Add Settings check before calling WorldEditLink

This commit is contained in:
Julian Krings
2023-11-17 11:40:56 +01:00
committed by BuildTools
parent f257f2c551
commit 2b449a1f3d
@@ -226,17 +226,19 @@ public class WandSVC implements IrisService {
return getCuboidFromItem(p.getInventory().getItemInMainHand()); return getCuboidFromItem(p.getInventory().getItemInMainHand());
} }
if (IrisSettings.get().getWorld().worldEditWandCUI) {
Cuboid c = WorldEditLink.getSelection(p); Cuboid c = WorldEditLink.getSelection(p);
if (c != null) { if (c != null) {
return new Location[]{c.getLowerNE(), c.getUpperSW()}; return new Location[]{c.getLowerNE(), c.getUpperSW()};
} }
}
return null; return null;
} }
public static boolean isHoldingWand(Player p) { public static boolean isHoldingWand(Player p) {
return isHoldingIrisWand(p) || WorldEditLink.getSelection(p) != null; return isHoldingIrisWand(p) || (IrisSettings.get().getWorld().worldEditWandCUI && WorldEditLink.getSelection(p) != null);
} }
public static boolean isHoldingIrisWand(Player p) { public static boolean isHoldingIrisWand(Player p) {