mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-30 00:56:45 +01:00
pw
This commit is contained in:
parent
0dc0b29ea7
commit
439a1d440a
@ -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<String> worlds = (config.contains("worlds") ? config.getConfigurationSection("worlds").getKeys(false) : new HashSet<String>());
|
||||
|
@ -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()));
|
||||
|
@ -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;
|
||||
|
@ -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) {
|
||||
|
@ -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<Plot> toRemove = new ArrayList<>();
|
||||
for (final Plot plot : PlotSquared.getPlots(plr.getWorld()).values()) {
|
||||
|
@ -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);
|
||||
|
@ -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<Plot> plots = new ArrayList<>();
|
||||
for (final PlotId id : PlayerFunctions.getPlotSelectionIds(min, max)) {
|
||||
final Plot plot = PlotHelper.getPlot(world, id);
|
||||
|
@ -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);
|
||||
|
@ -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());
|
||||
|
@ -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) {
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
|
@ -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) {
|
||||
|
@ -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;
|
||||
|
@ -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<Plot> expired = new ArrayList<>();
|
||||
// final Set<Plot> plots = ExpireManager.getOldPlots(world.getName()).keySet();
|
||||
// sendMessage("Checking " + plots.size() +" plots! This may take a long time...");
|
||||
|
@ -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) {
|
||||
|
@ -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);
|
||||
|
@ -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<Flag> getSettingFlags(final String world, final PlotSettings settings) {
|
||||
final Set<Flag> 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<String> flagStrings = new HashSet<>();
|
||||
for (final Flag flag : plotflags) {
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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) {
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
|
@ -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) {
|
||||
|
@ -77,7 +77,7 @@ public class PlayerFunctions {
|
||||
* @return
|
||||
*/
|
||||
public static boolean mergePlots(final Player plr, final String world, final ArrayList<PlotId> 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) {
|
||||
|
Loading…
Reference in New Issue
Block a user