diff options
Diffstat (limited to 'src/main/java/at/hannibal2')
-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() |