Merge map decoration patches

This commit is contained in:
Allink 2023-06-17 00:25:42 +01:00
parent 8ea9faadc7
commit cc8f9782d5
No known key found for this signature in database
13 changed files with 22 additions and 46 deletions

View File

@ -1,7 +1,7 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Luna <lunahatesgogle@gmail.com> From: Luna <lunahatesgogle@gmail.com>
Date: Fri, 28 Apr 2023 16:29:23 -0300 Date: Fri, 28 Apr 2023 16:29:23 -0300
Subject: [PATCH] Limit map decoration text length Subject: [PATCH] Limit map decorations
diff --git a/src/main/java/net/minecraft/world/level/saveddata/maps/MapDecoration.java b/src/main/java/net/minecraft/world/level/saveddata/maps/MapDecoration.java diff --git a/src/main/java/net/minecraft/world/level/saveddata/maps/MapDecoration.java b/src/main/java/net/minecraft/world/level/saveddata/maps/MapDecoration.java
@ -29,3 +29,20 @@ index 347d2914f9560a3ee8cea59444bc0dfbb7cf3456..b225f770869832775c9a8a79ffaf89e9
this.type = type; this.type = type;
this.x = x; this.x = x;
this.y = z; this.y = z;
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 3b12030b49b1c539684d75ca3896eb498400ef99..a1f042e5329343489cf30e436a8f553d39e5a6e4 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
@@ -354,6 +354,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;

View File

@ -1,23 +0,0 @@
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 3b12030b49b1c539684d75ca3896eb498400ef99..a1f042e5329343489cf30e436a8f553d39e5a6e4 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
@@ -354,6 +354,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;

View File

@ -5,7 +5,7 @@ Subject: [PATCH] Prevent player banning using duplicate UUIDs
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index 2ac23779222369ace69f1e3f7fb12184865b7a43..05c8e4e30b2dce565e84f4c09b3f27244f8c0451 100644 index 18aac3da3c88f33b1a71a5920a8daa27e9723913..f5b59d0ab82472e1c992ffb6a8b7fbb687a2b70f 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java --- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -1610,7 +1610,14 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -1610,7 +1610,14 @@ public class ServerLevel extends Level implements WorldGenLevel {

View File

@ -5,7 +5,7 @@ Subject: [PATCH] Make excluding players from nbt components configurable
diff --git a/src/main/java/me/totalfreedom/scissors/ScissorsConfig.java b/src/main/java/me/totalfreedom/scissors/ScissorsConfig.java diff --git a/src/main/java/me/totalfreedom/scissors/ScissorsConfig.java b/src/main/java/me/totalfreedom/scissors/ScissorsConfig.java
index 9f2a51fddb692f5152c32dcbe1f5a6ba150634e4..39b56ca496ed7369ead21805d476c2b813fcdd1d 100644 index ec93980fefcab57b7bac78d2fc4a217b376b7eca..44920c46aa75bcdc450e192d8c8ca0bf7ad0b7d5 100644
--- a/src/main/java/me/totalfreedom/scissors/ScissorsConfig.java --- a/src/main/java/me/totalfreedom/scissors/ScissorsConfig.java
+++ b/src/main/java/me/totalfreedom/scissors/ScissorsConfig.java +++ b/src/main/java/me/totalfreedom/scissors/ScissorsConfig.java
@@ -87,8 +87,8 @@ public class ScissorsConfig @@ -87,8 +87,8 @@ public class ScissorsConfig

View File

@ -5,7 +5,7 @@ Subject: [PATCH] Add depth limit to Component deserializer
diff --git a/src/main/java/me/totalfreedom/scissors/ScissorsConfig.java b/src/main/java/me/totalfreedom/scissors/ScissorsConfig.java diff --git a/src/main/java/me/totalfreedom/scissors/ScissorsConfig.java b/src/main/java/me/totalfreedom/scissors/ScissorsConfig.java
index 39b56ca496ed7369ead21805d476c2b813fcdd1d..9659cff6412584190ff0c32e01f602de4ff7d3b3 100644 index 44920c46aa75bcdc450e192d8c8ca0bf7ad0b7d5..56aa12b57d893b0be9ff7a18df87645dae2c8a19 100644
--- a/src/main/java/me/totalfreedom/scissors/ScissorsConfig.java --- a/src/main/java/me/totalfreedom/scissors/ScissorsConfig.java
+++ b/src/main/java/me/totalfreedom/scissors/ScissorsConfig.java +++ b/src/main/java/me/totalfreedom/scissors/ScissorsConfig.java
@@ -87,8 +87,8 @@ public class ScissorsConfig @@ -87,8 +87,8 @@ public class ScissorsConfig

View File

@ -5,7 +5,7 @@ Subject: [PATCH] Limit beacon effectRange
diff --git a/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java diff --git a/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java
index f2325c0c475bb465f5275f78c71949648a860d0c..4ec228ce026ee39eebd17d180fb5caea1b74e6e2 100644 index 5005a0ad5f703727ea9c618ae4b769a77d5655b5..8645ebb37dfab4e76b238a3660816a59018d3dde 100644
--- a/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java --- a/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java
+++ b/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java +++ b/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java
@@ -83,7 +83,7 @@ public class BeaconBlockEntity extends BlockEntity implements MenuProvider, Name @@ -83,7 +83,7 @@ public class BeaconBlockEntity extends BlockEntity implements MenuProvider, Name

View File

@ -1,18 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Luna <lunahatesgogle@gmail.com>
Date: Tue, 13 Jun 2023 18:29:18 -0300
Subject: [PATCH] Catch null ResourceLocations in CraftNamespacedKey
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftNamespacedKey.java b/src/main/java/org/bukkit/craftbukkit/util/CraftNamespacedKey.java
index 5014192edb9616ce725fc1592832034789527b6f..64da1b0afd51720803aba0d9e86d0b1743bdb0da 100644
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftNamespacedKey.java
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftNamespacedKey.java
@@ -21,6 +21,7 @@ public final class CraftNamespacedKey {
}
public static NamespacedKey fromMinecraft(ResourceLocation minecraft) {
+ if (minecraft == null) throw new IllegalArgumentException("Null ResourceLocation provided"); // Scissors
return new NamespacedKey(minecraft.getNamespace(), minecraft.getPath());
}