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

cc.carm.lib.mineconfiguration.bungee.builder.message.BungeeMessageValueBuilder Maven / Gradle / Ivy

There is a newer version: 2.9.3
Show newest version
package cc.carm.lib.mineconfiguration.bungee.builder.message;

import cc.carm.lib.mineconfiguration.bungee.data.TextConfig;
import cc.carm.lib.mineconfiguration.bungee.value.ConfiguredMessage;
import cc.carm.lib.mineconfiguration.common.builder.message.MessageValueBuilder;
import cc.carm.lib.mineconfiguration.common.utils.ParamsUtils;
import net.md_5.bungee.api.CommandSender;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import java.util.function.BiFunction;

public class BungeeMessageValueBuilder
        extends MessageValueBuilder> {

    public BungeeMessageValueBuilder(@NotNull BiFunction<@Nullable CommandSender, @NotNull String, @Nullable M> parser) {
        super(CommandSender.class, TextConfig::new, parser);
    }

    @Override
    protected @NotNull BungeeMessageValueBuilder getThis() {
        return this;
    }

    @Override
    public @NotNull ConfiguredMessage build() {
        return new ConfiguredMessage<>(
                buildManifest(TextConfig.of("")),
                ParamsUtils.formatParams(this.paramFormatter, this.params),
                this.messageParser, this.sendHandler
        );
    }


}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy