mirror of
https://github.com/EssentialsX/Essentials.git
synced 2024-12-30 21:17:38 +01:00
Adds essentials.mute.notify
This commit is contained in:
parent
0014d5cfcb
commit
78e6da9504
@ -5,6 +5,7 @@ import com.earth2me.essentials.User;
|
||||
import com.earth2me.essentials.Util;
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
|
||||
public class Commandmute extends EssentialsCommand
|
||||
@ -41,17 +42,31 @@ public class Commandmute extends EssentialsCommand
|
||||
}
|
||||
player.setMuteTimeout(muteTimestamp);
|
||||
final boolean muted = player.getMuted();
|
||||
sender.sendMessage(
|
||||
muted
|
||||
? (muteTimestamp > 0
|
||||
? _("mutedPlayerFor", player.getDisplayName(), Util.formatDateDiff(muteTimestamp))
|
||||
: _("mutedPlayer", player.getDisplayName()))
|
||||
: _("unmutedPlayer", player.getDisplayName()));
|
||||
player.sendMessage(
|
||||
muted
|
||||
? (muteTimestamp > 0
|
||||
? _("playerMutedFor", Util.formatDateDiff(muteTimestamp))
|
||||
: _("playerMuted"))
|
||||
: _("playerUnmuted"));
|
||||
if (muted)
|
||||
{
|
||||
if (muteTimestamp > 0)
|
||||
{
|
||||
sender.sendMessage(_("mutedPlayerFor", player.getDisplayName(), Util.formatDateDiff(muteTimestamp)));
|
||||
player.sendMessage(_("playerMutedFor", Util.formatDateDiff(muteTimestamp)));
|
||||
}
|
||||
else
|
||||
{
|
||||
sender.sendMessage(_("mutedPlayer", player.getDisplayName()));
|
||||
player.sendMessage(_("playerMuted"));
|
||||
}
|
||||
for (Player onlinePlayer : server.getOnlinePlayers())
|
||||
{
|
||||
final User user = ess.getUser(onlinePlayer);
|
||||
if (onlinePlayer != sender && user.isAuthorized("essentials.mute.notify"))
|
||||
{
|
||||
onlinePlayer.sendMessage(_("muteNotify", sender.getName(), player.getName()));
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
sender.sendMessage(_("unmutedPlayer", player.getDisplayName()));
|
||||
player.sendMessage(_("playerUnmuted"));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -489,3 +489,4 @@ holdBook=\u00a74You are not holding a writable book
|
||||
fireworkColor=\u00a74You must apply a color to the firework to add an effect
|
||||
holdFirework=\u00a74You must be holding a firework to add effects
|
||||
invalidFireworkFormat=\u00a76The option \u00a74{0} \u00a76is not a valid value for \u00a74{1}
|
||||
muteNotify=\u00a74{0} \u00a76has muted \u00a74{1}
|
||||
|
@ -492,4 +492,4 @@ holdBook=\u00a74You are not holding a writable book
|
||||
fireworkColor=\u00a74You must apply a color to the firework to add an effect
|
||||
holdFirework=\u00a74You must be holding a firework to add effects
|
||||
invalidFireworkFormat=\u00a76The option \u00a74{0} \u00a76is not a valid value for \u00a74{1}
|
||||
|
||||
muteNotify=\u00a74{0} \u00a76has muted \u00a74{1}
|
||||
|
@ -489,3 +489,4 @@ holdBook=\u00a74You are not holding a writable book
|
||||
fireworkColor=\u00a74You must apply a color to the firework to add an effect
|
||||
holdFirework=\u00a74You must be holding a firework to add effects
|
||||
invalidFireworkFormat=\u00a76The option \u00a74{0} \u00a76is not a valid value for \u00a74{1}
|
||||
muteNotify=\u00a74{0} \u00a76has muted \u00a74{1}
|
||||
|
@ -489,3 +489,4 @@ holdBook=\u00a74You are not holding a writable book
|
||||
fireworkColor=\u00a74You must apply a color to the firework to add an effect
|
||||
holdFirework=\u00a74You must be holding a firework to add effects
|
||||
invalidFireworkFormat=\u00a76The option \u00a74{0} \u00a76is not a valid value for \u00a74{1}
|
||||
muteNotify=\u00a74{0} \u00a76has muted \u00a74{1}
|
||||
|
@ -489,3 +489,4 @@ holdBook=\u00a74You are not holding a writable book
|
||||
fireworkColor=\u00a74You must apply a color to the firework to add an effect
|
||||
holdFirework=\u00a74You must be holding a firework to add effects
|
||||
invalidFireworkFormat=\u00a76The option \u00a74{0} \u00a76is not a valid value for \u00a74{1}
|
||||
muteNotify=\u00a74{0} \u00a76has muted \u00a74{1}
|
||||
|
@ -489,3 +489,4 @@ holdBook=\u00a74You are not holding a writable book
|
||||
fireworkColor=\u00a74You must apply a color to the firework to add an effect
|
||||
holdFirework=\u00a74You must be holding a firework to add effects
|
||||
invalidFireworkFormat=\u00a76The option \u00a74{0} \u00a76is not a valid value for \u00a74{1}
|
||||
muteNotify=\u00a74{0} \u00a76has muted \u00a74{1}
|
||||
|
@ -489,3 +489,4 @@ holdBook=\u00a74You are not holding a writable book
|
||||
fireworkColor=\u00a74You must apply a color to the firework to add an effect
|
||||
holdFirework=\u00a74You must be holding a firework to add effects
|
||||
invalidFireworkFormat=\u00a76The option \u00a74{0} \u00a76is not a valid value for \u00a74{1}
|
||||
muteNotify=\u00a74{0} \u00a76has muted \u00a74{1}
|
||||
|
@ -489,3 +489,4 @@ holdBook=\u00a74You are not holding a writable book
|
||||
fireworkColor=\u00a74You must apply a color to the firework to add an effect
|
||||
holdFirework=\u00a74You must be holding a firework to add effects
|
||||
invalidFireworkFormat=\u00a76The option \u00a74{0} \u00a76is not a valid value for \u00a74{1}
|
||||
muteNotify=\u00a74{0} \u00a76has muted \u00a74{1}
|
||||
|
@ -489,3 +489,4 @@ holdBook=\u00a74You are not holding a writable book
|
||||
fireworkColor=\u00a74You must apply a color to the firework to add an effect
|
||||
holdFirework=\u00a74You must be holding a firework to add effects
|
||||
invalidFireworkFormat=\u00a76The option \u00a74{0} \u00a76is not a valid value for \u00a74{1}
|
||||
muteNotify=\u00a74{0} \u00a76has muted \u00a74{1}
|
||||
|
@ -489,3 +489,4 @@ holdBook=\u00a74You are not holding a writable book
|
||||
fireworkColor=\u00a74You must apply a color to the firework to add an effect
|
||||
holdFirework=\u00a74You must be holding a firework to add effects
|
||||
invalidFireworkFormat=\u00a76The option \u00a74{0} \u00a76is not a valid value for \u00a74{1}
|
||||
muteNotify=\u00a74{0} \u00a76has muted \u00a74{1}
|
||||
|
@ -489,3 +489,4 @@ holdBook=\u00a74You are not holding a writable book
|
||||
fireworkColor=\u00a74You must apply a color to the firework to add an effect
|
||||
holdFirework=\u00a74You must be holding a firework to add effects
|
||||
invalidFireworkFormat=\u00a76The option \u00a74{0} \u00a76is not a valid value for \u00a74{1}
|
||||
muteNotify=\u00a74{0} \u00a76has muted \u00a74{1}
|
||||
|
@ -489,3 +489,4 @@ holdBook=\u00a74You are not holding a writable book
|
||||
fireworkColor=\u00a74You must apply a color to the firework to add an effect
|
||||
holdFirework=\u00a74You must be holding a firework to add effects
|
||||
invalidFireworkFormat=\u00a76The option \u00a74{0} \u00a76is not a valid value for \u00a74{1}
|
||||
muteNotify=\u00a74{0} \u00a76has muted \u00a74{1}
|
||||
|
@ -489,3 +489,4 @@ holdBook=\u00a74You are not holding a writable book
|
||||
fireworkColor=\u00a74You must apply a color to the firework to add an effect
|
||||
holdFirework=\u00a74You must be holding a firework to add effects
|
||||
invalidFireworkFormat=\u00a76The option \u00a74{0} \u00a76is not a valid value for \u00a74{1}
|
||||
muteNotify=\u00a74{0} \u00a76has muted \u00a74{1}
|
||||
|
Loading…
Reference in New Issue
Block a user