OSDN Git Service

とりあえずコミット
[chemicraft/chemicraft.git] / common / chemicraft / ContainerScienceCraftingTable.java
1 package chemicraft;
2
3 import net.minecraft.src.Container;
4 import net.minecraft.src.EntityPlayer;
5 import net.minecraft.src.IInventory;
6 import net.minecraft.src.InventoryPlayer;
7 import net.minecraft.src.ItemStack;
8 import net.minecraft.src.Slot;
9 import net.minecraft.src.World;
10
11 public class ContainerScienceCraftingTable extends Container
12 {
13     private World worldObj;
14     private int posX;
15     private int posY;
16     private int posZ;
17
18     public ContainerScienceCraftingTable(InventoryPlayer par1InventoryPlayer, TileEntityScienceCraftingTable par2)
19     {
20         this.worldObj = par2.worldObj;
21         this.posX = par2.xCoord;
22         this.posY = par2.yCoord;
23         this.posZ = par2.zCoord;
24         this.addSlotToContainer(new Slot(par2, 0, 10, 10));
25     }
26
27     /**
28      * Callback for when the crafting matrix is changed.
29      */
30     public void onCraftMatrixChanged(IInventory par1IInventory)
31     {
32     }
33
34     /**
35      * Callback for when the crafting gui is closed.
36      */
37     public void onCraftGuiClosed(EntityPlayer par1EntityPlayer)
38     {
39         super.onCraftGuiClosed(par1EntityPlayer);
40     }
41
42     public boolean canInteractWith(EntityPlayer par1EntityPlayer)
43     {
44         return this.worldObj.getBlockId(this.posX, this.posY, this.posZ) != ChemiCraft.instance.scienceCraftingTableID ? false : par1EntityPlayer.getDistanceSq((double)this.posX + 0.5D, (double)this.posY + 0.5D, (double)this.posZ + 0.5D) <= 64.0D;
45     }
46
47     /**
48      * Called to transfer a stack from one inventory to the other eg. when shift clicking.
49      */
50     public ItemStack transferStackInSlot(int par1)
51     {
52         return null;
53     }
54 }