Fix command auto-complete not functioning in multiplayer

This commit is contained in:
Sollace 2021-01-21 16:07:49 +02:00
parent e9e57cb949
commit 23f71c368c

View file

@ -2,10 +2,13 @@ package com.minelittlepony.unicopia.command;
import net.fabricmc.fabric.api.command.v1.CommandRegistrationCallback; import net.fabricmc.fabric.api.command.v1.CommandRegistrationCallback;
import net.fabricmc.loader.api.FabricLoader; import net.fabricmc.loader.api.FabricLoader;
import net.minecraft.command.argument.ArgumentTypes;
import net.minecraft.command.argument.serialize.ConstantArgumentSerializer;
import net.minecraft.server.MinecraftServer; import net.minecraft.server.MinecraftServer;
public class Commands { public class Commands {
public static void bootstrap() { public static void bootstrap() {
ArgumentTypes.register("unicopia:race", RaceArgument.class, new ConstantArgumentSerializer<>(RaceArgument::new));
CommandRegistrationCallback.EVENT.register((dispatcher, dedicated) -> { CommandRegistrationCallback.EVENT.register((dispatcher, dedicated) -> {
SpeciesCommand.register(dispatcher); SpeciesCommand.register(dispatcher);
RacelistCommand.register(dispatcher); RacelistCommand.register(dispatcher);