mirror of
https://github.com/Minestom/Minestom.git
synced 2025-01-08 09:27:58 +01:00
Fix build & remove deprecated method
This commit is contained in:
parent
3d585825b2
commit
b4d9cecdce
@ -23,7 +23,7 @@ import net.minestom.server.utils.PacketUtils;
|
|||||||
import net.minestom.server.utils.async.AsyncUtils;
|
import net.minestom.server.utils.async.AsyncUtils;
|
||||||
import net.minestom.server.utils.callback.validator.PlayerValidator;
|
import net.minestom.server.utils.callback.validator.PlayerValidator;
|
||||||
import net.minestom.server.utils.validate.Check;
|
import net.minestom.server.utils.validate.Check;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.text.similarity.JaroWinklerDistance;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
|
||||||
@ -95,7 +95,8 @@ public final class ConnectionManager {
|
|||||||
String lowercase = username.toLowerCase();
|
String lowercase = username.toLowerCase();
|
||||||
double currentDistance = 0;
|
double currentDistance = 0;
|
||||||
for (Player player : getOnlinePlayers()) {
|
for (Player player : getOnlinePlayers()) {
|
||||||
double distance = StringUtils.getJaroWinklerDistance(lowercase, player.getUsername().toLowerCase());
|
final JaroWinklerDistance jaroWinklerDistance = new JaroWinklerDistance();
|
||||||
|
final double distance = jaroWinklerDistance.apply(lowercase, player.getUsername().toLowerCase());
|
||||||
if (distance > currentDistance) {
|
if (distance > currentDistance) {
|
||||||
currentDistance = distance;
|
currentDistance = distance;
|
||||||
exact = player;
|
exact = player;
|
||||||
|
@ -147,9 +147,4 @@ public class ChunkDataPacket implements ServerPacket, CacheablePacket {
|
|||||||
public UUID getIdentifier() {
|
public UUID getIdentifier() {
|
||||||
return identifier;
|
return identifier;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public long getLastUpdateTime() {
|
|
||||||
return lastUpdate;
|
|
||||||
}
|
|
||||||
}
|
}
|
@ -79,9 +79,4 @@ public class UpdateLightPacket implements ServerPacket, CacheablePacket {
|
|||||||
public UUID getIdentifier() {
|
public UUID getIdentifier() {
|
||||||
return identifier;
|
return identifier;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public long getLastUpdateTime() {
|
|
||||||
return lastUpdate;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user