diff options
author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-04-28 21:23:19 +0200 |
---|---|---|
committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-04-28 21:23:19 +0200 |
commit | b8ad16add932307fc2ac4b2c82763938abbe2ddc (patch) | |
tree | d02f8093f48a34eedcf36e9ae62fdeb5dd26e448 /src/main | |
parent | 8bc87268ac43b769e84989d6e62753710895ffba (diff) | |
download | skyhanni-b8ad16add932307fc2ac4b2c82763938abbe2ddc.tar.gz skyhanni-b8ad16add932307fc2ac4b2c82763938abbe2ddc.tar.bz2 skyhanni-b8ad16add932307fc2ac4b2c82763938abbe2ddc.zip |
Added fake message when garden level up higher than 15
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/garden/GardenLevelDisplay.kt | 19 |
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 |