forked from Upstream/mmocore
Support for 1.16
you will need MMOLib 1.2!
This commit is contained in:
parent
8506be5169
commit
a74f912ac5
Binary file not shown.
BIN
lib/spigot.jar
BIN
lib/spigot.jar
Binary file not shown.
@ -33,7 +33,7 @@ public class SmeltItemExperienceSource extends SpecificExperienceSource<ItemStac
|
|||||||
@EventHandler(priority = EventPriority.HIGH)
|
@EventHandler(priority = EventPriority.HIGH)
|
||||||
public void a(BlockCookEvent event) {
|
public void a(BlockCookEvent event) {
|
||||||
if (!event.isCancelled()) {
|
if (!event.isCancelled()) {
|
||||||
Optional<Player> player = getNearbyPlayer(event.getBlock().getLocation(), 10);
|
Optional<Player> player = getNearestPlayer(event.getBlock().getLocation(), 10);
|
||||||
if (!player.isPresent())
|
if (!player.isPresent())
|
||||||
return;
|
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 double d2 = d * d;
|
||||||
final Player[] nearby = loc.getWorld().getPlayers().stream()
|
final Player[] nearby = loc.getWorld().getPlayers().stream()
|
||||||
.filter(player -> player.getLocation().distanceSquared(loc) < d2).toArray(Player[]::new);
|
.filter(player -> player.getLocation().distanceSquared(loc) < d2).toArray(Player[]::new);
|
||||||
|
Loading…
Reference in New Issue
Block a user