diff --git a/common/src/main/java-templates/com/railwayteam/railways/BuildParameters.java.peb b/common/src/main/java-templates/com/railwayteam/railways/RailwaysBuildInfo.java.peb similarity index 83% rename from common/src/main/java-templates/com/railwayteam/railways/BuildParameters.java.peb rename to common/src/main/java-templates/com/railwayteam/railways/RailwaysBuildInfo.java.peb index 6780a7009..285625018 100644 --- a/common/src/main/java-templates/com/railwayteam/railways/BuildParameters.java.peb +++ b/common/src/main/java-templates/com/railwayteam/railways/RailwaysBuildInfo.java.peb @@ -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") }}; } \ No newline at end of file diff --git a/common/src/main/java/com/railwayteam/railways/Railways.java b/common/src/main/java/com/railwayteam/railways/Railways.java index f110b5424..a89a4d2f5 100644 --- a/common/src/main/java/com/railwayteam/railways/Railways.java +++ b/common/src/main/java/com/railwayteam/railways/Railways.java @@ -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; @@ -91,7 +90,7 @@ private static void migrateConfig(Path path, Function 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"); diff --git a/common/src/main/java/com/railwayteam/railways/util/packet/ModVersionPacket.java b/common/src/main/java/com/railwayteam/railways/util/packet/ModVersionPacket.java index 674c75dc1..c5eab8659 100644 --- a/common/src/main/java/com/railwayteam/railways/util/packet/ModVersionPacket.java +++ b/common/src/main/java/com/railwayteam/railways/util/packet/ModVersionPacket.java @@ -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; @@ -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), diff --git a/common/src/main/java/com/railwayteam/railways/util/packet/PacketSender.java b/common/src/main/java/com/railwayteam/railways/util/packet/PacketSender.java index 5c75ea10e..3deabb72e 100644 --- a/common/src/main/java/com/railwayteam/railways/util/packet/PacketSender.java +++ b/common/src/main/java/com/railwayteam/railways/util/packet/PacketSender.java @@ -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; @@ -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)); } }