mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-23 13:46:45 +01:00
chore: Address false positive code style issues
This commit is contained in:
parent
6f4d2f6d5a
commit
4a2da59505
@ -218,6 +218,7 @@ public final class BukkitPlatform extends JavaPlugin implements Listener, PlotPl
|
|||||||
private PlatformWorldManager<World> worldManager;
|
private PlatformWorldManager<World> worldManager;
|
||||||
private Locale serverLocale;
|
private Locale serverLocale;
|
||||||
|
|
||||||
|
@SuppressWarnings("StringSplitter")
|
||||||
@Override
|
@Override
|
||||||
public int @NonNull [] serverVersion() {
|
public int @NonNull [] serverVersion() {
|
||||||
if (this.version == null) {
|
if (this.version == null) {
|
||||||
@ -242,6 +243,7 @@ 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();
|
||||||
@ -746,7 +748,7 @@ public final class BukkitPlatform extends JavaPlugin implements Listener, PlotPl
|
|||||||
return Bukkit.getWorldContainer();
|
return Bukkit.getWorldContainer();
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("deprecation")
|
@SuppressWarnings({"deprecation", "CatchAndPrintStacktrace"})
|
||||||
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());
|
||||||
@ -970,7 +972,6 @@ public final class BukkitPlatform extends JavaPlugin implements Listener, PlotPl
|
|||||||
}
|
}
|
||||||
iterator.remove();
|
iterator.remove();
|
||||||
entity.remove();
|
entity.remove();
|
||||||
continue;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -982,7 +983,6 @@ public final class BukkitPlatform extends JavaPlugin implements Listener, PlotPl
|
|||||||
}
|
}
|
||||||
iterator.remove();
|
iterator.remove();
|
||||||
entity.remove();
|
entity.remove();
|
||||||
continue;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1223,7 +1223,7 @@ public final class BukkitPlatform extends JavaPlugin implements Listener, PlotPl
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
@NonNull
|
@NonNull
|
||||||
@SuppressWarnings("ALL")
|
@SuppressWarnings("unchecked")
|
||||||
public PlayerManager<? extends PlotPlayer<Player>, ? extends Player> playerManager() {
|
public PlayerManager<? extends PlotPlayer<Player>, ? extends Player> playerManager() {
|
||||||
return (PlayerManager<BukkitPlayer, Player>) injector().getInstance(PlayerManager.class);
|
return (PlayerManager<BukkitPlayer, Player>) injector().getInstance(PlayerManager.class);
|
||||||
}
|
}
|
||||||
|
@ -461,6 +461,7 @@ public final class ReplicatingEntityWrapper extends EntityWrapper {
|
|||||||
this.tamed.tamed = tamed.isTamed();
|
this.tamed.tamed = tamed.isTamed();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("EmptyCatch")
|
||||||
@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,6 +108,7 @@ 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 {
|
||||||
@ -153,6 +154,7 @@ 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,
|
||||||
@ -195,6 +197,7 @@ 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) {
|
||||||
|
@ -66,6 +66,7 @@ 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,6 +89,7 @@ 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);
|
||||||
@ -132,6 +133,7 @@ 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,6 +35,7 @@ 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,6 +203,7 @@ 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();
|
||||||
@ -529,6 +530,7 @@ 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) {
|
||||||
@ -684,6 +686,7 @@ public class BlockEventListener implements Listener {
|
|||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("MissingCaseInEnumSwitch")
|
||||||
@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();
|
||||||
|
@ -139,6 +139,7 @@ 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,6 +88,7 @@ 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;
|
||||||
|
@ -121,6 +121,7 @@ public class EntitySpawnListener implements Listener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("MissingCaseInEnumSwitch")
|
||||||
@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();
|
||||||
|
@ -159,6 +159,7 @@ public class PaperListener implements Listener {
|
|||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("MissingCasesInEnumSwitch")
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void onPreCreatureSpawnEvent(PreCreatureSpawnEvent event) {
|
public void onPreCreatureSpawnEvent(PreCreatureSpawnEvent event) {
|
||||||
if (!Settings.Paper_Components.CREATURE_SPAWN) {
|
if (!Settings.Paper_Components.CREATURE_SPAWN) {
|
||||||
@ -363,6 +364,7 @@ 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) {
|
||||||
|
@ -224,6 +224,7 @@ public class PlayerEventListener extends PlotListener implements Listener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("StringSplitter")
|
||||||
@EventHandler(ignoreCancelled = true, priority = EventPriority.HIGHEST)
|
@EventHandler(ignoreCancelled = true, priority = EventPriority.HIGHEST)
|
||||||
public void playerCommand(PlayerCommandPreprocessEvent event) {
|
public void playerCommand(PlayerCommandPreprocessEvent event) {
|
||||||
String msg = event.getMessage().toLowerCase().replaceAll("/", "").trim();
|
String msg = event.getMessage().toLowerCase().replaceAll("/", "").trim();
|
||||||
@ -1667,6 +1668,7 @@ public class PlayerEventListener extends PlotListener implements Listener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("deprecation") // #getLocate is needed for Spigot compatibility
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void onLocaleChange(final PlayerLocaleChangeEvent event) {
|
public void onLocaleChange(final PlayerLocaleChangeEvent event) {
|
||||||
// The event is fired before the player is deemed online upon login
|
// The event is fired before the player is deemed online upon login
|
||||||
|
@ -43,12 +43,12 @@ import java.lang.reflect.Method;
|
|||||||
|
|
||||||
import static com.plotsquared.core.util.ReflectionUtils.getRefClass;
|
import static com.plotsquared.core.util.ReflectionUtils.getRefClass;
|
||||||
|
|
||||||
@SuppressWarnings("unused")
|
|
||||||
public class SingleWorldListener implements Listener {
|
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,6 +69,7 @@ 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,6 +64,7 @@ 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,6 +148,7 @@ 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) {
|
||||||
@ -162,6 +163,7 @@ public class BukkitPlayer extends PlotPlayer<Player> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("StringSplitter")
|
||||||
@Override
|
@Override
|
||||||
@NonNegative
|
@NonNegative
|
||||||
public int hasPermissionRange(
|
public int hasPermissionRange(
|
||||||
@ -319,7 +321,7 @@ public class BukkitPlayer extends PlotPlayer<Player> {
|
|||||||
if (id == ItemTypes.AIR) {
|
if (id == ItemTypes.AIR) {
|
||||||
// Let's just stop all the discs because why not?
|
// Let's just stop all the discs because why not?
|
||||||
for (final Sound sound : Arrays.stream(Sound.values())
|
for (final Sound sound : Arrays.stream(Sound.values())
|
||||||
.filter(sound -> sound.name().contains("DISC")).collect(Collectors.toList())) {
|
.filter(sound -> sound.name().contains("DISC")).toList()) {
|
||||||
player.stopSound(sound);
|
player.stopSound(sound);
|
||||||
}
|
}
|
||||||
// this.player.playEffect(BukkitUtil.getLocation(location), Effect.RECORD_PLAY, Material.AIR);
|
// this.player.playEffect(BukkitUtil.getLocation(location), Effect.RECORD_PLAY, Material.AIR);
|
||||||
@ -331,6 +333,7 @@ public class BukkitPlayer extends PlotPlayer<Player> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("deprecation") // Needed for Spigot compatibility
|
||||||
@Override
|
@Override
|
||||||
public void kick(final String message) {
|
public void kick(final String message) {
|
||||||
this.player.kickPlayer(message);
|
this.player.kickPlayer(message);
|
||||||
|
@ -193,6 +193,7 @@ 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++) {
|
||||||
|
@ -199,7 +199,7 @@ public class BukkitQueueCoordinator extends BasicQueueCoordinator {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (localChunk.getTiles().size() > 0) {
|
if (localChunk.getTiles().size() > 0) {
|
||||||
localChunk.getTiles().forEach(((blockVector3, tag) -> {
|
localChunk.getTiles().forEach((blockVector3, tag) -> {
|
||||||
try {
|
try {
|
||||||
BaseBlock block = getWorld().getBlock(blockVector3).toBaseBlock(tag);
|
BaseBlock block = getWorld().getBlock(blockVector3).toBaseBlock(tag);
|
||||||
getWorld().setBlock(blockVector3, block, noSideEffectSet);
|
getWorld().setBlock(blockVector3, block, noSideEffectSet);
|
||||||
@ -207,7 +207,7 @@ public class BukkitQueueCoordinator extends BasicQueueCoordinator {
|
|||||||
StateWrapper sw = new StateWrapper(tag);
|
StateWrapper sw = new StateWrapper(tag);
|
||||||
sw.restoreTag(getWorld().getName(), blockVector3.getX(), blockVector3.getY(), blockVector3.getZ());
|
sw.restoreTag(getWorld().getName(), blockVector3.getX(), blockVector3.getY(), blockVector3.getZ());
|
||||||
}
|
}
|
||||||
}));
|
});
|
||||||
}
|
}
|
||||||
if (localChunk.getEntities().size() > 0) {
|
if (localChunk.getEntities().size() > 0) {
|
||||||
localChunk.getEntities().forEach((location, entity) -> getWorld().createEntity(location, entity));
|
localChunk.getEntities().forEach((location, entity) -> getWorld().createEntity(location, entity));
|
||||||
|
@ -166,6 +166,7 @@ public class StateWrapper {
|
|||||||
return str;
|
return str;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("deprecation") // #setLine is needed for Spigot compatibility
|
||||||
public boolean restoreTag(String worldName, int x, int y, int z) {
|
public boolean restoreTag(String worldName, int x, int y, int z) {
|
||||||
if (this.tag == null) {
|
if (this.tag == null) {
|
||||||
return false;
|
return false;
|
||||||
|
@ -145,6 +145,7 @@ public class BukkitInventoryUtil extends InventoryUtil {
|
|||||||
.toArray(PlotItemStack[]::new);
|
.toArray(PlotItemStack[]::new);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("deprecation") // Need #getTitle for Spigot compatibility
|
||||||
@Override
|
@Override
|
||||||
public boolean isOpen(PlotInventory plotInventory) {
|
public boolean isOpen(PlotInventory plotInventory) {
|
||||||
if (!plotInventory.isOpen()) {
|
if (!plotInventory.isOpen()) {
|
||||||
|
@ -126,6 +126,7 @@ 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);
|
||||||
|
@ -291,6 +291,7 @@ 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(
|
||||||
@ -570,6 +571,7 @@ 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);
|
||||||
|
@ -68,7 +68,7 @@ public class UpdateUtility implements Listener {
|
|||||||
"https://api.spigotmc.org/simple/0.1/index.php?action=getResource&id=77506")
|
"https://api.spigotmc.org/simple/0.1/index.php?action=getResource&id=77506")
|
||||||
.openConnection();
|
.openConnection();
|
||||||
connection.setRequestMethod("GET");
|
connection.setRequestMethod("GET");
|
||||||
JsonObject result = (new JsonParser())
|
JsonObject result = new JsonParser()
|
||||||
.parse(new JsonReader(new InputStreamReader(connection.getInputStream())))
|
.parse(new JsonReader(new InputStreamReader(connection.getInputStream())))
|
||||||
.getAsJsonObject();
|
.getAsJsonObject();
|
||||||
spigotVersion = result.get("current_version").getAsString();
|
spigotVersion = result.get("current_version").getAsString();
|
||||||
|
@ -52,6 +52,7 @@ 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,6 +53,7 @@ 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());
|
||||||
@ -69,6 +70,7 @@ 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,6 +43,7 @@ import java.util.UUID;
|
|||||||
*/
|
*/
|
||||||
public class OfflinePlayerUUIDService implements UUIDService {
|
public class OfflinePlayerUUIDService 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) {
|
||||||
if (Settings.UUID.FORCE_LOWERCASE || Bukkit.getWorlds().isEmpty()) {
|
if (Settings.UUID.FORCE_LOWERCASE || Bukkit.getWorlds().isEmpty()) {
|
||||||
|
@ -49,6 +49,7 @@ 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));
|
||||||
@ -72,6 +73,7 @@ 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());
|
||||||
@ -91,6 +93,7 @@ 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());
|
||||||
@ -113,6 +116,7 @@ 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()
|
||||||
@ -132,6 +136,7 @@ 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,6 +67,7 @@ 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());
|
||||||
@ -102,6 +103,7 @@ 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