Skip to content

Commit

Permalink
Allow players to silence the beta warning
Browse files Browse the repository at this point in the history
  • Loading branch information
Edivad99 committed Oct 29, 2023
1 parent ad6192c commit f28d2f7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/main/java/mods/railcraft/RailcraftConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -248,12 +248,10 @@ public static class Client {

public final BooleanValue ghostTrainEnabled;
public final BooleanValue polarExpressEnabled;
public final BooleanValue showMessageBeta;
public final IntValue locomotiveLightLevel;

private Client(Builder builder) {
builder.comment("Client only settings, mostly things related to rendering")
.push("client");

this.ghostTrainEnabled = builder
.comment("Change to false to disable Ghost Train rendering")
.define("ghostTrainEnabled", true);
Expand All @@ -268,7 +266,9 @@ private Client(Builder builder) {
"If it is '0' then locomotive lightning will be disabled.")
.defineInRange("locomotiveLightLevel", 14, 0, 15);

builder.pop();
this.showMessageBeta = builder
.comment("Set to false to disable the message that informs you that you are using a beta version.")
.define("showMessageBeta", true);
}
}

Expand Down
4 changes: 3 additions & 1 deletion src/main/java/mods/railcraft/client/ClientManager.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package mods.railcraft.client;

import mods.railcraft.Railcraft;
import mods.railcraft.RailcraftConfig;
import mods.railcraft.Translations;
import mods.railcraft.api.core.RailcraftConstants;
import mods.railcraft.api.signal.SignalAspect;
Expand Down Expand Up @@ -245,7 +246,8 @@ static void handleClientLoggedIn(ClientPlayerNetworkEvent.LoggingIn event) {
event.getPlayer().displayClientMessage(message, false);
}

if (Railcraft.BETA || !FMLLoader.isProduction()) {
if (!FMLLoader.isProduction()
|| (Railcraft.BETA && RailcraftConfig.CLIENT.showMessageBeta.get())) {
var type = FMLLoader.isProduction() ? "beta" : "development";
var issueUrl = ((ModFileInfo) (modInfo.getOwningFile())).getIssueURL().toString();
var message = CommonComponents.joinLines(
Expand Down

0 comments on commit f28d2f7

Please sign in to comment.