本帖最后由 王汉琦 于 2022-9-16 08:47 编辑
Snap! - 让你的Velocity服务器支持BungeeCord插件!
它是怎么工作的?
Snap将使用自己的BungeeCord插件管理器实例加载插件,并将BungeeCord方法、类以及事件调用转换为相应的Velocity插件,反之亦然。
原文:Snap will use it’s own instance of BungeeCord’s plugin manager to load the plugins from there and translate BungeeCord methods, classes as well as event calls to the respective Velocity ones and vice versa. |
警告!
请注意,本插件目前处于实验状态,您不应该在没有过多测试的情况下在服务器中运行它!
装载BungeeCord插件
1.把snap插件放入plugins文件夹
2.启动Velocity服务器
3.把你想要装在Velocity的BungeeCord插件(.jar)放在/plugins/snap/plugins文件夹中
4.重启服务器
5.查看插件是否运行
不支持的BungeeCord插件
BungeeCord的内置权限插件(我推荐使用Luckperms-Velocity版)。
BungeeCord的重新连接服务器功能,因为BungeeCord与Velocity的重新连接服务器功能不一样。
BungeeCord的计分板插件,Velocity没有针对它们的API。
BungeeCord的登录插件,作者并没有做。
如果您的插件并不属于上面4类,但是仍然没有正常工作,请前往
https://github.com/Phoenix616/Snap/issues向作者反馈。
原文:
What doesn’t work?
Some functionality isn’t easily recreated (e.g. group handling is not a thing in Velocity, use a permissions plugin) and of course anything related to hacking into Bungee-internals or packets wont work. Just write a Velocity plugin at that point… Those functions not supported will throw an UnsupportedOperationException. Please report those including the plugin causing them on the issue tracker! If you are sure that the plugin will work fine otherwise then you can have it return default values by setting throw-unsupported-exception to false in the snap.conf!
Not supported:
Using Bungee’s inbuilt permissions system to set and get groups/permissions. Don’t. Use LuckPerms on Velocity. (hasPermission checks work though) Reconnect server functionality. That’s an inbuilt function in Bungee but better suited for a plugin. The related methods will return null or set nothing. Instead of erroring. Scoreboards. Velocity doesn’t have API for them and I’m not going to create a packet based one. Maybe there will be a way to integrate in some plugin or Velocity adds support in the future. Some ProxyConfig settings don’t exist on Velocity or aren’t exposed in the API so they return some sensible defaults which should reflect the proxy’s state. Registering commands after a plugin was enabled. I currently have no good way to hook into this besides straight up modifying the PluginManager class which I would like to avoid. Velocity plugins and Bungee plugins are not available to each other via the respective PluginManager APIs and as dependencies. Their classes should be accessible though. Some connection handling and related events might not work 100% exactly like on Bungee. They are as close as possible though but if you already have to fiddle with that then its best to create a standalone Velocity plugin tbh. Some events don’t work 100% or not at all. Not working: TabCompleteEvent, ProxyDefineCommandEvent, ProxyExceptionEvent. Only partially: ServerDisconnectEvent (only triggers on kicks), ClientConnectEvent (uses Velocity’s LoginEvent with PostOrder.FIRST) ConnectionInitEvent (uses Velocity’s LoginEvent with PostOrder.EARLY) Unsafe doesn’t work.
我的个人翻译并不是很准确,如果您愿意翻译的话,可以随时联系我!
|
赞助
前往GitHub进行赞助:
https://github.com/sponsors/Phoenix616?frequency=recurring
作者授权
支持版本
Velocity 3+
Java 8+
演示
我一共测试了3个插件,分别为:BungeeHub、Tablist、PlayerBalancer
其中BungeeHub、PlayerBalancer插件运行正常。
但是Tablist却在执行命令时出错,但是其插件文件夹已生成。
- [08:28:20 ERROR]: An error occurred while running this command.
- java.util.concurrent.CompletionException: java.lang.RuntimeException: Unable to invoke command tablist for com.velocitypowered.proxy.console.VelocityConsole@4150e7de
- at java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:315) ~[?:?]
- at java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:320) ~[?:?]
- at java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:649) ~[?:?]
- at java.util.concurrent.CompletableFuture$Completion.run(CompletableFuture.java:482) ~[?:?]
- at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) ~[?:?]
- at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) ~[?:?]
- at java.lang.Thread.run(Thread.java:833) [?:?]
- Caused by: java.lang.RuntimeException: Unable to invoke command tablist for com.velocitypowered.proxy.console.VelocityConsole@4150e7de
- at com.velocitypowered.proxy.command.VelocityCommandManager.executeImmediately0(VelocityCommandManager.java:223) ~[velocity-3.1.2-SNAPSHOT-179.jar:3.1.2-SNAPSHOT (git-6547ccaa-b179)]
- at com.velocitypowered.proxy.command.VelocityCommandManager.lambda$executeAsync$0(VelocityCommandManager.java:237) ~[velocity-3.1.2-SNAPSHOT-179.jar:3.1.2-SNAPSHOT (git-6547ccaa-b179)]
- at java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:646) ~[?:?]
- ... 4 more
- Caused by: java.lang.NullPointerException: Cannot invoke "java.util.List.forEach(java.util.function.Consumer)" because the return value of "hu.montlikadani.tablist.config.ConfigConstants.getMessageList(hu.montlikadani.tablist.config.ConfigConstants$MessageKeys)" is null
- at hu.montlikadani.tablist.TabList$1.execute(TabList.java:109) ~[?:?]
- at de.themoep.snap.SnapBungeeAdapter$1.execute(SnapBungeeAdapter.java:157) ~[?:?]
- at de.themoep.snap.SnapBungeeAdapter$1.execute(SnapBungeeAdapter.java:153) ~[?:?]
- at com.velocitypowered.proxy.command.registrar.InvocableCommandRegistrar.lambda$createLiteral$1(InvocableCommandRegistrar.java:81) ~[velocity-3.1.2-SNAPSHOT-179.jar:3.1.2-SNAPSHOT (git-6547ccaa-b179)]
- at com.mojang.brigadier.CommandDispatcher.execute(CommandDispatcher.java:262) ~[velocity-3.1.2-SNAPSHOT-179.jar:3.1.2-SNAPSHOT (git-6547ccaa-b179)]
- at com.velocitypowered.proxy.command.VelocityCommandManager.executeImmediately0(VelocityCommandManager.java:210) ~[velocity-3.1.2-SNAPSHOT-179.jar:3.1.2-SNAPSHOT (git-6547ccaa-b179)]
- at com.velocitypowered.proxy.command.VelocityCommandManager.lambda$executeAsync$0(VelocityCommandManager.java:237) ~[velocity-3.1.2-SNAPSHOT-179.jar:3.1.2-SNAPSHOT (git-6547ccaa-b179)]
- at java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:646) ~[?:?]
- ... 4 more
复制代码
|
下载
1.原帖下载:
https://ci.minebench.de/job/Snap/
2.本地下载:
https://wwz.lanzouv.com/i7ic10brh6if,密码4ism
编写不易,各位给点人气吧!