Update to Minecraft 1.20.6 (#66)

* bump dependencies + updated to minecraft version 1.20.6 & java 21

* moved to stable kotlinx dependencies

* Change versions for 1.20.6 update

* Make 1.20.6 update compile

---------

Co-authored-by: Jakob K <dev@jakobk.de>
This commit is contained in:
Marlon
2024-05-31 18:19:02 +02:00
committed by GitHub
parent 441b94ca7c
commit 77e2e72f06
7 changed files with 23 additions and 25 deletions

View File

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

View File

@@ -3,9 +3,10 @@
package net.axay.kspigot.data
import net.axay.kspigot.annotations.NMS_General
import net.minecraft.core.component.DataComponents
import net.minecraft.nbt.CompoundTag
import org.bukkit.craftbukkit.v1_20_R3.entity.CraftEntity
import org.bukkit.craftbukkit.v1_20_R3.inventory.CraftItemStack
import org.bukkit.craftbukkit.entity.CraftEntity
import org.bukkit.craftbukkit.inventory.CraftItemStack
import org.bukkit.entity.Entity
import org.bukkit.inventory.ItemStack
@@ -22,8 +23,4 @@ var Entity.nbtData: CompoundTag
@NMS_General
val ItemStack.nbtData: CompoundTag
get() {
CraftItemStack.asNMSCopy(this).let {
return if (it.hasTag()) (it.tag ?: CompoundTag()) else CompoundTag()
}
}
get() = (this as? CraftItemStack)?.handle?.get(DataComponents.CUSTOM_DATA)?.copyTag() ?: CompoundTag()

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_20_R3.CraftWorld ?: return null
val craftWorld = world as? org.bukkit.craftbukkit.CraftWorld ?: return null
return craftWorld.makeEntity(this, entityType.entityClass!!)?.let {
craftWorld.handle.addFreshEntity(it)
return@let it.bukkitEntity

View File

@@ -21,7 +21,7 @@ val PlayerInteractEntityEvent.interactItem: ItemStack?
return when (this.hand) {
EquipmentSlot.HAND -> p.inventory.itemInMainHand
EquipmentSlot.OFF_HAND -> p.inventory.itemInOffHand
EquipmentSlot.CHEST, EquipmentSlot.FEET, EquipmentSlot.HEAD, EquipmentSlot.LEGS -> null
EquipmentSlot.CHEST, EquipmentSlot.FEET, EquipmentSlot.HEAD, EquipmentSlot.LEGS, EquipmentSlot.BODY -> null
}
}

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_20_R3.entity.CraftEntity
import org.bukkit.craftbukkit.entity.CraftEntity
import org.bukkit.entity.Entity
import org.bukkit.entity.EntityType