mirror of
https://github.com/darksaid98/HuskHomes.git
synced 2026-12-04 14:38:53 +00:00
Improve way titles are sent to players
This commit is contained in:
2 files changed
+7
-5
No files matched your search
@@ -26,7 +26,7 @@ import net.kyori.adventure.key.InvalidKeyException;
|
|||||||
import net.kyori.adventure.key.Key;
|
import net.kyori.adventure.key.Key;
|
||||||
import net.kyori.adventure.sound.Sound;
|
import net.kyori.adventure.sound.Sound;
|
||||||
import net.kyori.adventure.text.Component;
|
import net.kyori.adventure.text.Component;
|
||||||
import net.kyori.adventure.title.TitlePart;
|
import net.kyori.adventure.title.Title;
|
||||||
import net.william278.huskhomes.config.Locales;
|
import net.william278.huskhomes.config.Locales;
|
||||||
import net.william278.huskhomes.position.Location;
|
import net.william278.huskhomes.position.Location;
|
||||||
import net.william278.huskhomes.position.Position;
|
import net.william278.huskhomes.position.Position;
|
||||||
@@ -90,9 +90,11 @@ public abstract class OnlineUser extends User implements Teleportable, CommandUs
|
|||||||
* @param subTitle whether to send the title as a subtitle ({@code true} for a subtitle, {@code false} for a title)
|
* @param subTitle whether to send the title as a subtitle ({@code true} for a subtitle, {@code false} for a title)
|
||||||
*/
|
*/
|
||||||
public void sendTitle(@NotNull MineDown mineDown, boolean subTitle) {
|
public void sendTitle(@NotNull MineDown mineDown, boolean subTitle) {
|
||||||
getAudience().sendTitlePart(subTitle ? TitlePart.SUBTITLE : TitlePart.TITLE, mineDown
|
final Component message = mineDown.disable(MineDownParser.Option.SIMPLE_FORMATTING).replace().toComponent();
|
||||||
.disable(MineDownParser.Option.SIMPLE_FORMATTING)
|
getAudience().showTitle(Title.title(
|
||||||
.replace().toComponent());
|
subTitle ? Component.empty() : message,
|
||||||
|
subTitle ? message : Component.empty()
|
||||||
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
+1
-1
@@ -3,7 +3,7 @@ javaVersion=16
|
|||||||
org.gradle.jvmargs='-Dfile.encoding=UTF-8'
|
org.gradle.jvmargs='-Dfile.encoding=UTF-8'
|
||||||
org.gradle.daemon=true
|
org.gradle.daemon=true
|
||||||
|
|
||||||
plugin_version=4.5.2
|
plugin_version=4.5.3
|
||||||
plugin_archive=huskhomes
|
plugin_archive=huskhomes
|
||||||
plugin_description=The powerful and intuitive homes, warps, and teleports plugin/mod
|
plugin_description=The powerful and intuitive homes, warps, and teleports plugin/mod
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user