Add in code to support the bukkit fun

This commit is contained in:
Christian Weeks 2012-04-15 18:30:49 -04:00
parent f12f8b1c31
commit 554d6c7005
2 changed files with 77 additions and 65 deletions

View File

@ -3,13 +3,18 @@ package cpw.mods.ironchest;
import net.minecraft.src.Container;
import net.minecraft.src.EntityPlayer;
import net.minecraft.src.IInventory;
import net.minecraft.src.InventoryPlayer;
import net.minecraft.src.ItemStack;
import net.minecraft.src.Slot;
public class ContainerIronChestBase extends Container {
private IronChestType type;
private EntityPlayer player;
private IInventory chest;
public ContainerIronChestBase(IInventory playerInventory, IInventory chestInventory, IronChestType type, int xSize, int ySize) {
chest = chestInventory;
player = ((InventoryPlayer) playerInventory).player;
this.type = type;
chestInventory.openChest();
layoutContainer(playerInventory, chestInventory, type, xSize, ySize);
@ -34,8 +39,7 @@ public class ContainerIronChestBase extends Container {
{
return null;
}
} else
if(!mergeItemStack(itemstack1, 0, type.size, false))
} else if (!mergeItemStack(itemstack1, 0, type.size, false))
{
return null;
}
@ -81,6 +85,11 @@ public class ContainerIronChestBase extends Container {
addSlot(new Slot(playerInventory, hotbarSlot, leftCol + hotbarSlot * 18, ySize - 24));
}
}
private IInventory chest;
public EntityPlayer getPlayer() {
return player;
}
public IInventory getInventory() {
return chest;
}
}

View File

@ -382,4 +382,7 @@ public class TileEntityIronChest extends TileEntity implements IInventory {
return null;
}
}
public void setMaxStackSize(int size) {
}
}