Convert item stats mapping to use item ids instead of names

Signed-off-by: Tomas Slusny <slusnucky@gmail.com>
This commit is contained in:
Tomas Slusny
2019-02-20 18:14:25 +01:00
parent 48ca19cd92
commit 14fe12e7d6
3 changed files with 11 additions and 10 deletions

View File

@@ -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);