Skip to content

Commit

Permalink
[1.20.4] Make player feet and eyes both need to be in swimmable fluid…
Browse files Browse the repository at this point in the history
… to swim (#379)

Fixes #220
  • Loading branch information
TelepathicGrunt authored Dec 16, 2023
1 parent 95a7e6c commit f2ecd67
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion patches/net/minecraft/world/entity/Entity.java.patch
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,7 @@

+ /**
+ * Gets the value of the legacy {@link #maxUpStep} field. Only used by players when the modified value causes issues.
+ * @deprecated Use {@link IEntityExtension#getStepHeight()} to get the real step height value.
+ * @deprecated Use {@link net.neoforged.neoforge.common.extensions.IEntityExtension#getStepHeight()} to get the real step height value.
+ */
+ @Deprecated
public float maxUpStep() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ default boolean isEyeInFluidType(FluidType type) {
* @return {@code true} if the entity can start swimming, {@code false} otherwise
*/
default boolean canStartSwimming() {
return !this.getEyeInFluidType().isAir() && this.canSwimInFluidType(this.getEyeInFluidType());
return !this.getEyeInFluidType().isAir() && this.canSwimInFluidType(this.getEyeInFluidType()) && this.canSwimInFluidType(this.self().level().getFluidState(this.self().blockPosition()).getFluidType());
}

/**
Expand Down

0 comments on commit f2ecd67

Please sign in to comment.