public class BitAccess extends java.lang.Object implements IBitAccess
Constructor and Description |
---|
BitAccess(net.minecraft.world.World worldIn,
net.minecraft.util.math.BlockPos pos,
VoxelBlob blob,
VoxelBlob filler) |
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 |
VoxelBlob |
getNativeBlob() |
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. |
public VoxelBlob getNativeBlob()
public IBitBrush getBitAt(int x, int y, int z)
IBitAccess
getBitAt
in interface IBitAccess
public void setBitAt(int x, int y, int z, IBitBrush bit) throws APIExceptions.SpaceOccupied
IBitAccess
setBitAt
in interface IBitAccess
APIExceptions.SpaceOccupied
public void commitChanges(boolean triggerUpdates)
IBitAccess
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.commitChanges
in interface IBitAccess
triggerUpdates
- normally true, only use false if your doing something special.public net.minecraft.item.ItemStack getBitsAsItem(@Nullable net.minecraft.util.EnumFacing side, @Nullable ItemType type, boolean crossWorld)
IBitAccess
IBitAccess
Usable for any IBitAccess
getBitsAsItem
in interface 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.public void visitBits(IBitVisitor visitor)
IBitAccess
IBitAccess
and return a new bit in its
place, can be used to optimize large changes, or iteration.visitBits
in interface IBitAccess
public BitQueryResults queryBitRange(net.minecraft.util.math.BlockPos a, net.minecraft.util.math.BlockPos b)
IBitAccess
queryBitRange
in interface IBitAccess