mirror of
https://github.com/essentials/Essentials.git
synced 2025-08-11 17:15:07 +02:00
Support new lines in newbie welcome message.
This commit is contained in:
@@ -11,7 +11,9 @@ public class SimpleTextInput implements IText
|
|||||||
private final transient List<String> lines = new ArrayList<String>();
|
private final transient List<String> lines = new ArrayList<String>();
|
||||||
|
|
||||||
public SimpleTextInput (final String input) {
|
public SimpleTextInput (final String input) {
|
||||||
lines.add(input);
|
for (String line : input.split("\\n")) {
|
||||||
|
lines.add(line);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@@ -1,5 +1,6 @@
|
|||||||
package com.earth2me.essentials.textreader;
|
package com.earth2me.essentials.textreader;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
import org.bukkit.command.CommandSender;
|
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)
|
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 IText output = new KeywordReplacer(ess.getSettings().getAnnounceNewPlayerFormat(), user, ess);
|
||||||
final SimpleTextPager pager = new SimpleTextPager(output);
|
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();
|
final String kitName = ess.getSettings().getNewPlayerKit();
|
||||||
|
Reference in New Issue
Block a user