Want a better Minecraft server? Read about SpigotMC here!
Separate names with a comma.
Discussion in 'Spigot Plugin Development' started by TKUIYEAGER1, Aug 16, 2018.
Title stays it all, how can I make my plugin compatible for 1.8 - 1.13?
In your plugin.yml there is an api-version key, set that to 1.13 if you developed it in 1.13. That will “fix” things that were updated in 1.13.
This is not a brilliant fix although aims to allow older plugins to work on a 1.13 server. Otherwise, where appropriate check what version the server’s using and use a comparative statement to perform certain actions based on this.
Edit: you should not be making things 1.8 compatible. Either 1.12 or 1.13. 1.12 and older should be able to partially work on newer versions via backwards compatibility - however this was quite broken in 1.13.
Make a pom project with modules for each version
do support all versions via nms
The thing is the 1.13 API is very diverse from the 1.12 API
Any video tutorials about that?
you can put all version dependent codes into your core library and share among your plugins.
What a bunch of misinformation, lol. Plugins are compatible across all versions by default, so long as things used in the plugin don't change between versions. If that happens, you have to use reflection if you want everything in the same jar. For instance, the Server#getOnlinePlayers method was changed from an array to a collection somewhere around MC 1.8, this gets around that.
And what about material names? Like stained glass?
if you dont add the api-version thing in your plugin.yml it actually uses the compatibility mode, which still works fine with the old material + subid system. Though not advised, as it's completely legacy, deprecated and legacy mode.
But that's just the materials and things like that as far as I know.
reflection is not the only way to do that...
Removed the api-version thing and I still get this error:
Error occurred while enabling Punish v1.0 (Is it up to date?)
That means that "GRASS_BLOCK" is not in that version (yet?). In what version are you right now?
Built on 1.13 and trying to use in 1.12.2
Granted you should build against something with the old Materials, not the new ones, so something like the 1.12 jar
There is no "only" way to do anything in programming. That's the entire point of it. Everything can be done in multiple ways depending on the developer.