Fixed slight performance issue with loading Crafters from disk. Fixes #2106
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
### 1.6.12
|
||||
- Increased the speed of autocrafting (raoulvdberge)
|
||||
- Fixed External Storage sending storage updates when it is disabled (raoulvdberge)
|
||||
- Fixed slight performance issue with loading Crafters from disk (raoulvdberge)
|
||||
- Added a completion percentage to the Crafting Monitor (raoulvdberge)
|
||||
- Updated Russian translation (kellixon)
|
||||
|
||||
|
@@ -61,12 +61,14 @@ public class NetworkNodeCrafter extends NetworkNode implements ICraftingPatternC
|
||||
protected void onContentsChanged(int slot) {
|
||||
super.onContentsChanged(slot);
|
||||
|
||||
if (!world.isRemote) {
|
||||
invalidate();
|
||||
}
|
||||
if (!reading) {
|
||||
if (!world.isRemote) {
|
||||
invalidate();
|
||||
}
|
||||
|
||||
if (network != null) {
|
||||
network.getCraftingManager().rebuild();
|
||||
if (network != null) {
|
||||
network.getCraftingManager().rebuild();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -91,6 +93,8 @@ public class NetworkNodeCrafter extends NetworkNode implements ICraftingPatternC
|
||||
private boolean locked = false;
|
||||
private boolean wasPowered;
|
||||
|
||||
private boolean reading;
|
||||
|
||||
@Nullable
|
||||
private String displayName;
|
||||
|
||||
@@ -171,12 +175,19 @@ public class NetworkNodeCrafter extends NetworkNode implements ICraftingPatternC
|
||||
public void read(NBTTagCompound tag) {
|
||||
super.read(tag);
|
||||
|
||||
// Fix cascading crafter invalidates while reading patterns
|
||||
this.reading = true;
|
||||
|
||||
StackUtils.readItems(patternsInventory, 0, tag);
|
||||
|
||||
if (API.instance().getOneSixMigrationHelper().migratePatternInventory(patternsInventory)) {
|
||||
markDirty();
|
||||
}
|
||||
|
||||
this.invalidate();
|
||||
|
||||
this.reading = false;
|
||||
|
||||
StackUtils.readItems(upgrades, 1, tag);
|
||||
|
||||
if (tag.hasKey(NBT_DISPLAY_NAME)) {
|
||||
|
Reference in New Issue
Block a user