aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/CropMoneyDisplay.kt24
1 files changed, 11 insertions, 13 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/CropMoneyDisplay.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/CropMoneyDisplay.kt
index fcfaceae4..8af8bf742 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/garden/CropMoneyDisplay.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/garden/CropMoneyDisplay.kt
@@ -43,32 +43,29 @@ class CropMoneyDisplay {
@SubscribeEvent
fun onTick(event: TickEvent.ClientTickEvent) {
if (!isEnabled()) return
-
if (tick++ % (20 * 5) != 0) return
-
if (!hasCropInHand && !config.moneyPerHourAlwaysOn) return
+
update()
}
private fun update() {
init()
- if (ready) {
- val newDisplay = drawNewDisplay()
- display.clear()
- display.addAll(newDisplay)
- } else {
- val newDisplay = mutableListOf<List<Any>>()
- newDisplay.add(Collections.singletonList("§7Money per hour when selling:"))
- newDisplay.add(Collections.singletonList("§eLoading..."))
- display.clear()
- display.addAll(newDisplay)
- }
+ val newDisplay = drawNewDisplay()
+ display.clear()
+ display.addAll(newDisplay)
}
private fun drawNewDisplay(): MutableList<List<Any>> {
val newDisplay = mutableListOf<List<Any>>()
+ if (!ready) {
+ newDisplay.add(Collections.singletonList("§7Money per hour when selling:"))
+ newDisplay.add(Collections.singletonList("§eLoading..."))
+ return newDisplay
+ }
+
if (!hasCropInHand && !config.moneyPerHourAlwaysOn) return newDisplay
newDisplay.add(Collections.singletonList("§7Money per hour when selling:"))
@@ -152,6 +149,7 @@ class CropMoneyDisplay {
for ((internalName, _) in NotEnoughUpdates.INSTANCE.manager.itemInformation) {
if (!BazaarApi.isBazaarItem(internalName)) continue
+ if (internalName == "ENCHANTED_PAPER") continue
val (newId, amount) = NEUItems.getMultiplier(internalName)
if (amount < 10) continue