Mirror von
https://github.com/ViaVersion/ViaVersion.git
synchronisiert 2024-09-17 01:23:43 +02:00
Blame a class when the childHandler doesn't inject
Dieser Commit ist enthalten in:
Ursprung
ea4650000e
Commit
c404f2206c
@ -87,9 +87,15 @@ public class ViaVersionPlugin extends JavaPlugin implements ViaVersionAPI {
|
||||
ChannelFuture future = (ChannelFuture) o;
|
||||
ChannelPipeline pipeline = future.channel().pipeline();
|
||||
ChannelHandler bootstrapAcceptor = pipeline.first();
|
||||
try {
|
||||
ChannelInitializer<SocketChannel> oldInit = ReflectionUtil.get(bootstrapAcceptor, "childHandler", ChannelInitializer.class);
|
||||
ChannelInitializer newInit = new ViaVersionInitializer(oldInit);
|
||||
|
||||
ReflectionUtil.set(bootstrapAcceptor, "childHandler", newInit);
|
||||
} catch (NoSuchFieldException e) {
|
||||
// field not found
|
||||
throw new Exception("Unable to find childHandler, blame " + bootstrapAcceptor.getClass().getName());
|
||||
}
|
||||
injected = true;
|
||||
} else {
|
||||
break; // not the right list.
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren