Skip to content

Commit

Permalink
Allow plugins to add on to Location, NPC, and server tags
Browse files Browse the repository at this point in the history
  • Loading branch information
Morphan1 committed Aug 12, 2013
1 parent b2fa7ca commit e64da68
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
Expand Up @@ -81,8 +81,10 @@ public void execute(ScriptEntry scriptEntry) throws CommandExecutionException {
for (int x = 0; x < possibilities; x++) {

if (bracketsEntered > 0) {
if (queue.getEntry(0).getArguments().contains("}"))
if (queue.getEntry(0).getArguments().contains("}")) {
dB.echoDebug("Leaving brackets...");
bracketsEntered--;
}

if (selectedBrackets) {
keeping.add(queue.getEntry(0));
Expand Down
Expand Up @@ -24,7 +24,8 @@ public LocationTags(Denizen denizen) {

@EventHandler
public void locationTags(ReplaceableTagEvent event) {
if (!event.matches("location, l")) return;

if (!event.matches("location, l") || event.replaced()) return;

// Stage the location
dLocation loc = null;
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/net/aufdemrand/denizen/tags/core/NPCTags.java
Expand Up @@ -29,7 +29,8 @@ public NPCTags(Denizen denizen) {

@EventHandler
public void npcTags(ReplaceableTagEvent event) {
if (!event.matches("npc")) return;

if (!event.matches("npc") || event.replaced()) return;

// Build a new attribute out of the raw_tag supplied in the script to be fulfilled
Attribute attribute = new Attribute(event.raw_tag, event.getScriptEntry());
Expand Down
Expand Up @@ -88,7 +88,7 @@ public void queueTags(ReplaceableTagEvent event) {

@EventHandler
public void serverTags(ReplaceableTagEvent event) {
if (!event.matches("server, svr, global")) return;
if (!event.matches("server, svr, global") || event.replaced()) return;
Attribute attribute =
new Attribute(event.raw_tag, event.getScriptEntry()).fulfill(1);

Expand Down

0 comments on commit e64da68

Please sign in to comment.