mirror of
https://github.com/ViaVersion/ViaFabric.git
synced 2024-12-23 16:37:44 +01:00
check envtype before registering client comamnds
This commit is contained in:
parent
bd7274d345
commit
f720b205be
@ -14,6 +14,7 @@ import com.mojang.brigadier.builder.LiteralArgumentBuilder;
|
|||||||
import com.mojang.brigadier.builder.RequiredArgumentBuilder;
|
import com.mojang.brigadier.builder.RequiredArgumentBuilder;
|
||||||
import io.netty.channel.DefaultEventLoop;
|
import io.netty.channel.DefaultEventLoop;
|
||||||
import io.netty.channel.EventLoop;
|
import io.netty.channel.EventLoop;
|
||||||
|
import net.fabricmc.api.EnvType;
|
||||||
import net.fabricmc.api.ModInitializer;
|
import net.fabricmc.api.ModInitializer;
|
||||||
import net.fabricmc.fabric.api.client.command.v1.ClientCommandManager;
|
import net.fabricmc.fabric.api.client.command.v1.ClientCommandManager;
|
||||||
import net.fabricmc.fabric.api.command.v1.CommandRegistrationCallback;
|
import net.fabricmc.fabric.api.command.v1.CommandRegistrationCallback;
|
||||||
@ -100,8 +101,10 @@ public class ViaFabric implements ModInitializer {
|
|||||||
CommandRegistrationCallback.EVENT.register((dispatcher, dedicated) -> dispatcher.register(command("viaversion")));
|
CommandRegistrationCallback.EVENT.register((dispatcher, dedicated) -> dispatcher.register(command("viaversion")));
|
||||||
CommandRegistrationCallback.EVENT.register((dispatcher, dedicated) -> dispatcher.register(command("viaver")));
|
CommandRegistrationCallback.EVENT.register((dispatcher, dedicated) -> dispatcher.register(command("viaver")));
|
||||||
CommandRegistrationCallback.EVENT.register((dispatcher, dedicated) -> dispatcher.register(command("vvfabric")));
|
CommandRegistrationCallback.EVENT.register((dispatcher, dedicated) -> dispatcher.register(command("vvfabric")));
|
||||||
|
if (FabricLoader.getInstance().getEnvironmentType() == EnvType.CLIENT) {
|
||||||
ClientCommandManager.DISPATCHER.register(command("viafabricclient"));
|
ClientCommandManager.DISPATCHER.register(command("viafabricclient"));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@SuppressWarnings("deprecation")
|
@SuppressWarnings("deprecation")
|
||||||
private void registerCommandsV0() {
|
private void registerCommandsV0() {
|
||||||
|
Loading…
Reference in New Issue
Block a user