File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed
src/main/java/io/github/archipelagomw Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -92,4 +92,23 @@ public void setMissingLocations(Set<Long> missingLocations) {
9292 this .missingLocations .clear ();
9393 this .missingLocations .addAll (missingLocations );
9494 }
95+
96+ /**
97+ Helper to get the location ID from an inputted location name as a String. Only use this
98+ if you know what you're dealing with, and can accept that getting this from the datapackage
99+ is not 100% reliable.
100+
101+ @param locationName The name of the location you wish to look up.
102+ @return The ID of the location that you have looked up from the datapackage.
103+ */
104+ public Optional <Long > getLocationNameFromID (String locationName ){
105+ return Optional .ofNullable (
106+ this .client
107+ .getDataPackage ()
108+ .getGame (this .client .getGame ())
109+ )
110+ .map (game -> game .locationNameToId
111+ .get (locationName )
112+ );
113+ }
95114}
You can’t perform that action at this time.
0 commit comments