mirror of
https://github.com/Melledy/LunarCore.git
synced 2025-12-14 14:24:37 +01:00
Update handbook to list commands
This commit is contained in:
@@ -12,6 +12,7 @@ import java.util.Map;
|
|||||||
|
|
||||||
import emu.lunarcore.GameConstants;
|
import emu.lunarcore.GameConstants;
|
||||||
import emu.lunarcore.LunarRail;
|
import emu.lunarcore.LunarRail;
|
||||||
|
import emu.lunarcore.command.Command;
|
||||||
import emu.lunarcore.data.GameData;
|
import emu.lunarcore.data.GameData;
|
||||||
import emu.lunarcore.data.excel.*;
|
import emu.lunarcore.data.excel.*;
|
||||||
|
|
||||||
@@ -38,12 +39,23 @@ public class Handbook {
|
|||||||
LocalDateTime now = LocalDateTime.now();
|
LocalDateTime now = LocalDateTime.now();
|
||||||
|
|
||||||
// Header
|
// Header
|
||||||
writer.println("// Star Rail " + GameConstants.VERSION + " Handbook");
|
writer.println("# Star Rail " + GameConstants.VERSION + " Handbook");
|
||||||
writer.println("// Created " + dtf.format(now));
|
writer.println("# Created " + dtf.format(now));
|
||||||
|
|
||||||
|
// Dump commands
|
||||||
|
writer.println(System.lineSeparator());
|
||||||
|
writer.println("# Commands");
|
||||||
|
list = GameData.getAvatarExcelMap().keySet().intStream().sorted().boxed().toList();
|
||||||
|
for (var entry : LunarRail.getCommandManager().getLabels().entrySet()) {
|
||||||
|
Command command = entry.getValue().getClass().getAnnotation(Command.class);
|
||||||
|
if (command == null) continue;
|
||||||
|
|
||||||
|
writer.println(command.desc());
|
||||||
|
}
|
||||||
|
|
||||||
// Dump avatars
|
// Dump avatars
|
||||||
writer.println(System.lineSeparator());
|
writer.println(System.lineSeparator());
|
||||||
writer.println("// Avatars");
|
writer.println("# Avatars");
|
||||||
list = GameData.getAvatarExcelMap().keySet().intStream().sorted().boxed().toList();
|
list = GameData.getAvatarExcelMap().keySet().intStream().sorted().boxed().toList();
|
||||||
for (int id : list) {
|
for (int id : list) {
|
||||||
AvatarExcel excel = GameData.getAvatarExcelMap().get(id);
|
AvatarExcel excel = GameData.getAvatarExcelMap().get(id);
|
||||||
@@ -54,7 +66,7 @@ public class Handbook {
|
|||||||
|
|
||||||
// Dump items
|
// Dump items
|
||||||
writer.println(System.lineSeparator());
|
writer.println(System.lineSeparator());
|
||||||
writer.println("// Items");
|
writer.println("# Items");
|
||||||
list = GameData.getItemExcelMap().keySet().intStream().sorted().boxed().toList();
|
list = GameData.getItemExcelMap().keySet().intStream().sorted().boxed().toList();
|
||||||
for (int id : list) {
|
for (int id : list) {
|
||||||
ItemExcel excel = GameData.getItemExcelMap().get(id);
|
ItemExcel excel = GameData.getItemExcelMap().get(id);
|
||||||
@@ -65,7 +77,7 @@ public class Handbook {
|
|||||||
|
|
||||||
// Dump npc monsters
|
// Dump npc monsters
|
||||||
writer.println(System.lineSeparator());
|
writer.println(System.lineSeparator());
|
||||||
writer.println("// NPC Monsters (Spawnable)");
|
writer.println("# NPC Monsters (Spawnable)");
|
||||||
list = GameData.getNpcMonsterExcelMap().keySet().intStream().sorted().boxed().toList();
|
list = GameData.getNpcMonsterExcelMap().keySet().intStream().sorted().boxed().toList();
|
||||||
for (int id : list) {
|
for (int id : list) {
|
||||||
NpcMonsterExcel excel = GameData.getNpcMonsterExcelMap().get(id);
|
NpcMonsterExcel excel = GameData.getNpcMonsterExcelMap().get(id);
|
||||||
@@ -76,7 +88,7 @@ public class Handbook {
|
|||||||
|
|
||||||
// Dump stages
|
// Dump stages
|
||||||
writer.println(System.lineSeparator());
|
writer.println(System.lineSeparator());
|
||||||
writer.println("// Stages");
|
writer.println("# Stages");
|
||||||
list = GameData.getStageExcelMap().keySet().intStream().sorted().boxed().toList();
|
list = GameData.getStageExcelMap().keySet().intStream().sorted().boxed().toList();
|
||||||
for (int id : list) {
|
for (int id : list) {
|
||||||
StageExcel excel = GameData.getStageExcelMap().get(id);
|
StageExcel excel = GameData.getStageExcelMap().get(id);
|
||||||
@@ -85,17 +97,6 @@ public class Handbook {
|
|||||||
writer.print("[Level " + excel.getLevel() + "] ");
|
writer.print("[Level " + excel.getLevel() + "] ");
|
||||||
writer.println(textMap.getOrDefault(excel.getStageName(), "null"));
|
writer.println(textMap.getOrDefault(excel.getStageName(), "null"));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Dump monsters
|
|
||||||
writer.println(System.lineSeparator());
|
|
||||||
writer.println("// Monsters");
|
|
||||||
list = GameData.getMonsterExcelMap().keySet().intStream().sorted().boxed().toList();
|
|
||||||
for (int id : list) {
|
|
||||||
MonsterExcel excel = GameData.getMonsterExcelMap().get(id);
|
|
||||||
writer.print(excel.getId());
|
|
||||||
writer.print(" : ");
|
|
||||||
writer.println(textMap.getOrDefault(excel.getMonsterName(), "null"));
|
|
||||||
}
|
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user