mirror of
https://github.com/architectury/architectury-api.git
synced 2026-03-28 03:56:59 -05:00
Remove the use of typetools in EventFactory#of and fix license field
This commit is contained in:
@@ -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<>();
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
"authors": [
|
||||
"shedaniel"
|
||||
],
|
||||
"license": "Apache-2.0",
|
||||
"license": "LGPL-3",
|
||||
"environment": "*",
|
||||
"mixins": [
|
||||
"architectury.mixins.json"
|
||||
|
||||
@@ -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"
|
||||
Reference in New Issue
Block a user