Fixed the mod version pattern and allowing dev builds to work with non dev builds.
This commit is contained in:
@ -12,7 +12,7 @@ import java.util.regex.Pattern;
|
||||
public class Network {
|
||||
public static final String VERSION = TotemOfReviving.MOD_ID + "-net-1";
|
||||
private static final Pattern NET_VERSION_PATTERN = Pattern.compile(TotemOfReviving.MOD_ID + "-net-\\d+$");
|
||||
private static final Pattern MOD_VERSION_PATTERN = Pattern.compile("Forge-^\\d+\\.\\d+\\.\\d+$-^\\d+\\.\\d+\\.\\d+$");
|
||||
private static final Pattern MOD_VERSION_PATTERN = Pattern.compile("Forge-\\d+\\.\\d+\\.\\d+-\\d+\\.\\d+\\.\\d+$");
|
||||
|
||||
public static SimpleChannel channel;
|
||||
|
||||
@ -54,7 +54,8 @@ public class Network {
|
||||
String clientNetVersion = (senderIsServer) ? VERSION : readNetVersion(buffer);
|
||||
String clientModVersion = (senderIsServer) ? TotemOfReviving.getVersion() : readModVersion(buffer);
|
||||
|
||||
if (!serverNetVersion.equals(clientNetVersion) || !serverModVersion.equals(clientModVersion)) {
|
||||
if (!serverNetVersion.equals(clientNetVersion) ||
|
||||
!serverModVersion.equals(clientModVersion) && !serverModVersion.equals("NONE") && !clientModVersion.equals("NONE")) {
|
||||
throw new MismatchedVersionException(
|
||||
String.format("The server and client are running different versions of [Micle's Totem of Reviving]." +
|
||||
"Try updating this mod on either the client and or the server." +
|
||||
|
Reference in New Issue
Block a user