11package net .countercraft .movecraft .compat .v1_21 ;
22
3+ import ca .spottedleaf .moonrise .common .util .WorldUtil ;
34import net .countercraft .movecraft .MovecraftLocation ;
45import net .countercraft .movecraft .MovecraftRotation ;
56import net .countercraft .movecraft .WorldHandler ;
@@ -51,7 +52,7 @@ public class IWorldHandler extends WorldHandler {
5152
5253 public IWorldHandler () {
5354 String version = Bukkit .getServer ().getMinecraftVersion ();
54- if (!version .equals ("1.21.1 " ))
55+ if (!version .equals ("1.21.4 " ))
5556 throw new IllegalStateException ("Movecraft is not compatible with this version of Minecraft: " + version );
5657 }
5758
@@ -237,7 +238,7 @@ private BlockPos locationToPosition(@NotNull MovecraftLocation loc) {
237238
238239 private void setBlockFast (@ NotNull Level world , @ NotNull BlockPos position , @ NotNull BlockState data ) {
239240 LevelChunk chunk = world .getChunkAt (position );
240- int chunkSection = (position .getY () >> 4 ) - chunk .getMinSection ();
241+ int chunkSection = (position .getY () >> 4 ) - WorldUtil .getMinSection (world );
241242 LevelChunkSection section = chunk .getSections ()[chunkSection ];
242243 if (section == null ) {
243244 // 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
251252 section .setBlockState (position .getX () & 15 , position .getY () & 15 , position .getZ () & 15 , data );
252253 world .sendBlockUpdated (position , data , data , 3 );
253254 world .getLightEngine ().checkBlock (position ); // boolean corresponds to if chunk section empty
254- chunk .setUnsaved ( true );
255+ chunk .markUnsaved ( );
255256 }
256257
257258 @ Override
0 commit comments