mirror of
https://github.com/alexcrea/CustomAnvil.git
synced 2026-06-23 08:14:00 +02:00
forgot to update external gui tester
and version up
This commit is contained in:
parent
d283ca0c12
commit
1f83b7b4fe
6 changed files with 89 additions and 18 deletions
|
|
@ -7,28 +7,11 @@ import xyz.alexcrea.cuanvil.dependency.gui.ExternGuiTester
|
|||
class v1_21R1_ExternGuiTester: ExternGuiTester {
|
||||
override val wesjdAnvilGuiName = "Wrapper1_21_R1"
|
||||
|
||||
var tested = false;
|
||||
var possible = false;
|
||||
|
||||
override fun getContainerClass(view: InventoryView): Class<Any>? {
|
||||
// In case we are in a test environment
|
||||
if(!tested) testClassExist()
|
||||
if(!possible) return null
|
||||
|
||||
if(view !is CraftInventoryView<*, *>) return null
|
||||
val container = view.handle
|
||||
|
||||
return container.javaClass
|
||||
}
|
||||
|
||||
fun testClassExist(){
|
||||
tested = true;
|
||||
try {
|
||||
Class.forName("org.bukkit.craftbukkit.inventory.CraftInventoryView")
|
||||
possible = true
|
||||
} catch (e: ClassNotFoundException){
|
||||
possible = false
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue