package com.hypixel.hytale.server.core.event.events.ecs;

import com.hypixel.hytale.component.system.CancellableEcsEvent;
import com.hypixel.hytale.math.vector.Vector3i;
import com.hypixel.hytale.server.core.asset.type.fluid.Fluid;

import javax.annotation.Nonnull;

/**
 * Event fired when a player attempts to place a fluid (e.g., water bucket).
 * This event is cancellable - if cancelled, the fluid will not be placed.
 */
public class PlaceFluidEvent extends CancellableEcsEvent {
    @Nonnull
    private final Vector3i targetBlock;
    @Nonnull
    private final Fluid fluid;

    public PlaceFluidEvent(@Nonnull Vector3i targetBlock, @Nonnull Fluid fluid) {
        this.targetBlock = targetBlock;
        this.fluid = fluid;
    }

    @Nonnull
    public Vector3i getTargetBlock() {
        return this.targetBlock;
    }

    @Nonnull
    public Fluid getFluid() {
        return this.fluid;
    }
}
