Created
April 1, 2014 00:13
-
-
Save Twinklez/9905161 to your computer and use it in GitHub Desktop.
10.12.0.997 Forge
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void teleport(World world, EntityPlayer player) | |
{ | |
if (!world.isRemote) | |
{ | |
System.out.println("IsRemote: false"); | |
Vec3 vec3 = player.getPosition(1.0F); | |
++vec3.yCoord; | |
Vec3 lookVec = player.getLook(1.0F); | |
Vec3 addedVector = vec3.addVector(lookVec.xCoord * 50.0D, lookVec.yCoord * 50.0D, lookVec.zCoord * 50.0D); | |
MovingObjectPosition movingObjPos = world.clip(vec3, addedVector); | |
//world.func_147447_a(vec3, addedVector, true, true, false); | |
if (movingObjPos != null && movingObjPos.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) | |
{ | |
System.out.println("made it"); | |
int blockX = movingObjPos.blockX; | |
int blockY = movingObjPos.blockY; | |
int blockZ = movingObjPos.blockZ; | |
EntityPlayerMP playerMP = (EntityPlayerMP)player; | |
if (!playerMP.playerNetServerHandler.func_147362_b().func_150724_d()) | |
{ | |
System.out.println("made it 2"); | |
playerMP.setPositionAndUpdate((double)blockX, (double)((float)blockY + 1.0F), (double)blockZ); | |
playerMP.fallDistance = 0.0F; | |
} | |
else if (playerMP.playerNetServerHandler.func_147362_b().func_150724_d()) | |
{ | |
System.out.println("made it elsewise 2"); | |
playerMP.setPositionAndUpdate((double)blockX, (double)((float)blockY + 1.0F), (double)blockZ); | |
playerMP.fallDistance = 0.0F; | |
} | |
} | |
if (movingObjPos != null && movingObjPos.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) | |
{ | |
System.out.println(movingObjPos.typeOfHit); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment