Fix MC-157464 Prevent sleeping villagers moving towards food

Fixes sleeping villagers moving to nearby food by adding an !isSleeping predicate

Relevant links:
https://bugs.mojang.com/browse/MC-157464
https://github.com/PaperMC/Paper/issues/8569
This commit is contained in:
Warrior 2023-02-27 19:16:07 +01:00
parent d1abd737aa
commit b5442da875

View file

@ -0,0 +1,11 @@
--- a/net/minecraft/world/entity/ai/behavior/VillagerGoalPackages.java
+++ b/net/minecraft/world/entity/ai/behavior/VillagerGoalPackages.java
@@ -42,7 +42,7 @@
Pair.of(1, new MoveToTargetSink()),
Pair.of(2, PoiCompetitorScan.create()),
Pair.of(3, new LookAndFollowTradingPlayerSink(speed)),
- Pair.of(5, GoToWantedItem.create(speed, false, 4)),
+ Pair.of(5, GoToWantedItem.create(villager -> !villager.isSleeping(), speed, false, 4)), // Paper - Fix MC-157464
Pair.of(
6,
AcquirePoi.create(