Although code for reading schem3 has been added in org.pesoft.worldpainter.layers.bo2.Scheme, due to some reasons, these codes actually cannot run correctly.
Scheme 3 puts all fields in a Component called "schematic", which was placed directly outside in previous versions. As jsons shown below:
Schem3
{
"": {
"Schematic": {
//...
}
}
}
Schem2
{
"": {
//...
}
}
So the Version judgment in the code is actually invalid. When running against schem3, these codes will never be able to read the correct Version value, resulting in a default value of "0".
public final class Schem extends AbstractNBTItem implements WPObject {
@SuppressWarnings("unchecked") // Guaranteed by Minecraft
public Schem(CompoundTag tag, String fallBackName) {
super(tag);
final int version = getInt(TAG_VERSION); //cont read version in schem3, get value "0"
//...
switch (version) {
case 1:
//...
break;
case 2:
//...
break;
case 3: //never go into this branch
//...
break;
default:
throw new IllegalArgumentException("Schem version " + version + " not supported");
}
'''
Although code for reading schem3 has been added in
org.pesoft.worldpainter.layers.bo2.Scheme
, due to some reasons, these codes actually cannot run correctly. Scheme 3 puts all fields in a Component called "schematic", which was placed directly outside in previous versions. As jsons shown below:Schem3
Schem2
So the Version judgment in the code is actually invalid. When running against schem3, these codes will never be able to read the correct Version value, resulting in a default value of "0".