Switch$Face casted to FaceAttachable$AttachedFace

    • Type: Bug
    • Resolution: Fixed
    • Priority: Minor
    • None
    • Affects Version/s: None
    • git-Spigot-988b411-055870c (MC: 1.16.3) (been around since at least 1.15.2, though)
    • CoreProtect (although irrelevant)
    • Yes

      If one first accessed e.g. a wooden button as a `Switch` to get its `Switch.Face` (`Switch#getFace`), it starts throwing a `ClassCastException` if you want to access it as a `FaceAttachable` for its `FaceAttachable.AttachedFace` (`FaceAttachable#getAttachedFace`).

       

      The issue is with `CraftBlockData#toBukkit` caching "incorrect" types into its `classMappings` map, as `BlockStateEnum` called `"face"` can be mapped to both `Switch.Face` and `FaceAttachable.AttachedFace`. The `BlockStateEnum` is found in `CraftSwitch` and `CraftFaceAttachable`.

            Assignee:
            Unassigned
            Reporter:
            Mariell Hoversholm
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: