OSDN Git Service

誰かEntityAtomGrenadeを登録してくれ...
[chemicraft/chemicraft.git] / common / chemicraft / block / BlockChemicalCombinationTable.java
index bc0a05a..8769f9a 100644 (file)
@@ -1,5 +1,6 @@
 package chemicraft.block;
 
 package chemicraft.block;
 
+import cpw.mods.fml.common.network.PacketDispatcher;
 import chemicraft.ChemiCraft;
 import chemicraft.tileentity.TileEntityChemicalCombinationTable;
 import net.minecraft.src.BlockContainer;
 import chemicraft.ChemiCraft;
 import chemicraft.tileentity.TileEntityChemicalCombinationTable;
 import net.minecraft.src.BlockContainer;
@@ -16,7 +17,7 @@ public class BlockChemicalCombinationTable extends BlockContainer {
        }
 
        @Override
        }
 
        @Override
-       public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9){
+       public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) {
                par5EntityPlayer.openGui(ChemiCraft.instance, ChemiCraft.instance.guiChemicalCombinationTableID, par1World, par2, par3, par4);
                return true;
        }
                par5EntityPlayer.openGui(ChemiCraft.instance, ChemiCraft.instance.guiChemicalCombinationTableID, par1World, par2, par3, par4);
                return true;
        }
@@ -24,15 +25,31 @@ public class BlockChemicalCombinationTable extends BlockContainer {
 
 
        @Override
 
 
        @Override
-       public String getTextureFile(){
+       public String getTextureFile() {
                return ChemiCraft.instance.blockChemicalCraftingTableTexture;
        }
 
 
 
                return ChemiCraft.instance.blockChemicalCraftingTableTexture;
        }
 
 
 
+       public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5) {
+               if (!par1World.isRemote) {
+                       boolean var7 = par1World.isBlockIndirectlyGettingPowered(par2, par3, par4);
+                       if(var7) {
+                               TileEntityChemicalCombinationTable tileentity;
+                               try {
+                                       tileentity = (TileEntityChemicalCombinationTable) par1World.getBlockTileEntity(par2, par3, par4);
+                               } catch(ClassCastException e) {
+                                       return;
+                               }
+                               tileentity.setProvidePower(true);
+                       }
+               }
+       }
+
+
+
        @Override
        @Override
-       public int getBlockTextureFromSide(int par1)
-       {
+       public int getBlockTextureFromSide(int par1) {
                if(par1 == 0){
                        return 17;
                }else if(par1 == 1){
                if(par1 == 0){
                        return 17;
                }else if(par1 == 1){