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

de.placeblock.betterinventories.builder.content.BaseGUIItemBuilder Maven / Gradle / Ivy

There is a newer version: 2.2.0
Show newest version
package de.placeblock.betterinventories.builder.content;

import de.placeblock.betterinventories.content.item.GUIItem;
import de.placeblock.betterinventories.gui.GUI;
import org.bukkit.inventory.ItemStack;

/**
 * Base class for creating GUIITem-Builders
 * @param  The GUIItem type
 * @param  The Builder type
 */
@SuppressWarnings("unchecked")
public abstract class BaseGUIItemBuilder> extends BaseGUISectionBuilder {
    /**
     * The ItemStack of the GUIItem
     */
    private ItemStack item;

    /**
     * Creates a new BaseGUIItemBuilder
     * @param gui The GUI for the Item
     */
    public BaseGUIItemBuilder(GUI gui) {
        super(gui);
    }

    /**
     * Sets the ItemStack of the GUIItem
     * @param item The ItemStack
     * @return this
     */
    public B item(ItemStack item) {
        this.item = item;
        return (B) this;
    }

    /**
     * @return The ItemStack of the GUIItem
     */
    protected ItemStack getItem() {
        return this.getValue(this.item);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy