mirror of
https://github.com/EngineHub/WorldGuard.git
synced 2024-08-29 00:39:35 +02:00
Added macro and colour support to deny-message
This commit is contained in:
parent
60731f9836
commit
84017bffc4
|
@ -39,6 +39,7 @@
|
||||||
import com.sk89q.worldguard.bukkit.util.Events;
|
import com.sk89q.worldguard.bukkit.util.Events;
|
||||||
import com.sk89q.worldguard.bukkit.util.InteropUtils;
|
import com.sk89q.worldguard.bukkit.util.InteropUtils;
|
||||||
import com.sk89q.worldguard.bukkit.util.Materials;
|
import com.sk89q.worldguard.bukkit.util.Materials;
|
||||||
|
import com.sk89q.worldguard.commands.CommandUtils;
|
||||||
import com.sk89q.worldguard.config.WorldConfiguration;
|
import com.sk89q.worldguard.config.WorldConfiguration;
|
||||||
import com.sk89q.worldguard.domains.Association;
|
import com.sk89q.worldguard.domains.Association;
|
||||||
import com.sk89q.worldguard.internal.permission.RegionPermissionModel;
|
import com.sk89q.worldguard.internal.permission.RegionPermissionModel;
|
||||||
|
@ -111,6 +112,8 @@ private void tellErrorMessage(DelegateEvent event, Cause cause, Location locatio
|
||||||
if (lastTime == null || now - lastTime >= LAST_MESSAGE_DELAY) {
|
if (lastTime == null || now - lastTime >= LAST_MESSAGE_DELAY) {
|
||||||
RegionQuery query = WorldGuard.getInstance().getPlatform().getRegionContainer().createQuery();
|
RegionQuery query = WorldGuard.getInstance().getPlatform().getRegionContainer().createQuery();
|
||||||
String message = query.queryValue(BukkitAdapter.adapt(location), localPlayer, Flags.DENY_MESSAGE);
|
String message = query.queryValue(BukkitAdapter.adapt(location), localPlayer, Flags.DENY_MESSAGE);
|
||||||
|
message = WorldGuard.getInstance().getPlatform().getMatcher().replaceMacros(localPlayer, message);
|
||||||
|
message = CommandUtils.replaceColorMacros(message);
|
||||||
if (message != null && !message.isEmpty()) {
|
if (message != null && !message.isEmpty()) {
|
||||||
player.sendMessage(message.replace("%what%", what));
|
player.sendMessage(message.replace("%what%", what));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user