diff options
author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-11-03 21:04:17 +0100 |
---|---|---|
committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-11-03 21:04:17 +0100 |
commit | 26879e9ff88c2a6e3bcd665606aef47ea97cdb5a (patch) | |
tree | 342ecfa74182aa9f6e45518759119844036a2086 /src/main/java | |
parent | 667fd43324e5610ec16a12ef42d4e4d3aff75419 (diff) | |
download | skyhanni-26879e9ff88c2a6e3bcd665606aef47ea97cdb5a.tar.gz skyhanni-26879e9ff88c2a6e3bcd665606aef47ea97cdb5a.tar.bz2 skyhanni-26879e9ff88c2a6e3bcd665606aef47ea97cdb5a.zip |
code cleanup
Diffstat (limited to 'src/main/java')
5 files changed, 57 insertions, 46 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/config/Storage.java b/src/main/java/at/hannibal2/skyhanni/config/Storage.java index 173b48fa4..ad17625fd 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/Storage.java +++ b/src/main/java/at/hannibal2/skyhanni/config/Storage.java @@ -92,9 +92,9 @@ public class Storage { @Override public String toString() { return "MinionConfig{" + - "displayName='" + displayName + '\'' + - ", lastClicked=" + lastClicked + - '}'; + "displayName='" + displayName + '\'' + + ", lastClicked=" + lastClicked + + '}'; } } @@ -380,22 +380,22 @@ public class Storage { @Override public String toString() { return "SlayerItemProfit{" + - "internalName='" + internalName + '\'' + - ", timesDropped=" + timesDropped + - ", totalAmount=" + totalAmount + - ", hidden=" + hidden + - '}'; + "internalName='" + internalName + '\'' + + ", timesDropped=" + timesDropped + + ", totalAmount=" + totalAmount + + ", hidden=" + hidden + + '}'; } } @Override public String toString() { return "SlayerProfitList{" + - "items=" + items + - ", mobKillCoins=" + mobKillCoins + - ", slayerSpawnCost=" + slayerSpawnCost + - ", slayerCompletedCount=" + slayerCompletedCount + - '}'; + "items=" + items + + ", mobKillCoins=" + mobKillCoins + + ", slayerSpawnCost=" + slayerSpawnCost + + ", slayerCompletedCount=" + slayerCompletedCount + + '}'; } } @@ -419,11 +419,11 @@ public class Storage { @Override public String toString() { return "SlayerRngMeterStorage{" + - "currentMeter=" + currentMeter + - ", gainPerBoss=" + gainPerBoss + - ", goalNeeded=" + goalNeeded + - ", itemGoal='" + itemGoal + '\'' + - '}'; + "currentMeter=" + currentMeter + + ", gainPerBoss=" + gainPerBoss + + ", goalNeeded=" + goalNeeded + + ", itemGoal='" + itemGoal + '\'' + + '}'; } } @@ -454,7 +454,7 @@ public class Storage { public int selfKillingAnimals; @Expose - public Map<TrevorTracker.TrapperMobRarity, Integer> animalRarities= new HashMap<>(); + public Map<TrevorTracker.TrapperMobRarity, Integer> animalRarities = new HashMap<>(); } @Expose diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/FarmingFortuneDisplay.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/FarmingFortuneDisplay.kt index 5bf5bbe8f..6cdf64ca6 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/FarmingFortuneDisplay.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/FarmingFortuneDisplay.kt @@ -140,7 +140,6 @@ class FarmingFortuneDisplay { private fun isEnabled(): Boolean = GardenAPI.inGarden() && config.display - companion object { private val config get() = SkyHanniMod.feature.garden.farmingFortunes private val latestFF: MutableMap<CropType, Double>? get() = GardenAPI.config?.latestTrueFarmingFortune @@ -251,17 +250,20 @@ class FarmingFortuneDisplay { itemBaseFortune = 0.0 greenThumbFortune = 0.0 for (line in tool?.getLore()!!) { - val match = tooltipFortunePattern.matchEntire(line)?.groups - if (match != null) { - displayedFortune = match[1]!!.value.toDouble() - reforgeFortune = match[2]?.value?.toDouble() ?: 0.0 - - itemBaseFortune = if (tool.getInternalName().contains("LOTUS")) 5.0 - else displayedFortune - reforgeFortune - enchantmentFortune - (tool.getFarmingForDummiesCount() ?: 0 ) * 1.0 - greenThumbFortune = if (tool.getInternalName().contains("LOTUS")) { - displayedFortune - reforgeFortune - itemBaseFortune - } else 0.0 + val match = tooltipFortunePattern.matchEntire(line)?.groups ?: continue + + displayedFortune = match[1]!!.value.toDouble() + reforgeFortune = match[2]?.value?.toDouble() ?: 0.0 + + itemBaseFortune = if (tool.getInternalName().contains("LOTUS")) { + 5.0 + } else { + val dummiesFF = (tool.getFarmingForDummiesCount() ?: 0) * 1.0 + displayedFortune - reforgeFortune - enchantmentFortune - dummiesFF } + greenThumbFortune = if (tool.getInternalName().contains("LOTUS")) { + displayedFortune - reforgeFortune - itemBaseFortune + } else 0.0 } } @@ -290,8 +292,8 @@ class FarmingFortuneDisplay { @SubscribeEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { - event.move(3,"garden.farmingFortuneDisplay", "garden.farmingFortunes.display") - event.move(3,"garden.farmingFortuneDropMultiplier", "garden.farmingFortunes.dropMultiplier") - event.move(3,"garden.farmingFortunePos", "garden.farmingFortunes.pos") + event.move(3, "garden.farmingFortuneDisplay", "garden.farmingFortunes.display") + event.move(3, "garden.farmingFortuneDropMultiplier", "garden.farmingFortunes.dropMultiplier") + event.move(3, "garden.farmingFortunePos", "garden.farmingFortunes.pos") } } diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/CaptureFarmingGear.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/CaptureFarmingGear.kt index b4d0fa372..47c64032c 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/CaptureFarmingGear.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/CaptureFarmingGear.kt @@ -80,14 +80,15 @@ class CaptureFarmingGear { } fun reverseCarrotFortune() { - val hidden = GardenAPI.config?.fortune ?: return - hidden.carrotFortune = !hidden.carrotFortune - LorenzUtils.chat("§2Toggled exportable carrot fortune to: ${hidden.carrotFortune}") + val storage = GardenAPI.config?.fortune ?: return + storage.carrotFortune = !storage.carrotFortune + LorenzUtils.chat("§2Toggled exportable carrot fortune to: ${storage.carrotFortune}") } + fun reversePumpkinFortune() { - val hidden = GardenAPI.config?.fortune ?: return - hidden.pumpkinFortune = !hidden.pumpkinFortune - LorenzUtils.chat("§2Toggled expired pumpkin fortune to: ${hidden.pumpkinFortune}") + val storage = GardenAPI.config?.fortune ?: return + storage.pumpkinFortune = !storage.pumpkinFortune + LorenzUtils.chat("§2Toggled expired pumpkin fortune to: ${storage.pumpkinFortune}") } } diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/FFStats.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/FFStats.kt index 8765bd19b..24d125d56 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/FFStats.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/FFStats.kt @@ -151,13 +151,13 @@ object FFStats { else -> {} } if (crop == CropType.CARROT) { - val hidden = GardenAPI.config?.fortune ?: return - val carrotFortune = if (hidden.carrotFortune) 12.0 else 0.0 + val storage = GardenAPI.config?.fortune ?: return + val carrotFortune = if (storage.carrotFortune) 12.0 else 0.0 cropPage[FortuneStats.EXPORTED_CARROT] = Pair(carrotFortune, 12.0) } if (crop == CropType.PUMPKIN) { - val hidden = GardenAPI.config?.fortune ?: return - val pumpkinFortune = if (hidden.pumpkinFortune) 12.0 else 0.0 + val storage = GardenAPI.config?.fortune ?: return + val pumpkinFortune = if (storage.pumpkinFortune) 12.0 else 0.0 cropPage[FortuneStats.EXPIRED_PUMPKIN] = Pair(pumpkinFortune, 12.0) } diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/FortuneStats.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/FortuneStats.kt index fc759ac04..af02f7577 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/FortuneStats.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/FortuneStats.kt @@ -4,7 +4,7 @@ enum class FortuneStats(val label: String, val tooltip: String) { BASE( "§2Universal Farming Fortune", "§7§2Farming fortune in that is\n§2applied to every crop\n§eNot the same as tab FF\n" + - "§eSee on the grass block page" + "§eSee on the grass block page" ), CROP_TOTAL("§6Crop Farming Fortune", "§7§2Farming fortune for this crop"), ACCESSORY("§2Talisman Bonus", "§7§2Fortune from your talisman\n§2You get 10☘ per talisman tier"), @@ -19,6 +19,14 @@ enum class FortuneStats(val label: String, val tooltip: String) { CULTIVATING("§2Cultivating Enchantment", "§7§2Fortune for each enchantment level\n§2You get 2☘ per level"), TURBO("§2Turbo-Crop Enchantment", "§7§2Fortune for each enchantment level\n§2You get 5☘ per level"), DEDICATION("§2Dedication Enchantment", "§7§2Fortune for each enchantment level\n§2and crop milestone"), - EXPORTED_CARROT("§2Exported Carrot", "§7§2Gain 12☘ from exporting Carrots in the Rift!\n§eRun /shcarrot to toggle the stat"), - EXPIRED_PUMPKIN("§2Expired Pumpkin", "§7§2Gain 12☘ from letting Pumpkins expire!\n§eRun /shpumpkin to toggle the stat") + EXPORTED_CARROT( + "§2Exported Carrot", + "§7§2Gain 12☘ from exporting Carrots in the Rift!\n" + + "§eRun /shcarrot to toggle the stat" + ), + EXPIRED_PUMPKIN( + "§2Expired Pumpkin", + "§7§2Gain 12☘ from letting Pumpkins expire!\n" + + "§eRun /shpumpkin to toggle the stat" + ) } |