OSDN Git Service

粉塵実装。デバッグよろしくお願いします
[chemicraft/chemicraft.git] / common / pcc / chemicraft / client / ClientProxy.java
1 package pcc.chemicraft.client;
2
3 import net.minecraft.client.particle.EffectRenderer;
4 import net.minecraft.client.particle.EntityFX;
5 import net.minecraft.entity.player.EntityPlayer;
6 import net.minecraft.tileentity.TileEntity;
7 import net.minecraft.world.World;
8 import net.minecraftforge.client.MinecraftForgeClient;
9 import pcc.chemicraft.ChemiCraft;
10 import pcc.chemicraft.container.ContainerElectrolysisTable;
11 import pcc.chemicraft.debug.DebugTick;
12 import pcc.chemicraft.entity.EntityAtomsGrenade;
13 import pcc.chemicraft.entity.EntityDust;
14 import pcc.chemicraft.gui.GuiChemicalCombinationTable;
15 import pcc.chemicraft.gui.GuiChemicalCraftingTable;
16 import pcc.chemicraft.gui.GuiElectrolysisTable;
17 import pcc.chemicraft.gui.GuiPyrolysisTable;
18 import pcc.chemicraft.gui.GuiToolAndWeaponCraftingTable;
19 import pcc.chemicraft.render.RenderAtomsGrenade;
20 import pcc.chemicraft.render.RenderDust;
21 import pcc.chemicraft.system.CommonProxy;
22 import pcc.chemicraft.tileentity.TileEntityChemicalCombinationTable;
23 import pcc.chemicraft.tileentity.TileEntityChemicalCraftingTable;
24 import pcc.chemicraft.tileentity.TileEntityElectrolysisTable;
25 import pcc.chemicraft.tileentity.TileEntityPyrolysisTable;
26 import pcc.chemicraft.tileentity.TileEntityToolAndWeaponCraftingTable;
27 import cpw.mods.fml.client.FMLClientHandler;
28 import cpw.mods.fml.client.registry.RenderingRegistry;
29 import cpw.mods.fml.common.registry.EntityRegistry;
30 import cpw.mods.fml.common.registry.EntityRegistry.EntityRegistration;
31 import cpw.mods.fml.common.registry.TickRegistry;
32 import cpw.mods.fml.relauncher.Side;
33
34 public class ClientProxy extends CommonProxy {
35
36         @Override
37         public void registerRenderInformation() {
38                 MinecraftForgeClient.preloadTexture(ChemiCraft.instance.BLOCK_CHEMICAL_CRAFTING_TABLE_TEXTURE);
39                 MinecraftForgeClient.preloadTexture(ChemiCraft.instance.BLOCK_ATOMS_ORE_TEXTURE);
40                 MinecraftForgeClient.preloadTexture(ChemiCraft.instance.ITEM_ATOMS_TEXTURE);
41                 MinecraftForgeClient.preloadTexture(ChemiCraft.instance.ITEM_COMPOUNDS_TEXTURE);
42                 MinecraftForgeClient.preloadTexture(ChemiCraft.instance.ITEM_TEXTURE);
43                 MinecraftForgeClient.preloadTexture(ChemiCraft.instance.GUI_PYROLYSIS_TEXTURE);
44                 MinecraftForgeClient.preloadTexture(ChemiCraft.instance.GUI_ELECTROLYSIS_TEXTURE);
45                 MinecraftForgeClient.preloadTexture(ChemiCraft.instance.GUI_CHEMICALCOMBINATION_TEXTURE);
46                 MinecraftForgeClient.preloadTexture(ChemiCraft.instance.GUI_CHEMICALCRAFTING_TEXTURE);
47                 MinecraftForgeClient.preloadTexture(ChemiCraft.instance.GUI_TOOLANDWEAPONCRAFTING_TEXTURE);
48                 MinecraftForgeClient.preloadTexture(ChemiCraft.instance.ENTITY_PARTICLE_TEXRURE);
49                 RenderingRegistry.registerEntityRenderingHandler(EntityAtomsGrenade.class, new RenderAtomsGrenade(0.5F));
50                 RenderingRegistry.registerEntityRenderingHandler(EntityDust.class, new RenderDust());
51         }
52
53
54         @Override
55         public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
56                 if (!world.blockExists(x, y, z))
57                         return null;
58
59                 TileEntity tileEntity = world.getBlockTileEntity(x, y, z);
60                 if (tileEntity instanceof TileEntityPyrolysisTable) {
61                         return new GuiPyrolysisTable(player, (TileEntityPyrolysisTable) tileEntity);
62                 }else if(tileEntity instanceof TileEntityElectrolysisTable){
63                         return new GuiElectrolysisTable(player, (TileEntityElectrolysisTable) tileEntity);
64                 }else if(tileEntity instanceof TileEntityChemicalCombinationTable){
65                         return new GuiChemicalCombinationTable(player, (TileEntityChemicalCombinationTable) tileEntity);
66                 }else if(tileEntity instanceof TileEntityToolAndWeaponCraftingTable){
67                         return new GuiToolAndWeaponCraftingTable(player, (TileEntityToolAndWeaponCraftingTable) tileEntity);
68                 }else if(tileEntity instanceof TileEntityChemicalCraftingTable){
69                         return new GuiChemicalCraftingTable(player, (TileEntityChemicalCraftingTable) tileEntity);
70                 } else if (tileEntity instanceof TileEntityElectrolysisTable) {
71                         return new ContainerElectrolysisTable(player, (TileEntityElectrolysisTable) tileEntity);
72                 }
73                 return null;
74         }
75
76
77         @Override
78         public World getClientWorld() {
79                 return FMLClientHandler.instance().getClient().theWorld;
80         }
81
82         @Override
83         public void registerTickHandler() {
84                 TickRegistry.registerTickHandler(new DebugTick(), Side.CLIENT);
85         }
86
87 }