Guest User

Untitled

a guest
Apr 20th, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.84 KB | None | 0 0
  1. public void usePortal(int i)
  2. {
  3. int j = thePlayer.dimension;
  4. thePlayer.dimension = i;
  5. theWorld.setEntityDead(thePlayer);
  6. thePlayer.isDead = false;
  7. double d = thePlayer.posX;
  8. double d1 = thePlayer.posZ;
  9. double d2 = 1.0D;
  10. if(j > -1 && thePlayer.dimension == -1)
  11. {
  12. d2 = 0.125D;
  13. } else
  14. if(j == -1 && thePlayer.dimension > -1)
  15. {
  16. d2 = 8D;
  17. }
  18. d *= d2;
  19. d1 *= d2;
  20. if(thePlayer.dimension == -1)
  21. {
  22. thePlayer.setLocationAndAngles(d, thePlayer.posY, d1, thePlayer.rotationYaw, thePlayer.rotationPitch);
  23. if(thePlayer.isEntityAlive())
  24. {
  25. theWorld.updateEntityWithOptionalForce(thePlayer, false);
  26. }
  27. World world = null;
  28. world = new World(theWorld, WorldProvider.getProviderForDimension(thePlayer.dimension));
  29. changeWorld(world, "Entering the Nether", thePlayer);
  30. } else
  31. if(thePlayer.dimension == 0)
  32. {
  33. if(thePlayer.isEntityAlive())
  34. {
  35. thePlayer.setLocationAndAngles(d, thePlayer.posY, d1, thePlayer.rotationYaw, thePlayer.rotationPitch);
  36. theWorld.updateEntityWithOptionalForce(thePlayer, false);
  37. }
  38. World world1 = null;
  39. world1 = new World(theWorld, WorldProvider.getProviderForDimension(thePlayer.dimension));
  40. if(j == -1)
  41. {
  42. changeWorld(world1, "Leaving the Nether", thePlayer);
  43. } else
  44. {
  45. changeWorld(world1, "Leaving the End", thePlayer);
  46. }
  47. } else
  48. {
  49. World world2 = null;
  50. world2 = new World(theWorld, WorldProvider.getProviderForDimension(thePlayer.dimension));
  51. ChunkCoordinates chunkcoordinates = world2.func_40472_j();
  52. d = chunkcoordinates.posX;
  53. thePlayer.posY = chunkcoordinates.posY;
  54. d1 = chunkcoordinates.posZ;
  55. thePlayer.setLocationAndAngles(d, thePlayer.posY, d1, 90F, 0.0F);
  56. if(thePlayer.isEntityAlive())
  57. {
  58. world2.updateEntityWithOptionalForce(thePlayer, false);
  59. }
  60. changeWorld(world2, "Entering the End", thePlayer);
  61. }
  62. thePlayer.worldObj = theWorld;
  63. System.out.println((new StringBuilder()).append("Teleported to ").append(theWorld.worldProvider.worldType).toString());
  64. if(thePlayer.isEntityAlive() && j < 1)
  65. {
  66. thePlayer.setLocationAndAngles(d, thePlayer.posY, d1, thePlayer.rotationYaw, thePlayer.rotationPitch);
  67. theWorld.updateEntityWithOptionalForce(thePlayer, false);
  68. (new Teleporter()).placeInPortal(theWorld, thePlayer);
  69. }
  70. }
Add Comment
Please, Sign In to add comment