Search in sources :

Example 1 with ComboLockNumber

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

the class Halloween20 method onInteract.

// ComboLock Handler
@EventHandler
public void onInteract(PlayerInteractEvent event) {
    if (!Utils.ActionGroup.CLICK_BLOCK.applies(event))
        return;
    if (!worldguard().getPlayersInRegion(region).contains(event.getPlayer()))
        return;
    if (event.getHand() != EquipmentSlot.HAND)
        return;
    ComboLockNumber number = ComboLockNumber.getByLocation(event.getClickedBlock().getLocation());
    if (number == null)
        return;
    event.setCancelled(true);
    Tasks.wait(1, () -> number.onFind(event.getPlayer()));
}
Also used : ComboLockNumber(gg.projecteden.nexus.features.events.y2020.halloween20.models.ComboLockNumber) EventHandler(org.bukkit.event.EventHandler)

Aggregations

ComboLockNumber (gg.projecteden.nexus.features.events.y2020.halloween20.models.ComboLockNumber)1 EventHandler (org.bukkit.event.EventHandler)1