Search in sources :

Example 41 with IAIState

use of com.minecolonies.api.entity.ai.statemachine.states.IAIState in project minecolonies by Minecolonies.

the class EntityAIWorkShepherd method decideWhatToDo.

@Override
public IAIState decideWhatToDo() {
    final IAIState result = super.decideWhatToDo();
    final List<SheepEntity> animals = new ArrayList<>(searchForAnimals());
    final SheepEntity shearingSheep = animals.stream().filter(sheepie -> !sheepie.isSheared() && !sheepie.isBaby()).findFirst().orElse(null);
    if (building.getSetting(BuildingShepherd.SHEARING).getValue() && result.equals(START_WORKING) && shearingSheep != null) {
        return SHEPHERD_SHEAR;
    }
    return result;
}
Also used : SheepEntity(net.minecraft.entity.passive.SheepEntity) IAIState(com.minecolonies.api.entity.ai.statemachine.states.IAIState) ArrayList(java.util.ArrayList)

Example 42 with IAIState

use of com.minecolonies.api.entity.ai.statemachine.states.IAIState in project minecolonies by Minecolonies.

the class EntityAIQuarrier method structureStep.

@Override
protected IAIState structureStep() {
    if (structurePlacer.getB().getStage() == null) {
        return PICK_UP_RESIDUALS;
    }
    if (InventoryUtils.isItemHandlerFull(worker.getInventoryCitizen())) {
        return INVENTORY_FULL;
    }
    worker.getCitizenStatusHandler().setLatestStatus(new TranslationTextComponent("com.minecolonies.coremod.status.building"));
    checkForExtraBuildingActions();
    // some things to do first! then we go to the actual phase!
    // Fill workFrom with the position from where the builder should build.
    // also ensure we are at that position.
    final BlockPos progress = getProgressPos() == null ? NULL_POS : getProgressPos().getA();
    final BlockPos worldPos = structurePlacer.getB().getProgressPosInWorld(progress);
    if (getProgressPos() != null) {
        structurePlacer.getB().setStage(getProgressPos().getB());
    }
    if (!progress.equals(NULL_POS) && !limitReached && (blockToMine == null ? !walkToConstructionSite(worldPos) : !walkToConstructionSite(blockToMine))) {
        return getState();
    }
    limitReached = false;
    final StructurePhasePlacementResult result;
    final StructurePlacer placer = structurePlacer.getA();
    switch(structurePlacer.getB().getStage()) {
        case BUILD_SOLID:
            result = placer.executeStructureStep(world, null, progress, StructurePlacer.Operation.BLOCK_PLACEMENT, () -> placer.getIterator().decrement(DONT_TOUCH_PREDICATE.or((info, pos, handler) -> !info.getBlockInfo().getState().getMaterial().isSolid() || isDecoItem(info.getBlockInfo().getState().getBlock()) || pos.getY() < worldPos.getY())), false);
            if (progress.getY() != -1 && result.getIteratorPos().getY() < progress.getY()) {
                structurePlacer.getB().nextStage();
                this.storeProgressPos(new BlockPos(0, progress.getY() + 1, 0), structurePlacer.getB().getStage());
            } else {
                this.storeProgressPos(result.getIteratorPos(), structurePlacer.getB().getStage());
            }
            break;
        case DECORATE:
            if (progress.getY() >= structurePlacer.getB().getBluePrint().getSizeY()) {
                structurePlacer.getB().nextStage();
                this.storeProgressPos(new BlockPos(structurePlacer.getB().getBluePrint().getSizeX(), progress.getY() - 1, structurePlacer.getB().getBluePrint().getSizeZ() - 1), structurePlacer.getB().getStage());
                return getState();
            }
            // not solid
            result = placer.executeStructureStep(world, null, progress, StructurePlacer.Operation.BLOCK_PLACEMENT, () -> placer.getIterator().increment(DONT_TOUCH_PREDICATE.or((info, pos, handler) -> (info.getBlockInfo().getState().getMaterial().isSolid() && !isDecoItem(info.getBlockInfo().getState().getBlock())) || pos.getY() > worldPos.getY())), false);
            if (result.getBlockResult().getResult() == BlockPlacementResult.Result.FINISHED) {
                structurePlacer.getB().nextStage();
                this.storeProgressPos(new BlockPos(structurePlacer.getB().getBluePrint().getSizeX(), progress.getY() - 1, structurePlacer.getB().getBluePrint().getSizeZ() - 1), structurePlacer.getB().getStage());
            } else if (progress.getY() != -1 && result.getIteratorPos().getY() > progress.getY()) {
                structurePlacer.getB().nextStage();
                this.storeProgressPos(new BlockPos(structurePlacer.getB().getBluePrint().getSizeX(), progress.getY() - 1, structurePlacer.getB().getBluePrint().getSizeZ() - 1), structurePlacer.getB().getStage());
            } else {
                this.storeProgressPos(result.getIteratorPos(), structurePlacer.getB().getStage());
            }
            break;
        case CLEAR:
        default:
            result = placer.executeStructureStep(world, null, progress, StructurePlacer.Operation.BLOCK_REMOVAL, () -> placer.getIterator().decrement((info, pos, handler) -> handler.getWorld().getBlockState(pos).getBlock() instanceof IBuilderUndestroyable || handler.getWorld().getBlockState(pos).getBlock() == Blocks.BEDROCK || handler.getWorld().getBlockState(pos).getBlock() instanceof AirBlock || info.getBlockInfo().getState().getBlock() == com.ldtteam.structurize.blocks.ModBlocks.blockFluidSubstitution.get() || !handler.getWorld().getBlockState(pos).getFluidState().isEmpty()), false);
            if (result.getBlockResult().getResult() == BlockPlacementResult.Result.FINISHED) {
                building.nextStage();
                building.setProgressPos(null, null);
                return COMPLETE_BUILD;
            } else if (progress.getY() != -1 && (result.getIteratorPos().getY() < progress.getY() || result.getBlockResult().getWorldPos().getY() < worldPos.getY())) {
                structurePlacer.getB().setStage(BUILD_SOLID);
                this.storeProgressPos(new BlockPos(structurePlacer.getB().getBluePrint().getSizeX(), progress.getY() - 1, structurePlacer.getB().getBluePrint().getSizeZ() - 1), structurePlacer.getB().getStage());
            } else {
                this.storeProgressPos(result.getIteratorPos(), structurePlacer.getB().getStage());
            }
            break;
    }
    if (result.getBlockResult().getResult() == BlockPlacementResult.Result.LIMIT_REACHED) {
        this.limitReached = true;
    }
    if (result.getBlockResult().getResult() == BlockPlacementResult.Result.MISSING_ITEMS) {
        if (hasListOfResInInvOrRequest(this, result.getBlockResult().getRequiredItems(), result.getBlockResult().getRequiredItems().size() > 1) == RECALC) {
            job.getWorkOrder().setRequested(false);
            return LOAD_STRUCTURE;
        }
        return NEEDS_ITEM;
    }
    if (result.getBlockResult().getResult() == BlockPlacementResult.Result.BREAK_BLOCK) {
        final BlockPos currentWorldPos = result.getBlockResult().getWorldPos();
        if (currentWorldPos.getY() < 5) {
            building.setProgressPos(null, null);
            return COMPLETE_BUILD;
        }
        blockToMine = currentWorldPos;
        return MINE_BLOCK;
    }
    if (MineColonies.getConfig().getServer().builderBuildBlockDelay.get() > 0) {
        final double decrease = 1 - worker.getCitizenColonyHandler().getColony().getResearchManager().getResearchEffects().getEffectStrength(BLOCK_PLACE_SPEED);
        setDelay((int) ((MineColonies.getConfig().getServer().builderBuildBlockDelay.get() * PROGRESS_MULTIPLIER / (getPlaceSpeedLevel() / 2 + PROGRESS_MULTIPLIER)) * decrease));
    }
    return getState();
}
Also used : StructurePlacer(com.ldtteam.structurize.placement.StructurePlacer) FluidState(net.minecraft.fluid.FluidState) BLOCK_PLACE_SPEED(com.minecolonies.api.research.util.ResearchConstants.BLOCK_PLACE_SPEED) SurfaceType(com.minecolonies.api.entity.pathfinding.SurfaceType) WorkerLoadOnlyStructureHandler(com.minecolonies.coremod.entity.ai.util.WorkerLoadOnlyStructureHandler) Structures(com.ldtteam.structurize.management.Structures) IBuilderUndestroyable(com.minecolonies.api.entity.ai.citizen.builder.IBuilderUndestroyable) Direction(net.minecraft.util.Direction) Mirror(net.minecraft.util.Mirror) TranslationTextComponent(net.minecraft.util.text.TranslationTextComponent) ItemStack(net.minecraft.item.ItemStack) RECALC(com.minecolonies.coremod.entity.ai.basic.AbstractEntityAIStructure.ItemCheckResult.RECALC) IAIState(com.minecolonies.api.entity.ai.statemachine.states.IAIState) net.minecraft.block(net.minecraft.block) AbstractBuildingStructureBuilder(com.minecolonies.coremod.colony.buildings.AbstractBuildingStructureBuilder) Hand(net.minecraft.util.Hand) AITarget(com.minecolonies.api.entity.ai.statemachine.AITarget) com.minecolonies.api.util(com.minecolonies.api.util) TICKS_SECOND(com.minecolonies.api.util.constant.Constants.TICKS_SECOND) StructurePhasePlacementResult(com.ldtteam.structurize.placement.StructurePhasePlacementResult) Fluids(net.minecraft.fluid.Fluids) JobQuarrier(com.minecolonies.coremod.colony.jobs.JobQuarrier) TranslationConstants(com.minecolonies.api.util.constant.TranslationConstants) BuildingMiner(com.minecolonies.coremod.colony.buildings.workerbuildings.BuildingMiner) BuildingStructureHandler(com.minecolonies.coremod.entity.ai.util.BuildingStructureHandler) AbstractEntityAIStructureWithWorkOrder(com.minecolonies.coremod.entity.ai.basic.AbstractEntityAIStructureWithWorkOrder) IColonyManager(com.minecolonies.api.colony.IColonyManager) VisibleCitizenStatus(com.minecolonies.api.entity.citizen.VisibleCitizenStatus) ChatPriority(com.minecolonies.api.colony.interactionhandling.ChatPriority) StandardInteraction(com.minecolonies.coremod.colony.interactionhandling.StandardInteraction) BlockPos(net.minecraft.util.math.BlockPos) NULL_POS(com.ldtteam.structurize.placement.AbstractBlueprintIterator.NULL_POS) WorkOrderMiner(com.minecolonies.coremod.colony.workorders.WorkOrderMiner) Items(net.minecraft.item.Items) AIWorkerState(com.minecolonies.api.entity.ai.statemachine.states.AIWorkerState) PROGRESS_MULTIPLIER(com.minecolonies.api.util.constant.CitizenConstants.PROGRESS_MULTIPLIER) PlacementSettings(com.ldtteam.structurize.util.PlacementSettings) Stage(com.minecolonies.coremod.entity.ai.util.BuildingStructureHandler.Stage) FILL_BLOCK(com.minecolonies.coremod.colony.buildings.workerbuildings.BuildingMiner.FILL_BLOCK) BlockPlacementResult(com.ldtteam.structurize.placement.BlockPlacementResult) MineColonies(com.minecolonies.coremod.MineColonies) IBuilding(com.minecolonies.api.colony.buildings.IBuilding) NotNull(org.jetbrains.annotations.NotNull) QuarryModule(com.minecolonies.coremod.colony.buildings.modules.QuarryModule) StructurePhasePlacementResult(com.ldtteam.structurize.placement.StructurePhasePlacementResult) StructurePlacer(com.ldtteam.structurize.placement.StructurePlacer) TranslationTextComponent(net.minecraft.util.text.TranslationTextComponent) BlockPos(net.minecraft.util.math.BlockPos) IBuilderUndestroyable(com.minecolonies.api.entity.ai.citizen.builder.IBuilderUndestroyable)

Example 43 with IAIState

use of com.minecolonies.api.entity.ai.statemachine.states.IAIState 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 44 with IAIState

use of com.minecolonies.api.entity.ai.statemachine.states.IAIState in project minecolonies by Minecolonies.

the class EntityAIWorkSifter method sift.

/**
 * The sifting process.
 *
 * @return the next AiState to go to.
 */
protected IAIState sift() {
    final BuildingSifter sifterBuilding = building;
    // Go idle if we can't do any more today
    if (sifterBuilding.getCurrentDailyQuantity() >= sifterBuilding.getMaxDailyQuantity()) {
        return IDLE;
    }
    if (walkToBuilding()) {
        return getState();
    }
    if (InventoryUtils.isItemHandlerFull(worker.getInventoryCitizen())) {
        return INVENTORY_FULL;
    }
    if (currentRecipeStorage == null) {
        final ICraftingBuildingModule module = building.getFirstModuleOccurance(BuildingSifter.CraftingModule.class);
        currentRecipeStorage = module.getFirstFulfillableRecipe(ItemStackUtils::isEmpty, 1, false);
    }
    if (currentRecipeStorage == null) {
        if (InventoryUtils.hasBuildingEnoughElseCount(sifterBuilding, i -> ModTags.meshes.contains(i.getItem()), 1) == 0) {
            if (InventoryUtils.getItemCountInProvider(worker, i -> ModTags.meshes.contains(i.getItem())) > 0) {
                // We don't want the mesh in our inventory, we 'craft' out of the building
                incrementActionsDone();
                return INVENTORY_FULL;
            }
            if (worker.getCitizenData() != null) {
                worker.getCitizenData().triggerInteraction(new StandardInteraction(new TranslationTextComponent(SIFTER_NO_MESH), ChatPriority.IMPORTANT));
                setDelay(NO_MESH_DELAY);
            }
        }
        if (!ItemStackUtils.isEmpty(worker.getMainHandItem())) {
            worker.setItemInHand(Hand.MAIN_HAND, ItemStack.EMPTY);
        }
        if (!ItemStackUtils.isEmpty(worker.getOffhandItem())) {
            worker.setItemInHand(Hand.OFF_HAND, ItemStack.EMPTY);
        }
        progress = 0;
        return START_WORKING;
    }
    final ItemStack meshItem = currentRecipeStorage.getCraftingTools().get(0);
    final ItemStack inputItem = currentRecipeStorage.getCleanedInput().stream().map(ItemStorage::getItemStack).filter(item -> !ItemStackUtils.compareItemStacksIgnoreStackSize(item, meshItem, false, true)).findFirst().orElse(ItemStack.EMPTY);
    if (meshItem.isEmpty() || inputItem.isEmpty()) {
        currentRecipeStorage = null;
        return getState();
    }
    if (!inputItem.isEmpty() && (ItemStackUtils.isEmpty(worker.getMainHandItem()) || ItemStackUtils.compareItemStacksIgnoreStackSize(worker.getMainHandItem(), inputItem))) {
        worker.setItemInHand(Hand.MAIN_HAND, inputItem);
    }
    if (!meshItem.isEmpty() && (ItemStackUtils.isEmpty(worker.getOffhandItem()) || ItemStackUtils.compareItemStacksIgnoreStackSize(worker.getOffhandItem(), meshItem, false, true))) {
        worker.setItemInHand(Hand.OFF_HAND, meshItem);
    }
    WorkerUtil.faceBlock(building.getPosition(), worker);
    progress++;
    if (progress > MAX_LEVEL - (getEffectiveSkillLevel(getSecondarySkillLevel()) / 2)) {
        progress = 0;
        sifterBuilding.setCurrentDailyQuantity(sifterBuilding.getCurrentDailyQuantity() + 1);
        if (sifterBuilding.getCurrentDailyQuantity() >= sifterBuilding.getMaxDailyQuantity() || worker.getRandom().nextInt(ONE_HUNDRED_PERCENT) < CHANCE_TO_DUMP_INV) {
            incrementActionsDoneAndDecSaturation();
        }
        if (!currentRecipeStorage.fullfillRecipe(getLootContext(), sifterBuilding.getHandlers())) {
            currentRecipeStorage = null;
            return getState();
        }
        worker.decreaseSaturationForContinuousAction();
        worker.getCitizenExperienceHandler().addExperience(0.2);
    }
    Network.getNetwork().sendToTrackingEntity(new LocalizedParticleEffectMessage(meshItem, sifterBuilding.getID()), worker);
    Network.getNetwork().sendToTrackingEntity(new LocalizedParticleEffectMessage(inputItem, sifterBuilding.getID().below()), worker);
    worker.swing(Hand.MAIN_HAND);
    SoundUtils.playSoundAtCitizen(world, building.getID(), SoundEvents.LEASH_KNOT_BREAK);
    return getState();
}
Also used : ModTags(com.minecolonies.api.items.ModTags) ItemStackUtils(com.minecolonies.api.util.ItemStackUtils) ICraftingBuildingModule(com.minecolonies.api.colony.buildings.modules.ICraftingBuildingModule) ChatPriority(com.minecolonies.api.colony.interactionhandling.ChatPriority) BuildingSifter(com.minecolonies.coremod.colony.buildings.workerbuildings.BuildingSifter) StandardInteraction(com.minecolonies.coremod.colony.interactionhandling.StandardInteraction) SIFTER_NO_MESH(com.minecolonies.api.util.constant.TranslationConstants.SIFTER_NO_MESH) SoundUtils(com.minecolonies.api.util.SoundUtils) LocalizedParticleEffectMessage(com.minecolonies.coremod.network.messages.client.LocalizedParticleEffectMessage) AIWorkerState(com.minecolonies.api.entity.ai.statemachine.states.AIWorkerState) SoundEvents(net.minecraft.util.SoundEvents) TranslationTextComponent(net.minecraft.util.text.TranslationTextComponent) ItemStack(net.minecraft.item.ItemStack) IAIState(com.minecolonies.api.entity.ai.statemachine.states.IAIState) WorkerUtil(com.minecolonies.coremod.util.WorkerUtil) InventoryUtils(com.minecolonies.api.util.InventoryUtils) AbstractEntityAICrafting(com.minecolonies.coremod.entity.ai.basic.AbstractEntityAICrafting) ONE_HUNDRED_PERCENT(com.minecolonies.api.util.constant.Constants.ONE_HUNDRED_PERCENT) Hand(net.minecraft.util.Hand) AITarget(com.minecolonies.api.entity.ai.statemachine.AITarget) Network(com.minecolonies.coremod.Network) ItemStorage(com.minecolonies.api.crafting.ItemStorage) NotNull(org.jetbrains.annotations.NotNull) JobSifter(com.minecolonies.coremod.colony.jobs.JobSifter) BuildingSifter(com.minecolonies.coremod.colony.buildings.workerbuildings.BuildingSifter) StandardInteraction(com.minecolonies.coremod.colony.interactionhandling.StandardInteraction) LocalizedParticleEffectMessage(com.minecolonies.coremod.network.messages.client.LocalizedParticleEffectMessage) TranslationTextComponent(net.minecraft.util.text.TranslationTextComponent) ICraftingBuildingModule(com.minecolonies.api.colony.buildings.modules.ICraftingBuildingModule) ItemStack(net.minecraft.item.ItemStack)

Example 45 with IAIState

use of com.minecolonies.api.entity.ai.statemachine.states.IAIState in project minecolonies by Minecolonies.

the class AbstractEntityAIUsesFurnace method fillUpFurnace.

/**
 * Smelt the smeltable after the required items are in the inv.
 *
 * @return the next state to go to.
 */
private IAIState fillUpFurnace() {
    if (building.getFirstModuleOccurance(FurnaceUserModule.class).getFurnaces().isEmpty()) {
        if (worker.getCitizenData() != null) {
            worker.getCitizenData().triggerInteraction(new StandardInteraction(new TranslationTextComponent(BAKER_HAS_NO_FURNACES_MESSAGE), ChatPriority.BLOCKING));
        }
        return START_WORKING;
    }
    if (walkTo == null || world.getBlockState(walkTo).getBlock() != Blocks.FURNACE) {
        walkTo = null;
        return START_WORKING;
    }
    if (walkToBlock(walkTo)) {
        return getState();
    }
    final TileEntity entity = world.getBlockEntity(walkTo);
    if (entity instanceof FurnaceTileEntity) {
        final FurnaceTileEntity furnace = (FurnaceTileEntity) entity;
        if (InventoryUtils.hasItemInItemHandler((worker.getInventoryCitizen()), this::isSmeltable) && (hasFuelInFurnaceAndNoSmeltable(furnace) || hasNeitherFuelNorSmeltAble(furnace))) {
            InventoryUtils.transferXOfFirstSlotInItemHandlerWithIntoInItemHandler((worker.getInventoryCitizen()), this::isSmeltable, STACKSIZE, new InvWrapper(furnace), SMELTABLE_SLOT);
        }
        final ItemListModule module = building.getModuleMatching(ItemListModule.class, m -> m.getId().equals(FUEL_LIST));
        if (InventoryUtils.hasItemInItemHandler((worker.getInventoryCitizen()), stack -> module.isItemInList(new ItemStorage(stack))) && (hasSmeltableInFurnaceAndNoFuel(furnace) || hasNeitherFuelNorSmeltAble(furnace))) {
            InventoryUtils.transferXOfFirstSlotInItemHandlerWithIntoInItemHandler((worker.getInventoryCitizen()), stack -> module.isItemInList(new ItemStorage(stack)), STACKSIZE, new InvWrapper(furnace), FUEL_SLOT);
        }
    }
    walkTo = null;
    return START_WORKING;
}
Also used : FurnaceTileEntity(net.minecraft.tileentity.FurnaceTileEntity) TileEntity(net.minecraft.tileentity.TileEntity) ItemListModule(com.minecolonies.coremod.colony.buildings.modules.ItemListModule) StackList(com.minecolonies.api.colony.requestsystem.requestable.StackList) ItemStackUtils(com.minecolonies.api.util.ItemStackUtils) FurnaceUserModule(com.minecolonies.coremod.colony.buildings.modules.FurnaceUserModule) AbstractJob(com.minecolonies.coremod.colony.jobs.AbstractJob) TranslationTextComponent(net.minecraft.util.text.TranslationTextComponent) ArrayList(java.util.ArrayList) ItemStack(net.minecraft.item.ItemStack) InvWrapper(net.minecraftforge.items.wrapper.InvWrapper) Tuple(com.minecolonies.api.util.Tuple) IAIState(com.minecolonies.api.entity.ai.statemachine.states.IAIState) RequestSystemTranslationConstants(com.minecolonies.api.util.constant.translation.RequestSystemTranslationConstants) AITarget(com.minecolonies.api.entity.ai.statemachine.AITarget) FUEL_LIST(com.minecolonies.api.util.constant.BuildingConstants.FUEL_LIST) ItemListModule(com.minecolonies.coremod.colony.buildings.modules.ItemListModule) Constants(com.minecolonies.api.util.constant.Constants) TranslationConstants(com.minecolonies.api.util.constant.TranslationConstants) AIEventTarget(com.minecolonies.api.entity.ai.statemachine.AIEventTarget) World(net.minecraft.world.World) VisibleCitizenStatus(com.minecolonies.api.entity.citizen.VisibleCitizenStatus) ChatPriority(com.minecolonies.api.colony.interactionhandling.ChatPriority) AIBlockingEventType(com.minecolonies.api.entity.ai.statemachine.states.AIBlockingEventType) AbstractBuilding(com.minecolonies.coremod.colony.buildings.AbstractBuilding) StandardInteraction(com.minecolonies.coremod.colony.interactionhandling.StandardInteraction) BlockPos(net.minecraft.util.math.BlockPos) FurnaceTileEntity(net.minecraft.tileentity.FurnaceTileEntity) IRequestable(com.minecolonies.api.colony.requestsystem.requestable.IRequestable) AIWorkerState(com.minecolonies.api.entity.ai.statemachine.states.AIWorkerState) Blocks(net.minecraft.block.Blocks) List(java.util.List) InventoryUtils(com.minecolonies.api.util.InventoryUtils) TileEntity(net.minecraft.tileentity.TileEntity) ItemStorage(com.minecolonies.api.crafting.ItemStorage) WorldUtil(com.minecolonies.api.util.WorldUtil) FurnaceBlock(net.minecraft.block.FurnaceBlock) NotNull(org.jetbrains.annotations.NotNull) StandardInteraction(com.minecolonies.coremod.colony.interactionhandling.StandardInteraction) InvWrapper(net.minecraftforge.items.wrapper.InvWrapper) TranslationTextComponent(net.minecraft.util.text.TranslationTextComponent) FurnaceTileEntity(net.minecraft.tileentity.FurnaceTileEntity) ItemStorage(com.minecolonies.api.crafting.ItemStorage)

