From 869d7a10cb1bf3d471655e96217325a767f7d943 Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Sat, 18 Nov 2023 21:50:55 +0100 Subject: code cleanup --- .../at/hannibal2/skyhanni/test/TestCopyBestiaryValues.kt | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) (limited to 'src/main/java/at/hannibal2/skyhanni/test') diff --git a/src/main/java/at/hannibal2/skyhanni/test/TestCopyBestiaryValues.kt b/src/main/java/at/hannibal2/skyhanni/test/TestCopyBestiaryValues.kt index 3e5072fac..24edae9cc 100644 --- a/src/main/java/at/hannibal2/skyhanni/test/TestCopyBestiaryValues.kt +++ b/src/main/java/at/hannibal2/skyhanni/test/TestCopyBestiaryValues.kt @@ -47,18 +47,12 @@ object TestCopyBestiaryValues { if (!SkyHanniMod.feature.dev.debug.copyBestiaryData) return SkyHanniDebugsAndTests.displayLine = "" - val backItem = event.inventoryItems[3 + 9 * 5 + 3] - if (backItem == null) { - return - } + val backItem = event.inventoryItems[3 + 9 * 5 + 3] ?: return if (backItem.getLore().none { it.contains("Bestiary Milestone") }) { return } - val rankingItem = event.inventoryItems[3 + 9 * 5 + 2] - if (rankingItem == null) { - return - } + val rankingItem = event.inventoryItems[3 + 9 * 5 + 2] ?: return if (rankingItem.getLore().none { it.contains("Ranking") }) { return } @@ -71,7 +65,7 @@ object TestCopyBestiaryValues { val name = titleItem.name ?: return val titleName = name.split(" ").dropLast(1).joinToString(" ") - val obj: BestiarityObject = BestiarityObject() + val obj = BestiarityObject() obj.name = titleName obj.texture = titleItem.getSkullTexture() ?: "no texture found" obj.skullOwner = titleItem.getSkullOwner() ?: "no skullOwner found" @@ -116,4 +110,4 @@ object TestCopyBestiaryValues { fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { event.move(3, "dev.copyBestiaryData", "dev.debug.copyBestiaryData") } -} \ No newline at end of file +} -- cgit