Skip to content

Commit

Permalink
document griefprevention mechs
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmonkey4eva committed Jul 18, 2020
1 parent 529fde5 commit 59ca059
Showing 1 changed file with 23 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ else if (attribute.startsWith("blocks")) {
// @attribute <PlayerTag.griefprevention.blocks.bonus>
// @returns ElementTag(Number)
// @plugin Depenizen, GriefPrevention
// @mechanism PlayerTag.bonus_blocks
// @description
// Returns the number of bonus claim blocks the player has.
// -->
Expand All @@ -134,6 +135,7 @@ else if (attribute.startsWith("total")) {
// @attribute <PlayerTag.griefprevention.blocks>
// @returns ElementTag(Number)
// @plugin Depenizen, GriefPrevention
// @mechanism PlayerTag.normal_blocks
// @description
// Returns the number of normal claim blocks the payer has.
// -->
Expand All @@ -147,10 +149,31 @@ else if (attribute.startsWith("total")) {

@Override
public void adjust(Mechanism mechanism) {

// <--[mechanism]
// @object PlayerTag
// @name bonus_blocks
// @input ElementTag(Number)
// @plugin Depenizen, GriefPrevention
// @description
// Sets the player's bonus claim blocks.
// @tags
// <PlayerTag.griefprevention.blocks.bonus>
// -->
if (mechanism.matches("bonus_blocks") && mechanism.requireInteger()) {
data.setBonusClaimBlocks(mechanism.getValue().asInt());
}

// <--[mechanism]
// @object PlayerTag
// @name normal_blocks
// @input ElementTag(Number)
// @plugin Depenizen, GriefPrevention
// @description
// Sets the player's accrued claim blocks.
// @tags
// <PlayerTag.griefprevention.blocks>
// -->
if (mechanism.matches("normal_blocks") && mechanism.requireInteger()) {
data.setAccruedClaimBlocks(mechanism.getValue().asInt());
}
Expand Down

0 comments on commit 59ca059

Please sign in to comment.