OSDN Git Service

・mcmod.info修正
[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.client.renderer.texture.IconRegister;
6 import net.minecraft.entity.player.EntityPlayer;
7 import net.minecraft.tileentity.TileEntity;
8 import net.minecraft.util.Icon;
9 import net.minecraft.world.World;
10 import pcc.chemicraft.core.ChemiCraftCore;
11 import pcc.chemicraft.core.debug.DebugTick;
12 import pcc.chemicraft.core.tileentity.TileEntityPyrolysisTable;
13
14 public class BlockPyrolysisTable extends BlockContainer {
15
16         public Icon topIcon;
17         public Icon bottomIcon;
18         public Icon globalIcon;
19
20         public BlockPyrolysisTable(int par1, Material par2Material) {
21                 super(par1, par2Material);
22                 this.setCreativeTab(ChemiCraftCore.creativeTabChemiCraft);
23         }
24
25         @Override
26         public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9){
27                 par5EntityPlayer.openGui(ChemiCraftCore.instance, ChemiCraftCore.instance.guiPyrolysisTableID, par1World, par2, par3, par4);
28                 return true;
29         }
30
31
32
33         @Override
34         public void registerIcons(IconRegister par1IconRegister) {
35                 this.topIcon = par1IconRegister.registerIcon(ChemiCraftCore.CCTABLE + "PyrolysisTable");
36                 this.bottomIcon = par1IconRegister.registerIcon(ChemiCraftCore.CCTABLE + "Bottom");
37                 this.globalIcon = par1IconRegister.registerIcon(ChemiCraftCore.CCTABLE + "Side");
38         }
39
40
41
42         @Override
43         public void breakBlock(World par1World, int par2, int par3, int par4, int par5, int par6) {
44                 TileEntity tileentity = par1World.getBlockTileEntity(par2, par3, par4);
45                 if (tileentity != null) {
46                         DebugTick.removeDebugData("PyrolysisTable" +
47                                         "(x:" + tileentity.xCoord +
48                                         " y:" + tileentity.yCoord +
49                                         " z:" + tileentity.zCoord + ")");
50                 }
51                 super.breakBlock(par1World, par2, par3, par4, par5, par6);
52         }
53
54
55
56         @Override
57         public Icon getBlockTextureFromSideAndMetadata(int par1, int par2) {
58                 if(par1 == 0){
59                         return this.bottomIcon;
60                 }else if(par1 == 1){
61                         return this.topIcon;
62                 }else{
63                         return this.globalIcon;
64                 }
65         }
66
67         @Override
68         public TileEntity createNewTileEntity(World var1) {
69                 return new TileEntityPyrolysisTable();
70         }
71
72 }