Sort Profile Info

This commit is contained in:
Kam committed 2025-02-23 22:43:55 -05:00
1 parent 56ab018320
commit ef05817991
1 file changed
+5 -2
@@ -601,8 +601,11 @@ public class ProfileController implements IProfileHandler {
Profile profile = getProfile(player);
if (profile == null)
return infoList;
List<IProfileData> dataList = new ArrayList<>(profileTypes.values());
dataList.sort(Comparator.comparingInt(IProfileData::getSwitchPriority));
if (slotId == profile.getCurrentSlotId()) {
for (IProfileData pd : profileTypes.values()) {
for (IProfileData pd : dataList) {
NBTTagCompound currentNBT = pd.getCurrentNBT(player);
List<InfoEntry> subInfo = pd.getInfo(player, currentNBT);
infoList.addAll(subInfo);
@@ -611,7 +614,7 @@ public class ProfileController implements IProfileHandler {
if (!profile.getSlots().containsKey(slotId))
return infoList;
ISlot slot = profile.getSlots().get(slotId);
for (IProfileData pd : profileTypes.values()) {
for (IProfileData pd : dataList) {
if (slot.getComponents().containsKey(pd.getTagName())) {
NBTTagCompound sub = slot.getComponentData(pd.getTagName());
List<InfoEntry> subInfo = pd.getInfo(player, sub);