Merge pull request #926 from iChun/master

Fix erroneous position when getting player position with changed eye height.
This commit is contained in:
LexManos 2014-01-11 17:32:27 -08:00
commit 0296803fe3
1 changed files with 19 additions and 1 deletions

View File

@ -479,11 +479,29 @@
chatcomponenttext.func_150256_b().func_150241_a(new ClickEvent(ClickEvent.Action.SUGGEST_COMMAND, "/msg " + this.getCommandSenderName() + " "));
return chatcomponenttext;
}
@@ -2096,6 +2244,101 @@
@@ -2096,6 +2244,119 @@
FMLNetworkHandler.openGui(this, mod, modGuiId, world, x, y, z);
}
+ /* ======================================== FORGE START =====================================*/
+ // JAVADOC METHOD $$ func_70666_h
+ @SideOnly(Side.CLIENT)
+ @Override
+ public Vec3 getPosition(float par1)
+ {
+ if (par1 == 1.0F)
+ {
+ return this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX, this.posY + (this.getEyeHeight() - this.getDefaultEyeHeight()), this.posZ);
+ }
+ else
+ {
+ double d0 = this.prevPosX + (this.posX - this.prevPosX) * (double)par1;
+ double d1 = this.prevPosY + (this.posY - this.prevPosY) * (double)par1 + (this.getEyeHeight() - this.getDefaultEyeHeight());
+ double d2 = this.prevPosZ + (this.posZ - this.prevPosZ) * (double)par1;
+ return this.worldObj.getWorldVec3Pool().getVecFromPool(d0, d1, d2);
+ }
+ }
+
+ /**
+ * A dimension aware version of getBedLocation.
+ * @param dimension The dimension to get the bed spawn for