Skip to content

Commit

Permalink
Re-add mock bukkit
Browse files Browse the repository at this point in the history
  • Loading branch information
gabber235 committed Dec 18, 2024
1 parent 4b1832a commit 3db0ae4
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
2 changes: 2 additions & 0 deletions engine/engine-paper/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ dependencies {
compileOnlyApi("com.github.retrooper:packetevents-spigot:2.7.0-SNAPSHOT")
compileOnly("me.clip:placeholderapi:2.11.6")
compileOnlyApi("org.geysermc.floodgate:api:2.2.3-SNAPSHOT")

testImplementation("org.mockbukkit.mockbukkit:mockbukkit-v1.21:4.18.0")
}

tasks.withType<ShadowJar> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ class PlaceholderParserTest : FunSpec({
}
}

checkAll<String, String>() { string, action ->
checkAll<String, String> { string, action ->
parser.parse(null, listOf(string, action)) shouldBe "Hey $string, $action"
}
parser.parse(null, listOf("bob")) shouldBe null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class ExampleBound(

// A manual version of the above
when (event.player.boundState) {
InteractionBoundState.BLOCKING -> event.cancelled = true
InteractionBoundState.BLOCKING -> event.isCancelled = true
InteractionBoundState.INTERRUPTING -> InteractionEndTrigger.triggerFor(event.player, context())
InteractionBoundState.IGNORING -> {}
}
Expand All @@ -70,17 +70,14 @@ class ExampleBound(
}
//</code-block:interaction_bound>

class SomeCancellablePlayerEvent(player: Player, var cancelled: Boolean) : PlayerEvent(player, true), Cancellable {
class SomeCancellablePlayerEvent(player: Player) : PlayerEvent(player, true), Cancellable {
override fun getHandlers(): HandlerList = HANDLER_LIST

companion object {
@JvmStatic
val HANDLER_LIST = HandlerList()
}

override fun isCancelled(): Boolean = cancelled

override fun setCancelled(isCancelled: Boolean) {
cancelled = isCancelled
}
override fun isCancelled(): Boolean = false
override fun setCancelled(p0: Boolean) {}
}

0 comments on commit 3db0ae4

Please sign in to comment.