mirror of
https://github.com/DRE2N/DungeonsXL.git
synced 2024-11-14 14:45:31 +01:00
Improve screen message util
This commit is contained in:
parent
262eceabfa
commit
e6ebee2d27
@ -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;
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
}
|
@ -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 + "\"");
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user