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
No known key found for this signature in database

View file

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