Fix some inbox issues

This commit is contained in:
SirYwell 2021-06-08 11:56:03 +02:00
parent 9b043b7444
commit 2b3ecc178a
2 changed files with 7 additions and 5 deletions

View File

@ -27,6 +27,7 @@ package com.plotsquared.core.command;
import com.google.inject.TypeLiteral;
import com.plotsquared.core.configuration.caption.StaticCaption;
import com.plotsquared.core.configuration.caption.Templates;
import com.plotsquared.core.configuration.caption.TranslatableCaption;
import com.plotsquared.core.permissions.Permission;
import com.plotsquared.core.player.MetaDataAccess;
@ -196,8 +197,9 @@ public class Inbox extends SubCommand {
if (args.length != 3) {
player.sendMessage(
TranslatableCaption.of("commandconfig.command_syntax"),
Template.of("value", "/plot inbox " + inbox.toString() + " delete <index>")
Template.of("value", "/plot inbox " + inbox + " delete <index>")
);
return true;
}
final int index;
try {
@ -205,14 +207,14 @@ public class Inbox extends SubCommand {
if (index < 1) {
player.sendMessage(
TranslatableCaption.of("comment.not_valid_inbox_index"),
Template.of("number", index + "")
Templates.of("number", index)
);
return false;
}
} catch (NumberFormatException ignored) {
player.sendMessage(
TranslatableCaption.of("commandconfig.command_syntax"),
Template.of("value", "/plot inbox " + inbox.toString() + " delete <index>")
Template.of("value", "/plot inbox " + inbox + " delete <index>")
);
return false;
}
@ -223,7 +225,7 @@ public class Inbox extends SubCommand {
if (index > value.size()) {
player.sendMessage(
TranslatableCaption.of("comment.not_valid_inbox_index"),
Template.of("number", index + "")
Templates.of("number", index)
);
return;
}

View File

@ -2508,8 +2508,8 @@ public class SQLManager implements AbstractDB {
PlotComment comment =
new PlotComment(world, id, msg, sender, inbox, timestamp);
comments.add(comment);
whenDone.value = comments;
}
whenDone.value = comments;
}
TaskManager.runTask(whenDone);
}