Advertisement
Guest User

Untitled

a guest
Apr 29th, 2017
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.08 KB | None | 0 0
  1. public void onEntityUpdate()
  2. {
  3. this.worldObj.theProfiler.startSection("entityBaseTick");
  4.  
  5. if (this.ridingEntity != null && this.ridingEntity.isDead)
  6. {
  7. this.ridingEntity = null;
  8. }
  9.  
  10. this.prevDistanceWalkedModified = this.distanceWalkedModified;
  11. this.prevPosX = this.posX;
  12. this.prevPosY = this.posY;
  13. this.prevPosZ = this.posZ;
  14. this.prevRotationPitch = this.rotationPitch;
  15. this.prevRotationYaw = this.rotationYaw;
  16.  
  17. if (!this.worldObj.isRemote && this.worldObj instanceof WorldServer)
  18. {
  19. this.worldObj.theProfiler.startSection("portal");
  20. MinecraftServer var1 = ((WorldServer)this.worldObj).func_73046_m();
  21. int var2 = this.getMaxInPortalTime();
  22.  
  23. if (this.inPortal)
  24. {
  25. if (var1.getAllowNether())
  26. {
  27. if (this.ridingEntity == null && this.portalCounter++ >= var2)
  28. {
  29. this.portalCounter = var2;
  30. this.timeUntilPortal = this.getPortalCooldown();
  31. byte var3;
  32.  
  33. if (this.worldObj.provider.getDimensionId() == -1)
  34. {
  35. var3 = 0;
  36. }
  37. else
  38. {
  39. var3 = -1;
  40. }
  41.  
  42. this.travelToDimension(var3);
  43. }
  44.  
  45. this.inPortal = false;
  46. }
  47. }
  48. else
  49. {
  50. if (this.portalCounter > 0)
  51. {
  52. this.portalCounter -= 4;
  53. }
  54.  
  55. if (this.portalCounter < 0)
  56. {
  57. this.portalCounter = 0;
  58. }
  59. }
  60.  
  61. if (this.timeUntilPortal > 0)
  62. {
  63. --this.timeUntilPortal;
  64. }
  65.  
  66. this.worldObj.theProfiler.endSection();
  67. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement