Configure the inspect distance

This commit is contained in:
T00thpick1 2013-05-16 19:31:12 -04:00
parent 2cf58f1b5b
commit 79aab57abc
3 changed files with 7 additions and 1 deletions

View File

@ -172,6 +172,9 @@ public class Config extends AutoUpdateConfigLoader {
public boolean getPTPCommandConfirmRequired() { return config.getBoolean("Commands.ptp.Confirm_Required", true); } public boolean getPTPCommandConfirmRequired() { return config.getBoolean("Commands.ptp.Confirm_Required", true); }
public boolean getPTPCommandWorldPermissions() { return config.getBoolean("Commands.ptp.World_Based_Permissions", false); } 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 * ABILITY SETTINGS
*/ */

View File

@ -5,6 +5,7 @@ import java.util.List;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import com.gmail.nossr50.config.Config;
import com.gmail.nossr50.datatypes.player.McMMOPlayer; import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.datatypes.player.PlayerProfile; import com.gmail.nossr50.datatypes.player.PlayerProfile;
import com.gmail.nossr50.datatypes.skills.SkillType; 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) { 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")); sender.sendMessage(LocaleLoader.getString("Inspect.TooFar"));
return true; return true;
} }

View File

@ -394,6 +394,8 @@ Experience:
Commands: Commands:
mcmmo: mcmmo:
Donate_Message: true Donate_Message: true
inspect:
Max_Distance: 30
ptp: ptp:
Cooldown: 120 Cooldown: 120
Warmup: 5 Warmup: 5