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

Skull:getRotation() and Skull:setRotation() broken for wall mounted skulls/heads

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • None
    • None
    • Ubuntu 16.04 - Intel i7

      Java(TM) SE Runtime Environment (build 1.8.0_181-b13)
      Java HotSpot(TM) 64-Bit Server VM (build 25.181-b13, mixed mode)

    • This server is running CraftBukkit version git-Spigot-eb21557-4a47be6 (MC: 1.13.2) (Implementing API version 1.13.2-R0.1-SNAPSHOT)
    • Yes

      The getRotation() and setRotation() in Skull is broken for all skulls/heads that are wall mounted. Causing java.lang.ClassCastException: org.bukkit.craftbukkit.v1_13_R2.block.impl.CraftSkullWall cannot be cast to org.bukkit.block.data.Rotatable

      Example code snippet:

      Block block = getServer().getWorlds().get(0).getBlockAt(0, 200, 0);
      block.setType(Material.SKELETON_WALL_SKULL);
      BlockState blockState = block.getState();
      if(blockState instanceof Skull)

      {    try \{ ((Skull)blockState).setRotation(BlockFace.SOUTH);  }

         catch(Exception e) {  getLogger().severe("rotation exception: "+e);  }
      }

      Proposal how to fix it, by updating org.bukkit.craftbukkit.block.CraftSkull.java is enclosed.

      This spigot bug causes exception in the CoreProtect plugin. 

            Unassigned Unassigned
            Heffaklumpen Mojjen
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: