Unicopia/src/main/java/com/minelittlepony/unicopia/command/Commands.java
2021-12-28 18:22:08 +02:00

24 lines
1 KiB
Java

package com.minelittlepony.unicopia.command;
import net.fabricmc.fabric.api.command.v1.CommandRegistrationCallback;
import net.fabricmc.loader.api.FabricLoader;
import net.minecraft.command.argument.ArgumentTypes;
import net.minecraft.server.MinecraftServer;
public class Commands {
@SuppressWarnings({ "deprecation", "unchecked", "rawtypes" })
public static void bootstrap() {
ArgumentTypes.register("unicopia:enumeration", EnumArgumentType.class, new EnumArgumentType.Serializer());
CommandRegistrationCallback.EVENT.register((dispatcher, dedicated) -> {
SpeciesCommand.register(dispatcher);
RacelistCommand.register(dispatcher);
GravityCommand.register(dispatcher);
DisguiseCommand.register(dispatcher);
TraitCommand.register(dispatcher);
});
Object game = FabricLoader.getInstance().getGameInstance();
if (game instanceof MinecraftServer) {
((MinecraftServer)game).setFlightEnabled(true);
}
}
}