Tabnine Logo
PlaceholderAPI
Code IndexAdd Tabnine to your IDE (free)

How to use
PlaceholderAPI
in
me.clip.placeholderapi

Best Java code snippets using me.clip.placeholderapi.PlaceholderAPI (Showing top 20 results out of 315)

origin: PlaceholderAPI/PlaceholderAPI

/**
 * set placeholders in the list<String> text provided placeholders are matched with the pattern
 * %(identifier)_(params)>% when set with this method
 *
 * @param p Player to parse the placeholders for
 * @param text text to parse the placeholder values in
 * @return modified list with all placeholders set to the corresponding values
 */
public static List<String> setPlaceholders(OfflinePlayer p, List<String> text) {
 return setPlaceholders(p, text, PLACEHOLDER_PATTERN);
}
origin: PlaceholderAPI/PlaceholderAPI

public boolean hook() {
 return PlaceholderAPI.registerPlaceholderHook(identifier, this);
}
origin: PlaceholderAPI/PlaceholderAPI

public PlaceholderExpansion getRegisteredExpansion(String name) {
 for (Entry<String, PlaceholderHook> hook : PlaceholderAPI.getPlaceholders().entrySet()) {
  if (hook.getValue() instanceof PlaceholderExpansion) {
   if (name.equalsIgnoreCase(hook.getKey())) {
    return (PlaceholderExpansion) hook.getValue();
   }
  }
 }
 return null;
}
origin: games647/ScoreboardStats

  @Override
  public void register() {
    Set<String> variables = Sets.newHashSet();

    Collection<PlaceholderHook> hooks = PlaceholderAPI.getPlaceholders().values();
    for (PlaceholderHook hook : hooks) {
      String variablePrefix = null;
      if (hook instanceof EZPlaceholderHook) {
        variablePrefix = ((EZPlaceholderHook) hook).getPlaceholderName();
      } else if (hook instanceof PlaceholderExpansion) {
        variablePrefix = ((PlaceholderExpansion) hook).getIdentifier();
      }

      if (variablePrefix != null) {
        variables.add(variablePrefix + "_*");
      }
    }

    for (String variable : variables) {
      register(variable).supply(player -> PlaceholderAPI.setPlaceholders(player, '%' + variable + '%'));
    }
  }
}
origin: PlaceholderAPI/PlaceholderAPI

  Msg.broadcast("&r" + PlaceholderAPI.setPlaceholders(pl, parse));
 } else {
  Msg.msg(s, "&r" + PlaceholderAPI.setPlaceholders(pl, parse));
 Msg.msg(s, "&r" + PlaceholderAPI.setRelationalPlaceholders(one, two, parse));
 return true;
} else if (args[0].equalsIgnoreCase("reload")) {
 Set<String> registered = PlaceholderAPI.getRegisteredIdentifiers();
 if (registered.isEmpty()) {
  Msg.msg(s, "&7There are no placeholder hooks currently registered!");
 if (PlaceholderAPI.unregisterExpansion(ex)) {
  Msg.msg(s, "&aSuccessfully unregistered expansion: &f" + ex.getName());
 } else {
origin: ProSavage/SavageFactions

private void updatePrefix(FScoreboard fboard) {
  if (SavageFactions.plugin.getConfig().getBoolean("scoreboard.default-prefixes", false)) {
    FPlayer fplayer = fboard.getFPlayer();
    Team team = teams.get(fboard);
    boolean focused = false;
    if ((SavageFactions.plugin.getConfig().getBoolean("ffocus.Enabled")) && (fplayer.getFaction() != null) && (fplayer.getFaction().getFocused() != null)) {
      for (FPlayer fp : this.faction.getFPlayersWhereOnline(true)) {
        if (fplayer.getFaction().getFocused().equalsIgnoreCase(fp.getName())) {
          team.setPrefix(ChatColor.translateAlternateColorCodes('&', SavageFactions.plugin.getConfig().getString("ffocus.Prefix", "&7ยป&b")));
          focused = true;
        }
      }
    }
    if (!focused) {
      String prefix = TL.DEFAULT_PREFIX.toString();
      prefix = PlaceholderAPI.setPlaceholders(fplayer.getPlayer(), prefix);
      prefix = PlaceholderAPI.setBracketPlaceholders(fplayer.getPlayer(), prefix);
      prefix = prefix.replace("{relationcolor}", this.faction.getRelationTo(fplayer).getColor().toString());
      prefix = prefix.replace("{faction}",
          this.faction.getTag().substring(0, Math.min("{faction}".length() + 16 - prefix.length(), this.faction.getTag().length())));
      if ((team.getPrefix() == null) || (!team.getPrefix().equals(prefix))) {
        team.setPrefix(prefix);
      }
    }
  }
}
origin: PlaceholderAPI/PlaceholderAPI

 message.then(color(placeholders.get(i) + "&b, &f"));
message.tooltip(PlaceholderAPI.setPlaceholders(p, placeholders.get(i)));
PlaceholderAPI.unregisterPlaceholderHook(loaded.getIdentifier());
origin: PlaceholderAPI/PlaceholderAPI

Map<String, PlaceholderHook> hooks = PlaceholderAPI.getPlaceholders();
   if (PlaceholderAPI.unregisterPlaceholderHook(hook.getKey())) {
    plugin.getLogger()
      .info("Unregistered placeholder hook for placeholder: " + h.getPlaceholderName());
   if (PlaceholderAPI.unregisterExpansion(ex)) {
    plugin.getLogger().info("Unregistered placeholder expansion: " + ex.getIdentifier());
origin: PlaceholderAPI/PlaceholderAPI

/**
 * unregister all expansions provided by PlaceholderAPI
 */
public static void unregisterAllProvidedExpansions() {
 if (placeholders.isEmpty()) {
  return;
 }
 getPlaceholders().forEach((key, value) -> {
  if (value instanceof PlaceholderExpansion) {
   PlaceholderExpansion ex = (PlaceholderExpansion) value;
   if (!ex.persist()) {
    unregisterExpansion(ex);
   }
  }
 });
}
origin: CodeCrafter47/BungeeTabListPlus

  public List<String> getRegisteredPlaceholderPlugins() {
    return Lists.newArrayList(PlaceholderAPI.getRegisteredPlaceholderPlugins());
  }
}
origin: PlaceholderAPI/PlaceholderAPI

 @EventHandler
 public void onQuit(PlayerQuitEvent e) {

  Set<PlaceholderExpansion> expansions = PlaceholderAPI.getExpansions();

  if (expansions.isEmpty()) {
   return;
  }

  for (PlaceholderExpansion ex : expansions) {
   if (ex instanceof Cleanable) {
    ((Cleanable) ex).cleanup(e.getPlayer());
   }
  }
 }
}
origin: PlaceholderAPI/PlaceholderAPI

public boolean isHooked() {
 return PlaceholderAPI.getRegisteredPlaceholderPlugins().contains(identifier);
}
origin: PlaceholderAPI/PlaceholderAPI

public int getToUpdateCount() {
  return ((int) PlaceholderAPI.getExpansions()
                .stream()
                .filter(ex -> getCloudExpansion(ex.getName()) != null && getCloudExpansion(ex.getName()).shouldUpdate())
                .count());
}
origin: PlaceholderAPI/PlaceholderAPI

/**
 * set placeholders in the list<String> text provided placeholders are matched with the pattern
 * {<placeholder>} when set with this method
 *
 * @param p Player to parse the placeholders for
 * @param text text to set the placeholder values in
 * @return modified list with all placeholders set to the corresponding values
 */
public static List<String> setBracketPlaceholders(OfflinePlayer p, List<String> text) {
 return setPlaceholders(p, text, BRACKET_PLACEHOLDER_PATTERN);
}
origin: gvlfm78/BukkitOldCombatMechanics

  @Override
  public void init(OCMMain plugin){
    System.out.println("Registering hook...");
    PlaceholderAPI.registerPlaceholderHook("ocm", new PlaceholderHook() {
      @Override
      public String onPlaceholderRequest(Player player, String identifier){
        System.out.println("Hook called for " + player.getName() + " with identifier '" + identifier + "'");
        if(identifier.equals("pvp_mode")){
          return ModuleAttackCooldown.getPVPMode(player).getName();
        }
        return null;
      }
    });
  }
}
origin: PlaceholderAPI/PlaceholderAPI

public static Set<PlaceholderExpansion> getExpansions() {
 Set<PlaceholderExpansion> set = getPlaceholders().values().stream()
   .filter(PlaceholderExpansion.class::isInstance).map(PlaceholderExpansion.class::cast)
   .collect(Collectors.toCollection(HashSet::new));
 return ImmutableSet.copyOf(set);
}
origin: PlaceholderAPI/PlaceholderAPI

/**
 * set placeholders in the text specified placeholders are matched with the pattern
 * {<placeholder>} when set with this method
 *
 * @param player Player to parse the placeholders for
 * @param text text to parse the placeholder values to
 * @return modified text with all placeholders set to the corresponding values
 */
public static String setBracketPlaceholders(OfflinePlayer player, String text) {
 return setPlaceholders(player, text, BRACKET_PLACEHOLDER_PATTERN);
}
origin: PlaceholderAPI/PlaceholderAPI

@Deprecated
public static boolean registerPlaceholderHook(Plugin plugin, PlaceholderHook placeholderHook) {
 return plugin != null && registerPlaceholderHook(plugin.getName(), placeholderHook);
}
origin: PlaceholderAPI/PlaceholderAPI

Map<String, PlaceholderHook> hooks = getPlaceholders();
while (m.find()) {
 String format = m.group(1);
origin: Bkm016/TabooLib

  @Override
  String replace(Player player, String text) {
    return PlaceholderAPI.setPlaceholders(player, text);
  }
}
me.clip.placeholderapiPlaceholderAPI

Most used methods

  • setPlaceholders
  • registerPlaceholderHook
  • getPlaceholders
    Get map of registered placeholders
  • getRegisteredPlaceholderPlugins
  • getExpansions
  • getRegisteredIdentifiers
    Get all registered placeholder identifiers
  • isRegistered
    check if a specific placeholder identifier is currently registered
  • registerExpansion
  • setBracketPlaceholders
  • setRelationalPlaceholders
    set relational placeholders in the text specified placeholders are matched with the pattern %% when
  • unregisterAll
    unregister ALL placeholder hooks that are currently registered
  • unregisterAllProvidedExpansions
    unregister all expansions provided by PlaceholderAPI
  • unregisterAll,
  • unregisterAllProvidedExpansions,
  • unregisterExpansion,
  • unregisterPlaceholderHook

Popular in Java

  • Reading from database using SQL prepared statement
  • notifyDataSetChanged (ArrayAdapter)
  • getExternalFilesDir (Context)
  • setContentView (Activity)
  • FileNotFoundException (java.io)
    Thrown when a file specified by a program cannot be found.
  • ServerSocket (java.net)
    This class represents a server-side socket that waits for incoming client connections. A ServerSocke
  • ResultSet (java.sql)
    An interface for an object which represents a database table entry, returned as the result of the qu
  • SimpleDateFormat (java.text)
    Formats and parses dates in a locale-sensitive manner. Formatting turns a Date into a String, and pa
  • JFileChooser (javax.swing)
  • Location (org.springframework.beans.factory.parsing)
    Class that models an arbitrary location in a Resource.Typically used to track the location of proble
  • Top Vim plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now