All Downloads are FREE. Search and download functionalities are using the official Maven repository.

cn.nukkit.event.level.StructureGrowEvent Maven / Gradle / Ivy

Go to download

A Minecraft Bedrock Edition server software implementation made in Java from scratch which supports all new features.

There is a newer version: 1.6.0.1-PN
Show newest version
package cn.nukkit.event.level;

import cn.nukkit.api.Since;
import cn.nukkit.block.Block;
import cn.nukkit.event.Cancellable;
import cn.nukkit.event.HandlerList;

import java.util.List;
import java.util.Objects;

/**
 * @author KCodeYT (Nukkit Project)
 */
@Since("1.4.0.0-PN")
public class StructureGrowEvent extends LevelEvent implements Cancellable {

    private static final HandlerList handlers = new HandlerList();

    @Since("1.4.0.0-PN")
    public static HandlerList getHandlers() {
        return handlers;
    }

    private final Block block;
    private final List blocks;

    @Since("1.4.0.0-PN")
    public StructureGrowEvent(Block block, List blocks) {
        super(Objects.requireNonNull(block.getLevel()));
        this.block = block;
        this.blocks = blocks;
    }

    @Since("1.4.0.0-PN")
    public Block getBlock() {
        return this.block;
    }

    @Since("1.4.0.0-PN")
    public List getBlockList() {
        return this.blocks;
    }

    @Since("1.4.0.0-PN")
    public void setBlockList(List blocks) {
        this.blocks.clear();
        if(blocks != null)
            this.blocks.addAll(blocks);
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy