Search in sources :

Example 21 with Tuple

use of com.minecolonies.api.util.Tuple in project minecolonies by Minecolonies.

the class EntityAIConcreteMixer method mixConcrete.

/**
 * Mix the concrete and mine it.
 *
 * @return next state.
 */
private IAIState mixConcrete() {
    int slot = -1;
    if (currentRequest != null && currentRecipeStorage != null) {
        ItemStack inputStack = currentRecipeStorage.getCleanedInput().get(0).getItemStack();
        if (CONCRETE.test(inputStack)) {
            slot = InventoryUtils.findFirstSlotInItemHandlerWith(worker.getInventoryCitizen(), s -> ItemStackUtils.compareItemStacksIgnoreStackSize(s, inputStack));
        } else {
            return START_WORKING;
        }
    } else {
        slot = InventoryUtils.findFirstSlotInItemHandlerWith(worker.getInventoryCitizen(), CONCRETE);
    }
    if (slot != -1) {
        final ItemStack stack = worker.getInventoryCitizen().getStackInSlot(slot);
        final Block block = ((BlockItem) stack.getItem()).getBlock();
        final BlockPos posToPlace = building.getBlockToPlace();
        if (posToPlace != null) {
            if (walkToBlock(posToPlace)) {
                walkTo = posToPlace;
                return START_WORKING;
            }
            walkTo = null;
            if (InventoryUtils.attemptReduceStackInItemHandler(worker.getInventoryCitizen(), stack, 1)) {
                world.setBlock(posToPlace, block.defaultBlockState().updateShape(Direction.DOWN, block.defaultBlockState(), world, posToPlace, posToPlace), 0x03);
            }
            return START_WORKING;
        }
    }
    final BlockPos pos = building.getBlockToMine();
    if (pos != null) {
        if (walkToBlock(pos)) {
            walkTo = pos;
            return START_WORKING;
        }
        walkTo = null;
        if (mineBlock(pos)) {
            this.resetActionsDone();
            return CRAFT;
        }
        return START_WORKING;
    }
    if (InventoryUtils.hasItemInItemHandler(building.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY).orElseGet(null), CONCRETE)) {
        needsCurrently = new Tuple<>(CONCRETE, STACKSIZE);
        return GATHERING_REQUIRED_MATERIALS;
    } else {
        incrementActionsDone();
    }
    return START_WORKING;
}
Also used : ItemStackUtils(com.minecolonies.api.util.ItemStackUtils) STACKSIZE(com.minecolonies.api.util.constant.Constants.STACKSIZE) Predicate(java.util.function.Predicate) RequestState(com.minecolonies.api.colony.requestsystem.request.RequestState) BlockPos(net.minecraft.util.math.BlockPos) Direction(net.minecraft.util.Direction) AIWorkerState(com.minecolonies.api.entity.ai.statemachine.states.AIWorkerState) ItemStack(net.minecraft.item.ItemStack) Tuple(com.minecolonies.api.util.Tuple) JobConcreteMixer(com.minecolonies.coremod.colony.jobs.JobConcreteMixer) Block(net.minecraft.block.Block) IAIState(com.minecolonies.api.entity.ai.statemachine.states.IAIState) BlockItem(net.minecraft.item.BlockItem) InventoryUtils(com.minecolonies.api.util.InventoryUtils) ConcretePowderBlock(net.minecraft.block.ConcretePowderBlock) CapabilityItemHandler(net.minecraftforge.items.CapabilityItemHandler) AbstractEntityAICrafting(com.minecolonies.coremod.entity.ai.basic.AbstractEntityAICrafting) BuildingConcreteMixer(com.minecolonies.coremod.colony.buildings.workerbuildings.BuildingConcreteMixer) NotNull(org.jetbrains.annotations.NotNull) Block(net.minecraft.block.Block) ConcretePowderBlock(net.minecraft.block.ConcretePowderBlock) BlockPos(net.minecraft.util.math.BlockPos) ItemStack(net.minecraft.item.ItemStack) BlockItem(net.minecraft.item.BlockItem)

Example 22 with Tuple

use of com.minecolonies.api.util.Tuple in project minecolonies by Minecolonies.

the class AbstractWindowWorkerModuleBuilding method onOpened.

