aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-03-29 23:06:37 +0200
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-03-29 23:06:37 +0200
commit1241fa6c64a985663371e59c4c1a38ff55bacced (patch)
tree7a98e67044a24bfe0b0014a8414980b2afe82934 /src
parent35ff28ebf5e79481326d87296834709f16d639ba (diff)
downloadskyhanni-1241fa6c64a985663371e59c4c1a38ff55bacced.tar.gz
skyhanni-1241fa6c64a985663371e59c4c1a38ff55bacced.tar.bz2
skyhanni-1241fa6c64a985663371e59c4c1a38ff55bacced.zip
dynamic optimal speed
Diffstat (limited to 'src')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/features/Garden.java81
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/CropType.kt6
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/GardenOptimalSpeed.kt21
3 files changed, 94 insertions, 14 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/Garden.java b/src/main/java/at/hannibal2/skyhanni/config/features/Garden.java
index 32e8c054e..02b31b377 100644
--- a/src/main/java/at/hannibal2/skyhanni/config/features/Garden.java
+++ b/src/main/java/at/hannibal2/skyhanni/config/features/Garden.java
@@ -378,7 +378,7 @@ public class Garden {
public boolean optimalSpeed = false;
@Expose
- @ConfigOption(name = "Enabled", desc = "Show the optimal speed for your current tool in the hand. (Ty MelonKingDE for the values).")
+ @ConfigOption(name = "Enabled", desc = "Show the optimal speed for your current tool in the hand.\n(Thanks MelonKingDE for the default values).")
@ConfigEditorBoolean
@ConfigAccordionId(id = 9)
public boolean optimalSpeedEnabled = true;
@@ -390,6 +390,85 @@ public class Garden {
public boolean optimalSpeedWarning = false;
@Expose
+ @ConfigOption(name = "Custom Speed", desc = "Change the exact speed for every single crop.")
+ @Accordion
+ @ConfigAccordionId(id = 9)
+ public CustomSpeed optimalSpeedCustom = new CustomSpeed();
+
+ public static class CustomSpeed {
+
+ @Expose
+ @ConfigOption(name = "Wheat", desc = "Suggested farm speed:\n" +
+ "§e5 Blocks§7: §f✦ 93 speed\n" +
+ "§e4 Blocks§7: §f✦ 116 speed")
+ @ConfigEditorSlider(minValue = 1, maxValue = 400, minStep = 1)
+ public int wheat = 93;
+
+ @Expose
+ @ConfigOption(name = "Carrot", desc = "Suggested farm speed:\n" +
+ "§e5 Blocks§7: §f✦ 93 speed\n" +
+ "§e4 Blocks§7: §f✦ 116 speed")
+ @ConfigEditorSlider(minValue = 1, maxValue = 400, minStep = 1)
+ public int carrot = 93;
+
+ @Expose
+ @ConfigOption(name = "Potato", desc = "Suggested farm speed:\n" +
+ "§e5 Blocks§7: §f✦ 93 speed\n" +
+ "§e4 Blocks§7: §f✦ 116 speed")
+ @ConfigEditorSlider(minValue = 1, maxValue = 400, minStep = 1)
+ public int potato = 93;
+
+ @Expose
+ @ConfigOption(name = "Nether Wart", desc = "Suggested farm speed:\n" +
+ "§e5 Blocks§7: §f✦ 93 speed\n" +
+ "§e4 Blocks§7: §f✦ 116 speed")
+ @ConfigEditorSlider(minValue = 1, maxValue = 400, minStep = 1)
+ public int netherWart = 93;
+
+ @Expose
+ @ConfigOption(name = "Pumpkin", desc = "Suggested farm speed:\n" +
+ "§e3 Blocks§7: §f✦ 155 speed\n" +
+ "§e2 Blocks§7: §f✦ 265 §7or §f400 speed")
+ @ConfigEditorSlider(minValue = 1, maxValue = 400, minStep = 1)
+ public int pumpkin = 155;
+
+ @Expose
+ @ConfigOption(name = "Melon", desc = "Suggested farm speed:\n" +
+ "§e3 Blocks§7: §f✦ 155 speed\n" +
+ "§e2 Blocks§7: §f✦ 265 or 400 speed")
+ @ConfigEditorSlider(minValue = 1, maxValue = 400, minStep = 1)
+ public int melon = 155;
+
+ @Expose
+ @ConfigOption(name = "Cocoa Beans", desc = "Suggested farm speed:\n" +
+ "§e3 Blocks§7: §f✦ 155 speed\n" +
+ "§e4 Blocks§7: §f✦ 116 speed")
+ @ConfigEditorSlider(minValue = 1, maxValue = 400, minStep = 1)
+ public int cocoaBeans = 155;
+
+ // TODO does other speed settings exist?
+ @Expose
+ @ConfigOption(name = "Sugar Cane", desc = "Suggested farm speed:\n" +
+ "§eYaw 45§7: §f✦ 328 speed")
+ @ConfigEditorSlider(minValue = 1, maxValue = 400, minStep = 1)
+ public int sugarCane = 328;
+
+ @Expose
+ @ConfigOption(name = "Cactus", desc = "Suggested farm speed:\n" +
+ "§eNormal§7: §f✦ 400 speed\n" +
+ "§eRacing Helmet§7: §f✦ 500 speed")
+ @ConfigEditorSlider(minValue = 1, maxValue = 500, minStep = 1)
+ public int cactus = 400;
+
+ // TODO does other speed settings exist?
+ @Expose
+ @ConfigOption(name = "Mushroom", desc = "Suggested farm speed:\n" +
+ "§eYaw 60§7: §f✦ 233 speed")
+ @ConfigEditorSlider(minValue = 1, maxValue = 400, minStep = 1)
+ public int mushroom = 233;
+ }
+
+ @Expose
public Position optimalSpeedPos = new Position(188, -105, false, true);
@Expose
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 769d3b4dd..18e701cb5 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/garden/CropType.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/garden/CropType.kt
@@ -4,13 +4,13 @@ enum class CropType(val cropName: String, val toolName: String) {
WHEAT("Wheat", "THEORETICAL_HOE_WHEAT"),
CARROT("Carrot", "THEORETICAL_HOE_CARROT"),
POTATO("Potato", "THEORETICAL_HOE_POTATO"),
+ NETHER_WART("Nether Wart", "THEORETICAL_HOE_WARTS"),
PUMPKIN("Pumpkin", "PUMPKIN_DICER"),
- SUGAR_CANE("Sugar Cane", "THEORETICAL_HOE_CANE"),
MELON("Melon", "MELON_DICER"),
- CACTUS("Cactus", "CACTUS_KNIFE"),
COCOA_BEANS("Cocoa Beans", "COCO_CHOPPER"),
+ SUGAR_CANE("Sugar Cane", "THEORETICAL_HOE_CANE"),
+ CACTUS("Cactus", "CACTUS_KNIFE"),
MUSHROOM("Mushroom", "FUNGI_CUTTER"),
- NETHER_WART("Nether Wart", "THEORETICAL_HOE_WARTS"),
;
companion object {
diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenOptimalSpeed.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenOptimalSpeed.kt
index 41258efc1..1fa138455 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenOptimalSpeed.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenOptimalSpeed.kt
@@ -13,6 +13,7 @@ import java.util.regex.Pattern
class GardenOptimalSpeed {
private val config get() = SkyHanniMod.feature.garden
+ private val configCustomSpeed get() = config.optimalSpeedCustom
private var currentSpeed = 100
private var optimalSpeed = -1
private val currentSpeedPattern = Pattern.compile(" Speed: §r§f✦(.*)")
@@ -38,16 +39,16 @@ class GardenOptimalSpeed {
}
private fun CropType.getOptimalSpeed() = when (this) {
- CropType.WHEAT -> 93
- CropType.CARROT -> 93
- CropType.POTATO -> 93
- CropType.PUMPKIN -> 155
- CropType.SUGAR_CANE -> 328
- CropType.MELON -> 155
- CropType.CACTUS -> 400 // 500 with racing helmet
- CropType.COCOA_BEANS -> 155
- CropType.MUSHROOM -> 233
- CropType.NETHER_WART -> 93
+ CropType.WHEAT -> configCustomSpeed.wheat
+ CropType.CARROT -> configCustomSpeed.carrot
+ CropType.POTATO -> configCustomSpeed.potato
+ CropType.NETHER_WART -> configCustomSpeed.netherWart
+ CropType.PUMPKIN -> configCustomSpeed.pumpkin
+ CropType.MELON -> configCustomSpeed.melon
+ CropType.COCOA_BEANS -> configCustomSpeed.cocoaBeans
+ CropType.SUGAR_CANE -> configCustomSpeed.sugarCane
+ CropType.CACTUS -> configCustomSpeed.cactus
+ CropType.MUSHROOM -> configCustomSpeed.mushroom
}
@SubscribeEvent