public final class SketchData
extends java.lang.Object
implements net.minecraftforge.common.util.INBTSerializable<net.minecraft.nbt.NBTTagCompound>
As such, this merely consists of an origin coordinate (minimum corner of the bounding box around the being edited sketch), and the set positions, relative to the origin coordinate. No actual block state data is stored here.
| Constructor and Description |
|---|
SketchData() |
| Modifier and Type | Method and Description |
|---|---|
void |
deserializeNBT(net.minecraft.nbt.NBTTagCompound nbt) |
java.util.stream.Stream<net.minecraft.util.math.BlockPos> |
getBlocks()
Get a stream over all block positions currently set in this sketch.
|
net.minecraft.util.math.AxisAlignedBB |
getBounds()
Get the current bounds of the sketch in world space.
|
net.minecraft.util.math.BlockPos |
getOrigin()
Get the current origin of the sketch in world space.
|
net.minecraft.util.math.AxisAlignedBB |
getPotentialBounds()
Get the potential bounds of the sketch in world space.
|
net.minecraft.util.math.AxisAlignedBB |
getPotentialBounds(net.minecraft.util.math.BlockPos including)
Get the potential bounds of the sketch in world space,
assuming the specified position is also added to the sketch.
|
boolean |
isEmpty()
Whether the sketch is currently empty, i.e.
|
boolean |
isSet(net.minecraft.util.math.BlockPos pos)
Get whether the specified block position in world space is set in this
sketch.
|
boolean |
isValid(net.minecraft.util.math.BlockPos pos)
Checks whether the position can be added to this sketch.
|
boolean |
reset(net.minecraft.util.math.BlockPos pos)
Remove the specified block position in world space from the sketch.
|
net.minecraft.nbt.NBTTagCompound |
serializeNBT() |
boolean |
set(net.minecraft.world.World world,
net.minecraft.util.math.BlockPos pos)
Add the specified block position in world space the sketch.
|
boolean |
toggle(net.minecraft.world.World world,
net.minecraft.util.math.BlockPos pos)
Toggle a block in the sketch.
|
public boolean isEmpty()
true if the sketch is empty;
false otherwise.@Nullable public net.minecraft.util.math.BlockPos getOrigin()
@Nullable public net.minecraft.util.math.AxisAlignedBB getBounds()
May be null if no block is set in the sketch.
public boolean isValid(net.minecraft.util.math.BlockPos pos)
pos - the position to check.true if it can be added;
false otherwise.public net.minecraft.util.math.AxisAlignedBB getPotentialBounds()
This is the bounds box indicating in what are blocks may be added to the sketch without it exceeding the maximum blueprint size.
public net.minecraft.util.math.AxisAlignedBB getPotentialBounds(net.minecraft.util.math.BlockPos including)
This is the bounds box indicating in what are blocks may be added to the sketch without it exceeding the maximum blueprint size.
This variant is used to determine the potential bounds during a range selection (where the specified position is the start position of the range).
including - the position to assume also to belong to the sketch.java.lang.IllegalArgumentException - if the specified coordinate does not
lie in the bounds returned by
getPotentialBounds().public boolean isSet(net.minecraft.util.math.BlockPos pos)
pos - the position to check.true if the position is set; false otherwise.public boolean toggle(net.minecraft.world.World world,
net.minecraft.util.math.BlockPos pos)
This can fail if the specified position is outside the potential bounds
of the sketch, in which case this will return false.
world - the world containing the position to add.pos - the position of the block to toggle.true if the change was applied; false otherwise.public boolean set(net.minecraft.world.World world,
net.minecraft.util.math.BlockPos pos)
This can fail if the specified position is outside the potential bounds
of the sketch, in which case this will return false.
world - the world containing the position to add.pos - the position of the block to add.true if the position was added; false otherwise.public boolean reset(net.minecraft.util.math.BlockPos pos)
pos - the position of the block to remove.true if the position was removed; false otherwise.public java.util.stream.Stream<net.minecraft.util.math.BlockPos> getBlocks()
public net.minecraft.nbt.NBTTagCompound serializeNBT()
serializeNBT in interface net.minecraftforge.common.util.INBTSerializable<net.minecraft.nbt.NBTTagCompound>public void deserializeNBT(net.minecraft.nbt.NBTTagCompound nbt)
deserializeNBT in interface net.minecraftforge.common.util.INBTSerializable<net.minecraft.nbt.NBTTagCompound>