@Override
public void onOpened() {
    super.onOpened();
    final List<Tuple<String, Integer>> workers = new ArrayList<>();
    for (final WorkerBuildingModuleView module : buildingView.getModuleViews(WorkerBuildingModuleView.class)) {
        for (final int worker : module.getAssignedCitizens()) {
            workers.add(new Tuple<>(new TranslationTextComponent(module.getJobEntry().getTranslationKey()).getString(), worker));
        }
    }
    if (findPaneByID(LIST_WORKERS) != null) {
        ScrollingList workerList = findPaneOfTypeByID(LIST_WORKERS, ScrollingList.class);
        workerList.setDataProvider(new ScrollingList.DataProvider() {

            @Override
            public int getElementCount() {
                return workers.size();
            }

            @Override
            public void updateElement(final int index, @NotNull final Pane rowPane) {
                final ICitizenDataView worker = building.getColony().getCitizen(workers.get(index).getB());
                if (worker != null) {
                    rowPane.findPaneOfTypeByID(LABEL_WORKERNAME, Text.class).setText(new TranslationTextComponent(workers.get(index).getA()).getString() + ": " + worker.getName());
                }
            }
        });
    }
    updatePriorityLabel();
}
Also used : ArrayList(java.util.ArrayList) TranslationTextComponent(net.minecraft.util.text.TranslationTextComponent) ICitizenDataView(com.minecolonies.api.colony.ICitizenDataView) WorkerBuildingModuleView(com.minecolonies.coremod.colony.buildings.moduleviews.WorkerBuildingModuleView) ScrollingList(com.ldtteam.blockout.views.ScrollingList) Pane(com.ldtteam.blockout.Pane) Tuple(com.minecolonies.api.util.Tuple)

Example 23 with Tuple

use of com.minecolonies.api.util.Tuple in project minecolonies by Minecolonies.

the class EntityAIWorkFarmer method prepareForFarming.

/**
 * Prepares the farmer for farming. Also requests the tools and checks if the farmer has sufficient fields.
 *
 * @return the next IAIState
 */
