cn.nukkit.event.level.StructureGrowEvent Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of powernukkit Show documentation
Show all versions of powernukkit Show documentation
A Minecraft Bedrock Edition server software implementation made in Java from scratch which supports all new features.
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);
}
}