Search in sources :

Example 1 with STACKSIZE

use of com.minecolonies.api.util.constant.Constants.STACKSIZE 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 = getOwnBuilding().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 = getOwnBuilding().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(getOwnBuilding().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 2 with STACKSIZE

use of com.minecolonies.api.util.constant.Constants.STACKSIZE in project minecolonies by ldtteam.

the class BuildingCook method buildingRequiresCertainAmountOfItem.

@Override
public int buildingRequiresCertainAmountOfItem(final ItemStack stack, final List<ItemStorage> localAlreadyKept, final boolean inventory) {
    if (stack.isEmpty()) {
        return 0;
    }
    if (inventory && getFirstModuleOccurance(MinimumStockModule.class).isStocked(stack)) {
        return stack.getCount();
    }
    if (isAllowedFood(stack) && (localAlreadyKept.stream().filter(storage -> ISFOOD.test(storage.getItemStack())).mapToInt(ItemStorage::getAmount).sum() < STACKSIZE || !inventory)) {
        final ItemStorage kept = new ItemStorage(stack);
        if (localAlreadyKept.contains(kept)) {
            kept.setAmount(localAlreadyKept.remove(localAlreadyKept.indexOf(kept)).getAmount());
        }
        localAlreadyKept.add(kept);
        return 0;
    }
    final Predicate<ItemStack> allowedFuel = theStack -> getModuleMatching(ItemListModule.class, m -> m.getId().equals(FUEL_LIST)).isItemInList(new ItemStorage(theStack));
    if (allowedFuel.test(stack) && (localAlreadyKept.stream().filter(storage -> allowedFuel.test(storage.getItemStack())).mapToInt(ItemStorage::getAmount).sum() < STACKSIZE || !inventory)) {
        final ItemStorage kept = new ItemStorage(stack);
        if (localAlreadyKept.contains(kept)) {
            kept.setAmount(localAlreadyKept.remove(localAlreadyKept.indexOf(kept)).getAmount());
        }
        localAlreadyKept.add(kept);
        return 0;
    }
    return super.buildingRequiresCertainAmountOfItem(stack, localAlreadyKept, inventory);
}
Also used : IItemHandler(net.minecraftforge.items.IItemHandler) java.util(java.util) ItemStackUtils(com.minecolonies.api.util.ItemStackUtils) Item(net.minecraft.item.Item) IRecipeStorage(com.minecolonies.api.crafting.IRecipeStorage) IToken(com.minecolonies.api.colony.requestsystem.token.IToken) ICitizenData(com.minecolonies.api.colony.ICitizenData) ISFOOD(com.minecolonies.api.util.ItemStackUtils.ISFOOD) AbstractJobCrafter(com.minecolonies.coremod.colony.jobs.AbstractJobCrafter) IGenericRecipe(com.minecolonies.api.crafting.IGenericRecipe) CRAFTING_COOK(com.minecolonies.api.util.constant.TagConstants.CRAFTING_COOK) MinecoloniesAPIProxy(com.minecolonies.api.MinecoloniesAPIProxy) ItemStack(net.minecraft.item.ItemStack) TAG_SITTING(com.minecolonies.api.util.constant.SchematicTagConstants.TAG_SITTING) GenericRecipe(com.minecolonies.api.crafting.GenericRecipe) MinimumStockModule(com.minecolonies.coremod.colony.buildings.modules.MinimumStockModule) CraftingWorkerBuildingModule(com.minecolonies.coremod.colony.buildings.modules.CraftingWorkerBuildingModule) ModJobs(com.minecolonies.api.colony.jobs.ModJobs) JobEntry(com.minecolonies.api.colony.jobs.registry.JobEntry) OptionalPredicate(com.minecolonies.api.util.OptionalPredicate) FUEL_LIST(com.minecolonies.api.util.constant.BuildingConstants.FUEL_LIST) IBlueprintDataProvider(com.ldtteam.structurize.blocks.interfaces.IBlueprintDataProvider) ItemListModule(com.minecolonies.coremod.colony.buildings.modules.ItemListModule) ModTags(com.minecolonies.api.items.ModTags) STACKSIZE(com.minecolonies.api.util.constant.Constants.STACKSIZE) Predicate(java.util.function.Predicate) CraftingUtils(com.minecolonies.api.util.CraftingUtils) FurnaceRecipes(com.minecolonies.coremod.util.FurnaceRecipes) Tuple(net.minecraft.util.Tuple) AbstractBuilding(com.minecolonies.coremod.colony.buildings.AbstractBuilding) BlockPos(net.minecraft.util.math.BlockPos) Items(net.minecraft.item.Items) Nullable(org.jetbrains.annotations.Nullable) OVERRIDE_EQUALS(com.minecolonies.api.util.constant.Suppression.OVERRIDE_EQUALS) AbstractCraftingBuildingModule(com.minecolonies.coremod.colony.buildings.modules.AbstractCraftingBuildingModule) IColony(com.minecolonies.api.colony.IColony) ItemStorage(com.minecolonies.api.crafting.ItemStorage) NotNull(org.jetbrains.annotations.NotNull) ItemListModule(com.minecolonies.coremod.colony.buildings.modules.ItemListModule) ItemStack(net.minecraft.item.ItemStack) ItemStorage(com.minecolonies.api.crafting.ItemStorage)

Example 3 with STACKSIZE

use of com.minecolonies.api.util.constant.Constants.STACKSIZE in project minecolonies by ldtteam.

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 = getOwnBuilding().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 = getOwnBuilding().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(getOwnBuilding().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 4 with STACKSIZE

use of com.minecolonies.api.util.constant.Constants.STACKSIZE in project minecolonies by Minecolonies.

the class BuildingCook method buildingRequiresCertainAmountOfItem.

@Override
public int buildingRequiresCertainAmountOfItem(final ItemStack stack, final List<ItemStorage> localAlreadyKept, final boolean inventory) {
    if (stack.isEmpty()) {
        return 0;
    }
    if (inventory && getFirstModuleOccurance(MinimumStockModule.class).isStocked(stack)) {
        return stack.getCount();
    }
    if (isAllowedFood(stack) && (localAlreadyKept.stream().filter(storage -> ISFOOD.test(storage.getItemStack())).mapToInt(ItemStorage::getAmount).sum() < STACKSIZE || !inventory)) {
        final ItemStorage kept = new ItemStorage(stack);
        if (localAlreadyKept.contains(kept)) {
            kept.setAmount(localAlreadyKept.remove(localAlreadyKept.indexOf(kept)).getAmount());
        }
        localAlreadyKept.add(kept);
        return 0;
    }
    final Predicate<ItemStack> allowedFuel = theStack -> getModuleMatching(ItemListModule.class, m -> m.getId().equals(FUEL_LIST)).isItemInList(new ItemStorage(theStack));
    if (allowedFuel.test(stack) && (localAlreadyKept.stream().filter(storage -> allowedFuel.test(storage.getItemStack())).mapToInt(ItemStorage::getAmount).sum() < STACKSIZE || !inventory)) {
        final ItemStorage kept = new ItemStorage(stack);
        if (localAlreadyKept.contains(kept)) {
            kept.setAmount(localAlreadyKept.remove(localAlreadyKept.indexOf(kept)).getAmount());
        }
        localAlreadyKept.add(kept);
        return 0;
    }
    return super.buildingRequiresCertainAmountOfItem(stack, localAlreadyKept, inventory);
}
Also used : IItemHandler(net.minecraftforge.items.IItemHandler) java.util(java.util) ItemStackUtils(com.minecolonies.api.util.ItemStackUtils) Item(net.minecraft.item.Item) IRecipeStorage(com.minecolonies.api.crafting.IRecipeStorage) IToken(com.minecolonies.api.colony.requestsystem.token.IToken) ICitizenData(com.minecolonies.api.colony.ICitizenData) ISFOOD(com.minecolonies.api.util.ItemStackUtils.ISFOOD) AbstractJobCrafter(com.minecolonies.coremod.colony.jobs.AbstractJobCrafter) IGenericRecipe(com.minecolonies.api.crafting.IGenericRecipe) CRAFTING_COOK(com.minecolonies.api.util.constant.TagConstants.CRAFTING_COOK) MinecoloniesAPIProxy(com.minecolonies.api.MinecoloniesAPIProxy) ItemStack(net.minecraft.item.ItemStack) TAG_SITTING(com.minecolonies.api.util.constant.SchematicTagConstants.TAG_SITTING) GenericRecipe(com.minecolonies.api.crafting.GenericRecipe) MinimumStockModule(com.minecolonies.coremod.colony.buildings.modules.MinimumStockModule) CraftingWorkerBuildingModule(com.minecolonies.coremod.colony.buildings.modules.CraftingWorkerBuildingModule) ModJobs(com.minecolonies.api.colony.jobs.ModJobs) JobEntry(com.minecolonies.api.colony.jobs.registry.JobEntry) OptionalPredicate(com.minecolonies.api.util.OptionalPredicate) FUEL_LIST(com.minecolonies.api.util.constant.BuildingConstants.FUEL_LIST) IBlueprintDataProvider(com.ldtteam.structurize.blocks.interfaces.IBlueprintDataProvider) ItemListModule(com.minecolonies.coremod.colony.buildings.modules.ItemListModule) ModTags(com.minecolonies.api.items.ModTags) STACKSIZE(com.minecolonies.api.util.constant.Constants.STACKSIZE) Predicate(java.util.function.Predicate) CraftingUtils(com.minecolonies.api.util.CraftingUtils) FurnaceRecipes(com.minecolonies.coremod.util.FurnaceRecipes) Tuple(net.minecraft.util.Tuple) AbstractBuilding(com.minecolonies.coremod.colony.buildings.AbstractBuilding) BlockPos(net.minecraft.util.math.BlockPos) Items(net.minecraft.item.Items) Nullable(org.jetbrains.annotations.Nullable) OVERRIDE_EQUALS(com.minecolonies.api.util.constant.Suppression.OVERRIDE_EQUALS) AbstractCraftingBuildingModule(com.minecolonies.coremod.colony.buildings.modules.AbstractCraftingBuildingModule) IColony(com.minecolonies.api.colony.IColony) ItemStorage(com.minecolonies.api.crafting.ItemStorage) NotNull(org.jetbrains.annotations.NotNull) ItemListModule(com.minecolonies.coremod.colony.buildings.modules.ItemListModule) ItemStack(net.minecraft.item.ItemStack) ItemStorage(com.minecolonies.api.crafting.ItemStorage)

Example 5 with STACKSIZE

use of com.minecolonies.api.util.constant.Constants.STACKSIZE 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() {
    @Nullable final BuildingFarmer building = getOwnBuilding();
    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() < getOwnBuilding().getBuildingLevel() && !module.assignManually()) {
        searchAndAddFields();
    }
    if (module.getFarmerFields().size() == getOwnBuilding().getMaxBuildingLevel()) {
        AdvancementUtils.TriggerAdvancementPlayersForColony(building.getColony(), AdvancementTriggers.MAX_FIELDS::trigger);
    }
    final int amountOfCompostInBuilding = InventoryUtils.getCountFromBuilding(getOwnBuilding(), this::isCompost);
    final int amountOfCompostInInv = InventoryUtils.getItemCountInItemHandler(worker.getInventoryCitizen(), this::isCompost);
    if (amountOfCompostInBuilding + amountOfCompostInInv <= 0) {
        if (getOwnBuilding().requestFertilizer() && !getOwnBuilding().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, FERTLIZER, 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, this::shouldHarvest)) {
            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.shouldHoe(pos, (ScarecrowTileEntity) entity))) {
            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) Objects(java.util.Objects) 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) 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) BuildingFarmer(com.minecolonies.coremod.colony.buildings.workerbuildings.BuildingFarmer) ItemStack(net.minecraft.item.ItemStack) Nullable(org.jetbrains.annotations.Nullable) Tuple(com.minecolonies.api.util.Tuple) NotNull(org.jetbrains.annotations.NotNull)

