From 247306afefa2dbf307c8b1672d506ba107d85d57 Mon Sep 17 00:00:00 2001 From: sandtechnology Date: Sun, 29 Nov 2020 21:26:40 +0800 Subject: [PATCH] floor the distance in find command Former-commit-id: 5c41cb5dbd11ffa628d53669f3ffc547cd462071 --- .../quickshop/command/subcommand/SubCommand_Find.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/maxgamer/quickshop/command/subcommand/SubCommand_Find.java b/src/main/java/org/maxgamer/quickshop/command/subcommand/SubCommand_Find.java index cfb75d0ad..b868ba8a9 100644 --- a/src/main/java/org/maxgamer/quickshop/command/subcommand/SubCommand_Find.java +++ b/src/main/java/org/maxgamer/quickshop/command/subcommand/SubCommand_Find.java @@ -111,7 +111,7 @@ public class SubCommand_Find implements CommandProcesser { if (distance >= minDistanceSquared) { continue; } - nearByShopList.add(new AbstractMap.SimpleEntry<>(shop, distance)); + nearByShopList.add(new AbstractMap.SimpleEntry<>(shop, Math.floor(distance))); if (nearByShopList.size() == limit) { break findingProcess; } @@ -142,7 +142,7 @@ public class SubCommand_Find implements CommandProcesser { Shop shop = shopDoubleEntry.getKey(); Location location = shop.getLocation(); // "nearby-shop-entry": "&a- Info:{0} &aPrice:&b{1} &ax:&b{2} &ay:&b{3} &az:&b{4} &adistance: &b{5} &ablock(s)" - stringBuilder.append(MsgUtil.getMessage("nearby-shop-entry", sender, shop.getSignText()[1], shop.getSignText()[3], location.getBlockX(), location.getBlockY(), location.getBlockZ(), Math.floor(shopDoubleEntry.getValue()))).append("\n"); + stringBuilder.append(MsgUtil.getMessage("nearby-shop-entry", sender, shop.getSignText()[1], shop.getSignText()[3], location.getBlockX(), location.getBlockY(), location.getBlockZ(), shopDoubleEntry.getValue())).append("\n"); } MsgUtil.sendMessage(sender, stringBuilder.toString()); }