Address style violations

This commit is contained in:
NotMyFault
2021-08-18 11:58:18 +02:00
parent 252d6a2866
commit 2988ad6b11
99 changed files with 494 additions and 345 deletions

View File

@ -120,6 +120,8 @@ import io.papermc.lib.PaperLib;
import net.kyori.adventure.audience.Audience;
import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.bstats.bukkit.Metrics;
import org.bstats.charts.DrilldownPie;
import org.bstats.charts.SimplePie;
@ -140,8 +142,6 @@ import org.bukkit.plugin.java.JavaPlugin;
import org.checkerframework.checker.nullness.qual.NonNull;
import org.checkerframework.checker.nullness.qual.Nullable;
import org.incendo.serverlib.ServerLib;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import java.io.File;
import java.lang.reflect.Method;
@ -274,7 +274,8 @@ public final class BukkitPlatform extends JavaPlugin implements Listener, PlotPl
// We create the injector after PlotSquared has been initialized, so that we have access
// to generated instances and settings
this.injector = Guice
.createInjector(Stage.PRODUCTION,
.createInjector(
Stage.PRODUCTION,
new PermissionModule(),
new WorldManagerModule(),
new PlotSquaredModule(),
@ -853,7 +854,7 @@ public final class BukkitPlatform extends JavaPlugin implements Listener, PlotPl
if (area != null) {
PlotId currentPlotId = area.getPlotAbs(pLoc).getId();
if (!originalPlotId.equals(currentPlotId) && (currentPlotId == null || !area.getPlot(
originalPlotId)
originalPlotId)
.equals(area.getPlot(currentPlotId)))) {
if (entity.hasMetadata("ps-tmp-teleport")) {
continue;
@ -991,10 +992,11 @@ public final class BukkitPlatform extends JavaPlugin implements Listener, PlotPl
}
@Override
public @Nullable final ChunkGenerator getDefaultWorldGenerator(
public @Nullable
final ChunkGenerator getDefaultWorldGenerator(
final @NonNull String worldName,
final @Nullable String id)
{
final @Nullable String id
) {
final IndependentPlotGenerator result;
if (id != null && id.equalsIgnoreCase("single")) {
result = injector().getInstance(SingleWorldGenerator.class);
@ -1023,7 +1025,8 @@ public final class BukkitPlatform extends JavaPlugin implements Listener, PlotPl
}
return new BukkitPlotGenerator(world, gen, this.plotAreaManager);
} else {
return new BukkitPlotGenerator(world,
return new BukkitPlotGenerator(
world,
injector().getInstance(Key.get(IndependentPlotGenerator.class, DefaultGenerator.class)),
this.plotAreaManager
);
@ -1088,11 +1091,11 @@ public final class BukkitPlatform extends JavaPlugin implements Listener, PlotPl
String manager = worldConfig.getString("generator.plugin", pluginName());
PlotAreaBuilder builder =
PlotAreaBuilder.newBuilder().plotManager(manager).generatorName(worldConfig.getString(
"generator.init",
manager
))
"generator.init",
manager
))
.plotAreaType(ConfigurationUtil.getType(worldConfig)).terrainType(ConfigurationUtil.getTerrain(
worldConfig))
worldConfig))
.settingsNodesWrapper(new SettingsNodesWrapper(new ConfigurationNode[0], null)).worldName(worldName);
injector().getInstance(SetupUtils.class).setupWorld(builder);
world = Bukkit.getWorld(worldName);

View File

@ -26,6 +26,8 @@
package com.plotsquared.bukkit.entity;
import com.plotsquared.core.configuration.Settings;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.bukkit.Art;
import org.bukkit.DyeColor;
import org.bukkit.Location;
@ -55,8 +57,6 @@ import org.bukkit.inventory.InventoryHolder;
import org.bukkit.inventory.ItemStack;
import org.bukkit.util.EulerAngle;
import org.bukkit.util.Vector;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import java.util.List;

View File

@ -1209,4 +1209,5 @@ public class BlockEventListener implements Listener {
event.setCancelled(true);
}
}
}

View File

@ -349,7 +349,8 @@ public class EntityEventListener implements Listener {
// trampling farmland
BlockType blockType = BukkitAdapter.asBlockType(type);
if (!this.eventDispatcher.checkPlayerBlockEvent(pp,
PlayerBlockEventType.TRIGGER_PHYSICAL, location, blockType, true)) {
PlayerBlockEventType.TRIGGER_PHYSICAL, location, blockType, true
)) {
event.setCancelled(true);
}
return;

View File

