From 2b3ecc178a73b774d7d266e0c1b598945cc325a7 Mon Sep 17 00:00:00 2001 From: SirYwell Date: Tue, 8 Jun 2021 11:56:03 +0200 Subject: [PATCH] Fix some inbox issues --- .../main/java/com/plotsquared/core/command/Inbox.java | 10 ++++++---- .../java/com/plotsquared/core/database/SQLManager.java | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/Core/src/main/java/com/plotsquared/core/command/Inbox.java b/Core/src/main/java/com/plotsquared/core/command/Inbox.java index ae1cc4a08..8b8574b1c 100644 --- a/Core/src/main/java/com/plotsquared/core/command/Inbox.java +++ b/Core/src/main/java/com/plotsquared/core/command/Inbox.java @@ -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 ") + Template.of("value", "/plot inbox " + inbox + " delete ") ); + 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 ") + Template.of("value", "/plot inbox " + inbox + " delete ") ); 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; } diff --git a/Core/src/main/java/com/plotsquared/core/database/SQLManager.java b/Core/src/main/java/com/plotsquared/core/database/SQLManager.java index 4dbbaf55e..dcf427055 100644 --- a/Core/src/main/java/com/plotsquared/core/database/SQLManager.java +++ b/Core/src/main/java/com/plotsquared/core/database/SQLManager.java @@ -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); }