IsolatedCall .java

net.minecraft.commands.execution.tasks.IsolatedCall (class): members: taskProducer, execute, output. imports: EntryAction, ExecutionControl, Frame.

net.minecraft.commands.execution.tasksclass27 linescommonextends ExecutionCommandSource<T>>1.1 KB

Implements

API Surface (1)

void execute(final ExecutionContext<T> context, final Frame frame)

Fields & Constants (2)

taskProducer
output

Full Source

IsolatedCall.java27 lines · Minecraft 26.3 · verbatim
1
package net.minecraft.commands.execution.tasks;
2
3
import java.util.function.Consumer;
4
import net.minecraft.commands.CommandResultCallback;
5
import net.minecraft.commands.ExecutionCommandSource;
6
import net.minecraft.commands.execution.EntryAction;
7
import net.minecraft.commands.execution.ExecutionContext;
8
import net.minecraft.commands.execution.ExecutionControl;
9
import net.minecraft.commands.execution.Frame;
10
11
public class IsolatedCall<T extends ExecutionCommandSource<T>> implements EntryAction<T> {
12
	private final Consumer<ExecutionControl<T>> taskProducer;
13
	private final CommandResultCallback output;
14
15
	public IsolatedCall(final Consumer<ExecutionControl<T>> taskOutput, final CommandResultCallback output) {
16
		this.taskProducer = taskOutput;
17
		this.output = output;
18
	}
19
20
	@Override
21
	public void execute(final ExecutionContext<T> context, final Frame frame) {
22
		int newFrameDepth = frame.depth() + 1;
23
		Frame newFrame = new Frame(newFrameDepth, this.output, context.frameControlForDepth(newFrameDepth));
24
		this.taskProducer.accept(ExecutionControl.create(context, newFrame));
25
	}
26
}
27

Decompiled Minecraft 26.3 source of IsolatedCall (net/minecraft/commands/execution/tasks/IsolatedCall.java) with Mojang official mappings, stored verbatim on the site.