9
0
mirror of https://github.com/HibiscusMC/HMCCosmetics.git synced 2026-01-04 15:41:45 +00:00

Better title handling

This commit is contained in:
LoJoSho
2023-01-08 11:24:46 -06:00
parent 1b802861e3
commit bc74c45b40
4 changed files with 34 additions and 6 deletions

View File

@@ -67,9 +67,13 @@ public class MessagesUtil {
}
public static void sendTitle(Player player, String message) {
sendTitle(player, message, 2000, 2000, 2000);
}
public static void sendTitle(Player player, String message, int fadein, int stay, int fadeout) {
Audience target = BukkitAudiences.create(HMCCosmeticsPlugin.getInstance()).player(player);
Title.Times times = Title.Times.times(Duration.ofMillis(3000), Duration.ofMillis(3000), Duration.ofMillis(1000));
Title.Times times = Title.Times.times(Duration.ofMillis(WardrobeSettings.getTransitionFadeIn()), Duration.ofMillis(3000), Duration.ofMillis(1000));
Title title = Title.title(processStringNoKey(player, message), Component.empty(), times);
target.showTitle(title);