aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/Storage.java3
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/commands/Commands.kt4
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/FarmingFortuneDisplay.kt11
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/CaptureFarmingGear.kt5
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/FFStats.kt7
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/FortuneStats.kt5
6 files changed, 29 insertions, 6 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/config/Storage.java b/src/main/java/at/hannibal2/skyhanni/config/Storage.java
index 951e80ebf..173b48fa4 100644
--- a/src/main/java/at/hannibal2/skyhanni/config/Storage.java
+++ b/src/main/java/at/hannibal2/skyhanni/config/Storage.java
@@ -251,6 +251,9 @@ public class Storage {
public boolean carrotFortune = false;
@Expose
+ public boolean pumpkinFortune = false;
+
+ @Expose
public Map<FarmingItems, ItemStack> farmingItems = new HashMap<>();
}
diff --git a/src/main/java/at/hannibal2/skyhanni/config/commands/Commands.kt b/src/main/java/at/hannibal2/skyhanni/config/commands/Commands.kt
index 69e8e5933..4a7e6cdcb 100644
--- a/src/main/java/at/hannibal2/skyhanni/config/commands/Commands.kt
+++ b/src/main/java/at/hannibal2/skyhanni/config/commands/Commands.kt
@@ -216,6 +216,10 @@ object Commands {
"Toggles receiving the 12 fortune from carrots"
) { CaptureFarmingGear.reverseCarrotFortune() }
registerCommand(
+ "shpumpkin",
+ "Toggles receiving the 12 fortune from pumpkins"
+ ) { CaptureFarmingGear.reversePumpkinFortune() }
+ registerCommand(
"shrepostatus",
"Shows the status of all the mods constants"
) { SkyHanniMod.repo.displayRepoStatus(false) }
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 17fc083fa..5bf5bbe8f 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/garden/FarmingFortuneDisplay.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/garden/FarmingFortuneDisplay.kt
@@ -270,14 +270,19 @@ class FarmingFortuneDisplay {
val accessoryFortune = accessoryFortune ?: 0.0
val baseFortune = if (alwaysBaseFortune) 100.0 else baseFortune
- var carrotFortune = 0.0
+ var otherFortune = 0.0
if (currentCrop == CropType.CARROT) {
GardenAPI.config?.fortune?.let {
- if (it.carrotFortune) carrotFortune = 12.0
+ if (it.carrotFortune) otherFortune = 12.0
}
}
- return baseFortune + upgradeFortune + tabFortune + toolFortune + accessoryFortune + carrotFortune
+ if (currentCrop == CropType.PUMPKIN) {
+ GardenAPI.config?.fortune?.let {
+ if (it.pumpkinFortune) otherFortune = 12.0
+ }
+ }
+ return baseFortune + upgradeFortune + tabFortune + toolFortune + accessoryFortune + otherFortune
}
fun CropType.getLatestTrueFarmingFortune() = latestFF?.get(this)
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 3a4844f2d..b4d0fa372 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
@@ -84,6 +84,11 @@ class CaptureFarmingGear {
hidden.carrotFortune = !hidden.carrotFortune
LorenzUtils.chat("§2Toggled exportable carrot fortune to: ${hidden.carrotFortune}")
}
+ fun reversePumpkinFortune() {
+ val hidden = GardenAPI.config?.fortune ?: return
+ hidden.pumpkinFortune = !hidden.pumpkinFortune
+ LorenzUtils.chat("§2Toggled expired pumpkin fortune to: ${hidden.pumpkinFortune}")
+ }
}
@SubscribeEvent
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 7e9c9399a..8765bd19b 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
@@ -155,6 +155,11 @@ object FFStats {
val carrotFortune = if (hidden.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
+ cropPage[FortuneStats.EXPIRED_PUMPKIN] = Pair(pumpkinFortune, 12.0)
+ }
cropPage[FortuneStats.CROP_TOTAL] = Pair(
cropPage.toList().sumOf { it.second.first },
@@ -257,4 +262,4 @@ object FFStats {
}
return 0.0
}
-} \ No newline at end of file
+}
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 77c275973..fc759ac04 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
@@ -19,5 +19,6 @@ 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")
-} \ No newline at end of file
+ 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")
+}