Skip to content

Commit

Permalink
Change name
Browse files Browse the repository at this point in the history
  • Loading branch information
IThundxr committed Sep 7, 2024
1 parent fde76a5 commit 1ec36f2
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.railwayteam.railways;

public class BuildParameters {
public class RailwaysBuildInfo {
public static final String VERSION = "{{ version }}";
public static final String GIT_COMMIT = {{ gitCommit | default("unknown") }};
}
3 changes: 1 addition & 2 deletions common/src/main/java/com/railwayteam/railways/Railways.java
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ public class Railways {
public static final String ID_NAME = "Railways";
public static final String NAME = "Steam 'n' Rails";
public static final Logger LOGGER = LoggerFactory.getLogger(ID_NAME);
public static final String VERSION = BuildParameters.VERSION;
// Only used for datafixers, bump whenever a block changes id etc. (should not be bumped multiple times within a release)
public static final int DATA_FIXER_VERSION = 2;

Expand Down Expand Up @@ -91,7 +90,7 @@ private static void migrateConfig(Path path, Function<String, String> converter)
}

public static void init() {
LOGGER.info("{} v{} initializing! Commit hash: {} Create version: {} on platform: {}", NAME, VERSION, BuildParameters.GIT_COMMIT, Create.VERSION, Loader.getFormatted());
LOGGER.info("{} v{} initializing! Commit hash: {} Create version: {} on platform: {}", NAME, RailwaysBuildInfo.VERSION, RailwaysBuildInfo.GIT_COMMIT, Create.VERSION, Loader.getFormatted());

Path configDir = Utils.configDir();
Path clientConfigDir = configDir.resolve(MODID + "-client.toml");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
package com.railwayteam.railways.util.packet;

import com.railwayteam.railways.Railways;
import com.railwayteam.railways.RailwaysBuildInfo;
import com.railwayteam.railways.compat.Mods;
import com.railwayteam.railways.config.CRConfigs;
import com.railwayteam.railways.events.ClientEvents;
Expand Down Expand Up @@ -46,8 +47,8 @@ public void write(FriendlyByteBuf buffer) {
@Environment(EnvType.CLIENT)
public void handle(Minecraft mc) {
LocalPlayer player = mc.player;
if (!Railways.VERSION.equals(version) && player != null) {
String msg = "Steam 'n' Rails version mismatch: Server is using version " + version + ", you are using version " + Railways.VERSION + ". This may cause problems.";
if (!RailwaysBuildInfo.VERSION.equals(version) && player != null) {
String msg = "Steam 'n' Rails version mismatch: Server is using version " + version + ", you are using version " + RailwaysBuildInfo.VERSION + ". This may cause problems.";
Railways.LOGGER.warn(msg);
player.displayClientMessage(
Components.literal(msg).withStyle(ChatFormatting.DARK_RED),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

package com.railwayteam.railways.util.packet;

import com.railwayteam.railways.Railways;
import com.railwayteam.railways.RailwaysBuildInfo;
import com.railwayteam.railways.annotation.event.MultiLoaderEvent;
import com.railwayteam.railways.content.minecarts.MinecartJukebox;
import com.railwayteam.railways.multiloader.PlayerSelection;
Expand All @@ -40,6 +40,6 @@ public static void syncMountedToolboxNBT(Entity entity, CompoundTag nbt) {
@MultiLoaderEvent
public static void notifyServerVersion(ServerPlayer player) {
CRPackets.PACKETS.onPlayerJoin(player);
CRPackets.PACKETS.sendTo(player, new ModVersionPacket(Railways.VERSION));
CRPackets.PACKETS.sendTo(player, new ModVersionPacket(RailwaysBuildInfo.VERSION));
}
}

0 comments on commit 1ec36f2

Please sign in to comment.