MCPcopy Create free account
hub / github.com/cabaletta/baritone / onRender

Method onRender

src/main/java/baritone/utils/GuiClick.java:118–135  ·  view source on GitHub ↗
(PoseStack modelViewStack, Matrix4f projectionMatrix)

Source from the content-addressed store, hash-verified

116 }
117
118 public void onRender(PoseStack modelViewStack, Matrix4f projectionMatrix) {
119 this.projectionViewMatrix = new Matrix4f(projectionMatrix);
120 this.projectionViewMatrix.mul(modelViewStack.last().pose());
121 this.projectionViewMatrix.invert();
122
123 if (currentMouseOver != null) {
124 Entity e = mc.getCameraEntity();
125 // drawSingleSelectionBox WHEN?
126 PathRenderer.drawManySelectionBoxes(modelViewStack, e, Collections.singletonList(currentMouseOver), Color.CYAN);
127 if (clickStart != null && !clickStart.equals(currentMouseOver)) {
128 BufferBuilder bufferBuilder = IRenderer.startLines(Color.RED, Baritone.settings().pathRenderLineWidthPixels.value);
129 BetterBlockPos a = new BetterBlockPos(currentMouseOver);
130 BetterBlockPos b = new BetterBlockPos(clickStart);
131 IRenderer.emitAABB(bufferBuilder, modelViewStack, new AABB(Math.min(a.x, b.x), Math.min(a.y, b.y), Math.min(a.z, b.z), Math.max(a.x, b.x) + 1, Math.max(a.y, b.y) + 1, Math.max(a.z, b.z) + 1));
132 IRenderer.endLines(bufferBuilder, true);
133 }
134 }
135 }
136
137 private Vec3 toWorld(double x, double y, double z) {
138 if (this.projectionViewMatrix == null) {

Callers 1

renderMethod · 0.80

Calls 8

startLinesMethod · 0.95
settingsMethod · 0.95
emitAABBMethod · 0.95
endLinesMethod · 0.95
minMethod · 0.65
maxMethod · 0.65
equalsMethod · 0.45

Tested by

no test coverage detected