public class ChiselAndBitsAPI extends java.lang.Object implements IChiselAndBitsAPI
Constructor and Description |
---|
ChiselAndBitsAPI() |
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 state)
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.
|
java.lang.Object |
getParameter(ParameterType 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?
|
public void addEquivilantMaterial(net.minecraft.block.material.Material newMaterial, net.minecraft.block.material.Material target)
IChiselAndBitsAPI
addEquivilantMaterial
in interface IChiselAndBitsAPI
newMaterial
- your custom materialtarget
- default MC Material C&B knows about.public boolean canBeChiseled(net.minecraft.world.World world, net.minecraft.util.math.BlockPos pos)
IChiselAndBitsAPI
IBitAccess
canBeChiseled
in interface IChiselAndBitsAPI
public boolean isBlockChiseled(net.minecraft.world.World world, net.minecraft.util.math.BlockPos pos)
IChiselAndBitsAPI
isBlockChiseled
in interface IChiselAndBitsAPI
public IBitAccess getBitAccess(net.minecraft.world.World world, net.minecraft.util.math.BlockPos pos) throws APIExceptions.CannotBeChiseled
IChiselAndBitsAPI
getBitAccess
in interface IChiselAndBitsAPI
IBitAccess
for the specified location.APIExceptions.CannotBeChiseled
- when the location cannot support bits, or if the parameters
are invalid.public IBitBrush createBrush(net.minecraft.item.ItemStack stack) throws APIExceptions.InvalidBitItem
IChiselAndBitsAPI
createBrush
in interface IChiselAndBitsAPI
APIExceptions.InvalidBitItem
public IBitLocation getBitPos(float hitX, float hitY, float hitZ, net.minecraft.util.EnumFacing side, net.minecraft.util.math.BlockPos pos, boolean placement)
IChiselAndBitsAPI
getBitPos
in interface IChiselAndBitsAPI
public ItemType getItemType(net.minecraft.item.ItemStack stack)
IChiselAndBitsAPI
getItemType
in interface IChiselAndBitsAPI
public IBitAccess createBitItem(net.minecraft.item.ItemStack stack)
IChiselAndBitsAPI
createBitItem
in interface IChiselAndBitsAPI
IBitAccess
for an ItemStack.public IBitBrush createBrushFromState(net.minecraft.block.state.IBlockState state) throws APIExceptions.InvalidBitItem
IChiselAndBitsAPI
createBrushFromState
in interface IChiselAndBitsAPI
APIExceptions.InvalidBitItem
public net.minecraft.item.ItemStack getBitItem(net.minecraft.block.state.IBlockState state) throws APIExceptions.InvalidBitItem
IChiselAndBitsAPI
getBitItem
in interface IChiselAndBitsAPI
APIExceptions.InvalidBitItem
public void giveBitToPlayer(net.minecraft.entity.player.EntityPlayer player, net.minecraft.item.ItemStack stack, net.minecraft.util.math.Vec3d spawnPos)
IChiselAndBitsAPI
giveBitToPlayer
in interface IChiselAndBitsAPI
player
- player to give bits to.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.public IBitBag getBitbag(net.minecraft.item.ItemStack stack)
IChiselAndBitsAPI
IItemHandler
with a few extra features.getBitbag
in interface IChiselAndBitsAPI
public void beginUndoGroup(net.minecraft.entity.player.EntityPlayer player)
IChiselAndBitsAPI
beginUndoGroup
in interface IChiselAndBitsAPI
public void endUndoGroup(net.minecraft.entity.player.EntityPlayer player)
IChiselAndBitsAPI
endUndoGroup
in interface IChiselAndBitsAPI
public net.minecraft.client.settings.KeyBinding getKeyBinding(ModKeyBinding modKeyBinding)
IChiselAndBitsAPI
getKeyBinding
in interface IChiselAndBitsAPI
modKeyBinding
- the ModKeyBinding
value that denotes the C&B key
binding to return.KeyBinding
.public java.lang.Object getParameter(ParameterType which)
IChiselAndBitsAPI
getParameter
in interface IChiselAndBitsAPI
which
- - refer to ParameterType for list of possible values.