dev.the_fireplace.grandeconomy.command.commands.BalanceCommand Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of GrandEconomy Show documentation
Show all versions of GrandEconomy Show documentation
A server-side economy mod/api for Minecraft.
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