Skip to content

Commit

Permalink
npcstats: add static getter for attack speed
Browse files Browse the repository at this point in the history
  • Loading branch information
Therealnull committed Feb 6, 2021
1 parent a579bdb commit e08e16f
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,14 @@ public NPCStats read(JsonReader in) throws IOException
}
};

public static int getAttackSpeed(int npcId)
{
if (statsMap != null)
if (statsMap.get(npcId) != null)
return statsMap.get(npcId).getAttackSpeed();
return -1;
}

public static void loadStats() throws IOException
{
try (JsonReader reader = new JsonReader(new InputStreamReader(NPCStats.class.getResourceAsStream("npc_stats.json"), StandardCharsets.UTF_8)))
Expand Down

0 comments on commit e08e16f

Please sign in to comment.