Cleanups/warning fixes

This commit is contained in:
Heliosares
2023-11-26 16:46:55 -05:00
parent a0e88a69ad
commit d20a1f9780
9 changed files with 18 additions and 10 deletions

View File

@@ -144,6 +144,12 @@
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>

View File

@@ -154,7 +154,7 @@ public class BlobManager {
}
}
static class BlobCache {
protected static class BlobCache {
final long blobid;
final byte[] ablob;
final int hash;

View File

@@ -49,7 +49,7 @@ public class XrayResults {
message.append("" + ChatColor.COLOR_CHAR + "7" + ChatColor.COLOR_CHAR + "l[0-All]")
.event(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/ap xray zero " + en.getUserUUID().substring(1)))
.event(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new Text("" + ChatColor.COLOR_CHAR + "7Rate all entries from " + en.getUser() + " as 0.")));
.event(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new Text(ChatColor.COLOR_CHAR + "7Rate all entries from " + en.getUser() + " as 0.")));
}
sender.sendMessage(message.create());

View File

@@ -7,6 +7,7 @@ import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.command.TabExecutor;
import javax.annotation.Nonnull;
import java.util.List;
public class APSCommand implements CommandExecutor, TabExecutor {
@@ -20,13 +21,13 @@ public class APSCommand implements CommandExecutor, TabExecutor {
}
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
public boolean onCommand(@Nonnull CommandSender sender, @Nonnull Command command, @Nonnull String label, @Nonnull String[] args) {
apcommand.onCommand(new SpigotSenderAdapter(plugin, sender), label, args);
return true;
}
@Override
public List<String> onTabComplete(CommandSender sender, Command command, String label, String[] args) {
public List<String> onTabComplete(@Nonnull CommandSender sender, @Nonnull Command command, @Nonnull String label, @Nonnull String[] args) {
return apcommand.onTabComplete(new SpigotSenderAdapter(plugin, sender), label, args);
}

View File

@@ -27,8 +27,9 @@ public class CommandListener implements Listener {
String[] args = new String[args1.length - 1];
System.arraycopy(args1, 1, args, 0, args.length);
if (auxprotect) {
//noinspection DataFlowIssue
plugin.getApcommand().onCommand(e.getPlayer(), null, label, args);
} else if (claiminv) {
} else {
plugin.getClaiminvcommand().onCommand(e.getPlayer(), null, label, args);
}
e.setCancelled(true);

View File

@@ -135,7 +135,7 @@ public class EntityListener implements Listener {
itemname += sourcePl.getInventory().getItemInMainHand().getType().toString().toLowerCase();
}
if (!itemname.equals("")) {
if (!itemname.isEmpty()) {
itemname += ", ";
}
itemname += (Math.round(e.getFinalDamage() * 10) / 10.0) + "HP";

View File

@@ -105,12 +105,12 @@ public class ActivitySolver {
int activity = counter[i];
String hovertext = "" + ChatColor.COLOR_CHAR + "9" + time.format(formatterDateTime) + "\n";
String hovertext = ChatColor.COLOR_CHAR + "9" + time.format(formatterDateTime) + "\n";
if (activity < 0) {
hovertext += "" + ChatColor.COLOR_CHAR + "7Offline";
} else if (activity > 0) {
hovertext += "" + ChatColor.COLOR_CHAR + "7Activity Level " + ChatColor.COLOR_CHAR + "9" + activity;
hovertext += ChatColor.COLOR_CHAR + "7Activity Level " + ChatColor.COLOR_CHAR + "9" + activity;
} else {
hovertext += "" + ChatColor.COLOR_CHAR + "cNo Activity";
}

View File

@@ -100,7 +100,7 @@ public class ChartRenderer extends MapRenderer {
case 2 -> 'M';
default -> ' ';
};
canvas.drawText(1, yPos - 4, MinecraftFont.Font, doubleToString(number) + "" + suffix);
canvas.drawText(1, yPos - 4, MinecraftFont.Font, doubleToString(number) + suffix);
setPixelColor(canvas, xShift - 2, yPos, Color.BLACK);
}
drawXDivs(view, canvas, player);

View File

@@ -65,7 +65,7 @@ public class PlaybackSolver extends BukkitRunnable {
this.protocol = ProtocolLibrary.getProtocolManager();
if (points.size() == 0) {
if (points.isEmpty()) {
throw new LookupException(Language.L.COMMAND__LOOKUP__NORESULTS);
}