From efc41d93d10b4f10d04e2abbe9e42f06c9fb6515 Mon Sep 17 00:00:00 2001 From: Intybyte Date: Mon, 16 Dec 2024 22:40:29 +0100 Subject: [PATCH] Aight --- v1_21/build.gradle.kts | 2 +- .../countercraft/movecraft/compat/v1_21/IWorldHandler.java | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/v1_21/build.gradle.kts b/v1_21/build.gradle.kts index d84125889..a795167e2 100644 --- a/v1_21/build.gradle.kts +++ b/v1_21/build.gradle.kts @@ -7,7 +7,7 @@ java.toolchain.languageVersion = JavaLanguageVersion.of(21) dependencies { api(project(":movecraft-api")) - paperweight.paperDevBundle("1.21.1-R0.1-SNAPSHOT") + paperweight.paperDevBundle("1.21.4-R0.1-SNAPSHOT") } description = "Movecraft-v1_21" diff --git a/v1_21/src/main/java/net/countercraft/movecraft/compat/v1_21/IWorldHandler.java b/v1_21/src/main/java/net/countercraft/movecraft/compat/v1_21/IWorldHandler.java index d4e3cba4b..c2947fa3b 100644 --- a/v1_21/src/main/java/net/countercraft/movecraft/compat/v1_21/IWorldHandler.java +++ b/v1_21/src/main/java/net/countercraft/movecraft/compat/v1_21/IWorldHandler.java @@ -1,5 +1,6 @@ package net.countercraft.movecraft.compat.v1_21; +import ca.spottedleaf.moonrise.common.util.WorldUtil; import net.countercraft.movecraft.MovecraftLocation; import net.countercraft.movecraft.MovecraftRotation; import net.countercraft.movecraft.WorldHandler; @@ -51,7 +52,7 @@ public class IWorldHandler extends WorldHandler { public IWorldHandler() { String version = Bukkit.getServer().getMinecraftVersion(); - if (!version.equals("1.21.1")) + if (!version.equals("1.21.4")) throw new IllegalStateException("Movecraft is not compatible with this version of Minecraft: " + version); } @@ -237,7 +238,7 @@ private BlockPos locationToPosition(@NotNull MovecraftLocation loc) { private void setBlockFast(@NotNull Level world, @NotNull BlockPos position, @NotNull BlockState data) { LevelChunk chunk = world.getChunkAt(position); - int chunkSection = (position.getY() >> 4) - chunk.getMinSection(); + int chunkSection = (position.getY() >> 4) - WorldUtil.getMinSection(chunk.getLevel()); LevelChunkSection section = chunk.getSections()[chunkSection]; if (section == null) { // Put a GLASS block to initialize the section. It will be replaced next with the real block. @@ -251,7 +252,7 @@ private void setBlockFast(@NotNull Level world, @NotNull BlockPos position, @Not section.setBlockState(position.getX() & 15, position.getY() & 15, position.getZ() & 15, data); world.sendBlockUpdated(position, data, data, 3); world.getLightEngine().checkBlock(position); // boolean corresponds to if chunk section empty - chunk.setUnsaved(true); + chunk.markUnsaved(); } @Override