ForgePatch/patches/minecraft/net/minecraft/client/Minecraft.java.patch
2012-08-01 17:41:34 -07:00

133 lines
5 KiB
Diff

--- ../src_base/minecraft/net/minecraft/client/Minecraft.java 0000-00-00 00:00:00.000000000 -0000
+++ ../src_work/minecraft/net/minecraft/client/Minecraft.java 0000-00-00 00:00:00.000000000 -0000
@@ -1960,86 +1960,54 @@
*/
public void usePortal(int par1)
{
+ usePortal(par1, new Teleporter());
+ }
+
+ public void usePortal(int par1, Teleporter teleporter)
+ {
int var2 = this.thePlayer.dimension;
this.thePlayer.dimension = par1;
this.theWorld.setEntityDead(this.thePlayer);
this.thePlayer.isDead = false;
+ WorldProvider pNew = WorldProvider.getProviderForDimension(par1);
+ WorldProvider pOld = WorldProvider.getProviderForDimension(var2);
double var3 = this.thePlayer.posX;
double var5 = this.thePlayer.posZ;
- double var7 = 1.0D;
-
- if (var2 > -1 && this.thePlayer.dimension == -1)
- {
- var7 = 0.125D;
- }
- else if (var2 == -1 && this.thePlayer.dimension > -1)
- {
- var7 = 8.0D;
- }
-
+ double var7 = pOld.getMovementFactor() / pNew.getMovementFactor();
var3 *= var7;
var5 *= var7;
- World var9;
-
- if (this.thePlayer.dimension == -1)
- {
- this.thePlayer.setLocationAndAngles(var3, this.thePlayer.posY, var5, this.thePlayer.rotationYaw, this.thePlayer.rotationPitch);
-
- if (this.thePlayer.isEntityAlive())
- {
- this.theWorld.updateEntityWithOptionalForce(this.thePlayer, false);
- }
+ World var9 = new World(theWorld, pNew);
- var9 = null;
- var9 = new World(this.theWorld, WorldProvider.getProviderForDimension(this.thePlayer.dimension));
- this.changeWorld(var9, "Entering the Nether", this.thePlayer);
- }
- else if (this.thePlayer.dimension == 0)
+ if (this.thePlayer.isEntityAlive())
{
- if (this.thePlayer.isEntityAlive())
- {
- this.thePlayer.setLocationAndAngles(var3, this.thePlayer.posY, var5, this.thePlayer.rotationYaw, this.thePlayer.rotationPitch);
- this.theWorld.updateEntityWithOptionalForce(this.thePlayer, false);
- }
-
- var9 = null;
- var9 = new World(this.theWorld, WorldProvider.getProviderForDimension(this.thePlayer.dimension));
-
- if (var2 == -1)
- {
- this.changeWorld(var9, "Leaving the Nether", this.thePlayer);
- }
- else
- {
- this.changeWorld(var9, "Leaving the End", this.thePlayer);
- }
+ this.theWorld.updateEntityWithOptionalForce(this.thePlayer, false);
}
- else
+
+ if (thePlayer.dimension == 1)
{
- var9 = null;
- var9 = new World(this.theWorld, WorldProvider.getProviderForDimension(this.thePlayer.dimension));
ChunkCoordinates var10 = var9.getEntrancePortalLocation();
var3 = (double)var10.posX;
this.thePlayer.posY = (double)var10.posY;
var5 = (double)var10.posZ;
- this.thePlayer.setLocationAndAngles(var3, this.thePlayer.posY, var5, 90.0F, 0.0F);
-
- if (this.thePlayer.isEntityAlive())
- {
- var9.updateEntityWithOptionalForce(this.thePlayer, false);
- }
-
- this.changeWorld(var9, "Entering the End", this.thePlayer);
+ }
+
+ if (thePlayer.dimension == 0)
+ {
+ changeWorld(var9, pOld.getDepartMessage(), thePlayer);
+ }
+ else
+ {
+ changeWorld(var9, pNew.getWelcomeMessage(), thePlayer);
}
this.thePlayer.worldObj = this.theWorld;
System.out.println("Teleported to " + this.theWorld.worldProvider.worldType);
- if (this.thePlayer.isEntityAlive() && var2 < 1)
+ if (this.thePlayer.isEntityAlive())
{
this.thePlayer.setLocationAndAngles(var3, this.thePlayer.posY, var5, this.thePlayer.rotationYaw, this.thePlayer.rotationPitch);
this.theWorld.updateEntityWithOptionalForce(this.thePlayer, false);
- (new Teleporter()).placeInPortal(this.theWorld, this.thePlayer);
+ teleporter.placeInPortal(this.theWorld, this.thePlayer);
}
}
@@ -2324,6 +2292,11 @@
{
this.usePortal(0);
}
+
+ if (!this.theWorld.isRemote && this.theWorld.worldProvider.canRespawnHere())
+ {
+ par2 = this.theWorld.worldProvider.worldType; //Fix for vanilla always re-spawning to the over world.
+ }
ChunkCoordinates var4 = null;
ChunkCoordinates var5 = null;
@@ -2591,6 +2564,7 @@
var0.addData("java_version", System.getProperty("java.version"));
var0.addData("opengl_version", GL11.glGetString(GL11.GL_VERSION));
var0.addData("opengl_vendor", GL11.glGetString(GL11.GL_VENDOR));
+ var0.addData("client_brand", "forge");
var0.sendReport();
}
}