use of com.cyr1en.commandprompter.prompt.ui.inventory.ControlPane in project CommandPrompter by CyR1en.
the class PlayerUIPrompt method sendPrompt.
@Override
public void sendPrompt() {
gui.setOnClose(e -> getPromptManager().cancel(getContext().getSender()));
var p = (Player) getContext().getSender();
var skullPane = new PaginatedPane(0, 0, 9, size - 1);
var isSorted = getPlugin().getPromptConfig().sorted();
var isPerWorld = getPlugin().getPromptConfig().isPerWorld();
var skulls = isPerWorld ? (isSorted ? SkullCache.getSkullsSortedFor(p.getWorld().getPlayers()) : SkullCache.getSkullsFor(p.getWorld().getPlayers())) : (isSorted ? SkullCache.getSkullsSorted() : SkullCache.getSkulls());
skullPane.populateWithItemStacks(skulls);
skullPane.setOnClick(this::processClick);
gui.addPane(skullPane);
gui.addPane(new ControlPane(getPlugin(), skullPane, gui, getContext(), size));
gui.show((HumanEntity) getContext().getSender());
}
Aggregations