ソースを参照

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

shedaniel 4 年 前
コミット
5822bb9460

+ 2 - 5
common/src/main/java/me/shedaniel/architectury/event/EventFactory.java

@@ -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<>();
         }

+ 1 - 1
fabric/src/main/resources/fabric.mod.json

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

+ 2 - 2
forge/src/main/resources/META-INF/mods.toml

@@ -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"