How to fix this error?
Type mismatch: cannot convert from element type Object to Block
I see it at this line:
for (Block b : blocksToSkip){
Here is the full code.
@EventHandler(priority=EventPriority.NORMAL, ignoreCancelled=true)
public void onEntityExplode(EntityExplodeEvent ev){
ArrayList blocksToSkip = new ArrayList();
Location rootLoc = ev.getLocation();
if (!SkyMagic.IsInIslandWorld(rootLoc)) return;
for (Block b : ev.blockList()){
Location loc = b.getLocation();
IslandData data = SkyMagic.GetIslandAt(loc);
if ((data != null) && (data.owner != null)){
blocksToSkip.add(b);
}
}
for (Block b : blocksToSkip){
ev.blockList().remove(b);
}
}