Skip to content

Commit

Permalink
Fix guards unable to request shields (#10227)
Browse files Browse the repository at this point in the history
With the tool rework shields were returning an item level of 1 by default, and can actually be levellable based on their durability to cope with modded shields better. The knight AI however was attempting to request shields in the range of level [0, 0]. Made the effective range for shields requests between 0 and max int.
  • Loading branch information
Thodor12 authored Sep 19, 2024
1 parent 9204d79 commit 365fa61
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
import java.util.List;

import static com.minecolonies.api.research.util.ResearchConstants.SHIELD_USAGE;
import static com.minecolonies.api.util.constant.EquipmentLevelConstants.TOOL_LEVEL_MAXIMUM;
import static com.minecolonies.api.util.constant.EquipmentLevelConstants.TOOL_LEVEL_WOOD_OR_GOLD;
import static com.minecolonies.api.util.constant.GuardConstants.SHIELD_BUILDING_LEVEL_RANGE;
import static com.minecolonies.api.util.constant.GuardConstants.SHIELD_LEVEL_RANGE;

Expand All @@ -31,7 +33,12 @@ public EntityAIKnight(@NotNull final JobKnight job)

for (final List<GuardGear> list : itemsNeeded)
{
list.add(new GuardGear(ModEquipmentTypes.shield.get(), EquipmentSlot.OFFHAND, 0, 0, SHIELD_LEVEL_RANGE, SHIELD_BUILDING_LEVEL_RANGE));
list.add(new GuardGear(ModEquipmentTypes.shield.get(),
EquipmentSlot.OFFHAND,
TOOL_LEVEL_WOOD_OR_GOLD,
TOOL_LEVEL_MAXIMUM,
SHIELD_LEVEL_RANGE,
SHIELD_BUILDING_LEVEL_RANGE));
}

new KnightCombatAI((EntityCitizen) worker, getStateAI(), this);
Expand Down

0 comments on commit 365fa61

Please sign in to comment.