aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2022-09-23 19:24:00 +0200
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2022-09-23 19:24:00 +0200
commitca5374842862e8f7258bb8d4ff9dc42b623cac6d (patch)
treea0c80e9e9bc9ac86e23a42781fef068133bd0500 /src
parent3176e492675f201952890bd87c278baa731dc774 (diff)
downloadskyhanni-ca5374842862e8f7258bb8d4ff9dc42b623cac6d.tar.gz
skyhanni-ca5374842862e8f7258bb8d4ff9dc42b623cac6d.tar.bz2
skyhanni-ca5374842862e8f7258bb8d4ff9dc42b623cac6d.zip
renamed sword to dagger and support for higher tier daggers
Diffstat (limited to 'src')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/SkyHanniMod.java4
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/damageindicator/DamageIndicatorManager.kt4
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/slayer/blaze/BlazeSlayerDaggerHelper.kt (renamed from src/main/java/at/hannibal2/skyhanni/features/slayer/blaze/BlazeSlayerWeaponHelper.kt)62
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/slayer/blaze/DaggerMode.kt (renamed from src/main/java/at/hannibal2/skyhanni/features/slayer/blaze/SwordMode.kt)2
4 files changed, 40 insertions, 32 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.java b/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.java
index 05dc52499..2805354b4 100644
--- a/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.java
+++ b/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.java
@@ -32,8 +32,8 @@ import at.hannibal2.skyhanni.features.nether.ashfang.*;
import at.hannibal2.skyhanni.features.slayer.EndermanSlayerBeacon;
import at.hannibal2.skyhanni.features.slayer.HideMobNames;
import at.hannibal2.skyhanni.features.slayer.HighlightSlayerMiniboss;
+import at.hannibal2.skyhanni.features.slayer.blaze.BlazeSlayerDaggerHelper;
import at.hannibal2.skyhanni.features.slayer.blaze.BlazeSlayerPillarTimer;
-import at.hannibal2.skyhanni.features.slayer.blaze.BlazeSlayerWeaponHelper;
import at.hannibal2.skyhanni.features.summonings.SummoningMobManager;
import at.hannibal2.skyhanni.features.summonings.SummoningSoulsName;
import at.hannibal2.skyhanni.test.LorenzTest;
@@ -134,7 +134,7 @@ public class SkyHanniMod {
registerEvent(new HideDamageSplash());
registerEvent(new ThunderSparksHighlight());
registerEvent(new BlazeSlayerPillarTimer());
- registerEvent(new BlazeSlayerWeaponHelper());
+ registerEvent(new BlazeSlayerDaggerHelper());
registerEvent(new PlayerChatFilter());
registerEvent(new HideArmor());
diff --git a/src/main/java/at/hannibal2/skyhanni/features/damageindicator/DamageIndicatorManager.kt b/src/main/java/at/hannibal2/skyhanni/features/damageindicator/DamageIndicatorManager.kt
index a8237e4b1..6f5fadb27 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/damageindicator/DamageIndicatorManager.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/damageindicator/DamageIndicatorManager.kt
@@ -4,7 +4,7 @@ import at.hannibal2.skyhanni.SkyHanniMod
import at.hannibal2.skyhanni.data.ScoreboardData
import at.hannibal2.skyhanni.events.*
import at.hannibal2.skyhanni.features.dungeon.DungeonData
-import at.hannibal2.skyhanni.features.slayer.blaze.SwordMode
+import at.hannibal2.skyhanni.features.slayer.blaze.DaggerMode
import at.hannibal2.skyhanni.test.LorenzTest
import at.hannibal2.skyhanni.utils.*
import at.hannibal2.skyhanni.utils.EntityUtils.getNameTagWith
@@ -342,7 +342,7 @@ class DamageIndicatorManager {
}
private fun checkBlazeSlayer(entity: EntityLiving, entityData: EntityData): String {
- for (swordMode in SwordMode.values()) {
+ for (swordMode in DaggerMode.values()) {
if (entity.hasNameTagWith(3, swordMode.name)) {
entityData.namePrefix = swordMode.formattedName + " "
entityData.color = swordMode.color
diff --git a/src/main/java/at/hannibal2/skyhanni/features/slayer/blaze/BlazeSlayerWeaponHelper.kt b/src/main/java/at/hannibal2/skyhanni/features/slayer/blaze/BlazeSlayerDaggerHelper.kt
index cc05b08a3..b9022842b 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/slayer/blaze/BlazeSlayerWeaponHelper.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/slayer/blaze/BlazeSlayerDaggerHelper.kt
@@ -15,43 +15,43 @@ import net.minecraftforge.client.event.RenderGameOverlayEvent
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
import net.minecraftforge.fml.common.gameevent.TickEvent
-class BlazeSlayerWeaponHelper {
+class BlazeSlayerDaggerHelper {
- var textToRenderA = ""
- var textToRenderB = ""
+ var textToRenderMain = ""
+ var textToRenderOther = ""
var clientSideClicked = false
@SubscribeEvent
fun onTick(event: TickEvent.ClientTickEvent) {
if (!isEnabled()) return
- val sword = getSwordInHand()
- if (sword != null) {
- textToRenderA = getSwordText(sword)
- textToRenderB = getSwordText(sword.other())
+ val dagger = getDaggerInHand()
+ if (dagger != null) {
+ textToRenderMain = getDaggerText(dagger)
+ textToRenderOther = getDaggerText(dagger.other())
return
}
- textToRenderA = ""
- textToRenderB = ""
+ textToRenderMain = ""
+ textToRenderOther = ""
}
- private fun getSwordInHand(): Sword? {
+ private fun getDaggerInHand(): Dagger? {
val player = Minecraft.getMinecraft().thePlayer
val itemName = getName(player)
- for (sword in Sword.values()) {
- if (itemName.contains(sword.swordName)) {
- return sword
+ for (dagger in Dagger.values()) {
+ if (dagger.daggerNames.any { itemName.contains(it) }) {
+ return dagger
}
}
return null
}
- private fun getSwordText(sword: Sword): String {
+ private fun getDaggerText(dagger: Dagger): String {
var activeAbility = ""
var inactiveAbility = ""
- for (mode in sword.modes) {
+ for (mode in dagger.modes) {
if (mode.active) {
activeAbility = mode.chatColor + "§l" + mode
} else {
@@ -78,12 +78,12 @@ class BlazeSlayerWeaponHelper {
val message = packet.message ?: return
val formattedText = message.formattedText
- for (swordMode in SwordMode.values()) {
- if (swordMode.formattedName + "§r" == formattedText) {
- Sword.values().filter { swordMode in it.modes }.forEach {
+ for (mode in DaggerMode.values()) {
+ if (mode.formattedName + "§r" == formattedText) {
+ Dagger.values().filter { mode in it.modes }.forEach {
it.modes.forEach { mode -> mode.active = false }
}
- swordMode.active = true
+ mode.active = true
event.isCanceled = true
clientSideClicked = false
return
@@ -106,19 +106,27 @@ class BlazeSlayerWeaponHelper {
if (packet is C07PacketPlayerDigging) {
val status = packet.status
if (status == C07PacketPlayerDigging.Action.RELEASE_USE_ITEM) {
- val sword = getSwordInHand()
- sword?.modes?.forEach { mode -> mode.active = !mode.active }
+ val dagger = getDaggerInHand()
+ dagger?.modes?.forEach { mode -> mode.active = !mode.active }
clientSideClicked = true
}
}
}
- enum class Sword(val swordName: String, vararg val modes: SwordMode) {
- TWILIGHT("Twilight Dagger", SwordMode.SPIRIT, SwordMode.CRYSTAL),
- FIREDUST("Firedust Dagger", SwordMode.ASHEN, SwordMode.AURIC),
+ enum class Dagger(val daggerNames: List<String>, vararg val modes: DaggerMode) {
+ TWILIGHT(
+ listOf("Twilight Dagger", "Mawdredge Dagger", "Deathripper Dagger"),
+ DaggerMode.SPIRIT,
+ DaggerMode.CRYSTAL
+ ),
+ FIREDUST(
+ listOf("Firedust Dagger", "Kindlebane Dagger", "Pyrochaos Dagger"),
+ DaggerMode.ASHEN,
+ DaggerMode.AURIC
+ ),
;
- fun other(): Sword = if (this == TWILIGHT) {
+ fun other(): Dagger = if (this == TWILIGHT) {
FIREDUST
} else {
TWILIGHT
@@ -143,13 +151,13 @@ class BlazeSlayerWeaponHelper {
GlStateManager.pushMatrix()
GlStateManager.translate((width / 2).toFloat(), (height / 3.8).toFloat(), 0.0f)
GlStateManager.scale(4.0f, 4.0f, 4.0f)
- TextRenderUtils.drawStringCenteredScaledMaxWidth(textToRenderA, renderer, 0f, 0f, false, 55, 0)
+ TextRenderUtils.drawStringCenteredScaledMaxWidth(textToRenderMain, renderer, 0f, 0f, false, 55, 0)
GlStateManager.popMatrix()
GlStateManager.pushMatrix()
GlStateManager.translate((width / 2).toFloat(), (height / 3.2).toFloat(), 0.0f)
GlStateManager.scale(4.0f, 4.0f, 4.0f)
- TextRenderUtils.drawStringCenteredScaledMaxWidth(textToRenderB, renderer, 0f, 0f, false, 40, 0)
+ TextRenderUtils.drawStringCenteredScaledMaxWidth(textToRenderOther, renderer, 0f, 0f, false, 40, 0)
GlStateManager.popMatrix()
}
} \ No newline at end of file
diff --git a/src/main/java/at/hannibal2/skyhanni/features/slayer/blaze/SwordMode.kt b/src/main/java/at/hannibal2/skyhanni/features/slayer/blaze/DaggerMode.kt
index b2dfc9e28..d6a8ab711 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/slayer/blaze/SwordMode.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/slayer/blaze/DaggerMode.kt
@@ -2,7 +2,7 @@ package at.hannibal2.skyhanni.features.slayer.blaze
import at.hannibal2.skyhanni.utils.LorenzColor
-enum class SwordMode(val formattedName: String, val color: LorenzColor, val chatColor: String = color.getChatColor(), var active: Boolean = false) {
+enum class DaggerMode(val formattedName: String, val color: LorenzColor, val chatColor: String = color.getChatColor(), var active: Boolean = false) {
AURIC("§e§lAURIC", LorenzColor.YELLOW),
ASHEN("§8§lASHEN", LorenzColor.DARK_GRAY),
SPIRIT("§f§lSPIRIT", LorenzColor.WHITE),