Update PackageDefragmenter.java

- Fixed order context getting lost in the repackager
This commit is contained in:
simibubi 2025-02-06 11:57:53 +01:00
parent 7ff29fd207
commit 3f078e2ab4

View file

@ -54,8 +54,11 @@ public class PackageDefragmenter {
for (ItemStack box : collectedPackages.get(orderId)) { for (ItemStack box : collectedPackages.get(orderId)) {
address = PackageItem.getAddress(box); address = PackageItem.getAddress(box);
if (box.has(AllDataComponents.PACKAGE_ORDER_DATA)) if (box.has(AllDataComponents.PACKAGE_ORDER_DATA)) {
orderContext = box.get(AllDataComponents.PACKAGE_ORDER_DATA).orderContext(); PackageOrder context = box.get(AllDataComponents.PACKAGE_ORDER_DATA).orderContext();
if (context != null && !context.isEmpty())
orderContext = context;
}
ItemStackHandler contents = PackageItem.getContents(box); ItemStackHandler contents = PackageItem.getContents(box);
Slots: for (int slot = 0; slot < contents.getSlots(); slot++) { Slots: for (int slot = 0; slot < contents.getSlots(); slot++) {
ItemStack stackInSlot = contents.getStackInSlot(slot); ItemStack stackInSlot = contents.getStackInSlot(slot);