<commit_before>package com.voxelwind.server.game.entities;

import com.flowpowered.math.vector.Vector3f;
import com.google.common.base.Preconditions;
import com.voxelwind.server.game.level.VoxelwindLevel;
import com.voxelwind.server.network.mcpe.packets.McpeEntityEvent;

public class LivingEntity extends BaseEntity {
    protected float drag = 0.02f;
    protected float gravity = 0.08f;
    private float health = 20;
    private float maximumHealth = 20;

    public LivingEntity(EntityTypeData data, VoxelwindLevel level, Vector3f position, float maximumHealth) {
        super(data, position, level);
        this.maximumHealth = maximumHealth;
        this.health = maximumHealth;
    }

    @Override
    public boolean onTick() {
        super.onTick();

        if (getMotion().lengthSquared() > 0) {
            boolean onGroundPreviously = isOnGround();
            setPosition(getPosition().add(getMotion()));
            boolean onGroundNow = isOnGround();

            if (!onGroundPreviously && onGroundNow) {
                setPosition(new Vector3f(getPosition().getX(), getPosition().getFloorY(), getPosition().getZ()));
                setMotion(Vector3f.ZERO);
            } else {
                setMotion(getMotion().mul(1f - drag));
                if (!onGroundNow) {
                    setMotion(getMotion().sub(0, gravity, 0));
                }
            }
        }
<commit_msg>Removed superfluous code<commit_after>package com.voxelwind.server.game.entities;

import com.flowpowered.math.vector.Vector3f;
import com.google.common.base.Preconditions;
import com.voxelwind.server.game.level.VoxelwindLevel;
import com.voxelwind.server.network.mcpe.packets.McpeEntityEvent;

public class LivingEntity extends BaseEntity {
    protected float drag = 0.02f;
    protected float gravity = 0.08f;
    private float health;
    private float maximumHealth;

    public LivingEntity(EntityTypeData data, VoxelwindLevel level, Vector3f position, float maximumHealth) {
        super(data, position, level);
        this.maximumHealth = maximumHealth;
        this.health = maximumHealth;
    }

    @Override
    public boolean onTick() {
        super.onTick();

        if (getMotion().lengthSquared() > 0) {
            boolean onGroundPreviously = isOnGround();
            setPosition(getPosition().add(getMotion()));
            boolean onGroundNow = isOnGround();

            if (!onGroundPreviously && onGroundNow) {
                setPosition(new Vector3f(getPosition().getX(), getPosition().getFloorY(), getPosition().getZ()));
                setMotion(Vector3f.ZERO);
            } else {
                setMotion(getMotion().mul(1f - drag));
                if (!onGroundNow) {
                    setMotion(getMotion().sub(0, gravity, 0));
                }
            }
        }

{'fraction_non_alphanumeric': 0.10910379029401346, 'fraction_numerical': 0.011335458731845554, 'mean_word_length': 2.570164348925411, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1892538', 'n_tokens_mistral': 840, 'n_tokens_neox': 785, 'n_words': 156}