Uploaded image for project: 'Spigot'
  1. Spigot
  2. SPIGOT-6205

Switch$Face casted to FaceAttachable$AttachedFace

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • None
    • 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`.

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

              Created:
              Updated:
              Resolved: