From 439a1d440a6b6189b09187f36a8ee526a246b873 Mon Sep 17 00:00:00 2001 From: boy0001 Date: Fri, 20 Feb 2015 19:55:04 +1100 Subject: [PATCH] pw --- .../plot/PlotSquared.java | 4 +-- .../plot/commands/Auto.java | 4 +-- .../plot/commands/Buy.java | 2 +- .../plot/commands/Claim.java | 4 +-- .../plot/commands/Cluster.java | 2 +- .../plot/commands/CreateRoadSchematic.java | 2 +- .../plot/commands/DebugClaimTest.java | 2 +- .../plot/commands/DebugClear.java | 4 +-- .../plot/commands/DebugRoadRegen.java | 2 +- .../plot/commands/Delete.java | 2 +- .../plot/commands/Info.java | 2 +- .../plot/commands/Merge.java | 2 +- .../plot/commands/Reload.java | 2 +- .../plot/commands/Set.java | 2 +- .../plot/commands/Template.java | 2 +- .../plot/commands/Trim.java | 4 +-- .../plot/commands/Unclaim.java | 2 +- .../plot/commands/Unlink.java | 2 +- .../plot/flag/FlagManager.java | 4 +-- .../plot/generator/AugmentedPopulator.java | 2 +- .../plot/generator/HybridGen.java | 2 +- .../plot/generator/HybridPlotManager.java | 6 ++-- .../plot/listeners/PlayerEvents.java | 9 +++--- .../plot/listeners/PlotListener.java | 2 +- .../plot/object/PlotHologram.java | 2 +- .../plot/util/ClusterManager.java | 12 +++---- .../plot/util/ExpireManager.java | 2 +- .../plot/util/PlotHelper.java | 32 +++++++++---------- .../plot/util/bukkit/PlayerFunctions.java | 2 +- 29 files changed, 60 insertions(+), 61 deletions(-) diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/PlotSquared.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/PlotSquared.java index 17998101c..e158cf2db 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/PlotSquared.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/PlotSquared.java @@ -92,7 +92,7 @@ public class PlotSquared { plots.get(world).put(plot.id, plot); } - public static PlotWorld getWorldSettings(final String world) { + public static PlotWorld getPlotWorld(final String world) { if (plotworlds.containsKey(world)) { return plotworlds.get(world); } @@ -196,7 +196,7 @@ public class PlotSquared { } public static void loadWorld(final String world, final PlotGenerator generator) { - if (getWorldSettings(world) != null) { + if (getPlotWorld(world) != null) { return; } final Set worlds = (config.contains("worlds") ? config.getConfigurationSection("worlds").getKeys(false) : new HashSet()); diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Auto.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Auto.java index 8fdceb51d..582537c24 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Auto.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Auto.java @@ -133,7 +133,7 @@ public class Auto extends SubCommand { } return false; } - final PlotWorld pWorld = PlotSquared.getWorldSettings(world.getName()); + final PlotWorld pWorld = PlotSquared.getPlotWorld(world.getName()); if ((PlotSquared.economy != null) && pWorld.USE_ECONOMY) { double cost = pWorld.PLOT_PRICE; cost = (size_x * size_z) * cost; @@ -160,7 +160,7 @@ public class Auto extends SubCommand { // } } final String worldname = world.getName(); - final PlotWorld plotworld = PlotSquared.getWorldSettings(worldname); + final PlotWorld plotworld = PlotSquared.getPlotWorld(worldname); if (plotworld.TYPE == 2) { final Location loc = BukkitUtil.getLocation(plr); final Plot plot = PlotHelper.getCurrentPlot(new com.intellectualcrafters.plot.object.Location(worldname, loc.getBlockX(), loc.getBlockY(), loc.getBlockZ())); diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Buy.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Buy.java index c4d31f562..729214950 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Buy.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Buy.java @@ -87,7 +87,7 @@ public class Buy extends SubCommand { final PlotId id = plot.id; final PlotId id2 = PlayerFunctions.getTopPlot(world, plot).id; final int size = PlayerFunctions.getPlotSelectionIds(id, id2).size(); - final PlotWorld plotworld = PlotSquared.getWorldSettings(world); + final PlotWorld plotworld = PlotSquared.getPlotWorld(world); if (plotworld.USE_ECONOMY) { price += plotworld.PLOT_PRICE * size; initPrice += plotworld.SELL_PRICE * size; diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Claim.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Claim.java index 82ac5733c..8a10cacfc 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Claim.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Claim.java @@ -62,7 +62,7 @@ public class Claim extends SubCommand { PlotSquared.teleportPlayer(player, BukkitUtil.getLocation(entity), plot); } final World world = plot.world; - final PlotWorld plotworld = PlotSquared.getWorldSettings(world); + final PlotWorld plotworld = PlotSquared.getPlotWorld(world); final Plot plot2 = PlotSquared.getPlots(player.getWorld()).get(plot.id); if (plotworld.SCHEMATIC_ON_CLAIM) { SchematicHandler.Schematic sch; @@ -98,7 +98,7 @@ public class Claim extends SubCommand { if (plot.hasOwner()) { return sendMessage(plr, C.PLOT_IS_CLAIMED); } - final PlotWorld world = PlotSquared.getWorldSettings(plot.world); + final PlotWorld world = PlotSquared.getPlotWorld(plot.world); if (PlotSquared.useEconomy && world.USE_ECONOMY) { final double cost = world.PLOT_PRICE; if (cost > 0d) { diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Cluster.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Cluster.java index 7a5ee1227..4d9c3e25d 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Cluster.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Cluster.java @@ -176,7 +176,7 @@ public class Cluster extends SubCommand { return false; } } - final PlotWorld plotworld = PlotSquared.getWorldSettings(plr.getWorld()); + final PlotWorld plotworld = PlotSquared.getPlotWorld(plr.getWorld()); if (plotworld.TYPE == 2) { final ArrayList toRemove = new ArrayList<>(); for (final Plot plot : PlotSquared.getPlots(plr.getWorld()).values()) { diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/CreateRoadSchematic.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/CreateRoadSchematic.java index 24b37bf43..298bc09d6 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/CreateRoadSchematic.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/CreateRoadSchematic.java @@ -41,7 +41,7 @@ public class CreateRoadSchematic extends SubCommand { PlayerFunctions.sendMessage(player, C.NOT_IN_PLOT); return false; } - if (!(PlotSquared.getWorldSettings(player.getWorld()) instanceof HybridPlotWorld)) { + if (!(PlotSquared.getPlotWorld(player.getWorld()) instanceof HybridPlotWorld)) { return sendMessage(player, C.NOT_IN_PLOT_WORLD); } final Plot plot = PlayerFunctions.getCurrentPlot(player); diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/DebugClaimTest.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/DebugClaimTest.java index 1e061579f..efa51ca31 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/DebugClaimTest.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/DebugClaimTest.java @@ -94,7 +94,7 @@ public class DebugClaimTest extends SubCommand { PlayerFunctions.sendMessage(null, "&3Sign Block&8->&3PlotSquared&8: &7Beginning sign to plot conversion. This may take a while..."); PlayerFunctions.sendMessage(null, "&3Sign Block&8->&3PlotSquared&8: Found an excess of 250,000 chunks. Limiting search radius... (~3.8 min)"); final PlotManager manager = PlotSquared.getPlotManager(world); - final PlotWorld plotworld = PlotSquared.getWorldSettings(world); + final PlotWorld plotworld = PlotSquared.getPlotWorld(world); final ArrayList plots = new ArrayList<>(); for (final PlotId id : PlayerFunctions.getPlotSelectionIds(min, max)) { final Plot plot = PlotHelper.getPlot(world, id); diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/DebugClear.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/DebugClear.java index 214026a95..9fe93bd54 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/DebugClear.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/DebugClear.java @@ -53,7 +53,7 @@ public class DebugClear extends SubCommand { if (id == null) { PlotSquared.log("Invalid Plot ID: " + args[0]); } else { - if (!PlotSquared.isPlotWorld(world) || !(PlotSquared.getWorldSettings(world) instanceof SquarePlotWorld)) { + if (!PlotSquared.isPlotWorld(world) || !(PlotSquared.getPlotWorld(world) instanceof SquarePlotWorld)) { PlotSquared.log("Invalid plot world: " + world); } else { final Plot plot = PlotHelper.getPlot(Bukkit.getWorld(world), id); @@ -82,7 +82,7 @@ public class DebugClear extends SubCommand { } return true; } - if (!PlayerFunctions.isInPlot(plr) || !(PlotSquared.getWorldSettings(plr.getWorld()) instanceof SquarePlotWorld)) { + if (!PlayerFunctions.isInPlot(plr) || !(PlotSquared.getPlotWorld(plr.getWorld()) instanceof SquarePlotWorld)) { return sendMessage(plr, C.NOT_IN_PLOT); } final Plot plot = PlayerFunctions.getCurrentPlot(plr); diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/DebugRoadRegen.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/DebugRoadRegen.java index 7d0af13c3..44119ce2e 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/DebugRoadRegen.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/DebugRoadRegen.java @@ -39,7 +39,7 @@ public class DebugRoadRegen extends SubCommand { @Override public boolean execute(final Player player, final String... args) { - if (!(PlotSquared.getWorldSettings(player.getWorld()) instanceof HybridPlotWorld)) { + if (!(PlotSquared.getPlotWorld(player.getWorld()) instanceof HybridPlotWorld)) { return sendMessage(player, C.NOT_IN_PLOT_WORLD); } final HybridPlotManager manager = (HybridPlotManager) PlotSquared.getPlotManager(player.getWorld()); diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Delete.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Delete.java index 2fb966fa8..6083c60b7 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Delete.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Delete.java @@ -51,7 +51,7 @@ public class Delete extends SubCommand { return !sendMessage(plr, C.NO_PLOT_PERMS); } assert plot != null; - final PlotWorld pWorld = PlotSquared.getWorldSettings(plot.world); + final PlotWorld pWorld = PlotSquared.getPlotWorld(plot.world); if (PlotSquared.useEconomy && pWorld.USE_ECONOMY && (plot != null) && plot.hasOwner() && plot.getOwner().equals(UUIDHandler.getUUID(plr))) { final double c = pWorld.SELL_PRICE; if (c > 0d) { diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Info.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Info.java index 225f17c5a..239126d80 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Info.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Info.java @@ -71,7 +71,7 @@ public class Info extends SubCommand { PlayerFunctions.sendMessage(null, C.INFO_SYNTAX_CONSOLE); return false; } - final PlotWorld plotworld = PlotSquared.getWorldSettings(args[0]); + final PlotWorld plotworld = PlotSquared.getPlotWorld(args[0]); if (plotworld == null) { PlayerFunctions.sendMessage(player, C.NOT_VALID_WORLD); return false; diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Merge.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Merge.java index bc2432b4d..efe7ee710 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Merge.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Merge.java @@ -142,7 +142,7 @@ public class Merge extends SubCommand { return false; } } - final PlotWorld plotWorld = PlotSquared.getWorldSettings(world); + final PlotWorld plotWorld = PlotSquared.getPlotWorld(world); if (PlotSquared.useEconomy && plotWorld.USE_ECONOMY) { double cost = plotWorld.MERGE_PRICE; cost = plots.size() * cost; diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Reload.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Reload.java index 200e021d7..9e054c535 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Reload.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Reload.java @@ -41,7 +41,7 @@ public class Reload extends SubCommand { PlotSquared.setupConfig(); C.setupTranslations(); for (final String pw : PlotSquared.getPlotWorlds()) { - final PlotWorld plotworld = PlotSquared.getWorldSettings(pw); + final PlotWorld plotworld = PlotSquared.getPlotWorld(pw); plotworld.loadDefaultConfiguration(PlotSquared.config.getConfigurationSection("worlds." + pw)); } MainUtil.sendMessage(plr, C.RELOADED_CONFIGS); diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Set.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Set.java index 38625d8c8..b12466047 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Set.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Set.java @@ -237,7 +237,7 @@ public class Set extends SubCommand { } // Get components final World world = plr.getWorld(); - final PlotWorld plotworld = PlotSquared.getWorldSettings(world); + final PlotWorld plotworld = PlotSquared.getPlotWorld(world); final PlotManager manager = PlotSquared.getPlotManager(world); final String[] components = manager.getPlotComponents(world, plotworld, plot.id); for (final String component : components) { diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Template.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Template.java index 607e395c3..6b9a4d344 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Template.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Template.java @@ -46,7 +46,7 @@ public class Template extends SubCommand { return false; } final World world = Bukkit.getWorld(args[1]); - final PlotWorld plotworld = PlotSquared.getWorldSettings(args[1]); + final PlotWorld plotworld = PlotSquared.getPlotWorld(args[1]); if ((world == null) || (plotworld == null)) { PlayerFunctions.sendMessage(plr, C.NOT_VALID_PLOT_WORLD); return false; diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Trim.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Trim.java index 0d27ccf08..80cf9a4e4 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Trim.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Trim.java @@ -90,7 +90,7 @@ public class Trim extends SubCommand { return false; } final World world = Bukkit.getWorld(args[1]); - if ((world == null) || (PlotSquared.getWorldSettings(world) == null)) { + if ((world == null) || (PlotSquared.getPlotWorld(world) == null)) { PlayerFunctions.sendMessage(plr, C.NOT_VALID_WORLD); return false; } @@ -209,7 +209,7 @@ public class Trim extends SubCommand { // public static void updateUnmodifiedPlots(final World world) { // final SquarePlotManager manager = (SquarePlotManager) PlotSquared.getPlotManager(world); - // final SquarePlotWorld plotworld = (SquarePlotWorld) PlotSquared.getWorldSettings(world); + // final SquarePlotWorld plotworld = (SquarePlotWorld) PlotSquared.getPlotWorld(world); // final ArrayList expired = new ArrayList<>(); // final Set plots = ExpireManager.getOldPlots(world.getName()).keySet(); // sendMessage("Checking " + plots.size() +" plots! This may take a long time..."); diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Unclaim.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Unclaim.java index 3ff765574..b11024293 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Unclaim.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Unclaim.java @@ -52,7 +52,7 @@ public class Unclaim extends SubCommand { return !sendMessage(plr, C.NO_PLOT_PERMS); } assert plot != null; - final PlotWorld pWorld = PlotSquared.getWorldSettings(plot.world); + final PlotWorld pWorld = PlotSquared.getPlotWorld(plot.world); if (PlotSquared.useEconomy && pWorld.USE_ECONOMY) { final double c = pWorld.SELL_PRICE; if (c > 0d) { diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Unlink.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Unlink.java index 2e9573215..6e70eabba 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Unlink.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Unlink.java @@ -91,7 +91,7 @@ public class Unlink extends SubCommand { return false; } final PlotManager manager = PlotSquared.getPlotManager(world); - final PlotWorld plotworld = PlotSquared.getWorldSettings(world); + final PlotWorld plotworld = PlotSquared.getPlotWorld(world); manager.startPlotUnlink(world, plotworld, ids); for (final PlotId id : ids) { final Plot myplot = PlotSquared.getPlots(world).get(id); diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/flag/FlagManager.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/flag/FlagManager.java index 060a84f55..00f2433ba 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/flag/FlagManager.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/flag/FlagManager.java @@ -80,7 +80,7 @@ public class FlagManager { if ((settings.flags != null) && (settings.flags.size() > 0)) { flags.addAll(settings.flags); } - final PlotWorld plotworld = PlotSquared.getWorldSettings(world); + final PlotWorld plotworld = PlotSquared.getPlotWorld(world); if ((plotworld != null) && (plotworld.DEFAULT_FLAGS != null) && (plotworld.DEFAULT_FLAGS.length > 0)) { flags.addAll(Arrays.asList(plotworld.DEFAULT_FLAGS)); } @@ -177,7 +177,7 @@ public class FlagManager { public static Set getSettingFlags(final String world, final PlotSettings settings) { final Set plotflags = settings.flags; - final PlotWorld plotworld = PlotSquared.getWorldSettings(world); + final PlotWorld plotworld = PlotSquared.getPlotWorld(world); if ((plotworld != null) && (plotworld.DEFAULT_FLAGS != null) && (plotworld.DEFAULT_FLAGS.length > 0)) { final HashSet flagStrings = new HashSet<>(); for (final Flag flag : plotflags) { diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/generator/AugmentedPopulator.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/generator/AugmentedPopulator.java index 88e272282..7a7b1769d 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/generator/AugmentedPopulator.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/generator/AugmentedPopulator.java @@ -52,7 +52,7 @@ public class AugmentedPopulator extends BlockPopulator { public AugmentedPopulator(final String world, final PlotGenerator generator, final PlotCluster cluster, final boolean p, final boolean b) { this.cluster = cluster; this.generator = generator; - this.plotworld = PlotSquared.getWorldSettings(world); + this.plotworld = PlotSquared.getPlotWorld(world); this.manager = generator.getPlotManager(); this.p = p; this.b = b; diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/generator/HybridGen.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/generator/HybridGen.java index 4675de0e6..ed144089a 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/generator/HybridGen.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/generator/HybridGen.java @@ -90,7 +90,7 @@ public class HybridGen extends PlotGenerator { public HybridGen(final String world) { super(world); if (this.plotworld == null) { - this.plotworld = (HybridPlotWorld) PlotSquared.getWorldSettings(world); + this.plotworld = (HybridPlotWorld) PlotSquared.getPlotWorld(world); } this.plotsize = this.plotworld.PLOT_WIDTH; this.pathsize = this.plotworld.ROAD_WIDTH; diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/generator/HybridPlotManager.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/generator/HybridPlotManager.java index 6556605cb..6f3531aa2 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/generator/HybridPlotManager.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/generator/HybridPlotManager.java @@ -60,7 +60,7 @@ public class HybridPlotManager extends ClassicPlotManager { final int botz = bottom.getBlockZ(); final int topx = top.getBlockX(); final int topz = top.getBlockZ(); - final HybridPlotWorld hpw = (HybridPlotWorld) PlotSquared.getWorldSettings(world); + final HybridPlotWorld hpw = (HybridPlotWorld) PlotSquared.getPlotWorld(world); final PlotBlock[] air = new PlotBlock[] { new PlotBlock((short) 0, (byte) 0) }; int changes = checkModified(requiredChanges, world, botx, topx, hpw.PLOT_HEIGHT, hpw.PLOT_HEIGHT, botz, topz, hpw.TOP_BLOCK); if (changes == -1) { @@ -111,7 +111,7 @@ public class HybridPlotManager extends ClassicPlotManager { final World world = Bukkit.getWorld(plot.world); final Location bot = PlotHelper.getPlotBottomLoc(world, plot.id); final Location top = PlotHelper.getPlotTopLoc(world, plot.id); - final HybridPlotWorld plotworld = (HybridPlotWorld) PlotSquared.getWorldSettings(world); + final HybridPlotWorld plotworld = (HybridPlotWorld) PlotSquared.getPlotWorld(world); final int sx = (bot.getBlockX() - plotworld.ROAD_WIDTH) + 1; final int sz = bot.getBlockZ() + 1; final int sy = plotworld.ROAD_HEIGHT; @@ -217,7 +217,7 @@ public class HybridPlotManager extends ClassicPlotManager { final int ez = z + 15; final Location bot = new Location(world, x, 0, z); final Location top = new Location(world, ex, 0, ez); - final HybridPlotWorld plotworld = (HybridPlotWorld) PlotSquared.getWorldSettings(world); + final HybridPlotWorld plotworld = (HybridPlotWorld) PlotSquared.getPlotWorld(world); if (!plotworld.ROAD_SCHEMATIC_ENABLED) { return false; } diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/listeners/PlayerEvents.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/listeners/PlayerEvents.java index 04c9a5d69..82519be36 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/listeners/PlayerEvents.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/listeners/PlayerEvents.java @@ -520,8 +520,7 @@ public class PlayerEvents extends com.intellectualcrafters.plot.listeners.PlotLi if (!isPlotWorld(world)) { return; } - final Player player = event.getPlayer(); - final Location loc = event.getClickedBlock().getLocation(); + final Location loc = BukkitUtil.getLocation(event.getClickedBlock().getLocation()); if (isInPlot(loc)) { final Plot plot = getCurrentPlot(loc); if (!plot.hasOwner()) { @@ -559,18 +558,18 @@ public class PlayerEvents extends com.intellectualcrafters.plot.listeners.PlotLi @EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true) public static void MobSpawn(final CreatureSpawnEvent event) { - final World world = event.getLocation().getWorld(); if (event.getEntity() instanceof Player) { return; } + Location loc = BukkitUtil.getLocation(event.getLocation()); + final String world = loc.getWorld(); if (!isPlotWorld(world)) { return; } - final Location loc = event.getLocation(); if (!isPlotArea(loc)) { return; } - final PlotWorld pW = getPlotWorld(world); + final PlotWorld pW = PlotSquared.getPlotWorld(world); final CreatureSpawnEvent.SpawnReason reason = event.getSpawnReason(); if ((reason == CreatureSpawnEvent.SpawnReason.SPAWNER_EGG) && pW.SPAWN_EGGS) { event.setCancelled(true); diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/listeners/PlotListener.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/listeners/PlotListener.java index a49f32473..64571a2c8 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/listeners/PlotListener.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/listeners/PlotListener.java @@ -78,7 +78,7 @@ public class PlotListener { } public static boolean isPlotArea(final Location location) { - final PlotWorld plotworld = PlotSquared.getWorldSettings(location.getWorld()); + final PlotWorld plotworld = PlotSquared.getPlotWorld(location.getWorld()); if (plotworld.TYPE == 2) { return ClusterManager.getCluster(location) != null; } diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/object/PlotHologram.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/object/PlotHologram.java index 1eab594d2..99953d5a0 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/object/PlotHologram.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/object/PlotHologram.java @@ -25,7 +25,7 @@ // public PlotHologram(final String world, final PlotId id) { // this.id = id; // this.world = world; -// this.hologram = createHologram(PlotSquared.getPlotManager(world).getSignLoc(Bukkit.getWorld(world), PlotSquared.getWorldSettings(world), PlotHelper.getPlot(Bukkit.getWorld(world), id))); +// this.hologram = createHologram(PlotSquared.getPlotManager(world).getSignLoc(Bukkit.getWorld(world), PlotSquared.getPlotWorld(world), PlotHelper.getPlot(Bukkit.getWorld(world), id))); // } // // public static Hologram createHologram(final org.bukkit.Location location) { diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/ClusterManager.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/ClusterManager.java index 62eea59bd..46d3ee806 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/ClusterManager.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/ClusterManager.java @@ -60,7 +60,7 @@ public class ClusterManager { toReturn = PlotHelper.getPlotHome(cluster.world, center); if (toReturn.getY() == 0) { final PlotManager manager = PlotSquared.getPlotManager(cluster.world); - final PlotWorld plotworld = PlotSquared.getWorldSettings(cluster.world); + final PlotWorld plotworld = PlotSquared.getPlotWorld(cluster.world); final Location loc = manager.getSignLoc(plotworld, PlotHelper.getPlot(cluster.world, center)); toReturn.setY(loc.getY()); } @@ -82,14 +82,14 @@ public class ClusterManager { public static Location getClusterBottom(final PlotCluster cluster) { final String world = cluster.world; - final PlotWorld plotworld = PlotSquared.getWorldSettings(world); + final PlotWorld plotworld = PlotSquared.getPlotWorld(world); final PlotManager manager = PlotSquared.getPlotManager(world); return manager.getPlotBottomLocAbs(plotworld, cluster.getP1()); } public static Location getClusterTop(final PlotCluster cluster) { final String world = cluster.world; - final PlotWorld plotworld = PlotSquared.getWorldSettings(world); + final PlotWorld plotworld = PlotSquared.getPlotWorld(world); final PlotManager manager = PlotSquared.getPlotManager(world); return manager.getPlotTopLocAbs(plotworld, cluster.getP2()); } @@ -109,7 +109,7 @@ public class ClusterManager { public static boolean contains(final PlotCluster cluster, final Location loc) { final String world = loc.getWorld(); final PlotManager manager = PlotSquared.getPlotManager(world); - final PlotWorld plotworld = PlotSquared.getWorldSettings(world); + final PlotWorld plotworld = PlotSquared.getPlotWorld(world); final Location bot = manager.getPlotBottomLocAbs(plotworld, cluster.getP1()); final Location top = manager.getPlotTopLocAbs(plotworld, cluster.getP2()).add(1, 0, 1); if ((bot.getX() < loc.getX()) && (bot.getZ() < loc.getZ()) && (top.getX() > loc.getX()) && (top.getZ() > loc.getZ())) { @@ -221,7 +221,7 @@ public class ClusterManager { int xw; int zw; final String world = loc.getWorld(); - final PlotWorld plotworld = PlotSquared.getWorldSettings(world); + final PlotWorld plotworld = PlotSquared.getPlotWorld(world); if (plotworld == null) { xw = 39; zw = 39; @@ -246,7 +246,7 @@ public class ClusterManager { int i = 0; final Random rand = new Random(); final World world = Bukkit.getWorld(cluster.world); - final PlotWorld plotworld = PlotSquared.getWorldSettings(cluster.world); + final PlotWorld plotworld = PlotSquared.getPlotWorld(cluster.world); final Location bot = getClusterBottom(cluster); final Location top = getClusterTop(cluster); final int minChunkX = bot.getX() >> 4; diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/ExpireManager.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/ExpireManager.java index 3e57ce1e4..e1ac03167 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/ExpireManager.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/ExpireManager.java @@ -111,7 +111,7 @@ public class ExpireManager { if (plot.settings.isMerged()) { Unlink.unlinkPlot(Bukkit.getWorld(world), plot); } - final PlotWorld plotworld = PlotSquared.getWorldSettings(world); + final PlotWorld plotworld = PlotSquared.getPlotWorld(world); manager.clearPlot(plotworld, plot, false, null); PlotHelper.removeSign(plot); DBFunc.delete(world, plot); diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/PlotHelper.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/PlotHelper.java index 88d2fac5e..0346e5731 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/PlotHelper.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/PlotHelper.java @@ -55,14 +55,14 @@ public class PlotHelper { public static int getBorder(final String worldname) { if (worldBorder.containsKey(worldname)) { - PlotSquared.getWorldSettings(worldname); + PlotSquared.getPlotWorld(worldname); return worldBorder.get(worldname) + 16; } return Integer.MAX_VALUE; } public static void setupBorder(final String world) { - final PlotWorld plotworld = PlotSquared.getWorldSettings(world); + final PlotWorld plotworld = PlotSquared.getPlotWorld(world); if (!plotworld.WORLD_BORDER) { return; } @@ -149,7 +149,7 @@ public class PlotHelper { final PlotId pos1 = plotIds.get(0); final PlotId pos2 = plotIds.get(plotIds.size() - 1); final PlotManager manager = PlotSquared.getPlotManager(world); - final PlotWorld plotworld = PlotSquared.getWorldSettings(world); + final PlotWorld plotworld = PlotSquared.getPlotWorld(world); manager.startPlotMerge(plotworld, plotIds); final boolean result = false; for (int x = pos1.x; x <= pos2.x; x++) { @@ -208,7 +208,7 @@ public class PlotHelper { */ public static void mergePlot(final String world, final Plot lesserPlot, final Plot greaterPlot, final boolean removeRoads) { final PlotManager manager = PlotSquared.getPlotManager(world); - final PlotWorld plotworld = PlotSquared.getWorldSettings(world); + final PlotWorld plotworld = PlotSquared.getPlotWorld(world); if (lesserPlot.id.x.equals(greaterPlot.id.x)) { if (!lesserPlot.settings.getMerged(2)) { lesserPlot.settings.setMerged(2, true); @@ -231,7 +231,7 @@ public class PlotHelper { public static void removeSign(final Plot p) { final String world = p.world; final PlotManager manager = PlotSquared.getPlotManager(world); - final PlotWorld plotworld = PlotSquared.getWorldSettings(world); + final PlotWorld plotworld = PlotSquared.getPlotWorld(world); final Location loc = manager.getSignLoc(plotworld, p); BlockManager.setBlocks(world, new int[] { loc.getX() }, new int[] { loc.getY() }, new int[] { loc.getZ() }, new int[] { 0 }, new byte[] { 0 }); } @@ -241,7 +241,7 @@ public class PlotHelper { name = "unknown"; } final PlotManager manager = PlotSquared.getPlotManager(p.world); - final PlotWorld plotworld = PlotSquared.getWorldSettings(p.world); + final PlotWorld plotworld = PlotSquared.getPlotWorld(p.world); final Location loc = manager.getSignLoc(plotworld, p); final String id = p.id.x + ";" + p.id.y; final String[] lines = new String[] { C.OWNER_SIGN_LINE_1.translated().replaceAll("%id%", id), C.OWNER_SIGN_LINE_2.translated().replaceAll("%id%", id).replaceAll("%plr%", name), C.OWNER_SIGN_LINE_3.translated().replaceAll("%id%", id).replaceAll("%plr%", name), C.OWNER_SIGN_LINE_4.translated().replaceAll("%id%", id).replaceAll("%plr%", name) }; @@ -338,7 +338,7 @@ public class PlotHelper { } final String world = plot.world; final PlotManager manager = PlotSquared.getPlotManager(world); - final PlotWorld plotworld = PlotSquared.getWorldSettings(world); + final PlotWorld plotworld = PlotSquared.getPlotWorld(world); final Location bot = manager.getPlotBottomLocAbs(plotworld, plot.id); final Location top = manager.getPlotTopLocAbs(plotworld, plot.id); final int border = worldBorder.get(plot.world); @@ -358,7 +358,7 @@ public class PlotHelper { updateWorldBorder(plot); } final Plot p = createPlotAbs(uuid, plot); - final PlotWorld plotworld = PlotSquared.getWorldSettings(plot.world); + final PlotWorld plotworld = PlotSquared.getPlotWorld(plot.world); if (plotworld.AUTO_MERGE) { autoMerge(plot.world, p, uuid); } @@ -418,7 +418,7 @@ public class PlotHelper { state = h; System.currentTimeMillis(); final Location location = PlotHelper.getPlotHomeDefault(plot); - final PlotWorld plotworld = PlotSquared.getWorldSettings(world); + final PlotWorld plotworld = PlotSquared.getPlotWorld(world); runners.put(plot, 1); if (plotworld.TERRAIN != 0) { final Location pos2 = PlotHelper.getPlotTopLoc(world, plot.id); @@ -538,7 +538,7 @@ public class PlotHelper { final Location top = getPlotTopLoc(w, plotid); final int x = ((top.getX() - bot.getX()) / 2) + bot.getX(); final int z = ((top.getZ() - bot.getZ()) / 2) + bot.getZ(); - final int y = Math.max(getHeighestBlock(w, x, z), manager.getSignLoc(PlotSquared.getWorldSettings(w), plot).getY()); + final int y = Math.max(getHeighestBlock(w, x, z), manager.getSignLoc(PlotSquared.getPlotWorld(w), plot).getY()); return new Location(w, x, y, z); } else { final int y = Math.max(getHeighestBlock(w, home.x, home.z), home.y); @@ -621,7 +621,7 @@ public class PlotHelper { * @return */ public static Location getPlotTopLocAbs(final String world, final PlotId id) { - final PlotWorld plotworld = PlotSquared.getWorldSettings(world); + final PlotWorld plotworld = PlotSquared.getPlotWorld(world); final PlotManager manager = PlotSquared.getPlotManager(world); return manager.getPlotTopLocAbs(plotworld, id); } @@ -636,7 +636,7 @@ public class PlotHelper { * @return */ public static Location getPlotBottomLocAbs(final String world, final PlotId id) { - final PlotWorld plotworld = PlotSquared.getWorldSettings(world); + final PlotWorld plotworld = PlotSquared.getPlotWorld(world); final PlotManager manager = PlotSquared.getPlotManager(world); return manager.getPlotBottomLocAbs(plotworld, id); } @@ -667,7 +667,7 @@ public class PlotHelper { if (plot != null) { id = getTopPlot(world, plot).id; } - final PlotWorld plotworld = PlotSquared.getWorldSettings(world); + final PlotWorld plotworld = PlotSquared.getPlotWorld(world); final PlotManager manager = PlotSquared.getPlotManager(world); return manager.getPlotTopLocAbs(plotworld, id); } @@ -686,7 +686,7 @@ public class PlotHelper { if (plot != null) { id = getBottomPlot(world, plot).id; } - final PlotWorld plotworld = PlotSquared.getWorldSettings(world); + final PlotWorld plotworld = PlotSquared.getPlotWorld(world); final PlotManager manager = PlotSquared.getPlotManager(world); return manager.getPlotBottomLocAbs(plotworld, id); } @@ -804,7 +804,7 @@ public class PlotHelper { if (manager == null) { return null; } - final PlotWorld plotworld = PlotSquared.getWorldSettings(world); + final PlotWorld plotworld = PlotSquared.getPlotWorld(world); return manager.getPlotIdAbs(plotworld, loc.getX(), loc.getY(), loc.getZ()); } @@ -819,7 +819,7 @@ public class PlotHelper { if (manager == null) { return null; } - final PlotWorld plotworld = PlotSquared.getWorldSettings(world); + final PlotWorld plotworld = PlotSquared.getPlotWorld(world); final PlotId id = manager.getPlotId(plotworld, loc.getX(), loc.getY(), loc.getZ()); if ((id != null) && (plotworld.TYPE == 2)) { if (ClusterManager.getCluster(world, id) == null) { diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/bukkit/PlayerFunctions.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/bukkit/PlayerFunctions.java index e1807473f..c8746b7f6 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/bukkit/PlayerFunctions.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/bukkit/PlayerFunctions.java @@ -77,7 +77,7 @@ public class PlayerFunctions { * @return */ public static boolean mergePlots(final Player plr, final String world, final ArrayList plotIds) { - final PlotWorld plotworld = PlotSquared.getWorldSettings(world); + final PlotWorld plotworld = PlotSquared.getPlotWorld(world); if ((PlotSquared.economy != null) && plotworld.USE_ECONOMY) { final double cost = plotIds.size() * plotworld.MERGE_PRICE; if (cost > 0d) {