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:
@@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -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()
|
||||
|
@@ -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
|
||||
|
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -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
|
||||
|
||||
|
Reference in New Issue
Block a user