diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/commands/Command.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/commands/Command.java
index 691daa93e..5fbcc9119 100644
--- a/Core/src/main/java/com/github/intellectualsites/plotsquared/commands/Command.java
+++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/commands/Command.java
@@ -81,7 +81,8 @@ public abstract class Command {
&& types[2] == String[].class && types[3] == RunnableVal3.class
&& types[4] == RunnableVal2.class) {
Command tmp = new Command(this, true) {
- @Override public CompletableFuture execute(PlotPlayer player, String[] args,
+ @Override
+ public CompletableFuture execute(PlotPlayer player, String[] args,
RunnableVal3 confirm,
RunnableVal2 whenDone) {
try {
@@ -264,14 +265,13 @@ public abstract class Command {
if (totalPages != 0) { // Back
new PlotMessage().text("<-").color("$1").command(baseCommand + " " + page).text(" | ")
.color("$3").text("->").color("$3").text(Captions.CLICKABLE.getTranslated())
- .color("$2")
- .send(player);
+ .color("$2").send(player);
}
}
/**
* @param player Caller
- * @param args Arguments
+ * @param args Arguments
* @param confirm Instance, Success, Failure
* @return CompletableFuture true if the command executed fully, false in
* any other case
diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/configuration/file/YamlConfiguration.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/configuration/file/YamlConfiguration.java
index d8c41c3da..1e694f05a 100644
--- a/Core/src/main/java/com/github/intellectualsites/plotsquared/configuration/file/YamlConfiguration.java
+++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/configuration/file/YamlConfiguration.java
@@ -83,7 +83,7 @@ public class YamlConfiguration extends FileConfiguration {
Map, ?> input;
try {
- input = (Map, ?>) yaml.load(contents);
+ input = yaml.load(contents);
} catch (YAMLException e) {
throw new InvalidConfigurationException(e);
} catch (ClassCastException ignored) {
diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/json/JSONObject.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/json/JSONObject.java
index 965e95644..283383df9 100644
--- a/Core/src/main/java/com/github/intellectualsites/plotsquared/json/JSONObject.java
+++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/json/JSONObject.java
@@ -186,7 +186,7 @@ public class JSONObject {
* @param object An object that has fields that should be used to make a JSONObject.
* @param names An array of strings, the names of the fields to be obtained from the object.
*/
- public JSONObject(Object object, String names[]) {
+ public JSONObject(Object object, String[] names) {
this();
Class c = object.getClass();
for (String name : names) {
diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/IPlotMain.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/IPlotMain.java
index 48f87a96e..81e549ec8 100644
--- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/IPlotMain.java
+++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/IPlotMain.java
@@ -219,7 +219,7 @@ public interface IPlotMain extends ILogger {
* Gets the generator wrapper for a world (world) and generator (name).
*
* @param world the world to get the generator from
- * @param name the name of the generator
+ * @param name the name of the generator
* @return the generator being used for the provided world
*/
GeneratorWrapper> getGenerator(String world, String name);
diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/PlotSquared.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/PlotSquared.java
index e2d60ce79..d371d6105 100644
--- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/PlotSquared.java
+++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/PlotSquared.java
@@ -155,7 +155,7 @@ import java.util.zip.ZipInputStream;
//
// Register configuration serializable classes
//
-// ConfigurationSerialization.registerClass(BlockState.class, "BlockState");
+ // ConfigurationSerialization.registerClass(BlockState.class, "BlockState");
ConfigurationSerialization.registerClass(BlockBucket.class, "BlockBucket");
try {
@@ -247,7 +247,8 @@ import java.util.zip.ZipInputStream;
if (Settings.Enabled_Components.WORLDEDIT_RESTRICTIONS) {
try {
if (this.IMP.initWorldEdit()) {
- PlotSquared.log(Captions.PREFIX + "&6" + IMP.getPluginName() + " hooked into WorldEdit.");
+ PlotSquared.log(Captions.PREFIX + "&6" + IMP.getPluginName()
+ + " hooked into WorldEdit.");
this.worldedit = WorldEdit.getInstance();
WorldEdit.getInstance().getEventBus().register(new WESubscriber());
if (Settings.Enabled_Components.COMMANDS) {
@@ -284,7 +285,7 @@ import java.util.zip.ZipInputStream;
}
if (!WorldUtil.IMP.isWorld(world) && !world.equals("*")) {
debug("`" + world + "` was not properly loaded - " + IMP.getPluginName()
- + " will now try to load it properly: ");
+ + " will now try to load it properly: ");
debug(
" - Are you trying to delete this world? Remember to remove it from the worlds.yml, bukkit.yml and multiverse worlds.yml");
debug(
@@ -347,7 +348,8 @@ import java.util.zip.ZipInputStream;
* @see IPlotMain#log(String)
*/
public static void log(Object message) {
- if (message == null || (message instanceof Caption ? ((Caption) message).getTranslated().isEmpty() :
+ if (message == null || (message instanceof Caption ?
+ ((Caption) message).getTranslated().isEmpty() :
message.toString().isEmpty())) {
return;
}
@@ -1832,7 +1834,8 @@ import java.util.zip.ZipInputStream;
if (this.version != null) {
this.style.set("Version", this.version.toString());
}
- this.style.set("Information", "Left Row: PlotSquared color codes ($), right row: Minecraft color codes (&)");
+ this.style.set("Information",
+ "Left Row: PlotSquared color codes ($), right row: Minecraft color codes (&)");
Map object = new HashMap<>(16);
object.put("color.1", "6");
object.put("color.2", "7");
diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/PlotVersion.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/PlotVersion.java
index 4646a787a..8e074221d 100644
--- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/PlotVersion.java
+++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/PlotVersion.java
@@ -37,6 +37,7 @@ public class PlotVersion {
return "4." + build;
}
}
+
@Override public String toString() {
if (hash == 0 && build == 0) {
return "PlotSquared-NoVer-SNAPSHOT";
diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Add.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Add.java
index 6c2423021..a361d7c90 100644
--- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Add.java
+++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Add.java
@@ -17,10 +17,8 @@ import java.util.Set;
import java.util.UUID;
import java.util.concurrent.CompletableFuture;
-@CommandDeclaration(command = "add",
- description = "Allow a user to build in a plot while the plot owner is online.",
- usage = "/plot add ", category = CommandCategory.SETTINGS, permission = "plots.add",
- requiredType = RequiredType.PLAYER) public class Add extends Command {
+@CommandDeclaration(command = "add", description = "Allow a user to build in a plot while the plot owner is online.", usage = "/plot add ", category = CommandCategory.SETTINGS, permission = "plots.add", requiredType = RequiredType.PLAYER)
+public class Add extends Command {
public Add() {
super(MainCommand.getInstance(), true);
diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Alias.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Alias.java
index f569674f8..9bed571f0 100644
--- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Alias.java
+++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Alias.java
@@ -12,11 +12,10 @@ import com.github.intellectualsites.plotsquared.plot.util.MathMan;
import com.github.intellectualsites.plotsquared.plot.util.Permissions;
import com.github.intellectualsites.plotsquared.plot.util.UUIDHandler;
-@CommandDeclaration(command = "setalias", permission = "plots.alias",
- description = "Set the plot name", usage = "/plot alias ",
- aliases = {"alias", "sa", "name", "rename", "setname", "seta", "nameplot"},
- category = CommandCategory.SETTINGS, requiredType = RequiredType.PLAYER) public class Alias
- extends SubCommand {
+@CommandDeclaration(command = "setalias", permission = "plots.alias", description = "Set the plot name", usage = "/plot alias ", aliases = {
+ "alias", "sa", "name", "rename", "setname", "seta",
+ "nameplot"}, category = CommandCategory.SETTINGS, requiredType = RequiredType.PLAYER)
+public class Alias extends SubCommand {
@Override public boolean onCommand(PlotPlayer player, String[] args) {
diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Area.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Area.java
index 2a9195028..14d6c3836 100644
--- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Area.java
+++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Area.java
@@ -33,11 +33,8 @@ import java.util.ArrayList;
import java.util.Objects;
import java.util.Set;
-@CommandDeclaration(command = "area", permission = "plots.area",
- category = CommandCategory.ADMINISTRATION, requiredType = RequiredType.NONE,
- description = "Create a new PlotArea", aliases = "world",
- usage = "/plot area ", confirmation = true) public class Area
- extends SubCommand {
+@CommandDeclaration(command = "area", permission = "plots.area", category = CommandCategory.ADMINISTRATION, requiredType = RequiredType.NONE, description = "Create a new PlotArea", aliases = "world", usage = "/plot area ", confirmation = true)
+public class Area extends SubCommand {
@Override public boolean onCommand(final PlotPlayer player, String[] args) {
if (args.length == 0) {
@@ -135,14 +132,14 @@ import java.util.Set;
if (WorldUtil.IMP.isWorld(world)) {
PlotSquared.get().loadWorld(world, null);
Captions.SETUP_FINISHED.send(player);
- player.teleport(WorldUtil.IMP.getSpawn(world), TeleportCause.COMMAND);
+ player.teleport(WorldUtil.IMP.getSpawn(world),
+ TeleportCause.COMMAND);
if (area.TERRAIN != 3) {
ChunkManager.largeRegionTask(world, region,
new RunnableVal() {
@Override public void run(BlockVector2 value) {
- AugmentedUtils
- .generate(world, value.getX(), value.getZ(),
- null);
+ AugmentedUtils.generate(world, value.getX(),
+ value.getZ(), null);
}
}, null);
}
@@ -258,7 +255,8 @@ import java.util.Set;
String world = SetupUtils.manager.setupWorld(object);
if (WorldUtil.IMP.isWorld(world)) {
Captions.SETUP_FINISHED.send(player);
- player.teleport(WorldUtil.IMP.getSpawn(world), TeleportCause.COMMAND);
+ player.teleport(WorldUtil.IMP.getSpawn(world),
+ TeleportCause.COMMAND);
} else {
MainUtil.sendMessage(player,
"An error occurred while creating the world: "
@@ -285,13 +283,15 @@ import java.util.Set;
}
if (WorldUtil.IMP.isWorld(pa.worldname)) {
if (!player.getLocation().getWorld().equals(pa.worldname)) {
- player.teleport(WorldUtil.IMP.getSpawn(pa.worldname), TeleportCause.COMMAND);
+ player.teleport(WorldUtil.IMP.getSpawn(pa.worldname),
+ TeleportCause.COMMAND);
}
} else {
object.terrain = 0;
object.type = 0;
SetupUtils.manager.setupWorld(object);
- player.teleport(WorldUtil.IMP.getSpawn(pa.worldname), TeleportCause.COMMAND);
+ player.teleport(WorldUtil.IMP.getSpawn(pa.worldname),
+ TeleportCause.COMMAND);
}
player.setMeta("area_create_area", pa);
MainUtil.sendMessage(player,
@@ -432,10 +432,11 @@ import java.util.Set;
"$4Stop the server and delete: " + area.worldname + "/region");
return false;
}
- ChunkManager
- .largeRegionTask(area.worldname, area.getRegion(), new RunnableVal() {
+ ChunkManager.largeRegionTask(area.worldname, area.getRegion(),
+ new RunnableVal() {
@Override public void run(BlockVector2 value) {
- AugmentedUtils.generate(area.worldname, value.getX(), value.getZ(), null);
+ AugmentedUtils
+ .generate(area.worldname, value.getX(), value.getZ(), null);
}
}, () -> player.sendMessage("Regen complete"));
return true;
@@ -463,9 +464,10 @@ import java.util.Set;
center = WorldUtil.IMP.getSpawn(area.worldname);
} else {
CuboidRegion region = area.getRegion();
- center =
- new Location(area.worldname, region.getMinimumPoint().getX() + (region.getMaximumPoint().getX() - region.getMinimumPoint().getX()) / 2,
- 0, region.getMinimumPoint().getZ() + (region.getMaximumPoint().getZ() - region.getMinimumPoint().getZ()) / 2);
+ center = new Location(area.worldname, region.getMinimumPoint().getX()
+ + (region.getMaximumPoint().getX() - region.getMinimumPoint().getX()) / 2,
+ 0, region.getMinimumPoint().getZ()
+ + (region.getMaximumPoint().getZ() - region.getMinimumPoint().getZ()) / 2);
center.setY(1 + WorldUtil.IMP
.getHighestBlock(area.worldname, center.getX(), center.getZ()));
}
diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Auto.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Auto.java
index c2b0fe814..75bc46039 100644
--- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Auto.java
+++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Auto.java
@@ -23,9 +23,7 @@ import org.jetbrains.annotations.Nullable;
import java.util.Set;
-@CommandDeclaration(command = "auto", permission = "plots.auto",
- category = CommandCategory.CLAIMING, requiredType = RequiredType.NONE,
- description = "Claim the nearest plot", aliases = "a", usage = "/plot auto [length,width]")
+@CommandDeclaration(command = "auto", permission = "plots.auto", category = CommandCategory.CLAIMING, requiredType = RequiredType.NONE, description = "Claim the nearest plot", aliases = "a", usage = "/plot auto [length,width]")
public class Auto extends SubCommand {
@Deprecated public static PlotId getNextPlotId(PlotId id, int step) {
@@ -177,7 +175,7 @@ public class Auto extends SubCommand {
try {
String[] split = args[0].split(",|;");
if (split[1] == null) {
- MainUtil.sendMessage(player,"Correct use /plot auto [length,width]");
+ MainUtil.sendMessage(player, "Correct use /plot auto [length,width]");
size_x = 1;
size_z = 1;
} else {
@@ -220,12 +218,12 @@ public class Auto extends SubCommand {
sendMessage(player, Captions.SCHEMATIC_INVALID, "non-existent: " + schematic);
return true;
}
- if (!Permissions.hasPermission(player,
- CaptionUtility.format(Captions.PERMISSION_CLAIM_SCHEMATIC.getTranslated(), schematic))
+ if (!Permissions.hasPermission(player, CaptionUtility
+ .format(Captions.PERMISSION_CLAIM_SCHEMATIC.getTranslated(), schematic))
&& !Permissions
.hasPermission(player, Captions.PERMISSION_ADMIN_COMMAND_SCHEMATIC)) {
- MainUtil.sendMessage(player, Captions.NO_PERMISSION,
- CaptionUtility.format(Captions.PERMISSION_CLAIM_SCHEMATIC.getTranslated(), schematic));
+ MainUtil.sendMessage(player, Captions.NO_PERMISSION, CaptionUtility
+ .format(Captions.PERMISSION_CLAIM_SCHEMATIC.getTranslated(), schematic));
return true;
}
}
diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Biome.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Biome.java
index df48c1aed..0d228cc0b 100644
--- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Biome.java
+++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Biome.java
@@ -9,16 +9,17 @@ import com.github.intellectualsites.plotsquared.plot.util.StringMan;
import com.sk89q.worldedit.world.biome.BiomeType;
import com.sk89q.worldedit.world.biome.BiomeTypes;
-@CommandDeclaration(command = "setbiome", permission = "plots.set.biome",
- description = "Set the plot biome", usage = "/plot biome [biome]",
- aliases = {"biome", "sb", "setb", "b"}, category = CommandCategory.APPEARANCE,
- requiredType = RequiredType.NONE) public class Biome extends SetCommand {
+@CommandDeclaration(command = "setbiome", permission = "plots.set.biome", description = "Set the plot biome", usage = "/plot biome [biome]", aliases = {
+ "biome", "sb", "setb",
+ "b"}, category = CommandCategory.APPEARANCE, requiredType = RequiredType.NONE)
+public class Biome extends SetCommand {
@Override public boolean set(final PlotPlayer player, final Plot plot, final String value) {
BiomeType biome = null;
try {
biome = BiomeTypes.get(value.toLowerCase());
- } catch (final Exception ignore) {}
+ } catch (final Exception ignore) {
+ }
if (biome == null) {
String biomes = StringMan
.join(BiomeType.REGISTRY.values(), Captions.BLOCK_LIST_SEPARATOR.getTranslated());
diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Buy.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Buy.java
index f74e6ce27..6e999ab7c 100644
--- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Buy.java
+++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Buy.java
@@ -15,9 +15,8 @@ import com.github.intellectualsites.plotsquared.plot.util.UUIDHandler;
import java.util.Set;
import java.util.concurrent.CompletableFuture;
-@CommandDeclaration(command = "buy", description = "Buy the plot you are standing on",
- usage = "/plot buy", permission = "plots.buy", category = CommandCategory.CLAIMING,
- requiredType = RequiredType.NONE) public class Buy extends Command {
+@CommandDeclaration(command = "buy", description = "Buy the plot you are standing on", usage = "/plot buy", permission = "plots.buy", category = CommandCategory.CLAIMING, requiredType = RequiredType.NONE)
+public class Buy extends Command {
public Buy() {
super(MainCommand.getInstance(), true);
diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Chat.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Chat.java
index c2a3daf84..5cf4948c7 100644
--- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Chat.java
+++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Chat.java
@@ -3,9 +3,8 @@ package com.github.intellectualsites.plotsquared.plot.commands;
import com.github.intellectualsites.plotsquared.commands.CommandDeclaration;
import com.github.intellectualsites.plotsquared.plot.object.PlotPlayer;
-@CommandDeclaration(command = "chat", description = "Toggle plot chat on or off",
- usage = "/plot chat [on|off]", permission = "plots.chat", category = CommandCategory.CHAT,
- requiredType = RequiredType.PLAYER) public class Chat extends SubCommand {
+@CommandDeclaration(command = "chat", description = "Toggle plot chat on or off", usage = "/plot chat [on|off]", permission = "plots.chat", category = CommandCategory.CHAT, requiredType = RequiredType.PLAYER)
+public class Chat extends SubCommand {
@Override public boolean onCommand(PlotPlayer player, String[] args) {
MainCommand.getInstance().toggle.chat(this, player, new String[0], null, null);
diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Claim.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Claim.java
index d54b32117..774c6610f 100644
--- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Claim.java
+++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Claim.java
@@ -17,9 +17,7 @@ import com.github.intellectualsites.plotsquared.plot.util.Permissions;
import com.github.intellectualsites.plotsquared.plot.util.TaskManager;
import com.google.common.primitives.Ints;
-@CommandDeclaration(command = "claim", aliases = "c",
- description = "Claim the current plot you're standing on", category = CommandCategory.CLAIMING,
- requiredType = RequiredType.PLAYER, permission = "plots.claim", usage = "/plot claim")
+@CommandDeclaration(command = "claim", aliases = "c", description = "Claim the current plot you're standing on", category = CommandCategory.CLAIMING, requiredType = RequiredType.PLAYER, permission = "plots.claim", usage = "/plot claim")
public class Claim extends SubCommand {
@Override public boolean onCommand(final PlotPlayer player, String[] args) {
@@ -38,8 +36,7 @@ public class Claim extends SubCommand {
int grants = 0;
if (currentPlots >= player.getAllowedPlots()) {
if (player.hasPersistentMeta("grantedPlots")) {
- grants =
- Ints.fromByteArray(player.getPersistentMeta("grantedPlots"));
+ grants = Ints.fromByteArray(player.getPersistentMeta("grantedPlots"));
if (grants <= 0) {
player.removePersistentMeta("grantedPlots");
return sendMessage(player, Captions.CANT_CLAIM_MORE_PLOTS);
@@ -58,9 +55,8 @@ public class Claim extends SubCommand {
return sendMessage(player, Captions.SCHEMATIC_INVALID,
"non-existent: " + schematic);
}
- if (!Permissions
- .hasPermission(player, CaptionUtility
- .format(Captions.PERMISSION_CLAIM_SCHEMATIC.getTranslated(), schematic))
+ if (!Permissions.hasPermission(player, CaptionUtility
+ .format(Captions.PERMISSION_CLAIM_SCHEMATIC.getTranslated(), schematic))
&& !Permissions
.hasPermission(player, Captions.PERMISSION_ADMIN_COMMAND_SCHEMATIC)) {
return sendMessage(player, Captions.NO_SCHEMATIC_PERMISSION, schematic);
@@ -86,8 +82,7 @@ public class Claim extends SubCommand {
if (grants == 1) {
player.removePersistentMeta("grantedPlots");
} else {
- player.setPersistentMeta("grantedPlots",
- Ints.toByteArray(grants - 1));
+ player.setPersistentMeta("grantedPlots", Ints.toByteArray(grants - 1));
}
sendMessage(player, Captions.REMOVED_GRANTED_PLOT, "1", "" + (grants - 1));
}
diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Clear.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Clear.java
index 07f80e414..8b40c25a9 100644
--- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Clear.java
+++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Clear.java
@@ -16,9 +16,8 @@ import com.github.intellectualsites.plotsquared.plot.util.block.GlobalBlockQueue
import java.util.concurrent.CompletableFuture;
-@CommandDeclaration(command = "clear", description = "Clear the plot you stand on", requiredType = RequiredType.NONE,
- permission = "plots.clear", category = CommandCategory.APPEARANCE, usage = "/plot clear",
- aliases = "reset", confirmation = true) public class Clear extends Command {
+@CommandDeclaration(command = "clear", description = "Clear the plot you stand on", requiredType = RequiredType.NONE, permission = "plots.clear", category = CommandCategory.APPEARANCE, usage = "/plot clear", aliases = "reset", confirmation = true)
+public class Clear extends Command {
// Note: To clear a specific plot use /plot clear
// The syntax also works with any command: /plot
diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Cluster.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Cluster.java
index f1f9a401c..4958a0d89 100644
--- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Cluster.java
+++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Cluster.java
@@ -22,10 +22,8 @@ import java.util.HashSet;
import java.util.Set;
import java.util.UUID;
-@CommandDeclaration(command = "cluster", aliases = "clusters",
- category = CommandCategory.ADMINISTRATION, requiredType = RequiredType.NONE,
- permission = "plots.cluster", description = "Manage a plot cluster") public class Cluster
- extends SubCommand {
+@CommandDeclaration(command = "cluster", aliases = "clusters", category = CommandCategory.ADMINISTRATION, requiredType = RequiredType.NONE, permission = "plots.cluster", description = "Manage a plot cluster")
+public class Cluster extends SubCommand {
@Override public boolean onCommand(PlotPlayer player, String[] args) {
diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Comment.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Comment.java
index 171a5bfe5..0120063d8 100644
--- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Comment.java
+++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Comment.java
@@ -16,8 +16,8 @@ import com.github.intellectualsites.plotsquared.plot.util.UUIDHandler;
import java.util.Arrays;
import java.util.Map.Entry;
-@CommandDeclaration(command = "comment", aliases = {"msg"}, description = "Comment on a plot",
- category = CommandCategory.CHAT, requiredType = RequiredType.PLAYER, permission = "plots.comment")
+@CommandDeclaration(command = "comment", aliases = {
+ "msg"}, description = "Comment on a plot", category = CommandCategory.CHAT, requiredType = RequiredType.PLAYER, permission = "plots.comment")
public class Comment extends SubCommand {
@Override public boolean onCommand(PlotPlayer player, String[] args) {
diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Condense.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Condense.java
index a9341f373..b2cee26f2 100644
--- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Condense.java
+++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Condense.java
@@ -19,10 +19,8 @@ import java.util.List;
import java.util.Set;
import java.util.concurrent.atomic.AtomicBoolean;
-@CommandDeclaration(command = "condense", permission = "plots.admin",
- usage = "/plot condense [radius]",
- description = "Condense a plotworld", category = CommandCategory.ADMINISTRATION,
- requiredType = RequiredType.CONSOLE) public class Condense extends SubCommand {
+@CommandDeclaration(command = "condense", permission = "plots.admin", usage = "/plot condense [radius]", description = "Condense a plotworld", category = CommandCategory.ADMINISTRATION, requiredType = RequiredType.CONSOLE)
+public class Condense extends SubCommand {
public static boolean TASK = false;
diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Confirm.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Confirm.java
index 75a4709b8..fa85ffb18 100644
--- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Confirm.java
+++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Confirm.java
@@ -9,9 +9,8 @@ import com.github.intellectualsites.plotsquared.plot.util.CmdConfirm;
import com.github.intellectualsites.plotsquared.plot.util.MainUtil;
import com.github.intellectualsites.plotsquared.plot.util.TaskManager;
-@CommandDeclaration(command = "confirm", permission = "plots.use",
- description = "Confirm an action", category = CommandCategory.INFO) public class Confirm
- extends SubCommand {
+@CommandDeclaration(command = "confirm", permission = "plots.use", description = "Confirm an action", category = CommandCategory.INFO)
+public class Confirm extends SubCommand {
@Override public boolean onCommand(PlotPlayer player, String[] args) {
CmdInstance command = CmdConfirm.getPending(player);
diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Continue.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Continue.java
index 2da59e2f7..63eebef04 100644
--- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Continue.java
+++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Continue.java
@@ -9,10 +9,8 @@ import com.github.intellectualsites.plotsquared.plot.object.PlotPlayer;
import com.github.intellectualsites.plotsquared.plot.util.MainUtil;
import com.github.intellectualsites.plotsquared.plot.util.Permissions;
-@CommandDeclaration(command = "continue",
- description = "Continue a plot that was previously marked as done",
- permission = "plots.continue", category = CommandCategory.SETTINGS,
- requiredType = RequiredType.PLAYER) public class Continue extends SubCommand {
+@CommandDeclaration(command = "continue", description = "Continue a plot that was previously marked as done", permission = "plots.continue", category = CommandCategory.SETTINGS, requiredType = RequiredType.PLAYER)
+public class Continue extends SubCommand {
@Override public boolean onCommand(PlotPlayer player, String[] args) {
Plot plot = player.getCurrentPlot();
diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Copy.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Copy.java
index de77513bc..43e0af25d 100644
--- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Copy.java
+++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Copy.java
@@ -8,9 +8,9 @@ import com.github.intellectualsites.plotsquared.plot.object.PlotPlayer;
import com.github.intellectualsites.plotsquared.plot.util.MainUtil;
import com.github.intellectualsites.plotsquared.plot.util.Permissions;
-@CommandDeclaration(command = "copy", permission = "plots.copy", aliases = {"copypaste"},
- category = CommandCategory.CLAIMING, description = "Copy a plot", usage = "/plot copy ",
- requiredType = RequiredType.NONE) public class Copy extends SubCommand {
+@CommandDeclaration(command = "copy", permission = "plots.copy", aliases = {
+ "copypaste"}, category = CommandCategory.CLAIMING, description = "Copy a plot", usage = "/plot copy ", requiredType = RequiredType.NONE)
+public class Copy extends SubCommand {
@Override public boolean onCommand(final PlotPlayer player, String[] args) {
Location location = player.getLocation();
diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/CreateRoadSchematic.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/CreateRoadSchematic.java
index 70b5952b1..efc820811 100644
--- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/CreateRoadSchematic.java
+++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/CreateRoadSchematic.java
@@ -9,11 +9,9 @@ import com.github.intellectualsites.plotsquared.plot.object.Plot;
import com.github.intellectualsites.plotsquared.plot.object.PlotPlayer;
import com.github.intellectualsites.plotsquared.plot.util.MainUtil;
-@CommandDeclaration(command = "createroadschematic", aliases = {"crs"},
- category = CommandCategory.ADMINISTRATION, requiredType = RequiredType.PLAYER,
- permission = "plots.createroadschematic",
- description = "Add a road schematic to your world using the roads around your current plot",
- usage = "/plot createroadschematic") public class CreateRoadSchematic extends SubCommand {
+@CommandDeclaration(command = "createroadschematic", aliases = {
+ "crs"}, category = CommandCategory.ADMINISTRATION, requiredType = RequiredType.PLAYER, permission = "plots.createroadschematic", description = "Add a road schematic to your world using the roads around your current plot", usage = "/plot createroadschematic")
+public class CreateRoadSchematic extends SubCommand {
@Override public boolean onCommand(PlotPlayer player, String[] args) {
Location location = player.getLocation();
diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Database.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Database.java
index abbddc9ca..c5573a4cd 100644
--- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Database.java
+++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Database.java
@@ -22,11 +22,9 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map.Entry;
-@CommandDeclaration(command = "database", aliases = {"convert"},
- category = CommandCategory.ADMINISTRATION, permission = "plots.database",
- description = "Convert/Backup Storage", requiredType = RequiredType.CONSOLE,
- usage = "/plot database [area] ") public class Database
- extends SubCommand {
+@CommandDeclaration(command = "database", aliases = {
+ "convert"}, category = CommandCategory.ADMINISTRATION, permission = "plots.database", description = "Convert/Backup Storage", requiredType = RequiredType.CONSOLE, usage = "/plot database [area] ")
+public class Database extends SubCommand {
public static void insertPlots(final SQLManager manager, final List plots,
final PlotPlayer player) {
diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Debug.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Debug.java
index c1970f969..7289c0601 100644
--- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Debug.java
+++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Debug.java
@@ -9,8 +9,7 @@ import com.github.intellectualsites.plotsquared.plot.util.StringMan;
import java.util.Map;
-@CommandDeclaration(command = "debug", category = CommandCategory.DEBUG,
- description = "Show debug information", usage = "/plot debug [msg]", permission = "plots.admin")
+@CommandDeclaration(command = "debug", category = CommandCategory.DEBUG, description = "Show debug information", usage = "/plot debug [msg]", permission = "plots.admin")
public class Debug extends SubCommand {
@Override public boolean onCommand(PlotPlayer player, String[] args) {
@@ -19,7 +18,6 @@ public class Debug extends SubCommand {
MainUtil.sendMessage(player,
"Key: " + meta.getKey() + " Value: " + meta.getValue().toString() + " , ");
}
- ;
}
if ((args.length > 0) && args[0].equalsIgnoreCase("msg")) {
StringBuilder msg = new StringBuilder();
diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/DebugAllowUnsafe.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/DebugAllowUnsafe.java
index 8413eae22..8a651cde3 100644
--- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/DebugAllowUnsafe.java
+++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/DebugAllowUnsafe.java
@@ -8,10 +8,8 @@ import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
-@CommandDeclaration(command = "debugallowunsafe",
- description = "Allow unsafe actions until toggled off", usage = "/plot debugallowunsafe",
- category = CommandCategory.DEBUG, requiredType = RequiredType.NONE,
- permission = "plots.debugallowunsafe") public class DebugAllowUnsafe extends SubCommand {
+@CommandDeclaration(command = "debugallowunsafe", description = "Allow unsafe actions until toggled off", usage = "/plot debugallowunsafe", category = CommandCategory.DEBUG, requiredType = RequiredType.NONE, permission = "plots.debugallowunsafe")
+public class DebugAllowUnsafe extends SubCommand {
public static final List unsafeAllowed = new ArrayList<>();
diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/DebugClaimTest.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/DebugClaimTest.java
index 3c8b854e5..51630753c 100644
--- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/DebugClaimTest.java
+++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/DebugClaimTest.java
@@ -56,7 +56,8 @@ public class DebugClaimTest extends SubCommand {
PlotManager manager = area.getPlotManager();
CompletableFuture.runAsync(() -> {
ArrayList ids = MainUtil.getPlotSelectionIds(min, max);
- MainUtil.sendMessage(player, "&3Sign Block&8->&3Plot&8: " + ids.size() + " plot ids to check!");
+ MainUtil.sendMessage(player,
+ "&3Sign Block&8->&3Plot&8: " + ids.size() + " plot ids to check!");
for (PlotId id : ids) {
Plot plot = area.getPlotAbs(id);
if (plot.hasOwner()) {
@@ -74,7 +75,8 @@ public class DebugClaimTest extends SubCommand {
BiMap map = UUIDHandler.getUuidMap();
UUID uuid = map.get(new StringWrapper(line));
if (uuid == null) {
- for (Map.Entry stringWrapperUUIDEntry : map.entrySet()) {
+ for (Map.Entry stringWrapperUUIDEntry : map
+ .entrySet()) {
if (stringWrapperUUIDEntry.getKey().value.toLowerCase()
.startsWith(line.toLowerCase())) {
uuid = stringWrapperUUIDEntry.getValue();
@@ -86,11 +88,13 @@ public class DebugClaimTest extends SubCommand {
uuid = UUIDHandler.getUUID(line, null);
}
if (uuid != null) {
- MainUtil.sendMessage(player, " - &aFound plot: " + plot.getId() + " : " + line);
+ MainUtil.sendMessage(player,
+ " - &aFound plot: " + plot.getId() + " : " + line);
plot.setOwner(uuid);
MainUtil.sendMessage(player, " - &8Updated plot: " + plot.getId());
} else {
- MainUtil.sendMessage(player, " - &cInvalid PlayerName: " + plot.getId() + " : " + line);
+ MainUtil.sendMessage(player,
+ " - &cInvalid PlayerName: " + plot.getId() + " : " + line);
}
}
}
diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/DebugExec.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/DebugExec.java
index 8bafa55b7..e8a59e8ff 100644
--- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/DebugExec.java
+++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/DebugExec.java
@@ -55,9 +55,8 @@ import java.util.List;
import java.util.UUID;
import java.util.concurrent.CompletableFuture;
-@CommandDeclaration(command = "debugexec", permission = "plots.admin",
- description = "Mutli-purpose debug command", aliases = {"exec", "$"},
- category = CommandCategory.DEBUG) public class DebugExec extends SubCommand {
+@CommandDeclaration(command = "debugexec", permission = "plots.admin", description = "Mutli-purpose debug command", aliases = {
+ "exec", "$"}, category = CommandCategory.DEBUG) public class DebugExec extends SubCommand {
private ScriptEngine engine;
private Bindings scope;
@@ -306,8 +305,8 @@ import java.util.concurrent.CompletableFuture;
System.getProperty("line.separator"));
new Command(MainCommand.getInstance(), true, args[1].split("\\.")[0], null,
RequiredType.NONE, CommandCategory.DEBUG) {
- @Override public CompletableFuture execute(PlotPlayer player, String[] args,
- RunnableVal3 confirm,
+ @Override public CompletableFuture execute(PlotPlayer player,
+ String[] args, RunnableVal3 confirm,
RunnableVal2 whenDone) {
try {
DebugExec.this.scope.put("PlotPlayer", player);
diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/DebugFixFlags.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/DebugFixFlags.java
index ca848a6bb..64f42752f 100644
--- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/DebugFixFlags.java
+++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/DebugFixFlags.java
@@ -16,9 +16,7 @@ import java.util.HashMap;
import java.util.Iterator;
import java.util.Map.Entry;
-@CommandDeclaration(command = "debugfixflags", usage = "/plot debugfixflags ",
- permission = "plots.debugfixflags", description = "Attempt to fix all flags for a world",
- requiredType = RequiredType.CONSOLE, category = CommandCategory.DEBUG)
+@CommandDeclaration(command = "debugfixflags", usage = "/plot debugfixflags ", permission = "plots.debugfixflags", description = "Attempt to fix all flags for a world", requiredType = RequiredType.CONSOLE, category = CommandCategory.DEBUG)
public class DebugFixFlags extends SubCommand {
public DebugFixFlags() {
diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/DebugImportWorlds.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/DebugImportWorlds.java
index 978c95e34..de55f81b9 100644
--- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/DebugImportWorlds.java
+++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/DebugImportWorlds.java
@@ -18,9 +18,8 @@ import java.io.File;
import java.util.UUID;
import java.util.concurrent.CompletableFuture;
-@CommandDeclaration(command = "debugimportworlds", permission = "plots.admin",
- description = "Import worlds by player name", requiredType = RequiredType.CONSOLE,
- category = CommandCategory.TELEPORT) public class DebugImportWorlds extends Command {
+@CommandDeclaration(command = "debugimportworlds", permission = "plots.admin", description = "Import worlds by player name", requiredType = RequiredType.CONSOLE, category = CommandCategory.TELEPORT)
+public class DebugImportWorlds extends Command {
public DebugImportWorlds() {
super(MainCommand.getInstance(), true);
}
diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/DebugLoadTest.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/DebugLoadTest.java
index f12ce8d1e..bbc972438 100644
--- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/DebugLoadTest.java
+++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/DebugLoadTest.java
@@ -5,10 +5,8 @@ import com.github.intellectualsites.plotsquared.plot.PlotSquared;
import com.github.intellectualsites.plotsquared.plot.database.DBFunc;
import com.github.intellectualsites.plotsquared.plot.object.PlotPlayer;
-@CommandDeclaration(command = "debugloadtest", permission = "plots.debugloadtest",
- description = "This debug command will force the reload of all plots in the DB",
- usage = "/plot debugloadtest", category = CommandCategory.DEBUG,
- requiredType = RequiredType.CONSOLE) public class DebugLoadTest extends SubCommand {
+@CommandDeclaration(command = "debugloadtest", permission = "plots.debugloadtest", description = "This debug command will force the reload of all plots in the DB", usage = "/plot debugloadtest", category = CommandCategory.DEBUG, requiredType = RequiredType.CONSOLE)
+public class DebugLoadTest extends SubCommand {
@Override public boolean onCommand(PlotPlayer player, String[] args) {
PlotSquared.get().plots_tmp = DBFunc.getPlots();
diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/DebugPaste.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/DebugPaste.java
index 426b46eaa..a9351edb2 100644
--- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/DebugPaste.java
+++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/DebugPaste.java
@@ -25,9 +25,7 @@ import java.util.Map;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
-@CommandDeclaration(command = "debugpaste", aliases = "dp", usage = "/plot debugpaste",
- description = "Upload settings.yml, worlds.yml, PlotSquared.use_THIS.yml your latest.log and Multiverse's worlds.yml (if being used) to https://athion.net/ISPaster/paste",
- permission = "plots.debugpaste", category = CommandCategory.DEBUG, confirmation = true, requiredType = RequiredType.NONE)
+@CommandDeclaration(command = "debugpaste", aliases = "dp", usage = "/plot debugpaste", description = "Upload settings.yml, worlds.yml, PlotSquared.use_THIS.yml your latest.log and Multiverse's worlds.yml (if being used) to https://athion.net/ISPaster/paste", permission = "plots.debugpaste", category = CommandCategory.DEBUG, confirmation = true, requiredType = RequiredType.NONE)
public class DebugPaste extends SubCommand {
private static String readFile(@NonNull final File file) throws IOException {
@@ -56,7 +54,8 @@ public class DebugPaste extends SubCommand {
b.append("online_mode: ").append(UUIDHandler.getUUIDWrapper()).append(';')
.append(!Settings.UUID.OFFLINE).append('\n');
b.append("Plugins:");
- for (Map.Entry, Boolean> pluginInfo : PlotSquared.get().IMP.getPluginIds()) {
+ for (Map.Entry, Boolean> pluginInfo : PlotSquared
+ .get().IMP.getPluginIds()) {
Map.Entry nameVersion = pluginInfo.getKey();
String name = nameVersion.getKey();
String version = nameVersion.getValue();
@@ -67,12 +66,17 @@ public class DebugPaste extends SubCommand {
b.append("\n\n# YAY! Now, let's see what we can find in your JVM\n");
Runtime runtime = Runtime.getRuntime();
RuntimeMXBean rb = ManagementFactory.getRuntimeMXBean();
- b.append("Uptime: ").append(TimeUnit.MINUTES.convert(rb.getUptime(), TimeUnit.MILLISECONDS) + " minutes").append('\n');
+ b.append("Uptime: ").append(
+ TimeUnit.MINUTES.convert(rb.getUptime(), TimeUnit.MILLISECONDS) + " minutes")
+ .append('\n');
b.append("JVM Flags: ").append(rb.getInputArguments()).append('\n');
- b.append("Free Memory: ").append(runtime.freeMemory() / 1024 / 1024 + " MB").append('\n');
- b.append("Max Memory: ").append(runtime.maxMemory() / 1024 / 1024 + " MB").append('\n');
+ b.append("Free Memory: ").append(runtime.freeMemory() / 1024 / 1024 + " MB")
+ .append('\n');
+ b.append("Max Memory: ").append(runtime.maxMemory() / 1024 / 1024 + " MB")
+ .append('\n');
b.append("Java Name: ").append(rb.getVmName()).append('\n');
- b.append("Java Version: '").append(System.getProperty("java.version")).append("'\n");
+ b.append("Java Version: '").append(System.getProperty("java.version"))
+ .append("'\n");
b.append("Java Vendor: '").append(System.getProperty("java.vendor")).append("'\n");
b.append("Operating System: '").append(System.getProperty("os.name")).append("'\n");
b.append("OS Version: ").append(System.getProperty("os.version")).append('\n');
@@ -119,12 +123,13 @@ public class DebugPaste extends SubCommand {
}
try {
- final File MultiverseWorlds =
- new File(PlotSquared.get().IMP.getDirectory(), "../Multiverse-Core/worlds.yml");
- incendoPaster
- .addFile(new IncendoPaster.PasteFile("MultiverseCore/worlds.yml", readFile(MultiverseWorlds)));
+ final File MultiverseWorlds = new File(PlotSquared.get().IMP.getDirectory(),
+ "../Multiverse-Core/worlds.yml");
+ incendoPaster.addFile(new IncendoPaster.PasteFile("MultiverseCore/worlds.yml",
+ readFile(MultiverseWorlds)));
} catch (final IOException ignored) {
- MainUtil.sendMessage(player, "&cSkipping Multiverse worlds.yml because the plugin is not in use");
+ MainUtil.sendMessage(player,
+ "&cSkipping Multiverse worlds.yml because the plugin is not in use");
}
try {
diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/DebugRoadRegen.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/DebugRoadRegen.java
index a268f8903..391ec365f 100644
--- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/DebugRoadRegen.java
+++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/DebugRoadRegen.java
@@ -13,10 +13,7 @@ import com.github.intellectualsites.plotsquared.plot.util.MainUtil;
import java.util.Arrays;
-@CommandDeclaration(command = "debugroadregen", usage = DebugRoadRegen.USAGE,
- requiredType = RequiredType.NONE,
- description = "Regenerate roads in the plot or region the user is, based on the road schematic",
- category = CommandCategory.DEBUG, permission = "plots.debugroadregen")
+@CommandDeclaration(command = "debugroadregen", usage = DebugRoadRegen.USAGE, requiredType = RequiredType.NONE, description = "Regenerate roads in the plot or region the user is, based on the road schematic", category = CommandCategory.DEBUG, permission = "plots.debugroadregen")
public class DebugRoadRegen extends SubCommand {
public static final String USAGE = "/plot debugroadregen ";
@@ -67,13 +64,11 @@ public class DebugRoadRegen extends SubCommand {
height = Integer.parseInt(args[0]);
} catch (NumberFormatException ignored) {
MainUtil.sendMessage(player, Captions.NOT_VALID_NUMBER, "(0, 256)");
- MainUtil.sendMessage(player, Captions.COMMAND_SYNTAX,
- DebugRoadRegen.USAGE);
+ MainUtil.sendMessage(player, Captions.COMMAND_SYNTAX, DebugRoadRegen.USAGE);
return false;
}
} else if (args.length != 0) {
- MainUtil.sendMessage(player, Captions.COMMAND_SYNTAX,
- DebugRoadRegen.USAGE);
+ MainUtil.sendMessage(player, Captions.COMMAND_SYNTAX, DebugRoadRegen.USAGE);
return false;
}
diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/DebugSaveTest.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/DebugSaveTest.java
index 0c544d096..2a6a0a129 100644
--- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/DebugSaveTest.java
+++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/DebugSaveTest.java
@@ -9,10 +9,7 @@ import com.github.intellectualsites.plotsquared.plot.util.MainUtil;
import java.util.ArrayList;
-@CommandDeclaration(command = "debugsavetest", permission = "plots.debugsavetest",
- category = CommandCategory.DEBUG, requiredType = RequiredType.CONSOLE,
- usage = "/plot debugsavetest",
- description = "This command will force the recreation of all plots in the DB")
+@CommandDeclaration(command = "debugsavetest", permission = "plots.debugsavetest", category = CommandCategory.DEBUG, requiredType = RequiredType.CONSOLE, usage = "/plot debugsavetest", description = "This command will force the recreation of all plots in the DB")
public class DebugSaveTest extends SubCommand {
@Override public boolean onCommand(final PlotPlayer player, String[] args) {
diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Delete.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Delete.java
index 72c6da126..fdb2bf9fc 100644
--- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Delete.java
+++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Delete.java
@@ -15,10 +15,10 @@ import com.github.intellectualsites.plotsquared.plot.util.Permissions;
import com.github.intellectualsites.plotsquared.plot.util.TaskManager;
-@CommandDeclaration(command = "delete", permission = "plots.delete",
- description = "Delete the plot you stand on", usage = "/plot delete",
- aliases = {"dispose", "del", "unclaim"}, category = CommandCategory.CLAIMING,
- requiredType = RequiredType.NONE, confirmation = true) public class Delete extends SubCommand {
+@CommandDeclaration(command = "delete", permission = "plots.delete", description = "Delete the plot you stand on", usage = "/plot delete", aliases = {
+ "dispose", "del",
+ "unclaim"}, category = CommandCategory.CLAIMING, requiredType = RequiredType.NONE, confirmation = true)
+public class Delete extends SubCommand {
// Note: To delete a specific plot use /plot delete
// The syntax also works with any command: /plot
diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Deny.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Deny.java
index b50e68762..c8dd62bcd 100644
--- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Deny.java
+++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Deny.java
@@ -18,10 +18,9 @@ import com.sk89q.worldedit.world.gamemode.GameModes;
import java.util.Set;
import java.util.UUID;
-@CommandDeclaration(command = "deny", aliases = {"d", "ban"},
- description = "Deny a user from entering a plot", usage = "/plot deny ",
- category = CommandCategory.SETTINGS, requiredType = RequiredType.PLAYER) public class Deny
- extends SubCommand {
+@CommandDeclaration(command = "deny", aliases = {"d",
+ "ban"}, description = "Deny a user from entering a plot", usage = "/plot deny ", category = CommandCategory.SETTINGS, requiredType = RequiredType.PLAYER)
+public class Deny extends SubCommand {
public Deny() {
super(Argument.PlayerName);
diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Desc.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Desc.java
index c3e6ab38d..8e812fd6f 100644
--- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Desc.java
+++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Desc.java
@@ -7,10 +7,10 @@ import com.github.intellectualsites.plotsquared.plot.object.Plot;
import com.github.intellectualsites.plotsquared.plot.object.PlotPlayer;
import com.github.intellectualsites.plotsquared.plot.util.MainUtil;
-@CommandDeclaration(command = "setdescription", permission = "plots.set.desc",
- description = "Set the plot description", usage = "/plot desc ",
- aliases = {"desc", "setdesc", "setd", "description"}, category = CommandCategory.SETTINGS,
- requiredType = RequiredType.PLAYER) public class Desc extends SetCommand {
+@CommandDeclaration(command = "setdescription", permission = "plots.set.desc", description = "Set the plot description", usage = "/plot desc ", aliases = {
+ "desc", "setdesc", "setd",
+ "description"}, category = CommandCategory.SETTINGS, requiredType = RequiredType.PLAYER)
+public class Desc extends SetCommand {
@Override public boolean set(PlotPlayer player, Plot plot, String desc) {
if (desc.isEmpty()) {
diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Dislike.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Dislike.java
index 372231481..6366b28b4 100644
--- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Dislike.java
+++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Dislike.java
@@ -3,10 +3,8 @@ package com.github.intellectualsites.plotsquared.plot.commands;
import com.github.intellectualsites.plotsquared.commands.CommandDeclaration;
import com.github.intellectualsites.plotsquared.plot.object.PlotPlayer;
-@CommandDeclaration(command = "dislike", permission = "plots.dislike",
- description = "Dislike the plot", usage = "/plot dislike [next|purge]",
- category = CommandCategory.INFO, requiredType = RequiredType.PLAYER) public class Dislike
- extends SubCommand {
+@CommandDeclaration(command = "dislike", permission = "plots.dislike", description = "Dislike the plot", usage = "/plot dislike [next|purge]", category = CommandCategory.INFO, requiredType = RequiredType.PLAYER)
+public class Dislike extends SubCommand {
@Override public boolean onCommand(PlotPlayer player, String[] args) {
return Like.handleLike(player, args, false);
diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Done.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Done.java
index e8446cc46..80b2d391f 100644
--- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Done.java
+++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Done.java
@@ -14,9 +14,9 @@ import com.github.intellectualsites.plotsquared.plot.util.Permissions;
import com.github.intellectualsites.plotsquared.plot.util.expiry.ExpireManager;
import com.github.intellectualsites.plotsquared.plot.util.expiry.PlotAnalysis;
-@CommandDeclaration(command = "done", aliases = {"submit"}, description = "Mark a plot as done",
- permission = "plots.done", category = CommandCategory.SETTINGS,
- requiredType = RequiredType.NONE) public class Done extends SubCommand {
+@CommandDeclaration(command = "done", aliases = {
+ "submit"}, description = "Mark a plot as done", permission = "plots.done", category = CommandCategory.SETTINGS, requiredType = RequiredType.NONE)
+public class Done extends SubCommand {
@Override public boolean onCommand(final PlotPlayer player, String[] args) {
Location location = player.getLocation();
diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Download.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Download.java
index 7be230efb..e8d1a9994 100644
--- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Download.java
+++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Download.java
@@ -17,10 +17,9 @@ import com.sk89q.jnbt.CompoundTag;
import java.net.URL;
-@CommandDeclaration(usage = "/plot download [schematic|world]", command = "download",
- aliases = {"dl"}, category = CommandCategory.SCHEMATIC, requiredType = RequiredType.NONE,
- description = "Download your plot", permission = "plots.download") public class Download
- extends SubCommand {
+@CommandDeclaration(usage = "/plot download [schematic|world]", command = "download", aliases = {
+ "dl"}, category = CommandCategory.SCHEMATIC, requiredType = RequiredType.NONE, description = "Download your plot", permission = "plots.download")
+public class Download extends SubCommand {
@Override public boolean onCommand(final PlotPlayer player, String[] args) {
String world = player.getLocation().getWorld();
@@ -35,8 +34,8 @@ import java.net.URL;
MainUtil.sendMessage(player, Captions.PLOT_UNOWNED);
return false;
}
- if ((Settings.Done.REQUIRED_FOR_DOWNLOAD && (!DoneFlag.isDone(plot)))
- && !Permissions.hasPermission(player, Captions.PERMISSION_ADMIN_COMMAND_DOWNLOAD)) {
+ if ((Settings.Done.REQUIRED_FOR_DOWNLOAD && (!DoneFlag.isDone(plot))) && !Permissions
+ .hasPermission(player, Captions.PERMISSION_ADMIN_COMMAND_DOWNLOAD)) {
MainUtil.sendMessage(player, Captions.DONE_NOT_DONE);
return false;
}
diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/FlagCmd.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/FlagCmd.java
index c3cc7d628..8426e9475 100644
--- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/FlagCmd.java
+++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/FlagCmd.java
@@ -30,30 +30,29 @@ import java.util.Map;
import java.util.StringJoiner;
@CommandDeclaration(command = "flag", aliases = {"f",
- "flag"}, usage = "/plot flag ",
- description = "Set plot flags",
- category = CommandCategory.SETTINGS,
- requiredType = RequiredType.NONE,
- permission = "plots.flag")
+ "flag"}, usage = "/plot flag ", description = "Set plot flags", category = CommandCategory.SETTINGS, requiredType = RequiredType.NONE, permission = "plots.flag")
public class FlagCmd extends SubCommand {
- private boolean checkPermValue(PlotPlayer player, PlotFlag, ?> flag, String key, String value) {
+ private boolean checkPermValue(PlotPlayer player, PlotFlag, ?> flag, String key,
+ String value) {
key = key.toLowerCase();
value = value.toLowerCase();
String perm = CaptionUtility
- .format(Captions.PERMISSION_SET_FLAG_KEY_VALUE.getTranslated(), key.toLowerCase(), value.toLowerCase());
+ .format(Captions.PERMISSION_SET_FLAG_KEY_VALUE.getTranslated(), key.toLowerCase(),
+ value.toLowerCase());
if (flag instanceof IntegerFlag && MathMan.isInteger(value)) {
try {
int numeric = Integer.parseInt(value);
perm = perm.substring(0, perm.length() - value.length() - 1);
if (numeric > 0) {
- int checkRange =
- PlotSquared.get().getPlatform().equalsIgnoreCase("bukkit") ? numeric : Settings.Limit.MAX_PLOTS;
+ int checkRange = PlotSquared.get().getPlatform().equalsIgnoreCase("bukkit") ?
+ numeric :
+ Settings.Limit.MAX_PLOTS;
final boolean result = player.hasPermissionRange(perm, checkRange) >= numeric;
if (!result) {
MainUtil.sendMessage(player, Captions.NO_PERMISSION, CaptionUtility
- .format(Captions.PERMISSION_SET_FLAG_KEY_VALUE.getTranslated(), key.toLowerCase(),
- value.toLowerCase()));
+ .format(Captions.PERMISSION_SET_FLAG_KEY_VALUE.getTranslated(),
+ key.toLowerCase(), value.toLowerCase()));
}
return result;
}
@@ -87,13 +86,13 @@ public class FlagCmd extends SubCommand {
PlotFlag extends List>, ?> parsedFlag = listFlag.parse(value);
for (final Object entry : parsedFlag.getValue()) {
final String permission = CaptionUtility
- .format(Captions.PERMISSION_SET_FLAG_KEY_VALUE.getTranslated(), key.toLowerCase(),
- entry.toString().toLowerCase());
+ .format(Captions.PERMISSION_SET_FLAG_KEY_VALUE.getTranslated(),
+ key.toLowerCase(), entry.toString().toLowerCase());
final boolean result = Permissions.hasPermission(player, permission);
if (!result) {
MainUtil.sendMessage(player, Captions.NO_PERMISSION, CaptionUtility
- .format(Captions.PERMISSION_SET_FLAG_KEY_VALUE.getTranslated(), key.toLowerCase(),
- value.toLowerCase()));
+ .format(Captions.PERMISSION_SET_FLAG_KEY_VALUE.getTranslated(),
+ key.toLowerCase(), value.toLowerCase()));
return false;
}
}
@@ -134,8 +133,10 @@ public class FlagCmd extends SubCommand {
sendMessage(player, Captions.PLOT_NOT_CLAIMED);
return false;
}
- if (!plot.isOwner(player.getUUID()) && !Permissions.hasPermission(player, Captions.PERMISSION_SET_FLAG_OTHER)) {
- MainUtil.sendMessage(player, Captions.NO_PERMISSION, Captions.PERMISSION_SET_FLAG_OTHER);
+ if (!plot.isOwner(player.getUUID()) && !Permissions
+ .hasPermission(player, Captions.PERMISSION_SET_FLAG_OTHER)) {
+ MainUtil
+ .sendMessage(player, Captions.NO_PERMISSION, Captions.PERMISSION_SET_FLAG_OTHER);
return false;
}
PlotFlag flag = null;
@@ -145,7 +146,8 @@ public class FlagCmd extends SubCommand {
boolean suggested = false;
try {
StringComparison> stringComparison =
- new StringComparison<>(args[1], GlobalFlagContainer.getInstance().getFlagMap().values());
+ new StringComparison<>(args[1],
+ GlobalFlagContainer.getInstance().getFlagMap().values());
String best = stringComparison.getBestMatch();
if (best != null) {
MainUtil.sendMessage(player, Captions.NOT_VALID_FLAG_SUGGESTED, best);
@@ -164,11 +166,13 @@ public class FlagCmd extends SubCommand {
}
case "set": {
if (!Permissions.hasPermission(player, Captions.PERMISSION_SET_FLAG)) {
- MainUtil.sendMessage(player, Captions.NO_PERMISSION, Captions.PERMISSION_SET_FLAG);
+ MainUtil
+ .sendMessage(player, Captions.NO_PERMISSION, Captions.PERMISSION_SET_FLAG);
return false;
}
if (args.length < 3) {
- MainUtil.sendMessage(player, Captions.COMMAND_SYNTAX, "/plot flag set ");
+ MainUtil.sendMessage(player, Captions.COMMAND_SYNTAX,
+ "/plot flag set ");
return false;
}
String value = StringMan.join(Arrays.copyOfRange(args, 2, args.length), " ");
@@ -188,25 +192,30 @@ public class FlagCmd extends SubCommand {
}
case "remove": {
if (!Permissions.hasPermission(player, Captions.PERMISSION_FLAG_REMOVE)) {
- MainUtil.sendMessage(player, Captions.NO_PERMISSION, Captions.PERMISSION_FLAG_REMOVE);
+ MainUtil.sendMessage(player, Captions.NO_PERMISSION,
+ Captions.PERMISSION_FLAG_REMOVE);
return false;
}
if (args.length != 2 && args.length != 3) {
- MainUtil.sendMessage(player, Captions.COMMAND_SYNTAX, "/plot flag remove [values]");
+ MainUtil.sendMessage(player, Captions.COMMAND_SYNTAX,
+ "/plot flag remove [values]");
return false;
}
- if (!Permissions.hasPermission(player,
- CaptionUtility.format(Captions.PERMISSION_SET_FLAG_KEY.getTranslated(), args[1].toLowerCase()))) {
+ if (!Permissions.hasPermission(player, CaptionUtility
+ .format(Captions.PERMISSION_SET_FLAG_KEY.getTranslated(),
+ args[1].toLowerCase()))) {
if (args.length != 3) {
MainUtil.sendMessage(player, Captions.NO_PERMISSION, CaptionUtility
- .format(Captions.PERMISSION_SET_FLAG_KEY.getTranslated(), args[1].toLowerCase()));
+ .format(Captions.PERMISSION_SET_FLAG_KEY.getTranslated(),
+ args[1].toLowerCase()));
return false;
}
}
if (args.length == 3 && flag instanceof ListFlag) {
String value = StringMan.join(Arrays.copyOfRange(args, 2, args.length), " ");
final ListFlag, ?> listFlag = (ListFlag, ?>) flag;
- final List> list = plot.getFlag((Class extends ListFlag, ?>>) listFlag.getClass());
+ final List> list =
+ plot.getFlag((Class extends ListFlag, ?>>) listFlag.getClass());
final PlotFlag extends List>, ?> parsedFlag;
try {
parsedFlag = listFlag.parse(value);
@@ -250,11 +259,13 @@ public class FlagCmd extends SubCommand {
}
case "add":
if (!Permissions.hasPermission(player, Captions.PERMISSION_FLAG_ADD)) {
- MainUtil.sendMessage(player, Captions.NO_PERMISSION, Captions.PERMISSION_FLAG_ADD);
+ MainUtil
+ .sendMessage(player, Captions.NO_PERMISSION, Captions.PERMISSION_FLAG_ADD);
return false;
}
if (args.length < 3) {
- MainUtil.sendMessage(player, Captions.COMMAND_SYNTAX, "/plot flag add ");
+ MainUtil.sendMessage(player, Captions.COMMAND_SYNTAX,
+ "/plot flag add ");
return false;
}
for (String entry : args[2].split(",")) {
@@ -279,7 +290,8 @@ public class FlagCmd extends SubCommand {
return true;
case "list":
if (!Permissions.hasPermission(player, Captions.PERMISSION_FLAG_LIST)) {
- MainUtil.sendMessage(player, Captions.NO_PERMISSION, Captions.PERMISSION_FLAG_LIST);
+ MainUtil
+ .sendMessage(player, Captions.NO_PERMISSION, Captions.PERMISSION_FLAG_LIST);
return false;
}
if (args.length > 1) {
@@ -287,20 +299,24 @@ public class FlagCmd extends SubCommand {
return false;
}
final Map> flags = new HashMap<>();
- for (PlotFlag, ?> plotFlag : GlobalFlagContainer.getInstance().getRecognizedPlotFlags()) {
+ for (PlotFlag, ?> plotFlag : GlobalFlagContainer.getInstance()
+ .getRecognizedPlotFlags()) {
final String category = plotFlag.getFlagCategory().getTranslated();
- final Collection flagList = flags.computeIfAbsent(category, k -> new ArrayList<>());
+ final Collection flagList =
+ flags.computeIfAbsent(category, k -> new ArrayList<>());
flagList.add(plotFlag.getName());
}
- final Iterator>> iterator = flags.entrySet().iterator();
+ final Iterator>> iterator =
+ flags.entrySet().iterator();
final StringJoiner message = new StringJoiner("\n");
while (iterator.hasNext()) {
final Map.Entry> flagsEntry = iterator.next();
final List flagNames = flagsEntry.getValue();
Collections.sort(flagNames);
- message.add(String.format(Captions.FLAG_LIST_ENTRY.formatted(), flagsEntry.getKey(),
- StringMan.join(flagNames, ", ")));
+ message.add(String
+ .format(Captions.FLAG_LIST_ENTRY.formatted(), flagsEntry.getKey(),
+ StringMan.join(flagNames, ", ")));
}
MainUtil.sendMessage(player, message.toString());
return true;
diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/FlagCommand.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/FlagCommand.java
index cc52673fa..aace9d317 100644
--- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/FlagCommand.java
+++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/FlagCommand.java
@@ -157,8 +157,7 @@ import java.util.Map;
@Override public boolean onCommand(final PlotPlayer player, final String[] args) {
new HelpMenu(player).setCategory(CommandCategory.SETTINGS).setCommands(this.getCommands())
- .generateMaxPages()
- .generatePage(0, getParent().toString()).render();
+ .generateMaxPages().generatePage(0, getParent().toString()).render();
return true;
}
@@ -229,8 +228,7 @@ import java.util.Map;
.send(player, e.getFlag().getName(), e.getValue(), e.getErrorMessage());
return;
}
- boolean result = player.getLocation().getPlotAbs()
- .setFlag(flag.merge(parsed.getValue()));
+ boolean result = player.getLocation().getPlotAbs().setFlag(flag.merge(parsed.getValue()));
if (!result) {
MainUtil.sendMessage(player, Captions.FLAG_NOT_ADDED);
return;
@@ -247,18 +245,20 @@ import java.util.Map;
return;
}
if (args.length != 1 && args.length != 2) {
- MainUtil.sendMessage(player, Captions.COMMAND_SYNTAX, "/plot flag remove [values]");
+ MainUtil
+ .sendMessage(player, Captions.COMMAND_SYNTAX, "/plot flag remove [values]");
return;
}
final PlotFlag, ?> flag = getFlag(player, args[0]);
if (flag == null) {
return;
}
- if (!Permissions.hasPermission(player,
- CaptionUtility.format(Captions.PERMISSION_SET_FLAG_KEY.getTranslated(), args[0].toLowerCase()))) {
+ if (!Permissions.hasPermission(player, CaptionUtility
+ .format(Captions.PERMISSION_SET_FLAG_KEY.getTranslated(), args[0].toLowerCase()))) {
if (args.length != 2) {
MainUtil.sendMessage(player, Captions.NO_PERMISSION, CaptionUtility
- .format(Captions.PERMISSION_SET_FLAG_KEY.getTranslated(), args[0].toLowerCase()));
+ .format(Captions.PERMISSION_SET_FLAG_KEY.getTranslated(),
+ args[0].toLowerCase()));
return;
}
}
@@ -266,7 +266,8 @@ import java.util.Map;
if (args.length == 2 && flag instanceof ListFlag) {
String value = StringMan.join(Arrays.copyOfRange(args, 1, args.length), " ");
final ListFlag, ?> listFlag = (ListFlag, ?>) flag;
- final List> list = plot.getFlag((Class extends ListFlag, ?>>) listFlag.getClass());
+ final List> list =
+ plot.getFlag((Class extends ListFlag, ?>>) listFlag.getClass());
final PlotFlag extends List>, ?> parsedFlag;
try {
parsedFlag = listFlag.parse(value);
@@ -325,20 +326,22 @@ import java.util.Map;
final Map> flags = new HashMap<>();
for (PlotFlag, ?> plotFlag : GlobalFlagContainer.getInstance().getRecognizedPlotFlags()) {
final String category = plotFlag.getFlagCategory().getTranslated();
- final Collection flagList = flags.computeIfAbsent(category, k -> new ArrayList<>());
+ final Collection flagList =
+ flags.computeIfAbsent(category, k -> new ArrayList<>());
flagList.add(plotFlag.getName());
}
for (final Map.Entry> entry : flags.entrySet()) {
Collections.sort(entry.getValue());
- PlotMessage plotMessage = new PlotMessage(entry.getKey() + ": ").color(Captions.FLAG_INFO_COLOR_KEY.getTranslated());
+ PlotMessage plotMessage = new PlotMessage(entry.getKey() + ": ")
+ .color(Captions.FLAG_INFO_COLOR_KEY.getTranslated());
final Iterator flagIterator = entry.getValue().iterator();
while (flagIterator.hasNext()) {
final String flag = flagIterator.next();
plotMessage = plotMessage.text(flag).command("/plot flag info " + flag)
- .color(Captions.FLAG_INFO_COLOR_VALUE.getTranslated())
- .tooltip(new PlotMessage(Captions.FLAG_LIST_SEE_INFO.getTranslated())
- .color(Captions.FLAG_INFO_COLOR_VALUE.getTranslated()));
+ .color(Captions.FLAG_INFO_COLOR_VALUE.getTranslated()).tooltip(
+ new PlotMessage(Captions.FLAG_LIST_SEE_INFO.getTranslated())
+ .color(Captions.FLAG_INFO_COLOR_VALUE.getTranslated()));
if (flagIterator.hasNext()) {
plotMessage = plotMessage.text(", ")
.color(Captions.FLAG_INFO_COLOR_VALUE.getTranslated());
diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Grant.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Grant.java
index 9a6e74d57..764bf5ae0 100644
--- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Grant.java
+++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Grant.java
@@ -17,9 +17,8 @@ import com.google.common.primitives.Ints;
import java.util.UUID;
import java.util.concurrent.CompletableFuture;
-@CommandDeclaration(command = "grant", category = CommandCategory.CLAIMING,
- usage = "/plot grant [player]", permission = "plots.grant",
- requiredType = RequiredType.NONE) public class Grant extends Command {
+@CommandDeclaration(command = "grant", category = CommandCategory.CLAIMING, usage = "/plot grant [player]", permission = "plots.grant", requiredType = RequiredType.NONE)
+public class Grant extends Command {
public Grant() {
super(MainCommand.getInstance(), true);
diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Help.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Help.java
index 7949df513..b61771e15 100644
--- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Help.java
+++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Help.java
@@ -14,8 +14,7 @@ import com.github.intellectualsites.plotsquared.plot.util.helpmenu.HelpMenu;
import java.util.concurrent.CompletableFuture;
-@CommandDeclaration(command = "help", description = "Get this help menu", aliases = "?",
- category = CommandCategory.INFO, usage = "help [category|#]", permission = "plots.use")
+@CommandDeclaration(command = "help", description = "Get this help menu", aliases = "?", category = CommandCategory.INFO, usage = "help [category|#]", permission = "plots.use")
public class Help extends Command {
public Help(Command parent) {
super(parent, true);
@@ -56,7 +55,8 @@ public class Help extends Command {
return CompletableFuture.completedFuture(true);
}
- public CompletableFuture displayHelp(final CommandCaller player, final String catRaw, final int page) {
+ public CompletableFuture displayHelp(final CommandCaller player, final String catRaw,
+ final int page) {
return CompletableFuture.supplyAsync(() -> {
String cat = catRaw;
@@ -81,12 +81,11 @@ public class Help extends Command {
for (CommandCategory c : CommandCategory.values()) {
builder.append("\n").append(StringMan
.replaceAll(Captions.HELP_INFO_ITEM.getTranslated(), "%category%",
- c.toString().toLowerCase(),
- "%category_desc%", c.toString()));
+ c.toString().toLowerCase(), "%category_desc%", c.toString()));
}
- builder.append("\n")
- .append(Captions.HELP_INFO_ITEM.getTranslated().replaceAll("%category%", "all")
- .replaceAll("%category_desc%", "Display all commands"));
+ builder.append("\n").append(
+ Captions.HELP_INFO_ITEM.getTranslated().replaceAll("%category%", "all")
+ .replaceAll("%category_desc%", "Display all commands"));
builder.append("\n").append(Captions.HELP_FOOTER.getTranslated());
MainUtil.sendMessage(player, builder.toString(), false);
return true;
diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Inbox.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Inbox.java
index 030ef0f44..d302cb90e 100644
--- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Inbox.java
+++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Inbox.java
@@ -13,8 +13,7 @@ import com.github.intellectualsites.plotsquared.plot.util.StringMan;
import java.util.List;
-@CommandDeclaration(command = "inbox", description = "Review the comments for a plot",
- usage = "/plot inbox [inbox] [delete |clear|page]", permission = "plots.inbox", category = CommandCategory.CHAT, requiredType = RequiredType.PLAYER)
+@CommandDeclaration(command = "inbox", description = "Review the comments for a plot", usage = "/plot inbox [inbox] [delete |clear|page]", permission = "plots.inbox", category = CommandCategory.CHAT, requiredType = RequiredType.PLAYER)
public class Inbox extends SubCommand {
public void displayComments(PlotPlayer player, List oldComments, int page) {
@@ -40,8 +39,7 @@ public class Inbox extends SubCommand {
StringBuilder string = new StringBuilder();
string.append(StringMan
.replaceAll(Captions.COMMENT_LIST_HEADER_PAGED.getTranslated(), "%amount%",
- comments.length, "%cur",
- page + 1, "%max", totalPages + 1, "%word", "all") + '\n');
+ comments.length, "%cur", page + 1, "%max", totalPages + 1, "%word", "all") + '\n');
// This might work xD
for (int x = page * 12; x < max; x++) {
diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Info.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Info.java
index 5446ee887..e45faff75 100644
--- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Info.java
+++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Info.java
@@ -15,8 +15,7 @@ import com.github.intellectualsites.plotsquared.plot.util.expiry.ExpireManager;
import java.util.UUID;
-@CommandDeclaration(command = "info", aliases = "i", description = "Display plot info",
- usage = "/plot info [-f, to force info]", category = CommandCategory.INFO)
+@CommandDeclaration(command = "info", aliases = "i", description = "Display plot info", usage = "/plot info [-f, to force info]", category = CommandCategory.INFO)
public class Info extends SubCommand {
@Override public boolean onCommand(final PlotPlayer player, String[] args) {
diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Kick.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Kick.java
index b453abeb3..64803a224 100644
--- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Kick.java
+++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Kick.java
@@ -17,9 +17,8 @@ import java.util.HashSet;
import java.util.Set;
import java.util.UUID;
-@CommandDeclaration(command = "kick", aliases = "k", description = "Kick a player from your plot",
- permission = "plots.kick", usage = "/plot kick ", category = CommandCategory.TELEPORT,
- requiredType = RequiredType.PLAYER) public class Kick extends SubCommand {
+@CommandDeclaration(command = "kick", aliases = "k", description = "Kick a player from your plot", permission = "plots.kick", usage = "/plot kick ", category = CommandCategory.TELEPORT, requiredType = RequiredType.PLAYER)
+public class Kick extends SubCommand {
public Kick() {
super(Argument.PlayerName);
diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Leave.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Leave.java
index 187977b2b..ed3652944 100644
--- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Leave.java
+++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Leave.java
@@ -13,10 +13,8 @@ import com.github.intellectualsites.plotsquared.plot.util.MainUtil;
import java.util.UUID;
import java.util.concurrent.CompletableFuture;
-@CommandDeclaration(command = "leave",
- description = "Removes self from being trusted or a member of the plot",
- permission = "plots.leave", usage = "/plot leave", category = CommandCategory.CLAIMING,
- requiredType = RequiredType.PLAYER) public class Leave extends Command {
+@CommandDeclaration(command = "leave", description = "Removes self from being trusted or a member of the plot", permission = "plots.leave", usage = "/plot leave", category = CommandCategory.CLAIMING, requiredType = RequiredType.PLAYER)
+public class Leave extends Command {
public Leave() {
super(MainCommand.getInstance(), true);
}
diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Like.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Like.java
index 191ca458f..4e1ae61d8 100644
--- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Like.java
+++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Like.java
@@ -21,9 +21,8 @@ import java.util.HashMap;
import java.util.List;
import java.util.UUID;
-@CommandDeclaration(command = "like", permission = "plots.like", description = "Like the plot",
- usage = "/plot like [next|purge]", category = CommandCategory.INFO,
- requiredType = RequiredType.PLAYER) public class Like extends SubCommand {
+@CommandDeclaration(command = "like", permission = "plots.like", description = "Like the plot", usage = "/plot like [next|purge]", category = CommandCategory.INFO, requiredType = RequiredType.PLAYER)
+public class Like extends SubCommand {
protected static boolean handleLike(final PlotPlayer player, String[] args,
final boolean like) {
@@ -41,8 +40,8 @@ import java.util.UUID;
return v2 > v1 ? 1 : -1;
});
for (final Plot plot : plots) {
- if ((!Settings.Done.REQUIRED_FOR_RATINGS || DoneFlag.isDone(plot))
- && plot.isBasePlot() && (!plot.getLikes().containsKey(uuid))) {
+ if ((!Settings.Done.REQUIRED_FOR_RATINGS || DoneFlag.isDone(plot)) && plot
+ .isBasePlot() && (!plot.getLikes().containsKey(uuid))) {
plot.teleportPlayer(player, TeleportCause.COMMAND);
MainUtil.sendMessage(player, Captions.RATE_THIS);
return true;
diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/ListCmd.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/ListCmd.java
index 1605fc397..a04a7c4a2 100644
--- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/ListCmd.java
+++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/ListCmd.java
@@ -28,9 +28,8 @@ import java.util.List;
import java.util.Map.Entry;
import java.util.UUID;
-@CommandDeclaration(command = "list", aliases = {"l", "find", "search"}, description = "List plots",
- permission = "plots.list", category = CommandCategory.INFO,
- usage = "/plot list > [#]")
+@CommandDeclaration(command = "list", aliases = {"l", "find",
+ "search"}, description = "List plots", permission = "plots.list", category = CommandCategory.INFO, usage = "/plot list > [#]")
public class ListCmd extends SubCommand {
private String[] getArgumentList(PlotPlayer player) {
@@ -137,11 +136,10 @@ public class ListCmd extends SubCommand {
Captions.PERMISSION_LIST_WORLD);
return false;
}
- if (!Permissions
- .hasPermission(player,
- CaptionUtility.format(Captions.PERMISSION_LIST_WORLD_NAME.getTranslated(), world))) {
- MainUtil.sendMessage(player, Captions.NO_PERMISSION,
- CaptionUtility.format(Captions.PERMISSION_LIST_WORLD_NAME.getTranslated(), world));
+ if (!Permissions.hasPermission(player, CaptionUtility
+ .format(Captions.PERMISSION_LIST_WORLD_NAME.getTranslated(), world))) {
+ MainUtil.sendMessage(player, Captions.NO_PERMISSION, CaptionUtility
+ .format(Captions.PERMISSION_LIST_WORLD_NAME.getTranslated(), world));
return false;
}
plots = new ArrayList<>(PlotSquared.get().getPlots(world));
@@ -162,11 +160,10 @@ public class ListCmd extends SubCommand {
.sendMessage(player, Captions.NO_PERMISSION, Captions.PERMISSION_LIST_AREA);
return false;
}
- if (!Permissions
- .hasPermission(player,
- CaptionUtility.format(Captions.PERMISSION_LIST_WORLD_NAME.getTranslated(), world))) {
- MainUtil.sendMessage(player, Captions.NO_PERMISSION,
- CaptionUtility.format(Captions.PERMISSION_LIST_WORLD_NAME.getTranslated(), world));
+ if (!Permissions.hasPermission(player, CaptionUtility
+ .format(Captions.PERMISSION_LIST_WORLD_NAME.getTranslated(), world))) {
+ MainUtil.sendMessage(player, Captions.NO_PERMISSION, CaptionUtility
+ .format(Captions.PERMISSION_LIST_WORLD_NAME.getTranslated(), world));
return false;
}
plots = area == null ? new ArrayList() : new ArrayList<>(area.getPlots());
@@ -308,9 +305,8 @@ public class ListCmd extends SubCommand {
Captions.PERMISSION_LIST_WORLD);
return false;
}
- if (!Permissions
- .hasPermission(player, CaptionUtility
- .format(Captions.PERMISSION_LIST_WORLD_NAME.getTranslated(), args[0]))) {
+ if (!Permissions.hasPermission(player, CaptionUtility
+ .format(Captions.PERMISSION_LIST_WORLD_NAME.getTranslated(), args[0]))) {
MainUtil.sendMessage(player, Captions.NO_PERMISSION, CaptionUtility
.format(Captions.PERMISSION_LIST_WORLD_NAME.getTranslated(), args[0]));
return false;
diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Load.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Load.java
index 4b0305969..87b7d28b6 100644
--- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Load.java
+++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Load.java
@@ -19,9 +19,8 @@ import java.net.MalformedURLException;
import java.net.URL;
import java.util.List;
-@CommandDeclaration(command = "load", aliases = "restore", category = CommandCategory.SCHEMATIC,
- requiredType = RequiredType.NONE, description = "Load your plot", permission = "plots.load",
- usage = "/plot load") public class Load extends SubCommand {
+@CommandDeclaration(command = "load", aliases = "restore", category = CommandCategory.SCHEMATIC, requiredType = RequiredType.NONE, description = "Load your plot", permission = "plots.load", usage = "/plot load")
+public class Load extends SubCommand {
@Override public boolean onCommand(final PlotPlayer player, String[] args) {
String world = player.getLocation().getWorld();
diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/MainCommand.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/MainCommand.java
index 696c0752e..c754ed78a 100644
--- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/MainCommand.java
+++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/MainCommand.java
@@ -23,9 +23,8 @@ import java.util.concurrent.CompletableFuture;
/**
* PlotSquared command class.
*/
-@CommandDeclaration(command = "plot",
- aliases = {"plots", "p", "plotsquared", "plot2", "p2", "ps", "2", "plotme", "plotz", "ap"})
-public class MainCommand extends Command {
+@CommandDeclaration(command = "plot", aliases = {"plots", "p", "plotsquared", "plot2", "p2", "ps",
+ "2", "plotme", "plotz", "ap"}) public class MainCommand extends Command {
private static MainCommand instance;
public Help help;
@@ -208,7 +207,8 @@ public class MainCommand extends Command {
PlotArea area = player.getApplicablePlotArea();
Plot newPlot = Plot.fromString(area, args[0]);
if (newPlot != null && (player instanceof ConsolePlayer || newPlot.getArea()
- .equals(area) || Permissions.hasPermission(player, Captions.PERMISSION_ADMIN) || Permissions.hasPermission(player, Captions.PERMISSION_ADMIN_SUDO_AREA))
+ .equals(area) || Permissions.hasPermission(player, Captions.PERMISSION_ADMIN)
+ || Permissions.hasPermission(player, Captions.PERMISSION_ADMIN_SUDO_AREA))
&& !newPlot.isDenied(player.getUUID())) {
Location newLoc = newPlot.getCenter();
if (player.canTeleport(newLoc)) {
diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Merge.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Merge.java
index 43204b266..735ffc274 100644
--- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Merge.java
+++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Merge.java
@@ -20,10 +20,7 @@ import java.util.UUID;
import static com.github.intellectualsites.plotsquared.plot.object.Direction.getFromIndex;
-@CommandDeclaration(command = "merge", aliases = "m",
- description = "Merge the plot you are standing on with another plot",
- permission = "plots.merge", usage = "/plot merge [removeroads]",
- category = CommandCategory.SETTINGS, requiredType = RequiredType.NONE, confirmation = true)
+@CommandDeclaration(command = "merge", aliases = "m", description = "Merge the plot you are standing on with another plot", permission = "plots.merge", usage = "/plot merge [removeroads]", category = CommandCategory.SETTINGS, requiredType = RequiredType.NONE, confirmation = true)
public class Merge extends SubCommand {
public static final String[] values = new String[] {"north", "east", "south", "west", "auto"};
@@ -160,8 +157,7 @@ public class Merge extends SubCommand {
}
Plot adjacent = plot.getRelative(direction);
if (adjacent == null || !adjacent.hasOwner() || adjacent
- .getMerged((direction.getIndex() + 2) % 4)
- || adjacent.isOwner(uuid)) {
+ .getMerged((direction.getIndex() + 2) % 4) || adjacent.isOwner(uuid)) {
MainUtil.sendMessage(player, Captions.NO_AVAILABLE_AUTOMERGE);
return false;
}
diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Middle.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Middle.java
index 95e07f9cd..d4484881b 100644
--- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Middle.java
+++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Middle.java
@@ -10,10 +10,9 @@ import com.github.intellectualsites.plotsquared.plot.object.TeleportCause;
/**
* @author manuelgu, altered by Citymonstret
*/
-@CommandDeclaration(command = "middle", aliases = {"center", "centre"},
- description = "Teleports you to the center of the plot", usage = "/plot middle",
- category = CommandCategory.TELEPORT, requiredType = RequiredType.PLAYER) public class Middle
- extends SubCommand {
+@CommandDeclaration(command = "middle", aliases = {"center",
+ "centre"}, description = "Teleports you to the center of the plot", usage = "/plot middle", category = CommandCategory.TELEPORT, requiredType = RequiredType.PLAYER)
+public class Middle extends SubCommand {
@Override public boolean onCommand(PlotPlayer player, String[] arguments) {
Location location = player.getLocation();
diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Move.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Move.java
index 02c7494cb..20ce8d4a5 100644
--- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Move.java
+++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Move.java
@@ -10,9 +10,8 @@ import com.github.intellectualsites.plotsquared.plot.object.PlotPlayer;
import com.github.intellectualsites.plotsquared.plot.util.MainUtil;
import com.github.intellectualsites.plotsquared.plot.util.Permissions;
-@CommandDeclaration(usage = "/plot move ", command = "move", description = "Move a plot",
- permission = "plots.move", category = CommandCategory.CLAIMING,
- requiredType = RequiredType.PLAYER) public class Move extends SubCommand {
+@CommandDeclaration(usage = "/plot move ", command = "move", description = "Move a plot", permission = "plots.move", category = CommandCategory.CLAIMING, requiredType = RequiredType.PLAYER)
+public class Move extends SubCommand {
@Override public boolean onCommand(final PlotPlayer player, String[] args) {
Location location = player.getLocation();
diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Music.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Music.java
index a1ad2d472..4332ec05e 100644
--- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Music.java
+++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Music.java
@@ -13,10 +13,8 @@ import java.util.Arrays;
import java.util.Collection;
import java.util.Locale;
-@CommandDeclaration(command = "music", permission = "plots.music",
- description = "Play music in your plot", usage = "/plot music",
- category = CommandCategory.APPEARANCE, requiredType = RequiredType.PLAYER) public class Music
- extends SubCommand {
+@CommandDeclaration(command = "music", permission = "plots.music", description = "Play music in your plot", usage = "/plot music", category = CommandCategory.APPEARANCE, requiredType = RequiredType.PLAYER)
+public class Music extends SubCommand {
private static final Collection DISCS = Arrays
.asList("music_disc_13", "music_disc_cat", "music_disc_blocks", "music_disc_chirp",
diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Near.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Near.java
index d897fb3cf..8cc18b38b 100644
--- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Near.java
+++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Near.java
@@ -11,8 +11,7 @@ import com.github.intellectualsites.plotsquared.plot.util.StringMan;
import java.util.concurrent.CompletableFuture;
-@CommandDeclaration(command = "near", aliases = "n", description = "Display nearby players",
- usage = "/plot near", category = CommandCategory.INFO, requiredType = RequiredType.PLAYER)
+@CommandDeclaration(command = "near", aliases = "n", description = "Display nearby players", usage = "/plot near", category = CommandCategory.INFO, requiredType = RequiredType.PLAYER)
public class Near extends Command {
public Near() {
super(MainCommand.getInstance(), true);
diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Owner.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Owner.java
index 82ec9f652..e823485ae 100644
--- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Owner.java
+++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Owner.java
@@ -14,10 +14,10 @@ import com.github.intellectualsites.plotsquared.plot.util.UUIDHandler;
import java.util.Set;
import java.util.UUID;
-@CommandDeclaration(command = "setowner", permission = "plots.set.owner",
- description = "Set the plot owner", usage = "/plot setowner ",
- aliases = {"owner", "so", "seto"}, category = CommandCategory.CLAIMING,
- requiredType = RequiredType.NONE, confirmation = true) public class Owner extends SetCommand {
+@CommandDeclaration(command = "setowner", permission = "plots.set.owner", description = "Set the plot owner", usage = "/plot setowner ", aliases = {
+ "owner", "so",
+ "seto"}, category = CommandCategory.CLAIMING, requiredType = RequiredType.NONE, confirmation = true)
+public class Owner extends SetCommand {
@Override public boolean set(final PlotPlayer player, final Plot plot, String value) {
if (value == null || value.isEmpty()) {
diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/PluginCmd.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/PluginCmd.java
index 8e31051fb..35c9fae40 100644
--- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/PluginCmd.java
+++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/PluginCmd.java
@@ -8,9 +8,8 @@ import com.github.intellectualsites.plotsquared.plot.util.HttpUtil;
import com.github.intellectualsites.plotsquared.plot.util.MainUtil;
import com.github.intellectualsites.plotsquared.plot.util.TaskManager;
-@CommandDeclaration(command = "plugin", permission = "plots.use",
- description = "Show plugin information", usage = "/plot plugin", aliases = "version",
- category = CommandCategory.INFO) public class PluginCmd extends SubCommand {
+@CommandDeclaration(command = "plugin", permission = "plots.use", description = "Show plugin information", usage = "/plot plugin", aliases = "version", category = CommandCategory.INFO)
+public class PluginCmd extends SubCommand {
@Override public boolean onCommand(final PlotPlayer player, String[] args) {
TaskManager.IMP.taskAsync(new Runnable() {
diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Purge.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Purge.java
index 0825b9610..fb0625a03 100644
--- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Purge.java
+++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Purge.java
@@ -18,11 +18,8 @@ import java.util.HashSet;
import java.util.Map.Entry;
import java.util.UUID;
-@CommandDeclaration(
- usage = "/plot purge world: area: id: owner: shared: unknown:[true|false]",
- command = "purge", permission = "plots.admin", description = "Purge all plots for a world",
- category = CommandCategory.ADMINISTRATION, requiredType = RequiredType.CONSOLE,
- confirmation = true) public class Purge extends SubCommand {
+@CommandDeclaration(usage = "/plot purge world: area: id: owner: shared: unknown:[true|false]", command = "purge", permission = "plots.admin", description = "Purge all plots for a world", category = CommandCategory.ADMINISTRATION, requiredType = RequiredType.CONSOLE, confirmation = true)
+public class Purge extends SubCommand {
@Override public boolean onCommand(final PlotPlayer player, String[] args) {
if (args.length == 0) {
diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Rate.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Rate.java
index 453b548ed..a2de17560 100644
--- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Rate.java
+++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Rate.java
@@ -24,9 +24,8 @@ import java.util.HashMap;
import java.util.Map.Entry;
import java.util.UUID;
-@CommandDeclaration(command = "rate", permission = "plots.rate", description = "Rate the plot",
- usage = "/plot rate [#|next|purge]", aliases = "rt", category = CommandCategory.INFO,
- requiredType = RequiredType.PLAYER) public class Rate extends SubCommand {
+@CommandDeclaration(command = "rate", permission = "plots.rate", description = "Rate the plot", usage = "/plot rate [#|next|purge]", aliases = "rt", category = CommandCategory.INFO, requiredType = RequiredType.PLAYER)
+public class Rate extends SubCommand {
@Override public boolean onCommand(final PlotPlayer player, String[] args) {
if (args.length == 1) {
diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/RegenAllRoads.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/RegenAllRoads.java
index e47cb610f..858635840 100644
--- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/RegenAllRoads.java
+++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/RegenAllRoads.java
@@ -10,11 +10,9 @@ import com.github.intellectualsites.plotsquared.plot.object.PlotManager;
import com.github.intellectualsites.plotsquared.plot.object.PlotPlayer;
import com.github.intellectualsites.plotsquared.plot.util.MainUtil;
-@CommandDeclaration(command = "regenallroads",
- description = "Regenerate all roads in the map using the set road schematic",
- aliases = {"rgar"}, usage = "/plot regenallroads [height]",
- category = CommandCategory.ADMINISTRATION, requiredType = RequiredType.CONSOLE,
- permission = "plots.regenallroads") public class RegenAllRoads extends SubCommand {
+@CommandDeclaration(command = "regenallroads", description = "Regenerate all roads in the map using the set road schematic", aliases = {
+ "rgar"}, usage = "/plot regenallroads [height]", category = CommandCategory.ADMINISTRATION, requiredType = RequiredType.CONSOLE, permission = "plots.regenallroads")
+public class RegenAllRoads extends SubCommand {
@Override public boolean onCommand(PlotPlayer player, String[] args) {
int height = 0;
diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Relight.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Relight.java
index cc5c8c21a..471d7385d 100644
--- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Relight.java
+++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Relight.java
@@ -13,8 +13,8 @@ import com.github.intellectualsites.plotsquared.plot.util.block.LocalBlockQueue;
import java.util.concurrent.CompletableFuture;
-@CommandDeclaration(command = "relight", description = "Relight your plot", usage = "/plot relight",
- category = CommandCategory.DEBUG, requiredType = RequiredType.PLAYER) public class Relight extends Command {
+@CommandDeclaration(command = "relight", description = "Relight your plot", usage = "/plot relight", category = CommandCategory.DEBUG, requiredType = RequiredType.PLAYER)
+public class Relight extends Command {
public Relight() {
super(MainCommand.getInstance(), true);
}
diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Reload.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Reload.java
index db900e91e..433f153c8 100644
--- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Reload.java
+++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Reload.java
@@ -12,9 +12,8 @@ import com.github.intellectualsites.plotsquared.plot.util.MainUtil;
import java.io.IOException;
import java.util.Objects;
-@CommandDeclaration(command = "reload", aliases = "rl", permission = "plots.admin.command.reload",
- description = "Reload translations and world settings", usage = "/plot reload",
- category = CommandCategory.ADMINISTRATION) public class Reload extends SubCommand {
+@CommandDeclaration(command = "reload", aliases = "rl", permission = "plots.admin.command.reload", description = "Reload translations and world settings", usage = "/plot reload", category = CommandCategory.ADMINISTRATION)
+public class Reload extends SubCommand {
@Override public boolean onCommand(PlotPlayer player, String[] args) {
try {
diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Remove.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Remove.java
index debf93c28..5c836ecc8 100644
--- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Remove.java
+++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Remove.java
@@ -17,10 +17,9 @@ import java.util.HashSet;
import java.util.Set;
import java.util.UUID;
-@CommandDeclaration(command = "remove", aliases = {"r", "untrust", "ut", "undeny", "unban", "ud"},
- description = "Remove a player from a plot", usage = "/plot remove ",
- category = CommandCategory.SETTINGS, requiredType = RequiredType.NONE,
- permission = "plots.remove") public class Remove extends SubCommand {
+@CommandDeclaration(command = "remove", aliases = {"r", "untrust", "ut", "undeny", "unban",
+ "ud"}, description = "Remove a player from a plot", usage = "/plot remove ", category = CommandCategory.SETTINGS, requiredType = RequiredType.NONE, permission = "plots.remove")
+public class Remove extends SubCommand {
public Remove() {
super(Argument.PlayerName);
diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Save.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Save.java
index d000f55e2..762b9ffec 100644
--- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Save.java
+++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Save.java
@@ -18,9 +18,9 @@ import java.net.URL;
import java.util.List;
import java.util.UUID;
-@CommandDeclaration(command = "save", aliases = {"backup"}, description = "Save your plot",
- category = CommandCategory.SCHEMATIC, requiredType = RequiredType.NONE,
- permission = "plots.save") public class Save extends SubCommand {
+@CommandDeclaration(command = "save", aliases = {
+ "backup"}, description = "Save your plot", category = CommandCategory.SCHEMATIC, requiredType = RequiredType.NONE, permission = "plots.save")
+public class Save extends SubCommand {
@Override public boolean onCommand(final PlotPlayer player, String[] args) {
String world = player.getLocation().getWorld();
diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/SchematicCmd.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/SchematicCmd.java
index 130f2ad1d..35880f256 100644
--- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/SchematicCmd.java
+++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/SchematicCmd.java
@@ -23,9 +23,9 @@ import java.util.ArrayList;
import java.util.Collection;
import java.util.UUID;
-@CommandDeclaration(command = "schematic", permission = "plots.schematic",
- description = "Schematic command", aliases = {"sch", "schem"},
- category = CommandCategory.SCHEMATIC, usage = "/plot schematic ")
+@CommandDeclaration(command = "schematic", permission = "plots.schematic", description = "Schematic command", aliases = {
+ "sch",
+ "schem"}, category = CommandCategory.SCHEMATIC, usage = "/plot schematic ")
public class SchematicCmd extends SubCommand {
private boolean running = false;
@@ -136,7 +136,8 @@ public class SchematicCmd extends SubCommand {
return false;
} else {
MainUtil.sendMessage(player, Captions.SCHEMATIC_EXPORTALL_STARTED);
- MainUtil.sendMessage(player, "&3Plot&8->&3Schematic&8: &7Found &c" + plots.size() + "&7 plots...");
+ MainUtil.sendMessage(player,
+ "&3Plot&8->&3Schematic&8: &7Found &c" + plots.size() + "&7 plots...");
}
break;
}
diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Set.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Set.java
index e91aa5207..2d17cf57e 100644
--- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Set.java
+++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Set.java
@@ -22,10 +22,9 @@ import java.util.HashSet;
import java.util.stream.Collectors;
import java.util.stream.IntStream;
-@CommandDeclaration(command = "set", description = "Set a plot value", aliases = {"s"},
- usage = "/plot set ", permission = "plots.set",
- category = CommandCategory.APPEARANCE, requiredType = RequiredType.NONE) public class Set
- extends SubCommand {
+@CommandDeclaration(command = "set", description = "Set a plot value", aliases = {
+ "s"}, usage = "/plot set ", permission = "plots.set", category = CommandCategory.APPEARANCE, requiredType = RequiredType.NONE)
+public class Set extends SubCommand {
public static final String[] values = new String[] {"biome", "alias", "home", "flag"};
public static final String[] aliases = new String[] {"b", "w", "wf", "f", "a", "h", "fl"};
@@ -51,7 +50,8 @@ import java.util.stream.IntStream;
for (String component : components) {
if (component.equalsIgnoreCase(args[0])) {
if (!Permissions.hasPermission(player, CaptionUtility
- .format(Captions.PERMISSION_SET_COMPONENT.getTranslated(), component))) {
+ .format(Captions.PERMISSION_SET_COMPONENT.getTranslated(),
+ component))) {
MainUtil.sendMessage(player, Captions.NO_PERMISSION, CaptionUtility
.format(Captions.PERMISSION_SET_COMPONENT.getTranslated(),
component));
@@ -86,12 +86,11 @@ import java.util.stream.IntStream;
new ArrayList<>(Arrays.asList("biome", "alias", "home", "flag"));
Plot plot = player.getCurrentPlot();
if (plot != null) {
- newValues.addAll(
- Arrays.asList(plot.getManager().getPlotComponents(plot.getId())));
+ newValues.addAll(Arrays.asList(plot.getManager().getPlotComponents(plot.getId())));
}
- MainUtil
- .sendMessage(player, Captions.SUBCOMMAND_SET_OPTIONS_HEADER.getTranslated() + StringMan
- .join(newValues, Captions.BLOCK_LIST_SEPARATOR.formatted()));
+ MainUtil.sendMessage(player,
+ Captions.SUBCOMMAND_SET_OPTIONS_HEADER.getTranslated() + StringMan
+ .join(newValues, Captions.BLOCK_LIST_SEPARATOR.formatted()));
return false;
}
@@ -114,8 +113,8 @@ import java.util.stream.IntStream;
return false;
}
// components
- HashSet components = new HashSet<>(
- Arrays.asList(plot.getManager().getPlotComponents(plot.getId())));
+ HashSet components =
+ new HashSet<>(Arrays.asList(plot.getManager().getPlotComponents(plot.getId())));
if (components.contains(args[0].toLowerCase())) {
return this.component.onCommand(player, Arrays.copyOfRange(args, 0, args.length));
}
diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/SetCommand.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/SetCommand.java
index 8c2c0740a..b209ac9af 100644
--- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/SetCommand.java
+++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/SetCommand.java
@@ -18,21 +18,19 @@ public abstract class SetCommand extends SubCommand {
return !sendMessage(player, Captions.NOT_IN_PLOT);
}
if (!plot.hasOwner()) {
- if (!Permissions
- .hasPermission(player,
- CaptionUtility.format(Captions.PERMISSION_ADMIN_COMMAND.getTranslated(), getFullId()))) {
- MainUtil.sendMessage(player, Captions.NO_PERMISSION,
- CaptionUtility.format(Captions.PERMISSION_ADMIN_COMMAND.getTranslated(), getFullId()));
+ if (!Permissions.hasPermission(player, CaptionUtility
+ .format(Captions.PERMISSION_ADMIN_COMMAND.getTranslated(), getFullId()))) {
+ MainUtil.sendMessage(player, Captions.NO_PERMISSION, CaptionUtility
+ .format(Captions.PERMISSION_ADMIN_COMMAND.getTranslated(), getFullId()));
MainUtil.sendMessage(player, Captions.PLOT_NOT_CLAIMED);
return false;
}
}
if (!plot.isOwner(player.getUUID())) {
- if (!Permissions
- .hasPermission(player,
- CaptionUtility.format(Captions.PERMISSION_ADMIN_COMMAND.getTranslated(), getFullId()))) {
- MainUtil.sendMessage(player, Captions.NO_PERMISSION,
- CaptionUtility.format(Captions.PERMISSION_ADMIN_COMMAND.getTranslated(), getFullId()));
+ if (!Permissions.hasPermission(player, CaptionUtility
+ .format(Captions.PERMISSION_ADMIN_COMMAND.getTranslated(), getFullId()))) {
+ MainUtil.sendMessage(player, Captions.NO_PERMISSION, CaptionUtility
+ .format(Captions.PERMISSION_ADMIN_COMMAND.getTranslated(), getFullId()));
MainUtil.sendMessage(player, Captions.NO_PLOT_PERMS);
return false;
}
diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/SetHome.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/SetHome.java
index 4b742ad94..2c6e04bfb 100644
--- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/SetHome.java
+++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/SetHome.java
@@ -8,9 +8,8 @@ import com.github.intellectualsites.plotsquared.plot.object.Plot;
import com.github.intellectualsites.plotsquared.plot.object.PlotPlayer;
import com.github.intellectualsites.plotsquared.plot.util.MainUtil;
-@CommandDeclaration(command = "sethome", permission = "plots.set.home",
- description = "Set the plot home to your current position", usage = "/plot sethome [none]",
- aliases = {"sh", "seth"}, category = CommandCategory.SETTINGS, requiredType = RequiredType.PLAYER)
+@CommandDeclaration(command = "sethome", permission = "plots.set.home", description = "Set the plot home to your current position", usage = "/plot sethome [none]", aliases = {
+ "sh", "seth"}, category = CommandCategory.SETTINGS, requiredType = RequiredType.PLAYER)
public class SetHome extends SetCommand {
@Override public boolean set(PlotPlayer player, Plot plot, String value) {
diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Setup.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Setup.java
index 8b8b22653..4ee450098 100644
--- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Setup.java
+++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Setup.java
@@ -34,9 +34,14 @@ import java.util.Map;
import java.util.Map.Entry;
import java.util.UUID;
-@CommandDeclaration(command = "setup", permission = "plots.admin.command.setup",
- description = "Setup wizard for plot worlds", usage = "/plot setup", aliases = {"create"},
- category = CommandCategory.ADMINISTRATION) public class Setup extends SubCommand {
+@CommandDeclaration(command = "setup", permission = "plots.admin.command.setup", description = "Setup wizard for plot worlds", usage = "/plot setup", aliases = {
+ "create"}, category = CommandCategory.ADMINISTRATION) public class Setup extends SubCommand {
+
+ private static boolean d(String s) {
+ return s.chars().allMatch((i) -> {
+ return i == 95 || i == 45 || i >= 97 && i <= 122 || i >= 48 && i <= 57 || i == 46;
+ });
+ }
public void displayGenerators(PlotPlayer player) {
StringBuilder message = new StringBuilder();
@@ -336,11 +341,7 @@ import java.util.UUID;
return false;
}
- private static boolean d(String s) {
- return s.chars().allMatch((i) -> {
- return i == 95 || i == 45 || i >= 97 && i <= 122 || i >= 48 && i <= 57 || i == 46;
- });
- }
+
private static final class StepPickGenerator extends SetupStep {
@Getter private String generator;
@@ -414,7 +415,7 @@ import java.util.UUID;
}
@Override public boolean parseInput(String input) {
- if (!WORLD_TYPES.keySet().contains(input.toLowerCase())) {
+ if (!WORLD_TYPES.containsKey(input.toLowerCase())) {
return false;
}
this.worldType = input.toLowerCase();
diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Swap.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Swap.java
index b3ec2ff05..71c38f887 100644
--- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Swap.java
+++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Swap.java
@@ -8,8 +8,8 @@ import com.github.intellectualsites.plotsquared.plot.object.PlotPlayer;
import com.github.intellectualsites.plotsquared.plot.util.MainUtil;
import com.github.intellectualsites.plotsquared.plot.util.Permissions;
-@CommandDeclaration(usage = "/plot swap ", command = "swap", description = "Swap two plots",
- aliases = {"switch"}, category = CommandCategory.CLAIMING, requiredType = RequiredType.PLAYER)
+@CommandDeclaration(usage = "/plot swap ", command = "swap", description = "Swap two plots", aliases = {
+ "switch"}, category = CommandCategory.CLAIMING, requiredType = RequiredType.PLAYER)
public class Swap extends SubCommand {
@Override public boolean onCommand(final PlotPlayer player, String[] args) {
diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Target.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Target.java
index 4dd37bdb0..5c1203e3d 100644
--- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Target.java
+++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Target.java
@@ -10,10 +10,8 @@ import com.github.intellectualsites.plotsquared.plot.object.PlotPlayer;
import com.github.intellectualsites.plotsquared.plot.util.MainUtil;
import com.github.intellectualsites.plotsquared.plot.util.StringMan;
-@CommandDeclaration(command = "target", usage = "/plot target <|nearest>",
- description = "Target a plot with your compass", permission = "plots.target",
- requiredType = RequiredType.PLAYER, category = CommandCategory.INFO) public class Target
- extends SubCommand {
+@CommandDeclaration(command = "target", usage = "/plot target <|nearest>", description = "Target a plot with your compass", permission = "plots.target", requiredType = RequiredType.PLAYER, category = CommandCategory.INFO)
+public class Target extends SubCommand {
public Target() {
super(Argument.PlotID);
diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Template.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Template.java
index d001388ea..912cebeee 100644
--- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Template.java
+++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Template.java
@@ -29,10 +29,8 @@ import java.util.zip.ZipEntry;
import java.util.zip.ZipInputStream;
import java.util.zip.ZipOutputStream;
-@CommandDeclaration(command = "template", permission = "plots.admin",
- description = "Create or use a world template",
- usage = "/plot template [import|export] ",
- category = CommandCategory.ADMINISTRATION) public class Template extends SubCommand {
+@CommandDeclaration(command = "template", permission = "plots.admin", description = "Create or use a world template", usage = "/plot template [import|export] ", category = CommandCategory.ADMINISTRATION)
+public class Template extends SubCommand {
public static boolean extractAllFiles(String world, String template) {
try {
diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Toggle.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Toggle.java
index 87411f1c6..2d97c3262 100644
--- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Toggle.java
+++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Toggle.java
@@ -8,16 +8,15 @@ import com.github.intellectualsites.plotsquared.plot.object.RunnableVal2;
import com.github.intellectualsites.plotsquared.plot.object.RunnableVal3;
import com.github.intellectualsites.plotsquared.plot.util.MainUtil;
-@CommandDeclaration(command = "toggle", aliases = {"attribute"}, permission = "plots.use",
- usage = "/plot toggle ",
- description = "Toggle per user settings", requiredType = RequiredType.NONE,
- category = CommandCategory.SETTINGS) public class Toggle extends Command {
+@CommandDeclaration(command = "toggle", aliases = {
+ "attribute"}, permission = "plots.use", usage = "/plot toggle ", description = "Toggle per user settings", requiredType = RequiredType.NONE, category = CommandCategory.SETTINGS)
+public class Toggle extends Command {
public Toggle() {
super(MainCommand.getInstance(), true);
}
- @CommandDeclaration(command = "chatspy", aliases = {"spy"},
- permission = "plots.admin.command.chat", description = "Toggle plot chat spy")
+ @CommandDeclaration(command = "chatspy", aliases = {
+ "spy"}, permission = "plots.admin.command.chat", description = "Toggle plot chat spy")
public void chatspy(Command command, PlotPlayer player, String[] args,
RunnableVal3 confirm,
RunnableVal2 whenDone) {
@@ -28,8 +27,8 @@ import com.github.intellectualsites.plotsquared.plot.util.MainUtil;
}
}
- @CommandDeclaration(command = "worldedit", aliases = {"we", "wea"},
- permission = "plots.worldedit.bypass", description = "Toggle worldedit area restrictions")
+ @CommandDeclaration(command = "worldedit", aliases = {"we",
+ "wea"}, permission = "plots.worldedit.bypass", description = "Toggle worldedit area restrictions")
public void worldedit(Command command, PlotPlayer player, String[] args,
RunnableVal3 confirm,
RunnableVal2 whenDone) {
@@ -40,8 +39,7 @@ import com.github.intellectualsites.plotsquared.plot.util.MainUtil;
}
}
- @CommandDeclaration(command = "chat", permission = "plots.toggle.chat",
- description = "Toggle plot chat")
+ @CommandDeclaration(command = "chat", permission = "plots.toggle.chat", description = "Toggle plot chat")
public void chat(Command command, PlotPlayer player, String[] args,
RunnableVal3 confirm,
RunnableVal2 whenDone) {
@@ -52,8 +50,7 @@ import com.github.intellectualsites.plotsquared.plot.util.MainUtil;
}
}
- @CommandDeclaration(command = "clear-confirmation",
- permission = "plots.admin.command.autoclear", description = "Toggle autoclear confirmation")
+ @CommandDeclaration(command = "clear-confirmation", permission = "plots.admin.command.autoclear", description = "Toggle autoclear confirmation")
public void clearConfirmation(Command command, PlotPlayer player, String[] args,
RunnableVal3 confirm,
RunnableVal2 whenDone) {
@@ -64,8 +61,7 @@ import com.github.intellectualsites.plotsquared.plot.util.MainUtil;
}
}
- @CommandDeclaration(command = "titles", permission = "plots.toggle.titles",
- description = "Toggle plot title messages")
+ @CommandDeclaration(command = "titles", permission = "plots.toggle.titles", description = "Toggle plot title messages")
public void titles(Command command, PlotPlayer player, String[] args,
RunnableVal3 confirm,
RunnableVal2 whenDone) {
@@ -76,8 +72,7 @@ import com.github.intellectualsites.plotsquared.plot.util.MainUtil;
}
}
- @CommandDeclaration(command = "time", permission = "plots.toggle.time",
- description = "Toggle plot time settings")
+ @CommandDeclaration(command = "time", permission = "plots.toggle.time", description = "Toggle plot time settings")
public void time(Command command, PlotPlayer player, String[] args,
RunnableVal3 confirm,
RunnableVal2 whenDone) {
diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Trim.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Trim.java
index fcdce4898..746539b75 100644
--- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Trim.java
+++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Trim.java
@@ -30,10 +30,8 @@ import java.util.HashSet;
import java.util.Iterator;
import java.util.Set;
-@CommandDeclaration(command = "trim", permission = "plots.admin",
- description = "Delete unmodified portions of your plotworld",
- usage = "/plot trim [regenerate]", requiredType = RequiredType.CONSOLE,
- category = CommandCategory.ADMINISTRATION) public class Trim extends SubCommand {
+@CommandDeclaration(command = "trim", permission = "plots.admin", description = "Delete unmodified portions of your plotworld", usage = "/plot trim [regenerate]", requiredType = RequiredType.CONSOLE, category = CommandCategory.ADMINISTRATION)
+public class Trim extends SubCommand {
public static ArrayList expired = null;
private static volatile boolean TASK = false;
@@ -177,18 +175,20 @@ import java.util.Set;
}
int bx = cbx << 4;
int bz = cbz << 4;
- CuboidRegion region = RegionUtil.createRegion(bx, bx + 511, bz, bz + 511);
+ CuboidRegion region =
+ RegionUtil.createRegion(bx, bx + 511, bz, bz + 511);
for (Plot plot : PlotSquared.get().getPlots(world)) {
Location bot = plot.getBottomAbs();
Location top = plot.getExtendedTopAbs();
- CuboidRegion plotReg =
- RegionUtil.createRegion(bot.getX(), top.getX(), bot.getZ(),
- top.getZ());
+ CuboidRegion plotReg = RegionUtil
+ .createRegion(bot.getX(), top.getX(), bot.getZ(), top.getZ());
if (!RegionUtil.intersects(region, plotReg)) {
continue;
}
- for (int x = plotReg.getMinimumPoint().getX() >> 4; x <= plotReg.getMaximumPoint().getX() >> 4; x++) {
- for (int z = plotReg.getMinimumPoint().getZ() >> 4; z <= plotReg.getMaximumPoint().getZ() >> 4; z++) {
+ for (int x = plotReg.getMinimumPoint().getX() >> 4;
+ x <= plotReg.getMaximumPoint().getX() >> 4; x++) {
+ for (int z = plotReg.getMinimumPoint().getZ() >> 4;
+ z <= plotReg.getMaximumPoint().getZ() >> 4; z++) {
BlockVector2 loc = BlockVector2.at(x, z);
chunks.remove(loc);
}
diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Trust.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Trust.java
index 345fe8851..fb6d6e31e 100644
--- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Trust.java
+++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Trust.java
@@ -17,10 +17,9 @@ import java.util.Set;
import java.util.UUID;
import java.util.concurrent.CompletableFuture;
-@CommandDeclaration(command = "trust", aliases = {"t"}, requiredType = RequiredType.PLAYER,
- usage = "/plot trust ",
- description = "Allow a user to build in a plot and use WorldEdit while the plot owner is offline.",
- category = CommandCategory.SETTINGS) public class Trust extends Command {
+@CommandDeclaration(command = "trust", aliases = {
+ "t"}, requiredType = RequiredType.PLAYER, usage = "/plot trust ", description = "Allow a user to build in a plot and use WorldEdit while the plot owner is offline.", category = CommandCategory.SETTINGS)
+public class Trust extends Command {
public Trust() {
super(MainCommand.getInstance(), true);
diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Unlink.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Unlink.java
index 66682ccda..5e4b796f6 100644
--- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Unlink.java
+++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Unlink.java
@@ -11,9 +11,8 @@ import com.github.intellectualsites.plotsquared.plot.util.Permissions;
import com.github.intellectualsites.plotsquared.plot.util.StringMan;
import com.github.intellectualsites.plotsquared.plot.util.TaskManager;
-@CommandDeclaration(command = "unlink", aliases = {"u", "unmerge"},
- description = "Unlink a mega-plot", usage = "/plot unlink [createroads]",
- requiredType = RequiredType.PLAYER, category = CommandCategory.SETTINGS, confirmation = true)
+@CommandDeclaration(command = "unlink", aliases = {"u",
+ "unmerge"}, description = "Unlink a mega-plot", usage = "/plot unlink [createroads]", requiredType = RequiredType.PLAYER, category = CommandCategory.SETTINGS, confirmation = true)
public class Unlink extends SubCommand {
@Override public boolean onCommand(final PlotPlayer player, String[] args) {
diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Visit.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Visit.java
index 0c0526580..520d1b436 100644
--- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Visit.java
+++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Visit.java
@@ -24,10 +24,10 @@ import java.util.List;
import java.util.UUID;
import java.util.concurrent.CompletableFuture;
-@CommandDeclaration(command = "visit", permission = "plots.visit",
- description = "Visit someones plot", usage = "/plot visit [|||] [#]",
- aliases = {"v", "tp", "teleport", "goto", "home", "h", "warp"}, requiredType = RequiredType.PLAYER,
- category = CommandCategory.TELEPORT) public class Visit extends Command {
+@CommandDeclaration(command = "visit", permission = "plots.visit", description = "Visit someones plot", usage = "/plot visit [|||] [#]", aliases = {
+ "v", "tp", "teleport", "goto", "home", "h",
+ "warp"}, requiredType = RequiredType.PLAYER, category = CommandCategory.TELEPORT)
+public class Visit extends Command {
public Visit() {
super(MainCommand.getInstance(), true);
@@ -139,8 +139,8 @@ import java.util.concurrent.CompletableFuture;
return CompletableFuture.completedFuture(false);
}
} else {
- if (!Permissions.hasPermission(player, Captions.PERMISSION_VISIT_OTHER) &&
- !plot.getFlag(UntrustedVisitFlag.class)) {
+ if (!Permissions.hasPermission(player, Captions.PERMISSION_VISIT_OTHER) && !plot
+ .getFlag(UntrustedVisitFlag.class)) {
Captions.NO_PERMISSION.send(player, Captions.PERMISSION_VISIT_OTHER);
return CompletableFuture.completedFuture(false);
}
diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/WE_Anywhere.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/WE_Anywhere.java
index 36744cc44..e2cabec1f 100644
--- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/WE_Anywhere.java
+++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/WE_Anywhere.java
@@ -3,11 +3,9 @@ package com.github.intellectualsites.plotsquared.plot.commands;
import com.github.intellectualsites.plotsquared.commands.CommandDeclaration;
import com.github.intellectualsites.plotsquared.plot.object.PlotPlayer;
-@CommandDeclaration(command = "weanywhere", permission = "plots.worldedit.bypass",
- description = "Force bypass of WorldEdit restrictions", aliases = {"wea"}, usage = "/plot weanywhere",
- requiredType = RequiredType.NONE, category = CommandCategory.ADMINISTRATION)
-@Deprecated
-public class WE_Anywhere extends SubCommand {
+@CommandDeclaration(command = "weanywhere", permission = "plots.worldedit.bypass", description = "Force bypass of WorldEdit restrictions", aliases = {
+ "wea"}, usage = "/plot weanywhere", requiredType = RequiredType.NONE, category = CommandCategory.ADMINISTRATION)
+@Deprecated public class WE_Anywhere extends SubCommand {
@Override public boolean onCommand(PlotPlayer player, String[] arguments) {
MainCommand.getInstance().toggle.worldedit(this, player, new String[0], null, null);
diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/config/Settings.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/config/Settings.java
index 8e1f5ef5b..39290d5c3 100644
--- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/config/Settings.java
+++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/config/Settings.java
@@ -19,8 +19,7 @@ public class Settings extends Config {
public static String ISSUES = "https://github.com/IntellectualSites/PlotSquared/issues";
@Final public static String SUGGESTION =
"https://github.com/IntellectualSites/PlotSquaredSuggestions";
- @Final public static String WIKI =
- "https://github.com/IntellectualSites/PlotSquared/wiki";
+ @Final public static String WIKI = "https://github.com/IntellectualSites/PlotSquared/wiki";
@Final public static String DATE; // These values are set from P2 before loading
@Final public static String BUILD; // These values are set from P2 before loading
@Final public static String COMMIT; // These values are set from P2 before loading
@@ -28,8 +27,9 @@ public class Settings extends Config {
@Comment("Show additional information in console") public static boolean DEBUG = false;
@Comment({"The big annoying text that appears when you enter a plot",
- "For a single plot: `/plot flag set titles false`", "For just you: `/plot toggle titles`", "For all plots: Add `titles: false` in the worlds.yml flags block"})
- public static boolean TITLES = true;
+ "For a single plot: `/plot flag set titles false`", "For just you: `/plot toggle titles`",
+ "For all plots: Add `titles: false` in the worlds.yml flags block"}) public static boolean
+ TITLES = true;
@Create // This value will be generated automatically
public static ConfigBlock AUTO_CLEAR = null;
@@ -229,8 +229,7 @@ public class Settings extends Config {
@Comment("Schematic Settings") public static final class Schematics {
- @Comment(
- "Whether schematic based generation should paste schematic on top of plots, or from Y=1")
+ @Comment("Whether schematic based generation should paste schematic on top of plots, or from Y=1")
public static boolean PASTE_ON_TOP = true;
}
@@ -256,11 +255,12 @@ public class Settings extends Config {
public static final class Done {
- @Comment("Require a plot marked as done to download") public static boolean REQUIRED_FOR_DOWNLOAD =
- false;
- @Comment("Only plots marked as done can be rated") public static boolean REQUIRED_FOR_RATINGS = false;
- @Comment("Restrict building when a plot is marked as done") public static boolean RESTRICT_BUILDING =
- false;
+ @Comment("Require a plot marked as done to download") public static boolean
+ REQUIRED_FOR_DOWNLOAD = false;
+ @Comment("Only plots marked as done can be rated") public static boolean
+ REQUIRED_FOR_RATINGS = false;
+ @Comment("Restrict building when a plot is marked as done") public static boolean
+ RESTRICT_BUILDING = false;
@Comment("The limit being how many plots a player can claim") public static boolean
COUNTS_TOWARDS_LIMIT = true;
}
@@ -276,9 +276,10 @@ public class Settings extends Config {
@Comment("Relating to how many plots someone can claim ") public static final class Limit {
@Comment("Should the limit be global (over multiple worlds)") public static boolean GLOBAL =
false;
- @Comment({"The max. range of permissions to check e.g. plots.plot.127", "The value covers the range to check only, you need to assign the permission to players/groups still",
- "Modifying the value does NOT change the amount of plots players can claim"}) public static int
- MAX_PLOTS = 127;
+ @Comment({"The max. range of permissions to check e.g. plots.plot.127",
+ "The value covers the range to check only, you need to assign the permission to players/groups still",
+ "Modifying the value does NOT change the amount of plots players can claim"})
+ public static int MAX_PLOTS = 127;
}
@@ -292,7 +293,9 @@ public class Settings extends Config {
@Comment("Teleport to your plot on death") public static boolean ON_DEATH = false;
@Comment("Teleport to your plot on login") public static boolean ON_LOGIN = false;
@Comment("Teleport to your plot on claim") public static boolean ON_CLAIM = true;
- @Comment({"Add a delay to all teleport commands", "Assign `plots.teleport.delay.bypass` to bypass the cooldown."}) public static int DELAY = 0;
+ @Comment({"Add a delay to all teleport commands",
+ "Assign `plots.teleport.delay.bypass` to bypass the cooldown."}) public static int
+ DELAY = 0;
@Comment("The visit command is ordered by world instead of globally") public static boolean
PER_WORLD_VISIT = false;
}
@@ -303,8 +306,7 @@ public class Settings extends Config {
false;
@Comment("Disable redstone when all owners/trusted/members are offline")
public static boolean DISABLE_OFFLINE = false;
- @Comment(
- "Detect and cancel invalid pistons on the edge of plots (e.g. placed with WorldEdit)")
+ @Comment("Detect and cancel invalid pistons on the edge of plots (e.g. placed with WorldEdit)")
public static boolean DETECT_INVALID_EDGE_PISTONS = false;
}
@@ -322,8 +324,8 @@ public class Settings extends Config {
}
- @Comment(
- {"Enable or disable parts of the plugin", "Note: A cache will use some memory if enabled"})
+ @Comment({"Enable or disable parts of the plugin",
+ "Note: A cache will use some memory if enabled"})
public static final class Enabled_Components { // Group the following values into a new config section
@Comment("The database stores all the plots") public static boolean DATABASE = true;
@Comment("Events are needed to track a lot of things") public static boolean EVENTS = true;
@@ -331,7 +333,8 @@ public class Settings extends Config {
true;
@Comment("The UUID cacher is used to resolve player names") public static boolean
UUID_CACHE = true;
- @Comment("The plugin auto updater will notify you if updates are available.") public static boolean UPDATER = true;
+ @Comment("The plugin auto updater will notify you if updates are available.")
+ public static boolean UPDATER = true;
@Comment("Stores user metadata in a database") public static boolean PERSISTENT_META = true;
@Comment("Optimizes permission checks") public static boolean PERMISSION_CACHE = true;
@Comment("Optimizes block changing code") public static boolean BLOCK_CACHE = true;
@@ -340,8 +343,7 @@ public class Settings extends Config {
@Comment("Allow WorldEdit to be restricted to plots") public static boolean
WORLDEDIT_RESTRICTIONS = true;
@Comment("Allow economy to be used") public static boolean ECONOMY = true;
- @Comment("@deprecated - use bstats config.yml") public static boolean
- METRICS = true;
+ @Comment("@deprecated - use bstats config.yml") public static boolean METRICS = true;
@Comment("Expiry will clear old or simplistic plots") public static boolean PLOT_EXPIRY =
false;
@Comment("Processes chunks (trimming, or entity/tile limits) ") public static boolean
@@ -356,7 +358,8 @@ public class Settings extends Config {
@Comment("Actively purge invalid database entries") public static boolean DATABASE_PURGER =
false;
@Comment("Delete plots when a player is banned") public static boolean BAN_DELETER = false;
- @Comment({"Prevent possibly unsafe blocks from being used in plot components", "Can be bypassed with `/plot debugallowunsafe`"})
- public static boolean PREVENT_UNSAFE = true;
+ @Comment({"Prevent possibly unsafe blocks from being used in plot components",
+ "Can be bypassed with `/plot debugallowunsafe`"}) public static boolean PREVENT_UNSAFE =
+ true;
}
}
diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/database/AbstractDB.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/database/AbstractDB.java
index 5beef2aab..e20d54caa 100644
--- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/database/AbstractDB.java
+++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/database/AbstractDB.java
@@ -231,7 +231,7 @@ public interface AbstractDB {
/**
* @param cluster PlotCluster Object
- * @param uuid Player that should be removed
+ * @param uuid Player that should be removed
*/
void setHelper(PlotCluster cluster, UUID uuid);
@@ -283,7 +283,7 @@ public interface AbstractDB {
/**
* Removes the specified comment from the given plot.
*
- * @param plot the plot
+ * @param plot the plot
* @param comment the comment to remove
*/
void removeComment(Plot plot, PlotComment comment);
@@ -291,7 +291,7 @@ public interface AbstractDB {
/**
* Clears the specified inbox on the given plot.
*
- * @param plot the plot
+ * @param plot the plot
* @param inbox the inbox to clear
*/
void clearInbox(Plot plot, String inbox);
@@ -299,7 +299,7 @@ public interface AbstractDB {
/**
* Adds the specified comment to the given plot.
*
- * @param plot the plot
+ * @param plot the plot
* @param comment the comment to add
*/
void setComment(Plot plot, PlotComment comment);
diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/database/DBFunc.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/database/DBFunc.java
index 47a03cf60..171a4b310 100644
--- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/database/DBFunc.java
+++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/database/DBFunc.java
@@ -84,6 +84,7 @@ public class DBFunc {
//TODO Consider Removal
+
/**
* Check if a {@link ResultSet} contains a column.
*
diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/BlockStateListFlag.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/BlockStateListFlag.java
index 117551488..6f4f05b11 100644
--- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/BlockStateListFlag.java
+++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/BlockStateListFlag.java
@@ -23,7 +23,8 @@ public class BlockStateListFlag extends ListFlag> {
}
@Override public Set parseValue(final String value) {
- return Arrays.stream(BlockUtil.parse(value)).filter(Objects::nonNull).map(BlockState::getBlockType).collect(Collectors.toSet());
+ return Arrays.stream(BlockUtil.parse(value)).filter(Objects::nonNull)
+ .map(BlockState::getBlockType).collect(Collectors.toSet());
}
@Override public String getValueDescription() {
diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/Flag.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/Flag.java
index 21047d9cd..4051ce138 100644
--- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/Flag.java
+++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/Flag.java
@@ -68,8 +68,8 @@ public abstract class Flag implements StringComparison.StringComparable {
public String getCategoryCaption() {
return this.typeCaption == null ?
- getClass().getSimpleName() :
- this.typeCaption.getTranslated();
+ getClass().getSimpleName() :
+ this.typeCaption.getTranslated();
}
}
diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flags/FlagContainer.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flags/FlagContainer.java
index 502ff0aee..e81ad5dce 100644
--- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flags/FlagContainer.java
+++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flags/FlagContainer.java
@@ -27,6 +27,11 @@ import java.util.Map;
this(parentContainer, null);
}
+ @SuppressWarnings("ALL")
+ public static > T castUnsafe(final PlotFlag, ?> flag) {
+ return (T) flag;
+ }
+
/**
* Return the parent container (if the container has a parent)
*
@@ -131,8 +136,8 @@ import java.util.Map;
* {@link GlobalFlagContainer global flag container}.
*
* @param flagClass Flag class to query for
- * @param Flag value type
- * @param Flag type
+ * @param Flag value type
+ * @param Flag type
* @return Flag instance
*/
public > T getFlag(final Class extends T> flagClass) {
@@ -151,11 +156,12 @@ import java.util.Map;
* Check for flag existence in this flag container instance.
*
* @param flagClass Flag class to query for
- * @param Flag value type
- * @param Flag type
+ * @param Flag value type
+ * @param Flag type
* @return The flag instance, if it exists in this container, else null.
*/
- @Nullable public > T queryLocal(final Class extends T> flagClass) {
+ @Nullable public > T queryLocal(
+ final Class extends T> flagClass) {
final PlotFlag, ?> localFlag = this.flagMap.get(flagClass);
if (localFlag == null) {
return null;
@@ -164,26 +170,6 @@ import java.util.Map;
}
}
- @SuppressWarnings("ALL")
- public static > T castUnsafe(final PlotFlag, ?> flag) {
- return (T) flag;
- }
-
- /**
- * Handler for update events in {@link FlagContainer flag containers}.
- */
- @FunctionalInterface public interface PlotFlagUpdateHandler {
-
- /**
- * Act on the flag update event
- * @param plotFlag Plot flag
- * @param type Update type
- */
- void handle(PlotFlag, ?> plotFlag, PlotFlagUpdateType type);
-
- }
-
-
/**
* Update event types used in {@link PlotFlagUpdateHandler}.
*/
@@ -198,4 +184,20 @@ import java.util.Map;
FLAG_REMOVED
}
+
+ /**
+ * Handler for update events in {@link FlagContainer flag containers}.
+ */
+ @FunctionalInterface public interface PlotFlagUpdateHandler {
+
+ /**
+ * Act on the flag update event
+ *
+ * @param plotFlag Plot flag
+ * @param type Update type
+ */
+ void handle(PlotFlag, ?> plotFlag, PlotFlagUpdateType type);
+
+ }
+
}
diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flags/FlagParseException.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flags/FlagParseException.java
index cfb9f5180..09c5a5bc0 100644
--- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flags/FlagParseException.java
+++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flags/FlagParseException.java
@@ -9,13 +9,13 @@ public class FlagParseException extends Exception {
private final String value;
private final String errorMessage;
- public FlagParseException(final PlotFlag, ?> flag, final String value, final Caption errorMessage,
- final Object ... args) {
+ public FlagParseException(final PlotFlag, ?> flag, final String value,
+ final Caption errorMessage, final Object... args) {
super(String.format("Failed to parse flag of type '%s'. Value '%s' was not accepted.",
flag.getName(), value));
this.flag = flag;
this.value = value;
- this.errorMessage = CaptionUtility.format(errorMessage, args);
+ this.errorMessage = CaptionUtility.format(errorMessage, args);
}
/**
diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flags/PlotFlag.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flags/PlotFlag.java
index f024dbd8b..f6b2322c5 100644
--- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flags/PlotFlag.java
+++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flags/PlotFlag.java
@@ -27,15 +27,17 @@ import org.jetbrains.annotations.NotNull;
protected PlotFlag(@NotNull final T value, @NotNull final Caption flagCategory,
@NotNull final Caption flagDescription) {
this.value = Preconditions.checkNotNull(value, "flag value may not be null");
- this.flagCategory = Preconditions.checkNotNull(flagCategory, "flag category may not be null");
- this.flagDescription = Preconditions.checkNotNull(flagDescription, "flag description may not be null");
+ this.flagCategory =
+ Preconditions.checkNotNull(flagCategory, "flag category may not be null");
+ this.flagDescription =
+ Preconditions.checkNotNull(flagDescription, "flag description may not be null");
// Parse flag name
final StringBuilder flagName = new StringBuilder();
final char[] chars = this.getClass().getSimpleName().replace("Flag", "").toCharArray();
for (int i = 0; i < chars.length; i++) {
if (i == 0) {
flagName.append(Character.toLowerCase(chars[i]));
- } else if(Character.isUpperCase(chars[i])) {
+ } else if (Character.isUpperCase(chars[i])) {
flagName.append('-').append(Character.toLowerCase(chars[i]));
} else {
flagName.append(chars[i]);
diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flags/implementations/BlockedCmdsFlag.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flags/implementations/BlockedCmdsFlag.java
index 72bf5e6cf..df8a856d0 100644
--- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flags/implementations/BlockedCmdsFlag.java
+++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flags/implementations/BlockedCmdsFlag.java
@@ -11,10 +11,12 @@ import java.util.List;
public class BlockedCmdsFlag extends ListFlag {
- public static final BlockedCmdsFlag BLOCKED_CMDS_FLAG_NONE = new BlockedCmdsFlag(Collections.emptyList());
+ public static final BlockedCmdsFlag BLOCKED_CMDS_FLAG_NONE =
+ new BlockedCmdsFlag(Collections.emptyList());
protected BlockedCmdsFlag(List valueList) {
- super(valueList, Captions.FLAG_CATEGORY_STRING_LIST, Captions.FLAG_DESCRIPTION_BLOCKED_CMDS);
+ super(valueList, Captions.FLAG_CATEGORY_STRING_LIST,
+ Captions.FLAG_DESCRIPTION_BLOCKED_CMDS);
}
@Override public BlockedCmdsFlag parse(@NotNull String input) throws FlagParseException {
diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flags/implementations/DenyTeleportFlag.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flags/implementations/DenyTeleportFlag.java
index 4ea8f8a59..71954c73e 100644
--- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flags/implementations/DenyTeleportFlag.java
+++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flags/implementations/DenyTeleportFlag.java
@@ -10,22 +10,52 @@ import org.jetbrains.annotations.Nullable;
public class DenyTeleportFlag extends PlotFlag {
- public static final DenyTeleportFlag DENY_TELEPORT_FLAG_NONE = new DenyTeleportFlag(DeniedGroup.NONE);
+ public static final DenyTeleportFlag DENY_TELEPORT_FLAG_NONE =
+ new DenyTeleportFlag(DeniedGroup.NONE);
/**
* Construct a new flag instance.
*
- * @param value Flag value
+ * @param value Flag value
*/
protected DenyTeleportFlag(@NotNull DeniedGroup value) {
super(value, Captions.FLAG_CATEGORY_ENUM, Captions.FLAG_DESCRIPTION_DENY_TELEPORT);
}
+ public static boolean allowsTeleport(PlotPlayer player, Plot plot) {
+ final DeniedGroup value = plot.getFlag(DenyTeleportFlag.class);
+ if (value == DeniedGroup.NONE) {
+ return true;
+ }
+ final boolean result;
+ switch (value) {
+ case TRUSTED:
+ result = !plot.getTrusted().contains(player.getUUID());
+ break;
+ case MEMBERS:
+ result = !plot.getMembers().contains(player.getUUID());
+ break;
+ case NONMEMBERS:
+ result = plot.isAdded(player.getUUID());
+ break;
+ case NONTRUSTED:
+ result =
+ plot.getTrusted().contains(player.getUUID()) || plot.isOwner(player.getUUID());
+ break;
+ case NONOWNERS:
+ result = plot.isOwner(player.getUUID());
+ break;
+ default:
+ return true;
+ }
+ return result || player.hasPermission("plots.admin.entry.denied");
+ }
+
@Override public DenyTeleportFlag parse(@NotNull String input) throws FlagParseException {
final DeniedGroup group = DeniedGroup.fromString(input);
if (group == null) {
- throw new FlagParseException(this, input, Captions.FLAG_ERROR_ENUM, "members, nonmembers,"
- + " trusted, nontrusted, nonowners");
+ throw new FlagParseException(this, input, Captions.FLAG_ERROR_ENUM,
+ "members, nonmembers," + " trusted, nontrusted, nonowners");
}
return flagOf(group);
}
@@ -49,42 +79,8 @@ public class DenyTeleportFlag extends PlotFlag implements InternalFlag
/**
* Construct a new flag instance.
*
- * @param value Flag value
+ * @param value Flag value
*/
public DoneFlag(@NotNull String value) {
super(value, Captions.NONE, Captions.NONE);
}
+ public static boolean isDone(final Plot plot) {
+ return !plot.getFlag(DoneFlag.class).isEmpty();
+ }
+
@Override public DoneFlag parse(@NotNull String input) {
return flagOf(input);
}
@@ -37,8 +41,4 @@ public class DoneFlag extends PlotFlag implements InternalFlag
return new DoneFlag(value);
}
- public static boolean isDone(final Plot plot) {
- return !plot.getFlag(DoneFlag.class).isEmpty();
- }
-
}
diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flags/implementations/GamemodeFlag.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flags/implementations/GamemodeFlag.java
index 880d69ab0..ceef0f83c 100644
--- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flags/implementations/GamemodeFlag.java
+++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flags/implementations/GamemodeFlag.java
@@ -10,20 +10,22 @@ import org.jetbrains.annotations.NotNull;
public class GamemodeFlag extends PlotFlag {
public static final GameMode DEFAULT = new GameMode("default");
+ public static final GamemodeFlag GAMEMODE_FLAG_CREATIVE = new GamemodeFlag(GameModes.CREATIVE);
+ public static final GamemodeFlag GAMEMODE_FLAG_ADVENTURE =
+ new GamemodeFlag(GameModes.ADVENTURE);
+ public static final GamemodeFlag GAMEMODE_FLAG_SPECTATOR =
+ new GamemodeFlag(GameModes.SPECTATOR);
+ public static final GamemodeFlag GAMEMODE_FLAG_SURVIVAL = new GamemodeFlag(GameModes.SURVIVAL);
+ public static final GamemodeFlag GAMEMODE_FLAG_DEFAULT = new GamemodeFlag(DEFAULT);
+
static {
GameModes.register(DEFAULT);
}
- public static final GamemodeFlag GAMEMODE_FLAG_CREATIVE = new GamemodeFlag(GameModes.CREATIVE);
- public static final GamemodeFlag GAMEMODE_FLAG_ADVENTURE = new GamemodeFlag(GameModes.ADVENTURE);
- public static final GamemodeFlag GAMEMODE_FLAG_SPECTATOR = new GamemodeFlag(GameModes.SPECTATOR);
- public static final GamemodeFlag GAMEMODE_FLAG_SURVIVAL = new GamemodeFlag(GameModes.SURVIVAL);
- public static final GamemodeFlag GAMEMODE_FLAG_DEFAULT = new GamemodeFlag(DEFAULT);
-
/**
* Construct a new flag instance.
*
- * @param value Flag value
+ * @param value Flag value
*/
protected GamemodeFlag(@NotNull GameMode value) {
super(value, Captions.FLAG_CATEGORY_GAMEMODE, Captions.FLAG_DESCRIPTION_GAMEMODE);
diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flags/implementations/GuestGamemodeFlag.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flags/implementations/GuestGamemodeFlag.java
index b299f05d1..7994a3307 100644
--- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flags/implementations/GuestGamemodeFlag.java
+++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flags/implementations/GuestGamemodeFlag.java
@@ -9,16 +9,21 @@ import org.jetbrains.annotations.NotNull;
public class GuestGamemodeFlag extends PlotFlag {
- public static final GuestGamemodeFlag GUEST_GAMEMODE_FLAG_CREATIVE = new GuestGamemodeFlag(GameModes.CREATIVE);
- public static final GuestGamemodeFlag GUEST_GAMEMODE_FLAG_ADVENTURE = new GuestGamemodeFlag(GameModes.ADVENTURE);
- public static final GuestGamemodeFlag GUEST_GAMEMODE_FLAG_SPECTATOR = new GuestGamemodeFlag(GameModes.SPECTATOR);
- public static final GuestGamemodeFlag GUEST_GAMEMODE_FLAG_SURVIVAL = new GuestGamemodeFlag(GameModes.SURVIVAL);
- public static final GuestGamemodeFlag GUEST_GAMEMODE_FLAG_DEFAULT = new GuestGamemodeFlag(GamemodeFlag.DEFAULT);
+ public static final GuestGamemodeFlag GUEST_GAMEMODE_FLAG_CREATIVE =
+ new GuestGamemodeFlag(GameModes.CREATIVE);
+ public static final GuestGamemodeFlag GUEST_GAMEMODE_FLAG_ADVENTURE =
+ new GuestGamemodeFlag(GameModes.ADVENTURE);
+ public static final GuestGamemodeFlag GUEST_GAMEMODE_FLAG_SPECTATOR =
+ new GuestGamemodeFlag(GameModes.SPECTATOR);
+ public static final GuestGamemodeFlag GUEST_GAMEMODE_FLAG_SURVIVAL =
+ new GuestGamemodeFlag(GameModes.SURVIVAL);
+ public static final GuestGamemodeFlag GUEST_GAMEMODE_FLAG_DEFAULT =
+ new GuestGamemodeFlag(GamemodeFlag.DEFAULT);
/**
* Construct a new flag instance.
*
- * @param value Flag value
+ * @param value Flag value
*/
protected GuestGamemodeFlag(@NotNull GameMode value) {
super(value, Captions.FLAG_CATEGORY_GAMEMODE, Captions.FLAG_DESCRIPTION_GUEST_GAMEMODE);
diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flags/implementations/HealFlag.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flags/implementations/HealFlag.java
index 7f0d14b20..6a89bde11 100644
--- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flags/implementations/HealFlag.java
+++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flags/implementations/HealFlag.java
@@ -7,6 +7,7 @@ import org.jetbrains.annotations.NotNull;
public class HealFlag extends TimedFlag {
public static final HealFlag HEAL_NOTHING = new HealFlag(new Timed<>(0, 0));
+
protected HealFlag(@NotNull Timed value) {
super(value, 1, Captions.FLAG_DESCRIPTION_HEAL);
}
diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flags/implementations/HostileCapFlag.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flags/implementations/HostileCapFlag.java
index e79afddcb..4da181745 100644
--- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flags/implementations/HostileCapFlag.java
+++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flags/implementations/HostileCapFlag.java
@@ -5,7 +5,8 @@ import com.github.intellectualsites.plotsquared.plot.flags.types.NonNegativeInte
import org.jetbrains.annotations.NotNull;
public class HostileCapFlag extends NonNegativeIntegerFlag {
- public static final HostileCapFlag HOSTILE_CAP_UNLIMITED = new HostileCapFlag(Integer.MAX_VALUE);
+ public static final HostileCapFlag HOSTILE_CAP_UNLIMITED =
+ new HostileCapFlag(Integer.MAX_VALUE);
protected HostileCapFlag(int value) {
super(value, Captions.FLAG_DESCRIPTION_HOSTILE_CAP);
diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flags/implementations/KeepFlag.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flags/implementations/KeepFlag.java
index 39f00718b..f4b9810c4 100644
--- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flags/implementations/KeepFlag.java
+++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flags/implementations/KeepFlag.java
@@ -14,7 +14,7 @@ public class KeepFlag extends PlotFlag
*/
- @Override public boolean clearPlot(Plot plot,
- final Runnable whenDone) {
+ @Override public boolean clearPlot(Plot plot, final Runnable whenDone) {
final String world = hybridPlotWorld.worldname;
Location pos1 = plot.getBottomAbs();
Location pos2 = plot.getExtendedTopAbs();
@@ -220,8 +219,7 @@ public class HybridPlotManager extends ClassicPlotManager {
return true;
}
- public void pastePlotSchematic(LocalBlockQueue queue,
- Location bottom, Location top) {
+ public void pastePlotSchematic(LocalBlockQueue queue, Location bottom, Location top) {
if (!hybridPlotWorld.PLOT_SCHEMATIC) {
return;
}
@@ -230,6 +228,7 @@ public class HybridPlotManager extends ClassicPlotManager {
/**
* Retrieves the location of where a sign should be for a plot.
+ *
* @param plot The plot
* @return The location where a sign should be
*/
diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/HybridPlotWorld.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/HybridPlotWorld.java
index 6b44487ce..d042044b2 100644
--- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/HybridPlotWorld.java
+++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/HybridPlotWorld.java
@@ -44,11 +44,6 @@ public class HybridPlotWorld extends ClassicPlotWorld {
super(worldName, id, generator, min, max);
}
- @NotNull @Override
- protected PlotManager createManager() {
- return new HybridPlotManager(this);
- }
-
public static byte wrap(byte data, int start) {
if ((data >= start) && (data < (start + 4))) {
data = (byte) ((((data - start) + 2) & 3) + start);
@@ -96,6 +91,10 @@ public class HybridPlotWorld extends ClassicPlotWorld {
return BlockTransformExtent.transform(id, transform);
}
+ @NotNull @Override protected PlotManager createManager() {
+ return new HybridPlotManager(this);
+ }
+
public Location getSignLocation(Plot plot) {
plot = plot.getBasePlot(false);
Location bot = plot.getBottomAbs();
diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/HybridUtils.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/HybridUtils.java
index 98d1f41bf..5d80a944d 100644
--- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/HybridUtils.java
+++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/HybridUtils.java
@@ -51,7 +51,8 @@ public abstract class HybridUtils {
public static PlotArea area;
public static boolean UPDATE = false;
- public void analyzeRegion(final String world, final CuboidRegion region, final RunnableVal whenDone) {
+ public void analyzeRegion(final String world, final CuboidRegion region,
+ final RunnableVal whenDone) {
// int diff, int variety, int vertices, int rotation, int height_sd
/*
* diff: compare to base by looping through all blocks
@@ -127,22 +128,28 @@ public abstract class HybridUtils {
// modifications_adjacent
if (x > 0 && z > 0 && y > 0 && x < width - 1 && z < length - 1
&& y < 255) {
- if (newBlocks[y - 1][x][z].getBlockType().getMaterial().isAir()) {
+ if (newBlocks[y - 1][x][z].getBlockType().getMaterial()
+ .isAir()) {
faces[i]++;
}
- if (newBlocks[y][x - 1][z].getBlockType().getMaterial().isAir()) {
+ if (newBlocks[y][x - 1][z].getBlockType().getMaterial()
+ .isAir()) {
faces[i]++;
}
- if (newBlocks[y][x][z - 1].getBlockType().getMaterial().isAir()) {
+ if (newBlocks[y][x][z - 1].getBlockType().getMaterial()
+ .isAir()) {
faces[i]++;
}
- if (newBlocks[y + 1][x][z].getBlockType().getMaterial().isAir()) {
+ if (newBlocks[y + 1][x][z].getBlockType().getMaterial()
+ .isAir()) {
faces[i]++;
}
- if (newBlocks[y][x + 1][z].getBlockType().getMaterial().isAir()) {
+ if (newBlocks[y][x + 1][z].getBlockType().getMaterial()
+ .isAir()) {
faces[i]++;
}
- if (newBlocks[y][x][z + 1].getBlockType().getMaterial().isAir()) {
+ if (newBlocks[y][x][z + 1].getBlockType().getMaterial()
+ .isAir()) {
faces[i]++;
}
}
@@ -281,7 +288,8 @@ public abstract class HybridUtils {
result.add(whenDone.value.data_sd);
result.add(whenDone.value.air_sd);
result.add(whenDone.value.variety_sd);
- origin.setFlag(GlobalFlagContainer.getInstance().getFlag(AnalysisFlag.class), result);
+ origin.setFlag(GlobalFlagContainer.getInstance().getFlag(AnalysisFlag.class),
+ result);
TaskManager.runTask(whenDone);
return;
}
@@ -386,11 +394,13 @@ public abstract class HybridUtils {
try {
if (chunks.size() < 1024) {
if (!HybridUtils.regions.isEmpty()) {
- Iterator iterator = HybridUtils.regions.iterator();
+ Iterator iterator =
+ HybridUtils.regions.iterator();
BlockVector2 loc = iterator.next();
iterator.remove();
- PlotSquared.debug("Updating .mcr: " + loc.getX() + ", " + loc.getZ()
- + " (approx 1024 chunks)");
+ PlotSquared.debug(
+ "Updating .mcr: " + loc.getX() + ", " + loc.getZ()
+ + " (approx 1024 chunks)");
PlotSquared
.debug(" - Remaining: " + HybridUtils.regions.size());
chunks.addAll(getChunks(loc));
@@ -421,8 +431,8 @@ public abstract class HybridUtils {
BlockVector2 loc = iterator.next();
iterator.remove();
PlotSquared.debug(
- "[ERROR] Could not update '" + area.worldname + "/region/r." + loc.getX()
- + "." + loc.getZ() + ".mca' (Corrupt chunk?)");
+ "[ERROR] Could not update '" + area.worldname + "/region/r." + loc
+ .getX() + "." + loc.getZ() + ".mca' (Corrupt chunk?)");
int sx = loc.getX() << 5;
int sz = loc.getZ() << 5;
for (int x = sx; x < sx + 32; x++) {
@@ -459,10 +469,10 @@ public abstract class HybridUtils {
int tz = sz - 1;
int ty = get_ey(plotManager, queue, sx, ex, bz, tz, sy);
- Set sideRoad =
- new HashSet<>(Collections.singletonList(RegionUtil.createRegion(sx, ex, sy, ey, sz, ez)));
- final Set intersection =
- new HashSet<>(Collections.singletonList(RegionUtil.createRegion(sx, ex, sy, ty, bz, tz)));
+ Set sideRoad = new HashSet<>(
+ Collections.singletonList(RegionUtil.createRegion(sx, ex, sy, ey, sz, ez)));
+ final Set intersection = new HashSet<>(
+ Collections.singletonList(RegionUtil.createRegion(sx, ex, sy, ty, bz, tz)));
final String dir =
"schematics" + File.separator + "GEN_ROAD_SCHEMATIC" + File.separator + plot.getArea()
@@ -583,11 +593,12 @@ public abstract class HybridUtils {
} else {
BaseBlock block = blocks[y];
if (block != null) {
- queue.setBlock(finalX + X + plotWorld.ROAD_OFFSET_X, minY + y,
- finalZ + Z + plotWorld.ROAD_OFFSET_Z, block);
+ queue.setBlock(finalX + X + plotWorld.ROAD_OFFSET_X,
+ minY + y, finalZ + Z + plotWorld.ROAD_OFFSET_Z, block);
} else {
- queue.setBlock(finalX + X + plotWorld.ROAD_OFFSET_X, minY + y,
- finalZ + Z + plotWorld.ROAD_OFFSET_Z, WEExtent.AIRBASE);
+ queue.setBlock(finalX + X + plotWorld.ROAD_OFFSET_X,
+ minY + y, finalZ + Z + plotWorld.ROAD_OFFSET_Z,
+ WEExtent.AIRBASE);
}
}
}
diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/SquarePlotManager.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/SquarePlotManager.java
index eeda6d06e..aab48222d 100644
--- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/SquarePlotManager.java
+++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/SquarePlotManager.java
@@ -26,8 +26,7 @@ public abstract class SquarePlotManager extends GridPlotManager {
this.squarePlotWorld = squarePlotWorld;
}
- @Override
- public boolean clearPlot(final Plot plot, final Runnable whenDone) {
+ @Override public boolean clearPlot(final Plot plot, final Runnable whenDone) {
final Set regions = plot.getRegions();
Runnable run = new Runnable() {
@Override public void run() {
@@ -38,10 +37,10 @@ public abstract class SquarePlotManager extends GridPlotManager {
Iterator iterator = regions.iterator();
CuboidRegion region = iterator.next();
iterator.remove();
- Location pos1 =
- new Location(plot.getWorldName(), region.getMinimumPoint().getX(), region.getMinimumPoint().getY(), region.getMinimumPoint().getZ());
- Location pos2 =
- new Location(plot.getWorldName(), region.getMaximumPoint().getX(), region.getMaximumPoint().getY(), region.getMaximumPoint().getZ());
+ Location pos1 = new Location(plot.getWorldName(), region.getMinimumPoint().getX(),
+ region.getMinimumPoint().getY(), region.getMinimumPoint().getZ());
+ Location pos2 = new Location(plot.getWorldName(), region.getMaximumPoint().getX(),
+ region.getMaximumPoint().getY(), region.getMaximumPoint().getZ());
ChunkManager.manager.regenerateRegion(pos1, pos2, false, this);
}
};
@@ -52,10 +51,10 @@ public abstract class SquarePlotManager extends GridPlotManager {
@Override public Location getPlotTopLocAbs(PlotId plotId) {
int px = plotId.x;
int pz = plotId.y;
- int x = (squarePlotWorld.ROAD_OFFSET_X + (px * (squarePlotWorld.ROAD_WIDTH + squarePlotWorld.PLOT_WIDTH))) - (int) Math
- .floor(squarePlotWorld.ROAD_WIDTH / 2) - 1;
- int z = (squarePlotWorld.ROAD_OFFSET_Z + (pz * (squarePlotWorld.ROAD_WIDTH + squarePlotWorld.PLOT_WIDTH))) - (int) Math
- .floor(squarePlotWorld.ROAD_WIDTH / 2) - 1;
+ int x = (squarePlotWorld.ROAD_OFFSET_X + (px * (squarePlotWorld.ROAD_WIDTH
+ + squarePlotWorld.PLOT_WIDTH))) - (int) Math.floor(squarePlotWorld.ROAD_WIDTH / 2) - 1;
+ int z = (squarePlotWorld.ROAD_OFFSET_Z + (pz * (squarePlotWorld.ROAD_WIDTH
+ + squarePlotWorld.PLOT_WIDTH))) - (int) Math.floor(squarePlotWorld.ROAD_WIDTH / 2) - 1;
return new Location(squarePlotWorld.worldname, x, Math.min(getWorldHeight(), 255), z);
}
@@ -204,8 +203,8 @@ public abstract class SquarePlotManager extends GridPlotManager {
}
PlotSquared.debug("invalid location: " + Arrays.toString(merged));
} catch (Exception ignored) {
- PlotSquared.debug(
- "Invalid plot / road width in settings.yml for world: " + squarePlotWorld.worldname);
+ PlotSquared.debug("Invalid plot / road width in settings.yml for world: "
+ + squarePlotWorld.worldname);
}
return null;
}
@@ -216,10 +215,12 @@ public abstract class SquarePlotManager extends GridPlotManager {
@Override public Location getPlotBottomLocAbs(PlotId plotId) {
int px = plotId.x;
int pz = plotId.y;
- int x = (squarePlotWorld.ROAD_OFFSET_X + (px * (squarePlotWorld.ROAD_WIDTH + squarePlotWorld.PLOT_WIDTH))) - squarePlotWorld.PLOT_WIDTH
- - (int) Math.floor(squarePlotWorld.ROAD_WIDTH / 2);
- int z = (squarePlotWorld.ROAD_OFFSET_Z + (pz * (squarePlotWorld.ROAD_WIDTH + squarePlotWorld.PLOT_WIDTH))) - squarePlotWorld.PLOT_WIDTH
- - (int) Math.floor(squarePlotWorld.ROAD_WIDTH / 2);
+ int x = (squarePlotWorld.ROAD_OFFSET_X + (px * (squarePlotWorld.ROAD_WIDTH
+ + squarePlotWorld.PLOT_WIDTH))) - squarePlotWorld.PLOT_WIDTH - (int) Math
+ .floor(squarePlotWorld.ROAD_WIDTH / 2);
+ int z = (squarePlotWorld.ROAD_OFFSET_Z + (pz * (squarePlotWorld.ROAD_WIDTH
+ + squarePlotWorld.PLOT_WIDTH))) - squarePlotWorld.PLOT_WIDTH - (int) Math
+ .floor(squarePlotWorld.ROAD_WIDTH / 2);
return new Location(squarePlotWorld.worldname, x, squarePlotWorld.MIN_BUILD_HEIGHT, z);
}
}
diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/listener/PlayerBlockEventType.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/listener/PlayerBlockEventType.java
index c226d87aa..dacecdd79 100644
--- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/listener/PlayerBlockEventType.java
+++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/listener/PlayerBlockEventType.java
@@ -11,8 +11,7 @@ public enum PlayerBlockEventType {
TELEPORT_OBJECT,
// armor stands
- PLACE_MISC,
- PLACE_VEHICLE,
+ PLACE_MISC, PLACE_VEHICLE,
// armor stands
INTERACT_BLOCK, // blocks
diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/listener/PlotListener.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/listener/PlotListener.java
index 5817111ac..413c113d7 100644
--- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/listener/PlotListener.java
+++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/listener/PlotListener.java
@@ -66,7 +66,7 @@ public class PlotListener {
} else {
titles = Settings.TITLES;
}
- String greeting;
+ String greeting;
if (flags.isEmpty()) {
if (titles) {
greeting = "";
@@ -80,12 +80,11 @@ public class PlotListener {
if (!greeting.isEmpty()) {
MainUtil
.format(Captions.PREFIX_GREETING.getTranslated() + greeting, plot, player,
- false,
- new RunnableVal() {
- @Override public void run(String value) {
- MainUtil.sendMessage(player, value);
- }
- });
+ false, new RunnableVal() {
+ @Override public void run(String value) {
+ MainUtil.sendMessage(player, value);
+ }
+ });
}
if (plot.getFlag(NotifyEnterFlag.class)) {
@@ -95,7 +94,7 @@ public class PlotListener {
if (owner != null && !owner.getUUID().equals(player.getUUID())) {
MainUtil.sendMessage(owner, Captions.NOTIFY_ENTER.getTranslated()
.replace("%player", player.getName())
- .replace("%plot", plot.getId().toString()));
+ .replace("%plot", plot.getId().toString()));
}
}
}
@@ -120,29 +119,27 @@ public class PlotListener {
} else {
MainUtil.sendMessage(player, StringMan
.replaceAll(Captions.GAMEMODE_WAS_BYPASSED.getTranslated(),
- "{plot}",
- plot.getId(), "{gamemode}", gameMode));
+ "{plot}", plot.getId(), "{gamemode}", gameMode));
}
}
}
final GameMode guestGameMode = plot.getFlag(GuestGamemodeFlag.class);
if (!guestGameMode.equals(GamemodeFlag.DEFAULT)) {
- if (player.getGameMode() != guestGameMode && !plot
- .isAdded(player.getUUID())) {
+ if (player.getGameMode() != guestGameMode && !plot.isAdded(player.getUUID())) {
if (!Permissions.hasPermission(player, "plots.gamemode.bypass")) {
player.setGameMode(guestGameMode);
} else {
MainUtil.sendMessage(player, StringMan
.replaceAll(Captions.GAMEMODE_WAS_BYPASSED.getTranslated(),
- "{plot}",
- plot.getId(), "{gamemode}", guestGameMode));
+ "{plot}", plot.getId(), "{gamemode}", guestGameMode));
}
}
}
long time = plot.getFlag(TimeFlag.class);
- if (time != TimeFlag.TIME_DISABLED.getValue() && !player.getAttribute("disabletime")) {
+ if (time != TimeFlag.TIME_DISABLED.getValue() && !player
+ .getAttribute("disabletime")) {
try {
player.setTime(time);
} catch (Exception ignored) {
@@ -218,36 +215,36 @@ public class PlotListener {
if (pw == null) {
return true;
}
- if (plot.getFlag(DenyExitFlag.class)
- && !Permissions.hasPermission(player, Captions.PERMISSION_ADMIN_EXIT_DENIED)
- && !player.getMeta("kick", false)) {
+ if (plot.getFlag(DenyExitFlag.class) && !Permissions
+ .hasPermission(player, Captions.PERMISSION_ADMIN_EXIT_DENIED) && !player
+ .getMeta("kick", false)) {
if (previous != null) {
player.setMeta(PlotPlayer.META_LAST_PLOT, previous);
}
return false;
}
- if (!plot.getFlag(GamemodeFlag.class).equals(GamemodeFlag.DEFAULT) ||
- !plot.getFlag(GuestGamemodeFlag.class).equals(GamemodeFlag.DEFAULT)) {
+ if (!plot.getFlag(GamemodeFlag.class).equals(GamemodeFlag.DEFAULT) || !plot
+ .getFlag(GuestGamemodeFlag.class).equals(GamemodeFlag.DEFAULT)) {
if (player.getGameMode() != pw.GAMEMODE) {
if (!Permissions.hasPermission(player, "plots.gamemode.bypass")) {
player.setGameMode(pw.GAMEMODE);
} else {
MainUtil.sendMessage(player, StringMan
.replaceAll(Captions.GAMEMODE_WAS_BYPASSED.getTranslated(), "{plot}",
- plot.toString(), "{gamemode}", pw.GAMEMODE.getName().toLowerCase()));
+ plot.toString(), "{gamemode}",
+ pw.GAMEMODE.getName().toLowerCase()));
}
}
}
final String farewell = plot.getFlag(FarewellFlag.class);
if (!farewell.isEmpty()) {
- MainUtil
- .format(Captions.PREFIX_FAREWELL.getTranslated() + farewell, plot, player, false,
- new RunnableVal() {
- @Override public void run(String value) {
- MainUtil.sendMessage(player, value);
- }
- });
+ MainUtil.format(Captions.PREFIX_FAREWELL.getTranslated() + farewell, plot, player,
+ false, new RunnableVal() {
+ @Override public void run(String value) {
+ MainUtil.sendMessage(player, value);
+ }
+ });
}
if (plot.getFlag(NotifyLeaveFlag.class)) {
@@ -257,7 +254,7 @@ public class PlotListener {
if ((owner != null) && !owner.getUUID().equals(player.getUUID())) {
MainUtil.sendMessage(owner, Captions.NOTIFY_LEAVE.getTranslated()
.replace("%player", player.getName())
- .replace("%plot", plot.getId().toString()));
+ .replace("%plot", plot.getId().toString()));
}
}
}
diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/listener/WEManager.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/listener/WEManager.java
index 8be02fac5..df1db3e2d 100644
--- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/listener/WEManager.java
+++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/listener/WEManager.java
@@ -36,8 +36,7 @@ public class WEManager {
return false;
}
- public static boolean maskContains(Set mask, double dx, double dy,
- double dz) {
+ public static boolean maskContains(Set mask, double dx, double dy, double dz) {
int x = Math.toIntExact(Math.round(dx >= 0 ? dx - 0.5 : dx + 0.5));
int y = Math.toIntExact(Math.round(dy - 0.5));
int z = Math.toIntExact(Math.round(dz >= 0 ? dz - 0.5 : dz + 0.5));
@@ -66,8 +65,9 @@ public class WEManager {
Location location = player.getLocation();
String world = location.getWorld();
if (!PlotSquared.get().hasPlotArea(world)) {
- regions.add(RegionUtil.createRegion(Integer.MIN_VALUE, Integer.MAX_VALUE, Integer.MIN_VALUE,
- Integer.MAX_VALUE));
+ regions.add(RegionUtil
+ .createRegion(Integer.MIN_VALUE, Integer.MAX_VALUE, Integer.MIN_VALUE,
+ Integer.MAX_VALUE));
return regions;
}
PlotArea area = player.getApplicablePlotArea();
diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/BlockBucket.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/BlockBucket.java
index 447ef0142..f87806554 100644
--- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/BlockBucket.java
+++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/BlockBucket.java
@@ -26,8 +26,9 @@ import java.util.regex.Matcher;
*/
@EqualsAndHashCode(of = {"input"}) @SuppressWarnings({"unused", "WeakerAccess"})
public final class BlockBucket implements ConfigurationSerializable {
+ private static java.util.regex.Pattern regex = java.util.regex.Pattern.compile(
+ "((?[A-Za-z_]+):)?(?([A-Za-z_]+(\\[?[\\S\\s]+\\])?))(:(?[0-9]{1,3}))?");
private boolean compiled;
-
private StringBuilder input;
private BlockState single;
private Pattern pattern;
@@ -76,7 +77,8 @@ public final class BlockBucket implements ConfigurationSerializable {
}
private void addBlock(@NonNull final BlockState block, double chance) {
- if (chance == -1) chance = 1;
+ if (chance == -1)
+ chance = 1;
String prefix = input.length() == 0 ? "" : ",";
input.append(prefix).append(chance).append("%").append(prefix);
this.compiled = false;
@@ -86,8 +88,6 @@ public final class BlockBucket implements ConfigurationSerializable {
return input == null || input.length() == 0;
}
- private static java.util.regex.Pattern regex = java.util.regex.Pattern.compile("((?[A-Za-z_]+):)?(?([A-Za-z_]+(\\[?[\\S\\s]+\\])?))(:(?[0-9]{1,3}))?");
-
public void compile() {
if (isCompiled()) {
return;
@@ -108,7 +108,8 @@ public final class BlockBucket implements ConfigurationSerializable {
if (matcher.find()) {
String chanceStr = matcher.group("chance");
String block = matcher.group("block");
- if (chanceStr != null && block != null && !MathMan.isInteger(block) && MathMan.isInteger(chanceStr)) {
+ if (chanceStr != null && block != null && !MathMan.isInteger(block) && MathMan
+ .isInteger(chanceStr)) {
String namespace = matcher.group("namespace");
string = (namespace == null ? "" : namespace + ":") + block;
}
@@ -116,7 +117,8 @@ public final class BlockBucket implements ConfigurationSerializable {
this.single = BlockUtil.get(string);
this.pattern = new BlockPattern(single);
return;
- } catch (Exception ignore) { }
+ } catch (Exception ignore) {
+ }
}
for (int i = 0; i < blocksStr.length; i++) {
String entry = blocksStr[i];
diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/BlockLoc.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/BlockLoc.java
index a4f02a9ef..ab531d633 100644
--- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/BlockLoc.java
+++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/BlockLoc.java
@@ -68,8 +68,8 @@ public class BlockLoc {
if (this.getX() == 0 && this.getY() == 0 && this.getZ() == 0) {
return "";
}
- return this.getX() + "," + this.getY() + ',' + this.getZ() + ',' + this.getYaw()
- + ',' + this.getPitch();
+ return this.getX() + "," + this.getY() + ',' + this.getZ() + ',' + this.getYaw() + ','
+ + this.getPitch();
}
diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/ConsolePlayer.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/ConsolePlayer.java
index 93b451b3f..a98696c2d 100644
--- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/ConsolePlayer.java
+++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/ConsolePlayer.java
@@ -22,7 +22,8 @@ public class ConsolePlayer extends PlotPlayer {
Location location;
if (area != null) {
CuboidRegion region = area.getRegion();
- location = new Location(area.worldname, region.getMinimumPoint().getX() + region.getMaximumPoint().getX() / 2, 0,
+ location = new Location(area.worldname,
+ region.getMinimumPoint().getX() + region.getMaximumPoint().getX() / 2, 0,
region.getMinimumPoint().getZ() + region.getMaximumPoint().getZ() / 2);
} else {
location = new Location("world", 0, 0, 0);
diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/Location.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/Location.java
index 9daad699d..d1fdbf97f 100644
--- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/Location.java
+++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/Location.java
@@ -35,24 +35,24 @@ public class Location implements Cloneable, Comparable {
return this.x;
}
- public int getY() {
- return this.y;
- }
-
- public int getZ() {
- return this.z;
- }
-
public void setX(int x) {
this.x = x;
this.blockVector3 = BlockVector3.at(x, y, z);
}
+ public int getY() {
+ return this.y;
+ }
+
public void setY(int y) {
this.y = y;
this.blockVector3 = BlockVector3.at(x, y, z);
}
+ public int getZ() {
+ return this.z;
+ }
+
public void setZ(int z) {
this.z = z;
this.blockVector3 = BlockVector3.at(x, y, z);
@@ -65,8 +65,7 @@ public class Location implements Cloneable, Comparable {
this.z = blockVector3.getZ();
}
- @Override
- public Location clone() {
+ @Override public Location clone() {
try {
return (Location) super.clone();
} catch (CloneNotSupportedException e) {
@@ -107,6 +106,7 @@ public class Location implements Cloneable, Comparable {
/**
* Checks if anyone owns a plot at the current location.
+ *
* @return true if the location is a road, not a plot area, or if the plot is unclaimed.
*/
public boolean isUnownedPlotArea() {
diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/Plot.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/Plot.java
index fe73d650e..4226ea949 100644
--- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/Plot.java
+++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/Plot.java
@@ -161,8 +161,8 @@ public class Plot {
* Constructor for a new plot.
* (Only changes after plot.create() will be properly set in the database)
*
- * @param area the PlotArea where the plot is located
- * @param id the plot id
+ * @param area the PlotArea where the plot is located
+ * @param id the plot id
* @param owner the plot owner
* @see Plot#getPlot(Location) for existing plots
*/
@@ -175,7 +175,7 @@ public class Plot {
* (Only changes after plot.create() will be properly set in the database)
*
* @param area the PlotArea where the plot is located
- * @param id the plot id
+ * @param id the plot id
* @see Plot#getPlot(Location) for existing plots
*/
public Plot(PlotArea area, @NotNull PlotId id) {
@@ -187,10 +187,10 @@ public class Plot {
* The database will ignore any queries regarding temporary plots.
* Please note that some bulk plot management functions may still affect temporary plots (TODO: fix this)
*
- * @param area the PlotArea where the plot is located
- * @param id the plot id
+ * @param area the PlotArea where the plot is located
+ * @param id the plot id
* @param owner the owner of the plot
- * @param temp Represents whatever the database manager needs it to
+ * @param temp Represents whatever the database manager needs it to
* @see Plot#getPlot(Location) for existing plots
*/
public Plot(PlotArea area, @NotNull PlotId id, UUID owner, int temp) {
@@ -204,11 +204,11 @@ public class Plot {
/**
* Constructor for a saved plots (Used by the database manager when plots are fetched)
*
- * @param id the plot id
- * @param owner the plot owner
+ * @param id the plot id
+ * @param owner the plot owner
* @param trusted the plot trusted players
- * @param denied the plot denied players
- * @param merged an array giving merged plots
+ * @param denied the plot denied players
+ * @param merged an array giving merged plots
* @see Plot#getPlot(Location) for existing plots
*/
public Plot(@NotNull PlotId id, UUID owner, HashSet trusted, HashSet members,
@@ -238,7 +238,7 @@ public class Plot {
* Gets a plot from a string e.g. [area];[id]
*
* @param defaultArea if no area is specified
- * @param string plot id/area + id
+ * @param string plot id/area + id
* @return New or existing plot object
*/
public static Plot fromString(PlotArea defaultArea, String string) {
@@ -655,9 +655,7 @@ public class Plot {
if (this.getSettings().getMerged(i2)) {
if (this.getSettings().getMerged(i)) {
if (this.area.getPlotAbs(this.id.getRelative(i)).getMerged(i2)) {
- if (this.area.getPlotAbs(this.id.getRelative(i2)).getMerged(i)) {
- return true;
- }
+ return this.area.getPlotAbs(this.id.getRelative(i2)).getMerged(i);
}
}
}
@@ -822,7 +820,7 @@ public class Plot {
/**
* Sets the plot owner (and update the database)
*
- * @param owner uuid to set as owner
+ * @param owner uuid to set as owner
* @param initiator player initiating set owner
* @return boolean
*/
@@ -947,23 +945,31 @@ public class Plot {
return;
}
CuboidRegion region = regions.poll();
- Location pos1 = new Location(getWorldName(), region.getMinimumPoint().getX() - extendBiome, region.getMinimumPoint().getY(),
- region.getMinimumPoint().getZ() - extendBiome);
- Location pos2 = new Location(getWorldName(), region.getMaximumPoint().getX() + extendBiome, region.getMaximumPoint().getY(),
- region.getMaximumPoint().getZ() + extendBiome);
+ Location pos1 =
+ new Location(getWorldName(), region.getMinimumPoint().getX() - extendBiome,
+ region.getMinimumPoint().getY(),
+ region.getMinimumPoint().getZ() - extendBiome);
+ Location pos2 =
+ new Location(getWorldName(), region.getMaximumPoint().getX() + extendBiome,
+ region.getMaximumPoint().getY(),
+ region.getMaximumPoint().getZ() + extendBiome);
ChunkManager.chunkTask(pos1, pos2, new RunnableVal() {
@Override public void run(int[] value) {
BlockVector2 loc = BlockVector2.at(value[0], value[1]);
long start = System.currentTimeMillis();
ChunkManager.manager.loadChunk(getWorldName(), loc, false);
long end = System.currentTimeMillis();
- PlotSquared.debug("[Biome Operation] Loading chunk took: " + TimeUnit.MILLISECONDS.toSeconds(end - start));
+ PlotSquared.debug(
+ "[Biome Operation] Loading chunk took: " + TimeUnit.MILLISECONDS
+ .toSeconds(end - start));
MainUtil.setBiome(getWorldName(), value[2], value[3], value[4], value[5],
biome);
start = System.currentTimeMillis();
ChunkManager.manager.unloadChunk(getWorldName(), loc, true);
end = System.currentTimeMillis();
- PlotSquared.debug("[Biome Operation] Unloading chunk took: " + TimeUnit.MILLISECONDS.toSeconds(end - start));
+ PlotSquared.debug(
+ "[Biome Operation] Unloading chunk took: " + TimeUnit.MILLISECONDS
+ .toSeconds(end - start));
}
}, this, 5);
@@ -1250,7 +1256,7 @@ public class Plot {
Location bot = corners[1];
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()) {
return location;
}
@@ -1264,7 +1270,8 @@ public class Plot {
public Location getSide() {
CuboidRegion largest = getLargestRegion();
- int x = (largest.getMaximumPoint().getX() >> 1) - (largest.getMinimumPoint().getX() >> 1) + largest.getMinimumPoint().getX();
+ int x = (largest.getMaximumPoint().getX() >> 1) - (largest.getMinimumPoint().getX() >> 1)
+ + largest.getMinimumPoint().getX();
int z = largest.getMinimumPoint().getZ() - 1;
PlotManager manager = getManager();
int y = isLoaded() ? WorldUtil.IMP.getHighestBlock(getWorldName(), x, z) : 62;
@@ -1285,10 +1292,9 @@ public class Plot {
return this.getDefaultHome(true);
} else {
Location bottom = this.getBottomAbs();
- Location location =
- new Location(bottom.getWorld(), bottom.getX() + home.getX(), bottom.getY() + home
- .getY(),
- bottom.getZ() + home.getZ(), home.getYaw(), home.getPitch());
+ Location location = new Location(bottom.getWorld(), bottom.getX() + home.getX(),
+ bottom.getY() + home.getY(), bottom.getZ() + home.getZ(), home.getYaw(),
+ home.getPitch());
if (!isLoaded()) {
return location;
}
@@ -1338,8 +1344,10 @@ public class Plot {
if (loc.getX() == Integer.MAX_VALUE && loc.getZ() == Integer.MAX_VALUE) {
// center
CuboidRegion largest = plot.getLargestRegion();
- x = (largest.getMaximumPoint().getX() >> 1) - (largest.getMinimumPoint().getX() >> 1) + largest.getMinimumPoint().getX();
- z = (largest.getMaximumPoint().getZ() >> 1) - (largest.getMinimumPoint().getZ() >> 1) + largest.getMinimumPoint().getZ();
+ x = (largest.getMaximumPoint().getX() >> 1) - (largest.getMinimumPoint().getX()
+ >> 1) + largest.getMinimumPoint().getX();
+ z = (largest.getMaximumPoint().getZ() >> 1) - (largest.getMinimumPoint().getZ()
+ >> 1) + largest.getMinimumPoint().getZ();
} else {
// specific
Location bot = plot.getBottomAbs();
@@ -1359,7 +1367,8 @@ public class Plot {
double count = 0;
for (CuboidRegion region : getRegions()) {
count +=
- (region.getMaximumPoint().getX() - (double) region.getMinimumPoint().getX() + 1) * (region.getMaximumPoint().getZ() - (double) region.getMinimumPoint().getZ() + 1)
+ (region.getMaximumPoint().getX() - (double) region.getMinimumPoint().getX() + 1) * (
+ region.getMaximumPoint().getZ() - (double) region.getMinimumPoint().getZ() + 1)
* MAX_HEIGHT;
}
return count;
@@ -1446,8 +1455,10 @@ public class Plot {
LocalBlockQueue queue = GlobalBlockQueue.IMP.getNewQueue(getWorldName(), false);
HashSet chunks = new HashSet<>();
for (CuboidRegion region : Plot.this.getRegions()) {
- for (int x = region.getMinimumPoint().getX() >> 4; x <= region.getMaximumPoint().getX() >> 4; x++) {
- for (int z = region.getMinimumPoint().getZ() >> 4; z <= region.getMaximumPoint().getZ() >> 4; z++) {
+ for (int x = region.getMinimumPoint().getX() >> 4;
+ x <= region.getMaximumPoint().getX() >> 4; x++) {
+ for (int z = region.getMinimumPoint().getZ() >> 4;
+ z <= region.getMaximumPoint().getZ() >> 4; z++) {
if (chunks.add(BlockVector2.at(x, z))) {
queue.refreshChunk(x, z);
}
@@ -1466,7 +1477,8 @@ public class Plot {
}
Location location = manager.getSignLoc(this);
LocalBlockQueue queue = GlobalBlockQueue.IMP.getNewQueue(getWorldName(), false);
- queue.setBlock(location.getX(), location.getY(), location.getZ(), BlockTypes.AIR.getDefaultState());
+ queue.setBlock(location.getX(), location.getY(), location.getZ(),
+ BlockTypes.AIR.getDefaultState());
queue.flush();
}
@@ -1595,8 +1607,7 @@ public class Plot {
* Sets components such as border, wall, floor.
* (components are generator specific)
*/
- @Deprecated
- public boolean setComponent(String component, String blocks) {
+ @Deprecated public boolean setComponent(String component, String blocks) {
BlockBucket parsed = Configuration.BLOCK_BUCKET.parseString(blocks);
if (parsed != null && parsed.isEmpty()) {
return false;
@@ -1682,7 +1693,7 @@ public class Plot {
/**
* Moves the settings for a plot.
*
- * @param plot the plot to move
+ * @param plot the plot to move
* @param whenDone
* @return
*/
@@ -2244,9 +2255,9 @@ public class Plot {
/**
* Auto merge a plot in a specific direction.
*
- * @param dir the direction to merge
- * @param max the max number of merges to do
- * @param uuid the UUID it is allowed to merge with
+ * @param dir the direction to merge
+ * @param max the max number of merges to do
+ * @param uuid the UUID it is allowed to merge with
* @param removeRoads whether to remove roads
* @return true if a merge takes place
*/
@@ -2365,7 +2376,8 @@ public class Plot {
final FlagContainer flagContainer1 = this.getFlagContainer();
final FlagContainer flagContainer2 = plot.getFlagContainer();
if (!flagContainer1.equals(flagContainer2)) {
- boolean greater = flagContainer1.getFlagMap().size() > flagContainer2.getFlagMap().size();
+ boolean greater =
+ flagContainer1.getFlagMap().size() > flagContainer2.getFlagMap().size();
if (greater) {
flagContainer1.addAll(flagContainer2.getFlagMap().values());
} else {
@@ -2691,13 +2703,13 @@ public class Plot {
Location botabs = plot.getBottomAbs();
Location topabs = plot.getTopAbs();
BlockVector3 pos1 = BlockVector3.at(botabs.getX(), 0, topabs.getZ() + 1);
- BlockVector3 pos2 = BlockVector3.at(topabs.getX(), Plot.MAX_HEIGHT - 1, toploc.getZ());
+ BlockVector3 pos2 =
+ BlockVector3.at(topabs.getX(), Plot.MAX_HEIGHT - 1, toploc.getZ());
regions.add(new CuboidRegion(pos1, pos2));
if (plot.getMerged(Direction.SOUTHEAST)) {
pos1 = BlockVector3.at(topabs.getX() + 1, 0, topabs.getZ() + 1);
pos2 = BlockVector3.at(toploc.getX(), Plot.MAX_HEIGHT - 1, toploc.getZ());
- regions.add(
- new CuboidRegion(pos1, pos2));
+ regions.add(new CuboidRegion(pos1, pos2));
// intersection
}
}
@@ -2711,21 +2723,21 @@ public class Plot {
Location botabs = plot.getBottomAbs();
Location topabs = plot.getTopAbs();
BlockVector3 pos1 = BlockVector3.at(topabs.getX() + 1, 0, botabs.getZ());
- BlockVector3 pos2 = BlockVector3.at(toploc.getX(), Plot.MAX_HEIGHT - 1, topabs.getZ());
+ BlockVector3 pos2 =
+ BlockVector3.at(toploc.getX(), Plot.MAX_HEIGHT - 1, topabs.getZ());
regions.add(new CuboidRegion(pos1, pos2));
if (plot.getMerged(Direction.SOUTHEAST)) {
pos1 = BlockVector3.at(topabs.getX() + 1, 0, topabs.getZ() + 1);
pos2 = BlockVector3.at(toploc.getX(), Plot.MAX_HEIGHT - 1, toploc.getZ());
- regions.add(
- new CuboidRegion(pos1, pos2));
+ regions.add(new CuboidRegion(pos1, pos2));
// intersection
}
}
}
BlockVector3 pos1 = BlockVector3.at(gbotabs.getX(), 0, gbotabs.getZ());
- BlockVector3 pos2 = BlockVector3.at(gtopabs.getX(), Plot.MAX_HEIGHT - 1, gtopabs.getZ());
- regions.add(
- new CuboidRegion(pos1, pos2));
+ BlockVector3 pos2 =
+ BlockVector3.at(gtopabs.getX(), Plot.MAX_HEIGHT - 1, gtopabs.getZ());
+ regions.add(new CuboidRegion(pos1, pos2));
}
return regions;
}
@@ -2741,7 +2753,8 @@ public class Plot {
double area = Double.NEGATIVE_INFINITY;
for (CuboidRegion region : regions) {
double current =
- (region.getMaximumPoint().getX() - (double) region.getMinimumPoint().getX() + 1) * (region.getMaximumPoint().getZ() - (double) region.getMinimumPoint().getZ() + 1);
+ (region.getMaximumPoint().getX() - (double) region.getMinimumPoint().getX() + 1) * (
+ region.getMaximumPoint().getZ() - (double) region.getMinimumPoint().getZ() + 1);
if (current > area) {
max = region;
area = current;
@@ -2771,8 +2784,10 @@ public class Plot {
public List getAllCorners() {
Area area = new Area();
for (CuboidRegion region : this.getRegions()) {
- Rectangle2D rect = new Rectangle2D.Double(region.getMinimumPoint().getX() - 0.6, region.getMinimumPoint().getZ() - 0.6,
- region.getMaximumPoint().getX() - region.getMinimumPoint().getX() + 1.2, region.getMaximumPoint().getZ() - region.getMinimumPoint().getZ() + 1.2);
+ Rectangle2D rect = new Rectangle2D.Double(region.getMinimumPoint().getX() - 0.6,
+ region.getMinimumPoint().getZ() - 0.6,
+ region.getMaximumPoint().getX() - region.getMinimumPoint().getX() + 1.2,
+ region.getMaximumPoint().getZ() - region.getMinimumPoint().getZ() + 1.2);
Area rectArea = new Area(rect);
area.add(rectArea);
}
@@ -2803,7 +2818,7 @@ public class Plot {
* Teleport a player to a plot and send them the teleport message.
*
* @param player the player
- * @param cause the cause of the teleport
+ * @param cause the cause of the teleport
* @return if the teleport succeeded
*/
public boolean teleportPlayer(final PlotPlayer player, TeleportCause cause) {
@@ -2816,12 +2831,14 @@ public class Plot {
} else {
location = this.getDefaultHome(false);
}
- if (Settings.Teleport.DELAY == 0 || Permissions.hasPermission(player, "plots.teleport.delay.bypass")) {
+ if (Settings.Teleport.DELAY == 0 || Permissions
+ .hasPermission(player, "plots.teleport.delay.bypass")) {
MainUtil.sendMessage(player, Captions.TELEPORTED_TO_PLOT);
player.teleport(location, cause);
return true;
}
- MainUtil.sendMessage(player, Captions.TELEPORT_IN_SECONDS, Settings.Teleport.DELAY + "");
+ MainUtil
+ .sendMessage(player, Captions.TELEPORT_IN_SECONDS, Settings.Teleport.DELAY + "");
final String name = player.getName();
TaskManager.TELEPORT_QUEUE.add(name);
TaskManager.runTaskLater(() -> {
@@ -2870,8 +2887,7 @@ public class Plot {
* @return
*/
public boolean setComponent(String component, Pattern blocks) {
- if (StringMan
- .isEqualToAny(component, getManager().getPlotComponents(this.getId()))) {
+ if (StringMan.isEqualToAny(component, getManager().getPlotComponents(this.getId()))) {
EventUtil.manager.callComponentSet(this, component);
}
return this.getManager().setComponent(this.getId(), component, blocks);
diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotArea.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotArea.java
index 77ae1f5d8..6d0c62eca 100644
--- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotArea.java
+++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotArea.java
@@ -92,7 +92,8 @@ public abstract class PlotArea {
/**
* Area flag container
*/
- @Getter private FlagContainer flagContainer = new FlagContainer(GlobalFlagContainer.getInstance());
+ @Getter private FlagContainer flagContainer =
+ new FlagContainer(GlobalFlagContainer.getInstance());
public PlotArea(@NotNull final String worldName, @Nullable final String id,
@NotNull IndependentPlotGenerator generator, @Nullable final PlotId min,
@@ -130,7 +131,8 @@ public abstract class PlotArea {
public CuboidRegion getRegion() {
this.region = getRegionAbs();
if (this.region == null) {
- return new CuboidRegion(BlockVector3.at(Integer.MIN_VALUE, Integer.MIN_VALUE, Integer.MIN_VALUE),
+ return new CuboidRegion(
+ BlockVector3.at(Integer.MIN_VALUE, Integer.MIN_VALUE, Integer.MIN_VALUE),
BlockVector3.at(Integer.MAX_VALUE, Integer.MAX_VALUE, Integer.MAX_VALUE));
}
return this.region;
@@ -532,8 +534,7 @@ public abstract class PlotArea {
public int getPlotCount(@NotNull final UUID uuid) {
if (!Settings.Done.COUNTS_TOWARDS_LIMIT) {
- return (int) getPlotsAbs(uuid).stream().filter(plot -> !DoneFlag.isDone(plot))
- .count();
+ return (int) getPlotsAbs(uuid).stream().filter(plot -> !DoneFlag.isDone(plot)).count();
}
return getPlotsAbs(uuid).size();
}
@@ -642,8 +643,7 @@ public abstract class PlotArea {
*
* For persistent metadata use the flag system
*/
- @Nullable
- public Object getMeta(@NotNull final String key) {
+ @Nullable public Object getMeta(@NotNull final String key) {
if (this.meta != null) {
return this.meta.get(key);
}
@@ -937,7 +937,8 @@ public abstract class PlotArea {
@Override public CuboidRegion getRegion(PlotCluster value) {
BlockVector2 pos1 = BlockVector2.at(value.getP1().x, value.getP1().y);
BlockVector2 pos2 = BlockVector2.at(value.getP2().x, value.getP2().y);
- return new CuboidRegion(pos1.toBlockVector3(), pos2.toBlockVector3(Plot.MAX_HEIGHT - 1));
+ return new CuboidRegion(pos1.toBlockVector3(),
+ pos2.toBlockVector3(Plot.MAX_HEIGHT - 1));
}
};
}
diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotId.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotId.java
index a777a6b6f..3b0fa279c 100644
--- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotId.java
+++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotId.java
@@ -25,14 +25,6 @@ public class PlotId {
this.y = y;
}
- public int getX() {
- return x;
- }
-
- public int getY() {
- return y;
- }
-
/**
* Get a Plot Id based on a string
*
@@ -78,6 +70,14 @@ public class PlotId {
return new PlotId(hash >> 16, hash & 0xFFFF);
}
+ public int getX() {
+ return x;
+ }
+
+ public int getY() {
+ return y;
+ }
+
public PlotId getNextId(int step) {
int absX = Math.abs(x);
int absY = Math.abs(y);
diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotPlayer.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotPlayer.java
index 082b5d08a..4d8821c7f 100644
--- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotPlayer.java
+++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotPlayer.java
@@ -132,6 +132,7 @@ public abstract class PlotPlayer implements CommandCaller, OfflinePlotPlayer {
public ConcurrentHashMap getMeta() {
return meta;
}
+
/**
* Delete the metadata for a key.
* - metadata is session only
@@ -262,8 +263,8 @@ public abstract class PlotPlayer implements CommandCaller, OfflinePlotPlayer {
int count = 0;
for (PlotArea area : PlotSquared.get().getPlotAreas(world)) {
if (!Settings.Done.COUNTS_TOWARDS_LIMIT) {
- count += area.getPlotsAbs(uuid).stream()
- .filter(plot -> !DoneFlag.isDone(plot)).count();
+ count +=
+ area.getPlotsAbs(uuid).stream().filter(plot -> !DoneFlag.isDone(plot)).count();
} else {
count += area.getPlotsAbs(uuid).size();
}
@@ -364,8 +365,6 @@ public abstract class PlotPlayer implements CommandCaller, OfflinePlotPlayer {
sendTitle(title, subtitle, 10, 50, 10);
}
- ;
-
public abstract void sendTitle(String title, String subtitle, int fadeIn, int stay,
int fadeOut);
@@ -382,7 +381,7 @@ public abstract class PlotPlayer implements CommandCaller, OfflinePlotPlayer {
* Teleport this player to a location.
*
* @param location the target location
- * @param cause the cause of the teleport
+ * @param cause the cause of the teleport
*/
public abstract void teleport(Location location, TeleportCause cause);
@@ -622,10 +621,9 @@ public abstract class PlotPlayer implements CommandCaller, OfflinePlotPlayer {
TaskManager.runTask(() -> {
if (getMeta("teleportOnLogin", true)) {
teleport(location);
- sendMessage(
- CaptionUtility.format(Captions.TELEPORTED_TO_PLOT.getTranslated())
- + " (quitLoc) (" + plotX
- + "," + plotZ + ")");
+ sendMessage(CaptionUtility
+ .format(Captions.TELEPORTED_TO_PLOT.getTranslated())
+ + " (quitLoc) (" + plotX + "," + plotZ + ")");
}
});
} else if (!PlotSquared.get().isMainThread(Thread.currentThread())) {
@@ -658,9 +656,7 @@ public abstract class PlotPlayer implements CommandCaller, OfflinePlotPlayer {
}
public void removePersistentMeta(String key) {
- if (this.metaMap.containsKey(key)) {
- this.metaMap.remove(key);
- }
+ this.metaMap.remove(key);
if (Settings.Enabled_Components.PERSISTENT_META) {
DBFunc.removePersistentMeta(getUUID(), key);
}
diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotSettings.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotSettings.java
index 7e79da6a2..29d208487 100644
--- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotSettings.java
+++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotSettings.java
@@ -96,7 +96,8 @@ public class PlotSettings {
}
public void setPosition(BlockLoc position) {
- if (position != null && position.getX() == 0 && position.getY() == 0 && position.getZ() == 0) {
+ if (position != null && position.getX() == 0 && position.getY() == 0
+ && position.getZ() == 0) {
position = null;
}
this.position = position;
diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/TeleportCause.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/TeleportCause.java
index af919e1ba..163182468 100644
--- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/TeleportCause.java
+++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/TeleportCause.java
@@ -1,7 +1,5 @@
package com.github.intellectualsites.plotsquared.plot.object;
public enum TeleportCause {
- COMMAND,
- PLUGIN,
- UNKNOWN
+ COMMAND, PLUGIN, UNKNOWN
}
diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/comment/CommentInbox.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/comment/CommentInbox.java
index 30d9b1230..999eb0a49 100644
--- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/comment/CommentInbox.java
+++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/comment/CommentInbox.java
@@ -14,10 +14,8 @@ public abstract class CommentInbox {
public boolean canRead(Plot plot, PlotPlayer player) {
if (Permissions.hasPermission(player, "plots.inbox.read." + toString(), true)) {
- if (plot.isOwner(player.getUUID()) || Permissions
- .hasPermission(player, "plots.inbox.read." + toString() + ".other", true)) {
- return true;
- }
+ return plot.isOwner(player.getUUID()) || Permissions
+ .hasPermission(player, "plots.inbox.read." + toString() + ".other", true);
}
return false;
}
@@ -33,10 +31,8 @@ public abstract class CommentInbox {
public boolean canModify(Plot plot, PlotPlayer player) {
if (Permissions.hasPermission(player, "plots.inbox.modify." + toString(), true)) {
- if (plot.isOwner(player.getUUID()) || Permissions
- .hasPermission(player, "plots.inbox.modify." + toString() + ".other", true)) {
- return true;
- }
+ return plot.isOwner(player.getUUID()) || Permissions
+ .hasPermission(player, "plots.inbox.modify." + toString() + ".other", true);
}
return false;
}
diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/worlds/SinglePlotArea.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/worlds/SinglePlotArea.java
index f04d340eb..85b6ac7fd 100644
--- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/worlds/SinglePlotArea.java
+++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/worlds/SinglePlotArea.java
@@ -33,8 +33,7 @@ public class SinglePlotArea extends GridPlotWorld {
this.DEFAULT_HOME = new PlotLoc(Integer.MAX_VALUE, Integer.MAX_VALUE);
}
- @NotNull @Override
- protected PlotManager createManager() {
+ @NotNull @Override protected PlotManager createManager() {
return new SinglePlotManager(this);
}
diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/worlds/SinglePlotManager.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/worlds/SinglePlotManager.java
index d2aa10499..e1d97d1e3 100644
--- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/worlds/SinglePlotManager.java
+++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/worlds/SinglePlotManager.java
@@ -68,8 +68,7 @@ public class SinglePlotManager extends PlotManager {
return new String[0];
}
- @Override public boolean setComponent(PlotId plotId, String component,
- Pattern blocks) {
+ @Override public boolean setComponent(PlotId plotId, String component, Pattern blocks) {
return false;
}
@@ -113,5 +112,7 @@ public class SinglePlotManager extends PlotManager {
return false;
}
- @Override public boolean regenerateAllPlotWalls() { return false; }
+ @Override public boolean regenerateAllPlotWalls() {
+ return false;
+ }
}
diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/ByteArrayUtilities.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/ByteArrayUtilities.java
index 91059e240..ce4ef46c8 100644
--- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/ByteArrayUtilities.java
+++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/ByteArrayUtilities.java
@@ -1,7 +1,5 @@
package com.github.intellectualsites.plotsquared.plot.util;
-import com.google.common.primitives.Ints;
-
public class ByteArrayUtilities {
public static boolean bytesToBoolean(byte[] bytes) {
diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/ChunkManager.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/ChunkManager.java
index c4df0f04b..c24d404f0 100644
--- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/ChunkManager.java
+++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/ChunkManager.java
@@ -90,16 +90,19 @@ public abstract class ChunkManager {
int bz = mcr.getZ() << 9;
int tx = bx + 511;
int tz = bz + 511;
- if (bx <= region.getMaximumPoint().getX() && tx >= region.getMinimumPoint().getX() && bz <= region.getMaximumPoint().getZ()
- && tz >= region.getMinimumPoint().getZ()) {
+ if (bx <= region.getMaximumPoint().getX() && tx >= region.getMinimumPoint().getX()
+ && bz <= region.getMaximumPoint().getZ() && tz >= region.getMinimumPoint()
+ .getZ()) {
for (int x = bx >> 4; x <= (tx >> 4); x++) {
int cbx = x << 4;
int ctx = cbx + 15;
- if (cbx <= region.getMaximumPoint().getX() && ctx >= region.getMinimumPoint().getX()) {
+ if (cbx <= region.getMaximumPoint().getX() && ctx >= region
+ .getMinimumPoint().getX()) {
for (int z = bz >> 4; z <= (tz >> 4); z++) {
int cbz = z << 4;
int ctz = cbz + 15;
- if (cbz <= region.getMaximumPoint().getZ() && ctz >= region.getMinimumPoint().getZ()) {
+ if (cbz <= region.getMaximumPoint().getZ() && ctz >= region
+ .getMinimumPoint().getZ()) {
chunks.add(BlockVector2.at(x, z));
}
}
@@ -110,7 +113,7 @@ public abstract class ChunkManager {
TaskManager.objectTask(chunks, new RunnableVal() {
@Override public void run(BlockVector2 value) {
- manager.loadChunk(world, value, false).thenRun(()-> task.run(value));
+ manager.loadChunk(world, value, false).thenRun(() -> task.run(value));
}
}, whenDone);
});
@@ -126,8 +129,10 @@ public abstract class ChunkManager {
return;
}
CuboidRegion value = regions.remove(0);
- Location pos1 = new Location(plot.getWorldName(), value.getMinimumPoint().getX(), 0, value.getMinimumPoint().getZ());
- Location pos2 = new Location(plot.getWorldName(), value.getMaximumPoint().getX(), 0, value.getMaximumPoint().getZ());
+ Location pos1 = new Location(plot.getWorldName(), value.getMinimumPoint().getX(), 0,
+ value.getMinimumPoint().getZ());
+ Location pos2 = new Location(plot.getWorldName(), value.getMaximumPoint().getX(), 0,
+ value.getMaximumPoint().getZ());
chunkTask(pos1, pos2, task, this, allocate);
}
};
@@ -249,8 +254,8 @@ public abstract class ChunkManager {
TaskManager.runTaskAsync(() -> {
for (BlockVector2 loc : chunks) {
String directory =
- world + File.separator + "region" + File.separator + "r." + loc.getX() + "." + loc.getZ()
- + ".mca";
+ world + File.separator + "region" + File.separator + "r." + loc.getX() + "."
+ + loc.getZ() + ".mca";
File file = new File(PlotSquared.get().IMP.getWorldContainer(), directory);
PlotSquared.log("&6 - Deleting file: " + file.getName() + " (max 1024 chunks)");
if (file.exists()) {
diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/EntityUtil.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/EntityUtil.java
index 2bd5a19c2..87f818f3e 100644
--- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/EntityUtil.java
+++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/EntityUtil.java
@@ -7,8 +7,6 @@ import com.github.intellectualsites.plotsquared.plot.object.Plot;
import lombok.NonNull;
import lombok.experimental.UtilityClass;
-;
-
/**
* Entity related general utility methods
*/
@@ -39,7 +37,7 @@ import lombok.experimental.UtilityClass;
return i;
}
- public static boolean checkEntity(Plot plot, PlotFlag ... flags) {
+ public static boolean checkEntity(Plot plot, PlotFlag... flags) {
if (Settings.Done.RESTRICT_BUILDING && DoneFlag.isDone(plot)) {
return true;
}
diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/EventUtil.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/EventUtil.java
index dab84bc7f..eca427096 100644
--- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/EventUtil.java
+++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/EventUtil.java
@@ -92,8 +92,8 @@ public abstract class EventUtil {
.getArea() instanceof SinglePlotArea)) {
TaskManager.runTask(() -> plot.teleportPlayer(player));
MainUtil.sendMessage(player,
- CaptionUtility.format(Captions.TELEPORTED_TO_ROAD.getTranslated()) + " (on-login) " + "(" + plot.getId().x + ";" + plot
- .getId().y + ")");
+ CaptionUtility.format(Captions.TELEPORTED_TO_ROAD.getTranslated()) + " (on-login) "
+ + "(" + plot.getId().x + ";" + plot.getId().y + ")");
}
}
@@ -123,20 +123,17 @@ public abstract class EventUtil {
case INTERACT_BLOCK: {
if (plot == null) {
return Permissions.hasPermission(player,
- Captions.PERMISSION_ADMIN_INTERACT_ROAD.getTranslated(),
- notifyPerms);
+ Captions.PERMISSION_ADMIN_INTERACT_ROAD.getTranslated(), notifyPerms);
}
if (!plot.hasOwner()) {
return Permissions.hasPermission(player,
- Captions.PERMISSION_ADMIN_INTERACT_UNOWNED.getTranslated(),
- notifyPerms);
+ Captions.PERMISSION_ADMIN_INTERACT_UNOWNED.getTranslated(), notifyPerms);
}
List use = plot.getFlag(UseFlag.class);
if (!use.contains(BlockTypes.AIR) && !use.contains(blockType)) {
return Permissions.hasPermission(player,
- Captions.PERMISSION_ADMIN_INTERACT_OTHER.getTranslated(), false)
- || !(!notifyPerms || MainUtil
- .sendMessage(player, Captions.FLAG_TUTORIAL_USAGE,
+ Captions.PERMISSION_ADMIN_INTERACT_OTHER.getTranslated(), false) || !(
+ !notifyPerms || MainUtil.sendMessage(player, Captions.FLAG_TUTORIAL_USAGE,
Captions.FLAG_USE.getTranslated()));
}
return true;
@@ -148,41 +145,34 @@ public abstract class EventUtil {
}
if (!plot.hasOwner()) {
return Permissions.hasPermission(player,
- Captions.PERMISSION_ADMIN_INTERACT_UNOWNED.getTranslated(),
- false);
+ Captions.PERMISSION_ADMIN_INTERACT_UNOWNED.getTranslated(), false);
}
if (plot.getFlag(DeviceInteractFlag.class)) {
return true;
}
List use = plot.getFlag(UseFlag.class);
if (!use.contains(BlockTypes.AIR) && !use.contains(blockType)) {
- if (Permissions.hasPermission(player,
- Captions.PERMISSION_ADMIN_INTERACT_OTHER.getTranslated(),
- false)) {
- return true;
- }
- return false;
+ return Permissions.hasPermission(player,
+ Captions.PERMISSION_ADMIN_INTERACT_OTHER.getTranslated(), false);
}
return true;
}
case SPAWN_MOB: {
if (plot == null) {
return Permissions.hasPermission(player,
- Captions.PERMISSION_ADMIN_INTERACT_ROAD.getTranslated(),
- notifyPerms);
+ Captions.PERMISSION_ADMIN_INTERACT_ROAD.getTranslated(), notifyPerms);
}
if (!plot.hasOwner()) {
return Permissions.hasPermission(player,
- Captions.PERMISSION_ADMIN_INTERACT_UNOWNED.getTranslated(),
- notifyPerms);
+ Captions.PERMISSION_ADMIN_INTERACT_UNOWNED.getTranslated(), notifyPerms);
}
if (plot.getFlag(MobPlaceFlag.class)) {
return true;
}
List place = plot.getFlag(PlaceFlag.class);
if (!place.contains(BlockTypes.AIR) && !place.contains(blockType)) {
- if (Permissions
- .hasPermission(player, Captions.PERMISSION_ADMIN_INTERACT_OTHER.getTranslated(), false)) {
+ if (Permissions.hasPermission(player,
+ Captions.PERMISSION_ADMIN_INTERACT_OTHER.getTranslated(), false)) {
return true;
}
return !(!notifyPerms || MainUtil
@@ -195,21 +185,19 @@ public abstract class EventUtil {
case PLACE_MISC: {
if (plot == null) {
return Permissions.hasPermission(player,
- Captions.PERMISSION_ADMIN_INTERACT_ROAD.getTranslated(),
- notifyPerms);
+ Captions.PERMISSION_ADMIN_INTERACT_ROAD.getTranslated(), notifyPerms);
}
if (!plot.hasOwner()) {
return Permissions.hasPermission(player,
- Captions.PERMISSION_ADMIN_INTERACT_UNOWNED.getTranslated(),
- notifyPerms);
+ Captions.PERMISSION_ADMIN_INTERACT_UNOWNED.getTranslated(), notifyPerms);
}
if (plot.getFlag(MiscPlaceFlag.class)) {
return true;
}
List place = plot.getFlag(PlaceFlag.class);
if (!place.contains(BlockTypes.AIR) && !place.contains(blockType)) {
- if (Permissions
- .hasPermission(player, Captions.PERMISSION_ADMIN_INTERACT_OTHER.getTranslated(), false)) {
+ if (Permissions.hasPermission(player,
+ Captions.PERMISSION_ADMIN_INTERACT_OTHER.getTranslated(), false)) {
return true;
}
return !(!notifyPerms || MainUtil
@@ -223,13 +211,11 @@ public abstract class EventUtil {
case PLACE_VEHICLE:
if (plot == null) {
return Permissions.hasPermission(player,
- Captions.PERMISSION_ADMIN_INTERACT_ROAD.getTranslated(),
- notifyPerms);
+ Captions.PERMISSION_ADMIN_INTERACT_ROAD.getTranslated(), notifyPerms);
}
if (!plot.hasOwner()) {
return Permissions.hasPermission(player,
- Captions.PERMISSION_ADMIN_INTERACT_UNOWNED.getTranslated(),
- notifyPerms);
+ Captions.PERMISSION_ADMIN_INTERACT_UNOWNED.getTranslated(), notifyPerms);
}
return plot.getFlag(VehiclePlaceFlag.class);
default:
diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/IncendoPaster.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/IncendoPaster.java
index b5ebe5d17..48cb395c5 100644
--- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/IncendoPaster.java
+++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/IncendoPaster.java
@@ -25,7 +25,7 @@ import java.util.Locale;
* Upload service URL
*/
public static final String UPLOAD_PATH = "https://athion.net/ISPaster/paste/upload";
- /**
+ /**
* Valid paste applications
*/
public static final Collection VALID_APPLICATIONS =
diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/MainUtil.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/MainUtil.java
index 0d8988576..e96be74ff 100644
--- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/MainUtil.java
+++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/MainUtil.java
@@ -596,8 +596,8 @@ public class MainUtil {
/**
* Send a message to the player.
*
- * @param player Player to receive message
- * @param message Message to send
+ * @param player Player to receive message
+ * @param message Message to send
* @return true Can be used in things such as commands (return PlayerFunctions.sendMessage(...))
*/
public static boolean sendMessage(PlotPlayer player, String message) {
@@ -792,10 +792,9 @@ public class MainUtil {
df.setMaximumFractionDigits(340);
value = df.format(value);
}
- flags.append(prefix)
- .append(CaptionUtility
- .format(Captions.PLOT_FLAG_LIST.getTranslated(), entry.getKey().getName(),
- value));
+ flags.append(prefix).append(CaptionUtility
+ .format(Captions.PLOT_FLAG_LIST.getTranslated(), entry.getKey().getName(),
+ value));
prefix = ", ";
}
}
diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/SchematicHandler.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/SchematicHandler.java
index 680cf9b21..e19ad3d88 100644
--- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/SchematicHandler.java
+++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/SchematicHandler.java
@@ -168,12 +168,15 @@ public abstract class SchematicHandler {
final int HEIGHT = dimension.getY();
// Validate dimensions
CuboidRegion region = plot.getLargestRegion();
- if (((region.getMaximumPoint().getX() - region.getMinimumPoint().getX() + xOffset + 1) < WIDTH) || (
- (region.getMaximumPoint().getZ() - region.getMinimumPoint().getZ() + zOffset + 1) < LENGTH) || (HEIGHT > 256)) {
+ if (((region.getMaximumPoint().getX() - region.getMinimumPoint().getX() + xOffset
+ + 1) < WIDTH) || (
+ (region.getMaximumPoint().getZ() - region.getMinimumPoint().getZ() + zOffset
+ + 1) < LENGTH) || (HEIGHT > 256)) {
PlotSquared.debug("Schematic is too large");
PlotSquared.debug(
"(" + WIDTH + ',' + LENGTH + ',' + HEIGHT + ") is bigger than (" + (
- region.getMaximumPoint().getX() - region.getMinimumPoint().getX()) + ',' + (region.getMaximumPoint().getZ() - region.getMinimumPoint().getZ())
+ region.getMaximumPoint().getX() - region.getMinimumPoint().getX()) + ','
+ + (region.getMaximumPoint().getZ() - region.getMinimumPoint().getZ())
+ ",256)");
TaskManager.runTask(whenDone);
return;
@@ -191,7 +194,8 @@ public abstract class SchematicHandler {
y_offset_actual = yOffset + ((ClassicPlotWorld) pw).PLOT_HEIGHT;
} else {
y_offset_actual = yOffset + 1 + MainUtil
- .getHeighestBlock(plot.getWorldName(), region.getMinimumPoint().getX() + 1,
+ .getHeighestBlock(plot.getWorldName(),
+ region.getMinimumPoint().getX() + 1,
region.getMinimumPoint().getZ() + 1);
}
}
@@ -199,8 +203,8 @@ public abstract class SchematicHandler {
y_offset_actual = yOffset;
}
Location pos1 =
- new Location(plot.getWorldName(), region.getMinimumPoint().getX() + xOffset, y_offset_actual,
- region.getMinimumPoint().getZ() + zOffset);
+ new Location(plot.getWorldName(), region.getMinimumPoint().getX() + xOffset,
+ y_offset_actual, region.getMinimumPoint().getZ() + zOffset);
Location pos2 = pos1.clone().add(WIDTH - 1, HEIGHT - 1, LENGTH - 1);
final int p1x = pos1.getX();
final int p1z = pos1.getZ();
diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/WorldUtil.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/WorldUtil.java
index 8b9c200c6..e56d5b24e 100644
--- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/WorldUtil.java
+++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/WorldUtil.java
@@ -104,10 +104,13 @@ public abstract class WorldUtil {
int brz = bot.getZ() >> 9;
int trx = top.getX() >> 9;
int trz = top.getZ() >> 9;
- Set files = ChunkManager.manager.getChunkChunks(bot.getWorld());
+ Set files =
+ ChunkManager.manager.getChunkChunks(bot.getWorld());
for (BlockVector2 mca : files) {
- if (mca.getX() >= brx && mca.getX() <= trx && mca.getZ() >= brz && mca.getZ() <= trz) {
- final File file = getMcr(plot.getWorldName(), mca.getX(), mca.getZ());
+ if (mca.getX() >= brx && mca.getX() <= trx && mca.getZ() >= brz
+ && mca.getZ() <= trz) {
+ final File file =
+ getMcr(plot.getWorldName(), mca.getX(), mca.getZ());
if (file != null) {
//final String name = "r." + (x - cx) + "." + (z - cz) + ".mca";
String name = file.getName();
diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/area/QuadMap.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/area/QuadMap.java
index e016cfeea..443a3c0d9 100644
--- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/area/QuadMap.java
+++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/area/QuadMap.java
@@ -256,8 +256,9 @@ public class QuadMap {
}
public boolean intersects(CuboidRegion other) {
- return (other.getMinimumPoint().getX() <= this.x + this.size) && (other.getMaximumPoint().getX() >= this.x - this.size) && (
- other.getMinimumPoint().getZ() <= this.z + this.size) && (other.getMaximumPoint().getZ() >= this.z - this.size);
+ return (other.getMinimumPoint().getX() <= this.x + this.size) && (
+ other.getMaximumPoint().getX() >= this.x - this.size) && (other.getMinimumPoint().getZ()
+ <= this.z + this.size) && (other.getMaximumPoint().getZ() >= this.z - this.size);
}
public T get(int x, int z) {
diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/block/ChunkBlockQueue.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/block/ChunkBlockQueue.java
index 0d7f9294d..57134373c 100644
--- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/block/ChunkBlockQueue.java
+++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/block/ChunkBlockQueue.java
@@ -71,9 +71,7 @@ public class ChunkBlockQueue extends ScopedLocalBlockQueue {
return true;
}
- @Override
- @Nullable
- public BlockState getBlock(int x, int y, int z) {
+ @Override @Nullable public BlockState getBlock(int x, int y, int z) {
BlockState[][] blocksY = result[y];
if (blocksY != null) {
BlockState[] blocksYZ = blocksY[z];
@@ -84,9 +82,7 @@ public class ChunkBlockQueue extends ScopedLocalBlockQueue {
return null;
}
- @Override
- @Nullable
- public String getWorld() {
+ @Override @Nullable public String getWorld() {
return null;
}
diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/block/LocalBlockQueue.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/block/LocalBlockQueue.java
index 4778a1cae..e1a5b3274 100644
--- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/block/LocalBlockQueue.java
+++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/block/LocalBlockQueue.java
@@ -50,9 +50,9 @@ public abstract class LocalBlockQueue {
/**
* Sets the block at the coordinates provided to the given id.
*
- * @param x the x coordinate from from 0 to 15 inclusive
- * @param y the y coordinate from from 0 (inclusive) - maxHeight(exclusive)
- * @param z the z coordinate from 0 to 15 inclusive
+ * @param x the x coordinate from from 0 to 15 inclusive
+ * @param y the y coordinate from from 0 (inclusive) - maxHeight(exclusive)
+ * @param z the z coordinate from 0 to 15 inclusive
* @param id the id to set the block to
*/
public abstract boolean setBlock(final int x, final int y, final int z, final BlockState id);
diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/expiry/ExpireManager.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/expiry/ExpireManager.java
index 774f9a429..c5caf28c8 100644
--- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/expiry/ExpireManager.java
+++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/expiry/ExpireManager.java
@@ -306,8 +306,8 @@ public class ExpireManager {
confirmation);
}
}, () -> {
- newPlot.setFlag(
- GlobalFlagContainer.getInstance().getFlag(AnalysisFlag.class), changed.asList());
+ newPlot.setFlag(GlobalFlagContainer.getInstance()
+ .getFlag(AnalysisFlag.class), changed.asList());
TaskManager.runTaskLaterAsync(task, 20);
});
}
diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/helpmenu/HelpMenu.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/helpmenu/HelpMenu.java
index 107f12f93..dd06e2681 100644
--- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/helpmenu/HelpMenu.java
+++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/helpmenu/HelpMenu.java
@@ -26,17 +26,17 @@ public class HelpMenu {
return this;
}
- public HelpMenu setCommands(final List commands) {
- this.commands = commands;
- return this;
- }
-
public HelpMenu getCommands() {
this.commands =
MainCommand.getInstance().getCommands(this.commandCategory, this.commandCaller);
return this;
}
+ public HelpMenu setCommands(final List commands) {
+ this.commands = commands;
+ return this;
+ }
+
public HelpMenu generateMaxPages() {
this.maxPage = Math.max((this.commands.size() - 1) / PER_PAGE, 0);
return this;
diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/world/BlockUtil.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/world/BlockUtil.java
index e4afd9c5d..856ddc758 100644
--- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/world/BlockUtil.java
+++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/world/BlockUtil.java
@@ -16,19 +16,19 @@ import lombok.NonNull;
import java.util.Map;
public final class BlockUtil {
- private BlockUtil(){}
-
private static ParserContext PARSER_CONTEXT = new ParserContext();
-
private static InputParser PARSER;
- static {
+ static {
PARSER_CONTEXT.setRestricted(false);
PARSER_CONTEXT.setPreferringWildcard(false);
PARSER_CONTEXT.setTryLegacy(true);
PARSER = WorldEdit.getInstance().getBlockFactory().getParsers().get(0);
}
+ private BlockUtil() {
+ }
+
public static BlockState get(int id) {
return LegacyMapper.getInstance().getBlockFromLegacy(id);
}
diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/world/ItemUtil.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/world/ItemUtil.java
index 098d3b461..2b574193b 100644
--- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/world/ItemUtil.java
+++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/world/ItemUtil.java
@@ -8,7 +8,8 @@ import com.sk89q.worldedit.world.registry.LegacyMapper;
import java.util.Locale;
public final class ItemUtil {
- private ItemUtil(){}
+ private ItemUtil() {
+ }
public static ItemType get(String input) {
if (input == null || input.isEmpty()) {
@@ -20,14 +21,17 @@ public final class ItemUtil {
if (MathMan.isInteger(split[0])) {
if (split.length == 2) {
if (MathMan.isInteger(split[1])) {
- return LegacyMapper.getInstance().getItemFromLegacy(Integer.parseInt(split[0]), Integer.parseInt(split[1]));
+ return LegacyMapper.getInstance()
+ .getItemFromLegacy(Integer.parseInt(split[0]),
+ Integer.parseInt(split[1]));
}
} else {
return LegacyMapper.getInstance().getItemFromLegacy(Integer.parseInt(split[0]));
}
}
}
- if (!input.split("\\[", 2)[0].contains(":")) input = "minecraft:" + input;
+ if (!input.split("\\[", 2)[0].contains(":"))
+ input = "minecraft:" + input;
return ItemTypes.get(input);
}
diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/world/OperationUtil.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/world/OperationUtil.java
index 2cb336f52..64432d555 100644
--- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/world/OperationUtil.java
+++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/world/OperationUtil.java
@@ -32,39 +32,9 @@ public class OperationUtil {
ASYNC = hasFawe;
}
- public Future> withEditSession(@NotNull PlotPlayer plotPlayer, @NotNull Consumer consumer, @Nullable Consumer exceptionHandler) {
- if (ASYNC) {
- ListeningExecutorService exec = WorldEdit.getInstance().getExecutorService();
- return exec.submit(
- () -> withEditSessionOnThread(plotPlayer, consumer, exceptionHandler));
- } else {
- withEditSessionOnThread(plotPlayer, consumer, exceptionHandler);
- }
- return Futures.immediateFuture(true);
- }
-
- private void withEditSessionOnThread(PlotPlayer plotPlayer, Consumer consumer, Consumer exceptionHandler) {
- Actor actor = plotPlayer.toActor();
- World weWorld = getWorld(plotPlayer, actor);
- LocalSession session = getSession(actor);
- try (EditSession ess = createEditSession(weWorld, actor, session)) {
- try {
- consumer.accept(ess);
- } finally {
- ess.close();
- session.remember(ess);
- }
- } catch (Throwable e) {
- if (exceptionHandler != null) {
- exceptionHandler.accept(e);
- } else {
- e.printStackTrace();
- }
- }
- }
-
private static World getWorld(String worldName) {
- Platform platform = WorldEdit.getInstance().getPlatformManager().queryCapability(Capability.WORLD_EDITING);
+ Platform platform =
+ WorldEdit.getInstance().getPlatformManager().queryCapability(Capability.WORLD_EDITING);
List extends World> worlds = platform.getWorlds();
for (World current : worlds) {
if (current.getName().equals(worldName)) {
@@ -86,7 +56,7 @@ public class OperationUtil {
return weWorld;
}
- private static EditSession createEditSession(PlotPlayer plotPlayer) {
+ private static EditSession createEditSession(PlotPlayer plotPlayer) {
Actor actor = plotPlayer.toActor();
World weWorld = getWorld(plotPlayer, actor);
return createEditSession(weWorld, actor);
@@ -96,18 +66,51 @@ public class OperationUtil {
return WorldEdit.getInstance().getSessionManager().get(actor);
}
- private static EditSession createEditSession(World world, Actor actor) {
+ private static EditSession createEditSession(World world, Actor actor) {
return createEditSession(world, actor, getSession(actor));
}
- private static EditSession createEditSession(World world, Actor actor, LocalSession session) {
+ private static EditSession createEditSession(World world, Actor actor, LocalSession session) {
EditSession editSession;
Player player = actor.isPlayer() ? (Player) actor : null;
- editSession = WorldEdit.getInstance().getEditSessionFactory()
- .getEditSession(world, -1, null, player);
+ editSession =
+ WorldEdit.getInstance().getEditSessionFactory().getEditSession(world, -1, null, player);
editSession.setFastMode(!actor.isPlayer());
editSession.setReorderMode(EditSession.ReorderMode.FAST);
return editSession;
}
+
+ public Future> withEditSession(@NotNull PlotPlayer plotPlayer,
+ @NotNull Consumer consumer, @Nullable Consumer exceptionHandler) {
+ if (ASYNC) {
+ ListeningExecutorService exec = WorldEdit.getInstance().getExecutorService();
+ return exec
+ .submit(() -> withEditSessionOnThread(plotPlayer, consumer, exceptionHandler));
+ } else {
+ withEditSessionOnThread(plotPlayer, consumer, exceptionHandler);
+ }
+ return Futures.immediateFuture(true);
+ }
+
+ private void withEditSessionOnThread(PlotPlayer plotPlayer, Consumer consumer,
+ Consumer exceptionHandler) {
+ Actor actor = plotPlayer.toActor();
+ World weWorld = getWorld(plotPlayer, actor);
+ LocalSession session = getSession(actor);
+ try (EditSession ess = createEditSession(weWorld, actor, session)) {
+ try {
+ consumer.accept(ess);
+ } finally {
+ ess.close();
+ session.remember(ess);
+ }
+ } catch (Throwable e) {
+ if (exceptionHandler != null) {
+ exceptionHandler.accept(e);
+ } else {
+ e.printStackTrace();
+ }
+ }
+ }
}
diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/world/PatternUtil.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/world/PatternUtil.java
index 4d3107eb0..bc1aa72bf 100644
--- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/world/PatternUtil.java
+++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/world/PatternUtil.java
@@ -18,10 +18,8 @@ import com.sk89q.worldedit.world.block.BlockType;
public class PatternUtil {
public static BaseBlock apply(Pattern pattern, int x, int y, int z) {
- if (pattern instanceof BlockPattern
- || pattern instanceof RandomPattern
- || pattern instanceof BlockState
- || pattern instanceof BlockType
+ if (pattern instanceof BlockPattern || pattern instanceof RandomPattern
+ || pattern instanceof BlockState || pattern instanceof BlockType
|| pattern instanceof BaseBlock) {
return pattern.apply(BlockVector3.ZERO);
}
diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/world/RegionUtil.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/world/RegionUtil.java
index 271f76dac..1b1d04e08 100644
--- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/world/RegionUtil.java
+++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/world/RegionUtil.java
@@ -9,7 +9,8 @@ public class RegionUtil {
return createRegion(pos1x, pos2x, 0, Plot.MAX_HEIGHT - 1, pos1z, pos2z);
}
- public static CuboidRegion createRegion(int pos1x, int pos2x, int pos1y, int pos2y, int pos1z, int pos2z) {
+ public static CuboidRegion createRegion(int pos1x, int pos2x, int pos1y, int pos2y, int pos1z,
+ int pos2z) {
BlockVector3 pos1 = BlockVector3.at(pos1x, pos1y, pos1z);
BlockVector3 pos2 = BlockVector3.at(pos2x, pos2y, pos2z);
return new CuboidRegion(pos1, pos2);
@@ -24,7 +25,8 @@ public class RegionUtil {
public static boolean contains(CuboidRegion region, int x, int y, int z) {
BlockVector3 min = region.getMinimumPoint();
BlockVector3 max = region.getMaximumPoint();
- return x >= min.getX() && x <= max.getX() && z >= min.getZ() && z <= max.getZ() && y >= min.getY() && y <= max.getY();
+ return x >= min.getX() && x <= max.getX() && z >= min.getZ() && z <= max.getZ() && y >= min
+ .getY() && y <= max.getY();
}
// Because WE (not fawe) lack this for CuboidRegion
@@ -35,6 +37,7 @@ public class RegionUtil {
BlockVector3 otherMin = other.getMinimumPoint();
BlockVector3 otherMax = other.getMaximumPoint();
- return otherMin.getX() <= regionMax.getX() && otherMax.getX() >= regionMin.getX() && otherMin.getZ() <= regionMax.getZ() && otherMax.getZ() >= regionMin.getZ();
+ return otherMin.getX() <= regionMax.getX() && otherMax.getX() >= regionMin.getX()
+ && otherMin.getZ() <= regionMax.getZ() && otherMax.getZ() >= regionMin.getZ();
}
}