upstream: merge
upstream: merge
This commit is contained in:
@@ -57,6 +57,10 @@ public enum InventoryID
|
||||
* Monkey madness puzzle box inventory.
|
||||
*/
|
||||
MONKEY_MADNESS_PUZZLE_BOX(221),
|
||||
/**
|
||||
* Drift net fishing reward
|
||||
*/
|
||||
DRIFT_NET_FISHING_REWARD(307),
|
||||
/**
|
||||
* Looting Bag inventory
|
||||
*/
|
||||
|
||||
@@ -501,6 +501,7 @@ public enum Varbits
|
||||
SUPERIOR_ENABLED(5362),
|
||||
FOSSIL_ISLAND_WYVERN_DISABLE(6251),
|
||||
|
||||
BANK_REARRANGE_MODE(3959),
|
||||
CURRENT_BANK_TAB(4150),
|
||||
|
||||
WORLDHOPPER_FAVROITE_1(4597),
|
||||
|
||||
@@ -33,11 +33,12 @@ import java.util.Collection;
|
||||
import java.util.List;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.commons.text.WordUtils;
|
||||
import org.apache.commons.text.similarity.JaroWinklerDistance;
|
||||
|
||||
public class Text
|
||||
{
|
||||
private static final StringBuilder SB = new StringBuilder(64);
|
||||
|
||||
private static final JaroWinklerDistance DISTANCE = new JaroWinklerDistance();
|
||||
public static final Splitter COMMA_SPLITTER = Splitter
|
||||
.on(",")
|
||||
.omitEmptyStrings()
|
||||
@@ -292,4 +293,22 @@ public class Text
|
||||
|
||||
return toString;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if all the search terms in the given list matches at least one keyword.
|
||||
*
|
||||
* @return true if all search terms matches at least one keyword, or false if otherwise.
|
||||
*/
|
||||
public static boolean matchesSearchTerms(String[] searchTerms, final Collection<String> keywords)
|
||||
{
|
||||
for (String term : searchTerms)
|
||||
{
|
||||
if (keywords.stream().noneMatch((t) -> t.contains(term) ||
|
||||
DISTANCE.apply(t, term) > 0.9))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -124,6 +124,7 @@ public class WidgetID
|
||||
public static final int WORLD_SWITCHER_GROUP_ID = 69;
|
||||
public static final int DIALOG_OPTION_GROUP_ID = 219;
|
||||
public static final int DIALOG_PLAYER_GROUP_ID = 217;
|
||||
public static final int DRIFT_NET_FISHING_REWARD_GROUP_ID = 607;
|
||||
public static final int FOSSIL_ISLAND_OXYGENBAR_ID = 609;
|
||||
public static final int MINIGAME_TAB_ID = 76;
|
||||
public static final int SPELLBOOK_GROUP_ID = 218;
|
||||
@@ -164,6 +165,8 @@ public class WidgetID
|
||||
public static final int OPTIONS_GROUP_ID = 261;
|
||||
public static final int THEATRE_OF_BLOOD_PARTY_GROUP_ID = 28;
|
||||
public static final int GWD_KC_GROUP_ID = 406;
|
||||
public static final int ADVENTURE_LOG_ID = 187;
|
||||
public static final int COUNTERS_LOG_GROUP_ID = 625;
|
||||
|
||||
static class WorldMap
|
||||
{
|
||||
@@ -1226,5 +1229,25 @@ public class WidgetID
|
||||
{
|
||||
static final int CONTAINER = 0;
|
||||
}
|
||||
|
||||
|
||||
static class Lms
|
||||
{
|
||||
static final int INFO = 3;
|
||||
}
|
||||
|
||||
static class LmsKDA
|
||||
{
|
||||
static final int INFO = 4;
|
||||
}
|
||||
|
||||
static class AdventureLog
|
||||
{
|
||||
static final int CONTAINER = 0;
|
||||
}
|
||||
|
||||
static class CountersLog
|
||||
{
|
||||
static final int OWNER = 4;
|
||||
static final int TEXT = 6;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -515,6 +515,10 @@ public enum WidgetInfo
|
||||
KILL_LOG_KILLS(WidgetID.KILL_LOGS_GROUP_ID, WidgetID.KillLog.KILLS),
|
||||
KILL_LOG_STREAK(WidgetID.KILL_LOGS_GROUP_ID, WidgetID.KillLog.STREAK),
|
||||
|
||||
ADVENTURE_LOG(WidgetID.ADVENTURE_LOG_ID, WidgetID.AdventureLog.CONTAINER),
|
||||
|
||||
COUNTERS_LOG_TEXT(WidgetID.COUNTERS_LOG_GROUP_ID, WidgetID.CountersLog.TEXT),
|
||||
|
||||
WORLD_SWITCHER_LIST(WidgetID.WORLD_SWITCHER_GROUP_ID, WidgetID.WorldSwitcher.WORLD_LIST),
|
||||
|
||||
FOSSIL_ISLAND_OXYGENBAR(WidgetID.FOSSIL_ISLAND_OXYGENBAR_ID, WidgetID.FossilOxygen.FOSSIL_ISLAND_OXYGEN_BAR),
|
||||
|
||||
Reference in New Issue
Block a user