try to fix mis-loading library problem

This commit is contained in:
huangyuhui 2016-02-10 17:28:33 +08:00
parent 8b1ff94c5f
commit 2f97cd8104
2 changed files with 9 additions and 7 deletions

View File

@ -56,12 +56,14 @@ public class MinecraftLibrary extends IMinecraftLibrary {
@Override @Override
public boolean allow() { public boolean allow() {
if (rules != null) { if (rules != null) {
String action = "disallow"; boolean flag = false;
for (Rules r : rules) for (Rules r : rules)
if (r.action() != null) if ("disallow".equals(r.action()))
action = r.action(); return false;
return "allow".equals(action); else if ("allow".equals(r.action()))
} flag = true;
return flag;
} else
return true; return true;
} }

View File

@ -36,7 +36,7 @@ public class Rules {
} }
public String action() { public String action() {
return os != null && os.isCurrentOS() ? action : null; return os == null || os != null && os.isCurrentOS() ? action : null;
} }
} }