mirror of
https://github.com/Auxilor/EcoSkills.git
synced 2025-12-30 12:29:18 +00:00
Added 1.20.6 support
This commit is contained in:
14
eco-core/core-nms/v1_20_6/build.gradle.kts
Normal file
14
eco-core/core-nms/v1_20_6/build.gradle.kts
Normal file
@@ -0,0 +1,14 @@
|
||||
group = "com.willfp"
|
||||
version = rootProject.version
|
||||
|
||||
val spigotVersion = "1.20.6-R0.1-SNAPSHOT"
|
||||
|
||||
dependencies {
|
||||
compileOnly("org.spigotmc:spigot:$spigotVersion")
|
||||
}
|
||||
|
||||
configurations.compileOnly {
|
||||
resolutionStrategy {
|
||||
force("org.spigotmc:spigot:$spigotVersion")
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.willfp.ecoskills.proxy.v1_20_6
|
||||
|
||||
import com.willfp.eco.core.packet.PacketEvent
|
||||
import com.willfp.ecoskills.actionbar.ActionBarCompatibilityProxy
|
||||
import com.willfp.ecoskills.actionbar.pausePersistentActionBar
|
||||
import net.minecraft.network.protocol.game.ClientboundSetActionBarTextPacket
|
||||
import net.minecraft.network.protocol.game.ClientboundSystemChatPacket
|
||||
|
||||
class ActionBarCompatibility : ActionBarCompatibilityProxy {
|
||||
private val ClientboundSystemChatPacket.isActionBar: Boolean
|
||||
get() = this::class.java.declaredFields
|
||||
.first { it.type == Boolean::class.java }
|
||||
.apply { isAccessible = true }
|
||||
.get(this) as Boolean
|
||||
|
||||
override fun onSend(event: PacketEvent) {
|
||||
val player = event.player
|
||||
|
||||
when (val packet = event.packet.handle) {
|
||||
is ClientboundSetActionBarTextPacket -> player.pausePersistentActionBar()
|
||||
is ClientboundSystemChatPacket -> if (packet.isActionBar) player.pausePersistentActionBar()
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -22,3 +22,4 @@ include(":eco-core:core-nms:v1_19_R3")
|
||||
include(":eco-core:core-nms:v1_20_R1")
|
||||
include(":eco-core:core-nms:v1_20_R2")
|
||||
include(":eco-core:core-nms:v1_20_R3")
|
||||
include(":eco-core:core-nms:v1_20_6")
|
||||
|
||||
Reference in New Issue
Block a user