mirror of
https://github.com/alexcrea/CustomAnvil.git
synced 2026-06-23 08:14:00 +02:00
Compatibility with most plugin using wesjd anvil gui
This commit is contained in:
parent
74a211bc88
commit
a915d5ad80
15 changed files with 267 additions and 1 deletions
|
|
@ -0,0 +1,24 @@
|
|||
package xyz.alexcrea.cuanvil.dependency.gui
|
||||
|
||||
import org.bukkit.inventory.InventoryView
|
||||
|
||||
interface ExternGuiTester {
|
||||
|
||||
val wesjdAnvilGuiName: String?
|
||||
|
||||
fun getContainerClass(inventory: InventoryView): Class<Any>?
|
||||
|
||||
fun testIfGui(inventory: InventoryView): Boolean {
|
||||
val clazz = getContainerClass(inventory)
|
||||
if(clazz == null) return false
|
||||
|
||||
val expectedWesjdGuiPath = "anvilgui.version.$wesjdAnvilGuiName"
|
||||
|
||||
val clazzName = clazz.name
|
||||
val isWejdsGui = clazzName.contains(expectedWesjdGuiPath)
|
||||
|
||||
return isWejdsGui
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue