2023-06-08 11:18:51 +02:00
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: 0x22 <0x22@futureclient.net>
Date: Thu, 26 Apr 2018 04:41:11 -0400
Subject: [PATCH] Fix exploit that allowed colored signs to be created
diff --git a/src/main/java/net/minecraft/world/level/block/entity/SignBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/SignBlockEntity.java
2024-12-03 19:05:31 +01:00
index 9e185afc561a4470055bba7dd1d256ee83805c8d..0e80e4f01e0175a9a2e90dc950ba0580af6b1520 100644
2023-06-08 11:18:51 +02:00
--- a/src/main/java/net/minecraft/world/level/block/entity/SignBlockEntity.java
+++ b/src/main/java/net/minecraft/world/level/block/entity/SignBlockEntity.java
2024-10-23 00:02:50 +02:00
@@ -202,9 +202,9 @@ public class SignBlockEntity extends BlockEntity {
2023-06-08 15:25:35 +02:00
Style chatmodifier = signtext.getMessage(i, entityhuman.isTextFilteringEnabled()).getStyle();
2023-09-22 00:01:00 +02:00
2023-06-08 15:25:35 +02:00
if (entityhuman.isTextFilteringEnabled()) {
- signtext = signtext.setMessage(i, Component.literal(filteredtext.filteredOrEmpty()).setStyle(chatmodifier));
2024-04-25 05:40:32 +02:00
+ signtext = signtext.setMessage(i, Component.literal(net.minecraft.util.StringUtil.filterText(filteredtext.filteredOrEmpty())).setStyle(chatmodifier)); // Paper - filter sign text to chat only
2023-06-08 11:18:51 +02:00
} else {
2023-06-08 15:25:35 +02:00
- signtext = signtext.setMessage(i, Component.literal(filteredtext.raw()).setStyle(chatmodifier), Component.literal(filteredtext.filteredOrEmpty()).setStyle(chatmodifier));
2024-04-25 05:40:32 +02:00
+ signtext = signtext.setMessage(i, Component.literal(net.minecraft.util.StringUtil.filterText(filteredtext.raw())).setStyle(chatmodifier), Component.literal(net.minecraft.util.StringUtil.filterText(filteredtext.filteredOrEmpty())).setStyle(chatmodifier)); // Paper - filter sign text to chat only
2023-06-08 11:18:51 +02:00
}
2023-06-08 15:25:35 +02:00
}
2023-09-22 00:01:00 +02:00