From b4c62afc330a0acc5ce3ea69acd921cf4846e82c Mon Sep 17 00:00:00 2001 From: Raycoms Date: Mon, 4 Nov 2024 18:55:42 +0100 Subject: [PATCH] allow farther range for building pos return (#10402) Allow farther distance if building returns its own pos for standing --- .../entity/ai/workers/AbstractEntityAIBasic.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/minecolonies/core/entity/ai/workers/AbstractEntityAIBasic.java b/src/main/java/com/minecolonies/core/entity/ai/workers/AbstractEntityAIBasic.java index 26ea0c8fe62..0a61c63d7cf 100755 --- a/src/main/java/com/minecolonies/core/entity/ai/workers/AbstractEntityAIBasic.java +++ b/src/main/java/com/minecolonies/core/entity/ai/workers/AbstractEntityAIBasic.java @@ -777,7 +777,17 @@ public int getTotalRequiredAmount(final ItemStack deliveredItemStack) protected final boolean walkToBuilding() { @Nullable final IBuilding ownBuilding = building; - return ownBuilding == null || walkToBlock(ownBuilding.getStandingPosition(), 1); + if (ownBuilding == null) + { + return true; + } + final BlockPos standingPos = ownBuilding.getStandingPosition(); + int range = 1; + if (standingPos.equals(ownBuilding.getPosition())) + { + range = 3; + } + return walkToBlock(ownBuilding.getStandingPosition(), range); } /**