From 91645c13ac1002c63213ea719f6efa56631496fc Mon Sep 17 00:00:00 2001 From: Auxilor Date: Wed, 8 Feb 2023 17:24:41 +0000 Subject: [PATCH] Added JobEvent --- .../main/kotlin/com/willfp/ecojobs/api/event/JobEvent.kt | 7 +++++++ .../com/willfp/ecojobs/api/event/PlayerJobExpGainEvent.kt | 4 ++-- .../com/willfp/ecojobs/api/event/PlayerJobJoinEvent.kt | 4 ++-- .../com/willfp/ecojobs/api/event/PlayerJobLeaveEvent.kt | 4 ++-- .../com/willfp/ecojobs/api/event/PlayerJobLevelUpEvent.kt | 4 ++-- gradle.properties | 2 +- 6 files changed, 16 insertions(+), 9 deletions(-) create mode 100644 eco-core/core-plugin/src/main/kotlin/com/willfp/ecojobs/api/event/JobEvent.kt diff --git a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecojobs/api/event/JobEvent.kt b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecojobs/api/event/JobEvent.kt new file mode 100644 index 0000000..dbeb1cf --- /dev/null +++ b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecojobs/api/event/JobEvent.kt @@ -0,0 +1,7 @@ +package com.willfp.ecojobs.api.event + +import com.willfp.ecojobs.jobs.Job + +interface JobEvent { + val job: Job +} diff --git a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecojobs/api/event/PlayerJobExpGainEvent.kt b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecojobs/api/event/PlayerJobExpGainEvent.kt index 8670df8..a4b7697 100644 --- a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecojobs/api/event/PlayerJobExpGainEvent.kt +++ b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecojobs/api/event/PlayerJobExpGainEvent.kt @@ -8,10 +8,10 @@ import org.bukkit.event.Cancellable class PlayerJobExpGainEvent( who: Player, - val job: Job, + override val job: Job, var amount: Double, val isMultiply: Boolean -) : PlayerEvent(who), Cancellable { +) : PlayerEvent(who), Cancellable, JobEvent { private var cancelled = false override fun setCancelled(cancel: Boolean) { diff --git a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecojobs/api/event/PlayerJobJoinEvent.kt b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecojobs/api/event/PlayerJobJoinEvent.kt index 7cb15fc..95ec4b1 100644 --- a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecojobs/api/event/PlayerJobJoinEvent.kt +++ b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecojobs/api/event/PlayerJobJoinEvent.kt @@ -8,9 +8,9 @@ import org.bukkit.event.HandlerList class PlayerJobJoinEvent( val player: OfflinePlayer, - val job: Job, + override val job: Job, val oldJob: Job? -) : Event(), Cancellable { +) : Event(), Cancellable, JobEvent { private var cancelled = false override fun isCancelled() = this.cancelled diff --git a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecojobs/api/event/PlayerJobLeaveEvent.kt b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecojobs/api/event/PlayerJobLeaveEvent.kt index 956378f..b4ac275 100644 --- a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecojobs/api/event/PlayerJobLeaveEvent.kt +++ b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecojobs/api/event/PlayerJobLeaveEvent.kt @@ -8,8 +8,8 @@ import org.bukkit.event.HandlerList class PlayerJobLeaveEvent( val player: OfflinePlayer, - val job: Job -) : Event(), Cancellable { + override val job: Job +) : Event(), Cancellable, JobEvent { private var cancelled = false override fun isCancelled() = this.cancelled diff --git a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecojobs/api/event/PlayerJobLevelUpEvent.kt b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecojobs/api/event/PlayerJobLevelUpEvent.kt index e1b5a4a..ef81379 100644 --- a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecojobs/api/event/PlayerJobLevelUpEvent.kt +++ b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecojobs/api/event/PlayerJobLevelUpEvent.kt @@ -7,9 +7,9 @@ import org.bukkit.event.HandlerList class PlayerJobLevelUpEvent( who: Player, - val job: Job, + override val job: Job, val level: Int -) : PlayerEvent(who) { +) : PlayerEvent(who), JobEvent { override fun getHandlers(): HandlerList { return handlerList } diff --git a/gradle.properties b/gradle.properties index c1691bc..03c8d2d 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,4 +1,4 @@ #libreforge-updater #Tue Feb 07 14:45:38 GMT 2023 -version=1.34.2 +version=1.35.0 plugin-name=EcoJobs