52 lines
2.0 KiB
Java
52 lines
2.0 KiB
Java
package eu.univento.teamvento.commands;
|
|
|
|
import eu.univento.commons.player.Rank;
|
|
import eu.univento.core.api.AutoCommand;
|
|
import eu.univento.core.api.languages.Messages;
|
|
import eu.univento.core.api.player.CustomPlayer;
|
|
import eu.univento.core.api.utils.UUIDFetcher;
|
|
import eu.univento.teamvento.TeamVento;
|
|
import eu.univento.teamvento.utils.Plot;
|
|
import eu.univento.teamvento.utils.PlotManager;
|
|
import org.bukkit.Bukkit;
|
|
import org.bukkit.command.CommandSender;
|
|
import org.bukkit.entity.Player;
|
|
|
|
import java.util.List;
|
|
|
|
public class PlotInfo extends AutoCommand<TeamVento>{
|
|
|
|
public PlotInfo(TeamVento 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((Player) sender);
|
|
if(p.getDatabasePlayer().isAllowed(Rank.SrBuilder)) {
|
|
if(PlotManager.getPlotByLocation(p.getLocation()) != null) {
|
|
Plot plot = PlotManager.getPlotByLocation(p.getLocation());
|
|
Bukkit.getScheduler().runTaskAsynchronously(TeamVento.getInstance(), () -> {
|
|
p.sendMessage("§eErsteller: " + UUIDFetcher.getName(plot.getOwner()));
|
|
p.sendMessage("§eErstellt am: " + PlotManager.getCreatedDate(plot.getOwner().toString()));
|
|
p.sendMessage("§eResourcePack " + plot.getResourcePack().getName());
|
|
});
|
|
}else{
|
|
p.sendMessage("§cHier ist leider kein Plot");
|
|
}
|
|
}else{
|
|
p.sendMessage(p.getMessages().NO_PERMS());
|
|
}
|
|
}else{
|
|
sender.sendMessage(Messages.Console.NOT_A_PLAYER);
|
|
}
|
|
return true;
|
|
}
|
|
|
|
@Override
|
|
public List<String> tabComplete(CommandSender sender, String label, String[] args) {
|
|
return null;
|
|
}
|
|
}
|