Fixed Grid "last changed" date not changing when using clear button or JEI transfer. Fixes #2022

This commit is contained in:
raoulvdberge
2018-10-14 16:56:43 +02:00
parent e07a467836
commit 071537120b
3 changed files with 16 additions and 1 deletions

View File

@@ -9,6 +9,7 @@
- Fixed a duplication bug with a disconnected Crafting Grid (raoulvdberge)
- Fixed oredict autocrafting sometimes reporting that a craftable item is missing (raoulvdberge)
- Fixed fluid autocrafting without item inputs locking when there's not enough space for the fluids (raoulvdberge)
- Fixed Grid "last changed" date not changing when using clear button or JEI transfer (raoulvdberge)
- Removed handling of reusable items in autocrafting, to avoid problems (raoulvdberge)
- You can no longer start a crafting task if it has missing items or fluids (raoulvdberge)

View File

@@ -345,6 +345,8 @@ public class NetworkNodeGrid extends NetworkNode implements IGridNetworkAware, I
return;
} else {
network.insertItem(slot, slot.getCount(), Action.PERFORM);
network.getItemStorageTracker().changed(player, slot.copy());
}
} else {
// If we aren't connected, try to insert into player inventory. If it fails, stop.
@@ -375,6 +377,8 @@ public class NetworkNodeGrid extends NetworkNode implements IGridNetworkAware, I
if (took != null) {
grid.getCraftingMatrix().setInventorySlotContents(i, StackUtils.nullToEmpty(took));
network.getItemStorageTracker().changed(player, took.copy());
found = true;
break;
@@ -461,7 +465,13 @@ public class NetworkNodeGrid extends NetworkNode implements IGridNetworkAware, I
}
} else if (!slot.isEmpty()) {
if (slot.getCount() == 1 && network != null) {
matrix.setInventorySlotContents(i, StackUtils.nullToEmpty(network.extractItem(slot, 1, Action.PERFORM)));
ItemStack refill = StackUtils.nullToEmpty(network.extractItem(slot, 1, Action.PERFORM));
matrix.setInventorySlotContents(i, refill);
if (!refill.isEmpty()) {
network.getItemStorageTracker().changed(player, refill.copy());
}
} else {
matrix.decrStackSize(i, 1);
}

View File

@@ -49,6 +49,10 @@ public class MessageGridClear extends MessageHandlerPlayerToServer<MessageGridCl
if (!slot.isEmpty()) {
matrix.setInventorySlotContents(i, StackUtils.nullToEmpty(grid.getNetwork().insertItem(slot, slot.getCount(), Action.PERFORM)));
if (player != null) {
grid.getNetwork().getItemStorageTracker().changed(player, slot.copy());
}
}
}
} else if (grid.getGridType() == GridType.PATTERN) {