MCPcopy Create free account
hub / github.com/DGVPSH/SlackOpen / handleWaterMovement

Method handleWaterMovement

src/main/java/net/minecraft/entity/Entity.java:1130–1149  ·  view source on GitHub ↗

Returns if this entity is in water and will end up adding the waters velocity to the entity

()

Source from the content-addressed store, hash-verified

1128 * Returns if this entity is in water and will end up adding the waters velocity to the entity
1129 */
1130 public boolean handleWaterMovement()
1131 {
1132 if (this.worldObj.handleMaterialAcceleration(this.getEntityBoundingBox().expand(0.0D, -0.4000000059604645D, 0.0D).contract(0.001D, 0.001D, 0.001D), Material.water, this))
1133 {
1134 if (!this.inWater && !this.firstUpdate)
1135 {
1136 this.resetHeight();
1137 }
1138
1139 this.fallDistance = 0.0F;
1140 this.inWater = true;
1141 this.fire = 0;
1142 }
1143 else
1144 {
1145 this.inWater = false;
1146 }
1147
1148 return this.inWater;
1149 }
1150
1151 /**
1152 * sets the players height back to normal after doing things like sleeping and dieing

Callers 2

onEntityUpdateMethod · 0.95
updateFallStateMethod · 0.45

Calls 5

getEntityBoundingBoxMethod · 0.95
resetHeightMethod · 0.95
contractMethod · 0.80
expandMethod · 0.80

Tested by

no test coverage detected