diff --git a/src/main/java/com/gmail/nossr50/config/Config.java b/src/main/java/com/gmail/nossr50/config/Config.java index ec245f03d..849f8292f 100644 --- a/src/main/java/com/gmail/nossr50/config/Config.java +++ b/src/main/java/com/gmail/nossr50/config/Config.java @@ -172,6 +172,9 @@ public class Config extends AutoUpdateConfigLoader { public boolean getPTPCommandConfirmRequired() { return config.getBoolean("Commands.ptp.Confirm_Required", true); } public boolean getPTPCommandWorldPermissions() { return config.getBoolean("Commands.ptp.World_Based_Permissions", false); } + /* Inspect command distance */ + public double getInspectDistance() { return config.getDouble("Commands.inspect.Max_Distance", 30); } + /* * ABILITY SETTINGS */ diff --git a/src/main/java/com/gmail/nossr50/util/commands/CommandUtils.java b/src/main/java/com/gmail/nossr50/util/commands/CommandUtils.java index 9984c7945..dfe14ca5b 100644 --- a/src/main/java/com/gmail/nossr50/util/commands/CommandUtils.java +++ b/src/main/java/com/gmail/nossr50/util/commands/CommandUtils.java @@ -5,6 +5,7 @@ import java.util.List; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; +import com.gmail.nossr50.config.Config; import com.gmail.nossr50.datatypes.player.McMMOPlayer; import com.gmail.nossr50.datatypes.player.PlayerProfile; import com.gmail.nossr50.datatypes.skills.SkillType; @@ -46,7 +47,7 @@ public final class CommandUtils { } public static boolean tooFar(CommandSender sender, Player target, boolean hasPermission) { - if (sender instanceof Player && !Misc.isNear(((Player) sender).getLocation(), target.getLocation(), 5.0) && !hasPermission) { + if (sender instanceof Player && !Misc.isNear(((Player) sender).getLocation(), target.getLocation(), Config.getInstance().getInspectDistance()) && !hasPermission) { sender.sendMessage(LocaleLoader.getString("Inspect.TooFar")); return true; } diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml index 52cfedc59..40eef14eb 100644 --- a/src/main/resources/config.yml +++ b/src/main/resources/config.yml @@ -394,6 +394,8 @@ Experience: Commands: mcmmo: Donate_Message: true + inspect: + Max_Distance: 30 ptp: Cooldown: 120 Warmup: 5