package de.steamwar.lobby.particle.elements;

import de.steamwar.lobby.particle.ParticleElement;
import de.steamwar.lobby.particle.ParticleTickData;

public class Floor extends DelegatingParticleElement {

    public Floor(ParticleElement particleElement) {
        super(particleElement);
    }

    @Override
    public String attribute() {
        return "PARTICLE_ATTRIBUTE_FLOOR";
    }

    @Override
    public void tick(ParticleTickData particleTickData) {
        if (!particleTickData.getWorld().getBlockAt(particleTickData.getPlayer().getLocation().subtract(0, 0.5, 0)).getType().isAir()) {
            particleElement.tick(particleTickData);
        }
    }
}
