Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,11 @@
<version>1.7.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-text</artifactId>
<version>1.15.0</version>
</dependency>
</dependencies>

<properties>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import io.minimum.minecraft.superbvote.util.PlayerVotes;
import io.minimum.minecraft.superbvote.votes.Vote;
import lombok.RequiredArgsConstructor;
import org.bukkit.configuration.ConfigurationSection;

import java.util.Optional;
import java.util.Random;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package io.minimum.minecraft.superbvote.votes.rewards.matchers;

import com.google.common.base.Preconditions;
import io.minimum.minecraft.superbvote.util.PlayerVotes;
import io.minimum.minecraft.superbvote.votes.Vote;
import lombok.RequiredArgsConstructor;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import com.google.common.collect.ImmutableSet;
import io.minimum.minecraft.superbvote.SuperbVote;
import net.milkbowl.vault.permission.Permission;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.text.similarity.LevenshteinDistance;
import org.bukkit.Bukkit;
import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.plugin.RegisteredServiceProvider;
Expand Down Expand Up @@ -45,7 +45,7 @@ public class RewardMatchers {
private static List<String> closestMatch(String string) {
List<String> matched = new ArrayList<>();
for (String availableMatcher : AVAILABLE_MATCHERS) {
if (StringUtils.getLevenshteinDistance(string, availableMatcher) <= 2) {
if (LevenshteinDistance.getDefaultInstance().apply(string, availableMatcher) <= 2) {
matched.add(availableMatcher);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
import io.minimum.minecraft.superbvote.votes.Vote;
import lombok.NonNull;
import lombok.Value;
import org.bukkit.Bukkit;
import org.bukkit.OfflinePlayer;

import javax.script.Invocable;
import javax.script.ScriptEngine;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package io.minimum.minecraft.superbvote.votes.rewards.matchers;

import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableSet;
import io.minimum.minecraft.superbvote.util.PlayerVotes;
import io.minimum.minecraft.superbvote.votes.Vote;
import lombok.ToString;
Expand Down