use of com.alpsbte.plotsystem.core.system.Builder in project Plot-System by AlpsBTE.
the class SelectLanguageMenu method setPreviewItems.
@Override
protected void setPreviewItems() {
super.setPreviewItems();
builder = new Builder(getMenuPlayer().getUniqueId());
isAutoDetectEnabled = builder.getLanguageTag() == null;
}
use of com.alpsbte.plotsystem.core.system.Builder in project Plot-System by AlpsBTE.
the class CMD_Plot_Teleport method onCommand.
@Override
public void onCommand(CommandSender sender, String[] args) {
try {
if (getPlayer(sender) != null) {
if (args.length > 0 && Utils.TryParseInt(args[0]) != null) {
int plotID = Integer.parseInt(args[0]);
Plot plot;
if (PlotManager.plotExists(plotID) && (plot = new Plot(plotID)).getStatus() != Status.unclaimed) {
plot.getWorld().teleportPlayer(getPlayer(sender));
} else {
if (sender.hasPermission("plotsystem.admin") && PlotManager.plotExists(plotID)) {
new DefaultPlotGenerator(new Plot(plotID), new Builder(getPlayer(sender).getUniqueId()));
} else {
sender.sendMessage(Utils.getErrorMessageFormat(LangUtil.get(sender, LangPaths.Message.Error.PLOT_DOES_NOT_EXIST)));
}
}
} else {
sendInfo(sender);
}
} else {
Bukkit.getConsoleSender().sendMessage(ChatColor.RED + "This command can only be used as a player!");
}
} catch (SQLException ex) {
sender.sendMessage(Utils.getErrorMessageFormat(LangUtil.get(sender, LangPaths.Message.Error.ERROR_OCCURRED)));
Bukkit.getLogger().log(Level.SEVERE, "A SQL error occurred!", ex);
}
}
Aggregations