PaperMC/patches/server/0843-Fix-MC-157464-Prevent-sleeping-villagers-moving-towa.patch
Jake Potrebic 526795bacd
Update patches to handle vineflower decompiler (#10406)
* Update patches to handle vineflower decompiler

* update patches again to handle inlined simple lambdas

* update vf again and re-apply/rebuild patches

* update patches after removal of verify-merges flag

* fix compile issue

* remove maven local

* fix some issues

* address more issues

* fix collision patch

* use paperweight release

* more fixes

* update fineflower and fix patches again

* add missing comment descriptor

---------

Co-authored-by: Jason Penilla <11360596+jpenilla@users.noreply.github.com>
2024-04-12 12:14:06 -07:00

24 lines
1.5 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Warrior <50800980+Warriorrrr@users.noreply.github.com>
Date: Mon, 27 Feb 2023 19:16:07 +0100
Subject: [PATCH] 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
diff --git a/src/main/java/net/minecraft/world/entity/ai/behavior/VillagerGoalPackages.java b/src/main/java/net/minecraft/world/entity/ai/behavior/VillagerGoalPackages.java
index 28b255b425d2ac4d13b85a7fce67406ea3b6fdae..458cfece2c0ce94f0017aa94ed6f1a356861ec31 100644
--- a/src/main/java/net/minecraft/world/entity/ai/behavior/VillagerGoalPackages.java
+++ b/src/main/java/net/minecraft/world/entity/ai/behavior/VillagerGoalPackages.java
@@ -35,7 +35,7 @@ public class VillagerGoalPackages {
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(profession.acquirableJobSite(), MemoryModuleType.JOB_SITE, MemoryModuleType.POTENTIAL_JOB_SITE, true, Optional.empty())
),