OSDN Git Service

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