Aggregations

IAIState (com.minecolonies.api.entity.ai.statemachine.states.IAIState)74 ItemStack (net.minecraft.item.ItemStack)58 BlockPos (net.minecraft.util.math.BlockPos)52 AIWorkerState (com.minecolonies.api.entity.ai.statemachine.states.AIWorkerState)50 NotNull (org.jetbrains.annotations.NotNull)50 AITarget (com.minecolonies.api.entity.ai.statemachine.AITarget)48 TranslationTextComponent (net.minecraft.util.text.TranslationTextComponent)48 ItemStorage (com.minecolonies.api.crafting.ItemStorage)42 StandardInteraction (com.minecolonies.coremod.colony.interactionhandling.StandardInteraction)38 Hand (net.minecraft.util.Hand)37 ChatPriority (com.minecolonies.api.colony.interactionhandling.ChatPriority)34 ItemStackUtils (com.minecolonies.api.util.ItemStackUtils)34 InventoryUtils (com.minecolonies.api.util.InventoryUtils)31 TranslationConstants (com.minecolonies.api.util.constant.TranslationConstants)30 TileEntity (net.minecraft.tileentity.TileEntity)28 List (java.util.List)27 TypeToken (com.google.common.reflect.TypeToken)26 StackList (com.minecolonies.api.colony.requestsystem.requestable.StackList)26 IRequest (com.minecolonies.api.colony.requestsystem.request.IRequest)25 VisibleCitizenStatus (com.minecolonies.api.entity.citizen.VisibleCitizenStatus)25