mirror of
https://github.com/ViaVersion/ViaLegacy.git
synced 2024-12-22 16:38:16 +01:00
Use full implementation version as subplatform name
This commit is contained in:
parent
0e02ecf818
commit
99e8fa7b83
10
build.gradle
10
build.gradle
@ -30,6 +30,7 @@ dependencies {
|
||||
|
||||
blossom {
|
||||
replaceToken("\${version}", project.version, "src/main/java/net/raphimc/vialegacy/ViaLegacy.java")
|
||||
replaceToken("\${impl_version}", "git-${project.archivesBaseName}-${project.version}:${latestCommitHash()}", "src/main/java/net/raphimc/vialegacy/ViaLegacy.java")
|
||||
}
|
||||
|
||||
java {
|
||||
@ -87,3 +88,12 @@ publishing {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
String latestCommitHash() {
|
||||
def stdout = new ByteArrayOutputStream()
|
||||
exec {
|
||||
commandLine "git", "rev-parse", "--short", "HEAD"
|
||||
standardOutput = stdout
|
||||
}
|
||||
return stdout.toString().trim()
|
||||
}
|
||||
|
@ -23,6 +23,7 @@ import net.raphimc.vialegacy.platform.ViaLegacyPlatform;
|
||||
public class ViaLegacy {
|
||||
|
||||
public static final String VERSION = "${version}";
|
||||
public static final String IMPL_VERSION = "${impl_version}";
|
||||
|
||||
private static ViaLegacyPlatform platform;
|
||||
private static ViaLegacyConfig config;
|
||||
|
@ -74,7 +74,7 @@ public interface ViaLegacyPlatform {
|
||||
final ViaLegacyConfig config = new ViaLegacyConfig(new File(dataFolder, "vialegacy.yml"));
|
||||
config.reloadConfig();
|
||||
ViaLegacy.init(this, config);
|
||||
Via.getManager().getSubPlatforms().add("ViaLegacy-" + ViaLegacy.VERSION);
|
||||
Via.getManager().getSubPlatforms().add(ViaLegacy.IMPL_VERSION);
|
||||
|
||||
final ProtocolManager protocolManager = Via.getManager().getProtocolManager();
|
||||
protocolManager.registerProtocol(new Protocol1_8to1_7_6_10(), ProtocolVersion.v1_8, ProtocolVersion.v1_7_6);
|
||||
|
Loading…
Reference in New Issue
Block a user