mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-13 05:27:37 +00:00
Sort Profile Info
This commit is contained in:
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);
|
||||
|
||||
Reference in new issue
Block a user