* Fixed a bug that prevented that cards from Classic Six Edition were shown in mage.

This commit is contained in:
LevelX2 2015-08-03 14:45:08 +02:00
parent 22c1631587
commit a02c0fac2f
3 changed files with 9 additions and 10 deletions

View file

@ -28,7 +28,6 @@
package mage.sets;
import java.util.GregorianCalendar;
import mage.cards.ExpansionSet;
import mage.constants.SetType;

View file

@ -1,12 +1,12 @@
package mage.sets;
import java.util.GregorianCalendar;
import mage.constants.SetType;
import mage.cards.ExpansionSet;
import mage.constants.SetType;
public class FifthEdition extends ExpansionSet {
private static final FifthEdition fINSTANCE = new FifthEdition();
private static final FifthEdition fINSTANCE = new FifthEdition();
public static FifthEdition getInstance() {
return fINSTANCE;
@ -19,7 +19,7 @@ public class FifthEdition extends ExpansionSet {
this.numBoosterCommon = 11;
this.numBoosterUncommon = 3;
this.numBoosterRare = 1;
this.ratioBoosterMythic = 0;
this.ratioBoosterMythic = 0;
}
}

View file

@ -47,13 +47,13 @@ import java.util.jar.JarInputStream;
public class ClassScanner {
public static List<Class> findClasses(List<String> packages, Class<?> type) {
List<Class> cards = new ArrayList<Class>();
List<Class> cards = new ArrayList<>();
try {
ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
assert classLoader != null;
HashMap<String, String> dirs = new HashMap<String, String>();
TreeSet<String> jars = new TreeSet<String>();
HashMap<String, String> dirs = new HashMap<>();
TreeSet<String> jars = new TreeSet<>();
for (String packageName : packages) {
String path = packageName.replace('.', '/');
Enumeration<URL> resources = classLoader.getResources(path);
@ -84,7 +84,7 @@ public class ClassScanner {
}
private static List<Class> findClasses(File directory, String packageName, Class<?> type) {
List<Class> cards = new ArrayList<Class>();
List<Class> cards = new ArrayList<>();
if (!directory.exists()) {
return cards;
}
@ -104,7 +104,7 @@ public class ClassScanner {
}
private static List<Class> findClassesInJar(File file, List<String> packages, Class<?> type) {
List<Class> cards = new ArrayList<Class>();
List<Class> cards = new ArrayList<>();
if (!file.exists()) {
return cards;
}
@ -117,7 +117,7 @@ public class ClassScanner {
break;
}
if (jarEntry.getName().endsWith(".class")) {
String className = jarEntry.getName().replace('/', '.').replace(".class", "");
String className = jarEntry.getName().replace(".class", "").replace('/', '.');
int packageNameEnd = className.lastIndexOf('.');
String packageName = packageNameEnd != -1 ? className.substring(0, packageNameEnd) : "";
if (packages.contains(packageName)) {