WorldOverlayRenderer: fix RenderType path and Camera.position() type
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
CI on 3b5e555 revealed:
- net.minecraft.client.renderer.RenderType moved to
net.minecraft.client.renderer.rendertype; use RenderTypes.lines() factory.
- Camera.position() returns Vec3, not Vector3fc as I guessed.
OrderedSubmitNodeCollector, submitShapeOutline, Shapes.block/box,
LevelRenderEvents.AFTER_TRANSLUCENT_FEATURES — all compiled cleanly.
This commit is contained in:
1
.claude/scheduled_tasks.lock
Normal file
1
.claude/scheduled_tasks.lock
Normal file
@@ -0,0 +1 @@
|
|||||||
|
{"sessionId":"59f835d0-c4fe-4a97-8637-b7e0ce9d72ee","pid":1608,"acquiredAt":1782108092590}
|
||||||
@@ -6,12 +6,12 @@ import net.fabricmc.fabric.api.client.rendering.v1.level.LevelRenderContext;
|
|||||||
import net.fabricmc.fabric.api.client.rendering.v1.level.LevelRenderEvents;
|
import net.fabricmc.fabric.api.client.rendering.v1.level.LevelRenderEvents;
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.client.renderer.OrderedSubmitNodeCollector;
|
import net.minecraft.client.renderer.OrderedSubmitNodeCollector;
|
||||||
import net.minecraft.client.renderer.RenderType;
|
|
||||||
import net.minecraft.client.renderer.SubmitNodeCollector;
|
import net.minecraft.client.renderer.SubmitNodeCollector;
|
||||||
|
import net.minecraft.client.renderer.rendertype.RenderTypes;
|
||||||
import net.minecraft.world.entity.player.Player;
|
import net.minecraft.world.entity.player.Player;
|
||||||
|
import net.minecraft.world.phys.Vec3;
|
||||||
import net.minecraft.world.phys.shapes.Shapes;
|
import net.minecraft.world.phys.shapes.Shapes;
|
||||||
import net.minecraft.world.phys.shapes.VoxelShape;
|
import net.minecraft.world.phys.shapes.VoxelShape;
|
||||||
import org.joml.Vector3fc;
|
|
||||||
|
|
||||||
public final class WorldOverlayRenderer {
|
public final class WorldOverlayRenderer {
|
||||||
private static final int FRIEND_COLOR = 0xFF33FF55;
|
private static final int FRIEND_COLOR = 0xFF33FF55;
|
||||||
@@ -33,10 +33,10 @@ public final class WorldOverlayRenderer {
|
|||||||
if (!(base instanceof OrderedSubmitNodeCollector collector)) return;
|
if (!(base instanceof OrderedSubmitNodeCollector collector)) return;
|
||||||
|
|
||||||
PoseStack pose = context.poseStack();
|
PoseStack pose = context.poseStack();
|
||||||
Vector3fc camPos = mc.gameRenderer.mainCamera().position();
|
Vec3 camPos = mc.gameRenderer.mainCamera().position();
|
||||||
double cx = camPos.x();
|
double cx = camPos.x;
|
||||||
double cy = camPos.y();
|
double cy = camPos.y;
|
||||||
double cz = camPos.z();
|
double cz = camPos.z;
|
||||||
|
|
||||||
for (Player player : mc.level.players()) {
|
for (Player player : mc.level.players()) {
|
||||||
if (player == mc.player) continue;
|
if (player == mc.player) continue;
|
||||||
@@ -51,7 +51,7 @@ public final class WorldOverlayRenderer {
|
|||||||
pose.pushPose();
|
pose.pushPose();
|
||||||
pose.translate(px - 0.15, py - 0.15, pz - 0.15);
|
pose.translate(px - 0.15, py - 0.15, pz - 0.15);
|
||||||
VoxelShape dot = Shapes.box(0.0, 0.0, 0.0, 0.3, 0.3, 0.3);
|
VoxelShape dot = Shapes.box(0.0, 0.0, 0.0, 0.3, 0.3, 0.3);
|
||||||
collector.submitShapeOutline(pose, dot, RenderType.lines(), FRIEND_COLOR, OUTLINE_WIDTH, false);
|
collector.submitShapeOutline(pose, dot, RenderTypes.lines(), FRIEND_COLOR, OUTLINE_WIDTH, false);
|
||||||
pose.popPose();
|
pose.popPose();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -65,13 +65,13 @@ public final class WorldOverlayRenderer {
|
|||||||
|
|
||||||
pose.pushPose();
|
pose.pushPose();
|
||||||
pose.translate(mx - 0.5, my, mz - 0.5);
|
pose.translate(mx - 0.5, my, mz - 0.5);
|
||||||
collector.submitShapeOutline(pose, Shapes.block(), RenderType.lines(), MARKER_COLOR, OUTLINE_WIDTH, false);
|
collector.submitShapeOutline(pose, Shapes.block(), RenderTypes.lines(), MARKER_COLOR, OUTLINE_WIDTH, false);
|
||||||
pose.popPose();
|
pose.popPose();
|
||||||
|
|
||||||
pose.pushPose();
|
pose.pushPose();
|
||||||
pose.translate(mx - 0.05, my, mz - 0.05);
|
pose.translate(mx - 0.05, my, mz - 0.05);
|
||||||
VoxelShape beam = Shapes.box(0.0, 0.0, 0.0, 0.1, BEAM_HEIGHT, 0.1);
|
VoxelShape beam = Shapes.box(0.0, 0.0, 0.0, 0.1, BEAM_HEIGHT, 0.1);
|
||||||
collector.submitShapeOutline(pose, beam, RenderType.lines(), MARKER_COLOR, OUTLINE_WIDTH, false);
|
collector.submitShapeOutline(pose, beam, RenderTypes.lines(), MARKER_COLOR, OUTLINE_WIDTH, false);
|
||||||
pose.popPose();
|
pose.popPose();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user