Search in sources :

Example 31 with Duration

use of net.aufdemrand.denizencore.objects.Duration in project Denizen-For-Bukkit by DenizenScript.

the class WaitCommand method execute.

@Override
public void execute(ScriptEntry scriptEntry) throws CommandExecutionException {
    ScriptQueue queue = (ScriptQueue) scriptEntry.getObject("queue");
    Duration delay = (Duration) scriptEntry.getObject("delay");
    dB.report(scriptEntry, getName(), aH.debugObj("queue", queue.id) + delay.debug());
    // Tell the queue to delay
    if (queue instanceof Delayable) {
        ((Delayable) queue).delayFor(delay);
    } else {
        scriptEntry.setInstant(false);
        dB.echoDebug(scriptEntry, "Forcing queue " + queue.id + " into a timed queue...");
        queue.forceToTimed(delay);
    }
}
Also used : Duration(net.aufdemrand.denizencore.objects.Duration) Delayable(net.aufdemrand.denizencore.scripts.queues.core.Delayable) ScriptQueue(net.aufdemrand.denizencore.scripts.queues.ScriptQueue)

Aggregations

Duration (net.aufdemrand.denizencore.objects.Duration)31 Element (net.aufdemrand.denizencore.objects.Element)20 net.aufdemrand.denizencore.objects.dList (net.aufdemrand.denizencore.objects.dList)12 net.aufdemrand.denizen.objects.dEntity (net.aufdemrand.denizen.objects.dEntity)11 InvalidArgumentsException (net.aufdemrand.denizencore.exceptions.InvalidArgumentsException)10 BukkitScriptEntryData (net.aufdemrand.denizen.BukkitScriptEntryData)9 net.aufdemrand.denizen.objects.dLocation (net.aufdemrand.denizen.objects.dLocation)9 List (java.util.List)7 net.aufdemrand.denizen.objects.dPlayer (net.aufdemrand.denizen.objects.dPlayer)6 CommandExecutionException (net.aufdemrand.denizencore.exceptions.CommandExecutionException)6 net.aufdemrand.denizencore.objects.aH (net.aufdemrand.denizencore.objects.aH)6 net.aufdemrand.denizen.objects.dNPC (net.aufdemrand.denizen.objects.dNPC)5 net.aufdemrand.denizencore.objects.dScript (net.aufdemrand.denizencore.objects.dScript)4 ScriptQueue (net.aufdemrand.denizencore.scripts.queues.ScriptQueue)4 Player (org.bukkit.entity.Player)3 BukkitRunnable (org.bukkit.scheduler.BukkitRunnable)3 net.aufdemrand.denizen.objects.dItem (net.aufdemrand.denizen.objects.dItem)2 net.aufdemrand.denizen.objects.dMaterial (net.aufdemrand.denizen.objects.dMaterial)2 Delayable (net.aufdemrand.denizencore.scripts.queues.core.Delayable)2 BufferedReader (java.io.BufferedReader)1