API to get a BlockState without a snapshot

This allows you to get a BlockState without creating a snapshot, operating
on the real tile entity.

This is useful for where performance is needed
This commit is contained in:
Aikar
2017-11-06 21:10:01 -05:00
parent 74e0518b1a
commit 8306cc5b4f
2 changed files with 24 additions and 0 deletions

View File

@@ -36,4 +36,18 @@ public interface TileState extends BlockState, PersistentDataHolder {
@NotNull
@Override
PersistentDataContainer getPersistentDataContainer();
// Paper start
/**
* Checks if this TileState is a snapshot or a live
* representation of the underlying tile entity.
* <p>
* NOTE: You may still have to call {@link BlockState#update()} on
* live representations to update any visuals on the block.
*
* @return true if this is a snapshot
* @see Block#getState(boolean)
*/
boolean isSnapshot();
// Paper end
}