mirror of
https://github.com/PlaceholderAPI/PlaceholderAPI
synced 2025-11-10 09:05:05 +01:00
Compare commits
24 Commits
2.11.0
...
feature/mo
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
46f91f5f11 | ||
|
|
9ae44a3954 | ||
|
|
883f1c1edf | ||
|
|
37c39ab734 | ||
|
|
35c47a8745 | ||
|
|
fadf14a316 | ||
|
|
1388a5278f | ||
|
|
bb149811d4 | ||
|
|
350a2be0ed | ||
|
|
b73d72cec7 | ||
|
|
7afb8ee36d | ||
|
|
1241c33ba0 | ||
|
|
fe8d865657 | ||
|
|
50d4e14333 | ||
|
|
666ab468a1 | ||
|
|
cd9074203c | ||
|
|
38d77ff4ca | ||
|
|
3ccbbe9c20 | ||
|
|
358a3bcab3 | ||
|
|
ca088227c3 | ||
|
|
850633e792 | ||
|
|
348b075ac5 | ||
|
|
ce18d3b597 | ||
|
|
9d66d9d9a1 |
12
.github/label-commenter-config.yml
vendored
12
.github/label-commenter-config.yml
vendored
@@ -38,8 +38,9 @@ labels:
|
|||||||
- Currently used Versions of your server and PlaceholderAPI
|
- Currently used Versions of your server and PlaceholderAPI
|
||||||
- Currently installed Expansions
|
- Currently installed Expansions
|
||||||
- Currently installed Plugins
|
- Currently installed Plugins
|
||||||
|
- Any additional information requested by users in this issue.
|
||||||
|
|
||||||
The easiest way to provide those information is through the `/papi dumb` command which posts the required information to https://paste.helpch.at and gives a URL to share.
|
The easiest way to provide those information is through the `/papi dump` command which posts the required information to https://paste.helpch.at and gives a URL to share.
|
||||||
unlabeled:
|
unlabeled:
|
||||||
issue:
|
issue:
|
||||||
body: |-
|
body: |-
|
||||||
@@ -76,6 +77,15 @@ labels:
|
|||||||
|
|
||||||
Don't hesitate to ask us any questions.
|
Don't hesitate to ask us any questions.
|
||||||
action: close
|
action: close
|
||||||
|
- name: 'Type: Invalid (Wiki)'
|
||||||
|
labeled:
|
||||||
|
pr:
|
||||||
|
body: |-
|
||||||
|
Your Wiki Pull request has been marked as **invalid**.
|
||||||
|
|
||||||
|
Pull requests targeting the wiki need to be based of and target the `docs/wiki` branch of this repository.
|
||||||
|
More information can be found on the [Wiki README](https://github.com/PlaceholderAPI/PlaceholderAPI/blob/docs/wiki/wiki/README.md).
|
||||||
|
action: close
|
||||||
- name: 'Target: Wiki'
|
- name: 'Target: Wiki'
|
||||||
labeled:
|
labeled:
|
||||||
issue:
|
issue:
|
||||||
|
|||||||
@@ -28,9 +28,9 @@
|
|||||||
# Information
|
# Information
|
||||||
[PlaceholderAPI][spigot] is a plugin for Spigot servers that allows server owners to display information from various plugins with a uniform format.
|
[PlaceholderAPI][spigot] is a plugin for Spigot servers that allows server owners to display information from various plugins with a uniform format.
|
||||||
|
|
||||||
Support for specific plugins are provided either by the plugin itself or through expansions. The expansions may be downloaded in-game through the PAPI Expansion Cloud. There are currently over 150+ expansions that support a wide variety of plugins, such as Essentials, Factions, LuckPerms, and Vault.
|
Support for specific plugins are provided either by the plugin itself or through expansions. The expansions may be downloaded in-game through the PAPI Expansion Cloud. There are currently over 240+ expansions that support a wide variety of plugins, such as Essentials, Factions, LuckPerms, and Vault.
|
||||||
|
|
||||||
PlaceholderAPI has been downloaded over 750,000 times and has been used concurrently on over 35,000 servers, which makes it a must-have for a server of any type or scale.
|
PlaceholderAPI has been downloaded over 1,000,000 times and has been used concurrently on over 40,000 servers, which makes it a must-have for a server of any type or scale.
|
||||||
|
|
||||||
## Contribute
|
## Contribute
|
||||||
If you would like to contribute towards PlaceholderAPI should you take a look at our [Contributing file][contributing] for the ins and outs on how you can do that and what you need to keep in mind.
|
If you would like to contribute towards PlaceholderAPI should you take a look at our [Contributing file][contributing] for the ins and outs on how you can do that and what you need to keep in mind.
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ plugins {
|
|||||||
}
|
}
|
||||||
|
|
||||||
group "me.clip"
|
group "me.clip"
|
||||||
version "2.11.0"
|
version "2.11.2-DEV-${System.getProperty("BUILD_NUMBER")}"
|
||||||
|
|
||||||
description "An awesome placeholder provider!"
|
description "An awesome placeholder provider!"
|
||||||
|
|
||||||
@@ -32,7 +32,7 @@ dependencies {
|
|||||||
testImplementation "org.openjdk.jmh:jmh-core:1.32"
|
testImplementation "org.openjdk.jmh:jmh-core:1.32"
|
||||||
testImplementation "org.openjdk.jmh:jmh-generator-annprocess:1.32"
|
testImplementation "org.openjdk.jmh:jmh-generator-annprocess:1.32"
|
||||||
|
|
||||||
testImplementation "org.junit.jupiter:junit-jupiter-engine:5.8.1"
|
testImplementation "org.junit.jupiter:junit-jupiter-engine:5.8.2"
|
||||||
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:5.8.1"
|
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:5.8.1"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
* PlaceholderAPI
|
* PlaceholderAPI
|
||||||
* Copyright (c) 2015 - 2021 PlaceholderAPI Team
|
* Copyright (c) 2015 - 2021 PlaceholderAPI Team
|
||||||
*
|
*
|
||||||
* PlaceholderAPI is free software: you can redistribute it and/or modify
|
* PlaceholderAPI free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
* (at your option) any later version.
|
* (at your option) any later version.
|
||||||
@@ -22,6 +22,7 @@ package me.clip.placeholderapi;
|
|||||||
|
|
||||||
import com.google.common.collect.ImmutableSet;
|
import com.google.common.collect.ImmutableSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Locale;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.regex.Matcher;
|
import java.util.regex.Matcher;
|
||||||
@@ -185,7 +186,7 @@ public final class PlaceholderAPI {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
String identifier = format.substring(0, index).toLowerCase();
|
String identifier = format.substring(0, index).toLowerCase(Locale.ROOT);
|
||||||
String params = format.substring(index + 1);
|
String params = format.substring(index + 1);
|
||||||
final PlaceholderExpansion expansion = PlaceholderAPIPlugin.getInstance()
|
final PlaceholderExpansion expansion = PlaceholderAPIPlugin.getInstance()
|
||||||
.getLocalExpansionManager().getExpansion(identifier);
|
.getLocalExpansionManager().getExpansion(identifier);
|
||||||
@@ -292,14 +293,14 @@ public final class PlaceholderAPI {
|
|||||||
// === Deprecated API ===
|
// === Deprecated API ===
|
||||||
|
|
||||||
@Deprecated
|
@Deprecated
|
||||||
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
|
@ApiStatus.ScheduledForRemoval(inVersion = "2.13.0")
|
||||||
public static boolean registerExpansion(PlaceholderExpansion expansion)
|
public static boolean registerExpansion(PlaceholderExpansion expansion)
|
||||||
{
|
{
|
||||||
return expansion.register();
|
return expansion.register();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Deprecated
|
@Deprecated
|
||||||
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
|
@ApiStatus.ScheduledForRemoval(inVersion = "2.13.0")
|
||||||
public static boolean unregisterExpansion(PlaceholderExpansion expansion)
|
public static boolean unregisterExpansion(PlaceholderExpansion expansion)
|
||||||
{
|
{
|
||||||
return expansion.unregister();
|
return expansion.unregister();
|
||||||
@@ -313,7 +314,7 @@ public final class PlaceholderAPI {
|
|||||||
* @return Map of registered placeholders
|
* @return Map of registered placeholders
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
|
@ApiStatus.ScheduledForRemoval(inVersion = "2.13.0")
|
||||||
public static Map<String, PlaceholderHook> getPlaceholders() {
|
public static Map<String, PlaceholderHook> getPlaceholders() {
|
||||||
return PlaceholderAPIPlugin.getInstance().getLocalExpansionManager()
|
return PlaceholderAPIPlugin.getInstance().getLocalExpansionManager()
|
||||||
.getExpansions().stream()
|
.getExpansions().stream()
|
||||||
@@ -329,7 +330,7 @@ public final class PlaceholderAPI {
|
|||||||
* @return always false
|
* @return always false
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
|
@ApiStatus.ScheduledForRemoval(inVersion = "2.13.0")
|
||||||
public static boolean registerPlaceholderHook(Plugin plugin, PlaceholderHook placeholderHook) {
|
public static boolean registerPlaceholderHook(Plugin plugin, PlaceholderHook placeholderHook) {
|
||||||
PlaceholderAPIPlugin.getInstance().getLogger().warning(plugin.getName()
|
PlaceholderAPIPlugin.getInstance().getLogger().warning(plugin.getName()
|
||||||
+ " is attempting to register placeholders via a PlaceholderHook class which is no longer supported!"
|
+ " is attempting to register placeholders via a PlaceholderHook class which is no longer supported!"
|
||||||
@@ -347,7 +348,7 @@ public final class PlaceholderAPI {
|
|||||||
* @return always false
|
* @return always false
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
|
@ApiStatus.ScheduledForRemoval(inVersion = "2.13.0")
|
||||||
public static boolean registerPlaceholderHook(String identifier,
|
public static boolean registerPlaceholderHook(String identifier,
|
||||||
PlaceholderHook placeholderHook) {
|
PlaceholderHook placeholderHook) {
|
||||||
PlaceholderAPIPlugin.getInstance().getLogger().warning(identifier
|
PlaceholderAPIPlugin.getInstance().getLogger().warning(identifier
|
||||||
@@ -363,7 +364,7 @@ public final class PlaceholderAPI {
|
|||||||
* @return always false
|
* @return always false
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
|
@ApiStatus.ScheduledForRemoval(inVersion = "2.13.0")
|
||||||
public static boolean unregisterPlaceholderHook(Plugin plugin) {
|
public static boolean unregisterPlaceholderHook(Plugin plugin) {
|
||||||
PlaceholderAPIPlugin.getInstance().getLogger().warning(plugin.getName()
|
PlaceholderAPIPlugin.getInstance().getLogger().warning(plugin.getName()
|
||||||
+ " is attempting to unregister placeholders via the PlaceholderAPI class which is no longer supported!"
|
+ " is attempting to unregister placeholders via the PlaceholderAPI class which is no longer supported!"
|
||||||
@@ -380,7 +381,7 @@ public final class PlaceholderAPI {
|
|||||||
* @return always false
|
* @return always false
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
|
@ApiStatus.ScheduledForRemoval(inVersion = "2.13.0")
|
||||||
public static boolean unregisterPlaceholderHook(String identifier) {
|
public static boolean unregisterPlaceholderHook(String identifier) {
|
||||||
PlaceholderAPIPlugin.getInstance().getLogger().warning(identifier
|
PlaceholderAPIPlugin.getInstance().getLogger().warning(identifier
|
||||||
+ " is attempting to unregister placeholders through the PlaceholderAPI class which is no longer supported!");
|
+ " is attempting to unregister placeholders through the PlaceholderAPI class which is no longer supported!");
|
||||||
@@ -393,7 +394,7 @@ public final class PlaceholderAPI {
|
|||||||
* @return Set of registered identifiers
|
* @return Set of registered identifiers
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
|
@ApiStatus.ScheduledForRemoval(inVersion = "2.13.0")
|
||||||
public static Set<String> getRegisteredPlaceholderPlugins() {
|
public static Set<String> getRegisteredPlaceholderPlugins() {
|
||||||
return getRegisteredIdentifiers();
|
return getRegisteredIdentifiers();
|
||||||
}
|
}
|
||||||
@@ -404,7 +405,7 @@ public final class PlaceholderAPI {
|
|||||||
* @return always null
|
* @return always null
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
|
@ApiStatus.ScheduledForRemoval(inVersion = "2.13.0")
|
||||||
public static Set<String> getExternalPlaceholderPlugins() {
|
public static Set<String> getExternalPlaceholderPlugins() {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@@ -419,7 +420,7 @@ public final class PlaceholderAPI {
|
|||||||
* @return String with the parsed placeholders
|
* @return String with the parsed placeholders
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
|
@ApiStatus.ScheduledForRemoval(inVersion = "2.13.0")
|
||||||
public static String setPlaceholders(OfflinePlayer player,
|
public static String setPlaceholders(OfflinePlayer player,
|
||||||
String text, Pattern pattern, boolean colorize) {
|
String text, Pattern pattern, boolean colorize) {
|
||||||
return setPlaceholders(player, text);
|
return setPlaceholders(player, text);
|
||||||
@@ -435,7 +436,7 @@ public final class PlaceholderAPI {
|
|||||||
* @return String with the parsed placeholders
|
* @return String with the parsed placeholders
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
|
@ApiStatus.ScheduledForRemoval(inVersion = "2.13.0")
|
||||||
public static List<String> setPlaceholders(OfflinePlayer player,
|
public static List<String> setPlaceholders(OfflinePlayer player,
|
||||||
List<String> text, Pattern pattern, boolean colorize) {
|
List<String> text, Pattern pattern, boolean colorize) {
|
||||||
return setPlaceholders(player, text);
|
return setPlaceholders(player, text);
|
||||||
@@ -450,7 +451,7 @@ public final class PlaceholderAPI {
|
|||||||
* @return String with the parsed placeholders
|
* @return String with the parsed placeholders
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
|
@ApiStatus.ScheduledForRemoval(inVersion = "2.13.0")
|
||||||
public static List<String> setPlaceholders(OfflinePlayer player, List<String> text,
|
public static List<String> setPlaceholders(OfflinePlayer player, List<String> text,
|
||||||
boolean colorize) {
|
boolean colorize) {
|
||||||
return setPlaceholders(player, text);
|
return setPlaceholders(player, text);
|
||||||
@@ -465,7 +466,7 @@ public final class PlaceholderAPI {
|
|||||||
* @return String with the parsed placeholders
|
* @return String with the parsed placeholders
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
|
@ApiStatus.ScheduledForRemoval(inVersion = "2.13.0")
|
||||||
public static List<String> setPlaceholders(OfflinePlayer player, List<String> text,
|
public static List<String> setPlaceholders(OfflinePlayer player, List<String> text,
|
||||||
Pattern pattern) {
|
Pattern pattern) {
|
||||||
return setPlaceholders(player, text);
|
return setPlaceholders(player, text);
|
||||||
@@ -479,7 +480,7 @@ public final class PlaceholderAPI {
|
|||||||
* @return String with the parsed placeholders
|
* @return String with the parsed placeholders
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
|
@ApiStatus.ScheduledForRemoval(inVersion = "2.13.0")
|
||||||
public static String setPlaceholders(Player player, String text, boolean colorize) {
|
public static String setPlaceholders(Player player, String text, boolean colorize) {
|
||||||
return setPlaceholders(player, text);
|
return setPlaceholders(player, text);
|
||||||
}
|
}
|
||||||
@@ -493,7 +494,7 @@ public final class PlaceholderAPI {
|
|||||||
* @return String with the parsed placeholders
|
* @return String with the parsed placeholders
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
|
@ApiStatus.ScheduledForRemoval(inVersion = "2.13.0")
|
||||||
public static List<String> setPlaceholders(Player player, List<String> text, boolean colorize) {
|
public static List<String> setPlaceholders(Player player, List<String> text, boolean colorize) {
|
||||||
return setPlaceholders(player, text);
|
return setPlaceholders(player, text);
|
||||||
}
|
}
|
||||||
@@ -507,7 +508,7 @@ public final class PlaceholderAPI {
|
|||||||
* @return String with the parsed placeholders
|
* @return String with the parsed placeholders
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
|
@ApiStatus.ScheduledForRemoval(inVersion = "2.13.0")
|
||||||
public static String setPlaceholders(OfflinePlayer player, String text, boolean colorize) {
|
public static String setPlaceholders(OfflinePlayer player, String text, boolean colorize) {
|
||||||
return setPlaceholders(player, text);
|
return setPlaceholders(player, text);
|
||||||
}
|
}
|
||||||
@@ -521,7 +522,7 @@ public final class PlaceholderAPI {
|
|||||||
* @return String with the parsed placeholders
|
* @return String with the parsed placeholders
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
|
@ApiStatus.ScheduledForRemoval(inVersion = "2.13.0")
|
||||||
public static String setPlaceholders(OfflinePlayer player, String text, Pattern pattern) {
|
public static String setPlaceholders(OfflinePlayer player, String text, Pattern pattern) {
|
||||||
return setPlaceholders(player, text);
|
return setPlaceholders(player, text);
|
||||||
}
|
}
|
||||||
@@ -535,7 +536,7 @@ public final class PlaceholderAPI {
|
|||||||
* @return String with the parsed placeholders
|
* @return String with the parsed placeholders
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
|
@ApiStatus.ScheduledForRemoval(inVersion = "2.13.0")
|
||||||
public static List<String> setBracketPlaceholders(OfflinePlayer player, List<String> text,
|
public static List<String> setBracketPlaceholders(OfflinePlayer player, List<String> text,
|
||||||
boolean colorize) {
|
boolean colorize) {
|
||||||
return setBracketPlaceholders(player, text);
|
return setBracketPlaceholders(player, text);
|
||||||
@@ -550,7 +551,7 @@ public final class PlaceholderAPI {
|
|||||||
* @return String with the parsed placeholders
|
* @return String with the parsed placeholders
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
|
@ApiStatus.ScheduledForRemoval(inVersion = "2.13.0")
|
||||||
public static String setBracketPlaceholders(OfflinePlayer player, String text, boolean colorize) {
|
public static String setBracketPlaceholders(OfflinePlayer player, String text, boolean colorize) {
|
||||||
return setBracketPlaceholders(player, text);
|
return setBracketPlaceholders(player, text);
|
||||||
}
|
}
|
||||||
@@ -564,7 +565,7 @@ public final class PlaceholderAPI {
|
|||||||
* @return String with the parsed placeholders
|
* @return String with the parsed placeholders
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
|
@ApiStatus.ScheduledForRemoval(inVersion = "2.13.0")
|
||||||
public static String setBracketPlaceholders(Player player, String text, boolean colorize) {
|
public static String setBracketPlaceholders(Player player, String text, boolean colorize) {
|
||||||
return setBracketPlaceholders(player, text);
|
return setBracketPlaceholders(player, text);
|
||||||
}
|
}
|
||||||
@@ -578,7 +579,7 @@ public final class PlaceholderAPI {
|
|||||||
* @return String with the parsed placeholders
|
* @return String with the parsed placeholders
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
|
@ApiStatus.ScheduledForRemoval(inVersion = "2.13.0")
|
||||||
public static List<String> setBracketPlaceholders(Player player, List<String> text,
|
public static List<String> setBracketPlaceholders(Player player, List<String> text,
|
||||||
boolean colorize) {
|
boolean colorize) {
|
||||||
return setBracketPlaceholders(player, text);
|
return setBracketPlaceholders(player, text);
|
||||||
@@ -596,7 +597,7 @@ public final class PlaceholderAPI {
|
|||||||
* @deprecated Use {@link #setPlaceholders(OfflinePlayer, String)} instead.
|
* @deprecated Use {@link #setPlaceholders(OfflinePlayer, String)} instead.
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
|
@ApiStatus.ScheduledForRemoval(inVersion = "2.13.0")
|
||||||
public static String setRelationalPlaceholders(Player one, Player two, String text,
|
public static String setRelationalPlaceholders(Player one, Player two, String text,
|
||||||
boolean colorize) {
|
boolean colorize) {
|
||||||
return setRelationalPlaceholders(one, two, text);
|
return setRelationalPlaceholders(one, two, text);
|
||||||
@@ -614,7 +615,7 @@ public final class PlaceholderAPI {
|
|||||||
* @deprecated Use {@link #setRelationalPlaceholders(Player, Player, List)} instead.
|
* @deprecated Use {@link #setRelationalPlaceholders(Player, Player, List)} instead.
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
|
@ApiStatus.ScheduledForRemoval(inVersion = "2.13.0")
|
||||||
public static List<String> setRelationalPlaceholders(Player one, Player two, List<String> text,
|
public static List<String> setRelationalPlaceholders(Player one, Player two, List<String> text,
|
||||||
boolean colorize) {
|
boolean colorize) {
|
||||||
return setRelationalPlaceholders(one, two, text);
|
return setRelationalPlaceholders(one, two, text);
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
* PlaceholderAPI
|
* PlaceholderAPI
|
||||||
* Copyright (c) 2015 - 2021 PlaceholderAPI Team
|
* Copyright (c) 2015 - 2021 PlaceholderAPI Team
|
||||||
*
|
*
|
||||||
* PlaceholderAPI is free software: you can redistribute it and/or modify
|
* PlaceholderAPI free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
* (at your option) any later version.
|
* (at your option) any later version.
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
* PlaceholderAPI
|
* PlaceholderAPI
|
||||||
* Copyright (c) 2015 - 2021 PlaceholderAPI Team
|
* Copyright (c) 2015 - 2021 PlaceholderAPI Team
|
||||||
*
|
*
|
||||||
* PlaceholderAPI is free software: you can redistribute it and/or modify
|
* PlaceholderAPI free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
* (at your option) any later version.
|
* (at your option) any later version.
|
||||||
@@ -25,8 +25,22 @@ import org.bukkit.entity.Player;
|
|||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
|
||||||
|
@Deprecated
|
||||||
public abstract class PlaceholderHook {
|
public abstract class PlaceholderHook {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Please see {@link me.clip.placeholderapi.expansion.PlaceholderExpansion#parsePlaceholders(OfflinePlayer, String) PlaceholderExpansion#parsePlaceholder(OfflinePlayer, String)}
|
||||||
|
* for a full description of what this method is used for.
|
||||||
|
*
|
||||||
|
* @param player Possibly-null OfflinePlayer instance to use.
|
||||||
|
* @param params String after {@code %<expansion>_} and before the second percent symbol.
|
||||||
|
* @return Possibly-null String depending on the Expansions returned value.
|
||||||
|
* @deprecated Planned for removal in 2.14.0
|
||||||
|
* <br>Please use {@link me.clip.placeholderapi.expansion.PlaceholderExpansion#parsePlaceholders(OfflinePlayer, String) parsePlaceholders(OfflinePlayer, String)}
|
||||||
|
* instead
|
||||||
|
*/
|
||||||
@Nullable
|
@Nullable
|
||||||
|
@Deprecated
|
||||||
public String onRequest(final OfflinePlayer player, @NotNull final String params) {
|
public String onRequest(final OfflinePlayer player, @NotNull final String params) {
|
||||||
if (player != null && player.isOnline()) {
|
if (player != null && player.isOnline()) {
|
||||||
return onPlaceholderRequest((Player) player, params);
|
return onPlaceholderRequest((Player) player, params);
|
||||||
@@ -35,7 +49,20 @@ public abstract class PlaceholderHook {
|
|||||||
return onPlaceholderRequest(null, params);
|
return onPlaceholderRequest(null, params);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Please see {@link me.clip.placeholderapi.expansion.PlaceholderExpansion#parsePlaceholders(Player, String) PlaceholderExpansion#parsePlaceholder(Player, String)}
|
||||||
|
* for a full description of what this method is used for.
|
||||||
|
*
|
||||||
|
* @param player Possibly-null Player instance to use.
|
||||||
|
* @param params String after {@code %<expansion>_} and before the second percent symbol.
|
||||||
|
* @return Possibly-null String depending on the Expansions returned value.
|
||||||
|
*
|
||||||
|
* @deprecated Planned for removal in 2.14.0
|
||||||
|
* <br>Please use {@link me.clip.placeholderapi.expansion.PlaceholderExpansion#parsePlaceholders(Player, String) parsePlaceholders(Player, String)}
|
||||||
|
* instead
|
||||||
|
*/
|
||||||
@Nullable
|
@Nullable
|
||||||
|
@Deprecated
|
||||||
public String onPlaceholderRequest(final Player player, @NotNull final String params) {
|
public String onPlaceholderRequest(final Player player, @NotNull final String params) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
* PlaceholderAPI
|
* PlaceholderAPI
|
||||||
* Copyright (c) 2015 - 2021 PlaceholderAPI Team
|
* Copyright (c) 2015 - 2021 PlaceholderAPI Team
|
||||||
*
|
*
|
||||||
* PlaceholderAPI is free software: you can redistribute it and/or modify
|
* PlaceholderAPI free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
* (at your option) any later version.
|
* (at your option) any later version.
|
||||||
@@ -23,6 +23,7 @@ package me.clip.placeholderapi.commands;
|
|||||||
import com.google.common.collect.ImmutableSet;
|
import com.google.common.collect.ImmutableSet;
|
||||||
import com.google.common.collect.Sets;
|
import com.google.common.collect.Sets;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Locale;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.stream.Stream;
|
import java.util.stream.Stream;
|
||||||
import me.clip.placeholderapi.PlaceholderAPIPlugin;
|
import me.clip.placeholderapi.PlaceholderAPIPlugin;
|
||||||
@@ -61,7 +62,7 @@ public abstract class PlaceholderCommand {
|
|||||||
if (parameter == null) {
|
if (parameter == null) {
|
||||||
possible.forEach(suggestions::add);
|
possible.forEach(suggestions::add);
|
||||||
} else {
|
} else {
|
||||||
possible.filter(suggestion -> suggestion.toLowerCase().startsWith(parameter.toLowerCase()))
|
possible.filter(suggestion -> suggestion.toLowerCase(Locale.ROOT).startsWith(parameter.toLowerCase(Locale.ROOT)))
|
||||||
.forEach(suggestions::add);
|
.forEach(suggestions::add);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
* PlaceholderAPI
|
* PlaceholderAPI
|
||||||
* Copyright (c) 2015 - 2021 PlaceholderAPI Team
|
* Copyright (c) 2015 - 2021 PlaceholderAPI Team
|
||||||
*
|
*
|
||||||
* PlaceholderAPI is free software: you can redistribute it and/or modify
|
* PlaceholderAPI free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
* (at your option) any later version.
|
* (at your option) any later version.
|
||||||
@@ -27,6 +27,7 @@ import java.util.Arrays;
|
|||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Locale;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.stream.Stream;
|
import java.util.stream.Stream;
|
||||||
import me.clip.placeholderapi.PlaceholderAPIPlugin;
|
import me.clip.placeholderapi.PlaceholderAPIPlugin;
|
||||||
@@ -95,7 +96,7 @@ public final class PlaceholderCommandRouter implements CommandExecutor, TabCompl
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
final String search = args[0].toLowerCase();
|
final String search = args[0].toLowerCase(Locale.ROOT);
|
||||||
final PlaceholderCommand target = commands.get(search);
|
final PlaceholderCommand target = commands.get(search);
|
||||||
|
|
||||||
if (target == null) {
|
if (target == null) {
|
||||||
@@ -121,10 +122,10 @@ public final class PlaceholderCommandRouter implements CommandExecutor, TabCompl
|
|||||||
final List<String> suggestions = new ArrayList<>();
|
final List<String> suggestions = new ArrayList<>();
|
||||||
|
|
||||||
if (args.length > 1) {
|
if (args.length > 1) {
|
||||||
final PlaceholderCommand target = this.commands.get(args[0].toLowerCase());
|
final PlaceholderCommand target = this.commands.get(args[0].toLowerCase(Locale.ROOT));
|
||||||
|
|
||||||
if (target != null) {
|
if (target != null) {
|
||||||
target.complete(plugin, sender, args[0].toLowerCase(),
|
target.complete(plugin, sender, args[0].toLowerCase(Locale.ROOT),
|
||||||
Arrays.asList(Arrays.copyOfRange(args, 1, args.length)), suggestions);
|
Arrays.asList(Arrays.copyOfRange(args, 1, args.length)), suggestions);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
* PlaceholderAPI
|
* PlaceholderAPI
|
||||||
* Copyright (c) 2015 - 2021 PlaceholderAPI Team
|
* Copyright (c) 2015 - 2021 PlaceholderAPI Team
|
||||||
*
|
*
|
||||||
* PlaceholderAPI is free software: you can redistribute it and/or modify
|
* PlaceholderAPI free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
* (at your option) any later version.
|
* (at your option) any later version.
|
||||||
@@ -24,6 +24,7 @@ import com.google.common.collect.ImmutableList;
|
|||||||
import com.google.common.collect.ImmutableMap;
|
import com.google.common.collect.ImmutableMap;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Locale;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.stream.Stream;
|
import java.util.stream.Stream;
|
||||||
import me.clip.placeholderapi.PlaceholderAPIPlugin;
|
import me.clip.placeholderapi.PlaceholderAPIPlugin;
|
||||||
@@ -100,7 +101,7 @@ public final class CommandECloud extends PlaceholderCommand {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
final String search = params.get(0).toLowerCase();
|
final String search = params.get(0).toLowerCase(Locale.ROOT);
|
||||||
final PlaceholderCommand target = commands.get(search);
|
final PlaceholderCommand target = commands.get(search);
|
||||||
|
|
||||||
if (target == null) {
|
if (target == null) {
|
||||||
@@ -136,7 +137,7 @@ public final class CommandECloud extends PlaceholderCommand {
|
|||||||
return; // send sub commands
|
return; // send sub commands
|
||||||
}
|
}
|
||||||
|
|
||||||
final String search = params.get(0).toLowerCase();
|
final String search = params.get(0).toLowerCase(Locale.ROOT);
|
||||||
final PlaceholderCommand target = commands.get(search);
|
final PlaceholderCommand target = commands.get(search);
|
||||||
|
|
||||||
if (target == null) {
|
if (target == null) {
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
* PlaceholderAPI
|
* PlaceholderAPI
|
||||||
* Copyright (c) 2015 - 2021 PlaceholderAPI Team
|
* Copyright (c) 2015 - 2021 PlaceholderAPI Team
|
||||||
*
|
*
|
||||||
* PlaceholderAPI is free software: you can redistribute it and/or modify
|
* PlaceholderAPI free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
* (at your option) any later version.
|
* (at your option) any later version.
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
* PlaceholderAPI
|
* PlaceholderAPI
|
||||||
* Copyright (c) 2015 - 2021 PlaceholderAPI Team
|
* Copyright (c) 2015 - 2021 PlaceholderAPI Team
|
||||||
*
|
*
|
||||||
* PlaceholderAPI is free software: you can redistribute it and/or modify
|
* PlaceholderAPI free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
* (at your option) any later version.
|
* (at your option) any later version.
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
* PlaceholderAPI
|
* PlaceholderAPI
|
||||||
* Copyright (c) 2015 - 2021 PlaceholderAPI Team
|
* Copyright (c) 2015 - 2021 PlaceholderAPI Team
|
||||||
*
|
*
|
||||||
* PlaceholderAPI is free software: you can redistribute it and/or modify
|
* PlaceholderAPI free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
* (at your option) any later version.
|
* (at your option) any later version.
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
* PlaceholderAPI
|
* PlaceholderAPI
|
||||||
* Copyright (c) 2015 - 2021 PlaceholderAPI Team
|
* Copyright (c) 2015 - 2021 PlaceholderAPI Team
|
||||||
*
|
*
|
||||||
* PlaceholderAPI is free software: you can redistribute it and/or modify
|
* PlaceholderAPI free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
* (at your option) any later version.
|
* (at your option) any later version.
|
||||||
@@ -87,7 +87,7 @@ public final class CommandECloudExpansionList extends PlaceholderCommand {
|
|||||||
@NotNull
|
@NotNull
|
||||||
private static Collection<CloudExpansion> getExpansions(@NotNull final String target,
|
private static Collection<CloudExpansion> getExpansions(@NotNull final String target,
|
||||||
@NotNull final PlaceholderAPIPlugin plugin) {
|
@NotNull final PlaceholderAPIPlugin plugin) {
|
||||||
switch (target.toLowerCase()) {
|
switch (target.toLowerCase(Locale.ROOT)) {
|
||||||
case "all":
|
case "all":
|
||||||
return plugin.getCloudExpansionManager().getCloudExpansions().values();
|
return plugin.getCloudExpansionManager().getCloudExpansions().values();
|
||||||
case "installed":
|
case "installed":
|
||||||
@@ -112,7 +112,7 @@ public final class CommandECloudExpansionList extends PlaceholderCommand {
|
|||||||
|
|
||||||
public static void addExpansionTitle(@NotNull final StringBuilder builder,
|
public static void addExpansionTitle(@NotNull final StringBuilder builder,
|
||||||
@NotNull final String target, final int page) {
|
@NotNull final String target, final int page) {
|
||||||
switch (target.toLowerCase()) {
|
switch (target.toLowerCase(Locale.ROOT)) {
|
||||||
case "all":
|
case "all":
|
||||||
builder.append("&bAll Expansions");
|
builder.append("&bAll Expansions");
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
* PlaceholderAPI
|
* PlaceholderAPI
|
||||||
* Copyright (c) 2015 - 2021 PlaceholderAPI Team
|
* Copyright (c) 2015 - 2021 PlaceholderAPI Team
|
||||||
*
|
*
|
||||||
* PlaceholderAPI is free software: you can redistribute it and/or modify
|
* PlaceholderAPI free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
* (at your option) any later version.
|
* (at your option) any later version.
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
* PlaceholderAPI
|
* PlaceholderAPI
|
||||||
* Copyright (c) 2015 - 2021 PlaceholderAPI Team
|
* Copyright (c) 2015 - 2021 PlaceholderAPI Team
|
||||||
*
|
*
|
||||||
* PlaceholderAPI is free software: you can redistribute it and/or modify
|
* PlaceholderAPI free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
* (at your option) any later version.
|
* (at your option) any later version.
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
* PlaceholderAPI
|
* PlaceholderAPI
|
||||||
* Copyright (c) 2015 - 2021 PlaceholderAPI Team
|
* Copyright (c) 2015 - 2021 PlaceholderAPI Team
|
||||||
*
|
*
|
||||||
* PlaceholderAPI is free software: you can redistribute it and/or modify
|
* PlaceholderAPI free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
* (at your option) any later version.
|
* (at your option) any later version.
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
* PlaceholderAPI
|
* PlaceholderAPI
|
||||||
* Copyright (c) 2015 - 2021 PlaceholderAPI Team
|
* Copyright (c) 2015 - 2021 PlaceholderAPI Team
|
||||||
*
|
*
|
||||||
* PlaceholderAPI is free software: you can redistribute it and/or modify
|
* PlaceholderAPI free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
* (at your option) any later version.
|
* (at your option) any later version.
|
||||||
@@ -21,6 +21,8 @@
|
|||||||
package me.clip.placeholderapi.commands.impl.cloud;
|
package me.clip.placeholderapi.commands.impl.cloud;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Locale;
|
||||||
|
|
||||||
import me.clip.placeholderapi.PlaceholderAPIPlugin;
|
import me.clip.placeholderapi.PlaceholderAPIPlugin;
|
||||||
import me.clip.placeholderapi.commands.PlaceholderCommand;
|
import me.clip.placeholderapi.commands.PlaceholderCommand;
|
||||||
import me.clip.placeholderapi.util.Msg;
|
import me.clip.placeholderapi.util.Msg;
|
||||||
@@ -41,7 +43,7 @@ public final class CommandECloudToggle extends PlaceholderCommand {
|
|||||||
final boolean desiredState;
|
final boolean desiredState;
|
||||||
final boolean currentState = plugin.getPlaceholderAPIConfig().isCloudEnabled();
|
final boolean currentState = plugin.getPlaceholderAPIConfig().isCloudEnabled();
|
||||||
|
|
||||||
switch (alias.toLowerCase()) {
|
switch (alias.toLowerCase(Locale.ROOT)) {
|
||||||
case "enable":
|
case "enable":
|
||||||
desiredState = true;
|
desiredState = true;
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
* PlaceholderAPI
|
* PlaceholderAPI
|
||||||
* Copyright (c) 2015 - 2021 PlaceholderAPI Team
|
* Copyright (c) 2015 - 2021 PlaceholderAPI Team
|
||||||
*
|
*
|
||||||
* PlaceholderAPI is free software: you can redistribute it and/or modify
|
* PlaceholderAPI free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
* (at your option) any later version.
|
* (at your option) any later version.
|
||||||
@@ -23,6 +23,7 @@ package me.clip.placeholderapi.commands.impl.cloud;
|
|||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Locale;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
import java.util.concurrent.CompletableFuture;
|
import java.util.concurrent.CompletableFuture;
|
||||||
@@ -128,7 +129,7 @@ public final class CommandECloudUpdate extends PlaceholderCommand {
|
|||||||
installed.removeIf(expansion -> !expansion.shouldUpdate());
|
installed.removeIf(expansion -> !expansion.shouldUpdate());
|
||||||
|
|
||||||
if (!installed.isEmpty() && (params.isEmpty() || "all"
|
if (!installed.isEmpty() && (params.isEmpty() || "all"
|
||||||
.startsWith(params.get(0).toLowerCase()))) {
|
.startsWith(params.get(0).toLowerCase(Locale.ROOT)))) {
|
||||||
suggestions.add("all");
|
suggestions.add("all");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
* PlaceholderAPI
|
* PlaceholderAPI
|
||||||
* Copyright (c) 2015 - 2021 PlaceholderAPI Team
|
* Copyright (c) 2015 - 2021 PlaceholderAPI Team
|
||||||
*
|
*
|
||||||
* PlaceholderAPI is free software: you can redistribute it and/or modify
|
* PlaceholderAPI free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
* (at your option) any later version.
|
* (at your option) any later version.
|
||||||
@@ -165,7 +165,7 @@ public final class CommandDump extends PlaceholderCommand {
|
|||||||
|
|
||||||
final String[] jars = plugin.getLocalExpansionManager()
|
final String[] jars = plugin.getLocalExpansionManager()
|
||||||
.getExpansionsFolder()
|
.getExpansionsFolder()
|
||||||
.list((dir, name) -> name.toLowerCase().endsWith(".jar"));
|
.list((dir, name) -> name.toLowerCase(Locale.ROOT).endsWith(".jar"));
|
||||||
|
|
||||||
for (final String jar : jars) {
|
for (final String jar : jars) {
|
||||||
builder.append(" ")
|
builder.append(" ")
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
* PlaceholderAPI
|
* PlaceholderAPI
|
||||||
* Copyright (c) 2015 - 2021 PlaceholderAPI Team
|
* Copyright (c) 2015 - 2021 PlaceholderAPI Team
|
||||||
*
|
*
|
||||||
* PlaceholderAPI is free software: you can redistribute it and/or modify
|
* PlaceholderAPI free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
* (at your option) any later version.
|
* (at your option) any later version.
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
* PlaceholderAPI
|
* PlaceholderAPI
|
||||||
* Copyright (c) 2015 - 2021 PlaceholderAPI Team
|
* Copyright (c) 2015 - 2021 PlaceholderAPI Team
|
||||||
*
|
*
|
||||||
* PlaceholderAPI is free software: you can redistribute it and/or modify
|
* PlaceholderAPI free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
* (at your option) any later version.
|
* (at your option) any later version.
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
* PlaceholderAPI
|
* PlaceholderAPI
|
||||||
* Copyright (c) 2015 - 2021 PlaceholderAPI Team
|
* Copyright (c) 2015 - 2021 PlaceholderAPI Team
|
||||||
*
|
*
|
||||||
* PlaceholderAPI is free software: you can redistribute it and/or modify
|
* PlaceholderAPI free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
* (at your option) any later version.
|
* (at your option) any later version.
|
||||||
@@ -45,9 +45,9 @@ public final class CommandHelp extends PlaceholderCommand {
|
|||||||
Msg.msg(sender,
|
Msg.msg(sender,
|
||||||
"&b&lPlaceholderAPI &8- &7Help Menu &8- &7(&f" + description.getVersion() + "&7)",
|
"&b&lPlaceholderAPI &8- &7Help Menu &8- &7(&f" + description.getVersion() + "&7)",
|
||||||
" ",
|
" ",
|
||||||
"&b/papi &fbcparse &9<me/player name> <message>",
|
"&b/papi &fbcparse &9<me|--null|player name> <message>",
|
||||||
" &7&oParse a message with placeholders and broadcast it",
|
" &7&oParse a message with placeholders and broadcast it",
|
||||||
"&b/papi &fcmdparse &9<me/player> <command with placeholders>",
|
"&b/papi &fcmdparse &9<me|player> <command with placeholders>",
|
||||||
" &7&oParse a message with relational placeholders",
|
" &7&oParse a message with relational placeholders",
|
||||||
"&b/papi &fdump",
|
"&b/papi &fdump",
|
||||||
" &7&oDump all relevant information needed to help debug issues into a paste link.",
|
" &7&oDump all relevant information needed to help debug issues into a paste link.",
|
||||||
@@ -55,7 +55,7 @@ public final class CommandHelp extends PlaceholderCommand {
|
|||||||
" &7&oView information for a specific expansion",
|
" &7&oView information for a specific expansion",
|
||||||
"&b/papi &flist",
|
"&b/papi &flist",
|
||||||
" &7&oList active expansions",
|
" &7&oList active expansions",
|
||||||
"&b/papi &fparse &9<me/player name> <message>",
|
"&b/papi &fparse &9<me|--null|player name> <message>",
|
||||||
" &7&oParse a message with placeholders",
|
" &7&oParse a message with placeholders",
|
||||||
"&b/papi &fparserel &9<player one> <player two> <message>",
|
"&b/papi &fparserel &9<player one> <player two> <message>",
|
||||||
" &7&oParse a message with relational placeholders",
|
" &7&oParse a message with relational placeholders",
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
* PlaceholderAPI
|
* PlaceholderAPI
|
||||||
* Copyright (c) 2015 - 2021 PlaceholderAPI Team
|
* Copyright (c) 2015 - 2021 PlaceholderAPI Team
|
||||||
*
|
*
|
||||||
* PlaceholderAPI is free software: you can redistribute it and/or modify
|
* PlaceholderAPI free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
* (at your option) any later version.
|
* (at your option) any later version.
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
* PlaceholderAPI
|
* PlaceholderAPI
|
||||||
* Copyright (c) 2015 - 2021 PlaceholderAPI Team
|
* Copyright (c) 2015 - 2021 PlaceholderAPI Team
|
||||||
*
|
*
|
||||||
* PlaceholderAPI is free software: you can redistribute it and/or modify
|
* PlaceholderAPI free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
* (at your option) any later version.
|
* (at your option) any later version.
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
* PlaceholderAPI
|
* PlaceholderAPI
|
||||||
* Copyright (c) 2015 - 2021 PlaceholderAPI Team
|
* Copyright (c) 2015 - 2021 PlaceholderAPI Team
|
||||||
*
|
*
|
||||||
* PlaceholderAPI is free software: you can redistribute it and/or modify
|
* PlaceholderAPI free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
* (at your option) any later version.
|
* (at your option) any later version.
|
||||||
@@ -22,6 +22,7 @@ package me.clip.placeholderapi.commands.impl.local;
|
|||||||
|
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Locale;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.stream.Stream;
|
import java.util.stream.Stream;
|
||||||
import me.clip.placeholderapi.PlaceholderAPI;
|
import me.clip.placeholderapi.PlaceholderAPI;
|
||||||
@@ -49,7 +50,7 @@ public final class CommandParse extends PlaceholderCommand {
|
|||||||
public void evaluate(@NotNull final PlaceholderAPIPlugin plugin,
|
public void evaluate(@NotNull final PlaceholderAPIPlugin plugin,
|
||||||
@NotNull final CommandSender sender, @NotNull final String alias,
|
@NotNull final CommandSender sender, @NotNull final String alias,
|
||||||
@NotNull @Unmodifiable final List<String> params) {
|
@NotNull @Unmodifiable final List<String> params) {
|
||||||
switch (alias.toLowerCase()) {
|
switch (alias.toLowerCase(Locale.ROOT)) {
|
||||||
case "parserel":
|
case "parserel":
|
||||||
evaluateParseRelation(sender, params);
|
evaluateParseRelation(sender, params);
|
||||||
break;
|
break;
|
||||||
@@ -69,7 +70,7 @@ public final class CommandParse extends PlaceholderCommand {
|
|||||||
public void complete(@NotNull final PlaceholderAPIPlugin plugin,
|
public void complete(@NotNull final PlaceholderAPIPlugin plugin,
|
||||||
@NotNull final CommandSender sender, @NotNull final String alias,
|
@NotNull final CommandSender sender, @NotNull final String alias,
|
||||||
@NotNull @Unmodifiable final List<String> params, @NotNull final List<String> suggestions) {
|
@NotNull @Unmodifiable final List<String> params, @NotNull final List<String> suggestions) {
|
||||||
switch (alias.toLowerCase()) {
|
switch (alias.toLowerCase(Locale.ROOT)) {
|
||||||
case "parserel":
|
case "parserel":
|
||||||
completeParseRelation(params, suggestions);
|
completeParseRelation(params, suggestions);
|
||||||
break;
|
break;
|
||||||
@@ -92,7 +93,7 @@ public final class CommandParse extends PlaceholderCommand {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull final OfflinePlayer player;
|
OfflinePlayer player;
|
||||||
|
|
||||||
if ("me".equalsIgnoreCase(params.get(0))) {
|
if ("me".equalsIgnoreCase(params.get(0))) {
|
||||||
if (!(sender instanceof Player)) {
|
if (!(sender instanceof Player)) {
|
||||||
@@ -101,6 +102,8 @@ public final class CommandParse extends PlaceholderCommand {
|
|||||||
}
|
}
|
||||||
|
|
||||||
player = ((Player) sender);
|
player = ((Player) sender);
|
||||||
|
} else if ("--null".equalsIgnoreCase(params.get(0))) {
|
||||||
|
player = null;
|
||||||
} else {
|
} else {
|
||||||
final OfflinePlayer target = resolvePlayer(params.get(0));
|
final OfflinePlayer target = resolvePlayer(params.get(0));
|
||||||
if (target == null) {
|
if (target == null) {
|
||||||
@@ -161,10 +164,14 @@ public final class CommandParse extends PlaceholderCommand {
|
|||||||
@NotNull @Unmodifiable final List<String> params, @NotNull final List<String> suggestions) {
|
@NotNull @Unmodifiable final List<String> params, @NotNull final List<String> suggestions) {
|
||||||
if (params.size() <= 1) {
|
if (params.size() <= 1) {
|
||||||
if (sender instanceof Player && (params.isEmpty() || "me"
|
if (sender instanceof Player && (params.isEmpty() || "me"
|
||||||
.startsWith(params.get(0).toLowerCase()))) {
|
.startsWith(params.get(0).toLowerCase(Locale.ROOT)))) {
|
||||||
suggestions.add("me");
|
suggestions.add("me");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ("--null".startsWith(params.get(0).toLowerCase(Locale.ROOT))) {
|
||||||
|
suggestions.add("--null");
|
||||||
|
}
|
||||||
|
|
||||||
final Stream<String> names = Bukkit.getOnlinePlayers().stream().map(Player::getName);
|
final Stream<String> names = Bukkit.getOnlinePlayers().stream().map(Player::getName);
|
||||||
suggestByParameter(names, suggestions, params.isEmpty() ? null : params.get(0));
|
suggestByParameter(names, suggestions, params.isEmpty() ? null : params.get(0));
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
* PlaceholderAPI
|
* PlaceholderAPI
|
||||||
* Copyright (c) 2015 - 2021 PlaceholderAPI Team
|
* Copyright (c) 2015 - 2021 PlaceholderAPI Team
|
||||||
*
|
*
|
||||||
* PlaceholderAPI is free software: you can redistribute it and/or modify
|
* PlaceholderAPI free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
* (at your option) any later version.
|
* (at your option) any later version.
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
* PlaceholderAPI
|
* PlaceholderAPI
|
||||||
* Copyright (c) 2015 - 2021 PlaceholderAPI Team
|
* Copyright (c) 2015 - 2021 PlaceholderAPI Team
|
||||||
*
|
*
|
||||||
* PlaceholderAPI is free software: you can redistribute it and/or modify
|
* PlaceholderAPI free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
* (at your option) any later version.
|
* (at your option) any later version.
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
* PlaceholderAPI
|
* PlaceholderAPI
|
||||||
* Copyright (c) 2015 - 2021 PlaceholderAPI Team
|
* Copyright (c) 2015 - 2021 PlaceholderAPI Team
|
||||||
*
|
*
|
||||||
* PlaceholderAPI is free software: you can redistribute it and/or modify
|
* PlaceholderAPI free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
* (at your option) any later version.
|
* (at your option) any later version.
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
* PlaceholderAPI
|
* PlaceholderAPI
|
||||||
* Copyright (c) 2015 - 2021 PlaceholderAPI Team
|
* Copyright (c) 2015 - 2021 PlaceholderAPI Team
|
||||||
*
|
*
|
||||||
* PlaceholderAPI is free software: you can redistribute it and/or modify
|
* PlaceholderAPI free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
* (at your option) any later version.
|
* (at your option) any later version.
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
* PlaceholderAPI
|
* PlaceholderAPI
|
||||||
* Copyright (c) 2015 - 2021 PlaceholderAPI Team
|
* Copyright (c) 2015 - 2021 PlaceholderAPI Team
|
||||||
*
|
*
|
||||||
* PlaceholderAPI is free software: you can redistribute it and/or modify
|
* PlaceholderAPI free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
* (at your option) any later version.
|
* (at your option) any later version.
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
* PlaceholderAPI
|
* PlaceholderAPI
|
||||||
* Copyright (c) 2015 - 2021 PlaceholderAPI Team
|
* Copyright (c) 2015 - 2021 PlaceholderAPI Team
|
||||||
*
|
*
|
||||||
* PlaceholderAPI is free software: you can redistribute it and/or modify
|
* PlaceholderAPI free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
* (at your option) any later version.
|
* (at your option) any later version.
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
* PlaceholderAPI
|
* PlaceholderAPI
|
||||||
* Copyright (c) 2015 - 2021 PlaceholderAPI Team
|
* Copyright (c) 2015 - 2021 PlaceholderAPI Team
|
||||||
*
|
*
|
||||||
* PlaceholderAPI is free software: you can redistribute it and/or modify
|
* PlaceholderAPI free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
* (at your option) any later version.
|
* (at your option) any later version.
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
* PlaceholderAPI
|
* PlaceholderAPI
|
||||||
* Copyright (c) 2015 - 2021 PlaceholderAPI Team
|
* Copyright (c) 2015 - 2021 PlaceholderAPI Team
|
||||||
*
|
*
|
||||||
* PlaceholderAPI is free software: you can redistribute it and/or modify
|
* PlaceholderAPI free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
* (at your option) any later version.
|
* (at your option) any later version.
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
* PlaceholderAPI
|
* PlaceholderAPI
|
||||||
* Copyright (c) 2015 - 2021 PlaceholderAPI Team
|
* Copyright (c) 2015 - 2021 PlaceholderAPI Team
|
||||||
*
|
*
|
||||||
* PlaceholderAPI is free software: you can redistribute it and/or modify
|
* PlaceholderAPI free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
* (at your option) any later version.
|
* (at your option) any later version.
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
* PlaceholderAPI
|
* PlaceholderAPI
|
||||||
* Copyright (c) 2015 - 2021 PlaceholderAPI Team
|
* Copyright (c) 2015 - 2021 PlaceholderAPI Team
|
||||||
*
|
*
|
||||||
* PlaceholderAPI is free software: you can redistribute it and/or modify
|
* PlaceholderAPI free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
* (at your option) any later version.
|
* (at your option) any later version.
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
* PlaceholderAPI
|
* PlaceholderAPI
|
||||||
* Copyright (c) 2015 - 2021 PlaceholderAPI Team
|
* Copyright (c) 2015 - 2021 PlaceholderAPI Team
|
||||||
*
|
*
|
||||||
* PlaceholderAPI is free software: you can redistribute it and/or modify
|
* PlaceholderAPI free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
* (at your option) any later version.
|
* (at your option) any later version.
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
* PlaceholderAPI
|
* PlaceholderAPI
|
||||||
* Copyright (c) 2015 - 2021 PlaceholderAPI Team
|
* Copyright (c) 2015 - 2021 PlaceholderAPI Team
|
||||||
*
|
*
|
||||||
* PlaceholderAPI is free software: you can redistribute it and/or modify
|
* PlaceholderAPI free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
* (at your option) any later version.
|
* (at your option) any later version.
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
* PlaceholderAPI
|
* PlaceholderAPI
|
||||||
* Copyright (c) 2015 - 2021 PlaceholderAPI Team
|
* Copyright (c) 2015 - 2021 PlaceholderAPI Team
|
||||||
*
|
*
|
||||||
* PlaceholderAPI is free software: you can redistribute it and/or modify
|
* PlaceholderAPI free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
* (at your option) any later version.
|
* (at your option) any later version.
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
* PlaceholderAPI
|
* PlaceholderAPI
|
||||||
* Copyright (c) 2015 - 2021 PlaceholderAPI Team
|
* Copyright (c) 2015 - 2021 PlaceholderAPI Team
|
||||||
*
|
*
|
||||||
* PlaceholderAPI is free software: you can redistribute it and/or modify
|
* PlaceholderAPI free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
* (at your option) any later version.
|
* (at your option) any later version.
|
||||||
@@ -26,7 +26,9 @@ import java.util.logging.Level;
|
|||||||
import me.clip.placeholderapi.PlaceholderAPIPlugin;
|
import me.clip.placeholderapi.PlaceholderAPIPlugin;
|
||||||
import me.clip.placeholderapi.PlaceholderHook;
|
import me.clip.placeholderapi.PlaceholderHook;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
|
import org.bukkit.OfflinePlayer;
|
||||||
import org.bukkit.configuration.ConfigurationSection;
|
import org.bukkit.configuration.ConfigurationSection;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
import org.jetbrains.annotations.ApiStatus;
|
import org.jetbrains.annotations.ApiStatus;
|
||||||
import org.jetbrains.annotations.Contract;
|
import org.jetbrains.annotations.Contract;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
@@ -398,6 +400,62 @@ public abstract class PlaceholderExpansion extends PlaceholderHook {
|
|||||||
getAuthor(), getVersion());
|
getAuthor(), getVersion());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This method is called first whenever PlaceholderAPI finds a valid placeholder with a matching expansion.
|
||||||
|
* <br>When called, the provided OfflinePlayer instance can be one of 3 possible states:
|
||||||
|
*
|
||||||
|
* <ul>
|
||||||
|
* <li>Not null and online</li>
|
||||||
|
* <li>Not null and offline</li>
|
||||||
|
* <li>Null</li>
|
||||||
|
* </ul>
|
||||||
|
*
|
||||||
|
* When not overridden by the called expansion will the method as of now call
|
||||||
|
* {@link PlaceholderHook#onRequest(OfflinePlayer, String) PlaceholderHook#onRequest(OfflinePlayer, String)}.
|
||||||
|
* <br>This behaviour will change in a future version to call {@link #parsePlaceholders(Player, String) parsePlaceholders(Player, String)}
|
||||||
|
* with the OfflinePlayer either being casted to a Player (When online), or {@link null}.
|
||||||
|
*
|
||||||
|
* <p>To use this method in your PlaceholderExpansion, override it and return either a String or {@code null}.
|
||||||
|
* <br>When {@code null} is returned will PlaceholderAPI see it as an "invalid placeholder" and return
|
||||||
|
* the content as-is in the final String.
|
||||||
|
*
|
||||||
|
* @param player The OfflinePlayer to use.
|
||||||
|
* @param params The parameters of the placeholder, right after the first underscore.
|
||||||
|
* @return Parsed placeholder, or null depending on the Expansion's handling of it.
|
||||||
|
*/
|
||||||
|
@Nullable
|
||||||
|
public String parsePlaceholders(@Nullable OfflinePlayer player, @NotNull String params) {
|
||||||
|
return this.onRequest(player, params);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This method is called whenever PlaceholderAPI finds a valid placeholder with a matching expansion
|
||||||
|
* AND {@link #parsePlaceholders(OfflinePlayer, String) parsePlaceholder(OfflinePlayer, String)} isn't
|
||||||
|
* overridden by the expansion in question.
|
||||||
|
* <br>When called, the provided Player instance can be one of 2 possible states:
|
||||||
|
*
|
||||||
|
* <ul>
|
||||||
|
* <li>Not null and online</li>
|
||||||
|
* <li>Null</li>
|
||||||
|
* </ul>
|
||||||
|
*
|
||||||
|
* When not overridden by the called expansion will the method as of now call
|
||||||
|
* {@link PlaceholderHook#onPlaceholderRequest(Player, String) PlaceholderHook#onPlaceholderRequest(Player, String)}.
|
||||||
|
* <br>This behaviour will change in a future version to instead return {@code null}.
|
||||||
|
*
|
||||||
|
* <p>To use this method in your PlaceholderExpansion, override it and return either a String or {@code null}.
|
||||||
|
* <br>When {@code null} is returned will PlaceholderAPI see it as an "invalid placeholder" and return
|
||||||
|
* the content as-is in the final String.
|
||||||
|
*
|
||||||
|
* @param player The Player to use. May be null
|
||||||
|
* @param params The parameters of the placeholder, right after the first underscore.
|
||||||
|
* @return Parsed placeholder, or null depending on the Expansion's handling of it.
|
||||||
|
*/
|
||||||
|
@Nullable
|
||||||
|
public String parsePlaceholders(@Nullable Player player, @NotNull String params){
|
||||||
|
return this.onPlaceholderRequest(player, params);
|
||||||
|
}
|
||||||
|
|
||||||
// === Deprecated API ===
|
// === Deprecated API ===
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -406,7 +464,7 @@ public abstract class PlaceholderExpansion extends PlaceholderHook {
|
|||||||
* @return The plugin name.
|
* @return The plugin name.
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
|
@ApiStatus.ScheduledForRemoval(inVersion = "2.13.0")
|
||||||
public String getPlugin() {
|
public String getPlugin() {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@@ -417,7 +475,7 @@ public abstract class PlaceholderExpansion extends PlaceholderHook {
|
|||||||
* @return The description of the expansion.
|
* @return The description of the expansion.
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
|
@ApiStatus.ScheduledForRemoval(inVersion = "2.13.0")
|
||||||
public String getDescription() {
|
public String getDescription() {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@@ -428,7 +486,7 @@ public abstract class PlaceholderExpansion extends PlaceholderHook {
|
|||||||
* @return The link for the expansion.
|
* @return The link for the expansion.
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
|
@ApiStatus.ScheduledForRemoval(inVersion = "2.13.0")
|
||||||
public String getLink() {
|
public String getLink() {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
* PlaceholderAPI
|
* PlaceholderAPI
|
||||||
* Copyright (c) 2015 - 2021 PlaceholderAPI Team
|
* Copyright (c) 2015 - 2021 PlaceholderAPI Team
|
||||||
*
|
*
|
||||||
* PlaceholderAPI is free software: you can redistribute it and/or modify
|
* PlaceholderAPI free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
* (at your option) any later version.
|
* (at your option) any later version.
|
||||||
@@ -21,23 +21,29 @@
|
|||||||
package me.clip.placeholderapi.expansion;
|
package me.clip.placeholderapi.expansion;
|
||||||
|
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Implementing this interface allows your {@link me.clip.placeholderapi.expansion.PlaceholderExpansion PlaceholderExpansion}
|
* This interface should be used when your {@link me.clip.placeholderapi.expansion.PlaceholderExpansion PlaceholderExpansion}
|
||||||
* to be used as a relational placeholder expansion.
|
* should support relational placeholders.
|
||||||
*
|
*
|
||||||
* <p>Relational placeholders take two Players as input and are always prefixed with {@code rel_},
|
* <p>The difference between relational placeholders and normal ones is, that relational ones start
|
||||||
* so {@code %foo_bar%} becomes {@code %rel_foo_bar%}
|
* with a {@code rel_} prefix and have two Players provided, instead of one.
|
||||||
|
* <br>The main purpose is to return a String based on the "relationship" between the two players
|
||||||
|
* (i.e. if both are within the same world).
|
||||||
*/
|
*/
|
||||||
public interface Relational {
|
public interface Relational {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This method is called whenever a placeholder starting with {@code rel_} is called.
|
* This method will be called whenever a valid placeholder in the format {@code %rel_<expansion>_<identifier>%}
|
||||||
|
* is found.
|
||||||
*
|
*
|
||||||
* @param one The first player used for the placeholder.
|
* @param one The first player to use for comparison.
|
||||||
* @param two The second player used for the placeholder.
|
* @param two The second player to use for comparison
|
||||||
* @param identifier The text right after the expansion's name (%expansion_<b>identifier</b>%)
|
* @param identifier String right after {@code %rel_<expansion>_} and before the second percent symbol.
|
||||||
* @return Parsed String from the expansion.
|
* @return Possibly-null String, depending on what the expansion returns.
|
||||||
*/
|
*/
|
||||||
String onPlaceholderRequest(Player one, Player two, String identifier);
|
@Nullable
|
||||||
|
String onPlaceholderRequest(Player one, Player two, @NotNull String identifier);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
* PlaceholderAPI
|
* PlaceholderAPI
|
||||||
* Copyright (c) 2015 - 2021 PlaceholderAPI Team
|
* Copyright (c) 2015 - 2021 PlaceholderAPI Team
|
||||||
*
|
*
|
||||||
* PlaceholderAPI is free software: you can redistribute it and/or modify
|
* PlaceholderAPI free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
* (at your option) any later version.
|
* (at your option) any later version.
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
* PlaceholderAPI
|
* PlaceholderAPI
|
||||||
* Copyright (c) 2015 - 2021 PlaceholderAPI Team
|
* Copyright (c) 2015 - 2021 PlaceholderAPI Team
|
||||||
*
|
*
|
||||||
* PlaceholderAPI is free software: you can redistribute it and/or modify
|
* PlaceholderAPI free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
* (at your option) any later version.
|
* (at your option) any later version.
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
* PlaceholderAPI
|
* PlaceholderAPI
|
||||||
* Copyright (c) 2015 - 2021 PlaceholderAPI Team
|
* Copyright (c) 2015 - 2021 PlaceholderAPI Team
|
||||||
*
|
*
|
||||||
* PlaceholderAPI is free software: you can redistribute it and/or modify
|
* PlaceholderAPI free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
* (at your option) any later version.
|
* (at your option) any later version.
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
* PlaceholderAPI
|
* PlaceholderAPI
|
||||||
* Copyright (c) 2015 - 2021 PlaceholderAPI Team
|
* Copyright (c) 2015 - 2021 PlaceholderAPI Team
|
||||||
*
|
*
|
||||||
* PlaceholderAPI is free software: you can redistribute it and/or modify
|
* PlaceholderAPI free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
* (at your option) any later version.
|
* (at your option) any later version.
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
* PlaceholderAPI
|
* PlaceholderAPI
|
||||||
* Copyright (c) 2015 - 2021 PlaceholderAPI Team
|
* Copyright (c) 2015 - 2021 PlaceholderAPI Team
|
||||||
*
|
*
|
||||||
* PlaceholderAPI is free software: you can redistribute it and/or modify
|
* PlaceholderAPI free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
* (at your option) any later version.
|
* (at your option) any later version.
|
||||||
@@ -37,6 +37,7 @@ import java.util.ArrayList;
|
|||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Locale;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
@@ -88,7 +89,7 @@ public final class CloudExpansionManager {
|
|||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
private static String toIndexName(@NotNull final String name) {
|
private static String toIndexName(@NotNull final String name) {
|
||||||
return name.toLowerCase().replace(' ', '_');
|
return name.toLowerCase(Locale.ROOT).replace(' ', '_');
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
* PlaceholderAPI
|
* PlaceholderAPI
|
||||||
* Copyright (c) 2015 - 2021 PlaceholderAPI Team
|
* Copyright (c) 2015 - 2021 PlaceholderAPI Team
|
||||||
*
|
*
|
||||||
* PlaceholderAPI is free software: you can redistribute it and/or modify
|
* PlaceholderAPI free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
* (at your option) any later version.
|
* (at your option) any later version.
|
||||||
@@ -125,7 +125,7 @@ public final class LocalExpansionManager implements Listener {
|
|||||||
public PlaceholderExpansion getExpansion(@NotNull final String identifier) {
|
public PlaceholderExpansion getExpansion(@NotNull final String identifier) {
|
||||||
expansionsLock.lock();
|
expansionsLock.lock();
|
||||||
try {
|
try {
|
||||||
return expansions.get(identifier.toLowerCase());
|
return expansions.get(identifier.toLowerCase(Locale.ROOT));
|
||||||
} finally {
|
} finally {
|
||||||
expansionsLock.unlock();
|
expansionsLock.unlock();
|
||||||
}
|
}
|
||||||
@@ -193,7 +193,7 @@ public final class LocalExpansionManager implements Listener {
|
|||||||
|
|
||||||
@ApiStatus.Internal
|
@ApiStatus.Internal
|
||||||
public boolean register(@NotNull final PlaceholderExpansion expansion) {
|
public boolean register(@NotNull final PlaceholderExpansion expansion) {
|
||||||
final String identifier = expansion.getIdentifier().toLowerCase();
|
final String identifier = expansion.getIdentifier().toLowerCase(Locale.ROOT);
|
||||||
|
|
||||||
if (!expansion.canRegister()) {
|
if (!expansion.canRegister()) {
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -1,3 +1,23 @@
|
|||||||
|
/*
|
||||||
|
* This file is part of PlaceholderAPI
|
||||||
|
*
|
||||||
|
* PlaceholderAPI
|
||||||
|
* Copyright (c) 2015 - 2021 PlaceholderAPI Team
|
||||||
|
*
|
||||||
|
* PlaceholderAPI free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* PlaceholderAPI is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
package me.clip.placeholderapi.expansion.manager;
|
package me.clip.placeholderapi.expansion.manager;
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
* PlaceholderAPI
|
* PlaceholderAPI
|
||||||
* Copyright (c) 2015 - 2021 PlaceholderAPI Team
|
* Copyright (c) 2015 - 2021 PlaceholderAPI Team
|
||||||
*
|
*
|
||||||
* PlaceholderAPI is free software: you can redistribute it and/or modify
|
* PlaceholderAPI free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
* (at your option) any later version.
|
* (at your option) any later version.
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
* PlaceholderAPI
|
* PlaceholderAPI
|
||||||
* Copyright (c) 2015 - 2021 PlaceholderAPI Team
|
* Copyright (c) 2015 - 2021 PlaceholderAPI Team
|
||||||
*
|
*
|
||||||
* PlaceholderAPI is free software: you can redistribute it and/or modify
|
* PlaceholderAPI free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
* (at your option) any later version.
|
* (at your option) any later version.
|
||||||
@@ -20,6 +20,7 @@
|
|||||||
|
|
||||||
package me.clip.placeholderapi.replacer;
|
package me.clip.placeholderapi.replacer;
|
||||||
|
|
||||||
|
import java.util.Locale;
|
||||||
import java.util.function.Function;
|
import java.util.function.Function;
|
||||||
import me.clip.placeholderapi.expansion.PlaceholderExpansion;
|
import me.clip.placeholderapi.expansion.PlaceholderExpansion;
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
@@ -50,56 +51,13 @@ public final class CharsReplacer implements Replacer {
|
|||||||
for (int i = 0; i < chars.length; i++) {
|
for (int i = 0; i < chars.length; i++) {
|
||||||
final char l = chars[i];
|
final char l = chars[i];
|
||||||
|
|
||||||
if (l == '&' && ++i < chars.length) {
|
|
||||||
final char c = Character.toLowerCase(chars[i]);
|
|
||||||
|
|
||||||
if (c != '0' && c != '1' && c != '2' && c != '3' && c != '4' && c != '5' && c != '6'
|
|
||||||
&& c != '7' && c != '8' && c != '9' && c != 'a' && c != 'b' && c != 'c' && c != 'd'
|
|
||||||
&& c != 'e' && c != 'f' && c != 'k' && c != 'l' && c != 'm' && c != 'n' && c != 'o' && c != 'r'
|
|
||||||
&& c != 'x') {
|
|
||||||
builder.append(l).append(chars[i]);
|
|
||||||
} else {
|
|
||||||
builder.append(ChatColor.COLOR_CHAR);
|
|
||||||
|
|
||||||
if (c != 'x') {
|
|
||||||
builder.append(chars[i]);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((i > 1 && chars[i - 2] == '\\') /*allow escaping &x*/) {
|
|
||||||
builder.setLength(builder.length() - 2);
|
|
||||||
builder.append('&').append(chars[i]);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
builder.append(c);
|
|
||||||
|
|
||||||
int j = 0;
|
|
||||||
while (++j <= 6) {
|
|
||||||
if (i + j >= chars.length) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
final char x = chars[i + j];
|
|
||||||
builder.append(ChatColor.COLOR_CHAR).append(x);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (j == 7) {
|
|
||||||
i += 6;
|
|
||||||
} else {
|
|
||||||
builder.setLength(builder.length() - (j * 2)); // undo &x parsing
|
|
||||||
}
|
|
||||||
}
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (l != closure.head || i + 1 >= chars.length) {
|
if (l != closure.head || i + 1 >= chars.length) {
|
||||||
builder.append(l);
|
builder.append(l);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean identified = false;
|
boolean identified = false;
|
||||||
boolean oopsitsbad = true;
|
boolean invalid = true;
|
||||||
boolean hadSpace = false;
|
boolean hadSpace = false;
|
||||||
|
|
||||||
while (++i < chars.length) {
|
while (++i < chars.length) {
|
||||||
@@ -110,7 +68,7 @@ public final class CharsReplacer implements Replacer {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (p == closure.tail) {
|
if (p == closure.tail) {
|
||||||
oopsitsbad = false;
|
invalid = false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -126,14 +84,15 @@ public final class CharsReplacer implements Replacer {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
final String identifierString = identifier.toString().toLowerCase();
|
final String identifierString = identifier.toString();
|
||||||
|
final String lowercaseIdentifierString = identifierString.toLowerCase(Locale.ROOT);
|
||||||
final String parametersString = parameters.toString();
|
final String parametersString = parameters.toString();
|
||||||
|
|
||||||
identifier.setLength(0);
|
identifier.setLength(0);
|
||||||
parameters.setLength(0);
|
parameters.setLength(0);
|
||||||
|
|
||||||
if (oopsitsbad) {
|
if (invalid) {
|
||||||
builder.append(closure.head).append(identifier);
|
builder.append(closure.head).append(identifierString);
|
||||||
|
|
||||||
if (identified) {
|
if (identified) {
|
||||||
builder.append('_').append(parametersString);
|
builder.append('_').append(parametersString);
|
||||||
@@ -145,7 +104,7 @@ public final class CharsReplacer implements Replacer {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
final PlaceholderExpansion placeholder = lookup.apply(identifierString);
|
final PlaceholderExpansion placeholder = lookup.apply(lowercaseIdentifierString);
|
||||||
if (placeholder == null) {
|
if (placeholder == null) {
|
||||||
builder.append(closure.head).append(identifierString);
|
builder.append(closure.head).append(identifierString);
|
||||||
|
|
||||||
@@ -157,7 +116,7 @@ public final class CharsReplacer implements Replacer {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
final String replacement = placeholder.onRequest(player, parametersString);
|
final String replacement = placeholder.parsePlaceholders(player, parametersString);
|
||||||
if (replacement == null) {
|
if (replacement == null) {
|
||||||
builder.append(closure.head).append(identifierString);
|
builder.append(closure.head).append(identifierString);
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
* PlaceholderAPI
|
* PlaceholderAPI
|
||||||
* Copyright (c) 2015 - 2021 PlaceholderAPI Team
|
* Copyright (c) 2015 - 2021 PlaceholderAPI Team
|
||||||
*
|
*
|
||||||
* PlaceholderAPI is free software: you can redistribute it and/or modify
|
* PlaceholderAPI free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
* (at your option) any later version.
|
* (at your option) any later version.
|
||||||
@@ -61,7 +61,7 @@ public final class RegexReplacer implements Replacer {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
final String requested = expansion.onRequest(player, parameters);
|
final String requested = expansion.parsePlaceholders(player, parameters);
|
||||||
matcher.appendReplacement(builder, requested != null ? requested : matcher.group(0));
|
matcher.appendReplacement(builder, requested != null ? requested : matcher.group(0));
|
||||||
}
|
}
|
||||||
while (matcher.find());
|
while (matcher.find());
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
* PlaceholderAPI
|
* PlaceholderAPI
|
||||||
* Copyright (c) 2015 - 2021 PlaceholderAPI Team
|
* Copyright (c) 2015 - 2021 PlaceholderAPI Team
|
||||||
*
|
*
|
||||||
* PlaceholderAPI is free software: you can redistribute it and/or modify
|
* PlaceholderAPI free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
* (at your option) any later version.
|
* (at your option) any later version.
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
* PlaceholderAPI
|
* PlaceholderAPI
|
||||||
* Copyright (c) 2015 - 2021 PlaceholderAPI Team
|
* Copyright (c) 2015 - 2021 PlaceholderAPI Team
|
||||||
*
|
*
|
||||||
* PlaceholderAPI is free software: you can redistribute it and/or modify
|
* PlaceholderAPI free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
* (at your option) any later version.
|
* (at your option) any later version.
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
* PlaceholderAPI
|
* PlaceholderAPI
|
||||||
* Copyright (c) 2015 - 2021 PlaceholderAPI Team
|
* Copyright (c) 2015 - 2021 PlaceholderAPI Team
|
||||||
*
|
*
|
||||||
* PlaceholderAPI is free software: you can redistribute it and/or modify
|
* PlaceholderAPI free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
* (at your option) any later version.
|
* (at your option) any later version.
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
* PlaceholderAPI
|
* PlaceholderAPI
|
||||||
* Copyright (c) 2015 - 2021 PlaceholderAPI Team
|
* Copyright (c) 2015 - 2021 PlaceholderAPI Team
|
||||||
*
|
*
|
||||||
* PlaceholderAPI is free software: you can redistribute it and/or modify
|
* PlaceholderAPI free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
* (at your option) any later version.
|
* (at your option) any later version.
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
* PlaceholderAPI
|
* PlaceholderAPI
|
||||||
* Copyright (c) 2015 - 2021 PlaceholderAPI Team
|
* Copyright (c) 2015 - 2021 PlaceholderAPI Team
|
||||||
*
|
*
|
||||||
* PlaceholderAPI is free software: you can redistribute it and/or modify
|
* PlaceholderAPI free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
* (at your option) any later version.
|
* (at your option) any later version.
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
* PlaceholderAPI
|
* PlaceholderAPI
|
||||||
* Copyright (c) 2015 - 2021 PlaceholderAPI Team
|
* Copyright (c) 2015 - 2021 PlaceholderAPI Team
|
||||||
*
|
*
|
||||||
* PlaceholderAPI is free software: you can redistribute it and/or modify
|
* PlaceholderAPI free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
* (at your option) any later version.
|
* (at your option) any later version.
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
* PlaceholderAPI
|
* PlaceholderAPI
|
||||||
* Copyright (c) 2015 - 2021 PlaceholderAPI Team
|
* Copyright (c) 2015 - 2021 PlaceholderAPI Team
|
||||||
*
|
*
|
||||||
* PlaceholderAPI is free software: you can redistribute it and/or modify
|
* PlaceholderAPI free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
* (at your option) any later version.
|
* (at your option) any later version.
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
* PlaceholderAPI
|
* PlaceholderAPI
|
||||||
* Copyright (c) 2015 - 2021 PlaceholderAPI Team
|
* Copyright (c) 2015 - 2021 PlaceholderAPI Team
|
||||||
*
|
*
|
||||||
* PlaceholderAPI is free software: you can redistribute it and/or modify
|
* PlaceholderAPI free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
* (at your option) any later version.
|
* (at your option) any later version.
|
||||||
|
|||||||
@@ -88,12 +88,4 @@ public final class ReplacerUnitTester {
|
|||||||
assertEquals(text, Values.CHARS_REPLACER.apply(text, null, Values.PLACEHOLDERS::get));
|
assertEquals(text, Values.CHARS_REPLACER.apply(text, null, Values.PLACEHOLDERS::get));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
|
||||||
void testCharsReplacerHandlesEscapedHex() {
|
|
||||||
final String text = "\\&xffffffThis should not change.";
|
|
||||||
|
|
||||||
assertEquals(text.substring(1),
|
|
||||||
Values.CHARS_REPLACER.apply(text, null, Values.PLACEHOLDERS::get));
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user