remove more nms sub modules

This commit is contained in:
alexcrea 2025-07-09 11:14:55 +02:00
parent c12e70ca54
commit a8553debeb
Signed by: alexcrea
GPG key ID: E346CD16413450E3
22 changed files with 34 additions and 355 deletions

View file

@ -1,49 +0,0 @@
package xyz.alexcrea.cuanvil.dependency.gui
import org.bukkit.inventory.InventoryView
interface ExternGuiTester {
val wesjdAnvilGuiName: String?
fun getContainerClass(view: InventoryView): Class<Any>?
fun testIfGui(view: InventoryView): Boolean {
// this mean we are on test
//TODO review why needed knowing previous mitigations should works
if(view.javaClass.name.endsWith("AnvilViewMock")) return false
val clazz = getContainerClass(view) ?: 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
}
fun expectWesjd(name: String): Boolean {
val expectedWesjdGuiPath = "anvilgui.version.$wesjdAnvilGuiName"
return name.contains(expectedWesjdGuiPath)
}
private val XenondevUIPrefix: String
get() = "xyz.xenondevs.inventoryaccess."
private val XenondevUISufix: String
get() = ".AnvilInventoryImpl"
fun expectXenondevUI(name: String): Boolean {
return name.startsWith(XenondevUIPrefix)
&& name.endsWith(XenondevUISufix)
}
fun expectVanePortal(name: String): Boolean {
val expected = "org.oddlama.vane.core.menu.AnvilMenu\$AnvilContainer"
return name == expected
}
}

View file

@ -1,18 +0,0 @@
package xyz.alexcrea.cuanvil.dependency.scheduler
import org.bukkit.entity.Entity
import org.bukkit.plugin.Plugin
interface TaskScheduler {
fun scheduleGlobally(plugin: Plugin, task: Runnable, time: Long): Any?
fun scheduleGlobally(plugin: Plugin, task: Runnable): Any?{
return scheduleGlobally(plugin, task, 0L)
}
fun scheduleOnEntity(plugin: Plugin, entity: Entity, task: Runnable, time: Long): Any?
fun scheduleOnEntity(plugin: Plugin, entity: Entity, task: Runnable): Any?{
return scheduleOnEntity(plugin, entity, task, 0L)
}
}