From 7073780e62c8f751f41571d835896ee9accc7701 Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Sat, 22 Jun 2024 10:02:45 +0200 Subject: formatting --- .../at/hannibal2/skyhanni/data/mob/MobFilter.kt | 51 ++++++++++------------ 1 file changed, 24 insertions(+), 27 deletions(-) (limited to 'src/main/java/at/hannibal2') 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+(?\\d+)\\] )?(?.Corrupted )?(?[^ᛤ]*)(?: ᛤ)? [\\dBMk.,❤]+" + "(?:\\[\\w+(?\\d+)\\] )?(?.Corrupted )?(?[^ᛤ]*)(?: ᛤ)? [\\dBMk.,❤]+", ) val slayerNameFilter by repoGroup.pattern("filter.slayer", "^. (?.*) (?[IV]+) \\d+.*") @@ -69,39 +69,39 @@ object MobFilter { * */ val bossMobNameFilter by repoGroup.pattern( "filter.boss", - "^. (?:\\[Lv(?\\d+)\\] )?(?[^ᛤ\n]*?)(?: ᛤ)?(?: [\\d\\/BMk.,❤]+| █+)? .$" + "^. (?:\\[Lv(?\\d+)\\] )?(?[^ᛤ\n]*?)(?: ᛤ)?(?: [\\d\\/BMk.,❤]+| █+)? .$", ) val dungeonNameFilter by repoGroup.pattern( "filter.dungeon", - "^(?:(?✯)\\s)?(?:(?${DungeonAttribute.toRegexLine})\\s)?(?:\\[[\\w\\d]+\\]\\s)?(?[^ᛤ]+)(?: ᛤ)?\\s[^\\s]+$" + "^(?:(?✯)\\s)?(?:(?${DungeonAttribute.toRegexLine})\\s)?(?:\\[[\\w\\d]+\\]\\s)?(?[^ᛤ]+)(?: ᛤ)?\\s[^\\s]+$", ) val summonFilter by repoGroup.pattern( "filter.summon", - "^(?\\w+)'s (?.*) \\d+.*" + "^(?\\w+)'s (?.*) \\d+.*", ) val dojoFilter by repoGroup.pattern( "filter.dojo", - "^(?:(?\\d+) pts|(?\\w+))$" + "^(?:(?\\d+) pts|(?\\w+))$", ) val jerryPattern by repoGroup.pattern( "jerry", - "(?:\\[\\w+(?\\d+)\\] )?(?\\w+)'s (?\\w+ Jerry) \\d+ Hits" + "(?:\\[\\w+(?\\d+)\\] )?(?\\w+)'s (?\\w+ Jerry) \\d+ Hits", ) val petCareNamePattern by repoGroup.pattern( "pattern.petcare", - "^\\[\\w+ (?\\d+)\\] (?.*)" + "^\\[\\w+ (?\\d+)\\] (?.*)", ) 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: (?.*).*" + ".*Spawned by: (?.*).*", ) /** @@ -113,7 +113,7 @@ object MobFilter { */ val illegalEntitiesPattern by repoGroup.pattern( "pattern.pet.entities", - "^§8\\[§7Lv\\d+§8] §.(?Horse|Armadillo|Skeleton Horse|Pig|Rat)$" + "^§8\\[§7Lv\\d+§8] §.(?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")) -- cgit