mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-28 23:38:25 +01:00
Prevent compass from loading chunks
This commit is contained in:
parent
0ea0d39edf
commit
f5e9a14a25
1 changed files with 28 additions and 0 deletions
28
patches/server/Prevent-compass-from-loading-chunks.patch
Normal file
28
patches/server/Prevent-compass-from-loading-chunks.patch
Normal file
|
@ -0,0 +1,28 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Shane Freeder <theboyetronic@gmail.com>
|
||||
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 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/world/item/CompassItem.java
|
||||
+++ b/src/main/java/net/minecraft/world/item/CompassItem.java
|
||||
@@ -0,0 +0,0 @@ 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 {
|
||||
@@ -0,0 +0,0 @@ public class CompassItem extends Item implements Vanishable {
|
||||
Optional<ResourceKey<Level>> 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");
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue