51 lines
1.2 KiB
Java
51 lines
1.2 KiB
Java
/**
|
|
*
|
|
*/
|
|
package cn.citycraft.SimpleEssential.command;
|
|
|
|
import org.bukkit.Location;
|
|
import org.bukkit.command.CommandException;
|
|
import org.bukkit.command.CommandSender;
|
|
import org.bukkit.entity.Player;
|
|
|
|
import cn.citycraft.SimpleEssential.SimpleEssential;
|
|
import cn.citycraft.SimpleEssential.config.Language;
|
|
|
|
/**
|
|
* @author 蒋天蓓 2015年8月12日下午2:04:05
|
|
*/
|
|
public class CommandSetSpawn extends BaseCommand {
|
|
SimpleEssential plugin;
|
|
|
|
/**
|
|
* @param name
|
|
*/
|
|
public CommandSetSpawn(SimpleEssential main) {
|
|
super("setspawn", "sesetspawn");
|
|
this.plugin = main;
|
|
}
|
|
|
|
@Override
|
|
public void execute(CommandSender sender, String label, String[] args) throws CommandException {
|
|
Player p = (Player) sender;
|
|
Location loc = p.getLocation();
|
|
p.getWorld().setSpawnLocation(loc.getBlockX(), loc.getBlockY(), loc.getBlockZ());
|
|
p.sendMessage(Language.getMessage("Teleport.setspawn", p.getWorld().getName(), loc.getBlockX(), loc.getBlockY(), loc.getBlockZ()));
|
|
};
|
|
|
|
@Override
|
|
public int getMinimumArguments() {
|
|
return 0;
|
|
}
|
|
|
|
@Override
|
|
public String getPossibleArguments() {
|
|
return "";
|
|
}
|
|
|
|
@Override
|
|
public boolean isOnlyPlayerExecutable() {
|
|
return true;
|
|
}
|
|
}
|