diff --git a/src/main/java/net/apdevteam/apautonpc/APAutoNPC.java b/src/main/java/net/apdevteam/apautonpc/APAutoNPC.java index c086ed3..bac6128 100644 --- a/src/main/java/net/apdevteam/apautonpc/APAutoNPC.java +++ b/src/main/java/net/apdevteam/apautonpc/APAutoNPC.java @@ -71,7 +71,7 @@ public ProtectedRegion isInAirspace(Location loc) { for (ProtectedRegion r : regions.getRegions()) { if (r.getId().toLowerCase().contains("airspace") && r.getFlag(Flags.PVP) == StateFlag.State.DENY - && r.getFlag(Flags.PVP) == StateFlag.State.DENY) { + && r.getFlag(Flags.TNT) == StateFlag.State.DENY) { return r; } } diff --git a/src/main/java/net/apdevteam/apautonpc/SellNPCCommand.java b/src/main/java/net/apdevteam/apautonpc/SellNPCCommand.java index bb65bce..4fdb784 100644 --- a/src/main/java/net/apdevteam/apautonpc/SellNPCCommand.java +++ b/src/main/java/net/apdevteam/apautonpc/SellNPCCommand.java @@ -45,8 +45,8 @@ public boolean onCommand(CommandSender sender, Command cmd, String label, String return true; } - Owner ownedTrait = selected.getTrait(Owner.class); - if (!ownedTrait.getOwner().equalsIgnoreCase(player.getName()) || !ownedTrait.isOwnedBy(player)) { + Owner ownedTrait = selected.getTraitNullable(Owner.class); + if (ownedTrait == null || !ownedTrait.isOwnedBy(player)) { sender.sendMessage(APAutoNPC.PREFIX + "You must own the selected NPC to use that command."); return true; }