Some more work on Bin crafting management. Don’t know if this is gonna work guys…
This commit is contained in:
parent
8cec8af952
commit
2a4a1cd291
3 changed files with 25 additions and 8 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue