Class PreviewSnapshot
java.lang.Object
de.eldoria.schematicbrush.rendering.PreviewSnapshot
The blocks of a brush preview, grouped by the 16x16x16 section they lie in.
A snapshot is immutable. Only blocks that differ from the world at capture time are contained.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classCollects the blocks of a snapshot. -
Method Summary
Modifier and TypeMethodDescriptionstatic PreviewSnapshot.BuilderCreates a builder for a snapshot.static PreviewSnapshotempty()A snapshot without blocks.booleanisEmpty()Checks whether the snapshot holds no blocks.@Nullable Locationorigin()The location the preview is rendered at.section(long sectionKey) The preview blocks of a section.sections()The keys of all sections holding preview blocks.intsize()The amount of preview blocks.@Nullable UUIDworld()The id of the world the preview belongs to.
-
Method Details
-
empty
-
builder
Creates a builder for a snapshot.- Parameters:
origin- the location the preview is rendered at- Returns:
- new builder
-
origin
The location the preview is rendered at.- Returns:
- the origin or null if the snapshot is empty
-
world
The id of the world the preview belongs to.- Returns:
- the world id or null if the snapshot is empty
-
sections
The keys of all sections holding preview blocks.- Returns:
- section keys as created by
BlockKey.section(long)
-
section
-
size
public int size()The amount of preview blocks.- Returns:
- block count
-
isEmpty
public boolean isEmpty()Checks whether the snapshot holds no blocks.- Returns:
- true if no blocks are contained
-