Solved Support version

Discussion in 'Spigot Plugin Help' started by craftmen0202, Feb 25, 2020.

  1. Hello, I am creating a plugin using version 1.14 of spigot, however the server will have free access to whoever is using minecraft 1.8, so I have doubts. For example, I made a command to grab a player's head and in 1.14 he needs 'LEGACY_SKULL_ITEM', in 1.8 'SKULL_ITEM', however in my eclipse, I can't use both imports in different classes, basically, I can only use one api at a time, so could someone give me a solution for this?
     
  2. Beginner should Not support multiple versions.
     
  3. ?
    I just need a solution
     
  4. If you are a beginner, you should stick to making your plugin work with one version and further develop it by adding new features and other Quality of Life changes.

    Once you have become more experienced with Java and the SpigotAPI, you will probably figure out how to add multi-version support by yourself (I did).
     
    • Creative Creative x 1
  5. people, so I’ve been developing for a while and if I’m asking here it’s because I want help and I know I have the ability to learn, I spoke up there very well, I want help, so if you came just to tell me I’m going to learn alone, thank you and bye.
     
  6. Theres an entire class you can add into your plugin project, I think its called MaterialX ?

    It basicly takes all the names from previous versions and allows them to be converted into the current 1.13+ names. Allowing for multi-version use of Materials and particles and many more things.

    Hopefully that made some sense, but you'll find a Github download for the class, and instructions on downloading and adding it to your projects.
     
  7. The reason why I am saying that you should first become a better developer is because from what I am reading you want to make a public plugin. Making a plugin public when you have been programming for a relatively short amount of time isn't the best idea.

    I have made my first public plugin a year and a half after I got into the SpigotAPI and Java, and it was still quite a mess when I first released it.
     
  8. drives_a_ford

    Moderator

    What are you describing here exactly?
    Your server can only ever run 1 version of MC at a time.
    Are you saying your server is on 1.14 and you're using ViaVersion/ViaBackwards/ViaRewind to enable players to join on other versions of the game?

    Or are you saying that you're not sure what version of MC the server will run?

    If you do want to simply support multiple versions of MC, then your best bet is to use abstraction. An example can be found here.

    If your server is allowing players to connect with other versions of MC using the above mentioned plugins, all you need to do is support the version of the server. The rest is dealt with by the plugins in any way they are able to. That's their whole point.

    And you should never be using LEGACY_ materials. Just declare the appropriate api-version in your plugin.yml and use the non-depracated Material.PLAYER_HEAD instead.
     
  9. @drives_a_ford
    Yes, I ended up understanding everything over time, but thanks anyway!