// 
// Decompiled by Procyon v0.6.0
// 

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

import java.util.Objects;
import com.hypixel.hytale.server.core.asset.type.blocktype.config.RotationTuple;
import javax.annotation.Nonnull;
import com.hypixel.hytale.math.vector.Vector3i;
import javax.annotation.Nullable;
import com.hypixel.hytale.server.core.inventory.ItemStack;
import com.hypixel.hytale.component.system.CancellableEcsEvent;

public class PlaceBlockEvent extends CancellableEcsEvent
{
    @Nullable
    private final ItemStack itemInHand;
    @Nonnull
    private Vector3i targetBlock;
    @Nonnull
    private RotationTuple rotation;
    
    public PlaceBlockEvent(@Nullable final ItemStack itemInHand, @Nonnull final Vector3i targetBlock, @Nonnull final RotationTuple rotation) {
        this.itemInHand = itemInHand;
        this.targetBlock = targetBlock;
        this.rotation = rotation;
    }
    
    @Nullable
    public ItemStack getItemInHand() {
        return this.itemInHand;
    }
    
    @Nonnull
    public Vector3i getTargetBlock() {
        return this.targetBlock;
    }
    
    public void setTargetBlock(@Nonnull final Vector3i targetBlock) {
        Objects.requireNonNull(targetBlock, "Block can't be null");
        this.targetBlock = targetBlock;
    }
    
    @Nonnull
    public RotationTuple getRotation() {
        return this.rotation;
    }
    
    public void setRotation(@Nonnull final RotationTuple rotation) {
        this.rotation = rotation;
    }
}
