Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void onEntityUpdate()
- {
- this.worldObj.theProfiler.startSection("entityBaseTick");
- if (this.ridingEntity != null && this.ridingEntity.isDead)
- {
- this.ridingEntity = null;
- }
- this.prevDistanceWalkedModified = this.distanceWalkedModified;
- this.prevPosX = this.posX;
- this.prevPosY = this.posY;
- this.prevPosZ = this.posZ;
- this.prevRotationPitch = this.rotationPitch;
- this.prevRotationYaw = this.rotationYaw;
- if (!this.worldObj.isRemote && this.worldObj instanceof WorldServer)
- {
- this.worldObj.theProfiler.startSection("portal");
- MinecraftServer var1 = ((WorldServer)this.worldObj).func_73046_m();
- int var2 = this.getMaxInPortalTime();
- if (this.inPortal)
- {
- if (var1.getAllowNether())
- {
- if (this.ridingEntity == null && this.portalCounter++ >= var2)
- {
- this.portalCounter = var2;
- this.timeUntilPortal = this.getPortalCooldown();
- byte var3;
- if (this.worldObj.provider.getDimensionId() == -1)
- {
- var3 = 0;
- }
- else
- {
- var3 = -1;
- }
- this.travelToDimension(var3);
- }
- this.inPortal = false;
- }
- }
- else
- {
- if (this.portalCounter > 0)
- {
- this.portalCounter -= 4;
- }
- if (this.portalCounter < 0)
- {
- this.portalCounter = 0;
- }
- }
- if (this.timeUntilPortal > 0)
- {
- --this.timeUntilPortal;
- }
- this.worldObj.theProfiler.endSection();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement