Skip to content
Permalink
Browse files

Fixed about not showing the git hash. Also added support for it being…

… overriden by versions.
  • Loading branch information...
me4502 committed Dec 23, 2016
1 parent 029b475 commit 9f4e7b4b23e96a54ab2ae9e53c27c9223b6378b3
19 pom.xml
@@ -264,6 +264,25 @@
</configuration>
</plugin>

<plugin>
<groupId>com.lukegb.mojo</groupId>
<artifactId>gitdescribe-maven-plugin</artifactId>
<version>3.0</version>
<executions>
<execution>
<goals>
<goal>gitdescribe</goal>
</goals>
<id>git-describe</id>
<phase>initialize</phase>
<configuration>
<extraArguments>
<param>--exact-match</param>
</extraArguments>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
@@ -52,6 +52,7 @@
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.plugin.java.JavaPlugin;

import javax.annotation.Nullable;
import java.io.*;
import java.security.NoSuchAlgorithmException;
import java.security.SecureRandom;
@@ -227,24 +228,9 @@ public CraftBookPlugin() {
instance = this;
}

@Nullable
public static String getVersion() {

return "3.9";
}

/**
* Gets the build equivalent of the last stable version.
*
* @return the build number
*/
public static String getStableBuild() {

return "DISABLE";//"3895";
}

public static int getUpdaterID() {

return 31055;
return null;
}

public List<CraftBookMechanic> getMechanics() {
@@ -102,10 +102,11 @@ public void reload(CommandContext context, CommandSender sender) {
public void about(CommandContext context, CommandSender sender) {

String ver = CraftBookPlugin.inst().getDescription().getVersion();
if(ver.split("-")[0].equalsIgnoreCase(CraftBookPlugin.getStableBuild()))
if(CraftBookPlugin.getVersion() != null) {
ver = CraftBookPlugin.getVersion();
}
sender.sendMessage(ChatColor.YELLOW + "CraftBook version " + ver);
sender.sendMessage(ChatColor.YELLOW + "Founded by sk89q, and currently developed by me4502 & Dark_Arc");
sender.sendMessage(ChatColor.YELLOW + "Founded by sk89q, and currently developed by Me4502 & Dark_Arc");
}

@Command(aliases = {"report"}, desc = "Writes a report on CraftBook", flags = "pi", max = 0)
@@ -1,6 +1,6 @@
name: CraftBook
main: com.sk89q.craftbook.bukkit.CraftBookPlugin
version: "${project.version}"
version: "${project.version}-${describe}"
dev-url: http://dev.bukkit.org/server-mods/craftbook/
softdepend: [WorldEdit, WorldGuard, ProtocolLib, Vault]
commands:

0 comments on commit 9f4e7b4

Please sign in to comment.
You can’t perform that action at this time.