Skip to content

Commit 751d838

Browse files
committed
fix color signs not working properly
1 parent ba521eb commit 751d838

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/entity/SignBlockEntity.java.patch

+2-4
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
);
3636
}
3737
}
38-
@@ -297,6 +_,26 @@
38+
@@ -297,6 +_,24 @@
3939
// CraftBukkit - this
4040
return new CommandSourceStack(commandSource, Vec3.atCenterOf(pos), Vec2.ZERO, (ServerLevel)level, 2, string, component, level.getServer(), player); // Paper - Fix commands from signs not firing command events
4141
}
@@ -49,11 +49,9 @@
4949
+ for (int i = 0; i < 4; i++) {
5050
+ final var component = io.papermc.paper.adventure.PaperAdventure.asAdventure(lines[i]);
5151
+ final String line = net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacyAmpersand().serialize(component);
52-
+ final var text = net.kyori.adventure.text.Component.text(line);
53-
+ final String json = net.kyori.adventure.text.serializer.gson.GsonComponentSerializer.gson().serialize(text);
5452
+ final CompoundTag sideNbt = nbt.getCompoundOrEmpty(side);
5553
+ final net.minecraft.nbt.ListTag messagesNbt = sideNbt.getListOrEmpty("messages");
56-
+ messagesNbt.set(i, net.minecraft.nbt.StringTag.valueOf(json));
54+
+ messagesNbt.set(i, net.minecraft.nbt.StringTag.valueOf(line));
5755
+ }
5856
+ nbt.putString("PurpurEditor", "true");
5957
+ return ClientboundBlockEntityDataPacket.create(this, (blockEntity, registryAccess) -> nbt);

0 commit comments

Comments
 (0)