Skip to content

Enumerations don't define the values() method #330

@osechet

Description

@osechet

Minecraft version: 1.21.5
Mappings version: 2025.04.19

Using the net.minecraft.core.Direction enum leads to errors during the mapping process. I created a small project to demonstrate the problem: https://gitlab.com/osechet/broken-mod
The first commit uses the mdk and only change the mapping_channel to parchment. Everything works. The second commit adds a Block that uses the Direction enum in switch. It creates an error (logs):

ABlock.java:38: error: cannot find symbol
          return switch (dir) {
                 ^
    symbol:   method values()
    location: class Direction
  1 error

The third commit revert the mapping to official and the build passes.

If I replace the switch by an if/else if, it works. The problem is due to the missing values() method that is expected in an enum.

I didn't try other enums but I guess the problem would be the same.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugAn error, misspell, incorrect information, or other issuetriageNeeds attention for triaging and proper assignment of labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions