mirror of
https://github.com/EssentialsX/Essentials.git
synced 2024-06-26 14:45:04 +02:00
Support new lines in newbie welcome message.
This commit is contained in:
parent
5cc24827fc
commit
2f40264c46
|
@ -11,7 +11,9 @@ public class SimpleTextInput implements IText
|
|||
private final transient List<String> lines = new ArrayList<String>();
|
||||
|
||||
public SimpleTextInput (final String input) {
|
||||
lines.add(input);
|
||||
for (String line : input.split("\\n")) {
|
||||
lines.add(line);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package com.earth2me.essentials.textreader;
|
||||
|
||||
import java.util.List;
|
||||
import org.bukkit.command.CommandSender;
|
||||
|
||||
|
||||
|
@ -20,7 +21,12 @@ public class SimpleTextPager
|
|||
}
|
||||
}
|
||||
|
||||
public String getString(int line)
|
||||
public List<String> getLines()
|
||||
{
|
||||
return text.getLines();
|
||||
}
|
||||
|
||||
public String getLine(int line)
|
||||
{
|
||||
if (text.getLines().size() < line)
|
||||
{
|
||||
|
|
|
@ -101,7 +101,11 @@ public class EssentialsSpawnPlayerListener implements Listener
|
|||
{
|
||||
final IText output = new KeywordReplacer(ess.getSettings().getAnnounceNewPlayerFormat(), user, ess);
|
||||
final SimpleTextPager pager = new SimpleTextPager(output);
|
||||
ess.broadcastMessage(user, pager.getString(0));
|
||||
|
||||
for (String line : pager.getLines())
|
||||
{
|
||||
ess.broadcastMessage(user, line);
|
||||
}
|
||||
}
|
||||
|
||||
final String kitName = ess.getSettings().getNewPlayerKit();
|
||||
|
|
Loading…
Reference in New Issue
Block a user