mirror of
https://e.coding.net/circlecloud/Residence.git
synced 2025-11-26 22:06:07 +00:00
34 lines
1.0 KiB
Java
34 lines
1.0 KiB
Java
package com.bekvon.bukkit.residence.commandsub;
|
|
|
|
import org.bukkit.command.Command;
|
|
import org.bukkit.command.CommandException;
|
|
import org.bukkit.command.CommandSender;
|
|
import org.bukkit.entity.Player;
|
|
|
|
import com.bekvon.bukkit.residence.ResidenceMain;
|
|
import com.bekvon.bukkit.residence.protection.ResidenceManager;
|
|
|
|
import cn.citycraft.PluginHelper.commands.BaseCommand;
|
|
|
|
public class CommandGive extends BaseCommand {
|
|
ResidenceMain plugin;
|
|
|
|
public CommandGive(final ResidenceMain plugin) {
|
|
super("give");
|
|
this.plugin = plugin;
|
|
setOnlyPlayerExecutable();
|
|
setMinimumArguments(2);
|
|
setPossibleArguments("<目标玩家> <赠送的领地>");
|
|
}
|
|
|
|
@Override
|
|
public void execute(final CommandSender sender, final Command command, final String label, final String[] args) throws CommandException {
|
|
final Player player = (Player) sender;
|
|
final boolean resadmin = (command != null);
|
|
final ResidenceManager rmanager = plugin.getResidenceManager();
|
|
|
|
rmanager.giveResidence(player, args[1], args[0], resadmin);
|
|
}
|
|
|
|
}
|