aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/dulkirmod/features/dungeons/HideHealerFairy.kt
diff options
context:
space:
mode:
authoringlettronald <inglettronald@gmail.com>2023-05-19 05:37:40 -0500
committeringlettronald <inglettronald@gmail.com>2023-05-19 05:37:40 -0500
commit170c6504bdb949c5dd133514b3db91823169cbad (patch)
treebaa86202f421eb0a5573a29264f0e852331221a2 /src/main/kotlin/dulkirmod/features/dungeons/HideHealerFairy.kt
parent95caa9cc8196021f89fee4a8db54706676ee49c9 (diff)
downloadDulkirMod-170c6504bdb949c5dd133514b3db91823169cbad.tar.gz
DulkirMod-170c6504bdb949c5dd133514b3db91823169cbad.tar.bz2
DulkirMod-170c6504bdb949c5dd133514b3db91823169cbad.zip
organization into better files
Diffstat (limited to 'src/main/kotlin/dulkirmod/features/dungeons/HideHealerFairy.kt')
-rw-r--r--src/main/kotlin/dulkirmod/features/dungeons/HideHealerFairy.kt36
1 files changed, 36 insertions, 0 deletions
diff --git a/src/main/kotlin/dulkirmod/features/dungeons/HideHealerFairy.kt b/src/main/kotlin/dulkirmod/features/dungeons/HideHealerFairy.kt
new file mode 100644
index 0000000..ecfe27e
--- /dev/null
+++ b/src/main/kotlin/dulkirmod/features/dungeons/HideHealerFairy.kt
@@ -0,0 +1,36 @@
+package dulkirmod.features.dungeons
+
+
+import dulkirmod.DulkirMod.Companion.config
+import dulkirmod.utils.TabListUtils
+import net.minecraft.entity.Entity
+import net.minecraft.entity.item.EntityArmorStand
+import net.minecraft.init.Items
+import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable
+
+object HideHealerFairy {
+ fun handle(entity: Entity, cir: CallbackInfoReturnable<Boolean>) {
+ if (!config.hideHealerFairy) return
+ if (TabListUtils.area != "Dungeon") return
+ if (entity is EntityArmorStand) {
+ if (entity.heldItem != null && entity.heldItem.item === Items.skull) {
+ val stack = entity.heldItem
+ if (stack.hasTagCompound() && stack.tagCompound.hasKey("SkullOwner")) {
+ val skullOwner = stack.tagCompound.getCompoundTag("SkullOwner")
+ if (skullOwner.hasKey("Properties")) {
+ val properties = skullOwner.getCompoundTag("Properties")
+ if (properties.hasKey("textures")) {
+ val healerFairyTexture =
+ "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvOTZjM2UzMWNmYzY2NzMzMjc1YzQyZmNmYjVkOWE0NDM0MmQ2NDNiNTVjZDE0YzljNzdkMjczYTIzNTIifX19"
+ if (healerFairyTexture == properties.getTagList("textures", 10).getCompoundTagAt(0)
+ .getString("Value")
+ ) {
+ cir.cancel()
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+} \ No newline at end of file