Skip to content

Commit

Permalink
fix: Permission Tag (#418)
Browse files Browse the repository at this point in the history
  • Loading branch information
TreemanKing authored and sekwah41 committed Nov 18, 2024
1 parent 967dd71 commit 9ce00a1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,11 @@ public String description() {

@Override
public boolean preActivated(TagTarget target, PlayerContainer player, ActivationData activeData, String[] argData) {
if (target instanceof AdvancedPortal portal) {
var portalName = portal.getName();
if (!player.hasPermission(argData[0])) return false;
}
return false;
if (!player.hasPermission(argData[1])) {
player.sendMessage(Lang.translate("portal.error.nopermission"));
return false;
}
return true;
}

@Override
Expand Down
1 change: 1 addition & 0 deletions lang/src/main/resources/lang/en_GB.lang
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ portal.error.takenname= The name given for the portal is already taken.
portal.error.selection.differentworlds= Both the selected points need to be in the same world.
portal.error.selection.missing= You need to select both points for the portal.
portal.error.save= There was a problem saving the portal.
portal.error.nopermission=You don't have permission to use that portal.

portal.nobuild= You don't have permission to build here!

Expand Down

0 comments on commit 9ce00a1

Please sign in to comment.