This commit is contained in:
parent
fedd2fe2d8
commit
74c97537b6
@ -1,5 +1,8 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
**1.1.7**
|
||||||
|
* Disable SemVer In JSON Strategy
|
||||||
|
|
||||||
**1.1.6**
|
**1.1.6**
|
||||||
* Drop Dom4j Dependency
|
* Drop Dom4j Dependency
|
||||||
|
|
||||||
|
@ -9,7 +9,7 @@ org.gradle.jvmargs = -Xmx1G
|
|||||||
fabric_loader_version = 0.8.8+build.202
|
fabric_loader_version = 0.8.8+build.202
|
||||||
|
|
||||||
# Mod Properties
|
# Mod Properties
|
||||||
mod_version = 1.1.6
|
mod_version = 1.1.7
|
||||||
maven_group = com.thebrokenrail
|
maven_group = com.thebrokenrail
|
||||||
|
|
||||||
# Dependencies
|
# Dependencies
|
||||||
|
@ -9,8 +9,6 @@ import com.thebrokenrail.modupdater.api.ConfigObject;
|
|||||||
import com.thebrokenrail.modupdater.api.UpdateStrategy;
|
import com.thebrokenrail.modupdater.api.UpdateStrategy;
|
||||||
import com.thebrokenrail.modupdater.data.ModUpdate;
|
import com.thebrokenrail.modupdater.data.ModUpdate;
|
||||||
import com.thebrokenrail.modupdater.util.Util;
|
import com.thebrokenrail.modupdater.util.Util;
|
||||||
import net.fabricmc.loader.api.SemanticVersion;
|
|
||||||
import net.fabricmc.loader.util.version.VersionParsingException;
|
|
||||||
|
|
||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
@ -66,20 +64,11 @@ public class JSONStrategy implements UpdateStrategy {
|
|||||||
String version = Util.getMinecraftVersion().getName();
|
String version = Util.getMinecraftVersion().getName();
|
||||||
if (map.containsKey(version)) {
|
if (map.containsKey(version)) {
|
||||||
LatestVersionEntry entry = map.get(version);
|
LatestVersionEntry entry = map.get(version);
|
||||||
ModUpdate update = new ModUpdate(oldVersion, entry.version, entry.downloadUrl, name);
|
|
||||||
try {
|
|
||||||
if (SemanticVersion.parse(entry.version).compareTo(SemanticVersion.parse(oldVersion)) > 0) {
|
|
||||||
return update;
|
|
||||||
} else {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
} catch (VersionParsingException e) {
|
|
||||||
if (!oldVersion.equals(entry.version)) {
|
if (!oldVersion.equals(entry.version)) {
|
||||||
return update;
|
return new ModUpdate(oldVersion, entry.version, entry.downloadUrl, name);
|
||||||
} else {
|
} else {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user