Correction des bugs de la commande /modo
This commit is contained in:
parent
b1afb29471
commit
30ca48cc5b
src/net/mc_pandacraft/java/plugin/pandacraftutils
@ -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;
|
||||
}
|
||||
|
@ -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<blocks.length; i++) {
|
||||
@ -319,14 +324,18 @@ public class JailsManager {
|
||||
private void setWallSign(Block b, String l1, String l2, String l3, String l4, BlockFace wallDir) {
|
||||
b.setType(Material.WALL_SIGN);
|
||||
|
||||
org.bukkit.block.Sign s = (Sign) b.getState();
|
||||
Sign s = new CraftSign(b);
|
||||
|
||||
org.bukkit.material.Sign matS = new org.bukkit.material.Sign(Material.WALL_SIGN);
|
||||
matS.setFacingDirection(wallDir.getOppositeFace());
|
||||
|
||||
s.setData(matS);
|
||||
s.setLine(0, l1);
|
||||
s.setLine(1, l2);
|
||||
s.setLine(2, l3);
|
||||
s.setLine(3, l4);
|
||||
|
||||
s.update();
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user