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