mirror of
https://github.com/Melledy/LunarCore.git
synced 2025-12-13 05:44:36 +01:00
added icons to giveall
This commit is contained in:
@@ -5,6 +5,7 @@ import java.util.List;
|
||||
|
||||
import emu.lunarcore.command.Command;
|
||||
import emu.lunarcore.command.CommandArgs;
|
||||
import java.util.stream.Collectors;
|
||||
import emu.lunarcore.command.CommandHandler;
|
||||
import emu.lunarcore.data.GameData;
|
||||
import emu.lunarcore.data.excel.ItemExcel;
|
||||
@@ -69,6 +70,20 @@ public class GiveAllCommand implements CommandHandler {
|
||||
// Send message
|
||||
this.sendMessage(sender, "Giving " + target.getName() + " " + items.size() + " light cones");
|
||||
}
|
||||
case "ic", "icons" -> {
|
||||
// Get UnlockedHeads
|
||||
for (int iconhead : GameData.getAllIconHeads()) {
|
||||
|
||||
// Skip if target already has the head icon
|
||||
if (target.getUnlockedHeadIcons().contains(iconhead)) {
|
||||
continue;
|
||||
}
|
||||
target.addHeadIcon(iconhead);
|
||||
}
|
||||
|
||||
// Send message
|
||||
this.sendMessage(sender, "Added all icons to " + target.getName());
|
||||
}
|
||||
case "r", "relics" -> {
|
||||
// Get relics
|
||||
List<GameItem> items = GameData.getItemExcelMap().values()
|
||||
|
||||
@@ -31,6 +31,7 @@ public class GameData {
|
||||
@Getter private static Int2ObjectMap<HeroExcel> heroExcelMap = new Int2ObjectOpenHashMap<>();
|
||||
@Getter private static Int2ObjectMap<ShopExcel> shopExcelMap = new Int2ObjectOpenHashMap<>();
|
||||
@Getter private static Int2ObjectMap<RewardExcel> rewardExcelMap = new Int2ObjectOpenHashMap<>();
|
||||
@Getter private static Int2ObjectMap<PlayerIconExcel> playerIconExcelMap = new Int2ObjectOpenHashMap<>();
|
||||
@Getter private static Int2ObjectMap<ItemComposeExcel> itemComposeExcelMap = new Int2ObjectOpenHashMap<>();
|
||||
@Getter private static Int2ObjectMap<ActivityPanelExcel> activityPanelExcelMap = new Int2ObjectOpenHashMap<>();
|
||||
|
||||
@@ -107,6 +108,17 @@ public class GameData {
|
||||
return allIds;
|
||||
}
|
||||
|
||||
public static List<Integer> getAllIconHeads() {
|
||||
List<Integer> allIds = new ArrayList<>();
|
||||
|
||||
for (Int2ObjectMap.Entry<PlayerIconExcel> entry : playerIconExcelMap.int2ObjectEntrySet()) {
|
||||
PlayerIconExcel playerIconExcel = entry.getValue();
|
||||
allIds.add(playerIconExcel.getId());
|
||||
}
|
||||
|
||||
return allIds;
|
||||
}
|
||||
|
||||
public static AvatarPromotionExcel getAvatarPromotionExcel(int id, int promotion) {
|
||||
return avatarPromotionExcelMap.get((id << 8) + promotion);
|
||||
}
|
||||
|
||||
@@ -44,6 +44,10 @@ public class ItemExcel extends GameResource {
|
||||
return ItemMainType == emu.lunarcore.game.enums.ItemMainType.Equipment && this.getEquipmentExcel() != null;
|
||||
}
|
||||
|
||||
public boolean isHeadIcon() {
|
||||
return ItemSubType == emu.lunarcore.game.enums.ItemSubType.HeadIcon;
|
||||
}
|
||||
|
||||
public boolean isRelic() {
|
||||
return ItemMainType == emu.lunarcore.game.enums.ItemMainType.Relic && this.getRelicExcel() != null;
|
||||
}
|
||||
|
||||
17
src/main/java/emu/lunarcore/data/excel/PlayerIconExcel.java
Normal file
17
src/main/java/emu/lunarcore/data/excel/PlayerIconExcel.java
Normal file
@@ -0,0 +1,17 @@
|
||||
package emu.lunarcore.data.excel;
|
||||
|
||||
import emu.lunarcore.data.GameResource;
|
||||
import emu.lunarcore.data.ResourceType;
|
||||
import emu.lunarcore.data.ResourceType.LoadPriority;
|
||||
import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
@ResourceType(name = {"PlayerIcon.json"}, loadPriority = LoadPriority.NORMAL)
|
||||
public class PlayerIconExcel extends GameResource {
|
||||
private int ID;
|
||||
|
||||
@Override
|
||||
public int getId() {
|
||||
return ID;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user