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>();
|
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)
|
||||||
{
|
{
|
||||||
|
|
|
@ -552,15 +552,15 @@ protect:
|
||||||
storm: false
|
storm: false
|
||||||
thunder: false
|
thunder: false
|
||||||
lightning: false
|
lightning: false
|
||||||
|
|
||||||
############################################################
|
############################################################
|
||||||
# +------------------------------------------------------+ #
|
# +------------------------------------------------------+ #
|
||||||
# | EssentialsAntiBuild | #
|
# | EssentialsAntiBuild | #
|
||||||
# +------------------------------------------------------+ #
|
# +------------------------------------------------------+ #
|
||||||
############################################################
|
############################################################
|
||||||
|
|
||||||
# Disable various default physics and behaviors
|
# Disable various default physics and behaviors
|
||||||
|
|
||||||
# Should people with build: false in permissions be allowed to build
|
# Should people with build: false in permissions be allowed to build
|
||||||
# Set true to disable building for those people
|
# Set true to disable building for those people
|
||||||
# Setting to false means EssentialsAntiBuild will never prevent you from building
|
# Setting to false means EssentialsAntiBuild will never prevent you from building
|
||||||
|
@ -573,7 +573,7 @@ protect:
|
||||||
|
|
||||||
# Should we tell people they are not allowed to build
|
# Should we tell people they are not allowed to build
|
||||||
warn-on-build-disallow: true
|
warn-on-build-disallow: true
|
||||||
|
|
||||||
# For which block types would you like to be alerted?
|
# For which block types would you like to be alerted?
|
||||||
# You can find a list of IDs in plugins/Essentials/items.csv after loading Essentials for the first time.
|
# You can find a list of IDs in plugins/Essentials/items.csv after loading Essentials for the first time.
|
||||||
# 10 = lava :: 11 = still lava :: 46 = TNT :: 327 = lava bucket
|
# 10 = lava :: 11 = still lava :: 46 = TNT :: 327 = lava bucket
|
||||||
|
@ -612,7 +612,7 @@ newbies:
|
||||||
# When we spawn for the first time, which spawnpoint do we use?
|
# When we spawn for the first time, which spawnpoint do we use?
|
||||||
# Set to "none" if you want to use the spawn point of the world.
|
# Set to "none" if you want to use the spawn point of the world.
|
||||||
spawnpoint: newbies
|
spawnpoint: newbies
|
||||||
|
|
||||||
# Do we want to give users anything on first join? Set to '' to disable
|
# Do we want to give users anything on first join? Set to '' to disable
|
||||||
# This kit will be given regardless of cost, and permissions.
|
# This kit will be given regardless of cost, and permissions.
|
||||||
#kit: ''
|
#kit: ''
|
||||||
|
|
|
@ -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();
|
||||||
|
|
Loading…
Reference in New Issue
Block a user