mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-26 23:26:45 +01:00
More work
This commit is contained in:
parent
8385387e88
commit
c3613365e9
4
.lift.toml
Normal file
4
.lift.toml
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
jdkVersion = "17"
|
||||||
|
build = "gradle clean build -x test"
|
||||||
|
tools = ["findsecbugs", "ErrorProne", "Semgrep", "Detekt", "Infer"]
|
||||||
|
ignoreRules = ["CatchAndPrintStackTrace", "ReferenceEquality", "FallThrough", "FutureReturnValueIgnored", "MixedMutabilityReturnType", "EmptyCatch", "MissingCasesInEnumSwitch", "OperatorPrecedence", "StaticAssignmentInConstructor", "ReferenceEquality", "EqualsHashCode", "EqualsGetClass"]
|
@ -63,7 +63,6 @@ public class BukkitCommand implements CommandExecutor, TabCompleter {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("MixedMutabilityReturnType")
|
|
||||||
@Override
|
@Override
|
||||||
public List<String> onTabComplete(
|
public List<String> onTabComplete(
|
||||||
CommandSender commandSender, Command command, String label,
|
CommandSender commandSender, Command command, String label,
|
||||||
|
@ -243,7 +243,6 @@ public final class BukkitPlatform extends JavaPlugin implements Listener, PlotPl
|
|||||||
return Bukkit.getVersion();
|
return Bukkit.getVersion();
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("CatchAndPrintStackTrace")
|
|
||||||
@Override
|
@Override
|
||||||
public void onEnable() {
|
public void onEnable() {
|
||||||
this.pluginName = getDescription().getName();
|
this.pluginName = getDescription().getName();
|
||||||
@ -563,7 +562,6 @@ public final class BukkitPlatform extends JavaPlugin implements Listener, PlotPl
|
|||||||
ServerLib.checkUnsafeForks();
|
ServerLib.checkUnsafeForks();
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("CatchAndPrintStackTrace")
|
|
||||||
private void unload() {
|
private void unload() {
|
||||||
if (!this.methodUnloadSetup) {
|
if (!this.methodUnloadSetup) {
|
||||||
this.methodUnloadSetup = true;
|
this.methodUnloadSetup = true;
|
||||||
@ -649,7 +647,6 @@ public final class BukkitPlatform extends JavaPlugin implements Listener, PlotPl
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("FutureReturnValueIgnored")
|
|
||||||
private void startUuidCaching(
|
private void startUuidCaching(
|
||||||
final @NonNull SQLiteUUIDService sqLiteUUIDService,
|
final @NonNull SQLiteUUIDService sqLiteUUIDService,
|
||||||
final @NonNull CacheUUIDService cacheUUIDService
|
final @NonNull CacheUUIDService cacheUUIDService
|
||||||
@ -750,7 +747,7 @@ public final class BukkitPlatform extends JavaPlugin implements Listener, PlotPl
|
|||||||
return Bukkit.getWorldContainer();
|
return Bukkit.getWorldContainer();
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings({"deprecation", "CatchAndPrintStacktrace"})
|
@SuppressWarnings("deprecation")
|
||||||
private void runEntityTask() {
|
private void runEntityTask() {
|
||||||
TaskManager.runTaskRepeat(() -> this.plotAreaManager.forEachPlotArea(plotArea -> {
|
TaskManager.runTaskRepeat(() -> this.plotAreaManager.forEachPlotArea(plotArea -> {
|
||||||
final World world = Bukkit.getWorld(plotArea.getWorldName());
|
final World world = Bukkit.getWorld(plotArea.getWorldName());
|
||||||
|
@ -461,7 +461,7 @@ public final class ReplicatingEntityWrapper extends EntityWrapper {
|
|||||||
this.tamed.tamed = tamed.isTamed();
|
this.tamed.tamed = tamed.isTamed();
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings({"EmptyCatch", "deprecation"}) // Paper deprecation
|
@SuppressWarnings("deprecation") // Paper deprecation
|
||||||
@Override
|
@Override
|
||||||
public Entity spawn(World world, int xOffset, int zOffset) {
|
public Entity spawn(World world, int xOffset, int zOffset) {
|
||||||
Location location = new Location(world, this.getX() + xOffset, this.getY(), this.z + zOffset);
|
Location location = new Location(world, this.getX() + xOffset, this.getY(), this.z + zOffset);
|
||||||
|
@ -108,7 +108,6 @@ public class BukkitPlotGenerator extends ChunkGenerator
|
|||||||
return this.platformGenerator;
|
return this.platformGenerator;
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("CatchAndPrintStackTrace")
|
|
||||||
@Override
|
@Override
|
||||||
public @NonNull List<BlockPopulator> getDefaultPopulators(@NonNull World world) {
|
public @NonNull List<BlockPopulator> getDefaultPopulators(@NonNull World world) {
|
||||||
try {
|
try {
|
||||||
@ -154,7 +153,6 @@ public class BukkitPlotGenerator extends ChunkGenerator
|
|||||||
return toAdd;
|
return toAdd;
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("CatchAndPrintStackTrace")
|
|
||||||
@Override
|
@Override
|
||||||
public @NonNull ChunkData generateChunkData(
|
public @NonNull ChunkData generateChunkData(
|
||||||
@NonNull World world, @NonNull Random random, int x, int z,
|
@NonNull World world, @NonNull Random random, int x, int z,
|
||||||
@ -197,7 +195,6 @@ public class BukkitPlotGenerator extends ChunkGenerator
|
|||||||
return result.getChunkData();
|
return result.getChunkData();
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("CatchAndPrintStackTrace")
|
|
||||||
private void generate(BlockVector2 loc, World world, ScopedQueueCoordinator result) {
|
private void generate(BlockVector2 loc, World world, ScopedQueueCoordinator result) {
|
||||||
// Load if improperly loaded
|
// Load if improperly loaded
|
||||||
if (!this.loaded) {
|
if (!this.loaded) {
|
||||||
@ -261,7 +258,6 @@ public class BukkitPlotGenerator extends ChunkGenerator
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings({"EqualsHashCode", "EqualsGetClass"}) // Valid comparison
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(final Object obj) {
|
public boolean equals(final Object obj) {
|
||||||
if (obj == null) {
|
if (obj == null) {
|
||||||
|
@ -66,7 +66,6 @@ final class DelegatePlotGenerator extends IndependentPlotGenerator {
|
|||||||
return PlotSquared.platform().defaultGenerator().getNewPlotArea(world, id, min, max);
|
return PlotSquared.platform().defaultGenerator().getNewPlotArea(world, id, min, max);
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("EmptyCatch")
|
|
||||||
@Override
|
@Override
|
||||||
public void generateChunk(final ScopedQueueCoordinator result, PlotArea settings) {
|
public void generateChunk(final ScopedQueueCoordinator result, PlotArea settings) {
|
||||||
World world = BukkitUtil.getWorld(this.world);
|
World world = BukkitUtil.getWorld(this.world);
|
||||||
|
@ -89,7 +89,6 @@ public class BukkitModule extends AbstractModule {
|
|||||||
this.bukkitPlatform = bukkitPlatform;
|
this.bukkitPlatform = bukkitPlatform;
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("CatchAndPrintStackTrace")
|
|
||||||
@Override
|
@Override
|
||||||
protected void configure() {
|
protected void configure() {
|
||||||
bind(PlayerManager.class).to(BukkitPlayerManager.class);
|
bind(PlayerManager.class).to(BukkitPlayerManager.class);
|
||||||
@ -133,7 +132,6 @@ public class BukkitModule extends AbstractModule {
|
|||||||
install(new FactoryModuleBuilder().build(ChunkCoordinatorBuilderFactory.class));
|
install(new FactoryModuleBuilder().build(ChunkCoordinatorBuilderFactory.class));
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("EmptyCatch")
|
|
||||||
@Provides
|
@Provides
|
||||||
@Singleton
|
@Singleton
|
||||||
@NonNull EconHandler provideEconHandler() {
|
@NonNull EconHandler provideEconHandler() {
|
||||||
|
@ -35,7 +35,6 @@ import org.bukkit.Bukkit;
|
|||||||
|
|
||||||
public class PermissionModule extends AbstractModule {
|
public class PermissionModule extends AbstractModule {
|
||||||
|
|
||||||
@SuppressWarnings("EmptyCatch")
|
|
||||||
@Provides
|
@Provides
|
||||||
@Singleton
|
@Singleton
|
||||||
PermissionHandler providePermissionHandler() {
|
PermissionHandler providePermissionHandler() {
|
||||||
|
@ -203,7 +203,6 @@ public class BlockEventListener implements Listener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("MissingCasesInEnumSwitch")
|
|
||||||
@EventHandler(ignoreCancelled = true, priority = EventPriority.HIGHEST)
|
@EventHandler(ignoreCancelled = true, priority = EventPriority.HIGHEST)
|
||||||
public void onPhysicsEvent(BlockPhysicsEvent event) {
|
public void onPhysicsEvent(BlockPhysicsEvent event) {
|
||||||
Block block = event.getBlock();
|
Block block = event.getBlock();
|
||||||
@ -426,7 +425,6 @@ public class BlockEventListener implements Listener {
|
|||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("FallThrough")
|
|
||||||
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
|
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
|
||||||
public void onBlockSpread(BlockSpreadEvent event) {
|
public void onBlockSpread(BlockSpreadEvent event) {
|
||||||
Block block = event.getBlock();
|
Block block = event.getBlock();
|
||||||
@ -531,7 +529,6 @@ public class BlockEventListener implements Listener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("MissingCasesInEnumSwitch")
|
|
||||||
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
|
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
|
||||||
public void onBlockForm(BlockFormEvent event) {
|
public void onBlockForm(BlockFormEvent event) {
|
||||||
if (event instanceof EntityBlockFormEvent) {
|
if (event instanceof EntityBlockFormEvent) {
|
||||||
@ -687,7 +684,6 @@ public class BlockEventListener implements Listener {
|
|||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("MissingCaseesInEnumSwitch")
|
|
||||||
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
|
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
|
||||||
public void onFade(BlockFadeEvent event) {
|
public void onFade(BlockFadeEvent event) {
|
||||||
Block block = event.getBlock();
|
Block block = event.getBlock();
|
||||||
@ -1076,7 +1072,6 @@ public class BlockEventListener implements Listener {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("OperatorPrecedence")
|
|
||||||
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
|
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
|
||||||
public void onBlockIgnite(BlockIgniteEvent event) {
|
public void onBlockIgnite(BlockIgniteEvent event) {
|
||||||
Player player = event.getPlayer();
|
Player player = event.getPlayer();
|
||||||
|
@ -139,7 +139,6 @@ public class BlockEventListener117 implements Listener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("MissingCasesInEnumSwitch")
|
|
||||||
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
|
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
|
||||||
public void onBlockForm(BlockFormEvent event) {
|
public void onBlockForm(BlockFormEvent event) {
|
||||||
Block block = event.getBlock();
|
Block block = event.getBlock();
|
||||||
|
@ -88,7 +88,6 @@ public class ChunkListener implements Listener {
|
|||||||
private boolean ignoreUnload = false;
|
private boolean ignoreUnload = false;
|
||||||
private boolean isTrueForNotSave = true;
|
private boolean isTrueForNotSave = true;
|
||||||
|
|
||||||
@SuppressWarnings({"StaticAssignmentInConstructor", "CatchAndPrintStackTrace"})
|
|
||||||
@Inject
|
@Inject
|
||||||
public ChunkListener(final @NonNull PlotAreaManager plotAreaManager) {
|
public ChunkListener(final @NonNull PlotAreaManager plotAreaManager) {
|
||||||
this.plotAreaManager = plotAreaManager;
|
this.plotAreaManager = plotAreaManager;
|
||||||
@ -258,7 +257,6 @@ public class ChunkListener implements Listener {
|
|||||||
processChunk(event.getChunk(), false);
|
processChunk(event.getChunk(), false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("FutureReturnValueIgnored")
|
|
||||||
@EventHandler(priority = EventPriority.LOWEST)
|
@EventHandler(priority = EventPriority.LOWEST)
|
||||||
public void onItemSpawn(ItemSpawnEvent event) {
|
public void onItemSpawn(ItemSpawnEvent event) {
|
||||||
Item entity = event.getEntity();
|
Item entity = event.getEntity();
|
||||||
@ -289,7 +287,6 @@ public class ChunkListener implements Listener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("FutureReturnValueIgnored")
|
|
||||||
@EventHandler(priority = EventPriority.LOWEST)
|
@EventHandler(priority = EventPriority.LOWEST)
|
||||||
public void onEntitySpawn(CreatureSpawnEvent event) {
|
public void onEntitySpawn(CreatureSpawnEvent event) {
|
||||||
LivingEntity entity = event.getEntity();
|
LivingEntity entity = event.getEntity();
|
||||||
|
@ -85,7 +85,6 @@ public class EntitySpawnListener implements Listener {
|
|||||||
test(entity);
|
test(entity);
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("FutureReturnValueIgnored")
|
|
||||||
public static void test(Entity entity) {
|
public static void test(Entity entity) {
|
||||||
@NonNull World world = entity.getWorld();
|
@NonNull World world = entity.getWorld();
|
||||||
List<MetadataValue> meta = entity.getMetadata(KEY);
|
List<MetadataValue> meta = entity.getMetadata(KEY);
|
||||||
@ -122,7 +121,6 @@ public class EntitySpawnListener implements Listener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings({"MissingCaseesInEnumSwitch", "FallThrough"})
|
|
||||||
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
|
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
|
||||||
public void creatureSpawnEvent(EntitySpawnEvent event) {
|
public void creatureSpawnEvent(EntitySpawnEvent event) {
|
||||||
Entity entity = event.getEntity();
|
Entity entity = event.getEntity();
|
||||||
|
@ -83,7 +83,6 @@ public class PaperListener implements Listener {
|
|||||||
this.plotAreaManager = plotAreaManager;
|
this.plotAreaManager = plotAreaManager;
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("ReferenceEquality")
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void onEntityPathfind(EntityPathfindEvent event) {
|
public void onEntityPathfind(EntityPathfindEvent event) {
|
||||||
if (!Settings.Paper_Components.ENTITY_PATHING) {
|
if (!Settings.Paper_Components.ENTITY_PATHING) {
|
||||||
@ -118,7 +117,6 @@ public class PaperListener implements Listener {
|
|||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("ReferenceEquality")
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void onEntityPathfind(SlimePathfindEvent event) {
|
public void onEntityPathfind(SlimePathfindEvent event) {
|
||||||
if (!Settings.Paper_Components.ENTITY_PATHING) {
|
if (!Settings.Paper_Components.ENTITY_PATHING) {
|
||||||
@ -161,7 +159,6 @@ public class PaperListener implements Listener {
|
|||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings({"MissingCasesInEnumSwitch", "FallThrough"})
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void onPreCreatureSpawnEvent(PreCreatureSpawnEvent event) {
|
public void onPreCreatureSpawnEvent(PreCreatureSpawnEvent event) {
|
||||||
if (!Settings.Paper_Components.CREATURE_SPAWN) {
|
if (!Settings.Paper_Components.CREATURE_SPAWN) {
|
||||||
@ -366,7 +363,6 @@ public class PaperListener implements Listener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("EmptyCatch")
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void onAsyncTabCompletion(final AsyncTabCompleteEvent event) {
|
public void onAsyncTabCompletion(final AsyncTabCompleteEvent event) {
|
||||||
if (!Settings.Paper_Components.ASYNC_TAB_COMPLETION) {
|
if (!Settings.Paper_Components.ASYNC_TAB_COMPLETION) {
|
||||||
|
@ -430,7 +430,6 @@ public class PlayerEventListener extends PlotListener implements Listener {
|
|||||||
playerMove(event);
|
playerMove(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("FutureReturnValueIgnored")
|
|
||||||
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
|
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
|
||||||
public void vehicleMove(VehicleMoveEvent event)
|
public void vehicleMove(VehicleMoveEvent event)
|
||||||
throws IllegalAccessException {
|
throws IllegalAccessException {
|
||||||
@ -808,7 +807,7 @@ public class PlayerEventListener extends PlotListener implements Listener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings({"deprecation", "FallThrough"})
|
@SuppressWarnings("deprecation")
|
||||||
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
|
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
|
||||||
public void onInventoryClick(InventoryClickEvent event) {
|
public void onInventoryClick(InventoryClickEvent event) {
|
||||||
/*if (!event.isLeftClick() || (event.getAction() != InventoryAction.PLACE_ALL) || event
|
/*if (!event.isLeftClick() || (event.getAction() != InventoryAction.PLACE_ALL) || event
|
||||||
|
@ -48,7 +48,6 @@ public class SingleWorldListener implements Listener {
|
|||||||
private final Method methodGetHandleChunk;
|
private final Method methodGetHandleChunk;
|
||||||
private Field shouldSave;
|
private Field shouldSave;
|
||||||
|
|
||||||
@SuppressWarnings("CatchAndPrintStackTrace")
|
|
||||||
public SingleWorldListener() throws Exception {
|
public SingleWorldListener() throws Exception {
|
||||||
ReflectionUtils.RefClass classCraftChunk = getRefClass("{cb}.CraftChunk");
|
ReflectionUtils.RefClass classCraftChunk = getRefClass("{cb}.CraftChunk");
|
||||||
this.methodGetHandleChunk = classCraftChunk.getMethod("getHandle").getRealMethod();
|
this.methodGetHandleChunk = classCraftChunk.getMethod("getHandle").getRealMethod();
|
||||||
@ -69,7 +68,6 @@ public class SingleWorldListener implements Listener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("CatchAndPrintStackTrace")
|
|
||||||
public void markChunkAsClean(Chunk chunk) {
|
public void markChunkAsClean(Chunk chunk) {
|
||||||
try {
|
try {
|
||||||
Object nmsChunk = methodGetHandleChunk.invoke(chunk);
|
Object nmsChunk = methodGetHandleChunk.invoke(chunk);
|
||||||
|
@ -64,7 +64,6 @@ public class BukkitWorldManager implements PlatformWorldManager<World> {
|
|||||||
return Bukkit.createWorld(wc);
|
return Bukkit.createWorld(wc);
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("CatchAndPrintStackTrace")
|
|
||||||
protected void setGenerator(final @Nullable String worldName, final @Nullable String generator) {
|
protected void setGenerator(final @Nullable String worldName, final @Nullable String generator) {
|
||||||
if (generator == null) {
|
if (generator == null) {
|
||||||
return;
|
return;
|
||||||
|
@ -148,7 +148,6 @@ public class BukkitPlayer extends PlotPlayer<Player> {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("CatchAndPrintStackTrace")
|
|
||||||
private void callEvent(final @NonNull Event event) {
|
private void callEvent(final @NonNull Event event) {
|
||||||
final RegisteredListener[] listeners = event.getHandlers().getRegisteredListeners();
|
final RegisteredListener[] listeners = event.getHandlers().getRegisteredListeners();
|
||||||
for (final RegisteredListener listener : listeners) {
|
for (final RegisteredListener listener : listeners) {
|
||||||
@ -229,7 +228,6 @@ public class BukkitPlayer extends PlotPlayer<Player> {
|
|||||||
return max;
|
return max;
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("FutureReturnValueIgnored")
|
|
||||||
@Override
|
@Override
|
||||||
public void teleport(final @NonNull Location location, final @NonNull TeleportCause cause) {
|
public void teleport(final @NonNull Location location, final @NonNull TeleportCause cause) {
|
||||||
if (Math.abs(location.getX()) >= 30000000 || Math.abs(location.getZ()) >= 30000000) {
|
if (Math.abs(location.getX()) >= 30000000 || Math.abs(location.getZ()) >= 30000000) {
|
||||||
@ -317,7 +315,6 @@ public class BukkitPlayer extends PlotPlayer<Player> {
|
|||||||
this.player.setAllowFlight(fly);
|
this.player.setAllowFlight(fly);
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("ReferenceEquality")
|
|
||||||
@Override
|
@Override
|
||||||
public void playMusic(final @NonNull Location location, final @NonNull ItemType id) {
|
public void playMusic(final @NonNull Location location, final @NonNull ItemType id) {
|
||||||
if (id == ItemTypes.AIR) {
|
if (id == ItemTypes.AIR) {
|
||||||
@ -341,7 +338,6 @@ public class BukkitPlayer extends PlotPlayer<Player> {
|
|||||||
this.player.kickPlayer(message);
|
this.player.kickPlayer(message);
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("ReferenceEquality")
|
|
||||||
@Override
|
@Override
|
||||||
public void stopSpectating() {
|
public void stopSpectating() {
|
||||||
if (getGameMode() == SPECTATOR) {
|
if (getGameMode() == SPECTATOR) {
|
||||||
|
@ -193,7 +193,6 @@ public final class BukkitChunkCoordinator extends ChunkCoordinator {
|
|||||||
/**
|
/**
|
||||||
* Requests a batch of chunks to be loaded
|
* Requests a batch of chunks to be loaded
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("FutureReturnValueIgnored")
|
|
||||||
private void requestBatch() {
|
private void requestBatch() {
|
||||||
BlockVector2 chunk;
|
BlockVector2 chunk;
|
||||||
for (int i = 0; i < this.batchSize && (chunk = this.requestedChunks.poll()) != null; i++) {
|
for (int i = 0; i < this.batchSize && (chunk = this.requestedChunks.poll()) != null; i++) {
|
||||||
|
@ -337,7 +337,6 @@ public class BukkitEntityUtil {
|
|||||||
&& !(victim instanceof Creature)));
|
&& !(victim instanceof Creature)));
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("OperatorPrecedence")
|
|
||||||
public static boolean checkEntity(Entity entity, Plot plot) {
|
public static boolean checkEntity(Entity entity, Plot plot) {
|
||||||
if (plot == null || !plot.hasOwner() || plot.getFlags().isEmpty() && plot.getArea()
|
if (plot == null || !plot.hasOwner() || plot.getFlags().isEmpty() && plot.getArea()
|
||||||
.getFlagContainer().getFlagMap().isEmpty()) {
|
.getFlagContainer().getFlagMap().isEmpty()) {
|
||||||
|
@ -94,7 +94,6 @@ public class BukkitRegionManager extends RegionManager {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings({"FutureReturnValueIgnored", "OperatorPrecedence"})
|
|
||||||
@Override
|
@Override
|
||||||
public int[] countEntities(@NonNull Plot plot) {
|
public int[] countEntities(@NonNull Plot plot) {
|
||||||
int[] existing = (int[]) plot.getMeta("EntityCount");
|
int[] existing = (int[]) plot.getMeta("EntityCount");
|
||||||
|
@ -74,7 +74,6 @@ public class BukkitSetupUtils extends SetupUtils {
|
|||||||
this.worldFile = worldFile;
|
this.worldFile = worldFile;
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("CatchAndPrintStackTrace")
|
|
||||||
@Override
|
@Override
|
||||||
public void updateGenerators(final boolean force) {
|
public void updateGenerators(final boolean force) {
|
||||||
if (!SetupUtils.generators.isEmpty() && !force) {
|
if (!SetupUtils.generators.isEmpty() && !force) {
|
||||||
@ -127,7 +126,6 @@ public class BukkitSetupUtils extends SetupUtils {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("CatchAndPrintStackTrace")
|
|
||||||
@Override
|
@Override
|
||||||
public String setupWorld(PlotAreaBuilder builder) {
|
public String setupWorld(PlotAreaBuilder builder) {
|
||||||
this.updateGenerators(false);
|
this.updateGenerators(false);
|
||||||
|
@ -193,7 +193,6 @@ public class BukkitUtil extends WorldUtil {
|
|||||||
return Bukkit.getWorld(string);
|
return Bukkit.getWorld(string);
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("FutureReturnValueIgnored")
|
|
||||||
private static void ensureLoaded(
|
private static void ensureLoaded(
|
||||||
final @NonNull String world,
|
final @NonNull String world,
|
||||||
final int x,
|
final int x,
|
||||||
@ -204,7 +203,6 @@ public class BukkitUtil extends WorldUtil {
|
|||||||
.thenAccept(chunk -> ensureMainThread(chunkConsumer, chunk));
|
.thenAccept(chunk -> ensureMainThread(chunkConsumer, chunk));
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("FutureReturnValueIgnored")
|
|
||||||
private static void ensureLoaded(final @NonNull Location location, final @NonNull Consumer<Chunk> chunkConsumer) {
|
private static void ensureLoaded(final @NonNull Location location, final @NonNull Consumer<Chunk> chunkConsumer) {
|
||||||
PaperLib.getChunkAtAsync(adapt(location), true).thenAccept(chunk -> ensureMainThread(chunkConsumer, chunk));
|
PaperLib.getChunkAtAsync(adapt(location), true).thenAccept(chunk -> ensureMainThread(chunkConsumer, chunk));
|
||||||
}
|
}
|
||||||
@ -293,7 +291,6 @@ public class BukkitUtil extends WorldUtil {
|
|||||||
return bukkitWorld.getMaxHeight() - 1;
|
return bukkitWorld.getMaxHeight() - 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("CatchAndPrintStackTrace")
|
|
||||||
@Override
|
@Override
|
||||||
public @NonNull String[] getSignSynchronous(final @NonNull Location location) {
|
public @NonNull String[] getSignSynchronous(final @NonNull Location location) {
|
||||||
Block block = Objects.requireNonNull(getWorld(location.getWorldName())).getBlockAt(
|
Block block = Objects.requireNonNull(getWorld(location.getWorldName())).getBlockAt(
|
||||||
@ -573,7 +570,6 @@ public class BukkitUtil extends WorldUtil {
|
|||||||
getChunkAt(chunk.getBlockX(), chunk.getBlockZ()).getTileEntities().length;
|
getChunkAt(chunk.getBlockX(), chunk.getBlockZ()).getTileEntities().length;
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("CatchAndPrintStackTrace")
|
|
||||||
@Override
|
@Override
|
||||||
public Set<BlockVector2> getChunkChunks(String world) {
|
public Set<BlockVector2> getChunkChunks(String world) {
|
||||||
Set<BlockVector2> chunks = super.getChunkChunks(world);
|
Set<BlockVector2> chunks = super.getChunkChunks(world);
|
||||||
|
@ -52,7 +52,6 @@ public class EssentialsUUIDService implements UUIDService {
|
|||||||
return Collections.emptyList();
|
return Collections.emptyList();
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("EmptyCatch")
|
|
||||||
@Override
|
@Override
|
||||||
public @NonNull List<UUIDMapping> getUUIDs(final @NonNull List<String> usernames) {
|
public @NonNull List<UUIDMapping> getUUIDs(final @NonNull List<String> usernames) {
|
||||||
final List<UUIDMapping> mappings = new ArrayList<>(usernames.size());
|
final List<UUIDMapping> mappings = new ArrayList<>(usernames.size());
|
||||||
|
@ -53,7 +53,6 @@ public class LuckPermsUUIDService implements UUIDService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("EmptyCatch")
|
|
||||||
@Override
|
@Override
|
||||||
public @NonNull List<UUIDMapping> getNames(final @NonNull List<UUID> uuids) {
|
public @NonNull List<UUIDMapping> getNames(final @NonNull List<UUID> uuids) {
|
||||||
final List<UUIDMapping> mappings = new ArrayList<>(uuids.size());
|
final List<UUIDMapping> mappings = new ArrayList<>(uuids.size());
|
||||||
@ -70,7 +69,6 @@ public class LuckPermsUUIDService implements UUIDService {
|
|||||||
return mappings;
|
return mappings;
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("EmptyCatch")
|
|
||||||
@Override
|
@Override
|
||||||
public @NonNull List<UUIDMapping> getUUIDs(final @NonNull List<String> usernames) {
|
public @NonNull List<UUIDMapping> getUUIDs(final @NonNull List<String> usernames) {
|
||||||
final List<UUIDMapping> mappings = new ArrayList<>(usernames.size());
|
final List<UUIDMapping> mappings = new ArrayList<>(usernames.size());
|
||||||
|
@ -43,7 +43,6 @@ import java.util.UUID;
|
|||||||
*/
|
*/
|
||||||
public class OfflinePlayerUUIDService implements UUIDService {
|
public class OfflinePlayerUUIDService implements UUIDService {
|
||||||
|
|
||||||
@SuppressWarnings({"EmptyCatch", "MixedMutabilityReturnType"})
|
|
||||||
@Override
|
@Override
|
||||||
public @NonNull List<UUIDMapping> getNames(final @NonNull List<UUID> uuids) {
|
public @NonNull List<UUIDMapping> getNames(final @NonNull List<UUID> uuids) {
|
||||||
if (Settings.UUID.FORCE_LOWERCASE || Bukkit.getWorlds().isEmpty()) {
|
if (Settings.UUID.FORCE_LOWERCASE || Bukkit.getWorlds().isEmpty()) {
|
||||||
|
@ -49,7 +49,6 @@ public class SQLiteUUIDService implements UUIDService, Consumer<List<UUIDMapping
|
|||||||
|
|
||||||
private final SQLite sqlite;
|
private final SQLite sqlite;
|
||||||
|
|
||||||
@SuppressWarnings("CatchAndPrintStackTrace")
|
|
||||||
public SQLiteUUIDService(final String fileName) {
|
public SQLiteUUIDService(final String fileName) {
|
||||||
this.sqlite =
|
this.sqlite =
|
||||||
new SQLite(FileUtils.getFile(PlotSquared.platform().getDirectory(), fileName));
|
new SQLite(FileUtils.getFile(PlotSquared.platform().getDirectory(), fileName));
|
||||||
@ -73,7 +72,6 @@ public class SQLiteUUIDService implements UUIDService, Consumer<List<UUIDMapping
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("CatchAndPrintStackTrace")
|
|
||||||
@Override
|
@Override
|
||||||
public @NonNull List<UUIDMapping> getNames(final @NonNull List<UUID> uuids) {
|
public @NonNull List<UUIDMapping> getNames(final @NonNull List<UUID> uuids) {
|
||||||
final List<UUIDMapping> mappings = new ArrayList<>(uuids.size());
|
final List<UUIDMapping> mappings = new ArrayList<>(uuids.size());
|
||||||
@ -93,7 +91,6 @@ public class SQLiteUUIDService implements UUIDService, Consumer<List<UUIDMapping
|
|||||||
return mappings;
|
return mappings;
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("CatchAndPrintStackTrace")
|
|
||||||
@Override
|
@Override
|
||||||
public @NonNull List<UUIDMapping> getUUIDs(@NonNull List<String> usernames) {
|
public @NonNull List<UUIDMapping> getUUIDs(@NonNull List<String> usernames) {
|
||||||
final List<UUIDMapping> mappings = new ArrayList<>(usernames.size());
|
final List<UUIDMapping> mappings = new ArrayList<>(usernames.size());
|
||||||
@ -116,7 +113,6 @@ public class SQLiteUUIDService implements UUIDService, Consumer<List<UUIDMapping
|
|||||||
return mappings;
|
return mappings;
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("CatchAndPrintStackTrace")
|
|
||||||
@Override
|
@Override
|
||||||
public void accept(final List<UUIDMapping> uuidWrappers) {
|
public void accept(final List<UUIDMapping> uuidWrappers) {
|
||||||
try (final PreparedStatement statement = getConnection()
|
try (final PreparedStatement statement = getConnection()
|
||||||
@ -136,7 +132,6 @@ public class SQLiteUUIDService implements UUIDService, Consumer<List<UUIDMapping
|
|||||||
*
|
*
|
||||||
* @return All read mappings
|
* @return All read mappings
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("CatchAndPrintStackTrace")
|
|
||||||
public @NonNull List<UUIDMapping> getAll() {
|
public @NonNull List<UUIDMapping> getAll() {
|
||||||
final List<UUIDMapping> mappings = new LinkedList<>();
|
final List<UUIDMapping> mappings = new LinkedList<>();
|
||||||
try (final PreparedStatement statement = getConnection().prepareStatement("SELECT * FROM `usercache`")) {
|
try (final PreparedStatement statement = getConnection().prepareStatement("SELECT * FROM `usercache`")) {
|
||||||
|
@ -67,7 +67,6 @@ public class SquirrelIdUUIDService implements UUIDService {
|
|||||||
this.rateLimiter = RateLimiter.create(rateLimit / 600.0D);
|
this.rateLimiter = RateLimiter.create(rateLimit / 600.0D);
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("CatchAndPrintStackTrace")
|
|
||||||
@Override
|
@Override
|
||||||
public @NonNull List<UUIDMapping> getNames(final @NonNull List<UUID> uuids) {
|
public @NonNull List<UUIDMapping> getNames(final @NonNull List<UUID> uuids) {
|
||||||
final List<UUIDMapping> results = new ArrayList<>(uuids.size());
|
final List<UUIDMapping> results = new ArrayList<>(uuids.size());
|
||||||
@ -103,7 +102,6 @@ public class SquirrelIdUUIDService implements UUIDService {
|
|||||||
return results;
|
return results;
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("CatchAndPrintStackTrace")
|
|
||||||
@Override
|
@Override
|
||||||
public @NonNull List<UUIDMapping> getUUIDs(final @NonNull List<String> usernames) {
|
public @NonNull List<UUIDMapping> getUUIDs(final @NonNull List<String> usernames) {
|
||||||
final List<UUIDMapping> results = new ArrayList<>(usernames.size());
|
final List<UUIDMapping> results = new ArrayList<>(usernames.size());
|
||||||
|
Loading…
Reference in New Issue
Block a user