Update PlaceholdersList.java

Adding a MOTD variable to be used in holograms.
This commit is contained in:
Mammothskier 2014-09-01 17:27:32 -08:00
parent b4afaf2489
commit 7b4da47bcd

View File

@ -12,7 +12,7 @@ import com.gmail.filoghost.holograms.Configuration;
public class PlaceholdersList { public class PlaceholdersList {
// Each 2 tenths of second // Each 2 tenths of second
private static final Placeholder RAINBOW_TEXT = new AnimatedPlaceholder("&u", 2, new String[] {"§c", "§6", "§e", "§a", "§b", "§d"}); private static final Placeholder RAINBOW_TEXT = new AnimatedPlaceholder("&u", 2, new String[] {"§c", "§6", "§e", "§a", "§b", "§d"});
// Each second // Each second
private static final Placeholder ONLINE_PLAYERS = new Placeholder("{online}", "{o}", 10) { private static final Placeholder ONLINE_PLAYERS = new Placeholder("{online}", "{o}", 10) {
@ -34,6 +34,15 @@ public class PlaceholdersList {
}; };
// Each 60 seconds
private static final Placeholder MOTD = new Placeholder("{motd}", "{message_of_the_day}", 600) {
@Override
public void update() {
currentReplacement = Bukkit.getServer().getMotd();
}
};
// Each second // Each second
private static final Placeholder TIME = new Placeholder("{time}", "{t}", 10) { private static final Placeholder TIME = new Placeholder("{time}", "{t}", 10) {
@ -45,9 +54,9 @@ public class PlaceholdersList {
}; };
// Each 5 seconds, maybe has changed // Each 5 seconds, maybe has changed
private static final Placeholder DISPLAYNAME = new AnimatedPlaceholder("{displayname}", 30, new String[]{"§f{displayname}", "§r{displayname}"}); private static final Placeholder DISPLAYNAME = new AnimatedPlaceholder("{displayname}", 30, new String[]{"§f{displayname}", "§r{displayname}"});
private static List<Placeholder> defaultList = Arrays.asList(RAINBOW_TEXT, ONLINE_PLAYERS, MAX_PLAYERS, TIME, DISPLAYNAME); private static List<Placeholder> defaultList = Arrays.asList(RAINBOW_TEXT, ONLINE_PLAYERS, MAX_PLAYERS, TIME, DISPLAYNAME, MOTD);
private static List<AnimatedPlaceholder> animatedList = new ArrayList<AnimatedPlaceholder>(); private static List<AnimatedPlaceholder> animatedList = new ArrayList<AnimatedPlaceholder>();
public static List<Placeholder> getDefaults() { public static List<Placeholder> getDefaults() {