Don't fire xp spawn events for fishing where xp was already 0.

Dedicated to @mikroskeem who let me forget about this.
This commit is contained in:
wizjany 2020-08-30 13:25:36 -04:00
parent 2ed60eba02
commit 0cb84927a3

View File

@ -761,7 +761,7 @@ public void onPlayerFish(PlayerFishEvent event) {
event.setCancelled(true);
}
} else if (event.getState() == PlayerFishEvent.State.CAUGHT_FISH) {
if (Events.fireAndTestCancel(new SpawnEntityEvent(event, create(event.getPlayer(), event.getHook()), event.getHook().getLocation(), EntityType.EXPERIENCE_ORB))) {
if (event.getExpToDrop() > 0 && Events.fireAndTestCancel(new SpawnEntityEvent(event, create(event.getPlayer(), event.getHook()), event.getHook().getLocation(), EntityType.EXPERIENCE_ORB))) {
event.setExpToDrop(0);
}
} else if (event.getState() == PlayerFishEvent.State.CAUGHT_ENTITY) {