mirror of
https://github.com/TotalFreedomMC/TF-PlotSquared.git
synced 2024-12-23 00:15:06 +00:00
Variable renaming
This commit is contained in:
parent
3e6b0b8394
commit
fd9e716ec4
28 changed files with 215 additions and 199 deletions
|
@ -85,10 +85,10 @@ import java.util.regex.Pattern;
|
|||
int distance = Bukkit.getViewDistance() * 16;
|
||||
for (Entry<String, PlotPlayer> entry : UUIDHandler.getPlayers().entrySet()) {
|
||||
PlotPlayer player = entry.getValue();
|
||||
Location loc = player.getLocation();
|
||||
if (loc.getWorld().equals(world)) {
|
||||
if (16 * Math.abs(loc.getX() - x) / 16 > distance
|
||||
|| 16 * Math.abs(loc.getZ() - z) / 16 > distance) {
|
||||
Location location = player.getLocation();
|
||||
if (location.getWorld().equals(world)) {
|
||||
if (16 * Math.abs(location.getX() - x) / 16 > distance
|
||||
|| 16 * Math.abs(location.getZ() - z) / 16 > distance) {
|
||||
continue;
|
||||
}
|
||||
((BukkitPlayer) player).player.sendBlockChange(bloc, data);
|
||||
|
@ -314,12 +314,12 @@ import java.util.regex.Pattern;
|
|||
case POWERED_RAIL:
|
||||
return;
|
||||
default:*/
|
||||
Location loc = BukkitUtil.getLocation(block.getLocation());
|
||||
PlotArea area = loc.getPlotArea();
|
||||
Location location = BukkitUtil.getLocation(block.getLocation());
|
||||
PlotArea area = location.getPlotArea();
|
||||
if (area == null) {
|
||||
return;
|
||||
}
|
||||
Plot plot = loc.getOwnedPlot();
|
||||
Plot plot = location.getOwnedPlot();
|
||||
if (plot == null) {
|
||||
return;
|
||||
}
|
||||
|
@ -369,12 +369,11 @@ import java.util.regex.Pattern;
|
|||
switch (event.getChangedType()) {
|
||||
case COMPARATOR: {
|
||||
Block block = event.getBlock();
|
||||
Location loc = BukkitUtil.getLocation(block.getLocation());
|
||||
PlotArea area = loc.getPlotArea();
|
||||
if (area == null) {
|
||||
Location location = BukkitUtil.getLocation(block.getLocation());
|
||||
if (location.isPlotArea()) {
|
||||
return;
|
||||
}
|
||||
Plot plot = area.getOwnedPlotAbs(loc);
|
||||
Plot plot = location.getOwnedPlotAbs();
|
||||
if (plot == null) {
|
||||
return;
|
||||
}
|
||||
|
@ -391,12 +390,12 @@ import java.util.regex.Pattern;
|
|||
case TURTLE_HELMET:
|
||||
case TURTLE_SPAWN_EGG: {
|
||||
Block block = event.getBlock();
|
||||
Location loc = BukkitUtil.getLocation(block.getLocation());
|
||||
PlotArea area = loc.getPlotArea();
|
||||
Location location = BukkitUtil.getLocation(block.getLocation());
|
||||
PlotArea area = location.getPlotArea();
|
||||
if (area == null) {
|
||||
return;
|
||||
}
|
||||
Plot plot = area.getOwnedPlotAbs(loc);
|
||||
Plot plot = area.getOwnedPlotAbs(location);
|
||||
if (plot == null) {
|
||||
return;
|
||||
}
|
||||
|
@ -413,30 +412,30 @@ import java.util.regex.Pattern;
|
|||
case STICKY_PISTON:
|
||||
org.bukkit.block.data.Directional piston =
|
||||
(org.bukkit.block.data.Directional) block.getBlockData();
|
||||
Location loc = BukkitUtil.getLocation(block.getLocation());
|
||||
PlotArea area = loc.getPlotArea();
|
||||
Location location = BukkitUtil.getLocation(block.getLocation());
|
||||
PlotArea area = location.getPlotArea();
|
||||
if (area == null) {
|
||||
return;
|
||||
}
|
||||
Plot plot = area.getOwnedPlotAbs(loc);
|
||||
Plot plot = area.getOwnedPlotAbs(location);
|
||||
if (plot == null) {
|
||||
return;
|
||||
}
|
||||
switch (piston.getFacing()) {
|
||||
case EAST:
|
||||
loc.setX(loc.getX() + 1);
|
||||
location.setX(location.getX() + 1);
|
||||
break;
|
||||
case SOUTH:
|
||||
loc.setX(loc.getX() - 1);
|
||||
location.setX(location.getX() - 1);
|
||||
break;
|
||||
case WEST:
|
||||
loc.setZ(loc.getZ() + 1);
|
||||
location.setZ(location.getZ() + 1);
|
||||
break;
|
||||
case NORTH:
|
||||
loc.setZ(loc.getZ() - 1);
|
||||
location.setZ(location.getZ() - 1);
|
||||
break;
|
||||
}
|
||||
Plot newPlot = area.getOwnedPlotAbs(loc);
|
||||
Plot newPlot = area.getOwnedPlotAbs(location);
|
||||
if (!plot.equals(newPlot)) {
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
|
@ -470,15 +469,15 @@ import java.util.regex.Pattern;
|
|||
|
||||
@EventHandler public boolean onProjectileHit(ProjectileHitEvent event) {
|
||||
Projectile entity = event.getEntity();
|
||||
Location loc = BukkitUtil.getLocation(entity);
|
||||
if (!PlotSquared.get().hasPlotArea(loc.getWorld())) {
|
||||
Location location = BukkitUtil.getLocation(entity);
|
||||
if (!PlotSquared.get().hasPlotArea(location.getWorld())) {
|
||||
return true;
|
||||
}
|
||||
PlotArea area = loc.getPlotArea();
|
||||
PlotArea area = location.getPlotArea();
|
||||
if (area == null) {
|
||||
return true;
|
||||
}
|
||||
Plot plot = area.getPlot(loc);
|
||||
Plot plot = area.getPlot(location);
|
||||
ProjectileSource shooter = entity.getShooter();
|
||||
if (shooter instanceof Player) {
|
||||
PlotPlayer pp = BukkitUtil.getPlayer((Player) shooter);
|
||||
|
@ -523,22 +522,22 @@ import java.util.regex.Pattern;
|
|||
return;
|
||||
}
|
||||
Player player = event.getPlayer();
|
||||
PlotPlayer pp = BukkitUtil.getPlayer(player);
|
||||
Location loc = pp.getLocation();
|
||||
PlotArea area = loc.getPlotArea();
|
||||
PlotPlayer plotPlayer = BukkitUtil.getPlayer(player);
|
||||
Location location = plotPlayer.getLocation();
|
||||
PlotArea area = location.getPlotArea();
|
||||
if (area == null) {
|
||||
return;
|
||||
}
|
||||
String[] parts = msg.split(" ");
|
||||
Plot plot = pp.getCurrentPlot();
|
||||
Plot plot = plotPlayer.getCurrentPlot();
|
||||
// Check WorldEdit
|
||||
switch (parts[0].toLowerCase()) {
|
||||
case "up":
|
||||
case "/up":
|
||||
case "worldedit:up":
|
||||
case "worldedit:/up":
|
||||
if (plot == null || (!plot.isAdded(pp.getUUID()) && !Permissions
|
||||
.hasPermission(pp, Captions.PERMISSION_ADMIN_BUILD_OTHER, true))) {
|
||||
if (plot == null || (!plot.isAdded(plotPlayer.getUUID()) && !Permissions
|
||||
.hasPermission(plotPlayer, Captions.PERMISSION_ADMIN_BUILD_OTHER, true))) {
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
|
@ -548,7 +547,7 @@ import java.util.regex.Pattern;
|
|||
}
|
||||
Optional<List<String>> flag = plot.getFlag(Flags.BLOCKED_CMDS);
|
||||
if (flag.isPresent() && !Permissions
|
||||
.hasPermission(pp, Captions.PERMISSION_ADMIN_INTERACT_BLOCKED_CMDS)) {
|
||||
.hasPermission(plotPlayer, Captions.PERMISSION_ADMIN_INTERACT_BLOCKED_CMDS)) {
|
||||
List<String> blocked_cmds = flag.get();
|
||||
String part = parts[0];
|
||||
if (parts[0].contains(":")) {
|
||||
|
@ -592,13 +591,13 @@ import java.util.regex.Pattern;
|
|||
}
|
||||
if (pattern.matcher(msg).matches()) {
|
||||
String perm;
|
||||
if (plot.isAdded(pp.getUUID())) {
|
||||
if (plot.isAdded(plotPlayer.getUUID())) {
|
||||
perm = "plots.admin.command.blocked-cmds.shared";
|
||||
} else {
|
||||
perm = "plots.admin.command.blocked-cmds.other";
|
||||
}
|
||||
if (!Permissions.hasPermission(pp, perm)) {
|
||||
MainUtil.sendMessage(pp, Captions.COMMAND_BLOCKED);
|
||||
if (!Permissions.hasPermission(plotPlayer, perm)) {
|
||||
MainUtil.sendMessage(plotPlayer, Captions.COMMAND_BLOCKED);
|
||||
event.setCancelled(true);
|
||||
}
|
||||
return;
|
||||
|
@ -619,10 +618,10 @@ import java.util.regex.Pattern;
|
|||
UUID uuid = pp.getUUID();
|
||||
UUIDHandler.add(sw, uuid);
|
||||
|
||||
Location loc = pp.getLocation();
|
||||
PlotArea area = loc.getPlotArea();
|
||||
Location location = pp.getLocation();
|
||||
PlotArea area = location.getPlotArea();
|
||||
if (area != null) {
|
||||
Plot plot = area.getPlot(loc);
|
||||
Plot plot = area.getPlot(location);
|
||||
if (plot != null) {
|
||||
plotEntry(pp, plot);
|
||||
}
|
||||
|
@ -688,27 +687,27 @@ import java.util.regex.Pattern;
|
|||
org.bukkit.Location to = event.getTo();
|
||||
if (to != null) {
|
||||
Player player = event.getPlayer();
|
||||
PlotPlayer pp = PlotPlayer.wrap(player);
|
||||
Location loc = BukkitUtil.getLocation(to);
|
||||
PlotArea area = loc.getPlotArea();
|
||||
PlotPlayer plotPlayer = PlotPlayer.wrap(player);
|
||||
Location location = BukkitUtil.getLocation(to);
|
||||
PlotArea area = location.getPlotArea();
|
||||
if (area == null) {
|
||||
return;
|
||||
}
|
||||
Plot plot = area.getPlot(loc);
|
||||
Plot plot = area.getPlot(location);
|
||||
if (plot != null) {
|
||||
final boolean result = Flags.DENY_TELEPORT.allowsTeleport(pp, plot);
|
||||
final boolean result = Flags.DENY_TELEPORT.allowsTeleport(plotPlayer, plot);
|
||||
if (!result) {
|
||||
MainUtil.sendMessage(pp, Captions.NO_PERMISSION_EVENT,
|
||||
MainUtil.sendMessage(plotPlayer, Captions.NO_PERMISSION_EVENT,
|
||||
Captions.PERMISSION_ADMIN_ENTRY_DENIED);
|
||||
event.setCancelled(true);
|
||||
if (lastLoc != null) {
|
||||
pp.setMeta(PlotPlayer.META_LOCATION, lastLoc);
|
||||
plotPlayer.setMeta(PlotPlayer.META_LOCATION, lastLoc);
|
||||
}
|
||||
if (lastPlot != null) {
|
||||
pp.setMeta(PlotPlayer.META_LAST_PLOT, lastPlot);
|
||||
plotPlayer.setMeta(PlotPlayer.META_LAST_PLOT, lastPlot);
|
||||
}
|
||||
} else {
|
||||
plotEntry(pp, plot);
|
||||
plotEntry(plotPlayer, plot);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -809,14 +808,14 @@ import java.util.regex.Pattern;
|
|||
// Cancel teleport
|
||||
TaskManager.TELEPORT_QUEUE.remove(pp.getName());
|
||||
// Set last location
|
||||
Location loc = BukkitUtil.getLocation(to);
|
||||
pp.setMeta(PlotPlayer.META_LOCATION, loc);
|
||||
PlotArea area = loc.getPlotArea();
|
||||
Location location = BukkitUtil.getLocation(to);
|
||||
pp.setMeta(PlotPlayer.META_LOCATION, location);
|
||||
PlotArea area = location.getPlotArea();
|
||||
if (area == null) {
|
||||
pp.deleteMeta(PlotPlayer.META_LAST_PLOT);
|
||||
return;
|
||||
}
|
||||
Plot now = area.getPlot(loc);
|
||||
Plot now = area.getPlot(location);
|
||||
Plot lastPlot = pp.getMeta(PlotPlayer.META_LAST_PLOT);
|
||||
if (now == null) {
|
||||
if (lastPlot != null && !plotExit(pp, lastPlot) && this.tmpTeleport && !pp
|
||||
|
@ -869,14 +868,14 @@ import java.util.regex.Pattern;
|
|||
// Cancel teleport
|
||||
TaskManager.TELEPORT_QUEUE.remove(pp.getName());
|
||||
// Set last location
|
||||
Location loc = BukkitUtil.getLocation(to);
|
||||
pp.setMeta(PlotPlayer.META_LOCATION, loc);
|
||||
PlotArea area = loc.getPlotArea();
|
||||
Location location = BukkitUtil.getLocation(to);
|
||||
pp.setMeta(PlotPlayer.META_LOCATION, location);
|
||||
PlotArea area = location.getPlotArea();
|
||||
if (area == null) {
|
||||
pp.deleteMeta(PlotPlayer.META_LAST_PLOT);
|
||||
return;
|
||||
}
|
||||
Plot now = area.getPlot(loc);
|
||||
Plot now = area.getPlot(location);
|
||||
Plot lastPlot = pp.getMeta(PlotPlayer.META_LAST_PLOT);
|
||||
if (now == null) {
|
||||
if (lastPlot != null && !plotExit(pp, lastPlot) && this.tmpTeleport && !pp
|
||||
|
@ -1123,10 +1122,10 @@ import java.util.regex.Pattern;
|
|||
if (Settings.Enabled_Components.PERMISSION_CACHE) {
|
||||
pp.deleteMeta("perm");
|
||||
}
|
||||
Location loc = pp.getLocation();
|
||||
PlotArea area = loc.getPlotArea();
|
||||
if (loc.isPlotArea()) {
|
||||
plot = loc.getPlot();
|
||||
Location location = pp.getLocation();
|
||||
PlotArea area = location.getPlotArea();
|
||||
if (location.isPlotArea()) {
|
||||
plot = location.getPlot();
|
||||
if (plot != null) {
|
||||
plotEntry(pp, plot);
|
||||
}
|
||||
|
@ -2269,17 +2268,17 @@ import java.util.regex.Pattern;
|
|||
Entity ignitingEntity = event.getIgnitingEntity();
|
||||
Block block = event.getBlock();
|
||||
BlockIgniteEvent.IgniteCause igniteCause = event.getCause();
|
||||
Location loc;
|
||||
Location location1;
|
||||
if (block != null) {
|
||||
loc = BukkitUtil.getLocation(block.getLocation());
|
||||
location1 = BukkitUtil.getLocation(block.getLocation());
|
||||
} else if (ignitingEntity != null) {
|
||||
loc = BukkitUtil.getLocation(ignitingEntity);
|
||||
location1 = BukkitUtil.getLocation(ignitingEntity);
|
||||
} else if (player != null) {
|
||||
loc = BukkitUtil.getLocation(player);
|
||||
location1 = BukkitUtil.getLocation(player);
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
PlotArea area = loc.getPlotArea();
|
||||
PlotArea area = location1.getPlotArea();
|
||||
if (area == null) {
|
||||
return;
|
||||
}
|
||||
|
@ -2288,7 +2287,7 @@ import java.util.regex.Pattern;
|
|||
return;
|
||||
}
|
||||
|
||||
Plot plot = area.getOwnedPlotAbs(loc);
|
||||
Plot plot = area.getOwnedPlotAbs(location1);
|
||||
if (player != null) {
|
||||
PlotPlayer pp = BukkitUtil.getPlayer(player);
|
||||
if (plot == null) {
|
||||
|
|
|
@ -72,8 +72,8 @@ public class BukkitPlayer extends PlotPlayer {
|
|||
return this.player.getLastPlayed();
|
||||
}
|
||||
|
||||
@Override public boolean canTeleport(@NotNull final Location loc) {
|
||||
final org.bukkit.Location to = BukkitUtil.getLocation(loc);
|
||||
@Override public boolean canTeleport(@NotNull final Location location) {
|
||||
final org.bukkit.Location to = BukkitUtil.getLocation(location);
|
||||
final org.bukkit.Location from = player.getLocation();
|
||||
PlayerTeleportEvent event = new PlayerTeleportEvent(player, from, to);
|
||||
callEvent(event);
|
||||
|
|
|
@ -352,8 +352,8 @@ public class BukkitChunkManager extends ChunkManager {
|
|||
int bz = min.getZ();
|
||||
for (int x1 = 0; x1 < 16; x1++) {
|
||||
for (int z1 = 0; z1 < 16; z1++) {
|
||||
PlotLoc loc = new PlotLoc(bx + x1, bz + z1);
|
||||
BaseBlock[] ids = map.allBlocks.get(loc);
|
||||
PlotLoc plotLoc = new PlotLoc(bx + x1, bz + z1);
|
||||
BaseBlock[] ids = map.allBlocks.get(plotLoc);
|
||||
if (ids != null) {
|
||||
for (int y = 0; y < Math.min(128, ids.length); y++) {
|
||||
BaseBlock id = ids[y];
|
||||
|
@ -388,17 +388,18 @@ public class BukkitChunkManager extends ChunkManager {
|
|||
return true;
|
||||
}
|
||||
|
||||
@Override public boolean loadChunk(String world, ChunkLoc loc, boolean force) {
|
||||
return BukkitUtil.getWorld(world).getChunkAt(loc.x, loc.z).load(force);
|
||||
@Override public boolean loadChunk(String world, ChunkLoc chunkLoc, boolean force) {
|
||||
return BukkitUtil.getWorld(world).getChunkAt(chunkLoc.x, chunkLoc.z).load(force);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void unloadChunk(final String world, final ChunkLoc loc, final boolean save,
|
||||
public void unloadChunk(final String world, final ChunkLoc chunkLoc, final boolean save,
|
||||
final boolean safe) {
|
||||
if (!PlotSquared.get().isMainThread(Thread.currentThread())) {
|
||||
TaskManager.runTask(() -> BukkitUtil.getWorld(world).unloadChunk(loc.x, loc.z, save));
|
||||
TaskManager.runTask(
|
||||
() -> BukkitUtil.getWorld(world).unloadChunk(chunkLoc.x, chunkLoc.z, save));
|
||||
} else {
|
||||
BukkitUtil.getWorld(world).unloadChunk(loc.x, loc.z, save);
|
||||
BukkitUtil.getWorld(world).unloadChunk(chunkLoc.x, chunkLoc.z, save);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -615,9 +616,9 @@ public class BukkitChunkManager extends ChunkManager {
|
|||
|
||||
void saveEntitiesOut(Chunk chunk, RegionWrapper region) {
|
||||
for (Entity entity : chunk.getEntities()) {
|
||||
Location loc = BukkitUtil.getLocation(entity);
|
||||
int x = loc.getX();
|
||||
int z = loc.getZ();
|
||||
Location location = BukkitUtil.getLocation(entity);
|
||||
int x = location.getX();
|
||||
int z = location.getZ();
|
||||
if (isIn(region, x, z)) {
|
||||
continue;
|
||||
}
|
||||
|
@ -637,9 +638,9 @@ public class BukkitChunkManager extends ChunkManager {
|
|||
void saveEntitiesIn(Chunk chunk, RegionWrapper region, int offsetX, int offsetZ,
|
||||
boolean delete) {
|
||||
for (Entity entity : chunk.getEntities()) {
|
||||
Location loc = BukkitUtil.getLocation(entity);
|
||||
int x = loc.getX();
|
||||
int z = loc.getZ();
|
||||
Location location = BukkitUtil.getLocation(entity);
|
||||
int x = location.getX();
|
||||
int z = location.getZ();
|
||||
if (!isIn(region, x, z)) {
|
||||
continue;
|
||||
}
|
||||
|
|
|
@ -25,8 +25,8 @@ import com.github.intellectualsites.plotsquared.plot.util.UUIDHandler;
|
|||
return false;
|
||||
}
|
||||
|
||||
Location loc = player.getLocation();
|
||||
Plot plot = loc.getPlotAbs();
|
||||
Location location = player.getLocation();
|
||||
Plot plot = location.getPlotAbs();
|
||||
if (plot == null) {
|
||||
return !sendMessage(player, Captions.NOT_IN_PLOT);
|
||||
}
|
||||
|
|
|
@ -20,13 +20,14 @@ public class Claim extends SubCommand {
|
|||
if (args.length >= 1) {
|
||||
schematic = args[0];
|
||||
}
|
||||
Location loc = player.getLocation();
|
||||
final Plot plot = loc.getPlotAbs();
|
||||
Location location = player.getLocation();
|
||||
final Plot plot = location.getPlotAbs();
|
||||
if (plot == null) {
|
||||
return sendMessage(player, Captions.NOT_IN_PLOT);
|
||||
}
|
||||
int currentPlots =
|
||||
Settings.Limit.GLOBAL ? player.getPlotCount() : player.getPlotCount(loc.getWorld());
|
||||
int currentPlots = Settings.Limit.GLOBAL ?
|
||||
player.getPlotCount() :
|
||||
player.getPlotCount(location.getWorld());
|
||||
int grants = 0;
|
||||
if (currentPlots >= player.getAllowedPlots()) {
|
||||
if (player.hasPersistentMeta("grantedPlots")) {
|
||||
|
@ -89,7 +90,7 @@ public class Claim extends SubCommand {
|
|||
@Override public void run(Object value) {
|
||||
plot.claim(player, true, finalSchematic, false);
|
||||
if (area.AUTO_MERGE) {
|
||||
plot.autoMerge(-1, Integer.MAX_VALUE, player.getUUID(), true);
|
||||
plot.autoMerge(Direction.ALL, Integer.MAX_VALUE, player.getUUID(), true);
|
||||
}
|
||||
}
|
||||
}), () -> sendMessage(player, Captions.PLOT_NOT_CLAIMED));
|
||||
|
|
|
@ -32,7 +32,7 @@ public class Comment extends SubCommand {
|
|||
StringMan.join(CommentManager.inboxes.keySet(), "|"));
|
||||
return false;
|
||||
}
|
||||
Location loc = player.getLocation();
|
||||
Location location = player.getLocation();
|
||||
PlotId id;
|
||||
try {
|
||||
id = PlotId.fromString(args[1]);
|
||||
|
@ -44,7 +44,7 @@ public class Comment extends SubCommand {
|
|||
int index;
|
||||
if (plot == null) {
|
||||
index = 1;
|
||||
plot = loc.getPlotAbs();
|
||||
plot = location.getPlotAbs();
|
||||
} else {
|
||||
if (args.length < 4) {
|
||||
sendMessage(player, Captions.COMMENT_SYNTAX,
|
||||
|
@ -59,7 +59,7 @@ public class Comment extends SubCommand {
|
|||
}
|
||||
String message = StringMan.join(Arrays.copyOfRange(args, index, args.length), " ");
|
||||
PlotComment comment =
|
||||
new PlotComment(loc.getWorld(), id, message, player.getName(), inbox.toString(),
|
||||
new PlotComment(location.getWorld(), id, message, player.getName(), inbox.toString(),
|
||||
System.currentTimeMillis());
|
||||
boolean result = inbox.addComment(plot, comment);
|
||||
if (!result) {
|
||||
|
|
|
@ -13,8 +13,8 @@ import com.github.intellectualsites.plotsquared.plot.util.Permissions;
|
|||
requiredType = RequiredType.NONE) public class Copy extends SubCommand {
|
||||
|
||||
@Override public boolean onCommand(final PlotPlayer player, String[] args) {
|
||||
Location loc = player.getLocation();
|
||||
Plot plot1 = loc.getPlotAbs();
|
||||
Location location = player.getLocation();
|
||||
Plot plot1 = location.getPlotAbs();
|
||||
if (plot1 == null) {
|
||||
return !MainUtil.sendMessage(player, Captions.NOT_IN_PLOT);
|
||||
}
|
||||
|
|
|
@ -16,12 +16,12 @@ import com.github.intellectualsites.plotsquared.plot.util.MainUtil;
|
|||
usage = "/plot createroadschematic") public class CreateRoadSchematic extends SubCommand {
|
||||
|
||||
@Override public boolean onCommand(PlotPlayer player, String[] args) {
|
||||
Location loc = player.getLocation();
|
||||
Plot plot = loc.getPlotAbs();
|
||||
Location location = player.getLocation();
|
||||
Plot plot = location.getPlotAbs();
|
||||
if (plot == null) {
|
||||
return sendMessage(player, Captions.NOT_IN_PLOT);
|
||||
}
|
||||
if (!(loc.getPlotArea() instanceof HybridPlotWorld)) {
|
||||
if (!(location.getPlotArea() instanceof HybridPlotWorld)) {
|
||||
return sendMessage(player, Captions.NOT_IN_PLOT_WORLD);
|
||||
}
|
||||
HybridUtils.manager.setupRoadSchematic(plot);
|
||||
|
|
|
@ -55,13 +55,13 @@ public class DebugClaimTest extends SubCommand {
|
|||
MainUtil.sendMessage(player, " - &cDB Already contains: " + plot.getId());
|
||||
continue;
|
||||
}
|
||||
Location loc = manager.getSignLoc(plot);
|
||||
ChunkLoc chunk = new ChunkLoc(loc.getX() >> 4, loc.getZ() >> 4);
|
||||
Location location = manager.getSignLoc(plot);
|
||||
ChunkLoc chunk = new ChunkLoc(location.getX() >> 4, location.getZ() >> 4);
|
||||
boolean result = ChunkManager.manager.loadChunk(area.worldname, chunk, false);
|
||||
if (!result) {
|
||||
continue;
|
||||
}
|
||||
String[] lines = WorldUtil.IMP.getSign(loc);
|
||||
String[] lines = WorldUtil.IMP.getSign(location);
|
||||
if (lines != null) {
|
||||
String line = lines[2];
|
||||
if (line != null && line.length() > 2) {
|
||||
|
|
|
@ -369,17 +369,17 @@ import java.util.concurrent.CompletableFuture;
|
|||
Command cmd = MainCommand.getInstance().getCommand(args[3]);
|
||||
String[] params = Arrays.copyOfRange(args, 4, args.length);
|
||||
if ("true".equals(args[1])) {
|
||||
Location loc = player.getMeta(PlotPlayer.META_LOCATION);
|
||||
Location location = player.getMeta(PlotPlayer.META_LOCATION);
|
||||
Plot plot = player.getMeta(PlotPlayer.META_LAST_PLOT);
|
||||
for (Plot current : PlotSquared.get().getBasePlots()) {
|
||||
player.setMeta(PlotPlayer.META_LOCATION, current.getBottomAbs());
|
||||
player.setMeta(PlotPlayer.META_LAST_PLOT, current);
|
||||
cmd.execute(player, params, null, null);
|
||||
}
|
||||
if (loc == null) {
|
||||
if (location == null) {
|
||||
player.deleteMeta(PlotPlayer.META_LOCATION);
|
||||
} else {
|
||||
player.setMeta(PlotPlayer.META_LOCATION, loc);
|
||||
player.setMeta(PlotPlayer.META_LOCATION, location);
|
||||
}
|
||||
if (plot == null) {
|
||||
player.deleteMeta(PlotPlayer.META_LAST_PLOT);
|
||||
|
|
|
@ -3,7 +3,6 @@ package com.github.intellectualsites.plotsquared.plot.commands;
|
|||
import com.github.intellectualsites.plotsquared.commands.CommandDeclaration;
|
||||
import com.github.intellectualsites.plotsquared.plot.config.Captions;
|
||||
import com.github.intellectualsites.plotsquared.plot.generator.HybridPlotManager;
|
||||
import com.github.intellectualsites.plotsquared.plot.generator.HybridPlotWorld;
|
||||
import com.github.intellectualsites.plotsquared.plot.generator.HybridUtils;
|
||||
import com.github.intellectualsites.plotsquared.plot.object.Location;
|
||||
import com.github.intellectualsites.plotsquared.plot.object.Plot;
|
||||
|
@ -43,8 +42,8 @@ public class DebugRoadRegen extends SubCommand {
|
|||
}
|
||||
|
||||
public boolean regenPlot(PlotPlayer player) {
|
||||
Location loc = player.getLocation();
|
||||
PlotArea area = loc.getPlotArea();
|
||||
Location location = player.getLocation();
|
||||
PlotArea area = location.getPlotArea();
|
||||
if (area == null) {
|
||||
return sendMessage(player, Captions.NOT_IN_PLOT_WORLD);
|
||||
}
|
||||
|
@ -82,8 +81,8 @@ public class DebugRoadRegen extends SubCommand {
|
|||
return false;
|
||||
}
|
||||
|
||||
Location loc = player.getLocation();
|
||||
PlotArea area = loc.getPlotArea();
|
||||
Location location = player.getLocation();
|
||||
PlotArea area = location.getPlotArea();
|
||||
if (area == null) {
|
||||
return sendMessage(player, Captions.NOT_IN_PLOT_WORLD);
|
||||
}
|
||||
|
|
|
@ -3,8 +3,16 @@ package com.github.intellectualsites.plotsquared.plot.commands;
|
|||
import com.github.intellectualsites.plotsquared.commands.CommandDeclaration;
|
||||
import com.github.intellectualsites.plotsquared.plot.config.Captions;
|
||||
import com.github.intellectualsites.plotsquared.plot.config.Settings;
|
||||
import com.github.intellectualsites.plotsquared.plot.object.*;
|
||||
import com.github.intellectualsites.plotsquared.plot.util.*;
|
||||
import com.github.intellectualsites.plotsquared.plot.object.Expression;
|
||||
import com.github.intellectualsites.plotsquared.plot.object.Location;
|
||||
import com.github.intellectualsites.plotsquared.plot.object.Plot;
|
||||
import com.github.intellectualsites.plotsquared.plot.object.PlotArea;
|
||||
import com.github.intellectualsites.plotsquared.plot.object.PlotPlayer;
|
||||
import com.github.intellectualsites.plotsquared.plot.util.CmdConfirm;
|
||||
import com.github.intellectualsites.plotsquared.plot.util.EconHandler;
|
||||
import com.github.intellectualsites.plotsquared.plot.util.MainUtil;
|
||||
import com.github.intellectualsites.plotsquared.plot.util.Permissions;
|
||||
import com.github.intellectualsites.plotsquared.plot.util.TaskManager;
|
||||
|
||||
|
||||
@CommandDeclaration(command = "delete", permission = "plots.delete",
|
||||
|
@ -16,8 +24,8 @@ import com.github.intellectualsites.plotsquared.plot.util.*;
|
|||
// The syntax also works with any command: /plot <plot> <command>
|
||||
|
||||
@Override public boolean onCommand(final PlotPlayer player, String[] args) {
|
||||
Location loc = player.getLocation();
|
||||
final Plot plot = loc.getPlotAbs();
|
||||
Location location = player.getLocation();
|
||||
final Plot plot = location.getPlotAbs();
|
||||
if (plot == null) {
|
||||
return !sendMessage(player, Captions.NOT_IN_PLOT);
|
||||
}
|
||||
|
@ -30,8 +38,9 @@ import com.github.intellectualsites.plotsquared.plot.util.*;
|
|||
}
|
||||
final PlotArea plotArea = plot.getArea();
|
||||
final java.util.Set<Plot> plots = plot.getConnectedPlots();
|
||||
final int currentPlots =
|
||||
Settings.Limit.GLOBAL ? player.getPlotCount() : player.getPlotCount(loc.getWorld());
|
||||
final int currentPlots = Settings.Limit.GLOBAL ?
|
||||
player.getPlotCount() :
|
||||
player.getPlotCount(location.getWorld());
|
||||
Runnable run = new Runnable() {
|
||||
@Override public void run() {
|
||||
if (plot.getRunning() > 0) {
|
||||
|
|
|
@ -97,8 +97,8 @@ import java.util.UUID;
|
|||
if (player.getGameMode() == PlotGameMode.SPECTATOR) {
|
||||
player.stopSpectating();
|
||||
}
|
||||
Location loc = player.getLocation();
|
||||
Location spawn = WorldUtil.IMP.getSpawn(loc.getWorld());
|
||||
Location location = player.getLocation();
|
||||
Location spawn = WorldUtil.IMP.getSpawn(location.getWorld());
|
||||
MainUtil.sendMessage(player, Captions.YOU_GOT_DENIED);
|
||||
if (plot.equals(spawn.getPlot())) {
|
||||
Location newSpawn =
|
||||
|
|
|
@ -19,8 +19,8 @@ import com.github.intellectualsites.plotsquared.plot.util.expiry.PlotAnalysis;
|
|||
requiredType = RequiredType.NONE) public class Done extends SubCommand {
|
||||
|
||||
@Override public boolean onCommand(final PlotPlayer player, String[] args) {
|
||||
Location loc = player.getLocation();
|
||||
final Plot plot = loc.getPlotAbs();
|
||||
Location location = player.getLocation();
|
||||
final Plot plot = location.getPlotAbs();
|
||||
if ((plot == null) || !plot.hasOwner()) {
|
||||
return !sendMessage(player, Captions.NOT_IN_PLOT);
|
||||
}
|
||||
|
|
|
@ -91,8 +91,8 @@ import java.util.*;
|
|||
"/plot flag <set|remove|add|list|info>");
|
||||
return false;
|
||||
}
|
||||
Location loc = player.getLocation();
|
||||
Plot plot = loc.getPlotAbs();
|
||||
Location location = player.getLocation();
|
||||
Plot plot = location.getPlotAbs();
|
||||
if (plot == null) {
|
||||
MainUtil.sendMessage(player, Captions.NOT_IN_PLOT);
|
||||
return false;
|
||||
|
|
|
@ -193,7 +193,7 @@ public class MainCommand extends Command {
|
|||
// Clear perm caching //
|
||||
player.deleteMeta("perm");
|
||||
// Optional command scope //
|
||||
Location loc = null;
|
||||
Location location = null;
|
||||
Plot plot = null;
|
||||
boolean tp = false;
|
||||
if (args.length >= 2) {
|
||||
|
@ -205,7 +205,7 @@ public class MainCommand extends Command {
|
|||
Location newLoc = newPlot.getCenter();
|
||||
if (player.canTeleport(newLoc)) {
|
||||
// Save meta
|
||||
loc = player.getMeta(PlotPlayer.META_LOCATION);
|
||||
location = player.getMeta(PlotPlayer.META_LOCATION);
|
||||
plot = player.getMeta(PlotPlayer.META_LAST_PLOT);
|
||||
tp = true;
|
||||
// Set loc
|
||||
|
@ -262,10 +262,10 @@ public class MainCommand extends Command {
|
|||
}
|
||||
// Reset command scope //
|
||||
if (tp && !(player instanceof ConsolePlayer)) {
|
||||
if (loc == null) {
|
||||
if (location == null) {
|
||||
player.deleteMeta(PlotPlayer.META_LOCATION);
|
||||
} else {
|
||||
player.setMeta(PlotPlayer.META_LOCATION, loc);
|
||||
player.setMeta(PlotPlayer.META_LOCATION, location);
|
||||
}
|
||||
if (plot == null) {
|
||||
player.deleteMeta(PlotPlayer.META_LAST_PLOT);
|
||||
|
|
|
@ -52,8 +52,8 @@ public class Merge extends SubCommand {
|
|||
}
|
||||
|
||||
@Override public boolean onCommand(final PlotPlayer player, String[] args) {
|
||||
Location loc = player.getLocationFull();
|
||||
final Plot plot = loc.getPlotAbs();
|
||||
Location location = player.getLocationFull();
|
||||
final Plot plot = location.getPlotAbs();
|
||||
if (plot == null) {
|
||||
return !sendMessage(player, Captions.NOT_IN_PLOT);
|
||||
}
|
||||
|
@ -135,8 +135,8 @@ public class Merge extends SubCommand {
|
|||
if (direction == Direction.ALL) {
|
||||
MainUtil.sendMessage(player, Captions.COMMAND_SYNTAX,
|
||||
"/plot merge <" + StringMan.join(values, "|") + "> [removeroads]");
|
||||
MainUtil.sendMessage(player,
|
||||
Captions.DIRECTION.getTranslated().replaceAll("%dir%", direction(loc.getYaw())));
|
||||
MainUtil.sendMessage(player, Captions.DIRECTION.getTranslated()
|
||||
.replaceAll("%dir%", direction(location.getYaw())));
|
||||
return false;
|
||||
}
|
||||
final boolean terrain;
|
||||
|
|
|
@ -15,8 +15,8 @@ import com.github.intellectualsites.plotsquared.plot.util.Permissions;
|
|||
requiredType = RequiredType.PLAYER) public class Move extends SubCommand {
|
||||
|
||||
@Override public boolean onCommand(final PlotPlayer player, String[] args) {
|
||||
Location loc = player.getLocation();
|
||||
Plot plot1 = loc.getPlotAbs();
|
||||
Location location = player.getLocation();
|
||||
Plot plot1 = location.getPlotAbs();
|
||||
if (plot1 == null) {
|
||||
return !MainUtil.sendMessage(player, Captions.NOT_IN_PLOT);
|
||||
}
|
||||
|
|
|
@ -3,7 +3,11 @@ package com.github.intellectualsites.plotsquared.plot.commands;
|
|||
import com.github.intellectualsites.plotsquared.commands.CommandDeclaration;
|
||||
import com.github.intellectualsites.plotsquared.plot.config.Captions;
|
||||
import com.github.intellectualsites.plotsquared.plot.flag.Flags;
|
||||
import com.github.intellectualsites.plotsquared.plot.object.*;
|
||||
import com.github.intellectualsites.plotsquared.plot.object.Location;
|
||||
import com.github.intellectualsites.plotsquared.plot.object.Plot;
|
||||
import com.github.intellectualsites.plotsquared.plot.object.PlotInventory;
|
||||
import com.github.intellectualsites.plotsquared.plot.object.PlotItemStack;
|
||||
import com.github.intellectualsites.plotsquared.plot.object.PlotPlayer;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
|
@ -20,8 +24,8 @@ import java.util.Locale;
|
|||
"music_disc_strad", "music_disc_ward", "music_disc_11", "music_disc_wait");
|
||||
|
||||
@Override public boolean onCommand(PlotPlayer player, String[] args) {
|
||||
Location loc = player.getLocation();
|
||||
final Plot plot = loc.getPlotAbs();
|
||||
Location location = player.getLocation();
|
||||
final Plot plot = location.getPlotAbs();
|
||||
if (plot == null) {
|
||||
return !sendMessage(player, Captions.NOT_IN_PLOT);
|
||||
}
|
||||
|
|
|
@ -11,8 +11,8 @@ import com.github.intellectualsites.plotsquared.plot.util.StringMan;
|
|||
public abstract class SetCommand extends SubCommand {
|
||||
|
||||
@Override public boolean onCommand(PlotPlayer player, String[] args) {
|
||||
Location loc = player.getLocation();
|
||||
Plot plot = loc.getPlotAbs();
|
||||
Location location = player.getLocation();
|
||||
Plot plot = location.getPlotAbs();
|
||||
if (plot == null) {
|
||||
return !sendMessage(player, Captions.NOT_IN_PLOT);
|
||||
}
|
||||
|
|
|
@ -25,11 +25,10 @@ public class SetHome extends SetCommand {
|
|||
}
|
||||
case "":
|
||||
Plot base = plot.getBasePlot(false);
|
||||
Location bot = base.getBottomAbs();
|
||||
Location loc = player.getLocationFull();
|
||||
BlockLoc rel =
|
||||
new BlockLoc(loc.getX() - bot.getX(), loc.getY(), loc.getZ() - bot.getZ(),
|
||||
loc.getYaw(), loc.getPitch());
|
||||
Location bottom = base.getBottomAbs();
|
||||
Location location = player.getLocationFull();
|
||||
BlockLoc rel = new BlockLoc(location.getX() - bottom.getX(), location.getY(),
|
||||
location.getZ() - bottom.getZ(), location.getYaw(), location.getPitch());
|
||||
base.setHome(rel);
|
||||
return MainUtil.sendMessage(player, Captions.POSITION_SET);
|
||||
default:
|
||||
|
|
|
@ -13,8 +13,8 @@ import com.github.intellectualsites.plotsquared.plot.util.Permissions;
|
|||
public class Swap extends SubCommand {
|
||||
|
||||
@Override public boolean onCommand(final PlotPlayer player, String[] args) {
|
||||
Location loc = player.getLocation();
|
||||
Plot plot1 = loc.getPlotAbs();
|
||||
Location location = player.getLocation();
|
||||
Plot plot1 = location.getPlotAbs();
|
||||
if (plot1 == null) {
|
||||
return !MainUtil.sendMessage(player, Captions.NOT_IN_PLOT);
|
||||
}
|
||||
|
|
|
@ -138,18 +138,18 @@ public class PlotListener {
|
|||
final PlotBlock block = PlotBlock.get(id);
|
||||
final String rawId = block.getRawId().toString();
|
||||
if (rawId.contains("disc") || PlotBlock.isEverything(block) || block.isAir()) {
|
||||
Location loc = player.getLocation();
|
||||
Location lastLoc = player.getMeta("music");
|
||||
if (lastLoc != null) {
|
||||
player.playMusic(lastLoc, PlotBlock.get("air"));
|
||||
Location location = player.getLocation();
|
||||
Location lastLocation = player.getMeta("music");
|
||||
if (lastLocation != null) {
|
||||
player.playMusic(lastLocation, PlotBlock.get("air"));
|
||||
if (PlotBlock.isEverything(block) || block.isAir()) {
|
||||
player.deleteMeta("music");
|
||||
}
|
||||
}
|
||||
if (!(PlotBlock.isEverything(block) || block.isAir())) {
|
||||
try {
|
||||
player.setMeta("music", loc);
|
||||
player.playMusic(loc, block);
|
||||
player.setMeta("music", location);
|
||||
player.playMusic(location, block);
|
||||
} catch (Exception ignored) {
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,6 +5,7 @@ import com.github.intellectualsites.plotsquared.plot.commands.RequiredType;
|
|||
import com.github.intellectualsites.plotsquared.plot.database.DBFunc;
|
||||
import com.github.intellectualsites.plotsquared.plot.util.PlotGameMode;
|
||||
import com.github.intellectualsites.plotsquared.plot.util.PlotWeather;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.UUID;
|
||||
|
@ -15,15 +16,15 @@ public class ConsolePlayer extends PlotPlayer {
|
|||
|
||||
private ConsolePlayer() {
|
||||
PlotArea area = PlotSquared.get().getFirstPlotArea();
|
||||
Location loc;
|
||||
Location location;
|
||||
if (area != null) {
|
||||
RegionWrapper region = area.getRegion();
|
||||
loc = new Location(area.worldname, region.minX + region.maxX / 2, 0,
|
||||
location = new Location(area.worldname, region.minX + region.maxX / 2, 0,
|
||||
region.minZ + region.maxZ / 2);
|
||||
} else {
|
||||
loc = new Location("world", 0, 0, 0);
|
||||
location = new Location("world", 0, 0, 0);
|
||||
}
|
||||
setMeta("location", loc);
|
||||
setMeta("location", location);
|
||||
}
|
||||
|
||||
public static ConsolePlayer getConsole() {
|
||||
|
@ -34,7 +35,7 @@ public class ConsolePlayer extends PlotPlayer {
|
|||
return instance;
|
||||
}
|
||||
|
||||
@Override public boolean canTeleport(@Nonnull Location loc) {
|
||||
@Override public boolean canTeleport(@NotNull Location location) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -50,7 +51,7 @@ public class ConsolePlayer extends PlotPlayer {
|
|||
return getLocation();
|
||||
}
|
||||
|
||||
@Nonnull @Override public UUID getUUID() {
|
||||
@NotNull @Override public UUID getUUID() {
|
||||
return DBFunc.EVERYONE;
|
||||
}
|
||||
|
||||
|
|
|
@ -1212,18 +1212,18 @@ public class Plot {
|
|||
Location[] corners = getCorners();
|
||||
Location top = corners[0];
|
||||
Location bot = corners[1];
|
||||
Location loc = new Location(this.getWorldName(), MathMan.average(bot.getX(), top.getX()),
|
||||
Location location =
|
||||
new Location(this.getWorldName(), MathMan.average(bot.getX(), top.getX()),
|
||||
MathMan.average(bot.getY(), top.getY()), MathMan.average(bot.getZ(), top.getZ()));
|
||||
if (!isLoaded()) {
|
||||
return loc;
|
||||
return location;
|
||||
}
|
||||
int y =
|
||||
isLoaded() ? WorldUtil.IMP.getHighestBlock(getWorldName(), loc.getX(), loc.getZ()) : 62;
|
||||
int y = WorldUtil.IMP.getHighestBlock(getWorldName(), location.getX(), location.getZ());
|
||||
if (area.ALLOW_SIGNS) {
|
||||
y = Math.max(y, getManager().getSignLoc(this).getY());
|
||||
}
|
||||
loc.setY(1 + y);
|
||||
return loc;
|
||||
location.setY(1 + y);
|
||||
return location;
|
||||
}
|
||||
|
||||
public Location getSide() {
|
||||
|
@ -1248,18 +1248,19 @@ public class Plot {
|
|||
if (home == null || home.x == 0 && home.z == 0) {
|
||||
return this.getDefaultHome(true);
|
||||
} else {
|
||||
Location bot = this.getBottomAbs();
|
||||
Location loc = new Location(bot.getWorld(), bot.getX() + home.x, bot.getY() + home.y,
|
||||
bot.getZ() + home.z, home.yaw, home.pitch);
|
||||
Location bottom = this.getBottomAbs();
|
||||
Location location =
|
||||
new Location(bottom.getWorld(), bottom.getX() + home.x, bottom.getY() + home.y,
|
||||
bottom.getZ() + home.z, home.yaw, home.pitch);
|
||||
if (!isLoaded()) {
|
||||
return loc;
|
||||
return location;
|
||||
}
|
||||
if (!WorldUtil.IMP.getBlock(loc).isAir()) {
|
||||
loc.setY(Math.max(
|
||||
1 + WorldUtil.IMP.getHighestBlock(this.getWorldName(), loc.getX(), loc.getZ()),
|
||||
bot.getY()));
|
||||
if (!WorldUtil.IMP.getBlock(location).isAir()) {
|
||||
location.setY(Math.max(1 + WorldUtil.IMP
|
||||
.getHighestBlock(this.getWorldName(), location.getX(), location.getZ()),
|
||||
bottom.getY()));
|
||||
}
|
||||
return loc;
|
||||
return location;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1426,9 +1427,9 @@ public class Plot {
|
|||
if (!this.area.ALLOW_SIGNS) {
|
||||
return;
|
||||
}
|
||||
Location loc = manager.getSignLoc(this);
|
||||
Location location = manager.getSignLoc(this);
|
||||
LocalBlockQueue queue = GlobalBlockQueue.IMP.getNewQueue(getWorldName(), false);
|
||||
queue.setBlock(loc.getX(), loc.getY(), loc.getZ(), PlotBlock.get("air"));
|
||||
queue.setBlock(location.getX(), location.getY(), location.getZ(), PlotBlock.get("air"));
|
||||
queue.flush();
|
||||
}
|
||||
|
||||
|
@ -1568,8 +1569,8 @@ public class Plot {
|
|||
* @return the name of the biome
|
||||
*/
|
||||
public String getBiome() {
|
||||
Location loc = this.getCenter();
|
||||
return WorldUtil.IMP.getBiome(loc.getWorld(), loc.getX(), loc.getZ());
|
||||
Location location = this.getCenter();
|
||||
return WorldUtil.IMP.getBiome(location.getWorld(), location.getX(), location.getZ());
|
||||
}
|
||||
|
||||
//TODO Better documentation needed.
|
||||
|
@ -1589,9 +1590,9 @@ public class Plot {
|
|||
* Returns the bottom location for the plot.
|
||||
*/
|
||||
public Location getBottomAbs() {
|
||||
Location loc = getManager().getPlotBottomLocAbs(this.id);
|
||||
loc.setWorld(getWorldName());
|
||||
return loc;
|
||||
Location location = getManager().getPlotBottomLocAbs(this.id);
|
||||
location.setWorld(getWorldName());
|
||||
return location;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -2131,11 +2132,12 @@ public class Plot {
|
|||
return null;
|
||||
}
|
||||
try {
|
||||
final Location loc = this.getManager().getSignLoc(this);
|
||||
final Location location = this.getManager().getSignLoc(this);
|
||||
String[] lines = TaskManager.IMP.sync(new RunnableVal<String[]>() {
|
||||
@Override public void run(String[] value) {
|
||||
ChunkManager.manager.loadChunk(loc.getWorld(), loc.getChunkLoc(), false);
|
||||
this.value = WorldUtil.IMP.getSign(loc);
|
||||
ChunkManager.manager
|
||||
.loadChunk(location.getWorld(), location.getChunkLoc(), false);
|
||||
this.value = WorldUtil.IMP.getSign(location);
|
||||
}
|
||||
});
|
||||
if (lines == null) {
|
||||
|
|
|
@ -132,8 +132,8 @@ public class PlotCluster {
|
|||
toReturn = center.getHome();
|
||||
if (toReturn.getY() == 0) {
|
||||
PlotManager manager = this.area.getPlotManager();
|
||||
Location loc = manager.getSignLoc(center);
|
||||
toReturn.setY(loc.getY());
|
||||
Location location = manager.getSignLoc(center);
|
||||
toReturn.setY(location.getY());
|
||||
}
|
||||
} else {
|
||||
toReturn = getClusterBottom().add(home.x, home.y, home.z);
|
||||
|
|
|
@ -14,6 +14,7 @@ import com.github.intellectualsites.plotsquared.plot.util.*;
|
|||
import com.github.intellectualsites.plotsquared.plot.util.expiry.ExpireManager;
|
||||
import com.google.common.base.Preconditions;
|
||||
import lombok.NonNull;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.nio.ByteBuffer;
|
||||
|
@ -335,14 +336,14 @@ public abstract class PlotPlayer implements CommandCaller, OfflinePlotPlayer {
|
|||
*
|
||||
* @return UUID
|
||||
*/
|
||||
@Override @Nonnull public abstract UUID getUUID();
|
||||
@Override @NotNull public abstract UUID getUUID();
|
||||
|
||||
public boolean canTeleport(@Nonnull final Location loc) {
|
||||
Preconditions.checkNotNull(loc, "Specified location cannot be null");
|
||||
public boolean canTeleport(@NotNull final Location location) {
|
||||
Preconditions.checkNotNull(location, "Specified location cannot be null");
|
||||
final Location current = getLocationFull();
|
||||
teleport(loc);
|
||||
teleport(location);
|
||||
boolean result = true;
|
||||
if (!getLocation().equals(loc)) {
|
||||
if (!getLocation().equals(location)) {
|
||||
result = false;
|
||||
}
|
||||
teleport(current);
|
||||
|
@ -493,10 +494,10 @@ public abstract class PlotPlayer implements CommandCaller, OfflinePlotPlayer {
|
|||
ByteBuffer buffer = ByteBuffer.allocate(13);
|
||||
buffer.putShort((short) x);
|
||||
buffer.putShort((short) z);
|
||||
Location loc = getLocation();
|
||||
buffer.putInt(loc.getX());
|
||||
buffer.put((byte) loc.getY());
|
||||
buffer.putInt(loc.getZ());
|
||||
Location location = getLocation();
|
||||
buffer.putInt(location.getX());
|
||||
buffer.put((byte) location.getY());
|
||||
buffer.putInt(location.getZ());
|
||||
setPersistentMeta("quitLoc", buffer.array());
|
||||
} else if (hasPersistentMeta("quitLoc")) {
|
||||
removePersistentMeta("quitLoc");
|
||||
|
@ -596,11 +597,11 @@ public abstract class PlotPlayer implements CommandCaller, OfflinePlotPlayer {
|
|||
return;
|
||||
}
|
||||
|
||||
final Location loc = new Location(plot.getWorldName(), x, y, z);
|
||||
final Location location = new Location(plot.getWorldName(), x, y, z);
|
||||
if (plot.isLoaded()) {
|
||||
TaskManager.runTask(() -> {
|
||||
if (getMeta("teleportOnLogin", true)) {
|
||||
teleport(loc);
|
||||
teleport(location);
|
||||
sendMessage(
|
||||
Captions.TELEPORTED_TO_PLOT.f() + " (quitLoc) (" + plotX
|
||||
+ "," + plotZ + ")");
|
||||
|
@ -612,7 +613,7 @@ public abstract class PlotPlayer implements CommandCaller, OfflinePlotPlayer {
|
|||
TaskManager.runTask(() -> {
|
||||
if (getMeta("teleportOnLogin", true)) {
|
||||
if (plot.isLoaded()) {
|
||||
teleport(loc);
|
||||
teleport(location);
|
||||
sendMessage(Captions.TELEPORTED_TO_PLOT.f()
|
||||
+ " (quitLoc-unloaded) (" + plotX + "," + plotZ
|
||||
+ ")");
|
||||
|
|
|
@ -80,22 +80,22 @@ public class ScopedLocalBlockQueue extends DelegateLocalBlockQueue {
|
|||
int bx = minX;
|
||||
int bz = minZ;
|
||||
PlotArea area = PlotSquared.get().getPlotArea(getWorld(), null);
|
||||
Location loc = new Location(getWorld(), bx, 0, bz);
|
||||
Location location = new Location(getWorld(), bx, 0, bz);
|
||||
if (area != null) {
|
||||
PlotManager manager = area.getPlotManager();
|
||||
for (int x = 0; x < 16; x++) {
|
||||
loc.setX(bx + x);
|
||||
location.setX(bx + x);
|
||||
for (int z = 0; z < 16; z++) {
|
||||
loc.setZ(bz + z);
|
||||
task.run(area.getPlotAbs(loc), x, z);
|
||||
location.setZ(bz + z);
|
||||
task.run(area.getPlotAbs(location), x, z);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for (int x = 0; x < 16; x++) {
|
||||
loc.setX(bx + x);
|
||||
location.setX(bx + x);
|
||||
for (int z = 0; z < 16; z++) {
|
||||
loc.setZ(bz + z);
|
||||
task.run(loc.getPlotAbs(), x, z);
|
||||
location.setZ(bz + z);
|
||||
task.run(location.getPlotAbs(), x, z);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue