Fixed error with NaturalExpGainListeners

This commit is contained in:
Auxilor 2020-12-20 20:22:56 +00:00
parent 398ab6f4a9
commit dbb6ece3df

View File

@ -18,6 +18,7 @@ public class NaturalExpGainListeners implements Listener {
NaturalExpGainBuilder toRemove = null; NaturalExpGainBuilder toRemove = null;
for (NaturalExpGainBuilder searchBuilder : events) { for (NaturalExpGainBuilder searchBuilder : events) {
if(!searchBuilder.getLoc().getWorld().equals(event.getPlayer().getLocation().getWorld())) continue;
if(searchBuilder.getReason().equals(NaturalExpGainBuilder.BuildReason.BOTTLE) && searchBuilder.getLoc().distanceSquared(event.getPlayer().getLocation()) > 52) if(searchBuilder.getReason().equals(NaturalExpGainBuilder.BuildReason.BOTTLE) && searchBuilder.getLoc().distanceSquared(event.getPlayer().getLocation()) > 52)
toRemove = searchBuilder; toRemove = searchBuilder;
} }