OSDN Git Service

b46340d8aa942221f2c62f2882817b434035996e
[chemicraft/chemicraft.git] / common / chemicraft / container / ContainerDecompositionTable.java
1 package chemicraft.container;
2
3 import net.minecraft.entity.player.EntityPlayer;
4 import net.minecraft.inventory.Container;
5 import net.minecraft.world.World;
6 import chemicraft.ChemiCraft;
7 import chemicraft.tileentity.TileEntityDecompositionTable;
8
9 public class ContainerDecompositionTable extends Container {
10
11         private World worldObj;
12
13         private int posX;
14         private int posY;
15         private int posZ;
16
17         public ContainerDecompositionTable(EntityPlayer par1EntityPlayer, TileEntityDecompositionTable par2){
18                 super();
19                 this.worldObj = par2.worldObj;
20                 this.posX = par2.xCoord;
21                 this.posY = par2.yCoord;
22                 this.posZ = par2.zCoord;
23         }
24
25         @Override
26         public boolean canInteractWith(EntityPlayer par1EntityPlayer) {
27                 return this.worldObj.getBlockId(this.posX, this.posY, this.posZ) != ChemiCraft.instance.decompositionTableID ? false : par1EntityPlayer.getDistanceSq((double)this.posX + 0.5D, (double)this.posY + 0.5D, (double)this.posZ + 0.5D) <= 64.0D;
28         }
29
30 }