mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-29 15:49:00 +01:00
20 lines
1.3 KiB
Diff
20 lines
1.3 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 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 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<EntityLiving> {
|
|
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);
|
|
}
|