mirror of
https://github.com/DRE2N/DungeonsXL.git
synced 2024-11-28 05:26:29 +01:00
Improved group sign group switching
This commit is contained in:
parent
fdee1355da
commit
07d36cdb10
@ -133,9 +133,21 @@ public class GroupSign extends JoinSign {
|
||||
}
|
||||
|
||||
public void onPlayerInteract(Block block, Player player) {
|
||||
if (plugin.getPlayerGroup(player) != null) {
|
||||
MessageUtil.sendMessage(player, DMessage.ERROR_LEAVE_GROUP.getMessage());
|
||||
return;
|
||||
DGroup playerGroup = (DGroup) plugin.getPlayerGroup(player);
|
||||
if (playerGroup != null) {
|
||||
if (playerGroup.getLeader().equals(player)) {
|
||||
if (group != null || maxElements < playerGroup.getMembers().size()) {
|
||||
MessageUtil.sendMessage(player, DMessage.ERROR_LEAVE_GROUP.getMessage());
|
||||
return;
|
||||
} else {
|
||||
group = playerGroup;
|
||||
group.setDungeon(dungeon);
|
||||
update();
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
playerGroup.removeMember(player, true);
|
||||
}
|
||||
}
|
||||
|
||||
Block topBlock = block.getRelative(0, startSign.getY() - block.getY(), 0);
|
||||
|
Loading…
Reference in New Issue
Block a user