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

cn.nukkit.item.randomitem.ConstantItemSelector 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.item.randomitem;

import cn.nukkit.item.Item;

/**
 * @author Snake1999
 * @since 2016/1/15
 */
public class ConstantItemSelector extends Selector {

    protected final Item item;

    public ConstantItemSelector(int id, Selector parent) {
        this(id, 0, parent);
    }

    public ConstantItemSelector(int id, Integer meta, Selector parent) {
        this(id, meta, 1, parent);
    }

    public ConstantItemSelector(int id, Integer meta, int count, Selector parent) {
        this(Item.get(id, meta, count), parent);
    }

    public ConstantItemSelector(Item item, Selector parent) {
        super(parent);
        this.item = item;
    }

    public Item getItem() {
        return item;
    }

    public Object select() {
        return getItem();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy