Fixed issue and updated bungee motd manager.
This commit is contained in:
parent
77a63f72cc
commit
a20a9ba9e7
@ -1,5 +1,6 @@
|
||||
package mineplex.bungee.motd;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
@ -31,9 +32,19 @@ public class MotdManager implements Listener, Runnable
|
||||
_plugin.getProxy().getScheduler().schedule(_plugin, this, 5L, 30L, TimeUnit.SECONDS);
|
||||
_plugin.getProxy().getPluginManager().registerListener(_plugin, this);
|
||||
|
||||
_repository = new RedisDataRepository<GlobalMotd>(ServerManager.getMasterConnection(), ServerManager.getSlaveConnection(),
|
||||
_repository = new RedisDataRepository<GlobalMotd>(ServerManager.getConnection(true, ServerManager.SERVER_STATUS_LABEL), ServerManager.getConnection(false, ServerManager.SERVER_STATUS_LABEL),
|
||||
Region.ALL, GlobalMotd.class, "globalMotd");
|
||||
run();
|
||||
|
||||
if (new File("updateMOTD.dat").exists())
|
||||
{
|
||||
List<String> lines = new ArrayList<String>();
|
||||
lines.add(" §b§l◄§f§lNEW§b§l► §f§l◄§b§lSKYWARS§f§l► §b§l◄§f§lNEW§b§l►");
|
||||
//lines.add(" §d§lRank Sale §a§l40% Off");
|
||||
|
||||
updateMainMotd(" §b§l§m §8§l§m[ §r §9§lMineplex§r §f§lGames§r §8§l§m ]§b§l§m §r", lines);
|
||||
System.out.println("Updated Bungee MOTD");
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
@ -53,14 +64,6 @@ public class MotdManager implements Listener, Runnable
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
// Add in default MOTD listing to database
|
||||
|
||||
List<String> lines = new ArrayList<String>();
|
||||
lines.add(" §b§l◄§f§lNEW§b§l► §f§l◄§b§lSKYWARS§f§l► §b§l◄§f§lNEW§b§l►");
|
||||
//lines.add(" §d§lRank Sale §a§l40% Off");
|
||||
|
||||
updateMainMotd(" §b§l§m §8§l§m[ §r §9§lMineplex§r §f§lGames§r §8§l§m ]§b§l§m §r", lines);
|
||||
|
||||
GlobalMotd motd = _repository.getElement("MainMotd");
|
||||
|
||||
if (motd != null)
|
||||
|
Loading…
Reference in New Issue
Block a user