Skip to content

Commit

Permalink
add c counter (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
MicrocontrollersDev authored Mar 16, 2023
1 parent d47549d commit 7100260
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/main/kotlin/cc/polyfrost/evergreenhud/EvergreenHUD.kt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ class EvergreenHUD {
Armour()
Biome()
BlockAbove()
CCounter()
Combo()
Coordinates()
CPS()
Expand Down
33 changes: 33 additions & 0 deletions src/main/kotlin/cc/polyfrost/evergreenhud/hud/CCounter.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
package cc.polyfrost.evergreenhud.hud

import cc.polyfrost.oneconfig.config.Config
import cc.polyfrost.oneconfig.config.annotations.HUD
import cc.polyfrost.oneconfig.config.annotations.Switch
import cc.polyfrost.oneconfig.config.data.Mod
import cc.polyfrost.oneconfig.config.data.ModType
import cc.polyfrost.oneconfig.hud.SingleTextHud
import cc.polyfrost.oneconfig.utils.dsl.mc

class CCounter: Config(Mod("C Counter", ModType.HUD, "/assets/evergreenhud/evergreenhud.svg"), "evergreenhud/ccounter.json", false) {
@HUD(name = "Main")
var hud = CCounterHud()

init {
initialize()
}

class CCounterHud: SingleTextHud("C", true, 400, 70) {

@Switch(
name = "Simplified"
)
var simplified = true

override fun getText(example: Boolean): String {
if (mc.thePlayer == null) return "Unknown"
return if (simplified) mc.renderGlobal.debugInfoRenders.split("/")[0].replace("C: ", "")
else mc.renderGlobal.debugInfoRenders.split(" ")[1]
}
}

}

0 comments on commit 7100260

Please sign in to comment.