Ajout de certains alias de commandes + ajout de la commande /broadcast

This commit is contained in:
Marc Baloup 2015-01-14 21:43:19 -05:00
parent 7e7c98fe8a
commit 1e9dae8dbe
5 changed files with 66 additions and 3 deletions

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<jardesc>
<jar path="PandacraftUtils/jar_export/PandacraftUtils-2.9.jar"/>
<jar path="PandacraftUtils/jar_export/PandacraftUtils-2.10.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"/>
<storedRefactorings deprecationInfo="true" structuralOnly="false"/>
<selectedProjects/>

View File

@ -1,6 +1,6 @@
name: PandacraftUtils
main: net.mc_pandacraft.java.plugin.pandacraftutils.PandacraftUtils
version: 2.9
version: 2.10
@ -54,10 +54,14 @@ commands:
description: Gère les protections de la map Survie
usage: /cubo
permission: pandacraft.cubo
broadcast:
description: Envoi un message sur tout le serveur
usage: /broadcast <message>
permission: pandacraft.broadcast
# les permissions marqués par le commentaire "# à ajouter" sont à ajouter dans le fichier d'organisation des permissions
permissions:
@ -120,6 +124,11 @@ permissions:
description: Ne pas être auto AFK
default: false
# à ajouter ######################
pandacraft.broadcast:
description: Utiliser la commande broadcast
default: op
pandacraft.antispam.exempt:
description: Ignoré par le système anti-spam

View File

@ -216,6 +216,24 @@ public class ConfigManager {
alias.put("replaceWith", "/ptime");
alias.put("permissions", "pandacraft.grade.users");
CommandAlias_alias.add(alias);
alias = new HashMap<String, String>();
alias.put("initialCommand", "/shop");
alias.put("replaceWith", "/warp shop");
alias.put("permissions", "*"); // tout le monde
CommandAlias_alias.add(alias);
alias = new HashMap<String, String>();
alias.put("initialCommand", "/tete");
alias.put("replaceWith", "/heads nick");
alias.put("permissions", "*");
CommandAlias_alias.add(alias);
alias = new HashMap<String, String>();
alias.put("initialCommand", "/inscription");
alias.put("replaceWith", "/mail send marcbal Inscription");
alias.put("permissions", "pandacraft.grade.not_default");
CommandAlias_alias.add(alias);
/*
Map<String, String> alias = new HashMap<String, String>();
alias.put("initialCommand", "");

View File

@ -11,6 +11,7 @@ import net.mc_pandacraft.java.plugin.pandacraftutils.cheat_protect.no_pvp.NoPvpP
import net.mc_pandacraft.java.plugin.pandacraftutils.login_message.LoginLogoutManager;
import net.mc_pandacraft.java.plugin.pandacraftutils.player_count_list.PacketOutServerInfoListener;
import net.mc_pandacraft.java.plugin.pandacraftutils.simple_commands._command_alias.CommandAliasManager;
import net.mc_pandacraft.java.plugin.pandacraftutils.simple_commands.broadcast.CommandBroadcast;
import net.mc_pandacraft.java.plugin.pandacraftutils.simple_commands.list.CommandList;
import net.mc_pandacraft.java.plugin.pandacraftutils.simple_commands.me.CommandMe;
import net.mc_pandacraft.java.plugin.pandacraftutils.simple_commands.ping.CommandPing;
@ -42,6 +43,7 @@ public class PandacraftUtils extends JavaPlugin {
public CommandWandSelection commandWandSelection;
public CommandStaff commandStaff;
public CommandCubo commandCubo;
public CommandBroadcast commandBroadcast;
public CommandAliasManager commandAliasManager;
public SpawnTimeManager spawnTimeManager;
@ -80,6 +82,7 @@ public class PandacraftUtils extends JavaPlugin {
commandWandSelection = new CommandWandSelection(this);
commandStaff = new CommandStaff(this);
commandCubo = new CommandCubo(this);
commandBroadcast = new CommandBroadcast(this);
commandAliasManager = new CommandAliasManager(this);
spawnTimeManager = new SpawnTimeManager(this);
@ -102,6 +105,10 @@ public class PandacraftUtils extends JavaPlugin {
commandPing = null;
commandMe = null;
commandSpeedMessage = null;
commandWandSelection = null;
commandStaff = null;
commandCubo = null;
commandBroadcast = null;
commandAliasManager = null;
spawnTimeManager = null;

View File

@ -0,0 +1,29 @@
package net.mc_pandacraft.java.plugin.pandacraftutils.simple_commands.broadcast;
import net.mc_pandacraft.java.plugin.pandacraftutils.PandacraftUtils;
import org.apache.commons.lang.StringUtils;
import org.bukkit.ChatColor;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
public class CommandBroadcast implements CommandExecutor {
private PandacraftUtils plugin;
public CommandBroadcast(PandacraftUtils pl) {
plugin = pl;
plugin.getCommand("broadcast").setExecutor(this);
}
@Override
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
if (args.length == 0) return false;
plugin.getServer().broadcastMessage(ChatColor.YELLOW+"["+ChatColor.WHITE+"Pandacraft"+ChatColor.YELLOW+"] " + ChatColor.translateAlternateColorCodes('&', StringUtils.join(args, ' ')));
return true;
}
}