Class ToolCommons
java.lang.Object
vazkii.botania.common.item.equipment.tool.ToolCommons
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic intdamageItemIfPossible(net.minecraft.world.item.ItemStack stack, int amount, net.minecraft.world.entity.LivingEntity entity, int manaPerDamage) Consumes as much mana as possible, returning the amount of damage that couldn't be paid with manastatic intgetToolPriority(net.minecraft.world.item.ItemStack stack) static net.minecraft.world.phys.BlockHitResultraytraceFromEntity(net.minecraft.world.entity.Entity e, double distance, boolean fluids) static voidremoveBlocksInIteration(net.minecraft.world.entity.player.Player player, net.minecraft.world.item.ItemStack stack, net.minecraft.world.level.Level world, net.minecraft.core.BlockPos centerPos, net.minecraft.core.Vec3i startDelta, net.minecraft.core.Vec3i endDelta, Predicate<net.minecraft.world.level.block.state.BlockState> filter) static voidremoveBlockWithDrops(net.minecraft.world.entity.player.Player player, net.minecraft.world.item.ItemStack stack, net.minecraft.world.level.Level world, net.minecraft.core.BlockPos pos, Predicate<net.minecraft.world.level.block.state.BlockState> filter) NB: Cannot be called in a call chain leading from PlayerInteractionManager.tryHarvestBlock without additional protection likerecCallinremoveBlocksInIteration(net.minecraft.world.entity.player.Player, net.minecraft.world.item.ItemStack, net.minecraft.world.level.Level, net.minecraft.core.BlockPos, net.minecraft.core.Vec3i, net.minecraft.core.Vec3i, java.util.function.Predicate<net.minecraft.world.level.block.state.BlockState>)orRingOfLokiItem.breakOnAllCursors(net.minecraft.world.entity.player.Player, net.minecraft.world.item.ItemStack, net.minecraft.core.BlockPos, net.minecraft.core.Direction), since this method calls that method also and would lead to an infinite loop.
-
Constructor Details
-
ToolCommons
public ToolCommons()
-
-
Method Details
-
damageItemIfPossible
public static int damageItemIfPossible(net.minecraft.world.item.ItemStack stack, int amount, net.minecraft.world.entity.LivingEntity entity, int manaPerDamage) Consumes as much mana as possible, returning the amount of damage that couldn't be paid with mana -
removeBlocksInIteration
public static void removeBlocksInIteration(net.minecraft.world.entity.player.Player player, net.minecraft.world.item.ItemStack stack, net.minecraft.world.level.Level world, net.minecraft.core.BlockPos centerPos, net.minecraft.core.Vec3i startDelta, net.minecraft.core.Vec3i endDelta, Predicate<net.minecraft.world.level.block.state.BlockState> filter) -
removeBlockWithDrops
public static void removeBlockWithDrops(net.minecraft.world.entity.player.Player player, net.minecraft.world.item.ItemStack stack, net.minecraft.world.level.Level world, net.minecraft.core.BlockPos pos, Predicate<net.minecraft.world.level.block.state.BlockState> filter) NB: Cannot be called in a call chain leading from PlayerInteractionManager.tryHarvestBlock without additional protection likerecCallinremoveBlocksInIteration(net.minecraft.world.entity.player.Player, net.minecraft.world.item.ItemStack, net.minecraft.world.level.Level, net.minecraft.core.BlockPos, net.minecraft.core.Vec3i, net.minecraft.core.Vec3i, java.util.function.Predicate<net.minecraft.world.level.block.state.BlockState>)orRingOfLokiItem.breakOnAllCursors(net.minecraft.world.entity.player.Player, net.minecraft.world.item.ItemStack, net.minecraft.core.BlockPos, net.minecraft.core.Direction), since this method calls that method also and would lead to an infinite loop. -
getToolPriority
public static int getToolPriority(net.minecraft.world.item.ItemStack stack) -
raytraceFromEntity
public static net.minecraft.world.phys.BlockHitResult raytraceFromEntity(net.minecraft.world.entity.Entity e, double distance, boolean fluids)
-