9
0
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:
Auxilor
2023-05-11 15:22:26 +01:00
parent 9d3bf472ac
commit 7c5e4e40db
5 changed files with 11 additions and 5 deletions

View File

@@ -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()
}
}
}

View File

@@ -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()
}
}
}

View File

@@ -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()
}
}
}

View File

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

View File

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