package org.allaymc.api.eventbus.event.block;

import lombok.Getter;
import lombok.Setter;
import org.allaymc.api.annotation.CallerThread;
import org.allaymc.api.annotation.ThreadType;
import org.allaymc.api.block.dto.Block;
import org.allaymc.api.block.type.BlockState;
import org.allaymc.api.eventbus.event.CancellableEvent;

/**
 * Called when a block fades, melts, or disappears naturally. Examples include ice melting, fire
 * extinguishing, and crop dying due to lack of light.
 *
 * @author daoge_cmd
 */
@Getter
@Setter
@CallerThread(ThreadType.DIMENSION)
public class BlockFadeEvent extends BlockEvent implements CancellableEvent {
    /**
     * The new block state after the fade.
     */
    protected BlockState newBlockState;

    public BlockFadeEvent(Block block, BlockState newBlockState) {
        super(block);
        this.newBlockState = newBlockState;
    }
}
