All Downloads are FREE. Search and download functionalities are using the official Maven repository.

me.deecaad.core.placeholder.NumericPlaceholderHandler Maven / Gradle / Ivy

package me.deecaad.core.placeholder;

import net.kyori.adventure.text.minimessage.tag.TagPattern;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

public abstract class NumericPlaceholderHandler extends PlaceholderHandler {

    public NumericPlaceholderHandler(@TagPattern String placeholderName) {
        super(placeholderName);
    }

    @Nullable @Override
    public final String onRequest(@NotNull PlaceholderData data) {
        Number value = requestValue(data);
        return value == null ? null : value.toString();
    }

    @Nullable public abstract Number requestValue(@NotNull PlaceholderData data);
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy