mirror of
https://github.com/alexcrea/CustomAnvil.git
synced 2026-06-23 16:16:17 +02:00
v1.8.1
fix weird bug where the viewer list is empty sometime apparently
This commit is contained in:
parent
c5c32ce386
commit
482d5eb66d
2 changed files with 4 additions and 3 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue