Skip to content

Commit

Permalink
limit objective display name to 32 characters
Browse files Browse the repository at this point in the history
  • Loading branch information
vytskalt committed Jul 8, 2023
1 parent ba2d9ae commit ba7fb93
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import com.github.retrooper.packetevents.event.PacketSendEvent;
import com.github.retrooper.packetevents.manager.server.ServerVersion;
import com.github.retrooper.packetevents.protocol.packettype.PacketType;
import com.github.retrooper.packetevents.util.LegacyFormat;
import com.github.retrooper.packetevents.util.adventure.AdventureSerializer;
import com.github.retrooper.packetevents.wrapper.PacketWrapper;
import net.kyori.adventure.text.Component;
Expand Down Expand Up @@ -68,7 +69,7 @@ public void write() {
writeByte((byte) mode.ordinal());
if (this.mode == ObjectiveMode.CREATE || this.mode == ObjectiveMode.UPDATE) {
if (serverVersion.isOlderThan(ServerVersion.V_1_13)) {
writeString(AdventureSerializer.asVanilla(displayName));
writeString(LegacyFormat.trimLegacyFormat(AdventureSerializer.asVanilla(displayName), 32));
if (renderType != null) {
writeString(renderType.name().toLowerCase());
} else {
Expand Down

0 comments on commit ba7fb93

Please sign in to comment.