/* * Decompiled with CFR 0.152. * * Could not load the following classes: * com.mojang.brigadier.Command * com.mojang.brigadier.context.CommandContext * com.mojang.brigadier.context.ContextChain * com.mojang.brigadier.exceptions.CommandSyntaxException * org.jspecify.annotations.Nullable */ package net.minecraft.commands.execution; import com.mojang.brigadier.Command; import com.mojang.brigadier.context.CommandContext; import com.mojang.brigadier.context.ContextChain; import com.mojang.brigadier.exceptions.CommandSyntaxException; import net.minecraft.commands.ExecutionCommandSource; import net.minecraft.commands.execution.ChainModifiers; import net.minecraft.commands.execution.ExecutionControl; import net.minecraft.commands.execution.TraceCallbacks; import org.jspecify.annotations.Nullable; public interface CustomCommandExecutor { public void run(T var1, ContextChain var2, ChainModifiers var3, ExecutionControl var4); public static abstract class WithErrorHandling> implements CustomCommandExecutor { @Override public final void run(T sender, ContextChain currentStep, ChainModifiers modifiers, ExecutionControl output) { try { this.runGuarded(sender, currentStep, modifiers, output); } catch (CommandSyntaxException e) { this.onError(e, sender, modifiers, output.tracer()); sender.callback().onFailure(); } } protected void onError(CommandSyntaxException e, T sender, ChainModifiers modifiers, @Nullable TraceCallbacks tracer) { sender.handleError(e, modifiers.isForked(), tracer); } protected abstract void runGuarded(T var1, ContextChain var2, ChainModifiers var3, ExecutionControl var4) throws CommandSyntaxException; } public static interface CommandAdapter extends CustomCommandExecutor, Command { default public int run(CommandContext context) throws CommandSyntaxException { throw new UnsupportedOperationException("This function should not run"); } } }