PaperMC/patches/server-unmapped/0747-Limit-item-frame-cursors-on-maps.patch

38 lines
2.2 KiB
Diff
Raw Normal View History

2021-06-11 14:02:28 +02:00
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();