Mirreski / Skript

Skript is a Bukkit plugin which allows server admins to customize their server easily, but without the hassle of programming a plugin or asking/paying someone to program a plugin for them.
http://njol.ch/projects/skript
7 stars 2 forks source link

Multiple enchantments error. [V7] #9

Closed Mirreski closed 9 years ago

Mirreski commented 9 years ago

Reference: http://dev.bukkit.org/bukkit-plugins/skript/forum/misc/79333-list-of-bugs-in-skript-2-2/?page=2#p31

Works in 2.1.2 but not in 2.2.

Mirreski commented 9 years ago

Hard to fix.

Remind for myself. Unlikely a problem here: https://github.com/Njol/Skript/blob/master/src/main/java/ch/njol/skript/aliases/Aliases.java#L524

Skript reads the itemtype wrong and separates the whole type at the "and" or "," and acts as if the itemtype and the last enchantment are two different objects when they should work as one.

Possibly a change to the SkriptParser?

Mirreski commented 9 years ago

Basicly the ItemType's syntax conflicts with the separator for lists("and", ",".).

[<number> [of]] [all/every] <alias> [of <enchantment> [<level>] [,/and <more enchantments...>]]

A quicker fix would be too alter the ItemType's syntax. Just the ",/and" part of it. If I can't find another fix without altering the syntax, I will probably do the quicker fix.

Mirreski commented 9 years ago

Actually I think I fixed it(Works fine for me). Thanks to Njol putting down a note in his older code: https://github.com/Njol/Skript/commit/333c54d29a70ede333e29b221ee8ef5b1a7b629f#diff-f6b5734f54c6a81a0ab46e7187558ee2L393

Needs more testing to see if I didn't break anything with the fix since I am touching the parser which is a scary thing to do.

Mirreski commented 9 years ago

Seems to work fine.