aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorShane Freeder <[email protected]>2022-10-13 03:45:53 +0100
committerShane Freeder <[email protected]>2022-10-13 03:45:53 +0100
commite8374371e635b5e3a68792b9841f4fc6ed5f78d5 (patch)
treea2218d67c37c6b0541f6c6cc16ea19401c08143b
parent7fe34e95089808e8d80ecb8c05c6f3b3506b8ed4 (diff)
downloadPaper-e8374371e635b5e3a68792b9841f4fc6ed5f78d5.tar.gz
Paper-e8374371e635b5e3a68792b9841f4fc6ed5f78d5.zip
Add max itemframe decoration limit
-rw-r--r--patches/server/0004-Paper-config-files.patch6
-rw-r--r--patches/server/0926-Add-max-itemframe-decoration-limit.patch32
2 files changed, 36 insertions, 2 deletions
diff --git a/patches/server/0004-Paper-config-files.patch b/patches/server/0004-Paper-config-files.patch
index 7470ff30f6..8b967a572d 100644
--- a/patches/server/0004-Paper-config-files.patch
+++ b/patches/server/0004-Paper-config-files.patch
@@ -431,10 +431,10 @@ index 0000000000000000000000000000000000000000..c2dca89291361d60cbf160cab77749cb
+}
diff --git a/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java b/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java
new file mode 100644
-index 0000000000000000000000000000000000000000..84785fed0d85d78c4caf8fabe35c0e89a59240d5
+index 0000000000000000000000000000000000000000..88b7581633bc59e000319b7239695064ed7f535c
--- /dev/null
+++ b/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java
-@@ -0,0 +1,275 @@
+@@ -0,0 +1,277 @@
+package io.papermc.paper.configuration;
+
+import co.aikar.timings.MinecraftTimings;
@@ -708,6 +708,8 @@ index 0000000000000000000000000000000000000000..84785fed0d85d78c4caf8fabe35c0e89
+ public boolean lagCompensateBlockBreaking = true;
+ public boolean useDimensionTypeForCustomSpawners = false;
+ public boolean strictAdvancementDimensionCheck = false;
++
++ public int maxMapDecorationLimit = 256;
+ }
+}
diff --git a/src/main/java/io/papermc/paper/configuration/InnerClassFieldDiscoverer.java b/src/main/java/io/papermc/paper/configuration/InnerClassFieldDiscoverer.java
diff --git a/patches/server/0926-Add-max-itemframe-decoration-limit.patch b/patches/server/0926-Add-max-itemframe-decoration-limit.patch
new file mode 100644
index 0000000000..f4dcccc936
--- /dev/null
+++ b/patches/server/0926-Add-max-itemframe-decoration-limit.patch
@@ -0,0 +1,32 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Shane Freeder <[email protected]>
+Date: Thu, 13 Oct 2022 03:44:50 +0100
+Subject: [PATCH] Add max itemframe decoration limit
+
+
+diff --git a/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java b/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java
+index d2a77b4ca343d19e1c70afe3f3906a9bd53d0eec..12fbca641932458df554060165a26d8c0df3fd86 100644
+--- a/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java
++++ b/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java
+@@ -455,7 +455,7 @@ public class ItemFrame extends HangingEntity {
+ if (itemstack.is(Items.FILLED_MAP)) {
+ MapItemSavedData worldmap = MapItem.getSavedData(itemstack, this.level);
+
+- if (worldmap != null && worldmap.isTrackedCountOverLimit(256)) {
++ if (worldmap != null && worldmap.isTrackedCountOverLimit(io.papermc.paper.configuration.GlobalConfiguration.get().misc.maxMapDecorationLimit)) { // Paper
+ return InteractionResult.FAIL;
+ }
+ }
+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 67b88da702b780f79c0496cb17f1e6f1f8dd6c2b..a45244c9081e3e503930c7d8b56a318a05d7439f 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
+@@ -482,7 +482,7 @@ public class MapItemSavedData extends SavedData {
+ return true;
+ }
+
+- if (!this.isTrackedCountOverLimit(256)) {
++ if (!this.isTrackedCountOverLimit(io.papermc.paper.configuration.GlobalConfiguration.get().misc.maxMapDecorationLimit)) {
+ this.bannerMarkers.put(mapiconbanner.getId(), mapiconbanner);
+ this.addDecoration(mapiconbanner.getDecoration(), world, mapiconbanner.getId(), d0, d1, 180.0D, mapiconbanner.getName());
+ return true;