From 2a4a1cd2916be99eed8e2ed7bd599686f987cfd8 Mon Sep 17 00:00:00 2001 From: Aidan Brady Date: Mon, 11 Nov 2013 23:57:33 -0500 Subject: [PATCH] =?UTF-8?q?Some=20more=20work=20on=20Bin=20crafting=20mana?= =?UTF-8?q?gement.=20=20Don=E2=80=99t=20know=20if=20this=20is=20gonna=20wo?= =?UTF-8?q?rk=20guys=E2=80=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/mekanism/common/BinRecipe.java | 4 +++ .../mekanism/common/item/ItemBlockBasic.java | 27 ++++++++++++++----- common/mekanism/common/item/ItemProxy.java | 2 +- 3 files changed, 25 insertions(+), 8 deletions(-) diff --git a/common/mekanism/common/BinRecipe.java b/common/mekanism/common/BinRecipe.java index aa8073a88..57dfaebf5 100644 --- a/common/mekanism/common/BinRecipe.java +++ b/common/mekanism/common/BinRecipe.java @@ -130,6 +130,10 @@ public class BinRecipe implements IRecipe, ICraftingHandler craftMatrix.setInventorySlotContents(i, proxy); } + else if(isBin(item) && isBin(craftMatrix.getStackInSlot(i))) + { + craftMatrix.setInventorySlotContents(i, null); + } } } } diff --git a/common/mekanism/common/item/ItemBlockBasic.java b/common/mekanism/common/item/ItemBlockBasic.java index 5eda5457a..5ae871b0b 100644 --- a/common/mekanism/common/item/ItemBlockBasic.java +++ b/common/mekanism/common/item/ItemBlockBasic.java @@ -46,6 +46,17 @@ public class ItemBlockBasic extends ItemBlock setHasSubtypes(true); } + @Override + public int getItemStackLimit(ItemStack stack) + { + if(stack.getItemDamage() == 6) + { + return 1; + } + + return 64; + } + @Override public int getMetadata(int i) { @@ -71,11 +82,13 @@ public class ItemBlockBasic extends ItemBlock else { InventoryBin inv = new InventoryBin(itemstack); - list.add(EnumColor.INDIGO + "Item color: " + EnumColor.GREY + inv.getItemCount()); - if(inv.getItemCount() > 0) { - list.add(EnumColor.BRIGHT_GREEN + "Item type: " + inv.getItemType().getDisplayName()); + list.add(EnumColor.BRIGHT_GREEN + inv.getItemType().getDisplayName()); + list.add(EnumColor.INDIGO + "Item amount: " + EnumColor.GREY + inv.getItemCount()); + } + else { + list.add(EnumColor.DARK_RED + "Empty"); } } } @@ -92,15 +105,15 @@ public class ItemBlockBasic extends ItemBlock { if(stack.getItemDamage() != 6) { - return false; + return true; } - if(stack.stackTagCompound == null || !stack.stackTagCompound.hasKey("newCount")) + if(stack.stackTagCompound == null || !stack.stackTagCompound.hasKey("newCount") || stack.stackTagCompound.getInteger("newCount") == 0) { - return false; + return true; } - return true; + return false; } @Override diff --git a/common/mekanism/common/item/ItemProxy.java b/common/mekanism/common/item/ItemProxy.java index e2836431e..15e5c6344 100644 --- a/common/mekanism/common/item/ItemProxy.java +++ b/common/mekanism/common/item/ItemProxy.java @@ -22,7 +22,7 @@ public class ItemProxy extends Item @Override public boolean doesContainerItemLeaveCraftingGrid(ItemStack stack) { - return stack.stackTagCompound != null && stack.stackTagCompound.getBoolean("hasStack"); + return stack.stackTagCompound == null || !stack.stackTagCompound.getBoolean("hasStack"); } @Override