OSDN Git Service

2266d51a399f61f3912424ecc43f7534f7424f29
[chemicraft/chemicraft.git] / src / chemicraft / client / ClientProxy.java
1 package chemicraft.client;
2
3 import net.minecraft.src.EntityPlayer;
4 import net.minecraft.src.TileEntity;
5 import net.minecraft.src.World;
6 import chemicraft.CommonProxy;
7 import chemicraft.GuiChemicalCraftingTable;
8 import chemicraft.TileEntityChemicalCraftingTable;
9 import cpw.mods.fml.client.FMLClientHandler;
10
11 public class ClientProxy extends CommonProxy {
12
13         @Override
14         public void registerRenderInformation() {
15         }
16
17         @Override
18         public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
19                 if (!world.blockExists(x, y, z))
20                         return null;
21
22                 TileEntity tileEntity = world.getBlockTileEntity(x, y, z);
23                 if (tileEntity instanceof TileEntityChemicalCraftingTable) {
24                         return new GuiChemicalCraftingTable(player, (TileEntityChemicalCraftingTable) tileEntity);
25                 }
26                 return null;
27         }
28
29         @Override
30         public World getClientWorld(){
31                 return FMLClientHandler.instance().getClient().theWorld;
32         }
33
34 }