NLthijs48 / AreaShop

A Bukkit/Spigot (Minecraft server) plugin that facilitates renting and buying WorldGuard regions
GNU General Public License v3.0
55 stars 89 forks source link

[break] in lang not working for 1.7 servers #222

Closed EverNife closed 8 years ago

EverNife commented 8 years ago

Current behavior

I want to break line **_\n_\ but it is not working

Steps to reproduce (for bugs)

  1. set [break] in the message you want to break
  2. reload plugin
  3. see your fail T.T

    Images

-------_Ingame_------- image

-------_lang-cofing_------- image

-------_random-default-command-with-original-lang_------- image


My environment

NLthijs48 commented 8 years ago

Thanks for your detailed report.

I have tested this message with a couple different server versions, only on 1.7.x it is broken, 1.8/1.9/1.10 all work correctly. The /tellraw feature these messages use has been introduced in 1.7, so apparently there was a bug with the \n in there.

I'll have to see how I can fix this nicely. The solution would be to use a new /tellraw for each line (after a \n), but for that I will need to rewrite some parts of the message handling code. Because the usage of 1.7 is still 7.3% (mostly modded servers probably) among AreaShop users I would also like to have this fixed.

Until I have a fix ready you could either stop using the fancy messages (set useFancyMessages in config.yml to false) or remove all [break] tags from the messages.

PS: It looks like there is a line break after the < AreaShop > part of your first image, any idea how that happened?

EverNife commented 8 years ago

i used a lot of spaces :V

Life calls us to do hard things :D

NLthijs48 commented 8 years ago

I have implemented the solution for this problem, you can use a development build if you want to use it immediately. If you find any other issues please let me know :)

EverNife commented 8 years ago

ok, i will test it

EverNife commented 8 years ago

_First_try_ I tried to break the line at it start; The result is that hid the previous line.

image

_Second_try_ Break the line in the middle make it to hide until the "place_holder" (If i can call it that...) image


_Sequel_ I tried with a lot other manners, like using a single line to break, etc Also I tried to [break] the line in the prefix, did not work too. (make the prefix desappear)

In fact, it seems to hide the part that shows the information from the _region_ In my case, the "Public_Shop01"

Anyway, sorry for the horrible english, i am brazilian T.T

NLthijs48 commented 8 years ago

A [break] needs to be at the end of a line, so after that you need to continue the text on a new line. Let me know if that works.

EverNife commented 8 years ago

image

The prefix has spacebars to "break" line

If use the [break] after the _region_info_ it hide it.

NLthijs48 commented 8 years ago

Do you get any errors in the log file? because there might be a problem there. I'll test your message myself to see if I find something.

EverNife commented 8 years ago

Here it is: _HasteBin_

I will seek for errors

EverNife commented 8 years ago

Getting this error when /as reload

03.09 13:49:49 [Server] INFO Invalid json: Unexpected value at line 1 column 980

Full lang: _HasteBin_ Dont know if it is related :D

NLthijs48 commented 8 years ago

It took me a while to figure it out, but I found the error and pushed a fix, a new build can be found on web page I linked above.

screenshot_4

EverNife commented 8 years ago

Thank You, working well now :D

image

EverNife commented 7 years ago

Sorry, i had not tested in all parts...

This first one is normal, but this one not : /

image

image

NLthijs48 commented 7 years ago

You cannot use it in greeting messages, those are simply strings that I pass to the greeting flag in WorldGuard. So I have no idea if that flag of WorldGuard support multiple lines or not, you could try to experiment with /region flag greeting <region> <message...> to see if you can find a way to add new lines to it.

EverNife commented 7 years ago

ty, i will

EverNife commented 7 years ago

image

Normal " \n " would take care of the problem

EverNife commented 7 years ago

image image

I changed my code, so it is working now

NLthijs48 commented 7 years ago

Okey cool. I did some tests with the development version of AreaShop (which has some changes to the message system), and there it actually already works with [break], so the next release version this will be working as intended.