aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0659-Limit-item-frame-cursors-on-maps.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patches/server/0659-Limit-item-frame-cursors-on-maps.patch')
-rw-r--r--patches/server/0659-Limit-item-frame-cursors-on-maps.patch37
1 files changed, 37 insertions, 0 deletions
diff --git a/patches/server/0659-Limit-item-frame-cursors-on-maps.patch b/patches/server/0659-Limit-item-frame-cursors-on-maps.patch
new file mode 100644
index 0000000000..97ce04c935
--- /dev/null
+++ b/patches/server/0659-Limit-item-frame-cursors-on-maps.patch
@@ -0,0 +1,37 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Yive <[email protected]>
+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 f06c9b615079b8200b45c4cea7aeacaf789159f3..489c81493ecae59c5d02572b447ed2696959c947 100644
+--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
++++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+@@ -823,4 +823,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/MapItemSavedData.java b/src/main/java/net/minecraft/world/level/saveddata/maps/MapItemSavedData.java
+index 4acbcafc158cf11af51d9518ba5b83aaa75f52a1..6a78374b6ab3198571df7e17023d371667ebb24b 100644
+--- a/src/main/java/net/minecraft/world/level/saveddata/maps/MapItemSavedData.java
++++ b/src/main/java/net/minecraft/world/level/saveddata/maps/MapItemSavedData.java
+@@ -295,8 +295,12 @@ public class MapItemSavedData extends SavedData {
+
+ MapFrame worldmapframe1 = new MapFrame(blockposition, entityitemframe.getDirection().get2DDataValue() * 90, entityitemframe.getId());
+
++ // Paper start
++ if (this.decorations.size() < player.level.paperConfig.mapItemFrameCursorLimit) {
+ this.addDecoration(MapDecoration.Type.FRAME, player.level, "frame-" + entityitemframe.getId(), (double) blockposition.getX(), (double) blockposition.getZ(), (double) (entityitemframe.getDirection().get2DDataValue() * 90), (Component) null);
+ this.frameMarkers.put(worldmapframe1.getId(), worldmapframe1);
++ }
++ // Paper end
+ }
+
+ CompoundTag nbttagcompound = stack.getTag();