Update to 1.20.1 (#58)

* Port to 1.20.1

---------

Co-authored-by: notstevy <notstevy@ultrabuildmc.de>
This commit is contained in:
NotStevy
2023-06-14 12:40:05 +02:00
committed by GitHub
parent 3e58d52a91
commit 965808f8fe
5 changed files with 11 additions and 11 deletions

View File

@@ -3,19 +3,19 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
val githubRepo = "jakobkmar/KSpigot"
group = "net.axay"
version = "1.19.2"
version = "1.20.1"
description = "A Kotlin API for Minecraft plugins using the Spigot or Paper toolchain"
plugins {
kotlin("jvm") version "1.8.10"
kotlin("plugin.serialization") version "1.8.10"
kotlin("jvm") version "1.8.20"
kotlin("plugin.serialization") version "1.8.20"
`java-library`
`maven-publish`
signing
id("org.jetbrains.dokka") version "1.8.10"
id("org.jetbrains.dokka") version "1.8.20"
id("io.papermc.paperweight.userdev") version "1.5.3"
}
@@ -25,7 +25,7 @@ repositories {
}
dependencies {
paperweight.paperDevBundle("1.19.4-R0.1-SNAPSHOT")
paperweight.paperDevBundle("1.20.1-R0.1-SNAPSHOT")
api("org.jetbrains.kotlinx:kotlinx-serialization-json:1.5.0")
api("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4")

View File

@@ -33,7 +33,7 @@ object BrigardierSupport {
}
@Suppress("HasPlatformType")
fun resolveCommandManager() = (server as org.bukkit.craftbukkit.v1_19_R3.CraftServer)
fun resolveCommandManager() = (server as org.bukkit.craftbukkit.v1_20_R1.CraftServer)
.server.vanillaCommandDispatcher
internal fun registerAll() {
@@ -52,7 +52,7 @@ object BrigardierSupport {
fun updateCommandTree() {
onlinePlayers.forEach {
// send the command tree
resolveCommandManager().sendCommands((it as org.bukkit.craftbukkit.v1_19_R3.entity.CraftPlayer).handle)
resolveCommandManager().sendCommands((it as org.bukkit.craftbukkit.v1_20_R1.entity.CraftPlayer).handle)
}
}
}

View File

@@ -4,8 +4,8 @@ package net.axay.kspigot.data
import net.axay.kspigot.annotations.NMS_General
import net.minecraft.nbt.CompoundTag
import org.bukkit.craftbukkit.v1_19_R3.entity.CraftEntity
import org.bukkit.craftbukkit.v1_19_R3.inventory.CraftItemStack
import org.bukkit.craftbukkit.v1_20_R1.entity.CraftEntity
import org.bukkit.craftbukkit.v1_20_R1.inventory.CraftItemStack
import org.bukkit.entity.Entity
import org.bukkit.inventory.ItemStack

View File

@@ -138,7 +138,7 @@ fun Player.showOnlinePlayers() {
@Deprecated("This function is unstable and it cannot be guaranteed that it will work at any time in the future.")
@NMS_General
fun Location.spawnCleanEntity(entityType: EntityType): Entity? {
val craftWorld = world as? org.bukkit.craftbukkit.v1_19_R3.CraftWorld ?: return null
val craftWorld = world as? org.bukkit.craftbukkit.v1_20_R1.CraftWorld ?: return null
return craftWorld.createEntity(this, entityType.entityClass)?.let {
craftWorld.handle.addFreshEntity(it)
return@let it.bukkitEntity

View File

@@ -10,7 +10,7 @@ import org.bukkit.Location
import org.bukkit.Material
import org.bukkit.block.Block
import org.bukkit.block.data.BlockData
import org.bukkit.craftbukkit.v1_19_R3.entity.CraftEntity
import org.bukkit.craftbukkit.v1_20_R1.entity.CraftEntity
import org.bukkit.entity.Entity
import org.bukkit.entity.EntityType