aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/GardenLevelDisplay.kt19
1 files changed, 17 insertions, 2 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenLevelDisplay.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenLevelDisplay.kt
index 38b31b57e..4ee33e2b4 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenLevelDisplay.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenLevelDisplay.kt
@@ -38,9 +38,24 @@ class GardenLevelDisplay {
if (!isEnabled()) return
visitorRewardPattern.matchMatcher(event.message) {
- gardenExp += group("exp").toInt()
- update()
+ addExp(group("exp").toInt())
+ }
+ }
+
+ private fun addExp(moreExp: Int) {
+ val oldLevel = getLevelForExp(gardenExp.toLong())
+ gardenExp += moreExp
+ val newLevel = getLevelForExp(gardenExp.toLong())
+ if (newLevel == oldLevel + 1) {
+ if (newLevel > 15) {
+ LorenzUtils.chat(
+ " \n" +
+ "§b§lGARDEN LEVEL UP §8$oldLevel -> §b$newLevel\n" +
+ " §8+§aRespect from Elite Farmers and SkyHanni members :)\n "
+ )
+ }
}
+ update()
}
@SubscribeEvent