Are "LEGACY_" enums from Material safe to use on the long run? What are their safer counterparts?

Discussion in 'Plugin Development' started by Reflxction, Jun 15, 2019.

Thread Status:
Not open for further replies.
  1. Offline


    Hello. In the process of updating some outdated plugins from 1.X.X to 1.14, there were a lot of occurrences where the old material name is not in the Material enum values anymore, but instead an unmotivating, deprecated legacy one. Many Materials had a replacement, such as the DIODE being a REPEATER, etc. But on the other hand, many were not, such as PISTON_MOVING_PIECE having no modern counterpart.

    So, I got a few questions I wish could be clarified:
    1- Are legacy enums subject to removal in future versions, for instance, 1.15?
    2- Are ALL legacy enums supposed to have a safer/modern counterpart?
    3- Those who do not have a counterpart, are developers expected to use the legacy one? Because if so, this leads back up to the first question.

    Thanks in advance.
  2. Offline


    1. I don't think anybody but Mojang can answer that.
    2. I would assume so. It would be logical.
    3. All blocks have a modern enum. PISTON_MOVING_PIECE that you mentioned is not a placeable block, so i can see why it wouldn't, IF it doesn't. It would seem logical to me if all legacy enums had modern counterparts but i have no experience with this.
  3. Offline


    Most likely not. Its actually Spigot that decides if the enum values stays, and they are still there to add support for older plugins.
    Kind of. Some block types that used to require a variant ID (Like colored wool, stained clay) now have their own material data, while others have their data values merged into single material types, and the different blocks are now controlled by BlockStates. For that piston value, you will most likely need to look at the data for a base-game piston head and see what data it uses.

    No. Some legacy values, like wool, will lose their color if the old values are used. This will most likely also happen to the piston as well.
    Reflxction likes this.
  4. Offline


    Alright, that clarifies a lot of things up and simplifies tons of things for me. Thanks! I'll probably have to do a lot of debugging today for that eh
Thread Status:
Not open for further replies.

Share This Page