Files
Chisel/src/main/java/com/cricketcraft/chisel/inventory/ContainerPresent.java
T

39 lines
963 B
Java
Raw Normal View History

2014-12-15 00:11:48 +00:00
package com.cricketcraft.chisel.inventory;
2014-11-26 20:03:54 -05:00
import net.minecraft.inventory.ContainerChest;
import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.Slot;
public class ContainerPresent extends ContainerChest {
private IInventory lower;
private int rows;
public ContainerPresent(IInventory player, IInventory chest) {
super(player, chest);
lower = chest;
rows = chest.getSizeInventory() / 9;
chest.openInventory();
int a = (rows - 4) * 18;
for (int d = 0; d < rows; d++) {
for (int e = 0; e < 9; e++) {
addSlotToContainer(new Slot(chest, e + d * 9, 8 + e * 18, 18 + d * 18));
}
}
for (int d = 0; d < 3; d++) {
for (int e = 0; e < 9; e++) {
addSlotToContainer(new Slot(player, e + d * 9 + 9, 8 + e * 18, 103 + d * 18 + a));
}
}
for (int d = 0; d < 9; d++) {
addSlotToContainer(new Slot(player, d, 8 + d * 18, 161 + a));
}
}
public IInventory getLowerPresentInventory() {
return lower;
}
2014-11-26 20:03:54 -05:00
}