Zarius / Bukkit-OtherBlocks

OtherBlocks (now known as OtherDrops) plugin for Bukkit (dev build: https://www.mediafire.com/?i6ows1g6kus2o0l)
http://dev.bukkit.org/server-mods/otherdrops/
GNU General Public License v3.0
17 stars 17 forks source link

Color and lore support for written books #201

Closed VoxPopuliZombiemold closed 11 years ago

VoxPopuliZombiemold commented 11 years ago

Written books don't seem to support colors in their name, or allow for lore of any kind.

A drop like:

Monster_Eggs:
  - drop: writtenbook@~&4Deep Discoveries:&6Archeology Journal 05:author=DoosyDittle:page=Day 32 - It's been weeks into our expedition, but all my men have been able to excavate has been a few caveman skeletons and old pottery. I am thinking that we need to go deeper underground, now if only I can get us the grant money.:page=Day 48 - Finally convinced my sponsors to dish out the cash, now we can finally excavate at the levels we need, lets hope this pays off.:page=Day 49 - Eureka. We found a pefectly intact dragon skeleton, and so close to bedrock. I estimate roughly 6 blocks above completely dense bedrock. Now if only we had found this sooner before the pockets of our sponsor dried out.
    chance: 100%
    flags: UNIQUE

Doesn't work at all it would seem. Something like this:

Monster_Eggs:
  - drop: writtenbook@author=DoosyDittle~&5Deep Discoveries:&6Archeology Journal 05:page=Day 32 - It's been weeks into our expedition, but all my men have been able to excavate has been a few caveman skeletons and old pottery. I am thinking that we need to go deeper underground, now if only I can get us the grant money.:page=Day 48 - Finally convinced my sponsors to dish out the cash, now we can finally excavate at the levels we need, lets hope this pays off.:page=Day 49 - Eureka. We found a pefectly intact dragon skeleton, and so close to bedrock. I estimate roughly 6 blocks above completely dense bedrock. Now if only we had found this sooner before the pockets of our sponsor dried out.
    chance: 100%
    flags: UNIQUE

Doesn't work either. and lastly, something like this:

Monster_Eggs:
  - drop: writtenbook@author=DoosyDittle:title=&5Deep Discoveries:&6Archeology Journal 05:page=Day 32 - It's been weeks into our expedition, but all my men have been able to excavate has been a few caveman skeletons and old pottery. I am thinking that we need to go deeper underground, now if only I can get us the grant money.:page=Day 48 - Finally convinced my sponsors to dish out the cash, now we can finally excavate at the levels we need, lets hope this pays off.:page=Day 49 - Eureka. We found a pefectly intact dragon skeleton, and so close to bedrock. I estimate roughly 6 blocks above completely dense bedrock. Now if only we had found this sooner before the pockets of our sponsor dried out.
    chance: 100%
    flags: UNIQUE

Doesn't work either.

CelticMinstrel commented 11 years ago

Was this closed because it was solved, or by accident?

VoxPopuliZombiemold commented 11 years ago

I found out a way to do it. Though the syntax for books doesn't support color codes itself, you can still separate the syntax with ! and do the lore and name like a normal item.

CelticMinstrel commented 11 years ago

So you can't put colours in book pages?

Zarius commented 11 years ago

Although the section character would always work people find it easier to remember/type the &a etc color codes which requires specific support.

I hadn't supported variables (which includes colors) in book title/author/pages at the time this issue was opened but issue #211 notes a fix for that. (noticed I hadn't mentioned specifically that colors had been fixed in the issue - noted that in the issue now)

CelticMinstrel commented 11 years ago

Adding &a etc support is trivial now, since there's a method in ChatColor that does it for you.

Zarius commented 11 years ago

Yes, but the point was that it's not automatic - I plain forgot to support it for the book data :-) On 14/04/2013 4:44 AM, "CelticMinstrel" notifications@github.com wrote:

Adding &a etc support is trivial now, since there's a method in ChatColor that does it for you.

— Reply to this email directly or view it on GitHubhttps://github.com/Zarius/Bukkit-OtherBlocks/issues/201#issuecomment-16338507 .