fix: Permission Tag (#418)

This commit is contained in:
TreemanKing 2024-05-12 22:35:21 +10:00 committed by Sekwah
parent 94522c237f
commit 69fa988f97
2 changed files with 6 additions and 5 deletions

View File

@ -55,11 +55,11 @@ public class PermissionTag implements Tag.Activation{
@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

View File

@ -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!