Search in sources :

Example 1 with QuestNPC

use of gg.projecteden.nexus.features.events.y2020.halloween20.models.QuestNPC in project Nexus by ProjectEdenGG.

the class Pugmas20 method createNpcHolograms.

public static void createNpcHolograms() {
    deleteNpcHolograms();
    for (QuestNPC questNPC : QuestNPC.values()) {
        NPC npc = CitizensUtils.getNPC(questNPC.getId());
        Hologram hologram = HologramsAPI.createHologram(Nexus.getInstance(), npc.getStoredLocation().clone().add(0, 3.15, 0));
        hologram.appendItemLine(new ItemStack(Material.EMERALD));
        holograms.add(hologram);
    }
}
Also used : NPC(net.citizensnpcs.api.npc.NPC) QuestNPC(gg.projecteden.nexus.features.events.y2020.pugmas20.models.QuestNPC) Hologram(com.gmail.filoghost.holographicdisplays.api.Hologram) QuestNPC(gg.projecteden.nexus.features.events.y2020.pugmas20.models.QuestNPC) ItemStack(org.bukkit.inventory.ItemStack)

Example 2 with QuestNPC

use of gg.projecteden.nexus.features.events.y2020.halloween20.models.QuestNPC in project Nexus by ProjectEdenGG.

the class Halloween20 method onNPCClick.

// Talking NPCs Handler
@EventHandler
public void onNPCClick(NPCRightClickEvent event) {
    QuestNPC npc = QuestNPC.getByID(event.getNPC().getId());
    if (npc == null)
        return;
    if (!new CooldownService().check(event.getClicker(), "Halloween20_NPC", TickTime.SECOND.x(2)))
        return;
    npc.sendScript(event.getClicker());
}
Also used : QuestNPC(gg.projecteden.nexus.features.events.y2020.halloween20.models.QuestNPC) CooldownService(gg.projecteden.nexus.models.cooldown.CooldownService) EventHandler(org.bukkit.event.EventHandler)

Aggregations

Hologram (com.gmail.filoghost.holographicdisplays.api.Hologram)1 QuestNPC (gg.projecteden.nexus.features.events.y2020.halloween20.models.QuestNPC)1 QuestNPC (gg.projecteden.nexus.features.events.y2020.pugmas20.models.QuestNPC)1 CooldownService (gg.projecteden.nexus.models.cooldown.CooldownService)1 NPC (net.citizensnpcs.api.npc.NPC)1 EventHandler (org.bukkit.event.EventHandler)1 ItemStack (org.bukkit.inventory.ItemStack)1