mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2025-06-27 19:24:43 +02:00
draft: Address false positives in code style issues (#3461)
* chore: Address false positive code style issues * chore: More work * More work
This commit is contained in:
@ -77,6 +77,7 @@ public class BukkitInventoryUtil extends InventoryUtil {
|
||||
return stack;
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation") // Paper deprecation
|
||||
@Override
|
||||
public void open(PlotInventory inv) {
|
||||
BukkitPlayer bp = (BukkitPlayer) inv.getPlayer();
|
||||
@ -113,6 +114,7 @@ public class BukkitInventoryUtil extends InventoryUtil {
|
||||
bp.player.updateInventory();
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation") // Paper deprecation
|
||||
public PlotItemStack getItem(ItemStack item) {
|
||||
if (item == null) {
|
||||
return null;
|
||||
@ -145,6 +147,7 @@ public class BukkitInventoryUtil extends InventoryUtil {
|
||||
.toArray(PlotItemStack[]::new);
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation") // #getTitle is needed for Spigot compatibility
|
||||
@Override
|
||||
public boolean isOpen(PlotInventory plotInventory) {
|
||||
if (!plotInventory.isOpen()) {
|
||||
|
@ -61,6 +61,7 @@ public class UpdateUtility implements Listener {
|
||||
internalVersion = PlotSquared.get().getVersion();
|
||||
}
|
||||
|
||||
@SuppressWarnings({"deprecation", "DefaultCharset"}) // Suppress Json deprecation, we can't use features from gson 2.8.1 and newer yet
|
||||
public void updateChecker() {
|
||||
task = Bukkit.getScheduler().runTaskTimerAsynchronously(this.javaPlugin, () -> {
|
||||
try {
|
||||
@ -68,7 +69,7 @@ public class UpdateUtility implements Listener {
|
||||
"https://api.spigotmc.org/simple/0.1/index.php?action=getResource&id=77506")
|
||||
.openConnection();
|
||||
connection.setRequestMethod("GET");
|
||||
JsonObject result = (new JsonParser())
|
||||
JsonObject result = new JsonParser()
|
||||
.parse(new JsonReader(new InputStreamReader(connection.getInputStream())))
|
||||
.getAsJsonObject();
|
||||
spigotVersion = result.get("current_version").getAsString();
|
||||
@ -91,7 +92,7 @@ public class UpdateUtility implements Listener {
|
||||
notify = false;
|
||||
LOGGER.info("Congratulations! You are running the latest PlotSquared version");
|
||||
}
|
||||
}, 0L, Settings.UpdateChecker.POLL_RATE * 60 * 20);
|
||||
}, 0L, (long) Settings.UpdateChecker.POLL_RATE * 60 * 20);
|
||||
}
|
||||
|
||||
private void cancelTask() {
|
||||
|
@ -75,6 +75,7 @@ public class FaweSchematicHandler extends SchematicHandler {
|
||||
return delegate.save(tag, path);
|
||||
}
|
||||
|
||||
@SuppressWarnings("removal") // Just the override
|
||||
@Override
|
||||
public void upload(final CompoundTag tag, final UUID uuid, final String file, final RunnableVal<URL> whenDone) {
|
||||
delegate.upload(tag, uuid, file, whenDone);
|
||||
|
Reference in New Issue
Block a user