From f48501f5b0f5365954902535e3cb629950cc4cdc Mon Sep 17 00:00:00 2001 From: Tristan Date: Thu, 26 May 2022 19:07:10 -0400 Subject: [PATCH] Bump Minestom --- build.gradle.kts | 4 ++-- src/main/kotlin/world/cepi/kepi/Kepi.kt | 1 + .../world/cepi/kepi/command/BlockHandlerCommand.kt | 6 +++--- src/main/kotlin/world/cepi/kepi/command/KepiCommand.kt | 2 +- src/main/kotlin/world/cepi/kepi/menu/KepiMenuUI.kt | 9 +++------ 5 files changed, 10 insertions(+), 12 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index dc80df4..d029631 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -34,13 +34,13 @@ dependencies { testImplementation("io.kotest:kotest-runner-junit5:5.2.1") // Compile Minestom into project - compileOnly("com.github.Minestom:Minestom:4ee5cbe424") + compileOnly("com.github.Minestom", "Minestom", "7867313290") // Use kotlinx serialization compileOnly("org.jetbrains.kotlinx", "kotlinx-serialization-json", "1.3.1") // implement KStom - compileOnly("com.github.Project-Cepi:KStom:1229e45e12") + compileOnly("com.github.Project-Cepi:KStom:af120b5455") // Add MiniMessage compileOnly("net.kyori:adventure-text-minimessage:4.10.1") diff --git a/src/main/kotlin/world/cepi/kepi/Kepi.kt b/src/main/kotlin/world/cepi/kepi/Kepi.kt index 4d3919c..d963302 100644 --- a/src/main/kotlin/world/cepi/kepi/Kepi.kt +++ b/src/main/kotlin/world/cepi/kepi/Kepi.kt @@ -20,6 +20,7 @@ import world.cepi.kstom.command.arguments.generation.CallbackGenerator import world.cepi.kstom.command.register import world.cepi.kstom.command.unregister import world.cepi.kstom.event.listenOnly +import world.cepi.kstom.item.displayName import world.cepi.kstom.item.item import world.cepi.kstom.util.log import world.cepi.kstom.util.node diff --git a/src/main/kotlin/world/cepi/kepi/command/BlockHandlerCommand.kt b/src/main/kotlin/world/cepi/kepi/command/BlockHandlerCommand.kt index 217cb5f..314292c 100644 --- a/src/main/kotlin/world/cepi/kepi/command/BlockHandlerCommand.kt +++ b/src/main/kotlin/world/cepi/kepi/command/BlockHandlerCommand.kt @@ -35,7 +35,7 @@ object BlockHandlerCommand : Kommand({ """.trimIndent() } - syntax(get, relativeBlockPosition).onlyPlayers { + syntax(get, relativeBlockPosition) { val block = player.instance!! .getBlock((!relativeBlockPosition).from(player)) @@ -43,7 +43,7 @@ object BlockHandlerCommand : Kommand({ if (handler == null) { player.sendMessage("No block handler found!") - return@onlyPlayers + return@syntax } player.sendMessage( @@ -66,7 +66,7 @@ object BlockHandlerCommand : Kommand({ } ) - } + }.onlyPlayers() val remove by literalFuzz(fuzz) diff --git a/src/main/kotlin/world/cepi/kepi/command/KepiCommand.kt b/src/main/kotlin/world/cepi/kepi/command/KepiCommand.kt index d70f9e2..4e1c747 100644 --- a/src/main/kotlin/world/cepi/kepi/command/KepiCommand.kt +++ b/src/main/kotlin/world/cepi/kepi/command/KepiCommand.kt @@ -31,7 +31,7 @@ object KepiCommand : Kommand({ Component.text("Click to copy your player data", NamedTextColor.GRAY) .clickEvent( ClickEvent.copyToClipboard( - player.getTag(Tag.NBT)?.toSNBT() ?: "{}" + player.tagHandler().asCompound().toSNBT() ) ) ) diff --git a/src/main/kotlin/world/cepi/kepi/menu/KepiMenuUI.kt b/src/main/kotlin/world/cepi/kepi/menu/KepiMenuUI.kt index 24a76ca..c7dbd11 100644 --- a/src/main/kotlin/world/cepi/kepi/menu/KepiMenuUI.kt +++ b/src/main/kotlin/world/cepi/kepi/menu/KepiMenuUI.kt @@ -9,17 +9,14 @@ import net.minestom.server.entity.PlayerSkin import net.minestom.server.item.Material import net.minestom.server.item.metadata.PlayerHeadMeta import world.cepi.kstom.adventure.noItalic -import world.cepi.kstom.item.item fun menuUI(player: Player) = fragment(9, 6) { this.inventory.title = Component.text("Menu", NamedTextColor.BLUE) - item(4, item(Material.PLAYER_HEAD) { - val builder = this as PlayerHeadMeta.Builder - - builder.skullOwner(player.uuid) - builder.playerSkin(PlayerSkin.fromUuid(player.uuid.toString())) + item(4, world.cepi.kstom.item.item(Material.PLAYER_HEAD) { + skullOwner(player.uuid) + playerSkin(PlayerSkin.fromUuid(player.uuid.toString())) displayName(Component.text(player.username, NamedTextColor.BLUE).noItalic()) lore(