mirror of
https://github.com/alexcrea/CustomAnvil.git
synced 2026-06-24 00:26:16 +02:00
remove more nms sub modules
This commit is contained in:
parent
f3eca58b1a
commit
5a57b3afbf
22 changed files with 34 additions and 355 deletions
|
|
@ -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
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -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)
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue