diff --git a/gradle.properties b/gradle.properties index e2072f4..f7d241b 100644 --- a/gradle.properties +++ b/gradle.properties @@ -4,9 +4,9 @@ org.gradle.jvmargs=-Xmx1G # Fabric Properties # check these on https://fabricmc.net/use # or better: https://modmuss50.me/fabric.html - minecraft_version=1.16.2 - yarn_mappings=1.16.2+build.47 - loader_version=0.11.1 + minecraft_version=1.16.5 + yarn_mappings=1.16.5+build.10 + loader_version=0.11.6 # Mod Properties mod_version = 0.3.1 diff --git a/src/main/java/com/hadroncfy/sreplay/command/SReplayCommand.java b/src/main/java/com/hadroncfy/sreplay/command/SReplayCommand.java index 04e59a6..b746af7 100644 --- a/src/main/java/com/hadroncfy/sreplay/command/SReplayCommand.java +++ b/src/main/java/com/hadroncfy/sreplay/command/SReplayCommand.java @@ -32,7 +32,7 @@ import java.util.regex.Matcher; import static net.minecraft.server.command.CommandManager.argument; -import static net.minecraft.server.command.CommandSource.suggestMatching; +import static net.minecraft.command.CommandSource.suggestMatching; import static com.hadroncfy.sreplay.recording.Photographer.MCPR; import static com.hadroncfy.sreplay.config.TextRenderer.render; import static com.hadroncfy.sreplay.SReplayMod.getConfig; diff --git a/src/main/java/com/hadroncfy/sreplay/mixin/MixinIntegratedServer.java b/src/main/java/com/hadroncfy/sreplay/mixin/MixinIntegratedServer.java index ac432a9..2559d15 100644 --- a/src/main/java/com/hadroncfy/sreplay/mixin/MixinIntegratedServer.java +++ b/src/main/java/com/hadroncfy/sreplay/mixin/MixinIntegratedServer.java @@ -37,7 +37,7 @@ private MixinIntegratedServer(Thread thread, Impl impl, Session session, SavePro minecraftSessionService, gameProfileRepository, userCache, worldGenerationProgressListenerFactory); } - @Inject(method = "tick", at = @At(value = "INVOKE", target = "Lnet/minecraft/util/profiler/DisableableProfiler;pop()V")) + @Inject(method = "tick", at = @At(value = "INVOKE", target = "Lnet/minecraft/util/profiler/Profiler;pop()V")) public void onPause(CallbackInfo ci) { Photographer.listFakes(this).forEach(Photographer::onSoftPause); } diff --git a/src/main/java/com/hadroncfy/sreplay/mixin/MixinThreadedAnvilChunkStorage.java b/src/main/java/com/hadroncfy/sreplay/mixin/MixinThreadedAnvilChunkStorage.java index 42895a7..c616478 100644 --- a/src/main/java/com/hadroncfy/sreplay/mixin/MixinThreadedAnvilChunkStorage.java +++ b/src/main/java/com/hadroncfy/sreplay/mixin/MixinThreadedAnvilChunkStorage.java @@ -37,7 +37,7 @@ public abstract class MixinThreadedAnvilChunkStorage { return getRealViewDistance(player, watchDistance); } - @Redirect(method = "updateCameraPosition", at = @At( + @Redirect(method = "updatePosition", at = @At( value = "FIELD", target = "Lnet/minecraft/server/world/ThreadedAnvilChunkStorage;watchDistance:I" )) diff --git a/src/main/java/com/hadroncfy/sreplay/recording/Photographer.java b/src/main/java/com/hadroncfy/sreplay/recording/Photographer.java index e948abf..7b40985 100644 --- a/src/main/java/com/hadroncfy/sreplay/recording/Photographer.java +++ b/src/main/java/com/hadroncfy/sreplay/recording/Photographer.java @@ -89,7 +89,7 @@ public static Photographer create(String name, MinecraftServer server, RegistryK ServerWorld world = server.getWorld(dim); ServerPlayerInteractionManager im = new ServerPlayerInteractionManager(world); Photographer ret = new Photographer(server, world, profile, im, outputDir, param); - ret.updatePosition(pos.x, pos.y, pos.z); + ret.setPosition(pos.x, pos.y, pos.z); ((PlayerManagerAccessor) server.getPlayerManager()).getSaveHandler().savePlayerData(ret); return ret; } @@ -144,7 +144,7 @@ private static int getChebyshevDistance(ChunkPos pos, int x, int z) { private void reloadChunks(int oldDistance, int newDistance) { ServerChunkManager chunkManager = getServerWorld().getChunkManager(); ThreadedAnvilChunkStorageAccessor acc = (ThreadedAnvilChunkStorageAccessor) chunkManager.threadedAnvilChunkStorage; - ChunkSectionPos pos = this.getCameraPosition(); + ChunkSectionPos pos = this.getWatchedSection(); int x0 = pos.getSectionX(); int z0 = pos.getSectionZ(); int r = oldDistance > newDistance ? oldDistance : newDistance; @@ -183,8 +183,8 @@ private void connect() throws IOException { trackedPlayers.clear(); server.getPlayerManager().onPlayerConnect(connection, this); syncParams(); - interactionManager.method_30118(MODE);// XXX: is this correct? - getServerWorld().getChunkManager().updateCameraPosition(this); + interactionManager.setGameMode(MODE);// XXX: is this correct? + getServerWorld().getChunkManager().updatePosition(this); int d = this.server.getPlayerManager().getViewDistance(); if (d != this.rparam.watchDistance) { @@ -214,7 +214,7 @@ public void connect(String saveName) throws IOException { public void tick() { if (getServer().getTicks() % 10 == 0) { networkHandler.syncWithPlayerPosition(); - getServerWorld().getChunkManager().updateCameraPosition(this); + getServerWorld().getChunkManager().updatePosition(this); } super.tick(); super.playerTick(); @@ -320,7 +320,7 @@ public void tp(RegistryKey dim, double x, double y, double z) { setWorld(nouveau); server.getPlayerManager().sendWorldInfo(this, nouveau); interactionManager.setWorld(nouveau); - networkHandler.sendPacket(new PlayerRespawnS2CPacket(nouveau.getDimension(), dim, BiomeAccess.hashSeed(nouveau.getSeed()), this.interactionManager.getGameMode(), this.interactionManager.method_30119(), nouveau.isDebugWorld(), nouveau.isFlat(), true)); + networkHandler.sendPacket(new PlayerRespawnS2CPacket(nouveau.getDimension(), dim, BiomeAccess.hashSeed(nouveau.getSeed()), this.interactionManager.getGameMode(), this.interactionManager.getPreviousGameMode(), nouveau.isDebugWorld(), nouveau.isFlat(), true)); nouveau.onPlayerChangeDimension(this); } requestTeleport(x, y, z); diff --git a/src/main/java/com/hadroncfy/sreplay/recording/param/EnumArgumentType.java b/src/main/java/com/hadroncfy/sreplay/recording/param/EnumArgumentType.java index de4208d..cee6c3e 100644 --- a/src/main/java/com/hadroncfy/sreplay/recording/param/EnumArgumentType.java +++ b/src/main/java/com/hadroncfy/sreplay/recording/param/EnumArgumentType.java @@ -11,7 +11,7 @@ import com.mojang.brigadier.suggestion.Suggestions; import com.mojang.brigadier.suggestion.SuggestionsBuilder; -import static net.minecraft.server.command.CommandSource.suggestMatching; +import static net.minecraft.command.CommandSource.suggestMatching; public class EnumArgumentType> implements ArgumentType { private final Class clazz; diff --git a/src/main/java/com/hadroncfy/sreplay/recording/param/OptionManager.java b/src/main/java/com/hadroncfy/sreplay/recording/param/OptionManager.java index 2a2dc60..dc063bb 100644 --- a/src/main/java/com/hadroncfy/sreplay/recording/param/OptionManager.java +++ b/src/main/java/com/hadroncfy/sreplay/recording/param/OptionManager.java @@ -24,7 +24,7 @@ import static net.minecraft.server.command.CommandManager.literal; import static net.minecraft.server.command.CommandManager.argument; -import static net.minecraft.server.command.CommandSource.suggestMatching; +import static net.minecraft.command.CommandSource.suggestMatching; import static com.hadroncfy.sreplay.SReplayMod.getFormats; diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index 44703a4..8f63025 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -28,7 +28,7 @@ "depends": { "fabricloader": ">=0.7.4", - "minecraft": "1.16.2" + "minecraft": "1.16.5" }, "suggests": { "flamingo": "*"