diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/BukkitMain.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/BukkitMain.java index d71fc1645..68e221333 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/BukkitMain.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/BukkitMain.java @@ -33,8 +33,8 @@ import com.sk89q.worldedit.bukkit.WorldEditPlugin; import com.sk89q.worldedit.extension.platform.Capability; import lombok.Getter; import lombok.NonNull; -import org.bukkit.Location; import org.bukkit.*; +import org.bukkit.Location; import org.bukkit.command.PluginCommand; import org.bukkit.entity.Entity; import org.bukkit.entity.LivingEntity; @@ -114,10 +114,12 @@ public final class BukkitMain extends JavaPlugin implements Listener, IPlotMain System.out.println("[P2] Testing platform capabilities"); WorldEdit.getInstance().getPlatformManager().queryCapability(Capability.GAME_HOOKS); } catch (final Throwable throwable) { - throw new IllegalStateException("Failed to force load WorldEdit." - + " Road schematics will fail to generate", throwable); + throw new IllegalStateException( + "Failed to force load WorldEdit." + " Road schematics will fail to generate", + throwable); } } + private final LegacyMappings legacyMappings = new BukkitLegacyMappings(); private final BlockRegistry blockRegistry = new BukkitBlockRegistry(Material.values()); @@ -160,16 +162,19 @@ public final class BukkitMain extends JavaPlugin implements Listener, IPlotMain if (Bukkit.getVersion().contains("git-Spigot")) { // Uses System.out.println because the logger isn't initialized yet - System.out.println("[P2] ========================== USE PAPER =========================="); + System.out + .println("[P2] ========================== USE PAPER =========================="); System.out.println("[P2] Paper offers a more complete API for us to work with"); System.out.println("[P2] and we may come to rely on it in the future."); System.out.println("[P2] It is also recommended out of a performance standpoint as"); - System.out.println("[P2] it contains many improvements missing from Spigot and Bukkit."); + System.out + .println("[P2] it contains many improvements missing from Spigot and Bukkit."); System.out.println("[P2] DOWNLOAD: https://papermc.io/downloads"); System.out.println("[P2] GUIDE: https://www.spigotmc.org/threads/21726/"); System.out.println("[P2] NOTE: This is only a recommendation"); System.out.println("[P2] both Spigot and CraftBukkit are still supported."); - System.out.println("[P2] ==============================================================="); + System.out + .println("[P2] ==============================================================="); } new PlotSquared(this, "Bukkit"); @@ -325,67 +330,81 @@ public final class BukkitMain extends JavaPlugin implements Listener, IPlotMain @Override @SuppressWarnings("deprecation") public void runEntityTask() { PlotSquared.log(C.PREFIX + "KillAllEntities started."); - TaskManager.runTaskRepeat(() -> PlotSquared.get().foreachPlotArea(new RunnableVal() { - @Override public void run(PlotArea plotArea) { - final World world = Bukkit.getWorld(plotArea.worldname); - try { - if (world == null) { - return; - } - List entities = world.getEntities(); - Iterator iterator = entities.iterator(); - while (iterator.hasNext()) { - Entity entity = iterator.next(); - switch (entity.getType()) { - case EGG: - case COMPLEX_PART: - case FISHING_HOOK: - case ENDER_SIGNAL: - case LINGERING_POTION: - case AREA_EFFECT_CLOUD: - case EXPERIENCE_ORB: - case LEASH_HITCH: - case FIREWORK: - case WEATHER: - case LIGHTNING: - case WITHER_SKULL: - case UNKNOWN: - case PLAYER: - // non moving / unmovable - continue; - case THROWN_EXP_BOTTLE: - case SPLASH_POTION: - case SNOWBALL: - case SHULKER_BULLET: - case SPECTRAL_ARROW: - case TIPPED_ARROW: - case ENDER_PEARL: - case ARROW: - case LLAMA_SPIT: - // managed elsewhere | projectile - continue; - case ITEM_FRAME: - case PAINTING: - // Not vehicles - continue; - case ARMOR_STAND: - // Temporarily classify as vehicle - case MINECART: - case MINECART_CHEST: - case MINECART_COMMAND: - case MINECART_FURNACE: - case MINECART_HOPPER: - case MINECART_MOB_SPAWNER: - case ENDER_CRYSTAL: - case MINECART_TNT: - case BOAT: - if (Settings.Enabled_Components.KILL_ROAD_VEHICLES) { - com.github.intellectualsites.plotsquared.plot.object.Location - location = - BukkitUtil.getLocation(entity.getLocation()); - Plot plot = location.getPlot(); - if (plot == null) { - if (location.isPlotArea()) { + TaskManager + .runTaskRepeat(() -> PlotSquared.get().foreachPlotArea(new RunnableVal() { + @Override public void run(PlotArea plotArea) { + final World world = Bukkit.getWorld(plotArea.worldname); + try { + if (world == null) { + return; + } + List entities = world.getEntities(); + Iterator iterator = entities.iterator(); + while (iterator.hasNext()) { + Entity entity = iterator.next(); + switch (entity.getType()) { + case EGG: + case COMPLEX_PART: + case FISHING_HOOK: + case ENDER_SIGNAL: + case LINGERING_POTION: + case AREA_EFFECT_CLOUD: + case EXPERIENCE_ORB: + case LEASH_HITCH: + case FIREWORK: + case WEATHER: + case LIGHTNING: + case WITHER_SKULL: + case UNKNOWN: + case PLAYER: + // non moving / unmovable + continue; + case THROWN_EXP_BOTTLE: + case SPLASH_POTION: + case SNOWBALL: + case SHULKER_BULLET: + case SPECTRAL_ARROW: + case TIPPED_ARROW: + case ENDER_PEARL: + case ARROW: + case LLAMA_SPIT: + // managed elsewhere | projectile + continue; + case ITEM_FRAME: + case PAINTING: + // Not vehicles + continue; + case ARMOR_STAND: + // Temporarily classify as vehicle + case MINECART: + case MINECART_CHEST: + case MINECART_COMMAND: + case MINECART_FURNACE: + case MINECART_HOPPER: + case MINECART_MOB_SPAWNER: + case ENDER_CRYSTAL: + case MINECART_TNT: + case BOAT: + if (Settings.Enabled_Components.KILL_ROAD_VEHICLES) { + com.github.intellectualsites.plotsquared.plot.object.Location + location = BukkitUtil.getLocation(entity.getLocation()); + Plot plot = location.getPlot(); + if (plot == null) { + if (location.isPlotArea()) { + if (entity.hasMetadata("ps-tmp-teleport")) { + continue; + } + iterator.remove(); + entity.remove(); + } + continue; + } + List meta = entity.getMetadata("plot"); + if (meta.isEmpty()) { + continue; + } + Plot origin = (Plot) meta.get(0).value(); + if (!plot.equals(origin.getBasePlot(false))) { if (entity.hasMetadata("ps-tmp-teleport")) { continue; } @@ -393,97 +412,93 @@ public final class BukkitMain extends JavaPlugin implements Listener, IPlotMain entity.remove(); } continue; - } - List meta = entity.getMetadata("plot"); - if (meta.isEmpty()) { + } else { continue; } - Plot origin = (Plot) meta.get(0).value(); - if (!plot.equals(origin.getBasePlot(false))) { - if (entity.hasMetadata("ps-tmp-teleport")) { - continue; - } - iterator.remove(); + case SMALL_FIREBALL: + case FIREBALL: + case DRAGON_FIREBALL: + case DROPPED_ITEM: + if (Settings.Enabled_Components.KILL_ROAD_ITEMS) { entity.remove(); } + // dropped item continue; - } else { + case PRIMED_TNT: + case FALLING_BLOCK: + // managed elsewhere continue; - } - case SMALL_FIREBALL: - case FIREBALL: - case DRAGON_FIREBALL: - case DROPPED_ITEM: - if (Settings.Enabled_Components.KILL_ROAD_ITEMS) { - entity.remove(); - } - // dropped item - continue; - case PRIMED_TNT: - case FALLING_BLOCK: - // managed elsewhere - continue; - case LLAMA: - case DONKEY: - case MULE: - case ZOMBIE_HORSE: - case SKELETON_HORSE: - case HUSK: - case ELDER_GUARDIAN: - case WITHER_SKELETON: - case STRAY: - case ZOMBIE_VILLAGER: - case EVOKER: - case EVOKER_FANGS: - case VEX: - case VINDICATOR: - case POLAR_BEAR: - case BAT: - case BLAZE: - case CAVE_SPIDER: - case CHICKEN: - case COW: - case CREEPER: - case ENDERMAN: - case ENDERMITE: - case ENDER_DRAGON: - case GHAST: - case GIANT: - case GUARDIAN: - case HORSE: - case IRON_GOLEM: - case MAGMA_CUBE: - case MUSHROOM_COW: - case OCELOT: - case PIG: - case PIG_ZOMBIE: - case RABBIT: - case SHEEP: - case SILVERFISH: - case SKELETON: - case SLIME: - case SNOWMAN: - case SPIDER: - case SQUID: - case VILLAGER: - case WITCH: - case WITHER: - case WOLF: - case ZOMBIE: - default: { - if (Settings.Enabled_Components.KILL_ROAD_MOBS) { - Location location = entity.getLocation(); - if (BukkitUtil.getLocation(location).isPlotRoad()) { - if (entity instanceof LivingEntity) { - LivingEntity livingEntity = - (LivingEntity) entity; - if (!livingEntity.isLeashed() || !entity - .hasMetadata("keep")) { + case LLAMA: + case DONKEY: + case MULE: + case ZOMBIE_HORSE: + case SKELETON_HORSE: + case HUSK: + case ELDER_GUARDIAN: + case WITHER_SKELETON: + case STRAY: + case ZOMBIE_VILLAGER: + case EVOKER: + case EVOKER_FANGS: + case VEX: + case VINDICATOR: + case POLAR_BEAR: + case BAT: + case BLAZE: + case CAVE_SPIDER: + case CHICKEN: + case COW: + case CREEPER: + case ENDERMAN: + case ENDERMITE: + case ENDER_DRAGON: + case GHAST: + case GIANT: + case GUARDIAN: + case HORSE: + case IRON_GOLEM: + case MAGMA_CUBE: + case MUSHROOM_COW: + case OCELOT: + case PIG: + case PIG_ZOMBIE: + case RABBIT: + case SHEEP: + case SILVERFISH: + case SKELETON: + case SLIME: + case SNOWMAN: + case SPIDER: + case SQUID: + case VILLAGER: + case WITCH: + case WITHER: + case WOLF: + case ZOMBIE: + default: { + if (Settings.Enabled_Components.KILL_ROAD_MOBS) { + Location location = entity.getLocation(); + if (BukkitUtil.getLocation(location).isPlotRoad()) { + if (entity instanceof LivingEntity) { + LivingEntity livingEntity = (LivingEntity) entity; + if (!livingEntity.isLeashed() || !entity + .hasMetadata("keep")) { + Entity passenger = entity.getPassenger(); + if (!(passenger instanceof Player) && entity + .getMetadata("keep").isEmpty()) { + if (entity.hasMetadata("ps-tmp-teleport")) { + continue; + } + iterator.remove(); + entity.remove(); + continue; + } + } + } else { Entity passenger = entity.getPassenger(); if (!(passenger instanceof Player) && entity .getMetadata("keep").isEmpty()) { - if (entity - .hasMetadata("ps-tmp-teleport")) { + if (entity.hasMetadata("ps-tmp-teleport")) { continue; } iterator.remove(); @@ -491,84 +506,68 @@ public final class BukkitMain extends JavaPlugin implements Listener, IPlotMain continue; } } - } else { - Entity passenger = entity.getPassenger(); - if (!(passenger instanceof Player) && entity - .getMetadata("keep").isEmpty()) { - if (entity.hasMetadata("ps-tmp-teleport")) { - continue; - } - iterator.remove(); - entity.remove(); - continue; - } } } + continue; } - continue; - } - case SHULKER: { - if (Settings.Enabled_Components.KILL_ROAD_MOBS) { - LivingEntity livingEntity = (LivingEntity) entity; - List meta = entity.getMetadata("plot"); - if (meta != null && !meta.isEmpty()) { - if (livingEntity.isLeashed()) - continue; + case SHULKER: { + if (Settings.Enabled_Components.KILL_ROAD_MOBS) { + LivingEntity livingEntity = (LivingEntity) entity; + List meta = entity.getMetadata("plot"); + if (meta != null && !meta.isEmpty()) { + if (livingEntity.isLeashed()) + continue; - List keep = - entity.getMetadata("keep"); - if (keep != null && !keep.isEmpty()) - continue; + List keep = entity.getMetadata("keep"); + if (keep != null && !keep.isEmpty()) + continue; - PlotId originalPlotId = - (PlotId) meta.get(0).value(); - if (originalPlotId != null) { + PlotId originalPlotId = (PlotId) meta.get(0).value(); + if (originalPlotId != null) { + com.github.intellectualsites.plotsquared.plot.object.Location + pLoc = + BukkitUtil.getLocation(entity.getLocation()); + PlotArea area = pLoc.getPlotArea(); + if (area != null) { + PlotId currentPlotId = + PlotId.of(area.getPlotAbs(pLoc)); + if (!originalPlotId.equals(currentPlotId) && ( + currentPlotId == null || !area + .getPlot(originalPlotId) + .equals(area.getPlot(currentPlotId)))) { + if (entity.hasMetadata("ps-tmp-teleport")) { + continue; + } + iterator.remove(); + entity.remove(); + } + } + } + } else { + //This is to apply the metadata to already spawned shulkers (see EntitySpawnListener.java) com.github.intellectualsites.plotsquared.plot.object.Location - pLoc = BukkitUtil - .getLocation(entity.getLocation()); + pLoc = BukkitUtil.getLocation(entity.getLocation()); PlotArea area = pLoc.getPlotArea(); if (area != null) { PlotId currentPlotId = PlotId.of(area.getPlotAbs(pLoc)); - if (!originalPlotId.equals(currentPlotId) - && (currentPlotId == null || !area - .getPlot(originalPlotId) - .equals(area.getPlot(currentPlotId)))) { - if (entity - .hasMetadata("ps-tmp-teleport")) { - continue; - } - iterator.remove(); - entity.remove(); + if (currentPlotId != null) { + entity.setMetadata("plot", + new FixedMetadataValue( + (Plugin) PlotSquared.get().IMP, + currentPlotId)); } } } - } else { - //This is to apply the metadata to already spawned shulkers (see EntitySpawnListener.java) - com.github.intellectualsites.plotsquared.plot.object.Location - pLoc = - BukkitUtil.getLocation(entity.getLocation()); - PlotArea area = pLoc.getPlotArea(); - if (area != null) { - PlotId currentPlotId = - PlotId.of(area.getPlotAbs(pLoc)); - if (currentPlotId != null) { - entity.setMetadata("plot", - new FixedMetadataValue( - (Plugin) PlotSquared.get().IMP, - currentPlotId)); - } - } } } } } + } catch (Throwable e) { + e.printStackTrace(); } - } catch (Throwable e) { - e.printStackTrace(); } - } - }), 20); + }), 20); } @Override @Nullable @@ -766,7 +765,8 @@ public final class BukkitMain extends JavaPlugin implements Listener, IPlotMain if (this.metricsStarted) { return; } - System.setProperty("bstats.relocatecheck", "false"); // We do not want to relocate the package... + System.setProperty("bstats.relocatecheck", + "false"); // We do not want to relocate the package... new org.bstats.bukkit.Metrics(this); // bstats PlotSquared.log(C.PREFIX + "&6Metrics enabled."); this.metricsStarted = true; diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/commands/DebugUUID.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/commands/DebugUUID.java index e53c69b02..0dfcf1a18 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/commands/DebugUUID.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/commands/DebugUUID.java @@ -27,8 +27,10 @@ import java.nio.file.Files; import java.util.*; import java.util.Map.Entry; -@CommandDeclaration(command = "uuidconvert", permission = "plots.admin", description = "Debug UUID conversion", usage = "/plot uuidconvert ", requiredType = RequiredType.CONSOLE, category = CommandCategory.DEBUG) -public class DebugUUID extends SubCommand { +@CommandDeclaration(command = "uuidconvert", permission = "plots.admin", + description = "Debug UUID conversion", usage = "/plot uuidconvert ", + requiredType = RequiredType.CONSOLE, category = CommandCategory.DEBUG) public class DebugUUID + extends SubCommand { public DebugUUID() { super(Argument.String); diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitChunkManager.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitChunkManager.java index f5924f592..28a6c4e29 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitChunkManager.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitChunkManager.java @@ -206,8 +206,8 @@ public class BukkitChunkManager extends ChunkManager { RegionWrapper currentPlotClear = new RegionWrapper(pos1.getX(), pos2.getX(), pos1.getZ(), pos2.getZ()); if (xxb >= p1x && xxt <= p2x && zzb >= p1z && zzt <= p2z) { - AugmentedUtils.bypass(ignoreAugment, - () -> queue.regenChunkSafe(chunk.x, chunk.z)); + AugmentedUtils + .bypass(ignoreAugment, () -> queue.regenChunkSafe(chunk.x, chunk.z)); continue; } boolean checkX1 = false; @@ -270,39 +270,38 @@ public class BukkitChunkManager extends ChunkManager { map.saveRegion(worldObj, xxt2, xxt, zzt2, zzt); // } map.saveEntitiesOut(chunkObj, currentPlotClear); - AugmentedUtils.bypass(ignoreAugment, () -> setChunkInPlotArea(null, new RunnableVal() { - @Override public void run(ScopedLocalBlockQueue value) { - com.github.intellectualsites.plotsquared.plot.object.Location - min = value.getMin(); - int bx = min.getX(); - int bz = min.getZ(); - for (int x1 = 0; x1 < 16; x1++) { - for (int z1 = 0; z1 < 16; z1++) { - PlotLoc loc = new PlotLoc(bx + x1, bz + z1); - PlotBlock[] ids = map.allBlocks.get(loc); - if (ids != null) { - for (int y = 0; - y < Math.min(128, ids.length); y++) { - PlotBlock id = ids[y]; - if (id != null) { - value.setBlock(x1, y, z1, id); - } else { - value.setBlock(x1, y, z1, - PlotBlock.get("air")); + AugmentedUtils.bypass(ignoreAugment, + () -> setChunkInPlotArea(null, new RunnableVal() { + @Override public void run(ScopedLocalBlockQueue value) { + com.github.intellectualsites.plotsquared.plot.object.Location min = + value.getMin(); + int bx = min.getX(); + int bz = min.getZ(); + for (int x1 = 0; x1 < 16; x1++) { + for (int z1 = 0; z1 < 16; z1++) { + PlotLoc loc = new PlotLoc(bx + x1, bz + z1); + PlotBlock[] ids = map.allBlocks.get(loc); + if (ids != null) { + for (int y = 0; y < Math.min(128, ids.length); y++) { + PlotBlock id = ids[y]; + if (id != null) { + value.setBlock(x1, y, z1, id); + } else { + value.setBlock(x1, y, z1, PlotBlock.get("air")); + } } - } - for (int y = Math.min(128, ids.length); - y < ids.length; y++) { - PlotBlock id = ids[y]; - if (id != null) { - value.setBlock(x1, y, z1, id); + for (int y = Math.min(128, ids.length); + y < ids.length; y++) { + PlotBlock id = ids[y]; + if (id != null) { + value.setBlock(x1, y, z1, id); + } } } } } } - } - }, world, chunk)); + }, world, chunk)); map.restoreBlocks(worldObj, 0, 0); map.restoreEntities(worldObj, 0, 0); } @@ -347,8 +346,8 @@ public class BukkitChunkManager extends ChunkManager { public void unloadChunk(final String world, final ChunkLoc loc, final boolean save, final boolean safe) { if (!PlotSquared.get().isMainThread(Thread.currentThread())) { - TaskManager.runTask( - () -> BukkitUtil.getWorld(world).unloadChunk(loc.x, loc.z, save, safe)); + TaskManager + .runTask(() -> BukkitUtil.getWorld(world).unloadChunk(loc.x, loc.z, save, safe)); } else { BukkitUtil.getWorld(world).unloadChunk(loc.x, loc.z, save, safe); } diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitLegacyMappings.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitLegacyMappings.java index ae58998d8..b9b9663f2 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitLegacyMappings.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitLegacyMappings.java @@ -676,7 +676,8 @@ public final class BukkitLegacyMappings extends LegacyMappings { for (final Material material : Material.values()) { final String materialName = material.name().toLowerCase(Locale.ENGLISH); if (OLD_STRING_TO_STRING_PLOT_BLOCK.get(materialName) == null) { - final LegacyBlock missingBlock = new LegacyBlock(material.getId(), materialName, materialName); + final LegacyBlock missingBlock = + new LegacyBlock(material.getId(), materialName, materialName); missing.add(missingBlock); } } @@ -692,8 +693,9 @@ public final class BukkitLegacyMappings extends LegacyMappings { .put(new IdDataPair(legacyBlock.getNumericalId(), legacyBlock.getDataValue()), legacyBlock.toStringPlotBlock()); } */ - LEGACY_ID_AND_DATA_TO_STRING_PLOT_BLOCK.put(new IdDataPair(legacyBlock.getNumericalId(), - legacyBlock.getDataValue()), legacyBlock.toStringPlotBlock()); + LEGACY_ID_AND_DATA_TO_STRING_PLOT_BLOCK + .put(new IdDataPair(legacyBlock.getNumericalId(), legacyBlock.getDataValue()), + legacyBlock.toStringPlotBlock()); NEW_STRING_TO_LEGACY_PLOT_BLOCK .put(legacyBlock.getLegacyName(), legacyBlock.toStringPlotBlock()); OLD_STRING_TO_STRING_PLOT_BLOCK 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 5bc3fa0f2..62ecfad3f 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 @@ -2027,7 +2027,7 @@ import java.util.zip.ZipInputStream; * * @param alias to search plots * @param worldname to filter alias to a specific world [optional] null means all worlds - * @return Set<{ @ link Plot }> empty if nothing found + * @return Set<{ @ link Plot }> empty if nothing found */ public Set getPlotsByAlias(@Nullable final String alias, @NonNull final String worldname) { 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 8d9df2774..03d27555a 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 @@ -16,8 +16,10 @@ import java.util.Iterator; import java.util.Set; import java.util.UUID; -@CommandDeclaration(command = "add", description = "Allow a user to build in a plot while you are online", usage = "/plot add ", category = CommandCategory.SETTINGS, permission = "plots.add", requiredType = RequiredType.NONE) -public class Add extends Command { +@CommandDeclaration(command = "add", + description = "Allow a user to build in a plot while you are online", + usage = "/plot add ", category = CommandCategory.SETTINGS, permission = "plots.add", + requiredType = RequiredType.NONE) 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 b5e248fab..2eeb0a49d 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,10 +12,11 @@ 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.NONE) -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.NONE) 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 7f7f64dba..9dc5ce20e 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 @@ -15,8 +15,11 @@ 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) { 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 428b76b15..a8636d1e1 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 @@ -11,7 +11,9 @@ import com.github.intellectualsites.plotsquared.plot.util.*; import javax.annotation.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) { 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 d9c16f1f6..82a573949 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 @@ -8,10 +8,10 @@ import com.github.intellectualsites.plotsquared.plot.util.MainUtil; import com.github.intellectualsites.plotsquared.plot.util.StringMan; import com.github.intellectualsites.plotsquared.plot.util.WorldUtil; -@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) { int biome = WorldUtil.IMP.getBiomeFromString(value); 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 370f18493..af552ec67 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,8 +15,9 @@ import com.google.common.base.Optional; import java.util.Set; -@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/Changelog.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Changelog.java index 720bff1bf..829e34380 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Changelog.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Changelog.java @@ -10,8 +10,10 @@ import java.io.IOException; import java.net.URL; import java.util.Scanner; -@CommandDeclaration(command = "changelog", permission = "plots.admin.command.changelog", description = "View the changelog", usage = "/plot changelog", requiredType = RequiredType.NONE, aliases = { - "cl"}, category = CommandCategory.ADMINISTRATION) public class Changelog extends SubCommand { +@CommandDeclaration(command = "changelog", permission = "plots.admin.command.changelog", + description = "View the changelog", usage = "/plot changelog", requiredType = RequiredType.NONE, + aliases = {"cl"}, category = CommandCategory.ADMINISTRATION) public class Changelog + extends SubCommand { @Override public boolean onCommand(PlotPlayer player, String[] args) { try { 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 ef4dc5d33..453a6a8ac 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,8 +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 = "chat", description = "Toggle plot chat on or off", usage = "/plot chat [on|off]", permission = "plots.chat", category = CommandCategory.CHAT, requiredType = RequiredType.NONE) -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.NONE) 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 9edebd05e..88f102967 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 @@ -10,7 +10,9 @@ import com.github.intellectualsites.plotsquared.plot.util.EconHandler; import com.github.intellectualsites.plotsquared.plot.util.Permissions; import com.github.intellectualsites.plotsquared.plot.util.TaskManager; -@CommandDeclaration(command = "claim", aliases = "c", description = "Claim the current plot you're standing on", category = CommandCategory.CLAIMING, requiredType = RequiredType.NONE, 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.NONE, permission = "plots.claim", usage = "/plot claim") public class Claim extends SubCommand { @Override public boolean onCommand(final PlotPlayer player, String[] args) { 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 a9dbe3e91..efd6b1525 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 @@ -14,8 +14,9 @@ import com.github.intellectualsites.plotsquared.plot.util.MainUtil; import com.github.intellectualsites.plotsquared.plot.util.Permissions; import com.github.intellectualsites.plotsquared.plot.util.block.GlobalBlockQueue; -@CommandDeclaration(command = "clear", description = "Clear the plot you stand on", 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", + 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 cd605bf30..154a8f914 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 @@ -15,8 +15,10 @@ 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 7df0d34d1..775450517 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.NONE, permission = "plots.comment") +@CommandDeclaration(command = "comment", aliases = {"msg"}, description = "Comment on a plot", + category = CommandCategory.CHAT, requiredType = RequiredType.NONE, 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 94629e08d..040fd97b8 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 @@ -15,8 +15,9 @@ import java.util.*; import java.util.Set; import java.util.concurrent.atomic.AtomicBoolean; -@CommandDeclaration(command = "condense", permission = "plots.admin", description = "Condense a plotworld", category = CommandCategory.ADMINISTRATION, requiredType = RequiredType.CONSOLE) -public class Condense extends SubCommand { +@CommandDeclaration(command = "condense", permission = "plots.admin", + 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 c4812b30f..b33bd4dab 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,8 +9,9 @@ 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 9657f0a79..68bf8c786 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,8 +9,10 @@ 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.NONE) -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.NONE) 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 ab9c7b8f8..8303ef042 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 loc = 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 779bf46c0..acc47a64e 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,9 +9,11 @@ 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.NONE, 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.NONE, + 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 loc = 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 c89821f4c..b760bc282 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,9 +22,11 @@ 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 5fcb921a0..28594982c 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 @@ -7,7 +7,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 = "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) { 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 2f558828a..cbfacfae6 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,8 +8,10 @@ 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 e57a543ef..01a344369 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 @@ -17,7 +17,8 @@ import java.util.UUID; @CommandDeclaration(command = "debugclaimtest", description = "If you accidentally delete your database, this command will attempt to restore all plots based on the data from plot signs. " - + "Execution time may vary", category = CommandCategory.DEBUG, requiredType = RequiredType.CONSOLE, permission = "plots.debugclaimtest") + + "Execution time may vary", category = CommandCategory.DEBUG, + requiredType = RequiredType.CONSOLE, permission = "plots.debugclaimtest") public class DebugClaimTest extends SubCommand { @Override public boolean onCommand(final PlotPlayer player, String[] args) { 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 ca5ba76d3..d68220814 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 @@ -24,8 +24,9 @@ import java.nio.charset.StandardCharsets; import java.sql.Timestamp; import java.util.*; -@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; 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 eaea2ad82..da1e27e61 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,7 +16,9 @@ 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 7a8d92744..ddffaf744 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 @@ -17,8 +17,9 @@ import com.google.common.base.Charsets; import java.io.File; import java.util.UUID; -@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 bbc972438..f12ce8d1e 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,8 +5,10 @@ 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 1e29809ff..bb06abe8a 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 @@ -13,8 +13,10 @@ import com.github.intellectualsites.plotsquared.plot.util.UUIDHandler; import java.io.File; import java.io.IOException; -@CommandDeclaration(command = "debugpaste", aliases = "dp", usage = "/plot debugpaste", description = "Upload settings.yml, worlds.yml, commands.yml and latest.log to www.hastebin.com", permission = "plots.debugpaste", category = CommandCategory.DEBUG) -public class DebugPaste extends SubCommand { +@CommandDeclaration(command = "debugpaste", aliases = "dp", usage = "/plot debugpaste", + description = "Upload settings.yml, worlds.yml, commands.yml and latest.log to www.hastebin.com", + permission = "plots.debugpaste", category = CommandCategory.DEBUG) public class DebugPaste + extends SubCommand { @Override public boolean onCommand(final PlotPlayer player, String[] args) { TaskManager.runTaskAsync(new Runnable() { 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 7b070e20f..9b7c35c12 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 @@ -4,12 +4,16 @@ import com.github.intellectualsites.plotsquared.commands.CommandDeclaration; import com.github.intellectualsites.plotsquared.plot.config.C; import com.github.intellectualsites.plotsquared.plot.generator.HybridPlotManager; import com.github.intellectualsites.plotsquared.plot.generator.HybridPlotWorld; -import com.github.intellectualsites.plotsquared.plot.generator.HybridUtils; -import com.github.intellectualsites.plotsquared.plot.object.*; +import com.github.intellectualsites.plotsquared.plot.object.Location; +import com.github.intellectualsites.plotsquared.plot.object.Plot; +import com.github.intellectualsites.plotsquared.plot.object.PlotArea; +import com.github.intellectualsites.plotsquared.plot.object.PlotPlayer; import com.github.intellectualsites.plotsquared.plot.util.MainUtil; -import com.github.intellectualsites.plotsquared.plot.util.MathMan; -@CommandDeclaration(command = "debugroadregen", usage = "/plot debugroadregen", requiredType = RequiredType.NONE, description = "Regenerate all roads based on the road schematic", category = CommandCategory.DEBUG, permission = "plots.debugroadregen") +@CommandDeclaration(command = "debugroadregen", usage = "/plot debugroadregen", + requiredType = RequiredType.NONE, + description = "Regenerate all roads based on the road schematic", + category = CommandCategory.DEBUG, permission = "plots.debugroadregen") public class DebugRoadRegen extends SubCommand { @Override public boolean onCommand(PlotPlayer player, String[] args) { @@ -20,24 +24,7 @@ public class DebugRoadRegen extends SubCommand { } Plot plot = player.getCurrentPlot(); if (plot == null) { - ChunkLoc chunk = new ChunkLoc(loc.getX() >> 4, loc.getZ() >> 4); - int extend = 0; - if (args.length == 1) { - if (MathMan.isInteger(args[0])) { - try { - extend = Integer.parseInt(args[0]); - } catch (NumberFormatException ignored) { - C.NOT_VALID_NUMBER.send(player, "(0, )"); - return false; - } - } - } - boolean result = HybridUtils.manager.regenerateRoad(plotArea, chunk, extend); - MainUtil.sendMessage(player, - "&6Regenerating chunk: " + chunk.x + ',' + chunk.z + "\n&6 - Result: " + (result ? - "&aSuccess" : - "&cFailed")); - MainUtil.sendMessage(player, "&cTo regenerate all roads: /plot regenallroads"); + C.NOT_IN_PLOT.send(player); } else { HybridPlotManager manager = (HybridPlotManager) plotArea.getPlotManager(); manager.createRoadEast(plotArea, plot); 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 f90a5b1d6..fbbc3267c 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,7 +9,10 @@ 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 39637e83b..ede1f14cd 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 @@ -7,10 +7,10 @@ import com.github.intellectualsites.plotsquared.plot.object.*; import com.github.intellectualsites.plotsquared.plot.util.*; -@CommandDeclaration(command = "delete", permission = "plots.delete", description = "Delete the plot you stand on", usage = "/plot delete", aliases = { - "dispose", - "del"}, 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"}, 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 723a47cfb..e586f0656 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 @@ -14,9 +14,10 @@ import java.util.Iterator; import java.util.Set; import java.util.UUID; -@CommandDeclaration(command = "deny", aliases = {"d", - "ban"}, description = "Deny a user from a plot", usage = "/plot deny ", category = CommandCategory.SETTINGS, requiredType = RequiredType.NONE) -public class Deny extends SubCommand { +@CommandDeclaration(command = "deny", aliases = {"d", "ban"}, + description = "Deny a user from a plot", usage = "/plot deny ", + category = CommandCategory.SETTINGS, requiredType = RequiredType.NONE) 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 83d0636bf..687eef002 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 @@ -8,10 +8,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.NONE) -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.NONE) 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/Done.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Done.java index f3661be2d..a37c187cc 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 loc = 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 11e338720..3b67c3f8d 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 @@ -13,9 +13,10 @@ import com.sk89q.jnbt.CompoundTag; import java.net.URL; -@CommandDeclaration(usage = "/plot download [schematic|bo3|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|bo3|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(); 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 35ccf7a4e..d7ab4e9cd 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 @@ -14,9 +14,10 @@ import com.google.common.base.Optional; import java.util.*; -@CommandDeclaration(command = "setflag", aliases = {"f", "flag", "setf", - "setflag"}, usage = "/plot flag ", description = "Set plot flags", category = CommandCategory.SETTINGS, requiredType = RequiredType.NONE, permission = "plots.flag") -public class FlagCmd extends SubCommand { +@CommandDeclaration(command = "setflag", aliases = {"f", "flag", "setf", "setflag"}, + 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, Flag flag, String key, String value) { key = key.toLowerCase(); 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 81c7f3039..d29bd76bb 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 @@ -15,8 +15,9 @@ import com.github.intellectualsites.plotsquared.plot.util.UUIDHandler; import java.util.UUID; -@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 36053b9f1..f0ff64af1 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 @@ -11,8 +11,8 @@ import com.github.intellectualsites.plotsquared.plot.util.MathMan; import com.github.intellectualsites.plotsquared.plot.util.StringMan; import com.github.intellectualsites.plotsquared.plot.util.helpmenu.HelpMenu; -@CommandDeclaration(command = "help", description = "Get this help menu", aliases = {"he", - "?"}, category = CommandCategory.INFO, usage = "help [category|#]", permission = "plots.use") +@CommandDeclaration(command = "help", description = "Get this help menu", aliases = {"he", "?"}, + category = CommandCategory.INFO, usage = "help [category|#]", permission = "plots.use") public class Help extends Command { public Help(Command parent) { super(parent, 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 eedc8945b..bf1bb74be 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 @@ -15,8 +15,10 @@ import com.google.common.base.Optional; import java.util.ArrayList; 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.NONE) -public class Inbox extends SubCommand { +@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.NONE) public class Inbox + extends SubCommand { public void displayComments(PlotPlayer player, List oldComments, int page) { if (oldComments == null || oldComments.isEmpty()) { 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 c8971c71c..6241e1d51 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 @@ -9,8 +9,9 @@ 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 ", category = CommandCategory.INFO) -public class Info extends SubCommand { +@CommandDeclaration(command = "info", aliases = "i", description = "Display plot info", + usage = "/plot info ", category = CommandCategory.INFO) public class Info + extends SubCommand { @Override public boolean onCommand(final PlotPlayer player, String[] args) { Plot plot; 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 f35423781..fe026b362 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,9 @@ 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.NONE) -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.NONE) 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 ae4043af8..6da8c1601 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 @@ -12,8 +12,9 @@ import com.github.intellectualsites.plotsquared.plot.util.MainUtil; import java.util.UUID; -@CommandDeclaration(command = "leave", description = "Leave a plot", permission = "plots.leave", category = CommandCategory.CLAIMING, requiredType = RequiredType.NONE) -public class Leave extends Command { +@CommandDeclaration(command = "leave", description = "Leave a plot", permission = "plots.leave", + category = CommandCategory.CLAIMING, requiredType = RequiredType.NONE) public class Leave + extends Command { public Leave() { super(MainCommand.getInstance(), 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 29a1defb2..472103853 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 @@ -13,8 +13,9 @@ import com.google.common.base.Optional; import java.util.*; import java.util.Map.Entry; -@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) { 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 90c000d9e..42736f9dc 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 @@ -15,9 +15,9 @@ 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 cc74d3c6a..a68681d7a 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 @@ -14,8 +14,9 @@ import java.util.Arrays; /** * 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; 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 e9527e3bd..532fa2ce0 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 @@ -8,7 +8,10 @@ import com.github.intellectualsites.plotsquared.plot.util.*; import java.util.UUID; -@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"}; 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 0105dc8bf..f4f184cc1 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 @@ -9,9 +9,10 @@ import com.github.intellectualsites.plotsquared.plot.object.PlotPlayer; /** * @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.NONE) -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.NONE) 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 725ce3a25..346dea7b9 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,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(usage = "/plot move ", command = "move", description = "Move a plot", aliases = { - "debugmove"}, permission = "plots.move", category = CommandCategory.CLAIMING, requiredType = RequiredType.NONE) -public class Move extends SubCommand { +@CommandDeclaration(usage = "/plot move ", command = "move", description = "Move a plot", + aliases = {"debugmove"}, permission = "plots.move", category = CommandCategory.CLAIMING, + requiredType = RequiredType.NONE) public class Move extends SubCommand { @Override public boolean onCommand(final PlotPlayer player, String[] args) { Location loc = 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 457d92e30..50b6f36d8 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 @@ -9,8 +9,10 @@ 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", "music_disc_far", "music_disc_mall", "music_disc_mellohi", 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 b9929e51e..c3e9c5f9e 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 @@ -9,8 +9,8 @@ import com.github.intellectualsites.plotsquared.plot.object.RunnableVal2; import com.github.intellectualsites.plotsquared.plot.object.RunnableVal3; import com.github.intellectualsites.plotsquared.plot.util.StringMan; -@CommandDeclaration(command = "near", aliases = "n", description = "Display nearby players", usage = "/plot near", category = CommandCategory.INFO) -public class Near extends Command { +@CommandDeclaration(command = "near", aliases = "n", description = "Display nearby players", + usage = "/plot near", category = CommandCategory.INFO) 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 964cbf212..4095c15c9 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 @@ -10,10 +10,10 @@ import com.github.intellectualsites.plotsquared.plot.util.*; 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) { Set plots = plot.getConnectedPlots(); 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 9207aa9a7..81047ec9b 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,8 +8,9 @@ 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 57e0fe2e9..b8b38e298 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,8 +18,11 @@ 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 9b31124c8..7141df96e 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 @@ -13,8 +13,9 @@ import com.github.intellectualsites.plotsquared.plot.util.*; import java.util.*; import java.util.Map.Entry; -@CommandDeclaration(command = "rate", permission = "plots.rate", description = "Rate the plot", usage = "/plot rate [#|next|purge]", aliases = "rt", category = CommandCategory.INFO, requiredType = RequiredType.NONE) -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.NONE) 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 e149a077f..87549270b 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 @@ -14,9 +14,11 @@ import com.github.intellectualsites.plotsquared.plot.util.MainUtil; import java.util.Set; -@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 7b3b52fe0..79a87b887 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 @@ -9,8 +9,8 @@ import com.github.intellectualsites.plotsquared.plot.util.block.LocalBlockQueue; import java.util.HashSet; -@CommandDeclaration(command = "relight", description = "Relight your plot", usage = "/plot relight", category = CommandCategory.DEBUG) -public class Relight extends Command { +@CommandDeclaration(command = "relight", description = "Relight your plot", usage = "/plot relight", + category = CommandCategory.DEBUG) 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 d24b54ff8..71ee2e840 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 @@ -14,8 +14,9 @@ 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 666192e58..bf027f20d 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,9 +17,10 @@ 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 684cc860c..da09625f0 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 @@ -14,9 +14,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(); @@ -52,8 +52,7 @@ public class Save extends SubCommand { PlotId id = plot.getId(); String world1 = plot.getArea().toString().replaceAll(";", "-") .replaceAll("[^A-Za-z0-9]", ""); - final String file = - time + '_' + world1 + '_' + id.x + '_' + id.y + '_' + size; + final String file = time + '_' + world1 + '_' + id.x + '_' + id.y + '_' + size; UUID uuid = player.getUUID(); SchematicHandler.manager.upload(value, uuid, file, new RunnableVal() { @Override public void run(URL url) { 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 4a802b911..110992543 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 @@ -13,8 +13,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; 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 8dd9ce8f1..95166aa4a 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 @@ -16,9 +16,10 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.HashSet; -@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"}; 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 86f474cd0..fc92cc550 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,8 +8,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 = "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.NONE) +@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.NONE) 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 cfbab8ed7..facea4952 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 @@ -17,8 +17,9 @@ import javax.annotation.Nullable; import java.util.*; import java.util.Map.Entry; -@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 { public void displayGenerators(PlotPlayer player) { StringBuilder message = new StringBuilder(); @@ -305,8 +306,7 @@ import java.util.Map.Entry; private static final class StepPickGenerator extends SetupStep { - @Getter - private String generator; + @Getter private String generator; public StepPickGenerator() { super("generator"); @@ -319,11 +319,17 @@ import java.util.Map.Entry; for (Entry> entry : SetupUtils.generators.entrySet()) { final PlotMessage plotMessage = new PlotMessage(" - ").color("$8"); if (entry.getKey().equals(PlotSquared.imp().getPluginName())) { - plotMessage.text(entry.getKey()).color("$8").tooltip("Select this generator").color("$2").command("/plot setup generator " + entry.getKey()).text(" (Default Generator)").color("$7"); + plotMessage.text(entry.getKey()).color("$8").tooltip("Select this generator") + .color("$2").command("/plot setup generator " + entry.getKey()) + .text(" (Default Generator)").color("$7"); } else if (entry.getValue().isFull()) { - plotMessage.text(entry.getKey()).color("$8").tooltip("Select this generator").color("$7").command("/plot setup generator " + entry.getKey()).text(" (Plot Generator)").color("$7"); + plotMessage.text(entry.getKey()).color("$8").tooltip("Select this generator") + .color("$7").command("/plot setup generator " + entry.getKey()) + .text(" (Plot Generator)").color("$7"); } else { - plotMessage.text(entry.getKey()).color("$8").tooltip("Select this generator").color("$7").command("/plot setup generator " + entry.getKey()).text(" (Unknown Structure)").color("$7"); + plotMessage.text(entry.getKey()).color("$8").tooltip("Select this generator") + .color("$7").command("/plot setup generator " + entry.getKey()) + .text(" (Unknown Structure)").color("$7"); } messages.add(plotMessage); } @@ -344,14 +350,14 @@ import java.util.Map.Entry; private static final class StepWorldType extends SetupStep { private static final Map WORLD_TYPES = new HashMap<>(); + static { WORLD_TYPES.put("default", "Standard plot generation"); WORLD_TYPES.put("augmented", "Plot generation with vanilla terrain"); WORLD_TYPES.put("partial", "Vanilla clusters of plots"); } - @Getter - private String worldType; + @Getter private String worldType; public StepWorldType() { super("type"); @@ -361,8 +367,11 @@ import java.util.Map.Entry; final List messages = new ArrayList<>(); messages.add(new PlotMessage("What world type do you want?").color("$6")); for (final Map.Entry worldType : WORLD_TYPES.entrySet()) { - messages.add(new PlotMessage(" - ").color("$8").text(worldType.getKey()).color(worldType.getKey().equals(getDefault()) ? "$2" : "$7") - .tooltip("Select this world type").command("/plot setup type " + worldType.getKey()).text(" (" +worldType.getValue() + ")").color("$7")); + messages.add(new PlotMessage(" - ").color("$8").text(worldType.getKey()) + .color(worldType.getKey().equals(getDefault()) ? "$2" : "$7") + .tooltip("Select this world type") + .command("/plot setup type " + worldType.getKey()) + .text(" (" + worldType.getValue() + ")").color("$7")); } return messages; } @@ -380,18 +389,17 @@ import java.util.Map.Entry; } } - @ToString - @EqualsAndHashCode(of = "uuid") - @AllArgsConstructor + + @ToString @EqualsAndHashCode(of = "uuid") @AllArgsConstructor private static class SetupContext { private final UUID uuid; - @Getter - private String step; + @Getter private String step; } + @RequiredArgsConstructor(access = AccessLevel.PROTECTED) private abstract static class SetupStep { @@ -402,16 +410,20 @@ import java.util.Map.Entry; public abstract boolean parseInut(String input); public final PlotMessage getUsage() { - return new PlotMessage("Usage: ").color("$1").text("/plot setup " + this.stepName + " ").color("$2") - .suggest("/plot setup " + this.stepName + (this.getDefault() != null ? this.getDefault() : "")); + return new PlotMessage("Usage: ").color("$1") + .text("/plot setup " + this.stepName + " ").color("$2").suggest( + "/plot setup " + this.stepName + (this.getDefault() != null ? + this.getDefault() : + "")); } @Nullable public abstract String getDefault(); public void sendToPlayer(@NonNull final PlotPlayer plotPlayer) { - new PlotMessage("Setup Step: ").color("$6").text(this.stepName).color("$7").send(plotPlayer); + new PlotMessage("Setup Step: ").color("$6").text(this.stepName).color("$7") + .send(plotPlayer); this.getUsage().send(plotPlayer); - this.showDescriptionMessage().forEach(plotMessage -> plotMessage.send(plotPlayer)); + this.showDescriptionMessage().forEach(plotMessage -> plotMessage.send(plotPlayer)); if (this.getDefault() != null) { new PlotMessage("Default: ").color("$6").text(this.getDefault()).color("$7"); } 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 4ee9f817c..80a96dfb6 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.NONE) +@CommandDeclaration(usage = "/plot swap ", command = "swap", description = "Swap two plots", + aliases = {"switch"}, category = CommandCategory.CLAIMING, requiredType = RequiredType.NONE) 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 b378f9be4..03879463a 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,8 +10,10 @@ 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 5c7e2d100..aed9c5ca6 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 @@ -21,8 +21,10 @@ 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]