aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-03-04 01:30:17 +0100
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-03-04 01:30:17 +0100
commitb1b7a884552afef87727bfd68cc982ae17308bea (patch)
tree8d61d157f4f618d955df4ec1da156bde18a98c66 /src
parent6eab582513f0cf275bf467938a56771f35c8aa1d (diff)
downloadskyhanni-b1b7a884552afef87727bfd68cc982ae17308bea.tar.gz
skyhanni-b1b7a884552afef87727bfd68cc982ae17308bea.tar.bz2
skyhanni-b1b7a884552afef87727bfd68cc982ae17308bea.zip
Fixed garden visitor problems with mushroom, enchanted cactus green, enchanted golden carrot and enchanted cookie
Diffstat (limited to 'src')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/GardenCropMilestoneDisplay.kt9
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/GardenVisitorFeatures.kt2
-rw-r--r--src/main/java/at/hannibal2/skyhanni/utils/NEUItems.kt27
3 files changed, 35 insertions, 3 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenCropMilestoneDisplay.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenCropMilestoneDisplay.kt
index f44749686..d43d2f428 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenCropMilestoneDisplay.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenCropMilestoneDisplay.kt
@@ -22,7 +22,14 @@ class GardenCropMilestoneDisplay {
private val config: Garden get() = SkyHanniMod.feature.garden
companion object {
- val cropsPerSecond: MutableMap<String, Int> get() = SkyHanniMod.feature.hidden.gardenCropsPerSecond
+ fun getCropsPerSecond(crop: String): Int? {
+ if (crop.endsWith(" Mushroom")) {
+ return cropsPerSecond["Mushroom"]
+ }
+ return cropsPerSecond[crop]
+ }
+
+ private val cropsPerSecond: MutableMap<String, Int> get() = SkyHanniMod.feature.hidden.gardenCropsPerSecond
}
@SubscribeEvent
diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenVisitorFeatures.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenVisitorFeatures.kt
index 2a2d9f270..1d20afaf8 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenVisitorFeatures.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenVisitorFeatures.kt
@@ -174,7 +174,7 @@ class GardenVisitorFeatures {
val rawName = NEUItems.getItemStack(multiplier.first).name ?: continue
val crop = rawName.removeColor()
val cropAmount = multiplier.second.toLong() * amount
- GardenCropMilestoneDisplay.cropsPerSecond[crop]?.let {
+ GardenCropMilestoneDisplay.getCropsPerSecond(crop)?.let {
val formatAmount = LorenzUtils.formatInteger(cropAmount)
val formatName = "§e${formatAmount}§7x $crop "
val formatSpeed = if (it != -1) {
diff --git a/src/main/java/at/hannibal2/skyhanni/utils/NEUItems.kt b/src/main/java/at/hannibal2/skyhanni/utils/NEUItems.kt
index 5b7e33592..72bffdc46 100644
--- a/src/main/java/at/hannibal2/skyhanni/utils/NEUItems.kt
+++ b/src/main/java/at/hannibal2/skyhanni/utils/NEUItems.kt
@@ -114,7 +114,32 @@ object NEUItems {
val map = mutableMapOf<String, Int>()
for (ingredient in recipe.ingredients) {
val count = ingredient.count.toInt()
- val internalItemId = ingredient.internalItemId
+ var internalItemId = ingredient.internalItemId
+ // ignore cactus green
+ if (rawId == "ENCHANTED_CACTUS_GREEN") {
+ if (internalItemId == "INK_SACK-2") {
+ internalItemId = "CACTUS"
+ }
+ }
+
+ // ignore wheat in enchanted cookie
+ if (rawId == "ENCHANTED_COOKIE") {
+ if (internalItemId == "WHEAT") {
+ continue
+ }
+ }
+
+ // ignore golden carrot in enchanted golden carrot
+ if (rawId == "ENCHANTED_GOLDEN_CARROT") {
+ if (internalItemId == "GOLDEN_CARROT") {
+ continue
+ }
+ }
+
+// println("")
+// println("rawId: $rawId")
+// println("internalItemId: $internalItemId")
+
val old = map.getOrDefault(internalItemId, 0)
map[internalItemId] = old + count
}