Solved Both use 1.8 and 1.9?

Discussion in 'Spigot Plugin Development' started by RestrictedPower, Apr 15, 2016.

  1. Hey how could I make a plugin compatible for both 1.8 and 1.9 versions?
     
  2. You make a base abstract class and load the implementation of that class based on the server version. So like MobsSpawnerAbs -> MobsSpawnerImpl_1_9 or 1_8
     
  3. MiniDigger

    Supporter

    if you only use the api (and no new 1.9 api) you should be fine.
    Only problem I can see is the changed Sound enum. For that you will just need to check which verison the server is running and access the sounds for each version using Sound.valueOf(name) instead of Sound.name
     
  4. Ummm
    Ummm example? :p
     
  5. So if I understood well I should check the version and then import for the version's api?
     
  6. MiniDigger

    Supporter

    most of the parts of the api did not break from 1.8 to 1.9, only thing I can think of are sounds. What feature doesn't work for you? Are you accessing obc/nms classes?
     
  7. Nothing I haven't tried yet :p I just thought that if the server is in 1.9 and the pl in 1.8 there would be an error just by loading the plugin...
     
  8. MiniDigger

    Supporter

    well, the api is designed to not break on updates. so in most cases there is no need to update your plugin at all. I workflow here is to try every feature of you plugin with the new version and then try to fix stuff the broke. If nothing broke you are good to go and don't need to change anything.
     
    • Winner Winner x 1