mirror of
https://github.com/Minestom/Minestom.git
synced 2024-12-29 04:28:21 +01:00
Fixed Team#removeMember
This commit is contained in:
parent
edd880ceb6
commit
66817eb9c4
@ -102,7 +102,7 @@ public class PlayerBlockBreakEvent extends PlayerEvent implements CancellableEve
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Changes the custom block id result, which will be placed after the event;
|
* Changes the custom block id result, which will be placed after the event.
|
||||||
*
|
*
|
||||||
* @param resultCustomBlockId the custom block id result
|
* @param resultCustomBlockId the custom block id result
|
||||||
*/
|
*/
|
||||||
|
@ -112,23 +112,23 @@ public class Team {
|
|||||||
* @param member The member to be removed
|
* @param member The member to be removed
|
||||||
*/
|
*/
|
||||||
public void removeMember(@NotNull String member) {
|
public void removeMember(@NotNull String member) {
|
||||||
// Removes the member from the team
|
|
||||||
this.members.remove(member);
|
|
||||||
|
|
||||||
// Initializes remove player packet
|
// Initializes remove player packet
|
||||||
final TeamsPacket removePlayerPacket = new TeamsPacket();
|
final TeamsPacket removePlayerPacket = new TeamsPacket();
|
||||||
removePlayerPacket.teamName = this.teamName;
|
removePlayerPacket.teamName = this.teamName;
|
||||||
removePlayerPacket.action = TeamsPacket.Action.REMOVE_PLAYERS_TEAM;
|
removePlayerPacket.action = TeamsPacket.Action.REMOVE_PLAYERS_TEAM;
|
||||||
removePlayerPacket.entities = members.toArray(new String[0]);
|
removePlayerPacket.entities = new String[]{member};
|
||||||
|
|
||||||
// Sends to all online player teh remove player packet
|
// Sends to all online player teh remove player packet
|
||||||
PacketUtils.sendGroupedPacket(CONNECTION_MANAGER.getOnlinePlayers(), removePlayerPacket);
|
PacketUtils.sendGroupedPacket(CONNECTION_MANAGER.getOnlinePlayers(), removePlayerPacket);
|
||||||
|
|
||||||
|
// Removes the member from the team
|
||||||
|
this.members.remove(member);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Changes the display name of the team.
|
* Changes the display name of the team.
|
||||||
* <br><br>
|
* <br><br>
|
||||||
* <b>Warning:</b> This is only changed on the <b>server side</b>.
|
* <b>Warning:</b> This is only changed <b>server side</b>.
|
||||||
*
|
*
|
||||||
* @param teamDisplayName The new display name
|
* @param teamDisplayName The new display name
|
||||||
*/
|
*/
|
||||||
|
Loading…
Reference in New Issue
Block a user