mirror of
https://github.com/alexcrea/CustomAnvil.git
synced 2026-06-24 00:26:16 +02:00
Add some testing (#38)
This commit is contained in:
parent
c42140a45a
commit
ed58c9c107
34 changed files with 1911 additions and 150 deletions
|
|
@ -2,6 +2,7 @@ package xyz.alexcrea.cuanvil.dependency
|
|||
|
||||
import io.delilaheve.CustomAnvil
|
||||
import org.bukkit.Bukkit
|
||||
import org.bukkit.entity.HumanEntity
|
||||
import org.bukkit.event.inventory.InventoryClickEvent
|
||||
import org.bukkit.event.inventory.PrepareAnvilEvent
|
||||
import org.bukkit.inventory.AnvilInventory
|
||||
|
|
@ -91,11 +92,11 @@ object DependencyManager {
|
|||
|
||||
}
|
||||
|
||||
fun tryEventPreAnvilBypass(event: PrepareAnvilEvent): Boolean {
|
||||
fun tryEventPreAnvilBypass(event: PrepareAnvilEvent, player: HumanEntity): Boolean {
|
||||
var bypass = false
|
||||
|
||||
// Test if disenchantment used special prepare anvil
|
||||
if(disenchantmentCompatibility?.testPrepareAnvil(event) == true) bypass = true
|
||||
if(disenchantmentCompatibility?.testPrepareAnvil(event, player) == true) bypass = true
|
||||
|
||||
// Test excellent enchantments used special prepare anvil
|
||||
if(!bypass && (excellentEnchantsCompatibility?.testPrepareAnvil(event) == true)) bypass = true
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue