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

dev.the_fireplace.grandeconomy.command.commands.BalanceCommand Maven / Gradle / Ivy

There is a newer version: 4.1.0+1.16.5
Show newest version
package dev.the_fireplace.grandeconomy.command.commands;

import com.mojang.brigadier.Command;
import com.mojang.brigadier.CommandDispatcher;
import com.mojang.brigadier.context.CommandContext;
import com.mojang.brigadier.exceptions.CommandSyntaxException;
import com.mojang.brigadier.tree.CommandNode;
import dev.the_fireplace.grandeconomy.command.CommonTranslationKeys;
import dev.the_fireplace.grandeconomy.command.GeCommand;
import net.minecraft.class_2168;
import net.minecraft.class_2170;

public final class BalanceCommand extends GeCommand {

    @Override
    public CommandNode register(CommandDispatcher commandDispatcher) {
        return commandDispatcher.register(class_2170.method_9247("balance")
            .requires(requirements::player)
            .executes(this::execute)
        );
    }

    private int execute(CommandContext command) throws CommandSyntaxException {
        feedbackSender.basic(command, CommonTranslationKeys.BALANCE, currencyAPI.getFormattedBalance(command.getSource().method_9207().method_5667(), true));
        return Command.SINGLE_SUCCESS;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy