From cbe46539caa1938a00cbb6d333ca5cb0e1ac1dcc Mon Sep 17 00:00:00 2001 From: dordsor21 Date: Thu, 30 Apr 2020 11:53:07 +0100 Subject: [PATCH] Pick up the rest of the reformating --- .../java/com/plotsquared/core/IPlotMain.java | 6 +-- .../com/plotsquared/core/PlotSquared.java | 48 +++++++++++-------- .../com/plotsquared/core/PlotVersion.java | 3 +- .../core/database/AbstractDBTest.java | 7 +-- .../core/plot/util/EventDispatcherTest.java | 13 +++-- .../util/UUIDHandlerImplementationTest.java | 2 +- 6 files changed, 44 insertions(+), 35 deletions(-) diff --git a/Core/src/main/java/com/plotsquared/core/IPlotMain.java b/Core/src/main/java/com/plotsquared/core/IPlotMain.java index d54bcba01..1b04b220f 100644 --- a/Core/src/main/java/com/plotsquared/core/IPlotMain.java +++ b/Core/src/main/java/com/plotsquared/core/IPlotMain.java @@ -28,18 +28,18 @@ package com.plotsquared.core; import com.plotsquared.core.generator.GeneratorWrapper; import com.plotsquared.core.generator.HybridUtils; import com.plotsquared.core.generator.IndependentPlotGenerator; -import com.plotsquared.core.util.logger.ILogger; import com.plotsquared.core.player.PlotPlayer; +import com.plotsquared.core.queue.QueueProvider; import com.plotsquared.core.util.ChatManager; import com.plotsquared.core.util.ChunkManager; import com.plotsquared.core.util.EconHandler; import com.plotsquared.core.util.InventoryUtil; import com.plotsquared.core.util.SchematicHandler; import com.plotsquared.core.util.SetupUtils; +import com.plotsquared.core.util.WorldUtil; +import com.plotsquared.core.util.logger.ILogger; import com.plotsquared.core.util.task.TaskManager; import com.plotsquared.core.util.uuid.UUIDHandlerImplementation; -import com.plotsquared.core.util.WorldUtil; -import com.plotsquared.core.queue.QueueProvider; import com.sk89q.worldedit.extension.platform.Actor; import org.jetbrains.annotations.NotNull; diff --git a/Core/src/main/java/com/plotsquared/core/PlotSquared.java b/Core/src/main/java/com/plotsquared/core/PlotSquared.java index 43b814313..bd018399f 100644 --- a/Core/src/main/java/com/plotsquared/core/PlotSquared.java +++ b/Core/src/main/java/com/plotsquared/core/PlotSquared.java @@ -29,11 +29,11 @@ import com.plotsquared.core.command.WE_Anywhere; import com.plotsquared.core.configuration.Caption; import com.plotsquared.core.configuration.CaptionUtility; import com.plotsquared.core.configuration.Captions; +import com.plotsquared.core.configuration.ConfigurationSection; import com.plotsquared.core.configuration.ConfigurationUtil; +import com.plotsquared.core.configuration.MemorySection; import com.plotsquared.core.configuration.Settings; import com.plotsquared.core.configuration.Storage; -import com.plotsquared.core.configuration.ConfigurationSection; -import com.plotsquared.core.configuration.MemorySection; import com.plotsquared.core.configuration.file.YamlConfiguration; import com.plotsquared.core.configuration.serialization.ConfigurationSerialization; import com.plotsquared.core.database.DBFunc; @@ -130,7 +130,8 @@ import java.util.zip.ZipInputStream; /** * An implementation of the core, with a static getter for easy access. */ -@SuppressWarnings({"unused", "WeakerAccess"}) public class PlotSquared { +@SuppressWarnings({"unused", "WeakerAccess"}) +public class PlotSquared { private static final Set EMPTY_SET = Collections.unmodifiableSet(Collections.emptySet()); private static PlotSquared instance; // Implementation @@ -360,7 +361,8 @@ import java.util.zip.ZipInputStream; } PlotSquared.log(Captions.PREFIX + CaptionUtility - .format(ConsolePlayer.getConsole(), Captions.ENABLED.getTranslated(), IMP.getPluginName())); + .format(ConsolePlayer.getConsole(), Captions.ENABLED.getTranslated(), + IMP.getPluginName())); } /** @@ -518,8 +520,9 @@ import java.util.zip.ZipInputStream; Set clusters; if (clusters_tmp == null || (clusters = clusters_tmp.remove(plotArea.toString())) == null) { if (plotArea.getType() == PlotAreaType.PARTIAL) { - clusters = - this.clusters_tmp != null ? this.clusters_tmp.get(plotArea.getWorldName()) : null; + clusters = this.clusters_tmp != null ? + this.clusters_tmp.get(plotArea.getWorldName()) : + null; if (clusters != null) { Iterator iterator = clusters.iterator(); while (iterator.hasNext()) { @@ -542,8 +545,8 @@ import java.util.zip.ZipInputStream; return; } File file = new File( - this.IMP.getDirectory() + File.separator + "persistent_regen_data_" + plotArea.getId() + "_" - + plotArea.getWorldName()); + this.IMP.getDirectory() + File.separator + "persistent_regen_data_" + plotArea.getId() + + "_" + plotArea.getWorldName()); if (!file.exists()) { return; } @@ -1301,7 +1304,8 @@ import java.util.zip.ZipInputStream; } if (type == PlotAreaType.AUGMENTED) { throw new IllegalArgumentException( - "Invalid type for multi-area world. Expected `PARTIAL`, got `" + PlotAreaType.AUGMENTED + "`"); + "Invalid type for multi-area world. Expected `PARTIAL`, got `" + + PlotAreaType.AUGMENTED + "`"); } for (String areaId : areasSection.getKeys(false)) { PlotSquared.log(Captions.PREFIX + " - " + areaId); @@ -1523,7 +1527,7 @@ import java.util.zip.ZipInputStream; /** * Copies a file from inside the jar to a location * - * @param file Name of the file inside PlotSquared.jar + * @param file Name of the file inside PlotSquared.jar * @param folder The output location relative to /plugins/PlotSquared/ */ public void copyFile(String file, String folder) { @@ -1636,8 +1640,9 @@ import java.util.zip.ZipInputStream; list.add(regions); list.add(chunks); list.add(HybridUtils.height); - File file = new File(this.IMP.getDirectory() + File.separator + "persistent_regen_data_" - + HybridUtils.area.getId() + "_" + HybridUtils.area.getWorldName()); + File file = new File( + this.IMP.getDirectory() + File.separator + "persistent_regen_data_" + HybridUtils.area + .getId() + "_" + HybridUtils.area.getWorldName()); if (file.exists() && !file.delete()) { PlotSquared.log(Captions.PREFIX + "persistent_regen_data file already exists and could not be deleted."); @@ -1712,13 +1717,13 @@ import java.util.zip.ZipInputStream; String lastVersionString = this.getConfig().getString("version"); if (lastVersionString != null) { String[] split = lastVersionString.split("\\."); - int[] lastVersion = new int[]{Integer.parseInt(split[0]), Integer.parseInt(split[1]), - Integer.parseInt(split[2])}; - if (checkVersion(new int[]{3, 4, 0}, lastVersion)) { + int[] lastVersion = new int[] {Integer.parseInt(split[0]), Integer.parseInt(split[1]), + Integer.parseInt(split[2])}; + if (checkVersion(new int[] {3, 4, 0}, lastVersion)) { Settings.convertLegacy(configFile); if (getConfig().contains("worlds")) { ConfigurationSection worldSection = - getConfig().getConfigurationSection("worlds"); + getConfig().getConfigurationSection("worlds"); worlds.set("worlds", worldSection); try { worlds.save(worldsFile); @@ -1768,10 +1773,10 @@ import java.util.zip.ZipInputStream; this.worlds = YamlConfiguration.loadConfiguration(this.worldsFile); if (this.worlds.contains("worlds")) { - if (!this.worlds.contains("configuration_version") || - (!this.worlds.getString("configuration_version").equalsIgnoreCase( - LegacyConverter.CONFIGURATION_VERSION) && - !this.worlds.getString("configuration_version").equalsIgnoreCase("v5"))) { + if (!this.worlds.contains("configuration_version") || ( + !this.worlds.getString("configuration_version") + .equalsIgnoreCase(LegacyConverter.CONFIGURATION_VERSION) && !this.worlds + .getString("configuration_version").equalsIgnoreCase("v5"))) { // Conversion needed log(Captions.LEGACY_CONFIG_FOUND.getTranslated()); try { @@ -1860,7 +1865,8 @@ import java.util.zip.ZipInputStream; } public String getConfigurationVersion() { - return this.worlds.get("configuration_version", LegacyConverter.CONFIGURATION_VERSION).toString(); + return this.worlds.get("configuration_version", LegacyConverter.CONFIGURATION_VERSION) + .toString(); } public void setConfigurationVersion(final String newVersion) throws IOException { diff --git a/Core/src/main/java/com/plotsquared/core/PlotVersion.java b/Core/src/main/java/com/plotsquared/core/PlotVersion.java index 4c49554a1..a205adc76 100644 --- a/Core/src/main/java/com/plotsquared/core/PlotVersion.java +++ b/Core/src/main/java/com/plotsquared/core/PlotVersion.java @@ -75,8 +75,7 @@ public class PlotVersion { } } - @Override - public String toString() { + @Override public String toString() { if (hash == 0 && versionString == null) { return "PlotSquared-NoVer-SNAPSHOT"; } else { diff --git a/Core/src/test/java/com/plotsquared/core/database/AbstractDBTest.java b/Core/src/test/java/com/plotsquared/core/database/AbstractDBTest.java index 0dbe97480..d502bd520 100644 --- a/Core/src/test/java/com/plotsquared/core/database/AbstractDBTest.java +++ b/Core/src/test/java/com/plotsquared/core/database/AbstractDBTest.java @@ -25,13 +25,13 @@ */ package com.plotsquared.core.database; -import com.plotsquared.core.plot.flag.PlotFlag; import com.plotsquared.core.plot.Plot; import com.plotsquared.core.plot.PlotArea; import com.plotsquared.core.plot.PlotCluster; import com.plotsquared.core.plot.PlotId; -import com.plotsquared.core.util.task.RunnableVal; import com.plotsquared.core.plot.comment.PlotComment; +import com.plotsquared.core.plot.flag.PlotFlag; +import com.plotsquared.core.util.task.RunnableVal; import org.jetbrains.annotations.NotNull; import java.util.HashMap; @@ -191,7 +191,8 @@ public class AbstractDBTest implements AbstractDB { @Override public void setComment(Plot plot, PlotComment comment) { } - @Override public void getComments(@NotNull Plot plot, String inbox, + @Override + public void getComments(@NotNull Plot plot, String inbox, RunnableVal> whenDone) { } diff --git a/Core/src/test/java/com/plotsquared/core/plot/util/EventDispatcherTest.java b/Core/src/test/java/com/plotsquared/core/plot/util/EventDispatcherTest.java index 319850389..96f18c9ab 100644 --- a/Core/src/test/java/com/plotsquared/core/plot/util/EventDispatcherTest.java +++ b/Core/src/test/java/com/plotsquared/core/plot/util/EventDispatcherTest.java @@ -44,14 +44,14 @@ import com.plotsquared.core.events.PlotFlagRemoveEvent; import com.plotsquared.core.events.PlotMergeEvent; import com.plotsquared.core.events.PlotRateEvent; import com.plotsquared.core.events.PlotUnlinkEvent; -import com.plotsquared.core.player.PlotPlayer; -import com.plotsquared.core.plot.flag.PlotFlag; import com.plotsquared.core.location.Direction; import com.plotsquared.core.location.Location; +import com.plotsquared.core.player.PlotPlayer; import com.plotsquared.core.plot.Plot; import com.plotsquared.core.plot.PlotArea; import com.plotsquared.core.plot.PlotId; import com.plotsquared.core.plot.Rating; +import com.plotsquared.core.plot.flag.PlotFlag; import com.plotsquared.core.util.EventDispatcher; import com.sk89q.worldedit.function.pattern.Pattern; @@ -110,7 +110,8 @@ public class EventDispatcherTest extends EventDispatcher { return null; } - @Override public PlotUnlinkEvent callUnlink(PlotArea area, Plot plot, boolean createRoad, + @Override + public PlotUnlinkEvent callUnlink(PlotArea area, Plot plot, boolean createRoad, boolean createSign, PlotUnlinkEvent.REASON reason) { return null; } @@ -123,7 +124,8 @@ public class EventDispatcherTest extends EventDispatcher { return null; } - @Override public PlayerPlotDeniedEvent callDenied(PlotPlayer initiator, Plot plot, UUID player, + @Override + public PlayerPlotDeniedEvent callDenied(PlotPlayer initiator, Plot plot, UUID player, boolean added) { return null; } @@ -134,7 +136,8 @@ public class EventDispatcherTest extends EventDispatcher { return null; } - @Override public PlayerPlotHelperEvent callMember(PlotPlayer initiator, Plot plot, UUID player, + @Override + public PlayerPlotHelperEvent callMember(PlotPlayer initiator, Plot plot, UUID player, boolean added) { return null; } diff --git a/Core/src/test/java/com/plotsquared/core/plot/util/UUIDHandlerImplementationTest.java b/Core/src/test/java/com/plotsquared/core/plot/util/UUIDHandlerImplementationTest.java index 0452da529..291461478 100644 --- a/Core/src/test/java/com/plotsquared/core/plot/util/UUIDHandlerImplementationTest.java +++ b/Core/src/test/java/com/plotsquared/core/plot/util/UUIDHandlerImplementationTest.java @@ -27,8 +27,8 @@ package com.plotsquared.core.plot.util; import com.plotsquared.core.database.AbstractDBTest; import com.plotsquared.core.database.DBFunc; -import com.plotsquared.core.util.uuid.UUIDHandlerImplementation; import com.plotsquared.core.util.task.RunnableVal; +import com.plotsquared.core.util.uuid.UUIDHandlerImplementation; import com.plotsquared.core.util.uuid.UUIDWrapper; import org.junit.Before;