Use ClassId getId instead of ordinal.

This commit is contained in:
MobiusDevelopment
2019-10-23 09:20:16 +00:00
parent 0ef149a2d8
commit 58259e68d6
81 changed files with 113 additions and 113 deletions

View File

@ -1569,7 +1569,7 @@ public class SkillTreesData implements IXmlReader
}
tempMap.clear();
Arrays.sort(array);
_skillsByClassIdHashCodes.put(cls.ordinal(), array);
_skillsByClassIdHashCodes.put(cls.getId(), array);
}
// Race specific skills from Fishing and Transformation skill trees.
@ -1681,7 +1681,7 @@ public class SkillTreesData implements IXmlReader
final int maxLvl = SkillData.getInstance().getMaxLevel(skill.getId());
final long hashCode = SkillData.getSkillHashCode(skill.getId(), Math.min(skill.getLevel(), maxLvl));
if (Arrays.binarySearch(_skillsByClassIdHashCodes.get(player.getClassId().ordinal()), hashCode) >= 0)
if (Arrays.binarySearch(_skillsByClassIdHashCodes.get(player.getClassId().getId()), hashCode) >= 0)
{
return true;
}

View File

@ -52,7 +52,7 @@ public class SubClass
public int getClassId()
{
return _class.ordinal();
return _class.getId();
}
public long getExp()

View File

@ -276,7 +276,7 @@ public abstract class ZoneType extends ListenersContainer
for (int _clas : _class)
{
if (((PlayerInstance) creature).getClassId().ordinal() == _clas)
if (((PlayerInstance) creature).getClassId().getId() == _clas)
{
ok = true;
break;

View File

@ -87,9 +87,9 @@ public class RequestCrystallizeItem implements IClientIncomingPacket
{
client.sendPacket(SystemMessageId.YOU_MAY_NOT_CRYSTALLIZE_THIS_ITEM_YOUR_CRYSTALLIZATION_SKILL_LEVEL_IS_TOO_LOW);
client.sendPacket(ActionFailed.STATIC_PACKET);
if ((player.getRace() != Race.DWARF) && (player.getClassId().ordinal() != 117) && (player.getClassId().ordinal() != 55))
if ((player.getRace() != Race.DWARF) && (player.getClassId().getId() != 117) && (player.getClassId().getId() != 55))
{
LOGGER.info("Player " + player + " used crystalize with classid: " + player.getClassId().ordinal());
LOGGER.info("Player " + player + " used crystalize with classid: " + player.getClassId().getId());
}
return;
}