Skip to content

Commit

Permalink
Scaffold LightLevel module
Browse files Browse the repository at this point in the history
  • Loading branch information
connorslade committed Jan 3, 2024
1 parent 91be0de commit f99acf2
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,15 +77,24 @@ public class DebugRendererMixin {
void render(MatrixStack matrices, VertexConsumerProvider.Immediate vertexConsumers, double cameraX, double cameraY, double cameraZ, CallbackInfo ci) {
if (!Config.getEnabled(DebugRenderers.class)) return;

var debug = List.of(new Pair<>(pathfindingDebugRenderer, DebugRenderers.pathfinding), new Pair<>(waterDebugRenderer, DebugRenderers.water),
new Pair<>(heightmapDebugRenderer, DebugRenderers.heightMap), new Pair<>(collisionDebugRenderer, DebugRenderers.collision),
new Pair<>(supportingBlockDebugRenderer, DebugRenderers.supportingBlock), new Pair<>(neighborUpdateDebugRenderer, DebugRenderers.neighborUpdate),
new Pair<>(structureDebugRenderer, DebugRenderers.structure), new Pair<>(skyLightDebugRenderer, DebugRenderers.skyLight),
new Pair<>(worldGenAttemptDebugRenderer, DebugRenderers.worldGenAttempt), new Pair<>(blockOutlineDebugRenderer, DebugRenderers.blockOutline),
new Pair<>(villageDebugRenderer, DebugRenderers.village), new Pair<>(villageSectionsDebugRenderer, DebugRenderers.villageSections),
new Pair<>(beeDebugRenderer, DebugRenderers.bee), new Pair<>(raidCenterDebugRenderer, DebugRenderers.raidCenter),
new Pair<>(goalSelectorDebugRenderer, DebugRenderers.goalSelector), new Pair<>(gameTestDebugRenderer, DebugRenderers.gameTest),
new Pair<>(gameEventDebugRenderer, DebugRenderers.gameEvent), new Pair<>(lightDebugRenderer, DebugRenderers.light));
var debug = List.of(new Pair<>(pathfindingDebugRenderer, DebugRenderers.pathfinding),
new Pair<>(waterDebugRenderer, DebugRenderers.water),
new Pair<>(heightmapDebugRenderer, DebugRenderers.heightMap),
new Pair<>(collisionDebugRenderer, DebugRenderers.collision),
new Pair<>(supportingBlockDebugRenderer, DebugRenderers.supportingBlock),
new Pair<>(neighborUpdateDebugRenderer, DebugRenderers.neighborUpdate),
new Pair<>(structureDebugRenderer, DebugRenderers.structure),
new Pair<>(skyLightDebugRenderer, DebugRenderers.skyLight),
new Pair<>(worldGenAttemptDebugRenderer, DebugRenderers.worldGenAttempt),
new Pair<>(blockOutlineDebugRenderer, DebugRenderers.blockOutline),
new Pair<>(villageDebugRenderer, DebugRenderers.village),
new Pair<>(villageSectionsDebugRenderer, DebugRenderers.villageSections),
new Pair<>(beeDebugRenderer, DebugRenderers.bee),
new Pair<>(raidCenterDebugRenderer, DebugRenderers.raidCenter),
new Pair<>(goalSelectorDebugRenderer, DebugRenderers.goalSelector),
new Pair<>(gameTestDebugRenderer, DebugRenderers.gameTest),
new Pair<>(gameEventDebugRenderer, DebugRenderers.gameEvent),
new Pair<>(lightDebugRenderer, DebugRenderers.light));

for (var renderer : debug) {
if (renderer.getRight().value()) renderer.getLeft().render(matrices, vertexConsumers, cameraX, cameraY, cameraZ);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package com.connorcode.sigmautils.modules.rendering;

import com.connorcode.sigmautils.event.render.WorldRender;
import com.connorcode.sigmautils.module.Module;
import net.minecraft.client.font.TextRenderer;

import static com.connorcode.sigmautils.SigmaUtils.client;

public class LightLevel extends Module {
void onRender(WorldRender.PostWorldRenderEvent event) {
if (!enabled || client.player == null) return;

var pos = client.player.getBlockPos();
var immediate = client.getBufferBuilders().getEntityVertexConsumers();
client.textRenderer.draw("TEST", 0f, 0f, 0, true, event.getMatrices().peek().getPositionMatrix(), immediate, TextRenderer.TextLayerType.NORMAL, 0, 0, true);
}
}

0 comments on commit f99acf2

Please sign in to comment.