Aggregations

ItemStackUtils (com.minecolonies.api.util.ItemStackUtils)6 STACKSIZE (com.minecolonies.api.util.constant.Constants.STACKSIZE)6 Predicate (java.util.function.Predicate)6 ItemStack (net.minecraft.item.ItemStack)6 BlockPos (net.minecraft.util.math.BlockPos)6 NotNull (org.jetbrains.annotations.NotNull)6 IColony (com.minecolonies.api.colony.IColony)4 AIWorkerState (com.minecolonies.api.entity.ai.statemachine.states.AIWorkerState)4 IAIState (com.minecolonies.api.entity.ai.statemachine.states.IAIState)4 InventoryUtils (com.minecolonies.api.util.InventoryUtils)4 Tuple (com.minecolonies.api.util.Tuple)4 AbstractEntityAICrafting (com.minecolonies.coremod.entity.ai.basic.AbstractEntityAICrafting)4 Item (net.minecraft.item.Item)3 Items (net.minecraft.item.Items)3 Nullable (org.jetbrains.annotations.Nullable)3 TypeToken (com.google.common.reflect.TypeToken)2 AdvancementTriggers (com.minecolonies.api.advancements.AdvancementTriggers)2 ChatPriority (com.minecolonies.api.colony.interactionhandling.ChatPriority)2 RequestState (com.minecolonies.api.colony.requestsystem.request.RequestState)2 StackList (com.minecolonies.api.colony.requestsystem.requestable.StackList)2