package me.km.blocks;

import net.minecraft.block.RotatedPillarBlock;
import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material;
import net.minecraft.entity.Entity;
import net.minecraft.util.Direction;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;

public class BlockHay extends RotatedPillarBlock {
    public BlockHay(String name) {
        super(Properties.create(Material.ORGANIC).hardnessAndResistance(0.5f).sound(SoundType.PLANT));
        this.setRegistryName(name);
        this.setDefaultState(this.stateContainer.getBaseState().with(AXIS, Direction.Axis.Y));
    }

    @Override
    public void onFallenUpon(World w, BlockPos pos, Entity ent, float fallDistance) {
        ent.onLivingFall(fallDistance, 0.2f);
    }
}
