From 30ca48cc5bf16d1d7418b100d69577a491088d22 Mon Sep 17 00:00:00 2001 From: Marc Baloup Date: Thu, 19 Mar 2015 22:24:59 -0400 Subject: [PATCH] Correction des bugs de la commande /modo --- .../pandacraftutils/commands/CommandModo.java | 8 ++++---- .../modules/player_control/JailsManager.java | 13 +++++++++++-- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/src/net/mc_pandacraft/java/plugin/pandacraftutils/commands/CommandModo.java b/src/net/mc_pandacraft/java/plugin/pandacraftutils/commands/CommandModo.java index d510f52..7c33ac9 100644 --- a/src/net/mc_pandacraft/java/plugin/pandacraftutils/commands/CommandModo.java +++ b/src/net/mc_pandacraft/java/plugin/pandacraftutils/commands/CommandModo.java @@ -228,7 +228,7 @@ public class CommandModo extends AbstractCommandExecutor { /* * unjail */ - if (args.length >= 3 && args[0].equalsIgnoreCase("unmute")) { + if (args.length >= 3 && args[0].equalsIgnoreCase("unjail")) { String player = args[1]; String message = getLastParam(args, 2); @@ -403,7 +403,7 @@ public class CommandModo extends AbstractCommandExecutor { */ private void onCommandBan(CommandSender sender, String player, long duration, String message) { // vérification des droits d'exécution - if (!hasCommandSenderPermissionLevel(sender, ModoPermissionLevel.LOW)) { + if (!hasCommandSenderPermissionLevel(sender, ModoPermissionLevel.NORMAL)) { sender.sendMessage(ChatColor.RED+"Vous n'avez pas le niveau de permission suffisant pour exécuter cette sous-commande"); return; } @@ -460,7 +460,7 @@ public class CommandModo extends AbstractCommandExecutor { private void onCommandUnban(CommandSender sender, String player, String message) { // vérification des droits d'exécution - if (!hasCommandSenderPermissionLevel(sender, ModoPermissionLevel.LOW)) { + if (!hasCommandSenderPermissionLevel(sender, ModoPermissionLevel.NORMAL)) { sender.sendMessage(ChatColor.RED+"Vous n'avez pas le niveau de permission suffisant pour exécuter cette sous-commande"); return; } @@ -839,7 +839,7 @@ public class CommandModo extends AbstractCommandExecutor { ModoPermissionLevel highestLevel = null; for (ModoPermissionLevel level : ModoPermissionLevel.values()) { - if (op.hasPermission("pandacrat.modo."+level.name().toLowerCase())) + if (op.hasPermission("pandacraft.modo."+level.name().toLowerCase())) if (highestLevel == null || level.level >= highestLevel.level) highestLevel = level; } diff --git a/src/net/mc_pandacraft/java/plugin/pandacraftutils/modules/player_control/JailsManager.java b/src/net/mc_pandacraft/java/plugin/pandacraftutils/modules/player_control/JailsManager.java index 4c05df5..3962b45 100644 --- a/src/net/mc_pandacraft/java/plugin/pandacraftutils/modules/player_control/JailsManager.java +++ b/src/net/mc_pandacraft/java/plugin/pandacraftutils/modules/player_control/JailsManager.java @@ -3,6 +3,7 @@ package net.mc_pandacraft.java.plugin.pandacraftutils.modules.player_control; import java.sql.Date; import java.text.DateFormat; import java.util.ArrayList; +import java.util.Arrays; import java.util.Collections; import java.util.Comparator; import java.util.HashMap; @@ -18,6 +19,7 @@ import org.bukkit.Material; import org.bukkit.block.Block; import org.bukkit.block.BlockFace; import org.bukkit.block.Sign; +import org.bukkit.craftbukkit.v1_7_R1.block.CraftSign; import com.earth2me.essentials.User; import com.earth2me.essentials.UserMap; @@ -235,7 +237,7 @@ public class JailsManager { if (i != 0) b = b.getRelative(BlockFace.DOWN, i); if (j != 0) - b = b.getRelative(-wallDir.getModZ(), 0, wallDir.getModX()); + b = b.getRelative(-wallDir.getModZ()*j, 0, wallDir.getModX()*j); blocks[n] = b; n++; @@ -280,6 +282,9 @@ public class JailsManager { // il ne faut pas l'effacer des pannaux si le joueur est toujours en prison) String[] raisonLines = raison.split("\n"); + // debug + plugin.getLogger().info(Arrays.asList(raisonLines).toString()); + int raisonI = 0; for (int i=1; i