mirror of
https://github.com/alexcrea/CustomAnvil.git
synced 2026-06-23 08:14:00 +02:00
Custom anvil only work on nms menu
This commit is contained in:
parent
0993b007a0
commit
8afd54c94d
3 changed files with 16 additions and 6 deletions
|
|
@ -1,9 +1,14 @@
|
|||
package xyz.alexcrea.cuanvil.dependency.gui
|
||||
|
||||
import org.bukkit.inventory.InventoryView
|
||||
import xyz.alexcrea.cuanvil.dependency.util.PlatformUtil
|
||||
|
||||
interface ExternGuiTester {
|
||||
|
||||
object Const{
|
||||
val cannonicalPaperAnvilMenu = "net.minecraft.world.inventory.AnvilMenu"
|
||||
}
|
||||
|
||||
val wesjdAnvilGuiName: String?
|
||||
|
||||
fun getContainerClass(inventory: InventoryView): Class<Any>?
|
||||
|
|
@ -16,12 +21,17 @@ interface ExternGuiTester {
|
|||
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
|
||||
if(!PlatformUtil.isPaper){
|
||||
// Blacklist gui causing issue
|
||||
if (expectWesjd(clazzName)) return true
|
||||
if (expectXenondevUI(clazzName)) return true
|
||||
if (expectVanePortal(clazzName)) return true
|
||||
|
||||
return false
|
||||
return false
|
||||
}
|
||||
|
||||
// Only allow cannonical anvil menu class
|
||||
return !Const.cannonicalPaperAnvilMenu.equals(clazzName, true)
|
||||
}
|
||||
|
||||
fun expectWesjd(name: String): Boolean {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue