Formatting stops lorename check from working
Blacklands opened this issue ยท 3 comments
I'm working on a smithing system, and while doing so, I noticed that the lorename check doesn't seem to work anymore as soon as you put ANY formatting codes in it.
I've had this set up for Anvils:
anvil:
- permission: smithsforgingdrops
trigger: left_click
tool: iron_sword@251
lorename: "Raw Iron Sword (Hot)"
damagetool: 251
drop: iron_sword@251!~&rUnfinished Iron Sword &4(Hot)
(The damage values are so that all of the parts immediately break when one tries to use them.)
And this for Cauldrons:
cauldron:
- permission: smithsforgingdrops
trigger: left_click
tool: iron_sword@251
lorename: "&rUnfinished Iron Sword &4(Hot)"
damagetool: 251
effect: [extinguish, extinguish, extinguish, smoke@up]
drop: iron_sword@251!~&rUnfinished Iron Sword &3(Cooled)
You see, it checks for the name "&rUnfinished Iron Sword &4(Hot)", the "(Hot)" in dark red and the whole name gets its formatting reset first (because I don't want it to be italic, which is the standard). But it doesn't work.
I've set "verbosity" to "extreme" in the config, and found out that, while it checks for the formatting, it doesn't find it on the tool I am using even though it's there. It just sees the name, without any formatting codes, but it checks against formatting codes, so the comparison fails and it doesn't work.
Can you help me with this? Am I doing something wrong?
Oh, and I'm using craftbukkit-1.5.2-R1.0 and... uhm... version v2.8b.566 according to the server console, even if I can't recall downloading the new version for 1.6.1.
I think I've fixed this recently, I'll check it with a recent dev build before I close the issue.
Is there any reason to allow formatting-dependent matching? I'd think it makes more sense for the lorename check to ignore formatting.
Also, on a side note, you have a lorename check but no wildcard type system for matching multiple lorenames? What is this!? Full regex is probably overkill, but shell-style glob syntax would seem useful...? (Not that I use this plugin anymore.)
Tested the issue again to make sure and yes, this has been fixed.
@Celtic: the main reason for matching lorename formatting is that it's easy in-game to rename items with the anvil but cannot use formatting. Regex (or wildcards) would be handy, and planned at some point, however in my experience so far most people want to match specific items.