Skip to content

Commit

Permalink
Add is_op mech for dPlayer.
Browse files Browse the repository at this point in the history
add is_whitelisted mech for dPlayer.
  • Loading branch information
Fortifier42 committed Nov 5, 2015
1 parent 81449c1 commit 32cc7ad
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/main/java/net/aufdemrand/denizen/objects/dPlayer.java
Expand Up @@ -2574,6 +2574,28 @@ else if (split.length > 1) {
}
}

// <--[mechanism]
// @object dPlayer
// @name is_whitelisted
// @input Element(Boolean)
// @description
// Changes whether the player is whitelisted or not.
// -->
if (mechanism.matches("is_whitelisted") && mechanism.requireBoolean()) {
getPlayerEntity().setWhitelisted(mechanism.getValue().asBoolean());
}

// <--[mechanism]
// @object dPlayer
// @name is_op
// @input Element(Boolean)
// @description
// Changes whether the player is a server operator or not.
// -->
if (mechanism.matches("is_op") && mechanism.requireBoolean()) {
getPlayerEntity().setOp(mechanism.getValue().asBoolean());
}

// Iterate through this object's properties' mechanisms
for (Property property : PropertyParser.getProperties(this)) {
property.adjust(mechanism);
Expand Down

0 comments on commit 32cc7ad

Please sign in to comment.