dev.the_fireplace.grandeconomy.command.commands.GEReloadCommand 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.tree.CommandNode;
import dev.the_fireplace.grandeconomy.GrandEconomy;
import dev.the_fireplace.grandeconomy.command.GeCommand;
import dev.the_fireplace.lib.api.storage.utility.ReloadableManager;
import net.minecraft.class_2168;
import net.minecraft.class_2170;
public final class GEReloadCommand extends GeCommand {
private final ReloadableManager reloadableManager;
public GEReloadCommand() {
reloadableManager = ReloadableManager.getInstance();
}
@Override
public CommandNode register(CommandDispatcher commandDispatcher) {
return commandDispatcher.register(class_2170.method_9247("gereload")
.requires(requirements::manageServer)
.executes(this::execute)
);
}
private int execute(CommandContext command) {
reloadableManager.reload(GrandEconomy.MODID);
feedbackSender.basic(command, "commands.grandeconomy.reload.reloaded");
return Command.SINGLE_SUCCESS;
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy