OSDN Git Service

誰かEntityAtomGrenadeを登録してくれ...
[chemicraft/chemicraft.git] / common / chemicraft / block / BlockChemicalCombinationTable.java
index 714f6e0..8769f9a 100644 (file)
@@ -1,22 +1,23 @@
 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 net.minecraft.src.EntityPlayer;
 import net.minecraft.src.Material;
 import net.minecraft.src.TileEntity;
 import net.minecraft.src.World;
 import net.minecraft.src.BlockContainer;
 import net.minecraft.src.EntityPlayer;
 import net.minecraft.src.Material;
 import net.minecraft.src.TileEntity;
 import net.minecraft.src.World;
-import chemicraft.ChemiCraft;
-import chemicraft.tileentity.TileEntityChemicalCombinationTable;
 
 public class BlockChemicalCombinationTable extends BlockContainer {
 
        public BlockChemicalCombinationTable(int par1, int par2, Material par3Material) {
                super(par1, par2, par3Material);
 
 public class BlockChemicalCombinationTable extends BlockContainer {
 
        public BlockChemicalCombinationTable(int par1, int par2, Material par3Material) {
                super(par1, par2, par3Material);
-               this.setCreativeTab(ChemiCraft.instance.creativeTab);
+               this.setCreativeTab(ChemiCraft.creativeTab);
        }
 
        @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){
@@ -42,7 +59,6 @@ public class BlockChemicalCombinationTable extends BlockContainer {
                }
        }
 
                }
        }
 
-
        @Override
        public TileEntity createNewTileEntity(World var1) {
                return new TileEntityChemicalCombinationTable();
        @Override
        public TileEntity createNewTileEntity(World var1) {
                return new TileEntityChemicalCombinationTable();