Paper/Spigot-Server-Patches/0387-Prevent-sync-chunk-loads-when-villagers-try-to-find-.patch
Aikar 976c6d425b
[CI-SKIP] [Auto] Rebuild Patches
A recent commit has been made that caused patches to be out of order, rebuilding
2021-05-02 15:37:24 -04:00

21 lines
1.2 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Callahan <mr.callahhh@gmail.com>
Date: Mon, 13 Jan 2020 23:47:28 -0600
Subject: [PATCH] Prevent sync chunk loads when villagers try to find beds
diff --git a/src/main/java/net/minecraft/world/entity/ai/behavior/BehaviorSleep.java b/src/main/java/net/minecraft/world/entity/ai/behavior/BehaviorSleep.java
index 84eba4c91e8e608b84623d6c71233e2512b77a54..ce86301723d20e79f95207cce1084bac091742fe 100644
--- a/src/main/java/net/minecraft/world/entity/ai/behavior/BehaviorSleep.java
+++ b/src/main/java/net/minecraft/world/entity/ai/behavior/BehaviorSleep.java
@@ -46,7 +46,8 @@ public class BehaviorSleep extends Behavior<EntityLiving> {
}
}
- IBlockData iblockdata = worldserver.getType(globalpos.getBlockPosition());
+ IBlockData iblockdata = worldserver.getTypeIfLoaded(globalpos.getBlockPosition()); // Paper
+ if (iblockdata == null) { return false; } // Paper
return globalpos.getBlockPosition().a((IPosition) entityliving.getPositionVector(), 2.0D) && iblockdata.getBlock().a((Tag) TagsBlock.BEDS) && !(Boolean) iblockdata.get(BlockBed.OCCUPIED);
}