@NotNull
private IAIState prepareForFarming() {
    if (building == null || building.getBuildingLevel() < 1) {
        return PREPARING;
    }
    if (!job.getTaskQueue().isEmpty() || getActionsDoneUntilDumping() <= job.getActionsDone()) {
        return START_WORKING;
    }
    worker.getCitizenData().setVisibleStatus(VisibleCitizenStatus.WORKING);
    final FarmerFieldModule module = building.getFirstModuleOccurance(FarmerFieldModule.class);
    module.syncWithColony(world);
    if (module.getFarmerFields().size() < building.getBuildingLevel() && !module.assignManually()) {
        searchAndAddFields();
    }
    if (module.getFarmerFields().size() == building.getMaxBuildingLevel()) {
        AdvancementUtils.TriggerAdvancementPlayersForColony(building.getColony(), AdvancementTriggers.MAX_FIELDS::trigger);
    }
    final int amountOfCompostInBuilding = InventoryUtils.hasBuildingEnoughElseCount(building, this::isCompost, 1);
    final int amountOfCompostInInv = InventoryUtils.getItemCountInItemHandler(worker.getInventoryCitizen(), this::isCompost);
    if (amountOfCompostInBuilding + amountOfCompostInInv <= 0) {
        if (building.requestFertilizer() && !building.hasWorkerOpenRequestsOfType(worker.getCitizenData().getId(), TypeToken.of(StackList.class))) {
            final List<ItemStack> compostAbleItems = new ArrayList<>();
            compostAbleItems.add(new ItemStack(ModItems.compost, 1));
            compostAbleItems.add(new ItemStack(Items.BONE_MEAL, 1));
            worker.getCitizenData().createRequestAsync(new StackList(compostAbleItems, RequestSystemTranslationConstants.REQUEST_TYPE_FERTILIZER, STACKSIZE, 1));
        }
    } else if (amountOfCompostInInv <= 0 && amountOfCompostInBuilding > 0) {
        needsCurrently = new Tuple<>(this::isCompost, STACKSIZE);
        return GATHERING_REQUIRED_MATERIALS;
    }
    if (module.hasNoFields()) {
        if (worker.getCitizenData() != null) {
            worker.getCitizenData().triggerInteraction(new StandardInteraction(new TranslationTextComponent(NO_FREE_FIELDS), ChatPriority.BLOCKING));
        }
        worker.getCitizenData().setIdleAtJob(true);
        return PREPARING;
    }
    worker.getCitizenData().setIdleAtJob(false);
    // If the farmer has no currentField and there is no field which needs work, check fields.
    if (module.getCurrentField() == null && module.getFieldToWorkOn(world) == null) {
        module.resetFields();
        return IDLE;
    }
    @Nullable final BlockPos currentField = module.getCurrentField();
    final TileEntity entity = world.getBlockEntity(currentField);
    if (entity instanceof ScarecrowTileEntity && ((ScarecrowTileEntity) entity).needsWork()) {
        if (((ScarecrowTileEntity) entity).getFieldStage() == ScarecrowFieldStage.PLANTED && checkIfShouldExecute((ScarecrowTileEntity) entity, pos -> this.findHarvestableSurface(pos) != null)) {
            return FARMER_HARVEST;
        } else if (((ScarecrowTileEntity) entity).getFieldStage() == ScarecrowFieldStage.HOED) {
            return canGoPlanting((ScarecrowTileEntity) entity, building);
        } else if (((ScarecrowTileEntity) entity).getFieldStage() == ScarecrowFieldStage.EMPTY && checkIfShouldExecute((ScarecrowTileEntity) entity, pos -> this.findHoeableSurface(pos, (ScarecrowTileEntity) entity) != null)) {
            return FARMER_HOE;
        }
        ((ScarecrowTileEntity) entity).nextState();
    } else {
        module.setCurrentField(null);
    }
    return PREPARING;
}
Also used : Tags(net.minecraftforge.common.Tags) ServerWorld(net.minecraft.world.server.ServerWorld) StackList(com.minecolonies.api.colony.requestsystem.requestable.StackList) Item(net.minecraft.item.Item) FarmerFieldModule(com.minecolonies.coremod.colony.buildings.modules.FarmerFieldModule) Compatibility(com.minecolonies.api.compatibility.Compatibility) AdvancementUtils(com.minecolonies.coremod.util.AdvancementUtils) Direction(net.minecraft.util.Direction) TranslationTextComponent(net.minecraft.util.text.TranslationTextComponent) PacketDistributor(net.minecraftforge.fml.network.PacketDistributor) Tuple(com.minecolonies.api.util.Tuple) IAIState(com.minecolonies.api.entity.ai.statemachine.states.IAIState) ModItems(com.minecolonies.api.items.ModItems) AITarget(com.minecolonies.api.entity.ai.statemachine.AITarget) Network(com.minecolonies.coremod.Network) NonNullList(net.minecraft.util.NonNullList) TICKS_SECOND(com.minecolonies.api.util.constant.Constants.TICKS_SECOND) Constants(com.minecolonies.api.util.constant.Constants) TranslationConstants(com.minecolonies.api.util.constant.TranslationConstants) STACKSIZE(com.minecolonies.api.util.constant.Constants.STACKSIZE) TOOL_LEVEL_WOOD_OR_GOLD(com.minecolonies.api.util.constant.ToolLevelConstants.TOOL_LEVEL_WOOD_OR_GOLD) JobFarmer(com.minecolonies.coremod.colony.jobs.JobFarmer) Predicate(java.util.function.Predicate) LootParameters(net.minecraft.loot.LootParameters) ChatPriority(com.minecolonies.api.colony.interactionhandling.ChatPriority) StandardInteraction(com.minecolonies.coremod.colony.interactionhandling.StandardInteraction) CompostParticleMessage(com.minecolonies.coremod.network.messages.client.CompostParticleMessage) Nullable(org.jetbrains.annotations.Nullable) AbstractEntityCitizen(com.minecolonies.api.entity.citizen.AbstractEntityCitizen) List(java.util.List) BlockItem(net.minecraft.item.BlockItem) BlockScarecrow(com.minecolonies.coremod.blocks.BlockScarecrow) NotNull(org.jetbrains.annotations.NotNull) ScarecrowTileEntity(com.minecolonies.coremod.tileentities.ScarecrowTileEntity) BLOCK_BREAK_SOUND_RANGE(com.minecolonies.api.util.constant.CitizenConstants.BLOCK_BREAK_SOUND_RANGE) BuildingFarmer(com.minecolonies.coremod.colony.buildings.workerbuildings.BuildingFarmer) ItemStackUtils(com.minecolonies.api.util.ItemStackUtils) TypeToken(com.google.common.reflect.TypeToken) PosBasedInteraction(com.minecolonies.coremod.colony.interactionhandling.PosBasedInteraction) ArrayList(java.util.ArrayList) ScarecrowFieldStage(com.minecolonies.api.tileentities.ScarecrowFieldStage) ItemStack(net.minecraft.item.ItemStack) LootContext(net.minecraft.loot.LootContext) RequestSystemTranslationConstants(com.minecolonies.api.util.constant.translation.RequestSystemTranslationConstants) net.minecraft.block(net.minecraft.block) AbstractEntityAICrafting(com.minecolonies.coremod.entity.ai.basic.AbstractEntityAICrafting) Hand(net.minecraft.util.Hand) VisibleCitizenStatus(com.minecolonies.api.entity.citizen.VisibleCitizenStatus) AbstractScarecrowTileEntity(com.minecolonies.api.tileentities.AbstractScarecrowTileEntity) BlockPos(net.minecraft.util.math.BlockPos) Items(net.minecraft.item.Items) AIWorkerState(com.minecolonies.api.entity.ai.statemachine.states.AIWorkerState) FARMING(com.minecolonies.api.research.util.ResearchConstants.FARMING) AdvancementTriggers(com.minecolonies.api.advancements.AdvancementTriggers) InventoryUtils(com.minecolonies.api.util.InventoryUtils) ResourceLocation(net.minecraft.util.ResourceLocation) IColony(com.minecolonies.api.colony.IColony) TileEntity(net.minecraft.tileentity.TileEntity) ToolType(com.minecolonies.api.util.constant.ToolType) StandardInteraction(com.minecolonies.coremod.colony.interactionhandling.StandardInteraction) ArrayList(java.util.ArrayList) StackList(com.minecolonies.api.colony.requestsystem.requestable.StackList) FarmerFieldModule(com.minecolonies.coremod.colony.buildings.modules.FarmerFieldModule) ScarecrowTileEntity(com.minecolonies.coremod.tileentities.ScarecrowTileEntity) AbstractScarecrowTileEntity(com.minecolonies.api.tileentities.AbstractScarecrowTileEntity) ScarecrowTileEntity(com.minecolonies.coremod.tileentities.ScarecrowTileEntity) AbstractScarecrowTileEntity(com.minecolonies.api.tileentities.AbstractScarecrowTileEntity) TileEntity(net.minecraft.tileentity.TileEntity) TranslationTextComponent(net.minecraft.util.text.TranslationTextComponent) BlockPos(net.minecraft.util.math.BlockPos) ItemStack(net.minecraft.item.ItemStack) Tuple(com.minecolonies.api.util.Tuple) Nullable(org.jetbrains.annotations.Nullable) NotNull(org.jetbrains.annotations.NotNull)

