mirror of
https://github.com/Minestom/Minestom.git
synced 2025-01-18 22:21:22 +01:00
fix compilation issues
This commit is contained in:
parent
327558c003
commit
aea8a5f794
@ -11,13 +11,11 @@ import net.kyori.adventure.title.Title;
|
||||
import net.minestom.server.MinecraftServer;
|
||||
import net.minestom.server.advancements.AdvancementTab;
|
||||
import net.minestom.server.adventure.AdventurePacketConvertor;
|
||||
import net.minestom.server.attribute.Attribute;
|
||||
import net.minestom.server.adventure.AdventureUtils;
|
||||
import net.minestom.server.adventure.Localizable;
|
||||
import net.minestom.server.attribute.Attribute;
|
||||
import net.minestom.server.attribute.AttributeInstance;
|
||||
import net.minestom.server.bossbar.BossBar;
|
||||
import net.minestom.server.chat.ChatParser;
|
||||
import net.minestom.server.attribute.Attributes;
|
||||
import net.minestom.server.chat.ColoredText;
|
||||
import net.minestom.server.chat.JsonMessage;
|
||||
import net.minestom.server.collision.BoundingBox;
|
||||
|
@ -1,6 +1,5 @@
|
||||
package net.minestom.server.listener;
|
||||
|
||||
import net.kyori.adventure.audience.MessageType;
|
||||
import net.kyori.adventure.text.Component;
|
||||
import net.kyori.adventure.text.event.ClickEvent;
|
||||
import net.minestom.server.MinecraftServer;
|
||||
@ -54,11 +53,9 @@ public class ChatMessageListener {
|
||||
|
||||
final Collection<Player> recipients = playerChatEvent.getRecipients();
|
||||
if (!recipients.isEmpty()) {
|
||||
final String jsonMessage = MinecraftServer.getSerializationManager().serialize(textObject);
|
||||
|
||||
// Send the message with the correct player UUID
|
||||
ChatMessagePacket chatMessagePacket =
|
||||
new ChatMessagePacket(jsonMessage, ChatMessagePacket.Position.CHAT, player.getUuid());
|
||||
new ChatMessagePacket(textObject, ChatMessagePacket.Position.CHAT, player.getUuid());
|
||||
|
||||
PacketUtils.sendGroupedPacket(recipients, chatMessagePacket);
|
||||
}
|
||||
|
@ -2,7 +2,6 @@ package net.minestom.server.scoreboard;
|
||||
|
||||
import it.unimi.dsi.fastutil.ints.IntLinkedOpenHashSet;
|
||||
import net.kyori.adventure.text.Component;
|
||||
import net.minestom.server.MinecraftServer;
|
||||
import net.minestom.server.chat.JsonMessage;
|
||||
import net.minestom.server.color.TeamColor;
|
||||
import net.minestom.server.entity.Player;
|
||||
@ -103,7 +102,7 @@ public class Sidebar implements Scoreboard {
|
||||
ScoreboardObjectivePacket scoreboardObjectivePacket = new ScoreboardObjectivePacket();
|
||||
scoreboardObjectivePacket.objectiveName = objectiveName;
|
||||
scoreboardObjectivePacket.mode = 2; // Update display text
|
||||
scoreboardObjectivePacket.objectiveValue = MinecraftServer.getSerializationManager().serialize(title);
|
||||
scoreboardObjectivePacket.objectiveValue = title;
|
||||
scoreboardObjectivePacket.type = ScoreboardObjectivePacket.Type.INTEGER;
|
||||
|
||||
sendPacketToViewers(scoreboardObjectivePacket);
|
||||
@ -467,13 +466,13 @@ public class Sidebar implements Scoreboard {
|
||||
TeamsPacket teamsPacket = new TeamsPacket();
|
||||
teamsPacket.teamName = teamName;
|
||||
teamsPacket.action = TeamsPacket.Action.CREATE_TEAM;
|
||||
teamsPacket.teamDisplayName = MinecraftServer.getSerializationManager().serialize(teamDisplayName);
|
||||
teamsPacket.teamDisplayName = teamDisplayName;
|
||||
teamsPacket.friendlyFlags = friendlyFlags;
|
||||
teamsPacket.nameTagVisibility = nameTagVisibility;
|
||||
teamsPacket.collisionRule = collisionRule;
|
||||
teamsPacket.teamColor = teamColor;
|
||||
teamsPacket.teamPrefix = MinecraftServer.getSerializationManager().serialize(prefix);
|
||||
teamsPacket.teamSuffix = MinecraftServer.getSerializationManager().serialize(suffix);
|
||||
teamsPacket.teamPrefix = prefix;
|
||||
teamsPacket.teamSuffix = suffix;
|
||||
teamsPacket.entities = new String[]{entityName};
|
||||
return teamsPacket;
|
||||
}
|
||||
@ -500,13 +499,13 @@ public class Sidebar implements Scoreboard {
|
||||
TeamsPacket teamsPacket = new TeamsPacket();
|
||||
teamsPacket.teamName = teamName;
|
||||
teamsPacket.action = TeamsPacket.Action.UPDATE_TEAM_INFO;
|
||||
teamsPacket.teamDisplayName = MinecraftServer.getSerializationManager().serialize(teamDisplayName);
|
||||
teamsPacket.teamDisplayName = teamDisplayName;
|
||||
teamsPacket.friendlyFlags = friendlyFlags;
|
||||
teamsPacket.nameTagVisibility = nameTagVisibility;
|
||||
teamsPacket.collisionRule = collisionRule;
|
||||
teamsPacket.teamColor = teamColor;
|
||||
teamsPacket.teamPrefix = MinecraftServer.getSerializationManager().serialize(prefix);
|
||||
teamsPacket.teamSuffix = MinecraftServer.getSerializationManager().serialize(suffix);
|
||||
teamsPacket.teamPrefix = prefix;
|
||||
teamsPacket.teamSuffix = suffix;
|
||||
return teamsPacket;
|
||||
}
|
||||
|
||||
|
@ -83,9 +83,7 @@ public class PlayerInit {
|
||||
final Component footer = Component.text(benchmarkManager.getCpuMonitoringMessage());
|
||||
|
||||
{
|
||||
PlayerListHeaderAndFooterPacket playerListHeaderAndFooterPacket = new PlayerListHeaderAndFooterPacket();
|
||||
playerListHeaderAndFooterPacket.header = MinecraftServer.getSerializationManager().serialize(header);
|
||||
playerListHeaderAndFooterPacket.footer = MinecraftServer.getSerializationManager().serialize(footer);
|
||||
PlayerListHeaderAndFooterPacket playerListHeaderAndFooterPacket = new PlayerListHeaderAndFooterPacket(header, footer);
|
||||
|
||||
PacketUtils.sendGroupedPacket(players, playerListHeaderAndFooterPacket);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user