From 4a391ce6aff2541ebb50de48743e4370e1ac0ad2 Mon Sep 17 00:00:00 2001 From: Nick Oates Date: Thu, 27 Jun 2024 20:41:39 -0700 Subject: [PATCH 01/15] Update farming.yml --- eco-core/core-plugin/src/main/resources/skills/farming.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eco-core/core-plugin/src/main/resources/skills/farming.yml b/eco-core/core-plugin/src/main/resources/skills/farming.yml index 6a94376..6947db4 100644 --- a/eco-core/core-plugin/src/main/resources/skills/farming.yml +++ b/eco-core/core-plugin/src/main/resources/skills/farming.yml @@ -147,15 +147,15 @@ xp-gain-methods: blocks: - wheat - carrots - - melon - nether_wart - trigger: mine_block multiplier: 4.5 filters: - fully_grown: true + player_placed: false blocks: - pumpkin + - melon - trigger: mine_block multiplier: 5 From 00ca55a629c12b219c02a9c3648a686d4f0ab1a8 Mon Sep 17 00:00:00 2001 From: Kapitowa Date: Sat, 6 Jul 2024 03:24:40 +0300 Subject: [PATCH 02/15] - fix print top command - gainCache should be per player --- .../kotlin/com/willfp/ecoskills/commands/CommandTop.kt | 6 +++--- .../willfp/ecoskills/skills/display/GainXPDisplay.kt | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/commands/CommandTop.kt b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/commands/CommandTop.kt index 84f801d..13cd128 100644 --- a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/commands/CommandTop.kt +++ b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/commands/CommandTop.kt @@ -35,9 +35,9 @@ class CommandTop(plugin: EcoPlugin) : return@runAsync } - val offset = (page - 1) * 10 - - val positions = ((offset + page)..(offset + page + 9)).toList() + val start = (page - 1) * 10 + 1 + val end = start + 9 + (page - 1) + val positions = (start..end).toList() val top = if (skill == null) { positions.mapNotNull { Skills.getTop(it) } diff --git a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/skills/display/GainXPDisplay.kt b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/skills/display/GainXPDisplay.kt index dc9621a..5a2f1fc 100644 --- a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/skills/display/GainXPDisplay.kt +++ b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/skills/display/GainXPDisplay.kt @@ -18,13 +18,13 @@ import com.willfp.ecoskills.api.getFormattedRequiredXP import com.willfp.ecoskills.api.getSkillLevel import com.willfp.ecoskills.api.getSkillProgress import com.willfp.ecoskills.api.getSkillXP -import com.willfp.ecoskills.skills.Skill import org.bukkit.boss.BarColor import org.bukkit.boss.BarStyle import org.bukkit.entity.Player import org.bukkit.event.EventHandler import org.bukkit.event.Listener import java.time.Duration +import java.util.UUID private val xpGainSoundEnabledKey = PersistentDataKey( namespacedKeyOf("ecoskills", "gain_sound_enabled"), @@ -42,7 +42,7 @@ val Player.isXPGainSoundEnabled: Boolean class GainXPDisplay( private val plugin: EcoPlugin ) : Listener { - private val gainCache: Cache = Caffeine.newBuilder().expireAfterWrite(Duration.ofSeconds(3)) + private val gainCache: Cache> = Caffeine.newBuilder().expireAfterWrite(Duration.ofSeconds(3)) .build() private val sound = if (plugin.configYml.getBool("skills.gain-xp.sound.enabled")) { @@ -54,8 +54,8 @@ class GainXPDisplay( @EventHandler fun handle(event: PlayerSkillXPGainEvent) { val player = event.player - val current = gainCache.get(event.skill) { 0.0 } - gainCache.put(event.skill, current + event.gainedXP) + val current = gainCache.get(player.uniqueId) { event.skill.id to 0.0 } + gainCache.put(player.uniqueId, event.skill.id to (current.second + event.gainedXP)) // Run next tick because level up calls before xp is added plugin.scheduler.run { @@ -111,7 +111,7 @@ class GainXPDisplay( ) .replace("%current_xp%", event.player.getSkillXP(event.skill).toNiceString()) .replace("%required_xp%", event.player.getFormattedRequiredXP(event.skill)) - .replace("%gained_xp%", gainCache.get(event.skill) { 0.0 }.toNiceString()) + .replace("%gained_xp%", gainCache.get(event.player.uniqueId) { event.skill.id to 0.0 }.toNiceString()) .formatEco( placeholderContext( event.player, From 94bfa39b65fa81cf95b80c3adb047d792024de40 Mon Sep 17 00:00:00 2001 From: Kapitowa Date: Sat, 6 Jul 2024 13:50:19 +0300 Subject: [PATCH 03/15] - fix mistakes --- .../src/main/kotlin/com/willfp/ecoskills/commands/CommandTop.kt | 2 +- .../kotlin/com/willfp/ecoskills/skills/display/GainXPDisplay.kt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/commands/CommandTop.kt b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/commands/CommandTop.kt index 13cd128..2cfd647 100644 --- a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/commands/CommandTop.kt +++ b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/commands/CommandTop.kt @@ -36,7 +36,7 @@ class CommandTop(plugin: EcoPlugin) : } val start = (page - 1) * 10 + 1 - val end = start + 9 + (page - 1) + val end = start + 9 val positions = (start..end).toList() val top = if (skill == null) { diff --git a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/skills/display/GainXPDisplay.kt b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/skills/display/GainXPDisplay.kt index 5a2f1fc..6cbd7f6 100644 --- a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/skills/display/GainXPDisplay.kt +++ b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/skills/display/GainXPDisplay.kt @@ -111,7 +111,7 @@ class GainXPDisplay( ) .replace("%current_xp%", event.player.getSkillXP(event.skill).toNiceString()) .replace("%required_xp%", event.player.getFormattedRequiredXP(event.skill)) - .replace("%gained_xp%", gainCache.get(event.player.uniqueId) { event.skill.id to 0.0 }.toNiceString()) + .replace("%gained_xp%", gainCache.get(event.player.uniqueId) { event.skill.id to 0.0 }.second.toNiceString()) .formatEco( placeholderContext( event.player, From 792965fc18383a9b5806f4d41fd76dceb62c8abc Mon Sep 17 00:00:00 2001 From: Kapitowa Date: Sat, 13 Jul 2024 16:11:47 +0300 Subject: [PATCH 04/15] - fix display for each skill and do priority monitor to accept multipliers --- .../willfp/ecoskills/skills/display/GainXPDisplay.kt | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/skills/display/GainXPDisplay.kt b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/skills/display/GainXPDisplay.kt index 6cbd7f6..19b8c60 100644 --- a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/skills/display/GainXPDisplay.kt +++ b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/skills/display/GainXPDisplay.kt @@ -22,6 +22,7 @@ import org.bukkit.boss.BarColor import org.bukkit.boss.BarStyle import org.bukkit.entity.Player import org.bukkit.event.EventHandler +import org.bukkit.event.EventPriority import org.bukkit.event.Listener import java.time.Duration import java.util.UUID @@ -42,7 +43,7 @@ val Player.isXPGainSoundEnabled: Boolean class GainXPDisplay( private val plugin: EcoPlugin ) : Listener { - private val gainCache: Cache> = Caffeine.newBuilder().expireAfterWrite(Duration.ofSeconds(3)) + private val gainCache: Cache, Double> = Caffeine.newBuilder().expireAfterWrite(Duration.ofSeconds(3)) .build() private val sound = if (plugin.configYml.getBool("skills.gain-xp.sound.enabled")) { @@ -51,11 +52,11 @@ class GainXPDisplay( ) } else null - @EventHandler + @EventHandler(priority = EventPriority.MONITOR) fun handle(event: PlayerSkillXPGainEvent) { val player = event.player - val current = gainCache.get(player.uniqueId) { event.skill.id to 0.0 } - gainCache.put(player.uniqueId, event.skill.id to (current.second + event.gainedXP)) + val current = gainCache.get(player.uniqueId to event.skill.id) { 0.0 } + gainCache.put(player.uniqueId to event.skill.id, current + event.gainedXP) // Run next tick because level up calls before xp is added plugin.scheduler.run { @@ -111,7 +112,7 @@ class GainXPDisplay( ) .replace("%current_xp%", event.player.getSkillXP(event.skill).toNiceString()) .replace("%required_xp%", event.player.getFormattedRequiredXP(event.skill)) - .replace("%gained_xp%", gainCache.get(event.player.uniqueId) { event.skill.id to 0.0 }.second.toNiceString()) + .replace("%gained_xp%", gainCache.get(event.player.uniqueId to event.skill.id) { 0.0 }.toNiceString()) .formatEco( placeholderContext( event.player, From abbda402721ee278e7a8cd78fcbe18825cb631af Mon Sep 17 00:00:00 2001 From: Nick Oates Date: Sun, 11 Aug 2024 20:10:23 -0700 Subject: [PATCH 05/15] Add magrove & cherry trees to woodcutting --- .../core-plugin/src/main/resources/skills/woodcutting.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/eco-core/core-plugin/src/main/resources/skills/woodcutting.yml b/eco-core/core-plugin/src/main/resources/skills/woodcutting.yml index cf15fc9..d719129 100644 --- a/eco-core/core-plugin/src/main/resources/skills/woodcutting.yml +++ b/eco-core/core-plugin/src/main/resources/skills/woodcutting.yml @@ -112,12 +112,16 @@ xp-gain-methods: - jungle_log - acacia_log - dark_oak_log + - mangrove_log + - cherry_log - oak_wood - birch_wood - spruce_wood - jungle_wood - acacia_wood - dark_oak_wood + - mangrove_wood + - cherry_wood - trigger: mine_block multiplier: 14 From 55a37dd4d9bf407b76db2228b1d2e4857f10397b Mon Sep 17 00:00:00 2001 From: often Date: Sun, 1 Sep 2024 14:25:21 +0300 Subject: [PATCH 06/15] Fixed %gained_xp% placeholder returning per-skill, not per-player values --- .../ecoskills/skills/display/GainXPDisplay.kt | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/skills/display/GainXPDisplay.kt b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/skills/display/GainXPDisplay.kt index dc9621a..d1af40a 100644 --- a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/skills/display/GainXPDisplay.kt +++ b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/skills/display/GainXPDisplay.kt @@ -25,6 +25,7 @@ import org.bukkit.entity.Player import org.bukkit.event.EventHandler import org.bukkit.event.Listener import java.time.Duration +import java.util.* private val xpGainSoundEnabledKey = PersistentDataKey( namespacedKeyOf("ecoskills", "gain_sound_enabled"), @@ -36,13 +37,22 @@ fun Player.toggleXPGainSound() { this.profile.write(xpGainSoundEnabledKey, !this.profile.read(xpGainSoundEnabledKey)) } +data class PlayerSkill( + val player: UUID, + val skill: String +) + +private fun playerSkill(player: Player, skill: Skill): PlayerSkill { + return PlayerSkill(player.uniqueId, skill.id) +} + val Player.isXPGainSoundEnabled: Boolean get() = this.profile.read(xpGainSoundEnabledKey) class GainXPDisplay( private val plugin: EcoPlugin ) : Listener { - private val gainCache: Cache = Caffeine.newBuilder().expireAfterWrite(Duration.ofSeconds(3)) + private val gainCache: Cache = Caffeine.newBuilder().expireAfterWrite(Duration.ofSeconds(3)) .build() private val sound = if (plugin.configYml.getBool("skills.gain-xp.sound.enabled")) { @@ -54,8 +64,8 @@ class GainXPDisplay( @EventHandler fun handle(event: PlayerSkillXPGainEvent) { val player = event.player - val current = gainCache.get(event.skill) { 0.0 } - gainCache.put(event.skill, current + event.gainedXP) + val current = gainCache.get(playerSkill(player, event.skill)) { 0.0 } + gainCache.put(playerSkill(player, event.skill), current + event.gainedXP) // Run next tick because level up calls before xp is added plugin.scheduler.run { @@ -111,7 +121,7 @@ class GainXPDisplay( ) .replace("%current_xp%", event.player.getSkillXP(event.skill).toNiceString()) .replace("%required_xp%", event.player.getFormattedRequiredXP(event.skill)) - .replace("%gained_xp%", gainCache.get(event.skill) { 0.0 }.toNiceString()) + .replace("%gained_xp%", gainCache.get(playerSkill(event.player, event.skill)) { 0.0 }.toNiceString()) .formatEco( placeholderContext( event.player, From bea861676274ea8dc405f884f59cacfbfa359206 Mon Sep 17 00:00:00 2001 From: Penumbrae <114706163+Penumbrae@users.noreply.github.com> Date: Wed, 2 Oct 2024 20:56:04 +0100 Subject: [PATCH 07/15] Added "CONTACT" as a filtered option Certain blocks give constant XP when the player gets in contact with them. Eg: Cactus. --- eco-core/core-plugin/src/main/resources/skills/armory.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/eco-core/core-plugin/src/main/resources/skills/armory.yml b/eco-core/core-plugin/src/main/resources/skills/armory.yml index 384e9b0..c27052d 100644 --- a/eco-core/core-plugin/src/main/resources/skills/armory.yml +++ b/eco-core/core-plugin/src/main/resources/skills/armory.yml @@ -122,6 +122,7 @@ xp-gain-methods: not_damage_cause: - KILL - SUICIDE + - CONTACT # Conditions that must be met to gain XP. While you can add conditions to xp # gain methods, if you have many this can be annoying, so this is global. From 521b5ad600ecddf6a610dd7a2459f7ba3657ea07 Mon Sep 17 00:00:00 2001 From: Exanthiax <107284021+Exanthiax@users.noreply.github.com> Date: Sun, 1 Dec 2024 15:46:51 +0000 Subject: [PATCH 08/15] fixed repdigit leaderboard positions Fixed issue where repeated-digit numbers were not displayed in leaderboards. --- .../main/kotlin/com/willfp/ecoskills/commands/CommandTop.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/commands/CommandTop.kt b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/commands/CommandTop.kt index 84f801d..c3257b0 100644 --- a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/commands/CommandTop.kt +++ b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/commands/CommandTop.kt @@ -37,7 +37,7 @@ class CommandTop(plugin: EcoPlugin) : val offset = (page - 1) * 10 - val positions = ((offset + page)..(offset + page + 9)).toList() + val positions = ((offset + 1)..(offset + 10)).toList() val top = if (skill == null) { positions.mapNotNull { Skills.getTop(it) } @@ -52,7 +52,7 @@ class CommandTop(plugin: EcoPlugin) : val (player, level) = entry val line = plugin.langYml.getString("top-line-format") - .replace("%rank%", positions[index].toString()) + .replace("%rank%", (offset + index + 1).toString()) .replace("%level%", level.toString()) .replace("%player%", player.savedDisplayName) From cbb4fd012ed07039c4e04304c28d029ad9e638cd Mon Sep 17 00:00:00 2001 From: Exanthiax <107284021+Exanthiax@users.noreply.github.com> Date: Sun, 1 Dec 2024 15:53:31 +0000 Subject: [PATCH 09/15] Made player-info toggleable This allows users to turn off the stats page icon in /skills. --- .../gui/components/PlayerInfoIcon.kt | 67 ++++++++++--------- .../core-plugin/src/main/resources/config.yml | 1 + 2 files changed, 35 insertions(+), 33 deletions(-) diff --git a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/gui/components/PlayerInfoIcon.kt b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/gui/components/PlayerInfoIcon.kt index 49b49cf..f93fad5 100644 --- a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/gui/components/PlayerInfoIcon.kt +++ b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/gui/components/PlayerInfoIcon.kt @@ -23,47 +23,48 @@ class PlayerInfoIcon( config: Config, opensStatMenu: Boolean ) : PositionedComponent { - private val slot = slot({ player, _ -> - skullCache.get(player.uniqueId) { - val skullBuilder = SkullBuilder() - .setDisplayName( - config.getString("name") - .replace("%player%", player.savedDisplayName) - .formatEco(player, true) - ) - .addLoreLines( - config.getFormattedStrings( - "lore", - placeholderContext( - player = player + override val isEnabled = config.getBoolOrNull("enabled") ?: true + private val slot = if (isEnabled) { + slot({ player, _ -> + skullCache.get(player.uniqueId) { + val skullBuilder = SkullBuilder() + .setDisplayName( + config.getString("name") + .replace("%player%", player.savedDisplayName) + .formatEco(player, true) + ) + .addLoreLines( + config.getFormattedStrings( + "lore", // Ensure correct path for lore + placeholderContext(player = player) ) ) - ) - .apply { - if (opensStatMenu) { - addLoreLines( - config.getFormattedStrings( - "view-more", - placeholderContext( - player = player + .apply { + if (opensStatMenu) { + addLoreLines( + config.getFormattedStrings( + "view-more", + placeholderContext(player = player) ) ) - ) + } } - } - skullBuilder.build().apply { - val meta = itemMeta as SkullMeta - meta.owningPlayer = player - itemMeta = meta - } - } - }) { - if (opensStatMenu) { - onLeftClick { player, _, _, _ -> - StatsGUI.open(player) + skullBuilder.build().apply { + val meta = itemMeta as SkullMeta + meta.owningPlayer = player + itemMeta = meta + } + } + }) { + if (opensStatMenu) { + onLeftClick { player, _, _, _ -> + StatsGUI.open(player) + } } } + } else { + null } override val row: Int = config.getInt("row") diff --git a/eco-core/core-plugin/src/main/resources/config.yml b/eco-core/core-plugin/src/main/resources/config.yml index 909e110..7c255a4 100644 --- a/eco-core/core-plugin/src/main/resources/config.yml +++ b/eco-core/core-plugin/src/main/resources/config.yml @@ -123,6 +123,7 @@ stats-gui: - "211101112" player-info: + enabled: true row: 1 column: 5 From 4360c212c8b85078fc6714201d11f43225d21b0d Mon Sep 17 00:00:00 2001 From: Will FP Date: Sun, 8 Dec 2024 16:13:51 +0000 Subject: [PATCH 10/15] Added 1.21.4 support --- build.gradle.kts | 4 +-- eco-core/core-nms/v1_21_3/build.gradle.kts | 6 ++-- eco-core/core-nms/v1_21_4/build.gradle.kts | 28 +++++++++++++++++++ .../proxy/v1_21_4/ActionBarCompatibility.kt | 22 +++++++++++++++ gradle.properties | 4 ++- settings.gradle.kts | 1 + 6 files changed, 60 insertions(+), 5 deletions(-) create mode 100644 eco-core/core-nms/v1_21_4/build.gradle.kts create mode 100644 eco-core/core-nms/v1_21_4/src/main/kotlin/com/willfp/ecoskills/proxy/v1_21_4/ActionBarCompatibility.kt diff --git a/build.gradle.kts b/build.gradle.kts index 9a6e260..bd2b681 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -2,7 +2,7 @@ plugins { java `java-library` `maven-publish` - kotlin("jvm") version "1.9.20" + kotlin("jvm") version "2.1.0" id("io.github.goooler.shadow") version "8.1.7" id("com.willfp.libreforge-gradle-plugin") version "1.0.0" } @@ -40,7 +40,7 @@ allprojects { dependencies { compileOnly("com.willfp:eco:6.58.0") compileOnly("org.jetbrains:annotations:23.0.0") - compileOnly("org.jetbrains.kotlin:kotlin-stdlib:1.9.20") + compileOnly("org.jetbrains.kotlin:kotlin-stdlib:2.1.0") } java { diff --git a/eco-core/core-nms/v1_21_3/build.gradle.kts b/eco-core/core-nms/v1_21_3/build.gradle.kts index c2cd9d0..b94628a 100644 --- a/eco-core/core-nms/v1_21_3/build.gradle.kts +++ b/eco-core/core-nms/v1_21_3/build.gradle.kts @@ -1,3 +1,5 @@ +import org.jetbrains.kotlin.gradle.dsl.JvmTarget + group = "com.willfp" version = rootProject.version @@ -19,8 +21,8 @@ tasks { } compileKotlin { - kotlinOptions { - jvmTarget = "21" + compilerOptions { + jvmTarget.set(JvmTarget.JVM_21) } } } diff --git a/eco-core/core-nms/v1_21_4/build.gradle.kts b/eco-core/core-nms/v1_21_4/build.gradle.kts new file mode 100644 index 0000000..88a41cf --- /dev/null +++ b/eco-core/core-nms/v1_21_4/build.gradle.kts @@ -0,0 +1,28 @@ +import org.jetbrains.kotlin.gradle.dsl.JvmTarget + +group = "com.willfp" +version = rootProject.version + +val spigotVersion = "1.21.4-R0.1-SNAPSHOT" + +dependencies { + compileOnly("org.spigotmc:spigot:$spigotVersion") +} + +configurations.compileOnly { + resolutionStrategy { + force("org.spigotmc:spigot:$spigotVersion") + } +} + +tasks { + compileJava { + options.release = 21 + } + + compileKotlin { + compilerOptions { + jvmTarget.set(JvmTarget.JVM_21) + } + } +} diff --git a/eco-core/core-nms/v1_21_4/src/main/kotlin/com/willfp/ecoskills/proxy/v1_21_4/ActionBarCompatibility.kt b/eco-core/core-nms/v1_21_4/src/main/kotlin/com/willfp/ecoskills/proxy/v1_21_4/ActionBarCompatibility.kt new file mode 100644 index 0000000..349e144 --- /dev/null +++ b/eco-core/core-nms/v1_21_4/src/main/kotlin/com/willfp/ecoskills/proxy/v1_21_4/ActionBarCompatibility.kt @@ -0,0 +1,22 @@ +package com.willfp.ecoskills.proxy.v1_21_4 + +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.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 ClientboundSystemChatPacket -> if (packet.isActionBar) player.pausePersistentActionBar() + } + } +} diff --git a/gradle.properties b/gradle.properties index 00f8ca7..2cbf40d 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,5 +1,7 @@ #libreforge-updater #Wed Nov 06 18:32:41 GMT 2024 -kotlin.code.style=official libreforge-version=4.72.2 version=3.60.4 +org.gradle.parallel=true +kotlin.daemon.jvmargs=-Xmx2g -XX:+UseG1GC -XX:MaxMetaspaceSize=512m +kotlin.code.style=official diff --git a/settings.gradle.kts b/settings.gradle.kts index ad5ee23..461999e 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -28,3 +28,4 @@ include(":eco-core:core-nms:v1_20_R2") include(":eco-core:core-nms:v1_20_R3") include(":eco-core:core-nms:v1_21") include(":eco-core:core-nms:v1_21_3") +include(":eco-core:core-nms:v1_21_4") From dbabbeed00e73ff604fc87004200082bbfe231ce Mon Sep 17 00:00:00 2001 From: Will FP Date: Sun, 8 Dec 2024 16:13:58 +0000 Subject: [PATCH 11/15] Updated to 4.72.3 --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index 2cbf40d..a315544 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,6 +1,6 @@ #libreforge-updater #Wed Nov 06 18:32:41 GMT 2024 -libreforge-version=4.72.2 +libreforge-version=4.72.3 version=3.60.4 org.gradle.parallel=true kotlin.daemon.jvmargs=-Xmx2g -XX:+UseG1GC -XX:MaxMetaspaceSize=512m From ab7de08048838d1a5b03a33cf4a82b848e385367 Mon Sep 17 00:00:00 2001 From: Will FP Date: Sun, 8 Dec 2024 16:14:32 +0000 Subject: [PATCH 12/15] Oops! Updated to 3.60.5 --- gradle.properties | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gradle.properties b/gradle.properties index a315544..df80128 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,7 +1,7 @@ #libreforge-updater #Wed Nov 06 18:32:41 GMT 2024 -libreforge-version=4.72.3 -version=3.60.4 +libreforge-version=4.72.2 +version=3.60.5 org.gradle.parallel=true kotlin.daemon.jvmargs=-Xmx2g -XX:+UseG1GC -XX:MaxMetaspaceSize=512m kotlin.code.style=official From b069bec52fe0a9566e6cdaf0d4883e2dbfa6f7cb Mon Sep 17 00:00:00 2001 From: Will FP Date: Sat, 25 Jan 2025 13:45:45 +0000 Subject: [PATCH 13/15] libreforge-updater --- gradle.properties | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/gradle.properties b/gradle.properties index df80128..e53538e 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,7 +1,7 @@ #libreforge-updater -#Wed Nov 06 18:32:41 GMT 2024 -libreforge-version=4.72.2 -version=3.60.5 -org.gradle.parallel=true -kotlin.daemon.jvmargs=-Xmx2g -XX:+UseG1GC -XX:MaxMetaspaceSize=512m +#Sat Jan 25 13:45:45 GMT 2025 kotlin.code.style=official +kotlin.daemon.jvmargs=-Xmx2g -XX\:+UseG1GC -XX\:MaxMetaspaceSize\=512m +libreforge-version=4.73.0 +org.gradle.parallel=true +version=3.62.0 From 6e5dba087e8c433704129ede0ea2cdd602f993ba Mon Sep 17 00:00:00 2001 From: Will FP Date: Sat, 25 Jan 2025 13:47:40 +0000 Subject: [PATCH 14/15] Fix --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index e53538e..a204e93 100644 --- a/gradle.properties +++ b/gradle.properties @@ -2,6 +2,6 @@ #Sat Jan 25 13:45:45 GMT 2025 kotlin.code.style=official kotlin.daemon.jvmargs=-Xmx2g -XX\:+UseG1GC -XX\:MaxMetaspaceSize\=512m -libreforge-version=4.73.0 +libreforge-version=4.72.0 org.gradle.parallel=true version=3.62.0 From 7cb57c996e3446c4214c693299116c0586e53651 Mon Sep 17 00:00:00 2001 From: Will FP Date: Sat, 25 Jan 2025 13:49:47 +0000 Subject: [PATCH 15/15] libreforge-updater --- gradle.properties | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gradle.properties b/gradle.properties index a204e93..95a5a1c 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,7 +1,7 @@ #libreforge-updater -#Sat Jan 25 13:45:45 GMT 2025 +#Sat Jan 25 13:49:47 GMT 2025 kotlin.code.style=official kotlin.daemon.jvmargs=-Xmx2g -XX\:+UseG1GC -XX\:MaxMetaspaceSize\=512m -libreforge-version=4.72.0 +libreforge-version=4.73.0 org.gradle.parallel=true version=3.62.0