Introduce better versioning system, mark 2.

By: Luke GB <github@lukegb.com>
This commit is contained in:
CraftBukkit/Spigot 2011-02-01 21:47:28 +00:00
parent 19eadde312
commit 9a102a26c1
2 changed files with 11 additions and 3 deletions

View file

@ -8,6 +8,7 @@
<url>http://www.bukkit.org</url> <url>http://www.bukkit.org</url>
<properties> <properties>
<build.version>unknown</build.version> <build.version>unknown</build.version>
<api.version>unknown</api.version>
</properties> </properties>
<repositories> <repositories>
<repository> <repository>
@ -54,7 +55,12 @@
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer"> <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<manifestEntries> <manifestEntries>
<Main-Class>org.bukkit.craftbukkit.Main</Main-Class> <Main-Class>org.bukkit.craftbukkit.Main</Main-Class>
<Build-Version>${build.version}</Build-Version> <Implementation-Title>CraftBukkit</Implementation-Title>
<Implementation-Version>${build.version}</Implementation-Version>
<Implementation-Vendor>Bukkit Team</Implementation-Title>
<Specification-Title>Bukkit</Specification-Title>
<Specification-Version>${api.version}</Specification-Version>
<Specification-Vendor>Bukkit Team</Specification-Vendor>
</manifestEntries> </manifestEntries>
</transformer> </transformer>
</transformers> </transformers>

View file

@ -19,7 +19,8 @@ import org.bukkit.plugin.java.JavaPluginLoader;
public final class CraftServer implements Server { public final class CraftServer implements Server {
private final String serverName = "Craftbukkit"; private final String serverName = "Craftbukkit";
private final String serverVersion = "1.2_01"; private final String serverVersion;
private final String protocolVersion = "1.2_01";
private final PluginManager pluginManager = new SimplePluginManager(this); private final PluginManager pluginManager = new SimplePluginManager(this);
private final CommandMap commandMap = new SimpleCommandMap(this); private final CommandMap commandMap = new SimpleCommandMap(this);
protected final MinecraftServer console; protected final MinecraftServer console;
@ -28,6 +29,7 @@ public final class CraftServer implements Server {
public CraftServer(MinecraftServer console, ServerConfigurationManager server) { public CraftServer(MinecraftServer console, ServerConfigurationManager server) {
this.console = console; this.console = console;
this.server = server; this.server = server;
this.serverVersion = CraftServer.class.getPackage().getImplementationVersion();
pluginManager.RegisterInterface(JavaPluginLoader.class); pluginManager.RegisterInterface(JavaPluginLoader.class);
} }
@ -66,7 +68,7 @@ public final class CraftServer implements Server {
} }
public String getVersion() { public String getVersion() {
return serverVersion; return serverVersion + " (MC: " + protocolVersion + ")";
} }
public Player[] getOnlinePlayers() { public Player[] getOnlinePlayers() {