diff --git a/core/src/main/java/com/nisovin/magicspells/spells/passive/TicksListener.java b/core/src/main/java/com/nisovin/magicspells/spells/passive/TicksListener.java index 42d219636..e7fa7f184 100644 --- a/core/src/main/java/com/nisovin/magicspells/spells/passive/TicksListener.java +++ b/core/src/main/java/com/nisovin/magicspells/spells/passive/TicksListener.java @@ -45,7 +45,7 @@ public void initialize(@NotNull String var) { int interval = Integer.parseInt(var); ticker = new Ticker(passiveSpell, interval); } catch (NumberFormatException e) { - // ignored + return; } for (World world : Bukkit.getWorlds()) { diff --git a/core/src/main/java/com/nisovin/magicspells/spells/targeted/CarpetSpell.java b/core/src/main/java/com/nisovin/magicspells/spells/targeted/CarpetSpell.java index 1435bac92..362ff7453 100644 --- a/core/src/main/java/com/nisovin/magicspells/spells/targeted/CarpetSpell.java +++ b/core/src/main/java/com/nisovin/magicspells/spells/targeted/CarpetSpell.java @@ -105,22 +105,18 @@ public CastResult castAtLocation(SpellData data) { private CastResult layCarpet(SpellData data) { Location loc = data.location(); - if (!loc.getBlock().getType().isOccluding()) { + if (!loc.getBlock().isSolid()) { int c = 0; - while (!loc.getBlock().getRelative(0, -1, 0).getType().isOccluding() && c <= 2) { + while (!loc.getBlock().getRelative(0, -1, 0).isSolid() && c <= 2) { loc.subtract(0, 1, 0); c++; } - - data = data.location(loc); } else { int c = 0; - while (loc.getBlock().getType().isOccluding() && c <= 2) { + while (loc.getBlock().isSolid() && c <= 2) { loc.add(0, 1, 0); c++; } - - data = data.location(loc); } Block b; @@ -141,10 +137,10 @@ private CastResult layCarpet(SpellData data) { b = loc.getWorld().getBlockAt(x, y, z); if (circle && loc.getBlock().getLocation().distanceSquared(b.getLocation()) > rad * rad) continue; - if (b.getType().isOccluding()) b = b.getRelative(0, 1, 0); - else if (!b.getRelative(0, -1, 0).getType().isOccluding()) b = b.getRelative(0, -1, 0); + if (b.isSolid()) b = b.getRelative(0, 1, 0); + else if (!b.getRelative(0, -1, 0).isSolid()) b = b.getRelative(0, -1, 0); - if (!b.getType().isAir() && !b.getRelative(0, -1, 0).getType().isSolid()) continue; + if (!b.isEmpty() || !b.getRelative(0, -1, 0).isSolid()) continue; blocks.put(b, new CarpetData(data, material, b.getType(), removeOnTouch)); b.setType(material, false);