Search in sources :

Example 1 with FrameworkView

use of dev.rosewood.guiframework.framework.gui.FrameworkView in project RoseStacker by Rosewood-Development.

the class StackedBlockGui method openFor.

/**
 * Opens the GUI for a player
 *
 * @param player The player to open the GUI for
 */
public void openFor(Player player) {
    if (this.isInvalid())
        this.buildGui();
    this.guiContainer.openFor(player);
    // TODO: Add support for switching the currently viewed page directly to GuiFramework instead, this works for now
    FrameworkView view = (FrameworkView) this.guiContainer.getCurrentViewers().get(player.getUniqueId());
    if (view != null) {
        view.setViewingPage(view.getViewingScreen().getMaximumPageNumber() - 1);
        player.openInventory(view.getViewingScreen().getInventory(view.getViewingPage()));
    }
}
Also used : FrameworkView(dev.rosewood.guiframework.framework.gui.FrameworkView)

Aggregations

FrameworkView (dev.rosewood.guiframework.framework.gui.FrameworkView)1