Paper/Spigot-Server-Patches/0387-Prevent-sync-chunk-loads-when-villagers-try-to-find-.patch
Mariell e38eceb42a
Updated Upstream (Spigot) (#4745)
Upstream has released updates that appears to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing

Spigot Changes:
a19903d2 SPIGOT-520: Add option to disable player data saving
2020-11-08 10:00:43 +00:00

21 lines
1.1 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/server/BehaviorSleep.java b/src/main/java/net/minecraft/server/BehaviorSleep.java
index 98ea2478898643a5744760b2d2adfacfa0bd5956..aadc27ddebbcc00d19d3d87593f130cf309e10ef 100644
--- a/src/main/java/net/minecraft/server/BehaviorSleep.java
+++ b/src/main/java/net/minecraft/server/BehaviorSleep.java
@@ -32,7 +32,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);
}