53 lines
1.7 KiB
Java
53 lines
1.7 KiB
Java
|
/*
|
||
|
* Copyright (c) univento.eu 2016. Any attempt to use these program(s) without permission may result in a penalty of up to 1.000€
|
||
|
*/
|
||
|
|
||
|
package eu.univento.woolget.commands;
|
||
|
|
||
|
import eu.univento.core.api.AutoCommand;
|
||
|
import eu.univento.core.api.Config;
|
||
|
import eu.univento.core.api.languages.Messages;
|
||
|
import eu.univento.core.api.player.CustomPlayer;
|
||
|
import eu.univento.core.api.player.Rank;
|
||
|
import eu.univento.woolget.WoolGet;
|
||
|
import org.bukkit.command.CommandSender;
|
||
|
import org.bukkit.entity.Player;
|
||
|
|
||
|
import java.util.List;
|
||
|
|
||
|
/**
|
||
|
* @author joethei
|
||
|
* @version 0.1
|
||
|
*/
|
||
|
public class SetPositions extends AutoCommand<WoolGet> {
|
||
|
|
||
|
|
||
|
public SetPositions(WoolGet plugin, String command, String description, String... aliases) {
|
||
|
super(plugin, command, description, aliases);
|
||
|
}
|
||
|
|
||
|
@Override
|
||
|
public boolean execute(CommandSender sender, String label, String[] args) {
|
||
|
if(sender instanceof Player) {
|
||
|
CustomPlayer p = CustomPlayer.getPlayer(sender.getName());
|
||
|
if(p.isAllowed(Rank.SrDeveloper)) {
|
||
|
if(args.length == 1) {
|
||
|
Config.write("Strive." + args[0], p.getLocation());
|
||
|
p.sendMessage(p.getMessages().PREFIX() + p.getMessages().Lobby_SET_LOCATION());
|
||
|
}else {
|
||
|
p.sendMessage(p.getMessages().PREFIX() + p.getMessages().Lobby_SET_LOCATION_USAGE());
|
||
|
}
|
||
|
}else {
|
||
|
p.sendMessage(p.getMessages().NO_PERMS());
|
||
|
}
|
||
|
}else {
|
||
|
sender.sendMessage(Messages.Console.NOT_A_PLAYER);
|
||
|
}
|
||
|
return false;
|
||
|
}
|
||
|
|
||
|
@Override
|
||
|
public List<String> tabComplete(CommandSender sender, String label, String[] args) {
|
||
|
return null;
|
||
|
}
|
||
|
}
|