mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2025-06-25 10:14:42 +02:00
Refactor PS (and rename to PlotSquared)
This commit is contained in:
@ -11,7 +11,7 @@ import com.github.intellectualsites.plotsquared.bukkit.util.block.*;
|
||||
import com.github.intellectualsites.plotsquared.bukkit.uuid.*;
|
||||
import com.github.intellectualsites.plotsquared.configuration.ConfigurationSection;
|
||||
import com.github.intellectualsites.plotsquared.plot.IPlotMain;
|
||||
import com.github.intellectualsites.plotsquared.plot.PS;
|
||||
import com.github.intellectualsites.plotsquared.plot.PlotSquared;
|
||||
import com.github.intellectualsites.plotsquared.plot.config.C;
|
||||
import com.github.intellectualsites.plotsquared.plot.config.ConfigurationNode;
|
||||
import com.github.intellectualsites.plotsquared.plot.config.Settings;
|
||||
@ -124,8 +124,8 @@ public final class BukkitMain extends JavaPlugin implements Listener, IPlotMain
|
||||
}
|
||||
} catch (NumberFormatException e) {
|
||||
e.printStackTrace();
|
||||
PS.debug(StringMan.getString(Bukkit.getBukkitVersion()));
|
||||
PS.debug(StringMan.getString(Bukkit.getBukkitVersion().split("-")[0].split("\\.")));
|
||||
PlotSquared.debug(StringMan.getString(Bukkit.getBukkitVersion()));
|
||||
PlotSquared.debug(StringMan.getString(Bukkit.getBukkitVersion().split("-")[0].split("\\.")));
|
||||
return new int[] {1, 13, 0};
|
||||
}
|
||||
}
|
||||
@ -138,12 +138,12 @@ public final class BukkitMain extends JavaPlugin implements Listener, IPlotMain
|
||||
}
|
||||
this.pluginName = getDescription().getName();
|
||||
getServer().getName();
|
||||
new PS(this, "Bukkit");
|
||||
new PlotSquared(this, "Bukkit");
|
||||
if (Settings.Enabled_Components.METRICS) {
|
||||
new Metrics(this).start();
|
||||
PS.log(C.PREFIX + "&6Metrics enabled.");
|
||||
PlotSquared.log(C.PREFIX + "&6Metrics enabled.");
|
||||
} else {
|
||||
PS.log(C.CONSOLE_PLEASE_ENABLE_METRICS.f(getPluginName()));
|
||||
PlotSquared.log(C.CONSOLE_PLEASE_ENABLE_METRICS.f(getPluginName()));
|
||||
}
|
||||
if (Settings.Enabled_Components.WORLDS) {
|
||||
TaskManager.IMP.taskRepeat(new Runnable() {
|
||||
@ -171,7 +171,7 @@ public final class BukkitMain extends JavaPlugin implements Listener, IPlotMain
|
||||
ignore.printStackTrace();
|
||||
}
|
||||
}
|
||||
final PlotAreaManager manager = PS.get().getPlotAreaManager();
|
||||
final PlotAreaManager manager = PlotSquared.get().getPlotAreaManager();
|
||||
if (manager instanceof SinglePlotAreaManager) {
|
||||
long start = System.currentTimeMillis();
|
||||
final SinglePlotArea area = ((SinglePlotAreaManager) manager).getArea();
|
||||
@ -200,7 +200,7 @@ public final class BukkitMain extends JavaPlugin implements Listener, IPlotMain
|
||||
final Chunk[] chunks = world.getLoadedChunks();
|
||||
if (chunks.length == 0) {
|
||||
if (!Bukkit.unloadWorld(world, true)) {
|
||||
PS.debug("Failed to unload " + world.getName());
|
||||
PlotSquared.debug("Failed to unload " + world.getName());
|
||||
}
|
||||
return;
|
||||
} else {
|
||||
@ -236,7 +236,7 @@ public final class BukkitMain extends JavaPlugin implements Listener, IPlotMain
|
||||
}
|
||||
|
||||
@Override public void onDisable() {
|
||||
PS.get().disable();
|
||||
PlotSquared.get().disable();
|
||||
Bukkit.getScheduler().cancelTasks(this);
|
||||
}
|
||||
|
||||
@ -291,10 +291,10 @@ public final class BukkitMain extends JavaPlugin implements Listener, IPlotMain
|
||||
}
|
||||
|
||||
@Override @SuppressWarnings("deprecation") public void runEntityTask() {
|
||||
PS.log(C.PREFIX + "KillAllEntities started.");
|
||||
PlotSquared.log(C.PREFIX + "KillAllEntities started.");
|
||||
TaskManager.runTaskRepeat(new Runnable() {
|
||||
@Override public void run() {
|
||||
PS.get().foreachPlotArea(new RunnableVal<PlotArea>() {
|
||||
PlotSquared.get().foreachPlotArea(new RunnableVal<PlotArea>() {
|
||||
@Override public void run(PlotArea plotArea) {
|
||||
final World world = Bukkit.getWorld(plotArea.worldname);
|
||||
try {
|
||||
@ -522,7 +522,7 @@ public final class BukkitMain extends JavaPlugin implements Listener, IPlotMain
|
||||
if (currentPlotId != null) {
|
||||
entity.setMetadata("plot",
|
||||
new FixedMetadataValue(
|
||||
(Plugin) PS.get().IMP,
|
||||
(Plugin) PlotSquared.get().IMP,
|
||||
currentPlotId));
|
||||
}
|
||||
}
|
||||
@ -549,8 +549,8 @@ public final class BukkitMain extends JavaPlugin implements Listener, IPlotMain
|
||||
if (id != null && id.equalsIgnoreCase("single")) {
|
||||
result = new SingleWorldGenerator();
|
||||
} else {
|
||||
result = PS.get().IMP.getDefaultGenerator();
|
||||
if (!PS.get().setupPlotWorld(world, id, result)) {
|
||||
result = PlotSquared.get().IMP.getDefaultGenerator();
|
||||
if (!PlotSquared.get().setupPlotWorld(world, id, result)) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@ -565,30 +565,30 @@ public final class BukkitMain extends JavaPlugin implements Listener, IPlotMain
|
||||
Class.forName("org.bukkit.event.entity.EntitySpawnEvent");
|
||||
getServer().getPluginManager().registerEvents(new EntitySpawnListener(), this);
|
||||
} catch (final NoSuchMethodException | ClassNotFoundException ignored) {
|
||||
PS.debug("Not running Spigot. Skipping EntitySpawnListener event.");
|
||||
PlotSquared.debug("Not running Spigot. Skipping EntitySpawnListener event.");
|
||||
}
|
||||
if (PS.get().checkVersion(getServerVersion(), 1, 7, 9)) {
|
||||
if (PlotSquared.get().checkVersion(getServerVersion(), 1, 7, 9)) {
|
||||
try {
|
||||
getServer().getPluginManager().registerEvents(new EntityPortal_1_7_9(), this);
|
||||
} catch (Throwable e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
if (PS.get().checkVersion(getServerVersion(), BukkitVersion.v1_8_0)) {
|
||||
if (PlotSquared.get().checkVersion(getServerVersion(), BukkitVersion.v1_8_0)) {
|
||||
try {
|
||||
getServer().getPluginManager().registerEvents(new PlayerEvents_1_8(), this);
|
||||
} catch (Throwable e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
if (PS.get().checkVersion(getServerVersion(), BukkitVersion.v1_8_3)) {
|
||||
if (PlotSquared.get().checkVersion(getServerVersion(), BukkitVersion.v1_8_3)) {
|
||||
try {
|
||||
getServer().getPluginManager().registerEvents(new PlayerEvents183(), this);
|
||||
} catch (Throwable e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
if (PS.get().checkVersion(getServerVersion(), BukkitVersion.v1_9_0)) {
|
||||
if (PlotSquared.get().checkVersion(getServerVersion(), BukkitVersion.v1_9_0)) {
|
||||
try {
|
||||
getServer().getPluginManager().registerEvents(new PlayerEvents_1_9(main), this);
|
||||
} catch (Throwable e) {
|
||||
@ -604,7 +604,7 @@ public final class BukkitMain extends JavaPlugin implements Listener, IPlotMain
|
||||
@Override public void registerPlotPlusEvents() {
|
||||
PlotPlusListener.startRunnable(this);
|
||||
getServer().getPluginManager().registerEvents(new PlotPlusListener(), this);
|
||||
if (PS.get().checkVersion(getServerVersion(), BukkitVersion.v1_12_0)) {
|
||||
if (PlotSquared.get().checkVersion(getServerVersion(), BukkitVersion.v1_12_0)) {
|
||||
getServer().getPluginManager().registerEvents(new PlotPlusListener_1_12(), this);
|
||||
} else {
|
||||
getServer().getPluginManager().registerEvents(new PlotPlusListener_Legacy(), this);
|
||||
@ -629,7 +629,7 @@ public final class BukkitMain extends JavaPlugin implements Listener, IPlotMain
|
||||
return econ;
|
||||
}
|
||||
} catch (Throwable ignored) {
|
||||
PS.debug("No economy detected!");
|
||||
PlotSquared.debug("No economy detected!");
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@ -639,20 +639,20 @@ public final class BukkitMain extends JavaPlugin implements Listener, IPlotMain
|
||||
new SendChunk();
|
||||
MainUtil.canSendChunk = true;
|
||||
} catch (ClassNotFoundException | NoSuchFieldException | NoSuchMethodException e) {
|
||||
PS.debug(
|
||||
PlotSquared.debug(
|
||||
SendChunk.class + " does not support " + StringMan.getString(getServerVersion()));
|
||||
MainUtil.canSendChunk = false;
|
||||
}
|
||||
if (PS.get().checkVersion(getServerVersion(), BukkitVersion.v1_13_0)) {
|
||||
if (PlotSquared.get().checkVersion(getServerVersion(), BukkitVersion.v1_13_0)) {
|
||||
return QueueProvider.of(BukkitLocalQueue.class, BukkitLocalQueue.class);
|
||||
}
|
||||
if (PS.get().checkVersion(getServerVersion(), BukkitVersion.v1_9_0)) {
|
||||
if (PlotSquared.get().checkVersion(getServerVersion(), BukkitVersion.v1_9_0)) {
|
||||
return QueueProvider.of(BukkitLocalQueue_1_9.class, BukkitLocalQueue.class);
|
||||
}
|
||||
if (PS.get().checkVersion(getServerVersion(), BukkitVersion.v1_8_3)) {
|
||||
if (PlotSquared.get().checkVersion(getServerVersion(), BukkitVersion.v1_8_3)) {
|
||||
return QueueProvider.of(BukkitLocalQueue_1_8_3.class, BukkitLocalQueue.class);
|
||||
}
|
||||
if (PS.get().checkVersion(getServerVersion(), BukkitVersion.v1_8_0)) {
|
||||
if (PlotSquared.get().checkVersion(getServerVersion(), BukkitVersion.v1_8_0)) {
|
||||
return QueueProvider.of(BukkitLocalQueue_1_8.class, BukkitLocalQueue.class);
|
||||
}
|
||||
return QueueProvider.of(BukkitLocalQueue_1_7.class, BukkitLocalQueue.class);
|
||||
@ -683,7 +683,7 @@ public final class BukkitMain extends JavaPlugin implements Listener, IPlotMain
|
||||
}
|
||||
return new BukkitPlotGenerator(world, gen);
|
||||
} else {
|
||||
return new BukkitPlotGenerator(PS.get().IMP.getDefaultGenerator());
|
||||
return new BukkitPlotGenerator(PlotSquared.get().IMP.getDefaultGenerator());
|
||||
}
|
||||
}
|
||||
|
||||
@ -722,7 +722,7 @@ public final class BukkitMain extends JavaPlugin implements Listener, IPlotMain
|
||||
Settings.UUID.OFFLINE = true;
|
||||
}
|
||||
if (!checkVersion) {
|
||||
PS.log(C.PREFIX
|
||||
PlotSquared.log(C.PREFIX
|
||||
+ " &c[WARN] Titles are disabled - please update your version of Bukkit to support this feature.");
|
||||
Settings.TITLES = false;
|
||||
} else {
|
||||
@ -733,11 +733,11 @@ public final class BukkitMain extends JavaPlugin implements Listener, IPlotMain
|
||||
}
|
||||
}
|
||||
if (Settings.UUID.OFFLINE) {
|
||||
PS.log(C.PREFIX + " &6" + getPluginName()
|
||||
PlotSquared.log(C.PREFIX + " &6" + getPluginName()
|
||||
+ " is using Offline Mode UUIDs either because of user preference, or because you are using an old version of "
|
||||
+ "Bukkit");
|
||||
} else {
|
||||
PS.log(C.PREFIX + " &6" + getPluginName() + " is using online UUIDs");
|
||||
PlotSquared.log(C.PREFIX + " &6" + getPluginName() + " is using online UUIDs");
|
||||
}
|
||||
if (Settings.UUID.USE_SQLUUIDHANDLER) {
|
||||
return new SQLUUIDHandler(wrapper);
|
||||
@ -776,7 +776,7 @@ public final class BukkitMain extends JavaPlugin implements Listener, IPlotMain
|
||||
|
||||
@Override public void startMetrics() {
|
||||
new Metrics(this).start();
|
||||
PS.log(C.PREFIX + "&6Metrics enabled.");
|
||||
PlotSquared.log(C.PREFIX + "&6Metrics enabled.");
|
||||
}
|
||||
|
||||
@Override public void setGenerator(@NonNull final String worldName) {
|
||||
@ -784,7 +784,7 @@ public final class BukkitMain extends JavaPlugin implements Listener, IPlotMain
|
||||
if (world == null) {
|
||||
// create world
|
||||
ConfigurationSection worldConfig =
|
||||
PS.get().worlds.getConfigurationSection("worlds." + worldName);
|
||||
PlotSquared.get().worlds.getConfigurationSection("worlds." + worldName);
|
||||
String manager = worldConfig.getString("generator.plugin", getPluginName());
|
||||
SetupObject setup = new SetupObject();
|
||||
setup.plotManager = manager;
|
||||
@ -797,22 +797,22 @@ public final class BukkitMain extends JavaPlugin implements Listener, IPlotMain
|
||||
world = Bukkit.getWorld(worldName);
|
||||
} else {
|
||||
try {
|
||||
if (!PS.get().hasPlotArea(worldName)) {
|
||||
if (!PlotSquared.get().hasPlotArea(worldName)) {
|
||||
SetGenCB.setGenerator(BukkitUtil.getWorld(worldName));
|
||||
}
|
||||
} catch (Exception ignored) {
|
||||
PS.log("Failed to reload world: " + world + " | " + ignored.getMessage());
|
||||
PlotSquared.log("Failed to reload world: " + world + " | " + ignored.getMessage());
|
||||
Bukkit.getServer().unloadWorld(world, false);
|
||||
return;
|
||||
}
|
||||
}
|
||||
ChunkGenerator gen = world.getGenerator();
|
||||
if (gen instanceof BukkitPlotGenerator) {
|
||||
PS.get().loadWorld(worldName, (BukkitPlotGenerator) gen);
|
||||
PlotSquared.get().loadWorld(worldName, (BukkitPlotGenerator) gen);
|
||||
} else if (gen != null) {
|
||||
PS.get().loadWorld(worldName, new BukkitPlotGenerator(worldName, gen));
|
||||
} else if (PS.get().worlds.contains("worlds." + worldName)) {
|
||||
PS.get().loadWorld(worldName, null);
|
||||
PlotSquared.get().loadWorld(worldName, new BukkitPlotGenerator(worldName, gen));
|
||||
} else if (PlotSquared.get().worlds.contains("worlds." + worldName)) {
|
||||
PlotSquared.get().loadWorld(worldName, null);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -6,7 +6,7 @@ import com.github.intellectualsites.plotsquared.bukkit.uuid.LowerOfflineUUIDWrap
|
||||
import com.github.intellectualsites.plotsquared.bukkit.uuid.OfflineUUIDWrapper;
|
||||
import com.github.intellectualsites.plotsquared.commands.Argument;
|
||||
import com.github.intellectualsites.plotsquared.commands.CommandDeclaration;
|
||||
import com.github.intellectualsites.plotsquared.plot.PS;
|
||||
import com.github.intellectualsites.plotsquared.plot.PlotSquared;
|
||||
import com.github.intellectualsites.plotsquared.plot.commands.CommandCategory;
|
||||
import com.github.intellectualsites.plotsquared.plot.commands.RequiredType;
|
||||
import com.github.intellectualsites.plotsquared.plot.commands.SubCommand;
|
||||
@ -180,7 +180,7 @@ public class DebugUUID extends SubCommand {
|
||||
|
||||
MainUtil.sendMessage(player, "&7 - Scanning for applicable files (uuids.txt)");
|
||||
|
||||
File file = new File(PS.get().IMP.getDirectory(), "uuids.txt");
|
||||
File file = new File(PlotSquared.get().IMP.getDirectory(), "uuids.txt");
|
||||
if (file.exists()) {
|
||||
try {
|
||||
List<String> lines =
|
||||
@ -220,7 +220,7 @@ public class DebugUUID extends SubCommand {
|
||||
|
||||
MainUtil.sendMessage(player, "&7 - Updating plot objects");
|
||||
|
||||
for (Plot plot : PS.get().getPlots()) {
|
||||
for (Plot plot : PlotSquared.get().getPlots()) {
|
||||
UUID value = uCMap.get(plot.owner);
|
||||
if (value != null) {
|
||||
plot.owner = value;
|
||||
@ -239,13 +239,13 @@ public class DebugUUID extends SubCommand {
|
||||
DBFunc.createTables();
|
||||
if (!result) {
|
||||
MainUtil.sendMessage(player, "&cConversion failed! Attempting recovery");
|
||||
for (Plot plot : PS.get().getPlots()) {
|
||||
for (Plot plot : PlotSquared.get().getPlots()) {
|
||||
UUID value = uCReverse.get(plot.owner);
|
||||
if (value != null) {
|
||||
plot.owner = value;
|
||||
}
|
||||
}
|
||||
DBFunc.createPlotsAndData(new ArrayList<>(PS.get().getPlots()),
|
||||
DBFunc.createPlotsAndData(new ArrayList<>(PlotSquared.get().getPlots()),
|
||||
new Runnable() {
|
||||
@Override public void run() {
|
||||
MainUtil.sendMessage(player, "&6Recovery was successful!");
|
||||
@ -259,14 +259,14 @@ public class DebugUUID extends SubCommand {
|
||||
}
|
||||
|
||||
if (newWrapper instanceof OfflineUUIDWrapper) {
|
||||
PS.get().worlds.set("UUID.force-lowercase", false);
|
||||
PS.get().worlds.set("UUID.offline", true);
|
||||
PlotSquared.get().worlds.set("UUID.force-lowercase", false);
|
||||
PlotSquared.get().worlds.set("UUID.offline", true);
|
||||
} else if (newWrapper instanceof DefaultUUIDWrapper) {
|
||||
PS.get().worlds.set("UUID.force-lowercase", false);
|
||||
PS.get().worlds.set("UUID.offline", false);
|
||||
PlotSquared.get().worlds.set("UUID.force-lowercase", false);
|
||||
PlotSquared.get().worlds.set("UUID.offline", false);
|
||||
}
|
||||
try {
|
||||
PS.get().worlds.save(PS.get().worldsFile);
|
||||
PlotSquared.get().worlds.save(PlotSquared.get().worldsFile);
|
||||
} catch (IOException ignored) {
|
||||
MainUtil.sendMessage(player,
|
||||
"Could not save configuration. It will need to be manual set!");
|
||||
@ -276,7 +276,7 @@ public class DebugUUID extends SubCommand {
|
||||
|
||||
TaskManager.runTaskAsync(new Runnable() {
|
||||
@Override public void run() {
|
||||
ArrayList<Plot> plots = new ArrayList<>(PS.get().getPlots());
|
||||
ArrayList<Plot> plots = new ArrayList<>(PlotSquared.get().getPlots());
|
||||
DBFunc.createPlotsAndData(plots, new Runnable() {
|
||||
@Override public void run() {
|
||||
MainUtil.sendMessage(player, "&aConversion complete!");
|
||||
|
@ -1,7 +1,7 @@
|
||||
package com.github.intellectualsites.plotsquared.bukkit.database.plotme;
|
||||
|
||||
import com.github.intellectualsites.plotsquared.configuration.file.FileConfiguration;
|
||||
import com.github.intellectualsites.plotsquared.plot.PS;
|
||||
import com.github.intellectualsites.plotsquared.plot.PlotSquared;
|
||||
import com.github.intellectualsites.plotsquared.plot.object.Location;
|
||||
import com.github.intellectualsites.plotsquared.plot.object.Plot;
|
||||
import com.github.intellectualsites.plotsquared.plot.object.PlotId;
|
||||
@ -27,23 +27,23 @@ public abstract class APlotMeConnector {
|
||||
|
||||
public void copyConfig(FileConfiguration plotConfig, String world, String actualWorldName) {
|
||||
int pathWidth = plotConfig.getInt("worlds." + world + ".PathWidth"); //
|
||||
PS.get().worlds.set("worlds." + actualWorldName + ".road.width", pathWidth);
|
||||
PlotSquared.get().worlds.set("worlds." + actualWorldName + ".road.width", pathWidth);
|
||||
int plotSize = plotConfig.getInt("worlds." + world + ".PlotSize"); //
|
||||
PS.get().worlds.set("worlds." + actualWorldName + ".plot.size", plotSize);
|
||||
PlotSquared.get().worlds.set("worlds." + actualWorldName + ".plot.size", plotSize);
|
||||
String wallBlock = plotConfig.getString("worlds." + world + ".WallBlockId"); //
|
||||
PS.get().worlds.set("worlds." + actualWorldName + ".wall.block", wallBlock);
|
||||
PlotSquared.get().worlds.set("worlds." + actualWorldName + ".wall.block", wallBlock);
|
||||
String floor = plotConfig.getString("worlds." + world + ".PlotFloorBlockId"); //
|
||||
PS.get().worlds
|
||||
PlotSquared.get().worlds
|
||||
.set("worlds." + actualWorldName + ".plot.floor", Collections.singletonList(floor));
|
||||
String filling = plotConfig.getString("worlds." + world + ".PlotFillingBlockId"); //
|
||||
PS.get().worlds
|
||||
PlotSquared.get().worlds
|
||||
.set("worlds." + actualWorldName + ".plot.filling", Collections.singletonList(filling));
|
||||
String road = plotConfig.getString("worlds." + world + ".RoadMainBlockId");
|
||||
PS.get().worlds.set("worlds." + actualWorldName + ".road.block", road);
|
||||
PlotSquared.get().worlds.set("worlds." + actualWorldName + ".road.block", road);
|
||||
int height = plotConfig.getInt("worlds." + world + ".RoadHeight"); //
|
||||
PS.get().worlds.set("worlds." + actualWorldName + ".road.height", height);
|
||||
PS.get().worlds.set("worlds." + actualWorldName + ".plot.height", height);
|
||||
PS.get().worlds.set("worlds." + actualWorldName + ".wall.height", height);
|
||||
PlotSquared.get().worlds.set("worlds." + actualWorldName + ".road.height", height);
|
||||
PlotSquared.get().worlds.set("worlds." + actualWorldName + ".plot.height", height);
|
||||
PlotSquared.get().worlds.set("worlds." + actualWorldName + ".wall.height", height);
|
||||
}
|
||||
|
||||
public Location getPlotTopLocAbs(int path, int plot, PlotId plotId) {
|
||||
|
@ -1,7 +1,7 @@
|
||||
package com.github.intellectualsites.plotsquared.bukkit.database.plotme;
|
||||
|
||||
import com.github.intellectualsites.plotsquared.configuration.file.FileConfiguration;
|
||||
import com.github.intellectualsites.plotsquared.plot.PS;
|
||||
import com.github.intellectualsites.plotsquared.plot.PlotSquared;
|
||||
import com.github.intellectualsites.plotsquared.plot.config.Settings;
|
||||
import com.github.intellectualsites.plotsquared.plot.database.DBFunc;
|
||||
import com.github.intellectualsites.plotsquared.plot.database.SQLite;
|
||||
@ -68,8 +68,8 @@ public class ClassicPlotMeConnector extends APlotMeConnector {
|
||||
if (!plots.containsKey(world)) {
|
||||
plots.put(world, new HashMap<PlotId, Plot>());
|
||||
if (merge) {
|
||||
int plot = PS.get().worlds.getInt("worlds." + world + ".plot.size");
|
||||
int path = PS.get().worlds.getInt("worlds." + world + ".road.width");
|
||||
int plot = PlotSquared.get().worlds.getInt("worlds." + world + ".plot.size");
|
||||
int path = PlotSquared.get().worlds.getInt("worlds." + world + ".road.width");
|
||||
plotWidth.put(world, plot);
|
||||
roadWidth.put(world, path);
|
||||
merges.put(world, new HashMap<PlotId, boolean[]>());
|
||||
@ -113,7 +113,8 @@ public class ClassicPlotMeConnector extends APlotMeConnector {
|
||||
}
|
||||
}
|
||||
if (name.isEmpty()) {
|
||||
PS.log("&cCould not identify owner for plot: " + id + " -> '" + name + "'");
|
||||
PlotSquared
|
||||
.log("&cCould not identify owner for plot: " + id + " -> '" + name + "'");
|
||||
missing++;
|
||||
continue;
|
||||
}
|
||||
@ -127,10 +128,10 @@ public class ClassicPlotMeConnector extends APlotMeConnector {
|
||||
plots.get(world).put(id, plot);
|
||||
}
|
||||
if (missing > 0) {
|
||||
PS.log("&cSome names could not be identified:");
|
||||
PS.log("&7 - Empty quotes mean PlotMe just stored an unowned plot in the database");
|
||||
PS.log("&7 - Names you have never seen before could be from people mistyping commands");
|
||||
PS.log(
|
||||
PlotSquared.log("&cSome names could not be identified:");
|
||||
PlotSquared.log("&7 - Empty quotes mean PlotMe just stored an unowned plot in the database");
|
||||
PlotSquared.log("&7 - Names you have never seen before could be from people mistyping commands");
|
||||
PlotSquared.log(
|
||||
"&7 - Converting from a non-uuid version of PlotMe can't identify owners if the playerdata files are deleted (these plots will "
|
||||
+ "remain unknown until the player connects)");
|
||||
}
|
||||
@ -151,7 +152,7 @@ public class ClassicPlotMeConnector extends APlotMeConnector {
|
||||
|
||||
try {
|
||||
|
||||
PS.log(" - " + this.prefix + "Denied");
|
||||
PlotSquared.log(" - " + this.prefix + "Denied");
|
||||
statement = connection.prepareStatement("SELECT * FROM `" + this.prefix + "Denied`");
|
||||
resultSet = statement.executeQuery();
|
||||
|
||||
@ -174,7 +175,7 @@ public class ClassicPlotMeConnector extends APlotMeConnector {
|
||||
}
|
||||
}
|
||||
if (denied == null) {
|
||||
PS.log("&6Could not identify denied for plot: " + id);
|
||||
PlotSquared.log("&6Could not identify denied for plot: " + id);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
@ -209,7 +210,7 @@ public class ClassicPlotMeConnector extends APlotMeConnector {
|
||||
}
|
||||
}
|
||||
if (helper == null) {
|
||||
PS.log("&6Could not identify helper for plot: " + id);
|
||||
PlotSquared.log("&6Could not identify helper for plot: " + id);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
@ -231,7 +232,7 @@ public class ClassicPlotMeConnector extends APlotMeConnector {
|
||||
}
|
||||
|
||||
@Override public boolean accepts(String version) {
|
||||
return version == null || PS.get().canUpdate(version, "0.17.0") || PS.get()
|
||||
return version == null || PlotSquared.get().canUpdate(version, "0.17.0") || PlotSquared.get()
|
||||
.canUpdate("0.999.999", version);
|
||||
}
|
||||
}
|
||||
|
@ -5,7 +5,7 @@ import com.github.intellectualsites.plotsquared.configuration.ConfigurationSecti
|
||||
import com.github.intellectualsites.plotsquared.configuration.MemorySection;
|
||||
import com.github.intellectualsites.plotsquared.configuration.file.FileConfiguration;
|
||||
import com.github.intellectualsites.plotsquared.configuration.file.YamlConfiguration;
|
||||
import com.github.intellectualsites.plotsquared.plot.PS;
|
||||
import com.github.intellectualsites.plotsquared.plot.PlotSquared;
|
||||
import com.github.intellectualsites.plotsquared.plot.config.Settings;
|
||||
import com.github.intellectualsites.plotsquared.plot.database.DBFunc;
|
||||
import com.github.intellectualsites.plotsquared.plot.object.Plot;
|
||||
@ -47,7 +47,7 @@ public class LikePlotMeConverter {
|
||||
}
|
||||
|
||||
private void sendMessage(String message) {
|
||||
PS.debug("&3PlotMe&8->&3" + PS.imp().getPluginName() + "&8: &7" + message);
|
||||
PlotSquared.debug("&3PlotMe&8->&3" + PlotSquared.imp().getPluginName() + "&8: &7" + message);
|
||||
}
|
||||
|
||||
public String getPlotMePath() {
|
||||
@ -96,7 +96,7 @@ public class LikePlotMeConverter {
|
||||
return;
|
||||
}
|
||||
String content = new String(Files.readAllBytes(path), StandardCharsets.UTF_8);
|
||||
String pluginName = PS.imp().getPluginName();
|
||||
String pluginName = PlotSquared.imp().getPluginName();
|
||||
content = content.replace("PlotMe-DefaultGenerator", pluginName);
|
||||
content = content.replace("PlotMe", pluginName);
|
||||
content = content.replace("AthionPlots", pluginName);
|
||||
@ -110,32 +110,32 @@ public class LikePlotMeConverter {
|
||||
String actualWorldName = getWorld(world);
|
||||
String plotMeWorldName = world.toLowerCase();
|
||||
Integer pathWidth = plotmeDgYml.getInt("worlds." + plotMeWorldName + ".PathWidth"); //
|
||||
PS.get().worlds.set("worlds." + world + ".road.width", pathWidth);
|
||||
PlotSquared.get().worlds.set("worlds." + world + ".road.width", pathWidth);
|
||||
int height = plotmeDgYml.getInt("worlds." + plotMeWorldName + ".RoadHeight",
|
||||
plotmeDgYml.getInt("worlds." + plotMeWorldName + ".GroundHeight", 64)); //
|
||||
PS.get().worlds.set("worlds." + world + ".road.height", height);
|
||||
PS.get().worlds.set("worlds." + world + ".wall.height", height);
|
||||
PS.get().worlds.set("worlds." + world + ".plot.height", height);
|
||||
PlotSquared.get().worlds.set("worlds." + world + ".road.height", height);
|
||||
PlotSquared.get().worlds.set("worlds." + world + ".wall.height", height);
|
||||
PlotSquared.get().worlds.set("worlds." + world + ".plot.height", height);
|
||||
int plotSize = plotmeDgYml.getInt("worlds." + plotMeWorldName + ".PlotSize", 32); //
|
||||
PS.get().worlds.set("worlds." + world + ".plot.size", plotSize);
|
||||
PlotSquared.get().worlds.set("worlds." + world + ".plot.size", plotSize);
|
||||
String wallblock = plotmeDgYml.getString("worlds." + plotMeWorldName + ".UnclaimedBorder",
|
||||
plotmeDgYml.getString("worlds." + plotMeWorldName + ".WallBlock", "44")); //
|
||||
PS.get().worlds.set("worlds." + world + ".wall.block", wallblock);
|
||||
PlotSquared.get().worlds.set("worlds." + world + ".wall.block", wallblock);
|
||||
String claimed =
|
||||
plotmeDgYml.getString("worlds." + plotMeWorldName + ".ProtectedWallBlock", "44:1"); //
|
||||
PS.get().worlds.set("worlds." + world + ".wall.block_claimed", claimed);
|
||||
PlotSquared.get().worlds.set("worlds." + world + ".wall.block_claimed", claimed);
|
||||
String floor =
|
||||
plotmeDgYml.getString("worlds." + plotMeWorldName + ".PlotFloorBlock", "2"); //
|
||||
PS.get().worlds.set("worlds." + world + ".plot.floor", Collections.singletonList(floor));
|
||||
PlotSquared.get().worlds.set("worlds." + world + ".plot.floor", Collections.singletonList(floor));
|
||||
String filling = plotmeDgYml.getString("worlds." + plotMeWorldName + ".FillBlock", "3"); //
|
||||
PS.get().worlds
|
||||
PlotSquared.get().worlds
|
||||
.set("worlds." + world + ".plot.filling", Collections.singletonList(filling));
|
||||
String road = plotmeDgYml.getString("worlds." + plotMeWorldName + ".RoadMainBlock", "5");
|
||||
PS.get().worlds.set("worlds." + world + ".road.block", road);
|
||||
PS.get().worlds.set("worlds." + actualWorldName + ".road.height", height);
|
||||
PS.get().worlds.set("worlds." + actualWorldName + ".plot.height", height);
|
||||
PS.get().worlds.set("worlds." + actualWorldName + ".wall.height", height);
|
||||
PS.get().worlds.save(PS.get().worldsFile);
|
||||
PlotSquared.get().worlds.set("worlds." + world + ".road.block", road);
|
||||
PlotSquared.get().worlds.set("worlds." + actualWorldName + ".road.height", height);
|
||||
PlotSquared.get().worlds.set("worlds." + actualWorldName + ".plot.height", height);
|
||||
PlotSquared.get().worlds.set("worlds." + actualWorldName + ".wall.height", height);
|
||||
PlotSquared.get().worlds.save(PlotSquared.get().worldsFile);
|
||||
}
|
||||
|
||||
public boolean run(APlotMeConnector connector) {
|
||||
@ -154,7 +154,7 @@ public class LikePlotMeConverter {
|
||||
return false;
|
||||
}
|
||||
|
||||
PS.debug("&3Using connector: " + connector.getClass().getCanonicalName());
|
||||
PlotSquared.debug("&3Using connector: " + connector.getClass().getCanonicalName());
|
||||
|
||||
Connection connection = connector.getPlotMeConnection(plugin, plotConfig, dataFolder);
|
||||
|
||||
@ -187,7 +187,7 @@ public class LikePlotMeConverter {
|
||||
try {
|
||||
String actualWorldName = getWorld(world);
|
||||
connector.copyConfig(plotConfig, world, actualWorldName);
|
||||
PS.get().worlds.save(PS.get().worldsFile);
|
||||
PlotSquared.get().worlds.save(PlotSquared.get().worldsFile);
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
sendMessage("&c-- &lFailed to save configuration for world '" + world
|
||||
@ -224,7 +224,7 @@ public class LikePlotMeConverter {
|
||||
}
|
||||
for (Entry<String, HashMap<PlotId, Plot>> entry : plots.entrySet()) {
|
||||
String world = entry.getKey();
|
||||
PlotArea area = PS.get().getPlotArea(world, null);
|
||||
PlotArea area = PlotSquared.get().getPlotArea(world, null);
|
||||
int duplicate = 0;
|
||||
if (area != null) {
|
||||
for (Entry<PlotId, Plot> entry2 : entry.getValue().entrySet()) {
|
||||
@ -235,13 +235,13 @@ public class LikePlotMeConverter {
|
||||
}
|
||||
}
|
||||
if (duplicate > 0) {
|
||||
PS.debug("&c[WARNING] Found " + duplicate
|
||||
PlotSquared.debug("&c[WARNING] Found " + duplicate
|
||||
+ " duplicate plots already in DB for world: '" + world
|
||||
+ "'. Have you run the converter already?");
|
||||
}
|
||||
} else {
|
||||
if (PS.get().plots_tmp != null) {
|
||||
HashMap<PlotId, Plot> map = PS.get().plots_tmp.get(world);
|
||||
if (PlotSquared.get().plots_tmp != null) {
|
||||
HashMap<PlotId, Plot> map = PlotSquared.get().plots_tmp.get(world);
|
||||
if (map != null) {
|
||||
for (Entry<PlotId, Plot> entry2 : entry.getValue().entrySet()) {
|
||||
if (map.containsKey(entry2.getKey())) {
|
||||
@ -251,7 +251,7 @@ public class LikePlotMeConverter {
|
||||
}
|
||||
}
|
||||
if (duplicate > 0) {
|
||||
PS.debug("&c[WARNING] Found " + duplicate
|
||||
PlotSquared.debug("&c[WARNING] Found " + duplicate
|
||||
+ " duplicate plots already in DB for world: '" + world
|
||||
+ "'. Have you run the converter already?");
|
||||
}
|
||||
@ -269,13 +269,13 @@ public class LikePlotMeConverter {
|
||||
if (done.get()) {
|
||||
done();
|
||||
sendMessage("&aDatabase conversion is now complete!");
|
||||
PS.debug("&c - Stop the server");
|
||||
PS.debug(
|
||||
PlotSquared.debug("&c - Stop the server");
|
||||
PlotSquared.debug(
|
||||
"&c - Disable 'plotme-converter' and 'plotme-convert.cache-uuids' in the settings.yml");
|
||||
PS.debug(
|
||||
PlotSquared.debug(
|
||||
"&c - Correct any generator settings that haven't copied to 'settings.yml' properly");
|
||||
PS.debug("&c - Start the server");
|
||||
PS.get().setPlots(DBFunc.getPlots());
|
||||
PlotSquared.debug("&c - Start the server");
|
||||
PlotSquared.get().setPlots(DBFunc.getPlots());
|
||||
} else {
|
||||
sendMessage(
|
||||
"&cPlease wait until database conversion is complete. You will be notified with instructions when this happens!");
|
||||
@ -285,7 +285,7 @@ public class LikePlotMeConverter {
|
||||
});
|
||||
sendMessage("Saving configuration...");
|
||||
try {
|
||||
PS.get().worlds.save(PS.get().worldsFile);
|
||||
PlotSquared.get().worlds.save(PlotSquared.get().worldsFile);
|
||||
} catch (IOException ignored) {
|
||||
sendMessage(" - &cFailed to save configuration.");
|
||||
}
|
||||
@ -316,7 +316,7 @@ public class LikePlotMeConverter {
|
||||
sendMessage(
|
||||
"&cYou need to stop the server to reload this world properly");
|
||||
} else {
|
||||
PS.get().removePlotAreas(actualWorldName);
|
||||
PlotSquared.get().removePlotAreas(actualWorldName);
|
||||
if (mv) {
|
||||
// unload world with MV
|
||||
Bukkit.getServer()
|
||||
@ -330,7 +330,7 @@ public class LikePlotMeConverter {
|
||||
// load world with MV
|
||||
Bukkit.getServer()
|
||||
.dispatchCommand(Bukkit.getServer().getConsoleSender(),
|
||||
"mv import " + actualWorldName + " normal -g " + PS
|
||||
"mv import " + actualWorldName + " normal -g " + PlotSquared
|
||||
.imp().getPluginName());
|
||||
} else if (mw) {
|
||||
// unload world with MW
|
||||
@ -345,14 +345,15 @@ public class LikePlotMeConverter {
|
||||
// load world with MW
|
||||
Bukkit.getServer()
|
||||
.dispatchCommand(Bukkit.getServer().getConsoleSender(),
|
||||
"mw create " + actualWorldName + " plugin:" + PS.imp()
|
||||
"mw create " + actualWorldName + " plugin:" + PlotSquared
|
||||
.imp()
|
||||
.getPluginName());
|
||||
} else {
|
||||
// Load using Bukkit API
|
||||
// - User must set generator manually
|
||||
Bukkit.getServer().unloadWorld(world, true);
|
||||
World myWorld = WorldCreator.name(actualWorldName).generator(
|
||||
new BukkitPlotGenerator(PS.get().IMP.getDefaultGenerator()))
|
||||
new BukkitPlotGenerator(PlotSquared.get().IMP.getDefaultGenerator()))
|
||||
.createWorld();
|
||||
myWorld.save();
|
||||
}
|
||||
@ -364,12 +365,12 @@ public class LikePlotMeConverter {
|
||||
if (done.get()) {
|
||||
done();
|
||||
sendMessage("&aDatabase conversion is now complete!");
|
||||
PS.debug("&c - Stop the server");
|
||||
PS.debug(
|
||||
PlotSquared.debug("&c - Stop the server");
|
||||
PlotSquared.debug(
|
||||
"&c - Disable 'plotme-converter' and 'plotme-convert.cache-uuids' in the settings.yml");
|
||||
PS.debug(
|
||||
PlotSquared.debug(
|
||||
"&c - Correct any generator settings that haven't copied to 'settings.yml' properly");
|
||||
PS.debug("&c - Start the server");
|
||||
PlotSquared.debug("&c - Start the server");
|
||||
} else {
|
||||
sendMessage(
|
||||
"&cPlease wait until database conversion is complete. You will be notified with instructions when this happens!");
|
||||
@ -379,12 +380,12 @@ public class LikePlotMeConverter {
|
||||
});
|
||||
} catch (InterruptedException | SQLException e) {
|
||||
e.printStackTrace();
|
||||
PS.debug("&/end/");
|
||||
PlotSquared.debug("&/end/");
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public void done() {
|
||||
PS.get().setPlots(DBFunc.getPlots());
|
||||
PlotSquared.get().setPlots(DBFunc.getPlots());
|
||||
}
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
package com.github.intellectualsites.plotsquared.bukkit.database.plotme;
|
||||
|
||||
import com.github.intellectualsites.plotsquared.configuration.file.FileConfiguration;
|
||||
import com.github.intellectualsites.plotsquared.plot.PS;
|
||||
import com.github.intellectualsites.plotsquared.plot.PlotSquared;
|
||||
import com.github.intellectualsites.plotsquared.plot.config.Settings;
|
||||
import com.github.intellectualsites.plotsquared.plot.database.DBFunc;
|
||||
import com.github.intellectualsites.plotsquared.plot.database.SQLite;
|
||||
@ -53,12 +53,12 @@ public class PlotMeConnector_017 extends APlotMeConnector {
|
||||
connection.prepareStatement("SELECT * FROM `" + this.plugin + "core_plots`");
|
||||
resultSet = statement.executeQuery();
|
||||
} catch (SQLException e) {
|
||||
PS.debug("========= Table does not exist =========");
|
||||
PlotSquared.debug("========= Table does not exist =========");
|
||||
e.printStackTrace();
|
||||
PS.debug("=======================================");
|
||||
PS.debug(
|
||||
PlotSquared.debug("=======================================");
|
||||
PlotSquared.debug(
|
||||
"&8 - &7The database does not match the version specified in the PlotMe config");
|
||||
PS.debug("&8 - &7Please correct this, or if you are unsure, the most common is 0.16.3");
|
||||
PlotSquared.debug("&8 - &7Please correct this, or if you are unsure, the most common is 0.16.3");
|
||||
return null;
|
||||
}
|
||||
boolean checkUUID = DBFunc.hasColumn(resultSet, "ownerID");
|
||||
@ -70,8 +70,8 @@ public class PlotMeConnector_017 extends APlotMeConnector {
|
||||
String name = resultSet.getString("owner");
|
||||
String world = LikePlotMeConverter.getWorld(resultSet.getString("world"));
|
||||
if (!plots.containsKey(world) && merge) {
|
||||
int plot = PS.get().worlds.getInt("worlds." + world + ".plot.size");
|
||||
int path = PS.get().worlds.getInt("worlds." + world + ".road.width");
|
||||
int plot = PlotSquared.get().worlds.getInt("worlds." + world + ".plot.size");
|
||||
int path = PlotSquared.get().worlds.getInt("worlds." + world + ".road.width");
|
||||
plotWidth.put(world, plot);
|
||||
roadWidth.put(world, path);
|
||||
merges.put(world, new HashMap<PlotId, boolean[]>());
|
||||
@ -111,7 +111,7 @@ public class PlotMeConnector_017 extends APlotMeConnector {
|
||||
}
|
||||
}
|
||||
if (owner == null) {
|
||||
PS.log(
|
||||
PlotSquared.log(
|
||||
"&cCould not identify owner for plot: " + id + " -> '" + name + '\'');
|
||||
continue;
|
||||
}
|
||||
@ -133,7 +133,7 @@ public class PlotMeConnector_017 extends APlotMeConnector {
|
||||
resultSet.close();
|
||||
statement.close();
|
||||
try {
|
||||
PS.log(" - " + this.plugin + "core_denied");
|
||||
PlotSquared.log(" - " + this.plugin + "core_denied");
|
||||
statement =
|
||||
connection.prepareStatement("SELECT * FROM `" + this.plugin + "core_denied`");
|
||||
resultSet = statement.executeQuery();
|
||||
@ -142,7 +142,7 @@ public class PlotMeConnector_017 extends APlotMeConnector {
|
||||
int key = resultSet.getInt("plot_id");
|
||||
Plot plot = plots.get(key);
|
||||
if (plot == null) {
|
||||
PS.log("&6Denied (" + key + ") references deleted plot; ignoring entry.");
|
||||
PlotSquared.log("&6Denied (" + key + ") references deleted plot; ignoring entry.");
|
||||
continue;
|
||||
}
|
||||
String player = resultSet.getString("player");
|
||||
@ -150,7 +150,7 @@ public class PlotMeConnector_017 extends APlotMeConnector {
|
||||
plot.getDenied().add(denied);
|
||||
}
|
||||
|
||||
PS.log(" - " + this.plugin + "core_allowed");
|
||||
PlotSquared.log(" - " + this.plugin + "core_allowed");
|
||||
statement =
|
||||
connection.prepareStatement("SELECT * FROM `" + this.plugin + "core_allowed`");
|
||||
resultSet = statement.executeQuery();
|
||||
@ -159,7 +159,7 @@ public class PlotMeConnector_017 extends APlotMeConnector {
|
||||
int key = resultSet.getInt("plot_id");
|
||||
Plot plot = plots.get(key);
|
||||
if (plot == null) {
|
||||
PS.log("&6Allowed (" + key + ") references deleted plot; ignoring entry.");
|
||||
PlotSquared.log("&6Allowed (" + key + ") references deleted plot; ignoring entry.");
|
||||
continue;
|
||||
}
|
||||
String player = resultSet.getString("player");
|
||||
@ -189,6 +189,6 @@ public class PlotMeConnector_017 extends APlotMeConnector {
|
||||
if (version == null) {
|
||||
return false;
|
||||
}
|
||||
return !PS.get().canUpdate(version, "0.17");
|
||||
return !PlotSquared.get().canUpdate(version, "0.17");
|
||||
}
|
||||
}
|
||||
|
@ -2,7 +2,7 @@ package com.github.intellectualsites.plotsquared.bukkit.generator;
|
||||
|
||||
import com.github.intellectualsites.plotsquared.bukkit.util.BukkitUtil;
|
||||
import com.github.intellectualsites.plotsquared.bukkit.util.block.GenChunk;
|
||||
import com.github.intellectualsites.plotsquared.plot.PS;
|
||||
import com.github.intellectualsites.plotsquared.plot.PlotSquared;
|
||||
import com.github.intellectualsites.plotsquared.plot.generator.GeneratorWrapper;
|
||||
import com.github.intellectualsites.plotsquared.plot.generator.IndependentPlotGenerator;
|
||||
import com.github.intellectualsites.plotsquared.plot.object.*;
|
||||
@ -78,7 +78,7 @@ public class BukkitPlotGenerator extends ChunkGenerator
|
||||
}
|
||||
}
|
||||
BukkitPlotGenerator.this.random.state = c.getX() << 16 | c.getZ() & 0xFFFF;
|
||||
PlotArea area = PS.get().getPlotArea(world.getName(), null);
|
||||
PlotArea area = PlotSquared.get().getPlotArea(world.getName(), null);
|
||||
ChunkWrapper wrap = new ChunkWrapper(area.worldname, c.getX(), c.getZ());
|
||||
ScopedLocalBlockQueue chunk = queue.getForChunk(wrap.x, wrap.z);
|
||||
if (BukkitPlotGenerator.this.plotGenerator
|
||||
@ -98,7 +98,7 @@ public class BukkitPlotGenerator extends ChunkGenerator
|
||||
+ " is already a BukkitPlotGenerator!");
|
||||
}
|
||||
this.full = false;
|
||||
PS.debug("BukkitPlotGenerator does not fully support: " + cg);
|
||||
PlotSquared.debug("BukkitPlotGenerator does not fully support: " + cg);
|
||||
this.platformGenerator = cg;
|
||||
this.plotGenerator = new IndependentPlotGenerator() {
|
||||
@Override public void processSetup(SetupObject setup) {
|
||||
@ -108,7 +108,7 @@ public class BukkitPlotGenerator extends ChunkGenerator
|
||||
}
|
||||
|
||||
@Override public PlotManager getNewPlotManager() {
|
||||
return PS.get().IMP.getDefaultGenerator().getNewPlotManager();
|
||||
return PlotSquared.get().IMP.getDefaultGenerator().getNewPlotManager();
|
||||
}
|
||||
|
||||
@Override public String getName() {
|
||||
@ -117,7 +117,7 @@ public class BukkitPlotGenerator extends ChunkGenerator
|
||||
|
||||
@Override
|
||||
public PlotArea getNewPlotArea(String world, String id, PlotId min, PlotId max) {
|
||||
return PS.get().IMP.getDefaultGenerator().getNewPlotArea(world, id, min, max);
|
||||
return PlotSquared.get().IMP.getDefaultGenerator().getNewPlotArea(world, id, min, max);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -199,8 +199,8 @@ public class BukkitPlotGenerator extends ChunkGenerator
|
||||
try {
|
||||
if (!this.loaded) {
|
||||
String name = world.getName();
|
||||
PS.get().loadWorld(name, this);
|
||||
Set<PlotArea> areas = PS.get().getPlotAreas(name);
|
||||
PlotSquared.get().loadWorld(name, this);
|
||||
Set<PlotArea> areas = PlotSquared.get().getPlotAreas(name);
|
||||
if (!areas.isEmpty()) {
|
||||
PlotArea area = areas.iterator().next();
|
||||
if (!area.MOB_SPAWNING) {
|
||||
@ -276,7 +276,7 @@ public class BukkitPlotGenerator extends ChunkGenerator
|
||||
// Load if improperly loaded
|
||||
if (!this.loaded) {
|
||||
String name = world.getName();
|
||||
PS.get().loadWorld(name, this);
|
||||
PlotSquared.get().loadWorld(name, this);
|
||||
this.loaded = true;
|
||||
}
|
||||
// Set random seed
|
||||
@ -285,7 +285,7 @@ public class BukkitPlotGenerator extends ChunkGenerator
|
||||
if (ChunkManager.preProcessChunk(result)) {
|
||||
return;
|
||||
}
|
||||
PlotArea area = PS.get().getPlotArea(world.getName(), null);
|
||||
PlotArea area = PlotSquared.get().getPlotArea(world.getName(), null);
|
||||
try {
|
||||
this.plotGenerator.generateChunk(this.chunkSetter, area, this.random);
|
||||
} catch (Throwable e) {
|
||||
|
@ -1,6 +1,6 @@
|
||||
package com.github.intellectualsites.plotsquared.bukkit.listeners;
|
||||
|
||||
import com.github.intellectualsites.plotsquared.plot.PS;
|
||||
import com.github.intellectualsites.plotsquared.plot.PlotSquared;
|
||||
import com.github.intellectualsites.plotsquared.plot.config.C;
|
||||
import com.github.intellectualsites.plotsquared.plot.config.Settings;
|
||||
import com.github.intellectualsites.plotsquared.plot.object.Location;
|
||||
@ -47,7 +47,7 @@ public class ChunkListener implements Listener {
|
||||
this.mustSave = classChunk.getField("mustSave");
|
||||
this.methodGetHandleChunk = classCraftChunk.getMethod("getHandle");
|
||||
} catch (Throwable ignored) {
|
||||
PS.debug(PS.imp().getPluginName()
|
||||
PlotSquared.debug(PlotSquared.imp().getPluginName()
|
||||
+ "/Server not compatible for chunk processor trim/gc");
|
||||
Settings.Chunk_Processor.AUTO_TRIM = false;
|
||||
}
|
||||
@ -64,7 +64,7 @@ public class ChunkListener implements Listener {
|
||||
HashSet<Chunk> toUnload = new HashSet<>();
|
||||
for (World world : Bukkit.getWorlds()) {
|
||||
String worldName = world.getName();
|
||||
if (!PS.get().hasPlotArea(worldName)) {
|
||||
if (!PlotSquared.get().hasPlotArea(worldName)) {
|
||||
continue;
|
||||
}
|
||||
Object w = world.getClass().getDeclaredMethod("getHandle").invoke(world);
|
||||
@ -153,7 +153,7 @@ public class ChunkListener implements Listener {
|
||||
if (Settings.Chunk_Processor.AUTO_TRIM) {
|
||||
Chunk chunk = event.getChunk();
|
||||
String world = chunk.getWorld().getName();
|
||||
if (PS.get().hasPlotArea(world)) {
|
||||
if (PlotSquared.get().hasPlotArea(world)) {
|
||||
if (unloadChunk(world, chunk, true)) {
|
||||
return;
|
||||
}
|
||||
@ -176,7 +176,7 @@ public class ChunkListener implements Listener {
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
if (!PS.get().hasPlotArea(chunk.getWorld().getName())) {
|
||||
if (!PlotSquared.get().hasPlotArea(chunk.getWorld().getName())) {
|
||||
return;
|
||||
}
|
||||
Entity[] entities = chunk.getEntities();
|
||||
@ -205,7 +205,7 @@ public class ChunkListener implements Listener {
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
if (!PS.get().hasPlotArea(chunk.getWorld().getName())) {
|
||||
if (!PlotSquared.get().hasPlotArea(chunk.getWorld().getName())) {
|
||||
return;
|
||||
}
|
||||
Entity[] entities = chunk.getEntities();
|
||||
@ -226,7 +226,7 @@ public class ChunkListener implements Listener {
|
||||
if (!chunk.isLoaded()) {
|
||||
Bukkit.getScheduler().cancelTask(TaskManager.tasks.get(currentIndex));
|
||||
TaskManager.tasks.remove(currentIndex);
|
||||
PS.debug(C.PREFIX.s() + "&aSuccessfully processed and unloaded chunk!");
|
||||
PlotSquared.debug(C.PREFIX.s() + "&aSuccessfully processed and unloaded chunk!");
|
||||
chunk.unload(true, true);
|
||||
return;
|
||||
}
|
||||
@ -234,7 +234,7 @@ public class ChunkListener implements Listener {
|
||||
if (tiles.length == 0) {
|
||||
Bukkit.getScheduler().cancelTask(TaskManager.tasks.get(currentIndex));
|
||||
TaskManager.tasks.remove(currentIndex);
|
||||
PS.debug(C.PREFIX.s() + "&aSuccessfully processed and unloaded chunk!");
|
||||
PlotSquared.debug(C.PREFIX.s() + "&aSuccessfully processed and unloaded chunk!");
|
||||
chunk.unload(true, true);
|
||||
return;
|
||||
}
|
||||
@ -244,7 +244,7 @@ public class ChunkListener implements Listener {
|
||||
if (i >= tiles.length) {
|
||||
Bukkit.getScheduler().cancelTask(TaskManager.tasks.get(currentIndex));
|
||||
TaskManager.tasks.remove(currentIndex);
|
||||
PS.debug(C.PREFIX.s() + "&aSuccessfully processed and unloaded chunk!");
|
||||
PlotSquared.debug(C.PREFIX.s() + "&aSuccessfully processed and unloaded chunk!");
|
||||
chunk.unload(true, true);
|
||||
return;
|
||||
}
|
||||
@ -257,7 +257,7 @@ public class ChunkListener implements Listener {
|
||||
}
|
||||
|
||||
public boolean processChunk(Chunk chunk, boolean unload) {
|
||||
if (!PS.get().hasPlotArea(chunk.getWorld().getName())) {
|
||||
if (!PlotSquared.get().hasPlotArea(chunk.getWorld().getName())) {
|
||||
return false;
|
||||
}
|
||||
Entity[] entities = chunk.getEntities();
|
||||
@ -268,12 +268,14 @@ public class ChunkListener implements Listener {
|
||||
ent.remove();
|
||||
}
|
||||
}
|
||||
PS.debug(C.PREFIX.s() + "&a detected unsafe chunk and processed: " + (chunk.getX() << 4)
|
||||
PlotSquared
|
||||
.debug(C.PREFIX.s() + "&a detected unsafe chunk and processed: " + (chunk.getX() << 4)
|
||||
+ "," + (chunk.getX() << 4));
|
||||
}
|
||||
if (tiles.length > Settings.Chunk_Processor.MAX_TILES) {
|
||||
if (unload) {
|
||||
PS.debug(C.PREFIX.s() + "&c detected unsafe chunk: " + (chunk.getX() << 4) + "," + (
|
||||
PlotSquared
|
||||
.debug(C.PREFIX.s() + "&c detected unsafe chunk: " + (chunk.getX() << 4) + "," + (
|
||||
chunk.getX() << 4));
|
||||
cleanChunk(chunk);
|
||||
return true;
|
||||
|
@ -1,6 +1,6 @@
|
||||
package com.github.intellectualsites.plotsquared.bukkit.listeners;
|
||||
|
||||
import com.github.intellectualsites.plotsquared.plot.PS;
|
||||
import com.github.intellectualsites.plotsquared.plot.PlotSquared;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.entity.ArmorStand;
|
||||
@ -28,9 +28,9 @@ public class EntityPortal_1_7_9 implements Listener {
|
||||
List<MetadataValue> meta = entity.getMetadata("plotworld");
|
||||
World world = entity.getLocation().getWorld();
|
||||
if (meta == null || meta.isEmpty()) {
|
||||
if (PS.get().hasPlotArea(world.getName())) {
|
||||
if (PlotSquared.get().hasPlotArea(world.getName())) {
|
||||
entity.setMetadata("plotworld",
|
||||
new FixedMetadataValue((Plugin) PS.get().IMP, entity.getLocation()));
|
||||
new FixedMetadataValue((Plugin) PlotSquared.get().IMP, entity.getLocation()));
|
||||
}
|
||||
} else {
|
||||
Location origin = (Location) meta.get(0).value();
|
||||
|
@ -1,7 +1,7 @@
|
||||
package com.github.intellectualsites.plotsquared.bukkit.listeners;
|
||||
|
||||
import com.github.intellectualsites.plotsquared.bukkit.util.BukkitUtil;
|
||||
import com.github.intellectualsites.plotsquared.plot.PS;
|
||||
import com.github.intellectualsites.plotsquared.plot.PlotSquared;
|
||||
import com.github.intellectualsites.plotsquared.plot.config.Settings;
|
||||
import com.github.intellectualsites.plotsquared.plot.flag.Flags;
|
||||
import com.github.intellectualsites.plotsquared.plot.object.Location;
|
||||
@ -54,7 +54,7 @@ public class EntitySpawnListener implements Listener {
|
||||
case SHULKER:
|
||||
if (!entity.hasMetadata("plot")) {
|
||||
entity.setMetadata("plot",
|
||||
new FixedMetadataValue((Plugin) PS.get().IMP, plot.getId()));
|
||||
new FixedMetadataValue((Plugin) PlotSquared.get().IMP, plot.getId()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -5,7 +5,7 @@ import com.github.intellectualsites.plotsquared.bukkit.object.BukkitLazyBlock;
|
||||
import com.github.intellectualsites.plotsquared.bukkit.object.BukkitPlayer;
|
||||
import com.github.intellectualsites.plotsquared.bukkit.util.BukkitUtil;
|
||||
import com.github.intellectualsites.plotsquared.bukkit.util.BukkitVersion;
|
||||
import com.github.intellectualsites.plotsquared.plot.PS;
|
||||
import com.github.intellectualsites.plotsquared.plot.PlotSquared;
|
||||
import com.github.intellectualsites.plotsquared.plot.config.C;
|
||||
import com.github.intellectualsites.plotsquared.plot.config.Settings;
|
||||
import com.github.intellectualsites.plotsquared.plot.flag.Flags;
|
||||
@ -66,7 +66,7 @@ public class PlayerEvents extends PlotListener implements Listener {
|
||||
private Field fieldPlayer;
|
||||
private PlayerMoveEvent moveTmp;
|
||||
private boolean v112 =
|
||||
PS.get().checkVersion(PS.imp().getServerVersion(), BukkitVersion.v1_12_0);
|
||||
PlotSquared.get().checkVersion(PlotSquared.imp().getServerVersion(), BukkitVersion.v1_12_0);
|
||||
|
||||
{
|
||||
try {
|
||||
@ -483,7 +483,7 @@ public class PlayerEvents extends PlotListener implements Listener {
|
||||
return;
|
||||
}
|
||||
Location l = BukkitUtil.getLocation(entity);
|
||||
if (!PS.get().hasPlotArea(l.getWorld())) {
|
||||
if (!PlotSquared.get().hasPlotArea(l.getWorld())) {
|
||||
return;
|
||||
}
|
||||
PlotPlayer pp = BukkitUtil.getPlayer((Player) shooter);
|
||||
@ -497,7 +497,7 @@ public class PlayerEvents extends PlotListener implements Listener {
|
||||
@EventHandler public boolean onProjectileHit(ProjectileHitEvent event) {
|
||||
Projectile entity = event.getEntity();
|
||||
Location loc = BukkitUtil.getLocation(entity);
|
||||
if (!PS.get().hasPlotArea(loc.getWorld())) {
|
||||
if (!PlotSquared.get().hasPlotArea(loc.getWorld())) {
|
||||
return true;
|
||||
}
|
||||
PlotArea area = loc.getPlotArea();
|
||||
@ -685,7 +685,7 @@ public class PlayerEvents extends PlotListener implements Listener {
|
||||
Player player = event.getPlayer();
|
||||
PlotPlayer pp = PlotPlayer.wrap(player);
|
||||
Location loc = BukkitUtil.getLocation(to);
|
||||
PlotArea area = PS.get().getPlotAreaAbs(loc);
|
||||
PlotArea area = PlotSquared.get().getPlotAreaAbs(loc);
|
||||
if (area == null) {
|
||||
return;
|
||||
}
|
||||
@ -776,7 +776,7 @@ public class PlayerEvents extends PlotListener implements Listener {
|
||||
}
|
||||
} else if (toPlot != null) {
|
||||
vehicle.setMetadata("plot",
|
||||
new FixedMetadataValue((Plugin) PS.get().IMP, toPlot));
|
||||
new FixedMetadataValue((Plugin) PlotSquared.get().IMP, toPlot));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -956,7 +956,7 @@ public class PlayerEvents extends PlotListener implements Listener {
|
||||
player.sendMessage(spyMessage);
|
||||
}
|
||||
}
|
||||
PS.debug(full);
|
||||
PlotSquared.debug(full);
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.LOWEST) public void blockDestroy(BlockBreakEvent event) {
|
||||
@ -1021,8 +1021,8 @@ public class PlayerEvents extends PlotListener implements Listener {
|
||||
if (Permissions.hasPermission(pp, C.PERMISSION_ADMIN_DESTROY_ROAD)) {
|
||||
return;
|
||||
}
|
||||
if (PS.get().worldedit != null && pp.getAttribute("worldedit")) {
|
||||
if (player.getItemInHand().getTypeId() == PS.get().worldedit
|
||||
if (PlotSquared.get().worldedit != null && pp.getAttribute("worldedit")) {
|
||||
if (player.getItemInHand().getTypeId() == PlotSquared.get().worldedit
|
||||
.getConfiguration().wandItem) {
|
||||
return;
|
||||
}
|
||||
@ -1036,7 +1036,7 @@ public class PlayerEvents extends PlotListener implements Listener {
|
||||
Location location = BukkitUtil.getLocation(event.getLocation());
|
||||
PlotArea area = location.getPlotArea();
|
||||
if (area == null) {
|
||||
if (!PS.get().hasPlotArea(location.getWorld())) {
|
||||
if (!PlotSquared.get().hasPlotArea(location.getWorld())) {
|
||||
return;
|
||||
}
|
||||
Iterator<Block> iterator = event.blockList().iterator();
|
||||
@ -1066,7 +1066,7 @@ public class PlayerEvents extends PlotListener implements Listener {
|
||||
.equals(EntityType.MINECART_TNT)) {
|
||||
if (!near.hasMetadata("plot")) {
|
||||
near.setMetadata("plot",
|
||||
new FixedMetadataValue((Plugin) PS.get().IMP, plot));
|
||||
new FixedMetadataValue((Plugin) PlotSquared.get().IMP, plot));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1097,7 +1097,7 @@ public class PlayerEvents extends PlotListener implements Listener {
|
||||
if (plot != null) {
|
||||
plotExit(pp, plot);
|
||||
}
|
||||
if (PS.get().worldedit != null) {
|
||||
if (PlotSquared.get().worldedit != null) {
|
||||
if (!Permissions.hasPermission(pp, C.PERMISSION_WORLDEDIT_BYPASS)) {
|
||||
if (pp.getAttribute("worldedit")) {
|
||||
pp.removeAttribute("worldedit");
|
||||
@ -1108,7 +1108,7 @@ public class PlayerEvents extends PlotListener implements Listener {
|
||||
pp.deleteMeta("perm");
|
||||
}
|
||||
Location loc = pp.getLocation();
|
||||
PlotArea area = PS.get().getPlotAreaAbs(loc);
|
||||
PlotArea area = PlotSquared.get().getPlotAreaAbs(loc);
|
||||
if (area == null) {
|
||||
return;
|
||||
}
|
||||
@ -1136,7 +1136,7 @@ public class PlayerEvents extends PlotListener implements Listener {
|
||||
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
|
||||
public void onEntityBlockForm(EntityBlockFormEvent event) {
|
||||
String world = event.getBlock().getWorld().getName();
|
||||
if (!PS.get().hasPlotArea(world)) {
|
||||
if (!PlotSquared.get().hasPlotArea(world)) {
|
||||
return;
|
||||
}
|
||||
Location location = BukkitUtil.getLocation(event.getBlock().getLocation());
|
||||
@ -1381,7 +1381,7 @@ public class PlayerEvents extends PlotListener implements Listener {
|
||||
Vector relative = new Vector(face.getModX(), face.getModY(), face.getModZ());
|
||||
PlotArea area = location.getPlotArea();
|
||||
if (area == null) {
|
||||
if (!PS.get().hasPlotArea(location.getWorld())) {
|
||||
if (!PlotSquared.get().hasPlotArea(location.getWorld())) {
|
||||
return;
|
||||
}
|
||||
for (Block b : event.getBlocks()) {
|
||||
@ -1419,7 +1419,7 @@ public class PlayerEvents extends PlotListener implements Listener {
|
||||
Location location = BukkitUtil.getLocation(block.getLocation());
|
||||
PlotArea area = location.getPlotArea();
|
||||
if (area == null) {
|
||||
if (!PS.get().hasPlotArea(location.getWorld())) {
|
||||
if (!PlotSquared.get().hasPlotArea(location.getWorld())) {
|
||||
return;
|
||||
}
|
||||
if (this.pistonBlocks) {
|
||||
@ -1512,7 +1512,7 @@ public class PlayerEvents extends PlotListener implements Listener {
|
||||
|
||||
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
|
||||
public void onStructureGrow(StructureGrowEvent event) {
|
||||
if (!PS.get().hasPlotArea(event.getWorld().getName())) {
|
||||
if (!PlotSquared.get().hasPlotArea(event.getWorld().getName())) {
|
||||
return;
|
||||
}
|
||||
List<BlockState> blocks = event.getBlocks();
|
||||
@ -1761,8 +1761,8 @@ public class PlayerEvents extends PlotListener implements Listener {
|
||||
default:
|
||||
return;
|
||||
}
|
||||
if (PS.get().worldedit != null && pp.getAttribute("worldedit")) {
|
||||
if (player.getItemInHand().getTypeId() == PS.get().worldedit
|
||||
if (PlotSquared.get().worldedit != null && pp.getAttribute("worldedit")) {
|
||||
if (player.getItemInHand().getTypeId() == PlotSquared.get().worldedit
|
||||
.getConfiguration().wandItem) {
|
||||
return;
|
||||
}
|
||||
@ -1832,7 +1832,7 @@ public class PlayerEvents extends PlotListener implements Listener {
|
||||
Block block = event.getBlock();
|
||||
World world = block.getWorld();
|
||||
String worldName = world.getName();
|
||||
if (!PS.get().hasPlotArea(worldName)) {
|
||||
if (!PlotSquared.get().hasPlotArea(worldName)) {
|
||||
return;
|
||||
}
|
||||
Location location = BukkitUtil.getLocation(block.getLocation());
|
||||
@ -1858,7 +1858,7 @@ public class PlayerEvents extends PlotListener implements Listener {
|
||||
}
|
||||
} else if (event.getTo() == Material.AIR) {
|
||||
event.getEntity()
|
||||
.setMetadata("plot", new FixedMetadataValue((Plugin) PS.get().IMP, plot));
|
||||
.setMetadata("plot", new FixedMetadataValue((Plugin) PlotSquared.get().IMP, plot));
|
||||
}
|
||||
}
|
||||
|
||||
@ -2100,7 +2100,7 @@ public class PlayerEvents extends PlotListener implements Listener {
|
||||
return;
|
||||
}
|
||||
if (Settings.Enabled_Components.KILL_ROAD_VEHICLES) {
|
||||
entity.setMetadata("plot", new FixedMetadataValue((Plugin) PS.get().IMP, plot));
|
||||
entity.setMetadata("plot", new FixedMetadataValue((Plugin) PlotSquared.get().IMP, plot));
|
||||
}
|
||||
}
|
||||
|
||||
@ -2314,7 +2314,7 @@ public class PlayerEvents extends PlotListener implements Listener {
|
||||
public void onPotionSplash(PotionSplashEvent event) {
|
||||
ThrownPotion damager = event.getPotion();
|
||||
Location l = BukkitUtil.getLocation(damager);
|
||||
if (!PS.get().hasPlotArea(l.getWorld())) {
|
||||
if (!PlotSquared.get().hasPlotArea(l.getWorld())) {
|
||||
return;
|
||||
}
|
||||
int count = 0;
|
||||
@ -2332,7 +2332,7 @@ public class PlayerEvents extends PlotListener implements Listener {
|
||||
@SuppressWarnings("deprecation") @EventHandler(priority = EventPriority.HIGHEST)
|
||||
public void onEntityCombustByEntity(EntityCombustByEntityEvent event) {
|
||||
EntityDamageByEntityEvent eventChange = null;
|
||||
if (PS.get().checkVersion(PS.get().IMP.getServerVersion(), BukkitVersion.v1_11_0)) {
|
||||
if (PlotSquared.get().checkVersion(PlotSquared.get().IMP.getServerVersion(), BukkitVersion.v1_11_0)) {
|
||||
eventChange = new EntityDamageByEntityEvent(event.getCombuster(), event.getEntity(),
|
||||
EntityDamageEvent.DamageCause.FIRE_TICK, (double) event.getDuration());
|
||||
} else {
|
||||
@ -2359,7 +2359,7 @@ public class PlayerEvents extends PlotListener implements Listener {
|
||||
public void onEntityDamageByEntityEvent(EntityDamageByEntityEvent event) {
|
||||
Entity damager = event.getDamager();
|
||||
Location l = BukkitUtil.getLocation(damager);
|
||||
if (!PS.get().hasPlotArea(l.getWorld())) {
|
||||
if (!PlotSquared.get().hasPlotArea(l.getWorld())) {
|
||||
return;
|
||||
}
|
||||
Entity victim = event.getEntity();
|
||||
|
@ -1,7 +1,7 @@
|
||||
package com.github.intellectualsites.plotsquared.bukkit.listeners;
|
||||
|
||||
import com.github.intellectualsites.plotsquared.bukkit.util.BukkitUtil;
|
||||
import com.github.intellectualsites.plotsquared.plot.PS;
|
||||
import com.github.intellectualsites.plotsquared.plot.PlotSquared;
|
||||
import com.github.intellectualsites.plotsquared.plot.flag.Flags;
|
||||
import com.github.intellectualsites.plotsquared.plot.object.Location;
|
||||
import com.github.intellectualsites.plotsquared.plot.object.Plot;
|
||||
@ -20,7 +20,7 @@ public class PlayerEvents183 implements Listener {
|
||||
Block block = event.getBlock();
|
||||
Location location = BukkitUtil.getLocation(block.getLocation());
|
||||
String world = location.getWorld();
|
||||
if (!PS.get().hasPlotArea(world)) {
|
||||
if (!PlotSquared.get().hasPlotArea(world)) {
|
||||
return;
|
||||
}
|
||||
PlotArea area = location.getPlotArea();
|
||||
|
@ -1,7 +1,7 @@
|
||||
package com.github.intellectualsites.plotsquared.bukkit.listeners;
|
||||
|
||||
import com.github.intellectualsites.plotsquared.bukkit.util.BukkitUtil;
|
||||
import com.github.intellectualsites.plotsquared.plot.PS;
|
||||
import com.github.intellectualsites.plotsquared.plot.PlotSquared;
|
||||
import com.github.intellectualsites.plotsquared.plot.config.C;
|
||||
import com.github.intellectualsites.plotsquared.plot.flag.Flags;
|
||||
import com.github.intellectualsites.plotsquared.plot.listener.PlotListener;
|
||||
@ -42,7 +42,7 @@ public class PlayerEvents_1_8 extends PlotListener implements Listener {
|
||||
return;
|
||||
}
|
||||
HumanEntity entity = event.getWhoClicked();
|
||||
if (!(entity instanceof Player) || !PS.get().hasPlotArea(entity.getWorld().getName())) {
|
||||
if (!(entity instanceof Player) || !PlotSquared.get().hasPlotArea(entity.getWorld().getName())) {
|
||||
return;
|
||||
}
|
||||
Player player = (Player) entity;
|
||||
|
@ -1,7 +1,7 @@
|
||||
package com.github.intellectualsites.plotsquared.bukkit.listeners;
|
||||
|
||||
import com.github.intellectualsites.plotsquared.bukkit.util.BukkitUtil;
|
||||
import com.github.intellectualsites.plotsquared.plot.PS;
|
||||
import com.github.intellectualsites.plotsquared.plot.PlotSquared;
|
||||
import com.github.intellectualsites.plotsquared.plot.object.Location;
|
||||
import org.bukkit.entity.LingeringPotion;
|
||||
import org.bukkit.event.EventHandler;
|
||||
@ -21,7 +21,7 @@ public class PlayerEvents_1_9 implements Listener {
|
||||
public void onPotionSplash(LingeringPotionSplashEvent event) {
|
||||
LingeringPotion entity = event.getEntity();
|
||||
Location l = BukkitUtil.getLocation(entity);
|
||||
if (!PS.get().hasPlotArea(l.getWorld())) {
|
||||
if (!PlotSquared.get().hasPlotArea(l.getWorld())) {
|
||||
return;
|
||||
}
|
||||
if (!parent.onProjectileHit(event)) {
|
||||
|
@ -1,6 +1,6 @@
|
||||
package com.github.intellectualsites.plotsquared.bukkit.listeners;
|
||||
|
||||
import com.github.intellectualsites.plotsquared.plot.PS;
|
||||
import com.github.intellectualsites.plotsquared.plot.PlotSquared;
|
||||
import com.github.intellectualsites.plotsquared.plot.object.worlds.PlotAreaManager;
|
||||
import com.github.intellectualsites.plotsquared.plot.object.worlds.SinglePlotAreaManager;
|
||||
import com.github.intellectualsites.plotsquared.plot.util.ReflectionUtils;
|
||||
@ -58,7 +58,7 @@ public class SingleWorldListener implements Listener {
|
||||
private void handle(ChunkEvent event) {
|
||||
World world = event.getWorld();
|
||||
String name = world.getName();
|
||||
PlotAreaManager man = PS.get().getPlotAreaManager();
|
||||
PlotAreaManager man = PlotSquared.get().getPlotAreaManager();
|
||||
if (!(man instanceof SinglePlotAreaManager))
|
||||
return;
|
||||
if (!isPlotId(name))
|
||||
|
@ -1,7 +1,7 @@
|
||||
package com.github.intellectualsites.plotsquared.bukkit.listeners;
|
||||
|
||||
import com.github.intellectualsites.plotsquared.bukkit.generator.BukkitPlotGenerator;
|
||||
import com.github.intellectualsites.plotsquared.plot.PS;
|
||||
import com.github.intellectualsites.plotsquared.plot.PlotSquared;
|
||||
import com.github.intellectualsites.plotsquared.plot.generator.GeneratorWrapper;
|
||||
import com.github.intellectualsites.plotsquared.plot.object.worlds.PlotAreaManager;
|
||||
import com.github.intellectualsites.plotsquared.plot.object.worlds.SinglePlotAreaManager;
|
||||
@ -18,7 +18,7 @@ public class WorldEvents implements Listener {
|
||||
public void onWorldInit(WorldInitEvent event) {
|
||||
World world = event.getWorld();
|
||||
String name = world.getName();
|
||||
PlotAreaManager manager = PS.get().getPlotAreaManager();
|
||||
PlotAreaManager manager = PlotSquared.get().getPlotAreaManager();
|
||||
if (manager instanceof SinglePlotAreaManager) {
|
||||
SinglePlotAreaManager single = (SinglePlotAreaManager) manager;
|
||||
if (single.isWorld(name)) {
|
||||
@ -28,9 +28,9 @@ public class WorldEvents implements Listener {
|
||||
}
|
||||
ChunkGenerator gen = world.getGenerator();
|
||||
if (gen instanceof GeneratorWrapper) {
|
||||
PS.get().loadWorld(name, (GeneratorWrapper<?>) gen);
|
||||
PlotSquared.get().loadWorld(name, (GeneratorWrapper<?>) gen);
|
||||
} else {
|
||||
PS.get().loadWorld(name, new BukkitPlotGenerator(name, gen));
|
||||
PlotSquared.get().loadWorld(name, new BukkitPlotGenerator(name, gen));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
package com.github.intellectualsites.plotsquared.bukkit.object;
|
||||
|
||||
import com.github.intellectualsites.plotsquared.bukkit.util.BukkitUtil;
|
||||
import com.github.intellectualsites.plotsquared.plot.PS;
|
||||
import com.github.intellectualsites.plotsquared.plot.PlotSquared;
|
||||
import com.github.intellectualsites.plotsquared.plot.config.C;
|
||||
import com.github.intellectualsites.plotsquared.plot.object.Location;
|
||||
import com.github.intellectualsites.plotsquared.plot.object.PlotPlayer;
|
||||
@ -76,7 +76,7 @@ public class BukkitPlayer extends PlotPlayer {
|
||||
private void callEvent(final Event event) {
|
||||
RegisteredListener[] listeners = event.getHandlers().getRegisteredListeners();
|
||||
for (RegisteredListener listener : listeners) {
|
||||
if (listener.getPlugin().getName().equals(PS.imp().getPluginName())) {
|
||||
if (listener.getPlugin().getName().equals(PlotSquared.imp().getPluginName())) {
|
||||
continue;
|
||||
}
|
||||
try {
|
||||
|
@ -1,7 +1,7 @@
|
||||
package com.github.intellectualsites.plotsquared.bukkit.object.entity;
|
||||
|
||||
import com.github.intellectualsites.plotsquared.bukkit.util.BukkitVersion;
|
||||
import com.github.intellectualsites.plotsquared.plot.PS;
|
||||
import com.github.intellectualsites.plotsquared.plot.PlotSquared;
|
||||
import org.bukkit.*;
|
||||
import org.bukkit.block.BlockFace;
|
||||
import org.bukkit.entity.*;
|
||||
@ -53,7 +53,7 @@ public final class ReplicatingEntityWrapper extends EntityWrapper {
|
||||
if (depth == 1) {
|
||||
return;
|
||||
}
|
||||
if (PS.get().checkVersion(PS.get().IMP.getServerVersion(), BukkitVersion.v1_10_0)
|
||||
if (PlotSquared.get().checkVersion(PlotSquared.get().IMP.getServerVersion(), BukkitVersion.v1_10_0)
|
||||
|| entity instanceof ArmorStand) {
|
||||
if (!entity.hasGravity()) {
|
||||
this.noGravity = true;
|
||||
@ -62,7 +62,8 @@ public final class ReplicatingEntityWrapper extends EntityWrapper {
|
||||
switch (entity.getType()) {
|
||||
case ARROW:
|
||||
case BOAT:
|
||||
if (PS.get().checkVersion(PS.get().IMP.getServerVersion(), BukkitVersion.v1_9_0)) {
|
||||
if (PlotSquared
|
||||
.get().checkVersion(PlotSquared.get().IMP.getServerVersion(), BukkitVersion.v1_9_0)) {
|
||||
Boat boat = (Boat) entity;
|
||||
this.dataByte = getOrdinal(TreeSpecies.values(), boat.getWoodType());
|
||||
}
|
||||
@ -102,7 +103,7 @@ public final class ReplicatingEntityWrapper extends EntityWrapper {
|
||||
// Do this stuff later
|
||||
return;
|
||||
default:
|
||||
PS.debug("&cCOULD NOT IDENTIFY ENTITY: " + entity.getType());
|
||||
PlotSquared.debug("&cCOULD NOT IDENTIFY ENTITY: " + entity.getType());
|
||||
return;
|
||||
// MISC //
|
||||
case DROPPED_ITEM:
|
||||
@ -322,7 +323,7 @@ public final class ReplicatingEntityWrapper extends EntityWrapper {
|
||||
|
||||
void restoreEquipment(LivingEntity entity) {
|
||||
EntityEquipment equipment = entity.getEquipment();
|
||||
if (PS.get().checkVersion(PS.get().IMP.getServerVersion(), BukkitVersion.v1_9_0)) {
|
||||
if (PlotSquared.get().checkVersion(PlotSquared.get().IMP.getServerVersion(), BukkitVersion.v1_9_0)) {
|
||||
equipment.setItemInMainHand(this.lived.mainHand);
|
||||
equipment.setItemInOffHand(this.lived.offHand);
|
||||
} else {
|
||||
@ -338,7 +339,7 @@ public final class ReplicatingEntityWrapper extends EntityWrapper {
|
||||
try {
|
||||
entity.getInventory().setContents(this.inventory);
|
||||
} catch (IllegalArgumentException e) {
|
||||
PS.debug("&c[WARN] Failed to restore inventory.\n Reason: " + e.getMessage());
|
||||
PlotSquared.debug("&c[WARN] Failed to restore inventory.\n Reason: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@ -366,7 +367,7 @@ public final class ReplicatingEntityWrapper extends EntityWrapper {
|
||||
}
|
||||
|
||||
void storeEquipment(EntityEquipment equipment) {
|
||||
if (PS.get().checkVersion(PS.get().IMP.getServerVersion(), BukkitVersion.v1_9_0)) {
|
||||
if (PlotSquared.get().checkVersion(PlotSquared.get().IMP.getServerVersion(), BukkitVersion.v1_9_0)) {
|
||||
this.lived.mainHand = equipment.getItemInMainHand().clone();
|
||||
this.lived.offHand = equipment.getItemInOffHand().clone();
|
||||
} else {
|
||||
@ -458,7 +459,7 @@ public final class ReplicatingEntityWrapper extends EntityWrapper {
|
||||
if (this.depth == 1) {
|
||||
return entity;
|
||||
}
|
||||
if (PS.get().checkVersion(PS.get().IMP.getServerVersion(), BukkitVersion.v1_10_0)
|
||||
if (PlotSquared.get().checkVersion(PlotSquared.get().IMP.getServerVersion(), BukkitVersion.v1_10_0)
|
||||
|| entity instanceof ArmorStand) {
|
||||
if (this.noGravity) {
|
||||
entity.setGravity(false);
|
||||
@ -467,7 +468,8 @@ public final class ReplicatingEntityWrapper extends EntityWrapper {
|
||||
switch (entity.getType()) {
|
||||
case ARROW:
|
||||
case BOAT:
|
||||
if (PS.get().checkVersion(PS.get().IMP.getServerVersion(), BukkitVersion.v1_9_0)) {
|
||||
if (PlotSquared
|
||||
.get().checkVersion(PlotSquared.get().IMP.getServerVersion(), BukkitVersion.v1_9_0)) {
|
||||
Boat boat = (Boat) entity;
|
||||
boat.setWoodType(TreeSpecies.values()[dataByte]);
|
||||
}
|
||||
@ -512,7 +514,7 @@ public final class ReplicatingEntityWrapper extends EntityWrapper {
|
||||
// Do this stuff later
|
||||
return entity;
|
||||
default:
|
||||
PS.debug("&cCOULD NOT IDENTIFY ENTITY: " + entity.getType());
|
||||
PlotSquared.debug("&cCOULD NOT IDENTIFY ENTITY: " + entity.getType());
|
||||
return entity;
|
||||
// MISC //
|
||||
case ITEM_FRAME:
|
||||
|
@ -2,7 +2,7 @@ package com.github.intellectualsites.plotsquared.bukkit.titles;
|
||||
|
||||
import com.github.intellectualsites.plotsquared.bukkit.object.BukkitPlayer;
|
||||
import com.github.intellectualsites.plotsquared.bukkit.util.BukkitVersion;
|
||||
import com.github.intellectualsites.plotsquared.plot.PS;
|
||||
import com.github.intellectualsites.plotsquared.plot.PlotSquared;
|
||||
import com.github.intellectualsites.plotsquared.plot.object.PlotPlayer;
|
||||
import com.github.intellectualsites.plotsquared.plot.util.AbstractTitle;
|
||||
import org.bukkit.entity.Player;
|
||||
@ -12,7 +12,8 @@ import org.bukkit.entity.Player;
|
||||
private final boolean valid;
|
||||
|
||||
public DefaultTitle_111() {
|
||||
this.valid = PS.get().checkVersion(PS.get().IMP.getServerVersion(), BukkitVersion.v1_11_0);
|
||||
this.valid = PlotSquared
|
||||
.get().checkVersion(PlotSquared.get().IMP.getServerVersion(), BukkitVersion.v1_11_0);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -1,7 +1,7 @@
|
||||
package com.github.intellectualsites.plotsquared.bukkit.titles;
|
||||
|
||||
import com.github.intellectualsites.plotsquared.bukkit.object.BukkitPlayer;
|
||||
import com.github.intellectualsites.plotsquared.plot.PS;
|
||||
import com.github.intellectualsites.plotsquared.plot.PlotSquared;
|
||||
import com.github.intellectualsites.plotsquared.plot.config.Settings;
|
||||
import com.github.intellectualsites.plotsquared.plot.object.PlotPlayer;
|
||||
import com.github.intellectualsites.plotsquared.plot.util.AbstractTitle;
|
||||
@ -14,7 +14,7 @@ public class HackTitle extends AbstractTitle {
|
||||
HackTitleManager title = new HackTitleManager(head, sub, in, delay, out);
|
||||
title.send(((BukkitPlayer) player).player);
|
||||
} catch (Exception ignored) {
|
||||
PS.debug("&cYour server version does not support titles!");
|
||||
PlotSquared.debug("&cYour server version does not support titles!");
|
||||
Settings.TITLES = false;
|
||||
AbstractTitle.TITLE_CLASS = null;
|
||||
}
|
||||
|
@ -2,7 +2,7 @@ package com.github.intellectualsites.plotsquared.bukkit.util;
|
||||
|
||||
import com.github.intellectualsites.plotsquared.bukkit.object.entity.EntityWrapper;
|
||||
import com.github.intellectualsites.plotsquared.bukkit.object.entity.ReplicatingEntityWrapper;
|
||||
import com.github.intellectualsites.plotsquared.plot.PS;
|
||||
import com.github.intellectualsites.plotsquared.plot.PlotSquared;
|
||||
import com.github.intellectualsites.plotsquared.plot.generator.AugmentedUtils;
|
||||
import com.github.intellectualsites.plotsquared.plot.object.*;
|
||||
import com.github.intellectualsites.plotsquared.plot.util.ChunkManager;
|
||||
@ -344,7 +344,7 @@ public class BukkitChunkManager extends ChunkManager {
|
||||
@SuppressWarnings("deprecation") @Override
|
||||
public void unloadChunk(final String world, final ChunkLoc loc, final boolean save,
|
||||
final boolean safe) {
|
||||
if (!PS.get().isMainThread(Thread.currentThread())) {
|
||||
if (!PlotSquared.get().isMainThread(Thread.currentThread())) {
|
||||
TaskManager.runTask(new Runnable() {
|
||||
@SuppressWarnings("deprecation") @Override public void run() {
|
||||
BukkitUtil.getWorld(world).unloadChunk(loc.x, loc.z, save, safe);
|
||||
@ -700,7 +700,7 @@ public class BukkitChunkManager extends ChunkManager {
|
||||
try {
|
||||
entity.spawn(world, xOffset, zOffset);
|
||||
} catch (Exception e) {
|
||||
PS.debug("Failed to restore entity (e): " + e.toString());
|
||||
PlotSquared.debug("Failed to restore entity (e): " + e.toString());
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
@ -719,12 +719,12 @@ public class BukkitChunkManager extends ChunkManager {
|
||||
chest.getInventory().setContents(blockLocEntry.getValue());
|
||||
state.update(true);
|
||||
} else {
|
||||
PS.debug("&c[WARN] Plot clear failed to regenerate chest: " + (
|
||||
PlotSquared.debug("&c[WARN] Plot clear failed to regenerate chest: " + (
|
||||
blockLocEntry.getKey().x + xOffset) + ',' + blockLocEntry.getKey().y
|
||||
+ ',' + (blockLocEntry.getKey().z + zOffset));
|
||||
}
|
||||
} catch (IllegalArgumentException ignored) {
|
||||
PS.debug("&c[WARN] Plot clear failed to regenerate chest (e): " + (
|
||||
PlotSquared.debug("&c[WARN] Plot clear failed to regenerate chest (e): " + (
|
||||
blockLocEntry.getKey().x + xOffset) + ',' + blockLocEntry.getKey().y + ','
|
||||
+ (blockLocEntry.getKey().z + zOffset));
|
||||
}
|
||||
@ -744,12 +744,12 @@ public class BukkitChunkManager extends ChunkManager {
|
||||
}
|
||||
state.update(true);
|
||||
} else {
|
||||
PS.debug("&c[WARN] Plot clear failed to regenerate sign: " + (
|
||||
PlotSquared.debug("&c[WARN] Plot clear failed to regenerate sign: " + (
|
||||
blockLocEntry.getKey().x + xOffset) + ',' + blockLocEntry.getKey().y
|
||||
+ ',' + (blockLocEntry.getKey().z + zOffset));
|
||||
}
|
||||
} catch (IndexOutOfBoundsException ignored) {
|
||||
PS.debug("&c[WARN] Plot clear failed to regenerate sign: " + (
|
||||
PlotSquared.debug("&c[WARN] Plot clear failed to regenerate sign: " + (
|
||||
blockLocEntry.getKey().x + xOffset) + ',' + blockLocEntry.getKey().y + ','
|
||||
+ (blockLocEntry.getKey().z + zOffset));
|
||||
}
|
||||
@ -765,12 +765,12 @@ public class BukkitChunkManager extends ChunkManager {
|
||||
.setContents(blockLocEntry.getValue());
|
||||
state.update(true);
|
||||
} else {
|
||||
PS.debug("&c[WARN] Plot clear failed to regenerate dispenser: " + (
|
||||
PlotSquared.debug("&c[WARN] Plot clear failed to regenerate dispenser: " + (
|
||||
blockLocEntry.getKey().x + xOffset) + ',' + blockLocEntry.getKey().y
|
||||
+ ',' + (blockLocEntry.getKey().z + zOffset));
|
||||
}
|
||||
} catch (IllegalArgumentException ignored) {
|
||||
PS.debug("&c[WARN] Plot clear failed to regenerate dispenser (e): " + (
|
||||
PlotSquared.debug("&c[WARN] Plot clear failed to regenerate dispenser (e): " + (
|
||||
blockLocEntry.getKey().x + xOffset) + ',' + blockLocEntry.getKey().y + ','
|
||||
+ (blockLocEntry.getKey().z + zOffset));
|
||||
}
|
||||
@ -786,12 +786,12 @@ public class BukkitChunkManager extends ChunkManager {
|
||||
.setContents(blockLocEntry.getValue());
|
||||
state.update(true);
|
||||
} else {
|
||||
PS.debug("&c[WARN] Plot clear failed to regenerate dispenser: " + (
|
||||
PlotSquared.debug("&c[WARN] Plot clear failed to regenerate dispenser: " + (
|
||||
blockLocEntry.getKey().x + xOffset) + ',' + blockLocEntry.getKey().y
|
||||
+ ',' + (blockLocEntry.getKey().z + zOffset));
|
||||
}
|
||||
} catch (IllegalArgumentException ignored) {
|
||||
PS.debug("&c[WARN] Plot clear failed to regenerate dispenser (e): " + (
|
||||
PlotSquared.debug("&c[WARN] Plot clear failed to regenerate dispenser (e): " + (
|
||||
blockLocEntry.getKey().x + xOffset) + ',' + blockLocEntry.getKey().y + ','
|
||||
+ (blockLocEntry.getKey().z + zOffset));
|
||||
}
|
||||
@ -807,12 +807,12 @@ public class BukkitChunkManager extends ChunkManager {
|
||||
.setContents(blockLocEntry.getValue());
|
||||
state.update(true);
|
||||
} else {
|
||||
PS.debug("&c[WARN] Plot clear failed to regenerate beacon: " + (
|
||||
PlotSquared.debug("&c[WARN] Plot clear failed to regenerate beacon: " + (
|
||||
blockLocEntry.getKey().x + xOffset) + ',' + blockLocEntry.getKey().y
|
||||
+ ',' + (blockLocEntry.getKey().z + zOffset));
|
||||
}
|
||||
} catch (IllegalArgumentException ignored) {
|
||||
PS.debug("&c[WARN] Plot clear failed to regenerate beacon (e): " + (
|
||||
PlotSquared.debug("&c[WARN] Plot clear failed to regenerate beacon (e): " + (
|
||||
blockLocEntry.getKey().x + xOffset) + ',' + blockLocEntry.getKey().y + ','
|
||||
+ (blockLocEntry.getKey().z + zOffset));
|
||||
}
|
||||
@ -827,13 +827,13 @@ public class BukkitChunkManager extends ChunkManager {
|
||||
((Jukebox) state).setPlaying(blockLocMaterialEntry.getValue());
|
||||
state.update(true);
|
||||
} else {
|
||||
PS.debug("&c[WARN] Plot clear failed to restore jukebox: " + (
|
||||
PlotSquared.debug("&c[WARN] Plot clear failed to restore jukebox: " + (
|
||||
blockLocMaterialEntry.getKey().x + xOffset) + ','
|
||||
+ blockLocMaterialEntry.getKey().y + ',' + (
|
||||
blockLocMaterialEntry.getKey().z + zOffset));
|
||||
}
|
||||
} catch (Exception ignored) {
|
||||
PS.debug("&c[WARN] Plot clear failed to regenerate jukebox (e): " + (
|
||||
PlotSquared.debug("&c[WARN] Plot clear failed to regenerate jukebox (e): " + (
|
||||
blockLocMaterialEntry.getKey().x + xOffset) + ',' + blockLocMaterialEntry
|
||||
.getKey().y + ',' + (blockLocMaterialEntry.getKey().z + zOffset));
|
||||
}
|
||||
@ -853,12 +853,12 @@ public class BukkitChunkManager extends ChunkManager {
|
||||
((Skull) state).setSkullType((SkullType) data[3]);
|
||||
state.update(true);
|
||||
} else {
|
||||
PS.debug("&c[WARN] Plot clear failed to restore skull: " + (
|
||||
PlotSquared.debug("&c[WARN] Plot clear failed to restore skull: " + (
|
||||
blockLocEntry.getKey().x + xOffset) + ',' + blockLocEntry.getKey().y
|
||||
+ ',' + (blockLocEntry.getKey().z + zOffset));
|
||||
}
|
||||
} catch (Exception e) {
|
||||
PS.debug("&c[WARN] Plot clear failed to regenerate skull (e): " + (
|
||||
PlotSquared.debug("&c[WARN] Plot clear failed to regenerate skull (e): " + (
|
||||
blockLocEntry.getKey().x + xOffset) + ',' + blockLocEntry.getKey().y + ','
|
||||
+ (blockLocEntry.getKey().z + zOffset));
|
||||
e.printStackTrace();
|
||||
@ -875,12 +875,12 @@ public class BukkitChunkManager extends ChunkManager {
|
||||
.setContents(blockLocEntry.getValue());
|
||||
state.update(true);
|
||||
} else {
|
||||
PS.debug("&c[WARN] Plot clear failed to regenerate hopper: " + (
|
||||
PlotSquared.debug("&c[WARN] Plot clear failed to regenerate hopper: " + (
|
||||
blockLocEntry.getKey().x + xOffset) + ',' + blockLocEntry.getKey().y
|
||||
+ ',' + (blockLocEntry.getKey().z + zOffset));
|
||||
}
|
||||
} catch (IllegalArgumentException ignored) {
|
||||
PS.debug("&c[WARN] Plot clear failed to regenerate hopper (e): " + (
|
||||
PlotSquared.debug("&c[WARN] Plot clear failed to regenerate hopper (e): " + (
|
||||
blockLocEntry.getKey().x + xOffset) + ',' + blockLocEntry.getKey().y + ','
|
||||
+ (blockLocEntry.getKey().z + zOffset));
|
||||
}
|
||||
@ -894,12 +894,12 @@ public class BukkitChunkManager extends ChunkManager {
|
||||
((NoteBlock) state).setNote(blockLocNoteEntry.getValue());
|
||||
state.update(true);
|
||||
} else {
|
||||
PS.debug("&c[WARN] Plot clear failed to regenerate note block: " + (
|
||||
PlotSquared.debug("&c[WARN] Plot clear failed to regenerate note block: " + (
|
||||
blockLocNoteEntry.getKey().x + xOffset) + ',' + blockLocNoteEntry
|
||||
.getKey().y + ',' + (blockLocNoteEntry.getKey().z + zOffset));
|
||||
}
|
||||
} catch (Exception ignored) {
|
||||
PS.debug("&c[WARN] Plot clear failed to regenerate note block (e): " + (
|
||||
PlotSquared.debug("&c[WARN] Plot clear failed to regenerate note block (e): " + (
|
||||
blockLocNoteEntry.getKey().x + xOffset) + ',' + blockLocNoteEntry.getKey().y
|
||||
+ ',' + (blockLocNoteEntry.getKey().z + zOffset));
|
||||
}
|
||||
@ -912,12 +912,14 @@ public class BukkitChunkManager extends ChunkManager {
|
||||
if (state instanceof BrewingStand) {
|
||||
((BrewingStand) state).setBrewingTime(blockLocShortEntry.getValue());
|
||||
} else {
|
||||
PS.debug("&c[WARN] Plot clear failed to restore brewing stand cooking: " + (
|
||||
PlotSquared
|
||||
.debug("&c[WARN] Plot clear failed to restore brewing stand cooking: " + (
|
||||
blockLocShortEntry.getKey().x + xOffset) + ',' + blockLocShortEntry
|
||||
.getKey().y + ',' + (blockLocShortEntry.getKey().z + zOffset));
|
||||
}
|
||||
} catch (Exception ignored) {
|
||||
PS.debug("&c[WARN] Plot clear failed to restore brewing stand cooking (e): " + (
|
||||
PlotSquared
|
||||
.debug("&c[WARN] Plot clear failed to restore brewing stand cooking (e): " + (
|
||||
blockLocShortEntry.getKey().x + xOffset) + ',' + blockLocShortEntry
|
||||
.getKey().y + ',' + (blockLocShortEntry.getKey().z + zOffset));
|
||||
}
|
||||
@ -934,13 +936,13 @@ public class BukkitChunkManager extends ChunkManager {
|
||||
.setSpawnedType(blockLocEntityTypeEntry.getValue());
|
||||
state.update(true);
|
||||
} else {
|
||||
PS.debug("&c[WARN] Plot clear failed to restore spawner type: " + (
|
||||
PlotSquared.debug("&c[WARN] Plot clear failed to restore spawner type: " + (
|
||||
blockLocEntityTypeEntry.getKey().x + xOffset) + ','
|
||||
+ blockLocEntityTypeEntry.getKey().y + ',' + (
|
||||
blockLocEntityTypeEntry.getKey().z + zOffset));
|
||||
}
|
||||
} catch (Exception ignored) {
|
||||
PS.debug("&c[WARN] Plot clear failed to restore spawner type (e): " + (
|
||||
PlotSquared.debug("&c[WARN] Plot clear failed to restore spawner type (e): " + (
|
||||
blockLocEntityTypeEntry.getKey().x + xOffset) + ','
|
||||
+ blockLocEntityTypeEntry.getKey().y + ',' + (
|
||||
blockLocEntityTypeEntry.getKey().z + zOffset));
|
||||
@ -955,12 +957,12 @@ public class BukkitChunkManager extends ChunkManager {
|
||||
((CommandBlock) state).setCommand(blockLocStringEntry.getValue());
|
||||
state.update(true);
|
||||
} else {
|
||||
PS.debug("&c[WARN] Plot clear failed to restore command block: " + (
|
||||
PlotSquared.debug("&c[WARN] Plot clear failed to restore command block: " + (
|
||||
blockLocStringEntry.getKey().x + xOffset) + ',' + blockLocStringEntry
|
||||
.getKey().y + ',' + (blockLocStringEntry.getKey().z + zOffset));
|
||||
}
|
||||
} catch (Exception ignored) {
|
||||
PS.debug("&c[WARN] Plot clear failed to restore command block (e): " + (
|
||||
PlotSquared.debug("&c[WARN] Plot clear failed to restore command block (e): " + (
|
||||
blockLocStringEntry.getKey().x + xOffset) + ',' + blockLocStringEntry
|
||||
.getKey().y + ',' + (blockLocStringEntry.getKey().z + zOffset));
|
||||
}
|
||||
@ -977,12 +979,14 @@ public class BukkitChunkManager extends ChunkManager {
|
||||
.setContents(blockLocEntry.getValue());
|
||||
state.update(true);
|
||||
} else {
|
||||
PS.debug("&c[WARN] Plot clear failed to regenerate brewing stand: " + (
|
||||
PlotSquared
|
||||
.debug("&c[WARN] Plot clear failed to regenerate brewing stand: " + (
|
||||
blockLocEntry.getKey().x + xOffset) + ',' + blockLocEntry.getKey().y
|
||||
+ ',' + (blockLocEntry.getKey().z + zOffset));
|
||||
}
|
||||
} catch (IllegalArgumentException ignored) {
|
||||
PS.debug("&c[WARN] Plot clear failed to regenerate brewing stand (e): " + (
|
||||
PlotSquared
|
||||
.debug("&c[WARN] Plot clear failed to regenerate brewing stand (e): " + (
|
||||
blockLocEntry.getKey().x + xOffset) + ',' + blockLocEntry.getKey().y + ','
|
||||
+ (blockLocEntry.getKey().z + zOffset));
|
||||
}
|
||||
@ -998,12 +1002,14 @@ public class BukkitChunkManager extends ChunkManager {
|
||||
((Furnace) state).setBurnTime(time[0]);
|
||||
((Furnace) state).setCookTime(time[1]);
|
||||
} else {
|
||||
PS.debug("&c[WARN] Plot clear failed to restore furnace cooking: " + (
|
||||
PlotSquared
|
||||
.debug("&c[WARN] Plot clear failed to restore furnace cooking: " + (
|
||||
blockLocEntry.getKey().x + xOffset) + ',' + blockLocEntry.getKey().y
|
||||
+ ',' + (blockLocEntry.getKey().z + zOffset));
|
||||
}
|
||||
} catch (Exception ignored) {
|
||||
PS.debug("&c[WARN] Plot clear failed to restore furnace cooking (e): " + (
|
||||
PlotSquared
|
||||
.debug("&c[WARN] Plot clear failed to restore furnace cooking (e): " + (
|
||||
blockLocEntry.getKey().x + xOffset) + ',' + blockLocEntry.getKey().y + ','
|
||||
+ (blockLocEntry.getKey().z + zOffset));
|
||||
}
|
||||
@ -1019,12 +1025,12 @@ public class BukkitChunkManager extends ChunkManager {
|
||||
.setContents(blockLocEntry.getValue());
|
||||
state.update(true);
|
||||
} else {
|
||||
PS.debug("&c[WARN] Plot clear failed to regenerate furnace: " + (
|
||||
PlotSquared.debug("&c[WARN] Plot clear failed to regenerate furnace: " + (
|
||||
blockLocEntry.getKey().x + xOffset) + ',' + blockLocEntry.getKey().y
|
||||
+ ',' + (blockLocEntry.getKey().z + zOffset));
|
||||
}
|
||||
} catch (IllegalArgumentException ignored) {
|
||||
PS.debug("&c[WARN] Plot clear failed to regenerate furnace (e): " + (
|
||||
PlotSquared.debug("&c[WARN] Plot clear failed to regenerate furnace (e): " + (
|
||||
blockLocEntry.getKey().x + xOffset) + ',' + blockLocEntry.getKey().y + ','
|
||||
+ (blockLocEntry.getKey().z + zOffset));
|
||||
}
|
||||
@ -1043,12 +1049,12 @@ public class BukkitChunkManager extends ChunkManager {
|
||||
banner.setPatterns(patterns);
|
||||
state.update(true);
|
||||
} else {
|
||||
PS.debug("&c[WARN] Plot clear failed to regenerate banner: " + (
|
||||
PlotSquared.debug("&c[WARN] Plot clear failed to regenerate banner: " + (
|
||||
blockLocByteEntry.getKey().x + xOffset) + ',' + blockLocByteEntry
|
||||
.getKey().y + ',' + (blockLocByteEntry.getKey().z + zOffset));
|
||||
}
|
||||
} catch (Exception ignored) {
|
||||
PS.debug("&c[WARN] Plot clear failed to regenerate banner (e): " + (
|
||||
PlotSquared.debug("&c[WARN] Plot clear failed to regenerate banner (e): " + (
|
||||
blockLocByteEntry.getKey().x + xOffset) + ',' + blockLocByteEntry.getKey().y
|
||||
+ ',' + (blockLocByteEntry.getKey().z + zOffset));
|
||||
}
|
||||
@ -1155,9 +1161,9 @@ public class BukkitChunkManager extends ChunkManager {
|
||||
|
||||
}
|
||||
} catch (Exception e) {
|
||||
PS.debug("------------ FAILED TO DO SOMETHING --------");
|
||||
PlotSquared.debug("------------ FAILED TO DO SOMETHING --------");
|
||||
e.printStackTrace();
|
||||
PS.debug("------------ but we caught it ^ --------");
|
||||
PlotSquared.debug("------------ but we caught it ^ --------");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -3,7 +3,7 @@ package com.github.intellectualsites.plotsquared.bukkit.util;
|
||||
import com.github.intellectualsites.plotsquared.bukkit.generator.BukkitPlotGenerator;
|
||||
import com.github.intellectualsites.plotsquared.configuration.ConfigurationSection;
|
||||
import com.github.intellectualsites.plotsquared.configuration.file.YamlConfiguration;
|
||||
import com.github.intellectualsites.plotsquared.plot.PS;
|
||||
import com.github.intellectualsites.plotsquared.plot.PlotSquared;
|
||||
import com.github.intellectualsites.plotsquared.plot.config.ConfigurationNode;
|
||||
import com.github.intellectualsites.plotsquared.plot.generator.GeneratorWrapper;
|
||||
import com.github.intellectualsites.plotsquared.plot.object.PlotArea;
|
||||
@ -33,7 +33,7 @@ public class BukkitSetupUtils extends SetupUtils {
|
||||
if (plugin.isEnabled()) {
|
||||
ChunkGenerator generator = plugin.getDefaultWorldGenerator(testWorld, "");
|
||||
if (generator != null) {
|
||||
PS.get().removePlotAreas(testWorld);
|
||||
PlotSquared.get().removePlotAreas(testWorld);
|
||||
String name = plugin.getDescription().getName();
|
||||
GeneratorWrapper<?> wrapped;
|
||||
if (generator instanceof GeneratorWrapper<?>) {
|
||||
@ -80,11 +80,11 @@ public class BukkitSetupUtils extends SetupUtils {
|
||||
switch (type) {
|
||||
case 2: {
|
||||
if (object.id != null) {
|
||||
if (!PS.get().worlds.contains(worldPath)) {
|
||||
PS.get().worlds.createSection(worldPath);
|
||||
if (!PlotSquared.get().worlds.contains(worldPath)) {
|
||||
PlotSquared.get().worlds.createSection(worldPath);
|
||||
}
|
||||
ConfigurationSection worldSection =
|
||||
PS.get().worlds.getConfigurationSection(worldPath);
|
||||
PlotSquared.get().worlds.getConfigurationSection(worldPath);
|
||||
String areaName = object.id + "-" + object.min + "-" + object.max;
|
||||
String areaPath = "areas." + areaName;
|
||||
if (!worldSection.contains(areaPath)) {
|
||||
@ -123,20 +123,20 @@ public class BukkitSetupUtils extends SetupUtils {
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
if (!PS.get().worlds.contains(worldPath)) {
|
||||
PS.get().worlds.createSection(worldPath);
|
||||
if (!PlotSquared.get().worlds.contains(worldPath)) {
|
||||
PlotSquared.get().worlds.createSection(worldPath);
|
||||
}
|
||||
ConfigurationSection worldSection =
|
||||
PS.get().worlds.getConfigurationSection(worldPath);
|
||||
PlotSquared.get().worlds.getConfigurationSection(worldPath);
|
||||
for (ConfigurationNode step : steps) {
|
||||
worldSection.set(step.getConstant(), step.getValue());
|
||||
}
|
||||
PS.get().worlds.set("worlds." + world + ".generator.type", object.type);
|
||||
PS.get().worlds.set("worlds." + world + ".generator.terrain", object.terrain);
|
||||
PS.get().worlds.set("worlds." + world + ".generator.plugin", object.plotManager);
|
||||
PlotSquared.get().worlds.set("worlds." + world + ".generator.type", object.type);
|
||||
PlotSquared.get().worlds.set("worlds." + world + ".generator.terrain", object.terrain);
|
||||
PlotSquared.get().worlds.set("worlds." + world + ".generator.plugin", object.plotManager);
|
||||
if (object.setupGenerator != null && !object.setupGenerator
|
||||
.equals(object.plotManager)) {
|
||||
PS.get().worlds
|
||||
PlotSquared.get().worlds
|
||||
.set("worlds." + world + ".generator.init", object.setupGenerator);
|
||||
}
|
||||
GeneratorWrapper<?> gen = SetupUtils.generators.get(object.setupGenerator);
|
||||
@ -147,11 +147,11 @@ public class BukkitSetupUtils extends SetupUtils {
|
||||
}
|
||||
case 0: {
|
||||
if (steps.length != 0) {
|
||||
if (!PS.get().worlds.contains(worldPath)) {
|
||||
PS.get().worlds.createSection(worldPath);
|
||||
if (!PlotSquared.get().worlds.contains(worldPath)) {
|
||||
PlotSquared.get().worlds.createSection(worldPath);
|
||||
}
|
||||
ConfigurationSection worldSection =
|
||||
PS.get().worlds.getConfigurationSection(worldPath);
|
||||
PlotSquared.get().worlds.getConfigurationSection(worldPath);
|
||||
for (ConfigurationNode step : steps) {
|
||||
worldSection.set(step.getConstant(), step.getValue());
|
||||
}
|
||||
@ -160,7 +160,7 @@ public class BukkitSetupUtils extends SetupUtils {
|
||||
}
|
||||
}
|
||||
try {
|
||||
PS.get().worlds.save(PS.get().worldsFile);
|
||||
PlotSquared.get().worlds.save(PlotSquared.get().worldsFile);
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
package com.github.intellectualsites.plotsquared.bukkit.util;
|
||||
|
||||
import com.github.intellectualsites.plotsquared.bukkit.object.BukkitPlayer;
|
||||
import com.github.intellectualsites.plotsquared.plot.PS;
|
||||
import com.github.intellectualsites.plotsquared.plot.PlotSquared;
|
||||
import com.github.intellectualsites.plotsquared.plot.object.ChunkLoc;
|
||||
import com.github.intellectualsites.plotsquared.plot.object.Location;
|
||||
import com.github.intellectualsites.plotsquared.plot.object.Plot;
|
||||
@ -50,7 +50,7 @@ public class SendChunk {
|
||||
RefClass classChunk = getRefClass("{nms}.Chunk");
|
||||
this.methodInitLighting = classChunk.getMethod("initLighting");
|
||||
RefClass classMapChunk = getRefClass("{nms}.PacketPlayOutMapChunk");
|
||||
if (PS.get().checkVersion(PS.get().IMP.getServerVersion(), BukkitVersion.v1_9_4)) {
|
||||
if (PlotSquared.get().checkVersion(PlotSquared.get().IMP.getServerVersion(), BukkitVersion.v1_9_4)) {
|
||||
//this works for 1.9.4 and 1.10
|
||||
tempMapChunk = classMapChunk.getConstructor(classChunk.getRealClass(), int.class);
|
||||
} else {
|
||||
@ -118,7 +118,8 @@ public class SendChunk {
|
||||
chunks.remove(chunk);
|
||||
Object con = this.connection.of(entity).get();
|
||||
Object packet = null;
|
||||
if (PS.get().checkVersion(PS.get().IMP.getServerVersion(), BukkitVersion.v1_9_4)) {
|
||||
if (PlotSquared
|
||||
.get().checkVersion(PlotSquared.get().IMP.getServerVersion(), BukkitVersion.v1_9_4)) {
|
||||
try {
|
||||
packet = this.mapChunk.create(c, 65535);
|
||||
} catch (Exception ignored) {
|
||||
@ -135,7 +136,7 @@ public class SendChunk {
|
||||
}
|
||||
}
|
||||
if (packet == null) {
|
||||
PS.debug("Error with PacketPlayOutMapChunk reflection.");
|
||||
PlotSquared.debug("Error with PacketPlayOutMapChunk reflection.");
|
||||
}
|
||||
this.send.of(con).call(packet);
|
||||
}
|
||||
@ -147,10 +148,11 @@ public class SendChunk {
|
||||
chunk.unload(true, false);
|
||||
} catch (Throwable ignored) {
|
||||
String worldName = chunk.getWorld().getName();
|
||||
PS.debug("$4Could not save chunk: " + worldName + ';' + chunk.getX() + ";"
|
||||
PlotSquared
|
||||
.debug("$4Could not save chunk: " + worldName + ';' + chunk.getX() + ";"
|
||||
+ chunk.getZ());
|
||||
PS.debug("$3 - $4File may be open in another process (e.g. MCEdit)");
|
||||
PS.debug("$3 - $4" + worldName + "/level.dat or " + worldName
|
||||
PlotSquared.debug("$3 - $4File may be open in another process (e.g. MCEdit)");
|
||||
PlotSquared.debug("$3 - $4" + worldName + "/level.dat or " + worldName
|
||||
+ "/level_old.dat may be corrupt (try repairing or removing these)");
|
||||
}
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
package com.github.intellectualsites.plotsquared.bukkit.util;
|
||||
|
||||
import com.github.intellectualsites.plotsquared.bukkit.generator.BukkitAugmentedGenerator;
|
||||
import com.github.intellectualsites.plotsquared.plot.PS;
|
||||
import com.github.intellectualsites.plotsquared.plot.PlotSquared;
|
||||
import com.github.intellectualsites.plotsquared.plot.generator.GeneratorWrapper;
|
||||
import com.github.intellectualsites.plotsquared.plot.util.SetupUtils;
|
||||
import org.bukkit.World;
|
||||
@ -16,7 +16,7 @@ public class SetGenCB {
|
||||
|
||||
public static void setGenerator(World world) throws Exception {
|
||||
SetupUtils.manager.updateGenerators();
|
||||
PS.get().removePlotAreas(world.getName());
|
||||
PlotSquared.get().removePlotAreas(world.getName());
|
||||
ChunkGenerator gen = world.getGenerator();
|
||||
if (gen == null) {
|
||||
return;
|
||||
@ -52,6 +52,6 @@ public class SetGenCB {
|
||||
}
|
||||
}
|
||||
}
|
||||
PS.get().loadWorld(world.getName(), PS.get().IMP.getGenerator(world.getName(), null));
|
||||
PlotSquared.get().loadWorld(world.getName(), PlotSquared.get().IMP.getGenerator(world.getName(), null));
|
||||
}
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
package com.github.intellectualsites.plotsquared.bukkit.uuid;
|
||||
|
||||
import com.github.intellectualsites.plotsquared.bukkit.util.NbtFactory;
|
||||
import com.github.intellectualsites.plotsquared.plot.PS;
|
||||
import com.github.intellectualsites.plotsquared.plot.PlotSquared;
|
||||
import com.github.intellectualsites.plotsquared.plot.config.C;
|
||||
import com.github.intellectualsites.plotsquared.plot.config.Settings;
|
||||
import com.github.intellectualsites.plotsquared.plot.object.OfflinePlotPlayer;
|
||||
@ -49,8 +49,8 @@ public class FileUUIDHandler extends UUIDHandlerImplementation {
|
||||
}
|
||||
TaskManager.runTaskAsync(new Runnable() {
|
||||
@Override public void run() {
|
||||
PS.debug(C.PREFIX + "&6Starting player data caching for: " + world);
|
||||
File uuidFile = new File(PS.get().IMP.getDirectory(), "uuids.txt");
|
||||
PlotSquared.debug(C.PREFIX + "&6Starting player data caching for: " + world);
|
||||
File uuidFile = new File(PlotSquared.get().IMP.getDirectory(), "uuids.txt");
|
||||
if (uuidFile.exists()) {
|
||||
try {
|
||||
List<String> lines =
|
||||
@ -85,7 +85,7 @@ public class FileUUIDHandler extends UUIDHandlerImplementation {
|
||||
HashBiMap.create(new HashMap<StringWrapper, UUID>());
|
||||
if (Settings.UUID.NATIVE_UUID_PROVIDER) {
|
||||
HashSet<UUID> all = UUIDHandler.getAllUUIDS();
|
||||
PS.debug("&aFast mode UUID caching enabled!");
|
||||
PlotSquared.debug("&aFast mode UUID caching enabled!");
|
||||
File playerDataFolder =
|
||||
new File(container, world + File.separator + "playerdata");
|
||||
String[] dat = playerDataFolder.list(new DatFileFilter());
|
||||
@ -101,7 +101,7 @@ public class FileUUIDHandler extends UUIDHandlerImplementation {
|
||||
.fromStream(new FileInputStream(file),
|
||||
NbtFactory.StreamOptions.GZIP_COMPRESSION);
|
||||
if (!compound.containsKey("bukkit")) {
|
||||
PS.debug("ERROR: Player data (" + uuid.toString()
|
||||
PlotSquared.debug("ERROR: Player data (" + uuid.toString()
|
||||
+ ".dat) does not contain the the key \"bukkit\"");
|
||||
} else {
|
||||
NbtFactory.NbtCompound bukkit =
|
||||
@ -118,7 +118,7 @@ public class FileUUIDHandler extends UUIDHandlerImplementation {
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
PS.debug(C.PREFIX + "Invalid playerdata: " + current);
|
||||
PlotSquared.debug(C.PREFIX + "Invalid playerdata: " + current);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -129,7 +129,7 @@ public class FileUUIDHandler extends UUIDHandlerImplementation {
|
||||
}
|
||||
return;
|
||||
} else {
|
||||
PS.debug("Failed to cache: " + all.size()
|
||||
PlotSquared.debug("Failed to cache: " + all.size()
|
||||
+ " uuids - slowly processing all files");
|
||||
}
|
||||
}
|
||||
@ -149,7 +149,7 @@ public class FileUUIDHandler extends UUIDHandlerImplementation {
|
||||
UUID uuid = UUID.fromString(s);
|
||||
uuids.add(uuid);
|
||||
} catch (Exception ignored) {
|
||||
PS.debug(C.PREFIX + "Invalid PlayerData: " + current);
|
||||
PlotSquared.debug(C.PREFIX + "Invalid PlayerData: " + current);
|
||||
}
|
||||
}
|
||||
break;
|
||||
@ -175,7 +175,7 @@ public class FileUUIDHandler extends UUIDHandlerImplementation {
|
||||
.fromStream(new FileInputStream(file),
|
||||
NbtFactory.StreamOptions.GZIP_COMPRESSION);
|
||||
if (!compound.containsKey("bukkit")) {
|
||||
PS.debug("ERROR: Player data (" + uuid.toString()
|
||||
PlotSquared.debug("ERROR: Player data (" + uuid.toString()
|
||||
+ ".dat) does not contain the the key \"bukkit\"");
|
||||
} else {
|
||||
NbtFactory.NbtCompound bukkit =
|
||||
@ -203,7 +203,7 @@ public class FileUUIDHandler extends UUIDHandlerImplementation {
|
||||
}
|
||||
}
|
||||
} catch (Exception ignored) {
|
||||
PS.debug(C.PREFIX + "&6Invalid PlayerData: " + uuid.toString() + ".dat");
|
||||
PlotSquared.debug(C.PREFIX + "&6Invalid PlayerData: " + uuid.toString() + ".dat");
|
||||
}
|
||||
}
|
||||
for (String name : names) {
|
||||
|
@ -1,7 +1,7 @@
|
||||
package com.github.intellectualsites.plotsquared.bukkit.uuid;
|
||||
|
||||
import com.github.intellectualsites.plotsquared.bukkit.object.BukkitOfflinePlayer;
|
||||
import com.github.intellectualsites.plotsquared.plot.PS;
|
||||
import com.github.intellectualsites.plotsquared.plot.PlotSquared;
|
||||
import com.github.intellectualsites.plotsquared.plot.object.OfflinePlotPlayer;
|
||||
import com.github.intellectualsites.plotsquared.plot.object.PlotPlayer;
|
||||
import com.github.intellectualsites.plotsquared.plot.object.StringWrapper;
|
||||
@ -82,7 +82,7 @@ public class OfflineUUIDWrapper extends UUIDWrapper {
|
||||
return p.toArray(new Player[p.size()]);
|
||||
}
|
||||
} catch (IllegalAccessException | InvocationTargetException | IllegalArgumentException ignored) {
|
||||
PS.debug("Failed to resolve online players");
|
||||
PlotSquared.debug("Failed to resolve online players");
|
||||
this.getOnline = null;
|
||||
Collection<? extends Player> onlinePlayers = Bukkit.getOnlinePlayers();
|
||||
return onlinePlayers.toArray(new Player[onlinePlayers.size()]);
|
||||
|
@ -1,6 +1,6 @@
|
||||
package com.github.intellectualsites.plotsquared.bukkit.uuid;
|
||||
|
||||
import com.github.intellectualsites.plotsquared.plot.PS;
|
||||
import com.github.intellectualsites.plotsquared.plot.PlotSquared;
|
||||
import com.github.intellectualsites.plotsquared.plot.config.C;
|
||||
import com.github.intellectualsites.plotsquared.plot.config.Settings;
|
||||
import com.github.intellectualsites.plotsquared.plot.database.SQLite;
|
||||
@ -43,7 +43,7 @@ public class SQLUUIDHandler extends UUIDHandlerImplementation {
|
||||
|
||||
public SQLUUIDHandler(UUIDWrapper wrapper) {
|
||||
super(wrapper);
|
||||
this.sqlite = new SQLite(MainUtil.getFile(PS.get().IMP.getDirectory(), "usercache.db"));
|
||||
this.sqlite = new SQLite(MainUtil.getFile(PlotSquared.get().IMP.getDirectory(), "usercache.db"));
|
||||
try {
|
||||
this.sqlite.openConnection();
|
||||
} catch (ClassNotFoundException | SQLException e) {
|
||||
@ -139,7 +139,7 @@ public class SQLUUIDHandler extends UUIDHandlerImplementation {
|
||||
connection.disconnect();
|
||||
}
|
||||
} catch (IOException | ParseException e) {
|
||||
PS.debug(
|
||||
PlotSquared.debug(
|
||||
"Invalid response from Mojang: Some UUIDs will be cached later. (`unknown` until then or player joins)");
|
||||
}
|
||||
try {
|
||||
@ -166,7 +166,7 @@ public class SQLUUIDHandler extends UUIDHandlerImplementation {
|
||||
}
|
||||
|
||||
@Override public void fetchUUID(final String name, final RunnableVal<UUID> ifFetch) {
|
||||
PS.debug(C.PREFIX + "UUID for '" + name
|
||||
PlotSquared.debug(C.PREFIX + "UUID for '" + name
|
||||
+ "' was null. We'll cache this from the Mojang servers!");
|
||||
if (ifFetch == null) {
|
||||
return;
|
||||
@ -221,7 +221,7 @@ public class SQLUUIDHandler extends UUIDHandlerImplementation {
|
||||
statement.setString(1, uuid.toString());
|
||||
statement.setString(2, name.toString());
|
||||
statement.execute();
|
||||
PS.debug(C.PREFIX + "&cAdded '&6" + uuid + "&c' - '&6" + name + "&c'");
|
||||
PlotSquared.debug(C.PREFIX + "&cAdded '&6" + uuid + "&c' - '&6" + name + "&c'");
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
@ -244,7 +244,8 @@ public class SQLUUIDHandler extends UUIDHandlerImplementation {
|
||||
statement.setString(1, name.value);
|
||||
statement.setString(2, uuid.toString());
|
||||
statement.execute();
|
||||
PS.debug(C.PREFIX + "Name change for '" + uuid + "' to '" + name.value + '\'');
|
||||
PlotSquared
|
||||
.debug(C.PREFIX + "Name change for '" + uuid + "' to '" + name.value + '\'');
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
Reference in New Issue
Block a user