Search in sources :

Example 1 with NPCMenu

use of xyz.derkades.ublisk.quest.npcmenu.NPCMenu in project Ublisk by Derkades.

the class TestNPC method talk.

@Override
public void talk(UPlayer player) {
    final QuestParticipant qp = player.getQuestParticipant(Quest.UNKNOWN, this);
    /*ClickAction action = new ClickAction(){

			@Override
			public void click(ClickedOption option) {
				qp.sendMessage("TEST!");
			}
			
		};*/
    // Option option1 = new Option(10, Material.STONE, "Some random option", "Some lore!", "Line 2");
    // Option option2 = new Option(11, Material.WOOD, "Option without lore");
    // qp.openMenu(new NPCMenu("Test Menu", action, option1, option2));
    new NPCMenu("Test Menu", 3 * 9, qp) {

        @Override
        public void open() {
            items.put(10, new ItemBuilder(Material.STONE).name("Some random option").lore("Some lore!", "Lines 2").create());
            items.put(11, new ItemBuilder(Material.WOOD).name("Option without lore").create());
            super.open();
        }

        @Override
        public boolean onOptionClick(OptionClickEvent event) {
            qp.sendMessage("TEST!");
            return false;
        }
    }.open();
}
Also used : QuestParticipant(xyz.derkades.ublisk.quest.QuestParticipant) ItemBuilder(xyz.derkades.derkutils.bukkit.ItemBuilder) NPCMenu(xyz.derkades.ublisk.quest.npcmenu.NPCMenu)

Aggregations

ItemBuilder (xyz.derkades.derkutils.bukkit.ItemBuilder)1 QuestParticipant (xyz.derkades.ublisk.quest.QuestParticipant)1 NPCMenu (xyz.derkades.ublisk.quest.npcmenu.NPCMenu)1