From b8ad16add932307fc2ac4b2c82763938abbe2ddc Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Fri, 28 Apr 2023 21:23:19 +0200 Subject: Added fake message when garden level up higher than 15 --- .../skyhanni/features/garden/GardenLevelDisplay.kt | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'src/main') 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 -- cgit