Skip to content

rillis/JLol

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 

Repository files navigation

JLol

A League of Legends API for Java

Setup

Download the latest release, put every JAR file in your project buildpath. You'll need to instantiate an LolAPI type object:

import com.jlol.*;

LolAPI api = new LolAPI("LOL API-KEY HERE");

Doc

com.jlol.LolAPI throws InvalidToken

getToken() : String
getLastVersion() : String

com.jlol.champion.ChampionList

getChampionList(String version, String Locale) : Champion[]

Locale example: Locale.ENGLISH_US (com.jlol.locale.Locale)

com.jlol.champion.Champion throws ChampionNotFound

getImageURL(String version) : String
getSplashImageUrl() : String
getSplashImageSkinUrl(int skinId) : String

com.jlol.champion.skin

getSkinListFromChampion(Champion c, String version, String locale) : Skin[]

Methods to get a Champion (com.jlol.champion.Champion):

Method 1: Getting from list.

	LolAPI l = null;
	try {
		l = new LolAPI("RGAPI-x");
	} catch (InvalidToken e1) {
		e1.printStackTrace();
	}
	String last_version = l.getLastVersion();
	try {
		Champion[] c = new ChampionList(l).getChampionList(last_version, Locale.PORTUGUESE);
	} catch (IOException e) {
		e.printStackTrace();
	}

Method 2: Searching.

	LolAPI l = null;
	try {
		l = new LolAPI("RGAPI-x");
	} catch (InvalidToken e1) {
		e1.printStackTrace();
	}
	
	String champID = "wu ko ng";
	
	Champion champ = null;
	try {
		champ = new Champion(champID, l, l.getLastVersion(), Locale.PORTUGUESE);
		System.out.println(champ.name); //Wukong
		System.out.println(champ.id); //MonkeyKing
		System.out.println(champ.stats.attackDamage); //68.0
	} catch (ChampionNotFound e) {
		e.printStackTrace();
	}