--- ../src-base/minecraft/net/minecraft/client/renderer/EntityRenderer.java
+++ ../src-work/minecraft/net/minecraft/client/renderer/EntityRenderer.java
@@ -403,7 +403,7 @@
 
                             if (d3 < d2 || d2 == 0.0D)
                             {
-                                if (entity1 == entity.field_70154_o)
+                                if (entity1 == entity.field_70154_o && !entity.canRiderInteract())
                                 {
                                     if (d2 == 0.0D)
                                     {
@@ -556,14 +556,8 @@
             {
                 BlockPos blockpos = new BlockPos(entity);
                 IBlockState iblockstate = this.field_78531_r.field_71441_e.func_180495_p(blockpos);
-                Block block = iblockstate.func_177230_c();
+                net.minecraftforge.client.ForgeHooksClient.orientBedCamera(this.field_78531_r.field_71441_e, blockpos, iblockstate, entity);
 
-                if (block == Blocks.field_150324_C)
-                {
-                    int j = ((EnumFacing)iblockstate.func_177229_b(BlockBed.field_176387_N)).func_176736_b();
-                    GlStateManager.func_179114_b((float)(j * 90), 0.0F, 1.0F, 0.0F);
-                }
-
                 GlStateManager.func_179114_b(entity.field_70126_B + (entity.field_70177_z - entity.field_70126_B) * p_78467_1_ + 180.0F, 0.0F, -1.0F, 0.0F);
                 GlStateManager.func_179114_b(entity.field_70127_C + (entity.field_70125_A - entity.field_70127_C) * p_78467_1_, -1.0F, 0.0F, 0.0F);
             }
@@ -1081,7 +1075,7 @@
 
                 try
                 {
-                    this.field_78531_r.field_71462_r.func_73863_a(l, i1, p_78480_1_);
+                    net.minecraftforge.client.ForgeHooksClient.drawScreen(this.field_78531_r.field_71462_r, l, i1, p_78480_1_);
                 }
                 catch (Throwable throwable)
                 {
@@ -1145,7 +1139,7 @@
 
                     if (this.field_78531_r.field_71442_b.func_178889_l() == WorldSettings.GameType.SPECTATOR)
                     {
-                        flag = block.func_149716_u() && this.field_78531_r.field_71441_e.func_175625_s(blockpos) instanceof IInventory;
+                        flag = block.hasTileEntity(this.field_78531_r.field_71441_e.func_180495_p(blockpos)) && this.field_78531_r.field_71441_e.func_175625_s(blockpos) instanceof IInventory;
                     }
                     else
                     {
@@ -1296,7 +1290,9 @@
             GlStateManager.func_179094_E();
             RenderHelper.func_74519_b();
             this.field_78531_r.field_71424_I.func_76318_c("entities");
+            net.minecraftforge.client.ForgeHooksClient.setRenderPass(0);
             renderglobal.func_180446_a(entity, frustum, p_175068_2_);
+            net.minecraftforge.client.ForgeHooksClient.setRenderPass(0);
             RenderHelper.func_74518_a();
             this.func_175072_h();
             GlStateManager.func_179128_n(5888);
@@ -1308,6 +1304,7 @@
                 entityplayer = (EntityPlayer)entity;
                 GlStateManager.func_179118_c();
                 this.field_78531_r.field_71424_I.func_76318_c("outline");
+                if (!net.minecraftforge.client.ForgeHooksClient.onDrawBlockHighlight(renderglobal, entityplayer, field_78531_r.field_71476_x, 0, entityplayer.func_70694_bm(), p_175068_2_))
                 renderglobal.func_72731_b(entityplayer, this.field_78531_r.field_71476_x, 0, p_175068_2_);
                 GlStateManager.func_179141_d();
             }
@@ -1321,6 +1318,7 @@
             entityplayer = (EntityPlayer)entity;
             GlStateManager.func_179118_c();
             this.field_78531_r.field_71424_I.func_76318_c("outline");
+            if (!net.minecraftforge.client.ForgeHooksClient.onDrawBlockHighlight(renderglobal, entityplayer, field_78531_r.field_71476_x, 0, entityplayer.func_70694_bm(), p_175068_2_))
             renderglobal.func_72731_b(entityplayer, this.field_78531_r.field_71476_x, 0, p_175068_2_);
             GlStateManager.func_179141_d();
         }
@@ -1373,6 +1371,16 @@
             renderglobal.func_174977_a(EnumWorldBlockLayer.TRANSLUCENT, (double)p_175068_2_, p_175068_1_, entity);
         }
 
+        if (!this.field_175078_W) //Only render if render pass 0 happens as well.
+        {
+            RenderHelper.func_74519_b();
+            this.field_78531_r.field_71424_I.func_76318_c("entities");
+            net.minecraftforge.client.ForgeHooksClient.setRenderPass(1);
+            renderglobal.func_180446_a(entity, frustum, p_175068_2_);
+            net.minecraftforge.client.ForgeHooksClient.setRenderPass(-1);
+            RenderHelper.func_74518_a();
+        }
+
         GlStateManager.func_179103_j(7424);
         GlStateManager.func_179132_a(true);
         GlStateManager.func_179089_o();
@@ -1385,8 +1393,12 @@
             this.func_180437_a(renderglobal, p_175068_2_, p_175068_1_);
         }
 
+        this.field_78531_r.field_71424_I.func_76318_c("forge_render_last");
+        net.minecraftforge.client.ForgeHooksClient.dispatchRenderLast(renderglobal, p_175068_2_);
+
         this.field_78531_r.field_71424_I.func_76318_c("hand");
 
+        if (!net.minecraftforge.client.ForgeHooksClient.renderFirstPersonHand(renderglobal, p_175068_2_, p_175068_1_))
         if (this.field_175074_C)
         {
             GlStateManager.func_179086_m(256);
@@ -1498,6 +1510,13 @@
 
     protected void func_78474_d(float p_78474_1_)
     {
+        net.minecraftforge.client.IRenderHandler renderer = this.field_78531_r.field_71441_e.field_73011_w.getWeatherRenderer();
+        if (renderer != null)
+        {
+            renderer.render(p_78474_1_, this.field_78531_r.field_71441_e, field_78531_r);
+            return;
+        }
+
         float f1 = this.field_78531_r.field_71441_e.func_72867_j(p_78474_1_);
 
         if (f1 > 0.0F)
@@ -1835,6 +1854,13 @@
             this.field_175081_S = f8;
         }
 
+        net.minecraftforge.client.event.EntityViewRenderEvent.FogColors event = new net.minecraftforge.client.event.EntityViewRenderEvent.FogColors(this, entity, block, p_78466_1_, this.field_175080_Q, this.field_175082_R, this.field_175081_S);
+        net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event);
+
+        this.field_175080_Q = event.red;
+        this.field_175082_R = event.blue;
+        this.field_175081_S = event.green;
+
         GlStateManager.func_179082_a(this.field_175080_Q, this.field_175082_R, this.field_175081_S, 0.0F);
     }
 
@@ -1854,6 +1880,10 @@
         Block block = ActiveRenderInfo.func_180786_a(this.field_78531_r.field_71441_e, entity, p_78468_2_);
         float f1;
 
+        float hook = net.minecraftforge.client.ForgeHooksClient.getFogDensity(this, entity, block, p_78468_2_, 0.1F);
+        if (hook >= 0)
+            GlStateManager.func_179095_a(hook);
+        else
         if (entity instanceof EntityLivingBase && ((EntityLivingBase)entity).func_70644_a(Potion.field_76440_q))
         {
             f1 = 5.0F;
@@ -1931,6 +1961,7 @@
                 GlStateManager.func_179102_b(f1 * 0.05F);
                 GlStateManager.func_179153_c(Math.min(f1, 192.0F) * 0.5F);
             }
+            net.minecraftforge.client.ForgeHooksClient.onFogRender(this, entity, block, p_78468_2_, p_78468_1_, f1);
         }
 
         GlStateManager.func_179142_g();
