mirror of
https://github.com/PlaceholderAPI/PlaceholderAPI
synced 2025-09-06 05:17:05 +02:00
Compare commits
8 Commits
feature/mo
...
developmen
Author | SHA1 | Date | |
---|---|---|---|
|
e3602e5aea | ||
|
b8d4dcd570 | ||
|
8a249a9a2e | ||
|
915166f78b | ||
|
533b892cf4 | ||
|
6676e2fa21 | ||
|
99e5752352 | ||
|
b4f6831e54 |
14
build.gradle
14
build.gradle
@@ -18,23 +18,23 @@ repositories {
|
||||
mavenCentral()
|
||||
mavenLocal()
|
||||
|
||||
maven({ url = "https://repo.codemc.org/repository/maven-public" })
|
||||
maven({ url = "https://repo.codemc.org/repository/maven-public/" })
|
||||
maven({ url = "https://hub.spigotmc.org/nexus/content/repositories/snapshots/" })
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation "org.bstats:bstats-bukkit:2.2.1"
|
||||
|
||||
implementation "net.kyori:adventure-platform-bukkit:4.0.0-SNAPSHOT"
|
||||
implementation "net.kyori:adventure-platform-bukkit:4.0.0"
|
||||
|
||||
compileOnly "org.spigotmc:spigot-api:1.17.1-R0.1-SNAPSHOT"
|
||||
compileOnly "org.jetbrains:annotations:19.0.0"
|
||||
compileOnly "org.jetbrains:annotations:22.0.0"
|
||||
|
||||
testImplementation "org.openjdk.jmh:jmh-core:1.23"
|
||||
testImplementation "org.openjdk.jmh:jmh-generator-annprocess:1.23"
|
||||
testImplementation "org.openjdk.jmh:jmh-core:1.32"
|
||||
testImplementation "org.openjdk.jmh:jmh-generator-annprocess:1.32"
|
||||
|
||||
testImplementation "org.junit.jupiter:junit-jupiter-engine:5.6.2"
|
||||
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:5.6.2"
|
||||
testImplementation "org.junit.jupiter:junit-jupiter-engine:5.8.1"
|
||||
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:5.8.1"
|
||||
}
|
||||
|
||||
processResources {
|
||||
|
@@ -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()) {
|
||||
|
@@ -275,7 +275,6 @@ public abstract class PlaceholderExpansion extends PlaceholderHook {
|
||||
* @param def The default boolean to return when the ConfigurationSection is null
|
||||
* @return boolean from the provided path or the default one provided
|
||||
*/
|
||||
@NotNull
|
||||
public final boolean getBoolean(@NotNull final String path, final boolean def) {
|
||||
final ConfigurationSection section = getConfigSection();
|
||||
return section == null ? def : section.getBoolean(path, def);
|
||||
|
@@ -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());
|
||||
|
Reference in New Issue
Block a user