Make Pair a record

This commit is contained in:
dfsek
2026-01-01 20:09:52 -07:00
parent eb6b3704d0
commit 47bdd66fe7
11 changed files with 24 additions and 49 deletions

View File

@@ -62,12 +62,12 @@ public final class TerraCLI implements Callable<Integer> {
if(!noSave) {
world.serialize().parallel().forEach(mcaFile -> {
Vector2Int pos = mcaFile.getLeft();
Vector2Int pos = mcaFile.left();
String name = MCAUtil.createNameFromRegionLocation(pos.getX(), pos.getZ());
LOGGER.info("Writing region ({}, {}) to {}", pos.getX(), pos.getZ(), name);
try {
MCAUtil.write(mcaFile.getRight(), name);
MCAUtil.write(mcaFile.right(), name);
} catch(IOException e) {
e.printStackTrace();
}

View File

@@ -37,15 +37,15 @@ public final class TagUtil {
PresetUtil
.getPresets()
.forEach(pair -> MinecraftUtil
.getEntry(registry, pair.getLeft())
.getEntry(registry, pair.left())
.ifPresentOrElse(
preset -> {
boolean useExtendedTag = pair.getRight(); // Get the boolean value from the pair
boolean useExtendedTag = pair.right(); // Get the boolean value from the pair
collect
.computeIfAbsent(useExtendedTag ? WorldPresetTags.EXTENDED : WorldPresetTags.NORMAL, tag -> new ArrayList<>())
.add(preset);
},
() -> logger.error("Preset {} does not exist!", pair.getLeft())));
() -> logger.error("Preset {} does not exist!", pair.left())));
registry.startTagReload(new RegistryTags<>(registry.getKey(), collect)).apply();