Search in sources :

Example 1 with PlayerUtils.sendModMessage

use of at.haha007.edenclient.utils.PlayerUtils.sendModMessage in project EdenClient by HahaOO7.

the class Nuker method removeCommand.

private ArgumentBuilder<ClientCommandSource, ?> removeCommand() {
    LiteralArgumentBuilder<ClientCommandSource> cmd = literal("remove");
    cmd.then(argument("type", StringArgumentType.word()).suggests((context, builder) -> {
        for (Block block : filter) {
            builder.suggest(Registry.BLOCK.getId(block).getPath());
        }
        return builder.buildFuture();
    }).executes(context -> {
        String name = context.getArgument("type", String.class);
        Identifier identifier = new Identifier(name);
        filter.remove(Registry.BLOCK.get(identifier));
        PlayerUtils.sendModMessage("Removed " + name);
        return 1;
    }));
    return cmd;
}
Also used : ServerCommandSource(net.minecraft.server.command.ServerCommandSource) PerWorldConfig(at.haha007.edenclient.utils.config.PerWorldConfig) ChatColor(at.haha007.edenclient.utils.ChatColor) PosArgument(net.minecraft.command.argument.PosArgument) PlayerActionC2SPacket(net.minecraft.network.packet.c2s.play.PlayerActionC2SPacket) StringArgumentType(com.mojang.brigadier.arguments.StringArgumentType) Block(net.minecraft.block.Block) CommandManager(at.haha007.edenclient.command.CommandManager) PlayerTickCallback(at.haha007.edenclient.callbacks.PlayerTickCallback) BlockSet(at.haha007.edenclient.utils.config.wrappers.BlockSet) ClientPlayNetworkHandler(net.minecraft.client.network.ClientPlayNetworkHandler) Hand(net.minecraft.util.Hand) BlockState(net.minecraft.block.BlockState) BlockPosArgumentType(net.minecraft.command.argument.BlockPosArgumentType) ClientCommandSource(net.minecraft.client.network.ClientCommandSource) HandSwingC2SPacket(net.minecraft.network.packet.c2s.play.HandSwingC2SPacket) net.minecraft.util.math(net.minecraft.util.math) ClientPlayerInteractionManager(net.minecraft.client.network.ClientPlayerInteractionManager) LiteralArgumentBuilder(com.mojang.brigadier.builder.LiteralArgumentBuilder) Blocks(net.minecraft.block.Blocks) Registry(net.minecraft.util.registry.Registry) PlayerUtils.getHitDirectionForBlock(at.haha007.edenclient.utils.PlayerUtils.getHitDirectionForBlock) List(java.util.List) Stream(java.util.stream.Stream) ConfigSubscriber(at.haha007.edenclient.utils.config.ConfigSubscriber) DoubleArgumentType(com.mojang.brigadier.arguments.DoubleArgumentType) Identifier(net.minecraft.util.Identifier) MinecraftClient(net.minecraft.client.MinecraftClient) ClientPlayerEntity(net.minecraft.client.network.ClientPlayerEntity) Comparator(java.util.Comparator) IntegerArgumentType(com.mojang.brigadier.arguments.IntegerArgumentType) ArgumentBuilder(com.mojang.brigadier.builder.ArgumentBuilder) PlayerUtils(at.haha007.edenclient.utils.PlayerUtils) ClientWorld(net.minecraft.client.world.ClientWorld) Identifier(net.minecraft.util.Identifier) ClientCommandSource(net.minecraft.client.network.ClientCommandSource) Block(net.minecraft.block.Block) PlayerUtils.getHitDirectionForBlock(at.haha007.edenclient.utils.PlayerUtils.getHitDirectionForBlock)

Aggregations

PlayerTickCallback (at.haha007.edenclient.callbacks.PlayerTickCallback)1 CommandManager (at.haha007.edenclient.command.CommandManager)1 ChatColor (at.haha007.edenclient.utils.ChatColor)1 PlayerUtils (at.haha007.edenclient.utils.PlayerUtils)1 PlayerUtils.getHitDirectionForBlock (at.haha007.edenclient.utils.PlayerUtils.getHitDirectionForBlock)1 ConfigSubscriber (at.haha007.edenclient.utils.config.ConfigSubscriber)1 PerWorldConfig (at.haha007.edenclient.utils.config.PerWorldConfig)1 BlockSet (at.haha007.edenclient.utils.config.wrappers.BlockSet)1 DoubleArgumentType (com.mojang.brigadier.arguments.DoubleArgumentType)1 IntegerArgumentType (com.mojang.brigadier.arguments.IntegerArgumentType)1 StringArgumentType (com.mojang.brigadier.arguments.StringArgumentType)1 ArgumentBuilder (com.mojang.brigadier.builder.ArgumentBuilder)1 LiteralArgumentBuilder (com.mojang.brigadier.builder.LiteralArgumentBuilder)1 Comparator (java.util.Comparator)1 List (java.util.List)1 Stream (java.util.stream.Stream)1 Block (net.minecraft.block.Block)1 BlockState (net.minecraft.block.BlockState)1 Blocks (net.minecraft.block.Blocks)1 MinecraftClient (net.minecraft.client.MinecraftClient)1