Fixed weird stock message when stock not specified and no shops are found

This commit is contained in:
Teriuihi 2022-11-11 04:27:34 +01:00
parent 515613c36d
commit 72fd7efc86

View File

@ -83,6 +83,9 @@ public class CheckStockCommand {
component = component.append(Component.newline()).append(Util.parseMiniMessage(putInConfig, resolver)); component = component.append(Component.newline()).append(Util.parseMiniMessage(putInConfig, resolver));
} }
if (component == null) if (component == null)
if (minimumStock == -1)
player.sendMessage(Util.parseMiniMessage("<yellow>No shops found in specified radius.<yellow>"));
else
player.sendMessage(Util.parseMiniMessage( player.sendMessage(Util.parseMiniMessage(
"<yellow>No shops with less than <minimum_stock> stock found.</yellow>", "<yellow>No shops with less than <minimum_stock> stock found.</yellow>",
TagResolver.resolver(Placeholder.parsed("minimum_stock", minimumStock + "")))); TagResolver.resolver(Placeholder.parsed("minimum_stock", minimumStock + ""))));