style: Address style issues from previous commit

This commit is contained in:
NotMyFault
2021-12-15 01:29:44 +01:00
parent fda01502b2
commit 51abe5565c
27 changed files with 101 additions and 105 deletions

View File

@@ -50,9 +50,9 @@ dependencies {
tasks.processResources {
filesMatching("plugin.properties") {
expand(
"version" to project.version.toString(),
"commit" to rootProject.grgit.head().abbreviatedId,
"date" to rootProject.grgit.head().dateTime.format(DateTimeFormatter.ofPattern("yy.MM.dd"))
"version" to project.version.toString(),
"commit" to rootProject.grgit.head().abbreviatedId,
"date" to rootProject.grgit.head().dateTime.format(DateTimeFormatter.ofPattern("yy.MM.dd"))
)
}
}

View File

@@ -714,12 +714,12 @@ public class Area extends SubCommand {
.deserialize(
TranslatableCaption.miniMessage("info.area_list_tooltip").getComponent(player),
PlaceholderResolver.placeholders(
claimedTemplate,
usageTemplate,
clustersTemplate,
regionTemplate,
generatorTemplate
)));
claimedTemplate,
usageTemplate,
clustersTemplate,
regionTemplate,
generatorTemplate
)));
Placeholder<?> tooltipTemplate = Placeholder.miniMessage("hover_info", tooltip);
Placeholder<?> visitcmdTemplate = Placeholder.miniMessage("command_tp", "/plot area tp " + area);
Placeholder<?> infocmdTemplate = Placeholder.miniMessage("command_info", "/plot area info " + area);

View File

@@ -32,7 +32,7 @@ import net.kyori.adventure.text.minimessage.placeholder.Placeholder;
/**
* @deprecated In favor of "/plot toggle chat" and
* scheduled for removal within the next major release.
* scheduled for removal within the next major release.
*/
@Deprecated(forRemoval = true)
@CommandDeclaration(command = "chat",

View File

@@ -44,7 +44,6 @@ import com.plotsquared.core.util.task.RunnableVal2;
import com.plotsquared.core.util.task.RunnableVal3;
import com.plotsquared.core.util.task.TaskManager;
import net.kyori.adventure.text.minimessage.placeholder.Placeholder;
import net.kyori.adventure.text.minimessage.placeholder.Placeholder;
import org.checkerframework.checker.nullness.qual.NonNull;
import java.util.concurrent.CompletableFuture;

View File

@@ -290,7 +290,7 @@ public abstract class Command {
* @param confirm Instance, Success, Failure
* @param whenDone task to run when done
* @return CompletableFuture true if the command executed fully, false in
* any other case
* any other case
*/
public CompletableFuture<Boolean> execute(
PlotPlayer<?> player, String[] args,

View File

@@ -28,8 +28,8 @@ package com.plotsquared.core.command;
import com.plotsquared.core.PlotSquared;
import com.plotsquared.core.configuration.Settings;
import com.plotsquared.core.configuration.caption.CaptionUtility;
import com.plotsquared.core.configuration.caption.StaticCaption;
import com.plotsquared.core.configuration.caption.Placeholders;
import com.plotsquared.core.configuration.caption.StaticCaption;
import com.plotsquared.core.configuration.caption.TranslatableCaption;
import com.plotsquared.core.events.PlotFlagAddEvent;
import com.plotsquared.core.events.PlotFlagRemoveEvent;

View File

@@ -97,14 +97,14 @@ public class Inbox extends SubCommand {
TranslatableCaption.miniMessage("list.comment_list_by_lister").getComponent(player),
PlaceholderResolver.placeholders(
Placeholder.miniMessage("comment", comment.comment)
));
));
} else {
commentColored = MINI_MESSAGE
.deserialize(
TranslatableCaption.miniMessage("list.comment_list_by_other").getComponent(player),
PlaceholderResolver.placeholders(
Placeholder.miniMessage("comment", comment.comment)
));
));
}
Placeholder<?> number = Placeholder.miniMessage("number", String.valueOf(x));
Placeholder<?> world = Placeholder.miniMessage("world", comment.world);
@@ -120,7 +120,7 @@ public class Inbox extends SubCommand {
plot_id,
commenter,
commentTemplate
)));
)));
}
player.sendMessage(StaticCaption.of(MINI_MESSAGE.serialize(builder.build())));
}

