OSDN Git Service

マージ用にコミット
[chemicraft/chemicraft.git] / common / pcc / chemicraft / system / CommonProxy.java
1 package pcc.chemicraft.system;
2
3 import net.minecraft.entity.player.EntityPlayer;
4 import net.minecraft.tileentity.TileEntity;
5 import net.minecraft.world.World;
6 import pcc.chemicraft.container.ContainerChemicalCombinationTable;
7 import pcc.chemicraft.container.ContainerChemicalCraftingTable;
8 import pcc.chemicraft.container.ContainerElectrolysisTable;
9 import pcc.chemicraft.container.ContainerPyrolysisTable;
10 import pcc.chemicraft.container.ContainerToolAndWeaponCraftingTable;
11 import pcc.chemicraft.debug.DebugTick;
12 import pcc.chemicraft.tileentity.TileEntityChemicalCombinationTable;
13 import pcc.chemicraft.tileentity.TileEntityChemicalCraftingTable;
14 import pcc.chemicraft.tileentity.TileEntityElectrolysisTable;
15 import pcc.chemicraft.tileentity.TileEntityPyrolysisTable;
16 import pcc.chemicraft.tileentity.TileEntityToolAndWeaponCraftingTable;
17 import cpw.mods.fml.common.network.IGuiHandler;
18 import cpw.mods.fml.common.registry.TickRegistry;
19 import cpw.mods.fml.relauncher.Side;
20
21 public class CommonProxy implements IGuiHandler {
22
23         public void registerTextures(){
24
25         }
26
27         public void registerRenderInformation() {
28         }
29
30
31         @Override
32         public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
33                 if (!world.blockExists(x, y, z))
34                         return null;
35
36                 TileEntity tileEntity = world.getBlockTileEntity(x, y, z);
37                 if (tileEntity instanceof TileEntityPyrolysisTable) {
38                         return new ContainerPyrolysisTable(player, (TileEntityPyrolysisTable) tileEntity);
39                 }else if(tileEntity instanceof TileEntityElectrolysisTable){
40                         return new ContainerElectrolysisTable(player, (TileEntityElectrolysisTable) tileEntity);
41                 }else if(tileEntity instanceof TileEntityChemicalCombinationTable){
42                         return new ContainerChemicalCombinationTable(player, (TileEntityChemicalCombinationTable) tileEntity);
43                 }else if(tileEntity instanceof TileEntityToolAndWeaponCraftingTable){
44                         return new ContainerToolAndWeaponCraftingTable(player, (TileEntityToolAndWeaponCraftingTable) tileEntity);
45                 }else if(tileEntity instanceof TileEntityChemicalCraftingTable){
46                         return new ContainerChemicalCraftingTable(player, (TileEntityChemicalCraftingTable) tileEntity);
47                 } else if (tileEntity instanceof TileEntityElectrolysisTable) {
48                         return new ContainerElectrolysisTable(player, (TileEntityElectrolysisTable) tileEntity);
49                 }
50                 return null;
51         }
52
53
54         @Override
55         public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
56                 return null;
57         }
58
59         public World getClientWorld(){
60                 return null;
61         }
62
63         public void registerTickHandler() {
64                 TickRegistry.registerTickHandler(new DebugTick(), Side.SERVER);
65         }
66
67 }