Add in code to support the bukkit fun
This commit is contained in:
parent
f12f8b1c31
commit
554d6c7005
|
@ -3,13 +3,18 @@ package cpw.mods.ironchest;
|
||||||
import net.minecraft.src.Container;
|
import net.minecraft.src.Container;
|
||||||
import net.minecraft.src.EntityPlayer;
|
import net.minecraft.src.EntityPlayer;
|
||||||
import net.minecraft.src.IInventory;
|
import net.minecraft.src.IInventory;
|
||||||
|
import net.minecraft.src.InventoryPlayer;
|
||||||
import net.minecraft.src.ItemStack;
|
import net.minecraft.src.ItemStack;
|
||||||
import net.minecraft.src.Slot;
|
import net.minecraft.src.Slot;
|
||||||
|
|
||||||
public class ContainerIronChestBase extends Container {
|
public class ContainerIronChestBase extends Container {
|
||||||
private IronChestType type;
|
private IronChestType type;
|
||||||
|
private EntityPlayer player;
|
||||||
|
private IInventory chest;
|
||||||
|
|
||||||
public ContainerIronChestBase(IInventory playerInventory, IInventory chestInventory, IronChestType type, int xSize, int ySize) {
|
public ContainerIronChestBase(IInventory playerInventory, IInventory chestInventory, IronChestType type, int xSize, int ySize) {
|
||||||
chest = chestInventory;
|
chest = chestInventory;
|
||||||
|
player = ((InventoryPlayer) playerInventory).player;
|
||||||
this.type = type;
|
this.type = type;
|
||||||
chestInventory.openChest();
|
chestInventory.openChest();
|
||||||
layoutContainer(playerInventory, chestInventory, type, xSize, ySize);
|
layoutContainer(playerInventory, chestInventory, type, xSize, ySize);
|
||||||
|
@ -34,8 +39,7 @@ public class ContainerIronChestBase extends Container {
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
} else
|
} else if (!mergeItemStack(itemstack1, 0, type.size, false))
|
||||||
if(!mergeItemStack(itemstack1, 0, type.size, false))
|
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
@ -81,6 +85,11 @@ public class ContainerIronChestBase extends Container {
|
||||||
addSlot(new Slot(playerInventory, hotbarSlot, leftCol + hotbarSlot * 18, ySize - 24));
|
addSlot(new Slot(playerInventory, hotbarSlot, leftCol + hotbarSlot * 18, ySize - 24));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
public EntityPlayer getPlayer() {
|
||||||
private IInventory chest;
|
return player;
|
||||||
|
}
|
||||||
|
|
||||||
|
public IInventory getInventory() {
|
||||||
|
return chest;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -382,4 +382,7 @@ public class TileEntityIronChest extends TileEntity implements IInventory {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
public void setMaxStackSize(int size) {
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue