use of com.minecolonies.coremod.colony.interactionhandling.PosBasedInteraction in project minecolonies by ldtteam.
the class AbstractEntityAIBasic method requestTool.
/**
* Request the appropriate tool for this block.
*
* @param target the blockstate to mine
* @param pos the pos to mine
*/
private void requestTool(@NotNull final BlockState target, final BlockPos pos) {
final IToolType toolType = WorkerUtil.getBestToolForBlock(target, target.getDestroySpeed(world, pos));
final int required = WorkerUtil.getCorrectHarvestLevelForBlock(target);
if (getOwnBuilding().getMaxToolLevel() < required && worker.getCitizenData() != null) {
worker.getCitizenData().triggerInteraction(new PosBasedInteraction(new TranslationTextComponent(BUILDING_LEVEL_TOO_LOW, new ItemStack(target.getBlock()).getHoverName(), pos.getX(), pos.getY(), pos.getZ()), ChatPriority.IMPORTANT, new TranslationTextComponent(BUILDING_LEVEL_TOO_LOW), pos));
}
updateToolFlag(toolType, required);
}
Aggregations