Convert item stats mapping to use item ids instead of names
Signed-off-by: Tomas Slusny <slusnucky@gmail.com>
This commit is contained in:
@@ -204,11 +204,12 @@ public class ItemClient
|
||||
}
|
||||
}
|
||||
|
||||
public Map<String, ItemStats> getStats() throws IOException
|
||||
public Map<Integer, ItemStats> getStats() throws IOException
|
||||
{
|
||||
HttpUrl.Builder urlBuilder = RuneLiteAPI.getStaticBase().newBuilder()
|
||||
.addPathSegment("item")
|
||||
.addPathSegment("stats.min.json");
|
||||
// TODO: Change this to stats.min.json later after release is undeployed
|
||||
.addPathSegment("stats.ids.min.json");
|
||||
|
||||
HttpUrl url = urlBuilder.build();
|
||||
|
||||
@@ -227,7 +228,7 @@ public class ItemClient
|
||||
}
|
||||
|
||||
InputStream in = response.body().byteStream();
|
||||
final Type typeToken = new TypeToken<Map<String, ItemStats>>()
|
||||
final Type typeToken = new TypeToken<Map<Integer, ItemStats>>()
|
||||
{
|
||||
}.getType();
|
||||
return RuneLiteAPI.GSON.fromJson(new InputStreamReader(in), typeToken);
|
||||
|
||||
Reference in New Issue
Block a user