Merge pull request #1198 from sethtroll/addregiontoagility
agility plugin: Add region check to lap counter
This commit is contained in:
@@ -25,6 +25,7 @@
|
|||||||
package net.runelite.client.plugins.agilityplugin;
|
package net.runelite.client.plugins.agilityplugin;
|
||||||
|
|
||||||
import com.google.common.eventbus.Subscribe;
|
import com.google.common.eventbus.Subscribe;
|
||||||
|
import com.google.common.primitives.Ints;
|
||||||
import com.google.inject.Provides;
|
import com.google.inject.Provides;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
@@ -129,7 +130,7 @@ public class AgilityPlugin extends Plugin
|
|||||||
|
|
||||||
// Get course
|
// Get course
|
||||||
Courses course = Courses.getCourse(skillGained);
|
Courses course = Courses.getCourse(skillGained);
|
||||||
if (course == null)
|
if (course == null || !Ints.contains(client.getMapRegions(), course.getRegionId()))
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,25 +26,27 @@ package net.runelite.client.plugins.agilityplugin;
|
|||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
|
|
||||||
|
@AllArgsConstructor
|
||||||
public enum Courses
|
public enum Courses
|
||||||
{
|
{
|
||||||
GNOME(86.5, 46),
|
GNOME(86.5, 46, 9781),
|
||||||
DRAYNOR(120.0, 79),
|
DRAYNOR(120.0, 79, 12338),
|
||||||
AL_KARID(180.0, 30),
|
AL_KARID(180.0, 30, 13105),
|
||||||
PYRAMID(722.0, 300),
|
PYRAMID(722.0, 300, 13356),
|
||||||
VARROCK(238.0, 125),
|
VARROCK(238.0, 125, 12853),
|
||||||
PENGUIN(540.0, 65),
|
PENGUIN(540.0, 65, 10559),
|
||||||
BARBARIAN(139.5, 60),
|
BARBARIAN(139.5, 60, 10039),
|
||||||
CANIFIS(240.0, 175),
|
CANIFIS(240.0, 175, 13878),
|
||||||
APE_ATOLL(580.0, 300),
|
APE_ATOLL(580.0, 300, 11050),
|
||||||
FALADOR(440, 180),
|
FALADOR(440, 180, 12084),
|
||||||
WILDERNESS(571.0, 499),
|
WILDERNESS(571.0, 499, 11837),
|
||||||
SEERS(570.0, 435),
|
SEERS(570.0, 435, 10806),
|
||||||
POLLNIVEACH(890.0, 540),
|
POLLNIVEACH(890.0, 540, 13358),
|
||||||
RELLEKA(780.0, 475),
|
RELLEKA(780.0, 475, 10553),
|
||||||
ARDOUGNE(793.0, 529);
|
ARDOUGNE(793.0, 529, 10547);
|
||||||
|
|
||||||
private final static Map<Integer, Courses> courseXps = new HashMap<>();
|
private final static Map<Integer, Courses> courseXps = new HashMap<>();
|
||||||
|
|
||||||
@@ -53,6 +55,9 @@ public enum Courses
|
|||||||
|
|
||||||
private final int lastObstacleXp;
|
private final int lastObstacleXp;
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
private final int regionId;
|
||||||
|
|
||||||
static
|
static
|
||||||
{
|
{
|
||||||
for (Courses course : values())
|
for (Courses course : values())
|
||||||
@@ -61,12 +66,6 @@ public enum Courses
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Courses(double totalXp, int lastObstacleXp)
|
|
||||||
{
|
|
||||||
this.totalXp = totalXp;
|
|
||||||
this.lastObstacleXp = lastObstacleXp;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static Courses getCourse(int exp)
|
public static Courses getCourse(int exp)
|
||||||
{
|
{
|
||||||
return courseXps.get(exp);
|
return courseXps.get(exp);
|
||||||
|
|||||||
Reference in New Issue
Block a user