Skip to content

Commit

Permalink
First stab at 1.21.3
Browse files Browse the repository at this point in the history
  • Loading branch information
TylerS1066 committed Nov 2, 2024
1 parent 6422b98 commit 926151a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Movecraft/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ hangarPublish {
platforms {
register(io.papermc.hangarpublishplugin.model.Platforms.PAPER) {
jar.set(tasks.shadowJar.flatMap { it.archiveFile })
platformVersions.set(listOf("1.20.6", "1.21.1"))
platformVersions.set(listOf("1.20.6", "1.21.3"))
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion v1_21/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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.3-R0.1-SNAPSHOT")
}

description = "Movecraft-v1_21"
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -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.3"))
throw new IllegalStateException("Movecraft is not compatible with this version of Minecraft: " + version);
}

Expand Down Expand Up @@ -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(world);
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.
Expand All @@ -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
Expand Down

0 comments on commit 926151a

Please sign in to comment.