Skip to content

Commit

Permalink
Fix dupe issue with container objects being dropped in single stack
Browse files Browse the repository at this point in the history
  • Loading branch information
jaquadro committed Jun 26, 2018
1 parent 051dd88 commit d653163
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ org.gradle.jvmargs=-Xmx3G

minecraft_base_version=1.12
minecraft_version=1.12.2
mod_version=5.3.6
mod_version=5.3.7
chameleon_version=4.1.0
chameleon_max_version=5.0.0

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,16 @@ public static void dropInventoryItems (World world, BlockPos pos, IDrawerGroup g

while (drawer.getStoredItemCount() > 0) {
ItemStack stack = drawer.getStoredItemPrototype().copy();
stack.setCount(drawer.getStoredItemCount());
int storedCount = drawer.getStoredItemCount();
int stackLimit = stack.getMaxStackSize();
int stackSize = Math.min(storedCount, stackLimit);

stack.setCount(stackSize);
if (stack.isEmpty())
break;

spawnItemStack(world, pos.getX(), pos.getY(), pos.getZ(), stack);
drawer.setStoredItemCount(0);
drawer.adjustStoredItemCount(-stackSize);
}
}
}
Expand Down

0 comments on commit d653163

Please sign in to comment.