use of gg.projecteden.nexus.models.cooldown.CooldownService in project Nexus by ProjectEdenGG.
the class Pride20Listener method onBalloonNPCClick.
@EventHandler
public void onBalloonNPCClick(NPCRightClickEvent event) {
if (event.getNPC().getId() != 2771)
return;
Player player = event.getClicker();
CooldownService cooldownService = new CooldownService();
if (!cooldownService.check(player, "prideDyeBomb", TickTime.MINUTE.x(1)))
return;
PlayerUtils.send(player, "&3Vendor > &eSadly all my balloons have uh... floated away, but I can give you this to play with");
DyeBombCommand.giveDyeBomb(player, 5);
}
use of gg.projecteden.nexus.models.cooldown.CooldownService in project Nexus by ProjectEdenGG.
the class Pride20Listener method onRegionEnter.
@EventHandler
public void onRegionEnter(PlayerEnteredRegionEvent event) {
if (!event.getRegion().getId().equalsIgnoreCase("pride20"))
return;
CooldownService cooldownService = new CooldownService();
if (!cooldownService.check(event.getPlayer(), "pride20enter", TickTime.MINUTE.x(5)))
return;
PlayerUtils.send(event.getPlayer(), "&eWelcome to the Pride Parade!" + " &3Have a look at all the colorful floats and roam around the city. If you'd like to join the parade, " + "type &c/pride20 parade join &3while standing where you want to be in the parade. &eEnjoy and happy pride!");
}
use of gg.projecteden.nexus.models.cooldown.CooldownService 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());
}
use of gg.projecteden.nexus.models.cooldown.CooldownService in project Nexus by ProjectEdenGG.
the class Effects method onClickNetherBrickStair.
// Netherbrick chairs
@EventHandler
public void onClickNetherBrickStair(PlayerInteractEvent event) {
Player player = event.getPlayer();
Block clicked = player.getTargetBlockExact(2);
if (!event.getAction().equals(Action.RIGHT_CLICK_BLOCK))
return;
if (clicked == null)
return;
if (!isInWorld(clicked))
return;
if (!(new CooldownService().check(player, "AeveonProject_Sit", TickTime.SECOND.x(2))))
return;
if (clicked.getType().equals(Material.NETHER_BRICK_STAIRS)) {
PlayerUtils.runCommandAsOp(player, "sit");
}
}
use of gg.projecteden.nexus.models.cooldown.CooldownService in project Nexus by ProjectEdenGG.
the class Tip method show.
public boolean show(TipType tipType) {
if (!isOnline())
throw new PlayerNotOnlineException(this);
if (!received.contains(tipType)) {
received.add(tipType);
new TipService().save(this);
return true;
}
if (!new CooldownService().check(uuid, "Tip-" + tipType.name(), tipType.getCooldown()))
return false;
if (tipType.getPredicate() != null)
if (!tipType.getPredicate().test(getOnlinePlayer()))
return false;
if (tipType.getRetryChance() > 0)
return RandomUtils.chanceOf(tipType.getRetryChance());
return true;
}
Aggregations