From cc8f9782d5d49e1a3444ce9adeafb795e137fe2d Mon Sep 17 00:00:00 2001 From: Allink Date: Sat, 17 Jun 2023 00:25:42 +0100 Subject: [PATCH] Merge map decoration patches --- ...patch => 0041-Limit-map-decorations.patch} | 19 ++++++++++++++- .../0042-Limit-map-decoration-count.patch | 23 ------------------- ...layer-banning-using-duplicate-UUIDs.patch} | 2 +- ...on-t-warn-on-duplicate-entity-UUIDs.patch} | 0 ...ayers-from-nbt-components-configura.patch} | 2 +- ...component-extra-empty-array-exploit.patch} | 0 ...pth-limit-to-Component-deserializer.patch} | 2 +- ...tch => 0047-Add-depth-limit-to-SNBT.patch} | 0 ...0048-Implement-command-block-events.patch} | 0 ...ch => 0049-Limit-beacon-effectRange.patch} | 2 +- ...0050-Fix-invalid-armor-trim-exploit.patch} | 0 ...ove-validation-of-ResourceLocations.patch} | 0 ...ourceLocations-in-CraftNamespacedKey.patch | 18 --------------- 13 files changed, 22 insertions(+), 46 deletions(-) rename patches/server/{0041-Limit-map-decoration-text-length.patch => 0041-Limit-map-decorations.patch} (54%) delete mode 100644 patches/server/0042-Limit-map-decoration-count.patch rename patches/server/{0043-Prevent-player-banning-using-duplicate-UUIDs.patch => 0042-Prevent-player-banning-using-duplicate-UUIDs.patch} (92%) rename patches/server/{0044-Don-t-warn-on-duplicate-entity-UUIDs.patch => 0043-Don-t-warn-on-duplicate-entity-UUIDs.patch} (100%) rename patches/server/{0045-Make-excluding-players-from-nbt-components-configura.patch => 0044-Make-excluding-players-from-nbt-components-configura.patch} (96%) rename patches/server/{0046-Fix-component-extra-empty-array-exploit.patch => 0045-Fix-component-extra-empty-array-exploit.patch} (100%) rename patches/server/{0047-Add-depth-limit-to-Component-deserializer.patch => 0046-Add-depth-limit-to-Component-deserializer.patch} (98%) rename patches/server/{0048-Add-depth-limit-to-SNBT.patch => 0047-Add-depth-limit-to-SNBT.patch} (100%) rename patches/server/{0049-Implement-command-block-events.patch => 0048-Implement-command-block-events.patch} (100%) rename patches/server/{0050-Limit-beacon-effectRange.patch => 0049-Limit-beacon-effectRange.patch} (92%) rename patches/server/{0051-Fix-invalid-armor-trim-exploit.patch => 0050-Fix-invalid-armor-trim-exploit.patch} (100%) rename patches/server/{0052-Improve-validation-of-ResourceLocations.patch => 0051-Improve-validation-of-ResourceLocations.patch} (100%) delete mode 100644 patches/server/0052-Catch-null-ResourceLocations-in-CraftNamespacedKey.patch diff --git a/patches/server/0041-Limit-map-decoration-text-length.patch b/patches/server/0041-Limit-map-decorations.patch similarity index 54% rename from patches/server/0041-Limit-map-decoration-text-length.patch rename to patches/server/0041-Limit-map-decorations.patch index b979d3f..1457972 100644 --- a/patches/server/0041-Limit-map-decoration-text-length.patch +++ b/patches/server/0041-Limit-map-decorations.patch @@ -1,7 +1,7 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Luna 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 @@ -29,3 +29,20 @@ index 347d2914f9560a3ee8cea59444bc0dfbb7cf3456..b225f770869832775c9a8a79ffaf89e9 this.type = type; this.x = x; 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; diff --git a/patches/server/0042-Limit-map-decoration-count.patch b/patches/server/0042-Limit-map-decoration-count.patch deleted file mode 100644 index db74dae..0000000 --- a/patches/server/0042-Limit-map-decoration-count.patch +++ /dev/null @@ -1,23 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Luna -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; diff --git a/patches/server/0043-Prevent-player-banning-using-duplicate-UUIDs.patch b/patches/server/0042-Prevent-player-banning-using-duplicate-UUIDs.patch similarity index 92% rename from patches/server/0043-Prevent-player-banning-using-duplicate-UUIDs.patch rename to patches/server/0042-Prevent-player-banning-using-duplicate-UUIDs.patch index 049979c..443f2ee 100644 --- a/patches/server/0043-Prevent-player-banning-using-duplicate-UUIDs.patch +++ b/patches/server/0042-Prevent-player-banning-using-duplicate-UUIDs.patch @@ -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 -index 2ac23779222369ace69f1e3f7fb12184865b7a43..05c8e4e30b2dce565e84f4c09b3f27244f8c0451 100644 +index 18aac3da3c88f33b1a71a5920a8daa27e9723913..f5b59d0ab82472e1c992ffb6a8b7fbb687a2b70f 100644 --- a/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 { diff --git a/patches/server/0044-Don-t-warn-on-duplicate-entity-UUIDs.patch b/patches/server/0043-Don-t-warn-on-duplicate-entity-UUIDs.patch similarity index 100% rename from patches/server/0044-Don-t-warn-on-duplicate-entity-UUIDs.patch rename to patches/server/0043-Don-t-warn-on-duplicate-entity-UUIDs.patch diff --git a/patches/server/0045-Make-excluding-players-from-nbt-components-configura.patch b/patches/server/0044-Make-excluding-players-from-nbt-components-configura.patch similarity index 96% rename from patches/server/0045-Make-excluding-players-from-nbt-components-configura.patch rename to patches/server/0044-Make-excluding-players-from-nbt-components-configura.patch index 427a4f3..c4e6299 100644 --- a/patches/server/0045-Make-excluding-players-from-nbt-components-configura.patch +++ b/patches/server/0044-Make-excluding-players-from-nbt-components-configura.patch @@ -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 -index 9f2a51fddb692f5152c32dcbe1f5a6ba150634e4..39b56ca496ed7369ead21805d476c2b813fcdd1d 100644 +index ec93980fefcab57b7bac78d2fc4a217b376b7eca..44920c46aa75bcdc450e192d8c8ca0bf7ad0b7d5 100644 --- a/src/main/java/me/totalfreedom/scissors/ScissorsConfig.java +++ b/src/main/java/me/totalfreedom/scissors/ScissorsConfig.java @@ -87,8 +87,8 @@ public class ScissorsConfig diff --git a/patches/server/0046-Fix-component-extra-empty-array-exploit.patch b/patches/server/0045-Fix-component-extra-empty-array-exploit.patch similarity index 100% rename from patches/server/0046-Fix-component-extra-empty-array-exploit.patch rename to patches/server/0045-Fix-component-extra-empty-array-exploit.patch diff --git a/patches/server/0047-Add-depth-limit-to-Component-deserializer.patch b/patches/server/0046-Add-depth-limit-to-Component-deserializer.patch similarity index 98% rename from patches/server/0047-Add-depth-limit-to-Component-deserializer.patch rename to patches/server/0046-Add-depth-limit-to-Component-deserializer.patch index c017ffd..e72e6ff 100644 --- a/patches/server/0047-Add-depth-limit-to-Component-deserializer.patch +++ b/patches/server/0046-Add-depth-limit-to-Component-deserializer.patch @@ -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 -index 39b56ca496ed7369ead21805d476c2b813fcdd1d..9659cff6412584190ff0c32e01f602de4ff7d3b3 100644 +index 44920c46aa75bcdc450e192d8c8ca0bf7ad0b7d5..56aa12b57d893b0be9ff7a18df87645dae2c8a19 100644 --- a/src/main/java/me/totalfreedom/scissors/ScissorsConfig.java +++ b/src/main/java/me/totalfreedom/scissors/ScissorsConfig.java @@ -87,8 +87,8 @@ public class ScissorsConfig diff --git a/patches/server/0048-Add-depth-limit-to-SNBT.patch b/patches/server/0047-Add-depth-limit-to-SNBT.patch similarity index 100% rename from patches/server/0048-Add-depth-limit-to-SNBT.patch rename to patches/server/0047-Add-depth-limit-to-SNBT.patch diff --git a/patches/server/0049-Implement-command-block-events.patch b/patches/server/0048-Implement-command-block-events.patch similarity index 100% rename from patches/server/0049-Implement-command-block-events.patch rename to patches/server/0048-Implement-command-block-events.patch diff --git a/patches/server/0050-Limit-beacon-effectRange.patch b/patches/server/0049-Limit-beacon-effectRange.patch similarity index 92% rename from patches/server/0050-Limit-beacon-effectRange.patch rename to patches/server/0049-Limit-beacon-effectRange.patch index 1dd041e..60ff631 100644 --- a/patches/server/0050-Limit-beacon-effectRange.patch +++ b/patches/server/0049-Limit-beacon-effectRange.patch @@ -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 -index f2325c0c475bb465f5275f78c71949648a860d0c..4ec228ce026ee39eebd17d180fb5caea1b74e6e2 100644 +index 5005a0ad5f703727ea9c618ae4b769a77d5655b5..8645ebb37dfab4e76b238a3660816a59018d3dde 100644 --- a/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 diff --git a/patches/server/0051-Fix-invalid-armor-trim-exploit.patch b/patches/server/0050-Fix-invalid-armor-trim-exploit.patch similarity index 100% rename from patches/server/0051-Fix-invalid-armor-trim-exploit.patch rename to patches/server/0050-Fix-invalid-armor-trim-exploit.patch diff --git a/patches/server/0052-Improve-validation-of-ResourceLocations.patch b/patches/server/0051-Improve-validation-of-ResourceLocations.patch similarity index 100% rename from patches/server/0052-Improve-validation-of-ResourceLocations.patch rename to patches/server/0051-Improve-validation-of-ResourceLocations.patch diff --git a/patches/server/0052-Catch-null-ResourceLocations-in-CraftNamespacedKey.patch b/patches/server/0052-Catch-null-ResourceLocations-in-CraftNamespacedKey.patch deleted file mode 100644 index 2aaf1ba..0000000 --- a/patches/server/0052-Catch-null-ResourceLocations-in-CraftNamespacedKey.patch +++ /dev/null @@ -1,18 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Luna -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()); - } -