OSDN Git Service

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