mirror of
https://github.com/kaboomserver/extras.git
synced 2025-04-22 09:23:40 -04:00
Fix NPE in spidey block iterator material checking
This commit is contained in:
parent
531c27b11d
commit
b2d5b9a6cb
1 changed files with 5 additions and 3 deletions
|
@ -3,6 +3,7 @@ package pw.kaboom.extras.commands;
|
|||
import net.kyori.adventure.text.Component;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandExecutor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
|
@ -37,10 +38,11 @@ public final class CommandSpidey implements CommandExecutor {
|
|||
distance
|
||||
);
|
||||
|
||||
Block block;
|
||||
while (blockIterator.hasNext()
|
||||
&& (Material.AIR.equals(blockIterator.next().getType())
|
||||
|| Material.CAVE_AIR.equals(blockIterator.next().getType()))) {
|
||||
blockIterator.next().setType(Material.COBWEB);
|
||||
&& (Material.AIR.equals((block = blockIterator.next()).getType())
|
||||
|| Material.CAVE_AIR.equals(block.getType()))) {
|
||||
block.setType(Material.COBWEB);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue