You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Skript.error("The function '" + functionName + "' doesn't return any value.");
@@ -96,31 +100,31 @@ public boolean validateFunction(final boolean first) {
96
100
}
97
101
if (!CollectionUtils.containsAnySuperclass(returnTypes, rt.getC())) {
98
102
if (first)
99
-
Skript.error("The returned value of the function '" + functionName + "', " + newFunc.returnType + ", is " + SkriptParser.notOfType(returnTypes) + ".");
103
+
Skript.error("The returned value of the function '" + functionName + "', " + sign.returnType + ", is " + SkriptParser.notOfType(returnTypes) + ".");
100
104
else
101
105
Skript.error("The function '" + functionName + "' was redefined with a different, incompatible return type, but is still used in other script(s)."
102
106
+ " These will continue to use the old version of the function until Skript restarts.");
103
107
returnfalse;
104
108
}
105
109
if (first) {
106
-
single = newFunc.single;
107
-
} elseif (single && !newFunc.single) {
110
+
single = sign.single;
111
+
} elseif (single && !sign.single) {
108
112
Skript.error("The function '" + functionName + "' was redefined with a different, incompatible return type, but is still used in other script(s)."
109
113
+ " These will continue to use the old version of the function until Skript restarts.");
110
114
returnfalse;
111
115
}
112
116
}
113
117
114
118
// check number of parameters only if the function does not have a single parameter that accepts multiple values
Skript.error("The function '" + functionName + "' was redefined with a different, incompatible amount of arguments, but is still used in other script(s)."
139
143
+ " These will continue to use the old version of the function until Skript restarts.");
140
144
returnfalse;
141
145
}
142
146
for (inti = 0; i < parameters.length; i++) {
143
-
finalParameter<?> p = newFunc.parameters[singleUberParam ? 0 : i];
147
+
finalParameter<?> p = sign.parameters.get(singleUberParam ? 0 : i);
Copy file name to clipboardExpand all lines: src/main/java/ch/njol/skript/lang/function/Functions.java
+9-26Lines changed: 9 additions & 26 deletions
Original file line number
Diff line number
Diff line change
@@ -109,9 +109,9 @@ public final static Function<?> loadFunction(final SectionNode node) {
109
109
// return error("Invalid function definition. Please check for typos and that the function's name only contains letters and underscores. Refer to the documentation for more information.");
error("Invalid function definition. Please check for typos and that the function's name only contains letters and underscores. Refer to the documentation for more information.");
133
-
finalStringname = "" + m.group(1);
132
+
returnsignError("Invalid function definition. Please check for typos and that the function's name only contains letters and underscores. Refer to the documentation for more information.");
133
+
finalStringname = "" + m.group(1);// TODO check for name uniqueness (currently functions with same name silently override each other)
0 commit comments