use of au.com.mineauz.minigamesregions.triggers.Trigger in project Minigames by AddstarMC.
the class RegionEvents method itemPickupEvent.
@EventHandler(ignoreCancelled = true)
private void itemPickupEvent(PlayerPickupItemEvent event) {
final MinigamePlayer ply = pdata.getMinigamePlayer(event.getPlayer());
if (ply == null)
return;
if (ply.isInMinigame()) {
final Trigger trig = Triggers.getTrigger("ITEM_PICKUP");
Bukkit.getScheduler().scheduleSyncDelayedTask(plugin, new Runnable() {
@Override
public void run() {
if (!ply.isInMinigame()) {
return;
}
for (Node node : getRegionModule(ply.getMinigame()).getNodes()) {
node.execute(trig, ply);
}
for (Region region : getRegionModule(ply.getMinigame()).getRegions()) {
if (region.hasPlayer(ply)) {
region.execute(trig, ply);
}
}
}
});
}
}
use of au.com.mineauz.minigamesregions.triggers.Trigger in project Minigames by AddstarMC.
the class RegionEvents method itemPickupEvent.
@EventHandler(ignoreCancelled = true)
private void itemPickupEvent(PlayerDropItemEvent event) {
final MinigamePlayer ply = pdata.getMinigamePlayer(event.getPlayer());
if (ply.isInMinigame()) {
final Trigger trig = Triggers.getTrigger("ITEM_DROP");
Bukkit.getScheduler().scheduleSyncDelayedTask(plugin, executeScriptObjects(ply, trig));
}
}
use of au.com.mineauz.minigamesregions.triggers.Trigger in project Minigames by AddstarMC.
the class RegionEvents method itemPickupEvent.
@EventHandler(ignoreCancelled = true)
private void itemPickupEvent(EntityPickupItemEvent event) {
if (!(event.getEntity() instanceof Player))
return;
final MinigamePlayer ply = pdata.getMinigamePlayer(((Player) event.getEntity()));
if (ply.isInMinigame()) {
final Trigger trig = Triggers.getTrigger("ITEM_PICKUP");
Bukkit.getScheduler().scheduleSyncDelayedTask(plugin, executeScriptObjects(ply, trig));
}
}
Aggregations