CallFunction.java
net.minecraft.commands.execution.tasks.CallFunction
信息
- 全限定名:net.minecraft.commands.execution.tasks.CallFunction
- 类型:public class
- 包:net.minecraft.commands.execution.tasks
- 源码路径:src/main/java/net/minecraft/commands/execution/tasks/CallFunction.java
- 起始行号:L13
- 实现:UnboundEntryAction
- 职责:
TODO
字段/常量
-
function- 类型:
InstantiatedFunction<T> - 修饰符:
private final - 源码定位:
L14 - 说明:
TODO
- 类型:
-
resultCallback- 类型:
CommandResultCallback - 修饰符:
private final - 源码定位:
L15 - 说明:
TODO
- 类型:
-
returnParentFrame- 类型:
boolean - 修饰符:
private final - 源码定位:
L16 - 说明:
TODO
- 类型:
内部类/嵌套类型
- 无
构造器
public CallFunction(InstantiatedFunction<T> function, CommandResultCallback resultCallback, boolean returnParentFrame) @ L18
- 构造器名:CallFunction
- 源码定位:L18
- 修饰符:public
参数:
- function: InstantiatedFunction
- resultCallback: CommandResultCallback
- returnParentFrame: boolean
说明:
TODO
方法
下面的方法块按源码顺序生成。
public void execute(T sender, ExecutionContext<T> context, Frame frame) @ L24
- 方法名:execute
- 源码定位:L24
- 返回类型:void
- 修饰符:public
参数:
- sender: T
- context: ExecutionContext
- frame: Frame
说明:
TODO
代码
public class CallFunction<T extends ExecutionCommandSource<T>> implements UnboundEntryAction<T> {
private final InstantiatedFunction<T> function;
private final CommandResultCallback resultCallback;
private final boolean returnParentFrame;
public CallFunction(InstantiatedFunction<T> function, CommandResultCallback resultCallback, boolean returnParentFrame) {
this.function = function;
this.resultCallback = resultCallback;
this.returnParentFrame = returnParentFrame;
}
public void execute(T sender, ExecutionContext<T> context, Frame frame) {
context.incrementCost();
List<UnboundEntryAction<T>> contents = this.function.entries();
TraceCallbacks tracer = context.tracer();
if (tracer != null) {
tracer.onCall(frame.depth(), this.function.id(), this.function.entries().size());
}
int newDepth = frame.depth() + 1;
Frame.FrameControl frameControl = this.returnParentFrame ? frame.frameControl() : context.frameControlForDepth(newDepth);
Frame newFrame = new Frame(newDepth, this.resultCallback, frameControl);
ContinuationTask.schedule(context, newFrame, contents, (frame1, entryAction) -> new CommandQueueEntry<>(frame1, entryAction.bind(sender)));
}
}引用的其他类
-
- 引用位置:
参数/字段
- 引用位置:
-
- 引用位置:
参数
- 引用位置:
-
- 引用位置:
参数/构造调用 - 关联成员:
Frame()
- 引用位置:
-
- 引用位置:
实现
- 引用位置:
-
- 引用位置:
方法调用 - 关联成员:
ContinuationTask.schedule()
- 引用位置:
-
- 引用位置:
参数/字段
- 引用位置: