mirror of
https://github.com/PlaceholderAPI/PlaceholderAPI
synced 2024-11-18 00:46:55 +01:00
Merge pull request #667 from PlaceholderAPI/fix/666-lowercase-issues
Fix issue with invalid placeholder pattern lowercasing text
This commit is contained in:
parent
d168be94b1
commit
cfd289939e
@ -81,7 +81,7 @@ public final class PlaceholderAPI {
|
||||
*/
|
||||
@NotNull
|
||||
public static List<String> setPlaceholders(final OfflinePlayer player,
|
||||
@NotNull final List<@NotNull String> text) {
|
||||
@NotNull final List<String> text) {
|
||||
return text.stream().map(line -> setPlaceholders(player, line)).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
@ -136,7 +136,7 @@ public final class PlaceholderAPI {
|
||||
*/
|
||||
@NotNull
|
||||
public static List<String> setBracketPlaceholders(final OfflinePlayer player,
|
||||
@NotNull final List<@NotNull String> text) {
|
||||
@NotNull final List<String> text) {
|
||||
return text.stream().map(line -> setBracketPlaceholders(player, line))
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
@ -33,7 +33,6 @@ import me.clip.placeholderapi.expansion.manager.LocalExpansionManager;
|
||||
import me.clip.placeholderapi.listeners.ServerLoadEventListener;
|
||||
import me.clip.placeholderapi.updatechecker.UpdateChecker;
|
||||
import net.kyori.adventure.platform.bukkit.BukkitAudiences;
|
||||
import net.kyori.adventure.text.serializer.craftbukkit.MinecraftComponentSerializer;
|
||||
import org.bstats.bukkit.Metrics;
|
||||
import org.bstats.charts.AdvancedPie;
|
||||
import org.bstats.charts.SimplePie;
|
||||
@ -249,7 +248,7 @@ public final class PlaceholderAPIPlugin extends JavaPlugin {
|
||||
try {
|
||||
Class.forName("org.bukkit.event.server.ServerLoadEvent");
|
||||
new ServerLoadEventListener(this);
|
||||
} catch (final ExceptionInInitializerError | ClassNotFoundException ignored) {
|
||||
} catch (final ClassNotFoundException ignored) {
|
||||
Bukkit.getScheduler()
|
||||
.runTaskLater(this, () -> getLocalExpansionManager().load(Bukkit.getConsoleSender()), 1);
|
||||
}
|
||||
|
@ -26,7 +26,6 @@ import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
public abstract class PlaceholderHook {
|
||||
|
||||
@Nullable
|
||||
public String onRequest(final OfflinePlayer player, @NotNull final String params) {
|
||||
if (player != null && player.isOnline()) {
|
||||
|
@ -171,7 +171,7 @@ public class CloudExpansion {
|
||||
this.versions = versions;
|
||||
}
|
||||
|
||||
public class Version {
|
||||
public static class Version {
|
||||
|
||||
private String url, version, release_notes;
|
||||
|
||||
|
@ -39,16 +39,6 @@ public final class ServerLoadEventListener implements Listener {
|
||||
Bukkit.getPluginManager().registerEvents(this, plugin);
|
||||
}
|
||||
|
||||
/**
|
||||
* This method will be called when the server is first loaded
|
||||
* <p>
|
||||
* The goal of the method is to register all the expansions as soon as possible especially before
|
||||
* players can join
|
||||
* <p>
|
||||
* This will ensure no issues with expansions and hooks.
|
||||
*
|
||||
* @param event the server load event
|
||||
*/
|
||||
@EventHandler
|
||||
public void onServerLoad(@NotNull final ServerLoadEvent event) {
|
||||
HandlerList.unregisterAll(this);
|
||||
|
@ -133,7 +133,7 @@ public final class CharsReplacer implements Replacer {
|
||||
parameters.setLength(0);
|
||||
|
||||
if (oopsitsbad) {
|
||||
builder.append(closure.head).append(identifierString);
|
||||
builder.append(closure.head).append(identifier);
|
||||
|
||||
if (identified) {
|
||||
builder.append('_').append(parametersString);
|
||||
|
@ -50,7 +50,7 @@ public final class Format {
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private static String buildFormat(@NotNull final Align align, @NotNull final int[] spacing) {
|
||||
private static String buildFormat(@NotNull final Align align, final int[] spacing) {
|
||||
return stream(spacing)
|
||||
.mapToObj(space -> "%" + (align == Align.LEFT ? "-" : "") + (space + 2) + "s")
|
||||
.collect(joining());
|
||||
|
Loading…
Reference in New Issue
Block a user