Create/src/main/java/com/simibubi/create/foundation/command/FabulousWarningCommand.java
PepperBell 6800c24c58 Fix command permission requirements
- Commands glue, highlight, and replaceInCommandBlocks now require OP
level 2 instead of 0
2021-09-05 21:14:41 -07:00

31 lines
933 B
Java

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