35 lines
900 B
Java
35 lines
900 B
Java
package cn.citycraft.SimpleProtect.listen;
|
|
|
|
import org.bukkit.entity.Player;
|
|
import org.bukkit.event.EventHandler;
|
|
import org.bukkit.event.Listener;
|
|
import org.bukkit.event.player.PlayerJoinEvent;
|
|
|
|
import cn.citycraft.SimpleProtect.SimpleProtect;
|
|
import cn.citycraft.SimpleProtect.config.Config;
|
|
|
|
public class Tip implements Listener {
|
|
SimpleProtect plugin;
|
|
|
|
public Tip(SimpleProtect instance) {
|
|
plugin = instance;
|
|
}
|
|
|
|
@EventHandler
|
|
public void onJoin(final PlayerJoinEvent e) {
|
|
plugin.getServer().getScheduler()
|
|
.runTaskLaterAsynchronously(plugin, new Runnable() {
|
|
public void run() {
|
|
Player p = e.getPlayer();
|
|
String[] msg = Config.getStringArray("Tip.Message");
|
|
for (String s : msg) {
|
|
s = s.replaceAll("&", "§");
|
|
p.sendMessage(plugin.servername + plugin.pluginname
|
|
+ s);
|
|
}
|
|
}
|
|
}, 15);
|
|
}
|
|
|
|
}
|