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

@@ -272,6 +272,16 @@ public interface Block extends Metadatable, Translatable {
@NotNull
BlockState getState();
// Paper start
/**
* @see #getState() optionally disables use of snapshot, to operate on real block data
* @param useSnapshot if this block is a TE, should we create a fully copy of the TileEntity
* @return BlockState with the current state of this block
*/
@NotNull
BlockState getState(boolean useSnapshot);
// Paper end
/**
* Returns the biome that this block resides in
*