Fix/vane portal (#61)

Fix incompatibility issue with vane portal (fix #60)
This commit is contained in:
alexcrea 2025-05-06 16:21:20 +02:00 committed by GitHub
commit a26c51a287
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 10 additions and 2 deletions

View file

@ -16,7 +16,7 @@ plugins {
}
group = "xyz.alexcrea"
version = "1.11.0"
version = "1.11.1"
repositories {
// EcoEnchants

View file

@ -10,13 +10,16 @@ interface ExternGuiTester {
fun testIfGui(inventory: InventoryView): Boolean {
// this mean we are on test
//TODO review why needed knowing previous mitigations should works
if(inventory.javaClass.name.endsWith("AnvilViewMock")) return false
val clazz = getContainerClass(inventory) ?: return false
val clazzName = clazz.name
//TODO maybe instead of testing non default, better to be testing we are default ?
if (expectWesjd(clazzName)) return true
if (expectXenondevUI(clazzName)) return true
if (expectVanePortal(clazzName)) return true
return false
}
@ -37,5 +40,10 @@ interface ExternGuiTester {
&& name.endsWith(XenondevUISufix)
}
fun expectVanePortal(name: String): Boolean {
val expected = "org.oddlama.vane.core.menu.AnvilMenu\$AnvilContainer"
return name == expected
}
}

View file

@ -281,7 +281,7 @@ object DataPackDependency {
for (enchantment in EnchantmentApi.getRegisteredEnchantments().values) {
if(!enchantment.key.namespace.equals(namespace, ignoreCase = true)) continue
CustomAnvil.log("Writing default for $enchantment")
CustomAnvil.log("Writing default for ${enchantment.key}")
EnchantmentApi.writeDefaultConfig(enchantment, false)
}