Paper/patches/server/0193-Fix-exploit-that-allowed-colored-signs-to-be-created.patch

23 lines
1.7 KiB
Diff
Raw Normal View History

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
2023-12-05 23:12:48 +01:00
index 0b5d988c6372ee5b7c2edd56f87ef604e76a2a5b..2d230e1f56be70f6373421c0649b0b9d3f2702e8 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
2023-12-05 23:12:48 +01:00
@@ -201,9 +201,9 @@ public class SignBlockEntity extends BlockEntity implements CommandSource { // C
Style chatmodifier = signtext.getMessage(i, entityhuman.isTextFilteringEnabled()).getStyle();
2023-09-22 00:01:00 +02:00
if (entityhuman.isTextFilteringEnabled()) {
- signtext = signtext.setMessage(i, Component.literal(filteredtext.filteredOrEmpty()).setStyle(chatmodifier));
+ signtext = signtext.setMessage(i, Component.literal(net.minecraft.SharedConstants.filterText(filteredtext.filteredOrEmpty())).setStyle(chatmodifier)); // Paper - filter sign text to chat only
2023-06-08 11:18:51 +02:00
} else {
- signtext = signtext.setMessage(i, Component.literal(filteredtext.raw()).setStyle(chatmodifier), Component.literal(filteredtext.filteredOrEmpty()).setStyle(chatmodifier));
+ signtext = signtext.setMessage(i, Component.literal(net.minecraft.SharedConstants.filterText(filteredtext.raw())).setStyle(chatmodifier), Component.literal(net.minecraft.SharedConstants.filterText(filteredtext.filteredOrEmpty())).setStyle(chatmodifier)); // Paper - filter sign text to chat only
2023-06-08 11:18:51 +02:00
}
}
2023-09-22 00:01:00 +02:00