From c464396d107acb4cb4d41bee4a7d6e7a67ce4f4c Mon Sep 17 00:00:00 2001 From: KingRainbow44 Date: Tue, 2 May 2023 21:12:51 -0400 Subject: [PATCH] Fix build problem (deprecation) --- src/main/java/emu/grasscutter/tools/Tools.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/main/java/emu/grasscutter/tools/Tools.java b/src/main/java/emu/grasscutter/tools/Tools.java index bdc4e90a2..f96b11f6b 100644 --- a/src/main/java/emu/grasscutter/tools/Tools.java +++ b/src/main/java/emu/grasscutter/tools/Tools.java @@ -9,6 +9,8 @@ import emu.grasscutter.command.CommandHandler; import emu.grasscutter.command.CommandMap; import emu.grasscutter.data.GameData; import emu.grasscutter.data.ResourceLoader; +import emu.grasscutter.data.common.ItemUseData; +import emu.grasscutter.data.excels.HomeWorldBgmData; import emu.grasscutter.data.excels.ItemData; import emu.grasscutter.data.excels.achievement.AchievementData; import emu.grasscutter.data.excels.avatar.AvatarData; @@ -141,12 +143,12 @@ public final class Tools { val bgmName = Optional.ofNullable(data.getItemUse()) .map(u -> u.get(0)) - .map(u -> u.getUseParam()) + .map(ItemUseData::getUseParam) .filter(u -> u.length > 0) .map(u -> Integer.parseInt(u[0])) - .map(bgmId -> GameData.getHomeWorldBgmDataMap().get(bgmId)) - .map(bgm -> bgm.getBgmNameTextMapHash()) - .map(hash -> getTextMapKey(hash)); + .map(bgmId -> GameData.getHomeWorldBgmDataMap().get((int) bgmId)) + .map(HomeWorldBgmData::getBgmNameTextMapHash) + .map(Language::getTextMapKey); if (bgmName.isPresent()) { h.newTranslatedLine(itemPre.formatted(id) + "{0} - {1}", name, bgmName.get()); return;