mirror of
https://github.com/Minestom/Minestom.git
synced 2024-12-28 12:07:42 +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) {
|
public static void setBrandName(@NotNull String brandName) {
|
||||||
MinecraftServer.brandName = brandName;
|
MinecraftServer.brandName = brandName;
|
||||||
|
PacketUtils.broadcastPacket(PluginMessagePacket.getBrandPacket());
|
||||||
PacketUtils.sendGroupedPacket(connectionManager.getOnlinePlayers(), PluginMessagePacket.getBrandPacket());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -245,8 +244,7 @@ public final class MinecraftServer {
|
|||||||
*/
|
*/
|
||||||
public static void setDifficulty(@NotNull Difficulty difficulty) {
|
public static void setDifficulty(@NotNull Difficulty difficulty) {
|
||||||
MinecraftServer.difficulty = difficulty;
|
MinecraftServer.difficulty = difficulty;
|
||||||
// Send the packet to all online players
|
PacketUtils.broadcastPacket(new ServerDifficultyPacket(difficulty, true));
|
||||||
PacketUtils.sendGroupedPacket(connectionManager.getOnlinePlayers(), new ServerDifficultyPacket(difficulty, true));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -41,8 +41,7 @@ public final class TeamManager {
|
|||||||
*/
|
*/
|
||||||
protected void registerNewTeam(@NotNull Team team) {
|
protected void registerNewTeam(@NotNull Team team) {
|
||||||
this.teams.add(team);
|
this.teams.add(team);
|
||||||
|
PacketUtils.broadcastPacket(team.createTeamsCreationPacket());
|
||||||
PacketUtils.sendGroupedPacket(MinecraftServer.getConnectionManager().getOnlinePlayers(), team.createTeamsCreationPacket());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -65,7 +64,7 @@ public final class TeamManager {
|
|||||||
*/
|
*/
|
||||||
public boolean deleteTeam(@NotNull Team team) {
|
public boolean deleteTeam(@NotNull Team team) {
|
||||||
// Sends to all online players a team destroy packet
|
// 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);
|
return this.teams.remove(team);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user