diff --git a/v1_18/src/main/java/net/countercraft/movecraft/support/v1_18/IAsyncChunk.java b/v1_18/src/main/java/net/countercraft/movecraft/support/v1_18/IAsyncChunk.java index 72d98448c..2cf850445 100644 --- a/v1_18/src/main/java/net/countercraft/movecraft/support/v1_18/IAsyncChunk.java +++ b/v1_18/src/main/java/net/countercraft/movecraft/support/v1_18/IAsyncChunk.java @@ -7,6 +7,7 @@ import net.countercraft.movecraft.processing.WorldManager; import net.countercraft.movecraft.support.AsyncChunk; import net.minecraft.core.BlockPos; +import net.minecraft.world.level.chunk.ChunkAccess; import org.bukkit.Chunk; import org.bukkit.Material; import org.bukkit.block.BlockState; @@ -26,8 +27,11 @@ public BlockState load(@NotNull MovecraftLocation movecraftLocation) { } }); + private final ChunkAccess handle; + public IAsyncChunk(@NotNull Chunk chunk) { super(chunk); + handle = this.chunk.getHandle(); } @NotNull @@ -51,7 +55,7 @@ public Material getType(@NotNull MovecraftLocation location){ @Override @NotNull public BlockData getData(@NotNull MovecraftLocation location){ - return CraftBlockData.fromData(chunk.getHandle().getBlockState(new BlockPos(location.getX(), location.getY(), location.getZ()))); + return CraftBlockData.fromData(handle.getBlockState(new BlockPos(location.getX(), location.getY(), location.getZ()))); } }