public class BlockBreaker
extends java.lang.Object
This mod is used to compute and update the break status on the mod.
| Modifier and Type | Field and Description |
|---|---|
static float |
BASE_BREAK_FACTOR |
| Constructor and Description |
|---|
BlockBreaker(net.minecraft.entity.Entity entity,
double digSpeed,
net.minecraft.util.math.BlockPos pos,
double minSeconds)
Constructs a block breaker that used to breaks blocks over time.
|
| Modifier and Type | Method and Description |
|---|---|
static double |
breakSeconds(net.minecraft.world.World world,
double digSpeed,
net.minecraft.util.math.BlockPos pos)
Returns the number of seconds needed to break this block based on the
block and digSpeed.
|
void |
reset()
Reset the break progress on this block.
|
int |
ticksLeft() |
boolean |
tickUpdate()
Updated the break status of the block.
|
java.lang.String |
toString() |
public static final float BASE_BREAK_FACTOR
public BlockBreaker(net.minecraft.entity.Entity entity,
double digSpeed,
net.minecraft.util.math.BlockPos pos,
double minSeconds)
entity - Entity doing the breaking.digSpeed - The speed of breaking. See breakSeconds(World, double, BlockPos) for details.pos - The block to break.minSeconds - The minimum amount of seconds to break.public static double breakSeconds(net.minecraft.world.World world,
double digSpeed,
net.minecraft.util.math.BlockPos pos)
A stone pickaxe takes about 1 second to break a stone block.
world - The worlddigSpeed - Dig speed of the digger. Should combine entity dig speed
and the work speed factor.pos - The pos of the block to dig.public int ticksLeft()
public boolean tickUpdate()
public void reset()
public java.lang.String toString()
toString in class java.lang.Object