mirror of
https://github.com/alexcrea/CustomAnvil.git
synced 2026-06-23 16:16:17 +02:00
Fix/vane portal (#61)
Fix incompatibility issue with vane portal (fix #60)
This commit is contained in:
commit
a26c51a287
3 changed files with 10 additions and 2 deletions
|
|
@ -16,7 +16,7 @@ plugins {
|
||||||
}
|
}
|
||||||
|
|
||||||
group = "xyz.alexcrea"
|
group = "xyz.alexcrea"
|
||||||
version = "1.11.0"
|
version = "1.11.1"
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
// EcoEnchants
|
// EcoEnchants
|
||||||
|
|
|
||||||
|
|
@ -10,13 +10,16 @@ interface ExternGuiTester {
|
||||||
|
|
||||||
fun testIfGui(inventory: InventoryView): Boolean {
|
fun testIfGui(inventory: InventoryView): Boolean {
|
||||||
// this mean we are on test
|
// this mean we are on test
|
||||||
|
//TODO review why needed knowing previous mitigations should works
|
||||||
if(inventory.javaClass.name.endsWith("AnvilViewMock")) return false
|
if(inventory.javaClass.name.endsWith("AnvilViewMock")) return false
|
||||||
|
|
||||||
val clazz = getContainerClass(inventory) ?: return false
|
val clazz = getContainerClass(inventory) ?: return false
|
||||||
|
|
||||||
val clazzName = clazz.name
|
val clazzName = clazz.name
|
||||||
|
//TODO maybe instead of testing non default, better to be testing we are default ?
|
||||||
if (expectWesjd(clazzName)) return true
|
if (expectWesjd(clazzName)) return true
|
||||||
if (expectXenondevUI(clazzName)) return true
|
if (expectXenondevUI(clazzName)) return true
|
||||||
|
if (expectVanePortal(clazzName)) return true
|
||||||
|
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
@ -37,5 +40,10 @@ interface ExternGuiTester {
|
||||||
&& name.endsWith(XenondevUISufix)
|
&& name.endsWith(XenondevUISufix)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun expectVanePortal(name: String): Boolean {
|
||||||
|
val expected = "org.oddlama.vane.core.menu.AnvilMenu\$AnvilContainer"
|
||||||
|
|
||||||
|
return name == expected
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -281,7 +281,7 @@ object DataPackDependency {
|
||||||
for (enchantment in EnchantmentApi.getRegisteredEnchantments().values) {
|
for (enchantment in EnchantmentApi.getRegisteredEnchantments().values) {
|
||||||
if(!enchantment.key.namespace.equals(namespace, ignoreCase = true)) continue
|
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)
|
EnchantmentApi.writeDefaultConfig(enchantment, false)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue