public interface IChiselAndBitsAPI
IChiselsAndBitsAddon
Modifier and Type | Method and Description |
---|---|
void |
addEquivilantMaterial(net.minecraft.block.material.Material newMaterial,
net.minecraft.block.material.Material target)
Register a custom material as equivalent to another material.
|
void |
beginUndoGroup(net.minecraft.entity.player.EntityPlayer player)
Begins an undo group, starting two operations without ending the previous
operation will throw a runtime exception.
|
boolean |
canBeChiseled(net.minecraft.world.World world,
net.minecraft.util.math.BlockPos pos)
Check if a block can support
IBitAccess |
IBitAccess |
createBitItem(net.minecraft.item.ItemStack stack)
Create a bit access from an ItemStack, passing an empty ItemStack creates
an empty bit access, passing an invalid item returns null.
|
IBitBrush |
createBrush(net.minecraft.item.ItemStack stack)
Create a brush from an ItemStack, once created you can use it many times.
|
IBitBrush |
createBrushFromState(net.minecraft.block.state.IBlockState state)
Create a brush from a state, once created you can use it many times.
|
void |
endUndoGroup(net.minecraft.entity.player.EntityPlayer player)
Ends a previously running undo group, must be called after starting an
undo group, closing a group without opening one will result in a runtime
exception.
|
IBitAccess |
getBitAccess(net.minecraft.world.World world,
net.minecraft.util.math.BlockPos pos)
Get Access to the bits for a given block.
|
IBitBag |
getBitbag(net.minecraft.item.ItemStack stack)
Access the contents of a bitbag as if it was a normal
IItemHandler with a few extra features. |
net.minecraft.item.ItemStack |
getBitItem(net.minecraft.block.state.IBlockState defaultState)
Get an ItemStack for the bit type of the state...
|
IBitLocation |
getBitPos(float hitX,
float hitY,
float hitZ,
net.minecraft.util.EnumFacing side,
net.minecraft.util.math.BlockPos pos,
boolean placement)
Convert ray trace information into bit location information, note that
the block position can change, be aware.
|
ItemType |
getItemType(net.minecraft.item.ItemStack stack)
Determine the Item Type of the item in an ItemStack and return it.
|
net.minecraft.client.settings.KeyBinding |
getKeyBinding(ModKeyBinding modKeyBinding)
Get a C&B key binding.
|
<T> T |
getParameter(ParameterType<T> which)
Example: int stackSize =
api.getParameter(IntegerParam.BIT_BAG_MAX_STACK_SIZE );
|
void |
giveBitToPlayer(net.minecraft.entity.player.EntityPlayer player,
net.minecraft.item.ItemStack stack,
net.minecraft.util.math.Vec3d spawnPos)
Give a bit to a player, it will end up in their inventory, a bag, or if
there is no where to put it, on the ground.
|
boolean |
isBlockChiseled(net.minecraft.world.World world,
net.minecraft.util.math.BlockPos pos)
is this block already chiseled?
|
@Nullable ItemType getItemType(net.minecraft.item.ItemStack stack)
stack
- boolean canBeChiseled(net.minecraft.world.World world, net.minecraft.util.math.BlockPos pos)
IBitAccess
world
- pos
- boolean isBlockChiseled(net.minecraft.world.World world, net.minecraft.util.math.BlockPos pos)
world
- pos
- IBitAccess getBitAccess(net.minecraft.world.World world, net.minecraft.util.math.BlockPos pos) throws APIExceptions.CannotBeChiseled
world
- pos
- IBitAccess
for the specified location.APIExceptions.CannotBeChiseled
- when the location cannot support bits, or if the parameters
are invalid.@Nullable IBitAccess createBitItem(net.minecraft.item.ItemStack stack)
IBitAccess
for an ItemStack.IBitBrush createBrush(net.minecraft.item.ItemStack stack) throws APIExceptions.InvalidBitItem
bitItem
- APIExceptions.InvalidBitItem
IBitBrush createBrushFromState(@Nullable net.minecraft.block.state.IBlockState state) throws APIExceptions.InvalidBitItem
state
- APIExceptions.InvalidBitItem
IBitLocation getBitPos(float hitX, float hitY, float hitZ, net.minecraft.util.EnumFacing side, net.minecraft.util.math.BlockPos pos, boolean placement)
hitX
- hitY
- hitZ
- side
- pos
- placement
- net.minecraft.item.ItemStack getBitItem(net.minecraft.block.state.IBlockState defaultState) throws APIExceptions.InvalidBitItem
defaultState
- APIExceptions.InvalidBitItem
void giveBitToPlayer(net.minecraft.entity.player.EntityPlayer player, net.minecraft.item.ItemStack stack, net.minecraft.util.math.Vec3d spawnPos)
player
- player to give bits to.itemstack
- bits to store.spawnPos
- if null defaults to the players position, absolute position of
where to spawn bits, should be in the block near where they
are being extracted from.@Nullable IBitBag getBitbag(net.minecraft.item.ItemStack stack)
IItemHandler
with a few extra features.<T> T getParameter(ParameterType<T> which)
which
- - refer to ParameterType for list of possible values.void beginUndoGroup(net.minecraft.entity.player.EntityPlayer player)
void endUndoGroup(net.minecraft.entity.player.EntityPlayer player)
void addEquivilantMaterial(net.minecraft.block.material.Material newMaterial, net.minecraft.block.material.Material target)
newMaterial
- your custom materialtarget
- default MC Material C&B knows about.net.minecraft.client.settings.KeyBinding getKeyBinding(ModKeyBinding modKeyBinding)
modKeyBinding
- the ModKeyBinding
value that denotes the C&B key
binding to return.KeyBinding
.