mirror of
https://github.com/GTNewHorizons/CraftTweaker.git
synced 2026-11-19 03:39:17 +00:00
- Fixed Java 7 compatibility due to accidental usage of Java 8-only methods
- Fixed mod support loading even if the respective mod isn't present - Fixed iterator implementations missing the remove method (fine in Java 8, but not in Java 7) - Added /mt mods command
This commit is contained in:
1 parent
3827eba3e2
commit
8e47ca9317
11 files changed
+80
-25
No files matched your search
@@ -0,0 +1,15 @@
|
||||
/*
|
||||
* To change this license header, choose License Headers in Project Properties.
|
||||
* To change this template file, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
|
||||
package minetweaker.api.mods;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Stan
|
||||
*/
|
||||
public class IMod {
|
||||
|
||||
}
|
||||
@@ -141,12 +141,14 @@ public class GlobalRegistry {
|
||||
}
|
||||
|
||||
public static void registerExpansion(Class cls) {
|
||||
for (Annotation annotation : cls.getAnnotationsByType(ZenExpansion.class)) {
|
||||
ZenExpansion eAnnotation = (ZenExpansion) annotation;
|
||||
if (!expansions.containsKey(eAnnotation.value())) {
|
||||
expansions.put(eAnnotation.value(), new TypeExpansion());
|
||||
for (Annotation annotation : cls.getAnnotations()) {
|
||||
if (annotation instanceof ZenExpansion) {
|
||||
ZenExpansion eAnnotation = (ZenExpansion) annotation;
|
||||
if (!expansions.containsKey(eAnnotation.value())) {
|
||||
expansions.put(eAnnotation.value(), new TypeExpansion());
|
||||
}
|
||||
expansions.get(eAnnotation.value()).expand(cls, types);
|
||||
}
|
||||
expansions.get(eAnnotation.value()).expand(cls, types);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+5
@@ -70,5 +70,10 @@ public class ScriptProviderCascade implements IScriptProvider {
|
||||
currentValue = current.next();
|
||||
} while (executed.contains(currentValue.getGroupName()) && hasNext());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void remove() {
|
||||
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
|
||||
}
|
||||
}
|
||||
}
|
||||
+6
-1
@@ -106,7 +106,7 @@ public class ScriptProviderMemory implements IScriptProvider {
|
||||
}
|
||||
|
||||
private class ProviderIterator implements Iterator<IScriptIterator> {
|
||||
private Iterator<MemoryModule> baseIterator = modules.values().iterator();
|
||||
private final Iterator<MemoryModule> baseIterator = modules.values().iterator();
|
||||
|
||||
@Override
|
||||
public boolean hasNext() {
|
||||
@@ -117,6 +117,11 @@ public class ScriptProviderMemory implements IScriptProvider {
|
||||
public IScriptIterator next() {
|
||||
return new ScriptIterator(baseIterator.next());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void remove() {
|
||||
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
|
||||
}
|
||||
}
|
||||
|
||||
private class ScriptIterator implements IScriptIterator {
|
||||
|
||||
@@ -55,6 +55,11 @@ public class CloseablePriorityList<T> implements Iterable<T> {
|
||||
current = current == null ? first : current.next;
|
||||
return current.value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void remove() {
|
||||
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
|
||||
}
|
||||
}
|
||||
|
||||
private class CloseableEntry implements Closeable {
|
||||
|
||||
Reference in new issue
Block a user