diff options
author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-04-14 19:45:13 +0200 |
---|---|---|
committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-04-14 19:45:13 +0200 |
commit | 1a2676dcff04f6a6d04619a0c3b19185ab2557bf (patch) | |
tree | 10d362ed6a296624786ceb534de2f71962d74b22 /src/main/java | |
parent | d9191de0d4670d8e710c556210fea64b351090e2 (diff) | |
download | skyhanni-1a2676dcff04f6a6d04619a0c3b19185ab2557bf.tar.gz skyhanni-1a2676dcff04f6a6d04619a0c3b19185ab2557bf.tar.bz2 skyhanni-1a2676dcff04f6a6d04619a0c3b19185ab2557bf.zip |
Adjusted Crop_Money_Per_Hour calculation to account for replenishing costs of carrot, potato, Nether Wart, and cocoa beans, resulting in a slight decrease in the money/hour value for these crops.
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/garden/CropType.kt | 19 | ||||
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/garden/farming/CropMoneyDisplay.kt | 4 |
2 files changed, 18 insertions, 5 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/CropType.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/CropType.kt index ea1337e5b..c8888b688 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/CropType.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/CropType.kt @@ -6,14 +6,23 @@ import net.minecraft.init.Items import net.minecraft.item.EnumDyeColor import net.minecraft.item.ItemStack -enum class CropType(val cropName: String, val toolName: String, val baseDrops: Double, iconSupplier: () -> ItemStack) { +enum class CropType( + val cropName: String, + val toolName: String, + val baseDrops: Double, + iconSupplier: () -> ItemStack, + val replenish: Boolean = false, +) { WHEAT("Wheat", "THEORETICAL_HOE_WHEAT", 1.0, { ItemStack(Items.wheat) }), - CARROT("Carrot", "THEORETICAL_HOE_CARROT", 3.0, { ItemStack(Items.carrot) }), - POTATO("Potato", "THEORETICAL_HOE_POTATO", 3.0, { ItemStack(Items.potato) }), - NETHER_WART("Nether Wart", "THEORETICAL_HOE_WARTS", 2.5, { ItemStack(Items.nether_wart) }), + CARROT("Carrot", "THEORETICAL_HOE_CARROT", 3.0, { ItemStack(Items.carrot) }, replenish = true), + POTATO("Potato", "THEORETICAL_HOE_POTATO", 3.0, { ItemStack(Items.potato) }, replenish = true), + NETHER_WART("Nether Wart", "THEORETICAL_HOE_WARTS", 2.5, { ItemStack(Items.nether_wart) }, replenish = true), PUMPKIN("Pumpkin", "PUMPKIN_DICER", 1.0, { ItemStack(Blocks.pumpkin) }), MELON("Melon", "MELON_DICER", 5.0, { ItemStack(Items.melon) }), - COCOA_BEANS("Cocoa Beans", "COCO_CHOPPER", 3.0, { ItemStack(Items.dye, 1, EnumDyeColor.BROWN.dyeDamage) }), + COCOA_BEANS( + "Cocoa Beans", "COCO_CHOPPER", + 3.0, { ItemStack(Items.dye, 1, EnumDyeColor.BROWN.dyeDamage) }, replenish = true + ), SUGAR_CANE("Sugar Cane", "THEORETICAL_HOE_CANE", 2.0, { ItemStack(Items.reeds) }), CACTUS("Cactus", "CACTUS_KNIFE", 2.0, { ItemStack(Blocks.cactus) }), MUSHROOM("Mushroom", "FUNGI_CUTTER", 1.0, { ItemStack(Blocks.red_mushroom_block) }), diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/farming/CropMoneyDisplay.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/farming/CropMoneyDisplay.kt index 63296bace..a9d25ecb3 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/farming/CropMoneyDisplay.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/farming/CropMoneyDisplay.kt @@ -195,6 +195,10 @@ class CropMoneyDisplay { if (speed == -1.0) continue val isSeeds = internalName == "ENCHANTED_SEEDS" if (isSeeds) speed *= 1.36 + if (crop.replenish) { + val blockPerSecond = crop.multiplier * 20 + speed -= blockPerSecond + } val speedPerHour = speed * 60 * 60 val cropsPerHour = speedPerHour / amount.toDouble() |