mirror of
https://github.com/Auxilor/EcoSkills.git
synced 2026-01-02 13:56:38 +00:00
Fixed action bar on 1.19+
This commit is contained in:
@@ -4,13 +4,15 @@ 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 {
|
||||
override fun onSend(event: PacketEvent) {
|
||||
val player = event.player
|
||||
|
||||
when (event.packet.handle) {
|
||||
when (val packet = event.packet.handle) {
|
||||
is ClientboundSetActionBarTextPacket -> player.pausePersistentActionBar()
|
||||
is ClientboundSystemChatPacket -> if (packet.c()) player.pausePersistentActionBar()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,13 +4,15 @@ import com.willfp.eco.core.packet.PacketEvent
|
||||
import com.willfp.ecoskills.actionbar.ActionBarCompatibilityProxy
|
||||
import net.minecraft.network.protocol.game.ClientboundSetActionBarTextPacket
|
||||
import com.willfp.ecoskills.actionbar.pausePersistentActionBar
|
||||
import net.minecraft.network.protocol.game.ClientboundSystemChatPacket
|
||||
|
||||
class ActionBarCompatibility : ActionBarCompatibilityProxy {
|
||||
override fun onSend(event: PacketEvent) {
|
||||
val player = event.player
|
||||
|
||||
when (event.packet.handle) {
|
||||
when (val packet = event.packet.handle) {
|
||||
is ClientboundSetActionBarTextPacket -> player.pausePersistentActionBar()
|
||||
is ClientboundSystemChatPacket -> if (packet.c()) player.pausePersistentActionBar()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,13 +4,15 @@ import com.willfp.eco.core.packet.PacketEvent
|
||||
import com.willfp.ecoskills.actionbar.ActionBarCompatibilityProxy
|
||||
import net.minecraft.network.protocol.game.ClientboundSetActionBarTextPacket
|
||||
import com.willfp.ecoskills.actionbar.pausePersistentActionBar
|
||||
import net.minecraft.network.protocol.game.ClientboundSystemChatPacket
|
||||
|
||||
class ActionBarCompatibility : ActionBarCompatibilityProxy {
|
||||
override fun onSend(event: PacketEvent) {
|
||||
val player = event.player
|
||||
|
||||
when (event.packet.handle) {
|
||||
when (val packet = event.packet.handle) {
|
||||
is ClientboundSetActionBarTextPacket -> player.pausePersistentActionBar()
|
||||
is ClientboundSystemChatPacket -> if (packet.c()) player.pausePersistentActionBar()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ import org.bukkit.event.Listener
|
||||
import org.bukkit.event.player.PlayerGameModeChangeEvent
|
||||
import java.util.UUID
|
||||
|
||||
private const val ACTION_BAR_DURATION = 3000L
|
||||
private const val ACTION_BAR_DURATION = 2700L
|
||||
private const val TICK_DURATION = 50L
|
||||
|
||||
private val blacklist = mutableMapOf<UUID, Long>()
|
||||
|
||||
@@ -49,7 +49,7 @@ class Skill(
|
||||
)
|
||||
|
||||
private val xpGainMethods = config.getSubsections("xp-gain-methods").mapNotNull {
|
||||
Counters.compile(it, ViolationContext(plugin, "Skill $id"))
|
||||
Counters.compile(it, ViolationContext(plugin, "Skill $id xp-gain-methods"))
|
||||
}
|
||||
|
||||
private val xpFormula = config.getStringOrNull("xp-formula")
|
||||
|
||||
Reference in New Issue
Block a user