Example 24 with Tuple

use of com.minecolonies.api.util.Tuple in project minecolonies by Minecolonies.

the class EntityAIWorkPlanter method checkSoil.

/**
 * Check the selected soil on what to do.
 *
 * @return next state to go to.
 */
private IAIState checkSoil() {
    if (plantableSoilPos == null) {
        return START_WORKING;
    }
    final BuildingPlantation plantation = building;
    final List<Item> availablePlants = plantation.getAvailablePlants();
    if (isItemPositionAir(plantableSoilPos)) {
        final Item currentItem = plantableSoilPos.getCombination().getItem();
        final ItemStack currentStack = new ItemStack(currentItem);
        if (!availablePlants.contains(currentItem)) {
            return START_WORKING;
        }
        final int plantInInv = InventoryUtils.getItemCountInItemHandler((worker.getInventoryCitizen()), itemStack -> itemStack.sameItem(currentStack));
        final int plantInBuilding = InventoryUtils.getCountFromBuilding(building, itemStack -> itemStack.sameItem(currentStack));
        if (plantInInv + plantInBuilding <= 0) {
            requestPlantable(currentItem);
            return START_WORKING;
        }
        if (plantInInv == 0 && plantInBuilding > 0) {
            needsCurrently = new Tuple<>(itemStack -> itemStack.sameItem(currentStack), Math.min(plantInBuilding, PLANT_TO_REQUEST));
            return GATHERING_REQUIRED_MATERIALS;
        }
        return PLANTATION_PLANT;
    } else {
        if (positionHasInvalidBlock(plantableSoilPos)) {
            return PLANTATION_CLEAR_OBSTACLE;
        }
        if (isSufficientHeight(plantableSoilPos) || !availablePlants.contains(plantableSoilPos.getCombination().getItem())) {
            return PLANTATION_FARM;
        }
    }
    return START_WORKING;
}
Also used : BuildingPlantation(com.minecolonies.coremod.colony.buildings.workerbuildings.BuildingPlantation) TICKS_20(com.minecolonies.api.util.constant.CitizenConstants.TICKS_20) BuildingPlantation(com.minecolonies.coremod.colony.buildings.workerbuildings.BuildingPlantation) Item(net.minecraft.item.Item) AirBlock(net.minecraft.block.AirBlock) AxisAlignedBB(net.minecraft.util.math.AxisAlignedBB) Level(org.apache.logging.log4j.Level) ItemStack(net.minecraft.item.ItemStack) AbstractAdvancedPathNavigate(com.minecolonies.api.entity.pathfinding.AbstractAdvancedPathNavigate) Tuple(com.minecolonies.api.util.Tuple) Block(net.minecraft.block.Block) IAIState(com.minecolonies.api.entity.ai.statemachine.states.IAIState) AbstractEntityAICrafting(com.minecolonies.coremod.entity.ai.basic.AbstractEntityAICrafting) AITarget(com.minecolonies.api.entity.ai.statemachine.AITarget) Log(com.minecolonies.api.util.Log) CitizenConstants(com.minecolonies.api.util.constant.CitizenConstants) Stack(com.minecolonies.api.colony.requestsystem.requestable.Stack) JobPlanter(com.minecolonies.coremod.colony.jobs.JobPlanter) VisibleCitizenStatus(com.minecolonies.api.entity.citizen.VisibleCitizenStatus) BlockPos(net.minecraft.util.math.BlockPos) AIWorkerState(com.minecolonies.api.entity.ai.statemachine.states.AIWorkerState) DEFAULT_SPEED(com.minecolonies.api.util.constant.Constants.DEFAULT_SPEED) List(java.util.List) BlockUtils(com.ldtteam.structurize.util.BlockUtils) InventoryUtils(com.minecolonies.api.util.InventoryUtils) ItemEntity(net.minecraft.entity.item.ItemEntity) NotNull(org.jetbrains.annotations.NotNull) Item(net.minecraft.item.Item) ItemStack(net.minecraft.item.ItemStack)

