minor changes to shift crafting behavior (#2561)

* minor changes to shift crafting behavior

* revert shift crafting only crafting until current stack size of crafting slots.
This commit is contained in:
Darkere
2020-06-18 13:32:12 +02:00
committed by GitHub
parent 76cf8a1de6
commit 196192786d

View File

@@ -75,7 +75,10 @@ public class CraftingGridBehavior implements ICraftingGridBehavior {
int amountCrafted = 0;
ItemStack crafted = grid.getCraftingResult().getStackInSlot(0);
int maxCrafted = crafted.getMaxStackSize();
ForgeHooks.setCraftingPlayer(player);
// Do while the item is still craftable (aka is the result slot still the same as the original item?) and we don't exceed the max stack size.
do {
grid.onCrafted(player);
@@ -83,7 +86,7 @@ public class CraftingGridBehavior implements ICraftingGridBehavior {
craftedItemsList.add(crafted.copy());
amountCrafted += crafted.getCount();
} while (API.instance().getComparer().isEqual(crafted, grid.getCraftingResult().getStackInSlot(0)) && amountCrafted < crafted.getMaxStackSize());
} while (API.instance().getComparer().isEqual(crafted, grid.getCraftingResult().getStackInSlot(0)) && amountCrafted < maxCrafted && amountCrafted + crafted.getCount() <= maxCrafted );
INetwork network = grid.getNetwork();