OSDN Git Service

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