Add fuse test. Also made some modification to allow the test to work

This commit is contained in:
alexcrea 2024-10-24 10:29:29 +02:00
parent 2008b41b09
commit 99a7829990
No known key found for this signature in database
GPG key ID: 43FD265DB0DBF91F
15 changed files with 514 additions and 52 deletions

View file

@ -7,10 +7,28 @@ 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
}
}
}