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