OSDN Git Service

いろいろした
[chemicraft/chemicraft.git] / common / pcc / chemicraft / core / block / BlockPyrolysisTable.java
1 package pcc.chemicraft.core.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 pcc.chemicraft.ChemiCraft;
9 import pcc.chemicraft.core.ChemiCraftCore;
10 import pcc.chemicraft.core.debug.DebugTick;
11 import pcc.chemicraft.core.tileentity.TileEntityPyrolysisTable;
12
13 public class BlockPyrolysisTable extends BlockContainer {
14
15         public BlockPyrolysisTable(int par1, int par2, Material par3Material) {
16                 super(par1, par2, par3Material);
17                 this.setCreativeTab(ChemiCraftCore.creativeTabChemiCraft);
18         }
19
20         @Override
21         public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9){
22                 par5EntityPlayer.openGui(ChemiCraftCore.instance, ChemiCraftCore.instance.guiPyrolysisTableID, par1World, par2, par3, par4);
23                 return true;
24         }
25
26
27
28         @Override
29         public String getTextureFile(){
30                 return ChemiCraft.BLOCK_CHEMICAL_CRAFTING_TABLE_TEXTURE;
31         }
32
33
34
35         @Override
36         public void breakBlock(World par1World, int par2, int par3, int par4, int par5, int par6) {
37                 TileEntity tileentity = par1World.getBlockTileEntity(par2, par3, par4);
38                 if (tileentity != null) {
39                         DebugTick.removeDebugData("PyrolysisTable" +
40                                         "(x:" + tileentity.xCoord +
41                                         " y:" + tileentity.yCoord +
42                                         " z:" + tileentity.zCoord + ")");
43                 }
44                 super.breakBlock(par1World, par2, par3, par4, par5, par6);
45         }
46
47
48
49         @Override
50         public int getBlockTextureFromSide(int par1)
51         {
52                 if(par1 == 0){
53                         return 17;
54                 }else if(par1 == 1){
55                         return this.blockIndexInTexture;
56                 }else{
57                         return 16;
58                 }
59         }
60
61         @Override
62         public TileEntity createNewTileEntity(World var1) {
63                 return new TileEntityPyrolysisTable();
64         }
65
66 }