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 + "' does not exist.");
152
+
Skript.error("The function '" + stringified + "' does not exist.");
140
153
} else {
141
-
Skript.error("The function '" + functionName + "' was deleted or renamed, but is still used in other script(s)."
154
+
Skript.error("The function '" + stringified + "' was deleted or renamed, but is still used in other script(s)."
142
155
+ " These will continue to use the old version of the function until Skript restarts.");
143
156
function = previousFunction;
144
157
}
@@ -151,19 +164,19 @@ public boolean validateFunction(boolean first) {
151
164
ClassInfo<?> rt = sign.returnType;
152
165
if (rt == null) {
153
166
if (first) {
154
-
Skript.error("The function '" + functionName + "' doesn't return any value.");
167
+
Skript.error("The function '" + stringified + "' doesn't return any value.");
155
168
} else {
156
-
Skript.error("The function '" + functionName + "' was redefined with no return value, but is still used in other script(s)."
169
+
Skript.error("The function '" + stringified + "' was redefined with no return value, but is still used in other script(s)."
157
170
+ " These will continue to use the old version of the function until Skript restarts.");
158
171
function = previousFunction;
159
172
}
160
173
returnfalse;
161
174
}
162
175
if (!Converters.converterExists(rt.getC(), returnTypes)) {
163
176
if (first) {
164
-
Skript.error("The returned value of the function '" + functionName + "', " + sign.returnType + ", is " + SkriptParser.notOfType(returnTypes) + ".");
177
+
Skript.error("The returned value of the function '" + stringified + "', " + sign.returnType + ", is " + SkriptParser.notOfType(returnTypes) + ".");
165
178
} else {
166
-
Skript.error("The function '" + functionName + "' was redefined with a different, incompatible return type, but is still used in other script(s)."
179
+
Skript.error("The function '" + stringified + "' was redefined with a different, incompatible return type, but is still used in other script(s)."
167
180
+ " These will continue to use the old version of the function until Skript restarts.");
168
181
function = previousFunction;
169
182
}
@@ -186,15 +199,15 @@ public boolean validateFunction(boolean first) {
186
199
if (parameters.length > sign.getMaxParameters()) {
187
200
if (first) {
188
201
if (sign.getMaxParameters() == 0) {
189
-
Skript.error("The function '" + functionName + "' has no arguments, but " + parameters.length + " are given."
202
+
Skript.error("The function '" + stringified + "' has no arguments, but " + parameters.length + " are given."
190
203
+ " To call a function without parameters, just write the function name followed by '()', e.g. 'func()'.");
191
204
} else {
192
-
Skript.error("The function '" + functionName + "' has only " + sign.getMaxParameters() + " argument" + (sign.getMaxParameters() == 1 ? "" : "s") + ","
205
+
Skript.error("The function '" + stringified + "' has only " + sign.getMaxParameters() + " argument" + (sign.getMaxParameters() == 1 ? "" : "s") + ","
193
206
+ " but " + parameters.length + " are given."
194
207
+ " If you want to use lists in function calls, you have to use additional parentheses, e.g. 'give(player, (iron ore and gold ore))'");
195
208
}
196
209
} else {
197
-
Skript.error("The function '" + functionName + "' was redefined with a different, incompatible amount of arguments, but is still used in other script(s)."
210
+
Skript.error("The function '" + stringified + "' was redefined with a different, incompatible amount of arguments, but is still used in other script(s)."
198
211
+ " These will continue to use the old version of the function until Skript restarts.");
199
212
function = previousFunction;
200
213
}
@@ -205,10 +218,10 @@ public boolean validateFunction(boolean first) {
205
218
// Not enough parameters
206
219
if (parameters.length < sign.getMinParameters()) {
207
220
if (first) {
208
-
Skript.error("The function '" + functionName + "' requires at least " + sign.getMinParameters() + " argument" + (sign.getMinParameters() == 1 ? "" : "s") + ","
221
+
Skript.error("The function '" + stringified + "' requires at least " + sign.getMinParameters() + " argument" + (sign.getMinParameters() == 1 ? "" : "s") + ","
Skript.error("The function '" + functionName + "' was redefined with a different, incompatible amount of arguments, but is still used in other script(s)."
224
+
Skript.error("The function '" + stringified + "' was redefined with a different, incompatible amount of arguments, but is still used in other script(s)."
212
225
+ " These will continue to use the old version of the function until Skript restarts.");
213
226
function = previousFunction;
214
227
}
@@ -227,12 +240,12 @@ public boolean validateFunction(boolean first) {
227
240
if (LiteralUtils.hasUnparsedLiteral(parameters[i])) {
228
241
Skript.error("Can't understand this expression: " + parameters[i].toString());
229
242
} else {
230
-
Skript.error("The " + StringUtils.fancyOrderNumber(i + 1) + " argument given to the function '" + functionName + "' is not of the required type " + p.type + "."
243
+
Skript.error("The " + StringUtils.fancyOrderNumber(i + 1) + " argument given to the function '" + stringified + "' is not of the required type " + p.type + "."
231
244
+ " Check the correct order of the arguments and put lists into parentheses if appropriate (e.g. 'give(player, (iron ore and gold ore))')."
232
245
+ " Please note that storing the value in a variable and then using that variable as parameter may suppress this error, but it still won't work.");
233
246
}
234
247
} else {
235
-
Skript.error("The function '" + functionName + "' was redefined with different, incompatible arguments, but is still used in other script(s)."
248
+
Skript.error("The function '" + stringified + "' was redefined with different, incompatible arguments, but is still used in other script(s)."
236
249
+ " These will continue to use the old version of the function until Skript restarts.");
237
250
function = previousFunction;
238
251
}
@@ -242,7 +255,7 @@ public boolean validateFunction(boolean first) {
242
255
Skript.error("The " + StringUtils.fancyOrderNumber(i + 1) + " argument given to the function '" + functionName + "' is plural, "
243
256
+ "but a single argument was expected");
244
257
} else {
245
-
Skript.error("The function '" + functionName + "' was redefined with different, incompatible arguments, but is still used in other script(s)."
258
+
Skript.error("The function '" + stringified + "' was redefined with different, incompatible arguments, but is still used in other script(s)."
246
259
+ " These will continue to use the old version of the function until Skript restarts.");
0 commit comments