View File

@@ -48,7 +48,7 @@ import java.util.UUID;
/**
* @deprecated In favor of "/plot download" (Arkitektonika) and scheduled
* for removal within the next major release.
* for removal within the next major release.
*/
@Deprecated(forRemoval = true)
@CommandDeclaration(command = "save",

View File

@@ -143,7 +143,7 @@ public class Visit extends Command {
// allow visit, if UntrustedVisit flag is set, or if the player has either the plot.visit.other or
// plot.admin.visit.untrusted permission
if (!plot.getFlag(UntrustedVisitFlag.class) && !Permissions.hasPermission(player, Permission.PERMISSION_VISIT_OTHER)
&& !Permissions.hasPermission(player, Permission.PERMISSION_ADMIN_VISIT_UNTRUSTED)) {
&& !Permissions.hasPermission(player, Permission.PERMISSION_ADMIN_VISIT_UNTRUSTED)) {
player.sendMessage(
TranslatableCaption.miniMessage("permission.no_permission"),
Placeholders.miniMessage("node", "plots.visit.other")

View File

@@ -74,7 +74,7 @@ public interface ConfigurationSection {
*
* @param path Path to check for existence.
* @return True if this section contains the requested path, either via
* default or being set.
* default or being set.
* @throws IllegalArgumentException Thrown when path is {@code null}.
*/
boolean contains(String path);
@@ -88,7 +88,7 @@ public interface ConfigurationSection {
*
* @param path Path to check for existence.
* @return True if this section contains the requested path, regardless of
* having a default.
* having a default.
* @throws IllegalArgumentException Thrown when path is {@code null}.
*/
boolean isSet(String path);

View File

@@ -46,7 +46,6 @@ import com.sk89q.worldedit.function.pattern.Pattern;
import com.sk89q.worldedit.regions.CuboidRegion;
import com.sk89q.worldedit.world.biome.BiomeType;
import com.sk89q.worldedit.world.block.BaseBlock;
import com.sk89q.worldedit.world.block.BlockState;
import com.sk89q.worldedit.world.block.BlockTypes;
import org.checkerframework.checker.nullness.qual.NonNull;
import org.checkerframework.checker.nullness.qual.Nullable;

View File

@@ -334,7 +334,7 @@ public class HybridPlotWorld extends ClassicPlotWorld {
LOGGER.info("- plot schematic: {}", schematic3File.getPath());
}
}
if ((schematic1 == null&& schematic2 == null) || this.ROAD_WIDTH == 0) {
if ((schematic1 == null && schematic2 == null) || this.ROAD_WIDTH == 0) {
if (Settings.DEBUG) {
LOGGER.info("- schematic: false");
}

View File

@@ -62,7 +62,7 @@ public abstract class MetaDataAccess<T> implements AutoCloseable {
* Check if the player has meta data stored with the given key
*
* @return {@code true} if player has meta data with this key, or
* {@code false}
* {@code false}
*/
public abstract boolean isPresent();

View File

@@ -40,7 +40,6 @@ import com.plotsquared.core.database.DBFunc;
import com.plotsquared.core.events.Result;
import com.plotsquared.core.events.TeleportCause;
import com.plotsquared.core.generator.ClassicPlotWorld;
import com.plotsquared.core.generator.HybridPlotWorld;
import com.plotsquared.core.listener.PlotListener;
import com.plotsquared.core.location.BlockLoc;
import com.plotsquared.core.location.Direction;
@@ -450,7 +449,7 @@ public class Plot {
* that could alter the de facto owner of the plot.
*
* @return The plot owner of this particular (sub-)plot
* as stored in the database, if one exists. Else, null.
* as stored in the database, if one exists. Else, null.
*/
public @Nullable UUID getOwnerAbs() {
return this.owner;
@@ -1202,12 +1201,12 @@ public class Plot {
*
* @return array of entity counts
* @see RegionManager#countEntities(Plot)
* 0 = Entity
* 1 = Animal
* 2 = Monster
* 3 = Mob
* 4 = Boat
* 5 = Misc
* 0 = Entity
* 1 = Animal
* 2 = Monster
* 3 = Mob
* 4 = Boat
* 5 = Misc
*/
public int[] countEntities() {
int[] count = new int[6];
@@ -1565,7 +1564,7 @@ public class Plot {
x = bot.getX() + loc.getX();
z = bot.getZ() + loc.getZ();
}
if (loc.getY() == Integer.MIN_VALUE) {
if (loc.getY() == Integer.MIN_VALUE) {
if (isLoaded()) {
this.worldUtil.getHighestBlock(
plot.getWorldName(),
@@ -2852,8 +2851,8 @@ public class Plot {
TranslatableCaption.miniMessage("info.plot_flag_list").getComponent(player)
),
PlaceholderResolver.placeholders(
Placeholder.miniMessage("flag", flag.getName()),
Placeholder.miniMessage("value", CaptionUtility.formatRaw(player, value.toString()))
Placeholder.miniMessage("flag", flag.getName()),
Placeholder.miniMessage("value", CaptionUtility.formatRaw(player, value.toString()))
)
);
flagBuilder.append(snip);
@@ -2903,7 +2902,7 @@ public class Plot {
Placeholder<?> descTemplate = Placeholder.miniMessage("desc", description);
Placeholder<?> biomeTemplate = Placeholder.miniMessage("biome", biome.toString().toLowerCase());
Placeholder<?> ownerTemplate = Placeholder.miniMessage("owner", owner.toString());
Placeholder<?> membersTemplate =Placeholder.miniMessage("members", members.toString());
Placeholder<?> membersTemplate = Placeholder.miniMessage("members", members.toString());
Placeholder<?> playerTemplate = Placeholder.miniMessage("player", player.getName());
Placeholder<?> trustedTemplate = Placeholder.miniMessage("trusted", trusted.toString());
Placeholder<?> helpersTemplate = Placeholder.miniMessage("helpers", members.toString());
@@ -2951,6 +2950,33 @@ public class Plot {
.deserialize(
iInfo.getComponent(player),
PlaceholderResolver.placeholders(
headerTemplate,
areaTemplate,
idTemplate,
aliasTemplate,
numTemplate,
descTemplate,
biomeTemplate,
ownerTemplate,
membersTemplate,
playerTemplate,
trustedTemplate,
helpersTemplate,
deniedTemplate,
seenTemplate,
flagsTemplate,
buildTemplate,
ratingTemplate,
creationTemplate,
footerTemplate
)))));
});
return;
}
future.complete(StaticCaption.of(MINI_MESSAGE.serialize(MINI_MESSAGE
.deserialize(
iInfo.getComponent(player),
PlaceholderResolver.placeholders(
headerTemplate,
areaTemplate,
idTemplate,
@@ -2967,35 +2993,8 @@ public class Plot {
seenTemplate,
flagsTemplate,
buildTemplate,
ratingTemplate,
creationTemplate,
footerTemplate
)))));
});
return;
}
future.complete(StaticCaption.of(MINI_MESSAGE.serialize(MINI_MESSAGE
.deserialize(
iInfo.getComponent(player),
PlaceholderResolver.placeholders(
headerTemplate,
areaTemplate,
idTemplate,
aliasTemplate,
numTemplate,
descTemplate,
biomeTemplate,
ownerTemplate,
membersTemplate,
playerTemplate,
trustedTemplate,
helpersTemplate,
deniedTemplate,
seenTemplate,
flagsTemplate,
buildTemplate,
footerTemplate
)))));
}
);
return future;

View File

@@ -458,8 +458,8 @@ public abstract class PlotArea {
TranslatableCaption.miniMessage("info.plot_flag_list").getComponent(LocaleHolder.console())
),
PlaceholderResolver.placeholders(
Placeholder.miniMessage("flag", flag.getName()),
Placeholder.miniMessage("value", CaptionUtility.formatRaw(ConsolePlayer.getConsole(), value.toString()))
Placeholder.miniMessage("flag", flag.getName()),
Placeholder.miniMessage("value", CaptionUtility.formatRaw(ConsolePlayer.getConsole(), value.toString()))
)
);
if (flagsComponent != null) {
@@ -1308,8 +1308,8 @@ public abstract class PlotArea {
*
* @return the legacy sign material.
* @deprecated Use {@link #signMaterial()}. This method is used for 1.13 only and
* will be removed without replacement in favor of {@link #signMaterial()}
* once we remove the support for 1.13.
* will be removed without replacement in favor of {@link #signMaterial()}
* once we remove the support for 1.13.
*/
@Deprecated(forRemoval = true)
public String getLegacySignMaterial() {

View File

@@ -39,23 +39,20 @@ import com.sk89q.worldedit.world.World;
import com.sk89q.worldedit.world.biome.BiomeType;
import com.sk89q.worldedit.world.block.BaseBlock;
import com.sk89q.worldedit.world.block.BlockState;
import java.util.concurrent.atomic.AtomicBoolean;
import org.checkerframework.checker.nullness.qual.NonNull;
import org.checkerframework.checker.nullness.qual.Nullable;
import java.util.List;
import java.util.Set;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.function.Consumer;
public abstract class QueueCoordinator {
private final AtomicBoolean enqueued = new AtomicBoolean();
private boolean forceSync = false;
@Nullable
private Object chunkObject;
private final AtomicBoolean enqueued = new AtomicBoolean();
@Inject
private GlobalBlockQueue blockQueue;
@@ -205,8 +202,8 @@ public abstract class QueueCoordinator {
* @param biome biome
* @return success or not
* @deprecated Biomes now take XYZ, see {@link #setBiome(int, int, int, BiomeType)}
* <br>
* Scheduled for removal once we drop the support for versions not supporting 3D biomes.
* <br>
* Scheduled for removal once we drop the support for versions not supporting 3D biomes.
*/
@Deprecated(forRemoval = true)
public abstract boolean setBiome(int x, int z, @NonNull BiomeType biome);

View File

@@ -71,9 +71,9 @@ public final class LockRepository {
* @param runnable Action to run when the lock is available
*/
public void useLock(final @NonNull LockKey key, final @NonNull Runnable runnable) {
try (LockAccess ignored = lock(key)) {
runnable.run();
}
try (LockAccess ignored = lock(key)) {
runnable.run();
}
}
/**

View File

@@ -84,7 +84,7 @@ public final class BlockUtil {
*
* @param id String or integer ID
* @return Parsed block state, or {@code null} if none
* could be parsed
* could be parsed
*/
public static @Nullable BlockState get(final @NonNull String id) {
if (id.length() == 1 && id.charAt(0) == '*') {
@@ -136,7 +136,7 @@ public final class BlockUtil {
*
* @param map Serialized block state
* @return Deserialized block state, or {@code null} if the map is
* not a properly serialized block state
* not a properly serialized block state
*/
public static @Nullable BlockState deserialize(final @NonNull Map<String, Object> map) {
if (map.containsKey("material")) {

View File

@@ -38,7 +38,6 @@ import com.plotsquared.core.plot.Plot;
import com.plotsquared.core.plot.PlotArea;
import com.plotsquared.core.uuid.UUIDMapping;
import org.checkerframework.checker.nullness.qual.NonNull;
import org.checkerframework.checker.nullness.qual.Nullable;
import java.util.ArrayList;
import java.util.Arrays;
@@ -116,7 +115,6 @@ public final class TabCompletions {
* @param input Command input
* @param existing Players that should not be included in completions
* @return List of completions
*
* @deprecated In favor {@link #completeAddedPlayers(PlotPlayer, Plot, String, List)}
*/
@Deprecated(forRemoval = true)

View File

@@ -91,7 +91,7 @@ public abstract class WorldUtil {
*
* @param worldName World name
* @return {@code true} if there exists a world with the given world name,
* {@code false} if not
* {@code false} if not
*/
public abstract boolean isWorld(@NonNull String worldName);

View File

@@ -28,7 +28,6 @@ package com.plotsquared.core.util.query;
import com.plotsquared.core.plot.Plot;
import org.checkerframework.checker.nullness.qual.NonNull;
import java.util.Objects;
import java.util.UUID;
class OwnersIncludeFilter implements PlotFilter {

View File

@@ -60,7 +60,7 @@ public interface PlotSquaredTask extends Runnable {
* Check if the task has been cancelled
*
* @return {@code true} if the tasks is cancelled,
* {@code false} if not
* {@code false} if not
*/
boolean isCancelled();