Skip to content

Commit

Permalink
Added JobEvent
Browse files Browse the repository at this point in the history
  • Loading branch information
WillFP committed Feb 8, 2023
1 parent 420279f commit 91645c1
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package com.willfp.ecojobs.api.event

import com.willfp.ecojobs.jobs.Job

interface JobEvent {
val job: Job
}
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 91645c1

Please sign in to comment.