mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-06 19:00:16 +01:00
39 lines
2.2 KiB
Diff
39 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 5eeb09c7cbc743c4273a6d02d9f0c357c2724ba2..436362e1325284278484c7fd10f533041cad89dd 100644
|
|
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
|
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
|
@@ -818,5 +818,10 @@ 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 2e5155fe541ed7040a6be9fdec98b23e8c45bfb0..60d7496966b22e0553372a93e3c0e7ed9e166cba 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
|
|
@@ -296,8 +296,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();
|