diff --git a/src/main/java/com/minecolonies/core/entity/ai/workers/production/herders/AbstractEntityAIHerder.java b/src/main/java/com/minecolonies/core/entity/ai/workers/production/herders/AbstractEntityAIHerder.java index 666fb9303f9..f8301e46309 100755 --- a/src/main/java/com/minecolonies/core/entity/ai/workers/production/herders/AbstractEntityAIHerder.java +++ b/src/main/java/com/minecolonies/core/entity/ai/workers/production/herders/AbstractEntityAIHerder.java @@ -1,5 +1,6 @@ package com.minecolonies.core.entity.ai.workers.production.herders; +import com.minecolonies.api.crafting.ItemStorage; import com.minecolonies.api.entity.ai.statemachine.AITarget; import com.minecolonies.api.entity.ai.statemachine.states.IAIState; import com.minecolonies.api.entity.citizen.VisibleCitizenStatus; @@ -178,7 +179,7 @@ public List getExtraToolsNeeded() * @return a list of items needed or empty. */ @NotNull - public List getExtraItemsNeeded() + public List getExtraItemsNeeded() { return new ArrayList<>(); } @@ -312,9 +313,9 @@ private IAIState prepareForHerding() checkIfRequestForItemExistOrCreateAsync(breedingItem, breedingItem.getCount() * EXTRA_BREEDING_ITEMS_REQUEST, breedingItem.getCount()); } - for (final ItemStack item : getExtraItemsNeeded()) + for (final ItemStorage item : getExtraItemsNeeded()) { - checkIfRequestForItemExistOrCreateAsync(item); + checkIfRequestForItemExistOrCreateAsync(item.getItemStack(), item.getAmount(), item.getAmount()); } return DECIDE; diff --git a/src/main/java/com/minecolonies/core/entity/ai/workers/production/herders/EntityAIWorkCowboy.java b/src/main/java/com/minecolonies/core/entity/ai/workers/production/herders/EntityAIWorkCowboy.java index c820bf74628..3827d6ecafb 100755 --- a/src/main/java/com/minecolonies/core/entity/ai/workers/production/herders/EntityAIWorkCowboy.java +++ b/src/main/java/com/minecolonies/core/entity/ai/workers/production/herders/EntityAIWorkCowboy.java @@ -116,20 +116,20 @@ else if (building != null && building.getFirstModuleOccurance(BuildingCowboy.Her @NotNull @Override - public List getExtraItemsNeeded() + public List getExtraItemsNeeded() { - final List list = super.getExtraItemsNeeded(); + final List list = super.getExtraItemsNeeded(); if (building != null && building.getFirstModuleOccurance(BuildingCowboy.HerdingModule.class).canTryToMilk() && !searchForAnimals(a -> a instanceof Cow && !(a instanceof MushroomCow)).isEmpty()) { - final ItemStack stack = building.getMilkInputItem().copy(); - stack.setCount(building.getSetting(MILKING_AMOUNT).getValue()); + final ItemStorage stack = new ItemStorage(building.getMilkInputItem().copy()); + stack.setAmount(building.getSetting(MILKING_AMOUNT).getValue()); list.add(stack); } if (building != null && building.getFirstModuleOccurance(BuildingCowboy.HerdingModule.class).canTryToStew() && !searchForAnimals(a -> a instanceof MushroomCow).isEmpty()) { - list.add(new ItemStack(Items.BOWL)); + list.add(new ItemStorage(Items.BOWL)); } return list; }