mirror of
https://github.com/EngineHub/WorldGuard.git
synced 2025-02-11 18:02:00 +01:00
Reduce the number of internal events for EXPERIENCE_ORB.
This commit is contained in:
parent
fa14184eb4
commit
5ff9f5c175
@ -436,10 +436,12 @@ public void onVehicleDestroy(VehicleDestroyEvent event) {
|
|||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void onBlockExp(BlockExpEvent event) {
|
public void onBlockExp(BlockExpEvent event) {
|
||||||
|
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))) {
|
if (Events.fireAndTestCancel(new SpawnEntityEvent(event, create(event.getBlock()), event.getBlock().getLocation(), EntityType.EXPERIENCE_ORB))) {
|
||||||
event.setExpToDrop(0);
|
event.setExpToDrop(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// TODO: XP pickup is an entity destroy event
|
// TODO: XP pickup is an entity destroy event
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user