diff options
author | inglettronald <inglettronald@gmail.com> | 2023-06-26 02:56:24 -0500 |
---|---|---|
committer | inglettronald <inglettronald@gmail.com> | 2023-06-26 02:56:24 -0500 |
commit | 5aa81b2dbf81f0ef3907ebec082828b7e0023798 (patch) | |
tree | bca8948191801e151c2345b2d1899a2ca8a4f06a /src/main/kotlin/dulkirmod | |
parent | cc83deeaf522e06f9d7ff1c6d8b506b81bdecc7c (diff) | |
download | DulkirMod-5aa81b2dbf81f0ef3907ebec082828b7e0023798.tar.gz DulkirMod-5aa81b2dbf81f0ef3907ebec082828b7e0023798.tar.bz2 DulkirMod-5aa81b2dbf81f0ef3907ebec082828b7e0023798.zip |
fix steak display and add effigy display
Diffstat (limited to 'src/main/kotlin/dulkirmod')
4 files changed, 74 insertions, 1 deletions
diff --git a/src/main/kotlin/dulkirmod/DulkirMod.kt b/src/main/kotlin/dulkirmod/DulkirMod.kt index 1277de5..4ae84cc 100644 --- a/src/main/kotlin/dulkirmod/DulkirMod.kt +++ b/src/main/kotlin/dulkirmod/DulkirMod.kt @@ -6,6 +6,7 @@ import dulkirmod.events.ChatEvent import dulkirmod.features.* import dulkirmod.features.chat.AbiphoneDND import dulkirmod.features.dungeons.* +import dulkirmod.features.rift.EffigyWaypoint import dulkirmod.features.rift.IchorHighlight import dulkirmod.features.rift.SteakDisplay import dulkirmod.utils.* @@ -87,6 +88,7 @@ class DulkirMod { mcBus.register(ArcherHighlight) mcBus.register(ReaperDisplay) mcBus.register(ImpactDisplay) + mcBus.register(EffigyWaypoint) keyBinds.forEach(ClientRegistry::registerKeyBinding) } @@ -111,6 +113,7 @@ class DulkirMod { // the data structure on 1s cooldown TabListUtils.parseTabEntries() DragonFeatures.updateDragonDead() + EffigyWaypoint.checkEffigies() lastLongUpdate = currTime } diff --git a/src/main/kotlin/dulkirmod/config/DulkirConfig.kt b/src/main/kotlin/dulkirmod/config/DulkirConfig.kt index d8ac14c..a4aea6c 100644 --- a/src/main/kotlin/dulkirmod/config/DulkirConfig.kt +++ b/src/main/kotlin/dulkirmod/config/DulkirConfig.kt @@ -836,6 +836,14 @@ object DulkirConfig : Config(Mod("DulkirMod", ModType.SKYBLOCK), "dulkirmod-conf ) var ichorHighlight = false + @Switch( + name = "Inactive Effigy Waypoint", + description = "Useful for learning/remembering where the effigies are in relation to the scoreboard position", + category = "Rift", + subcategory = "Vamp Slayer" + ) + var effigyWaypoint = false + fun init() { initialize() diff --git a/src/main/kotlin/dulkirmod/features/rift/EffigyWaypoint.kt b/src/main/kotlin/dulkirmod/features/rift/EffigyWaypoint.kt new file mode 100644 index 0000000..73155eb --- /dev/null +++ b/src/main/kotlin/dulkirmod/features/rift/EffigyWaypoint.kt @@ -0,0 +1,62 @@ +package dulkirmod.features.rift + +import dulkirmod.DulkirMod.Companion.mc +import dulkirmod.config.DulkirConfig +import dulkirmod.utils.* +import net.minecraft.util.Vec3 +import net.minecraftforge.client.event.RenderWorldLastEvent +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent +import kotlin.math.max + +object EffigyWaypoint { + var effigyWaypoints = arrayOf( + Effigy(Vec3(150.5, 76.0, 95.5)), + Effigy(Vec3(193.5, 90.0, 119.5)), + Effigy(Vec3(235.5, 107.0, 147.5)), + Effigy(Vec3(294.5, 93.0, 134.5)), + Effigy(Vec3(240.5, 126.0, 118.5)), + Effigy(Vec3(262.5, 96.0, 94.5)) + ) + + private val c7OnlyRegex = Regex("[^c7]") + + @SubscribeEvent + fun onRender(event: RenderWorldLastEvent) { + // if we have any waypoints that need rendering, Do so. + val playerVec = mc.thePlayer.positionVector + for (effigy in effigyWaypoints) { + if (effigy.render) { + WorldRenderUtils.renderString(effigy.coords, "§6Inactive", false, + max(1f, playerVec.distanceTo(effigy.coords).toFloat()/10f), true + ) + } + } + } + + /** + * Run once per second to check scoreboard data and update our data struct + */ + fun checkEffigies() { + if (!DulkirConfig.effigyWaypoint) return + if (!Utils.isInSkyblock()) return + if (TabListUtils.area != "The Rift") return + val lines = ScoreBoardUtils.getLines() + if (lines.size <= 7) return + if (lines[3] != " §5ф §cStillgore\uD83D\uDC0D§c Château") return + val effigyStatusLine = lines[6].replace(c7OnlyRegex, "") + if (effigyStatusLine.length != 6) { + TextUtils.info("§6Something went wrong with Scoreboard parsing in Effigy Feature.") + TextUtils.info(" §6Turning off feature, please report to Dulkir.", prefix = false) + DulkirConfig.effigyWaypoint = false + return + } + for (i in 0..5) { + effigyWaypoints[i].render = (effigyStatusLine[i] == '7') + } + } + + /** + * data class for storing the effigy coordinates and whether they need to be rendered + */ + data class Effigy(val coords: Vec3, var render: Boolean = false) +}
\ No newline at end of file diff --git a/src/main/kotlin/dulkirmod/features/rift/SteakDisplay.kt b/src/main/kotlin/dulkirmod/features/rift/SteakDisplay.kt index 171dc7a..cb0c035 100644 --- a/src/main/kotlin/dulkirmod/features/rift/SteakDisplay.kt +++ b/src/main/kotlin/dulkirmod/features/rift/SteakDisplay.kt @@ -20,7 +20,7 @@ object SteakDisplay { if (event.entity is EntityArmorStand && event.entity.hasCustomName()) { val name = Utils.stripColorCodes(event.entity.customNameTag) val (x, y, z) = WorldRenderUtils.fixRenderPos(event.x, event.y, event.z) - if (name.contains(char) && name.contains("Vampire Boss")) { + if (name.contains(char) && name.contains("Bloodfiend")) { WorldRenderUtils.drawCustomBox( x - .5, 1.0, |