Skip to content

Commit

Permalink
Add tag element.to_itemscript_hash
Browse files Browse the repository at this point in the history
Yay for better item script control via elements.
  • Loading branch information
mcmonkey4eva committed Nov 15, 2014
1 parent 752f782 commit 2689478
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
14 changes: 14 additions & 0 deletions src/main/java/net/aufdemrand/denizen/objects/Element.java
Expand Up @@ -11,6 +11,7 @@
import net.aufdemrand.denizen.scripts.ScriptRegistry;
import net.aufdemrand.denizen.scripts.commands.core.Comparable;
import net.aufdemrand.denizen.scripts.containers.core.FormatScriptContainer;
import net.aufdemrand.denizen.scripts.containers.core.ItemScriptHelper;
import net.aufdemrand.denizen.scripts.queues.ScriptQueue;
import net.aufdemrand.denizen.tags.Attribute;
import net.aufdemrand.denizen.tags.TagManager;
Expand Down Expand Up @@ -1847,6 +1848,19 @@ else if (element.toLowerCase().contains(contains.toLowerCase()))
.getAttribute(attribute.fulfill(1));
}


// <--[tag]
// @attribute <el@element.to_itemscript_hash>
// @returns Element(Number)
// @group conversion
// @description
// Shortens the element down to an itemscript hash ID, made of invisible color codes.
// -->
if (attribute.startsWith("to_itemscript_hash")) {
return new Element(ItemScriptHelper.createItemScriptID(element))
.getAttribute(attribute.fulfill(1));
}

// <--[tag]
// @attribute <el@element.type>
// @returns Element
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/config.yml
Expand Up @@ -101,7 +101,7 @@ Tags:
# Settings for tags like cuboid.get_blocks, location.find.blocks, ...
Block tags:
# How many blocks can be read, max, before stopping the tag in place
max blocks: 1000000
Max blocks: 1000000


# The version of this configuration file, used to check if your
Expand Down

0 comments on commit 2689478

Please sign in to comment.