Example 25 with Tuple

use of com.minecolonies.api.util.Tuple in project minecolonies by Minecolonies.

the class CitizenDataView method deserialize.

@Override
public void deserialize(@NotNull final PacketBuffer buf) {
    name = buf.readUtf(32767);
    female = buf.readBoolean();
    entityId = buf.readInt();
    paused = buf.readBoolean();
    isChild = buf.readBoolean();
    homeBuilding = buf.readBoolean() ? buf.readBlockPos() : null;
    workBuilding = buf.readBoolean() ? buf.readBlockPos() : null;
    // Attributes
    health = buf.readFloat();
    maxHealth = buf.readFloat();
    saturation = buf.readDouble();
    happiness = buf.readDouble();
    citizenSkillHandler.read(buf.readNbt());
    job = buf.readUtf(32767);
    colonyId = buf.readInt();
    final CompoundNBT compound = buf.readNbt();
    inventory = new InventoryCitizen(this.name, true);
    final ListNBT ListNBT = compound.getList("inventory", 10);
    this.inventory.read(ListNBT);
    this.inventory.setHeldItem(Hand.MAIN_HAND, compound.getInt(TAG_HELD_ITEM_SLOT));
    this.inventory.setHeldItem(Hand.OFF_HAND, compound.getInt(TAG_OFFHAND_HELD_ITEM_SLOT));
    position = buf.readBlockPos();
    citizenChatOptions.clear();
    final int size = buf.readInt();
    for (int i = 0; i < size; i++) {
        final CompoundNBT compoundNBT = buf.readNbt();
        final ServerCitizenInteraction handler = (ServerCitizenInteraction) MinecoloniesAPIProxy.getInstance().getInteractionResponseHandlerDataManager().createFrom(this, compoundNBT);
        citizenChatOptions.put(handler.getInquiry(), handler);
    }
    sortedInteractions = citizenChatOptions.values().stream().sorted(Comparator.comparingInt(e -> e.getPriority().getPriority())).collect(Collectors.toList());
    citizenHappinessHandler.read(buf.readNbt());
    int statusindex = buf.readInt();
    statusIcon = statusindex >= 0 ? VisibleCitizenStatus.getForId(statusindex) : null;
    if (buf.readBoolean()) {
        final IColonyView colonyView = IColonyManager.getInstance().getColonyView(colonyId, Minecraft.getInstance().level.dimension());
        jobView = IJobDataManager.getInstance().createViewFrom(colonyView, this, buf);
    } else {
        jobView = null;
    }
    children.clear();
    siblings.clear();
    partner = buf.readInt();
    final int siblingsSize = buf.readInt();
    for (int i = 0; i < siblingsSize; i++) {
        siblings.add(buf.readInt());
    }
    final int childrenSize = buf.readInt();
    for (int i = 0; i < childrenSize; i++) {
        children.add(buf.readInt());
    }
    final String parentA = buf.readUtf();
    final String parentB = buf.readUtf();
    parents = new Tuple<>(parentA, parentB);
}
Also used : java.util(java.util) Suppression(com.minecolonies.api.util.constant.Suppression) CompoundNBT(net.minecraft.nbt.CompoundNBT) ITextComponent(net.minecraft.util.text.ITextComponent) MinecoloniesAPIProxy(com.minecolonies.api.MinecoloniesAPIProxy) ICitizenSkillHandler(com.minecolonies.api.entity.citizen.citizenhandlers.ICitizenSkillHandler) Tuple(com.minecolonies.api.util.Tuple) TAG_OFFHAND_HELD_ITEM_SLOT(com.minecolonies.api.util.constant.NbtTagConstants.TAG_OFFHAND_HELD_ITEM_SLOT) Minecraft(net.minecraft.client.Minecraft) IJobDataManager(com.minecolonies.api.colony.jobs.registry.IJobDataManager) IInteractionResponseHandler(com.minecolonies.api.colony.interactionhandling.IInteractionResponseHandler) Hand(net.minecraft.util.Hand) CitizenSkillHandler(com.minecolonies.coremod.entity.citizen.citizenhandlers.CitizenSkillHandler) Constants(com.minecolonies.api.util.constant.Constants) ListNBT(net.minecraft.nbt.ListNBT) IColonyView(com.minecolonies.api.colony.IColonyView) ICitizenHappinessHandler(com.minecolonies.api.entity.citizen.citizenhandlers.ICitizenHappinessHandler) IColonyManager(com.minecolonies.api.colony.IColonyManager) VisibleCitizenStatus(com.minecolonies.api.entity.citizen.VisibleCitizenStatus) ICitizenDataView(com.minecolonies.api.colony.ICitizenDataView) ChatPriority(com.minecolonies.api.colony.interactionhandling.ChatPriority) BlockPos(net.minecraft.util.math.BlockPos) Collectors(java.util.stream.Collectors) Nullable(org.jetbrains.annotations.Nullable) InventoryCitizen(com.minecolonies.api.inventory.InventoryCitizen) IJobView(com.minecolonies.api.colony.jobs.IJobView) ResourceLocation(net.minecraft.util.ResourceLocation) ServerCitizenInteraction(com.minecolonies.coremod.colony.interactionhandling.ServerCitizenInteraction) NotNull(org.jetbrains.annotations.NotNull) CitizenHappinessHandler(com.minecolonies.coremod.entity.citizen.citizenhandlers.CitizenHappinessHandler) PacketBuffer(net.minecraft.network.PacketBuffer) ListNBT(net.minecraft.nbt.ListNBT) CompoundNBT(net.minecraft.nbt.CompoundNBT) ServerCitizenInteraction(com.minecolonies.coremod.colony.interactionhandling.ServerCitizenInteraction) InventoryCitizen(com.minecolonies.api.inventory.InventoryCitizen) IColonyView(com.minecolonies.api.colony.IColonyView)

