45 lines
1.2 KiB
Java
45 lines
1.2 KiB
Java
/*
|
|
* Copyright (c) 2017 univento.eu - All rights reserved
|
|
* You are not allowed to use, distribute or modify this code
|
|
*/
|
|
|
|
package eu.univento.core.api.gui.hologram.components;
|
|
|
|
import eu.univento.core.api.player.CustomPlayer;
|
|
import lombok.Getter;
|
|
import org.bukkit.inventory.ItemStack;
|
|
|
|
import java.util.HashMap;
|
|
|
|
/**
|
|
* @author joethei
|
|
* @version 0.1
|
|
*/
|
|
|
|
@Getter
|
|
public class GUIPage {
|
|
|
|
private HashMap<String, GUIComponent> components;
|
|
private String id;
|
|
private ItemStack item;
|
|
private String itemName;
|
|
private boolean closeOnPlayerMove;
|
|
private boolean closeOnPlayerItemSwitch;
|
|
|
|
public GUIPage(HashMap<String, GUIComponent> components, String id, ItemStack item, String itemName, boolean closeOnPlayerMove, boolean closeOnPlayerItemSwitch) {
|
|
this.components = components;
|
|
this.id = id;
|
|
this.item = item;
|
|
this.itemName = itemName;
|
|
this.closeOnPlayerMove = closeOnPlayerMove;
|
|
this.closeOnPlayerItemSwitch = closeOnPlayerItemSwitch;
|
|
}
|
|
|
|
public PlayerGUIPage getPlayerGUIPage(CustomPlayer player) {
|
|
PlayerGUIPage page = player.getHologramData().getPlayerGUIPage();
|
|
if(page.getPage().getId().equals(id)) {
|
|
return page;
|
|
}
|
|
return null;
|
|
}
|
|
} |