From 5ed33dfa4f504194f2ed53891930bc3f3f05d53f Mon Sep 17 00:00:00 2001 From: Ryan Nasers <42074409+Cardinalstars@users.noreply.github.com> Date: Sun, 29 Oct 2023 15:20:52 -0500 Subject: [PATCH] Adding mushroom bag and minor refactor (#33) * Refactors flower bag into a generic bag * Adds a mushroom bag --- .../client/gui/bag/ContainerFlowerBag.java | 99 ----------- .../botania/client/gui/bag/GuiFlowerBag.java | 74 -------- .../client/gui/bag/InventoryFlowerBag.java | 160 ------------------ .../botania/client/gui/bag/SlotFlower.java | 39 ----- .../gui/bags/ContainerMagicPlantBag.java | 89 ++++++++++ .../client/gui/bags/GuiMagicPlantBag.java | 65 +++++++ .../gui/bags/InventoryMagicPlantBag.java | 148 ++++++++++++++++ .../client/gui/bags/SlotMagicPlant.java | 32 ++++ .../bags/flowerBag/ContainerFlowerBag.java | 23 +++ .../gui/bags/flowerBag/GuiFlowerBag.java | 27 +++ .../bags/flowerBag/InventoryFlowerBag.java | 23 +++ .../client/gui/bags/flowerBag/SlotFlower.java | 18 ++ .../bags/shroomBag/ContainerShroomBag.java | 23 +++ .../gui/bags/shroomBag/GuiShroomBag.java | 27 +++ .../bags/shroomBag/InventoryShroomBag.java | 23 +++ .../client/gui/bags/shroomBag/SlotShroom.java | 18 ++ .../botania/client/lib/LibResources.java | 1 + .../common/crafting/ModCraftingRecipes.java | 8 + .../botania/common/item/ItemFlowerBag.java | 159 ----------------- .../vazkii/botania/common/item/ModItems.java | 4 + .../botania/common/item/bag/ItemBagBase.java | 154 +++++++++++++++++ .../common/item/bag/ItemFlowerBag.java | 23 +++ .../common/item/bag/ItemShroomBag.java | 23 +++ .../botania/common/lexicon/LexiconData.java | 5 + .../vazkii/botania/common/lib/LibGuiIDs.java | 2 + .../botania/common/lib/LibItemNames.java | 1 + .../vazkii/botania/common/lib/LibLexicon.java | 1 + .../botania/common/network/GuiHandler.java | 10 +- .../resources/assets/botania/lang/en_US.lang | 7 + .../assets/botania/textures/gui/flowerBag.png | Bin 18629 -> 3123 bytes .../assets/botania/textures/gui/shroomBag.png | Bin 0 -> 3120 bytes .../botania/textures/items/shroomBag.png | Bin 0 -> 506 bytes 32 files changed, 753 insertions(+), 533 deletions(-) delete mode 100644 src/main/java/vazkii/botania/client/gui/bag/ContainerFlowerBag.java delete mode 100644 src/main/java/vazkii/botania/client/gui/bag/GuiFlowerBag.java delete mode 100644 src/main/java/vazkii/botania/client/gui/bag/InventoryFlowerBag.java delete mode 100644 src/main/java/vazkii/botania/client/gui/bag/SlotFlower.java create mode 100644 src/main/java/vazkii/botania/client/gui/bags/ContainerMagicPlantBag.java create mode 100644 src/main/java/vazkii/botania/client/gui/bags/GuiMagicPlantBag.java create mode 100644 src/main/java/vazkii/botania/client/gui/bags/InventoryMagicPlantBag.java create mode 100644 src/main/java/vazkii/botania/client/gui/bags/SlotMagicPlant.java create mode 100644 src/main/java/vazkii/botania/client/gui/bags/flowerBag/ContainerFlowerBag.java create mode 100644 src/main/java/vazkii/botania/client/gui/bags/flowerBag/GuiFlowerBag.java create mode 100644 src/main/java/vazkii/botania/client/gui/bags/flowerBag/InventoryFlowerBag.java create mode 100644 src/main/java/vazkii/botania/client/gui/bags/flowerBag/SlotFlower.java create mode 100644 src/main/java/vazkii/botania/client/gui/bags/shroomBag/ContainerShroomBag.java create mode 100644 src/main/java/vazkii/botania/client/gui/bags/shroomBag/GuiShroomBag.java create mode 100644 src/main/java/vazkii/botania/client/gui/bags/shroomBag/InventoryShroomBag.java create mode 100644 src/main/java/vazkii/botania/client/gui/bags/shroomBag/SlotShroom.java delete mode 100644 src/main/java/vazkii/botania/common/item/ItemFlowerBag.java create mode 100644 src/main/java/vazkii/botania/common/item/bag/ItemBagBase.java create mode 100644 src/main/java/vazkii/botania/common/item/bag/ItemFlowerBag.java create mode 100644 src/main/java/vazkii/botania/common/item/bag/ItemShroomBag.java create mode 100644 src/main/resources/assets/botania/textures/gui/shroomBag.png create mode 100644 src/main/resources/assets/botania/textures/items/shroomBag.png diff --git a/src/main/java/vazkii/botania/client/gui/bag/ContainerFlowerBag.java b/src/main/java/vazkii/botania/client/gui/bag/ContainerFlowerBag.java deleted file mode 100644 index 5160afa2a..000000000 --- a/src/main/java/vazkii/botania/client/gui/bag/ContainerFlowerBag.java +++ /dev/null @@ -1,99 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Mar 16, 2015, 6:42:40 PM (GMT)] - */ -package vazkii.botania.client.gui.bag; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.Container; -import net.minecraft.inventory.IInventory; -import net.minecraft.inventory.Slot; -import net.minecraft.item.ItemStack; -import vazkii.botania.client.gui.SlotLocked; - -public class ContainerFlowerBag extends Container { - - InventoryFlowerBag flowerBagInv; - - public ContainerFlowerBag(EntityPlayer player) { - int i; - int j; - - int slot = player.inventory.currentItem; - IInventory playerInv = player.inventory; - flowerBagInv = new InventoryFlowerBag(player, slot); - - for(i = 0; i < 2; ++i) - for(j = 0; j < 8; ++j) { - int k = j + i * 8; - addSlotToContainer(new SlotFlower(flowerBagInv, k, 17 + j * 18, 26 + i * 18, k)); - } - - for(i = 0; i < 3; ++i) - for(j = 0; j < 9; ++j) - addSlotToContainer(new Slot(playerInv, j + i * 9 + 9, 8 + j * 18, 84 + i * 18)); - - for(i = 0; i < 9; ++i) { - if(player.inventory.currentItem == i) - addSlotToContainer(new SlotLocked(playerInv, i, 8 + i * 18, 142)); - else addSlotToContainer(new Slot(playerInv, i, 8 + i * 18, 142)); - } - - } - - @Override - public boolean canInteractWith(EntityPlayer player) { - boolean can = flowerBagInv.isUseableByPlayer(player); - if(!can) - onContainerClosed(player); - - return can; - } - - @Override - public void onContainerClosed(EntityPlayer player) { - super.onContainerClosed(player); - flowerBagInv.pushInventory(); - } - - @Override - public ItemStack transferStackInSlot(EntityPlayer p_82846_1_, int p_82846_2_) { - ItemStack itemstack = null; - Slot slot = (Slot)inventorySlots.get(p_82846_2_); - - if(slot != null && slot.getHasStack()) { - ItemStack itemstack1 = slot.getStack(); - itemstack = itemstack1.copy(); - - if(p_82846_2_ < 16) { - if(!mergeItemStack(itemstack1, 16, 52, true)) - return null; - } else { - int i = itemstack.getItemDamage(); - if(i < 16) { - Slot slot1 = (Slot)inventorySlots.get(i); - if(slot1.isItemValid(itemstack) && !mergeItemStack(itemstack1, i, i + 1, true)) - return null; - } - } - - if(itemstack1.stackSize == 0) - slot.putStack((ItemStack)null); - else slot.onSlotChanged(); - - if(itemstack1.stackSize == itemstack.stackSize) - return null; - - slot.onPickupFromSlot(p_82846_1_, itemstack1); - } - - return itemstack; - } - -} diff --git a/src/main/java/vazkii/botania/client/gui/bag/GuiFlowerBag.java b/src/main/java/vazkii/botania/client/gui/bag/GuiFlowerBag.java deleted file mode 100644 index b3cee8997..000000000 --- a/src/main/java/vazkii/botania/client/gui/bag/GuiFlowerBag.java +++ /dev/null @@ -1,74 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Mar 16, 2015, 6:42:43 PM (GMT)] - */ -package vazkii.botania.client.gui.bag; - -import java.util.List; - -import net.minecraft.client.gui.inventory.GuiContainer; -import net.minecraft.client.renderer.RenderHelper; -import net.minecraft.client.renderer.entity.RenderItem; -import net.minecraft.client.resources.I18n; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.Slot; -import net.minecraft.item.ItemStack; -import net.minecraft.util.ResourceLocation; -import net.minecraft.util.StatCollector; - -import org.lwjgl.opengl.GL11; - -import vazkii.botania.client.lib.LibResources; -import vazkii.botania.common.block.ModBlocks; - -public class GuiFlowerBag extends GuiContainer { - - private static final ResourceLocation texture = new ResourceLocation(LibResources.GUI_FLOWER_BAG); - - public GuiFlowerBag(EntityPlayer player) { - super(new ContainerFlowerBag(player)); - } - - @Override - protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) { - String s = StatCollector.translateToLocal("item.botania:flowerBag.name"); - fontRendererObj.drawString(s, xSize / 2 - fontRendererObj.getStringWidth(s) / 2, 6, 4210752); - fontRendererObj.drawString(I18n.format("container.inventory", new Object[0]), 8, ySize - 96 + 2, 4210752); - } - - @Override - protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) { - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - mc.getTextureManager().bindTexture(texture); - int k = (width - xSize) / 2; - int l = (height - ySize) / 2; - drawTexturedModalRect(k, l, 0, 0, xSize, ySize); - - List slotList = inventorySlots.inventorySlots; - for(Slot slot : slotList) - if(slot instanceof SlotFlower) { - SlotFlower slotf = (SlotFlower) slot; - if(!slotf.getHasStack()) { - ItemStack stack = new ItemStack(ModBlocks.flower, 0, slotf.color); - int x = guiLeft + slotf.xDisplayPosition; - int y = guiTop + slotf.yDisplayPosition; - RenderHelper.enableGUIStandardItemLighting(); - RenderItem.getInstance().renderItemIntoGUI(mc.fontRenderer, mc.renderEngine, stack, x, y); - RenderHelper.disableStandardItemLighting(); - mc.fontRenderer.drawStringWithShadow("0", x + 11, y + 9, 0xFF6666); - } - } - } - - @Override - protected boolean checkHotbarKeys(int p_146983_1_) { - return false; - } - -} diff --git a/src/main/java/vazkii/botania/client/gui/bag/InventoryFlowerBag.java b/src/main/java/vazkii/botania/client/gui/bag/InventoryFlowerBag.java deleted file mode 100644 index 10fcb06f9..000000000 --- a/src/main/java/vazkii/botania/client/gui/bag/InventoryFlowerBag.java +++ /dev/null @@ -1,160 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Mar 16, 2015, 6:42:56 PM (GMT)] - */ -package vazkii.botania.client.gui.bag; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.IInventory; -import net.minecraft.item.ItemStack; -import vazkii.botania.common.item.ItemFlowerBag; -import vazkii.botania.common.item.ModItems; -import vazkii.botania.common.lib.LibItemNames; - -public class InventoryFlowerBag implements IInventory { - - private static final ItemStack[] FALLBACK_INVENTORY = new ItemStack[16]; - - EntityPlayer player; - int slot; - ItemStack[] stacks = null; - - boolean invPushed = false; - ItemStack storedInv = null; - - public InventoryFlowerBag(EntityPlayer player, int slot) { - this.player = player; - this.slot = slot; - } - - public static boolean isFlowerBag(ItemStack stack) { - return stack != null && stack.getItem() == ModItems.flowerBag; - } - - ItemStack getStack() { - ItemStack stack = player.inventory.getStackInSlot(slot); - if(stack != null) - storedInv = stack; - return stack; - } - - ItemStack[] getInventory() { - if(stacks != null) - return stacks; - - ItemStack stack = getStack(); - if(isFlowerBag(getStack())) { - stacks = ItemFlowerBag.loadStacks(stack); - return stacks; - } - - return FALLBACK_INVENTORY; - } - - public void pushInventory() { - if(invPushed) - return; - - ItemStack stack = getStack(); - if(stack == null) - stack = storedInv; - - if(stack != null) { - ItemStack[] inv = getInventory(); - ItemFlowerBag.setStacks(stack, inv); - } - - invPushed = true; - } - - @Override - public int getSizeInventory() { - return 16; - } - - @Override - public ItemStack getStackInSlot(int i) { - return getInventory()[i]; - } - - @Override - public ItemStack decrStackSize(int i, int j) { - ItemStack[] inventorySlots = getInventory(); - if (inventorySlots[i] != null) { - ItemStack stackAt; - - if (inventorySlots[i].stackSize <= j) { - stackAt = inventorySlots[i]; - inventorySlots[i] = null; - return stackAt; - } else { - stackAt = inventorySlots[i].splitStack(j); - - if (inventorySlots[i].stackSize == 0) - inventorySlots[i] = null; - - return stackAt; - } - } - - return null; - } - - @Override - public ItemStack getStackInSlotOnClosing(int i) { - return getStackInSlot(i); - } - - @Override - public void setInventorySlotContents(int i, ItemStack itemstack) { - ItemStack[] inventorySlots = getInventory(); - inventorySlots[i] = itemstack; - } - - @Override - public int getInventoryStackLimit() { - return isFlowerBag(getStack()) ? 64 : 0; - } - - @Override - public boolean isUseableByPlayer(EntityPlayer entityplayer) { - return isFlowerBag(getStack()); - } - - @Override - public boolean isItemValidForSlot(int i, ItemStack itemstack) { - return isFlowerBag(getStack()); - } - - @Override - public boolean hasCustomInventoryName() { - return false; - } - - @Override - public void openInventory() { - // NO-OP - } - - @Override - public void closeInventory() { - // NO-OP - } - - @Override - public String getInventoryName() { - return LibItemNames.FLOWER_BAG; - } - - @Override - public void markDirty() { - // NO-OP - } - -} diff --git a/src/main/java/vazkii/botania/client/gui/bag/SlotFlower.java b/src/main/java/vazkii/botania/client/gui/bag/SlotFlower.java deleted file mode 100644 index ba4c32378..000000000 --- a/src/main/java/vazkii/botania/client/gui/bag/SlotFlower.java +++ /dev/null @@ -1,39 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Mar 16, 2015, 7:20:05 PM (GMT)] - */ -package vazkii.botania.client.gui.bag; - -import net.minecraft.inventory.Slot; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import vazkii.botania.common.block.ModBlocks; - -public class SlotFlower extends Slot { - - InventoryFlowerBag inv; - int color; - - public SlotFlower(InventoryFlowerBag p_i1824_1_, int p_i1824_2_, int p_i1824_3_, int p_i1824_4_, int color) { - super(p_i1824_1_, p_i1824_2_, p_i1824_3_, p_i1824_4_); - this.color = color; - inv = p_i1824_1_; - } - - @Override - public void onSlotChange(ItemStack oldStack, ItemStack newStack) { - inv.setInventorySlotContents(color, newStack); - } - - @Override - public boolean isItemValid(ItemStack stack) { - return stack.getItem() == Item.getItemFromBlock(ModBlocks.flower) && stack.getItemDamage() == color; - } - -} diff --git a/src/main/java/vazkii/botania/client/gui/bags/ContainerMagicPlantBag.java b/src/main/java/vazkii/botania/client/gui/bags/ContainerMagicPlantBag.java new file mode 100644 index 000000000..c0179d6d6 --- /dev/null +++ b/src/main/java/vazkii/botania/client/gui/bags/ContainerMagicPlantBag.java @@ -0,0 +1,89 @@ +package vazkii.botania.client.gui.bags; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.Container; +import net.minecraft.inventory.IInventory; +import net.minecraft.inventory.Slot; +import net.minecraft.item.ItemStack; +import vazkii.botania.client.gui.SlotLocked; + +public abstract class ContainerMagicPlantBag extends Container { + + protected InventoryMagicPlantBag magicPlantInv; + public ContainerMagicPlantBag(EntityPlayer player) { + int i; + int j; + + IInventory playerInv = player.inventory; + + addMagicPlantSlots(player); + + for(i = 0; i < 3; ++i) { + for(j = 0; j < 9; ++j) { + addSlotToContainer(new Slot(playerInv, j + i * 9 + 9, 8 + j * 18, 84 + i * 18)); + } + } + + + for(i = 0; i < 9; ++i) { + if(player.inventory.currentItem == i) { + addSlotToContainer(new SlotLocked(playerInv, i, 8 + i * 18, 142)); + } + else addSlotToContainer(new Slot(playerInv, i, 8 + i * 18, 142)); + } + } + + public abstract void addMagicPlantSlots(EntityPlayer player); + + @Override + public boolean canInteractWith(EntityPlayer player) { + boolean can = magicPlantInv.isUseableByPlayer(player); + if(!can) + onContainerClosed(player); + + return can; + } + + @Override + public void onContainerClosed(EntityPlayer player) { + super.onContainerClosed(player); + magicPlantInv.pushInventory(); + } + + @Override + public ItemStack transferStackInSlot(EntityPlayer p_82846_1_, int p_82846_2_) { + ItemStack itemstack = null; + Slot slot = (Slot)inventorySlots.get(p_82846_2_); + + if(slot != null && slot.getHasStack()) { + ItemStack itemstack1 = slot.getStack(); + itemstack = itemstack1.copy(); + + if(p_82846_2_ < 16) { + if(!mergeItemStack(itemstack1, 16, 52, true)) + return null; + } else { + int i = itemstack.getItemDamage(); + if(i < 16) { + Slot slot1 = (Slot)inventorySlots.get(i); + if(slot1.isItemValid(itemstack) && !mergeItemStack(itemstack1, i, i + 1, true)) + return null; + } + } + + if(itemstack1.stackSize == 0) + slot.putStack((ItemStack)null); + else slot.onSlotChanged(); + + if(itemstack1.stackSize == itemstack.stackSize) + return null; + + slot.onPickupFromSlot(p_82846_1_, itemstack1); + } + + return itemstack; + } + +} + + diff --git a/src/main/java/vazkii/botania/client/gui/bags/GuiMagicPlantBag.java b/src/main/java/vazkii/botania/client/gui/bags/GuiMagicPlantBag.java new file mode 100644 index 000000000..92c65bce7 --- /dev/null +++ b/src/main/java/vazkii/botania/client/gui/bags/GuiMagicPlantBag.java @@ -0,0 +1,65 @@ +package vazkii.botania.client.gui.bags; + +import java.util.List; + +import net.minecraft.block.Block; +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.client.renderer.entity.RenderItem; +import net.minecraft.client.resources.I18n; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.Slot; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.StatCollector; + +import org.lwjgl.opengl.GL11; + +public abstract class GuiMagicPlantBag extends GuiContainer { + + private final ResourceLocation texture; + public GuiMagicPlantBag(ContainerMagicPlantBag container, ResourceLocation texture) { + super(container); + this.texture = texture; + } + + @Override + protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) { + String s = StatCollector.translateToLocal(getLocalizedNameKey()); + fontRendererObj.drawString(s, xSize / 2 - fontRendererObj.getStringWidth(s) / 2, 6, 4210752); + fontRendererObj.drawString(I18n.format("container.inventory", new Object[0]), 8, ySize - 96 + 2, 4210752); + } + + @Override + protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) { + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + mc.getTextureManager().bindTexture(texture); + int k = (width - xSize) / 2; + int l = (height - ySize) / 2; + drawTexturedModalRect(k, l, 0, 0, xSize, ySize); + + List slotList = inventorySlots.inventorySlots; + for(Slot slot : slotList) + if(slot instanceof SlotMagicPlant) { + SlotMagicPlant slotf = (SlotMagicPlant) slot; + if(!slotf.getHasStack()) { + ItemStack stack = new ItemStack(itemTypeAllowed(), 0, slotf.color); + int x = guiLeft + slotf.xDisplayPosition; + int y = guiTop + slotf.yDisplayPosition; + RenderHelper.enableGUIStandardItemLighting(); + RenderItem.getInstance().renderItemIntoGUI(mc.fontRenderer, mc.renderEngine, stack, x, y); + RenderHelper.disableStandardItemLighting(); + mc.fontRenderer.drawStringWithShadow("0", x + 11, y + 9, 0xFF6666); + } + } + } + + @Override + protected boolean checkHotbarKeys(int p_146983_1_) { + return false; + } + + protected abstract Block itemTypeAllowed(); + + protected abstract String getLocalizedNameKey(); +} \ No newline at end of file diff --git a/src/main/java/vazkii/botania/client/gui/bags/InventoryMagicPlantBag.java b/src/main/java/vazkii/botania/client/gui/bags/InventoryMagicPlantBag.java new file mode 100644 index 000000000..ffea63b75 --- /dev/null +++ b/src/main/java/vazkii/botania/client/gui/bags/InventoryMagicPlantBag.java @@ -0,0 +1,148 @@ +package vazkii.botania.client.gui.bags; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.IInventory; +import net.minecraft.item.ItemStack; +import vazkii.botania.common.item.bag.ItemBagBase; + +public abstract class InventoryMagicPlantBag implements IInventory { + + private static final ItemStack[] FALLBACK_INVENTORY = new ItemStack[16]; + + EntityPlayer player; + int slot; + ItemStack[] stacks = null; + + boolean invPushed = false; + ItemStack storedInv = null; + + public InventoryMagicPlantBag(EntityPlayer player, int slot) { + this.player = player; + this.slot = slot; + } + + ItemStack getStack() { + ItemStack stack = player.inventory.getStackInSlot(slot); + if(stack != null) + storedInv = stack; + return stack; + } + + + public void pushInventory() { + if(invPushed) + return; + + ItemStack stack = getStack(); + if(stack == null) + stack = storedInv; + + if(stack != null) { + ItemStack[] inv = getInventory(); + ItemBagBase.setStacks(stack, inv); + } + + invPushed = true; + } + + ItemStack[] getInventory() { + if(stacks != null) + return stacks; + + ItemStack stack = getStack(); + if(isMagicPlantBag(getStack())) { + stacks = ItemBagBase.loadStacks(stack); + return stacks; + } + + return FALLBACK_INVENTORY; + } + + @Override + public int getSizeInventory() { + return 16; + } + + @Override + public ItemStack getStackInSlot(int slotIn) { + return getInventory()[slotIn]; + } + + @Override + public ItemStack decrStackSize(int index, int count) { + ItemStack[] inventorySlots = getInventory(); + if (inventorySlots[index] != null) { + ItemStack stackAt; + + if (inventorySlots[index].stackSize <= count) { + stackAt = inventorySlots[index]; + inventorySlots[index] = null; + return stackAt; + } else { + stackAt = inventorySlots[index].splitStack(count); + + if (inventorySlots[index].stackSize == 0) + inventorySlots[index] = null; + + return stackAt; + } + } + + return null; + } + + @Override + public ItemStack getStackInSlotOnClosing(int index) { + return getStackInSlot(index); + } + + @Override + public void setInventorySlotContents(int index, ItemStack stack) { + ItemStack[] inventorySlots = getInventory(); + inventorySlots[index] = stack; + } + + @Override + public String getInventoryName() { + return getBagName(); + } + + @Override + public boolean hasCustomInventoryName() { + return false; + } + + @Override + public int getInventoryStackLimit() { + return isMagicPlantBag(getStack()) ? 64 : 0; + } + + @Override + public void markDirty() { + // NO-OP + } + + @Override + public boolean isUseableByPlayer(EntityPlayer player) { + return isMagicPlantBag(getStack()); + } + + @Override + public void openInventory() { + // NO-OP + } + + @Override + public void closeInventory() { + // NO-OP + } + + @Override + public boolean isItemValidForSlot(int index, ItemStack stack) { + return isMagicPlantBag(getStack()); + } + + protected abstract String getBagName(); + + public abstract boolean isMagicPlantBag(ItemStack stack); +} diff --git a/src/main/java/vazkii/botania/client/gui/bags/SlotMagicPlant.java b/src/main/java/vazkii/botania/client/gui/bags/SlotMagicPlant.java new file mode 100644 index 000000000..6f8b351ec --- /dev/null +++ b/src/main/java/vazkii/botania/client/gui/bags/SlotMagicPlant.java @@ -0,0 +1,32 @@ + +package vazkii.botania.client.gui.bags; + +import net.minecraft.block.Block; +import net.minecraft.inventory.Slot; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import vazkii.botania.common.block.ModBlocks; + +public abstract class SlotMagicPlant extends Slot { + + InventoryMagicPlantBag inv; + int color; + + public SlotMagicPlant(InventoryMagicPlantBag p_i1824_1_, int p_i1824_2_, int p_i1824_3_, int p_i1824_4_, int color) { + super(p_i1824_1_, p_i1824_2_, p_i1824_3_, p_i1824_4_); + this.color = color; + inv = p_i1824_1_; + } + + @Override + public void onSlotChange(ItemStack oldStack, ItemStack newStack) { + inv.setInventorySlotContents(color, newStack); + } + + @Override + public boolean isItemValid(ItemStack stack) { + return stack.getItem() == Item.getItemFromBlock(getValidBlock()) && stack.getItemDamage() == color; + } + + protected abstract Block getValidBlock(); +} \ No newline at end of file diff --git a/src/main/java/vazkii/botania/client/gui/bags/flowerBag/ContainerFlowerBag.java b/src/main/java/vazkii/botania/client/gui/bags/flowerBag/ContainerFlowerBag.java new file mode 100644 index 000000000..73e1e580a --- /dev/null +++ b/src/main/java/vazkii/botania/client/gui/bags/flowerBag/ContainerFlowerBag.java @@ -0,0 +1,23 @@ +package vazkii.botania.client.gui.bags.flowerBag; + +import net.minecraft.entity.player.EntityPlayer; +import vazkii.botania.client.gui.bags.ContainerMagicPlantBag; + +public class ContainerFlowerBag extends ContainerMagicPlantBag { + public ContainerFlowerBag(EntityPlayer player) { + super(player); + } + + @Override + public void addMagicPlantSlots(EntityPlayer player) { + int slot = player.inventory.currentItem; + magicPlantInv = new InventoryFlowerBag(player, slot); + + for(int i = 0; i < 2; ++i) { + for (int j = 0; j < 8; ++j) { + int k = j + i * 8; + addSlotToContainer(new SlotFlower(magicPlantInv, k, 17 + j * 18, 26 + i * 18, k)); + } + } + } +} diff --git a/src/main/java/vazkii/botania/client/gui/bags/flowerBag/GuiFlowerBag.java b/src/main/java/vazkii/botania/client/gui/bags/flowerBag/GuiFlowerBag.java new file mode 100644 index 000000000..aaeb2c132 --- /dev/null +++ b/src/main/java/vazkii/botania/client/gui/bags/flowerBag/GuiFlowerBag.java @@ -0,0 +1,27 @@ +package vazkii.botania.client.gui.bags.flowerBag; + +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.ResourceLocation; +import vazkii.botania.client.gui.bags.GuiMagicPlantBag; +import vazkii.botania.client.lib.LibResources; +import vazkii.botania.common.block.ModBlocks; + +public class GuiFlowerBag extends GuiMagicPlantBag { + + private static final ResourceLocation texture = new ResourceLocation(LibResources.GUI_FLOWER_BAG); + + public GuiFlowerBag(EntityPlayer player) { + super(new ContainerFlowerBag(player), texture); + } + + @Override + protected Block itemTypeAllowed() { + return ModBlocks.flower; + } + + @Override + protected String getLocalizedNameKey() { + return "item.botania:flowerBag.name"; + } +} diff --git a/src/main/java/vazkii/botania/client/gui/bags/flowerBag/InventoryFlowerBag.java b/src/main/java/vazkii/botania/client/gui/bags/flowerBag/InventoryFlowerBag.java new file mode 100644 index 000000000..20867ae42 --- /dev/null +++ b/src/main/java/vazkii/botania/client/gui/bags/flowerBag/InventoryFlowerBag.java @@ -0,0 +1,23 @@ +package vazkii.botania.client.gui.bags.flowerBag; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import vazkii.botania.client.gui.bags.InventoryMagicPlantBag; +import vazkii.botania.common.item.ModItems; +import vazkii.botania.common.lib.LibItemNames; + +public class InventoryFlowerBag extends InventoryMagicPlantBag { + public InventoryFlowerBag(EntityPlayer player, int slot) { + super(player, slot); + } + + @Override + public boolean isMagicPlantBag(ItemStack stack) { + return stack != null && stack.getItem() == ModItems.flowerBag; + } + + @Override + protected String getBagName() { + return LibItemNames.FLOWER_BAG; + } +} diff --git a/src/main/java/vazkii/botania/client/gui/bags/flowerBag/SlotFlower.java b/src/main/java/vazkii/botania/client/gui/bags/flowerBag/SlotFlower.java new file mode 100644 index 000000000..cb5082608 --- /dev/null +++ b/src/main/java/vazkii/botania/client/gui/bags/flowerBag/SlotFlower.java @@ -0,0 +1,18 @@ +package vazkii.botania.client.gui.bags.flowerBag; + +import net.minecraft.block.Block; +import vazkii.botania.client.gui.bags.InventoryMagicPlantBag; +import vazkii.botania.client.gui.bags.SlotMagicPlant; +import vazkii.botania.common.block.ModBlocks; + +public class SlotFlower extends SlotMagicPlant { + public SlotFlower(InventoryMagicPlantBag p_i1824_1_, int p_i1824_2_, int p_i1824_3_, int p_i1824_4_, int color) { + super(p_i1824_1_, p_i1824_2_, p_i1824_3_, p_i1824_4_, color); + } + + @Override + protected Block getValidBlock() { + return ModBlocks.flower; + } + +} diff --git a/src/main/java/vazkii/botania/client/gui/bags/shroomBag/ContainerShroomBag.java b/src/main/java/vazkii/botania/client/gui/bags/shroomBag/ContainerShroomBag.java new file mode 100644 index 000000000..bc59c08df --- /dev/null +++ b/src/main/java/vazkii/botania/client/gui/bags/shroomBag/ContainerShroomBag.java @@ -0,0 +1,23 @@ +package vazkii.botania.client.gui.bags.shroomBag; + +import net.minecraft.entity.player.EntityPlayer; +import vazkii.botania.client.gui.bags.ContainerMagicPlantBag; + +public class ContainerShroomBag extends ContainerMagicPlantBag { + public ContainerShroomBag(EntityPlayer player) { + super(player); + } + + @Override + public void addMagicPlantSlots(EntityPlayer player) { + int slot = player.inventory.currentItem; + magicPlantInv = new InventoryShroomBag(player, slot); + + for(int i = 0; i < 2; ++i) { + for (int j = 0; j < 8; ++j) { + int k = j + i * 8; + addSlotToContainer(new SlotShroom(magicPlantInv, k, 17 + j * 18, 26 + i * 18, k)); + } + } + } +} diff --git a/src/main/java/vazkii/botania/client/gui/bags/shroomBag/GuiShroomBag.java b/src/main/java/vazkii/botania/client/gui/bags/shroomBag/GuiShroomBag.java new file mode 100644 index 000000000..763f679b7 --- /dev/null +++ b/src/main/java/vazkii/botania/client/gui/bags/shroomBag/GuiShroomBag.java @@ -0,0 +1,27 @@ +package vazkii.botania.client.gui.bags.shroomBag; + +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.ResourceLocation; +import vazkii.botania.client.gui.bags.GuiMagicPlantBag; +import vazkii.botania.client.lib.LibResources; +import vazkii.botania.common.block.ModBlocks; + +public class GuiShroomBag extends GuiMagicPlantBag { + + private static final ResourceLocation texture = new ResourceLocation(LibResources.GUI_SHROOM_BAG); + + public GuiShroomBag(EntityPlayer player) { + super(new ContainerShroomBag(player), texture); + } + + @Override + protected Block itemTypeAllowed() { + return ModBlocks.mushroom; + } + + @Override + protected String getLocalizedNameKey() { + return "item.botania:shroomBag.name"; + } +} diff --git a/src/main/java/vazkii/botania/client/gui/bags/shroomBag/InventoryShroomBag.java b/src/main/java/vazkii/botania/client/gui/bags/shroomBag/InventoryShroomBag.java new file mode 100644 index 000000000..37d99a41a --- /dev/null +++ b/src/main/java/vazkii/botania/client/gui/bags/shroomBag/InventoryShroomBag.java @@ -0,0 +1,23 @@ +package vazkii.botania.client.gui.bags.shroomBag; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import vazkii.botania.client.gui.bags.InventoryMagicPlantBag; +import vazkii.botania.common.item.ModItems; +import vazkii.botania.common.lib.LibItemNames; + +public class InventoryShroomBag extends InventoryMagicPlantBag { + public InventoryShroomBag(EntityPlayer player, int slot) { + super(player, slot); + } + + @Override + public boolean isMagicPlantBag(ItemStack stack) { + return stack != null && stack.getItem() == ModItems.shroomBag; + } + + @Override + protected String getBagName() { + return LibItemNames.SHROOM_BAG; + } +} diff --git a/src/main/java/vazkii/botania/client/gui/bags/shroomBag/SlotShroom.java b/src/main/java/vazkii/botania/client/gui/bags/shroomBag/SlotShroom.java new file mode 100644 index 000000000..da8d6e087 --- /dev/null +++ b/src/main/java/vazkii/botania/client/gui/bags/shroomBag/SlotShroom.java @@ -0,0 +1,18 @@ +package vazkii.botania.client.gui.bags.shroomBag; + +import net.minecraft.block.Block; +import vazkii.botania.client.gui.bags.InventoryMagicPlantBag; +import vazkii.botania.client.gui.bags.SlotMagicPlant; +import vazkii.botania.common.block.ModBlocks; + +public class SlotShroom extends SlotMagicPlant { + public SlotShroom(InventoryMagicPlantBag p_i1824_1_, int p_i1824_2_, int p_i1824_3_, int p_i1824_4_, int color) { + super(p_i1824_1_, p_i1824_2_, p_i1824_3_, p_i1824_4_, color); + } + + @Override + protected Block getValidBlock() { + return ModBlocks.mushroom; + } + +} diff --git a/src/main/java/vazkii/botania/client/lib/LibResources.java b/src/main/java/vazkii/botania/client/lib/LibResources.java index 584d12181..f16c2c172 100644 --- a/src/main/java/vazkii/botania/client/lib/LibResources.java +++ b/src/main/java/vazkii/botania/client/lib/LibResources.java @@ -44,6 +44,7 @@ public final class LibResources { public static final String GUI_NEI_BLANK = PREFIX_GUI + "neiBlank.png"; public static final String GUI_NEI_BREWERY = PREFIX_GUI + "neiBrewery.png"; public static final String GUI_FLOWER_BAG = PREFIX_GUI + "flowerBag.png"; + public static final String GUI_SHROOM_BAG = PREFIX_GUI + "shroomBag.png"; public static final String GUI_BAUBLE_BOX = PREFIX_GUI + "baubleBox.png"; public static final String GUI_HUD_ICONS = PREFIX_GUI + "hudIcons.png"; public static final String GUI_STENCIL = PREFIX_GUI + "stencil.png"; diff --git a/src/main/java/vazkii/botania/common/crafting/ModCraftingRecipes.java b/src/main/java/vazkii/botania/common/crafting/ModCraftingRecipes.java index 1737229ce..bb226a4f7 100644 --- a/src/main/java/vazkii/botania/common/crafting/ModCraftingRecipes.java +++ b/src/main/java/vazkii/botania/common/crafting/ModCraftingRecipes.java @@ -257,6 +257,7 @@ public final class ModCraftingRecipes { public static IRecipe recipeSwapRing; public static IRecipe recipeSnowHorn; public static IRecipe recipeFlowerBag; + public static IRecipe recipeShroomBag; public static IRecipe recipePhantomInk; public static IRecipe recipePoolCart; public static IRecipe recipePump; @@ -1768,6 +1769,13 @@ public final class ModCraftingRecipes { 'W', new ItemStack(Blocks.wool, 1, Short.MAX_VALUE)); recipeFlowerBag = BotaniaAPI.getLatestAddedRecipe(); + // Mushroom Pouch Recipe + GameRegistry.addShapedRecipe(new ItemStack(ModItems.shroomBag), + "WPW", "W W", " W ", + 'P', new ItemStack(ModBlocks.mushroom, 1, Short.MAX_VALUE), + 'W', new ItemStack(Blocks.wool, 1, Short.MAX_VALUE)); + recipeShroomBag = BotaniaAPI.getLatestAddedRecipe(); + // Phantom Ink Recipe addShapelessOreDictRecipe(new ItemStack(ModItems.phantomInk, 4), LibOreDict.MANA_PEARL, "dye", "blockGlass", new ItemStack(Items.glass_bottle), new ItemStack(Items.glass_bottle), new ItemStack(Items.glass_bottle), new ItemStack(Items.glass_bottle)); recipePhantomInk = BotaniaAPI.getLatestAddedRecipe(); diff --git a/src/main/java/vazkii/botania/common/item/ItemFlowerBag.java b/src/main/java/vazkii/botania/common/item/ItemFlowerBag.java deleted file mode 100644 index a57e00bfb..000000000 --- a/src/main/java/vazkii/botania/common/item/ItemFlowerBag.java +++ /dev/null @@ -1,159 +0,0 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - * - * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - * - * File Created @ [Mar 16, 2015, 6:43:33 PM (GMT)] - */ -package vazkii.botania.common.item; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.IInventory; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.nbt.NBTTagList; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.tileentity.TileEntityChest; -import net.minecraft.world.World; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.common.util.ForgeDirection; -import net.minecraftforge.event.entity.player.EntityItemPickupEvent; -import vazkii.botania.common.Botania; -import vazkii.botania.common.block.ModBlocks; -import vazkii.botania.common.core.helper.InventoryHelper; -import vazkii.botania.common.core.helper.ItemNBTHelper; -import vazkii.botania.common.lib.LibGuiIDs; -import vazkii.botania.common.lib.LibItemNames; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; - -public class ItemFlowerBag extends ItemMod { - - private static final String TAG_ITEMS = "InvItems"; - private static final String TAG_SLOT = "Slot"; - - public ItemFlowerBag() { - setUnlocalizedName(LibItemNames.FLOWER_BAG); - setMaxStackSize(1); - MinecraftForge.EVENT_BUS.register(this); - } - - @SubscribeEvent - public void onPickupItem(EntityItemPickupEvent event) { - ItemStack stack = event.item.getEntityItem(); - if(stack.getItem() == Item.getItemFromBlock(ModBlocks.flower) && stack.stackSize > 0) { - int color = stack.getItemDamage(); - if(color > 15) - return; - - for(int i = 0; i < event.entityPlayer.inventory.getSizeInventory(); i++) { - if(i == event.entityPlayer.inventory.currentItem) - continue; // prevent item deletion - - ItemStack invStack = event.entityPlayer.inventory.getStackInSlot(i); - if(invStack != null && invStack.getItem() == this) { - ItemStack[] bagInv = loadStacks(invStack); - ItemStack stackAt = bagInv[color]; - boolean didChange = false; - if(stackAt == null) { - bagInv[color] = stack.copy(); - stack.stackSize = 0; - didChange = true; - } else { - int stackAtSize = stackAt.stackSize; - int stackSize = stack.stackSize; - int spare = 64 - stackAtSize; - int pass = Math.min(spare, stackSize); - if(pass > 0) { - stackAt.stackSize += pass; - stack.stackSize -= pass; - didChange = true; - } - } - - if(didChange) - setStacks(invStack, bagInv); - } - - if(stack.stackSize == 0) - return; - } - } - } - - @Override - public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) { - player.openGui(Botania.instance, LibGuiIDs.FLOWER_BAG, world, 0, 0, 0); - return stack; - } - - @Override - public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int s, float xs, float ys, float zs) { - TileEntity tile = world.getTileEntity(x, y, z); - if(tile != null && tile instanceof IInventory) { - if(!world.isRemote) { - ForgeDirection side = ForgeDirection.getOrientation(s); - IInventory inv = (IInventory) tile; - ItemStack[] stacks = loadStacks(stack); - ItemStack[] newStacks = new ItemStack[stacks.length]; - boolean putAny = false; - - int i = 0; - for(ItemStack petal : stacks) { - if(petal != null) { - int count = InventoryHelper.testInventoryInsertion(inv, petal, side); - InventoryHelper.insertItemIntoInventory(inv, petal, side, -1); - - ItemStack newPetal = petal.copy(); - if(newPetal.stackSize == 0) - newPetal = null; - - newStacks[i] = newPetal; - putAny |= count > 0; - } - - i++; - } - - setStacks(stack, newStacks); - if(putAny && inv instanceof TileEntityChest) { - inv = InventoryHelper.getInventory(inv); - player.displayGUIChest(inv); - } - } - - return true; - } - return false; - } - - public static ItemStack[] loadStacks(ItemStack stack) { - NBTTagList var2 = ItemNBTHelper.getList(stack, TAG_ITEMS, 10, false); - ItemStack[] inventorySlots = new ItemStack[16]; - for(int var3 = 0; var3 < var2.tagCount(); ++var3) { - NBTTagCompound var4 = var2.getCompoundTagAt(var3); - byte var5 = var4.getByte(TAG_SLOT); - if(var5 >= 0 && var5 < inventorySlots.length) - inventorySlots[var5] = ItemStack.loadItemStackFromNBT(var4); - } - - return inventorySlots; - } - - public static void setStacks(ItemStack stack, ItemStack[] inventorySlots) { - NBTTagList var2 = new NBTTagList(); - for(int var3 = 0; var3 < inventorySlots.length; ++var3) - if(inventorySlots[var3] != null) { - NBTTagCompound var4 = new NBTTagCompound(); - var4.setByte(TAG_SLOT, (byte)var3); - inventorySlots[var3].writeToNBT(var4); - var2.appendTag(var4); - } - - ItemNBTHelper.setList(stack, TAG_ITEMS, var2); - } - -} diff --git a/src/main/java/vazkii/botania/common/item/ModItems.java b/src/main/java/vazkii/botania/common/item/ModItems.java index d029d5a93..43b8f5f53 100644 --- a/src/main/java/vazkii/botania/common/item/ModItems.java +++ b/src/main/java/vazkii/botania/common/item/ModItems.java @@ -15,6 +15,8 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraftforge.oredict.OreDictionary; import vazkii.botania.api.BotaniaAPI; +import vazkii.botania.common.item.bag.ItemFlowerBag; +import vazkii.botania.common.item.bag.ItemShroomBag; import vazkii.botania.common.item.brew.ItemBrewFlask; import vazkii.botania.common.item.brew.ItemBrewVial; import vazkii.botania.common.item.brew.ItemIncenseStick; @@ -232,6 +234,7 @@ public final class ModItems { public static Item cosmetic; public static Item swapRing; public static Item flowerBag; + public static Item shroomBag; public static Item phantomInk; public static Item poolMinecart; public static Item pinkinator; @@ -381,6 +384,7 @@ public final class ModItems { cosmetic = new ItemBaubleCosmetic(); swapRing = new ItemSwapRing(); flowerBag = new ItemFlowerBag(); + shroomBag = new ItemShroomBag(); phantomInk = new ItemPhantomInk(); poolMinecart = new ItemPoolMinecart(); pinkinator = new ItemPinkinator(); diff --git a/src/main/java/vazkii/botania/common/item/bag/ItemBagBase.java b/src/main/java/vazkii/botania/common/item/bag/ItemBagBase.java new file mode 100644 index 000000000..d842f6bc3 --- /dev/null +++ b/src/main/java/vazkii/botania/common/item/bag/ItemBagBase.java @@ -0,0 +1,154 @@ +package vazkii.botania.common.item.bag; + +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.IInventory; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.tileentity.TileEntityChest; +import net.minecraft.world.World; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.event.entity.player.EntityItemPickupEvent; +import vazkii.botania.common.Botania; +import vazkii.botania.common.block.ModBlocks; +import vazkii.botania.common.core.helper.InventoryHelper; +import vazkii.botania.common.core.helper.ItemNBTHelper; +import vazkii.botania.common.item.ItemMod; +import vazkii.botania.common.lib.LibGuiIDs; +import vazkii.botania.common.lib.LibItemNames; + +public abstract class ItemBagBase extends ItemMod { + + private static final String TAG_ITEMS = "InvItems"; + private static final String TAG_SLOT = "Slot"; + + public ItemBagBase(String name) { + setUnlocalizedName(name); + setMaxStackSize(1); + MinecraftForge.EVENT_BUS.register(this); + } + + @SubscribeEvent + public void onPickupItem(EntityItemPickupEvent event) { + ItemStack stack = event.item.getEntityItem(); + if(stack.getItem() == Item.getItemFromBlock(getValidPickUp()) && stack.stackSize > 0) { + int color = stack.getItemDamage(); + if(color > 15) + return; + + for(int i = 0; i < event.entityPlayer.inventory.getSizeInventory(); i++) { + if(i == event.entityPlayer.inventory.currentItem) + continue; // prevent item deletion + + ItemStack invStack = event.entityPlayer.inventory.getStackInSlot(i); + if(invStack != null && invStack.getItem() == this) { + ItemStack[] bagInv = loadStacks(invStack); + ItemStack stackAt = bagInv[color]; + boolean didChange = false; + if(stackAt == null) { + bagInv[color] = stack.copy(); + stack.stackSize = 0; + didChange = true; + } else { + int stackAtSize = stackAt.stackSize; + int stackSize = stack.stackSize; + int spare = 64 - stackAtSize; + int pass = Math.min(spare, stackSize); + if(pass > 0) { + stackAt.stackSize += pass; + stack.stackSize -= pass; + didChange = true; + } + } + + if(didChange) + setStacks(invStack, bagInv); + } + + if(stack.stackSize == 0) + return; + } + } + } + + @Override + public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) { + player.openGui(Botania.instance, getGuiID(), world, 0, 0, 0); + return stack; + } + + @Override + public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int s, float xs, float ys, float zs) { + TileEntity tile = world.getTileEntity(x, y, z); + if(tile != null && tile instanceof IInventory) { + if(!world.isRemote) { + ForgeDirection side = ForgeDirection.getOrientation(s); + IInventory inv = (IInventory) tile; + ItemStack[] stacks = loadStacks(stack); + ItemStack[] newStacks = new ItemStack[stacks.length]; + boolean putAny = false; + + int i = 0; + for(ItemStack petal : stacks) { + if(petal != null) { + int count = InventoryHelper.testInventoryInsertion(inv, petal, side); + InventoryHelper.insertItemIntoInventory(inv, petal, side, -1); + + ItemStack newPetal = petal.copy(); + if(newPetal.stackSize == 0) + newPetal = null; + + newStacks[i] = newPetal; + putAny |= count > 0; + } + + i++; + } + + setStacks(stack, newStacks); + if(putAny && inv instanceof TileEntityChest) { + inv = InventoryHelper.getInventory(inv); + player.displayGUIChest(inv); + } + } + + return true; + } + return false; + } + + public static ItemStack[] loadStacks(ItemStack stack) { + NBTTagList var2 = ItemNBTHelper.getList(stack, TAG_ITEMS, 10, false); + ItemStack[] inventorySlots = new ItemStack[16]; + for(int var3 = 0; var3 < var2.tagCount(); ++var3) { + NBTTagCompound var4 = var2.getCompoundTagAt(var3); + byte var5 = var4.getByte(TAG_SLOT); + if(var5 >= 0 && var5 < inventorySlots.length) + inventorySlots[var5] = ItemStack.loadItemStackFromNBT(var4); + } + + return inventorySlots; + } + + public static void setStacks(ItemStack stack, ItemStack[] inventorySlots) { + NBTTagList var2 = new NBTTagList(); + for(int var3 = 0; var3 < inventorySlots.length; ++var3) + if(inventorySlots[var3] != null) { + NBTTagCompound var4 = new NBTTagCompound(); + var4.setByte(TAG_SLOT, (byte)var3); + inventorySlots[var3].writeToNBT(var4); + var2.appendTag(var4); + } + + ItemNBTHelper.setList(stack, TAG_ITEMS, var2); + } + + protected abstract Block getValidPickUp(); + + protected abstract int getGuiID(); +} diff --git a/src/main/java/vazkii/botania/common/item/bag/ItemFlowerBag.java b/src/main/java/vazkii/botania/common/item/bag/ItemFlowerBag.java new file mode 100644 index 000000000..f63de4478 --- /dev/null +++ b/src/main/java/vazkii/botania/common/item/bag/ItemFlowerBag.java @@ -0,0 +1,23 @@ +package vazkii.botania.common.item.bag; + +import net.minecraft.block.Block; +import vazkii.botania.common.block.ModBlocks; +import vazkii.botania.common.lib.LibGuiIDs; +import vazkii.botania.common.lib.LibItemNames; + +public class ItemFlowerBag extends ItemBagBase { + + public ItemFlowerBag() { + super(LibItemNames.FLOWER_BAG); + } + + @Override + protected Block getValidPickUp() { + return ModBlocks.flower; + } + + @Override + protected int getGuiID() { + return LibGuiIDs.FLOWER_BAG; + } +} diff --git a/src/main/java/vazkii/botania/common/item/bag/ItemShroomBag.java b/src/main/java/vazkii/botania/common/item/bag/ItemShroomBag.java new file mode 100644 index 000000000..395ba703e --- /dev/null +++ b/src/main/java/vazkii/botania/common/item/bag/ItemShroomBag.java @@ -0,0 +1,23 @@ +package vazkii.botania.common.item.bag; + +import net.minecraft.block.Block; +import vazkii.botania.common.block.ModBlocks; +import vazkii.botania.common.lib.LibGuiIDs; +import vazkii.botania.common.lib.LibItemNames; + +public class ItemShroomBag extends ItemBagBase{ + + public ItemShroomBag() { + super(LibItemNames.SHROOM_BAG); + } + + @Override + protected Block getValidPickUp() { + return ModBlocks.mushroom; + } + + @Override + protected int getGuiID() { + return LibGuiIDs.SHROOM_BAG; + } +} diff --git a/src/main/java/vazkii/botania/common/lexicon/LexiconData.java b/src/main/java/vazkii/botania/common/lexicon/LexiconData.java index 2c291d353..be7a30ed0 100644 --- a/src/main/java/vazkii/botania/common/lexicon/LexiconData.java +++ b/src/main/java/vazkii/botania/common/lexicon/LexiconData.java @@ -69,6 +69,7 @@ public final class LexiconData { public static LexiconEntry terrasteel; public static LexiconEntry blackLotus; public static LexiconEntry flowerBag; + public static LexiconEntry shroomBag; public static LexiconEntry gardenOfGlass; public static LexiconEntry manaIntro; @@ -395,6 +396,10 @@ public final class LexiconData { flowerBag.setLexiconPages(new PageText("0"), new PageText("2"), new PageCraftingRecipe("1", ModCraftingRecipes.recipeFlowerBag)); + shroomBag = new BLexiconEntry(LibLexicon.BASICS_SHROOM_BAG, categoryBasics); + shroomBag.setLexiconPages(new PageText("0"), + new PageCraftingRecipe("1", ModCraftingRecipes.recipeShroomBag)); + if (Botania.gardenOfGlassLoaded) { gardenOfGlass = new BLexiconEntry(LibLexicon.BASICS_GARDEN_OF_GLASS, categoryBasics); gardenOfGlass.setLexiconPages(new PageText("0"), new PageText("1"), new PageText("2"), diff --git a/src/main/java/vazkii/botania/common/lib/LibGuiIDs.java b/src/main/java/vazkii/botania/common/lib/LibGuiIDs.java index fefcb749a..98a5d2205 100644 --- a/src/main/java/vazkii/botania/common/lib/LibGuiIDs.java +++ b/src/main/java/vazkii/botania/common/lib/LibGuiIDs.java @@ -17,4 +17,6 @@ public final class LibGuiIDs { public static final int FLOWER_BAG = 2; public static final int BAUBLE_BOX = 3; + public static final int SHROOM_BAG = 4; + } diff --git a/src/main/java/vazkii/botania/common/lib/LibItemNames.java b/src/main/java/vazkii/botania/common/lib/LibItemNames.java index 98f2643f7..3e27e8103 100644 --- a/src/main/java/vazkii/botania/common/lib/LibItemNames.java +++ b/src/main/java/vazkii/botania/common/lib/LibItemNames.java @@ -126,6 +126,7 @@ public final class LibItemNames { public static final String COSMETIC = "cosmetic"; public static final String SWAP_RING = "swapRing"; public static final String FLOWER_BAG = "flowerBag"; + public static final String SHROOM_BAG = "shroomBag"; public static final String PHANTOM_INK = "phantomInk"; public static final String POOL_MINECART = "poolMinecart"; public static final String PINKINATOR = "pinkinator"; diff --git a/src/main/java/vazkii/botania/common/lib/LibLexicon.java b/src/main/java/vazkii/botania/common/lib/LibLexicon.java index 8b6013961..a2c0cee51 100644 --- a/src/main/java/vazkii/botania/common/lib/LibLexicon.java +++ b/src/main/java/vazkii/botania/common/lib/LibLexicon.java @@ -38,6 +38,7 @@ public final class LibLexicon { public static final String BASICS_TERRASTEEL = "terrasteel"; public static final String BASICS_BLACK_LOTUS = "blackLotus"; public static final String BASICS_FLOWER_BAG = "flowerBag"; + public static final String BASICS_SHROOM_BAG = "shroomBag"; public static final String BASICS_GARDEN_OF_GLASS = "gardenOfGlass"; public static final String MANA_INTRO = "mIntro"; diff --git a/src/main/java/vazkii/botania/common/network/GuiHandler.java b/src/main/java/vazkii/botania/common/network/GuiHandler.java index 0dd9fea9f..1d08bad85 100644 --- a/src/main/java/vazkii/botania/common/network/GuiHandler.java +++ b/src/main/java/vazkii/botania/common/network/GuiHandler.java @@ -12,8 +12,10 @@ package vazkii.botania.common.network; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.world.World; -import vazkii.botania.client.gui.bag.ContainerFlowerBag; -import vazkii.botania.client.gui.bag.GuiFlowerBag; +import vazkii.botania.client.gui.bags.flowerBag.ContainerFlowerBag; +import vazkii.botania.client.gui.bags.flowerBag.GuiFlowerBag; +import vazkii.botania.client.gui.bags.shroomBag.ContainerShroomBag; +import vazkii.botania.client.gui.bags.shroomBag.GuiShroomBag; import vazkii.botania.client.gui.box.ContainerBaubleBox; import vazkii.botania.client.gui.box.GuiBaubleBox; import vazkii.botania.client.gui.crafting.ContainerCraftingHalo; @@ -31,6 +33,8 @@ public class GuiHandler implements IGuiHandler { return new ContainerCraftingHalo(player.inventory, world); case LibGuiIDs.FLOWER_BAG : return new ContainerFlowerBag(player); + case LibGuiIDs.SHROOM_BAG: + return new ContainerShroomBag(player); case LibGuiIDs.BAUBLE_BOX : return new ContainerBaubleBox(player); } @@ -48,6 +52,8 @@ public class GuiHandler implements IGuiHandler { return new GuiCraftingHalo(player.inventory, world); case LibGuiIDs.FLOWER_BAG : return new GuiFlowerBag(player); + case LibGuiIDs.SHROOM_BAG: + return new GuiShroomBag(player); case LibGuiIDs.BAUBLE_BOX : return new GuiBaubleBox(player); } diff --git a/src/main/resources/assets/botania/lang/en_US.lang b/src/main/resources/assets/botania/lang/en_US.lang index 017d4c38c..7ae72e4c7 100644 --- a/src/main/resources/assets/botania/lang/en_US.lang +++ b/src/main/resources/assets/botania/lang/en_US.lang @@ -1630,6 +1630,7 @@ item.botania:cosmetic31.name=Questgiver Mark item.botania:manaString.name=Mana Infused String item.botania:swapRing.name=Ring of Correction item.botania:flowerBag.name=Flower Pouch +item.botania:shroomBag.name=Mushroom Pouch item.botania:phantomInk.name=Phantom Ink item.botania:poolMinecart.name=Minecart with Mana Pool item.botania:pinkinator.name=The Pinkinator @@ -2121,6 +2122,12 @@ botania.page.flowerBag0=The laws of physics regarding one's &4Inventory&0 are so botania.page.flowerBag2=Items won't be added automatically to the pouch if that's the item being held.
Furthermore, shift-right clicking the pouch into a &1Chest&0 or other inventory will store the flowers it contains into said inventory. botania.page.flowerBag1=Pull a copter out of it (any colors work) +# -- MUSHROOM POUCH +botania.entry.shroomBag=Mushroom Pouch +botania.tagline.shroomBag=A trusty pouch to hold your mushroom goodness +botania.page.shroomBag0=Similar to the &1Flower Pouch&0, the mushroom pouch will hold all of those pesky &1Mystical Mushrooms&0 that have been clogging up your inventory.
Remember the bag will not pick up items if you are holding it in your hand.
Furthermore, shift-right clicking the pouch into a &1Chest&0 or other inventory will store the flowers it contains into said inventory. +botania.page.shroomBag1=Any colors work + # -- WRAP botania.entry.wrap=Wrap botania.tagline.wrap=It's a wrap diff --git a/src/main/resources/assets/botania/textures/gui/flowerBag.png b/src/main/resources/assets/botania/textures/gui/flowerBag.png index 8933ac78bc503f035207ee4e8beb502d8a527be5..b6433bc9b6af723c66e61c6eac2a85b53c7503e8 100644 GIT binary patch literal 3123 zcmeH~Yfuws6o$XuEV95D!fo(E(kKWDD8(BDkgSq`fDlM8U}Xfct@Rd^i$(}!gH;eg z5EQ72q!y(PieRlk<&usfbf`hG(isg91OkK#A*7f9CSCkff7oB0mTAXddv@mCGjq;9 z@4Vl4A}lmuzUd-U0Kojf%`7ee5K%$^oku*P;=lcT_AP-MunAO3?S=s`8wq4>{E)x> zMVC7-D#G$uZ|5pI#yK|Sl#>cBqk3Mfy}OzMXOwSl{)VfEx>=LGX=ZIgOy zbiKCzwgV+H-8++}2b(RXQGr&~tGR2=%)@}L6j9|0qm5(PbX6ka+o0DnW)zC!2su_C z1ZeuBYjfh3V1V&6lDBikZYv0G6*=N|!GY&d3PxTF^+yIhW#J%RY(j70b~wUF9w`Jc z3iH=n&~dvj;MVFhw@v`4AG5+vT`mhjP`dFs5bwHd|5Bpm!?|pk8VQ>8nzr7@^#Yw* zGuq|NFsJaP0$;s$cimw)(tlEpv4C)TP)IHriWVBihLuXC!(du=`&XO+$33v8rZ#om z7Vxr4AT^Kjcw~us~7 z)lUBh(EqgK(08!*_ws0RQ%75o8)vM$pYm8<$R+azpAW^NaKE`mNNCD0QOX~(l!JGb|FpHX3h(mLBgUs0)7K-MD!9m^|2E8OAbof`r1Y01Ysk+5q=0V=Nb zx_%!OM;b#E>|oL-ITlzonPBF*^421IJeK-58%s^))1^(`T`Q*^<-X>gWKlY?SkWTN z^%a@7N6(nbhl1~nD||KzR!tnVfB2|eg#%fC0@EiBsyE{Q&=Mc5ZoUDCk(@`0t;=e_ z*?BY%Kaks}DQ^#2#aAk?4W9D@&C62nEr5LBj?~gkpc|g!k>A)QVP%ZUQ!~unnp-#| zT4aaWH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md;+*J12w?_da$Bppp;`2TT%FsIl65q93 zx(EkuZODn}CA;Ym+$69kEd1FSC=H+M49P>*hIx~cMYAcH8V0b=X?Nb4=H}-5&d&Ti zU$kyJ6Voc2+b34VJM<9m!A&kwci5^Q#(Wp?FqdQ zkz8-D%ia0-P*jO69Y6-d>w`{^(=m4(AWn6GghjUMX!zW`` zy_C*-4QZi?xJ6+-kIUt@^KT3ceB|b^ShR_mZWjOi?rD9Y31Kdc1?>{$CIG3e#7fw%fd%T-=U%R!>hn*p{Kr#>OAsbtL70&d?S{wrAhJ;h0GEMD+A<}kEW0ZbZYvn1JWxc_iZCODo%(r?V&d1VE>_!rNAvv}1K;;aO-%FbX;CGdDl z6^M5lCr)UsSHOd<3$dvM;z9q~-};+~>-P;UUnKB zze*wVaHagdDP%lA25@mnYj89Yc=Z#27FD@#&Z6UGb4g!%p2ob-0uAouAvG(-)%0Co zW&fPzlE}&JVig^;TfH(h2uLQb=g==1B~NsZ<#tP@(#O_~mg5_2ao`hwOJq$pr80-V zYDyA~BZ))x*!UkfI4TD>s@2n>P}Kr;RI+BFax}<(Qq2XhtL)L;4Ksy{-7_##f=3x7e?B? zb5pPwI00aq52NjK0PT-$t)`F<6YtvdFXfDZ(ZO3 literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/botania/textures/items/shroomBag.png b/src/main/resources/assets/botania/textures/items/shroomBag.png new file mode 100644 index 0000000000000000000000000000000000000000..c7f61bb7676ed4bd60583e97e6a839029bbb23b9 GIT binary patch literal 506 zcmVPx$nn^@KR5*>*lfO$FVHn3hXJZ1_gd;zWU{gv$MF=HO&Dctas%{+v(F zr45A)@NDxr-`;KEIyU=nw=s(a0QC7F?{5vHka<)Y={*}Xqv1A$!H(2m>Z0`T