Pick up the rest of the reformating

This commit is contained in:
dordsor21 2020-04-30 11:53:07 +01:00
parent 5e842f1572
commit cbe46539ca
6 changed files with 44 additions and 35 deletions

View File

@ -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;

View File

@ -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<Plot> 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<PlotCluster> 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<PlotCluster> 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);
@ -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,9 +1717,9 @@ 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]),
int[] lastVersion = new int[] {Integer.parseInt(split[0]), Integer.parseInt(split[1]),
Integer.parseInt(split[2])};
if (checkVersion(new int[]{3, 4, 0}, lastVersion)) {
if (checkVersion(new int[] {3, 4, 0}, lastVersion)) {
Settings.convertLegacy(configFile);
if (getConfig().contains("worlds")) {
ConfigurationSection worldSection =
@ -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 {

View File

@ -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 {

View File

@ -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<List<PlotComment>> whenDone) {
}

View File

@ -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;
}

View File

@ -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;