Squake/java/squeek/quakemovement/QuakeServerPlayer.java
Ryan Liptak 0da195ebb5 WIP port to Fabric
Water movement is still broken
2019-09-15 13:51:13 -07:00

27 lines
754 B
Java

package squeek.quakemovement;
import net.minecraft.entity.player.PlayerEntity;
public class QuakeServerPlayer
{
// we can get away with a single static variable here instead of a <Player, boolean> map
// because we only care about the state before it has any possibility of changing
private static boolean wasVelocityChangedBeforeFall = false;
public static void beforeFall(PlayerEntity player, float fallDistance, float damageMultiplier)
{
if (player.world.isClient)
return;
wasVelocityChangedBeforeFall = player.velocityModified;
}
public static void afterFall(PlayerEntity player, float fallDistance, float damageMultiplier)
{
if (player.world.isClient)
return;
player.velocityModified = wasVelocityChangedBeforeFall;
}
}