package net.minecraft.commands.execution.tasks; import java.util.function.Consumer; import net.minecraft.commands.CommandResultCallback; import net.minecraft.commands.ExecutionCommandSource; import net.minecraft.commands.execution.EntryAction; import net.minecraft.commands.execution.ExecutionContext; import net.minecraft.commands.execution.ExecutionControl; import net.minecraft.commands.execution.Frame; public class IsolatedCall> implements EntryAction { private final Consumer> taskProducer; private final CommandResultCallback output; public IsolatedCall(Consumer> taskProducer, CommandResultCallback output) { this.taskProducer = taskProducer; this.output = output; } @Override public void execute(ExecutionContext executionContext, Frame frame) { int i = frame.depth() + 1; Frame frame2 = new Frame(i, this.output, executionContext.frameControlForDepth(i)); this.taskProducer.accept(ExecutionControl.create(executionContext, frame2)); } }