mirror of
https://github.com/Minestom/Minestom.git
synced 2024-12-27 03:27:56 +01:00
Use broadcastPacket
whenever possible
This commit is contained in:
parent
5d4dd1f9f4
commit
40a2168d52
@ -188,8 +188,7 @@ public final class MinecraftServer {
|
||||
*/
|
||||
public static void setBrandName(@NotNull String brandName) {
|
||||
MinecraftServer.brandName = brandName;
|
||||
|
||||
PacketUtils.sendGroupedPacket(connectionManager.getOnlinePlayers(), PluginMessagePacket.getBrandPacket());
|
||||
PacketUtils.broadcastPacket(PluginMessagePacket.getBrandPacket());
|
||||
}
|
||||
|
||||
/**
|
||||
@ -245,8 +244,7 @@ public final class MinecraftServer {
|
||||
*/
|
||||
public static void setDifficulty(@NotNull Difficulty difficulty) {
|
||||
MinecraftServer.difficulty = difficulty;
|
||||
// Send the packet to all online players
|
||||
PacketUtils.sendGroupedPacket(connectionManager.getOnlinePlayers(), new ServerDifficultyPacket(difficulty, true));
|
||||
PacketUtils.broadcastPacket(new ServerDifficultyPacket(difficulty, true));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -41,8 +41,7 @@ public final class TeamManager {
|
||||
*/
|
||||
protected void registerNewTeam(@NotNull Team team) {
|
||||
this.teams.add(team);
|
||||
|
||||
PacketUtils.sendGroupedPacket(MinecraftServer.getConnectionManager().getOnlinePlayers(), team.createTeamsCreationPacket());
|
||||
PacketUtils.broadcastPacket(team.createTeamsCreationPacket());
|
||||
}
|
||||
|
||||
/**
|
||||
@ -65,7 +64,7 @@ public final class TeamManager {
|
||||
*/
|
||||
public boolean deleteTeam(@NotNull Team team) {
|
||||
// Sends to all online players a team destroy packet
|
||||
PacketUtils.sendGroupedPacket(CONNECTION_MANAGER.getOnlinePlayers(), team.createTeamDestructionPacket());
|
||||
PacketUtils.broadcastPacket(team.createTeamDestructionPacket());
|
||||
return this.teams.remove(team);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user