mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-22 10:35:38 +01:00
8fd4e70db7
This is done by returning the center location of the chunk at the height of the input location when the target chunk isn't loaded already which is exact enough for most use cases and will get more precise once the player is close enough for the chunk being loaded anyways. As this might lead to less precise locations a config option to enable the sync loading of the chunks is provided.
38 lines
2.2 KiB
Diff
38 lines
2.2 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Yive <admin@yive.me>
|
|
Date: Wed, 26 May 2021 15:09:33 -0700
|
|
Subject: [PATCH] Limit item frame cursors on maps
|
|
|
|
|
|
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
|
index 0dd0795af0d0deeff5637a2a1a4a165dec26af15..467f4bd13c58f6724cdda580b95a0d58f516ec12 100644
|
|
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
|
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
|
@@ -817,4 +817,9 @@ public class PaperWorldConfig {
|
|
private void allowUsingSignsInsideSpawnProtection() {
|
|
allowUsingSignsInsideSpawnProtection = getBoolean("allow-using-signs-inside-spawn-protection", allowUsingSignsInsideSpawnProtection);
|
|
}
|
|
+
|
|
+ public int mapItemFrameCursorLimit = 128;
|
|
+ private void mapItemFrameCursorLimit() {
|
|
+ mapItemFrameCursorLimit = getInt("map-item-frame-cursor-limit", mapItemFrameCursorLimit);
|
|
+ }
|
|
}
|
|
diff --git a/src/main/java/net/minecraft/world/level/saveddata/maps/WorldMap.java b/src/main/java/net/minecraft/world/level/saveddata/maps/WorldMap.java
|
|
index 1f9b710f2af3c5067b3c2b73bebb11f8e22c403e..97fe61dcd066ec0ee05e81fc22409d6aa6b3a6d5 100644
|
|
--- a/src/main/java/net/minecraft/world/level/saveddata/maps/WorldMap.java
|
|
+++ b/src/main/java/net/minecraft/world/level/saveddata/maps/WorldMap.java
|
|
@@ -279,8 +279,12 @@ public class WorldMap extends PersistentBase {
|
|
|
|
WorldMapFrame worldmapframe1 = new WorldMapFrame(blockposition, entityitemframe.getDirection().get2DRotationValue() * 90, entityitemframe.getId());
|
|
|
|
+ // Paper start
|
|
+ if (this.decorations.size() < entityhuman.world.paperConfig.mapItemFrameCursorLimit) {
|
|
this.a(MapIcon.Type.FRAME, entityhuman.world, "frame-" + entityitemframe.getId(), (double) blockposition.getX(), (double) blockposition.getZ(), (double) (entityitemframe.getDirection().get2DRotationValue() * 90), (IChatBaseComponent) null);
|
|
this.n.put(worldmapframe1.e(), worldmapframe1);
|
|
+ }
|
|
+ // Paper end
|
|
}
|
|
|
|
NBTTagCompound nbttagcompound = itemstack.getTag();
|