aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2024-06-22 09:56:47 +0200
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2024-06-22 09:56:47 +0200
commit463f49b9d2f19cd51461fcc58ac6315ac2642577 (patch)
tree3d79549e629f315c28e654055939883b04def977 /src/main/java/at/hannibal2
parentb475e06f0c9f0caa79620b0af781d220fc377f53 (diff)
downloadskyhanni-463f49b9d2f19cd51461fcc58ac6315ac2642577.tar.gz
skyhanni-463f49b9d2f19cd51461fcc58ac6315ac2642577.tar.bz2
skyhanni-463f49b9d2f19cd51461fcc58ac6315ac2642577.zip
more SkyHanniModules
Diffstat (limited to 'src/main/java/at/hannibal2')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/data/mob/MobDetection.kt26
-rw-r--r--src/main/java/at/hannibal2/skyhanni/data/mob/MobFilter.kt2
-rw-r--r--src/main/java/at/hannibal2/skyhanni/utils/MobUtils.kt2
3 files changed, 10 insertions, 20 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/data/mob/MobDetection.kt b/src/main/java/at/hannibal2/skyhanni/data/mob/MobDetection.kt
index c1e17f06b..82aec2fc6 100644
--- a/src/main/java/at/hannibal2/skyhanni/data/mob/MobDetection.kt
+++ b/src/main/java/at/hannibal2/skyhanni/data/mob/MobDetection.kt
@@ -20,7 +20,6 @@ import at.hannibal2.skyhanni.utils.CollectionUtils.refreshReference
import at.hannibal2.skyhanni.utils.EntityUtils
import at.hannibal2.skyhanni.utils.LocationUtils
import at.hannibal2.skyhanni.utils.LorenzUtils
-import at.hannibal2.skyhanni.utils.MobUtils
import at.hannibal2.skyhanni.utils.getLorenzVec
import net.minecraft.client.entity.EntityPlayerSP
import net.minecraft.entity.EntityLivingBase
@@ -60,21 +59,6 @@ object MobDetection {
private var shouldClear: AtomicBoolean = AtomicBoolean(false)
- init {
- MobFilter.bossMobNameFilter
- MobFilter.mobNameFilter
- MobFilter.dojoFilter
- MobFilter.summonFilter
- MobFilter.dungeonNameFilter
- MobFilter.petCareNamePattern
- MobFilter.slayerNameFilter
- MobFilter.summonOwnerPattern
- MobFilter.wokeSleepingGolemPattern
- MobFilter.jerryPattern
- MobFilter.jerryMagmaCubePattern
- MobUtils.defaultArmorStandName
- }
-
private fun mobDetectionReset() {
MobData.currentMobs.map {
it.createDeSpawnEvent()
@@ -99,8 +83,10 @@ object MobDetection {
MobData.previousEntityLiving.clear()
MobData.previousEntityLiving.addAll(MobData.currentEntityLiving)
MobData.currentEntityLiving.clear()
- MobData.currentEntityLiving.addAll(EntityUtils.getEntities<EntityLivingBase>()
- .filter { it !is EntityArmorStand && it !is EntityPlayerSP })
+ MobData.currentEntityLiving.addAll(
+ EntityUtils.getEntities<EntityLivingBase>()
+ .filter { it !is EntityArmorStand && it !is EntityPlayerSP },
+ )
if (forceReset) {
MobData.currentEntityLiving.clear() // Naturally removing the mobs using the despawn
@@ -152,7 +138,7 @@ object MobDetection {
Mob.Type.SUMMON -> MobEvent.Spawn.Summon(mob)
Mob.Type.BASIC, Mob.Type.DUNGEON, Mob.Type.BOSS, Mob.Type.SLAYER -> MobEvent.Spawn.SkyblockMob(
- mob
+ mob,
)
Mob.Type.SPECIAL -> MobEvent.Spawn.Special(mob)
@@ -274,7 +260,7 @@ object MobDetection {
entity.getLorenzVec().distanceChebyshevIgnoreY(LocationUtils.playerLocation())
}\n"
+ "Relative Position: ${entity.getLorenzVec() - LocationUtils.playerLocation()}\n " +
- "}"
+ "}",
)
// Uncomment this to make it closed a loop
// iterator.remove()
diff --git a/src/main/java/at/hannibal2/skyhanni/data/mob/MobFilter.kt b/src/main/java/at/hannibal2/skyhanni/data/mob/MobFilter.kt
index fdcc99df1..47561545e 100644
--- a/src/main/java/at/hannibal2/skyhanni/data/mob/MobFilter.kt
+++ b/src/main/java/at/hannibal2/skyhanni/data/mob/MobFilter.kt
@@ -5,6 +5,7 @@ import at.hannibal2.skyhanni.data.mob.MobData.MobResult
import at.hannibal2.skyhanni.data.mob.MobData.MobResult.Companion.makeMobResult
import at.hannibal2.skyhanni.events.MobEvent
import at.hannibal2.skyhanni.features.dungeon.DungeonAPI
+import at.hannibal2.skyhanni.skyhannimodule.SkyHanniModule
import at.hannibal2.skyhanni.utils.CollectionUtils.takeWhileInclusive
import at.hannibal2.skyhanni.utils.EntityUtils.cleanName
import at.hannibal2.skyhanni.utils.EntityUtils.isNPC
@@ -44,6 +45,7 @@ import net.minecraft.entity.passive.EntityVillager
import net.minecraft.entity.player.EntityPlayer
@Suppress("RegExpRedundantEscape")
+@SkyHanniModule
object MobFilter {
private val repoGroup = RepoPattern.group("mob.detection")
diff --git a/src/main/java/at/hannibal2/skyhanni/utils/MobUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/MobUtils.kt
index 4e2180443..db04ddd7c 100644
--- a/src/main/java/at/hannibal2/skyhanni/utils/MobUtils.kt
+++ b/src/main/java/at/hannibal2/skyhanni/utils/MobUtils.kt
@@ -2,6 +2,7 @@ package at.hannibal2.skyhanni.utils
import at.hannibal2.skyhanni.data.mob.Mob
import at.hannibal2.skyhanni.data.mob.MobData
+import at.hannibal2.skyhanni.skyhannimodule.SkyHanniModule
import at.hannibal2.skyhanni.utils.EntityUtils.cleanName
import at.hannibal2.skyhanni.utils.LocationUtils.distanceTo
import at.hannibal2.skyhanni.utils.LocationUtils.rayIntersects
@@ -12,6 +13,7 @@ import net.minecraft.entity.EntityLivingBase
import net.minecraft.entity.item.EntityArmorStand
import net.minecraft.entity.player.EntityPlayer
+@SkyHanniModule
object MobUtils {
val defaultArmorStandName by RepoPattern.pattern("armorstand.default", "Armou?r Stand")