Merge pull request #667 from PlaceholderAPI/fix/666-lowercase-issues

Fix issue with invalid placeholder pattern lowercasing text
This commit is contained in:
PiggyPiglet 2021-12-13 15:03:33 +08:00 committed by darbyjack
parent d168be94b1
commit cfd289939e
No known key found for this signature in database
GPG Key ID: F4B1016988371117
7 changed files with 6 additions and 18 deletions

View File

@ -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());
}

View File

@ -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);
}

View File

@ -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()) {

View File

@ -171,7 +171,7 @@ public class CloudExpansion {
this.versions = versions;
}
public class Version {
public static class Version {
private String url, version, release_notes;

View File

@ -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);

View File

@ -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);

View File

@ -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());