2023-10-15 22:45:13 +00:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
|
|
From: Luna <lunahatesgogle@gmail.com>
|
|
|
|
Date: Fri, 28 Apr 2023 16:29:23 -0300
|
|
|
|
Subject: [PATCH] Limit map decorations
|
|
|
|
|
|
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/network/protocol/game/ClientboundMapItemDataPacket.java b/src/main/java/net/minecraft/network/protocol/game/ClientboundMapItemDataPacket.java
|
2024-04-16 03:24:44 +00:00
|
|
|
index 02e3d1c9c18952ba53507f7b6887fd3c81af33a9..61573844b236838fd219526ea35df8c7b0c94026 100644
|
2023-10-15 22:45:13 +00:00
|
|
|
--- a/src/main/java/net/minecraft/network/protocol/game/ClientboundMapItemDataPacket.java
|
|
|
|
+++ b/src/main/java/net/minecraft/network/protocol/game/ClientboundMapItemDataPacket.java
|
2024-04-16 03:24:44 +00:00
|
|
|
@@ -63,7 +63,8 @@ public class ClientboundMapItemDataPacket implements Packet<ClientGamePacketList
|
2023-10-15 22:45:13 +00:00
|
|
|
b.writeByte(icon.x());
|
|
|
|
b.writeByte(icon.y());
|
|
|
|
b.writeByte(icon.rot() & 15);
|
|
|
|
- b.writeNullable(icon.name(), FriendlyByteBuf::writeComponent);
|
|
|
|
+ final boolean passedNameCap = icon.name() == null || icon.name().getString().length() <= 32; // Scissors
|
|
|
|
+ b.writeNullable(passedNameCap ? icon.name() : null, FriendlyByteBuf::writeComponent); // Scissors
|
2024-04-16 03:24:44 +00:00
|
|
|
}));
|
2023-10-15 22:45:13 +00:00
|
|
|
if (this.colorPatch != null) {
|
2024-04-16 03:24:44 +00:00
|
|
|
buf.writeByte(this.colorPatch.width);
|
2023-10-15 22:45:13 +00:00
|
|
|
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
|
2024-01-24 01:05:59 +00:00
|
|
|
index 45269115e63cfc3bd7dc740a5694e2cc7c35bcb1..85ea95f55fd6177748edf921e2380142d93b8b06 100644
|
2023-10-15 22:45:13 +00:00
|
|
|
--- a/src/main/java/net/minecraft/world/level/saveddata/maps/MapItemSavedData.java
|
|
|
|
+++ b/src/main/java/net/minecraft/world/level/saveddata/maps/MapItemSavedData.java
|
|
|
|
@@ -361,6 +361,11 @@ 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;
|