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

@@ -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