Skip to content

Commit

Permalink
Add <co@color.to_particle_offset>
Browse files Browse the repository at this point in the history
Example: /ex playeffect <pl.eye_location> effect:red_dust data:1 qty:0
offset:<co@orange.to_particle_offset>
  • Loading branch information
Morphan1 committed Jul 16, 2015
1 parent 6e0cfb6 commit c910c7d
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/main/java/net/aufdemrand/denizen/objects/dColor.java
Expand Up @@ -292,6 +292,21 @@ public String getAttribute(Attribute attribute) {
dB.echoError("'" + attribute.getContext(1) + "' is not a valid color!");
}

// <--[tag]
// @attribute <co@color.to_particle_offset>
// @returns dLocation
// @description
// Returns the color as a particle offset, for use with PlayEffect.
// -->
if (attribute.startsWith("to_particle_offset")) {
Color valid = color;
if (valid.asRGB() == 0) {
valid = Color.fromRGB(1, 0, 0);
}
return new dLocation(null, valid.getRed()/255F, valid.getGreen()/255F, valid.getBlue()/255F)
.getAttribute(attribute.fulfill(1));
}

// <--[tag]
// @attribute <co@color.type>
// @returns Element
Expand Down

0 comments on commit c910c7d

Please sign in to comment.