Skip to content

Commit

Permalink
Quick fix for PacketGetArchiveDataScRsp
Browse files Browse the repository at this point in the history
  • Loading branch information
Melledy committed Feb 6, 2024
1 parent a47363a commit 0058166
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
10 changes: 2 additions & 8 deletions src/main/java/emu/lunarcore/data/GameData.java
Original file line number Diff line number Diff line change
Expand Up @@ -104,14 +104,7 @@ public static Int2ObjectMap<?> getMapForExcel(Class<?> resourceDefinition) {
}

public static List<Integer> getAllRelicIds() {
List<Integer> allIds = new ArrayList<>();

for (Int2ObjectMap.Entry<RelicExcel> entry : relicExcelMap.int2ObjectEntrySet()) {
RelicExcel relicExcel = entry.getValue();
allIds.add(relicExcel.getId());
}

return allIds;
return relicExcelMap.values().stream().map(RelicExcel::getId).toList();
}

public static int getRelicSetFromId(int relicId) {
Expand All @@ -120,6 +113,7 @@ public static int getRelicSetFromId(int relicId) {
if (relicExcel == null) {
return 0;
}

return relicExcel.getSetId();
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
package emu.lunarcore.server.packet.send;

import java.util.stream.Collectors;

import emu.lunarcore.data.GameData;
import emu.lunarcore.data.excel.RelicExcel;
import emu.lunarcore.proto.GetArchiveDataScRspOuterClass.GetArchiveDataScRsp;
import emu.lunarcore.proto.MonsterArchiveOuterClass.MonsterArchive;
import emu.lunarcore.proto.RelicArchiveOuterClass.RelicArchive;
Expand All @@ -16,19 +19,21 @@ public PacketGetArchiveDataScRsp() {

var data = GetArchiveDataScRsp.newInstance();
var archiveData = data.getMutableArchiveData();
var allRelicSetIds = GameData.getAllRelicSetIds();
//var allRelicSetIds = GameData.getRelicExcelMap().values().stream().map(RelicExcel::getSetId).collect(Collectors.toSet());

//for (var avatarExcel : GameData.getAvatarExcelMap().values()) {
//archiveData.addArchiveAvatarIdList(avatarExcel.getAvatarID());
//}

/*
for (int relicSetId : allRelicSetIds) {
int setType = GameData.getTypeValueFromSetID(relicSetId);
var relicSetInstance = RelicArchive.newInstance()
.setRelicId(relicSetId)
.setRelicId(relicSetId);
.setSlot(setType);
archiveData.addRelicList(relicSetInstance);
}
*/

for (var monsterExcel : GameData.getMonsterExcelMap().values()) {
MonsterArchive monsterinfo = MonsterArchive.newInstance()
Expand Down

0 comments on commit 0058166

Please sign in to comment.