Skip to content

Commit

Permalink
Merge pull request #101 from Shynixn/development
Browse files Browse the repository at this point in the history
Merge changes to master --release
  • Loading branch information
Shynixn authored May 14, 2023
2 parents d73684f + 2c01da1 commit 001368d
Show file tree
Hide file tree
Showing 9 changed files with 35 additions and 26 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ tasks.register("printVersion") {

subprojects {
group 'com.github.shynixn.mccoroutine'
version '2.11.0'
version '2.12.0'

sourceCompatibility = 1.8

Expand Down
28 changes: 14 additions & 14 deletions docs/wiki/docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,53 +8,53 @@ In order to use the MCCoroutine Kotlin API, you need to include the following li

```groovy
dependencies {
implementation("com.github.shynixn.mccoroutine:mccoroutine-bukkit-api:2.11.0")
implementation("com.github.shynixn.mccoroutine:mccoroutine-bukkit-core:2.11.0")
implementation("com.github.shynixn.mccoroutine:mccoroutine-bukkit-api:2.12.0")
implementation("com.github.shynixn.mccoroutine:mccoroutine-bukkit-core:2.12.0")
}
```

=== "BungeeCord"

```groovy
dependencies {
implementation("com.github.shynixn.mccoroutine:mccoroutine-bungeecord-api:2.11.0")
implementation("com.github.shynixn.mccoroutine:mccoroutine-bungeecord-core:2.11.0")
implementation("com.github.shynixn.mccoroutine:mccoroutine-bungeecord-api:2.12.0")
implementation("com.github.shynixn.mccoroutine:mccoroutine-bungeecord-core:2.12.0")
}
```

=== "Sponge"

```groovy
dependencies {
implementation("com.github.shynixn.mccoroutine:mccoroutine-sponge-api:2.11.0")
implementation("com.github.shynixn.mccoroutine:mccoroutine-sponge-core:2.11.0")
implementation("com.github.shynixn.mccoroutine:mccoroutine-sponge-api:2.12.0")
implementation("com.github.shynixn.mccoroutine:mccoroutine-sponge-core:2.12.0")
}
```

=== "Velocity"

```groovy
dependencies {
implementation("com.github.shynixn.mccoroutine:mccoroutine-velocity-api:2.11.0")
implementation("com.github.shynixn.mccoroutine:mccoroutine-velocity-core:2.11.0")
implementation("com.github.shynixn.mccoroutine:mccoroutine-velocity-api:2.12.0")
implementation("com.github.shynixn.mccoroutine:mccoroutine-velocity-core:2.12.0")
}
```

=== "Minestom"

```groovy
dependencies {
implementation("com.github.shynixn.mccoroutine:mccoroutine-minestom-api:2.11.0")
implementation("com.github.shynixn.mccoroutine:mccoroutine-minestom-core:2.11.0")
implementation("com.github.shynixn.mccoroutine:mccoroutine-minestom-api:2.12.0")
implementation("com.github.shynixn.mccoroutine:mccoroutine-minestom-core:2.12.0")
}
```

=== "Fabric"

```groovy
dependencies {
implementation("com.github.shynixn.mccoroutine:mccoroutine-fabric-api:2.11.0")
implementation("com.github.shynixn.mccoroutine:mccoroutine-fabric-core:2.11.0")
implementation("com.github.shynixn.mccoroutine:mccoroutine-fabric-api:2.12.0")
implementation("com.github.shynixn.mccoroutine:mccoroutine-fabric-core:2.12.0")
}
```

Expand All @@ -78,8 +78,8 @@ dependencies {
**plugin.yml**
```yaml
libraries:
- com.github.shynixn.mccoroutine:mccoroutine-bukkit-api:2.11.0
- com.github.shynixn.mccoroutine:mccoroutine-bukkit-core:2.11.0
- com.github.shynixn.mccoroutine:mccoroutine-bukkit-api:2.12.0
- com.github.shynixn.mccoroutine:mccoroutine-bukkit-core:2.12.0
```

=== "Other Server"
Expand Down
2 changes: 1 addition & 1 deletion docs/wiki/docs/unittests.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ feedback to the real environment.

```kotlin
dependencies {
testImplementation("com.github.shynixn.mccoroutine:mccoroutine-bukkit-test:2.11.0")
testImplementation("com.github.shynixn.mccoroutine:mccoroutine-bukkit-test:2.12.0")
}
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ internal class EventServiceImpl(private val plugin: Plugin) {
private val method: Method,
private val plugin: Plugin
) : EventExecutor {
var isSuspendMethod: Boolean? = null
fun executeSuspend(listener: Listener, event: Event): Job {
return executeEvent(listener, event)
}
Expand All @@ -210,11 +211,19 @@ internal class EventServiceImpl(private val plugin: Plugin) {
// We want to start it on the same thread as the calling thread -> unDispatched.
// However, after a possible suspension we either end up on the asyncDispatcher or minecraft Dispatcher.
return plugin.launch(dispatcher, CoroutineStart.UNDISPATCHED) {
try {
// Try as suspension function.
if (isSuspendMethod == null) {
try {
// Try as suspension function.
method.invokeSuspend(listener, event)
isSuspendMethod = true
} catch (e: IllegalArgumentException) {
// Try as ordinary function.
method.invoke(listener, event)
isSuspendMethod = false
}
} else if (isSuspendMethod!!) {
method.invokeSuspend(listener, event)
} catch (e: IllegalArgumentException) {
// Try as ordinary function.
} else {
method.invoke(listener, event)
}
}
Expand Down
2 changes: 1 addition & 1 deletion mccoroutine-bukkit-sample/src/main/resources/plugin.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: MCCoroutine-Sample
version: 2.11.0
version: 2.12.0
author: Shynixn
main: com.github.shynixn.mccoroutine.bukkit.sample.MCCoroutineSamplePlugin
commands:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: MCCoroutine-Sample
version: 2.11.0
version: 2.12.0
author: Shynixn
main: com.github.shynixn.mccoroutine.bungeecord.sample.MCCoroutineSamplePlugin
commands:
Expand Down
4 changes: 2 additions & 2 deletions mccoroutine-fabric-sample/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ repositories {
mavenLocal()
}
dependencies {
implementation("com.github.shynixn.mccoroutine:mccoroutine-fabric-api:2.11.0")
implementation("com.github.shynixn.mccoroutine:mccoroutine-fabric-core:2.11.0")
implementation("com.github.shynixn.mccoroutine:mccoroutine-fabric-api:2.12.0")
implementation("com.github.shynixn.mccoroutine:mccoroutine-fabric-core:2.12.0")

minecraft("com.mojang", "minecraft", project.extra["minecraft_version"] as String)
mappings("net.fabricmc", "yarn", project.extra["yarn_mappings"] as String, null, "v2")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"entrypoint": "com.github.shynixn.mccoroutine.minestom.sample.extension.MCCoroutineSampleExtension",
"name": "MCCoroutineSampleExtension",
"version": "2.11.0"
"version": "2.12.0"
}
2 changes: 1 addition & 1 deletion mccoroutine-sponge-sample/src/main/resources/mcmod.info
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[{
"modid": "mccoroutinesample",
"name": "MCCoroutineSample",
"version": "2.11.0",
"version": "2.12.0",
"description": "MCCoroutineSample is sample plugin to use MCCoroutine in Sponge.",
"authorList": [
"Shynixn"
Expand Down

0 comments on commit 001368d

Please sign in to comment.