OSDN Git Service

誰かEntityAtomGrenadeを登録してくれ...
[chemicraft/chemicraft.git] / common / chemicraft / block / BlockChemicalCombinationTable.java
1 package chemicraft.block;
2
3 import cpw.mods.fml.common.network.PacketDispatcher;
4 import chemicraft.ChemiCraft;
5 import chemicraft.tileentity.TileEntityChemicalCombinationTable;
6 import net.minecraft.src.BlockContainer;
7 import net.minecraft.src.EntityPlayer;
8 import net.minecraft.src.Material;
9 import net.minecraft.src.TileEntity;
10 import net.minecraft.src.World;
11
12 public class BlockChemicalCombinationTable extends BlockContainer {
13
14         public BlockChemicalCombinationTable(int par1, int par2, Material par3Material) {
15                 super(par1, par2, par3Material);
16                 this.setCreativeTab(ChemiCraft.creativeTab);
17         }
18
19         @Override
20         public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) {
21                 par5EntityPlayer.openGui(ChemiCraft.instance, ChemiCraft.instance.guiChemicalCombinationTableID, par1World, par2, par3, par4);
22                 return true;
23         }
24
25
26
27         @Override
28         public String getTextureFile() {
29                 return ChemiCraft.instance.blockChemicalCraftingTableTexture;
30         }
31
32
33
34         public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5) {
35                 if (!par1World.isRemote) {
36                         boolean var7 = par1World.isBlockIndirectlyGettingPowered(par2, par3, par4);
37                         if(var7) {
38                                 TileEntityChemicalCombinationTable tileentity;
39                                 try {
40                                         tileentity = (TileEntityChemicalCombinationTable) par1World.getBlockTileEntity(par2, par3, par4);
41                                 } catch(ClassCastException e) {
42                                         return;
43                                 }
44                                 tileentity.setProvidePower(true);
45                         }
46                 }
47         }
48
49
50
51         @Override
52         public int getBlockTextureFromSide(int par1) {
53                 if(par1 == 0){
54                         return 17;
55                 }else if(par1 == 1){
56                         return 1;
57                 }else{
58                         return 16;
59                 }
60         }
61
62         @Override
63         public TileEntity createNewTileEntity(World var1) {
64                 return new TileEntityChemicalCombinationTable();
65         }
66
67 }