Work in progress
This commit is contained in:
parent
1b6fc01061
commit
d3c4cf0b0c
74 changed files with 2287 additions and 219 deletions
|
|
@ -1,5 +1,6 @@
|
|||
package love.distributedrebirth.bassboon;
|
||||
|
||||
import java.lang.annotation.Annotation;
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
|
|
@ -65,7 +66,7 @@ public final class DefaultBȍőnLoader implements Bãß.𝔅𝔬𝔫𝔢𝔏𝔬
|
|||
|
||||
for (Class<?> duytschenType:duytschenCoffins.keySet()) {
|
||||
BãßBȍőnCoffinDuytschenᵗˣᵗ duytschenCoffin = duytschenCoffins.get(duytschenType);
|
||||
//System.out.println("INIT.REG "+duytschenType+" senseResult="+duytschenCoffin);
|
||||
//System.out.println("INIT.REG_TXT "+duytschenType+" senseResult="+duytschenCoffin);
|
||||
spider.registrateEgg(duytschenType, new BãßBȍőnSpiderSilk() {
|
||||
@Override
|
||||
public Object senseWire(BãßBȍőnʸᴰ<?> boonTmp, String name, String description)
|
||||
|
|
@ -74,12 +75,24 @@ public final class DefaultBȍőnLoader implements Bãß.𝔅𝔬𝔫𝔢𝔏𝔬
|
|||
}
|
||||
});
|
||||
}
|
||||
for (Annotation anno:boon.getClass().getDeclaredAnnotations()) {
|
||||
//System.out.println("INIT.REG_ANNO "+anno.annotationType());
|
||||
spider.registrateEgg(anno.annotationType(), new BãßBȍőnSpiderSilk() {
|
||||
@Override
|
||||
public Object senseWire(BãßBȍőnʸᴰ<?> boonTmp, String name, String description)
|
||||
throws IllegalAccessException, IllegalArgumentException, InvocationTargetException {
|
||||
return anno;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Set<Class<?>> ydmods = new HashSet<>();
|
||||
for (PiratePhaseBoat boat : loadPirateBoats(boon)) {
|
||||
//System.out.println("INIT.RUN "+boat.pirateClazz.getName());
|
||||
|
||||
if (ydmods.add(boat.pirateClazz.getDeclaringClass())) {
|
||||
//System.out.println("INIT.REG_MOD "+boat.pirateClazz.getDeclaringClass());
|
||||
spider.registrateEgg(boat.pirateClazz.getDeclaringClass(), new BãßBȍőnSpiderSilk() {
|
||||
@Override
|
||||
public Object senseWire(BãßBȍőnʸᴰ<?> boonTmp, String name, String description)
|
||||
|
|
@ -93,7 +106,7 @@ public final class DefaultBȍőnLoader implements Bãß.𝔅𝔬𝔫𝔢𝔏𝔬
|
|||
BãßBȍőnꝐŕḯṿª₮ḕ響ᴼᶠ soundOf = boat.pirate.init();
|
||||
Class<?> soundOfType = soundOf.getClass().getInterfaces()[0]; // TOOD ....
|
||||
if (ydmods.add(soundOfType)) {
|
||||
//System.out.println("INIT.SOUND "+soundOfType);
|
||||
//System.out.println("INIT.REG_SND "+soundOfType);
|
||||
spider.registrateEgg(soundOfType, new BãßBȍőnSpiderSilk() {
|
||||
@Override
|
||||
public Object senseWire(BãßBȍőnʸᴰ<?> boonTmp, String name, String description)
|
||||
|
|
@ -222,6 +235,10 @@ public final class DefaultBȍőnLoader implements Bãß.𝔅𝔬𝔫𝔢𝔏𝔬
|
|||
}
|
||||
}
|
||||
|
||||
public static Class<?> findInterfaceByAnnotation(Class<?> clazz, Class<? extends Annotation> annoType) {
|
||||
return walkInterfaces(clazz, new LinkedHashSet<>()).stream().filter(v -> v.isAnnotationPresent(annoType)).findFirst().get();
|
||||
}
|
||||
|
||||
public static Set<Class<?>> walkInterfaces(Class<?> clazz, Set<Class<?>> result) {
|
||||
return walkTree(clazz, result, v -> Arrays.asList(v.getInterfaces()), v -> v.getSuperclass());
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue