aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2024-06-22 10:02:45 +0200
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2024-06-22 10:02:45 +0200
commit7073780e62c8f751f41571d835896ee9accc7701 (patch)
tree235ddd382d9e8ced3eb9313836a55d02064fd5f5 /src/main/java/at/hannibal2/skyhanni
parentb38c39d913e82b711b182dba2a77378ff83249ea (diff)
downloadskyhanni-7073780e62c8f751f41571d835896ee9accc7701.tar.gz
skyhanni-7073780e62c8f751f41571d835896ee9accc7701.tar.bz2
skyhanni-7073780e62c8f751f41571d835896ee9accc7701.zip
formatting
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/data/mob/MobFilter.kt51
1 files changed, 24 insertions, 27 deletions
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 9bb48eb48..8b0d5dbdc 100644
--- a/src/main/java/at/hannibal2/skyhanni/data/mob/MobFilter.kt
+++ b/src/main/java/at/hannibal2/skyhanni/data/mob/MobFilter.kt
@@ -53,7 +53,7 @@ object MobFilter {
/** REGEX-TEST: Wither Husk 500M❤ */
val mobNameFilter by repoGroup.pattern(
"filter.basic",
- "(?:\\[\\w+(?<level>\\d+)\\] )?(?<corrupted>.Corrupted )?(?<name>[^ᛤ]*)(?: ᛤ)? [\\dBMk.,❤]+"
+ "(?:\\[\\w+(?<level>\\d+)\\] )?(?<corrupted>.Corrupted )?(?<name>[^ᛤ]*)(?: ᛤ)? [\\dBMk.,❤]+",
)
val slayerNameFilter by repoGroup.pattern("filter.slayer", "^. (?<name>.*) (?<tier>[IV]+) \\d+.*")
@@ -69,39 +69,39 @@ object MobFilter {
* */
val bossMobNameFilter by repoGroup.pattern(
"filter.boss",
- "^. (?:\\[Lv(?<level>\\d+)\\] )?(?<name>[^ᛤ\n]*?)(?: ᛤ)?(?: [\\d\\/BMk.,❤]+| █+)? .$"
+ "^. (?:\\[Lv(?<level>\\d+)\\] )?(?<name>[^ᛤ\n]*?)(?: ᛤ)?(?: [\\d\\/BMk.,❤]+| █+)? .$",
)
val dungeonNameFilter by repoGroup.pattern(
"filter.dungeon",
- "^(?:(?<star>✯)\\s)?(?:(?<attribute>${DungeonAttribute.toRegexLine})\\s)?(?:\\[[\\w\\d]+\\]\\s)?(?<name>[^ᛤ]+)(?: ᛤ)?\\s[^\\s]+$"
+ "^(?:(?<star>✯)\\s)?(?:(?<attribute>${DungeonAttribute.toRegexLine})\\s)?(?:\\[[\\w\\d]+\\]\\s)?(?<name>[^ᛤ]+)(?: ᛤ)?\\s[^\\s]+$",
)
val summonFilter by repoGroup.pattern(
"filter.summon",
- "^(?<owner>\\w+)'s (?<name>.*) \\d+.*"
+ "^(?<owner>\\w+)'s (?<name>.*) \\d+.*",
)
val dojoFilter by repoGroup.pattern(
"filter.dojo",
- "^(?:(?<points>\\d+) pts|(?<empty>\\w+))$"
+ "^(?:(?<points>\\d+) pts|(?<empty>\\w+))$",
)
val jerryPattern by repoGroup.pattern(
"jerry",
- "(?:\\[\\w+(?<level>\\d+)\\] )?(?<owner>\\w+)'s (?<name>\\w+ Jerry) \\d+ Hits"
+ "(?:\\[\\w+(?<level>\\d+)\\] )?(?<owner>\\w+)'s (?<name>\\w+ Jerry) \\d+ Hits",
)
val petCareNamePattern by repoGroup.pattern(
"pattern.petcare",
- "^\\[\\w+ (?<level>\\d+)\\] (?<name>.*)"
+ "^\\[\\w+ (?<level>\\d+)\\] (?<name>.*)",
)
val wokeSleepingGolemPattern by repoGroup.pattern(
"pattern.dungeon.woke.golem",
- "(?:§c§lWoke|§5§lSleeping) Golem§r"
+ "(?:§c§lWoke|§5§lSleeping) Golem§r",
)
val jerryMagmaCubePattern by repoGroup.pattern(
"pattern.jerry.magma.cube",
- "§c(?:Cubie|Maggie|Cubert|Cübe|Cubette|Magmalene|Lucky 7|8ball|Mega Cube|Super Cube)(?: ᛤ)? §a\\d+§8\\/§a\\d+§c❤"
+ "§c(?:Cubie|Maggie|Cubert|Cübe|Cubette|Magmalene|Lucky 7|8ball|Mega Cube|Super Cube)(?: ᛤ)? §a\\d+§8\\/§a\\d+§c❤",
)
val summonOwnerPattern by repoGroup.pattern(
"pattern.summon.owner",
- ".*Spawned by: (?<name>.*).*"
+ ".*Spawned by: (?<name>.*).*",
)
/**
@@ -113,7 +113,7 @@ object MobFilter {
*/
val illegalEntitiesPattern by repoGroup.pattern(
"pattern.pet.entities",
- "^§8\\[§7Lv\\d+§8] §.(?<name>Horse|Armadillo|Skeleton Horse|Pig|Rat)$"
+ "^§8\\[§7Lv\\d+§8] §.(?<name>Horse|Armadillo|Skeleton Horse|Pig|Rat)$",
)
internal const val RAT_SKULL =
@@ -165,7 +165,7 @@ object MobFilter {
"§e§lGATE KEEPER",
"§e§lBLACKSMITH",
"§e§lSHOP",
- "§e§lTREASURES"
+ "§e§lTREASURES",
)
fun Entity.isSkyBlockMob(): Boolean = when {
@@ -208,10 +208,7 @@ object MobFilter {
// Stack up the mob
var caughtSkyblockMob: Mob? = null
val extraEntityList = generateSequence(nextEntity) {
- MobUtils.getNextEntity(
- it,
- 1
- ) as? EntityLivingBase
+ MobUtils.getNextEntity(it, 1) as? EntityLivingBase
}.takeWhileInclusive { entity ->
!(entity is EntityArmorStand && !entity.isDefaultValue()) && MobData.entityToMob[entity]?.also {
caughtSkyblockMob = it
@@ -240,7 +237,7 @@ object MobFilter {
?: if (DungeonAPI.inDungeon()) MobFactories.dungeon(
baseEntity,
armorStand,
- extraEntityList
+ extraEntityList,
) else (MobFactories.basic(baseEntity, armorStand, extraEntityList)
?: MobFactories.dojo(baseEntity, armorStand))
@@ -260,8 +257,8 @@ object MobFilter {
baseEntity is EntityGiantZombie && baseEntity.name == "Dinnerbone" -> MobResult.found(
MobFactories.projectile(
baseEntity,
- "Giant Sword"
- )
+ "Giant Sword",
+ ),
) // Will false trigger if there is another Dinnerbone Giant
baseEntity is EntityCaveSpider -> MobUtils.getArmorStand(baseEntity, -1)
?.takeIf { summonOwnerPattern.matches(it.cleanName()) }?.let {
@@ -272,15 +269,15 @@ object MobFilter {
baseEntity is EntityWither && baseEntity.invulTime == 800 -> MobResult.found(
MobFactories.special(
baseEntity,
- "Mini Wither"
- )
+ "Mini Wither",
+ ),
)
baseEntity is EntityOtherPlayerMP && baseEntity.name == "Decoy " -> MobResult.found(
MobFactories.special(
baseEntity,
- "Decoy"
- )
+ "Decoy",
+ ),
)
else -> null
@@ -304,8 +301,8 @@ object MobFilter {
armorStand,
name = name,
ownerName = owner,
- levelOrTier = level
- )
+ levelOrTier = level,
+ ),
)
}
return when {
@@ -369,8 +366,8 @@ object MobFilter {
100 -> MobResult.found(
MobFactories.basic(
baseEntity,
- if (DungeonAPI.inDungeon()) "Dungeon Secret Bat" else if (IslandType.PRIVATE_ISLAND.isInIsland()) "Private Island Bat" else "Mega Bat"
- )
+ if (DungeonAPI.inDungeon()) "Dungeon Secret Bat" else if (IslandType.PRIVATE_ISLAND.isInIsland()) "Private Island Bat" else "Mega Bat",
+ ),
)
20 -> MobResult.found(MobFactories.projectile(baseEntity, "Vampire Mask Bat"))