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

25 lines
1 KiB
Java
Raw Normal View History

package com.minelittlepony.unicopia.command;
2020-06-26 11:44:47 +02:00
import net.fabricmc.fabric.api.command.v1.CommandRegistrationCallback;
import net.fabricmc.loader.api.FabricLoader;
import net.minecraft.command.argument.ArgumentTypes;
import net.minecraft.command.argument.serialize.ConstantArgumentSerializer;
import net.minecraft.server.MinecraftServer;
public class Commands {
public static void bootstrap() {
ArgumentTypes.register("unicopia:race", RaceArgument.class, new ConstantArgumentSerializer<>(RaceArgument::new));
2020-06-26 11:44:47 +02:00
CommandRegistrationCallback.EVENT.register((dispatcher, dedicated) -> {
SpeciesCommand.register(dispatcher);
RacelistCommand.register(dispatcher);
GravityCommand.register(dispatcher);
DisguiseCommand.register(dispatcher);
});
@SuppressWarnings("deprecation")
Object game = FabricLoader.getInstance().getGameInstance();
if (game instanceof MinecraftServer) {
((MinecraftServer)game).setFlightEnabled(true);
}
}
}