Fix server favicon URLs being incorrect
All checks were successful
Deploy App / docker (ubuntu-latest, 2.44.0) (push) Successful in 59s
All checks were successful
Deploy App / docker (ubuntu-latest, 2.44.0) (push) Successful in 59s
This commit is contained in:
@ -107,8 +107,8 @@ public final class JavaMinecraftServer extends MinecraftServer {
|
|||||||
motdString = new TextComponent(ComponentSerializer.parse(RESTfulMC.GSON.toJson(token.getDescription()))).toLegacyText();
|
motdString = new TextComponent(ComponentSerializer.parse(RESTfulMC.GSON.toJson(token.getDescription()))).toLegacyText();
|
||||||
}
|
}
|
||||||
return new JavaMinecraftServer(hostname, ip, port, token.getVersion().detailedCopy(), token.getPlayers(),
|
return new JavaMinecraftServer(hostname, ip, port, token.getVersion().detailedCopy(), token.getPlayers(),
|
||||||
MOTD.create(motdString), Favicon.create(token.getFavicon(), Platform.JAVA, hostname),
|
MOTD.create(motdString), Favicon.create(token.getFavicon(), hostname), token.getModInfo(),
|
||||||
token.getModInfo(), token.isEnforcesSecureChat(), token.isPreventsChatReports(), false
|
token.isEnforcesSecureChat(), token.isPreventsChatReports(), false
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -176,17 +176,16 @@ public final class JavaMinecraftServer extends MinecraftServer {
|
|||||||
* Create a new favicon for a server.
|
* Create a new favicon for a server.
|
||||||
*
|
*
|
||||||
* @param base64 the Base64 encoded favicon
|
* @param base64 the Base64 encoded favicon
|
||||||
* @param platform the platform to create the favicon for
|
|
||||||
* @param hostname the server hostname
|
* @param hostname the server hostname
|
||||||
* @return the favicon, null if none
|
* @return the favicon, null if none
|
||||||
*/
|
*/
|
||||||
public static Favicon create(String base64, @NonNull Platform platform, @NonNull String hostname) {
|
public static Favicon create(String base64, @NonNull String hostname) {
|
||||||
if (base64 == null) { // No favicon to create
|
if (base64 == null) { // No favicon to create
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
return new Favicon(
|
return new Favicon(
|
||||||
base64,
|
base64,
|
||||||
AppConfig.INSTANCE.getServerPublicUrl() + "/server/icon/" + platform.name().toLowerCase() + "/" + hostname
|
AppConfig.INSTANCE.getServerPublicUrl() + "/server/icon/" + hostname
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user