fix weird bug where the viewer list is empty sometime apparently
This commit is contained in:
alexcrea 2025-02-17 15:16:00 +01:00
parent c5c32ce386
commit 482d5eb66d
No known key found for this signature in database
GPG key ID: 43FD265DB0DBF91F
2 changed files with 4 additions and 3 deletions

View file

@ -16,7 +16,7 @@ plugins {
}
group = "xyz.alexcrea"
version = "1.8.0"
version = "1.8.1"
repositories {
// EcoEnchants
@ -29,7 +29,7 @@ dependencies {
compileOnly("org.spigotmc:spigot-api:1.18-R0.1-SNAPSHOT")
// Gui library
val inventoryFramework = "xyz.alexcrea.cuanvil.inventoryframework:IF-CustomAnvil:0.10.18"
val inventoryFramework = "xyz.alexcrea.cuanvil.inventoryframework:IF-CustomAnvil:0.10.18.2"
implementation(inventoryFramework)
testRuntimeOnly(inventoryFramework)

View file

@ -1,5 +1,6 @@
package xyz.alexcrea.cuanvil.listener
import com.github.stefvanschie.inventoryframework.util.InventoryViewUtil
import io.delilaheve.CustomAnvil
import io.delilaheve.util.ConfigOptions
import io.delilaheve.util.EnchantmentUtil.combineWith
@ -42,7 +43,7 @@ class PrepareAnvilListener : Listener {
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
fun anvilCombineCheck(event: PrepareAnvilEvent) {
// Should find player
val player: HumanEntity = event.viewers.first()
val player: HumanEntity = InventoryViewUtil.getInstance().getPlayer(event.view)
// Test if the event should bypass custom anvil.
if (DependencyManager.tryEventPreAnvilBypass(event, player)) return