Skip to content
Permalink
Browse files

Assembler now allows you to assemble infinite items in creative mode.

  • Loading branch information...
Ri5ux committed Apr 10, 2019
1 parent 3ba89e6 commit 1ca567e41e3f0e24ddfaa78e69e0e1cc446b60ad
Showing with 17 additions and 14 deletions.
  1. +17 −14 src/main/java/org/avp/item/crafting/AssemblyManager.java
@@ -180,30 +180,33 @@ public static ItemStack findInventoryItemstackMatchOreDict(EntityPlayer player,

public static boolean handleAssembly(Schematic schematic, EntityPlayer player, boolean simulate)
{
if (schematic != null && Schematic.isComplete(schematic, player))
if (schematic != null && Schematic.isComplete(schematic, player) || schematic != null && player.isCreative())
{
for (ItemStack requirement : schematic.getItemsRequired())
if (!player.isCreative())
{
if (requirement != null && requirement != ItemStack.EMPTY)
for (ItemStack requirement : schematic.getItemsRequired())
{
Item requiredItem = findInventoryItemstackMatchOreDict(player, requirement).getItem();

if (Inventories.getAmountOfItemPlayerHas(requiredItem, player) >= requirement.getCount())
if (requirement != null && requirement != ItemStack.EMPTY)
{
for (int x = 0; x < requirement.getCount(); x++)
Item requiredItem = findInventoryItemstackMatchOreDict(player, requirement).getItem();

if (Inventories.getAmountOfItemPlayerHas(requiredItem, player) >= requirement.getCount())
{
if (!simulate)
for (int x = 0; x < requirement.getCount(); x++)
{
if (!Inventories.consumeItem(player, requiredItem))
if (!simulate)
{
return false;
if (!Inventories.consumeItem(player, requiredItem))
{
return false;
}
}
}
}
}
else
{
return false;
else
{
return false;
}
}
}
}

0 comments on commit 1ca567e

Please sign in to comment.
You can’t perform that action at this time.