Skip to content

Commit

Permalink
Fixed removal of vehicles not detected by the plugin (#1679)
Browse files Browse the repository at this point in the history
  • Loading branch information
OmerBenGera committed Apr 12, 2023
1 parent 85a2ba6 commit 0a6f00c
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import org.bukkit.event.entity.EntityDeathEvent;
import org.bukkit.event.hanging.HangingPlaceEvent;
import org.bukkit.event.vehicle.VehicleCreateEvent;
import org.bukkit.event.vehicle.VehicleDestroyEvent;

public class EntityTrackingListener implements Listener {

Expand Down Expand Up @@ -102,6 +103,11 @@ private void onEntityDeath(EntityDeathEvent e) {
onEntityDespawn(e.getEntity());
}

@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
private void onVehicleDestroy(VehicleDestroyEvent e) {
onEntityDespawn(e.getVehicle());
}

}

}

0 comments on commit 0a6f00c

Please sign in to comment.