summaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/features
diff options
context:
space:
mode:
authorWalker Selby <git@walkerselby.com>2023-09-29 11:30:27 -0700
committerGitHub <noreply@github.com>2023-09-29 20:30:27 +0200
commit343d5d9cea12beaf7a8dfabda2f61ad940be592a (patch)
treeceb0a82790eaa1a1babfe4a2e05220378037a748 /src/main/java/at/hannibal2/skyhanni/features
parentb364b6da62668ea44dfc23180fe70c13ec707804 (diff)
downloadskyhanni-343d5d9cea12beaf7a8dfabda2f61ad940be592a.tar.gz
skyhanni-343d5d9cea12beaf7a8dfabda2f61ad940be592a.tar.bz2
skyhanni-343d5d9cea12beaf7a8dfabda2f61ad940be592a.zip
Random Code Cleanup (#516)
Sonar Lint for the win #516
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/anvil/AnvilCombineHelper.kt18
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/bingo/BingoNextStepHelper.kt5
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/bingo/CompactBingoChat.kt6
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/bingo/MinionCraftHelper.kt7
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/chat/PlayerDeathMessages.kt18
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/chat/Translator.kt2
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/chat/playerchat/PlayerChatModifier.kt30
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/cosmetics/CosmeticFollowingLine.kt18
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/damageindicator/DamageIndicatorManager.kt62
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/damageindicator/MobFinder.kt280
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonAPI.kt5
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonCleanEnd.kt33
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonHideItems.kt74
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonHighlightClickedBlocks.kt6
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonMilestonesDisplay.kt7
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/dungeon/HighlightDungeonDeathmite.kt10
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/event/diana/GriffinBurrowHelper.kt12
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/event/diana/GriffinBurrowParticleFinder.kt65
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/event/diana/GriffinPetWarning.kt10
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/event/diana/InquisitorWaypointShare.kt8
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/fishing/SeaCreatureFeatures.kt2
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/GardenAPI.kt5
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/GardenCropMilestoneFix.kt6
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/GardenLevelDisplay.kt16
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/composter/ComposterDisplay.kt12
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/composter/ComposterOverlay.kt11
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/contest/JacobContestStatsSummary.kt6
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/contest/JacobFarmingContestsInventory.kt12
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/farming/FarmingWeightDisplay.kt6
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/farming/GardenCropMilestoneDisplay.kt6
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/farming/GardenCropSpeed.kt2
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/farming/WrongFungiCutterWarning.kt12
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/CaptureFarmingGear.kt34
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/FFGuideGUI.kt16
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorFeatures.kt59
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/inventory/HideNotClickableItems.kt9
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/inventory/ItemDisplayOverlayFeatures.kt150
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/inventory/RngMeterInventory.kt34
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/inventory/StatsTuning.kt118
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/itemabilities/abilitycooldown/ItemAbility.kt1
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/itemabilities/abilitycooldown/ItemAbilityCooldown.kt142
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/minion/MinionFeatures.kt40
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/misc/ChumBucketHider.kt16
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/misc/CollectionTracker.kt15
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/misc/JoinCrystalHollows.kt10
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/misc/ParticleHider.kt32
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/misc/QuickModMenuSwitch.kt2
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/misc/ServerRestartTitle.kt4
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/misc/ghostcounter/GhostCounter.kt20
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/misc/items/EstimatedItemValue.kt4
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/misc/tabcomplete/PlayerTabComplete.kt37
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/misc/tiarelay/TiaRelayHelper.kt18
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/misc/trevor/TrevorFeatures.kt54
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/misc/trevor/TrevorSolver.kt44
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/misc/update/GuiOptionEditorUpdateCheck.kt16
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/mobs/MobHighlight.kt46
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/CrimsonIsleReputationHelper.kt6
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailyquest/DailyQuestHelper.kt6
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailyquest/QuestLoader.kt42
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/miniboss/DailyMiniBossHelper.kt8
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/rift/area/dreadfarm/RiftWiltedBerberisHelper.kt8
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/rift/area/livingcave/LivingCaveDefenseBlocks.kt6
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/rift/area/mirrorverse/DanceRoomHelper.kt6
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/rift/area/stillgorechateau/RiftBloodEffigies.kt12
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/rift/area/westvillage/KloonHacking.kt6
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/rift/everywhere/EnigmaSoulWaypoints.kt6
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/rift/everywhere/HighlightRiftGuide.kt6
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/rift/everywhere/RiftHorsezookaHider.kt4
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/slayer/SlayerItemProfitTracker.kt32
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/slayer/SlayerQuestWarning.kt12
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/slayer/SlayerRngMeterDisplay.kt26
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/slayer/VampireSlayerFeatures.kt24
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/slayer/blaze/BlazeSlayerFirePitsWarning.kt17
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/slayer/enderman/EndermanSlayerFeatures.kt20
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/summonings/SummoningMobManager.kt6
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/summonings/SummoningSoulsName.kt9
76 files changed, 703 insertions, 1252 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/anvil/AnvilCombineHelper.kt b/src/main/java/at/hannibal2/skyhanni/features/anvil/AnvilCombineHelper.kt
index e03126fde..eddd232bd 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/anvil/AnvilCombineHelper.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/anvil/AnvilCombineHelper.kt
@@ -25,7 +25,6 @@ class AnvilCombineHelper {
if (chestName != "Anvil") return
val matchLore = mutableListOf<String>()
-// var compareItem: ItemStack? = null
for (slot in chest.inventorySlots) {
if (slot == null) continue
@@ -34,13 +33,9 @@ class AnvilCombineHelper {
if (slot.stack == null) continue
if (slot.slotNumber == 29) {
-// slot highlight LorenzColor.GREEN
val lore = slot.stack.getLore()
-// compareItem = slot.stack
matchLore.addAll(lore)
break
-// } else if (slot.slotIndex == 29) {
-// slot highlight LorenzColor.YELLOW
}
}
@@ -56,19 +51,6 @@ class AnvilCombineHelper {
if (matchLore == slot.stack.getLore()) {
slot highlight LorenzColor.GREEN
}
-
-// if (compareItem == slot.stack) {
-// slot highlight LorenzColor.GREEN
-// } else if (compareItem.metadata == slot.stack.metadata) {
-// slot highlight LorenzColor.YELLOW
-// }
-
-// if (slot.slotNumber == 3) {
-//// slot highlight LorenzColor.GREEN
-//// } else if (slot.slotIndex == 4) {
-//// slot highlight LorenzColor.YELLOW
-//// }
-// }
}
}
} \ No newline at end of file
diff --git a/src/main/java/at/hannibal2/skyhanni/features/bingo/BingoNextStepHelper.kt b/src/main/java/at/hannibal2/skyhanni/features/bingo/BingoNextStepHelper.kt
index 7f4b5cf46..e7ebc2d9e 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/bingo/BingoNextStepHelper.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/bingo/BingoNextStepHelper.kt
@@ -84,10 +84,8 @@ class BingoNextStepHelper {
}
}
- if (!step.done && !parentDone && requirementsToDo == 0) {
- if (!currentSteps.contains(step)) {
+ if (!step.done && !parentDone && requirementsToDo == 0 && !currentSteps.contains(step)) {
currentSteps = currentSteps.editCopy { add(step) }
- }
}
}
@@ -345,7 +343,6 @@ class BingoNextStepHelper {
"Combat",
12
).also { it requires IslandType.DEEP_CAVERNS.getStep() }
-
// enchantedCharcoal(7)
// compactor(7)
}
diff --git a/src/main/java/at/hannibal2/skyhanni/features/bingo/CompactBingoChat.kt b/src/main/java/at/hannibal2/skyhanni/features/bingo/CompactBingoChat.kt
index 7beff8920..3e40f0b85 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/bingo/CompactBingoChat.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/bingo/CompactBingoChat.kt
@@ -48,10 +48,8 @@ class CompactBingoChat {
return false
}
- if (inSkillLevelUp) {
- if (!message.contains("Access to") && !message.endsWith(" Enchantment")) {
- return true
- }
+ if (inSkillLevelUp && !message.contains("Access to") && !message.endsWith(" Enchantment")) {
+ return true
}
return false
diff --git a/src/main/java/at/hannibal2/skyhanni/features/bingo/MinionCraftHelper.kt b/src/main/java/at/hannibal2/skyhanni/features/bingo/MinionCraftHelper.kt
index 92602860f..7f080ae39 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/bingo/MinionCraftHelper.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/bingo/MinionCraftHelper.kt
@@ -59,7 +59,6 @@ class MinionCraftHelper {
}
if (!event.isMod(3)) return
-// if (!event.isMod(60)) return
val mainInventory = Minecraft.getMinecraft()?.thePlayer?.inventory?.mainInventory ?: return
@@ -161,10 +160,8 @@ class MinionCraftHelper {
for (ingredient in recipe.ingredients) {
val id = ingredient.internalItemId
- if (!id.contains("_GENERATOR_")) {
- if (!allIngredients.contains(id)) {
- allIngredients.add(id)
- }
+ if (!id.contains("_GENERATOR_") && !allIngredients.contains(id)) {
+ allIngredients.add(id)
}
}
}
diff --git a/src/main/java/at/hannibal2/skyhanni/features/chat/PlayerDeathMessages.kt b/src/main/java/at/hannibal2/skyhanni/features/chat/PlayerDeathMessages.kt
index ac83feb51..3296ab782 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/chat/PlayerDeathMessages.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/chat/PlayerDeathMessages.kt
@@ -36,20 +36,16 @@ class PlayerDeathMessages {
val message = event.message
deathMessagePattern.matchMatcher(message) {
val name = group("name")
- if (SkyHanniMod.feature.markedPlayers.highlightInChat && !LorenzUtils.inDungeons && !LorenzUtils.inKuudraFight) {
- if (MarkedPlayerManager.isMarkedPlayer(name)) {
- val reason = group("reason").removeColor()
- LorenzUtils.chat(" §c☠ §e$name §7$reason")
- event.blockedReason = "marked_player_death"
- return
- }
+ if (SkyHanniMod.feature.markedPlayers.highlightInChat && !LorenzUtils.inDungeons && !LorenzUtils.inKuudraFight && MarkedPlayerManager.isMarkedPlayer(name)) {
+ val reason = group("reason").removeColor()
+ LorenzUtils.chat(" §c☠ §e$name §7$reason")
+ event.blockedReason = "marked_player_death"
+ return
}
- if (isHideFarDeathsEnabled()) {
- if (System.currentTimeMillis() > lastTimePlayerSeen.getOrDefault(name, 0) + 30_000) {
- event.blockedReason = "far_away_player_death"
- }
+ if (isHideFarDeathsEnabled() && System.currentTimeMillis() > lastTimePlayerSeen.getOrDefault(name, 0) + 30_000) {
+ event.blockedReason = "far_away_player_death"
}
}
}
diff --git a/src/main/java/at/hannibal2/skyhanni/features/chat/Translator.kt b/src/main/java/at/hannibal2/skyhanni/features/chat/Translator.kt
index ffa7d53ec..6d238b8b3 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/chat/Translator.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/chat/Translator.kt
@@ -32,7 +32,7 @@ class Translator {
val message = event.message
if (message.getPlayerName() == "-") return
- val editedComponent = event.chatComponent.transformIf({ siblings.size > 0 }) { siblings.last() }
+ val editedComponent = event.chatComponent.transformIf({ siblings.isNotEmpty() }) { siblings.last() }
val clickStyle = createClickStyle(message.removeColor(), editedComponent.chatStyle)
editedComponent.setChatStyle(clickStyle)
diff --git a/src/main/java/at/hannibal2/skyhanni/features/chat/playerchat/PlayerChatModifier.kt b/src/main/java/at/hannibal2/skyhanni/features/chat/playerchat/PlayerChatModifier.kt
index c9311d11e..e63c925df 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/chat/playerchat/PlayerChatModifier.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/chat/playerchat/PlayerChatModifier.kt
@@ -48,10 +48,8 @@ class PlayerChatModifier {
private fun addComponent(foundCommands: MutableList<IChatComponent>, message: IChatComponent) {
val clickEvent = message.chatStyle.chatClickEvent
if (clickEvent != null) {
- if (foundCommands.size == 1) {
- if (foundCommands[0].chatStyle.chatClickEvent.value == clickEvent.value) {
- return
- }
+ if (foundCommands.size == 1 && foundCommands[0].chatStyle.chatClickEvent.value == clickEvent.value) {
+ return
}
foundCommands.add(message)
}
@@ -74,12 +72,8 @@ class PlayerChatModifier {
}
}
- if (SkyHanniMod.feature.chat.chatFilter) {
- if (string.contains("§r§f: ")) {
- if (PlayerChatFilter.shouldChatFilter(string)) {
- string = string.replace("§r§f: ", "§r§7: ")
- }
- }
+ if (SkyHanniMod.feature.chat.chatFilter && string.contains("§r§f: ") && PlayerChatFilter.shouldChatFilter(string)) {
+ string = string.replace("§r§f: ", "§r§7: ")
}
if (SkyHanniMod.feature.markedPlayers.highlightInChat) {
@@ -90,20 +84,4 @@ class PlayerChatModifier {
return string
}
-
-// private fun shouldChatFilter(input: String): Boolean {
-// val text = input.lowercase()
-//
-// //Low baller
-// if (text.contains("lowballing")) return true
-// if (text.contains("lowballer")) return true
-//
-// //Trade
-// if (text.contains("buy")) return true
-// if (text.contains("sell")) return true
-// if (text.contains("on my ah")) return true
-//
-//
-// return false
-// }
}
diff --git a/src/main/java/at/hannibal2/skyhanni/features/cosmetics/CosmeticFollowingLine.kt b/src/main/java/at/hannibal2/skyhanni/features/cosmetics/CosmeticFoll