mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-26 12:35:15 +01:00
console message
This commit is contained in:
parent
0d3f6d5e0b
commit
55e2465bee
@ -472,13 +472,13 @@ public class _PlotSquared {
|
||||
public static void configs() {
|
||||
final File folder = new File(getMain().getDataFolder() + File.separator + "config");
|
||||
if (!folder.exists() && !folder.mkdirs()) {
|
||||
sendConsoleSenderMessage(C.PREFIX.s() + "&cFailed to create the /plugins/config folder. Please create it manually.");
|
||||
log(C.PREFIX.s() + "&cFailed to create the /plugins/config folder. Please create it manually.");
|
||||
}
|
||||
try {
|
||||
styleFile = new File(getMain().getDataFolder() + File.separator + "translations" + File.separator + "style.yml");
|
||||
if (!styleFile.exists()) {
|
||||
if (!styleFile.createNewFile()) {
|
||||
sendConsoleSenderMessage("Could not create the style file, please create \"translations/style.yml\" manually");
|
||||
log("Could not create the style file, please create \"translations/style.yml\" manually");
|
||||
}
|
||||
}
|
||||
styleConfig = YamlConfiguration.loadConfiguration(styleFile);
|
||||
@ -491,7 +491,7 @@ public class _PlotSquared {
|
||||
configFile = new File(getMain().getDataFolder() + File.separator + "config" + File.separator + "settings.yml");
|
||||
if (!configFile.exists()) {
|
||||
if (!configFile.createNewFile()) {
|
||||
sendConsoleSenderMessage("Could not create the settings file, please create \"settings.yml\" manually.");
|
||||
log("Could not create the settings file, please create \"settings.yml\" manually.");
|
||||
}
|
||||
}
|
||||
config = YamlConfiguration.loadConfiguration(configFile);
|
||||
@ -504,7 +504,7 @@ public class _PlotSquared {
|
||||
storageFile = new File(getMain().getDataFolder() + File.separator + "config" + File.separator + "storage.yml");
|
||||
if (!storageFile.exists()) {
|
||||
if (!storageFile.createNewFile()) {
|
||||
sendConsoleSenderMessage("Could not the storage settings file, please create \"storage.yml\" manually.");
|
||||
log("Could not the storage settings file, please create \"storage.yml\" manually.");
|
||||
}
|
||||
}
|
||||
storage = YamlConfiguration.loadConfiguration(storageFile);
|
||||
@ -557,7 +557,7 @@ public class _PlotSquared {
|
||||
settings.put("Schematics Save Path", "" + Settings.SCHEMATIC_SAVE_PATH);
|
||||
settings.put("API Location", "" + Settings.API_URL);
|
||||
for (final Entry<String, String> setting : settings.entrySet()) {
|
||||
sendConsoleSenderMessage(C.PREFIX.s() + String.format("&cKey: &6%s&c, Value: &6%s", setting.getKey(), setting.getValue()));
|
||||
log(C.PREFIX.s() + String.format("&cKey: &6%s&c, Value: &6%s", setting.getKey(), setting.getValue()));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -571,7 +571,7 @@ public class _PlotSquared {
|
||||
long error = 0l;
|
||||
|
||||
{
|
||||
sendConsoleSenderMessage(C.PREFIX.s() + "KillAllEntities started.");
|
||||
log(C.PREFIX.s() + "KillAllEntities started.");
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -579,7 +579,7 @@ public class _PlotSquared {
|
||||
if (this.ticked > 36_000L) {
|
||||
this.ticked = 0l;
|
||||
if (this.error > 0) {
|
||||
sendConsoleSenderMessage(C.PREFIX.s() + "KillAllEntities has been running for 6 hours. Errors: " + this.error);
|
||||
log(C.PREFIX.s() + "KillAllEntities has been running for 6 hours. Errors: " + this.error);
|
||||
}
|
||||
this.error = 0l;
|
||||
}
|
||||
@ -648,7 +648,7 @@ public class _PlotSquared {
|
||||
Settings.ENABLE_CLUSTERS = config.getBoolean("clusters.enabled");
|
||||
Settings.DEBUG = config.getBoolean("debug");
|
||||
if (Settings.DEBUG) {
|
||||
sendConsoleSenderMessage(C.PREFIX.s() + "&6Debug Mode Enabled (Default). Edit the config to turn this off.");
|
||||
log(C.PREFIX.s() + "&6Debug Mode Enabled (Default). Edit the config to turn this off.");
|
||||
}
|
||||
Settings.TELEPORT_DELAY = config.getInt("teleport.delay");
|
||||
Settings.CONSOLE_COLOR = config.getBoolean("console.color");
|
||||
@ -666,7 +666,7 @@ public class _PlotSquared {
|
||||
Settings.TITLES = config.getBoolean("titles");
|
||||
Settings.MAX_PLOTS = config.getInt("max_plots");
|
||||
if (Settings.MAX_PLOTS > 32767) {
|
||||
sendConsoleSenderMessage("&c`max_plots` Is set too high! This is a per player setting and does not need to be very large.");
|
||||
log("&c`max_plots` Is set too high! This is a per player setting and does not need to be very large.");
|
||||
Settings.MAX_PLOTS = 32767;
|
||||
}
|
||||
Settings.SCHEMATIC_SAVE_PATH = config.getString("schematics.save_path");
|
||||
@ -698,7 +698,7 @@ public class _PlotSquared {
|
||||
try {
|
||||
config.save(PlotSquared.configFile);
|
||||
} catch (final IOException e) {
|
||||
PlotSquared.sendConsoleSenderMessage("&c[Warning] PlotSquared failed to save the configuration&7 (settings.yml may differ from the one in memory)\n - To force a save from console use /plots save");
|
||||
PlotSquared.log("&c[Warning] PlotSquared failed to save the configuration&7 (settings.yml may differ from the one in memory)\n - To force a save from console use /plots save");
|
||||
}
|
||||
}
|
||||
|
||||
@ -708,10 +708,10 @@ public class _PlotSquared {
|
||||
UUIDHandler.cacheAll();
|
||||
if (Settings.CONVERT_PLOTME) {
|
||||
if (Bukkit.getPluginManager().getPlugin("PlotMe") != null) {
|
||||
sendConsoleSenderMessage("&c[IMPORTANT] THIS MESSAGE MAY BE EXTREMELY HELPFUL IF YOU HAVE TROUBLE CONVERTING PLOTME!");
|
||||
sendConsoleSenderMessage("&c[IMPORTANT] - Make sure 'UUID.read-from-disk' is disabled (false)!");
|
||||
sendConsoleSenderMessage("&c[IMPORTANT] - Sometimes the database can be locked, deleting PlotMe.jar beforehand will fix the issue!");
|
||||
sendConsoleSenderMessage("&c[IMPORTANT] - After the conversion is finished, please set 'plotme-convert.enabled' to false in the 'settings.yml@'");
|
||||
log("&c[IMPORTANT] THIS MESSAGE MAY BE EXTREMELY HELPFUL IF YOU HAVE TROUBLE CONVERTING PLOTME!");
|
||||
log("&c[IMPORTANT] - Make sure 'UUID.read-from-disk' is disabled (false)!");
|
||||
log("&c[IMPORTANT] - Sometimes the database can be locked, deleting PlotMe.jar beforehand will fix the issue!");
|
||||
log("&c[IMPORTANT] - After the conversion is finished, please set 'plotme-convert.enabled' to false in the 'settings.yml@'");
|
||||
}
|
||||
try {
|
||||
new PlotMeConverter(PlotSquared.getMain()).runAsync();
|
||||
@ -739,10 +739,10 @@ public class _PlotSquared {
|
||||
plotWorld = plotGenerator.getNewPlotWorld(world);
|
||||
plotManager = plotGenerator.getPlotManager();
|
||||
if (!world.equals("CheckingPlotSquaredGenerator")) {
|
||||
sendConsoleSenderMessage(C.PREFIX.s() + "&aDetected world load for '" + world + "'");
|
||||
sendConsoleSenderMessage(C.PREFIX.s() + "&3 - generator: &7" + plotGenerator.getClass().getName());
|
||||
sendConsoleSenderMessage(C.PREFIX.s() + "&3 - plotworld: &7" + plotWorld.getClass().getName());
|
||||
sendConsoleSenderMessage(C.PREFIX.s() + "&3 - manager: &7" + plotManager.getClass().getName());
|
||||
log(C.PREFIX.s() + "&aDetected world load for '" + world + "'");
|
||||
log(C.PREFIX.s() + "&3 - generator: &7" + plotGenerator.getClass().getName());
|
||||
log(C.PREFIX.s() + "&3 - plotworld: &7" + plotWorld.getClass().getName());
|
||||
log(C.PREFIX.s() + "&3 - manager: &7" + plotManager.getClass().getName());
|
||||
}
|
||||
if (!config.contains(path)) {
|
||||
config.createSection(path);
|
||||
@ -772,7 +772,7 @@ public class _PlotSquared {
|
||||
new HybridGen(world);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
PlotSquared.sendConsoleSenderMessage("&d=== Oh no! Please set the generator for the " + world + " ===");
|
||||
PlotSquared.log("&d=== Oh no! Please set the generator for the " + world + " ===");
|
||||
e.printStackTrace();
|
||||
LOADING_WORLD = false;
|
||||
removePlotWorld(world);
|
||||
@ -796,7 +796,7 @@ public class _PlotSquared {
|
||||
e.printStackTrace();
|
||||
}
|
||||
if ((plotWorld.TYPE == 2 && !Settings.ENABLE_CLUSTERS) || !(plotManager instanceof SquarePlotManager)) {
|
||||
sendConsoleSenderMessage("&c[ERROR] World '" + world + "' in settings.yml is not using PlotSquared generator! Please set the generator correctly or delete the world from the 'settings.yml'!");
|
||||
log("&c[ERROR] World '" + world + "' in settings.yml is not using PlotSquared generator! Please set the generator correctly or delete the world from the 'settings.yml'!");
|
||||
return;
|
||||
}
|
||||
addPlotWorld(world, plotWorld, plotManager);
|
||||
@ -1078,7 +1078,7 @@ public class _PlotSquared {
|
||||
for (String element : split) {
|
||||
String[] pair = element.split("=");
|
||||
if (pair.length != 2) {
|
||||
sendConsoleSenderMessage("&cNo value provided for: &7" + element);
|
||||
log("&cNo value provided for: &7" + element);
|
||||
return null;
|
||||
}
|
||||
String key = pair[0].toLowerCase();
|
||||
@ -1123,14 +1123,14 @@ public class _PlotSquared {
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
sendConsoleSenderMessage("&cKey not found: &7" + element);
|
||||
log("&cKey not found: &7" + element);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
sendConsoleSenderMessage("&cInvalid value: &7" + value + " in arg " + element);
|
||||
log("&cInvalid value: &7" + value + " in arg " + element);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@ -1253,7 +1253,7 @@ public class _PlotSquared {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendConsoleSenderMessage(String string) {
|
||||
public void log(String string) {
|
||||
if (BukkitMain.plugin == null || Bukkit.getServer().getConsoleSender() == null) {
|
||||
System.out.println(ChatColor.stripColor(ConsoleColors.fromString(string)));
|
||||
} else {
|
||||
@ -1277,13 +1277,13 @@ public class _PlotSquared {
|
||||
C.saveTranslations();
|
||||
// Check for outdated java version.
|
||||
if (getJavaVersion() < 1.7) {
|
||||
sendConsoleSenderMessage(C.PREFIX.s() + "&cYour java version is outdated. Please update to at least 1.7.");
|
||||
log(C.PREFIX.s() + "&cYour java version is outdated. Please update to at least 1.7.");
|
||||
// Didn't know of any other link :D
|
||||
sendConsoleSenderMessage(C.PREFIX.s() + "&cURL: &6https://java.com/en/download/index.jsp");
|
||||
log(C.PREFIX.s() + "&cURL: &6https://java.com/en/download/index.jsp");
|
||||
Bukkit.getPluginManager().disablePlugin(this);
|
||||
return;
|
||||
} else if (getJavaVersion() < 1.8) {
|
||||
sendConsoleSenderMessage(C.PREFIX.s() + "&cIt's really recommended to run Java 1.8, as it increases performance");
|
||||
log(C.PREFIX.s() + "&cIt's really recommended to run Java 1.8, as it increases performance");
|
||||
}
|
||||
// Setup configuration
|
||||
configs();
|
||||
@ -1293,20 +1293,20 @@ public class _PlotSquared {
|
||||
try {
|
||||
final Metrics metrics = new Metrics(this);
|
||||
metrics.start();
|
||||
sendConsoleSenderMessage(C.PREFIX.s() + "&6Metrics enabled.");
|
||||
log(C.PREFIX.s() + "&6Metrics enabled.");
|
||||
} catch (final Exception e) {
|
||||
sendConsoleSenderMessage(C.PREFIX.s() + "&cFailed to load up metrics.");
|
||||
log(C.PREFIX.s() + "&cFailed to load up metrics.");
|
||||
}
|
||||
} else {
|
||||
// We should at least make them feel bad.
|
||||
sendConsoleSenderMessage("Using metrics will allow us to improve the plugin\nPlease consider it :)");
|
||||
log("Using metrics will allow us to improve the plugin\nPlease consider it :)");
|
||||
}
|
||||
// Kill mobs on roads?
|
||||
if (Settings.KILL_ROAD_MOBS) {
|
||||
killAllEntities();
|
||||
}
|
||||
if (C.ENABLED.s().length() > 0) {
|
||||
sendConsoleSenderMessage(C.ENABLED);
|
||||
log(C.ENABLED);
|
||||
}
|
||||
final String[] tables;
|
||||
if (Settings.ENABLE_CLUSTERS) {
|
||||
@ -1345,12 +1345,12 @@ public class _PlotSquared {
|
||||
}
|
||||
} catch (final Exception e) {
|
||||
Logger.add(LogLevel.DANGER, "MySQL connection failed.");
|
||||
sendConsoleSenderMessage("&c[Plots] MySQL is not setup correctly. The plugin will disable itself.");
|
||||
log("&c[Plots] MySQL is not setup correctly. The plugin will disable itself.");
|
||||
if ((config == null) || config.getBoolean("debug")) {
|
||||
sendConsoleSenderMessage("&d==== Here is an ugly stacktrace if you are interested in those things ====");
|
||||
log("&d==== Here is an ugly stacktrace if you are interested in those things ====");
|
||||
e.printStackTrace();
|
||||
sendConsoleSenderMessage("&d==== End of stacktrace ====");
|
||||
sendConsoleSenderMessage("&6Please go to the PlotSquared 'storage.yml' and configure MySQL correctly.");
|
||||
log("&d==== End of stacktrace ====");
|
||||
log("&6Please go to the PlotSquared 'storage.yml' and configure MySQL correctly.");
|
||||
}
|
||||
Bukkit.getPluginManager().disablePlugin(this);
|
||||
return;
|
||||
@ -1363,7 +1363,7 @@ public class _PlotSquared {
|
||||
// TODO: Implement mongo
|
||||
else if (Settings.DB.USE_MONGO) {
|
||||
// DBFunc.dbManager = new MongoManager();
|
||||
sendConsoleSenderMessage(C.PREFIX.s() + "MongoDB is not yet implemented");
|
||||
log(C.PREFIX.s() + "MongoDB is not yet implemented");
|
||||
} else if (Settings.DB.USE_SQLITE) {
|
||||
try {
|
||||
connection = new SQLite(this, this.getDataFolder() + File.separator + Settings.DB.SQLITE_DB + ".db").openConnection();
|
||||
@ -1384,8 +1384,8 @@ public class _PlotSquared {
|
||||
}
|
||||
} catch (final Exception e) {
|
||||
Logger.add(LogLevel.DANGER, "SQLite connection failed");
|
||||
sendConsoleSenderMessage(C.PREFIX.s() + "&cFailed to open SQLite connection. The plugin will disable itself.");
|
||||
sendConsoleSenderMessage("&9==== Here is an ugly stacktrace, if you are interested in those things ===");
|
||||
log(C.PREFIX.s() + "&cFailed to open SQLite connection. The plugin will disable itself.");
|
||||
log("&9==== Here is an ugly stacktrace, if you are interested in those things ===");
|
||||
e.printStackTrace();
|
||||
Bukkit.getPluginManager().disablePlugin(this);
|
||||
return;
|
||||
@ -1396,7 +1396,7 @@ public class _PlotSquared {
|
||||
}
|
||||
} else {
|
||||
Logger.add(LogLevel.DANGER, "No storage type is set.");
|
||||
sendConsoleSenderMessage(C.PREFIX + "&cNo storage type is set!");
|
||||
log(C.PREFIX + "&cNo storage type is set!");
|
||||
getServer().getPluginManager().disablePlugin(this);
|
||||
return;
|
||||
}
|
||||
@ -1434,9 +1434,9 @@ public class _PlotSquared {
|
||||
|
||||
final String version = worldEdit.getDescription().getVersion();
|
||||
if ((version != null) && version.startsWith("5.")) {
|
||||
PlotSquared.sendConsoleSenderMessage("&cThis version of WorldEdit does not support PlotSquared.");
|
||||
PlotSquared.sendConsoleSenderMessage("&cPlease use WorldEdit 6+ for masking support");
|
||||
PlotSquared.sendConsoleSenderMessage("&c - http://builds.enginehub.org/job/worldedit");
|
||||
PlotSquared.log("&cThis version of WorldEdit does not support PlotSquared.");
|
||||
PlotSquared.log("&cPlease use WorldEdit 6+ for masking support");
|
||||
PlotSquared.log("&c - http://builds.enginehub.org/job/worldedit");
|
||||
} else {
|
||||
getServer().getPluginManager().registerEvents(new WorldEditListener(), this);
|
||||
MainCommand.subCommands.add(new WE_Anywhere());
|
||||
@ -1500,7 +1500,7 @@ public class _PlotSquared {
|
||||
{
|
||||
boolean checkVersion = checkVersion(1, 7, 6);
|
||||
if (!checkVersion) {
|
||||
sendConsoleSenderMessage(C.PREFIX.s()+" &c[WARN] Titles are disabled - please update your version of Bukkit to support this feature.");
|
||||
log(C.PREFIX.s()+" &c[WARN] Titles are disabled - please update your version of Bukkit to support this feature.");
|
||||
Settings.TITLES = false;
|
||||
FlagManager.removeFlag(FlagManager.getFlag("titles"));
|
||||
}
|
||||
@ -1520,10 +1520,10 @@ public class _PlotSquared {
|
||||
Settings.OFFLINE_MODE = true;
|
||||
}
|
||||
if (Settings.OFFLINE_MODE) {
|
||||
sendConsoleSenderMessage(C.PREFIX.s()+" &6PlotSquared is using Offline Mode UUIDs either because of user preference, or because you are using an old version of Bukkit");
|
||||
log(C.PREFIX.s()+" &6PlotSquared is using Offline Mode UUIDs either because of user preference, or because you are using an old version of Bukkit");
|
||||
}
|
||||
else {
|
||||
sendConsoleSenderMessage(C.PREFIX.s()+" &6PlotSquared is using online UUIDs");
|
||||
log(C.PREFIX.s()+" &6PlotSquared is using online UUIDs");
|
||||
}
|
||||
}
|
||||
// Now we're finished :D
|
||||
|
@ -340,10 +340,10 @@ import com.intellectualcrafters.plot.util.UUIDHandler;
|
||||
// *
|
||||
// * @param msg Message that should be sent to the console
|
||||
// *
|
||||
// * @see PlotSquared#sendConsoleSenderMessage(String)
|
||||
// * @see PlotSquared#log(String)
|
||||
// */
|
||||
// public void sendConsoleMessage(final String msg) {
|
||||
// PlotSquared.sendConsoleSenderMessage(msg);
|
||||
// PlotSquared.log(msg);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
|
@ -43,22 +43,22 @@ public class Clear extends SubCommand {
|
||||
if (plr == null) {
|
||||
// Is console
|
||||
if (args.length < 2) {
|
||||
PlotSquared.sendConsoleSenderMessage("You need to specify two arguments: ID (0;0) & World (world)");
|
||||
PlotSquared.log("You need to specify two arguments: ID (0;0) & World (world)");
|
||||
} else {
|
||||
final PlotId id = PlotId.fromString(args[0]);
|
||||
final String world = args[1];
|
||||
if (id == null) {
|
||||
PlotSquared.sendConsoleSenderMessage("Invalid Plot ID: " + args[0]);
|
||||
PlotSquared.log("Invalid Plot ID: " + args[0]);
|
||||
} else {
|
||||
if (!PlotSquared.isPlotWorld(world)) {
|
||||
PlotSquared.sendConsoleSenderMessage("Invalid plot world: " + world);
|
||||
PlotSquared.log("Invalid plot world: " + world);
|
||||
} else {
|
||||
final Plot plot = PlotHelper.getPlot(Bukkit.getWorld(world), id);
|
||||
if (plot == null) {
|
||||
PlotSquared.sendConsoleSenderMessage("Could not find plot " + args[0] + " in world " + world);
|
||||
PlotSquared.log("Could not find plot " + args[0] + " in world " + world);
|
||||
} else {
|
||||
plot.clear(null, false);
|
||||
PlotSquared.sendConsoleSenderMessage("Plot " + plot.getId().toString() + " cleared.");
|
||||
PlotSquared.log("Plot " + plot.getId().toString() + " cleared.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -203,7 +203,7 @@ public class Condense extends SubCommand {
|
||||
}
|
||||
|
||||
public static void sendMessage(final String message) {
|
||||
PlotSquared.sendConsoleSenderMessage("&3PlotSquared -> Plot condense&8: &7" + message);
|
||||
PlotSquared.log("&3PlotSquared -> Plot condense&8: &7" + message);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -33,7 +33,7 @@ public class Database extends SubCommand {
|
||||
|
||||
private static boolean sendMessageU(final UUID uuid, final String msg) {
|
||||
if (uuid == null) {
|
||||
PlotSquared.sendConsoleSenderMessage(msg);
|
||||
PlotSquared.log(msg);
|
||||
} else {
|
||||
final Player p = UUIDHandler.uuidWrapper.getPlayer(uuid);
|
||||
if ((p != null) && p.isOnline()) {
|
||||
@ -141,7 +141,7 @@ public class Database extends SubCommand {
|
||||
|
||||
private boolean sendMessage(final Player player, final String msg) {
|
||||
if (player == null) {
|
||||
PlotSquared.sendConsoleSenderMessage(msg);
|
||||
PlotSquared.log(msg);
|
||||
} else {
|
||||
PlayerFunctions.sendMessage(player, msg);
|
||||
}
|
||||
|
@ -47,19 +47,19 @@ public class DebugClear extends SubCommand {
|
||||
if (plr == null) {
|
||||
// Is console
|
||||
if (args.length < 2) {
|
||||
PlotSquared.sendConsoleSenderMessage("You need to specify two arguments: ID (0;0) & World (world)");
|
||||
PlotSquared.log("You need to specify two arguments: ID (0;0) & World (world)");
|
||||
} else {
|
||||
final PlotId id = PlotId.fromString(args[0]);
|
||||
final String world = args[1];
|
||||
if (id == null) {
|
||||
PlotSquared.sendConsoleSenderMessage("Invalid Plot ID: " + args[0]);
|
||||
PlotSquared.log("Invalid Plot ID: " + args[0]);
|
||||
} else {
|
||||
if (!PlotSquared.isPlotWorld(world) || !(PlotSquared.getWorldSettings(world) instanceof SquarePlotWorld)) {
|
||||
PlotSquared.sendConsoleSenderMessage("Invalid plot world: " + world);
|
||||
PlotSquared.log("Invalid plot world: " + world);
|
||||
} else {
|
||||
final Plot plot = PlotHelper.getPlot(Bukkit.getWorld(world), id);
|
||||
if (plot == null) {
|
||||
PlotSquared.sendConsoleSenderMessage("Could not find plot " + args[0] + " in world " + world);
|
||||
PlotSquared.log("Could not find plot " + args[0] + " in world " + world);
|
||||
} else {
|
||||
World bukkitWorld = Bukkit.getWorld(world);
|
||||
Location pos1 = PlotHelper.getPlotBottomLoc(bukkitWorld, plot.id).add(1, 0, 1);
|
||||
@ -73,8 +73,8 @@ public class DebugClear extends SubCommand {
|
||||
@Override
|
||||
public void run() {
|
||||
PlotHelper.runners.remove(plot);
|
||||
PlotSquared.sendConsoleSenderMessage("Plot " + plot.getId().toString() + " cleared.");
|
||||
PlotSquared.sendConsoleSenderMessage("&aDone!");
|
||||
PlotSquared.log("Plot " + plot.getId().toString() + " cleared.");
|
||||
PlotSquared.log("&aDone!");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -46,9 +46,9 @@ public class DebugLoadTest extends SubCommand {
|
||||
fPlots.setAccessible(true);
|
||||
fPlots.set(null, DBFunc.getPlots());
|
||||
} catch (final Exception e) {
|
||||
PlotSquared.sendConsoleSenderMessage("&3===FAILED&3===");
|
||||
PlotSquared.log("&3===FAILED&3===");
|
||||
e.printStackTrace();
|
||||
PlotSquared.sendConsoleSenderMessage("&3===END OF STACKTRACE===");
|
||||
PlotSquared.log("&3===END OF STACKTRACE===");
|
||||
}
|
||||
} else {
|
||||
PlayerFunctions.sendMessage(plr, "&6This command can only be executed by console as it has been deemed unsafe if abused..");
|
||||
|
@ -66,15 +66,15 @@ public class RegenAllRoads extends SubCommand {
|
||||
World world = Bukkit.getWorld(name);
|
||||
ArrayList<ChunkLoc> chunks = ChunkManager.getChunkChunks(world);
|
||||
|
||||
PlotSquared.sendConsoleSenderMessage("&cIf no schematic is set, the following will not do anything");
|
||||
PlotSquared.sendConsoleSenderMessage("&7 - To set a schematic, stand in a plot and use &c/plot createroadschematic");
|
||||
PlotSquared.sendConsoleSenderMessage("&6Potential chunks to update: &7"+ (chunks.size() * 1024));
|
||||
PlotSquared.sendConsoleSenderMessage("&6Estimated time: &7"+ (chunks.size()) + " seconds");
|
||||
PlotSquared.log("&cIf no schematic is set, the following will not do anything");
|
||||
PlotSquared.log("&7 - To set a schematic, stand in a plot and use &c/plot createroadschematic");
|
||||
PlotSquared.log("&6Potential chunks to update: &7"+ (chunks.size() * 1024));
|
||||
PlotSquared.log("&6Estimated time: &7"+ (chunks.size()) + " seconds");
|
||||
|
||||
boolean result = hpm.scheduleRoadUpdate(world);
|
||||
|
||||
if (!result) {
|
||||
PlotSquared.sendConsoleSenderMessage("&cCannot schedule mass schematic update! (Is one already in progress?)");
|
||||
PlotSquared.log("&cCannot schedule mass schematic update! (Is one already in progress?)");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -67,7 +67,7 @@ public class Schematic extends SubCommand {
|
||||
switch (arg) {
|
||||
case "paste":
|
||||
if (plr == null) {
|
||||
PlotSquared.sendConsoleSenderMessage(C.IS_CONSOLE);
|
||||
PlotSquared.log(C.IS_CONSOLE);
|
||||
return false;
|
||||
}
|
||||
if (!BukkitMain.hasPermission(plr, "plots.schematic.paste")) {
|
||||
@ -155,7 +155,7 @@ public class Schematic extends SubCommand {
|
||||
break;
|
||||
case "test":
|
||||
if (plr == null) {
|
||||
PlotSquared.sendConsoleSenderMessage(C.IS_CONSOLE);
|
||||
PlotSquared.log(C.IS_CONSOLE);
|
||||
return false;
|
||||
}
|
||||
if (!BukkitMain.hasPermission(plr, "plots.schematic.test")) {
|
||||
@ -205,8 +205,8 @@ public class Schematic extends SubCommand {
|
||||
return false;
|
||||
}
|
||||
|
||||
PlotSquared.sendConsoleSenderMessage("&3PlotSquared&8->&3Schemaitc&8: &7Mass export has started. This may take a while.");
|
||||
PlotSquared.sendConsoleSenderMessage("&3PlotSquared&8->&3Schemaitc&8: &7Found &c" + plotmap.size() + "&7 plots...");
|
||||
PlotSquared.log("&3PlotSquared&8->&3Schemaitc&8: &7Mass export has started. This may take a while.");
|
||||
PlotSquared.log("&3PlotSquared&8->&3Schemaitc&8: &7Found &c" + plotmap.size() + "&7 plots...");
|
||||
final World worldObj = Bukkit.getWorld(args[1]);
|
||||
final String worldname = Bukkit.getWorld(args[1]).getName();
|
||||
|
||||
@ -221,7 +221,7 @@ public class Schematic extends SubCommand {
|
||||
@Override
|
||||
public void run() {
|
||||
if (Schematic.this.counter >= Schematic.this.plots.length) {
|
||||
PlotSquared.sendConsoleSenderMessage("&3PlotSquared&8->&3Schemaitc&8: &aFinished!");
|
||||
PlotSquared.log("&3PlotSquared&8->&3Schemaitc&8: &aFinished!");
|
||||
Schematic.this.running = false;
|
||||
Bukkit.getScheduler().cancelTask(Schematic.this.task);
|
||||
return;
|
||||
@ -305,7 +305,7 @@ public class Schematic extends SubCommand {
|
||||
@Override
|
||||
public void run() {
|
||||
if (Schematic.this.counter >= Schematic.this.plots.length) {
|
||||
PlotSquared.sendConsoleSenderMessage("&3PlotSquared&8->&3Schemaitc&8: &aFinished!");
|
||||
PlotSquared.log("&3PlotSquared&8->&3Schemaitc&8: &aFinished!");
|
||||
Schematic.this.running = false;
|
||||
Bukkit.getScheduler().cancelTask(Schematic.this.task);
|
||||
return;
|
||||
|
@ -260,7 +260,7 @@ public class Trim extends SubCommand {
|
||||
}
|
||||
|
||||
public static void sendMessage(final String message) {
|
||||
PlotSquared.sendConsoleSenderMessage("&3PlotSquared -> World trim&8: &7" + message);
|
||||
PlotSquared.log("&3PlotSquared -> World trim&8: &7" + message);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -73,7 +73,7 @@ public class Unlink extends SubCommand {
|
||||
} catch (final Exception e) {
|
||||
// execute(final Player plr, final String... args) {
|
||||
try {
|
||||
PlotSquared.sendConsoleSenderMessage("Error on: " + getClass().getMethod("execute", Player.class, String[].class).toGenericString() + ":119, when trying to use \"SetBlockFast#update\"");
|
||||
PlotSquared.log("Error on: " + getClass().getMethod("execute", Player.class, String[].class).toGenericString() + ":119, when trying to use \"SetBlockFast#update\"");
|
||||
} catch (final Exception ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
|
@ -126,7 +126,7 @@ public class SQLManager implements AbstractDB {
|
||||
statement.close();
|
||||
} catch (final SQLException e) {
|
||||
e.printStackTrace();
|
||||
PlotSquared.sendConsoleSenderMessage("&c[ERROR] "+"Could not set owner for plot " + plot.id);
|
||||
PlotSquared.log("&c[ERROR] "+"Could not set owner for plot " + plot.id);
|
||||
}
|
||||
}
|
||||
});
|
||||
@ -232,7 +232,7 @@ public class SQLManager implements AbstractDB {
|
||||
}
|
||||
}
|
||||
catch (Exception e2) {}
|
||||
PlotSquared.sendConsoleSenderMessage("&7[WARN] "+"Failed to set all helpers for plots");
|
||||
PlotSquared.log("&7[WARN] "+"Failed to set all helpers for plots");
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -284,20 +284,20 @@ public class SQLManager implements AbstractDB {
|
||||
stmt.close();
|
||||
} catch (final Exception e) {
|
||||
e.printStackTrace();
|
||||
PlotSquared.sendConsoleSenderMessage("&6[WARN] "+"Could not bulk save. Conversion may be slower...");
|
||||
PlotSquared.log("&6[WARN] "+"Could not bulk save. Conversion may be slower...");
|
||||
try {
|
||||
for (Plot plot : plots) {
|
||||
try {
|
||||
createPlot(plot);
|
||||
}
|
||||
catch (Exception e3) {
|
||||
PlotSquared.sendConsoleSenderMessage("&c[ERROR] "+"Failed to save plot: "+plot.id);
|
||||
PlotSquared.log("&c[ERROR] "+"Failed to save plot: "+plot.id);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception e2) {
|
||||
e2.printStackTrace();
|
||||
PlotSquared.sendConsoleSenderMessage("&c[ERROR] "+"Failed to save plots!");
|
||||
PlotSquared.log("&c[ERROR] "+"Failed to save plots!");
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -324,7 +324,7 @@ public class SQLManager implements AbstractDB {
|
||||
stmt.close();
|
||||
} catch (final Exception e) {
|
||||
e.printStackTrace();
|
||||
PlotSquared.sendConsoleSenderMessage("&c[ERROR] "+"Failed to save plot " + plot.id);
|
||||
PlotSquared.log("&c[ERROR] "+"Failed to save plot " + plot.id);
|
||||
}
|
||||
}
|
||||
});
|
||||
@ -352,7 +352,7 @@ public class SQLManager implements AbstractDB {
|
||||
stmt.close();
|
||||
} catch (final Exception e) {
|
||||
e.printStackTrace();
|
||||
PlotSquared.sendConsoleSenderMessage("&c[ERROR] "+"Failed to save plot " + plot.id);
|
||||
PlotSquared.log("&c[ERROR] "+"Failed to save plot " + plot.id);
|
||||
}
|
||||
}
|
||||
});
|
||||
@ -439,7 +439,7 @@ public class SQLManager implements AbstractDB {
|
||||
stmt.close();
|
||||
} catch (final SQLException e) {
|
||||
e.printStackTrace();
|
||||
PlotSquared.sendConsoleSenderMessage("&c[ERROR] " + "Failed to delete plot " + plot.id);
|
||||
PlotSquared.log("&c[ERROR] " + "Failed to delete plot " + plot.id);
|
||||
}
|
||||
}
|
||||
});
|
||||
@ -582,7 +582,7 @@ public class SQLManager implements AbstractDB {
|
||||
if (plot != null) {
|
||||
plot.addHelper(user);
|
||||
} else {
|
||||
PlotSquared.sendConsoleSenderMessage("&cPLOT " + id + " in plot_helpers does not exist. Please create the plot or remove this entry.");
|
||||
PlotSquared.log("&cPLOT " + id + " in plot_helpers does not exist. Please create the plot or remove this entry.");
|
||||
}
|
||||
}
|
||||
/*
|
||||
@ -601,7 +601,7 @@ public class SQLManager implements AbstractDB {
|
||||
if (plot != null) {
|
||||
plot.addTrusted(user);
|
||||
} else {
|
||||
PlotSquared.sendConsoleSenderMessage("&cPLOT " + id + " in plot_trusted does not exist. Please create the plot or remove this entry.");
|
||||
PlotSquared.log("&cPLOT " + id + " in plot_trusted does not exist. Please create the plot or remove this entry.");
|
||||
}
|
||||
}
|
||||
/*
|
||||
@ -620,7 +620,7 @@ public class SQLManager implements AbstractDB {
|
||||
if (plot != null) {
|
||||
plot.addDenied(user);
|
||||
} else {
|
||||
PlotSquared.sendConsoleSenderMessage("&cPLOT " + id + " in plot_denied does not exist. Please create the plot or remove this entry.");
|
||||
PlotSquared.log("&cPLOT " + id + " in plot_denied does not exist. Please create the plot or remove this entry.");
|
||||
}
|
||||
}
|
||||
r = stmt.executeQuery("SELECT * FROM `" + this.prefix + "plot_settings`");
|
||||
@ -700,12 +700,12 @@ public class SQLManager implements AbstractDB {
|
||||
}
|
||||
}
|
||||
if (exception) {
|
||||
PlotSquared.sendConsoleSenderMessage("&cPlot " + id + " had an invalid flag. A fix has been attempted.");
|
||||
PlotSquared.log("&cPlot " + id + " had an invalid flag. A fix has been attempted.");
|
||||
setFlags(id, flags.toArray(new Flag[0]));
|
||||
}
|
||||
plot.settings.flags = flags;
|
||||
} else {
|
||||
PlotSquared.sendConsoleSenderMessage("&cPLOT " + id + " in plot_settings does not exist. Please create the plot or remove this entry.");
|
||||
PlotSquared.log("&cPLOT " + id + " in plot_settings does not exist. Please create the plot or remove this entry.");
|
||||
}
|
||||
}
|
||||
stmt.close();
|
||||
@ -720,13 +720,13 @@ public class SQLManager implements AbstractDB {
|
||||
boolean invalidPlot = false;
|
||||
for (final String worldname : noExist.keySet()) {
|
||||
invalidPlot = true;
|
||||
PlotSquared.sendConsoleSenderMessage("&c[WARNING] Found " + noExist.get(worldname) + " plots in DB for non existant world; '" + worldname + "'.");
|
||||
PlotSquared.log("&c[WARNING] Found " + noExist.get(worldname) + " plots in DB for non existant world; '" + worldname + "'.");
|
||||
}
|
||||
if (invalidPlot) {
|
||||
PlotSquared.sendConsoleSenderMessage("&c[WARNING] - Please create the world/s or remove the plots using the purge command");
|
||||
PlotSquared.log("&c[WARNING] - Please create the world/s or remove the plots using the purge command");
|
||||
}
|
||||
} catch (final SQLException e) {
|
||||
PlotSquared.sendConsoleSenderMessage("&7[WARN] "+"Failed to load plots.");
|
||||
PlotSquared.log("&7[WARN] "+"Failed to load plots.");
|
||||
e.printStackTrace();
|
||||
}
|
||||
return newplots;
|
||||
@ -750,7 +750,7 @@ public class SQLManager implements AbstractDB {
|
||||
stmt.close();
|
||||
} catch (final SQLException e) {
|
||||
e.printStackTrace();
|
||||
PlotSquared.sendConsoleSenderMessage("&7[WARN] "+"Could not set merged for plot " + plot.id);
|
||||
PlotSquared.log("&7[WARN] "+"Could not set merged for plot " + plot.id);
|
||||
}
|
||||
}
|
||||
});
|
||||
@ -837,7 +837,7 @@ public class SQLManager implements AbstractDB {
|
||||
stmt.close();
|
||||
} catch (final SQLException e) {
|
||||
e.printStackTrace();
|
||||
PlotSquared.sendConsoleSenderMessage("&7[WARN] "+"Could not set flag for plot " + plot.id);
|
||||
PlotSquared.log("&7[WARN] "+"Could not set flag for plot " + plot.id);
|
||||
}
|
||||
}
|
||||
});
|
||||
@ -862,7 +862,7 @@ public class SQLManager implements AbstractDB {
|
||||
stmt.close();
|
||||
} catch (final SQLException e) {
|
||||
e.printStackTrace();
|
||||
PlotSquared.sendConsoleSenderMessage("&7[WARN] "+"Could not set flag for plot " + id);
|
||||
PlotSquared.log("&7[WARN] "+"Could not set flag for plot " + id);
|
||||
}
|
||||
}
|
||||
});
|
||||
@ -886,7 +886,7 @@ public class SQLManager implements AbstractDB {
|
||||
stmt.executeUpdate();
|
||||
stmt.close();
|
||||
} catch (final SQLException e) {
|
||||
PlotSquared.sendConsoleSenderMessage("&7[WARN] "+"Failed to set alias for plot " + plot.id);
|
||||
PlotSquared.log("&7[WARN] "+"Failed to set alias for plot " + plot.id);
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
@ -930,11 +930,11 @@ public class SQLManager implements AbstractDB {
|
||||
stmt.close();
|
||||
} catch (final SQLException e) {
|
||||
e.printStackTrace();
|
||||
PlotSquared.sendConsoleSenderMessage("&c[ERROR] "+"FAILED TO PURGE WORLD '" + world + "'!");
|
||||
PlotSquared.log("&c[ERROR] "+"FAILED TO PURGE WORLD '" + world + "'!");
|
||||
return;
|
||||
}
|
||||
}
|
||||
PlotSquared.sendConsoleSenderMessage("&6[INFO] "+"SUCCESSFULLY PURGED WORLD '" + world + "'!");
|
||||
PlotSquared.log("&6[INFO] "+"SUCCESSFULLY PURGED WORLD '" + world + "'!");
|
||||
}
|
||||
@Override
|
||||
public void purge(final String world, Set<PlotId> plots) {
|
||||
@ -959,7 +959,7 @@ public class SQLManager implements AbstractDB {
|
||||
r.close();
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
PlotSquared.sendConsoleSenderMessage("&c[ERROR] "+"FAILED TO PURGE WORLD '" + world + "'!");
|
||||
PlotSquared.log("&c[ERROR] "+"FAILED TO PURGE WORLD '" + world + "'!");
|
||||
}
|
||||
}
|
||||
|
||||
@ -980,7 +980,7 @@ public class SQLManager implements AbstractDB {
|
||||
stmt.executeUpdate();
|
||||
stmt.close();
|
||||
} catch (final SQLException e) {
|
||||
PlotSquared.sendConsoleSenderMessage("&7[WARN] "+"Failed to set position for plot " + plot.id);
|
||||
PlotSquared.log("&7[WARN] "+"Failed to set position for plot " + plot.id);
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
@ -1034,7 +1034,7 @@ public class SQLManager implements AbstractDB {
|
||||
stmt.close();
|
||||
r.close();
|
||||
} catch (final SQLException e) {
|
||||
PlotSquared.sendConsoleSenderMessage("&7[WARN] "+"Failed to load settings for plot: " + id);
|
||||
PlotSquared.log("&7[WARN] "+"Failed to load settings for plot: " + id);
|
||||
e.printStackTrace();
|
||||
}
|
||||
return h;
|
||||
@ -1064,7 +1064,7 @@ public class SQLManager implements AbstractDB {
|
||||
statement.close();
|
||||
} catch (final SQLException e) {
|
||||
e.printStackTrace();
|
||||
PlotSquared.sendConsoleSenderMessage("&7[WARN] "+"Failed to remove helper for plot " + plot.id);
|
||||
PlotSquared.log("&7[WARN] "+"Failed to remove helper for plot " + plot.id);
|
||||
}
|
||||
}
|
||||
});
|
||||
@ -1096,7 +1096,7 @@ public class SQLManager implements AbstractDB {
|
||||
statement.close();
|
||||
set.close();
|
||||
} catch (final SQLException e) {
|
||||
PlotSquared.sendConsoleSenderMessage("&7[WARN] "+"Failed to fetch comment");
|
||||
PlotSquared.log("&7[WARN] "+"Failed to fetch comment");
|
||||
e.printStackTrace();
|
||||
}
|
||||
return comments;
|
||||
@ -1117,7 +1117,7 @@ public class SQLManager implements AbstractDB {
|
||||
statement.close();
|
||||
} catch (final SQLException e) {
|
||||
e.printStackTrace();
|
||||
PlotSquared.sendConsoleSenderMessage("&7[WARN] "+"Failed to set comment for plot " + plot.id);
|
||||
PlotSquared.log("&7[WARN] "+"Failed to set comment for plot " + plot.id);
|
||||
}
|
||||
}
|
||||
});
|
||||
@ -1141,7 +1141,7 @@ public class SQLManager implements AbstractDB {
|
||||
statement.close();
|
||||
} catch (final SQLException e) {
|
||||
e.printStackTrace();
|
||||
PlotSquared.sendConsoleSenderMessage("&7[WARN] "+"Failed to remove helper for plot " + plot.id);
|
||||
PlotSquared.log("&7[WARN] "+"Failed to remove helper for plot " + plot.id);
|
||||
}
|
||||
}
|
||||
});
|
||||
@ -1164,7 +1164,7 @@ public class SQLManager implements AbstractDB {
|
||||
statement.close();
|
||||
} catch (final SQLException e) {
|
||||
e.printStackTrace();
|
||||
PlotSquared.sendConsoleSenderMessage("&7[WARN] "+"Failed to remove trusted user for plot " + plot.id);
|
||||
PlotSquared.log("&7[WARN] "+"Failed to remove trusted user for plot " + plot.id);
|
||||
}
|
||||
}
|
||||
});
|
||||
@ -1186,7 +1186,7 @@ public class SQLManager implements AbstractDB {
|
||||
statement.executeUpdate();
|
||||
statement.close();
|
||||
} catch (final SQLException e) {
|
||||
PlotSquared.sendConsoleSenderMessage("&7[WARN] "+"Failed to set helper for plot " + plot.id);
|
||||
PlotSquared.log("&7[WARN] "+"Failed to set helper for plot " + plot.id);
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
@ -1204,7 +1204,7 @@ public class SQLManager implements AbstractDB {
|
||||
statement.executeUpdate();
|
||||
statement.close();
|
||||
} catch (final SQLException e) {
|
||||
PlotSquared.sendConsoleSenderMessage("&7[WARN] "+"Failed to set helper for id " + id);
|
||||
PlotSquared.log("&7[WARN] "+"Failed to set helper for id " + id);
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
@ -1227,7 +1227,7 @@ public class SQLManager implements AbstractDB {
|
||||
statement.executeUpdate();
|
||||
statement.close();
|
||||
} catch (final SQLException e) {
|
||||
PlotSquared.sendConsoleSenderMessage("&7[WARN] "+"Failed to set plot trusted for plot " + plot.id);
|
||||
PlotSquared.log("&7[WARN] "+"Failed to set plot trusted for plot " + plot.id);
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
@ -1251,7 +1251,7 @@ public class SQLManager implements AbstractDB {
|
||||
statement.close();
|
||||
} catch (final SQLException e) {
|
||||
e.printStackTrace();
|
||||
PlotSquared.sendConsoleSenderMessage("&7[WARN] "+"Failed to remove denied for plot " + plot.id);
|
||||
PlotSquared.log("&7[WARN] "+"Failed to remove denied for plot " + plot.id);
|
||||
}
|
||||
}
|
||||
});
|
||||
@ -1273,7 +1273,7 @@ public class SQLManager implements AbstractDB {
|
||||
statement.executeUpdate();
|
||||
statement.close();
|
||||
} catch (final SQLException e) {
|
||||
PlotSquared.sendConsoleSenderMessage("&7[WARN] "+"Failed to set denied for plot " + plot.id);
|
||||
PlotSquared.log("&7[WARN] "+"Failed to set denied for plot " + plot.id);
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
@ -1294,7 +1294,7 @@ public class SQLManager implements AbstractDB {
|
||||
set.close();
|
||||
return rating;
|
||||
} catch (final SQLException e) {
|
||||
PlotSquared.sendConsoleSenderMessage("&7[WARN] "+"Failed to fetch rating for plot " + plot.getId().toString());
|
||||
PlotSquared.log("&7[WARN] "+"Failed to fetch rating for plot " + plot.getId().toString());
|
||||
e.printStackTrace();
|
||||
}
|
||||
return 0.0d;
|
||||
@ -1325,7 +1325,7 @@ public class SQLManager implements AbstractDB {
|
||||
stmt.close();
|
||||
} catch (final SQLException e) {
|
||||
e.printStackTrace();
|
||||
PlotSquared.sendConsoleSenderMessage("&c[ERROR] "+"Failed to delete plot cluster: " + cluster.getP1() + ":" + cluster.getP2());
|
||||
PlotSquared.log("&c[ERROR] "+"Failed to delete plot cluster: " + cluster.getP1() + ":" + cluster.getP2());
|
||||
}
|
||||
}
|
||||
});
|
||||
@ -1419,7 +1419,7 @@ public class SQLManager implements AbstractDB {
|
||||
if (cluster != null) {
|
||||
cluster.helpers.add(user);
|
||||
} else {
|
||||
PlotSquared.sendConsoleSenderMessage("&cCluster " + id + " in cluster_helpers does not exist. Please create the cluster or remove this entry.");
|
||||
PlotSquared.log("&cCluster " + id + " in cluster_helpers does not exist. Please create the cluster or remove this entry.");
|
||||
}
|
||||
}
|
||||
/*
|
||||
@ -1438,7 +1438,7 @@ public class SQLManager implements AbstractDB {
|
||||
if (cluster != null) {
|
||||
cluster.invited.add(user);
|
||||
} else {
|
||||
PlotSquared.sendConsoleSenderMessage("&cCluster " + id + " in cluster_invited does not exist. Please create the cluster or remove this entry.");
|
||||
PlotSquared.log("&cCluster " + id + " in cluster_invited does not exist. Please create the cluster or remove this entry.");
|
||||
}
|
||||
}
|
||||
r = stmt.executeQuery("SELECT * FROM `" + this.prefix + "cluster_settings`");
|
||||
@ -1517,12 +1517,12 @@ public class SQLManager implements AbstractDB {
|
||||
}
|
||||
}
|
||||
if (exception) {
|
||||
PlotSquared.sendConsoleSenderMessage("&cPlot " + id + " had an invalid flag. A fix has been attempted.");
|
||||
PlotSquared.log("&cPlot " + id + " had an invalid flag. A fix has been attempted.");
|
||||
setFlags(id, flags.toArray(new Flag[0]));
|
||||
}
|
||||
cluster.settings.flags = flags;
|
||||
} else {
|
||||
PlotSquared.sendConsoleSenderMessage("&cCluster " + id + " in cluster_settings does not exist. Please create the cluster or remove this entry.");
|
||||
PlotSquared.log("&cCluster " + id + " in cluster_settings does not exist. Please create the cluster or remove this entry.");
|
||||
}
|
||||
}
|
||||
stmt.close();
|
||||
@ -1537,13 +1537,13 @@ public class SQLManager implements AbstractDB {
|
||||
boolean invalidPlot = false;
|
||||
for (final String w : noExist.keySet()) {
|
||||
invalidPlot = true;
|
||||
PlotSquared.sendConsoleSenderMessage("&c[WARNING] Found " + noExist.get(w) + " clusters in DB for non existant world; '" + w + "'.");
|
||||
PlotSquared.log("&c[WARNING] Found " + noExist.get(w) + " clusters in DB for non existant world; '" + w + "'.");
|
||||
}
|
||||
if (invalidPlot) {
|
||||
PlotSquared.sendConsoleSenderMessage("&c[WARNING] - Please create the world/s or remove the clusters using the purge command");
|
||||
PlotSquared.log("&c[WARNING] - Please create the world/s or remove the clusters using the purge command");
|
||||
}
|
||||
} catch (final SQLException e) {
|
||||
PlotSquared.sendConsoleSenderMessage("&7[WARN] "+"Failed to load clusters.");
|
||||
PlotSquared.log("&7[WARN] "+"Failed to load clusters.");
|
||||
e.printStackTrace();
|
||||
}
|
||||
return newClusters;
|
||||
@ -1571,7 +1571,7 @@ public class SQLManager implements AbstractDB {
|
||||
stmt.close();
|
||||
} catch (final SQLException e) {
|
||||
e.printStackTrace();
|
||||
PlotSquared.sendConsoleSenderMessage("&7[WARN] "+"Could not set flag for plot " + cluster);
|
||||
PlotSquared.log("&7[WARN] "+"Could not set flag for plot " + cluster);
|
||||
}
|
||||
}
|
||||
});
|
||||
@ -1592,7 +1592,7 @@ public class SQLManager implements AbstractDB {
|
||||
stmt.executeUpdate();
|
||||
stmt.close();
|
||||
} catch (final SQLException e) {
|
||||
PlotSquared.sendConsoleSenderMessage("&7[WARN] "+"Failed to set alias for cluster " + cluster);
|
||||
PlotSquared.log("&7[WARN] "+"Failed to set alias for cluster " + cluster);
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
@ -1613,7 +1613,7 @@ public class SQLManager implements AbstractDB {
|
||||
statement.close();
|
||||
} catch (final SQLException e) {
|
||||
e.printStackTrace();
|
||||
PlotSquared.sendConsoleSenderMessage("&7[WARN] "+"Failed to remove helper for cluster " + cluster);
|
||||
PlotSquared.log("&7[WARN] "+"Failed to remove helper for cluster " + cluster);
|
||||
}
|
||||
}
|
||||
});
|
||||
@ -1631,7 +1631,7 @@ public class SQLManager implements AbstractDB {
|
||||
statement.executeUpdate();
|
||||
statement.close();
|
||||
} catch (final SQLException e) {
|
||||
PlotSquared.sendConsoleSenderMessage("&7[WARN] "+"Failed to set helper for cluster " + cluster);
|
||||
PlotSquared.log("&7[WARN] "+"Failed to set helper for cluster " + cluster);
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
@ -1663,7 +1663,7 @@ public class SQLManager implements AbstractDB {
|
||||
stmt.close();
|
||||
} catch (final Exception e) {
|
||||
e.printStackTrace();
|
||||
PlotSquared.sendConsoleSenderMessage("&c[ERROR] "+"Failed to save cluster " + cluster);
|
||||
PlotSquared.log("&c[ERROR] "+"Failed to save cluster " + cluster);
|
||||
}
|
||||
}
|
||||
});
|
||||
@ -1689,7 +1689,7 @@ public class SQLManager implements AbstractDB {
|
||||
stmt.executeUpdate();
|
||||
stmt.close();
|
||||
} catch (final SQLException e) {
|
||||
PlotSquared.sendConsoleSenderMessage("&7[WARN] "+"Failed to rezize cluster " + current);
|
||||
PlotSquared.log("&7[WARN] "+"Failed to rezize cluster " + current);
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
@ -1709,7 +1709,7 @@ public class SQLManager implements AbstractDB {
|
||||
stmt.executeUpdate();
|
||||
stmt.close();
|
||||
} catch (final SQLException e) {
|
||||
PlotSquared.sendConsoleSenderMessage("&7[WARN] "+"Failed to set position for cluster " + cluster);
|
||||
PlotSquared.log("&7[WARN] "+"Failed to set position for cluster " + cluster);
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
@ -1758,7 +1758,7 @@ public class SQLManager implements AbstractDB {
|
||||
stmt.close();
|
||||
r.close();
|
||||
} catch (final SQLException e) {
|
||||
PlotSquared.sendConsoleSenderMessage("&7[WARN] "+"Failed to load settings for cluster: " + id);
|
||||
PlotSquared.log("&7[WARN] "+"Failed to load settings for cluster: " + id);
|
||||
e.printStackTrace();
|
||||
}
|
||||
return h;
|
||||
@ -1777,7 +1777,7 @@ public class SQLManager implements AbstractDB {
|
||||
statement.close();
|
||||
} catch (final SQLException e) {
|
||||
e.printStackTrace();
|
||||
PlotSquared.sendConsoleSenderMessage("&7[WARN] "+"Failed to remove invited for cluster " + cluster);
|
||||
PlotSquared.log("&7[WARN] "+"Failed to remove invited for cluster " + cluster);
|
||||
}
|
||||
}
|
||||
});
|
||||
@ -1796,7 +1796,7 @@ public class SQLManager implements AbstractDB {
|
||||
statement.executeUpdate();
|
||||
statement.close();
|
||||
} catch (final SQLException e) {
|
||||
PlotSquared.sendConsoleSenderMessage("&7[WARN] "+"Failed to set helper for cluster " + cluster);
|
||||
PlotSquared.log("&7[WARN] "+"Failed to set helper for cluster " + cluster);
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
@ -63,7 +63,7 @@ import com.intellectualcrafters.plot.object.PlotWorld;
|
||||
* @return success?
|
||||
*/
|
||||
public static boolean addFlag(final AbstractFlag af) {
|
||||
PlotSquared.sendConsoleSenderMessage(C.PREFIX.s() + "&8 - Adding flag: &7" + af);
|
||||
PlotSquared.log(C.PREFIX.s() + "&8 - Adding flag: &7" + af);
|
||||
String key = af.getKey();
|
||||
if (PlotSquared.getAllPlotsRaw() != null) {
|
||||
for (Plot plot : PlotSquared.getPlots()) {
|
||||
|
@ -50,7 +50,7 @@ public abstract class ClassicPlotWorld extends SquarePlotWorld {
|
||||
@Override
|
||||
public void loadConfiguration(final ConfigurationSection config) {
|
||||
if (!config.contains("plot.height")) {
|
||||
PlotSquared.sendConsoleSenderMessage(" - &cConfiguration is null? (" + config.getCurrentPath() + ")");
|
||||
PlotSquared.log(" - &cConfiguration is null? (" + config.getCurrentPath() + ")");
|
||||
}
|
||||
this.PLOT_BEDROCK = config.getBoolean("plot.bedrock");
|
||||
this.PLOT_HEIGHT = Math.min(255, config.getInt("plot.height"));
|
||||
|
@ -211,23 +211,23 @@ import com.intellectualcrafters.plot.util.bukkit.BukkitTaskManager;
|
||||
public void run() {
|
||||
if (chunks.size() == 0) {
|
||||
HybridPlotManager.UPDATE = false;
|
||||
PlotSquared.sendConsoleSenderMessage(C.PREFIX.s() + "Finished road conversion");
|
||||
PlotSquared.log(C.PREFIX.s() + "Finished road conversion");
|
||||
Bukkit.getScheduler().cancelTask(task);
|
||||
return;
|
||||
}
|
||||
else {
|
||||
try {
|
||||
ChunkLoc loc = chunks.get(0);
|
||||
PlotSquared.sendConsoleSenderMessage("Updating .mcr: " + loc.x + ", "+loc.z + " (aprrox 256 chunks)");
|
||||
PlotSquared.sendConsoleSenderMessage("Remaining regions: "+chunks.size());
|
||||
PlotSquared.log("Updating .mcr: " + loc.x + ", "+loc.z + " (aprrox 256 chunks)");
|
||||
PlotSquared.log("Remaining regions: "+chunks.size());
|
||||
regenerateChunkChunk(world, loc);
|
||||
chunks.remove(0);
|
||||
}
|
||||
catch (Exception e) {
|
||||
ChunkLoc loc = chunks.get(0);
|
||||
PlotSquared.sendConsoleSenderMessage("&c[ERROR]&7 Could not update '"+world.getName() + "/region/r." + loc.x + "." + loc.z + ".mca' (Corrupt chunk?)");
|
||||
PlotSquared.sendConsoleSenderMessage("&d - Potentially skipping 256 chunks");
|
||||
PlotSquared.sendConsoleSenderMessage("&d - TODO: recommend chunkster if corrupt");
|
||||
PlotSquared.log("&c[ERROR]&7 Could not update '"+world.getName() + "/region/r." + loc.x + "." + loc.z + ".mca' (Corrupt chunk?)");
|
||||
PlotSquared.log("&d - Potentially skipping 256 chunks");
|
||||
PlotSquared.log("&d - TODO: recommend chunkster if corrupt");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -62,7 +62,7 @@ public class HybridPlotWorld extends ClassicPlotWorld {
|
||||
@Override
|
||||
public void loadConfiguration(final ConfigurationSection config) {
|
||||
if (!config.contains("plot.height")) {
|
||||
PlotSquared.sendConsoleSenderMessage(" - &cConfiguration is null? (" + config.getCurrentPath() + ")");
|
||||
PlotSquared.log(" - &cConfiguration is null? (" + config.getCurrentPath() + ")");
|
||||
}
|
||||
this.PLOT_BEDROCK = config.getBoolean("plot.bedrock");
|
||||
this.PLOT_HEIGHT = Math.min(255, config.getInt("plot.height"));
|
||||
@ -89,7 +89,7 @@ public class HybridPlotWorld extends ClassicPlotWorld {
|
||||
try {
|
||||
setupSchematics();
|
||||
} catch (Exception e) {
|
||||
PlotSquared.sendConsoleSenderMessage("&c - road schematics are disabled for this world.");
|
||||
PlotSquared.log("&c - road schematics are disabled for this world.");
|
||||
this.ROAD_SCHEMATIC_ENABLED = false;
|
||||
}
|
||||
System.out.print("LOADED!");
|
||||
@ -144,7 +144,7 @@ public class HybridPlotWorld extends ClassicPlotWorld {
|
||||
}
|
||||
|
||||
if (schem1 == null || schem2 == null || this.ROAD_WIDTH == 0) {
|
||||
PlotSquared.sendConsoleSenderMessage(C.PREFIX.s() + "&3 - schematic: &7false");
|
||||
PlotSquared.log(C.PREFIX.s() + "&3 - schematic: &7false");
|
||||
return;
|
||||
}
|
||||
// Do not populate road if using schematic population
|
||||
|
@ -15,7 +15,7 @@ public abstract class SquarePlotWorld extends GridPlotWorld {
|
||||
@Override
|
||||
public void loadConfiguration(final ConfigurationSection config) {
|
||||
if (!config.contains("plot.height")) {
|
||||
PlotSquared.sendConsoleSenderMessage(" - &cConfiguration is null? (" + config.getCurrentPath() + ")");
|
||||
PlotSquared.log(" - &cConfiguration is null? (" + config.getCurrentPath() + ")");
|
||||
}
|
||||
this.PLOT_WIDTH = config.getInt("plot.size");
|
||||
this.ROAD_WIDTH = config.getInt("road.width");
|
||||
|
@ -713,7 +713,7 @@ public class PlayerEvents extends com.intellectualcrafters.plot.listeners.PlotLi
|
||||
final PlotManager manager = PlotSquared.getPlotManager(plot.getWorld());
|
||||
manager.clearPlot(null, plotworld, plot, true, null);
|
||||
DBFunc.delete(plot.getWorld().getName(), plot);
|
||||
PlotSquared.sendConsoleSenderMessage(String.format("&cPlot &6%s &cwas deleted + cleared due to &6%s&c getting banned", plot.getId(), event.getPlayer().getName()));
|
||||
PlotSquared.log(String.format("&cPlot &6%s &cwas deleted + cleared due to &6%s&c getting banned", plot.getId(), event.getPlayer().getName()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -137,7 +137,7 @@ public abstract class PlotWorld {
|
||||
this.DEFAULT_FLAGS = FlagManager.parseFlags(flags);
|
||||
}
|
||||
catch (Exception e) {
|
||||
PlotSquared.sendConsoleSenderMessage("&cInvalid default flags for "+this.worldname+": "+StringUtils.join(flags,","));
|
||||
PlotSquared.log("&cInvalid default flags for "+this.worldname+": "+StringUtils.join(flags,","));
|
||||
this.DEFAULT_FLAGS = new Flag[]{};
|
||||
}
|
||||
}
|
||||
|
@ -227,7 +227,7 @@ public class EntityWrapper {
|
||||
return;
|
||||
}
|
||||
default: {
|
||||
PlotSquared.sendConsoleSenderMessage("&cCOULD NOT IDENTIFY ENTITY: " + entity.getType());
|
||||
PlotSquared.log("&cCOULD NOT IDENTIFY ENTITY: " + entity.getType());
|
||||
return;
|
||||
}
|
||||
|
||||
@ -443,7 +443,7 @@ public class EntityWrapper {
|
||||
return entity;
|
||||
}
|
||||
default: {
|
||||
PlotSquared.sendConsoleSenderMessage("&cCOULD NOT IDENTIFY ENTITY: " + entity.getType());
|
||||
PlotSquared.log("&cCOULD NOT IDENTIFY ENTITY: " + entity.getType());
|
||||
return entity;
|
||||
}
|
||||
|
||||
|
@ -16,7 +16,7 @@ public class HackTitle extends AbstractTitle {
|
||||
title.send(player);
|
||||
}
|
||||
catch (Throwable e) {
|
||||
PlotSquared.sendConsoleSenderMessage("&cYour server version does not support titles!");
|
||||
PlotSquared.log("&cYour server version does not support titles!");
|
||||
Settings.TITLES = false;
|
||||
AbstractTitle.TITLE_CLASS = null;
|
||||
}
|
||||
|
@ -100,7 +100,7 @@ public class ChunkManager {
|
||||
public void run() {
|
||||
String directory = world + File.separator + "region" + File.separator + "r." + loc.x + "." + loc.z + ".mca";
|
||||
File file = new File(directory);
|
||||
PlotSquared.sendConsoleSenderMessage("&6 - Deleting file: " + file.getName() + " (max 1024 chunks)");
|
||||
PlotSquared.log("&6 - Deleting file: " + file.getName() + " (max 1024 chunks)");
|
||||
if (file.exists()) {
|
||||
file.delete();
|
||||
}
|
||||
@ -446,7 +446,7 @@ public class ChunkManager {
|
||||
chest.getInventory().setContents(chestContents.get(loc));
|
||||
state.update(true);
|
||||
}
|
||||
else { PlotSquared.sendConsoleSenderMessage("&c[WARN] Plot clear failed to regenerate chest: "+loc.x + x_offset+","+loc.y+","+loc.z + z_offset); }
|
||||
else { PlotSquared.log("&c[WARN] Plot clear failed to regenerate chest: "+loc.x + x_offset+","+loc.y+","+loc.z + z_offset); }
|
||||
}
|
||||
|
||||
for (BlockLoc loc: signContents.keySet()) {
|
||||
@ -461,7 +461,7 @@ public class ChunkManager {
|
||||
}
|
||||
state.update(true);
|
||||
}
|
||||
else { PlotSquared.sendConsoleSenderMessage("&c[WARN] Plot clear failed to regenerate sign: "+loc.x + x_offset+","+loc.y+","+loc.z + z_offset); }
|
||||
else { PlotSquared.log("&c[WARN] Plot clear failed to regenerate sign: "+loc.x + x_offset+","+loc.y+","+loc.z + z_offset); }
|
||||
}
|
||||
|
||||
for (BlockLoc loc: dispenserContents.keySet()) {
|
||||
@ -471,7 +471,7 @@ public class ChunkManager {
|
||||
((Dispenser) (state)).getInventory().setContents(dispenserContents.get(loc));
|
||||
state.update(true);
|
||||
}
|
||||
else { PlotSquared.sendConsoleSenderMessage("&c[WARN] Plot clear failed to regenerate dispenser: "+loc.x + x_offset+","+loc.y+","+loc.z + z_offset); }
|
||||
else { PlotSquared.log("&c[WARN] Plot clear failed to regenerate dispenser: "+loc.x + x_offset+","+loc.y+","+loc.z + z_offset); }
|
||||
}
|
||||
for (BlockLoc loc: dropperContents.keySet()) {
|
||||
Block block = world.getBlockAt(loc.x + x_offset, loc.y, loc.z + z_offset);
|
||||
@ -480,7 +480,7 @@ public class ChunkManager {
|
||||
((Dropper) (state)).getInventory().setContents(dropperContents.get(loc));
|
||||
state.update(true);
|
||||
}
|
||||
else { PlotSquared.sendConsoleSenderMessage("&c[WARN] Plot clear failed to regenerate dispenser: "+loc.x + x_offset+","+loc.y+","+loc.z + z_offset); }
|
||||
else { PlotSquared.log("&c[WARN] Plot clear failed to regenerate dispenser: "+loc.x + x_offset+","+loc.y+","+loc.z + z_offset); }
|
||||
}
|
||||
for (BlockLoc loc: beaconContents.keySet()) {
|
||||
Block block = world.getBlockAt(loc.x + x_offset, loc.y, loc.z + z_offset);
|
||||
@ -489,7 +489,7 @@ public class ChunkManager {
|
||||
((Beacon) (state)).getInventory().setContents(beaconContents.get(loc));
|
||||
state.update(true);
|
||||
}
|
||||
else { PlotSquared.sendConsoleSenderMessage("&c[WARN] Plot clear failed to regenerate beacon: "+loc.x + x_offset+","+loc.y+","+loc.z + z_offset); }
|
||||
else { PlotSquared.log("&c[WARN] Plot clear failed to regenerate beacon: "+loc.x + x_offset+","+loc.y+","+loc.z + z_offset); }
|
||||
}
|
||||
for (BlockLoc loc: jukeDisc.keySet()) {
|
||||
Block block = world.getBlockAt(loc.x + x_offset, loc.y, loc.z + z_offset);
|
||||
@ -498,7 +498,7 @@ public class ChunkManager {
|
||||
((Jukebox) (state)).setPlaying(Material.getMaterial(jukeDisc.get(loc)));
|
||||
state.update(true);
|
||||
}
|
||||
else { PlotSquared.sendConsoleSenderMessage("&c[WARN] Plot clear failed to restore jukebox: "+loc.x + x_offset+","+loc.y+","+loc.z + z_offset); }
|
||||
else { PlotSquared.log("&c[WARN] Plot clear failed to restore jukebox: "+loc.x + x_offset+","+loc.y+","+loc.z + z_offset); }
|
||||
}
|
||||
for (BlockLoc loc: skullData.keySet()) {
|
||||
Block block = world.getBlockAt(loc.x + x_offset, loc.y, loc.z + z_offset);
|
||||
@ -516,7 +516,7 @@ public class ChunkManager {
|
||||
}
|
||||
state.update(true);
|
||||
}
|
||||
else { PlotSquared.sendConsoleSenderMessage("&c[WARN] Plot clear failed to restore jukebox: "+loc.x + x_offset+","+loc.y+","+loc.z + z_offset); }
|
||||
else { PlotSquared.log("&c[WARN] Plot clear failed to restore jukebox: "+loc.x + x_offset+","+loc.y+","+loc.z + z_offset); }
|
||||
}
|
||||
for (BlockLoc loc: hopperContents.keySet()) {
|
||||
Block block = world.getBlockAt(loc.x + x_offset, loc.y, loc.z + z_offset);
|
||||
@ -525,7 +525,7 @@ public class ChunkManager {
|
||||
((Hopper) (state)).getInventory().setContents(hopperContents.get(loc));
|
||||
state.update(true);
|
||||
}
|
||||
else { PlotSquared.sendConsoleSenderMessage("&c[WARN] Plot clear failed to regenerate hopper: "+loc.x + x_offset+","+loc.y+","+loc.z + z_offset); }
|
||||
else { PlotSquared.log("&c[WARN] Plot clear failed to regenerate hopper: "+loc.x + x_offset+","+loc.y+","+loc.z + z_offset); }
|
||||
}
|
||||
|
||||
for (BlockLoc loc: noteBlockContents.keySet()) {
|
||||
@ -535,7 +535,7 @@ public class ChunkManager {
|
||||
((NoteBlock) (state)).setNote(noteBlockContents.get(loc));
|
||||
state.update(true);
|
||||
}
|
||||
else { PlotSquared.sendConsoleSenderMessage("&c[WARN] Plot clear failed to regenerate note block: "+loc.x + x_offset+","+loc.y+","+loc.z + z_offset); }
|
||||
else { PlotSquared.log("&c[WARN] Plot clear failed to regenerate note block: "+loc.x + x_offset+","+loc.y+","+loc.z + z_offset); }
|
||||
}
|
||||
for (BlockLoc loc: brewTime.keySet()) {
|
||||
Block block = world.getBlockAt(loc.x + x_offset, loc.y, loc.z + z_offset);
|
||||
@ -543,7 +543,7 @@ public class ChunkManager {
|
||||
if (state instanceof BrewingStand) {
|
||||
((BrewingStand) (state)).setBrewingTime(brewTime.get(loc));
|
||||
}
|
||||
else { PlotSquared.sendConsoleSenderMessage("&c[WARN] Plot clear failed to restore brewing stand cooking: "+loc.x + x_offset+","+loc.y+","+loc.z + z_offset); }
|
||||
else { PlotSquared.log("&c[WARN] Plot clear failed to restore brewing stand cooking: "+loc.x + x_offset+","+loc.y+","+loc.z + z_offset); }
|
||||
}
|
||||
|
||||
for (BlockLoc loc: spawnerData.keySet()) {
|
||||
@ -553,7 +553,7 @@ public class ChunkManager {
|
||||
((CreatureSpawner) (state)).setCreatureTypeId(spawnerData.get(loc));
|
||||
state.update(true);
|
||||
}
|
||||
else { PlotSquared.sendConsoleSenderMessage("&c[WARN] Plot clear failed to restore spawner type: "+loc.x + x_offset+","+loc.y+","+loc.z + z_offset); }
|
||||
else { PlotSquared.log("&c[WARN] Plot clear failed to restore spawner type: "+loc.x + x_offset+","+loc.y+","+loc.z + z_offset); }
|
||||
}
|
||||
for (BlockLoc loc: cmdData.keySet()) {
|
||||
Block block = world.getBlockAt(loc.x + x_offset, loc.y, loc.z + z_offset);
|
||||
@ -562,7 +562,7 @@ public class ChunkManager {
|
||||
((CommandBlock) (state)).setCommand(cmdData.get(loc));
|
||||
state.update(true);
|
||||
}
|
||||
else { PlotSquared.sendConsoleSenderMessage("&c[WARN] Plot clear failed to restore command block: "+loc.x + x_offset+","+loc.y+","+loc.z + z_offset); }
|
||||
else { PlotSquared.log("&c[WARN] Plot clear failed to restore command block: "+loc.x + x_offset+","+loc.y+","+loc.z + z_offset); }
|
||||
}
|
||||
for (BlockLoc loc: brewingStandContents.keySet()) {
|
||||
Block block = world.getBlockAt(loc.x + x_offset, loc.y, loc.z + z_offset);
|
||||
@ -571,7 +571,7 @@ public class ChunkManager {
|
||||
((BrewingStand) (state)).getInventory().setContents(brewingStandContents.get(loc));
|
||||
state.update(true);
|
||||
}
|
||||
else { PlotSquared.sendConsoleSenderMessage("&c[WARN] Plot clear failed to regenerate brewing stand: "+loc.x + x_offset+","+loc.y+","+loc.z + z_offset); }
|
||||
else { PlotSquared.log("&c[WARN] Plot clear failed to regenerate brewing stand: "+loc.x + x_offset+","+loc.y+","+loc.z + z_offset); }
|
||||
}
|
||||
for (BlockLoc loc: furnaceTime.keySet()) {
|
||||
Block block = world.getBlockAt(loc.x + x_offset, loc.y, loc.z + z_offset);
|
||||
@ -581,7 +581,7 @@ public class ChunkManager {
|
||||
((Furnace) (state)).setBurnTime(time[0]);
|
||||
((Furnace) (state)).setCookTime(time[1]);
|
||||
}
|
||||
else { PlotSquared.sendConsoleSenderMessage("&c[WARN] Plot clear failed to restore furnace cooking: "+loc.x + x_offset+","+loc.y+","+loc.z + z_offset); }
|
||||
else { PlotSquared.log("&c[WARN] Plot clear failed to restore furnace cooking: "+loc.x + x_offset+","+loc.y+","+loc.z + z_offset); }
|
||||
}
|
||||
for (BlockLoc loc: furnaceContents.keySet()) {
|
||||
Block block = world.getBlockAt(loc.x + x_offset, loc.y, loc.z + z_offset);
|
||||
@ -590,7 +590,7 @@ public class ChunkManager {
|
||||
((Furnace) (state)).getInventory().setContents(furnaceContents.get(loc));
|
||||
state.update(true);
|
||||
}
|
||||
else { PlotSquared.sendConsoleSenderMessage("&c[WARN] Plot clear failed to regenerate furnace: "+loc.x + x_offset+","+loc.y+","+loc.z + z_offset); }
|
||||
else { PlotSquared.log("&c[WARN] Plot clear failed to regenerate furnace: "+loc.x + x_offset+","+loc.y+","+loc.z + z_offset); }
|
||||
}
|
||||
|
||||
for (BlockLoc loc: bannerBase.keySet()) {
|
||||
@ -606,7 +606,7 @@ public class ChunkManager {
|
||||
}
|
||||
state.update(true);
|
||||
}
|
||||
else { PlotSquared.sendConsoleSenderMessage("&c[WARN] Plot clear failed to regenerate banner: "+loc.x + x_offset+","+loc.y+","+loc.z + z_offset); }
|
||||
else { PlotSquared.log("&c[WARN] Plot clear failed to regenerate banner: "+loc.x + x_offset+","+loc.y+","+loc.z + z_offset); }
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -50,7 +50,7 @@ public class ExpireManager {
|
||||
@Override
|
||||
public void run() {
|
||||
HashMap<Plot, Long> plots = getOldPlots(world);
|
||||
PlotSquared.sendConsoleSenderMessage("&cFound " + plots.size() + " expired plots for " + world + "!");
|
||||
PlotSquared.log("&cFound " + plots.size() + " expired plots for " + world + "!");
|
||||
expiredPlots.put(world, plots);
|
||||
updatingPlots.put(world, false);
|
||||
}
|
||||
@ -120,13 +120,13 @@ public class ExpireManager {
|
||||
DBFunc.delete(world, plot);
|
||||
PlotSquared.removePlot(world, plot.id, true);
|
||||
expiredPlots.get(world).remove(plot);
|
||||
PlotSquared.sendConsoleSenderMessage("&cDeleted expired plot: " + plot.id);
|
||||
PlotSquared.sendConsoleSenderMessage("&3 - World: "+plot.world);
|
||||
PlotSquared.log("&cDeleted expired plot: " + plot.id);
|
||||
PlotSquared.log("&3 - World: "+plot.world);
|
||||
if (plot.hasOwner()) {
|
||||
PlotSquared.sendConsoleSenderMessage("&3 - Owner: "+UUIDHandler.getName(plot.owner));
|
||||
PlotSquared.log("&3 - Owner: "+UUIDHandler.getName(plot.owner));
|
||||
}
|
||||
else {
|
||||
PlotSquared.sendConsoleSenderMessage("&3 - Owner: Unowned");
|
||||
PlotSquared.log("&3 - Owner: Unowned");
|
||||
}
|
||||
return;
|
||||
}
|
||||
@ -205,7 +205,7 @@ public class ExpireManager {
|
||||
if (filename != null) {
|
||||
File playerFile = new File(worldname + File.separator + foldername + File.separator + filename);
|
||||
if (!playerFile.exists()) {
|
||||
PlotSquared.sendConsoleSenderMessage("Could not find file: " + filename);
|
||||
PlotSquared.log("Could not find file: " + filename);
|
||||
}
|
||||
else {
|
||||
try {
|
||||
@ -217,7 +217,7 @@ public class ExpireManager {
|
||||
}
|
||||
}
|
||||
catch (Exception e) {
|
||||
PlotSquared.sendConsoleSenderMessage("Please disable disk checking in old plot auto clearing; Could not read file: " + filename);
|
||||
PlotSquared.log("Please disable disk checking in old plot auto clearing; Could not read file: " + filename);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -53,7 +53,7 @@ public class Logger {
|
||||
}
|
||||
reader.close();
|
||||
} catch (final IOException e) {
|
||||
PlotSquared.sendConsoleSenderMessage(C.PREFIX.s() + "File setup error Logger#setup");
|
||||
PlotSquared.log(C.PREFIX.s() + "File setup error Logger#setup");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -11,7 +11,7 @@ public class MainUtil {
|
||||
*
|
||||
* @param c message
|
||||
*/
|
||||
public static void sendConsoleSenderMessage(final C c) {
|
||||
PlotSquared.MAIN_IMP.sendConsoleSenderMessage(c.s());
|
||||
public static void log(final C c) {
|
||||
PlotSquared.MAIN_IMP.log(c.s());
|
||||
}
|
||||
}
|
||||
|
@ -286,7 +286,7 @@ import java.util.UUID;
|
||||
public static boolean sendMessage(final Player plr, final String msg, final boolean prefix) {
|
||||
if ((msg.length() > 0) && !msg.equals("")) {
|
||||
if (plr == null) {
|
||||
PlotSquared.MAIN_IMP.sendConsoleSenderMessage(C.PREFIX.s() + msg);
|
||||
PlotSquared.MAIN_IMP.log(C.PREFIX.s() + msg);
|
||||
} else {
|
||||
sendMessageWrapped(plr, ChatColor.translateAlternateColorCodes('&', C.PREFIX.s() + msg));
|
||||
}
|
||||
@ -313,7 +313,7 @@ import java.util.UUID;
|
||||
}
|
||||
}
|
||||
if (plr == null) {
|
||||
PlotSquared.sendConsoleSenderMessage(msg);
|
||||
PlotSquared.log(msg);
|
||||
}
|
||||
else {
|
||||
sendMessage(plr, msg, c.usePrefix());
|
||||
|
@ -32,7 +32,7 @@ public class PlotSquaredException extends RuntimeException {
|
||||
|
||||
public PlotSquaredException(final PlotError error, final String details) {
|
||||
super("PlotError >> " + error.getHeader() + ": " + details);
|
||||
PlotSquared.sendConsoleSenderMessage("&cPlotError &6>> &c" + error.getHeader() + ": &6" + details);
|
||||
PlotSquared.log("&cPlotError &6>> &c" + error.getHeader() + ": &6" + details);
|
||||
}
|
||||
|
||||
public static enum PlotError {
|
||||
|
@ -69,7 +69,7 @@ public class SchematicHandler {
|
||||
*/
|
||||
public static boolean paste(final Location location, final Schematic schematic, final Plot plot, final int x_offset, final int z_offset) {
|
||||
if (schematic == null) {
|
||||
PlotSquared.sendConsoleSenderMessage("Schematic == null :|");
|
||||
PlotSquared.log("Schematic == null :|");
|
||||
return false;
|
||||
}
|
||||
try {
|
||||
@ -179,7 +179,7 @@ public class SchematicHandler {
|
||||
}
|
||||
final File file = new File(PlotSquared.getMain().getDirectory() + File.separator + "schematics" + File.separator + name + ".schematic");
|
||||
if (!file.exists()) {
|
||||
PlotSquared.sendConsoleSenderMessage(file.toString() + " doesn't exist");
|
||||
PlotSquared.log(file.toString() + " doesn't exist");
|
||||
return null;
|
||||
}
|
||||
|
||||
@ -191,7 +191,7 @@ public class SchematicHandler {
|
||||
return getSchematic(tag, file);
|
||||
|
||||
} catch (final Exception e) {
|
||||
PlotSquared.sendConsoleSenderMessage(file.toString() + " is not in GZIP format");
|
||||
PlotSquared.log(file.toString() + " is not in GZIP format");
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@ -206,7 +206,7 @@ public class SchematicHandler {
|
||||
*/
|
||||
public static boolean save(final CompoundTag tag, final String path) {
|
||||
if (tag == null) {
|
||||
PlotSquared.sendConsoleSenderMessage("&cCannot save empty tag");
|
||||
PlotSquared.log("&cCannot save empty tag");
|
||||
return false;
|
||||
}
|
||||
try {
|
||||
@ -265,7 +265,7 @@ public class SchematicHandler {
|
||||
}
|
||||
}
|
||||
} catch (final Exception e) {
|
||||
PlotSquared.sendConsoleSenderMessage("&7 - Cannot save: corrupt chunk at " + (i / 16) + ", " + (j / 16));
|
||||
PlotSquared.log("&7 - Cannot save: corrupt chunk at " + (i / 16) + ", " + (j / 16));
|
||||
return null;
|
||||
}
|
||||
final int width = (pos2.getBlockX() - pos1.getBlockX()) + 1;
|
||||
|
@ -109,7 +109,7 @@ public class UUIDHandler {
|
||||
uuids.add(uuid);
|
||||
}
|
||||
catch (Exception e) {
|
||||
PlotSquared.sendConsoleSenderMessage(C.PREFIX.s() + "Invalid playerdata: "+current);
|
||||
PlotSquared.log(C.PREFIX.s() + "Invalid playerdata: "+current);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -136,7 +136,7 @@ public class UUIDHandler {
|
||||
add(name, uuid);
|
||||
}
|
||||
catch (Throwable e) {
|
||||
PlotSquared.sendConsoleSenderMessage(C.PREFIX.s() + "&6Invalid playerdata: "+uuid.toString() + ".dat");
|
||||
PlotSquared.log(C.PREFIX.s() + "&6Invalid playerdata: "+uuid.toString() + ".dat");
|
||||
}
|
||||
}
|
||||
for (String name : names) {
|
||||
@ -149,7 +149,7 @@ public class UUIDHandler {
|
||||
// add the Everyone '*' UUID
|
||||
add(new StringWrapper("*"), DBFunc.everyone);
|
||||
|
||||
PlotSquared.sendConsoleSenderMessage(C.PREFIX.s() + "&6Cached a total of: " + UUIDHandler.uuidMap.size() + " UUIDs");
|
||||
PlotSquared.log(C.PREFIX.s() + "&6Cached a total of: " + UUIDHandler.uuidMap.size() + " UUIDs");
|
||||
}
|
||||
|
||||
public static UUID getUUID(Player player) {
|
||||
|
Loading…
Reference in New Issue
Block a user