@ -711,7 +711,8 @@ public class PlayerEventListener extends PlotListener implements Listener {
// allowing colour.
if (plotPlayer.hasPermission("plots.chat.color")) {
msgTemplate = Template
.of("msg",
.of(
"msg",
BukkitUtil.LEGACY_COMPONENT_SERIALIZER.deserialize(ChatColor.translateAlternateColorCodes(
'&',
message
@ -1116,7 +1117,9 @@ public class PlayerEventListener extends PlotListener implements Listener {
// todo: when the code above is rearranged, it would be great to beautify this as well.
// will code this as a temporary, specific bug fix (for dragon eggs)
if (blockType != Material.DRAGON_EGG) return;
if (blockType != Material.DRAGON_EGG) {
return;
}
eventType = PlayerBlockEventType.INTERACT_BLOCK;
blocktype1 = BukkitAdapter.asBlockType(block.getType());

View File

@ -34,8 +34,9 @@ import org.checkerframework.checker.nullness.qual.Nullable;
/**
* Multiverse specific manager that informs Multiverse of
* world creation by executing a console command
*
* @deprecated Deprecated and scheduled for removal without replacement
* in favor of the build in setup wizard.
* in favor of the build in setup wizard.
*/
@Deprecated(forRemoval = true)
@Singleton

View File

@ -88,8 +88,10 @@ public class BukkitOfflinePlayer implements OfflinePlotPlayer {
final @NonNull String stub,
final @NonNull String key
) {
return this.permissionProfile.hasPermission(world, stub + "." + key) || this.permissionProfile.hasPermission(world,
stub + ".*");
return this.permissionProfile.hasPermission(world, stub + "." + key) || this.permissionProfile.hasPermission(
world,
stub + ".*"
);
}
}

View File

@ -55,6 +55,8 @@ import net.kyori.adventure.platform.bukkit.BukkitAudiences;
import net.kyori.adventure.text.minimessage.MiniMessage;
import net.kyori.adventure.text.minimessage.Template;
import net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.bukkit.Bukkit;
import org.bukkit.Chunk;
import org.bukkit.Material;
@ -98,8 +100,6 @@ import org.bukkit.entity.WaterMob;
import org.checkerframework.checker.index.qual.NonNegative;
import org.checkerframework.checker.nullness.qual.NonNull;
import org.checkerframework.checker.nullness.qual.Nullable;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import java.util.Collection;
import java.util.HashSet;
@ -140,7 +140,8 @@ public class BukkitUtil extends WorldUtil {
*/
public static @NonNull Location adapt(final org.bukkit.@NonNull Location location) {
return Location
.at(com.plotsquared.bukkit.util.BukkitWorld.of(location.getWorld()),
.at(
com.plotsquared.bukkit.util.BukkitWorld.of(location.getWorld()),
MathMan.roundInt(location.getX()),
MathMan.roundInt(location.getY()),
MathMan.roundInt(location.getZ())
@ -156,7 +157,8 @@ public class BukkitUtil extends WorldUtil {
*/
public static @NonNull Location adaptComplete(final org.bukkit.@NonNull Location location) {
return Location
.at(com.plotsquared.bukkit.util.BukkitWorld.of(location.getWorld()),
.at(
com.plotsquared.bukkit.util.BukkitWorld.of(location.getWorld()),
MathMan.roundInt(location.getX()),
MathMan.roundInt(location.getY()),
MathMan.roundInt(location.getZ()),
@ -516,45 +518,46 @@ public class BukkitUtil extends WorldUtil {
tileEntityTypes.addAll(BlockCategories.FLOWER_POTS.getAll());
// Individual Types
// Add these from strings
Stream.of("barrel",
"beacon",
"beehive",
"bee_nest",
"bell",
"blast_furnace",
"brewing_stand",
"campfire",
"chest",
"ender_chest",
"trapped_chest",
"command_block",
"end_gateway",
"hopper",
"jigsaw",
"jubekox",
"lectern",
"note_block",
"black_shulker_box",
"blue_shulker_box",
"brown_shulker_box",
"cyan_shulker_box",
"gray_shulker_box",
"green_shulker_box",
"light_blue_shulker_box",
"light_gray_shulker_box",
"lime_shulker_box",
"magenta_shulker_box",
"orange_shulker_box",
"pink_shulker_box",
"purple_shulker_box",
"red_shulker_box",
"shulker_box",
"white_shulker_box",
"yellow_shulker_box",
"smoker",
"structure_block",
"structure_void"
)
Stream.of(
"barrel",
"beacon",
"beehive",
"bee_nest",
"bell",
"blast_furnace",
"brewing_stand",
"campfire",
"chest",
"ender_chest",
"trapped_chest",
"command_block",
"end_gateway",
"hopper",
"jigsaw",
"jubekox",
"lectern",
"note_block",
"black_shulker_box",
"blue_shulker_box",
"brown_shulker_box",
"cyan_shulker_box",
"gray_shulker_box",
"green_shulker_box",
"light_blue_shulker_box",
"light_gray_shulker_box",
"lime_shulker_box",
"magenta_shulker_box",
"orange_shulker_box",
"pink_shulker_box",
"purple_shulker_box",
"red_shulker_box",
"shulker_box",
"white_shulker_box",
"yellow_shulker_box",
"smoker",
"structure_block",
"structure_void"
)
.map(BlockTypes::get).filter(Objects::nonNull).forEach(tileEntityTypes::add);
}
return this.tileEntityTypes;

View File

@ -33,12 +33,12 @@ import com.sk89q.worldedit.bukkit.BukkitWorld;
import com.sk89q.worldedit.math.BlockVector3;
import com.sk89q.worldedit.regions.CuboidRegion;
import com.sk89q.worldedit.world.block.BaseBlock;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.bukkit.Chunk;
import org.bukkit.World;
import org.bukkit.entity.Entity;
import org.bukkit.entity.Player;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import java.util.HashMap;
import java.util.HashSet;

View File

@ -32,12 +32,12 @@ import com.google.inject.Inject;
import com.plotsquared.core.PlotSquared;
import com.plotsquared.core.PlotVersion;
import com.plotsquared.core.configuration.Settings;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.bukkit.Bukkit;
import org.bukkit.event.Listener;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.scheduler.BukkitTask;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import javax.net.ssl.HttpsURLConnection;
import java.io.IOException;

View File

@ -32,9 +32,9 @@ import com.plotsquared.core.uuid.UUIDService;
import com.sk89q.squirrelid.Profile;
import com.sk89q.squirrelid.resolver.HttpRepositoryService;
import com.sk89q.squirrelid.resolver.ProfileService;
import org.checkerframework.checker.nullness.qual.NonNull;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.checkerframework.checker.nullness.qual.NonNull;
import java.io.IOException;
import java.util.ArrayList;