feat: add a way to get AccountType

This adds a way to get the logged in players account type.
This commit is contained in:
Joshua Filby
2018-04-25 17:28:09 -05:00
committed by Adam
parent e9d1d7e75f
commit b594c83ab6
4 changed files with 79 additions and 1 deletions

View File

@@ -27,6 +27,7 @@ package net.runelite.mixins;
import java.util.ArrayList;
import java.util.List;
import javax.annotation.Nullable;
import net.runelite.api.vars.AccountType;
import net.runelite.api.ChatMessageType;
import net.runelite.api.ClanMember;
import net.runelite.api.GameState;
@@ -160,6 +161,25 @@ public abstract class RSClientMixin implements RSClient
interpolateObjectAnimations = interpolate;
}
@Inject
@Override
public AccountType getAccountType()
{
int varbit = getVar(Varbits.ACCOUNT_TYPE);
switch (varbit)
{
case 1:
return AccountType.IRONMAN;
case 2:
return AccountType.ULTIMATE_IRONMAN;
case 3:
return AccountType.HARDCORE_IRONMAN;
}
return AccountType.NORMAL;
}
@Inject
@Override
public Tile getSelectedRegionTile()