package me.hammerle.supersnuvi.tiles;

import me.hammerle.supersnuvi.entity.Entity;
import me.hammerle.supersnuvi.util.Face;

public class SlipperyTile extends BaseBoxTile
{
    public SlipperyTile(String path) 
    {
        super(path);
    }

    @Override
    public void onEntityCollide(Entity ent, int x, int y, Face face) 
    {
        if(face == Face.UP)
        {
            double motionX = ent.getMotionX() * 0.98d;
            if(Math.abs(motionX) > 0.1)
            {
                ent.setMotionX(motionX);
            }
            else
            {
                ent.setMotionX(0);
            }
        }
    }
}
