CraftBanner tile entity return null

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: Minor
    • None
    • Affects Version/s: None

      When try to get a BlockState from a banner make "Invalid Block State" exception :

      My code :

                              ItemStack item = new ItemStack(Material.SHIELD);
                              
                              ItemMeta meta = item.getItemMeta();
                              BlockStateMeta bmeta = (BlockStateMeta) meta;
                              Banner banner = (Banner) bmeta.getBlockState();
                              banner.setBaseColor(DyeColor.BLACK);
                              bmeta.setBlockState(banner);
                              item.setItemMeta(bmeta);
      

      Error :
      Caused by: java.lang.IllegalArgumentException: Invalid blockState
      at org.apache.commons.lang.Validate.notNull(Validate.java:192) ~[spigot.jar:git-Spigot-f32adba-bf43ca6]
      at org.bukkit.craftbukkit.v1_9_R1.inventory.CraftMetaBlockState.setBlockState(CraftMetaBlockState.java:281) ~[spigot.jar:git-Spigot-f32adba-bf43ca6]

            Assignee:
            Unassigned
            Reporter:
            Axen Georget
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: