Skip to content

Commit fffc093

Browse files
committed
refactor: fix errors in RenderUtil
[no ci]
1 parent 6fa207d commit fffc093

File tree

6 files changed

+150
-249
lines changed

6 files changed

+150
-249
lines changed

mod/src/main/kotlin/gg/skytils/skytilsmod/features/impl/events/GriffinBurrows.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,9 @@ object GriffinBurrows : EventSubscriber {
384384
(0.1f + 0.005f * distSq.toFloat()).coerceAtLeast(0.2f)
385385
)
386386
// disable texture 2d
387-
if (distSq > 5 * 5) RenderUtil.renderBeaconBeam(renderX, renderY + 1, renderZ, this.color.rgb, 1.0f, partialTicks)
387+
matrixStack.push()
388+
matrixStack.translate(renderX, renderY, renderZ)
389+
if (distSq > 5 * 5) RenderUtil.renderBeaconBeam(matrixStack, this.color.rgb, partialTicks)
388390
RenderUtil.renderWaypointText(
389391
waypointText,
390392
x + 0.5,

mod/src/main/kotlin/gg/skytils/skytilsmod/features/impl/events/TechnoMayor.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,9 @@ object TechnoMayor : EventSubscriber {
8585
val distSq = x * x + y * y + z * z
8686
GlStateManager._disableCull()
8787
// disable texture 2d
88-
89-
if (distSq > 5 * 5) RenderUtil.renderBeaconBeam(x, y, z, Color(114, 245, 82).rgb, 0.75f, event.partialTicks)
88+
matrixStack.push()
89+
matrixStack.translate(x, y, z)
90+
if (distSq > 5 * 5) RenderUtil.renderBeaconBeam(matrixStack, 0x72f552, event.partialTicks)
9091
GlStateManager._disableDepthTest()
9192
RenderUtil.renderWaypointText(
9293
"Orb",

mod/src/main/kotlin/gg/skytils/skytilsmod/features/impl/farming/GardenFeatures.kt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,6 @@ object GardenFeatures : EventSubscriber {
112112
if (baseState.block !in trashBlocks) return
113113
RenderUtil.drawSelectionBox(
114114
base,
115-
baseState.block,
116115
Skytils.config.samScytheColor,
117116
event.partialTicks,
118117
)
@@ -123,7 +122,6 @@ object GardenFeatures : EventSubscriber {
123122
if (state.block in trashBlocks) {
124123
RenderUtil.drawSelectionBox(
125124
pos,
126-
state.block,
127125
Skytils.config.samScytheColor,
128126
event.partialTicks,
129127
)

mod/src/main/kotlin/gg/skytils/skytilsmod/features/impl/misc/ItemFeatures.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -824,7 +824,6 @@ object ItemFeatures : EventSubscriber {
824824
if (isValidEtherwarpPos(obj)) {
825825
RenderUtil.drawSelectionBox(
826826
block,
827-
state.block,
828827
Skytils.config.showEtherwarpTeleportPosColor,
829828
event.partialTicks
830829
)

mod/src/main/kotlin/gg/skytils/skytilsmod/features/impl/spidersden/RelicWaypoints.kt

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -96,14 +96,14 @@ object RelicWaypoints : Tracker("found_spiders_den_relics"), EventSubscriber {
9696
Color(114, 245, 82),
9797
1f
9898
)
99+
matrixStack.push()
100+
matrixStack.translate(x, y+1, z)
99101
if (distSq > 5 * 5) RenderUtil.renderBeaconBeam(
100-
x,
101-
y + 1,
102-
z,
102+
matrixStack,
103103
Color(114, 245, 82).rgb,
104-
1.0f,
105104
event.partialTicks
106105
)
106+
matrixStack.pop()
107107
RenderUtil.renderWaypointText("Relic", relic, event.partialTicks, matrixStack)
108108
// disable lighting
109109
GlStateManager._enableDepthTest()
@@ -124,14 +124,14 @@ object RelicWaypoints : Tracker("found_spiders_den_relics"), EventSubscriber {
124124
Color(152, 41, 222),
125125
1f
126126
)
127+
matrixStack.push()
128+
matrixStack.translate(x, y+1, z)
127129
if (distSq > 5 * 5) RenderUtil.renderBeaconBeam(
128-
x,
129-
y + 1,
130-
z,
130+
matrixStack,
131131
Color(152, 41, 222).rgb,
132-
1.0f,
133132
event.partialTicks
134133
)
134+
matrixStack.pop()
135135
RenderUtil.renderWaypointText("Rare Relic", relic, event.partialTicks, matrixStack)
136136
// disable lighting
137137
GlStateManager._enableDepthTest()

0 commit comments

Comments
 (0)