diff options
author | ronald <inglettronald@gmail.com> | 2023-07-30 17:41:02 -0500 |
---|---|---|
committer | ronald <inglettronald@gmail.com> | 2023-07-30 17:41:02 -0500 |
commit | cb1c7a0db3ba8990c65dce812a435bc1abadd369 (patch) | |
tree | c4ff025989ed50d40d9a7f9861961104667ba397 | |
parent | d6faaa1f987b8766637fbc1e20a97112dfce164a (diff) | |
download | DulkirMod-Fabric-cb1c7a0db3ba8990c65dce812a435bc1abadd369.tar.gz DulkirMod-Fabric-cb1c7a0db3ba8990c65dce812a435bc1abadd369.tar.bz2 DulkirMod-Fabric-cb1c7a0db3ba8990c65dce812a435bc1abadd369.zip |
Added Rift Stuff and some cooldowns
-rw-r--r-- | README.md | 26 | ||||
-rw-r--r-- | build.gradle | 6 | ||||
-rw-r--r-- | src/main/kotlin/com/dulkirfabric/Registrations.kt | 2 | ||||
-rw-r--r-- | src/main/kotlin/com/dulkirfabric/config/DulkirConfig.kt | 10 | ||||
-rw-r--r-- | src/main/kotlin/com/dulkirfabric/features/BrokenHyp.kt | 1 | ||||
-rw-r--r-- | src/main/kotlin/com/dulkirfabric/features/CooldownDisplays.kt | 33 | ||||
-rw-r--r-- | src/main/kotlin/com/dulkirfabric/features/slayer/Vampire.kt | 93 | ||||
-rw-r--r-- | src/main/kotlin/com/dulkirfabric/util/Utils.kt | 9 |
8 files changed, 167 insertions, 13 deletions
@@ -26,8 +26,9 @@ DulkirMod 1.8.9 Can be found [here](https://github.com/inglettronald/DulkirMod). <li>Custom Selected Block outline</li> <li>Inactive Effigy Waypoints (rift)</li> <li>Custom Held Item Placement/Animations</li> - <li>Glow Utility (ESP Toggle currently broken on AMD, HMU if you're a wizard with OpenGL and feel inclined to help)</li> - <li>Cooldown Tracking through Durability Display (Working for some sound cooldowns, need to input some data)</li> + <li>Commands for Preset Export/Import to/from Clipboard (see /animations)</li> + <li>Glow Utility (no ESP toggle, currently not used for anything)</li> + <li>Cooldown Tracking through Durability Display (Working for some sound cooldowns)</li> <li>NO DOWNTIME alarm. Plays Iphone alarm if you stop moving after a certain amount of time.</li> <li>Large Explosion Particle render toggle</li> <li>Hide Scoreboard Numbers</li> @@ -35,6 +36,16 @@ DulkirMod 1.8.9 Can be found [here](https://github.com/inglettronald/DulkirMod). <li>Hide Hunger Display option</li> <li>AOTV Etherwarp display</li> <li>Action Bar HUD replacements (HEALTH, MANA, DEF, SPEED)</li> + <li>Hide Lightning in Skyblock</li> + <li>Hide Fire Overlay</li> + <li>Slayer Miniboss Alerts + Boxes</li> + <li>Boss Kill time Feedback for slayers</li> + <li>Clean Blaze Slayer Mode! (Removes particles and kills fireballs)</li> + <li>Damage Splash Truncate/Hide</li> + <li>Blaze Attunement Display</li> + <li>Broken Hyperion Notification</li> + <li>Max Visitors Notification</li> + <li>Garden HUD for Composter/Visitors</li> </ul> </details> @@ -43,12 +54,7 @@ DulkirMod 1.8.9 Can be found [here](https://github.com/inglettronald/DulkirMod). <b>Planned</b> </summary> <ul> - <li>Most features from DulkirMod 1.8.9</li> - <li>Lots more Rendering Utility</li> - <li>OldAnimations ??</li> - <li>Etherwarp display</li> - <li>HUD for health, Mana, Speed</li> - <li>A lot more I'm forgetting about</li> + <li>More Enderman Slayer Features</li> </ul> </details> @@ -75,4 +81,6 @@ Opening the settings menu can be achieved through the escape menu or through the Editing HUD positioning makes use of the [JARVIS API](https://github.com/romangraef/jarvis). This library is still in development, but is a fantastic library for a common HUD element editor. This allows multiple mods to handle the rendering on their own, but have the positioning logic be handled in one place. -Use the command `/jarvis gui` to access the main editor.
\ No newline at end of file +Use the command `/jarvis gui` to access the main editor. + +Use the command `/animations` to share animation profiles.
\ No newline at end of file diff --git a/build.gradle b/build.gradle index 5f38eaa..69aa3eb 100644 --- a/build.gradle +++ b/build.gradle @@ -43,9 +43,9 @@ dependencies { include "com.github.llamalad7.mixinextras:mixinextras-fabric:0.2.0-beta.9" implementation "com.github.llamalad7.mixinextras:mixinextras-fabric:0.2.0-beta.9" annotationProcessor "com.github.llamalad7.mixinextras:mixinextras-fabric:0.2.0-beta.9" - modImplementation("moe.nea.jarvis:jarvis-fabric:1.1.0") - include("moe.nea.jarvis:jarvis-fabric:1.1.0") - modLocalRuntime("moe.nea.jarvis:jarvis-fabric:1.1.0") + modImplementation("moe.nea.jarvis:jarvis-fabric:1.1.1") + include("moe.nea.jarvis:jarvis-fabric:1.1.1") + modLocalRuntime("moe.nea.jarvis:jarvis-fabric:1.1.1") } loom { diff --git a/src/main/kotlin/com/dulkirfabric/Registrations.kt b/src/main/kotlin/com/dulkirfabric/Registrations.kt index 650fe87..355abb8 100644 --- a/src/main/kotlin/com/dulkirfabric/Registrations.kt +++ b/src/main/kotlin/com/dulkirfabric/Registrations.kt @@ -15,6 +15,7 @@ import com.dulkirfabric.features.filters.Lightning import com.dulkirfabric.features.slayer.BossTimer import com.dulkirfabric.features.slayer.Demonlord import com.dulkirfabric.features.slayer.MiniBossHighlight +import com.dulkirfabric.features.slayer.Vampire import com.dulkirfabric.hud.ActionBarHudReplacements import com.dulkirfabric.hud.Garden import com.dulkirfabric.hud.SpeedOverlay @@ -97,6 +98,7 @@ object Registrations { EVENT_BUS.subscribe(Garden) EVENT_BUS.subscribe(VisitorAlert) EVENT_BUS.subscribe(BrokenHyp) + EVENT_BUS.subscribe(Vampire) if (FabricLoader.getInstance().isDevelopmentEnvironment) EVENT_BUS.subscribe(RenderTest) diff --git a/src/main/kotlin/com/dulkirfabric/config/DulkirConfig.kt b/src/main/kotlin/com/dulkirfabric/config/DulkirConfig.kt index 3118275..1457a85 100644 --- a/src/main/kotlin/com/dulkirfabric/config/DulkirConfig.kt +++ b/src/main/kotlin/com/dulkirfabric/config/DulkirConfig.kt @@ -298,6 +298,14 @@ class DulkirConfig { slayer.addEntry( entryBuilder.mkToggle(Text.literal("Disable ALL particles during Blaze slayer boss"), configOptions::cleanBlaze) ) + slayer.addEntry( + entryBuilder.mkToggle(Text.literal("Vampire Steak Display"), configOptions::steakDisplay, + Text.literal("Shows a wireframe on vampire boss when you can 1 tap it")) + ) + slayer.addEntry( + entryBuilder.mkToggle(Text.literal("Blood Ichor Highlight"), configOptions::ichorHighlight, + Text.literal("Highlights the T5 mechanic that you line up with the boss.")) + ) val garden = builder.getOrCreateCategory(Text.literal("Garden")) garden.addEntry( @@ -367,6 +375,8 @@ class DulkirConfig { var visitorAlert: Boolean = false, var persistentVisitorAlert: Boolean = false, var brokenHypNotif: Boolean = false, + var steakDisplay: Boolean = false, + var ichorHighlight: Boolean = false, ) @Serializable diff --git a/src/main/kotlin/com/dulkirfabric/features/BrokenHyp.kt b/src/main/kotlin/com/dulkirfabric/features/BrokenHyp.kt index dfae99b..85c1f7b 100644 --- a/src/main/kotlin/com/dulkirfabric/features/BrokenHyp.kt +++ b/src/main/kotlin/com/dulkirfabric/features/BrokenHyp.kt @@ -31,6 +31,7 @@ object BrokenHyp { // get info about held item val tag = stack.nbt ?: return id = tag.getCompound("ExtraAttributes")?.getString("id") ?: "" + kill = tag.getCompound("ExtraAttributes")?.getInt("stats_book") ?: -1 championXp = tag.getCompound("ExtraAttributes")?.getDouble("champion_combat_xp") ?: -1.0 diff --git a/src/main/kotlin/com/dulkirfabric/features/CooldownDisplays.kt b/src/main/kotlin/com/dulkirfabric/features/CooldownDisplays.kt index 9bdfa13..0476d51 100644 --- a/src/main/kotlin/com/dulkirfabric/features/CooldownDisplays.kt +++ b/src/main/kotlin/com/dulkirfabric/features/CooldownDisplays.kt @@ -7,6 +7,7 @@ import com.dulkirfabric.util.SoundInfo import com.dulkirfabric.util.TrackedCooldown import com.dulkirfabric.util.Utils import meteordevelopment.orbit.EventHandler +import net.minecraft.client.sound.Sound import net.minecraft.item.ItemStack import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable import kotlin.math.round @@ -24,9 +25,31 @@ object CooldownDisplays { Pair( SoundInfo("entity.firework_rocket.launch", 1f, 3f), TrackedCooldown("SOS_FLARE".toRegex(), 20000, 0) + ), + Pair( + SoundInfo("block.lever.click", 2f, .55f), + TrackedCooldown("RAGNAROCK_AXE".toRegex(), 20000, 0) + ), + Pair( + SoundInfo("entity.generic.drink", 1.7936507f, 1f), + TrackedCooldown("HOLY_ICE".toRegex(), 4000, 0) + ), + Pair( + SoundInfo("entity.wolf.howl", 1.5238096f, .5f), + TrackedCooldown("WEIRDER_TUBA".toRegex(), 20000, 0) + ), + Pair( + SoundInfo("block.lava.pop", 2f, .4f), + TrackedCooldown("ROGUE_SWORD".toRegex(), 30000, 0) + ), + Pair( + SoundInfo("block.anvil.land", 0.4920635f, 1f), + TrackedCooldown("GIANTS_SWORD".toRegex(), 30000, 0) ) ) + private var lastRagTick: Long = 0 + fun shouldDisplay(stack: ItemStack, cir: CallbackInfoReturnable<Boolean>) { val cooldown = fetchCooldownItem(stack) ?: return cir.returnValue = System.currentTimeMillis() - cooldown.lastUsage < cooldown.cooldownDuration @@ -39,13 +62,21 @@ object CooldownDisplays { @EventHandler fun onSound(event: PlaySoundEvent) { if (!DulkirConfig.configOptions.duraCooldown) return - // Utils.debugSound(event) val path = event.sound.id.path val pitch = event.sound.pitch val volume = event.sound.volume // Figure out if we have a match in trackedCooldowns val matchResult = trackedCooldowns[SoundInfo(path, pitch, volume)] ?: return + + if (matchResult.itemID matches "RAGNAROCK_AXE") { + if (System.currentTimeMillis() - lastRagTick < 5000) { + lastRagTick = System.currentTimeMillis() + return + } else { + lastRagTick = System.currentTimeMillis() + } + } matchResult.lastUsage = System.currentTimeMillis() } diff --git a/src/main/kotlin/com/dulkirfabric/features/slayer/Vampire.kt b/src/main/kotlin/com/dulkirfabric/features/slayer/Vampire.kt new file mode 100644 index 0000000..322d58a --- /dev/null +++ b/src/main/kotlin/com/dulkirfabric/features/slayer/Vampire.kt @@ -0,0 +1,93 @@ +package com.dulkirfabric.features.slayer + +import com.dulkirfabric.DulkirModFabric.mc +import com.dulkirfabric.config.DulkirConfig +import com.dulkirfabric.events.SlayerBossEvents +import com.dulkirfabric.events.WorldRenderLastEvent +import com.dulkirfabric.util.ScoreBoardUtils +import com.dulkirfabric.util.TablistUtils +import com.dulkirfabric.util.Utils.getInterpolatedPos +import com.dulkirfabric.util.Utils.getSkullTexture +import com.dulkirfabric.util.render.WorldRenderUtils +import meteordevelopment.orbit.EventHandler +import net.minecraft.block.entity.SkullBlockEntity +import net.minecraft.client.texture.PlayerSkinProvider +import net.minecraft.entity.EquipmentSlot +import net.minecraft.entity.decoration.ArmorStandEntity +import net.minecraft.item.Items +import net.minecraft.nbt.NbtHelper +import net.minecraft.util.math.Box +import java.awt.Color + +object Vampire { + + private const val char = "҉" + private const val ichorTexture = + "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYzAzNDA5MjNhNmRlNDgyNWExNzY4MTNkMTMzNTAzZWZmMTg2ZGIwODk2ZTMyYjY3MDQ5MjhjMmEyYmY2ODQyMiJ9fX0=" + private val box = Box(-.4, .1, -.4, .4, -1.9, .4) + private var inT5 = false + private val ichorBox = Box(- .5, 1.0, -.5, .5, 2.0, .5,) + + @EventHandler + fun steakDisplay(event: WorldRenderLastEvent) { + if (!DulkirConfig.configOptions.steakDisplay) return + if (TablistUtils.persistentInfo.area != "The Rift") return + + val ents = mc.world?.entities ?: return + ents.forEach { + if (it !is ArmorStandEntity || !it.hasCustomName()) return@forEach + if (!it.isMarker) return@forEach + if (!it.isCustomNameVisible) return@forEach + val name = it.customName?.string ?: return@forEach + if (name.contains(char) && name.contains("Bloodfiend")) { + val pos = it.getInterpolatedPos(mc.tickDelta) + WorldRenderUtils.drawWireFrame( + event.context, + box.offset(pos.x, pos.y, pos.z), + Color(0, 255, 255), + 8f + ) + } + } + } + + @EventHandler + fun ichorHighlight(event: WorldRenderLastEvent) { + if (!inT5) return + if (!DulkirConfig.configOptions.ichorHighlight) return + if (TablistUtils.persistentInfo.area != "The Rift") return + + val ents = mc.world?.entities ?: return + ents.forEach { + if (it !is ArmorStandEntity) return@forEach + val itemStack = it.getEquippedStack(EquipmentSlot.HEAD) ?: return@forEach + val item = itemStack.item ?: return@forEach + if (item !== Items.PLAYER_HEAD) return@forEach + val textureId = getSkullTexture(itemStack) ?: return@forEach + if (textureId != ichorTexture) return@forEach + val pos = it.getInterpolatedPos(mc.tickDelta) + WorldRenderUtils.drawWireFrame( + event.context, + ichorBox.offset(pos.x, pos.y, pos.z), + Color(0, 255, 255), + 8f, + ) + } + } + + @EventHandler + fun onSlayerStart(event: SlayerBossEvents.Spawn) { + if (ScoreBoardUtils.slayerType == "Riftstalker Bloodfiend V") + inT5 = true + } + + @EventHandler + fun onSlayerKill(event: SlayerBossEvents.Kill) { + inT5 = false + } + + @EventHandler + fun onSlayerFail(event: SlayerBossEvents.Fail) { + inT5 = false + } +}
\ No newline at end of file diff --git a/src/main/kotlin/com/dulkirfabric/util/Utils.kt b/src/main/kotlin/com/dulkirfabric/util/Utils.kt index c2d65c3..18a442e 100644 --- a/src/main/kotlin/com/dulkirfabric/util/Utils.kt +++ b/src/main/kotlin/com/dulkirfabric/util/Utils.kt @@ -4,7 +4,11 @@ import com.dulkirfabric.events.PlaySoundEvent import com.dulkirfabric.events.SlayerBossEvents import com.dulkirfabric.events.chat.ChatEvents import meteordevelopment.orbit.EventHandler +import net.minecraft.block.entity.SkullBlockEntity +import net.minecraft.client.texture.PlayerSkinProvider import net.minecraft.entity.Entity +import net.minecraft.item.ItemStack +import net.minecraft.nbt.NbtHelper import net.minecraft.util.math.Vec3d object Utils { @@ -42,4 +46,9 @@ object Utils { SlayerBossEvents.Fail(ScoreBoardUtils.slayerType ?: return ScoreBoardUtils.err()).post() } } + + fun getSkullTexture(itemStack: ItemStack): String? { + return itemStack.getSubNbt(SkullBlockEntity.SKULL_OWNER_KEY)?.let(NbtHelper::toGameProfile)?.properties?.get( + PlayerSkinProvider.TEXTURES)?.first()?.value + } }
\ No newline at end of file |