OSDN Git Service

・mcmod.info修正
[chemicraft/chemicraft.git] / common / pcc / chemicraft / core / block / BlockChemicalCraftingTable.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.tileentity.TileEntityChemicalCraftingTable;
12
13 public class BlockChemicalCraftingTable extends BlockContainer {
14
15         public Icon topIcon;
16         public Icon bottomIcon;
17         public Icon globalIcon;
18
19         public BlockChemicalCraftingTable(int par1, Material par2Material) {
20                 super(par1, par2Material);
21                 this.setCreativeTab(ChemiCraftCore.creativeTabChemiCraft);
22         }
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.guiChemicalCraftingTableID, 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 + "ChemicalCraftingTable");
36                 this.bottomIcon = par1IconRegister.registerIcon(ChemiCraftCore.CCTABLE + "Bottom");
37                 this.globalIcon = par1IconRegister.registerIcon(ChemiCraftCore.CCTABLE + "Side");
38         }
39
40
41
42         @Override
43         public Icon getBlockTextureFromSideAndMetadata(int par1, int par2) {
44                 if(par1 == 0){
45                         return this.bottomIcon;
46                 }else if(par1 == 1){
47                         return this.topIcon;
48                 }else{
49                         return this.globalIcon;
50                 }
51         }
52
53
54
55         @Override
56         public TileEntity createNewTileEntity(World var1) {
57                 return new TileEntityChemicalCraftingTable();
58         }
59
60 }