Print logo on startup.

This commit is contained in:
IzzelAliz 2020-06-10 15:30:11 +08:00
parent 089216b6a6
commit eb065aa667
6 changed files with 52 additions and 16 deletions

View File

@ -1,12 +0,0 @@
############################################################################
# Arclight configurations
#
# Repository https://github.com/IzzelAliz/Arclight
# Issue Tracker https://github.com/IzzelAliz/Arclight/issues
#
############################################################################
optimizations:
# The stream allocates useless garbage and hurts a lot of performance
# Arclight optimizes this by removing them
removeStreams: true

View File

@ -21,10 +21,13 @@
<TerminalConsole name="Console">
<PatternLayout>
<!-- use white for info output -->
<LoggerNamePatternSelector noConsoleNoAnsi="true" defaultPattern="%highlight{[%d{HH:mm:ss}] [%t/%level] [%c{1.}/%markerSimpleName]: %minecraftFormatting{%msg}%n%tEx}{INFO=normal}">
<LoggerNamePatternSelector
defaultPattern="%highlight{[%d{HH:mm:ss}] [%t/%level] [%c{1.}/%markerSimpleName]: %minecraftFormatting{%msg}%n%tEx}{INFO=normal}">
<!-- don't include the full logger name for Mojang's logs since they use full class names and it's very verbose -->
<PatternMatch key="net.minecraft." pattern="%highlight{[%d{HH:mm:ss}] [%t/%level] [minecraft/%logger{1}]: %minecraftFormatting{%msg}%n%tEx}{INFO=normal}"/>
<PatternMatch key="com.mojang." pattern="%highlight{[%d{HH:mm:ss}] [%t/%level] [mojang/%logger{1}]: %minecraftFormatting{%msg}%n%tEx}{INFO=normal}"/>
<PatternMatch key="net.minecraft."
pattern="%highlight{[%d{HH:mm:ss}] [%t/%level] [minecraft/%logger{1}]: %minecraftFormatting{%msg}%n%tEx}{INFO=normal}"/>
<PatternMatch key="com.mojang."
pattern="%highlight{[%d{HH:mm:ss}] [%t/%level] [mojang/%logger{1}]: %minecraftFormatting{%msg}%n%tEx}{INFO=normal}"/>
</LoggerNamePatternSelector>
</PatternLayout>
</TerminalConsole>

View File

@ -97,8 +97,9 @@ jar {
manifest.attributes 'MixinConnector': 'io.izzel.arclight.common.mod.ArclightConnector'
manifest.attributes 'Main-Class': 'io.izzel.arclight.server.Main'
manifest.attributes 'Implementation-Title': 'Arclight'
manifest.attributes 'Implementation-Version': "arclight-${project.version}-${getGitHash()}"
manifest.attributes 'Implementation-Version': "arclight-$minecraftVersion-${project.version}-${getGitHash()}"
manifest.attributes 'Implementation-Vendor': 'Arclight Team'
manifest.attributes 'Implementation-Timestamp': new Date().format("yyyy-MM-dd HH:mm:ss")
from(configurations.embed.collect { it.isDirectory() ? it : zipTree(it) }) {
exclude "META-INF/MANIFEST.MF"
exclude "META-INF/*.SF"

View File

@ -10,7 +10,10 @@ import io.izzel.arclight.i18n.ArclightConfig;
import io.izzel.arclight.i18n.ArclightLocale;
import net.minecraftforge.server.ServerMain;
import java.io.InputStream;
import java.util.Objects;
import java.util.jar.Attributes;
import java.util.jar.Manifest;
public class Main {
@ -31,6 +34,7 @@ public class Main {
return;
}
try {
printLogo();
ArclightI18nLogger.getLogger("Arclight").info("loading-mapping");
Objects.requireNonNull(ArclightRemapper.INSTANCE);
ServerMain.main(args);
@ -39,4 +43,14 @@ public class Main {
System.err.println("Fail to launch Arclight.");
}
}
private static void printLogo() throws Exception {
try (InputStream stream = Main.class.getResourceAsStream("/META-INF/MANIFEST.MF")) {
Manifest manifest = new Manifest(stream);
Attributes attributes = manifest.getMainAttributes();
String version = attributes.getValue(Attributes.Name.IMPLEMENTATION_VERSION);
String buildTime = attributes.getValue("Implementation-Timestamp");
ArclightI18nLogger.getLogger("Arclight").info("logo", version, buildTime);
}
}
}

View File

@ -1,3 +1,18 @@
logo = [
""
""
" §1 ___ §9 §3 §6___§e §6 __ /\\"
" §1 / |§9 ____§3____§6/ §e(_)§6__ / / / /"
" §1 / /| |§9/ __§3/ __§6/ §e/ /§6 _ / _ \\/__/"
" §1 / ___ §9/ / §3/ /_§6/ §e/ /§6 / / // / /"
" §1/_/ |§9/_/ §3\\__§6/_§e/_/§6\\_ /_//_/ /"
" §1 §9 §3 §6 §e §6/__/ \\/"
""
" §aVersion {}"
" §aBuild Date {}"
""
]
i18n {
current-not-available = "Current locale {0} is not available"
using-language = "Using locale {0} and fallback locale {1}"

View File

@ -1,3 +1,18 @@
logo = [
""
""
" §1 ___ §9 §3 §6___§e §6 __ /\\"
" §1 / |§9 ____§3____§6/ §e(_)§6__ / / / /"
" §1 / /| |§9/ __§3/ __§6/ §e/ /§6 _ / _ \\/__/"
" §1 / ___ §9/ / §3/ /_§6/ §e/ /§6 / / // / /"
" §1/_/ |§9/_/ §3\\__§6/_§e/_/§6\\_ /_//_/ /"
" §1 §9 §3 §6 §e §6/__/ \\/"
""
" §a运行版本 {}"
" §a构建日期 {}"
""
]
i18n {
current-not-available = "选择的语言 {0} 不可用"
using-language = "正在使用 {0} 语言,{1} 作为备选语言"