mirror of
https://github.com/DRE2N/DungeonsXL.git
synced 2024-11-02 17:00:19 +01:00
/dxl enter: Allow player names instead of group names
This commit is contained in:
parent
6d543c22be
commit
7abca6543b
@ -24,6 +24,7 @@ import io.github.dre2n.dungeonsxl.game.Game;
|
||||
import io.github.dre2n.dungeonsxl.player.DGamePlayer;
|
||||
import io.github.dre2n.dungeonsxl.player.DGroup;
|
||||
import io.github.dre2n.dungeonsxl.player.DPermissions;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@ -51,6 +52,13 @@ public class EnterCommand extends BRCommand {
|
||||
DGroup joining = args.length == 3 ? DGroup.getByName(args[1]) : DGroup.getByPlayer(captain);
|
||||
DGroup target = DGroup.getByName(targetName);
|
||||
|
||||
if (target == null) {
|
||||
Player targetPlayer = Bukkit.getPlayer(targetName);
|
||||
if (targetPlayer != null) {
|
||||
target = DGroup.getByPlayer(targetPlayer);
|
||||
}
|
||||
}
|
||||
|
||||
if (target == null) {
|
||||
MessageUtil.sendMessage(sender, DMessages.ERROR_NO_SUCH_GROUP.getMessage(targetName));
|
||||
return;
|
||||
|
Loading…
Reference in New Issue
Block a user