CreateMod/src/main/java/com/simibubi/create/foundation/command/ConfigCommand.java
2021-04-15 15:44:26 +02:00

28 lines
840 B
Java

package com.simibubi.create.foundation.command;
import net.minecraft.command.CommandSource;
import net.minecraft.command.Commands;
import net.minecraft.entity.player.ServerPlayerEntity;
import net.minecraftforge.fml.network.PacketDistributor;
import com.mojang.brigadier.Command;
import com.mojang.brigadier.builder.ArgumentBuilder;
import com.simibubi.create.foundation.networking.AllPackets;
public class ConfigCommand {
public static ArgumentBuilder<CommandSource, ?> register() {
return Commands.literal("config")
.executes(ctx -> {
ServerPlayerEntity player = ctx.getSource().asPlayer();
AllPackets.channel.send(
PacketDistributor.PLAYER.with(() -> player),
new SConfigureConfigPacket(SConfigureConfigPacket.Actions.configScreen.name(), "")
);
return Command.SINGLE_SUCCESS;
});
}
}