Improve screen message util

This commit is contained in:
Daniel Saukel 2016-01-10 16:54:23 +01:00
parent 262eceabfa
commit e6ebee2d27
3 changed files with 20 additions and 12 deletions

View File

@ -227,6 +227,11 @@ public class MessageUtil {
case UNKNOWN:
UNKNOWN.sendScreenMessage(player, title, subtitle, fadeIn, show, fadeOut);
break;
case v1_7_R3:
case v1_7_R4:
case OUTDATED:
OUTDATED.sendScreenMessage(player, title, subtitle, fadeIn, show, fadeOut);
break;
default:
return;
}

View File

@ -0,0 +1,15 @@
package io.github.dre2n.dungeonsxl.util.messageutil;
import org.bukkit.ChatColor;
import org.bukkit.entity.Player;
public class OUTDATED {
static void sendScreenMessage(Player player, String title, String subtitle, long fadeIn, long show, long fadeOut) {
subtitle = ChatColor.translateAlternateColorCodes('&', subtitle);
title = ChatColor.translateAlternateColorCodes('&', title);
MessageUtil.sendCenteredMessage(player, title);
MessageUtil.sendCenteredMessage(player, subtitle);
}
}

View File

@ -14,16 +14,4 @@ class UNKNOWN {
Bukkit.getServer().dispatchCommand(Bukkit.getConsoleSender(), "title " + player.getName() + " title " + title);
}
static void sendScreenMessage(Player player, String title, String subtitle) {
subtitle = ChatColor.translateAlternateColorCodes('&', subtitle);
title = ChatColor.translateAlternateColorCodes('&', title);
Bukkit.getServer().dispatchCommand(Bukkit.getConsoleSender(), "title " + player.getName() + " subtitle " + subtitle);
Bukkit.getServer().dispatchCommand(Bukkit.getConsoleSender(), "title " + player.getName() + " title " + title);
}
public static void sendScreenMessage(Player player, String title) {
title = ChatColor.translateAlternateColorCodes('&', title);
Bukkit.getServer().dispatchCommand(Bukkit.getConsoleSender(), "title " + player.getName() + " title \"" + title + "\"");
}
}