Use isAir() on Material and improve readability

This also fixes spidey not working when inside VOID_AIR, which is presumably unintended behavior.
This commit is contained in:
OptimisticDeving 2025-02-17 05:08:49 +00:00
parent b2d5b9a6cb
commit 865de7f5bb
Signed by: opt
SSH key fingerprint: SHA256:efAXeDMyuFt1iia2xaqlrcHPlsXcjQEWNA2tmvVTqK8

View file

@ -38,10 +38,10 @@ public final class CommandSpidey implements CommandExecutor {
distance
);
Block block;
while (blockIterator.hasNext()
&& (Material.AIR.equals((block = blockIterator.next()).getType())
|| Material.CAVE_AIR.equals(block.getType()))) {
while (blockIterator.hasNext()) {
final Block block = blockIterator.next();
if (!block.getType().isAir()) break;
block.setType(Material.COBWEB);
}
return true;