-
Notifications
You must be signed in to change notification settings - Fork 30
Description
Looking at the CraftTweaker documentation for IOreDictEntry, the example for adding items indicates that varargs functions exist, as shown here:
//oreDictEnt.add(IItemStack... item_items);
oreDictEnt.add(<minecraft:grass>);
oreDictEnt.add(<minecraft:iron_ore>, <minecraft:dirt>);However, nowhere in the documentation for custom functions is there any indication of it being possible to declare a custom function to take a varargs parameter. I tried, as a quick test, declaring a function parameter parameterName as string... (and it was not just the last but the only parameter in that function) but running /ct syntax gave me the error ) expected at that line. I also tried declaring parameterName... as string[] and got the same error.
Can custom functions be declared to take varargs parameters? If so, what is the syntax (and can it be added to the documentation)? If not, can this be implemented?
Final note: I felt this belonged in the ZenScript issue tracker because it's a feature inherent to the language, not the minecraft-specific application of it. If I'm wrong about that, I can open a copy of this on the CraftTweaker issue tracker instead.