From 464cccaa3e7c1ebf277d77ecf24850f691aa88d8 Mon Sep 17 00:00:00 2001 From: LexManos Date: Wed, 27 Jun 2018 12:23:00 -0700 Subject: [PATCH] Fix NPE when sleeping in some custom beds. Closes #4956 --- .../net/minecraft/entity/player/EntityPlayer.java.patch | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/patches/minecraft/net/minecraft/entity/player/EntityPlayer.java.patch b/patches/minecraft/net/minecraft/entity/player/EntityPlayer.java.patch index 395f839893..6f61a08a28 100644 --- a/patches/minecraft/net/minecraft/entity/player/EntityPlayer.java.patch +++ b/patches/minecraft/net/minecraft/entity/player/EntityPlayer.java.patch @@ -359,7 +359,8 @@ { + net.minecraftforge.event.ForgeEventFactory.onPlayerWakeup(this, p_70999_1_, p_70999_2_, p_70999_3_); this.func_70105_a(0.6F, 1.8F); - IBlockState iblockstate = this.field_70170_p.func_180495_p(this.field_71081_bT); +- IBlockState iblockstate = this.field_70170_p.func_180495_p(this.field_71081_bT); ++ IBlockState iblockstate = this.field_71081_bT == null ? null : this.field_70170_p.func_180495_p(this.field_71081_bT); - if (this.field_71081_bT != null && iblockstate.func_177230_c() == Blocks.field_150324_C) + if (this.field_71081_bT != null && iblockstate.func_177230_c().isBed(iblockstate, field_70170_p, field_71081_bT, this))