Skip to content

Commit

Permalink
structure grows: player link, world loads: deconflict with crossbow
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmonkey4eva committed Jun 12, 2021
1 parent d4055e0 commit 2cd36d4
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@
import com.denizenscript.denizen.objects.MaterialTag;
import com.denizenscript.denizen.objects.WorldTag;
import com.denizenscript.denizen.events.BukkitScriptEvent;
import com.denizenscript.denizen.utilities.implementation.BukkitScriptEntryData;
import com.denizenscript.denizencore.objects.core.ElementTag;
import com.denizenscript.denizencore.objects.core.ListTag;
import com.denizenscript.denizencore.objects.ObjectTag;
import com.denizenscript.denizencore.scripts.ScriptEntryData;
import com.denizenscript.denizencore.utilities.CoreUtilities;
import org.bukkit.TreeType;
import org.bukkit.block.BlockState;
Expand All @@ -31,6 +33,8 @@ public class StructureGrowsScriptEvent extends BukkitScriptEvent implements List
//
// @Cancellable true
//
// @Player when a player caused the structure growth to occur (eg with bonemeal).
//
// @Triggers when a structure (a tree or a mushroom) grows in a world.
//
// @Context
Expand Down Expand Up @@ -85,6 +89,11 @@ public String getName() {
return "StructureGrow";
}

@Override
public ScriptEntryData getScriptEntryData() {
return new BukkitScriptEntryData(event.getPlayer());
}

@Override
public ObjectTag getContext(String name) {
switch (name) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ public boolean couldMatch(ScriptPath path) {
if (!path.eventArgLowerAt(1).equals("loads")) {
return false;
}
if (path.eventArgLowerAt(2).equals("crossbow")) {
return false;
}
return true;
}

Expand Down

0 comments on commit 2cd36d4

Please sign in to comment.