diff options
Diffstat (limited to 'src/main/java/lance5057/tDefense/proxy')
| -rw-r--r-- | src/main/java/lance5057/tDefense/proxy/ClientProxy.java | 32 | ||||
| -rw-r--r-- | src/main/java/lance5057/tDefense/proxy/CommonProxy.java | 57 |
2 files changed, 64 insertions, 25 deletions
diff --git a/src/main/java/lance5057/tDefense/proxy/ClientProxy.java b/src/main/java/lance5057/tDefense/proxy/ClientProxy.java index 278bd83..800ba02 100644 --- a/src/main/java/lance5057/tDefense/proxy/ClientProxy.java +++ b/src/main/java/lance5057/tDefense/proxy/ClientProxy.java @@ -2,6 +2,8 @@ package lance5057.tDefense.proxy; import lance5057.tDefense.Reference; import lance5057.tDefense.TD_Commands; +import lance5057.tDefense.baubles.BaublesClientProxy; +import lance5057.tDefense.core.CoreClientProxy; import lance5057.tDefense.core.CoreItems; import lance5057.tDefense.core.tools.TDTools; import lance5057.tDefense.holiday.HolidayClientProxy; @@ -39,10 +41,15 @@ public class ClientProxy extends CommonProxy // public static ModelTinkersChausses chausses; // public static ModelTinkersBoots boots; + public static BaublesClientProxy baubles = new BaublesClientProxy();; + ToolBuildGuiInfo roundshieldGUI; ToolBuildGuiInfo heatershieldGUI; - HolidayClientProxy holiProxy = new HolidayClientProxy(); + ToolBuildGuiInfo zweihanderGUI; + + public static CoreClientProxy coreProxy = new CoreClientProxy(); + public static HolidayClientProxy holiProxy = new HolidayClientProxy(); @Override public void preInit() @@ -50,10 +57,12 @@ public class ClientProxy extends CommonProxy ClientCommandHandler.instance.registerCommand(new TD_Commands()); registerToolRenderers(); + coreProxy.preInit(); + baubles.preInit(); } @Override - public void Init() + public void init() { // Minecraft.getMinecraft().getRenderItem().getItemModelMesher() // .register(TDTools.heatershield, 0, new ModelResourceLocation("modid:itemname", "inventory")); @@ -67,14 +76,16 @@ public class ClientProxy extends CommonProxy registerItemRenderer(CoreItems.item_dogbeariumIngot, 0, CoreItems.item_dogbeariumIngot.getUnlocalizedName()); registerItemRenderer(CoreItems.item_queensgoldIngot, 0, CoreItems.item_queensgoldIngot.getUnlocalizedName()); + coreProxy.init(); holiProxy.Init(); + baubles.init(); } public void registerToolRenderers() { ModelRegisterUtil.registerToolModel(TDTools.roundshield); ModelRegisterUtil.registerToolModel(TDTools.heatershield); - + ModelRegisterUtil.registerToolModel(TDTools.zweihander); } @@ -82,6 +93,7 @@ public class ClientProxy extends CommonProxy { roundshieldGUI = new ToolBuildGuiInfo(TDTools.roundshield); heatershieldGUI = new ToolBuildGuiInfo(TDTools.heatershield); + zweihanderGUI = new ToolBuildGuiInfo(TDTools.zweihander); } public void setupToolGuis() @@ -94,18 +106,26 @@ public class ClientProxy extends CommonProxy heatershieldGUI.addSlotPosition(25, 33+8); heatershieldGUI.addSlotPosition(43, 33+8); heatershieldGUI.addSlotPosition(34, 51+8); + + zweihanderGUI.addSlotPosition(34, 15+8); + zweihanderGUI.addSlotPosition(25, 33+8); + zweihanderGUI.addSlotPosition(43, 33+8); + zweihanderGUI.addSlotPosition(34, 51+8); } public void registerToolGuis() { TinkerRegistryClient.addToolBuilding(roundshieldGUI); TinkerRegistryClient.addToolBuilding(heatershieldGUI); + TinkerRegistryClient.addToolBuilding(zweihanderGUI); } @Override public void reloadRenderers() { setToolGuis(); + + baubles.reloadRenderers(); } public void setToolGuis() @@ -120,6 +140,12 @@ public class ClientProxy extends CommonProxy heatershieldGUI.addSlotPosition(25, 33); heatershieldGUI.addSlotPosition(43, 33); heatershieldGUI.addSlotPosition(34, 51); + + zweihanderGUI.positions.clear(); + zweihanderGUI.addSlotPosition(34, 15); + zweihanderGUI.addSlotPosition(25, 33); + zweihanderGUI.addSlotPosition(43, 33); + zweihanderGUI.addSlotPosition(34, 51); } public static void registerItemRenderer(Item item, int meta, String id) { diff --git a/src/main/java/lance5057/tDefense/proxy/CommonProxy.java b/src/main/java/lance5057/tDefense/proxy/CommonProxy.java index a76da7b..8ae3d90 100644 --- a/src/main/java/lance5057/tDefense/proxy/CommonProxy.java +++ b/src/main/java/lance5057/tDefense/proxy/CommonProxy.java @@ -1,10 +1,17 @@ package lance5057.tDefense.proxy; -import lance5057.tDefense.TD_Commands; -import net.minecraftforge.client.ClientCommandHandler; +import lance5057.tDefense.TinkersDefense; +import lance5057.tDefense.core.blocks.crestMount.Container_CrestMount; +import lance5057.tDefense.core.blocks.crestMount.Gui_CrestMount; +import lance5057.tDefense.core.blocks.crestMount.TileEntity_CrestMount; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; +import net.minecraftforge.fml.common.network.IGuiHandler; +import net.minecraftforge.fml.common.network.NetworkRegistry; -public class CommonProxy// implements IGuiHandler +public class CommonProxy implements IGuiHandler { //public static ModifierSoulHandler SoulHandler = null; @@ -12,8 +19,9 @@ public class CommonProxy// implements IGuiHandler { } - public void Init() + public void init() { + NetworkRegistry.INSTANCE.registerGuiHandler(TinkersDefense.instance, this); } public void registerTileEntitySpecialRenderer() @@ -26,6 +34,11 @@ public class CommonProxy// implements IGuiHandler } + public void postInit() { + // TODO Auto-generated method stub + + } + // public EntityPlayer getPlayerEntity(MessageContext ctx) // { // return ctx.getServerHandler().playerEntity; @@ -41,28 +54,28 @@ public class CommonProxy// implements IGuiHandler // return null; // } // -// @Override -// public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) -// { -// if(ID == TinkersDefense.GUI_CREST_INV) -// return new Container_CrestMount(player.inventory, -// (TileEntity_CrestMount) world.getTileEntity(x, y, z)); + @Override + public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) + { + if(ID == TinkersDefense.GUI_CREST_INV) + return new Container_CrestMount(player.inventory, + (TileEntity_CrestMount) world.getTileEntity(new BlockPos(x, y, z))); // if(ID == TinkersDefense.GUI_ANVIL_INV) // return new Container_FinishingAnvil(player.inventory, // (TileEntity_FinishingAnvil) world.getTileEntity(x, y, z)); -// -// return null; -// } -// -// @Override -// public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) -// { -// if(ID == TinkersDefense.GUI_CREST_INV) -// return new Gui_CrestMount(player.inventory, -// (TileEntity_CrestMount) world.getTileEntity(x, y, z)); + + return null; + } + + @Override + public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) + { + if(ID == TinkersDefense.GUI_CREST_INV) + return new Gui_CrestMount(player.inventory, + (TileEntity_CrestMount) world.getTileEntity(new BlockPos(x, y, z))); // if(ID == TinkersDefense.GUI_ANVIL_INV) // return new Gui_FinishingAnvil(player.inventory, // (TileEntity_FinishingAnvil) world.getTileEntity(x, y, z)); -// return null; -// } + return null; + } } |
