Skip to content

Commit

Permalink
Minor Cleanup.
Browse files Browse the repository at this point in the history
  • Loading branch information
aufdemrand committed Jul 4, 2013
1 parent df752ee commit 9c5bf5e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 11 deletions.
Expand Up @@ -21,13 +21,10 @@ public PlayerTags(Denizen denizen) {
denizen.getServer().getPluginManager().registerEvents(this, denizen);
}


///////////
// Player Chat History
/////////

// TODO: Find a better place for this?

public static Map<String, List<String>> playerChatHistory = new ConcurrentHashMap<String, List<String>>(8, 0.9f, 2);

@EventHandler(priority = EventPriority.MONITOR)
Expand Down Expand Up @@ -66,7 +63,8 @@ public void playerTags(ReplaceableTagEvent event) {
if (dPlayer.matches(attribute.getContext(1)))
p = dPlayer.valueOf(attribute.getContext(1));
else {
dB.echoDebug("Could not match '" + attribute.getContext(1) + "' to a valid player!");
dB.echoDebug("Could not match '"
+ attribute.getContext(1) + "' to a valid player!");
return;
}

Expand Down
Expand Up @@ -20,7 +20,7 @@ public ProcedureScriptTag(Denizen denizen) {
}

@EventHandler
public void utilTags(ReplaceableTagEvent event) {
public void procedureTag(ReplaceableTagEvent event) {
if (!event.matches("proc, pr")) return;
if (event.getValue() == null) return;

Expand Down
11 changes: 5 additions & 6 deletions src/main/java/net/aufdemrand/denizen/tags/core/UtilTags.java
Expand Up @@ -29,12 +29,11 @@ public UtilTags(Denizen denizen) {
denizen.getServer().getPluginManager().registerEvents(this, denizen);
}


@EventHandler
public void mathTags(ReplaceableTagEvent event) {
if (!(event.matches("m") || event.matches("math"))) return;
Double evalulation = new DoubleEvaluator().evaluate(event.getValue());
event.setReplaced(String.valueOf(evalulation));
if (!event.matches("math, m")) return;
Double evaluation = new DoubleEvaluator().evaluate(event.getValue());
event.setReplaced(String.valueOf(evaluation));
}

@EventHandler
Expand All @@ -60,8 +59,8 @@ else if (attribute.startsWith("selected_npc")) {


@EventHandler
public void utilTags(ReplaceableTagEvent event) {
if (!event.matches("UTIL, U")) return;
public void miscTags(ReplaceableTagEvent event) {
if (!event.matches("util, u")) return;

String type = event.getType() != null ? event.getType() : "";
String typeContext = event.getTypeContext() != null ? event.getTypeContext() : "";
Expand Down

0 comments on commit 9c5bf5e

Please sign in to comment.