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