Skip to content

Commit

Permalink
Add tag queue.definition[name]
Browse files Browse the repository at this point in the history
A way to read defs off other queues
  • Loading branch information
mcmonkey4eva committed Sep 25, 2014
1 parent 6af33b1 commit b11be3d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
Expand Up @@ -4,16 +4,12 @@
import net.aufdemrand.denizen.events.SmartEvent;
import net.aufdemrand.denizen.objects.Element;
import net.aufdemrand.denizen.objects.dLocation;
import net.aufdemrand.denizen.objects.dMaterial;
import net.aufdemrand.denizen.objects.dObject;
import net.aufdemrand.denizen.utilities.DenizenAPI;
import net.aufdemrand.denizen.utilities.debugging.dB;
import org.bukkit.Material;
import org.bukkit.block.BlockFace;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.block.BlockRedstoneEvent;
import org.bukkit.event.entity.EntityChangeBlockEvent;

import java.util.Arrays;
import java.util.HashMap;
Expand Down
Expand Up @@ -854,6 +854,18 @@ public String getAttribute(Attribute attribute) {
return new dList(getAllDefinitions().keySet()).getAttribute(attribute.fulfill(1));
}

// <--[tag]
// @attribute <q@queue.definition[<definition>]>
// @returns dList
// @description
// Returns the value of the specified definition.
// Returns null if the queue lacks the definition.
// -->
if (attribute.startsWith("definition")
&& attribute.hasContext(1)) {
return new Element(getDefinition(attribute.getContext(1))).getAttribute(attribute.fulfill(1));
}

// <--[tag]
// @attribute <q@queue.npc>
// @returns dNPC
Expand Down

0 comments on commit b11be3d

Please sign in to comment.