mirror of
https://github.com/aikar/commands.git
synced 2026-05-31 06:11:55 +00:00
Added Velocity support (#182)
This PR adds support for the upcoming proxy Velocity. https://www.velocitypowered.org/ A few note worthy issues: - Velocity does not provide a static method for its ProxyServer instance, so the instance has to be passed in by the plugin with `new VelocityCommandManager(proxy, this)` - Velocity does not provide a way to get the Plugin logger with the provided Plugin or PluginContainer, so it must be fetched using `Logger logger = LoggerFactory.getLogger(plugin.getClass());` UNTESTED - Velocity uses an annotation to signify the main class, meaning it can't be passed around like the Bukkit and Bungeecord JavaPlugin and Plugin. An Object has to be passed in which the PluginContainer is extracted from it using the Proxy's PluginManager `proxy.getPluginManager().getPlugin(plugin.getClass().getAnnotation(Plugin.class).id()).get();` Any and all feedback is welcomed and appreciated. *This implementation is essentially a copy/paste/rename. All code belongs to the original author, except the `ACFVelocityUtil#matchPlayer` which was originally written by md_5 and modified to use Velocity classes.*
This commit is contained in: