npc mixin: transform npc in getName/getCombatLevel/getId

This commit is contained in:
Adam
2018-04-23 19:38:09 -04:00
parent 0edfbb59b6
commit 3caf182b0b
4 changed files with 19 additions and 42 deletions

View File

@@ -48,6 +48,10 @@ public abstract class RSNPCMixin implements RSNPC
public int getId()
{
RSNPCComposition composition = getComposition();
if (composition != null && composition.getConfigs() != null)
{
composition = composition.transform();
}
return composition == null ? -1 : composition.getId();
}
@@ -56,6 +60,10 @@ public abstract class RSNPCMixin implements RSNPC
public String getName()
{
RSNPCComposition composition = getComposition();
if (composition != null && composition.getConfigs() != null)
{
composition = composition.transform();
}
return composition == null ? null : composition.getName().replace('\u00A0', ' ');
}
@@ -64,6 +72,10 @@ public abstract class RSNPCMixin implements RSNPC
public int getCombatLevel()
{
RSNPCComposition composition = getComposition();
if (composition != null && composition.getConfigs() != null)
{
composition = composition.transform();
}
return composition == null ? -1 : composition.getCombatLevel();
}