diff --git a/src/net/mc_pandacraft/java/plugin/pandacraftutils/modules/player_control/AfkManager.java b/src/net/mc_pandacraft/java/plugin/pandacraftutils/modules/player_control/AfkManager.java index bb5a200..41ae172 100644 --- a/src/net/mc_pandacraft/java/plugin/pandacraftutils/modules/player_control/AfkManager.java +++ b/src/net/mc_pandacraft/java/plugin/pandacraftutils/modules/player_control/AfkManager.java @@ -12,6 +12,7 @@ import org.bukkit.Location; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; +import org.bukkit.event.block.Action; import org.bukkit.event.player.AsyncPlayerChatEvent; import org.bukkit.event.player.PlayerCommandPreprocessEvent; import org.bukkit.event.player.PlayerDropItemEvent; @@ -133,6 +134,11 @@ public class AfkManager extends BukkitRunnable implements Listener { @EventHandler public void onPlayerInteract (PlayerInteractEvent event) { + /* + * Une action de type Action.PHYSICAL peut avoir une cause ne provenant pas de l'utilisateur + */ + if (event.getAction().equals(Action.PHYSICAL)) + return; try { OnlinePlayerManager.get(event.getPlayer()).isDoingAction(); diff --git a/src/net/mc_pandacraft/java/plugin/pandacraftutils/modules/protection/SurvivalCuboManager.java b/src/net/mc_pandacraft/java/plugin/pandacraftutils/modules/protection/SurvivalCuboManager.java index 99ce04f..e14e333 100644 --- a/src/net/mc_pandacraft/java/plugin/pandacraftutils/modules/protection/SurvivalCuboManager.java +++ b/src/net/mc_pandacraft/java/plugin/pandacraftutils/modules/protection/SurvivalCuboManager.java @@ -204,7 +204,7 @@ public class SurvivalCuboManager { if (!isInCuboWorld(selection.getWorld())) return null; - if (ownerName == null || !ownerName.matches("[0-9A-Za-z_]{2;16}")) + if (ownerName == null || !ownerName.matches("[0-9A-Za-z_]{2,16}")) return null; if (nom_cubo == null || !nom_cubo.matches("[0-9A-Za-z_]+")) return null; diff --git a/src/net/mc_pandacraft/java/plugin/pandacraftutils/modules/protection/WorldBorderManager.java b/src/net/mc_pandacraft/java/plugin/pandacraftutils/modules/protection/WorldBorderManager.java index fc3a406..a9902cc 100644 --- a/src/net/mc_pandacraft/java/plugin/pandacraftutils/modules/protection/WorldBorderManager.java +++ b/src/net/mc_pandacraft/java/plugin/pandacraftutils/modules/protection/WorldBorderManager.java @@ -47,7 +47,7 @@ public class WorldBorderManager extends BukkitRunnable implements Listener { Location newLoc = checkPosition(op.getPlayer().getLocation(), config); if (newLoc != null) { // le joueur dépasse la bordure - op.getPlayer().teleport(newLoc); + op.teleportWithVehicle(newLoc); op.getPlayer().sendMessage(ChatColor.RED+"Vous avez été téléporté car vous avez passé la limite de la carte"); } diff --git a/src/net/mc_pandacraft/java/plugin/pandacraftutils/players/OnlinePlayer.java b/src/net/mc_pandacraft/java/plugin/pandacraftutils/players/OnlinePlayer.java index 7160d67..c61826f 100644 --- a/src/net/mc_pandacraft/java/plugin/pandacraftutils/players/OnlinePlayer.java +++ b/src/net/mc_pandacraft/java/plugin/pandacraftutils/players/OnlinePlayer.java @@ -14,6 +14,8 @@ import net.mc_pandacraft.java.plugin.pandacraftutils.plugin_interface.Essentials import org.bukkit.Bukkit; import org.bukkit.ChatColor; +import org.bukkit.Location; +import org.bukkit.entity.Entity; import org.bukkit.entity.Player; import org.bukkit.entity.Tameable; @@ -303,6 +305,26 @@ public class OnlinePlayer { } + public boolean teleportWithVehicle(Location l) { + Entity toTeleport = player; + while (toTeleport.getVehicle() != null) { + toTeleport = toTeleport.getVehicle(); + } + return toTeleport.teleport(l); + } + + + + + + + + + + + + +