Gets called every tick from main Entity class
()
| 418 | * Gets called every tick from main Entity class |
| 419 | */ |
| 420 | public void onEntityUpdate() |
| 421 | { |
| 422 | this.worldObj.theProfiler.startSection("entityBaseTick"); |
| 423 | |
| 424 | if (this.ridingEntity != null && this.ridingEntity.isDead) |
| 425 | { |
| 426 | this.ridingEntity = null; |
| 427 | } |
| 428 | |
| 429 | this.prevDistanceWalkedModified = this.distanceWalkedModified; |
| 430 | this.prevPosX = this.posX; |
| 431 | this.prevPosY = this.posY; |
| 432 | this.prevPosZ = this.posZ; |
| 433 | this.prevRotationPitch = this.rotationPitch; |
| 434 | this.prevRotationYaw = this.rotationYaw; |
| 435 | |
| 436 | if (!this.worldObj.isRemote && this.worldObj instanceof WorldServer) |
| 437 | { |
| 438 | this.worldObj.theProfiler.startSection("portal"); |
| 439 | MinecraftServer minecraftserver = ((WorldServer)this.worldObj).getMinecraftServer(); |
| 440 | int i = this.getMaxInPortalTime(); |
| 441 | |
| 442 | if (this.inPortal) |
| 443 | { |
| 444 | if (minecraftserver.getAllowNether()) |
| 445 | { |
| 446 | if (this.ridingEntity == null && this.portalCounter++ >= i) |
| 447 | { |
| 448 | this.portalCounter = i; |
| 449 | this.timeUntilPortal = this.getPortalCooldown(); |
| 450 | int j; |
| 451 | |
| 452 | if (this.worldObj.provider.getDimensionId() == -1) |
| 453 | { |
| 454 | j = 0; |
| 455 | } |
| 456 | else |
| 457 | { |
| 458 | j = -1; |
| 459 | } |
| 460 | |
| 461 | this.travelToDimension(j); |
| 462 | } |
| 463 | |
| 464 | this.inPortal = false; |
| 465 | } |
| 466 | } |
| 467 | else |
| 468 | { |
| 469 | if (this.portalCounter > 0) |
| 470 | { |
| 471 | this.portalCounter -= 4; |
| 472 | } |
| 473 | |
| 474 | if (this.portalCounter < 0) |
| 475 | { |
| 476 | this.portalCounter = 0; |
| 477 | } |
no test coverage detected