diff --git a/gradle.properties b/gradle.properties index 78b15500..48fc1bee 100644 --- a/gradle.properties +++ b/gradle.properties @@ -5,7 +5,7 @@ org.gradle.jvmargs=-Xmx1G # check these on https://fabricmc.net/use # or better: https://modmuss50.me/fabric.html minecraft_version=1.15-pre1 - yarn_mappings=1.15-pre1+build.3 + yarn_mappings=1.15-pre1+build.7 loader_version=0.7.1+build.173 # Mod Properties diff --git a/src/main/java/carpet/helpers/FeatureGenerator.java b/src/main/java/carpet/helpers/FeatureGenerator.java index fc8ee398..102e22c4 100644 --- a/src/main/java/carpet/helpers/FeatureGenerator.java +++ b/src/main/java/carpet/helpers/FeatureGenerator.java @@ -40,7 +40,7 @@ public class FeatureGenerator { return (w, p) -> { CarpetSettings.skipGenerationChecks=true; - boolean res = feature.generate(w, w.method_14178().getChunkGenerator(), w.random, p, config); + boolean res = feature.generate(w, w.getChunkManager().getChunkGenerator(), w.random, p, config); CarpetSettings.skipGenerationChecks=false; return res; }; @@ -52,7 +52,7 @@ public class FeatureGenerator //if (1+2==3) // throw new RuntimeException("rebuild me"); return (w, p) -> { - ChunkGenerator chunkgen = new OverworldChunkGenerator(w, w.method_14178().getChunkGenerator().getBiomeSource(), new OverworldChunkGeneratorConfig()) // BiomeSourceType.VANILLA_LAYERED.applyConfig((BiomeSourceType.VANILLA_LAYERED.getConfig())), ChunkGeneratorType.SURFACE.createSettings()) + ChunkGenerator chunkgen = new OverworldChunkGenerator(w, w.getChunkManager().getChunkGenerator().getBiomeSource(), new OverworldChunkGeneratorConfig()) // BiomeSourceType.VANILLA_LAYERED.applyConfig((BiomeSourceType.VANILLA_LAYERED.getConfig())), ChunkGeneratorType.SURFACE.createSettings()) { @Override public C getStructureConfig(Biome biome_1, StructureFeature structureFeature_1) diff --git a/src/main/java/carpet/mixins/ClientConnectionMixin.java b/src/main/java/carpet/mixins/ClientConnectionMixin.java index c98ceb6e..2caf403d 100644 --- a/src/main/java/carpet/mixins/ClientConnectionMixin.java +++ b/src/main/java/carpet/mixins/ClientConnectionMixin.java @@ -15,7 +15,7 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; public abstract class ClientConnectionMixin { // Add to the packet counter whenever a packet is received. - @Inject(method = "method_10770", at = @At("HEAD")) + @Inject(method = "channelRead0", at = @At("HEAD")) private void packetInCount(ChannelHandlerContext channelHandlerContext_1, Packet packet_1, CallbackInfo ci) { PacketCounter.totalIn++; diff --git a/src/main/java/carpet/mixins/FossilFeatureMixin.java b/src/main/java/carpet/mixins/FossilFeatureMixin.java index 05a4ad7a..ffb695ce 100644 --- a/src/main/java/carpet/mixins/FossilFeatureMixin.java +++ b/src/main/java/carpet/mixins/FossilFeatureMixin.java @@ -11,7 +11,7 @@ import org.spongepowered.asm.mixin.injection.Redirect; @Mixin(FossilFeature.class) public class FossilFeatureMixin { - @Redirect(method = "method_13236", at = @At( + @Redirect(method = "generate", at = @At( value = "INVOKE", target = "Lnet/minecraft/world/IWorld;getTopY(Lnet/minecraft/world/Heightmap$Type;II)I" )) diff --git a/src/main/java/carpet/mixins/PistonBlockEntityRenderer_movableTEMixin.java b/src/main/java/carpet/mixins/PistonBlockEntityRenderer_movableTEMixin.java index 47118ca4..435d4d94 100644 --- a/src/main/java/carpet/mixins/PistonBlockEntityRenderer_movableTEMixin.java +++ b/src/main/java/carpet/mixins/PistonBlockEntityRenderer_movableTEMixin.java @@ -23,7 +23,7 @@ public abstract class PistonBlockEntityRenderer_movableTEMixin extends BlockEnti super(blockEntityRenderDispatcher_1); } - @Inject(method = "method_3576", at = @At(value = "INVOKE", + @Inject(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/render/block/entity/PistonBlockEntityRenderer;method_3575(Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;Lnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/VertexConsumerProvider;Lnet/minecraft/world/World;ZI)V", ordinal = 3)) private void updateRenderBool(PistonBlockEntity pistonBlockEntity_1, float float_1, MatrixStack matrixStack_1, VertexConsumerProvider layeredVertexConsumerStorage_1, int int_1, int int_2, CallbackInfo ci) //private void updateRenderBool(PistonBlockEntity pistonBlockEntity_1, double double_1, double double_2, double double_3, float float_1, class_4587 class_4587_1, class_4597 class_4597_1, int int_1, CallbackInfo ci) @@ -33,7 +33,7 @@ public abstract class PistonBlockEntityRenderer_movableTEMixin extends BlockEnti } - @Inject(method = "method_3576", at = @At("RETURN"), locals = LocalCapture.NO_CAPTURE) + @Inject(method = "render", at = @At("RETURN"), locals = LocalCapture.NO_CAPTURE) private void endMethod3576(PistonBlockEntity pistonBlockEntity_1, float partialTicks, MatrixStack matrixStack_1, VertexConsumerProvider layeredVertexConsumerStorage_1, int int_1, int init_2, CallbackInfo ci) { if (((PistonBlockEntityInterface) pistonBlockEntity_1).getRenderCarriedBlockEntity()) diff --git a/src/main/java/carpet/mixins/PlayerEntity_horseFixMixin.java b/src/main/java/carpet/mixins/PlayerEntity_horseFixMixin.java index 79821518..547edd30 100644 --- a/src/main/java/carpet/mixins/PlayerEntity_horseFixMixin.java +++ b/src/main/java/carpet/mixins/PlayerEntity_horseFixMixin.java @@ -28,7 +28,7 @@ public abstract class PlayerEntity_horseFixMixin extends Entity { super(entityType_1, world_1); } - + /* fixed in 1.15 pre-2 @Inject(method = "stopRiding", at = @At("HEAD")) private void resetNavigation(CallbackInfo ci) { @@ -38,11 +38,11 @@ public abstract class PlayerEntity_horseFixMixin extends Entity ((MobEntity) getVehicle()).getNavigation().stop(); if (!getEntityWorld().isClient) { - ((ServerWorld) getEntityWorld()).method_14178().sendToNearbyPlayers(this, new EntityPositionS2CPacket(getVehicle())); + ((ServerWorld) getEntityWorld()).getChunkManager().sendToNearbyPlayers(this, new EntityPositionS2CPacket(getVehicle())); // not sure if player at this point is actually considered to be next to the exiting vehicle ((ServerPlayerEntity)(Object)this).networkHandler.sendPacket(new EntityPositionS2CPacket(getVehicle())); ((ServerPlayerEntity)(Object)this).networkHandler.sendPacket(new VehicleMoveS2CPacket(getVehicle())); } } - } + }*/ } diff --git a/src/main/java/carpet/mixins/RedstoneWireBlockMixin.java b/src/main/java/carpet/mixins/RedstoneWireBlockMixin.java index a4125031..354985b3 100644 --- a/src/main/java/carpet/mixins/RedstoneWireBlockMixin.java +++ b/src/main/java/carpet/mixins/RedstoneWireBlockMixin.java @@ -105,7 +105,7 @@ public abstract class RedstoneWireBlockMixin implements RedstoneWireBlockInterfa if (blockState_3.isSimpleFullBlock(world_1, blockPos_2) && !world_1.getBlockState(blockPos_3).isSimpleFullBlock(world_1, blockPos_3)) { int_3 = this.increasePower(int_3, world_1.getBlockState(blockPos_2.up())); } else if (!blockState_3.isSimpleFullBlock(world_1, blockPos_2)) { - int_3 = this.increasePower(int_3, world_1.getBlockState(blockPos_2.method_10074())); + int_3 = this.increasePower(int_3, world_1.getBlockState(blockPos_2.down())); } } } diff --git a/src/main/java/carpet/mixins/ServerWorld_fakePlayersMixin.java b/src/main/java/carpet/mixins/ServerWorld_fakePlayersMixin.java index 73b2bdab..e67556cb 100644 --- a/src/main/java/carpet/mixins/ServerWorld_fakePlayersMixin.java +++ b/src/main/java/carpet/mixins/ServerWorld_fakePlayersMixin.java @@ -27,7 +27,7 @@ public abstract class ServerWorld_fakePlayersMixin if ( !(ticking && serverPlayerEntity_1 instanceof EntityPlayerMPFake) ) serverWorld.removeEntity(entity_1); else - getServer().method_18858(new ServerTask(getServer().getTicks(), () -> + getServer().send(new ServerTask(getServer().getTicks(), () -> { serverWorld.removeEntity(serverPlayerEntity_1); serverPlayerEntity_1.onTeleportationDone(); diff --git a/src/main/java/carpet/mixins/StructureFeatureMixin.java b/src/main/java/carpet/mixins/StructureFeatureMixin.java index 0e84ae04..6fec2aa2 100644 --- a/src/main/java/carpet/mixins/StructureFeatureMixin.java +++ b/src/main/java/carpet/mixins/StructureFeatureMixin.java @@ -35,7 +35,7 @@ public abstract class StructureFeatureMixin implements StructureFeatureInterface @Override public boolean plopAnywhere(ServerWorld world, BlockPos pos) { - return plopAnywhere(world, pos, world.method_14178().getChunkGenerator()); + return plopAnywhere(world, pos, world.getChunkManager().getChunkGenerator()); } @Override public boolean plopAnywhere(ServerWorld world, BlockPos pos, ChunkGenerator generator) diff --git a/src/main/java/carpet/patches/EntityPlayerMPFake.java b/src/main/java/carpet/patches/EntityPlayerMPFake.java index d2c705ae..f9b77745 100644 --- a/src/main/java/carpet/patches/EntityPlayerMPFake.java +++ b/src/main/java/carpet/patches/EntityPlayerMPFake.java @@ -59,7 +59,7 @@ public class EntityPlayerMPFake extends ServerPlayerEntity interactionManagerIn.setGameMode(gamemode); server.getPlayerManager().sendToDimension(new EntitySetHeadYawS2CPacket(instance, (byte) (instance.headYaw * 256 / 360)), instance.dimension); server.getPlayerManager().sendToDimension(new EntityPositionS2CPacket(instance), instance.dimension); - instance.getServerWorld().method_14178().updateCameraPosition(instance); + instance.getServerWorld().getChunkManager().updateCameraPosition(instance); instance.dataTracker.set(PLAYER_MODEL_BIT_MASK, (byte) 0x7f); // show all model layers (incl. capes) return instance; } @@ -84,7 +84,7 @@ public class EntityPlayerMPFake extends ServerPlayerEntity server.getPlayerManager().sendToDimension(new EntitySetHeadYawS2CPacket(playerShadow, (byte) (player.headYaw * 256 / 360)), playerShadow.dimension); server.getPlayerManager().sendToAll(new PlayerListS2CPacket(PlayerListS2CPacket.Action.ADD_PLAYER, playerShadow)); - player.getServerWorld().method_14178().updateCameraPosition(playerShadow); + player.getServerWorld().getChunkManager().updateCameraPosition(playerShadow); return playerShadow; } @@ -96,7 +96,7 @@ public class EntityPlayerMPFake extends ServerPlayerEntity @Override public void kill() { - this.server.method_18858(new ServerTask(this.server.getTicks(), () -> { + this.server.send(new ServerTask(this.server.getTicks(), () -> { this.networkHandler.onDisconnected(Messenger.s("Killed")); })); } @@ -107,7 +107,7 @@ public class EntityPlayerMPFake extends ServerPlayerEntity if (this.getServer().getTicks() % 10 == 0) { this.networkHandler.syncWithPlayerPosition(); - this.getServerWorld().method_14178().updateCameraPosition(this); + this.getServerWorld().getChunkManager().updateCameraPosition(this); } super.tick(); this.playerTick(); diff --git a/src/main/java/carpet/script/CarpetExpression.java b/src/main/java/carpet/script/CarpetExpression.java index 264bf1e5..2d600bee 100644 --- a/src/main/java/carpet/script/CarpetExpression.java +++ b/src/main/java/carpet/script/CarpetExpression.java @@ -307,10 +307,10 @@ public class CarpetExpression for (int i = 0; i<16; i++) { BlockPos section = new BlockPos((pos.getX()>>4 <<4)+8, 16*i, (pos.getZ()>>4 <<4)+8); - world.method_14178().markForUpdate(section); - world.method_14178().markForUpdate(section.east()); - world.method_14178().markForUpdate(section.west()); - world.method_14178().markForUpdate(section.north()); + world.getChunkManager().markForUpdate(section); + world.getChunkManager().markForUpdate(section.east()); + world.getChunkManager().markForUpdate(section.west()); + world.getChunkManager().markForUpdate(section.north()); } } @@ -748,7 +748,7 @@ public class CarpetExpression int howMuch = 1; if (lv.size() > locator.offset+1) howMuch = (int) NumericValue.asNumber(lv.get(locator.offset+1).evalValue(c)).getLong(); - BlockPos retpos = pos.method_10079(dir, howMuch); + BlockPos retpos = pos.offset(dir, howMuch); Value ret = ListValue.of(new NumericValue(retpos.getX()), new NumericValue(retpos.getY()), new NumericValue(retpos.getZ())); return (cc, tt) -> ret; }); @@ -927,7 +927,7 @@ public class CarpetExpression BlockEntity be = world.getBlockEntity(targetPos); if (be != null) { - CompoundTag destTag = data.method_10553(); + CompoundTag destTag = data.copy(); destTag.putInt("x", targetPos.getX()); destTag.putInt("y", targetPos.getY()); destTag.putInt("z", targetPos.getZ()); @@ -2208,7 +2208,7 @@ public class CarpetExpression List neighbours = new ArrayList<>(); neighbours.add(new BlockValue(null, world, center.up())); - neighbours.add(new BlockValue(null, world, center.method_10074())); + neighbours.add(new BlockValue(null, world, center.down())); neighbours.add(new BlockValue(null, world, center.north())); neighbours.add(new BlockValue(null, world, center.south())); neighbours.add(new BlockValue(null, world, center.east())); diff --git a/src/main/java/carpet/script/value/EntityValue.java b/src/main/java/carpet/script/value/EntityValue.java index caa1796b..eae7f115 100644 --- a/src/main/java/carpet/script/value/EntityValue.java +++ b/src/main/java/carpet/script/value/EntityValue.java @@ -466,7 +466,7 @@ public class EntityValue extends Value else { e.setPositionAnglesAndUpdate(x, y, z, yaw, pitch); - ((ServerWorld) e.getEntityWorld()).method_14178().sendToNearbyPlayers(e, new EntityPositionS2CPacket(e)); + ((ServerWorld) e.getEntityWorld()).getChunkManager().sendToNearbyPlayers(e, new EntityPositionS2CPacket(e)); } } diff --git a/src/main/java/carpet/script/value/NBTSerializableValue.java b/src/main/java/carpet/script/value/NBTSerializableValue.java index 3c570fa4..5e72c031 100644 --- a/src/main/java/carpet/script/value/NBTSerializableValue.java +++ b/src/main/java/carpet/script/value/NBTSerializableValue.java @@ -488,7 +488,7 @@ public class NBTSerializableValue extends Value implements ContainerValueInterfa return res; try { - res = NbtPathArgumentType.nbtPath().method_9362(new StringReader(arg)); + res = NbtPathArgumentType.nbtPath().parse(new StringReader(arg)); } catch (CommandSyntaxException exc) { diff --git a/src/main/java/carpet/settings/SettingsManager.java b/src/main/java/carpet/settings/SettingsManager.java index cb21506e..33a42caf 100644 --- a/src/main/java/carpet/settings/SettingsManager.java +++ b/src/main/java/carpet/settings/SettingsManager.java @@ -176,7 +176,7 @@ public class SettingsManager { return; } - server.method_18858(new ServerTask(this.server.getTicks(), () -> + server.send(new ServerTask(this.server.getTicks(), () -> { for (ServerPlayerEntity entityplayermp : server.getPlayerManager().getPlayerList()) { diff --git a/src/main/java/carpet/utils/PerimeterDiagnostics.java b/src/main/java/carpet/utils/PerimeterDiagnostics.java index 07fe0f02..54517276 100644 --- a/src/main/java/carpet/utils/PerimeterDiagnostics.java +++ b/src/main/java/carpet/utils/PerimeterDiagnostics.java @@ -107,7 +107,7 @@ public class PerimeterDiagnostics pos = new BlockPos(eX+x, y, eZ+z); BlockState iblockstate = worldserver.getBlockState(pos); - BlockState iblockstate_down = worldserver.getBlockState(pos.method_10074()); + BlockState iblockstate_down = worldserver.getBlockState(pos.down()); BlockState iblockstate_up = worldserver.getBlockState(pos.up()); if ( iblockstate.getMaterial() == Material.WATER && iblockstate_down.getMaterial() == Material.WATER && !iblockstate_up.isSimpleFullBlock(worldserver, pos)) @@ -155,10 +155,10 @@ public class PerimeterDiagnostics private boolean check_entity_spawn(BlockPos pos) { - if (sle == null || !worldServer.method_14178().getChunkGenerator().getEntitySpawnList(ctype, pos).contains(sle)) + if (sle == null || !worldServer.getChunkManager().getChunkGenerator().getEntitySpawnList(ctype, pos).contains(sle)) { sle = null; - for (Biome.SpawnEntry sle: worldServer.method_14178().getChunkGenerator().getEntitySpawnList(ctype, pos)) + for (Biome.SpawnEntry sle: worldServer.getChunkManager().getChunkGenerator().getEntitySpawnList(ctype, pos)) { if (el.getType() == sle.type) { @@ -166,7 +166,7 @@ public class PerimeterDiagnostics break; } } - if (sle == null || !worldServer.method_14178().getChunkGenerator().getEntitySpawnList(ctype, pos).contains(sle)) + if (sle == null || !worldServer.getChunkManager().getChunkGenerator().getEntitySpawnList(ctype, pos).contains(sle)) { return false; } diff --git a/src/main/java/carpet/utils/SpawnReporter.java b/src/main/java/carpet/utils/SpawnReporter.java index 4122eb19..281cd180 100644 --- a/src/main/java/carpet/utils/SpawnReporter.java +++ b/src/main/java/carpet/utils/SpawnReporter.java @@ -165,7 +165,7 @@ public class SpawnReporter public static List show_mobcaps(BlockPos pos, World worldIn) { - DyeColor under = WoolTool.getWoolColorAtPosition(worldIn, pos.method_10074()); + DyeColor under = WoolTool.getWoolColorAtPosition(worldIn, pos.down()); if (under == null) { if (track_spawns > 0L) @@ -401,7 +401,7 @@ public class SpawnReporter for (EntityCategory enumcreaturetype : EntityCategory.values()) { String type_code = String.format("%s", enumcreaturetype).substring(0, 3); - List lst = ((ChunkGenerator)worldIn.method_14178().getChunkGenerator()).getEntitySpawnList(enumcreaturetype, pos); + List lst = ((ChunkGenerator)worldIn.getChunkManager().getChunkGenerator()).getEntitySpawnList(enumcreaturetype, pos); if (lst != null && !lst.isEmpty()) { for (Biome.SpawnEntry spawnEntry : lst) diff --git a/src/main/java/carpet/utils/WoolTool.java b/src/main/java/carpet/utils/WoolTool.java index 496abfa8..5614b3a0 100644 --- a/src/main/java/carpet/utils/WoolTool.java +++ b/src/main/java/carpet/utils/WoolTool.java @@ -60,7 +60,7 @@ public class WoolTool break; case GRAY: if (CarpetSettings.commandInfo) - Messenger.send(placer, BlockInfo.blockInfo(pos.method_10074(), worldIn)); + Messenger.send(placer, BlockInfo.blockInfo(pos.down(), worldIn)); break; case YELLOW: if (CarpetSettings.commandInfo) @@ -70,7 +70,7 @@ public class WoolTool case GREEN: if (CarpetSettings.hopperCounters) { - DyeColor under = getWoolColorAtPosition(worldIn, pos.method_10074()); + DyeColor under = getWoolColorAtPosition(worldIn, pos.down()); if (under == null) return; HopperCounter counter = HopperCounter.getCounter(under.toString()); if (counter != null) @@ -80,7 +80,7 @@ public class WoolTool case RED: if (CarpetSettings.hopperCounters) { - DyeColor under = getWoolColorAtPosition(worldIn, pos.method_10074()); + DyeColor under = getWoolColorAtPosition(worldIn, pos.down()); if (under == null) return; HopperCounter counter = HopperCounter.getCounter(under.toString()); if (counter == null) return;