mirror of
https://github.com/AtlasMediaGroup/Scissors.git
synced 2024-11-18 03:06:11 +00:00
cbfc1beb6a
* Add depth limit to Component deserializer * Make depth limit configurable; increase placeholder penalty
24 lines
1.2 KiB
Diff
24 lines
1.2 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Luna <lunahatesgogle@gmail.com>
|
|
Date: Fri, 28 Apr 2023 16:34:15 -0300
|
|
Subject: [PATCH] Limit map decoration count
|
|
|
|
|
|
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 25a64250ce57fe4cd90f8b95d1e003d961662152..60e013d418b1aa8c154ca9474186191aa5c9041d 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
|
|
@@ -356,6 +356,12 @@ public class MapItemSavedData extends SavedData {
|
|
}
|
|
|
|
private void addDecoration(MapDecoration.Type type, @Nullable LevelAccessor world, String key, double x, double z, double rotation, @Nullable Component text) {
|
|
+ // Scissors start - Limit decoration count
|
|
+ if (this.decorations.size() > 32) {
|
|
+ return;
|
|
+ }
|
|
+ // Scissors end
|
|
+
|
|
int i = 1 << this.scale;
|
|
float f = (float) (x - (double) this.centerX) / (float) i;
|
|
float f1 = (float) (z - (double) this.centerZ) / (float) i;
|