mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-07-12 08:38:34 +00:00
Replace BlockStates reading with new 1.16 logic (#1413)
* Replace BlockStates reading with new 1.16 logic * Account for running on older platforms Splits out the new reading to AnvilChunk16, uses data version to detect the appropriate version. * Move data versions to Constants Also fixes some logic hiccups that become obvious with the new names. * Fix LegacyMapper DFU handling * Fix factor indexing (cherry picked from commit 8c171f0929e8530aab1731d122649adc58c5161f)
This commit is contained in:
@ -39,7 +39,7 @@ import com.sk89q.worldedit.extension.platform.Capability;
|
||||
import com.sk89q.worldedit.extension.platform.Platform;
|
||||
import com.sk89q.worldedit.extent.clipboard.BlockArrayClipboard;
|
||||
import com.sk89q.worldedit.extent.clipboard.Clipboard;
|
||||
import com.sk89q.worldedit.math.BlockVector2;
|
||||
import com.sk89q.worldedit.internal.Constants;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.regions.CuboidRegion;
|
||||
import com.sk89q.worldedit.regions.Region;
|
||||
@ -97,7 +97,7 @@ public class SpongeSchematicReader extends NBTSchematicReader {
|
||||
int liveDataVersion = platform.getDataVersion();
|
||||
|
||||
if (schematicVersion == 1) {
|
||||
dataVersion = 1631; // this is a relatively safe assumption unless someone imports a schematic from 1.12, e.g. sponge 7.1-
|
||||
dataVersion = Constants.DATA_VERSION_MC_1_13_2; // this is a relatively safe assumption unless someone imports a schematic from 1.12, e.g. sponge 7.1-
|
||||
fixer = platform.getDataFixer();
|
||||
return readVersion1(schematicTag);
|
||||
} else if (schematicVersion == 2) {
|
||||
@ -128,7 +128,7 @@ public class SpongeSchematicReader extends NBTSchematicReader {
|
||||
CompoundTag schematicTag = getBaseTag();
|
||||
Map<String, Tag> schematic = schematicTag.getValue();
|
||||
if (schematicVersion == 1) {
|
||||
return OptionalInt.of(1631);
|
||||
return OptionalInt.of(Constants.DATA_VERSION_MC_1_13_2);
|
||||
} else if (schematicVersion == 2) {
|
||||
return OptionalInt.of(requireTag(schematic, "DataVersion", IntTag.class).getValue());
|
||||
}
|
||||
@ -322,7 +322,7 @@ public class SpongeSchematicReader extends NBTSchematicReader {
|
||||
BiomeType biome = BiomeTypes.get(key);
|
||||
if (biome == null) {
|
||||
log.warn("Unknown biome type :" + key +
|
||||
" in palette. Are you missing a mod or using a schematic made in a newer version of Minecraft?");
|
||||
" in palette. Are you missing a mod or using a schematic made in a newer version of Minecraft?");
|
||||
}
|
||||
Tag idTag = palettePart.getValue();
|
||||
if (!(idTag instanceof IntTag)) {
|
||||
@ -338,7 +338,7 @@ public class SpongeSchematicReader extends NBTSchematicReader {
|
||||
int biomeJ = 0;
|
||||
int bVal;
|
||||
int varIntLength;
|
||||
BlockVector2 min = clipboard.getMinimumPoint().toBlockVector2();
|
||||
BlockVector3 min = clipboard.getMinimumPoint();
|
||||
while (biomeJ < biomes.length) {
|
||||
bVal = 0;
|
||||
varIntLength = 0;
|
||||
@ -357,7 +357,9 @@ public class SpongeSchematicReader extends NBTSchematicReader {
|
||||
int z = biomeIndex / width;
|
||||
int x = biomeIndex % width;
|
||||
BiomeType type = palette.get(bVal);
|
||||
clipboard.setBiome(min.add(x, z), type);
|
||||
for (int y = 0; y < clipboard.getRegion().getHeight(); y++) {
|
||||
clipboard.setBiome(min.add(x, y, z), type);
|
||||
}
|
||||
biomeIndex++;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user