diff --git a/gradle.properties b/gradle.properties index c74cf62f..6ef95dc5 100644 --- a/gradle.properties +++ b/gradle.properties @@ -5,8 +5,8 @@ org.gradle.jvmargs=-Xmx1G # check these on https://fabricmc.net/use # or better: https://modmuss50.me/fabric.html minecraft_version=20w22a - yarn_mappings=20w22a+build.10 - loader_version=0.8.5+build.199 + yarn_mappings=20w22a+build.14 + loader_version=0.8.6+build.200 # Mod Properties mod_version = 1.3.25+v200527 diff --git a/src/main/java/carpet/CarpetSettings.java b/src/main/java/carpet/CarpetSettings.java index 5b6ccf29..2b1eddee 100644 --- a/src/main/java/carpet/CarpetSettings.java +++ b/src/main/java/carpet/CarpetSettings.java @@ -524,7 +524,7 @@ public class CarpetSettings public static class ChangeSpawnChunksValidator extends Validator { public static void changeSpawnSize(int size) { - ServerWorld overworld = CarpetServer.minecraft_server.getWorld(World.field_25179); // OW + ServerWorld overworld = CarpetServer.minecraft_server.getWorld(World.OVERWORLD); // OW if (overworld != null) { ChunkPos centerChunk = new ChunkPos(new BlockPos( overworld.getLevelProperties().getSpawnX(), @@ -546,7 +546,7 @@ public class CarpetSettings //must been some startup thing return newValue; } - ServerWorld currentOverworld = CarpetServer.minecraft_server.getWorld(World.field_25179); // OW + ServerWorld currentOverworld = CarpetServer.minecraft_server.getWorld(World.OVERWORLD); // OW if (currentOverworld != null) { changeSpawnSize(newValue); diff --git a/src/main/java/carpet/commands/PlayerCommand.java b/src/main/java/carpet/commands/PlayerCommand.java index d894f53c..454a93b6 100644 --- a/src/main/java/carpet/commands/PlayerCommand.java +++ b/src/main/java/carpet/commands/PlayerCommand.java @@ -238,7 +238,7 @@ public class PlayerCommand ); RegistryKey dimType = tryGetArg( () -> DimensionArgumentType.getDimensionArgument(context, "dimension"), - () -> source.getWorld().method_27983() // dimension.getType() + () -> source.getWorld().getRegistryKey() // dimension.getType() ); GameMode mode = GameMode.CREATIVE; try diff --git a/src/main/java/carpet/helpers/FeatureGenerator.java b/src/main/java/carpet/helpers/FeatureGenerator.java index 65b1a91d..5dd3844e 100644 --- a/src/main/java/carpet/helpers/FeatureGenerator.java +++ b/src/main/java/carpet/helpers/FeatureGenerator.java @@ -161,7 +161,7 @@ public class FeatureGenerator structureToFeature.put(StructureFeature.VILLAGE, Arrays.asList("village", "village_desert", "village_savanna", "village_taiga", "village_snowy")); structureToFeature.put(StructureFeature.MANSION, Collections.singletonList("mansion")); structureToFeature.put(StructureFeature.BURIED_TREASURE, Collections.singletonList("treasure")); - structureToFeature.put(StructureFeature.field_24851, Collections.singletonList("witch_hut")); + structureToFeature.put(StructureFeature.SWAMP_HUT, Collections.singletonList("witch_hut")); structureToFeature.put(StructureFeature.STRONGHOLD, Collections.singletonList("stronghold")); structureToFeature.put(StructureFeature.DESERT_PYRAMID, Collections.singletonList("desert_temple")); structureToFeature.put(StructureFeature.JUNGLE_PYRAMID, Collections.singletonList("jungle_temple")); @@ -188,7 +188,7 @@ public class FeatureGenerator put("igloo", ((StructureFeatureInterface)StructureFeature.IGLOO)::gridAnywhere); put("shipwreck", gridCustomStructure(StructureFeature.SHIPWRECK, new ShipwreckFeatureConfig(true), Biomes.PLAINS)); put("shipwreck2", gridCustomStructure(StructureFeature.SHIPWRECK, new ShipwreckFeatureConfig(false), Biomes.PLAINS)); - put("witch_hut", ((StructureFeatureInterface)StructureFeature.field_24851)::gridAnywhere); + put("witch_hut", ((StructureFeatureInterface)StructureFeature.SWAMP_HUT)::gridAnywhere); put("stronghold", ((StructureFeatureInterface)StructureFeature.STRONGHOLD)::gridAnywhere); put("ocean_ruin_small", gridCustomStructure(StructureFeature.OCEAN_RUIN, @@ -308,7 +308,7 @@ public class FeatureGenerator put("igloo", ((StructureFeatureInterface)StructureFeature.IGLOO)::plopAnywhere); put("shipwreck", spawnCustomStructure(StructureFeature.SHIPWRECK, new ShipwreckFeatureConfig(true), Biomes.PLAINS)); put("shipwreck2", spawnCustomStructure(StructureFeature.SHIPWRECK, new ShipwreckFeatureConfig(false), Biomes.PLAINS)); - put("witch_hut", ((StructureFeatureInterface)StructureFeature.field_24851)::plopAnywhere); + put("witch_hut", ((StructureFeatureInterface)StructureFeature.SWAMP_HUT)::plopAnywhere); put("stronghold", ((StructureFeatureInterface)StructureFeature.STRONGHOLD)::plopAnywhere); put("ocean_ruin_small", spawnCustomStructure(StructureFeature.OCEAN_RUIN, diff --git a/src/main/java/carpet/helpers/HopperCounter.java b/src/main/java/carpet/helpers/HopperCounter.java index a409126f..139f521a 100644 --- a/src/main/java/carpet/helpers/HopperCounter.java +++ b/src/main/java/carpet/helpers/HopperCounter.java @@ -51,7 +51,7 @@ public class HopperCounter { if (startTick == 0) { - startTick = server.getWorld(World.field_25179).getTime(); //OW + startTick = server.getWorld(World.OVERWORLD).getTime(); //OW startMillis = System.currentTimeMillis(); } Item item = stack.getItem(); @@ -62,7 +62,7 @@ public class HopperCounter public void reset(MinecraftServer server) { counter.clear(); - startTick = server.getWorld(World.field_25179).getTime(); //OW + startTick = server.getWorld(World.OVERWORLD).getTime(); //OW startMillis = System.currentTimeMillis(); // pubSubProvider.publish(); } @@ -106,7 +106,7 @@ public class HopperCounter return Collections.singletonList(Messenger.s(String.format("No items for %s yet", color.getName()))); } long total = getTotalItems(); - long ticks = Math.max(realTime ? (System.currentTimeMillis() - startMillis) / 50 : server.getWorld(World.field_25179).getTime() - startTick, 1); //OW + long ticks = Math.max(realTime ? (System.currentTimeMillis() - startMillis) / 50 : server.getWorld(World.OVERWORLD).getTime() - startTick, 1); //OW if (total == 0) { if (brief) diff --git a/src/main/java/carpet/mixins/FlatChunkGeneratorMixin.java b/src/main/java/carpet/mixins/FlatChunkGeneratorMixin.java index 2068c2c1..9f434ba7 100644 --- a/src/main/java/carpet/mixins/FlatChunkGeneratorMixin.java +++ b/src/main/java/carpet/mixins/FlatChunkGeneratorMixin.java @@ -33,16 +33,16 @@ public abstract class FlatChunkGeneratorMixin extends ChunkGenerator { if (CarpetSettings.flatWorldStructureSpawning) { - if (accessor.method_28388(pos, true, StructureFeature.field_24851).hasChildren()) + if (accessor.method_28388(pos, true, StructureFeature.SWAMP_HUT).hasChildren()) { //swamp hut if (group == SpawnGroup.MONSTER) { - return StructureFeature.field_24851.getMonsterSpawns(); + return StructureFeature.SWAMP_HUT.getMonsterSpawns(); } if (group == SpawnGroup.CREATURE) { - return StructureFeature.field_24851.getCreatureSpawns(); + return StructureFeature.SWAMP_HUT.getCreatureSpawns(); } } diff --git a/src/main/java/carpet/mixins/ServerChunkManagerMixin.java b/src/main/java/carpet/mixins/ServerChunkManagerMixin.java index 740d5836..91afbe4b 100644 --- a/src/main/java/carpet/mixins/ServerChunkManagerMixin.java +++ b/src/main/java/carpet/mixins/ServerChunkManagerMixin.java @@ -49,7 +49,7 @@ public abstract class ServerChunkManagerMixin implements ServerChunkManagerInter private int setupTracking(ChunkTicketManager chunkTicketManager) { int j = chunkTicketManager.getSpawningChunkCount(); - RegistryKey dim = this.world.method_27983(); // getDimensionType; + RegistryKey dim = this.world.getRegistryKey(); // getDimensionType; //((WorldInterface)world).getPrecookedMobs().clear(); not needed because mobs are compared with predefined BBs SpawnReporter.chunkCounts.put(dim, j); @@ -79,7 +79,7 @@ public abstract class ServerChunkManagerMixin implements ServerChunkManagerInter { for (SpawnGroup cat: SpawnGroup.values()) { - RegistryKey dim = world.method_27983(); // getDimensionType; + RegistryKey dim = world.getRegistryKey(); // getDimensionType; Pair key = Pair.of(dim, cat); int spawnTries = SpawnReporter.spawn_tries.get(cat); if (!SpawnReporter.local_spawns.containsKey(cat)) diff --git a/src/main/java/carpet/mixins/ServerPlayerEntity_scarpetEventMixin.java b/src/main/java/carpet/mixins/ServerPlayerEntity_scarpetEventMixin.java index b3b9cee9..7e7c8cb2 100644 --- a/src/main/java/carpet/mixins/ServerPlayerEntity_scarpetEventMixin.java +++ b/src/main/java/carpet/mixins/ServerPlayerEntity_scarpetEventMixin.java @@ -95,7 +95,7 @@ public abstract class ServerPlayerEntity_scarpetEventMixin extends PlayerEntity private void logPreviousCoordinates(RegistryKey newDimension, CallbackInfoReturnable cir) { previousLocation = getPos(); - previousDimension = world.method_27983(); //dimension type + previousDimension = world.getRegistryKey(); //dimension type } @Inject(method = "changeDimension", at = @At("RETURN")) @@ -105,7 +105,7 @@ public abstract class ServerPlayerEntity_scarpetEventMixin extends PlayerEntity { ServerPlayerEntity player = (ServerPlayerEntity) (Object)this; Vec3d to = null; - if (!notInAnyWorld || previousDimension != World.field_25181 || newDimension != World.field_25179) // end ow + if (!notInAnyWorld || previousDimension != World.END || newDimension != World.OVERWORLD) // end ow { to = getPos(); } diff --git a/src/main/java/carpet/mixins/SpawnHelperMixin.java b/src/main/java/carpet/mixins/SpawnHelperMixin.java index 2fd3a74a..e8e53850 100644 --- a/src/main/java/carpet/mixins/SpawnHelperMixin.java +++ b/src/main/java/carpet/mixins/SpawnHelperMixin.java @@ -281,7 +281,7 @@ public class SpawnHelperMixin SpawnGroup entityCategory = var6[var8]; if ((spawnAnimals || !entityCategory.isPeaceful()) && (spawnMonsters || entityCategory.isPeaceful()) && (shouldSpawnAnimals || !entityCategory.isAnimal()) ) { - RegistryKey dim = world.method_27983(); // getDimensionType; + RegistryKey dim = world.getRegistryKey(); // getDimensionType; int newCap = (int) ((double)entityCategory.getCapacity()*(Math.pow(2.0,(SpawnReporter.mobcap_exponent/4)))); int int_2 = SpawnReporter.chunkCounts.get(dim); // eligible chunks for spawning int int_3 = newCap * int_2 / CHUNK_AREA; //current spawning limits diff --git a/src/main/java/carpet/mixins/VillagerEntity_aiMixin.java b/src/main/java/carpet/mixins/VillagerEntity_aiMixin.java index 58546c4f..c7e48887 100644 --- a/src/main/java/carpet/mixins/VillagerEntity_aiMixin.java +++ b/src/main/java/carpet/mixins/VillagerEntity_aiMixin.java @@ -120,7 +120,7 @@ public abstract class VillagerEntity_aiMixin extends AbstractTraderEntity if (itemStack_1.getItem() == Items.EMERALD) { GlobalPos bedPos = this.brain.getOptionalMemory(MemoryModuleType.HOME).orElse(null); - if (bedPos == null || bedPos.getDimension() != world.method_27983()) // get DImension + if (bedPos == null || bedPos.getDimension() != world.getRegistryKey()) // get DImension { sayNo(); ((ServerWorld) getEntityWorld()).spawnParticles(ParticleTypes.BARRIER, getX(), getY() + getStandingEyeHeight() + 1, getZ(), 1, 0.1, 0.1, 0.1, 0.0); diff --git a/src/main/java/carpet/patches/EntityPlayerMPFake.java b/src/main/java/carpet/patches/EntityPlayerMPFake.java index 0e16498e..de2ca657 100644 --- a/src/main/java/carpet/patches/EntityPlayerMPFake.java +++ b/src/main/java/carpet/patches/EntityPlayerMPFake.java @@ -74,7 +74,7 @@ public class EntityPlayerMPFake extends ServerPlayerEntity playerShadow.dataTracker.set(PLAYER_MODEL_PARTS, player.getDataTracker().get(PLAYER_MODEL_PARTS)); - server.getPlayerManager().sendToDimension(new EntitySetHeadYawS2CPacket(playerShadow, (byte) (player.headYaw * 256 / 360)), playerShadow.world.method_27983()); + server.getPlayerManager().sendToDimension(new EntitySetHeadYawS2CPacket(playerShadow, (byte) (player.headYaw * 256 / 360)), playerShadow.world.getRegistryKey()); server.getPlayerManager().sendToAll(new PlayerListS2CPacket(PlayerListS2CPacket.Action.ADD_PLAYER, playerShadow)); player.getServerWorld().getChunkManager().updateCameraPosition(playerShadow); return playerShadow; diff --git a/src/main/java/carpet/script/CarpetEventServer.java b/src/main/java/carpet/script/CarpetEventServer.java index aa26bbb5..6ad0eebf 100644 --- a/src/main/java/carpet/script/CarpetEventServer.java +++ b/src/main/java/carpet/script/CarpetEventServer.java @@ -198,7 +198,7 @@ public class CarpetEventServer { handler.call(Collections::emptyList, () -> CarpetServer.minecraft_server.getCommandSource(). - withWorld(CarpetServer.minecraft_server.getWorld(World.field_25179)) + withWorld(CarpetServer.minecraft_server.getWorld(World.OVERWORLD)) ); } }, @@ -209,7 +209,7 @@ public class CarpetEventServer { handler.call(Collections::emptyList, () -> CarpetServer.minecraft_server.getCommandSource(). - withWorld(CarpetServer.minecraft_server.getWorld(World.field_25180)) + withWorld(CarpetServer.minecraft_server.getWorld(World.NETHER)) ); } }, @@ -220,7 +220,7 @@ public class CarpetEventServer { handler.call(Collections::emptyList, () -> CarpetServer.minecraft_server.getCommandSource(). - withWorld(CarpetServer.minecraft_server.getWorld(World.field_25181)) + withWorld(CarpetServer.minecraft_server.getWorld(World.END)) ); } }, diff --git a/src/main/java/carpet/script/CarpetExpression.java b/src/main/java/carpet/script/CarpetExpression.java index e08efc78..4068127b 100644 --- a/src/main/java/carpet/script/CarpetExpression.java +++ b/src/main/java/carpet/script/CarpetExpression.java @@ -2697,7 +2697,7 @@ public class CarpetExpression for (int i=2; i < lv.size(); i++) paramList.add(lv.get(i).evalValue(c)); params = ShapeDispatcher.parseParams(paramList); } - params.putIfAbsent("dim", new StringValue(cc.s.getWorld().method_27983().getValue().toString())); + params.putIfAbsent("dim", new StringValue(cc.s.getWorld().getRegistryKey().getValue().toString())); params.putIfAbsent("duration", duration); ShapeDispatcher.ExpiringShape shape = ShapeDispatcher.create(cc, shapeType, params); @@ -2983,7 +2983,7 @@ public class CarpetExpression this.expr.addLazyFunction("current_dimension", 0, (c, t, lv) -> { ServerCommandSource s = ((CarpetContext)c).s; - Value retval = new StringValue(NBTSerializableValue.nameFromRegistryId(s.getWorld().method_27983().getValue())); // getDImensionType + Value retval = new StringValue(NBTSerializableValue.nameFromRegistryId(s.getWorld().getRegistryKey().getValue())); // getDImensionType return (cc, tt) -> retval; }); @@ -3020,15 +3020,15 @@ public class CarpetExpression { case "nether": case "the_nether": - innerSource = outerSource.withWorld(outerSource.getMinecraftServer().getWorld(World.field_25180)); //nether + innerSource = outerSource.withWorld(outerSource.getMinecraftServer().getWorld(World.NETHER)); //nether break; case "end": case "the_end": - innerSource = outerSource.withWorld(outerSource.getMinecraftServer().getWorld(World.field_25181)); //end + innerSource = outerSource.withWorld(outerSource.getMinecraftServer().getWorld(World.END)); //end break; case "overworld": case "over_world": - innerSource = outerSource.withWorld(outerSource.getMinecraftServer().getWorld(World.field_25179)); //ow + innerSource = outerSource.withWorld(outerSource.getMinecraftServer().getWorld(World.OVERWORLD)); //ow break; default: throw new InternalExpressionException("Incorrect dimension string: "+dimString); diff --git a/src/main/java/carpet/script/CarpetScriptServer.java b/src/main/java/carpet/script/CarpetScriptServer.java index 52e5e05c..49237b0c 100644 --- a/src/main/java/carpet/script/CarpetScriptServer.java +++ b/src/main/java/carpet/script/CarpetScriptServer.java @@ -76,7 +76,7 @@ public class CarpetScriptServer public Module getModule(String name, boolean allowLibraries) { - File folder = CarpetServer.minecraft_server.method_27050(WorldSavePath.ROOT).resolve("scripts").toFile(); + File folder = CarpetServer.minecraft_server.getSavePath(WorldSavePath.ROOT).resolve("scripts").toFile(); File[] listOfFiles = folder.listFiles(); if (listOfFiles != null) for (File script : listOfFiles) @@ -110,7 +110,7 @@ public class CarpetScriptServer if (!mi.isLibrary()) moduleNames.add(mi.getName()); } } - File folder = CarpetServer.minecraft_server.method_27050(WorldSavePath.ROOT).resolve("scripts").toFile(); + File folder = CarpetServer.minecraft_server.getSavePath(WorldSavePath.ROOT).resolve("scripts").toFile(); File[] listOfFiles = folder.listFiles(); if (listOfFiles == null) return moduleNames; diff --git a/src/main/java/carpet/script/bundled/Module.java b/src/main/java/carpet/script/bundled/Module.java index 32df19b0..66fff341 100644 --- a/src/main/java/carpet/script/bundled/Module.java +++ b/src/main/java/carpet/script/bundled/Module.java @@ -35,7 +35,7 @@ public abstract class Module public static Tag getData(Module module, String file, boolean isShared) { if (!isShared && (module == null || module.getName() == null)) return null; - File dataFile = CarpetServer.minecraft_server.method_27050(WorldSavePath.ROOT).resolve("scripts/"+getDescriptor(module, file, isShared)+".nbt").toFile(); + File dataFile = CarpetServer.minecraft_server.getSavePath(WorldSavePath.ROOT).resolve("scripts/"+getDescriptor(module, file, isShared)+".nbt").toFile(); if (!Files.exists(dataFile.toPath()) || !(dataFile.isFile())) return null; return read(dataFile); } @@ -43,7 +43,7 @@ public abstract class Module public static boolean saveData(Module module, String file, Tag globalState, boolean isShared) { if (!isShared && (module == null || module.getName() == null)) return false; - File dataFile =CarpetServer.minecraft_server.method_27050(WorldSavePath.ROOT).resolve("scripts/"+getDescriptor(module, file, isShared)+".nbt").toFile(); + File dataFile =CarpetServer.minecraft_server.getSavePath(WorldSavePath.ROOT).resolve("scripts/"+getDescriptor(module, file, isShared)+".nbt").toFile(); if (!Files.exists(dataFile.toPath().getParent()) && !dataFile.getParentFile().mkdirs()) return false; return write(globalState, dataFile); } diff --git a/src/main/java/carpet/script/utils/ShapesRenderer.java b/src/main/java/carpet/script/utils/ShapesRenderer.java index 62ce62d3..50fe77d6 100644 --- a/src/main/java/carpet/script/utils/ShapesRenderer.java +++ b/src/main/java/carpet/script/utils/ShapesRenderer.java @@ -41,16 +41,16 @@ public class ShapesRenderer { this.client = minecraftClient; shapes = new HashMap<>(); - shapes.put(World.field_25179, new Int2ObjectOpenHashMap<>()); - shapes.put(World.field_25180, new Int2ObjectOpenHashMap<>()); - shapes.put(World.field_25181, new Int2ObjectOpenHashMap<>()); + shapes.put(World.OVERWORLD, new Int2ObjectOpenHashMap<>()); + shapes.put(World.NETHER, new Int2ObjectOpenHashMap<>()); + shapes.put(World.END, new Int2ObjectOpenHashMap<>()); } public void render(MatrixStack matrices, VertexConsumerProvider vertexConsumers, double cameraX, double cameraY, double cameraZ) { //Camera camera = this.client.gameRenderer.getCamera(); ClientWorld iWorld = this.client.world; - RegistryKey dimensionType = iWorld.method_27983(); + RegistryKey dimensionType = iWorld.getRegistryKey(); if (shapes.get(dimensionType).isEmpty()) return; long currentTime = client.world.getTime(); RenderSystem.disableTexture(); @@ -168,7 +168,7 @@ public class ShapesRenderer { if (shape.followEntity <=0 ) return true; if (client.world == null) return false; - if (client.world.method_27983() != dim) return false; + if (client.world.getRegistryKey() != dim) return false; if (client.world.getEntityById(shape.followEntity) == null) return false; return true; } diff --git a/src/main/java/carpet/script/utils/WorldTools.java b/src/main/java/carpet/script/utils/WorldTools.java index 96f2ab65..4a63d9e1 100644 --- a/src/main/java/carpet/script/utils/WorldTools.java +++ b/src/main/java/carpet/script/utils/WorldTools.java @@ -25,7 +25,7 @@ public class WorldTools if (region == null) return false; return region.hasChunk(chpos); } - Path regionPath = new File(((MinecraftServerInterface )world.getServer()).getCMSession().method_27424(world.method_27983()), "region").toPath(); + Path regionPath = new File(((MinecraftServerInterface )world.getServer()).getCMSession().method_27424(world.getRegistryKey()), "region").toPath(); Path regionFilePath = regionPath.resolve(currentRegionName); File regionFile = regionFilePath.toFile(); if (!regionFile.exists()) diff --git a/src/main/java/carpet/script/value/BlockValue.java b/src/main/java/carpet/script/value/BlockValue.java index 764ea9c1..c090cb40 100644 --- a/src/main/java/carpet/script/value/BlockValue.java +++ b/src/main/java/carpet/script/value/BlockValue.java @@ -169,7 +169,7 @@ public class BlockValue extends Value public int hashCode() { if (world != null && pos != null ) - return GlobalPos.create(world.method_27983() , pos).hashCode(); //getDimension().getType() + return GlobalPos.create(world.getRegistryKey() , pos).hashCode(); //getDimension().getType() return ("b"+getString()).hashCode(); } diff --git a/src/main/java/carpet/script/value/EntityValue.java b/src/main/java/carpet/script/value/EntityValue.java index 7384e8e4..f44b6f62 100644 --- a/src/main/java/carpet/script/value/EntityValue.java +++ b/src/main/java/carpet/script/value/EntityValue.java @@ -249,7 +249,7 @@ public class EntityValue extends Value put("immune_to_fire", (e, a) -> new NumericValue(e.isFireImmune())); put("invulnerable", (e, a) -> new NumericValue(e.isInvulnerable())); - put("dimension", (e, a) -> new StringValue(nameFromRegistryId(e.world.method_27983().getValue()))); // getDimId + put("dimension", (e, a) -> new StringValue(nameFromRegistryId(e.world.getRegistryKey().getValue()))); // getDimId put("height", (e, a) -> new NumericValue(e.getDimensions(EntityPose.STANDING).height)); put("width", (e, a) -> new NumericValue(e.getDimensions(EntityPose.STANDING).width)); put("eye_height", (e, a) -> new NumericValue(e.getStandingEyeHeight())); diff --git a/src/main/java/carpet/settings/SettingsManager.java b/src/main/java/carpet/settings/SettingsManager.java index b851f4db..e371d8e5 100644 --- a/src/main/java/carpet/settings/SettingsManager.java +++ b/src/main/java/carpet/settings/SettingsManager.java @@ -139,7 +139,7 @@ public class SettingsManager private File getFile() { - return server.method_27050(WorldSavePath.ROOT).resolve(identifier+".conf").toFile(); + return server.getSavePath(WorldSavePath.ROOT).resolve(identifier+".conf").toFile(); } public void disableBooleanCommands() diff --git a/src/main/java/carpet/utils/CarpetProfiler.java b/src/main/java/carpet/utils/CarpetProfiler.java index fb54cd68..ca2f3034 100644 --- a/src/main/java/carpet/utils/CarpetProfiler.java +++ b/src/main/java/carpet/utils/CarpetProfiler.java @@ -56,7 +56,7 @@ public class CarpetProfiler private static String getSectionString(World world, String section) { return String.format("%s.%s%s", - world.method_27983().getValue().toString().replaceFirst("minecraft:", ""), + world.getRegistryKey().getValue().toString().replaceFirst("minecraft:", ""), section, // ^ getDImension getId world.isClient ? " (Client)" : ""); } @@ -64,7 +64,7 @@ public class CarpetProfiler private static String getEntityString(World world, Entity e) { return String.format("%s.%s%s", - world.method_27983().getValue().toString().replaceFirst("minecraft:", ""), + world.getRegistryKey().getValue().toString().replaceFirst("minecraft:", ""), Registry.ENTITY_TYPE.getId(e.getType()).toString().replaceFirst("minecraft:", ""), world.isClient ? " (Client)" : ""); } @@ -72,7 +72,7 @@ public class CarpetProfiler private static String getTEntityString(World world, BlockEntity be) { return String.format("%s.%s%s", - world.method_27983().getValue().toString().replaceFirst("minecraft:", ""), + world.getRegistryKey().getValue().toString().replaceFirst("minecraft:", ""), Registry.BLOCK_ENTITY_TYPE.getId(be.getType()).toString().replaceFirst("minecraft:", ""), world.isClient ? " (Client)" : ""); } diff --git a/src/main/java/carpet/utils/HUDController.java b/src/main/java/carpet/utils/HUDController.java index f5be2006..9161aa30 100644 --- a/src/main/java/carpet/utils/HUDController.java +++ b/src/main/java/carpet/utils/HUDController.java @@ -60,17 +60,17 @@ public class HUDController if (LoggerRegistry.__mobcaps) LoggerRegistry.getLogger("mobcaps").log((option, player) -> { - RegistryKey dim = player.world.method_27983(); //getDimType + RegistryKey dim = player.world.getRegistryKey(); //getDimType switch (option) { case "overworld": - dim = World.field_25179; // OW + dim = World.OVERWORLD; // OW break; case "nether": - dim = World.field_25180; // nether + dim = World.NETHER; // nether break; case "end": - dim = World.field_25181; // end + dim = World.END; // end break; } return new BaseText[]{SpawnReporter.printMobcapsForDimension(server.getWorld(dim), false).get(0)}; diff --git a/src/main/java/carpet/utils/Messenger.java b/src/main/java/carpet/utils/Messenger.java index 05b7c57b..8c7a43b5 100644 --- a/src/main/java/carpet/utils/Messenger.java +++ b/src/main/java/carpet/utils/Messenger.java @@ -254,7 +254,7 @@ public class Messenger public static void m(ServerCommandSource source, Object ... fields) { if (source != null) - source.sendFeedback(Messenger.c(fields),source.getMinecraftServer() != null && source.getMinecraftServer().getWorld(World.field_25179) != null); //OW + source.sendFeedback(Messenger.c(fields),source.getMinecraftServer() != null && source.getMinecraftServer().getWorld(World.OVERWORLD) != null); //OW } public static void m(PlayerEntity player, Object ... fields) { diff --git a/src/main/java/carpet/utils/SpawnReporter.java b/src/main/java/carpet/utils/SpawnReporter.java index f0dcb84b..6fa72cf9 100644 --- a/src/main/java/carpet/utils/SpawnReporter.java +++ b/src/main/java/carpet/utils/SpawnReporter.java @@ -75,7 +75,7 @@ public class SpawnReporter return; } } - Pair, SpawnGroup> key = Pair.of(mob.world.method_27983(), cat); + Pair, SpawnGroup> key = Pair.of(mob.world.getRegistryKey(), cat); long count = spawn_stats.get(key).getOrDefault(mob.getType(), 0L); spawn_stats.get(key).put(mob.getType(), count + 1); spawned_mobs.get(key).put(Pair.of(mob.getType(), pos)); @@ -85,7 +85,7 @@ public class SpawnReporter public static List printMobcapsForDimension(ServerWorld world, boolean multiline) { - RegistryKey dim = world.method_27983(); + RegistryKey dim = world.getRegistryKey(); String name = dim.toString(); List lst = new ArrayList<>(); if (multiline) @@ -149,7 +149,7 @@ public class SpawnReporter String type_code = creature_type.getName(); lst.add(Messenger.s(String.format("Recent %s spawns:",type_code))); - for (Pair pair : spawned_mobs.get(Pair.of(world.method_27983(), creature_type)).keySet()) // getDImTYpe + for (Pair pair : spawned_mobs.get(Pair.of(world.getRegistryKey(), creature_type)).keySet()) // getDImTYpe { lst.add( Messenger.c( "w - ", @@ -305,7 +305,7 @@ public class SpawnReporter { spawn_tries.put(enumcreaturetype, 1); } - for (RegistryKey dim : Arrays.asList(World.field_25179, World.field_25180, World.field_25181)) + for (RegistryKey dim : Arrays.asList(World.OVERWORLD, World.NETHER, World.END)) { Pair, SpawnGroup> key = Pair.of(dim, enumcreaturetype); overall_spawn_ticks.put(key, 0L);