mirror of
https://github.com/AtlasMediaGroup/Scissors.git
synced 2025-07-04 19:06:41 +00:00
Add depth limit to Component deserializer
This commit is contained in:
23
patches/server/0049-Limit-map-decoration-count.patch
Normal file
23
patches/server/0049-Limit-map-decoration-count.patch
Normal file
@ -0,0 +1,23 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Luna <lunahatesgogle@gmail.com>
|
||||
Date: Fri, 28 Apr 2023 18:24:55 -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 6f64d1ce0f5b20e1579f8af64c08ef8fc4e4444b..d78036b62bb36539d3d3e1a8299af2fa60ebd379 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
|
||||
@@ -357,6 +357,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.x) / (float) i;
|
||||
float f1 = (float) (z - (double) this.z) / (float) i;
|
Reference in New Issue
Block a user