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

Expose net.minecraft.world.level.block.state.BlockBase.BlockData#canPlace

XMLWordPrintable

    • Icon: New Feature New Feature
    • Resolution: Fixed
    • Icon: Minor Minor
    • None
    • None
    • 3271-Spigot-3892929-cef1fda
    • Yes

      It would be nice to have net.minecraft.world.level.block.state.BlockBase.BlockData#canPlace exposed in spigot's BlockData interface, this method is overriden by various blocks to determine if they can be placed at a certain location.

      This would be a replacement for the following method that makes use of NMS to call canPlace.

          public static boolean canPlace(BlockData data, Location location) {
              return ((CraftBlockData) data).getState().canPlace(((CraftWorld) location.getWorld()).getHandle(),
                      new BlockPosition(location.getX(), location.getY(), location.getZ()));
          }

            Unassigned Unassigned
            joshl5324@gmail.com JishunaMatata
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: