Commit 1c36f078 authored by Melledy's avatar Melledy
Browse files

Renamed all references to a certain game

parent 6b8902be
...@@ -3,7 +3,7 @@ package emu.grasscutter.command.commands; ...@@ -3,7 +3,7 @@ package emu.grasscutter.command.commands;
import emu.grasscutter.Grasscutter; import emu.grasscutter.Grasscutter;
import emu.grasscutter.command.Command; import emu.grasscutter.command.Command;
import emu.grasscutter.command.CommandHandler; import emu.grasscutter.command.CommandHandler;
import emu.grasscutter.game.GenshinPlayer; import emu.grasscutter.game.Player;
import java.util.List; import java.util.List;
...@@ -12,7 +12,7 @@ import java.util.List; ...@@ -12,7 +12,7 @@ import java.util.List;
public final class ReloadCommand implements CommandHandler { public final class ReloadCommand implements CommandHandler {
@Override @Override
public void execute(GenshinPlayer sender, List<String> args) { public void execute(Player sender, List<String> args) {
CommandHandler.sendMessage(sender, "Reloading config."); CommandHandler.sendMessage(sender, "Reloading config.");
Grasscutter.loadConfig(); Grasscutter.loadConfig();
Grasscutter.getGameServer().getGachaManager().load(); Grasscutter.getGameServer().getGachaManager().load();
......
...@@ -2,8 +2,8 @@ package emu.grasscutter.command.commands; ...@@ -2,8 +2,8 @@ package emu.grasscutter.command.commands;
import emu.grasscutter.command.Command; import emu.grasscutter.command.Command;
import emu.grasscutter.command.CommandHandler; import emu.grasscutter.command.CommandHandler;
import emu.grasscutter.game.GenshinPlayer; import emu.grasscutter.game.Player;
import emu.grasscutter.game.avatar.GenshinAvatar; import emu.grasscutter.game.avatar.Avatar;
import emu.grasscutter.game.entity.EntityAvatar; import emu.grasscutter.game.entity.EntityAvatar;
import java.util.List; import java.util.List;
...@@ -14,7 +14,7 @@ import java.util.List; ...@@ -14,7 +14,7 @@ import java.util.List;
public final class ResetConstCommand implements CommandHandler { public final class ResetConstCommand implements CommandHandler {
@Override @Override
public void execute(GenshinPlayer sender, List<String> args) { public void execute(Player sender, List<String> args) {
if (sender == null) { if (sender == null) {
CommandHandler.sendMessage(null, "Run this command in-game."); CommandHandler.sendMessage(null, "Run this command in-game.");
return; return;
...@@ -29,14 +29,14 @@ public final class ResetConstCommand implements CommandHandler { ...@@ -29,14 +29,14 @@ public final class ResetConstCommand implements CommandHandler {
return; return;
} }
GenshinAvatar avatar = entity.getAvatar(); Avatar avatar = entity.getAvatar();
this.resetConstellation(avatar); this.resetConstellation(avatar);
sender.dropMessage("Constellations for " + avatar.getAvatarData().getName() + " have been reset. Please relog to see changes."); sender.dropMessage("Constellations for " + avatar.getAvatarData().getName() + " have been reset. Please relog to see changes.");
} }
} }
private void resetConstellation(GenshinAvatar avatar) { private void resetConstellation(Avatar avatar) {
avatar.getTalentIdList().clear(); avatar.getTalentIdList().clear();
avatar.setCoreProudSkillLevel(0); avatar.setCoreProudSkillLevel(0);
avatar.recalcStats(); avatar.recalcStats();
......
...@@ -2,7 +2,7 @@ package emu.grasscutter.command.commands; ...@@ -2,7 +2,7 @@ package emu.grasscutter.command.commands;
import emu.grasscutter.command.Command; import emu.grasscutter.command.Command;
import emu.grasscutter.command.CommandHandler; import emu.grasscutter.command.CommandHandler;
import emu.grasscutter.game.GenshinPlayer; import emu.grasscutter.game.Player;
import java.util.List; import java.util.List;
...@@ -10,7 +10,7 @@ import java.util.List; ...@@ -10,7 +10,7 @@ import java.util.List;
public final class RestartCommand implements CommandHandler { public final class RestartCommand implements CommandHandler {
@Override @Override
public void execute(GenshinPlayer sender, List<String> args) { public void execute(Player sender, List<String> args) {
sender.getSession().close(); sender.getSession().close();
} }
} }
...@@ -4,7 +4,7 @@ import emu.grasscutter.Grasscutter; ...@@ -4,7 +4,7 @@ import emu.grasscutter.Grasscutter;
import emu.grasscutter.command.Command; import emu.grasscutter.command.Command;
import emu.grasscutter.command.CommandHandler; import emu.grasscutter.command.CommandHandler;
import emu.grasscutter.database.DatabaseHelper; import emu.grasscutter.database.DatabaseHelper;
import emu.grasscutter.game.GenshinPlayer; import emu.grasscutter.game.Player;
import emu.grasscutter.game.Mail; import emu.grasscutter.game.Mail;
import emu.grasscutter.server.packet.send.PacketMailChangeNotify; import emu.grasscutter.server.packet.send.PacketMailChangeNotify;
...@@ -27,7 +27,7 @@ public class SendMailCommand implements CommandHandler { ...@@ -27,7 +27,7 @@ public class SendMailCommand implements CommandHandler {
// Yes this is awful and I hate it. // Yes this is awful and I hate it.
@Override @Override
public void execute(GenshinPlayer sender, List<String> args) { public void execute(Player sender, List<String> args) {
int senderId; int senderId;
if(sender != null) { if(sender != null) {
senderId = sender.getUid(); senderId = sender.getUid();
...@@ -77,7 +77,7 @@ public class SendMailCommand implements CommandHandler { ...@@ -77,7 +77,7 @@ public class SendMailCommand implements CommandHandler {
Grasscutter.getGameServer().getPlayerByUid(mailBuilder.recipient, true).sendMail(mailBuilder.mail); Grasscutter.getGameServer().getPlayerByUid(mailBuilder.recipient, true).sendMail(mailBuilder.mail);
CommandHandler.sendMessage(sender, "Message sent to user " + mailBuilder.recipient + "!"); CommandHandler.sendMessage(sender, "Message sent to user " + mailBuilder.recipient + "!");
} else { } else {
for (GenshinPlayer player : DatabaseHelper.getAllPlayers()) { for (Player player : DatabaseHelper.getAllPlayers()) {
Grasscutter.getGameServer().getPlayerByUid(player.getUid(), true).sendMail(mailBuilder.mail); Grasscutter.getGameServer().getPlayerByUid(player.getUid(), true).sendMail(mailBuilder.mail);
} }
CommandHandler.sendMessage(sender, "Message sent to all users!"); CommandHandler.sendMessage(sender, "Message sent to all users!");
......
...@@ -3,7 +3,7 @@ package emu.grasscutter.command.commands; ...@@ -3,7 +3,7 @@ package emu.grasscutter.command.commands;
import emu.grasscutter.Grasscutter; import emu.grasscutter.Grasscutter;
import emu.grasscutter.command.Command; import emu.grasscutter.command.Command;
import emu.grasscutter.command.CommandHandler; import emu.grasscutter.command.CommandHandler;
import emu.grasscutter.game.GenshinPlayer; import emu.grasscutter.game.Player;
import java.util.List; import java.util.List;
...@@ -12,7 +12,7 @@ import java.util.List; ...@@ -12,7 +12,7 @@ import java.util.List;
public final class SendMessageCommand implements CommandHandler { public final class SendMessageCommand implements CommandHandler {
@Override @Override
public void execute(GenshinPlayer sender, List<String> args) { public void execute(Player sender, List<String> args) {
if (args.size() < 2) { if (args.size() < 2) {
CommandHandler.sendMessage(null, "Usage: sendmessage <player> <message>"); CommandHandler.sendMessage(null, "Usage: sendmessage <player> <message>");
return; return;
...@@ -22,7 +22,7 @@ public final class SendMessageCommand implements CommandHandler { ...@@ -22,7 +22,7 @@ public final class SendMessageCommand implements CommandHandler {
int target = Integer.parseInt(args.get(0)); int target = Integer.parseInt(args.get(0));
String message = String.join(" ", args.subList(1, args.size())); String message = String.join(" ", args.subList(1, args.size()));
GenshinPlayer targetPlayer = Grasscutter.getGameServer().getPlayerByUid(target); Player targetPlayer = Grasscutter.getGameServer().getPlayerByUid(target);
if (targetPlayer == null) { if (targetPlayer == null) {
CommandHandler.sendMessage(sender, "Player not found."); CommandHandler.sendMessage(sender, "Player not found.");
return; return;
......
...@@ -4,9 +4,9 @@ import java.util.List; ...@@ -4,9 +4,9 @@ import java.util.List;
import emu.grasscutter.command.Command; import emu.grasscutter.command.Command;
import emu.grasscutter.command.CommandHandler; import emu.grasscutter.command.CommandHandler;
import emu.grasscutter.data.GenshinData; import emu.grasscutter.data.GameData;
import emu.grasscutter.game.GenshinPlayer; import emu.grasscutter.game.Player;
import emu.grasscutter.game.avatar.GenshinAvatar; import emu.grasscutter.game.avatar.Avatar;
import emu.grasscutter.server.packet.send.PacketAvatarFetterDataNotify; import emu.grasscutter.server.packet.send.PacketAvatarFetterDataNotify;
@Command(label = "setfetterlevel", usage = "setfetterlevel <level>", @Command(label = "setfetterlevel", usage = "setfetterlevel <level>",
...@@ -15,7 +15,7 @@ import emu.grasscutter.server.packet.send.PacketAvatarFetterDataNotify; ...@@ -15,7 +15,7 @@ import emu.grasscutter.server.packet.send.PacketAvatarFetterDataNotify;
public final class SetFetterLevelCommand implements CommandHandler { public final class SetFetterLevelCommand implements CommandHandler {
@Override @Override
public void execute(GenshinPlayer sender, List<String> args) { public void execute(Player sender, List<String> args) {
if (sender == null) { if (sender == null) {
CommandHandler.sendMessage(null, "Run this command in-game."); CommandHandler.sendMessage(null, "Run this command in-game.");
return; return;
...@@ -32,11 +32,11 @@ public final class SetFetterLevelCommand implements CommandHandler { ...@@ -32,11 +32,11 @@ public final class SetFetterLevelCommand implements CommandHandler {
CommandHandler.sendMessage(sender, "Fetter level must be between 0 and 10."); CommandHandler.sendMessage(sender, "Fetter level must be between 0 and 10.");
return; return;
} }
GenshinAvatar avatar = sender.getTeamManager().getCurrentAvatarEntity().getAvatar(); Avatar avatar = sender.getTeamManager().getCurrentAvatarEntity().getAvatar();
avatar.setFetterLevel(fetterLevel); avatar.setFetterLevel(fetterLevel);
if (fetterLevel != 10) { if (fetterLevel != 10) {
avatar.setFetterExp(GenshinData.getAvatarFetterLevelDataMap().get(fetterLevel).getExp()); avatar.setFetterExp(GameData.getAvatarFetterLevelDataMap().get(fetterLevel).getExp());
} }
avatar.save(); avatar.save();
......
...@@ -2,7 +2,7 @@ package emu.grasscutter.command.commands; ...@@ -2,7 +2,7 @@ package emu.grasscutter.command.commands;
import emu.grasscutter.command.Command; import emu.grasscutter.command.Command;
import emu.grasscutter.command.CommandHandler; import emu.grasscutter.command.CommandHandler;
import emu.grasscutter.game.GenshinPlayer; import emu.grasscutter.game.Player;
import emu.grasscutter.game.entity.EntityAvatar; import emu.grasscutter.game.entity.EntityAvatar;
import emu.grasscutter.game.props.FightProperty; import emu.grasscutter.game.props.FightProperty;
import emu.grasscutter.server.packet.send.PacketEntityFightPropUpdateNotify; import emu.grasscutter.server.packet.send.PacketEntityFightPropUpdateNotify;
...@@ -14,7 +14,7 @@ import java.util.List; ...@@ -14,7 +14,7 @@ import java.util.List;
public final class SetStatsCommand implements CommandHandler { public final class SetStatsCommand implements CommandHandler {
@Override @Override
public void execute(GenshinPlayer sender, List<String> args) { public void execute(Player sender, List<String> args) {
if (sender == null) { if (sender == null) {
CommandHandler.sendMessage(null, "Run this command in-game."); CommandHandler.sendMessage(null, "Run this command in-game.");
return; return;
......
...@@ -2,7 +2,7 @@ package emu.grasscutter.command.commands; ...@@ -2,7 +2,7 @@ package emu.grasscutter.command.commands;
import emu.grasscutter.command.Command; import emu.grasscutter.command.Command;
import emu.grasscutter.command.CommandHandler; import emu.grasscutter.command.CommandHandler;
import emu.grasscutter.game.GenshinPlayer; import emu.grasscutter.game.Player;
import emu.grasscutter.game.props.PlayerProperty; import emu.grasscutter.game.props.PlayerProperty;
import java.util.List; import java.util.List;
...@@ -13,7 +13,7 @@ import java.util.List; ...@@ -13,7 +13,7 @@ import java.util.List;
public final class SetWorldLevelCommand implements CommandHandler { public final class SetWorldLevelCommand implements CommandHandler {
@Override @Override
public void execute(GenshinPlayer sender, List<String> args) { public void execute(Player sender, List<String> args) {
if (sender == null) { if (sender == null) {
CommandHandler.sendMessage(null, "Run this command in-game."); CommandHandler.sendMessage(null, "Run this command in-game.");
return; // TODO: set player's world level from console or other players return; // TODO: set player's world level from console or other players
......
...@@ -2,9 +2,9 @@ package emu.grasscutter.command.commands; ...@@ -2,9 +2,9 @@ package emu.grasscutter.command.commands;
import emu.grasscutter.command.Command; import emu.grasscutter.command.Command;
import emu.grasscutter.command.CommandHandler; import emu.grasscutter.command.CommandHandler;
import emu.grasscutter.data.GenshinData; import emu.grasscutter.data.GameData;
import emu.grasscutter.data.def.MonsterData; import emu.grasscutter.data.def.MonsterData;
import emu.grasscutter.game.GenshinPlayer; import emu.grasscutter.game.Player;
import emu.grasscutter.game.entity.EntityMonster; import emu.grasscutter.game.entity.EntityMonster;
import emu.grasscutter.utils.Position; import emu.grasscutter.utils.Position;
...@@ -15,7 +15,7 @@ import java.util.List; ...@@ -15,7 +15,7 @@ import java.util.List;
public final class SpawnCommand implements CommandHandler { public final class SpawnCommand implements CommandHandler {
@Override @Override
public void execute(GenshinPlayer sender, List<String> args) { public void execute(Player sender, List<String> args) {
if (sender == null) { if (sender == null) {
CommandHandler.sendMessage(null, "Run this command in-game."); CommandHandler.sendMessage(null, "Run this command in-game.");
return; return;
...@@ -31,7 +31,7 @@ public final class SpawnCommand implements CommandHandler { ...@@ -31,7 +31,7 @@ public final class SpawnCommand implements CommandHandler {
int level = args.size() > 1 ? Integer.parseInt(args.get(1)) : 1; int level = args.size() > 1 ? Integer.parseInt(args.get(1)) : 1;
int amount = args.size() > 2 ? Integer.parseInt(args.get(2)) : 1; int amount = args.size() > 2 ? Integer.parseInt(args.get(2)) : 1;
MonsterData entityData = GenshinData.getMonsterDataMap().get(entity); MonsterData entityData = GameData.getMonsterDataMap().get(entity);
if (entityData == null) { if (entityData == null) {
CommandHandler.sendMessage(sender, "Invalid entity id."); CommandHandler.sendMessage(sender, "Invalid entity id.");
return; return;
......
...@@ -3,7 +3,7 @@ package emu.grasscutter.command.commands; ...@@ -3,7 +3,7 @@ package emu.grasscutter.command.commands;
import emu.grasscutter.Grasscutter; import emu.grasscutter.Grasscutter;
import emu.grasscutter.command.Command; import emu.grasscutter.command.Command;
import emu.grasscutter.command.CommandHandler; import emu.grasscutter.command.CommandHandler;
import emu.grasscutter.game.GenshinPlayer; import emu.grasscutter.game.Player;
import java.util.List; import java.util.List;
...@@ -12,9 +12,9 @@ import java.util.List; ...@@ -12,9 +12,9 @@ import java.util.List;
public final class StopCommand implements CommandHandler { public final class StopCommand implements CommandHandler {
@Override @Override
public void execute(GenshinPlayer sender, List<String> args) { public void execute(Player sender, List<String> args) {
CommandHandler.sendMessage(null, "Server shutting down..."); CommandHandler.sendMessage(null, "Server shutting down...");
for (GenshinPlayer p : Grasscutter.getGameServer().getPlayers().values()) { for (Player p : Grasscutter.getGameServer().getPlayers().values()) {
CommandHandler.sendMessage(p, "Server shutting down..."); CommandHandler.sendMessage(p, "Server shutting down...");
} }
......
...@@ -3,8 +3,8 @@ package emu.grasscutter.command.commands; ...@@ -3,8 +3,8 @@ package emu.grasscutter.command.commands;
import emu.grasscutter.command.Command; import emu.grasscutter.command.Command;
import emu.grasscutter.command.CommandHandler; import emu.grasscutter.command.CommandHandler;
import emu.grasscutter.data.def.AvatarSkillDepotData; import emu.grasscutter.data.def.AvatarSkillDepotData;
import emu.grasscutter.game.GenshinPlayer; import emu.grasscutter.game.Player;
import emu.grasscutter.game.avatar.GenshinAvatar; import emu.grasscutter.game.avatar.Avatar;
import emu.grasscutter.game.entity.EntityAvatar; import emu.grasscutter.game.entity.EntityAvatar;
import emu.grasscutter.server.packet.send.PacketAvatarSkillChangeNotify; import emu.grasscutter.server.packet.send.PacketAvatarSkillChangeNotify;
import emu.grasscutter.server.packet.send.PacketAvatarSkillUpgradeRsp; import emu.grasscutter.server.packet.send.PacketAvatarSkillUpgradeRsp;
...@@ -16,7 +16,7 @@ import java.util.List; ...@@ -16,7 +16,7 @@ import java.util.List;
public final class TalentCommand implements CommandHandler { public final class TalentCommand implements CommandHandler {
@Override @Override
public void execute(GenshinPlayer sender, List<String> args) { public void execute(Player sender, List<String> args) {
if (sender == null) { if (sender == null) {
CommandHandler.sendMessage(null, "Run this command in-game."); CommandHandler.sendMessage(null, "Run this command in-game.");
return; return;
...@@ -41,7 +41,7 @@ public final class TalentCommand implements CommandHandler { ...@@ -41,7 +41,7 @@ public final class TalentCommand implements CommandHandler {
int skillId = Integer.parseInt(args.get(1)); int skillId = Integer.parseInt(args.get(1));
int nextLevel = Integer.parseInt(args.get(2)); int nextLevel = Integer.parseInt(args.get(2));
EntityAvatar entity = sender.getTeamManager().getCurrentAvatarEntity(); EntityAvatar entity = sender.getTeamManager().getCurrentAvatarEntity();
GenshinAvatar avatar = entity.getAvatar(); Avatar avatar = entity.getAvatar();
int skillIdNorAtk = avatar.getData().getSkillDepot().getSkills().get(0); int skillIdNorAtk = avatar.getData().getSkillDepot().getSkills().get(0);
int skillIdE = avatar.getData().getSkillDepot().getSkills().get(1); int skillIdE = avatar.getData().getSkillDepot().getSkills().get(1);
int skillIdQ = avatar.getData().getSkillDepot().getEnergySkill(); int skillIdQ = avatar.getData().getSkillDepot().getEnergySkill();
...@@ -97,7 +97,7 @@ public final class TalentCommand implements CommandHandler { ...@@ -97,7 +97,7 @@ public final class TalentCommand implements CommandHandler {
case "n": case "e": case "q": case "n": case "e": case "q":
try { try {
EntityAvatar entity = sender.getTeamManager().getCurrentAvatarEntity(); EntityAvatar entity = sender.getTeamManager().getCurrentAvatarEntity();
GenshinAvatar avatar = entity.getAvatar(); Avatar avatar = entity.getAvatar();
AvatarSkillDepotData SkillDepot = avatar.getData().getSkillDepot(); AvatarSkillDepotData SkillDepot = avatar.getData().getSkillDepot();
int skillId; int skillId;
switch (cmdSwitch) { switch (cmdSwitch) {
...@@ -135,7 +135,7 @@ public final class TalentCommand implements CommandHandler { ...@@ -135,7 +135,7 @@ public final class TalentCommand implements CommandHandler {
break; break;
case "getid": case "getid":
EntityAvatar entity = sender.getTeamManager().getCurrentAvatarEntity(); EntityAvatar entity = sender.getTeamManager().getCurrentAvatarEntity();
GenshinAvatar avatar = entity.getAvatar(); Avatar avatar = entity.getAvatar();
int skillIdNorAtk = avatar.getData().getSkillDepot().getSkills().get(0); int skillIdNorAtk = avatar.getData().getSkillDepot().getSkills().get(0);
int skillIdE = avatar.getData().getSkillDepot().getSkills().get(1); int skillIdE = avatar.getData().getSkillDepot().getSkills().get(1);
int skillIdQ = avatar.getData().getSkillDepot().getEnergySkill(); int skillIdQ = avatar.getData().getSkillDepot().getEnergySkill();
......
...@@ -2,7 +2,7 @@ package emu.grasscutter.command.commands; ...@@ -2,7 +2,7 @@ package emu.grasscutter.command.commands;
import emu.grasscutter.command.Command; import emu.grasscutter.command.Command;
import emu.grasscutter.command.CommandHandler; import emu.grasscutter.command.CommandHandler;
import emu.grasscutter.game.GenshinPlayer; import emu.grasscutter.game.Player;
import emu.grasscutter.utils.Position; import emu.grasscutter.utils.Position;
import java.util.List; import java.util.List;
...@@ -12,7 +12,7 @@ import java.util.List; ...@@ -12,7 +12,7 @@ import java.util.List;
public final class TeleportCommand implements CommandHandler { public final class TeleportCommand implements CommandHandler {
@Override @Override
public void execute(GenshinPlayer sender, List<String> args) { public void execute(Player sender, List<String> args) {
if (sender == null) { if (sender == null) {
CommandHandler.sendMessage(null, "Run this command in-game."); CommandHandler.sendMessage(null, "Run this command in-game.");
return; return;
......
...@@ -2,7 +2,7 @@ package emu.grasscutter.command.commands; ...@@ -2,7 +2,7 @@ package emu.grasscutter.command.commands;
import emu.grasscutter.command.Command; import emu.grasscutter.command.Command;
import emu.grasscutter.command.CommandHandler; import emu.grasscutter.command.CommandHandler;
import emu.grasscutter.game.GenshinPlayer; import emu.grasscutter.game.Player;
import emu.grasscutter.game.props.ClimateType; import emu.grasscutter.game.props.ClimateType;
import emu.grasscutter.server.packet.send.PacketSceneAreaWeatherNotify; import emu.grasscutter.server.packet.send.PacketSceneAreaWeatherNotify;
...@@ -13,7 +13,7 @@ import java.util.List; ...@@ -13,7 +13,7 @@ import java.util.List;
public final class WeatherCommand implements CommandHandler { public final class WeatherCommand implements CommandHandler {
@Override @Override
public void execute(GenshinPlayer sender, List<String> args) { public void execute(Player sender, List<String> args) {
if (sender == null) { if (sender == null) {
CommandHandler.sendMessage(null, "Run this command in-game."); CommandHandler.sendMessage(null, "Run this command in-game.");
return; return;
......
...@@ -16,7 +16,7 @@ import it.unimi.dsi.fastutil.ints.Int2ObjectLinkedOpenHashMap; ...@@ -16,7 +16,7 @@ import it.unimi.dsi.fastutil.ints.Int2ObjectLinkedOpenHashMap;
import it.unimi.dsi.fastutil.ints.Int2ObjectMap; import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap; import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap;
public class GenshinData { public class GameData {
// BinOutputs // BinOutputs
private static final Int2ObjectMap<String> abilityHashes = new Int2ObjectOpenHashMap<>(); private static final Int2ObjectMap<String> abilityHashes = new Int2ObjectOpenHashMap<>();
private static final Map<String, AbilityEmbryoEntry> abilityEmbryos = new HashMap<>(); private static final Map<String, AbilityEmbryoEntry> abilityEmbryos = new HashMap<>();
...@@ -69,7 +69,7 @@ public class GenshinData { ...@@ -69,7 +69,7 @@ public class GenshinData {
Int2ObjectMap<?> map = null; Int2ObjectMap<?> map = null;
try { try {
Field field = GenshinData.class.getDeclaredField(Utils.lowerCaseFirstChar(resourceDefinition.getSimpleName()) + "Map"); Field field = GameData.class.getDeclaredField(Utils.lowerCaseFirstChar(resourceDefinition.getSimpleName()) + "Map");
field.setAccessible(true); field.setAccessible(true);
map = (Int2ObjectMap<?>) field.get(null); map = (Int2ObjectMap<?>) field.get(null);
......
...@@ -15,21 +15,21 @@ import emu.grasscutter.utils.WeightedList; ...@@ -15,21 +15,21 @@ import emu.grasscutter.utils.WeightedList;
import it.unimi.dsi.fastutil.ints.Int2ObjectMap; import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap; import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap;
public class GenshinDepot { public class GameDepot {
private static Int2ObjectMap<WeightedList<ReliquaryMainPropData>> relicMainPropDepot = new Int2ObjectOpenHashMap<>(); private static Int2ObjectMap<WeightedList<ReliquaryMainPropData>> relicMainPropDepot = new Int2ObjectOpenHashMap<>();
private static Int2ObjectMap<List<ReliquaryAffixData>> relicAffixDepot = new Int2ObjectOpenHashMap<>(); private static Int2ObjectMap<List<ReliquaryAffixData>> relicAffixDepot = new Int2ObjectOpenHashMap<>();
private static Int2ObjectMap<SpatialIndex<SpawnGroupEntry>> spawnLists = new Int2ObjectOpenHashMap<>(); private static Int2ObjectMap<SpatialIndex<SpawnGroupEntry>> spawnLists = new Int2ObjectOpenHashMap<>();
public static void load() { public static void load() {
for (ReliquaryMainPropData data : GenshinData.getReliquaryMainPropDataMap().values()) { for (ReliquaryMainPropData data : GameData.getReliquaryMainPropDataMap().values()) {
if (data.getWeight() <= 0 || data.getPropDepotId() <= 0) { if (data.getWeight() <= 0 || data.getPropDepotId() <= 0) {
continue; continue;
} }
WeightedList<ReliquaryMainPropData> list = relicMainPropDepot.computeIfAbsent(data.getPropDepotId(), k -> new WeightedList<>()); WeightedList<ReliquaryMainPropData> list = relicMainPropDepot.computeIfAbsent(data.getPropDepotId(), k -> new WeightedList<>());
list.add(data.getWeight(), data); list.add(data.getWeight(), data);
} }
for (ReliquaryAffixData data : GenshinData.getReliquaryAffixDataMap().values()) { for (ReliquaryAffixData data : GameData.getReliquaryAffixDataMap().values()) {
if (data.getWeight() <= 0 || data.getDepotId() <= 0) { if (data.getWeight() <= 0 || data.getDepotId() <= 0) {
continue; continue;
} }
......
package emu.grasscutter.data; package emu.grasscutter.data;
public abstract class GenshinResource { public abstract class GameResource {
public int getId() { public int getId() {
return 0; return 0;
......
...@@ -27,7 +27,7 @@ public class ResourceLoader { ...@@ -27,7 +27,7 @@ public class ResourceLoader {
public static List<Class<?>> getResourceDefClasses() { public static List<Class<?>> getResourceDefClasses() {
Reflections reflections = new Reflections(ResourceLoader.class.getPackage().getName()); Reflections reflections = new Reflections(ResourceLoader.class.getPackage().getName());
Set<?> classes = reflections.getSubTypesOf(GenshinResource.class); Set<?> classes = reflections.getSubTypesOf(GameResource.class);
List<Class<?>> classList = new ArrayList<>(classes.size()); List<Class<?>> classList = new ArrayList<>(classes.size());
classes.forEach(o -> { classes.forEach(o -> {
...@@ -50,12 +50,12 @@ public class ResourceLoader { ...@@ -50,12 +50,12 @@ public class ResourceLoader {
loadResources(); loadResources();
loadScenePoints(); loadScenePoints();
// Process into depots // Process into depots
GenshinDepot.load(); GameDepot.load();
// Load spawn data // Load spawn data
loadSpawnData(); loadSpawnData();
// Custom - TODO move this somewhere else // Custom - TODO move this somewhere else
try { try {
GenshinData.getAvatarSkillDepotDataMap().get(504).setAbilities( GameData.getAvatarSkillDepotDataMap().get(504).setAbilities(
new AbilityEmbryoEntry( new AbilityEmbryoEntry(
"", "",
new String[] { new String[] {
...@@ -68,7 +68,7 @@ public class ResourceLoader { ...@@ -68,7 +68,7 @@ public class ResourceLoader {
"Avatar_Player_WindBreathe_CameraController" "Avatar_Player_WindBreathe_CameraController"
} }
)); ));
GenshinData.getAvatarSkillDepotDataMap().get(704).setAbilities( GameData.getAvatarSkillDepotDataMap().get(704).setAbilities(
new AbilityEmbryoEntry( new AbilityEmbryoEntry(
"", "",
new String[] { new String[] {
...@@ -95,7 +95,7 @@ public class ResourceLoader { ...@@ -95,7 +95,7 @@ public class ResourceLoader {
} }
@SuppressWarnings("rawtypes") @SuppressWarnings("rawtypes")
Int2ObjectMap map = GenshinData.getMapByResourceDef(resourceDefinition); Int2ObjectMap map = GameData.getMapByResourceDef(resourceDefinition);
if (map == null) { if (map == null) {
continue; continue;
...@@ -123,7 +123,7 @@ public class ResourceLoader { ...@@ -123,7 +123,7 @@ public class ResourceLoader {
List list = Grasscutter.getGsonFactory().fromJson(fileReader, TypeToken.getParameterized(Collection.class, c).getType()); List list = Grasscutter.getGsonFactory().fromJson(fileReader, TypeToken.getParameterized(Collection.class, c).getType());
for (Object o : list) { for (Object o : list) {
GenshinResource res = (GenshinResource) o; GameResource res = (GameResource) o;
res.onLoad(); res.onLoad();
map.put(res.getId(), res); map.put(res.getId(), res);
} }
...@@ -170,7 +170,7 @@ public class ResourceLoader { ...@@ -170,7 +170,7 @@ public class ResourceLoader {
} }
for (ScenePointEntry entry : scenePointList) { for (ScenePointEntry entry : scenePointList) {
GenshinData.getScenePointEntries().put(entry.getName(), entry); GameData.getScenePointEntries().put(entry.getName(), entry);
} }
} }
} }
...@@ -233,7 +233,7 @@ public class ResourceLoader { ...@@ -233,7 +233,7 @@ public class ResourceLoader {
} }
for (AbilityEmbryoEntry entry : embryoList) { for (AbilityEmbryoEntry entry : embryoList) {
GenshinData.getAbilityEmbryoInfo().put(entry.getName(), entry); GameData.getAbilityEmbryoInfo().put(entry.getName(), entry);
} }
} }
...@@ -260,7 +260,7 @@ public class ResourceLoader { ...@@ -260,7 +260,7 @@ public class ResourceLoader {
entry.getSpawns().stream().forEach(s -> { entry.getSpawns().stream().forEach(s -> {
s.setGroup(entry); s.setGroup(entry);
}); });
GenshinDepot.getSpawnListById(entry.getSceneId()).insert(entry, entry.getPos().getX(), entry.getPos().getZ()); GameDepot.getSpawnListById(entry.getSceneId()).insert(entry, entry.getPos().getX(), entry.getPos().getZ());
} }
} }
...@@ -328,7 +328,7 @@ public class ResourceLoader { ...@@ -328,7 +328,7 @@ public class ResourceLoader {
} }
for (OpenConfigEntry entry : list) { for (OpenConfigEntry entry : list) {
GenshinData.getOpenConfigEntries().put(entry.getName(), entry); GameData.getOpenConfigEntries().put(entry.getName(), entry);
} }
} }
......
package emu.grasscutter.data.def; package emu.grasscutter.data.def;
import emu.grasscutter.data.GenshinData; import emu.grasscutter.data.GameData;
import emu.grasscutter.data.GenshinResource; import emu.grasscutter.data.GameResource;
import emu.grasscutter.data.ResourceType; import emu.grasscutter.data.ResourceType;
@ResourceType(name = "AvatarCostumeExcelConfigData.json") @ResourceType(name = "AvatarCostumeExcelConfigData.json")
public class AvatarCostumeData extends GenshinResource { public class AvatarCostumeData extends GameResource {
private int CostumeId; private int CostumeId;
private int ItemId; private int ItemId;
private int AvatarId; private int AvatarId;
...@@ -25,6 +25,6 @@ public class AvatarCostumeData extends GenshinResource { ...@@ -25,6 +25,6 @@ public class AvatarCostumeData extends GenshinResource {
@Override @Override
public void onLoad() { public void onLoad() {
GenshinData.getAvatarCostumeDataItemIdMap().put(this.getItemId(), this); GameData.getAvatarCostumeDataItemIdMap().put(this.getItemId(), this);
} }
} }
...@@ -4,12 +4,12 @@ import java.util.HashMap; ...@@ -4,12 +4,12 @@ import java.util.HashMap;
import java.util.Map; import java.util.Map;
import java.util.stream.Stream; import java.util.stream.Stream;
import emu.grasscutter.data.GenshinResource; import emu.grasscutter.data.GameResource;
import emu.grasscutter.data.ResourceType; import emu.grasscutter.data.ResourceType;
import emu.grasscutter.data.common.CurveInfo; import emu.grasscutter.data.common.CurveInfo;
@ResourceType(name = "AvatarCurveExcelConfigData.json") @ResourceType(name = "AvatarCurveExcelConfigData.json")
public class AvatarCurveData extends GenshinResource { public class AvatarCurveData extends GameResource {
private int Level; private int Level;
private CurveInfo[] CurveInfos; private CurveInfo[] CurveInfos;
......
...@@ -2,8 +2,8 @@ package emu.grasscutter.data.def; ...@@ -2,8 +2,8 @@ package emu.grasscutter.data.def;
import java.util.List; import java.util.List;
import emu.grasscutter.data.GenshinData; import emu.grasscutter.data.GameData;
import emu.grasscutter.data.GenshinResource; import emu.grasscutter.data.GameResource;
import emu.grasscutter.data.ResourceType; import emu.grasscutter.data.ResourceType;
import emu.grasscutter.data.ResourceType.LoadPriority; import emu.grasscutter.data.ResourceType.LoadPriority;
import emu.grasscutter.data.common.PropGrowCurve; import emu.grasscutter.data.common.PropGrowCurve;
...@@ -15,7 +15,7 @@ import it.unimi.dsi.fastutil.ints.IntArrayList; ...@@ -15,7 +15,7 @@ import it.unimi.dsi.fastutil.ints.IntArrayList;
import it.unimi.dsi.fastutil.ints.IntList; import it.unimi.dsi.fastutil.ints.IntList;
@ResourceType(name = "AvatarExcelConfigData.json", loadPriority = LoadPriority.LOW) @ResourceType(name = "AvatarExcelConfigData.json", loadPriority = LoadPriority.LOW)
public class AvatarData extends GenshinResource { public class AvatarData extends GameResource {
private String name; private String name;
private String IconName; private String IconName;
...@@ -178,7 +178,7 @@ public class AvatarData extends GenshinResource { ...@@ -178,7 +178,7 @@ public class AvatarData extends GenshinResource {
if (growCurve == null) { if (growCurve == null) {
return 1f; return 1f;
} }
AvatarCurveData curveData = GenshinData.getAvatarCurveDataMap().get(level); AvatarCurveData curveData = GameData.getAvatarCurveDataMap().get(level);
if (curveData == null) { if (curveData == null) {
return 1f; return 1f;
} }
...@@ -211,24 +211,24 @@ public class AvatarData extends GenshinResource { ...@@ -211,24 +211,24 @@ public class AvatarData extends GenshinResource {
@Override @Override
public void onLoad() { public void onLoad() {
this.skillDepot = GenshinData.getAvatarSkillDepotDataMap().get(this.SkillDepotId); this.skillDepot = GameData.getAvatarSkillDepotDataMap().get(this.SkillDepotId);
// Get fetters from GenshinData // Get fetters from GameData
this.fetters = GenshinData.getFetterDataEntries().get(this.Id); this.fetters = GameData.getFetterDataEntries().get(this.Id);
if (GenshinData.getFetterCharacterCardDataMap().get(this.Id) != null) { if (GameData.getFetterCharacterCardDataMap().get(this.Id) != null) {
this.nameCardRewardId = GenshinData.getFetterCharacterCardDataMap().get(this.Id).getRewardId(); this.nameCardRewardId = GameData.getFetterCharacterCardDataMap().get(this.Id).getRewardId();
} }
if (GenshinData.getRewardDataMap().get(this.nameCardRewardId) != null) { if (GameData.getRewardDataMap().get(this.nameCardRewardId) != null) {
this.nameCardId = GenshinData.getRewardDataMap().get(this.nameCardRewardId).getRewardItemList().get(0).getItemId(); this.nameCardId = GameData.getRewardDataMap().get(this.nameCardRewardId).getRewardItemList().get(0).getItemId();
} }
int size = GenshinData.getAvatarCurveDataMap().size(); int size = GameData.getAvatarCurveDataMap().size();
this.hpGrowthCurve = new float[size]; this.hpGrowthCurve = new float[size];
this.attackGrowthCurve = new float[size]; this.attackGrowthCurve = new float[size];
this.defenseGrowthCurve = new float[size]; this.defenseGrowthCurve = new float[size];
for (AvatarCurveData curveData : GenshinData.getAvatarCurveDataMap().values()) { for (AvatarCurveData curveData : GameData.getAvatarCurveDataMap().values()) {
int level = curveData.getLevel() - 1; int level = curveData.getLevel() - 1;
for (PropGrowCurve growCurve : this.PropGrowCurves) { for (PropGrowCurve growCurve : this.PropGrowCurves) {
FightProperty prop = FightProperty.getPropByName(growCurve.getType()); FightProperty prop = FightProperty.getPropByName(growCurve.getType());
...@@ -260,7 +260,7 @@ public class AvatarData extends GenshinResource { ...@@ -260,7 +260,7 @@ public class AvatarData extends GenshinResource {
if (split.length > 0) { if (split.length > 0) {
this.name = split[split.length - 1]; this.name = split[split.length - 1];
AbilityEmbryoEntry info = GenshinData.getAbilityEmbryoInfo().get(this.name); AbilityEmbryoEntry info = GameData.getAbilityEmbryoInfo().get(this.name);
if (info != null) { if (info != null) {
this.abilities = new IntArrayList(info.getAbilities().length); this.abilities = new IntArrayList(info.getAbilities().length);
for (String ability : info.getAbilities()) { for (String ability : info.getAbilities()) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment