adventure v4.1.0; project now compiles

This commit is contained in:
Mariell Hoversholm
2020-10-17 21:45:43 +02:00
committed by dordsor21
parent 38333a6d11
commit 333493f351
6 changed files with 12 additions and 10 deletions

View File

@ -147,7 +147,7 @@ public class Debug extends SubCommand {
player.sendMessage(StaticCaption.of(msg.toString()));
return true;
}
TextComponent.Builder information = TextComponent.builder();
TextComponent.Builder information = Component.text();
Component header = MINI_MESSAGE.parse(TranslatableCaption.of("debug.debug_header").getComponent(player) + "\n");
String line = TranslatableCaption.of("debug.debug_line").getComponent(player) + "\n";
String section = TranslatableCaption.of("debug.debug_section").getComponent(player) + "\n";

View File

@ -33,6 +33,7 @@ import com.plotsquared.core.util.StringMan;
import com.plotsquared.core.util.helpmenu.HelpMenu;
import com.plotsquared.core.util.task.RunnableVal2;
import com.plotsquared.core.util.task.RunnableVal3;
import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.TextComponent;
import net.kyori.adventure.text.minimessage.Template;
@ -105,17 +106,17 @@ public class Help extends Command {
}
}
if (cat == null && page == 0) {
TextComponent.Builder builder = TextComponent.builder();
TextComponent.Builder builder = Component.text();
builder.append(MINI_MESSAGE.parse(TranslatableCaption.of("help.help_header").getComponent(player)));
for (CommandCategory c : CommandCategory.values()) {
builder.append("\n").append(MINI_MESSAGE
builder.append(Component.newline()).append(MINI_MESSAGE
.parse(TranslatableCaption.of("help.help_info_item").getComponent(player), Template.of("category", c.name().toLowerCase()),
Template.of("category_desc", c.getComponent(player))));
}
builder.append("\n").append(MINI_MESSAGE
builder.append(Component.newline()).append(MINI_MESSAGE
.parse(TranslatableCaption.of("help.help_info_item").getComponent(player), Template.of("category", "all"),
Template.of("category_desc", "Display all commands")));
builder.append("\n").append(MINI_MESSAGE.parse(TranslatableCaption.of("help.help_footer").getComponent(player)));
builder.append(Component.newline()).append(MINI_MESSAGE.parse(TranslatableCaption.of("help.help_footer").getComponent(player)));
player.sendMessage(StaticCaption.of(MINI_MESSAGE.serialize(builder.asComponent())));
return true;
}

View File

@ -70,7 +70,7 @@ public class Inbox extends SubCommand {
if (max > comments.length) {
max = comments.length;
}
TextComponent.Builder builder = TextComponent.builder();
TextComponent.Builder builder = Component.text();
builder.append(MINI_MESSAGE.parse(TranslatableCaption.of("list.comment_list_header_paged").getComponent(player) + '\n',
Template.of("amount", String.valueOf(comments.length)), Template.of("cur", String.valueOf(page + 1)),
Template.of("max", String.valueOf(totalPages + 1)), Template.of("word", "all")));

View File

@ -818,7 +818,7 @@ public abstract class PlotPlayer<P> implements CommandCaller, OfflinePlotPlayer,
Duration.of(stay * 50, ChronoUnit.MILLIS),
Duration.of(fadeOut * 50, ChronoUnit.MILLIS));
getAudience().showTitle(Title
.of(titleComponent, subtitleComponent, times));
.title(titleComponent, subtitleComponent, times));
}
@Override public void sendMessage(@Nonnull final Caption caption,