Unicopia/src/main/java/com/minelittlepony/unicopia/command/Commands.java

27 lines
1.1 KiB
Java
Raw Normal View History

package com.minelittlepony.unicopia.command;
2022-06-25 00:19:55 +02:00
import net.fabricmc.fabric.api.command.v2.CommandRegistrationCallback;
import net.fabricmc.fabric.api.command.v2.ArgumentTypeRegistry;
import net.fabricmc.loader.api.FabricLoader;
import net.minecraft.server.MinecraftServer;
2022-06-25 00:19:55 +02:00
import net.minecraft.util.Identifier;
public class Commands {
2021-12-28 17:22:08 +01:00
@SuppressWarnings({ "deprecation", "unchecked", "rawtypes" })
public static void bootstrap() {
2022-06-25 00:19:55 +02:00
ArgumentTypeRegistry.registerArgumentType(new Identifier("unicopia", "enumeration"), EnumArgumentType.class, new EnumArgumentType.Serializer());
CommandRegistrationCallback.EVENT.register((dispatcher, access, environment) -> {
2020-06-26 11:44:47 +02:00
SpeciesCommand.register(dispatcher);
RacelistCommand.register(dispatcher);
GravityCommand.register(dispatcher);
DisguiseCommand.register(dispatcher);
2021-12-28 17:22:08 +01:00
TraitCommand.register(dispatcher);
EmoteCommand.register(dispatcher);
2020-06-26 11:44:47 +02:00
});
Object game = FabricLoader.getInstance().getGameInstance();
if (game instanceof MinecraftServer) {
((MinecraftServer)game).setFlightEnabled(true);
}
}
}