Skip to content

Commit

Permalink
item script: always track the script in context
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmonkey4eva committed Nov 21, 2019
1 parent 99c73fe commit 6e9a544
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
Expand Up @@ -3177,7 +3177,7 @@ else if (split.length > 1 && new ElementTag(split[1]).isBoolean()) {
// <--[mechanism]
// @object PlayerTag
// @name fake_equipment
// @input EntityTag(|Element|dItem)
// @input EntityTag(|Element|ItemTag)
// @description
// Shows the player fake equipment on the specified living entity, which has
// no real non-visual effects, in the form Entity|Slot|Item, where the slot
Expand Down
Expand Up @@ -174,6 +174,10 @@ public ItemTag getItemFrom(BukkitTagContext context) {
if (context == null) {
context = new BukkitTagContext(null, null, new ScriptTag(this));
}
else {
context = new BukkitTagContext(context);
context.script = new ScriptTag(this);
}
// Try to use this script to make an item.
ItemTag stack = null;
isProcessing = true;
Expand Down
Expand Up @@ -9,8 +9,12 @@
import com.denizenscript.denizencore.tags.TagContext;

public class BukkitTagContext extends TagContext {
public final PlayerTag player;
public final NPCTag npc;
public PlayerTag player;
public NPCTag npc;

public BukkitTagContext(BukkitTagContext copyFrom) {
this(copyFrom.player, copyFrom.npc, copyFrom.instant, copyFrom.entry, copyFrom.debug, copyFrom.script);
}

public BukkitTagContext(PlayerTag player, NPCTag npc, ScriptTag script) {
super(false, script == null || script.getContainer().shouldDebug(), null, script);
Expand Down

0 comments on commit 6e9a544

Please sign in to comment.