GoalSelectorDebugRenderer.java
net.minecraft.client.renderer.debug.GoalSelectorDebugRenderer
信息
- 全限定名:net.minecraft.client.renderer.debug.GoalSelectorDebugRenderer
- 类型:public class
- 包:net.minecraft.client.renderer.debug
- 源码路径:src/main/java/net/minecraft/client/renderer/debug/GoalSelectorDebugRenderer.java
- 起始行号:L17
- 实现:DebugRenderer.SimpleDebugRenderer
- 职责:
TODO
字段/常量
-
MAX_RENDER_DIST- 类型:
int - 修饰符:
private static final - 源码定位:
L18 - 说明:
TODO
- 类型:
-
minecraft- 类型:
Minecraft - 修饰符:
private final - 源码定位:
L19 - 说明:
TODO
- 类型:
内部类/嵌套类型
- 无
构造器
public GoalSelectorDebugRenderer(Minecraft minecraft) @ L21
- 构造器名:GoalSelectorDebugRenderer
- 源码定位:L21
- 修饰符:public
参数:
- minecraft: Minecraft
说明:
TODO
方法
下面的方法块按源码顺序生成。
public void emitGizmos(double camX, double camY, double camZ, DebugValueAccess debugValues, Frustum frustum, float partialTicks) @ L25
- 方法名:emitGizmos
- 源码定位:L25
- 返回类型:void
- 修饰符:public
参数:
- camX: double
- camY: double
- camZ: double
- debugValues: DebugValueAccess
- frustum: Frustum
- partialTicks: float
说明:
TODO
代码
@OnlyIn(Dist.CLIENT)
public class GoalSelectorDebugRenderer implements DebugRenderer.SimpleDebugRenderer {
private static final int MAX_RENDER_DIST = 160;
private final Minecraft minecraft;
public GoalSelectorDebugRenderer(Minecraft minecraft) {
this.minecraft = minecraft;
}
@Override
public void emitGizmos(double camX, double camY, double camZ, DebugValueAccess debugValues, Frustum frustum, float partialTicks) {
Camera camera = this.minecraft.gameRenderer.getMainCamera();
BlockPos playerPos = BlockPos.containing(camera.position().x, 0.0, camera.position().z);
debugValues.forEachEntity(DebugSubscriptions.GOAL_SELECTORS, (entity, goalInfo) -> {
if (playerPos.closerThan(entity.blockPosition(), 160.0)) {
for (int i = 0; i < goalInfo.goals().size(); i++) {
DebugGoalInfo.DebugGoal goal = goalInfo.goals().get(i);
double x = entity.getBlockX() + 0.5;
double y = entity.getY() + 2.0 + i * 0.25;
double z = entity.getBlockZ() + 0.5;
int color = goal.isRunning() ? -16711936 : -3355444;
Gizmos.billboardText(goal.name(), new Vec3(x, y, z), TextGizmo.Style.forColorAndCentered(color));
}
}
});
}
}引用的其他类
-
- 引用位置:
参数/字段
- 引用位置:
-
- 引用位置:
参数
- 引用位置:
-
- 引用位置:
实现
- 引用位置:
-
- 引用位置:
方法调用 - 关联成员:
BlockPos.containing()
- 引用位置:
-
- 引用位置:
方法调用 - 关联成员:
Gizmos.billboardText()
- 引用位置:
-
- 引用位置:
方法调用 - 关联成员:
TextGizmo.Style.forColorAndCentered()
- 引用位置:
-
- 引用位置:
参数
- 引用位置:
-
- 引用位置:
构造调用 - 关联成员:
Vec3()
- 引用位置: