From daa817bbdf798962b0b34c71ee5e0d488cb35cea Mon Sep 17 00:00:00 2001 From: Paul Becker Date: Mon, 27 Jul 2020 23:35:13 +0200 Subject: [PATCH] Fix SleepingTimeCheckEvent not being fired in initial sleep test. (#7005) --- .../entity/player/ServerPlayerEntity.java.patch | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/patches/minecraft/net/minecraft/entity/player/ServerPlayerEntity.java.patch b/patches/minecraft/net/minecraft/entity/player/ServerPlayerEntity.java.patch index 99e0ce68de..9d92794f2f 100644 --- a/patches/minecraft/net/minecraft/entity/player/ServerPlayerEntity.java.patch +++ b/patches/minecraft/net/minecraft/entity/player/ServerPlayerEntity.java.patch @@ -75,6 +75,15 @@ Direction direction = this.field_70170_p.func_180495_p(p_213819_1_).func_177229_b(HorizontalBlock.field_185512_D); if (!this.func_70608_bn() && this.func_70089_S()) { if (!this.field_70170_p.func_230315_m_().func_236043_f_()) { +@@ -741,7 +751,7 @@ + return Either.left(PlayerEntity.SleepResult.OBSTRUCTED); + } else { + this.func_241153_a_(this.field_70170_p.func_234923_W_(), p_213819_1_, false, true); +- if (this.field_70170_p.func_72935_r()) { ++ if (!net.minecraftforge.event.ForgeEventFactory.fireSleepingTimeCheck(this, optAt)) { + return Either.left(PlayerEntity.SleepResult.NOT_POSSIBLE_NOW); + } else { + if (!this.func_184812_l_()) { @@ -775,6 +785,7 @@ }