From 70c1354a4a96698758a88c032866288f79de6f5a Mon Sep 17 00:00:00 2001 From: Benjamin Culkin Date: Sat, 24 Aug 2024 08:16:37 -0400 Subject: Initial commit --- .../fbs/container/ContainerAlchemyCauldron.java | 68 ++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 src/main/java/jp/plusplus/fbs/container/ContainerAlchemyCauldron.java (limited to 'src/main/java/jp/plusplus/fbs/container/ContainerAlchemyCauldron.java') diff --git a/src/main/java/jp/plusplus/fbs/container/ContainerAlchemyCauldron.java b/src/main/java/jp/plusplus/fbs/container/ContainerAlchemyCauldron.java new file mode 100644 index 0000000..af7e083 --- /dev/null +++ b/src/main/java/jp/plusplus/fbs/container/ContainerAlchemyCauldron.java @@ -0,0 +1,68 @@ +package jp.plusplus.fbs.container; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import jp.plusplus.fbs.container.slot.SlotTakeOnlyWithMagicEXP; +import jp.plusplus.fbs.tileentity.TileEntityAlchemyCauldron; +import jp.plusplus.fbs.tileentity.TileEntityExtractingFurnace; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.Container; +import net.minecraft.inventory.ICrafting; +import net.minecraft.inventory.Slot; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidStack; + +/** + * Createdby pluslus_Fon 2015/06/08. + */ +public class ContainerAlchemyCauldron extends Container { + public TileEntityAlchemyCauldron entity; + public EntityPlayer player; + + public ContainerAlchemyCauldron(EntityPlayer player, TileEntityAlchemyCauldron tileEntity) { + this.entity = tileEntity; + this.player=player; + + //inventory's inventory + this.addSlotToContainer(new Slot(this.entity, 0, 26, 19)); + this.addSlotToContainer(new SlotTakeOnlyWithMagicEXP(player, this.entity, 1, 134, 39, 1)); + this.addSlotToContainer(new Slot(this.entity, 2, 8, 19)); + + //player inventory + for (int i = 0; i < 3; i++) { + for (int j = 0; j < 9; j++) { + this.addSlotToContainer(new Slot(player.inventory, j + i * 9 + 9, 8 + j * 18, 119 + i * 18)); + } + } + + //player slots + for (int i = 0; i < 9; i++) { + this.addSlotToContainer(new Slot(player.inventory, i, 8 + i * 18, 177)); + } + } + + @Override + public void addCraftingToCrafters(ICrafting par1ICrafting) { + super.addCraftingToCrafters(par1ICrafting); + } + @Override + public void detectAndSendChanges() { + super.detectAndSendChanges(); + } + + @Override + public boolean canInteractWith(EntityPlayer entityPlayer) { + return entity.isUseableByPlayer(entityPlayer); + } + + @Override + @SideOnly(Side.CLIENT) + public void updateProgressBar(int par1, int par2) {} + + @Override + public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int par2) { + ItemStack itemStack = null; + Slot slot = (Slot) this.inventorySlots.get(par2); + return itemStack; + } +} -- cgit v1.2.3