Files
MinecraftForge/patches/minecraft/net/minecraft/client/renderer/entity/RenderManager.java.patch
T
2013-06-30 19:43:27 -07:00

23 lines
1.3 KiB
Diff

--- ../src_base/minecraft/net/minecraft/client/renderer/entity/RenderManager.java
+++ ../src_work/minecraft/net/minecraft/client/renderer/entity/RenderManager.java
@@ -224,12 +224,14 @@
if (par4EntityLivingBase.isPlayerSleeping())
{
- int i = par1World.getBlockId(MathHelper.floor_double(par4EntityLivingBase.posX), MathHelper.floor_double(par4EntityLivingBase.posY), MathHelper.floor_double(par4EntityLivingBase.posZ));
-
- if (i == Block.bed.blockID)
+ int x = MathHelper.floor_double(par4EntityLivingBase.posX);
+ int y = MathHelper.floor_double(par4EntityLivingBase.posY);
+ int z = MathHelper.floor_double(par4EntityLivingBase.posZ);
+ Block block = Block.blocksList[par1World.getBlockId(x, y, z)];
+
+ if (block != null && block.isBed(par1World, x, y, z, par4EntityLivingBase))
{
- int j = par1World.getBlockMetadata(MathHelper.floor_double(par4EntityLivingBase.posX), MathHelper.floor_double(par4EntityLivingBase.posY), MathHelper.floor_double(par4EntityLivingBase.posZ));
- int k = j & 3;
+ int k = block.getBedDirection(par1World, x, y, z);
this.playerViewY = (float)(k * 90 + 180);
this.playerViewX = 0.0F;
}