Skip to content

Commit

Permalink
Show message when it's a snapshot
Browse files Browse the repository at this point in the history
  • Loading branch information
Edivad99 committed Feb 17, 2024
1 parent 02a209a commit 8f2f45b
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/main/java/mods/railcraft/client/ClientManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -245,9 +245,11 @@ static void handleClientLoggedIn(ClientPlayerNetworkEvent.LoggingIn event) {
event.getPlayer().displayClientMessage(message, false);
}

if (!FMLLoader.isProduction()
|| (Railcraft.BETA && RailcraftConfig.CLIENT.showMessageBeta.get())) {
var type = FMLLoader.isProduction() ? "beta" : "development";
var qualifier = modInfo.getVersion().getQualifier();
boolean isSnapshot = qualifier != null && qualifier.equals("snapshot");
boolean showMessageBeta = Railcraft.BETA && RailcraftConfig.CLIENT.showMessageBeta.get();
if (!FMLLoader.isProduction() || isSnapshot || showMessageBeta) {
var type = isSnapshot ? "development" : "beta";
var issueUrl = ((ModFileInfo) (modInfo.getOwningFile())).getIssueURL().toString();
var message = CommonComponents.joinLines(
Component.literal("You are using a %s version of %s.".formatted(type, RailcraftConstants.NAME))
Expand Down

0 comments on commit 8f2f45b

Please sign in to comment.