mirror of
https://github.com/Minestom/Minestom.git
synced 2025-01-15 12:41:26 +01:00
Fix packets changed with text replacement
This commit is contained in:
parent
3e657bbba9
commit
9e9e979104
@ -1,5 +1,6 @@
|
||||
package net.minestom.server.network.packet.server.play;
|
||||
|
||||
import net.minestom.server.chat.Chat;
|
||||
import net.minestom.server.item.ItemStack;
|
||||
import net.minestom.server.network.packet.PacketWriter;
|
||||
import net.minestom.server.network.packet.server.ServerPacket;
|
||||
@ -91,8 +92,8 @@ public class AdvancementsPacket implements ServerPacket {
|
||||
public float y;
|
||||
|
||||
private void write(PacketWriter writer) {
|
||||
writer.writeSizedString(title);
|
||||
writer.writeSizedString(description);
|
||||
writer.writeSizedString(Chat.toJsonString(Chat.fromLegacyText(title)));
|
||||
writer.writeSizedString(Chat.toJsonString(Chat.fromLegacyText(title)));
|
||||
writer.writeItemStack(icon);
|
||||
writer.writeVarInt(frameType.ordinal());
|
||||
writer.writeInt(flags);
|
||||
|
@ -2,6 +2,7 @@ package net.minestom.server.network.packet.server.play;
|
||||
|
||||
import net.minestom.server.bossbar.BarColor;
|
||||
import net.minestom.server.bossbar.BarDivision;
|
||||
import net.minestom.server.chat.Chat;
|
||||
import net.minestom.server.network.packet.PacketWriter;
|
||||
import net.minestom.server.network.packet.server.ServerPacket;
|
||||
import net.minestom.server.network.packet.server.ServerPacketIdentifier;
|
||||
@ -27,7 +28,7 @@ public class BossBarPacket implements ServerPacket {
|
||||
|
||||
switch (action) {
|
||||
case ADD:
|
||||
writer.writeSizedString(title);
|
||||
writer.writeSizedString(Chat.toJsonString(Chat.fromLegacyText(title)));
|
||||
writer.writeFloat(health);
|
||||
writer.writeVarInt(color.ordinal());
|
||||
writer.writeVarInt(division.ordinal());
|
||||
@ -40,7 +41,7 @@ public class BossBarPacket implements ServerPacket {
|
||||
writer.writeFloat(health);
|
||||
break;
|
||||
case UPDATE_TITLE:
|
||||
writer.writeSizedString(title);
|
||||
writer.writeSizedString(Chat.toJsonString(Chat.fromLegacyText(title)));
|
||||
break;
|
||||
case UPDATE_STYLE:
|
||||
writer.writeVarInt(color.ordinal());
|
||||
|
@ -1,5 +1,6 @@
|
||||
package net.minestom.server.network.packet.server.play;
|
||||
|
||||
import net.minestom.server.chat.Chat;
|
||||
import net.minestom.server.network.packet.PacketWriter;
|
||||
import net.minestom.server.network.packet.server.ServerPacket;
|
||||
import net.minestom.server.network.packet.server.ServerPacketIdentifier;
|
||||
@ -10,7 +11,7 @@ public class DisconnectPacket implements ServerPacket {
|
||||
|
||||
@Override
|
||||
public void write(PacketWriter writer) {
|
||||
writer.writeSizedString(message);
|
||||
writer.writeSizedString(Chat.toJsonString(Chat.fromLegacyText(message)));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -1,5 +1,6 @@
|
||||
package net.minestom.server.network.packet.server.play;
|
||||
|
||||
import net.minestom.server.chat.Chat;
|
||||
import net.minestom.server.network.packet.PacketWriter;
|
||||
import net.minestom.server.network.packet.server.ServerPacket;
|
||||
import net.minestom.server.network.packet.server.ServerPacketIdentifier;
|
||||
@ -17,7 +18,7 @@ public class ScoreboardObjectivePacket implements ServerPacket {
|
||||
writer.writeByte(mode);
|
||||
|
||||
if (mode == 0 || mode == 2) {
|
||||
writer.writeSizedString(objectiveValue);
|
||||
writer.writeSizedString(Chat.toJsonString(Chat.fromLegacyText(objectiveValue)));
|
||||
writer.writeVarInt(type);
|
||||
}
|
||||
}
|
||||
|
@ -27,13 +27,13 @@ public class TeamsPacket implements ServerPacket {
|
||||
switch (action) {
|
||||
case CREATE_TEAM:
|
||||
case UPDATE_TEAM_INFO:
|
||||
writer.writeSizedString(teamDisplayName);
|
||||
writer.writeSizedString(Chat.toJsonString(Chat.fromLegacyText(teamDisplayName)));
|
||||
writer.writeByte(friendlyFlags);
|
||||
writer.writeSizedString(nameTagVisibility.getIdentifier());
|
||||
writer.writeSizedString(collisionRule.getIdentifier());
|
||||
writer.writeVarInt(teamColor);
|
||||
writer.writeSizedString(teamPrefix);
|
||||
writer.writeSizedString(teamSuffix);
|
||||
writer.writeSizedString(Chat.toJsonString(Chat.fromLegacyText(teamPrefix)));
|
||||
writer.writeSizedString(Chat.toJsonString(Chat.fromLegacyText(teamSuffix)));
|
||||
break;
|
||||
case REMOVE_TEAM:
|
||||
|
||||
|
@ -25,13 +25,13 @@ public class TitlePacket implements ServerPacket {
|
||||
|
||||
switch (action) {
|
||||
case SET_TITLE:
|
||||
writer.writeSizedString(titleText);
|
||||
writer.writeSizedString(Chat.toJsonString(Chat.fromLegacyText(titleText)));
|
||||
break;
|
||||
case SET_SUBTITLE:
|
||||
writer.writeSizedString(subtitleText);
|
||||
writer.writeSizedString(Chat.toJsonString(Chat.fromLegacyText(subtitleText)));
|
||||
break;
|
||||
case SET_ACTION_BAR:
|
||||
writer.writeSizedString(actionBarText);
|
||||
writer.writeSizedString(Chat.toJsonString(Chat.fromLegacyText(actionBarText)));
|
||||
break;
|
||||
case SET_TIMES_AND_DISPLAY:
|
||||
writer.writeInt(fadeIn);
|
||||
|
Loading…
Reference in New Issue
Block a user