Support for 1.16

you will need MMOLib 1.2!
This commit is contained in:
ASangarin 2020-06-25 16:27:11 +02:00
parent 8506be5169
commit a74f912ac5
3 changed files with 2 additions and 2 deletions

Binary file not shown.

Binary file not shown.

View File

@ -33,7 +33,7 @@ public class SmeltItemExperienceSource extends SpecificExperienceSource<ItemStac
@EventHandler(priority = EventPriority.HIGH)
public void a(BlockCookEvent event) {
if (!event.isCancelled()) {
Optional<Player> player = getNearbyPlayer(event.getBlock().getLocation(), 10);
Optional<Player> player = getNearestPlayer(event.getBlock().getLocation(), 10);
if (!player.isPresent())
return;
@ -50,7 +50,7 @@ public class SmeltItemExperienceSource extends SpecificExperienceSource<ItemStac
};
}
private Optional<Player> getNearbyPlayer(Location loc, double d) {
private Optional<Player> getNearestPlayer(Location loc, double d) {
final double d2 = d * d;
final Player[] nearby = loc.getWorld().getPlayers().stream()
.filter(player -> player.getLocation().distanceSquared(loc) < d2).toArray(Player[]::new);