From a0513959ea6a89770c7aa8ea61eb8f2297d70417 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 --- .../world/entity/ai/behavior/SleepInBed.java.patch | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 paper-server/patches/sources/net/minecraft/world/entity/ai/behavior/SleepInBed.java.patch diff --git a/paper-server/patches/sources/net/minecraft/world/entity/ai/behavior/SleepInBed.java.patch b/paper-server/patches/sources/net/minecraft/world/entity/ai/behavior/SleepInBed.java.patch new file mode 100644 index 0000000000..d905f5c1d7 --- /dev/null +++ b/paper-server/patches/sources/net/minecraft/world/entity/ai/behavior/SleepInBed.java.patch @@ -0,0 +1,12 @@ +--- a/net/minecraft/world/entity/ai/behavior/SleepInBed.java ++++ b/net/minecraft/world/entity/ai/behavior/SleepInBed.java +@@ -42,7 +42,8 @@ + } + } + +- BlockState blockState = world.getBlockState(globalPos.pos()); ++ BlockState blockState = world.getBlockStateIfLoaded(globalPos.pos()); // Paper - Prevent sync chunk loads when villagers try to find beds ++ if (blockState == null) { return false; } // Paper - Prevent sync chunk loads when villagers try to find beds + return globalPos.pos().closerToCenterThan(entity.position(), 2.0) && blockState.is(BlockTags.BEDS) && !blockState.getValue(BedBlock.OCCUPIED); + } + }