Skip to content

Commit 74a2724

Browse files
committed
Fixes
1 parent b95476c commit 74a2724

6 files changed

Lines changed: 40 additions & 12 deletions

File tree

src/main/java/com/nekiplay/hypixelcry/features/macros/GhostBlocks.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ private static ActionResult keyEvent(KeyEvent keyEvent) {
3737
}
3838

3939
private static void handleGhostBlocks() {
40-
if (mc.player == null || mc.world == null) return;
40+
if (mc.player == null || mc.world == null || mc.currentScreen != null) return;
4141

4242
HitResult mouseOver = mc.player.raycast(HypixelCry.config.macros.ghostBlocks.range, 1, false);
4343
if (mouseOver instanceof BlockHitResult blockHitResult) {

src/main/kotlin/com/nekiplay/hypixelcry/features/lua/objects/render/WorldRendererObject.kt

Lines changed: 35 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
11
package com.nekiplay.hypixelcry.features.lua.objects.render
22

3+
import com.nekiplay.hypixelcry.utils.SpecialColor.toSpecialColorIntNoAlpha
34
import com.nekiplay.hypixelcry.utils.render.RenderHelper
45
import net.fabricmc.fabric.api.client.rendering.v1.WorldRenderContext
56
import net.minecraft.text.Text
67
import net.minecraft.util.math.BlockPos
78
import net.minecraft.util.math.Vec3d
89
import org.luaj.vm2.LuaValue
910
import org.luaj.vm2.lib.OneArgFunction
11+
import java.awt.Color
12+
import kotlin.collections.component1
13+
import kotlin.collections.component2
14+
import kotlin.collections.component3
1015

1116
class WorldRendererObject(private val context: WorldRenderContext?): LuaValue() {
1217
override fun call(): LuaValue {
@@ -91,23 +96,42 @@ class WorldRendererObject(private val context: WorldRenderContext?): LuaValue()
9196
val y: Double = if (table.get("y").isnumber()) table.get("y").todouble() else 0.0
9297
val z: Double = if (table.get("z").isnumber()) table.get("z").todouble() else 0.0
9398

94-
val text = if (table.get("text").isstring()) table.get("text").tojstring() else ""
99+
val text = if (table.get("text").isstring()) table.get("text").tojstring() else "Empty"
95100
val scale = if (table.get("scale").isnumber()) table.get("scale").tofloat() else 1f
96101

97-
val color = if (table.get("color").isnumber()) table.get("color").toint() else 0
102+
val red = if (table.get("red").isnumber()) table.get("red").toint() else -0x1
103+
val green = if (table.get("green").isnumber()) table.get("green").toint() else -0x1
104+
val blue = if (table.get("blue").isnumber()) table.get("blue").toint() else -0x1
98105

99106
val throughWalls = if (table.get("through_walls").isboolean()) table.get("through_walls").toboolean() else true
100107
val pos = Vec3d(x, y, z)
101108

102-
RenderHelper.renderText(context,
103-
Text.of(text).asOrderedText(),
104-
pos,
105-
color,
106-
scale,
107-
0f,
108-
throughWalls
109-
);
110-
return TRUE
109+
if (red != -0x1 && green != -0x1 && blue != -0x1) {
110+
val (hue, sat, bri) = Color.RGBtoHSB(red, green, blue, null)
111+
RenderHelper.renderText(
112+
context,
113+
Text.of(text).asOrderedText(),
114+
pos,
115+
Color.HSBtoRGB(hue, sat, bri),
116+
scale,
117+
0.5f,
118+
throughWalls
119+
);
120+
return TRUE
121+
}
122+
else {
123+
RenderHelper.renderText(
124+
context,
125+
Text.of(text).asOrderedText(),
126+
pos,
127+
-0x1,
128+
scale,
129+
0.5f,
130+
throughWalls
131+
);
132+
return TRUE
133+
}
134+
return FALSE
111135
}
112136
return NIL
113137
}

src/main/kotlin/com/nekiplay/hypixelcry/features/modules/impl/macros/HealingWands.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ object HealingWands : BindableClientModule() {
2323
}
2424

2525
override fun press() {
26+
if (screen != null) return
2627
findWand()?.let { slot ->
2728
interaction?.silentUse(slot)
2829
}

src/main/kotlin/com/nekiplay/hypixelcry/features/modules/impl/macros/RogueSword.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ object RogueSword : BindableClientModule() {
2020
}
2121

2222
override fun press() {
23+
if (screen != null) return
2324
findWand()?.let { slot ->
2425
interaction?.silentUse(slot)
2526
}

src/main/kotlin/com/nekiplay/hypixelcry/features/modules/impl/macros/WitherCloak.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ object WitherCloak : BindableClientModule() {
2020
}
2121

2222
override fun press() {
23+
if (screen != null) return
2324
findWand()?.let { slot ->
2425
interaction?.silentUse(slot)
2526
}

src/main/kotlin/com/nekiplay/hypixelcry/features/modules/impl/macros/ZombieSword.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ object ZombieSword : BindableClientModule() {
2020
}
2121

2222
override fun press() {
23+
if (screen != null) return
2324
findWand()?.let { slot ->
2425
interaction?.silentUse(slot)
2526
}

0 commit comments

Comments
 (0)