From 0a95a791eb57a546fb5421594abae740faf1dfdb Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal002@users.noreply.github.com> Date: Wed, 6 Mar 2024 23:51:02 +0100 Subject: Internal Changes: Many small code cleanups (#1101) Co-authored-by: Thunderblade73 <85900443+Thunderblade73@users.noreply.github.com> Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com> --- .../java/at/hannibal2/skyhanni/features/nether/PabloHelper.kt | 2 +- .../skyhanni/features/nether/ashfang/AshfangHideParticles.kt | 2 +- .../nether/reputationhelper/dailyquest/DailyQuestHelper.kt | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) (limited to 'src/main/java/at/hannibal2/skyhanni/features/nether') diff --git a/src/main/java/at/hannibal2/skyhanni/features/nether/PabloHelper.kt b/src/main/java/at/hannibal2/skyhanni/features/nether/PabloHelper.kt index 0e07441da..a65d5d030 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/nether/PabloHelper.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/nether/PabloHelper.kt @@ -32,7 +32,7 @@ class PabloHelper { group("flower") } ?: return - if (InventoryUtils.countItemsInLowerInventory { it.name?.contains(itemName) == true } > 0) return + if (InventoryUtils.countItemsInLowerInventory { it.name.contains(itemName) } > 0) return ChatUtils.clickableChat("Click here to grab an $itemName from sacks!", "gfs $itemName 1") lastSentMessage = SimpleTimeMark.now() diff --git a/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangHideParticles.kt b/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangHideParticles.kt index fc9ae54c8..7f15d294c 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangHideParticles.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangHideParticles.kt @@ -41,7 +41,7 @@ class AshfangHideParticles { if (entity is EntityArmorStand) { for (stack in entity.inventory) { if (stack == null) continue - val name = stack.name ?: continue + val name = stack.name if (name == "§aFairy Souls") continue if (name == "Glowstone") { event.isCanceled = true diff --git a/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailyquest/DailyQuestHelper.kt b/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailyquest/DailyQuestHelper.kt index 89ff65e5c..8042f6f5c 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailyquest/DailyQuestHelper.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailyquest/DailyQuestHelper.kt @@ -40,6 +40,7 @@ import at.hannibal2.skyhanni.utils.NEUItems.getItemStack import at.hannibal2.skyhanni.utils.NumberUtil.addSeparators import at.hannibal2.skyhanni.utils.RenderUtils.drawDynamicText import at.hannibal2.skyhanni.utils.RenderUtils.highlight +import at.hannibal2.skyhanni.utils.StringUtils.removeWordsAtEnd import net.minecraft.client.gui.inventory.GuiChest import net.minecraft.inventory.ContainerChest import net.minecraftforge.fml.common.eventhandler.SubscribeEvent @@ -99,9 +100,8 @@ class DailyQuestHelper(val reputationHelper: CrimsonIsleReputationHelper) { if (slot == null) continue if (slot.slotNumber != slot.slotIndex) continue val stack = slot.stack ?: continue - val itemName = stack.name ?: continue - if (itemName.contains(dojoQuest.dojoName)) { + if (stack.name.contains(dojoQuest.dojoName)) { slot highlight LorenzColor.AQUA } } @@ -143,7 +143,7 @@ class DailyQuestHelper(val reputationHelper: CrimsonIsleReputationHelper) { val itemName = fetchQuest.itemName - val count = InventoryUtils.countItemsInLowerInventory { it.name?.contains(itemName) ?: false } + val count = InventoryUtils.countItemsInLowerInventory { it.name.contains(itemName) } updateProcessQuest(fetchQuest, count) } @@ -253,7 +253,7 @@ class DailyQuestHelper(val reputationHelper: CrimsonIsleReputationHelper) { val displayName = if (category == QuestCategory.FETCH || category == QuestCategory.FISHING) { val name = item.name if (category == QuestCategory.FISHING) { - name!!.split(" ").dropLast(1).joinToString(" ") + name.removeWordsAtEnd(1) } else name } else quest.displayName -- cgit