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