Some more work on Bin crafting management. Don’t know if this is gonna work guys…

This commit is contained in:
Aidan Brady committed 2013-11-11 23:57:33 -05:00
1 parent 8cec8af952
commit 2a4a1cd291
3 files changed
+25 -8

No files matched your search

+4
View File
@@ -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);
}
}
}
}
@@ -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
+1 -1
View File
@@ -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