Remove the use of typetools in EventFactory#of and fix license field

This commit is contained in:
shedaniel
2020-11-26 19:38:21 +08:00
parent f275c3b156
commit 5822bb9460
3 changed files with 5 additions and 8 deletions

View File

@@ -54,8 +54,7 @@ public final class EventFactory {
}
public static <T> Event<T> of(Function<List<T>, T> function) {
Class<?>[] arguments = TypeResolver.resolveRawArguments(Function.class, function.getClass());
return new EventImpl<>(arguments[1], function);
return new EventImpl<>(function);
}
@SuppressWarnings("UnstableApiUsage")
@@ -149,10 +148,8 @@ public final class EventFactory {
private final Function<List<T>, T> function;
private T invoker = null;
private ArrayList<T> listeners;
private Class<?> clazz;
public EventImpl(Class<?> clazz, Function<List<T>, T> function) {
this.clazz = Objects.requireNonNull(clazz);
public EventImpl(Function<List<T>, T> function) {
this.function = function;
this.listeners = new ArrayList<>();
}

View File

@@ -7,7 +7,7 @@
"authors": [
"shedaniel"
],
"license": "Apache-2.0",
"license": "LGPL-3",
"environment": "*",
"mixins": [
"architectury.mixins.json"

View File

@@ -1,7 +1,7 @@
modLoader = "javafml"
loaderVersion = "[33,)"
issueTrackerURL = "https://github.com/shedaniel/architectury/issues"
license = "Apache-2.0"
license = "LGPL-3"
[[mods]]
modId = "architectury"
@@ -11,4 +11,4 @@ authors = "shedaniel"
description = '''
A intermediary api aimed to ease developing multiplatform mods.
'''
license = "Apache-2.0"
license = "LGPL-3"