Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,6 @@ public static void autoExecute(ScriptEntry scriptEntry,
}

public static String parse(ParseableTag tag, BukkitTagContext context) {
return tag == null ? null : tag.parse(context).toString();
return tag == null ? "" : tag.parse(context).toString();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -159,13 +159,11 @@ public void showTabListHeaderFooter(Player player, String header, String footer)

@Override
public void showTitle(Player player, String title, String subtitle, int fadeInTicks, int stayTicks, int fadeOutTicks) {
send(player, new ClientboundSetTitlesAnimationPacket(fadeInTicks, stayTicks, fadeOutTicks));
if (title != null) {
send(player, new ClientboundSetTitleTextPacket(Handler.componentToNMS(FormattedTextHelper.parse(title, ChatColor.WHITE))));
}
if (subtitle != null) {
send(player, new ClientboundSetSubtitleTextPacket(Handler.componentToNMS(FormattedTextHelper.parse(subtitle, ChatColor.WHITE))));
}
send(player, new ClientboundBundlePacket(List.of(
new ClientboundSetTitlesAnimationPacket(fadeInTicks, stayTicks, fadeOutTicks),
new ClientboundSetTitleTextPacket(Handler.componentToNMS(FormattedTextHelper.parse(title, ChatColor.WHITE))),
new ClientboundSetSubtitleTextPacket(Handler.componentToNMS(FormattedTextHelper.parse(subtitle, ChatColor.WHITE)))
)));
}

@Override
Expand Down