Fixed Constructor being able to drop more than the maximum stack size for an item. Fixes #3455

This commit is contained in:
raoulvdberge
2023-02-12 10:16:36 +01:00
parent 4836c6fa9d
commit 036e680795
2 changed files with 4 additions and 2 deletions

View File

@@ -10,8 +10,9 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
### Fixed ### Fixed
- Fixed some craftable items not showing as craftable in JEI - Fixed some craftable items not showing as craftable in JEI
- Fixed grid crashing on exit if JEI mod is not used - Fixed Grid crashing on exit if JEI mod is not used
- Fixed rare multithreading crash - Fixed rare multithreading crash
- Fixed Constructor being able to drop more than the maximum stack size for an item
## [v1.11.4] - 2022-12-20 ## [v1.11.4] - 2022-12-20

View File

@@ -134,7 +134,8 @@ public class ConstructorNetworkNode extends NetworkNode implements IComparable,
} }
private void extractAndDropItem(ItemStack stack) { private void extractAndDropItem(ItemStack stack) {
ItemStack took = network.extractItem(stack, upgrades.getStackInteractCount(), compare, Action.PERFORM); int dropCount = Math.min(upgrades.getStackInteractCount(), stack.getMaxStackSize());
ItemStack took = network.extractItem(stack, dropCount, compare, Action.PERFORM);
if (!took.isEmpty()) { if (!took.isEmpty()) {
DefaultDispenseItemBehavior.spawnItem(level, took, 6, getDirection(), new PositionImpl(getDispensePositionX(), getDispensePositionY(), getDispensePositionZ())); DefaultDispenseItemBehavior.spawnItem(level, took, 6, getDirection(), new PositionImpl(getDispensePositionX(), getDispensePositionY(), getDispensePositionZ()));