Skip to content

Commit

Permalink
Add dPlayer.item_on_cursor mechanism
Browse files Browse the repository at this point in the history
  • Loading branch information
Morphan1 committed Aug 9, 2015
1 parent 17de417 commit d48b4be
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion src/main/java/net/aufdemrand/denizen/objects/dPlayer.java
Expand Up @@ -1252,7 +1252,7 @@ else if (isOnline())
// @attribute <p@player.item_on_cursor>
// @returns dItem
// @description
// returns a dItem that the player's cursor is on, if any. This includes
// Returns the item on the player's cursor, if any. This includes
// chest interfaces, inventories, and hotbars, etc.
// -->
if (attribute.startsWith("item_on_cursor"))
Expand Down Expand Up @@ -1859,6 +1859,20 @@ public void adjust(Mechanism mechanism) {
}
}

// <--[tag]
// @object dPlayer
// @name item_on_cursor
// @input dItem
// @description
// Sets the item on the player's cursor. This includes
// chest interfaces, inventories, and hotbars, etc.
// @tags
// <p@player.item_on_cursor>
// -->
if (mechanism.matches("item_on_cursor") && mechanism.requireObject(dItem.class)) {
getPlayerEntity().setItemOnCursor(value.asType(dItem.class).getItemStack());
}

// <--[mechanism]
// @object dPlayer
// @name award_achievement
Expand Down

0 comments on commit d48b4be

Please sign in to comment.