Add a cloner to the queue classinfo
Suggestion
Implement the .cloner() method on the QueueClassinfo
Why?
Queues do not currently respect the usage of copy {_a} into {_b} due to the missing method and instead just return the original object
Other
While users can work around it using a mixture of set {_b} to a queue of unrolled {_a} this is not intuitive and actively works against the end users
Agreement
- [x] I have read the guidelines above and affirm I am following them with this suggestion.
Adding a cloner would cause queues to be cloned on function boundaries and setting variables, which would be a breaking change. May or may not be desirable.
Would it be wrong to implement an updated cloner? idk if it would be better but if the concern is with general constraints implemented by this. Couldn't we instead have something like
// T = type
new Cloner<T>()
.supplier(Function<T, T>)
.permitFunctions(boolean) // false meaning it won't clone in functions
Something along those lines?
Alternatively would probably fall under misuse as I'm not sure of the general guidelines for type properties too much but what about a clone type?
Rather than explicitly adding it to the copy x to y syntax which would feel like the required step we can still do it but make it something other addons can implement themselves?
Although I guess it depends how feasible it is. but I feel like it isn't impossible
Yes, the whole cloning/copying api in skript should probably be overhauled imo. It's very poorly documented and inconsistent, and i'm baffled it's worked as well as it has for so long. It also sounds like hell to do that lmao. Some sort of context-dependent system for Cloner would be a good start, though.