@@ -92,7 +92,7 @@ index 373059fcccdab0a918aa1d1a4a613fb62fef8a18..7d0a1181ac64eabd54395cff8e1b9356
9292 if (rounded > 0) {
9393 this.awardStat(Stats.WALK_UNDER_WATER_ONE_CM, rounded);
9494diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java
95- index 3bba6cd29f85bec2e98ce97313f1158e2836c6b9..0cad980ff4198615621a4dacf07127be822cd935 100644
95+ index 3bba6cd29f85bec2e98ce97313f1158e2836c6b9..069a3a46bf2f699210234a4096642d1b6e82b5f1 100644
9696--- a/net/minecraft/world/entity/Entity.java
9797+++ b/net/minecraft/world/entity/Entity.java
9898@@ -268,7 +268,14 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
@@ -111,17 +111,18 @@ index 3bba6cd29f85bec2e98ce97313f1158e2836c6b9..0cad980ff4198615621a4dacf07127be
111111 public int invulnerableTime;
112112 protected boolean firstTick = true;
113113 protected final SynchedEntityData entityData;
114- @@ -2014,8 +2021,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
114+ @@ -2014,8 +2021,8 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
115115 }
116116
117117 private void updateFluidOnEyes() {
118118- this.wasEyeInWater = this.isEyeInFluid(FluidTags.WATER);
119119- this.fluidOnEyes.clear();
120120+ this.wasEyeInWater = this.isInWaterOrLava == 1; // Leaf - Optimize isEyeInFluid
121+ + this.isInWaterOrLava = 0; // Leaf - Optimize isEyeInFluid - reset cache
121122 double eyeY = this.getEyeY();
122123 if (!(
123124 this.getVehicle() instanceof AbstractBoat abstractBoat
124- @@ -2027,7 +2033 ,10 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
125+ @@ -2027,7 +2034 ,10 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
125126 FluidState fluidState = this.level().getFluidState(blockPos);
126127 double d = blockPos.getY() + fluidState.getHeight(this.level(), blockPos);
127128 if (d > eyeY) {
@@ -133,7 +134,7 @@ index 3bba6cd29f85bec2e98ce97313f1158e2836c6b9..0cad980ff4198615621a4dacf07127be
133134 }
134135 }
135136 }
136- @@ -2107,9 +2116 ,25 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
137+ @@ -2107,9 +2117 ,25 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
137138 }
138139 }
139140
0 commit comments