mirror of
https://github.com/Creators-of-Create/Create.git
synced 2024-06-02 10:49:31 +02:00
28 lines
840 B
Java
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;
|
|
});
|
|
}
|
|
|
|
}
|