diff --git a/patches/server/0936-Prevent-compass-from-loading-chunks.patch b/patches/server/0936-Prevent-compass-from-loading-chunks.patch new file mode 100644 index 0000000000..38122a5e6c --- /dev/null +++ b/patches/server/0936-Prevent-compass-from-loading-chunks.patch @@ -0,0 +1,28 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Shane Freeder +Date: Sun, 6 Nov 2022 22:35:51 +0000 +Subject: [PATCH] Prevent compass from loading chunks + + +diff --git a/src/main/java/net/minecraft/world/item/CompassItem.java b/src/main/java/net/minecraft/world/item/CompassItem.java +index 5d3047a420efe59063e90bfc7b42392127e0ad7d..f77270ba7c6c9b544b958771d54dfbc04df2d3c5 100644 +--- a/src/main/java/net/minecraft/world/item/CompassItem.java ++++ b/src/main/java/net/minecraft/world/item/CompassItem.java +@@ -19,6 +19,8 @@ import net.minecraft.world.entity.player.Player; + import net.minecraft.world.item.context.UseOnContext; + import net.minecraft.world.level.Level; + import net.minecraft.world.level.block.Blocks; ++import net.minecraft.world.level.chunk.ChunkStatus; ++ + import org.slf4j.Logger; + + public class CompassItem extends Item implements Vanishable { +@@ -77,7 +79,7 @@ public class CompassItem extends Item implements Vanishable { + Optional> optional = getLodestoneDimension(compoundTag); + if (optional.isPresent() && optional.get() == world.dimension() && compoundTag.contains("LodestonePos")) { + BlockPos blockPos = NbtUtils.readBlockPos(compoundTag.getCompound("LodestonePos")); +- if (!world.isInWorldBounds(blockPos) || !((ServerLevel)world).getPoiManager().existsAtPosition(PoiTypes.LODESTONE, blockPos)) { ++ if (!world.isInWorldBounds(blockPos) || (world.hasChunkAt(blockPos) && !((ServerLevel)world).getPoiManager().existsAtPosition(PoiTypes.LODESTONE, blockPos))) { // Paper + compoundTag.remove("LodestonePos"); + } + }