Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/mcmonkey4eva/Denizen
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmonkey4eva committed Jan 31, 2017
2 parents 459ea7e + 93bedf8 commit 2ff22e1
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 7 deletions.
Expand Up @@ -3037,7 +3037,7 @@ else if (split.length > 1) {
// <p@player.is_op>
// -->
if (mechanism.matches("is_op") && mechanism.requireBoolean()) {
getPlayerEntity().setOp(mechanism.getValue().asBoolean());
getOfflinePlayer().setOp(mechanism.getValue().asBoolean());
}

// <--[mechanism]
Expand Down
Expand Up @@ -1460,6 +1460,9 @@ public void registerCoreMembers() {
// @Description
// The flag command sets or modifies custom value storage database entries connected to
// each player, each NPC, each entity, and the server.
// All the flag values are stored default in "plugins/denizen/saves.yml" file.
// For an alternative way of storing values, use either yaml (See <@link command yaml>)
// or sql (See <@link command sql>)
// TODO: Document Command Details
//
// @Tags
Expand Down Expand Up @@ -1615,6 +1618,11 @@ public void registerCoreMembers() {
//
// @Description
// Gives the linked player or inventory any form of giveable object, including items, xp, or money.
// If the player's inventory if full, the item will be dropped at the inventory location.
// Specifying a slot will give the player the item to that slot.
// If an item is already in that slot, the item will not be given
// unless they are exactly the same items, then it will stack.
// If an economy is registered, specifying money instead of a item will give money to the player's economy.
// TODO: Document Command Details
//
// @Tags
Expand All @@ -1630,7 +1638,11 @@ public void registerCoreMembers() {
//
// @Usage
// Use to give an item to the player.
// - give i@iron_sword quantity:1
// - give i@iron_sword
//
// @Usage
// Use to give an item and place it in a specific slot if possible.
// - give WATCH slot:5
// -->
registerCoreMember(GiveCommand.class,
"GIVE", "give [money/xp/<item>|...] (qty:<#>) (engrave) (to:<inventory>) (slot:<#>)", 1);
Expand Down Expand Up @@ -2425,7 +2437,12 @@ public void registerCoreMembers() {
// - modifyblock cu@<player.location>|<player.location.cursor_on> li@stone|dirt li@25|25
//
// @Usage
// TODO: Document Command Details
// Use to clear the area around the player and drop their respective items.
// - modifyblock <player.location> air radius:5 naturally delayed
//
// @Usage
// Use to modify the ground beneath the player's feet.
// - modifyblock cu@<player.location.add[2,-1,2]>|<player.location.add[-2,-1,-2]> WOOL,14
// -->
registerCoreMember(ModifyBlockCommand.class,
"MODIFYBLOCK", "modifyblock [<location>|.../<ellipsoid>/<cuboid>] [<material>|...] (radius:<#>) (height:<#>) (depth:<#>) (no_physics/naturally) (delayed) (<script>) (<percent chance>|...)", 2);
Expand Down Expand Up @@ -2643,7 +2660,16 @@ public void registerCoreMembers() {
// None
//
// @Usage
// TODO: Document Command Details
// Use to create a fake explosion.
// - playeffect <player.location> effect:EXPLOSION_HUGE visibility:500 quantity:10 offset:2.0
//
// @Usage
// Use to play a cloud effect.
// - playeffect <player.location.add[0,5,0]> effect:CLOUD quantity:20 data:1 offset:0.0
//
// @Usage
// Use to play some effects at spawn.
// - playeffect <w@world.spawn_location> effect:FIREWORKS_SPARK visibility:100 quantity:375 data:0 offset:50.0
// -->
registerCoreMember(PlayEffectCommand.class,
"PLAYEFFECT", "playeffect [<location>|...] [effect:<name>] (data:<#.#>) (visibility:<#.#>) (qty:<#>) (offset:<#.#>,<#.#>,<#.#>) (targets:<player>|...)", 2);
Expand Down Expand Up @@ -3096,7 +3122,7 @@ public void registerCoreMembers() {
// Specifying context or definitions as argument
// allows the transfer oof definitions to the new queue.
// Definitions are not carried over if not specified.
// (See <a href="/cmds/Define">command/Define</a>)
// (See <@link command define>)
//
// Specifying a player argument will run the queue with a player attached
// to that queue. The same can be done to attach an npc.
Expand Down Expand Up @@ -3761,14 +3787,28 @@ public void registerCoreMembers() {
// @Group item
//
// @Description
// TODO: Document Command Details
// Takes items from a player or inventory.
// If the player or inventory does not have the item being taken, nothing happens.
// Specifying a slot will take the items from that specific slot.
// If an economy is registered, specifying money instead of a item will take money from the player's economy.
// If no quantity is specified, it is assmued one.
//
// @Tags
// <p@player.item_in_hand>
// <p@player.money>
//
// @Usage
// TODO: Document Command Details
// Use to take money from the player
// - take money quantity:10
// @Usage
// Use to take an arrow from the player's enderchest
// - take arrow from:<player.enderchest>
// @Usage
// Use to take the current holding item from the player's hand
// - take iteminhand
// @Usage
// Use to take 5 emeralds from the player's inventory
// - take emerald quantity:5
// -->
registerCoreMember(TakeCommand.class,
"TAKE", "take [money/iteminhand/bydisplay:<name>/bycover:<title>|<author>/slot:<#>/<item>|...] (qty:<#>) (from:<inventory>)", 1);
Expand Down
Expand Up @@ -210,6 +210,9 @@ public void checkHeld(dEntity entity) {
for (int i = 0; i < held.size(); i++) {
ScriptEntry entry = held.get(i);
List<dEntity> waitForEntities = (List<dEntity>) entry.getObject("entities");
if (waitForEntities == null) {
continue;
}
waitForEntities.remove(entity);
if (waitForEntities.isEmpty()) {
if (!entry.hasObject("tally") || ((List<dNPC>) entry.getObject("tally")).isEmpty()) {
Expand Down
Expand Up @@ -56,6 +56,11 @@ public void checkHeld(NavigationEvent e) {
// Get all NPCs associated with the entry. They must all
// finish navigation before the entry can be let go
List<dNPC> tally = (List<dNPC>) entry.getObject("tally");

if (tally == null) {
continue;
}

for (int x = 0; x < tally.size(); x++) {
if (!tally.get(x).isSpawned()) {
tally.remove(x--);
Expand Down

0 comments on commit 2ff22e1

Please sign in to comment.