mirror of
https://github.com/DRE2N/DungeonsXL.git
synced 2024-12-01 06:53:26 +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) {
|
public void onPlayerInteract(Block block, Player player) {
|
||||||
if (plugin.getPlayerGroup(player) != null) {
|
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());
|
MessageUtil.sendMessage(player, DMessage.ERROR_LEAVE_GROUP.getMessage());
|
||||||
return;
|
return;
|
||||||
|
} else {
|
||||||
|
group = playerGroup;
|
||||||
|
group.setDungeon(dungeon);
|
||||||
|
update();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
playerGroup.removeMember(player, true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Block topBlock = block.getRelative(0, startSign.getY() - block.getY(), 0);
|
Block topBlock = block.getRelative(0, startSign.getY() - block.getY(), 0);
|
||||||
|
Loading…
Reference in New Issue
Block a user