1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
|
package jp.plusplus.fbs.container;
import jp.plusplus.fbs.container.inventory.InventoryBonfire;
import jp.plusplus.fbs.container.slot.SlotBonfire;
import jp.plusplus.fbs.container.slot.SlotInventory;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
/**
* Created by plusplus_F on 2015/10/19.
*/
public class ContainerBonfire extends Container {
public InventoryBonfire inventory;
public ContainerBonfire(int x, int y, int z, EntityPlayer player){
inventory=new InventoryBonfire(x,y,z,player);
inventory.openInventory();
addSlotToContainer(new SlotBonfire(inventory, 0, 80, 21, 0));
for(int i=0;i<3;i++){
addSlotToContainer(new SlotBonfire(inventory, i+1, 62+18*i, 43, 1));
}
//player's inv
for (int j = 0; j < 3; ++j) {
for (int k = 0; k < 9; ++k) {
this.addSlotToContainer(new SlotInventory(player.inventory, k + j * 9 + 9, 8 + k * 18, 84 + j * 18, 2));
}
}
for (int j = 0; j < 9; ++j) {
this.addSlotToContainer(new SlotInventory(player.inventory, j, 8 + j * 18, 142, 2));
}
}
@Override
public boolean canInteractWith(EntityPlayer p_75145_1_) {
return inventory.isUseableByPlayer(p_75145_1_);
}
@Override
public void onContainerClosed(EntityPlayer p_75134_1_) {
super.onContainerClosed(p_75134_1_);
this.inventory.closeInventory();
}
@Override
public ItemStack transferStackInSlot(EntityPlayer p_82846_1_, int p_82846_2_) {
ItemStack itemstack = null;
return itemstack;
}
}
|