Skip to content

Commit

Permalink
Fix /sellnpc
Browse files Browse the repository at this point in the history
  • Loading branch information
TylerS1066 committed Sep 11, 2024
1 parent 88f21b7 commit 010f48a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/main/java/net/apdevteam/apautonpc/APAutoNPC.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/net/apdevteam/apautonpc/SellNPCCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 010f48a

Please sign in to comment.