Skip to content

Commit

Permalink
fix(custom-events): fix stack overflow on bad kotlin convention for s…
Browse files Browse the repository at this point in the history
…pigot events

Bump to .25
  • Loading branch information
joshbker committed Nov 5, 2023
1 parent 51e91f2 commit c7a55da
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Maven
<dependency>
<groupId>gg.flyte</groupId>
<artifactId>twilight</artifactId>
<version>1.0.24</version>
<version>1.0.25</version>
</dependency>
```

Expand All @@ -29,14 +29,14 @@ maven {
url "https://repo.flyte.gg/releases"
}
implementation "gg.flyte:twilight:1.0.24"
implementation "gg.flyte:twilight:1.0.25"
```

Gradle (Kotlin DSL)
```kotlin
maven("https://repo.flyte.gg/releases")

implementation("gg.flyte:twilight:1.0.24")
implementation("gg.flyte:twilight:1.0.25")
```

Certain features of Twilight require configuration, which can be done via the Twilight class. To setup a Twilight class instance, you can use the `twilight` method as shown below:
Expand Down
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ plugins {
}

group = "gg.flyte"
version = "1.0.24"
version = "1.0.25"

repositories {
mavenCentral()
Expand Down
9 changes: 7 additions & 2 deletions src/main/kotlin/gg/flyte/twilight/event/Event.kt
Original file line number Diff line number Diff line change
Expand Up @@ -63,20 +63,25 @@ open class TwilightEvent(async: Boolean = false) : Event(async), Cancellable {
*/
val timestamp: Instant = Instant.now()

/**
* Whether the event is cancelled
*/
private var _isCancelled = false

/**
* Checks if the event is cancelled.
*
* @return True if the event is cancelled, otherwise false.
*/
override fun isCancelled(): Boolean = isCancelled
override fun isCancelled(): Boolean = _isCancelled

/**
* Sets the cancellation status of the event.
*
* @param cancel True to cancel the event, false to allow it to proceed.
*/
override fun setCancelled(cancel: Boolean) {
isCancelled = cancel
_isCancelled = cancel
}

companion object {
Expand Down

0 comments on commit c7a55da

Please sign in to comment.