Skip to content

Commit 1018e80

Browse files
committed
update thruster debug code
1 parent 190c034 commit 1018e80

1 file changed

Lines changed: 23 additions & 27 deletions

File tree

src/main/java/dev/propulsionteam/propulsionsimulated/content/thruster/ThrusterDebugRenderer.java

Lines changed: 23 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,11 @@ public static void debug_drawRenderBoundingBox(AbstractThrusterBlockEntity be, P
4141
}
4242

4343
public static void render(AbstractThrusterBlockEntity be, PoseStack ms, MultiBufferSource buffer) {
44-
if (be == null || be.isRemoved() || be.getLevel() == null) {
44+
if (!PropulsionDebug.isDebug(MainDebugRoute.THRUSTER) || be == null || be.isRemoved() || be.getLevel() == null) {
4545
return;
4646
}
4747
debug_drawRenderBoundingBox(be, ms, buffer);
4848

49-
if (!PropulsionDebug.isDebug(MainDebugRoute.THRUSTER)) {
50-
return;
51-
}
52-
5349
AbstractThrusterBlockEntity.WorldExhaustRay worldRay = be.getWorldExhaustRay();
5450
if (worldRay == null || worldRay.direction().lengthSqr() < 1.0e-8) {
5551
return;
@@ -63,30 +59,30 @@ public static void render(AbstractThrusterBlockEntity be, PoseStack ms, MultiBuf
6359
String idBase = "thruster_debug_" + be.getBlockPos().asLong();
6460

6561
DebugRenderer.drawElongatedBox(
66-
idBase + "_ray",
67-
worldRay.nozzlePos(),
68-
worldEnd,
69-
LINE_THICKNESS,
70-
new Color(0, 255, 255, 255),
71-
false,
72-
RENDER_TICKS
62+
idBase + "_ray",
63+
worldRay.nozzlePos(),
64+
worldEnd,
65+
LINE_THICKNESS,
66+
new Color(0, 255, 255, 255),
67+
false,
68+
RENDER_TICKS
7369
);
7470
DebugRenderer.drawBox(idBase + "_origin", worldRay.nozzlePos(), new Vec3(0.12, 0.12, 0.12), Color.GREEN, RENDER_TICKS);
7571

7672
BlockHitResult hitResult = worldLevel.clip(new ClipContext(
77-
traceStart,
78-
worldEnd,
79-
ClipContext.Block.COLLIDER,
80-
ClipContext.Fluid.NONE,
81-
net.minecraft.world.phys.shapes.CollisionContext.empty()
73+
traceStart,
74+
worldEnd,
75+
ClipContext.Block.COLLIDER,
76+
ClipContext.Fluid.NONE,
77+
net.minecraft.world.phys.shapes.CollisionContext.empty()
8278
));
8379
if (hitResult.getType() == BlockHitResult.Type.BLOCK) {
8480
DebugRenderer.drawBox(
85-
idBase + "_ray_hit",
86-
hitResult.getLocation(),
87-
new Vec3(0.14, 0.14, 0.14),
88-
new Color(255, 100, 100, 255),
89-
RENDER_TICKS
81+
idBase + "_ray_hit",
82+
hitResult.getLocation(),
83+
new Vec3(0.14, 0.14, 0.14),
84+
new Color(255, 100, 100, 255),
85+
RENDER_TICKS
9086
);
9187
}
9288

@@ -112,11 +108,11 @@ public static void render(AbstractThrusterBlockEntity be, PoseStack ms, MultiBuf
112108
}
113109

114110
DebugRenderer.drawBox(
115-
idBase + "_hit_" + hitIndex,
116-
Vec3.atCenterOf(hitPos),
117-
new Vec3(0.98, 0.98, 0.98),
118-
new Color(255, 64, 64, 255),
119-
RENDER_TICKS
111+
idBase + "_hit_" + hitIndex,
112+
Vec3.atCenterOf(hitPos),
113+
new Vec3(0.98, 0.98, 0.98),
114+
new Color(255, 64, 64, 255),
115+
RENDER_TICKS
120116
);
121117
hitIndex++;
122118
}

0 commit comments

Comments
 (0)