aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2024-09-28 21:49:06 +0200
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2024-09-28 21:49:06 +0200
commit8a67b06c948ea35fee18853b7b19e2b0d064f60f (patch)
tree454cd982d633ab5a661a2ce6bee04c5597e23b50 /src
parent4ce974d559a080ac8ac95c8cae9147938fc97123 (diff)
downloadskyhanni-8a67b06c948ea35fee18853b7b19e2b0d064f60f.tar.gz
skyhanni-8a67b06c948ea35fee18853b7b19e2b0d064f60f.tar.bz2
skyhanni-8a67b06c948ea35fee18853b7b19e2b0d064f60f.zip
using default parameters
Diffstat (limited to 'src')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/events/hoppity/EggFoundEvent.kt4
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityAPI.kt14
2 files changed, 9 insertions, 9 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/events/hoppity/EggFoundEvent.kt b/src/main/java/at/hannibal2/skyhanni/events/hoppity/EggFoundEvent.kt
index 2cd81811f..30cd282ac 100644
--- a/src/main/java/at/hannibal2/skyhanni/events/hoppity/EggFoundEvent.kt
+++ b/src/main/java/at/hannibal2/skyhanni/events/hoppity/EggFoundEvent.kt
@@ -5,6 +5,6 @@ import at.hannibal2.skyhanni.features.event.hoppity.HoppityEggType
class EggFoundEvent(
val type: HoppityEggType,
- val slotIndex: Int?,
- val note: String?,
+ val slotIndex: Int? = null,
+ val note: String? = null,
) : SkyHanniEvent()
diff --git a/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityAPI.kt b/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityAPI.kt
index 881b8b5e7..09c0dedf9 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityAPI.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityAPI.kt
@@ -105,13 +105,13 @@ object HoppityAPI {
ChocolateFactoryStrayTracker.handleStrayClicked(it)
when (groupOrNull("name") ?: return@matchMatcher) {
"Fish the Rabbit" -> {
- EggFoundEvent(STRAY, it.slotNumber, null).post()
+ EggFoundEvent(STRAY, it.slotNumber).post()
lastName = "§9Fish the Rabbit"
lastMeal = STRAY
attemptFireRabbitFound()
}
"El Dorado" -> {
- EggFoundEvent(STRAY, it.slotNumber, null).post()
+ EggFoundEvent(STRAY, it.slotNumber).post()
lastName = "§6El Dorado"
lastMeal = STRAY
attemptFireRabbitFound()
@@ -132,7 +132,7 @@ object HoppityAPI {
val nameText = (if (clickedStack.hasDisplayName()) clickedStack.displayName else clickedStack.itemName)
sideDishNamePattern.matchMatcher(nameText) {
- EggFoundEvent(SIDE_DISH, index, null).post()
+ EggFoundEvent(SIDE_DISH, index).post()
lastMeal = SIDE_DISH
attemptFireRabbitFound()
}
@@ -140,12 +140,12 @@ object HoppityAPI {
clickedStack.getLore().let {
if (!it.any { line -> line == "§eClick to claim!" }) return
allTimeLorePattern.firstMatcher(it) {
- EggFoundEvent(CHOCOLATE_FACTORY_MILESTONE, index, null).post()
+ EggFoundEvent(CHOCOLATE_FACTORY_MILESTONE, index).post()
lastMeal = CHOCOLATE_FACTORY_MILESTONE
attemptFireRabbitFound()
}
shopLorePattern.firstMatcher(it) {
- EggFoundEvent(CHOCOLATE_SHOP_MILESTONE, index, null).post()
+ EggFoundEvent(CHOCOLATE_SHOP_MILESTONE, index).post()
lastMeal = CHOCOLATE_SHOP_MILESTONE
attemptFireRabbitFound()
}
@@ -160,14 +160,14 @@ object HoppityAPI {
eggFoundPattern.matchMatcher(event.message) {
resetRabbitData()
lastMeal = getEggType(event)
- lastMeal?.let { EggFoundEvent(it, null, groupOrNull("note")).post() }
+ lastMeal?.let { EggFoundEvent(it, note = groupOrNull("note")).post() }
attemptFireRabbitFound()
}
HoppityEggsManager.eggBoughtPattern.matchMatcher(event.message) {
if (group("rabbitname").equals(lastName)) {
lastMeal = HoppityEggType.BOUGHT
- EggFoundEvent(HoppityEggType.BOUGHT, null, null).post()
+ EggFoundEvent(HoppityEggType.BOUGHT).post()
attemptFireRabbitFound()
}
}