mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-24 14:16:45 +01:00
35 lines
1.3 KiB
Java
35 lines
1.3 KiB
Java
|
package com.gmail.nossr50.commands.party;
|
||
|
|
||
|
import org.bukkit.command.Command;
|
||
|
import org.bukkit.command.CommandExecutor;
|
||
|
import org.bukkit.command.CommandSender;
|
||
|
import org.bukkit.entity.Player;
|
||
|
|
||
|
import com.gmail.nossr50.mcMMO;
|
||
|
import com.gmail.nossr50.datatypes.party.Party;
|
||
|
import com.gmail.nossr50.locale.LocaleLoader;
|
||
|
import com.gmail.nossr50.party.PartyManager;
|
||
|
import com.gmail.nossr50.util.player.UserManager;
|
||
|
|
||
|
public class PartyChangeOwnerCommand implements CommandExecutor {
|
||
|
@Override
|
||
|
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||
|
switch (args.length) {
|
||
|
case 2:
|
||
|
Party playerParty = UserManager.getPlayer((Player) sender).getParty();
|
||
|
|
||
|
if (!playerParty.getMembers().contains(mcMMO.p.getServer().getOfflinePlayer(args[1]))) {
|
||
|
sender.sendMessage(LocaleLoader.getString("Party.NotInYourParty", args[1]));
|
||
|
return true;
|
||
|
}
|
||
|
|
||
|
PartyManager.setPartyLeader(args[1], playerParty);
|
||
|
return true;
|
||
|
|
||
|
default:
|
||
|
sender.sendMessage(LocaleLoader.getString("Commands.Usage.2", "party", "owner", "<" + LocaleLoader.getString("Commands.Usage.Player") + ">"));
|
||
|
return true;
|
||
|
}
|
||
|
}
|
||
|
}
|