Java Code Examples for org.bukkit.event.vehicle.VehicleExitEvent#getExited()
The following examples show how to use
org.bukkit.event.vehicle.VehicleExitEvent#getExited() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: PlayerEventListener.java From Hawk with GNU General Public License v3.0 | 5 votes |
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true) public void vehicleExit(VehicleExitEvent e) { if(e.getExited() instanceof Player) { HawkPlayer pp = hawk.getHawkPlayer((Player)e.getExited()); pp.sendSimulatedAction(new Runnable() { @Override public void run() { pp.setInVehicle(false); } }); } }
Example 2
Source File: SafeBoat.java From askyblock with GNU General Public License v2.0 | 5 votes |
/** * @param e - event * This event aims to put the player in a safe place when they * exit the boat */ @EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true) public void onBoatExit(VehicleExitEvent e) { final Entity boat = e.getVehicle(); if (!boat.getType().equals(EntityType.BOAT)) { // Not a boat return; } // LivingEntity entity = e.getExited(); final Entity entityObj = e.getExited(); if (!(entityObj instanceof Player)) { return; } final Player player = (Player) entityObj; final World playerWorld = player.getWorld(); if (!playerWorld.getName().equalsIgnoreCase(Settings.worldName)) { // Not the right world return; } if (SafeBoat.ignoreList.contains(player.getUniqueId())) { return; } // Set the boat exit flag for this player // midTeleport.add(player.getUniqueId()); if (exitedBoat.containsKey(player.getUniqueId())) { // Debounce e.setCancelled(true); } else { exitedBoat.put(player.getUniqueId(), boat); } return; }
Example 3
Source File: ObserverModule.java From CardinalPGM with MIT License | 4 votes |
@EventHandler public void onVehicleExit(VehicleExitEvent event) { if (event.getExited() instanceof Player && testObserverOrDead((Player) event.getExited())) { event.setCancelled(true); } }