EAA_MOD/src/main/java/net/saltymc/eaa/commands/ReloadCommand.java

33 lines
991 B
Java

package net.saltymc.eaa.commands;
import com.mojang.brigadier.builder.LiteralArgumentBuilder;
import com.mojang.brigadier.context.CommandContext;
import net.fabricmc.fabric.api.client.command.v1.FabricClientCommandSource;
import net.minecraft.text.Text;
import net.saltymc.eaa.function.TagFunction;
import static net.fabricmc.fabric.api.client.command.v1.ClientCommandManager.literal;
public class ReloadCommand extends EaaModCommand{
@Override
public int run(CommandContext<FabricClientCommandSource> context) {
FabricClientCommandSource source = context.getSource();
try {
TagFunction.getHashMap().clear();
source.sendFeedback(Text.of("Reloaded!"));
} catch (Exception e) {
source.sendFeedback(Text.of(e.toString()));
}
return 1;
}
@Override
public LiteralArgumentBuilder<FabricClientCommandSource> getCommandSpecification() {
return literal("/reload").executes(this);
}
}