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

Add source block field to BlockPhysicsEvent

XMLWordPrintable

    • None

      BlockPhysicsEvent provides a method called getChangedType() so we can get the material of the source block(the block causing this event), but we cannot get the 'source' block instance. It nearly makes the event useless.

      For example, I wanna logging block updates, I can know all blocks involved, but I can't know which is the source block.

      (May you think we can calc the centred block? no, since there are many different source blocks in one tick, BlockPhysicsEvent was called out-of-order)

      In nms.World.java, I found the way to get 'changedTypeId' is by 'CraftMagicNumbers.getId(block)', why not expose the 'block' field to the event?

      I would be appreciated if Spigot can add this 

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

              Created:
              Updated: