1.15.2 Support Items for All Versions

Discussion in 'Spigot Plugin Development' started by Carbon., Feb 5, 2020.

  1. Hi all, I'm currently creating an Item Filter plugin.

    I would like to support 1.8 - 1.15.2 but I'm finding this difficult with the different item structures and names.

    My original idea was to compile with a 1.15.2 jar and use an ID library to convert old names in the config to newer names. Then I realized it wouldn't work because the server would likely be running 1.8.

    Huge issue I missed I know.

    I was wondering what the best way to go about it is?

    TL;DR: I want to compile on 1.15.2 but allow servers on 1.8 to use my plugin and am having issues with materials.
     
    • Make your project modular
    • Add one common module with an interface
    • Have two version specific modules with implementation of the interface in common module that deals with the material
    • Use different version specific modules when building 2 artifacts
     
    • Agree Agree x 1
  2. Thanks a ton, this resource was really helpful

    Can you go into some more detail? I've found a solution but I'd still like to know more about what you're talking about
     
  3. To make things easy I’d go for an api which checks the server version and assigns a material appropriately. I think I heard of something like UMaterial, worth taking a search
    But if you’re advanced and want better performance but multiple jars, then rsl’s solution is great
     
  4. You would basically have custom adapter implementations, this takes advantage of maven its ability to split a project into modules. My goto example here is https://github.com/sainttx/Holograms it has separate modules for every version. You would then just be able to handle the logic for each version individually.
     
    • Agree Agree x 1
    • Informative Informative x 1