diff --git a/api/src/main/java/me/filoghost/holographicdisplays/api/beta/HolographicDisplaysAPI.java b/api/src/main/java/me/filoghost/holographicdisplays/api/beta/HolographicDisplaysAPI.java index eb489a5c..17b2511f 100644 --- a/api/src/main/java/me/filoghost/holographicdisplays/api/beta/HolographicDisplaysAPI.java +++ b/api/src/main/java/me/filoghost/holographicdisplays/api/beta/HolographicDisplaysAPI.java @@ -9,10 +9,10 @@ import me.filoghost.holographicdisplays.api.beta.hologram.Hologram; import me.filoghost.holographicdisplays.api.beta.internal.HolographicDisplaysAPIProvider; import me.filoghost.holographicdisplays.api.beta.placeholder.GlobalPlaceholder; import me.filoghost.holographicdisplays.api.beta.placeholder.GlobalPlaceholderFactory; -import me.filoghost.holographicdisplays.api.beta.placeholder.GlobalPlaceholderReplacementSupplier; +import me.filoghost.holographicdisplays.api.beta.placeholder.GlobalPlaceholderReplaceFunction; import me.filoghost.holographicdisplays.api.beta.placeholder.IndividualPlaceholder; import me.filoghost.holographicdisplays.api.beta.placeholder.IndividualPlaceholderFactory; -import me.filoghost.holographicdisplays.api.beta.placeholder.IndividualPlaceholderReplacementSupplier; +import me.filoghost.holographicdisplays.api.beta.placeholder.IndividualPlaceholderReplaceFunction; import org.bukkit.Location; import org.bukkit.plugin.Plugin; import org.jetbrains.annotations.NotNull; @@ -84,7 +84,7 @@ public interface HolographicDisplaysAPI { /** * @since 1 */ - void registerGlobalPlaceholder(@NotNull String identifier, int refreshIntervalTicks, @NotNull GlobalPlaceholderReplacementSupplier replacementSupplier); + void registerGlobalPlaceholder(@NotNull String identifier, int refreshIntervalTicks, @NotNull GlobalPlaceholderReplaceFunction replaceFunction); /** * @since 1 @@ -99,7 +99,7 @@ public interface HolographicDisplaysAPI { /** * @since 1 */ - void registerIndividualPlaceholder(@NotNull String identifier, int refreshIntervalTicks, @NotNull IndividualPlaceholderReplacementSupplier replacementSupplier); + void registerIndividualPlaceholder(@NotNull String identifier, int refreshIntervalTicks, @NotNull IndividualPlaceholderReplaceFunction replaceFunction); /** * @since 1 diff --git a/api/src/main/java/me/filoghost/holographicdisplays/api/beta/placeholder/GlobalPlaceholderReplacementSupplier.java b/api/src/main/java/me/filoghost/holographicdisplays/api/beta/placeholder/GlobalPlaceholderReplaceFunction.java similarity index 89% rename from api/src/main/java/me/filoghost/holographicdisplays/api/beta/placeholder/GlobalPlaceholderReplacementSupplier.java rename to api/src/main/java/me/filoghost/holographicdisplays/api/beta/placeholder/GlobalPlaceholderReplaceFunction.java index dd9a4f26..aa66b908 100644 --- a/api/src/main/java/me/filoghost/holographicdisplays/api/beta/placeholder/GlobalPlaceholderReplacementSupplier.java +++ b/api/src/main/java/me/filoghost/holographicdisplays/api/beta/placeholder/GlobalPlaceholderReplaceFunction.java @@ -13,7 +13,7 @@ import org.jetbrains.annotations.Nullable; * @since 1 */ @FunctionalInterface -public interface GlobalPlaceholderReplacementSupplier { +public interface GlobalPlaceholderReplaceFunction { /** * @see GlobalPlaceholder#getReplacement(String) diff --git a/api/src/main/java/me/filoghost/holographicdisplays/api/beta/placeholder/IndividualPlaceholderReplacementSupplier.java b/api/src/main/java/me/filoghost/holographicdisplays/api/beta/placeholder/IndividualPlaceholderReplaceFunction.java similarity index 89% rename from api/src/main/java/me/filoghost/holographicdisplays/api/beta/placeholder/IndividualPlaceholderReplacementSupplier.java rename to api/src/main/java/me/filoghost/holographicdisplays/api/beta/placeholder/IndividualPlaceholderReplaceFunction.java index 976200c7..9cbea522 100644 --- a/api/src/main/java/me/filoghost/holographicdisplays/api/beta/placeholder/IndividualPlaceholderReplacementSupplier.java +++ b/api/src/main/java/me/filoghost/holographicdisplays/api/beta/placeholder/IndividualPlaceholderReplaceFunction.java @@ -13,7 +13,7 @@ import org.jetbrains.annotations.Nullable; * @since 1 */ @FunctionalInterface -public interface IndividualPlaceholderReplacementSupplier { +public interface IndividualPlaceholderReplaceFunction { /** * @see IndividualPlaceholder#getReplacement(Player, String) diff --git a/plugin/src/main/java/me/filoghost/holographicdisplays/plugin/api/current/DefaultHolographicDisplaysAPI.java b/plugin/src/main/java/me/filoghost/holographicdisplays/plugin/api/current/DefaultHolographicDisplaysAPI.java index 84b29e56..983f8aad 100644 --- a/plugin/src/main/java/me/filoghost/holographicdisplays/plugin/api/current/DefaultHolographicDisplaysAPI.java +++ b/plugin/src/main/java/me/filoghost/holographicdisplays/plugin/api/current/DefaultHolographicDisplaysAPI.java @@ -11,10 +11,10 @@ import me.filoghost.holographicdisplays.api.beta.Position; import me.filoghost.holographicdisplays.api.beta.hologram.Hologram; import me.filoghost.holographicdisplays.api.beta.placeholder.GlobalPlaceholder; import me.filoghost.holographicdisplays.api.beta.placeholder.GlobalPlaceholderFactory; -import me.filoghost.holographicdisplays.api.beta.placeholder.GlobalPlaceholderReplacementSupplier; +import me.filoghost.holographicdisplays.api.beta.placeholder.GlobalPlaceholderReplaceFunction; import me.filoghost.holographicdisplays.api.beta.placeholder.IndividualPlaceholder; import me.filoghost.holographicdisplays.api.beta.placeholder.IndividualPlaceholderFactory; -import me.filoghost.holographicdisplays.api.beta.placeholder.IndividualPlaceholderReplacementSupplier; +import me.filoghost.holographicdisplays.api.beta.placeholder.IndividualPlaceholderReplaceFunction; import me.filoghost.holographicdisplays.plugin.hologram.base.ImmutablePosition; import me.filoghost.holographicdisplays.plugin.placeholder.registry.PlaceholderRegistry; import org.bukkit.Location; @@ -54,12 +54,12 @@ class DefaultHolographicDisplaysAPI implements HolographicDisplaysAPI { } @Override - public void registerGlobalPlaceholder(@NotNull String identifier, int refreshIntervalTicks, @NotNull GlobalPlaceholderReplacementSupplier replacementSupplier) { + public void registerGlobalPlaceholder(@NotNull String identifier, int refreshIntervalTicks, @NotNull GlobalPlaceholderReplaceFunction replaceFunction) { checkIdentifier(identifier); Preconditions.checkArgument(refreshIntervalTicks >= 0, "refreshIntervalTicks should be positive"); - Preconditions.notNull(replacementSupplier, "replacementSupplier"); + Preconditions.notNull(replaceFunction, "replaceFunction"); - placeholderRegistry.registerGlobalPlaceholder(plugin, identifier, refreshIntervalTicks, replacementSupplier); + placeholderRegistry.registerGlobalPlaceholder(plugin, identifier, refreshIntervalTicks, replaceFunction); } @Override @@ -79,12 +79,12 @@ class DefaultHolographicDisplaysAPI implements HolographicDisplaysAPI { } @Override - public void registerIndividualPlaceholder(@NotNull String identifier, int refreshIntervalTicks, @NotNull IndividualPlaceholderReplacementSupplier replacementSupplier) { + public void registerIndividualPlaceholder(@NotNull String identifier, int refreshIntervalTicks, @NotNull IndividualPlaceholderReplaceFunction replaceFunction) { checkIdentifier(identifier); Preconditions.checkArgument(refreshIntervalTicks >= 0, "refreshIntervalTicks should be positive"); - Preconditions.notNull(replacementSupplier, "replacementSupplier"); + Preconditions.notNull(replaceFunction, "replaceFunction"); - placeholderRegistry.registerIndividualPlaceholder(plugin, identifier, refreshIntervalTicks, replacementSupplier); + placeholderRegistry.registerIndividualPlaceholder(plugin, identifier, refreshIntervalTicks, replaceFunction); } @Override diff --git a/plugin/src/main/java/me/filoghost/holographicdisplays/plugin/placeholder/registry/PlaceholderRegistry.java b/plugin/src/main/java/me/filoghost/holographicdisplays/plugin/placeholder/registry/PlaceholderRegistry.java index 17e3dc0d..b4873791 100644 --- a/plugin/src/main/java/me/filoghost/holographicdisplays/plugin/placeholder/registry/PlaceholderRegistry.java +++ b/plugin/src/main/java/me/filoghost/holographicdisplays/plugin/placeholder/registry/PlaceholderRegistry.java @@ -13,10 +13,10 @@ import me.filoghost.fcommons.collection.CollectionUtils; import me.filoghost.fcommons.logging.Log; import me.filoghost.holographicdisplays.api.beta.placeholder.GlobalPlaceholder; import me.filoghost.holographicdisplays.api.beta.placeholder.GlobalPlaceholderFactory; -import me.filoghost.holographicdisplays.api.beta.placeholder.GlobalPlaceholderReplacementSupplier; +import me.filoghost.holographicdisplays.api.beta.placeholder.GlobalPlaceholderReplaceFunction; import me.filoghost.holographicdisplays.api.beta.placeholder.IndividualPlaceholder; import me.filoghost.holographicdisplays.api.beta.placeholder.IndividualPlaceholderFactory; -import me.filoghost.holographicdisplays.api.beta.placeholder.IndividualPlaceholderReplacementSupplier; +import me.filoghost.holographicdisplays.api.beta.placeholder.IndividualPlaceholderReplaceFunction; import me.filoghost.holographicdisplays.plugin.placeholder.PlaceholderIdentifier; import me.filoghost.holographicdisplays.plugin.placeholder.PlaceholderOccurrence; import me.filoghost.holographicdisplays.plugin.placeholder.PluginName; @@ -43,8 +43,8 @@ public class PlaceholderRegistry { } public void registerIndividualPlaceholder( - Plugin plugin, String identifier, int refreshIntervalTicks, IndividualPlaceholderReplacementSupplier replacementSupplier) { - registerIndividualPlaceholder(plugin, identifier, new SimpleIndividualPlaceholder(refreshIntervalTicks, replacementSupplier)); + Plugin plugin, String identifier, int refreshIntervalTicks, IndividualPlaceholderReplaceFunction replaceFunction) { + registerIndividualPlaceholder(plugin, identifier, new SimpleIndividualPlaceholder(refreshIntervalTicks, replaceFunction)); } public void registerIndividualPlaceholder(Plugin plugin, String identifier, IndividualPlaceholder placeholder) { @@ -57,8 +57,8 @@ public class PlaceholderRegistry { } public void registerGlobalPlaceholder( - Plugin plugin, String identifier, int refreshIntervalTicks, GlobalPlaceholderReplacementSupplier replacementSupplier) { - registerGlobalPlaceholder(plugin, identifier, new SimpleGlobalPlaceholder(refreshIntervalTicks, replacementSupplier)); + Plugin plugin, String identifier, int refreshIntervalTicks, GlobalPlaceholderReplaceFunction replaceFunction) { + registerGlobalPlaceholder(plugin, identifier, new SimpleGlobalPlaceholder(refreshIntervalTicks, replaceFunction)); } public void registerGlobalPlaceholder(Plugin plugin, String identifier, GlobalPlaceholder placeholder) { @@ -122,14 +122,14 @@ public class PlaceholderRegistry { Plugin plugin, String textPlaceholder, int refreshIntervalTicks, - GlobalPlaceholderReplacementSupplier replacementSupplier) { + GlobalPlaceholderReplaceFunction replaceFunction) { String identifier = convertToNewFormat(textPlaceholder); if (!identifier.equals(textPlaceholder)) { Log.warning("The plugin " + plugin.getName() + " registered the placeholder " + textPlaceholder + " with the old v2 API, but it doesn't comply with the new format. In order to display it," + " you must use {" + textPlaceholder + "} instead."); } - GlobalPlaceholder placeholder = new SimpleGlobalPlaceholder(refreshIntervalTicks, replacementSupplier); + GlobalPlaceholder placeholder = new SimpleGlobalPlaceholder(refreshIntervalTicks, replaceFunction); GlobalPlaceholderFactory placeholderFactory = (String argument) -> placeholder; LegacyGlobalPlaceholderExpansion expansion = new LegacyGlobalPlaceholderExpansion( plugin, diff --git a/plugin/src/main/java/me/filoghost/holographicdisplays/plugin/placeholder/registry/SimpleGlobalPlaceholder.java b/plugin/src/main/java/me/filoghost/holographicdisplays/plugin/placeholder/registry/SimpleGlobalPlaceholder.java index 1c90223e..9f6c6881 100644 --- a/plugin/src/main/java/me/filoghost/holographicdisplays/plugin/placeholder/registry/SimpleGlobalPlaceholder.java +++ b/plugin/src/main/java/me/filoghost/holographicdisplays/plugin/placeholder/registry/SimpleGlobalPlaceholder.java @@ -6,16 +6,16 @@ package me.filoghost.holographicdisplays.plugin.placeholder.registry; import me.filoghost.holographicdisplays.api.beta.placeholder.GlobalPlaceholder; -import me.filoghost.holographicdisplays.api.beta.placeholder.GlobalPlaceholderReplacementSupplier; +import me.filoghost.holographicdisplays.api.beta.placeholder.GlobalPlaceholderReplaceFunction; class SimpleGlobalPlaceholder implements GlobalPlaceholder { private final int refreshIntervalTicks; - private final GlobalPlaceholderReplacementSupplier replacementSupplier; + private final GlobalPlaceholderReplaceFunction replaceFunction; - SimpleGlobalPlaceholder(int refreshIntervalTicks, GlobalPlaceholderReplacementSupplier replacementSupplier) { + SimpleGlobalPlaceholder(int refreshIntervalTicks, GlobalPlaceholderReplaceFunction replaceFunction) { this.refreshIntervalTicks = refreshIntervalTicks; - this.replacementSupplier = replacementSupplier; + this.replaceFunction = replaceFunction; } @Override @@ -25,7 +25,7 @@ class SimpleGlobalPlaceholder implements GlobalPlaceholder { @Override public String getReplacement(String argument) { - return replacementSupplier.getReplacement(argument); + return replaceFunction.getReplacement(argument); } } diff --git a/plugin/src/main/java/me/filoghost/holographicdisplays/plugin/placeholder/registry/SimpleIndividualPlaceholder.java b/plugin/src/main/java/me/filoghost/holographicdisplays/plugin/placeholder/registry/SimpleIndividualPlaceholder.java index ad20edad..946dc0c3 100644 --- a/plugin/src/main/java/me/filoghost/holographicdisplays/plugin/placeholder/registry/SimpleIndividualPlaceholder.java +++ b/plugin/src/main/java/me/filoghost/holographicdisplays/plugin/placeholder/registry/SimpleIndividualPlaceholder.java @@ -6,7 +6,7 @@ package me.filoghost.holographicdisplays.plugin.placeholder.registry; import me.filoghost.holographicdisplays.api.beta.placeholder.IndividualPlaceholder; -import me.filoghost.holographicdisplays.api.beta.placeholder.IndividualPlaceholderReplacementSupplier; +import me.filoghost.holographicdisplays.api.beta.placeholder.IndividualPlaceholderReplaceFunction; import org.bukkit.entity.Player; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -14,11 +14,11 @@ import org.jetbrains.annotations.Nullable; class SimpleIndividualPlaceholder implements IndividualPlaceholder { private final int refreshIntervalTicks; - private final IndividualPlaceholderReplacementSupplier replacementSupplier; + private final IndividualPlaceholderReplaceFunction replaceFunction; - SimpleIndividualPlaceholder(int refreshIntervalTicks, IndividualPlaceholderReplacementSupplier replacementSupplier) { + SimpleIndividualPlaceholder(int refreshIntervalTicks, IndividualPlaceholderReplaceFunction replaceFunction) { this.refreshIntervalTicks = refreshIntervalTicks; - this.replacementSupplier = replacementSupplier; + this.replaceFunction = replaceFunction; } @Override @@ -28,7 +28,7 @@ class SimpleIndividualPlaceholder implements IndividualPlaceholder { @Override public String getReplacement(@NotNull Player player, @Nullable String argument) { - return replacementSupplier.getReplacement(player, argument); + return replaceFunction.getReplacement(player, argument); } }