Skip to content

Neptune using legacy material support #198

Description

@Biquaternions

At the moment, Neptune logs a warning about the plugin requiring legacy material support.
I enabled debug mode in server.properties to force it to throw an exception and see what part of the plugin is causing it.

https://pastes.dev/hvyaiwz4bS

The reason comes from methods like this, that call Material.values() instead of using the Registry (bySuffix also uses said method):

    public List<Material> getAllItems() {
        List<Material> list = new ArrayList<>();
        for (Material m : Material.values()) {
            if (m.isItem() && !m.isAir() && !m.isLegacy()) list.add(m);
        }
        return list;
    }

Example using the registry, note the isLegacy validation is no longer required:

    public List<Material> getAllItems() {
        List<Material> list = new ArrayList<>();
        for (Material m : Registry.MATERIAL) {
            if (m.isItem() && !m.isAir()) list.add(m);
        }
        return list;
    }

I didn't make this into a pr because idk if this is intentional, I see the registry being used in other places.
Lmk if I should make one.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions