From 12d6beacfcc02a0797e04526ac649da4df0ffa6e Mon Sep 17 00:00:00 2001 From: Callahhh Date: Sat, 18 Jan 2020 11:54:33 -0600 Subject: [PATCH] Prevent sync chunk loads when villagers try to find beds (#2855) --- ...nk-loads-when-villagers-try-to-find-.patch | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 Spigot-Server-Patches/Prevent-sync-chunk-loads-when-villagers-try-to-find-.patch diff --git a/Spigot-Server-Patches/Prevent-sync-chunk-loads-when-villagers-try-to-find-.patch b/Spigot-Server-Patches/Prevent-sync-chunk-loads-when-villagers-try-to-find-.patch new file mode 100644 index 0000000000..8c8ddfaf12 --- /dev/null +++ b/Spigot-Server-Patches/Prevent-sync-chunk-loads-when-villagers-try-to-find-.patch @@ -0,0 +1,23 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Callahan +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/server/BehaviorSleep.java b/src/main/java/net/minecraft/server/BehaviorSleep.java +index fa575dde..dfe0f665 100644 +--- a/src/main/java/net/minecraft/server/BehaviorSleep.java ++++ b/src/main/java/net/minecraft/server/BehaviorSleep.java +@@ -0,0 +0,0 @@ public class BehaviorSleep extends Behavior { + if (optional.isPresent() && worldserver.getTime() - ((MinecraftSerializableLong) optional.get()).a() < 100L) { + return false; + } else { +- 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(TagsBlock.BEDS) && !(Boolean) iblockdata.get(BlockBed.OCCUPIED); + } +-- +2.21.0 (Apple Git-122.2) +