relax constraints when loading corrupted pipes
This commit is contained in:
parent
49747b054e
commit
29d308f4f9
1 changed files with 18 additions and 4 deletions
|
@ -204,10 +204,24 @@ public class SchematicPipe extends SchematicTile {
|
|||
|
||||
if (!nbt.hasKey("version") || nbt.getInteger("version") < 2) {
|
||||
// Schematics previous to the fixes in version 2 had item id
|
||||
// translation badly broken. Building a blueprint that contains
|
||||
// these doesn't make any sense, better to prevent the blueprint to
|
||||
// be built altogether.
|
||||
permission = BuildingPermission.NONE;
|
||||
// translation badly broken. We need to flush out information that
|
||||
// would be otherwise corrupted - that is the inventory (with the
|
||||
// old formalism "items") and gate parameters.
|
||||
cpt.removeTag("items");
|
||||
|
||||
if (cpt.hasKey("Gate")) {
|
||||
NBTTagCompound gateNBT = cpt.getCompoundTag("Gate");
|
||||
|
||||
for (int i = 0; i < 8; ++i) {
|
||||
if (gateNBT.hasKey("triggerParameters[" + i + "]")) {
|
||||
NBTTagCompound parameterNBT = gateNBT.getCompoundTag("triggerParameters[" + i + "]");
|
||||
|
||||
if (parameterNBT.hasKey("stack")) {
|
||||
parameterNBT.removeTag("stack");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue