Ajout des messages aux personnes qui viennent juste de se faire sanctionner
This commit is contained in:
parent
c0dae89dbe
commit
ee175f6515
@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
<jardesc>
|
<jardesc>
|
||||||
<jar path="PandacraftUtils/jar_export/PandacraftUtils-4.4.jar"/>
|
<jar path="PandacraftUtils/jar_export/PandacraftUtils-4.5.jar"/>
|
||||||
<options buildIfNeeded="true" compress="true" descriptionLocation="/PandacraftUtils/make_jar.jardesc" exportErrors="true" exportWarnings="true" includeDirectoryEntries="false" overwrite="false" saveDescription="true" storeRefactorings="false" useSourceFolders="false"/>
|
<options buildIfNeeded="true" compress="true" descriptionLocation="/PandacraftUtils/make_jar.jardesc" exportErrors="true" exportWarnings="true" includeDirectoryEntries="false" overwrite="false" saveDescription="true" storeRefactorings="false" useSourceFolders="false"/>
|
||||||
<storedRefactorings deprecationInfo="true" structuralOnly="false"/>
|
<storedRefactorings deprecationInfo="true" structuralOnly="false"/>
|
||||||
<selectedProjects/>
|
<selectedProjects/>
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
name: PandacraftUtils
|
name: PandacraftUtils
|
||||||
main: net.mc_pandacraft.java.plugin.pandacraftutils.PandacraftUtils
|
main: net.mc_pandacraft.java.plugin.pandacraftutils.PandacraftUtils
|
||||||
version: 4.4
|
version: 4.5
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -14,6 +14,7 @@ import net.mc_pandacraft.java.plugin.pandacraftutils.plugin_interface.Essentials
|
|||||||
import net.mc_pandacraft.java.util.TimeUtil;
|
import net.mc_pandacraft.java.util.TimeUtil;
|
||||||
|
|
||||||
import org.bukkit.BanList.Type;
|
import org.bukkit.BanList.Type;
|
||||||
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.World;
|
import org.bukkit.World;
|
||||||
@ -459,9 +460,9 @@ public class CommandModo extends AbstractCommandExecutor {
|
|||||||
historyEl.save();
|
historyEl.save();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
broadcastModoMessage(sender.getName(), " viens d'appliquer une amende de ", String.valueOf(moneyToRemove), "P à ", player, " pour ", message);
|
broadcastModoMessage(sender.getName(), " viens d'appliquer une amende de ", String.valueOf(moneyToRemove), "P à ", player, " pour ", message);
|
||||||
|
|
||||||
|
sendPlayerMessage(Bukkit.getPlayer(player), "Vous venez de recevoir une amende de ", String.valueOf(moneyToRemove), "P pour ", message);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -549,7 +550,7 @@ public class CommandModo extends AbstractCommandExecutor {
|
|||||||
u.setBanReason(message);
|
u.setBanReason(message);
|
||||||
u.setBanTimeout(expire.getTime());
|
u.setBanTimeout(expire.getTime());
|
||||||
if (u.isOnline())
|
if (u.isOnline())
|
||||||
u.kickPlayer(message);
|
u.kickPlayer("Banni pendant "+TimeUtil.durationToString(duration*1000)+" pour : "+message);
|
||||||
|
|
||||||
// enregistrement de l'action
|
// enregistrement de l'action
|
||||||
ModoHistoryElement historyEl = new ModoHistoryElement(sender.getName(), ActionType.BAN, player, message);
|
ModoHistoryElement historyEl = new ModoHistoryElement(sender.getName(), ActionType.BAN, player, message);
|
||||||
@ -659,6 +660,8 @@ public class CommandModo extends AbstractCommandExecutor {
|
|||||||
// diffusion
|
// diffusion
|
||||||
broadcastModoMessage(sender.getName(), " viens de rendre muet ", player, " pendant ", TimeUtil.durationToString(duration*1000), " pour ", message);
|
broadcastModoMessage(sender.getName(), " viens de rendre muet ", player, " pendant ", TimeUtil.durationToString(duration*1000), " pour ", message);
|
||||||
|
|
||||||
|
sendPlayerMessage(Bukkit.getPlayer(player), "Vous avez été rendu muet pendant ", TimeUtil.durationToString(duration*1000), " pour ", message);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -700,6 +703,7 @@ public class CommandModo extends AbstractCommandExecutor {
|
|||||||
// diffusion
|
// diffusion
|
||||||
broadcastModoMessage(sender.getName(), " viens de rendre la parole à ", player, " pour ", message);
|
broadcastModoMessage(sender.getName(), " viens de rendre la parole à ", player, " pour ", message);
|
||||||
|
|
||||||
|
sendPlayerMessage(Bukkit.getPlayer(player), "Vous venez de retrouver la parole pour ", message);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -762,6 +766,8 @@ public class CommandModo extends AbstractCommandExecutor {
|
|||||||
// diffusion
|
// diffusion
|
||||||
broadcastModoMessage(sender.getName(), " viens d'emprisonner ", player, " pendant ", TimeUtil.durationToString(duration*1000), " pour ", message);
|
broadcastModoMessage(sender.getName(), " viens d'emprisonner ", player, " pendant ", TimeUtil.durationToString(duration*1000), " pour ", message);
|
||||||
|
|
||||||
|
sendPlayerMessage(Bukkit.getPlayer(player), "Vous avez été emprisonné pendant ", TimeUtil.durationToString(duration*1000), " pour ", message);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -801,6 +807,8 @@ public class CommandModo extends AbstractCommandExecutor {
|
|||||||
// diffusion
|
// diffusion
|
||||||
broadcastModoMessage(sender.getName(), " viens de libérer ", player, " pour ", message);
|
broadcastModoMessage(sender.getName(), " viens de libérer ", player, " pour ", message);
|
||||||
|
|
||||||
|
sendPlayerMessage(Bukkit.getPlayer(player), "Vous venez de retrouver la liberté pour ", message);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -884,6 +892,30 @@ public class CommandModo extends AbstractCommandExecutor {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Diffuse un message au joueur passé en paramètre.<br/>
|
||||||
|
* Ce message est préfixé de [Modération].<br/>
|
||||||
|
* Les 1er, 3ème, 5ème, ... paramètres sont colorés en blanc, et 2ème, 4ème, 6ème, ... paramètres
|
||||||
|
* sont colorés en gris. Ces paramètres sont ensuite concaténé pour former le message final.
|
||||||
|
* @param player
|
||||||
|
* @param messages
|
||||||
|
*/
|
||||||
|
protected void sendPlayerMessage(Player player, String ... messages) {
|
||||||
|
if (player == null) return;
|
||||||
|
boolean colorToggle = true;
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
for (String message : messages) {
|
||||||
|
sb.append(colorToggle?ChatColor.RESET:ChatColor.GRAY);
|
||||||
|
|
||||||
|
sb.append(message);
|
||||||
|
|
||||||
|
colorToggle = !colorToggle;
|
||||||
|
}
|
||||||
|
player.sendMessage("["+ChatColor.GREEN+"Modération"+ChatColor.RESET+"] "+sb.toString());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
protected ModoPermissionLevel getPermissionLevel(OnlinePlayer op) {
|
protected ModoPermissionLevel getPermissionLevel(OnlinePlayer op) {
|
||||||
|
@ -26,7 +26,7 @@ public class TimeUtil {
|
|||||||
result = result.concat((msec/1000D)+"s");
|
result = result.concat((msec/1000D)+"s");
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result.trim();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String durationToString (long msec_time)
|
public static String durationToString (long msec_time)
|
||||||
|
Loading…
Reference in New Issue
Block a user