2018-09-13 12:03:28 -04:00
|
|
|
package noppes.npcs;
|
|
|
|
|
|
|
|
|
|
import net.minecraft.client.model.ModelBiped;
|
|
|
|
|
import net.minecraft.entity.EntityLivingBase;
|
|
|
|
|
import net.minecraft.entity.player.EntityPlayer;
|
|
|
|
|
import net.minecraft.inventory.Container;
|
|
|
|
|
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 noppes.npcs.blocks.tiles.TileNpcContainer;
|
|
|
|
|
import noppes.npcs.constants.EnumGuiType;
|
|
|
|
|
import noppes.npcs.containers.ContainerCarpentryBench;
|
|
|
|
|
import noppes.npcs.containers.ContainerCrate;
|
|
|
|
|
import noppes.npcs.containers.ContainerMail;
|
|
|
|
|
import noppes.npcs.containers.ContainerManageBanks;
|
|
|
|
|
import noppes.npcs.containers.ContainerManageRecipes;
|
|
|
|
|
import noppes.npcs.containers.ContainerMerchantAdd;
|
|
|
|
|
import noppes.npcs.containers.ContainerNPCBankLarge;
|
|
|
|
|
import noppes.npcs.containers.ContainerNPCBankSmall;
|
|
|
|
|
import noppes.npcs.containers.ContainerNPCBankUnlock;
|
|
|
|
|
import noppes.npcs.containers.ContainerNPCBankUpgrade;
|
|
|
|
|
import noppes.npcs.containers.ContainerNPCCompanion;
|
|
|
|
|
import noppes.npcs.containers.ContainerNPCFollower;
|
|
|
|
|
import noppes.npcs.containers.ContainerNPCFollowerHire;
|
|
|
|
|
import noppes.npcs.containers.ContainerNPCFollowerSetup;
|
|
|
|
|
import noppes.npcs.containers.ContainerNPCInv;
|
|
|
|
|
import noppes.npcs.containers.ContainerNPCTrader;
|
|
|
|
|
import noppes.npcs.containers.ContainerNPCTraderSetup;
|
|
|
|
|
import noppes.npcs.containers.ContainerNpcItemGiver;
|
|
|
|
|
import noppes.npcs.containers.ContainerNpcQuestReward;
|
|
|
|
|
import noppes.npcs.containers.ContainerNpcQuestTypeItem;
|
2021-09-30 21:44:30 -05:00
|
|
|
import noppes.npcs.controllers.PlayerData;
|
2018-09-13 12:03:28 -04:00
|
|
|
import noppes.npcs.entity.EntityNPCInterface;
|
|
|
|
|
import cpw.mods.fml.common.network.IGuiHandler;
|
|
|
|
|
|
|
|
|
|
public class CommonProxy implements IGuiHandler {
|
2021-04-27 11:56:36 -04:00
|
|
|
|
2018-09-13 12:03:28 -04:00
|
|
|
public boolean newVersionAvailable = false;
|
2021-04-27 11:56:36 -04:00
|
|
|
public int revision = 1;
|
2018-09-13 12:03:28 -04:00
|
|
|
|
|
|
|
|
public void load() {
|
|
|
|
|
CustomNpcs.Channel.register(new PacketHandlerServer());
|
|
|
|
|
CustomNpcs.ChannelPlayer.register(new PacketHandlerPlayer());
|
|
|
|
|
}
|
|
|
|
|
|
2021-09-30 21:44:30 -05:00
|
|
|
public PlayerData getPlayerData(EntityPlayer player) {
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
|
2018-09-13 12:03:28 -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);
|
|
|
|
|
}
|
|
|
|
|
public Container getContainer(EnumGuiType gui,EntityPlayer player, int x, int y, int z,EntityNPCInterface npc){
|
|
|
|
|
if(gui == EnumGuiType.MainMenuInv)
|
|
|
|
|
return new ContainerNPCInv(npc, player);
|
|
|
|
|
|
|
|
|
|
if(gui == EnumGuiType.PlayerBankSmall)
|
|
|
|
|
return new ContainerNPCBankSmall(player, x , y);
|
2021-10-19 02:49:46 -05:00
|
|
|
|
2018-09-13 12:03:28 -04:00
|
|
|
if(gui == EnumGuiType.PlayerBankUnlock)
|
|
|
|
|
return new ContainerNPCBankUnlock(player, x , y);
|
|
|
|
|
|
|
|
|
|
if(gui == EnumGuiType.PlayerBankUprade)
|
|
|
|
|
return new ContainerNPCBankUpgrade(player, x , y);
|
2021-10-19 02:49:46 -05:00
|
|
|
|
2018-09-13 12:03:28 -04:00
|
|
|
if(gui == EnumGuiType.PlayerBankLarge)
|
|
|
|
|
return new ContainerNPCBankLarge(player, x , y);
|
|
|
|
|
|
|
|
|
|
if(gui == EnumGuiType.PlayerFollowerHire)
|
|
|
|
|
return new ContainerNPCFollowerHire(npc, player);
|
2021-10-19 02:49:46 -05:00
|
|
|
|
2018-09-13 12:03:28 -04:00
|
|
|
if(gui == EnumGuiType.PlayerFollower)
|
|
|
|
|
return new ContainerNPCFollower(npc, player);
|
2021-10-19 02:49:46 -05:00
|
|
|
|
2018-09-13 12:03:28 -04:00
|
|
|
if(gui == EnumGuiType.PlayerTrader)
|
|
|
|
|
return new ContainerNPCTrader(npc, player);
|
|
|
|
|
|
|
|
|
|
if(gui == EnumGuiType.PlayerAnvil)
|
|
|
|
|
return new ContainerCarpentryBench(player.inventory, player.worldObj, x, y, z);
|
2021-10-19 02:49:46 -05:00
|
|
|
|
2018-09-13 12:03:28 -04:00
|
|
|
if(gui == EnumGuiType.SetupItemGiver)
|
|
|
|
|
return new ContainerNpcItemGiver(npc, player);
|
2021-10-19 02:49:46 -05:00
|
|
|
|
2018-09-13 12:03:28 -04:00
|
|
|
if(gui == EnumGuiType.SetupTrader)
|
|
|
|
|
return new ContainerNPCTraderSetup(npc, player);
|
|
|
|
|
|
|
|
|
|
if(gui == EnumGuiType.SetupFollower)
|
|
|
|
|
return new ContainerNPCFollowerSetup(npc, player);
|
|
|
|
|
|
|
|
|
|
if(gui == EnumGuiType.QuestReward)
|
|
|
|
|
return new ContainerNpcQuestReward(player);
|
2021-10-19 02:49:46 -05:00
|
|
|
|
2018-09-13 12:03:28 -04:00
|
|
|
if(gui == EnumGuiType.QuestItem)
|
|
|
|
|
return new ContainerNpcQuestTypeItem(player);
|
2021-10-19 02:49:46 -05:00
|
|
|
|
2018-09-13 12:03:28 -04:00
|
|
|
if(gui == EnumGuiType.ManageRecipes)
|
|
|
|
|
return new ContainerManageRecipes(player,x);
|
|
|
|
|
|
|
|
|
|
if(gui == EnumGuiType.ManageBanks)
|
|
|
|
|
return new ContainerManageBanks(player);
|
|
|
|
|
|
|
|
|
|
if(gui == EnumGuiType.MerchantAdd)
|
|
|
|
|
return new ContainerMerchantAdd(player, ServerEventsHandler.Merchant, player.worldObj);
|
|
|
|
|
|
|
|
|
|
if(gui == EnumGuiType.Crate)
|
|
|
|
|
return new ContainerCrate(player.inventory, (TileNpcContainer)player.worldObj.getTileEntity(x, y, z));
|
2021-10-19 02:49:46 -05:00
|
|
|
|
2018-09-13 12:03:28 -04:00
|
|
|
if(gui == EnumGuiType.PlayerMailman)
|
|
|
|
|
return new ContainerMail(player, x == 1, y == 1);
|
2021-10-19 02:49:46 -05:00
|
|
|
|
2018-09-13 12:03:28 -04:00
|
|
|
if(gui == EnumGuiType.CompanionInv)
|
|
|
|
|
return new ContainerNPCCompanion(npc, player);
|
2021-10-19 02:49:46 -05:00
|
|
|
|
2018-09-13 12:03:28 -04:00
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
|
|
|
|
// TODO Auto-generated method stub
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void openGui(EntityNPCInterface npc, EnumGuiType gui) {
|
|
|
|
|
// TODO Auto-generated method stub
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void openGui(EntityNPCInterface npc, EnumGuiType gui, int x, int y, int z) {
|
|
|
|
|
// TODO Auto-generated method stub
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void openGui(int i, int j, int k, EnumGuiType gui, EntityPlayer player) {
|
2021-10-19 02:49:46 -05:00
|
|
|
|
2018-09-13 12:03:28 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void openGui(EntityPlayer player, Object guiscreen) {
|
|
|
|
|
// TODO Auto-generated method stub
|
2021-10-19 02:49:46 -05:00
|
|
|
|
2018-09-13 12:03:28 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void spawnParticle(EntityLivingBase player, String string, Object... ob) {
|
|
|
|
|
// TODO Auto-generated method stub
|
2021-10-19 02:49:46 -05:00
|
|
|
|
2018-09-13 12:03:28 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public boolean hasClient() {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public EntityPlayer getPlayer() {
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void registerItem(Item item) {
|
|
|
|
|
// TODO Auto-generated method stub
|
2021-10-19 02:49:46 -05:00
|
|
|
|
2018-09-13 12:03:28 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public ModelBiped getSkirtModel() {
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void spawnParticle(String particle, double x, double y, double z,
|
2021-10-19 02:49:46 -05:00
|
|
|
double motionX, double motionY, double motionZ, float scale) {
|
|
|
|
|
|
2018-09-13 12:03:28 -04:00
|
|
|
}
|
|
|
|
|
|
2021-10-19 02:49:46 -05:00
|
|
|
public String getAchievementDesc(Achievement achievement) {
|
|
|
|
|
return "";
|
|
|
|
|
}
|
|
|
|
|
}
|