Examples of requiresPermission()


Examples of com.tommytony.war.utility.Loadout.requiresPermission()

      List<String> sortedNames = LoadoutYmlMapper.sortNames(Loadout.toLegacyFormat(loadouts));
      sortedNames.remove("first");
      for (Iterator<String> it = sortedNames.iterator(); it.hasNext();) {
        String loadoutName = it.next();
        Loadout ldt = Loadout.getLoadout(loadouts, loadoutName);
        if (ldt.requiresPermission() && !player.hasPermission(ldt.getPermission())) {
          it.remove();
        }
      }
      if (sortedNames.isEmpty()) {
        // Fix for zones that mistakenly only specify a `first' loadout, but do not add any others.
View Full Code Here

Examples of com.tommytony.war.utility.Loadout.requiresPermission()

        if (i == currentIndex) {
          if (playerTeam.getTeamConfig().resolveBoolean(TeamConfig.PLAYERLOADOUTASDEFAULT) && name.equals("default")) {
            // Use player's own inventory as loadout
            this.resetInventory(playerTeam, player, this.getPlayerInventoryFromSavedState(player));
          } else if (isFirstRespawn && firstLoadout != null && name.equals("default")
              && (firstLoadout.requiresPermission() ? player.hasPermission(firstLoadout.getPermission()) : true)) {
            // Get the loadout for the first spawn
            this.resetInventory(playerTeam, player, Loadout.getLoadout(loadouts, "first").getContents());
          } else {
            // Use the loadout from the list in the settings
            this.resetInventory(playerTeam, player, Loadout.getLoadout(loadouts, name).getContents());
View Full Code Here

Examples of com.tommytony.war.utility.Loadout.requiresPermission()

          Loadout ldt = team.getInventories().getNewLoadout(loadoutName);
          if (thirdParameter.containsKey("loadout")) {
            String permission = thirdParameter.get("loadout");
            ldt.setPermission(permission);
            returnMessage.append(' ').append(loadoutName).append(" respawn loadout permission set to ").append(permission).append('.');
          } else if (ldt.requiresPermission()) {
            ldt.setPermission(null);
            returnMessage.append(' ').append(loadoutName).append(" respawn loadout permission deleted.");
          }
        }
        if (namedParams.containsKey("deleteloadout")) {
View Full Code Here

Examples of com.tommytony.war.utility.Loadout.requiresPermission()

          Loadout ldt = warzone.getDefaultInventories().getNewLoadout(loadoutName);
          if (thirdParameter.containsKey("loadout")) {
            String permission = thirdParameter.get("loadout");
            ldt.setPermission(permission);
            returnMessage.append(' ').append(loadoutName).append(" respawn loadout permission set to ").append(permission).append('.');
          } else if (ldt.requiresPermission()) {
            ldt.setPermission(null);
            returnMessage.append(' ').append(loadoutName).append(" respawn loadout permission deleted.");
          }
        }
        if (namedParams.containsKey("deleteloadout")) {
View Full Code Here

Examples of com.tommytony.war.utility.Loadout.requiresPermission()

          Loadout ldt = this.getDefaultInventories().getNewLoadout(loadoutName);
          if (thirdParameter.containsKey("loadout")) {
            String permission = thirdParameter.get("loadout");
            ldt.setPermission(permission);
            returnMessage.append(' ').append(loadoutName).append(" respawn loadout permission set to ").append(permission).append('.');
          } else if (ldt.requiresPermission()) {
            ldt.setPermission(null);
            returnMessage.append(' ').append(loadoutName).append(" respawn loadout permission deleted.");
          }
        }
        if (namedParams.containsKey("deleteloadout")) {
View Full Code Here

Examples of com.tommytony.war.utility.Loadout.requiresPermission()

          LoadoutSelection selection = playerWarzone.getLoadoutSelections().get(event.getPlayer().getName());
          List<Loadout> loadouts = new ArrayList<Loadout>(playerTeam.getInventories().resolveNewLoadouts());
          for (Iterator<Loadout> it = loadouts.iterator(); it.hasNext();) {
            Loadout ldt = it.next();
            if (ldt.getName().equals("first") ||
                (ldt.requiresPermission() && !event.getPlayer().hasPermission(ldt.getPermission()))) {
              it.remove();
            }
          }
          int currentIndex = (selection.getSelectedIndex() + 1) % loadouts.size();
          selection.setSelectedIndex(currentIndex);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.