Files
CustomNPC-Plus/src/main/java/noppes/npcs/CommonProxy.java
T

182 lines
5.4 KiB
Java
Raw Normal View History

2018-09-13 12:03:28 -04:00
package noppes.npcs;
2023-01-12 21:33:06 -05:00
import cpw.mods.fml.common.network.IGuiHandler;
2018-09-13 12:03:28 -04:00
import net.minecraft.client.model.ModelBiped;
2025-01-22 18:54:00 -06:00
import net.minecraft.entity.Entity;
2018-09-13 12:03:28 -04:00
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.Container;
2022-01-12 04:44:08 -06:00
import net.minecraft.inventory.InventoryBasic;
2018-09-13 12:03:28 -04:00
import net.minecraft.item.Item;
2021-10-19 02:49:46 -05:00
import net.minecraft.stats.Achievement;
2018-09-13 12:03:28 -04:00
import net.minecraft.world.World;
import net.minecraftforge.common.util.FakePlayer;
2023-01-12 21:33:06 -05:00
import noppes.npcs.api.IWorld;
2018-09-13 12:03:28 -04:00
import noppes.npcs.blocks.tiles.TileNpcContainer;
import noppes.npcs.constants.EnumGuiType;
2022-01-12 04:44:08 -06:00
import noppes.npcs.containers.*;
2025-01-22 18:54:00 -06:00
import noppes.npcs.controllers.data.AnimationData;
import noppes.npcs.controllers.data.PlayerData;
2018-09-13 12:03:28 -04:00
import noppes.npcs.entity.EntityNPCInterface;
2024-08-22 16:47:07 -04:00
public class CommonProxy implements IGuiHandler {
2025-03-12 20:12:01 -04:00
public boolean newVersionAvailable = false;
public int revision = 1;
2024-08-22 16:47:07 -04:00
2025-03-12 20:12:01 -04:00
public void load() {
}
2018-09-13 12:03:28 -04:00
2025-03-12 20:12:01 -04:00
public PlayerData getPlayerData(EntityPlayer player) {
return null;
}
public AnimationData getClientAnimationData(Entity entity) {
return null;
}
2025-03-12 20:12:01 -04:00
@Override
public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
if (ID > EnumGuiType.values().length)
return null;
EntityNPCInterface npc = NoppesUtilServer.getEditingNpc(player);
EnumGuiType gui = EnumGuiType.values()[ID];
return getContainer(gui, player, x, y, z, npc);
}
2022-01-12 04:44:08 -06:00
2025-03-12 20:12:01 -04:00
public Container getContainer(EnumGuiType gui, EntityPlayer player, int x, int y, int z, EntityNPCInterface npc) {
if (gui == EnumGuiType.CustomGui)
return new ContainerCustomGui(new InventoryBasic("", false, x));
2018-09-13 12:03:28 -04:00
2025-03-12 20:12:01 -04:00
if (gui == EnumGuiType.MainMenuInv)
return new ContainerNPCInv(npc, player);
2021-10-19 02:49:46 -05:00
2025-03-12 20:12:01 -04:00
if (gui == EnumGuiType.PlayerBankSmall)
return new ContainerNPCBankSmall(player, x, y);
2018-09-13 12:03:28 -04:00
2025-03-12 20:12:01 -04:00
if (gui == EnumGuiType.PlayerBankUnlock)
return new ContainerNPCBankUnlock(player, x, y);
2021-10-19 02:49:46 -05:00
2025-03-12 20:12:01 -04:00
if (gui == EnumGuiType.PlayerBankUprade)
return new ContainerNPCBankUpgrade(player, x, y);
2018-09-13 12:03:28 -04:00
2025-03-12 20:12:01 -04:00
if (gui == EnumGuiType.PlayerBankLarge)
return new ContainerNPCBankLarge(player, x, y);
2021-10-19 02:49:46 -05:00
2025-03-12 20:12:01 -04:00
if (gui == EnumGuiType.PlayerFollowerHire)
return new ContainerNPCFollowerHire(npc, player);
2021-10-19 02:49:46 -05:00
2025-03-12 20:12:01 -04:00
if (gui == EnumGuiType.PlayerFollower)
return new ContainerNPCFollower(npc, player);
2018-09-13 12:03:28 -04:00
2025-03-12 20:12:01 -04:00
if (gui == EnumGuiType.PlayerTrader)
return new ContainerNPCTrader(npc, player);
2021-10-19 02:49:46 -05:00
2025-03-12 20:12:01 -04:00
if (gui == EnumGuiType.PlayerCarpentryBench)
return new ContainerCarpentryBench(player.inventory, player.worldObj, x, y, z);
if (gui == EnumGuiType.PlayerAnvil)
2025-02-09 20:49:45 -05:00
return new ContainerAnvilRepair(player.inventory, player.worldObj, x, y, z);
2025-03-12 20:12:01 -04:00
if (gui == EnumGuiType.SetupItemGiver)
return new ContainerNpcItemGiver(npc, player);
2021-10-19 02:49:46 -05:00
2025-03-12 20:12:01 -04:00
if (gui == EnumGuiType.SetupTrader)
return new ContainerNPCTraderSetup(npc, player);
2018-09-13 12:03:28 -04:00
2025-03-12 20:12:01 -04:00
if (gui == EnumGuiType.SetupFollower)
return new ContainerNPCFollowerSetup(npc, player);
2018-09-13 12:03:28 -04:00
2025-03-12 20:12:01 -04:00
if (gui == EnumGuiType.QuestReward)
return new ContainerNpcQuestReward(player);
2021-10-19 02:49:46 -05:00
2025-03-12 20:12:01 -04:00
if (gui == EnumGuiType.QuestItem)
return new ContainerNpcQuestTypeItem(player);
2021-10-19 02:49:46 -05:00
2025-03-12 20:12:01 -04:00
if (gui == EnumGuiType.ManageRecipes)
return new ContainerManageRecipes(player, x);
2018-09-13 12:03:28 -04:00
2025-03-12 20:12:01 -04:00
if (gui == EnumGuiType.ManageBanks)
return new ContainerManageBanks(player);
2018-09-13 12:03:28 -04:00
2025-03-12 20:12:01 -04:00
if (gui == EnumGuiType.MerchantAdd)
return new ContainerMerchantAdd(player, ServerEventsHandler.Merchant, player.worldObj);
2018-09-13 12:03:28 -04:00
2025-03-12 20:12:01 -04:00
if (gui == EnumGuiType.Crate)
return new ContainerCrate(player.inventory, (TileNpcContainer) player.worldObj.getTileEntity(x, y, z));
2021-10-19 02:49:46 -05:00
2025-03-12 20:12:01 -04:00
if (gui == EnumGuiType.PlayerMailman)
return new ContainerMail(player, x == 1, y == 1);
2021-10-19 02:49:46 -05:00
2025-03-12 20:12:01 -04:00
if (gui == EnumGuiType.CompanionInv)
return new ContainerNPCCompanion(npc, player);
2021-10-19 02:49:46 -05:00
2025-03-12 20:12:01 -04:00
return null;
}
2018-09-13 12:03:28 -04:00
2025-03-12 20:12:01 -04:00
@Override
public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
2025-02-10 14:58:45 -05:00
2025-03-12 20:12:01 -04:00
return null;
}
2018-09-13 12:03:28 -04:00
2025-03-12 20:12:01 -04:00
public void openGui(EntityNPCInterface npc, EnumGuiType gui) {
2025-02-10 14:58:45 -05:00
2025-03-12 20:12:01 -04:00
}
2018-09-13 12:03:28 -04:00
2025-03-12 20:12:01 -04:00
public void openGui(EntityNPCInterface npc, EnumGuiType gui, int x, int y, int z) {
2025-02-10 14:58:45 -05:00
2025-03-12 20:12:01 -04:00
}
2018-09-13 12:03:28 -04:00
2025-03-12 20:12:01 -04:00
public void openGui(int i, int j, int k, EnumGuiType gui, EntityPlayer player) {
2021-10-19 02:49:46 -05:00
2025-03-12 20:12:01 -04:00
}
2018-09-13 12:03:28 -04:00
2025-03-12 20:12:01 -04:00
public void openGui(EntityPlayer player, Object guiscreen) {
2025-02-10 14:58:45 -05:00
2021-10-19 02:49:46 -05:00
2025-03-12 20:12:01 -04:00
}
2018-09-13 12:03:28 -04:00
2025-03-12 20:12:01 -04:00
public void spawnParticle(EntityLivingBase player, String string, Object... ob) {
2025-02-10 14:58:45 -05:00
2021-10-19 02:49:46 -05:00
2025-03-12 20:12:01 -04:00
}
2018-09-13 12:03:28 -04:00
2025-03-12 20:12:01 -04:00
public FakePlayer getCommandPlayer(IWorld world) {
return null;
}
2025-03-12 20:12:01 -04:00
public boolean hasClient() {
return false;
}
2018-09-13 12:03:28 -04:00
2025-03-12 20:12:01 -04:00
public EntityPlayer getPlayer() {
return null;
}
2018-09-13 12:03:28 -04:00
2025-03-12 20:12:01 -04:00
public void registerItem(Item item) {
2025-02-10 14:58:45 -05:00
2021-10-19 02:49:46 -05:00
2025-03-12 20:12:01 -04:00
}
2018-09-13 12:03:28 -04:00
2025-03-12 20:12:01 -04:00
public ModelBiped getSkirtModel() {
return null;
}
2018-09-13 12:03:28 -04:00
2025-03-12 20:12:01 -04:00
public void spawnParticle(String particle, double x, double y, double z,
double motionX, double motionY, double motionZ, float scale) {
2021-10-19 02:49:46 -05:00
2025-03-12 20:12:01 -04:00
}
2018-09-13 12:03:28 -04:00
2025-03-12 20:12:01 -04:00
public void generateBigSmokeParticles(World world, int x, int y, int z, boolean signalFire) {
2025-01-29 18:25:34 -05:00
}
2025-01-26 16:48:53 -05:00
public String getAchievementDesc(Achievement achievement) {
2025-03-12 20:12:01 -04:00
return "";
}
2025-03-12 20:12:01 -04:00
public boolean isGUIOpen() {
return false;
}
2025-01-22 18:54:00 -06:00
}