mirror of
https://github.com/NoCheatPlus/NoCheatPlus.git
synced 2024-11-07 11:10:05 +01:00
[Bleeding] Check vehicle-morepackets for players riding pigs.
This commit is contained in:
parent
542dafc6f7
commit
07d8573e9e
@ -13,6 +13,7 @@ import org.bukkit.Location;
|
|||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.Server;
|
import org.bukkit.Server;
|
||||||
import org.bukkit.entity.Entity;
|
import org.bukkit.entity.Entity;
|
||||||
|
import org.bukkit.entity.Pig;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.entity.Vehicle;
|
import org.bukkit.entity.Vehicle;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
@ -365,7 +366,14 @@ public class MovingListener extends CheckListener implements TickListener, IRemo
|
|||||||
processingEvents.put(playerName, event);
|
processingEvents.put(playerName, event);
|
||||||
|
|
||||||
// Ignore players in vehicles.
|
// Ignore players in vehicles.
|
||||||
if (player.isInsideVehicle()) return;
|
if (player.isInsideVehicle()){
|
||||||
|
// Workaround for pigs !
|
||||||
|
final Entity vehicle = player.getVehicle();
|
||||||
|
if (vehicle != null && (vehicle instanceof Pig)){
|
||||||
|
onVehicleMove(new VehicleMoveEvent((Vehicle) vehicle, event.getFrom(), event.getFrom()));
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Ignore dead players.
|
// Ignore dead players.
|
||||||
if (player.isDead()) return;
|
if (player.isDead()) return;
|
||||||
|
Loading…
Reference in New Issue
Block a user