Foreground text fill auto detected

This commit is contained in:
huanghongxun
2018-02-23 17:40:32 +08:00
parent b11e4ab1db
commit 9ff2442789
18 changed files with 99 additions and 66 deletions

View File

@@ -63,7 +63,7 @@ public final class CompatibilityRule {
}
public static boolean appliesToCurrentEnvironment(Collection<CompatibilityRule> rules, Map<String, Boolean> features) {
if (rules == null)
if (rules == null || rules.isEmpty())
return true;
Action action = Action.DISALLOW;

View File

@@ -208,7 +208,8 @@ public class DefaultGameRepository implements GameRepository {
try {
Version resolved = version.resolve(provider);
if (EventBus.EVENT_BUS.fireEvent(new LoadedOneVersionEvent(this, resolved)) != Event.Result.DENY)
if (resolved.appliesToCurrentEnvironment() &&
EventBus.EVENT_BUS.fireEvent(new LoadedOneVersionEvent(this, resolved)) != Event.Result.DENY)
versions.put(version.getId(), version);
} catch (VersionNotFoundException e) {
Logging.LOG.log(Level.WARNING, "Ignoring version {0} because it inherits from a nonexistent version.", version.getId());

View File

@@ -154,7 +154,7 @@ public class Version implements Comparable<Version>, Validation {
* Resolve given version
*/
public Version resolve(VersionProvider provider) throws VersionNotFoundException {
return resolve(provider, new HashSet<>()).setResolved(true);
return resolve(provider, new HashSet<>()).setResolved();
}
protected Version resolve(VersionProvider provider, Set<String> resolvedSoFar) throws VersionNotFoundException {
@@ -189,8 +189,8 @@ public class Version implements Comparable<Version>, Validation {
Math.max(minimumLauncherVersion, parent.minimumLauncherVersion));
}
public Version setResolved(boolean resolved) {
return new Version(resolved, id, minecraftArguments, arguments, mainClass, inheritsFrom, jar, assetIndex, assets, libraries, compatibilityRules, downloads, logging, type, time, releaseTime, minimumLauncherVersion);
private Version setResolved() {
return new Version(true, id, minecraftArguments, arguments, mainClass, inheritsFrom, jar, assetIndex, assets, libraries, compatibilityRules, downloads, logging, type, time, releaseTime, minimumLauncherVersion);
}
public Version setId(String id) {