Skip to content

Commit 01789b0

Browse files
committed
Cleanup import stuff
1 parent 895d997 commit 01789b0

File tree

1 file changed

+12
-14
lines changed

1 file changed

+12
-14
lines changed

src/main/kotlin/org/polyfrost/polyhitbox/HitboxRenderer.kt

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ import dev.deftu.omnicore.common.offsetBy
1515
import net.minecraft.util.math.Box
1616
import org.polyfrost.polyui.color.PolyColor
1717

18+
//#if MC <=1.16.5
19+
//$$ import org.lwjgl.opengl.GL11
20+
//#endif
21+
1822
const val Z_FIGHTING_OFFSET = 0.01 // (to prevent z-fighting)
1923

2024
val BOX_PIPELINE: OmniRenderPipeline = OmniRenderPipeline.builderWithDefaultShader(
@@ -70,7 +74,7 @@ fun renderHitbox(stack: OmniMatrixStack, hitbox: HitboxState) {
7074
}
7175

7276
//#if MC <=1.16.5
73-
//$$ org.lwjgl.opengl.GL11.glLineStipple(info.dashFactor, 0xAAAA.toShort())
77+
//$$ GL11.glLineStipple(info.dashFactor, 0xAAAA.toShort())
7478
//#endif
7579
OmniRenderState.disableTexture2D()
7680
OmniRenderState.disableLighting() // TODO: Figure out why mobs lighting is affected
@@ -80,16 +84,14 @@ fun renderHitbox(stack: OmniMatrixStack, hitbox: HitboxState) {
8084
if (outline.isShown) {
8185
//#if MC <=1.16.5
8286
//$$ if (outline.isDashed) {
83-
//$$ org.lwjgl.opengl.GL11.glEnable(org.lwjgl.opengl.GL11.GL_LINE_STIPPLE)
87+
//$$ GL11.glEnable(GL11.GL_LINE_STIPPLE)
8488
//$$ }
8589
//#endif
86-
8790
setLineWidth(outline.width)
8891
renderOutlineBox(OUTLINE_BOX_PIPELINE, stack, entityBoundingBox, outline.getColor())
89-
9092
//#if MC <=1.16.5
9193
//$$ if (outline.isDashed) {
92-
//$$ org.lwjgl.opengl.GL11.glDisable(org.lwjgl.opengl.GL11.GL_LINE_STIPPLE)
94+
//$$ GL11.glDisable(GL11.GL_LINE_STIPPLE)
9395
//$$ }
9496
//#endif
9597
}
@@ -121,16 +123,14 @@ fun renderHitbox(stack: OmniMatrixStack, hitbox: HitboxState) {
121123

122124
//#if MC <=1.16.5
123125
//$$ if (eyeline.isDashed) {
124-
//$$ org.lwjgl.opengl.GL11.glEnable(org.lwjgl.opengl.GL11.GL_LINE_STIPPLE)
126+
//$$ GL11.glEnable(GL11.GL_LINE_STIPPLE)
125127
//$$ }
126128
//#endif
127-
128129
setLineWidth(eyeline.width)
129130
renderOutlineBox(OUTLINE_BOX_PIPELINE, stack, boundingBox, eyeline.getColor())
130-
131131
//#if MC <=1.16.5
132132
//$$ if (eyeline.isDashed) {
133-
//$$ org.lwjgl.opengl.GL11.glDisable(org.lwjgl.opengl.GL11.GL_LINE_STIPPLE)
133+
//$$ GL11.glDisable(GL11.GL_LINE_STIPPLE)
134134
//$$ }
135135
//#endif
136136
}
@@ -141,10 +141,9 @@ fun renderHitbox(stack: OmniMatrixStack, hitbox: HitboxState) {
141141
if (viewRay.isShown) {
142142
//#if MC <=1.16.5
143143
//$$ if (viewRay.isDashed) {
144-
//$$ org.lwjgl.opengl.GL11.glEnable(org.lwjgl.opengl.GL11.GL_LINE_STIPPLE)
144+
//$$ GL11.glEnable(GL11.GL_LINE_STIPPLE)
145145
//$$ }
146146
//#endif
147-
148147
setLineWidth(viewRay.width)
149148
renderViewRay(
150149
VIEW_RAY_PIPELINE,
@@ -154,10 +153,9 @@ fun renderHitbox(stack: OmniMatrixStack, hitbox: HitboxState) {
154153
hitbox.eyeHeight,
155154
viewRay.getColor()
156155
)
157-
158156
//#if MC <=1.16.5
159157
//$$ if (viewRay.isDashed) {
160-
//$$ org.lwjgl.opengl.GL11.glDisable(org.lwjgl.opengl.GL11.GL_LINE_STIPPLE)
158+
//$$ GL11.glDisable(GL11.GL_LINE_STIPPLE)
161159
//$$ }
162160
//#endif
163161
}
@@ -318,6 +316,6 @@ private fun setLineWidth(width: Float) {
318316
//#if MC >=1.16.5
319317
com.mojang.blaze3d.systems.RenderSystem.lineWidth(width)
320318
//#else
321-
//$$ org.lwjgl.opengl.GL11.glLineWidth(width)
319+
//$$ GL11.glLineWidth(width)
322320
//#endif
323321
}

0 commit comments

Comments
 (0)