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         /**
14          * Worldのインスタンス
15          */
16         private World worldObj;
17
18
19         /**
20          * BlockのX, Y, Z座標
21          */
22         private int posX;
23         private int posY;
24         private int posZ;
25
26
27
28         public ContainerScienceCraftingTable(InventoryPlayer par1InventoryPlayer, TileEntityScienceCraftingTable par2)
29         {
30                 this.worldObj = par2.worldObj;
31                 this.posX = par2.xCoord;
32                 this.posY = par2.yCoord;
33                 this.posZ = par2.zCoord;
34         }
35
36
37
38         @Override
39         public void onCraftMatrixChanged(IInventory par1IInventory){}
40
41
42
43         @Override
44         public void onCraftGuiClosed(EntityPlayer par1EntityPlayer){
45                 super.onCraftGuiClosed(par1EntityPlayer);
46         }
47
48
49
50         @Override
51         public boolean canInteractWith(EntityPlayer par1EntityPlayer){
52                 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;
53         }
54
55
56
57         @Override
58         public ItemStack transferStackInSlot(int par1){
59                 return null;
60         }
61
62 }