mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-25 22:56:45 +01:00
Configure the inspect distance
This commit is contained in:
parent
2cf58f1b5b
commit
79aab57abc
@ -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
|
||||||
*/
|
*/
|
||||||
|
@ -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;
|
||||||
}
|
}
|
||||||
|
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user