Closed Paulomart closed 8 years ago
Somehow related to: SpigotMC/BungeeCord#1717
Also: I is not happing on my local machine, just in production
According to this code, we do support LilyPad and Bungee. Perhaps @mastercoms could take a look at this, or maybe @turt2live if he hasn't dropped off the face of the planet, since he seems to know how it works.
I found the issue: I shade an older version of flowpowered into my plugins, it caused the throuble. Updating to 1.1.0 from glowstone++ fixed it.
@Paulomart For future reference, you should remap everything you shade into your plugins to avoid conflicts like this. Here's how you do that with Maven - A quick Google didn't find anything for Gradle, however.
@gdude2002 @Paulomart for Gradle, the maven-shade-plugin equivalent is shadow (also supports class relocation to avoid these conflicts)
@deathcap Ah, that's what I use, didn't realise it was able to remap as well. Thanks.
Year I know that, but I application wraps around glowstone and injects libs before glowstone itself starts. Remapping the whole lib would cause a lot of problems in other projects that uses some parts of it as api. So I will go with using glowstones flowpowered to avoid this.
If anyone is interested I remapped and patched Glowstone: https://github.com/Mystalion/MysticStone
Glowstone should probably take this change: https://github.com/Mystalion/MysticStone/blob/master/patches/0001-Pom-changes.patch
+ <relocations>
+ <relocation>
+ <pattern>com.flowpowered</pattern>
+ <shadedPattern>net.glowstone.lib.com.flowpowered</shadedPattern>
+ </relocation>
+ <relocation>
+ <pattern>io.netty</pattern>
+ <shadedPattern>net.glowstone.lib.io.netty</shadedPattern>
+ </relocation>
+ </relocations>
@gdude2002 @mastercoms what do you think? While plugins should ideally shade and relocate their own dependencies, Glowstone could help prevent conflicts by relocating its dependencies as well (similar to CraftBukkit of yore relocating its library dependencies into org.craftbukkit.libs.*)
When doing that, glowstone should divide in libs that are internal such as Netty and FlowPowered, and something like Apache commons which is often used in plugins without shading it.
@deathcap It's a good idea, honestly. Personally I would say that plugins shouldn't be relying on internal libs for Glowstone, but as @Paulomart says, we should consider not remapping things that are in Bukkit and that plugins typically rely on (such as the MySQL driver).
https://github.com/GlowstonePlusPlus/Glowkit/blob/bukkit%2Bglowkit/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java#L97 Here, the order should be changed.
When connecting to a glowstone server via bungee this happens and you cannot connect to the server.
Related:
https://github.com/GlowstonePlusPlus/GlowstonePlusPlus/blob/master/src/main/java/net/glowstone/net/codec/handshake/HandshakeCodec.java
https://github.com/SpigotMC/BungeeCord/blob/master/proxy/src/main/java/net/md_5/bungee/ServerConnector.java#L76
https://github.com/SpigotMC/BungeeCord/blob/master/protocol/src/main/java/net/md_5/bungee/protocol/packet/Handshake.java