EssentialsX

EssentialsX

2M Downloads

Book systems don't work

Medialo opened this issue ยท 5 comments

commented

EssentialsX version (/essentials): Essentials 2.0.1-b556

Server software (/version): Spigot 5695bca-53fccdf MC:1.12.2 (API version 1.12..2-R0.1-SNAPSHOT)

Server (logs/latest.log):
latest.log

EssentialsX config (if applicable):

My problem is simply that Essentials doesn't create a book. yml file when ordering /kit color, so give me a book with the message: Invalid Tag Book.
So I have to go back to an old version for the books to work.

commented

Can you show your book.yml and kits from your config?

commented

Hello, here is the config file (kit), but the book. yml file is not created, when the server starts or even when ordering /kit color for example. .

####
kits:
  tools:
    delay: 10
    items:
      - 272 1
      - 273 1
      - 274 1
      - 275 1
  dtools:
    delay: 600
    items:
      - 278 1 efficiency:1 durability:1 fortune:1 name:&4Gigadrill lore:The_drill_that_&npierces|the_heavens
      - 277 1 digspeed:3 name:Dwarf lore:Diggy|Diggy|Hole
      - 298 1 color:255,255,255 name:Top_Hat lore:Good_day,_Good_day
      - 279:780 1
  notch:
    delay: 6000
    items:
      - 397:3 1 player:Notch
  color:
    delay: 6000
    items:
      - 387 1 title:&4Book_&9o_&6Colors author:KHobbits lore:Ingame_color_codes book:Colors
  firework:
    delay: 6000
    items:
      - 401 1 name:Angry_Creeper color:red fade:green type:creeper power:1
      - 401 1 name:Starry_Night color:yellow,orange fade:blue type:star effect:trail,twinkle power:1
      - 401 2 name:Solar_Wind color:yellow,orange fade:red shape:large effect:twinkle color:yellow,orange fade:red shape:ball effect:trail color:red,purple fade:pink shape:star effect:trail power:1


commented

book.txt
I add my book. txt that I added in the essentials files because the file was not created automatically, I confirm that this configuration works on an older version but does not work on the Essentials 2.0.1-b556 version.

commented

I fixed the error on my server. Just move the title and lore tags after the book: tag in config.yml

For example, - 387 1 title:&2Bukkit_&bFormatting_&4Codes author:Spotrealms lore:Ingame_color_codes book:SpotrealmsColors becomes - 387 1 book:SpotrealmsColors title:&2Bukkit_&bFormatting_&4Codes author:Spotrealms lore:Ingame_color_codes
Hope this helps.
Update: I have submitted a PR (#1741) for this fix.

commented

This is a side effect of #1722 and 5fa2ce7.

@SupaHam's fix aggressively concats aything after lore: and destroys subsequent tags. See relevant lines:

} else {
string[loreIndex] += " " + string[i];
string[i] = null;
dirty = true;
}
}
if (dirty) {
string = (String[]) ArrayUtils.subarray(string, 0, loreIndex + 1);
}

As long as lore: is put at the end, everything should work completely fine.

Although you might not like it, I believe the best fix for this is to require the lore argument to be escaped somehow. Since the existing doc states that the pipe (|) should separate lines, perhaps a way to do this is to signal the end of all lore entries by placing a pipe at the end of the text. I don't believe it is possible to retain the current one-line configuration format if this issue is to be fixed in its entirety because people WILL forget to escape.

Thoughts?