2020-04-15 14:22:03 +02:00
|
|
|
package com.minelittlepony.unicopia.command;
|
|
|
|
|
2020-06-26 11:44:47 +02:00
|
|
|
import net.fabricmc.fabric.api.command.v1.CommandRegistrationCallback;
|
2020-04-15 14:22:03 +02:00
|
|
|
import net.fabricmc.loader.api.FabricLoader;
|
2021-01-21 15:07:49 +01:00
|
|
|
import net.minecraft.command.argument.ArgumentTypes;
|
2020-04-15 14:22:03 +02:00
|
|
|
import net.minecraft.server.MinecraftServer;
|
|
|
|
|
|
|
|
public class Commands {
|
2021-12-28 17:22:08 +01:00
|
|
|
@SuppressWarnings({ "deprecation", "unchecked", "rawtypes" })
|
2020-04-15 14:22:03 +02:00
|
|
|
public static void bootstrap() {
|
2021-12-28 17:22:08 +01:00
|
|
|
ArgumentTypes.register("unicopia:enumeration", EnumArgumentType.class, new EnumArgumentType.Serializer());
|
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);
|
2021-12-28 17:22:08 +01:00
|
|
|
TraitCommand.register(dispatcher);
|
2022-01-04 16:57:57 +01:00
|
|
|
EmoteCommand.register(dispatcher);
|
2020-06-26 11:44:47 +02:00
|
|
|
});
|
2020-04-15 14:22:03 +02:00
|
|
|
Object game = FabricLoader.getInstance().getGameInstance();
|
|
|
|
if (game instanceof MinecraftServer) {
|
|
|
|
((MinecraftServer)game).setFlightEnabled(true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|