Reduce the number of internal events for EXPERIENCE_ORB.

This commit is contained in:
sk89q 2014-08-18 23:33:45 -07:00
parent fa14184eb4
commit 5ff9f5c175

View File

@ -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);
}
}
}