public interface IBitAccess
IChiselAndBitsAPI
Modifier and Type | Method and Description |
---|---|
void |
commitChanges(boolean triggerUpdates)
Any time you modify a block you must commit your changes for them to take
affect, optionally you can trigger updates or not.
|
IBitBrush |
getBitAt(int x,
int y,
int z)
Returns the bit at the specific location, this should always return a
valid IBitBrush, never null.
|
net.minecraft.item.ItemStack |
getBitsAsItem(net.minecraft.util.EnumFacing side,
ItemType type,
boolean crossWorld)
Returns an ItemStack for the
IBitAccess
Usable for any IBitAccess |
BitQueryResults |
queryBitRange(net.minecraft.util.math.BlockPos a,
net.minecraft.util.math.BlockPos b)
Request a summary of the contents of a range of bits, all range values
are clamped to 0 - 15.
|
void |
setBitAt(int x,
int y,
int z,
IBitBrush bit)
Sets the bit at the specific location, if you pass null it will use air.
|
void |
visitBits(IBitVisitor visitor)
Process each bit in the
IBitAccess and return a new bit in its
place, can be used to optimize large changes, or iteration. |
BitQueryResults queryBitRange(net.minecraft.util.math.BlockPos a, net.minecraft.util.math.BlockPos b)
a
- b
- void visitBits(IBitVisitor visitor)
IBitAccess
and return a new bit in its
place, can be used to optimize large changes, or iteration.visitor
- IBitBrush getBitAt(int x, int y, int z)
x
- y
- z
- void setBitAt(int x, int y, int z, IBitBrush bit) throws APIExceptions.SpaceOccupied
x
- y
- z
- bit
- APIExceptions.SpaceOccupied
void commitChanges(boolean triggerUpdates)
IBitAccess
is not in the world this method does nothing.
All changes made by a player should be committed on the client and the
server, failure to commit changes on the client will cause corruption of
the Undo Pipeline, causing 'Block Has Changed' errors when trying to undo
blocks that have been modified only on the server, doing so also
increases responsiveness in those changes for the player making them.triggerUpdates
- normally true, only use false if your doing something special.net.minecraft.item.ItemStack getBitsAsItem(@Nullable net.minecraft.util.EnumFacing side, ItemType type, boolean crossWorld)
IBitAccess
Usable for any IBitAccess
side
- angle the player is looking at, can be null.type
- what type of item to give.crossWorld
- determines if the NBT for the ItemStack is specific to this
world or if it is portable, cross world NBT is larger and
slower, you should only request cross world NBT if you
specifically need it.