Correction de bugs : Erreur de regex dans /cubo creer, Téléportation du véhicule pour worldBorder et correction d'un bug exploit du système AFK
This commit is contained in:
parent
10c3a40677
commit
0beeb02fd3
@ -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();
|
||||
|
@ -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;
|
||||
|
@ -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");
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user