mirror of
https://github.com/EngineHub/WorldGuard.git
synced 2025-01-29 11:31:33 +01:00
Reduce the number of internal events for EXPERIENCE_ORB.
This commit is contained in:
parent
fa14184eb4
commit
5ff9f5c175
@ -436,8 +436,10 @@ public void onVehicleDestroy(VehicleDestroyEvent event) {
|
||||
|
||||
@EventHandler
|
||||
public void onBlockExp(BlockExpEvent event) {
|
||||
if (Events.fireAndTestCancel(new SpawnEntityEvent(event, create(event.getBlock()), event.getBlock().getLocation(), EntityType.EXPERIENCE_ORB))) {
|
||||
event.setExpToDrop(0);
|
||||
if (event.getExpToDrop() > 0) { // Event is raised even where no XP is being dropped
|
||||
if (Events.fireAndTestCancel(new SpawnEntityEvent(event, create(event.getBlock()), event.getBlock().getLocation(), EntityType.EXPERIENCE_ORB))) {
|
||||
event.setExpToDrop(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user