mirror of
https://github.com/EssentialsX/Essentials.git
synced 2025-01-04 23:48:31 +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 com.earth2me.essentials.Util;
|
||||||
import org.bukkit.Server;
|
import org.bukkit.Server;
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
|
|
||||||
public class Commandmute extends EssentialsCommand
|
public class Commandmute extends EssentialsCommand
|
||||||
@ -41,17 +42,31 @@ public class Commandmute extends EssentialsCommand
|
|||||||
}
|
}
|
||||||
player.setMuteTimeout(muteTimestamp);
|
player.setMuteTimeout(muteTimestamp);
|
||||||
final boolean muted = player.getMuted();
|
final boolean muted = player.getMuted();
|
||||||
sender.sendMessage(
|
if (muted)
|
||||||
muted
|
{
|
||||||
? (muteTimestamp > 0
|
if (muteTimestamp > 0)
|
||||||
? _("mutedPlayerFor", player.getDisplayName(), Util.formatDateDiff(muteTimestamp))
|
{
|
||||||
: _("mutedPlayer", player.getDisplayName()))
|
sender.sendMessage(_("mutedPlayerFor", player.getDisplayName(), Util.formatDateDiff(muteTimestamp)));
|
||||||
: _("unmutedPlayer", player.getDisplayName()));
|
player.sendMessage(_("playerMutedFor", Util.formatDateDiff(muteTimestamp)));
|
||||||
player.sendMessage(
|
}
|
||||||
muted
|
else
|
||||||
? (muteTimestamp > 0
|
{
|
||||||
? _("playerMutedFor", Util.formatDateDiff(muteTimestamp))
|
sender.sendMessage(_("mutedPlayer", player.getDisplayName()));
|
||||||
: _("playerMuted"))
|
player.sendMessage(_("playerMuted"));
|
||||||
: _("playerUnmuted"));
|
}
|
||||||
|
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
|
fireworkColor=\u00a74You must apply a color to the firework to add an effect
|
||||||
holdFirework=\u00a74You must be holding a firework to add effects
|
holdFirework=\u00a74You must be holding a firework to add effects
|
||||||
invalidFireworkFormat=\u00a76The option \u00a74{0} \u00a76is not a valid value for \u00a74{1}
|
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
|
fireworkColor=\u00a74You must apply a color to the firework to add an effect
|
||||||
holdFirework=\u00a74You must be holding a firework to add effects
|
holdFirework=\u00a74You must be holding a firework to add effects
|
||||||
invalidFireworkFormat=\u00a76The option \u00a74{0} \u00a76is not a valid value for \u00a74{1}
|
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
|
fireworkColor=\u00a74You must apply a color to the firework to add an effect
|
||||||
holdFirework=\u00a74You must be holding a firework to add effects
|
holdFirework=\u00a74You must be holding a firework to add effects
|
||||||
invalidFireworkFormat=\u00a76The option \u00a74{0} \u00a76is not a valid value for \u00a74{1}
|
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
|
fireworkColor=\u00a74You must apply a color to the firework to add an effect
|
||||||
holdFirework=\u00a74You must be holding a firework to add effects
|
holdFirework=\u00a74You must be holding a firework to add effects
|
||||||
invalidFireworkFormat=\u00a76The option \u00a74{0} \u00a76is not a valid value for \u00a74{1}
|
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
|
fireworkColor=\u00a74You must apply a color to the firework to add an effect
|
||||||
holdFirework=\u00a74You must be holding a firework to add effects
|
holdFirework=\u00a74You must be holding a firework to add effects
|
||||||
invalidFireworkFormat=\u00a76The option \u00a74{0} \u00a76is not a valid value for \u00a74{1}
|
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
|
fireworkColor=\u00a74You must apply a color to the firework to add an effect
|
||||||
holdFirework=\u00a74You must be holding a firework to add effects
|
holdFirework=\u00a74You must be holding a firework to add effects
|
||||||
invalidFireworkFormat=\u00a76The option \u00a74{0} \u00a76is not a valid value for \u00a74{1}
|
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
|
fireworkColor=\u00a74You must apply a color to the firework to add an effect
|
||||||
holdFirework=\u00a74You must be holding a firework to add effects
|
holdFirework=\u00a74You must be holding a firework to add effects
|
||||||
invalidFireworkFormat=\u00a76The option \u00a74{0} \u00a76is not a valid value for \u00a74{1}
|
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
|
fireworkColor=\u00a74You must apply a color to the firework to add an effect
|
||||||
holdFirework=\u00a74You must be holding a firework to add effects
|
holdFirework=\u00a74You must be holding a firework to add effects
|
||||||
invalidFireworkFormat=\u00a76The option \u00a74{0} \u00a76is not a valid value for \u00a74{1}
|
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
|
fireworkColor=\u00a74You must apply a color to the firework to add an effect
|
||||||
holdFirework=\u00a74You must be holding a firework to add effects
|
holdFirework=\u00a74You must be holding a firework to add effects
|
||||||
invalidFireworkFormat=\u00a76The option \u00a74{0} \u00a76is not a valid value for \u00a74{1}
|
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
|
fireworkColor=\u00a74You must apply a color to the firework to add an effect
|
||||||
holdFirework=\u00a74You must be holding a firework to add effects
|
holdFirework=\u00a74You must be holding a firework to add effects
|
||||||
invalidFireworkFormat=\u00a76The option \u00a74{0} \u00a76is not a valid value for \u00a74{1}
|
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
|
fireworkColor=\u00a74You must apply a color to the firework to add an effect
|
||||||
holdFirework=\u00a74You must be holding a firework to add effects
|
holdFirework=\u00a74You must be holding a firework to add effects
|
||||||
invalidFireworkFormat=\u00a76The option \u00a74{0} \u00a76is not a valid value for \u00a74{1}
|
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
|
fireworkColor=\u00a74You must apply a color to the firework to add an effect
|
||||||
holdFirework=\u00a74You must be holding a firework to add effects
|
holdFirework=\u00a74You must be holding a firework to add effects
|
||||||
invalidFireworkFormat=\u00a76The option \u00a74{0} \u00a76is not a valid value for \u00a74{1}
|
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
|
fireworkColor=\u00a74You must apply a color to the firework to add an effect
|
||||||
holdFirework=\u00a74You must be holding a firework to add effects
|
holdFirework=\u00a74You must be holding a firework to add effects
|
||||||
invalidFireworkFormat=\u00a76The option \u00a74{0} \u00a76is not a valid value for \u00a74{1}
|
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