diff --git a/src/main/java/net/minecraft/core/entity/vehicle/EntityMinecart.java b/src/main/java/net/minecraft/core/entity/vehicle/EntityMinecart.java
index 867ed29f3..a19df97a5 100644
--- a/src/main/java/net/minecraft/core/entity/vehicle/EntityMinecart.java
+++ b/src/main/java/net/minecraft/core/entity/vehicle/EntityMinecart.java
@@ -784,69 +784,56 @@ label0:
         {
             entity.startRiding(this);
         }
-        double d = entity.x - x;
-        double d1 = entity.z - z;
-        double d2 = d * d + d1 * d1;
-        if(d2 >= 9.9999997473787516E-005D)
-        {
-            d2 = MathHelper.sqrt_double(d2);
-            d /= d2;
-            d1 /= d2;
-            double d3 = 1.0D / d2;
-            if(d3 > 1.0D)
-            {
-                d3 = 1.0D;
-            }
-            d *= d3;
-            d1 *= d3;
-            d *= 0.1D;
-            d1 *= 0.1D;
-            d *= 1.0F - pushthrough;
-            d1 *= 1.0F - pushthrough;
-            d *= 0.5D;
-            d1 *= 0.5D;
-            if(entity instanceof EntityMinecart)
-            {
-                double d4 = entity.x - x;
-                double d5 = entity.z - z;
-                double d6 = d4 * entity.zd + d5 * entity.xo;
-                d6 *= d6;
-                if(d6 > 5D)
-                {
-                    return;
+        final double n = entity.x - this.x;
+        final double n2 = entity.z - this.z;
+        final double n3 = n * n + n2 * n2;
+        if (n3 >= 9.999999747378752E-5) {
+            final double n4 = Math.sqrt(n3);
+            final double n5 = n / n4;
+            final double n6 = n2 / n4;
+            double n7 = 1.0 / n4;
+            if (n7 > 1.0) {
+                n7 = 1.0;
+            }
+            final double n8 = n5 * n7;
+            final double n9 = n6 * n7;
+            final double n10 = n8 * 0.10000000149011612;
+            final double n11 = n9 * 0.10000000149011612;
+            final double n12 = n10 * (1.0f - this.pushthrough);
+            final double n13 = n11 * (1.0f - this.pushthrough);
+            final double n14 = n12 * 0.5;
+            final double n15 = n13 * 0.5;
+            if (entity instanceof EntityMinecart) {
+                final double n16 = entity.xd + this.xd;
+                final double n17 = entity.zd + this.zd;
+                if (((EntityMinecart)entity).minecartType == 2 && this.minecartType != 2) {
+                    this.xd *= 0.20000000298023224;
+                    this.zd *= 0.20000000298023224;
+                    this.push(entity.xd - n14, 0.0, entity.zd - n15);
+                    entity.xd *= 0.699999988079071;
+                    entity.zd *= 0.699999988079071;
                 }
-                double d7 = entity.xd + xd;
-                double d8 = entity.zd + zd;
-                if(((EntityMinecart)entity).minecartType == 2 && minecartType != 2)
-                {
-                    xd *= 0.2D;
-                    zd *= 0.2D;
-                    push(entity.xd - d, 0.0D, entity.zd - d1);
-                    entity.xd *= 0.7D;
-                    entity.zd *= 0.7D;
-                } else
-                if(((EntityMinecart)entity).minecartType != 2 && minecartType == 2)
-                {
-                    entity.xd *= 0.2D;
-                    entity.zd *= 0.2D;
-                    entity.push(xd + d, 0.0D, zd + d1);
-                    xd *= 0.7D;
-                    zd *= 0.7D;
-                } else
-                {
-                    d7 /= 2D;
-                    d8 /= 2D;
-                    xd *= 0.2D;
-                    zd *= 0.2D;
-                    push(d7 - d, 0.0D, d8 - d1);
-                    entity.xd *= 0.2D;
-                    entity.zd *= 0.2D;
-                    entity.push(d7 + d, 0.0D, d8 + d1);
+                else if (((EntityMinecart)entity).minecartType != 2 && this.minecartType == 2) {
+                    entity.xd *= 0.20000000298023224;
+                    entity.zd *= 0.20000000298023224;
+                    entity.push(this.xd + n14, 0.0, this.zd + n15);
+                    this.xd *= 0.699999988079071;
+                    this.zd *= 0.699999988079071;
                 }
-            } else
-            {
-                push(-d, 0.0D, -d1);
-                entity.push(d / 4D, 0.0D, d1 / 4D);
+                else {
+                    final double n18 = n16 / 2.0;
+                    final double n19 = n17 / 2.0;
+                    this.xd *= 0.20000000298023224;
+                    this.zd *= 0.20000000298023224;
+                    this.push(n18 - n14, 0.0, n19 - n15);
+                    entity.xd *= 0.20000000298023224;
+                    entity.zd *= 0.20000000298023224;
+                    entity.push(n18 + n14, 0.0, n19 + n15);
+                }
+            }
+            else {
+                this.push(-n14, 0.0, -n15);
+                entity.push(n14 / 4.0, 0.0, n15 / 4.0);
             }
         }
     }
diff --git a/src/main/java/net/minecraft/core/net/command/commands/SpawnCommand.java b/src/main/java/net/minecraft/core/net/command/commands/SpawnCommand.java
index 1094417d1..acfd41d16 100644
--- a/src/main/java/net/minecraft/core/net/command/commands/SpawnCommand.java
+++ b/src/main/java/net/minecraft/core/net/command/commands/SpawnCommand.java
@@ -30,7 +30,7 @@ public class SpawnCommand extends Command{
 			if(player instanceof EntityPlayerMP) {
 				EntityPlayerMP playerMP = (EntityPlayerMP) player;
 				if(playerMP.dimension != 0) {
-					playerMP.mcServer.playerList.sendPlayerToOtherDimension(playerMP, 0);
+					playerMP.mcServer.playerList.sendPlayerToOtherDimension(playerMP, 0, false);
 				}
 				playerMP.playerNetServerHandler.teleportAndRotate(pos.x + 0.5, pos.y + 0.5, pos.z + 0.5, 0, 0);
 			}
diff --git a/src/main/java/net/minecraft/core/net/command/commands/TeleportCommand.java b/src/main/java/net/minecraft/core/net/command/commands/TeleportCommand.java
index 54fe1c519..910d7dc38 100644
--- a/src/main/java/net/minecraft/core/net/command/commands/TeleportCommand.java
+++ b/src/main/java/net/minecraft/core/net/command/commands/TeleportCommand.java
@@ -110,7 +110,7 @@ public class TeleportCommand extends Command{
 			EntityPlayerMP p1MP = (EntityPlayerMP) p1;
 			if(dimension != null && p1MP.dimension != dimension && handler instanceof ServerCommandHandler) {
 				ServerCommandHandler serverCommandHandler = (ServerCommandHandler) handler;
-				serverCommandHandler.minecraftServer.playerList.sendPlayerToOtherDimension(p1MP, dimension);
+				serverCommandHandler.minecraftServer.playerList.sendPlayerToOtherDimension(p1MP, dimension, false);
 			}
 			p1MP.playerNetServerHandler.teleportAndRotate(x, y, z, p1MP.yRot, p1MP.xRot);
 		}else {
diff --git a/src/main/java/net/minecraft/server/entity/player/EntityPlayerMP.java b/src/main/java/net/minecraft/server/entity/player/EntityPlayerMP.java
index a879c59f6..058fb00ab 100644
--- a/src/main/java/net/minecraft/server/entity/player/EntityPlayerMP.java
+++ b/src/main/java/net/minecraft/server/entity/player/EntityPlayerMP.java
@@ -333,11 +333,11 @@ public class EntityPlayerMP extends EntityPlayer implements ICrafting {
                         timeUntilPortal = 10;
                         if (dimension == targetDim)
                         {
-                            mcServer.playerList.sendPlayerToOtherDimension(this, 0);
+                            mcServer.playerList.sendPlayerToOtherDimension(this, 0, true);
                         }
                         else
                         {
-                            mcServer.playerList.sendPlayerToOtherDimension(this, targetDim);
+                            mcServer.playerList.sendPlayerToOtherDimension(this, targetDim, true);
                         }
                     }
                 }
diff --git a/src/main/java/net/minecraft/server/net/PlayerList.java b/src/main/java/net/minecraft/server/net/PlayerList.java
index cc66f95cf..7e0197858 100644
--- a/src/main/java/net/minecraft/server/net/PlayerList.java
+++ b/src/main/java/net/minecraft/server/net/PlayerList.java
@@ -215,7 +215,7 @@ public class PlayerList
         return newPlayer;
     }
 
-    public void sendPlayerToOtherDimension(EntityPlayerMP entityplayermp, int targetDim)
+    public void sendPlayerToOtherDimension(EntityPlayerMP entityplayermp, int targetDim, boolean generatePortal)
     {
         WorldServer worldserver = server.getDimensionWorld(entityplayermp.dimension);
         Dimension lastDim = Dimension.getDimensionList().get(entityplayermp.dimension);
@@ -243,9 +243,11 @@ public class PlayerList
             worldserver1.entityJoinedWorld(entityplayermp);
             entityplayermp.moveTo(d, entityplayermp.y, d1, entityplayermp.yRot, entityplayermp.xRot);
             worldserver1.updateEntityWithOptionalForce(entityplayermp, false);
-            worldserver1.chunkProviderServer.chunkLoadOverride = true;
-            (new PortalHandler()).teleportEntity(worldserver1, entityplayermp, lastDim, newDim);
-            worldserver1.chunkProviderServer.chunkLoadOverride = false;
+            if (generatePortal){
+                worldserver1.chunkProviderServer.chunkLoadOverride = true;
+                (new PortalHandler()).teleportEntity(worldserver1, entityplayermp, lastDim, newDim);
+                worldserver1.chunkProviderServer.chunkLoadOverride = false;
+            }
         }
         func_28172_a(entityplayermp);
         entityplayermp.playerNetServerHandler.teleportAndRotate(entityplayermp.x, entityplayermp.y, entityplayermp.z, entityplayermp.yRot, entityplayermp.xRot);
