Single cross-version jar?
SimSonic opened this issue ยท 1 comments
Is it possible to make single cross-version jar supporting some older versions of Bukkit (1.4.x, 1.5.x and 1.6.x) for example? Like dynmap, craftbook and many other plugins do?
It's possible, but not practical. Bukkit's terrain generation api lacks many features, so Terrain Control needs to use a lot of internal server code (nms code).
There are two ways to achieve cross-version compability for plugins that need nms code:
- Use reflection. This is difficult to write and a nightmare to debug and maintain, so when using this, you have to keep the reflective code to a minimum. BKCommonLib and PowerNBT use this.
- Include multiple "handlers" for nms code. VanishNoPacket and WorldEdit use this.
Because of the large amount of code in Terrain Control that accesses nms code, reflection is almost impossible. Including multiple "handlers" would be possible, but the file size will increase quickly, and compiling TC becomes more difficult. You'll also get only backwards compability (i.e. built for 1.6, still works on 1.5) but no forward compability (i.e. built for 1.6, 90% chance it will work on 1.7 too). That's not so useful, since you can also just grab an old file.
As far as I know, CraftBook and Dynmap don't use nms code at all, or at least fall back on normal Bukkit code when needed.