Aggregations

Tuple (com.minecolonies.api.util.Tuple)34 BlockPos (net.minecraft.util.math.BlockPos)22 ItemStack (net.minecraft.item.ItemStack)20 TranslationTextComponent (net.minecraft.util.text.TranslationTextComponent)20 NotNull (org.jetbrains.annotations.NotNull)18 IAIState (com.minecolonies.api.entity.ai.statemachine.states.IAIState)14 AIWorkerState (com.minecolonies.api.entity.ai.statemachine.states.AIWorkerState)12 InventoryUtils (com.minecolonies.api.util.InventoryUtils)12 ItemStackUtils (com.minecolonies.api.util.ItemStackUtils)12 ItemStorage (com.minecolonies.api.crafting.ItemStorage)10 AITarget (com.minecolonies.api.entity.ai.statemachine.AITarget)10 ArrayList (java.util.ArrayList)10 List (java.util.List)10 Predicate (java.util.function.Predicate)10 Hand (net.minecraft.util.Hand)10 TypeToken (com.google.common.reflect.TypeToken)8 ICitizenDataView (com.minecolonies.api.colony.ICitizenDataView)8 ChatPriority (com.minecolonies.api.colony.interactionhandling.ChatPriority)8 RequestState (com.minecolonies.api.colony.requestsystem.request.RequestState)8 StackList (com.minecolonies.api.colony.requestsystem.requestable.StackList)8