Skip to content

Commit

Permalink
Add build number to "/denizen version", "Unknown" if it's a local build
Browse files Browse the repository at this point in the history
  • Loading branch information
Morphan1 committed Aug 18, 2013
1 parent 087e126 commit 0470c1b
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 4 deletions.
13 changes: 13 additions & 0 deletions pom.xml
Expand Up @@ -17,6 +17,7 @@
<json.version>20090211</json.version>
<citizens.version>2.0.9-SNAPSHOT</citizens.version>
<build.number>Unknown</build.number>
<BUILD_NUMBER>Unknown</BUILD_NUMBER>
</properties>

<!-- Repositories -->
Expand Down Expand Up @@ -126,6 +127,18 @@
</scm>

<build>
<defaultGoal>clean package install</defaultGoal>

<resources>
<resource>
<targetPath>.</targetPath>
<filtering>true</filtering>
<directory>${basedir}/src/main/resources</directory>
<includes>
<include>plugin.yml</include>
</includes>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand Down
4 changes: 3 additions & 1 deletion src/main/java/net/aufdemrand/denizen/Denizen.java
Expand Up @@ -47,7 +47,7 @@

public class Denizen extends JavaPlugin {
public final static int configVersion = 2;
public final static String versionTag = "0.9.2";
public static String versionTag = null;

private boolean startedSuccessful = false;

Expand Down Expand Up @@ -138,6 +138,8 @@ public void onEnable() {
return;
} else startedSuccessful = true;

versionTag = getServer().getPluginManager().getPlugin("Denizen").getDescription().getVersion();

// Startup procedure
dB.echoDebug(DebugElement.Footer);
dB.echoDebug(ChatColor.YELLOW + " _/_ _ ._ _ _ ");
Expand Down
Expand Up @@ -652,7 +652,7 @@ else if (shooter.isPlayer()) {
subEvents.add(damagerType + " kills " + entityType);
}

determination = doEvents(subEvents, subNPC, (subPlayer != null?subPlayer.getPlayerEntity():null), context);
determination = doEvents(subEvents, (subNPC != null ? subNPC : null), (subPlayer != null?subPlayer.getPlayerEntity():null), context);

if (determination.toUpperCase().startsWith("CANCELLED"))
event.setCancelled(true);
Expand All @@ -663,7 +663,7 @@ else if (Argument.valueOf(determination)
}
}

determination = doEvents(events, npc,
determination = doEvents(events, (npc != null ? npc : null),
(player != null && player.isOnline() ? player.getPlayerEntity() : null), context);

if (determination.toUpperCase().startsWith("CANCELLED"))
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/plugin.yml
@@ -1,6 +1,6 @@
name: Denizen
author: aufdemrand
version: 0.9.2-SNAPSHOT
version: ${project.version} (build ${BUILD_NUMBER})
main: net.aufdemrand.denizen.Denizen
depend: [Citizens]
softdepend: [Vault, WorldGuard]
Expand Down

0 comments on commit 0470c1b

Please sign in to comment.