refactor(lombok): add Getter where possible

This commit is contained in:
Breno A. 2024-06-09 09:52:49 -03:00
parent 7ee644c794
commit 8f4120fcd3
200 changed files with 708 additions and 1401 deletions

View File

@ -1,5 +1,8 @@
package emu.grasscutter.data.binout;
import lombok.Getter;
@Getter
public class AbilityEmbryoEntry {
private String name;
private String[] abilities;
@ -11,11 +14,4 @@ public class AbilityEmbryoEntry {
this.abilities = array;
}
public String getName() {
return name;
}
public String[] getAbilities() {
return abilities;
}
}

View File

@ -1,12 +1,17 @@
package emu.grasscutter.data.binout;
import emu.grasscutter.data.binout.AbilityModifier.AbilityModifierAction;
import lombok.Getter;
import java.util.*;
public class AbilityModifierEntry {
public final List<AbilityModifierAction> onModifierAdded;
@Getter
public final List<AbilityModifierAction> onThinkInterval;
@Getter
public final List<AbilityModifierAction> onRemoved;
@Getter
private final String name; // Custom value
public AbilityModifierEntry(String name) {
@ -16,19 +21,8 @@ public class AbilityModifierEntry {
this.onRemoved = new ArrayList<>();
}
public String getName() {
return name;
}
public List<AbilityModifierAction> getOnAdded() {
return onModifierAdded;
}
public List<AbilityModifierAction> getOnThinkInterval() {
return onThinkInterval;
}
public List<AbilityModifierAction> getOnRemoved() {
return onRemoved;
}
}

View File

@ -5,53 +5,30 @@ import emu.grasscutter.data.GameData;
import emu.grasscutter.game.quest.enums.QuestType;
import java.util.*;
import lombok.Data;
import lombok.Getter;
public class MainQuestData {
@Getter
private int id;
private int ICLLDPJFIMA;
@Getter
private int series;
@Getter
private QuestType type;
@Getter
private long titleTextMapHash;
@Getter
private int[] suggestTrackMainQuestList;
@Getter
private int[] rewardIdList;
@Getter
private SubQuestData[] subQuests;
@Getter
private List<TalkData> talks;
private long[] preloadLuaList;
public int getId() {
return id;
}
public int getSeries() {
return series;
}
public QuestType getType() {
return type;
}
public long getTitleTextMapHash() {
return titleTextMapHash;
}
public int[] getSuggestTrackMainQuestList() {
return suggestTrackMainQuestList;
}
public int[] getRewardIdList() {
return rewardIdList;
}
public SubQuestData[] getSubQuests() {
return subQuests;
}
public List<TalkData> getTalks() {
return talks;
}
public void onLoad() {
if (this.talks == null) this.talks = new ArrayList<>();
if (this.subQuests == null) this.subQuests = new SubQuestData[0];

View File

@ -1,8 +1,11 @@
package emu.grasscutter.data.binout;
import emu.grasscutter.data.ResourceLoader.OpenConfigData;
import lombok.Getter;
import java.util.*;
@Getter
public class OpenConfigEntry {
private final String name;
private String[] addAbilities;
@ -34,22 +37,7 @@ public class OpenConfigEntry {
}
}
public String getName() {
return name;
}
public String[] getAddAbilities() {
return addAbilities;
}
public int getExtraTalentIndex() {
return extraTalentIndex;
}
public SkillPointModifier[] getSkillPointModifiers() {
return skillPointModifiers;
}
@Getter
public static class SkillPointModifier {
private final int skillId;
private final int delta;
@ -59,12 +47,5 @@ public class OpenConfigEntry {
this.delta = delta;
}
public int getSkillId() {
return skillId;
}
public int getDelta() {
return delta;
}
}
}

View File

@ -3,9 +3,10 @@ package emu.grasscutter.data.binout;
import emu.grasscutter.data.common.PointData;
import lombok.Getter;
@Getter
public class ScenePointEntry {
@Getter private final int sceneId;
@Getter private final PointData pointData;
private final int sceneId;
private final PointData pointData;
@Deprecated(forRemoval = true)
public ScenePointEntry(String name, PointData pointData) {

View File

@ -4,13 +4,14 @@ import emu.grasscutter.data.binout.config.fields.ConfigAbilityData;
import java.util.List;
import lombok.Getter;
@Getter
public class ConfigLevelEntity {
@Getter private List<ConfigAbilityData> abilities;
@Getter private List<ConfigAbilityData> monsterAbilities;
@Getter private List<ConfigAbilityData> avatarAbilities;
@Getter private List<ConfigAbilityData> teamAbilities;
@Getter private List<Integer> preloadMonsterEntityIDs;
private List<ConfigAbilityData> abilities;
private List<ConfigAbilityData> monsterAbilities;
private List<ConfigAbilityData> avatarAbilities;
private List<ConfigAbilityData> teamAbilities;
private List<Integer> preloadMonsterEntityIDs;
@Getter private String dropElemControlType;
private String dropElemControlType;
}

View File

@ -3,13 +3,14 @@ package emu.grasscutter.data.binout.routes;
// import emu.grasscutter.scripts.constants.IntValueEnum;
import lombok.Getter;
@Getter
public enum RotAngleType /*implements IntValueEnum */ {
ROT_NONE(-1),
ROT_ANGLE_X(0),
ROT_ANGLE_Y(1),
ROT_ANGLE_Z(2);
@Getter private final int id;
private final int id;
RotAngleType(int id) {
this.id = id;

View File

@ -3,13 +3,14 @@ package emu.grasscutter.data.binout.routes;
// import emu.grasscutter.scripts.constants.IntValueEnum;
import lombok.Getter;
@Getter
public enum RouteType /*implements IntValueEnum*/ {
Unknown(-1),
OneWay(0),
Reciprocate(1),
Loop(2);
@Getter private final int id;
private final int id;
RouteType(int id) {
this.id = id;

View File

@ -1,19 +1,11 @@
package emu.grasscutter.data.common;
import lombok.Getter;
@Getter
public class CurveInfo {
private String type;
private String arith;
private float value;
public String getType() {
return type;
}
public String getArith() {
return arith;
}
public float getValue() {
return value;
}
}

View File

@ -1,24 +1,14 @@
package emu.grasscutter.data.common;
import emu.grasscutter.game.props.FightProperty;
import lombok.Getter;
@Getter
public class FightPropData {
private String propType;
private FightProperty prop;
private float value;
public String getPropType() {
return propType;
}
public float getValue() {
return value;
}
public FightProperty getProp() {
return prop;
}
public void onLoad() {
this.prop = FightProperty.getPropByName(propType);
}

View File

@ -1,8 +1,10 @@
package emu.grasscutter.data.common;
import com.google.gson.annotations.SerializedName;
import lombok.Getter;
// Used in excels
@Getter
public class ItemParamData {
@SerializedName(
value = "id",
@ -21,18 +23,10 @@ public class ItemParamData {
this.count = count;
}
public int getId() {
return id;
}
public int getItemId() {
return id;
}
public int getCount() {
return count;
}
public int getItemCount() {
return count;
}

View File

@ -1,19 +1,14 @@
package emu.grasscutter.data.common;
import lombok.Getter;
@Getter
public class ItemParamStringData {
private int id;
private String count;
public ItemParamStringData() {}
public int getId() {
return id;
}
public String getCount() {
return count;
}
public ItemParamData toItemParamData() {
if (count.contains(";")) {
String[] split = count.split(";");

View File

@ -1,9 +1,11 @@
package emu.grasscutter.data.common;
import emu.grasscutter.game.props.ItemUseOp;
import lombok.Getter;
public class ItemUseData {
private ItemUseOp useOp;
@Getter
private String[] useParam;
public ItemUseOp getUseOp() {
@ -13,7 +15,4 @@ public class ItemUseData {
return useOp;
}
public String[] getUseParam() {
return useParam;
}
}

View File

@ -1,23 +1,18 @@
package emu.grasscutter.data.common;
import lombok.Getter;
import java.util.List;
@Getter
public class OpenCondData {
private String condType;
private List<Integer> paramList;
public String getCondType() {
return condType;
}
public void setCondType(String cType) {
condType = cType;
}
public List<Integer> getParamList() {
return paramList;
}
public void setParamList(List<Integer> pList) {
paramList = pList;
}

View File

@ -1,14 +1,10 @@
package emu.grasscutter.data.common;
import lombok.Getter;
@Getter
public class PropGrowCurve {
private String type;
private String growCurve;
public String getType() {
return this.type;
}
public String getGrowCurve() {
return this.growCurve;
}
}

View File

@ -2,22 +2,34 @@ package emu.grasscutter.data.excels;
import emu.grasscutter.data.*;
import emu.grasscutter.data.common.ItemParamData;
import lombok.Getter;
import java.util.List;
import java.util.stream.Collectors;
@ResourceType(name = "CombineExcelConfigData.json")
public class CombineData extends GameResource {
@Getter
private int combineId;
@Getter
private int playerLevel;
private boolean isDefaultShow;
@Getter
private int combineType;
@Getter
private int subCombineType;
@Getter
private int resultItemId;
@Getter
private int resultItemCount;
@Getter
private int scoinCost;
@Getter
private List<ItemParamData> randomItems;
@Getter
private List<ItemParamData> materialItems;
@Getter
private String recipeType;
@Override
@ -35,47 +47,8 @@ public class CombineData extends GameResource {
materialItems.stream().filter(item -> item.getId() > 0).collect(Collectors.toList());
}
public int getCombineId() {
return combineId;
}
public int getPlayerLevel() {
return playerLevel;
}
public boolean isDefaultShow() {
return isDefaultShow;
}
public int getCombineType() {
return combineType;
}
public int getSubCombineType() {
return subCombineType;
}
public int getResultItemId() {
return resultItemId;
}
public int getResultItemCount() {
return resultItemCount;
}
public int getScoinCost() {
return scoinCost;
}
public List<ItemParamData> getRandomItems() {
return randomItems;
}
public List<ItemParamData> getMaterialItems() {
return materialItems;
}
public String getRecipeType() {
return recipeType;
}
}

View File

@ -2,7 +2,9 @@ package emu.grasscutter.data.excels;
import emu.grasscutter.data.*;
import emu.grasscutter.data.ResourceType.LoadPriority;
import lombok.Getter;
@Getter
@ResourceType(
name = {"CookBonusExcelConfigData.json"},
loadPriority = LoadPriority.LOW)
@ -17,22 +19,6 @@ public class CookBonusData extends GameResource {
return this.avatarId;
}
public int getAvatarId() {
return avatarId;
}
public int getRecipeId() {
return recipeId;
}
public int[] getParamVec() {
return paramVec;
}
public int[] getComplexParamVec() {
return complexParamVec;
}
public int getReplacementItemId() {
return this.paramVec[0];
}

View File

@ -2,13 +2,17 @@ package emu.grasscutter.data.excels;
import emu.grasscutter.data.*;
import emu.grasscutter.data.common.ItemParamData;
import lombok.Getter;
import java.util.List;
@ResourceType(
name = "EnvAnimalGatherExcelConfigData.json",
loadPriority = ResourceType.LoadPriority.LOW)
public class EnvAnimalGatherConfigData extends GameResource {
@Getter
private int animalId;
@Getter
private String entityType;
private List<ItemParamData> gatherItemId;
private String excludeWeathers;
@ -21,14 +25,6 @@ public class EnvAnimalGatherConfigData extends GameResource {
return animalId;
}
public int getAnimalId() {
return animalId;
}
public String getEntityType() {
return entityType;
}
public ItemParamData getGatherItem() {
return !gatherItemId.isEmpty() ? gatherItemId.get(0) : null;
}

View File

@ -2,6 +2,8 @@ package emu.grasscutter.data.excels;
import emu.grasscutter.data.*;
import emu.grasscutter.data.common.FightPropData;
import lombok.Getter;
import java.util.ArrayList;
@ResourceType(name = "EquipAffixExcelConfigData.json")
@ -9,10 +11,15 @@ public class EquipAffixData extends GameResource {
private int affixId;
private int id;
@Getter
private int level;
@Getter
private long nameTextMapHash;
@Getter
private String openConfig;
@Getter
private FightPropData[] addProps;
@Getter
private float[] paramList;
@Override
@ -24,26 +31,6 @@ public class EquipAffixData extends GameResource {
return id;
}
public int getLevel() {
return level;
}
public long getNameTextMapHash() {
return nameTextMapHash;
}
public String getOpenConfig() {
return openConfig;
}
public FightPropData[] getAddProps() {
return addProps;
}
public float[] getParamList() {
return paramList;
}
@Override
public void onLoad() {
ArrayList<FightPropData> parsed = new ArrayList<>(getAddProps().length);

View File

@ -2,10 +2,12 @@ package emu.grasscutter.data.excels;
import emu.grasscutter.data.*;
import emu.grasscutter.data.ResourceType.LoadPriority;
import lombok.Getter;
@ResourceType(name = "FetterCharacterCardExcelConfigData.json", loadPriority = LoadPriority.HIGHEST)
public class FetterCharacterCardData extends GameResource {
private int avatarId;
@Getter
private int rewardId;
@Override
@ -13,10 +15,6 @@ public class FetterCharacterCardData extends GameResource {
return avatarId;
}
public int getRewardId() {
return rewardId;
}
@Override
public void onLoad() {}
}

View File

@ -3,6 +3,8 @@ package emu.grasscutter.data.excels;
import emu.grasscutter.data.*;
import emu.grasscutter.data.ResourceType.LoadPriority;
import emu.grasscutter.data.common.OpenCondData;
import lombok.Getter;
import java.util.List;
@ResourceType(
@ -15,6 +17,7 @@ import java.util.List;
},
loadPriority = LoadPriority.HIGHEST)
public class FetterData extends GameResource {
@Getter
private int avatarId;
private int fetterId;
private List<OpenCondData> openCond;
@ -24,10 +27,6 @@ public class FetterData extends GameResource {
return fetterId;
}
public int getAvatarId() {
return avatarId;
}
public List<OpenCondData> getOpenConds() {
return openCond;
}

View File

@ -1,13 +1,17 @@
package emu.grasscutter.data.excels;
import emu.grasscutter.data.*;
import lombok.Getter;
@ResourceType(name = "GatherExcelConfigData.json")
public class GatherData extends GameResource {
private int pointType;
private int id;
@Getter
private int gadgetId;
@Getter
private int itemId;
@Getter
private int cd; // Probably hours
private boolean isForbidGuest;
private boolean initDisableInteract;
@ -21,18 +25,6 @@ public class GatherData extends GameResource {
return id;
}
public int getGadgetId() {
return gadgetId;
}
public int getItemId() {
return itemId;
}
public int getCd() {
return cd;
}
public boolean isForbidGuest() {
return isForbidGuest;
}

View File

@ -39,12 +39,10 @@ public class OpenStateData extends GameResource {
OPEN_STATE_COND_PARENT_QUEST
}
@Getter
public static class OpenStateCond {
@Getter
private OpenStateCondType condType;
@Getter
private int param;
@Getter
private int param2;
}
}

View File

@ -6,11 +6,12 @@ import emu.grasscutter.game.world.World;
import java.util.*;
import lombok.Getter;
@Getter
@ResourceType(name = "RefreshPolicyExcelConfigData.json")
public class RefreshPolicyExcelConfigData extends GameResource {
@Getter private int id;
@Getter private RefreshType type;
@Getter private String time;
private int id;
private RefreshType type;
private String time;
private static int upperBound(List<Integer> list, int low, int high, int value) {
while (low < high) {

View File

@ -2,11 +2,14 @@ package emu.grasscutter.data.excels;
import emu.grasscutter.data.*;
import emu.grasscutter.data.common.ItemParamData;
import lombok.Getter;
import java.util.List;
@ResourceType(name = "RewardExcelConfigData.json")
public class RewardData extends GameResource {
public int rewardId;
@Getter
public List<ItemParamData> rewardItemList;
@Override
@ -14,10 +17,6 @@ public class RewardData extends GameResource {
return rewardId;
}
public List<ItemParamData> getRewardItemList() {
return rewardItemList;
}
@Override
public void onLoad() {
rewardItemList = rewardItemList.stream().filter(i -> i.getId() > 0).toList();

View File

@ -4,26 +4,40 @@ import com.google.gson.annotations.SerializedName;
import emu.grasscutter.data.*;
import emu.grasscutter.data.common.ItemParamData;
import emu.grasscutter.game.shop.ShopInfo;
import lombok.Getter;
import java.util.List;
@ResourceType(name = "ShopGoodsExcelConfigData.json")
public class ShopGoodsData extends GameResource {
@Getter
private int goodsId;
@Getter
private int shopType;
@Getter
private int itemId;
@Getter
private int itemCount;
@Getter
private int costScoin;
@Getter
private int costHcoin;
@Getter
private int costMcoin;
@Getter
private List<ItemParamData> costItems;
@Getter
private int minPlayerLevel;
@Getter
private int maxPlayerLevel;
@Getter
private int buyLimit;
@Getter
@SerializedName(
value = "subTabId",
alternate = {"secondarySheetId"})
@ -32,6 +46,7 @@ public class ShopGoodsData extends GameResource {
private String refreshType;
private transient ShopInfo.ShopRefreshType refreshTypeEnum;
@Getter
private int refreshParam;
@Override
@ -53,59 +68,8 @@ public class ShopGoodsData extends GameResource {
return getGoodsId();
}
public int getGoodsId() {
return goodsId;
}
public int getShopType() {
return shopType;
}
public int getItemId() {
return itemId;
}
public int getItemCount() {
return itemCount;
}
public int getCostScoin() {
return costScoin;
}
public int getCostHcoin() {
return costHcoin;
}
public int getCostMcoin() {
return costMcoin;
}
public List<ItemParamData> getCostItems() {
return costItems;
}
public int getMinPlayerLevel() {
return minPlayerLevel;
}
public int getMaxPlayerLevel() {
return maxPlayerLevel;
}
public int getBuyLimit() {
return buyLimit;
}
public int getSubTabId() {
return subTabId;
}
public ShopInfo.ShopRefreshType getRefreshType() {
return refreshTypeEnum;
}
public int getRefreshParam() {
return refreshParam;
}
}

View File

@ -4,13 +4,14 @@ import emu.grasscutter.data.*;
import emu.grasscutter.data.common.ItemParamData;
import lombok.*;
@Getter
@ResourceType(name = "StatuePromoteExcelConfigData.json")
public class StatuePromoteData extends GameResource {
@Getter @Setter private int level;
@Getter @Setter private int cityId;
@Getter @Setter private ItemParamData[] costItems;
@Getter @Setter private int[] rewardIdList;
@Getter @Setter private int stamina;
@Setter private int level;
@Setter private int cityId;
@Setter private ItemParamData[] costItems;
@Setter private int[] rewardIdList;
@Setter private int stamina;
@Override
public int getId() {

View File

@ -15,9 +15,10 @@ public class ActivityCondExcelConfigData extends GameResource {
LogicType condComb;
List<ActivityConfigCondition> cond;
@Getter
public static class ActivityConfigCondition {
@Getter private ActivityConditions type;
@Getter private List<Integer> param;
private ActivityConditions type;
private List<Integer> param;
public int[] paramArray() {
return param.stream().mapToInt(Integer::intValue).toArray();

View File

@ -5,11 +5,12 @@ import emu.grasscutter.game.shop.ShopType;
import java.util.List;
import lombok.Getter;
@Getter
@ResourceType(name = "ActivityShopOverallExcelConfigData.json")
public class ActivityShopData extends GameResource {
@Getter private int scheduleId;
@Getter private ShopType shopType;
@Getter private List<Integer> sheetList;
private int scheduleId;
private ShopType shopType;
private List<Integer> sheetList;
@Override
public int getId() {

View File

@ -2,14 +2,18 @@ package emu.grasscutter.data.excels.avatar;
import com.google.gson.annotations.SerializedName;
import emu.grasscutter.data.*;
import lombok.Getter;
@ResourceType(name = "AvatarCostumeExcelConfigData.json")
public class AvatarCostumeData extends GameResource {
@SerializedName(value = "skinId", alternate = "costumeId")
private int skinId;
@Getter
private int itemId;
@Getter
private int characterId;
@Getter
private int quality;
@Override
@ -17,18 +21,6 @@ public class AvatarCostumeData extends GameResource {
return this.skinId;
}
public int getItemId() {
return this.itemId;
}
public int getCharacterId() {
return characterId;
}
public int getQuality() {
return quality;
}
@Override
public void onLoad() {
GameData.getAvatarCostumeDataItemIdMap().put(this.getItemId(), this);

View File

@ -2,11 +2,14 @@ package emu.grasscutter.data.excels.avatar;
import emu.grasscutter.data.*;
import emu.grasscutter.data.common.CurveInfo;
import lombok.Getter;
import java.util.*;
import java.util.stream.Stream;
@ResourceType(name = "AvatarCurveExcelConfigData.json")
public class AvatarCurveData extends GameResource {
@Getter
private int level;
private CurveInfo[] curveInfos;
@ -17,10 +20,6 @@ public class AvatarCurveData extends GameResource {
return this.level;
}
public int getLevel() {
return level;
}
public Map<String, Float> getCurveInfos() {
return curveInfoMap;
}

View File

@ -1,10 +1,12 @@
package emu.grasscutter.data.excels.avatar;
import emu.grasscutter.data.*;
import lombok.Getter;
@ResourceType(name = "AvatarFlycloakExcelConfigData.json")
public class AvatarFlycloakData extends GameResource {
private int flycloakId;
@Getter
private long nameTextMapHash;
@Override
@ -12,10 +14,6 @@ public class AvatarFlycloakData extends GameResource {
return this.flycloakId;
}
public long getNameTextMapHash() {
return nameTextMapHash;
}
@Override
public void onLoad() {}
}

View File

@ -1,7 +1,9 @@
package emu.grasscutter.data.excels.avatar;
import emu.grasscutter.data.*;
import lombok.Getter;
@Getter
@ResourceType(name = "AvatarLevelExcelConfigData.json")
public class AvatarLevelData extends GameResource {
private int level;
@ -12,11 +14,4 @@ public class AvatarLevelData extends GameResource {
return this.level;
}
public int getLevel() {
return level;
}
public int getExp() {
return exp;
}
}

View File

@ -2,17 +2,25 @@ package emu.grasscutter.data.excels.avatar;
import emu.grasscutter.data.*;
import emu.grasscutter.data.common.*;
import lombok.Getter;
import java.util.ArrayList;
@ResourceType(name = "AvatarPromoteExcelConfigData.json")
public class AvatarPromoteData extends GameResource {
@Getter
private int avatarPromoteId;
@Getter
private int promoteLevel;
private int scoinCost;
@Getter
private ItemParamData[] costItems;
@Getter
private int unlockMaxLevel;
@Getter
private FightPropData[] addProps;
@Getter
private int requiredPlayerLevel;
@Override
@ -20,34 +28,10 @@ public class AvatarPromoteData extends GameResource {
return (avatarPromoteId << 8) + promoteLevel;
}
public int getAvatarPromoteId() {
return avatarPromoteId;
}
public int getPromoteLevel() {
return promoteLevel;
}
public ItemParamData[] getCostItems() {
return costItems;
}
public int getCoinCost() {
return scoinCost;
}
public FightPropData[] getAddProps() {
return addProps;
}
public int getUnlockMaxLevel() {
return unlockMaxLevel;
}
public int getRequiredPlayerLevel() {
return requiredPlayerLevel;
}
@Override
public void onLoad() {
// Trim item params

View File

@ -3,18 +3,27 @@ package emu.grasscutter.data.excels.avatar;
import emu.grasscutter.data.*;
import emu.grasscutter.data.ResourceType.LoadPriority;
import emu.grasscutter.data.common.FightPropData;
import lombok.Getter;
import java.util.ArrayList;
@ResourceType(name = "AvatarTalentExcelConfigData.json", loadPriority = LoadPriority.HIGHEST)
public class AvatarTalentData extends GameResource {
private int talentId;
private int prevTalent;
@Getter
private long nameTextMapHash;
@Getter
private String icon;
@Getter
private int mainCostItemId;
@Getter
private int mainCostItemCount;
@Getter
private String openConfig;
@Getter
private FightPropData[] addProps;
@Getter
private float[] paramList;
@Override
@ -26,34 +35,6 @@ public class AvatarTalentData extends GameResource {
return prevTalent;
}
public long getNameTextMapHash() {
return nameTextMapHash;
}
public String getIcon() {
return icon;
}
public int getMainCostItemId() {
return mainCostItemId;
}
public int getMainCostItemCount() {
return mainCostItemCount;
}
public String getOpenConfig() {
return openConfig;
}
public FightPropData[] getAddProps() {
return addProps;
}
public float[] getParamList() {
return paramList;
}
@Override
public void onLoad() {
ArrayList<FightPropData> parsed = new ArrayList<>(getAddProps().length);

View File

@ -1,25 +1,15 @@
package emu.grasscutter.data.excels.codex;
import emu.grasscutter.data.*;
import lombok.Getter;
@Getter
@ResourceType(name = {"MaterialCodexExcelConfigData.json"})
public class CodexMaterialData extends GameResource {
private int Id;
private int materialId;
private int sortOrder;
public int getSortOrder() {
return sortOrder;
}
public int getMaterialId() {
return materialId;
}
public int getId() {
return Id;
}
@Override
public void onLoad() {
GameData.getCodexMaterialDataIdMap().put(this.getMaterialId(), this);

View File

@ -1,31 +1,20 @@
package emu.grasscutter.data.excels.codex;
import emu.grasscutter.data.*;
import lombok.Getter;
@ResourceType(name = {"QuestCodexExcelConfigData.json"})
public class CodexQuestData extends GameResource {
@Getter
private int Id;
@Getter
private int parentQuestId;
@Getter
private int chapterId;
@Getter
private int sortOrder;
private boolean isDisuse;
public int getParentQuestId() {
return parentQuestId;
}
public int getId() {
return Id;
}
public int getChapterId() {
return chapterId;
}
public int getSortOrder() {
return sortOrder;
}
public boolean getIsDisuse() {
return isDisuse;
}

View File

@ -1,30 +1,22 @@
package emu.grasscutter.data.excels.codex;
import emu.grasscutter.data.*;
import lombok.Getter;
@ResourceType(name = {"WeaponCodexExcelConfigData.json"})
public class CodexWeaponData extends GameResource {
@Getter
private int Id;
@Getter
private int weaponId;
private int gadgetId;
@Getter
private int sortOrder;
public int getSortOrder() {
return sortOrder;
}
public int getWeaponId() {
return weaponId;
}
public int getGadgetId() {
return weaponId;
}
public int getId() {
return Id;
}
@Override
public void onLoad() {
GameData.getCodexWeaponDataIdMap().put(this.getWeaponId(), this);

View File

@ -9,6 +9,7 @@ import lombok.Getter;
@Getter
@ResourceType(name = "DungeonChallengeConfigData.json")
public class DungeonChallengeConfigData extends GameResource {
@Getter
private int id;
private ChallengeType challengeType;
private boolean noSuccessHint;
@ -42,11 +43,7 @@ public class DungeonChallengeConfigData extends GameResource {
alternate = {"NJBJIKAIENN"})
private AllowAnimationType animationOnSubFail;
public int getId() {
return id;
}
public enum InterruptButtonType {
public enum InterruptButtonType {
INTERRUPT_BUTTON_TYPE_NONE,
INTERRUPT_BUTTON_TYPE_HOST,
INTERRUPT_BUTTON_TYPE_ALL

View File

@ -6,15 +6,17 @@ import emu.grasscutter.game.quest.enums.LogicType;
import java.util.List;
import lombok.*;
@Getter
@ResourceType(name = "DungeonPassExcelConfigData.json")
public class DungeonPassConfigData extends GameResource {
@Getter private int id;
@Getter private LogicType logicType;
@Getter @Setter private List<DungeonPassCondition> conds;
private int id;
private LogicType logicType;
@Setter private List<DungeonPassCondition> conds;
@Getter
public static class DungeonPassCondition {
@Getter private DungeonPassConditionType condType;
@Getter int[] param;
private DungeonPassConditionType condType;
int[] param;
}
@Override

View File

@ -11,32 +11,33 @@ import javax.annotation.*;
import lombok.*;
import lombok.experimental.FieldDefaults;
@Getter
@ResourceType(name = "QuestExcelConfigData.json")
@Getter
@ToString
public class QuestData extends GameResource {
@Getter private int subId;
@Getter private int mainId;
@Getter private int order;
@Getter private long descTextMapHash;
private int subId;
private int mainId;
private int order;
private long descTextMapHash;
@Getter private boolean finishParent;
@Getter private boolean isRewind;
private boolean finishParent;
private boolean isRewind;
@Getter private LogicType acceptCondComb;
@Getter private LogicType finishCondComb;
@Getter private LogicType failCondComb;
private LogicType acceptCondComb;
private LogicType finishCondComb;
private LogicType failCondComb;
@Getter private List<QuestAcceptCondition> acceptCond;
@Getter private List<QuestContentCondition> finishCond;
@Getter private List<QuestContentCondition> failCond;
@Getter private List<QuestExecParam> beginExec;
@Getter private List<QuestExecParam> finishExec;
@Getter private List<QuestExecParam> failExec;
@Getter private Guide guide;
private List<QuestAcceptCondition> acceptCond;
private List<QuestContentCondition> finishCond;
private List<QuestContentCondition> failCond;
private List<QuestExecParam> beginExec;
private List<QuestExecParam> finishExec;
private List<QuestExecParam> failExec;
private Guide guide;
@Getter private List<Integer> trialAvatarList;
@Getter private List<ItemParamData> gainItems;
private List<Integer> trialAvatarList;
private List<ItemParamData> gainItems;
public static String questConditionKey(
@Nonnull Enum<?> type, int firstParam, @Nullable String paramsStr) {

View File

@ -2,12 +2,15 @@ package emu.grasscutter.data.excels.reliquary;
import com.google.gson.annotations.SerializedName;
import emu.grasscutter.data.*;
import lombok.Getter;
@ResourceType(name = "ReliquarySetExcelConfigData.json")
public class ReliquarySetData extends GameResource {
private int setId;
@Getter
private int[] setNeedNum;
@Getter
@SerializedName(
value = "equipAffixId",
alternate = {"EquipAffixId"})
@ -18,14 +21,6 @@ public class ReliquarySetData extends GameResource {
return setId;
}
public int[] getSetNeedNum() {
return setNeedNum;
}
public int getEquipAffixId() {
return equipAffixId;
}
@Override
public void onLoad() {}
}

View File

@ -1,8 +1,11 @@
package emu.grasscutter.data.excels.tower;
import emu.grasscutter.data.*;
import lombok.Getter;
import java.util.List;
@Getter
@ResourceType(name = "TowerScheduleExcelConfigData.json")
public class TowerScheduleData extends GameResource {
private int scheduleId;
@ -22,27 +25,9 @@ public class TowerScheduleData extends GameResource {
this.schedules.stream().filter(item -> !item.getFloorList().isEmpty()).toList();
}
public int getScheduleId() {
return scheduleId;
}
public List<Integer> getEntranceFloorId() {
return entranceFloorId;
}
public List<ScheduleDetail> getSchedules() {
return schedules;
}
public int getMonthlyLevelConfigId() {
return monthlyLevelConfigId;
}
@Getter
public static class ScheduleDetail {
private List<Integer> floorList;
public List<Integer> getFloorList() {
return floorList;
}
}
}

View File

@ -1,7 +1,9 @@
package emu.grasscutter.data.excels.weapon;
import emu.grasscutter.data.*;
import lombok.Getter;
@Getter
@ResourceType(name = "WeaponLevelExcelConfigData.json")
public class WeaponLevelData extends GameResource {
private int level;
@ -12,11 +14,4 @@ public class WeaponLevelData extends GameResource {
return this.level;
}
public int getLevel() {
return level;
}
public int[] getRequiredExps() {
return requiredExps;
}
}

View File

@ -2,8 +2,11 @@ package emu.grasscutter.data.excels.weapon;
import emu.grasscutter.data.*;
import emu.grasscutter.data.common.*;
import lombok.Getter;
import java.util.ArrayList;
@Getter
@ResourceType(name = "WeaponPromoteExcelConfigData.json")
public class WeaponPromoteData extends GameResource {
@ -20,34 +23,6 @@ public class WeaponPromoteData extends GameResource {
return (weaponPromoteId << 8) + promoteLevel;
}
public int getWeaponPromoteId() {
return weaponPromoteId;
}
public int getPromoteLevel() {
return promoteLevel;
}
public ItemParamData[] getCostItems() {
return costItems;
}
public int getCoinCost() {
return coinCost;
}
public FightPropData[] getAddProps() {
return addProps;
}
public int getUnlockMaxLevel() {
return unlockMaxLevel;
}
public int getRequiredPlayerLevel() {
return requiredPlayerLevel;
}
@Override
public void onLoad() {
// Trim item params

View File

@ -4,19 +4,20 @@ import emu.grasscutter.data.*;
import emu.grasscutter.game.props.ClimateType;
import lombok.Getter;
@Getter
@ResourceType(name = "WeatherExcelConfigData.json")
public class WeatherData extends GameResource {
@Getter private int areaID;
@Getter private int weatherAreaId;
@Getter private String maxHeightStr;
@Getter private int gadgetID;
@Getter private boolean isDefaultValid;
@Getter private String templateName;
@Getter private int priority;
@Getter private String profileName;
@Getter private ClimateType defaultClimate;
@Getter private boolean isUseDefault;
@Getter private int sceneID;
private int areaID;
private int weatherAreaId;
private String maxHeightStr;
private int gadgetID;
private boolean isDefaultValid;
private String templateName;
private int priority;
private String profileName;
private ClimateType defaultClimate;
private boolean isUseDefault;
private int sceneID;
@Override
public int getId() {

View File

@ -1,10 +1,12 @@
package emu.grasscutter.data.excels.world;
import emu.grasscutter.data.*;
import lombok.Getter;
@ResourceType(name = "WorldLevelExcelConfigData.json")
public class WorldLevelData extends GameResource {
private int level;
@Getter
private int monsterLevel;
@Override
@ -12,10 +14,6 @@ public class WorldLevelData extends GameResource {
return this.level;
}
public int getMonsterLevel() {
return monsterLevel;
}
@Override
public void onLoad() {}
}

View File

@ -5,12 +5,20 @@ import com.github.davidmoten.rtreemulti.geometry.Geometry;
import emu.grasscutter.Grasscutter;
import emu.grasscutter.game.world.*;
import emu.grasscutter.scripts.SceneIndexManager;
import lombok.Getter;
import java.util.*;
public class Grid {
public transient RTree<Map.Entry<GridPosition, Set<Integer>>, Geometry> gridOptimized = null;
private final transient Set<Integer> nearbyGroups = new HashSet<>(100);
/**
* -- GETTER --
*
* @return The correctly loaded grid map.
*/
@Getter
public Map<GridPosition, Set<Integer>> grid = new LinkedHashMap<>();
/** Creates an optimized cache of the grid. */
@ -23,13 +31,6 @@ public class Grid {
}
}
/**
* @return The correctly loaded grid map.
*/
public Map<GridPosition, Set<Integer>> getGrid() {
return this.grid;
}
public Set<Integer> getNearbyGroups(int vision_level, Position position) {
this.optimize(); // Check to see if the grid is optimized.

View File

@ -11,15 +11,13 @@ import dev.morphia.query.experimental.filters.Filters;
import emu.grasscutter.Grasscutter;
import emu.grasscutter.Grasscutter.ServerRunMode;
import emu.grasscutter.game.Account;
import lombok.Getter;
public final class DatabaseManager {
@Getter
private static Datastore gameDatastore;
private static Datastore dispatchDatastore;
public static Datastore getGameDatastore() {
return gameDatastore;
}
public static Datastore getAccountDatastore() {
if (Grasscutter.getRunMode() == ServerRunMode.HYBRID) return gameDatastore;
else return dispatchDatastore;

View File

@ -7,28 +7,44 @@ import emu.grasscutter.database.DatabaseHelper;
import emu.grasscutter.utils.*;
import java.util.*;
import java.util.stream.Stream;
import lombok.Getter;
import org.bson.Document;
@Entity(value = "accounts", useDiscriminator = false)
public class Account {
@Getter
@Id private String id;
@Getter
@Indexed(options = @IndexOptions(unique = true))
@Collation(locale = "simple", caseLevel = true)
private String username;
@Getter
private String password; // Unused for now
private int reservedPlayerId;
private String email;
@Getter
private String token;
@Getter
private String sessionKey; // Session token for dispatch server
/**
* -- GETTER --
* The collection of a player's permissions.
*/
@Getter
private final List<String> permissions;
@Getter
private Locale locale;
@Getter
private String banReason;
@Getter
private int banEndTime;
@Getter
private int banStartTime;
private boolean isBanned;
@ -64,34 +80,18 @@ public class Account {
return (wildcardParts.length == permissionParts.length);
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public String getToken() {
return token;
}
public void setToken(String token) {
this.token = token;
}
@ -117,44 +117,24 @@ public class Account {
this.email = email;
}
public String getSessionKey() {
return this.sessionKey;
}
public String generateSessionKey() {
this.sessionKey = Utils.bytesToHex(Crypto.createSessionKey(32));
this.save();
return this.sessionKey;
}
public Locale getLocale() {
return locale;
}
public void setLocale(Locale locale) {
this.locale = locale;
}
public String getBanReason() {
return banReason;
}
public void setBanReason(String banReason) {
this.banReason = banReason;
}
public int getBanEndTime() {
return banEndTime;
}
public void setBanEndTime(int banEndTime) {
this.banEndTime = banEndTime;
}
public int getBanStartTime() {
return banStartTime;
}
public void setBanStartTime(int banStartTime) {
this.banStartTime = banStartTime;
}
@ -175,11 +155,6 @@ public class Account {
this.isBanned = isBanned;
}
/** The collection of a player's permissions. */
public List<String> getPermissions() {
return this.permissions;
}
public boolean addPermission(String permission) {
if (this.permissions.contains(permission)) return false;
this.permissions.add(permission);

View File

@ -1,7 +1,9 @@
package emu.grasscutter.game;
import emu.grasscutter.game.player.Player;
import lombok.Getter;
@Getter
public class CoopRequest {
private final Player requester;
private final long requestTime;
@ -13,18 +15,6 @@ public class CoopRequest {
this.expireTime = this.requestTime + 10000;
}
public Player getRequester() {
return requester;
}
public long getRequestTime() {
return requestTime;
}
public long getExpireTime() {
return expireTime;
}
public boolean isExpired() {
return System.currentTimeMillis() > getExpireTime();
}

View File

@ -3,11 +3,12 @@ package emu.grasscutter.game.ability;
import emu.grasscutter.data.binout.*;
import lombok.Getter;
@Getter
public class AbilityModifierController {
@Getter private final Ability ability;
private final Ability ability;
@Getter private final AbilityData abilityData;
@Getter private final AbilityModifier modifierData;
private final AbilityData abilityData;
private final AbilityModifier modifierData;
public AbilityModifierController(
Ability ability, AbilityData abilityData, AbilityModifier modifierData) {

View File

@ -32,13 +32,14 @@ public class AchievementControlReturns {
return new AchievementControlReturns(Return.NOT_YET_ACHIEVED);
}
@Getter
public enum Return {
SUCCESS("commands.achievement.success."),
ACHIEVEMENT_NOT_FOUND("commands.achievement.fail.achievement_not_found"),
ALREADY_ACHIEVED("commands.achievement.fail.already_achieved"),
NOT_YET_ACHIEVED("commands.achievement.fail.not_yet_achieved");
@Getter private final String key;
private final String key;
Return(String key) {
this.key = key;

View File

@ -16,9 +16,10 @@ import java.util.*;
import java.util.stream.Stream;
import lombok.*;
@Getter
@GameActivity(ActivityType.NEW_ACTIVITY_TRIAL_AVATAR)
public class TrialAvatarActivityHandler extends ActivityHandler {
@Getter @Setter private int selectedTrialAvatarIndex;
@Setter private int selectedTrialAvatarIndex;
@Override
public void onInitPlayerActivityData(PlayerActivityData playerActivityData) {

View File

@ -15,10 +15,13 @@ import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap;
import it.unimi.dsi.fastutil.longs.Long2ObjectMap;
import it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap;
import lombok.Getter;
import java.util.Iterator;
import java.util.List;
public class AvatarStorage extends BasePlayerManager implements Iterable<Avatar> {
@Getter
private final Int2ObjectMap<Avatar> avatars;
private final Long2ObjectMap<Avatar> avatarsGuid;
@ -28,10 +31,6 @@ public class AvatarStorage extends BasePlayerManager implements Iterable<Avatar>
this.avatarsGuid = new Long2ObjectOpenHashMap<>();
}
public Int2ObjectMap<Avatar> getAvatars() {
return avatars;
}
public int getAvatarCount() {
return this.avatars.size();
}

View File

@ -4,10 +4,13 @@ import dev.morphia.annotations.*;
import emu.grasscutter.data.GameData;
import emu.grasscutter.data.excels.BattlePassMissionData;
import emu.grasscutter.game.props.BattlePassMissionStatus;
import lombok.Getter;
@Entity
public class BattlePassMission {
@Getter
private int id;
@Getter
private int progress;
private BattlePassMissionStatus status;
@ -20,10 +23,6 @@ public class BattlePassMission {
this.id = id;
}
public int getId() {
return id;
}
public BattlePassMissionData getData() {
if (this.data == null) {
this.data = GameData.getBattlePassMissionDataMap().get(getId());
@ -31,10 +30,6 @@ public class BattlePassMission {
return this.data;
}
public int getProgress() {
return progress;
}
public void setProgress(int value) {
this.progress = value;
}

View File

@ -4,11 +4,15 @@ import dev.morphia.annotations.*;
import emu.grasscutter.data.excels.BattlePassMissionData;
import emu.grasscutter.net.proto.BattlePassRewardTagOuterClass.BattlePassRewardTag;
import emu.grasscutter.net.proto.BattlePassUnlockStatusOuterClass.BattlePassUnlockStatus;
import lombok.Getter;
@Entity
public class BattlePassReward {
@Getter
private int level;
@Getter
private int rewardId;
@Getter
private boolean paid;
@Transient private BattlePassMissionData data;
@ -22,18 +26,6 @@ public class BattlePassReward {
this.paid = paid;
}
public int getLevel() {
return level;
}
public int getRewardId() {
return rewardId;
}
public boolean isPaid() {
return paid;
}
public BattlePassRewardTag toProto() {
var protoBuilder = BattlePassRewardTag.newBuilder();

View File

@ -10,6 +10,8 @@ import emu.grasscutter.server.event.player.PlayerChatEvent;
import emu.grasscutter.server.game.GameServer;
import emu.grasscutter.server.packet.send.*;
import emu.grasscutter.utils.Utils;
import lombok.Getter;
import java.util.*;
import java.util.regex.Pattern;
@ -22,16 +24,13 @@ public class ChatSystem implements ChatSystemHandler {
// user id -> chat partner id -> [messages]
private final Map<Integer, Map<Integer, List<ChatInfo>>> history = new HashMap<>();
@Getter
private final GameServer server;
public ChatSystem(GameServer server) {
this.server = server;
}
public GameServer getServer() {
return server;
}
private boolean tryInvokeCommand(Player sender, Player target, String rawMessage) {
if (!RE_PREFIXES.matcher(rawMessage.substring(0, 1)).matches()) return false;
for (String line : rawMessage.substring(1).split("\n[/!]"))

View File

@ -4,14 +4,15 @@ import dev.morphia.annotations.Entity;
import emu.grasscutter.net.proto.CityInfoOuterClass.CityInfo;
import lombok.*;
@Getter
@Entity
public class CityInfoData {
@Getter @Setter private int cityId;
@Setter private int cityId;
@Getter @Setter
@Setter
private int level = 1; // level of the city (include level SotS, level Frostbearing Trees, etc.)
@Getter @Setter private int numCrystal = 0; // number of crystals in the city
@Setter private int numCrystal = 0; // number of crystals in the city
public CityInfoData(int cityId) {
this.cityId = cityId;

View File

@ -1,42 +1,29 @@
package emu.grasscutter.game.combine;
import emu.grasscutter.data.common.ItemParamData;
import lombok.Getter;
import java.util.List;
@Getter
public class CombineResult {
private List<ItemParamData> material;
private List<ItemParamData> result;
private List<ItemParamData> extra;
private List<ItemParamData> back;
public List<ItemParamData> getMaterial() {
return material;
}
public void setMaterial(List<ItemParamData> material) {
this.material = material;
}
public List<ItemParamData> getResult() {
return result;
}
public void setResult(List<ItemParamData> result) {
this.result = result;
}
public List<ItemParamData> getExtra() {
return extra;
}
public void setExtra(List<ItemParamData> extra) {
this.extra = extra;
}
public List<ItemParamData> getBack() {
return back;
}
public void setBack(List<ItemParamData> back) {
this.back = back;
}

View File

@ -1,23 +1,18 @@
package emu.grasscutter.game.combine;
import lombok.Getter;
import java.util.List;
@Getter
public class ReliquaryDecomposeEntry {
private int configId;
private List<Integer> items;
public int getConfigId() {
return configId;
}
public void setConfigId(int configId) {
this.configId = configId;
}
public List<Integer> getItems() {
return items;
}
public void setItems(List<Integer> items) {
this.items = items;
}

View File

@ -1,5 +1,8 @@
package emu.grasscutter.game.drop;
import lombok.Getter;
@Getter
@Deprecated
public class DropData {
private int minWeight;
@ -10,42 +13,14 @@ public class DropData {
private boolean share = false;
private boolean give = false;
public boolean isGive() {
return give;
}
public void setGive(boolean give) {
this.give = give;
}
public int getItemId() {
return itemId;
}
public void setItemId(int itemId) {
this.itemId = itemId;
}
public int getMinCount() {
return minCount;
}
public int getMaxCount() {
return maxCount;
}
public int getMinWeight() {
return minWeight;
}
public int getMaxWeight() {
return maxWeight;
}
public boolean isShare() {
return share;
}
public void setIsShare(boolean share) {
this.share = share;
}

View File

@ -1,17 +1,13 @@
package emu.grasscutter.game.drop;
import lombok.Getter;
import java.util.List;
@Getter
@SuppressWarnings("deprecation")
public class DropInfo {
private int monsterId;
private List<DropData> dropDataList;
public int getMonsterId() {
return monsterId;
}
public List<DropData> getDropDataList() {
return dropDataList;
}
}

View File

@ -11,8 +11,11 @@ import emu.grasscutter.game.world.*;
import emu.grasscutter.server.game.*;
import emu.grasscutter.utils.Utils;
import it.unimi.dsi.fastutil.ints.*;
import lombok.Getter;
import java.util.List;
@Getter
@SuppressWarnings("deprecation")
public class DropSystemLegacy extends BaseGameSystem {
private final Int2ObjectMap<List<DropData>> dropData;
@ -23,10 +26,6 @@ public class DropSystemLegacy extends BaseGameSystem {
this.load();
}
public Int2ObjectMap<List<DropData>> getDropData() {
return dropData;
}
public synchronized void load() {
getDropData().clear();
try {

View File

@ -1,23 +1,18 @@
package emu.grasscutter.game.dungeons;
import lombok.Getter;
import java.util.List;
@Getter
public class DungeonDrop {
private int dungeonId;
private List<DungeonDropEntry> drops;
public int getDungeonId() {
return dungeonId;
}
public void setDungeonId(int dungeonId) {
this.dungeonId = dungeonId;
}
public List<DungeonDropEntry> getDrops() {
return drops;
}
public void setDrops(List<DungeonDropEntry> drops) {
this.drops = drops;
}

View File

@ -1,7 +1,10 @@
package emu.grasscutter.game.dungeons;
import lombok.Getter;
import java.util.List;
@Getter
public class DungeonDropEntry {
private List<Integer> counts;
private List<Integer> items;
@ -9,42 +12,22 @@ public class DungeonDropEntry {
private List<Integer> itemProbabilities;
private boolean mpDouble;
public List<Integer> getCounts() {
return counts;
}
public void setCounts(List<Integer> counts) {
this.counts = counts;
}
public List<Integer> getItems() {
return items;
}
public void setItems(List<Integer> items) {
this.items = items;
}
public List<Integer> getProbabilities() {
return probabilities;
}
public void setProbabilities(List<Integer> probabilities) {
this.probabilities = probabilities;
}
public List<Integer> getItemProbabilities() {
return itemProbabilities;
}
public void setItemProbabilities(List<Integer> itemProbabilities) {
this.itemProbabilities = itemProbabilities;
}
public boolean isMpDouble() {
return mpDouble;
}
public void setMpDouble(boolean mpDouble) {
this.mpDouble = mpDouble;
}

View File

@ -3,11 +3,12 @@ package emu.grasscutter.game.dungeons;
import emu.grasscutter.game.dungeons.dungeon_results.BaseDungeonResult;
import lombok.Getter;
@Getter
public class DungeonEndStats {
@Getter private final int killedMonsters;
@Getter private final int timeTaken;
@Getter private final int openChestCount;
@Getter private final BaseDungeonResult.DungeonEndReason dungeonResult;
private final int killedMonsters;
private final int timeTaken;
private final int openChestCount;
private final BaseDungeonResult.DungeonEndReason dungeonResult;
public DungeonEndStats(
int killedMonsters,

View File

@ -4,9 +4,11 @@ import emu.grasscutter.game.dungeons.challenge.trigger.ChallengeTrigger;
import emu.grasscutter.game.dungeons.enums.DungeonPassConditionType;
import emu.grasscutter.game.world.Scene;
import emu.grasscutter.scripts.data.SceneGroup;
import lombok.Getter;
import java.util.List;
@Getter
public final class DungeonChallenge extends WorldChallenge {
/**
@ -22,10 +24,6 @@ public final class DungeonChallenge extends WorldChallenge {
super(scene, group, challengeId, challengeIndex, paramList, timeLimit, goal, challengeTriggers);
}
public boolean isStage() {
return stage;
}
public void setStage(boolean stage) {
this.stage = stage;
}

View File

@ -7,9 +7,10 @@ import emu.grasscutter.net.proto.ParamListOuterClass;
import emu.grasscutter.utils.Utils;
import lombok.Getter;
@Getter
public class BaseDungeonResult {
@Getter DungeonData dungeonData;
@Getter DungeonEndStats dungeonStats;
DungeonData dungeonData;
DungeonEndStats dungeonStats;
public BaseDungeonResult(DungeonData dungeonData, DungeonEndStats dungeonStats) {
this.dungeonData = dungeonData;

View File

@ -3,6 +3,7 @@ package emu.grasscutter.game.dungeons.enums;
import emu.grasscutter.scripts.constants.IntValueEnum;
import lombok.Getter;
@Getter
public enum DungeonPassConditionType implements IntValueEnum {
DUNGEON_COND_NONE(0),
DUNGEON_COND_KILL_MONSTER(3),
@ -15,7 +16,7 @@ public enum DungeonPassConditionType implements IntValueEnum {
DUNGEON_COND_END_MULTISTAGE_PLAY(15) // Missing
;
@Getter private final int id;
private final int id;
DungeonPassConditionType(int id) {
this.id = id;

View File

@ -2,6 +2,7 @@ package emu.grasscutter.game.dungeons.enums;
import lombok.Getter;
@Getter
public enum DungeonType {
DUNGEON_NONE(false),
DUNGEON_PLOT(true),
@ -41,7 +42,7 @@ public enum DungeonType {
DUNGEON_EFFIGY_CHALLENGE_V2(false),
DUNGEON_CHAR_AMUSEMENT(false);
@Getter private final boolean countsToBattlepass;
private final boolean countsToBattlepass;
DungeonType(boolean countsToBattlepass) {
this.countsToBattlepass = countsToBattlepass;

View File

@ -2,6 +2,7 @@ package emu.grasscutter.game.dungeons.enums;
import lombok.Getter;
@Getter
public enum SettleShowType {
SETTLE_SHOW_NONE(0),
SETTLE_SHOW_TIME_COST(1),
@ -9,7 +10,7 @@ public enum SettleShowType {
SETTLE_SHOW_KILL_MONSTER_COUNT(3),
SETTLE_SHOW_BLACKSCREEN(4);
@Getter private final int id;
private final int id;
SettleShowType(int id) {
this.id = id;

View File

@ -33,11 +33,12 @@ import emu.grasscutter.utils.helpers.ProtoHelper;
import it.unimi.dsi.fastutil.ints.Int2FloatMap;
import lombok.*;
@Getter
public class EntityAvatar extends GameEntity {
@Getter private final Avatar avatar;
private final Avatar avatar;
@Getter private PlayerDieType killedType;
@Getter private int killedBy;
private PlayerDieType killedType;
private int killedBy;
public EntityAvatar(Avatar avatar) {
this(null, avatar);

View File

@ -26,10 +26,11 @@ import emu.grasscutter.utils.helpers.ProtoHelper;
import it.unimi.dsi.fastutil.ints.Int2FloatMap;
import lombok.Getter;
@Getter
public class EntityItem extends EntityBaseGadget {
@Getter private final GameItem item;
@Getter private final long guid;
@Getter private final boolean share;
private final GameItem item;
private final long guid;
private final boolean share;
public EntityItem(Scene scene, Player player, ItemData itemData, Position pos, int count) {
this(scene, player, itemData, pos, count, true);

View File

@ -6,10 +6,11 @@ import emu.grasscutter.game.world.Scene;
import emu.grasscutter.net.proto.EvtCreateGadgetNotifyOuterClass;
import lombok.Getter;
@Getter
public class EntitySolarIsotomaClientGadget extends EntityClientGadget {
public static final int GADGET_ID = 41038001;
public static final int ELEVATOR_GADGET_ID = 41038002;
@Getter private EntityGadget platformGadget;
private EntityGadget platformGadget;
public EntitySolarIsotomaClientGadget(
Scene scene, Player player, EvtCreateGadgetNotifyOuterClass.EvtCreateGadgetNotify notify) {

View File

@ -7,8 +7,9 @@ import emu.grasscutter.net.proto.SceneEntityInfoOuterClass.SceneEntityInfo;
import it.unimi.dsi.fastutil.ints.*;
import lombok.Getter;
@Getter
public class EntityWorld extends GameEntity {
@Getter private final World world;
private final World world;
public EntityWorld(World world) {
super(null);

View File

@ -4,7 +4,9 @@ import emu.grasscutter.game.entity.EntityGadget;
import emu.grasscutter.game.player.Player;
import emu.grasscutter.net.proto.GadgetInteractReqOuterClass.GadgetInteractReq;
import emu.grasscutter.net.proto.SceneGadgetInfoOuterClass.SceneGadgetInfo;
import lombok.Getter;
@Getter
public abstract class GadgetContent {
private final EntityGadget gadget;
@ -12,10 +14,6 @@ public abstract class GadgetContent {
this.gadget = gadget;
}
public EntityGadget getGadget() {
return gadget;
}
public abstract boolean onInteract(Player player, GadgetInteractReq req);
public abstract void onBuildProto(SceneGadgetInfo.Builder gadgetInfo);

View File

@ -16,8 +16,10 @@ import emu.grasscutter.scripts.constants.EventType;
import emu.grasscutter.scripts.data.ScriptArgs;
import emu.grasscutter.server.packet.send.PacketGadgetInteractRsp;
import emu.grasscutter.utils.Utils;
import lombok.Getter;
public final class GadgetGatherObject extends GadgetContent {
@Getter
private int itemId;
private boolean isForbidGuest;
@ -39,10 +41,6 @@ public final class GadgetGatherObject extends GadgetContent {
}
}
public int getItemId() {
return this.itemId;
}
public boolean isForbidGuest() {
return isForbidGuest;
}

View File

@ -6,12 +6,13 @@ import emu.grasscutter.net.proto.PlatformInfoOuterClass.PlatformInfo;
import emu.grasscutter.scripts.data.SceneGadget;
import lombok.*;
@Getter
public abstract class BaseRoute {
@Getter @Setter private boolean isStarted;
@Getter @Setter private boolean isActive;
@Getter @Setter private Position startRot;
@Getter @Setter private int startSceneTime;
@Getter @Setter private int stopSceneTime;
@Setter private boolean isStarted;
@Setter private boolean isActive;
@Setter private Position startRot;
@Setter private int startSceneTime;
@Setter private int stopSceneTime;
BaseRoute(Position startRot, boolean isStarted, boolean isActive) {
this.startRot = startRot;

View File

@ -6,11 +6,12 @@ import emu.grasscutter.scripts.data.SceneGadget;
import java.util.*;
import lombok.*;
@Getter
public class ConfigRoute extends BaseRoute {
@Getter @Setter private int routeId;
@Getter @Setter private int startIndex;
@Getter @Setter private List<Integer> scheduledIndexes;
@Setter private int routeId;
@Setter private int startIndex;
@Setter private List<Integer> scheduledIndexes;
public ConfigRoute(SceneGadget gadget) {
super(gadget);

View File

@ -6,10 +6,11 @@ import emu.grasscutter.scripts.data.SceneGadget;
import lombok.*;
/** TODO implement point array routes, read from missing resources */
@Getter
public class PointArrayRoute extends BaseRoute {
@Getter @Setter int currentPoint;
@Getter @Setter int pointArrayId;
@Setter int currentPoint;
@Setter int pointArrayId;
public PointArrayRoute(SceneGadget gadget) {
super(gadget);

View File

@ -4,10 +4,11 @@ import emu.grasscutter.game.inventory.GameItem;
import emu.grasscutter.utils.Utils;
import lombok.Getter;
@Getter
public class ExpeditionRewardData {
@Getter private int itemId;
@Getter private int minCount;
@Getter private int maxCount;
private int itemId;
private int minCount;
private int maxCount;
public GameItem getReward() {
return new GameItem(itemId, Utils.randomRange(minCount, maxCount));

View File

@ -4,9 +4,10 @@ import emu.grasscutter.game.inventory.GameItem;
import java.util.*;
import lombok.Getter;
@Getter
public class ExpeditionRewardDataList {
@Getter private int hourTime;
@Getter private List<ExpeditionRewardData> expeditionRewardData;
private int hourTime;
private List<ExpeditionRewardData> expeditionRewardData;
public List<GameItem> getRewards() {
List<GameItem> rewards = new ArrayList<>();

View File

@ -3,7 +3,8 @@ package emu.grasscutter.game.expedition;
import java.util.List;
import lombok.Getter;
@Getter
public class ExpeditionRewardInfo {
@Getter private int expId;
@Getter private List<ExpeditionRewardDataList> expeditionRewardDataList;
private int expId;
private List<ExpeditionRewardDataList> expeditionRewardDataList;
}

View File

@ -7,17 +7,22 @@ import emu.grasscutter.net.proto.FriendBriefOuterClass.FriendBrief;
import emu.grasscutter.net.proto.FriendOnlineStateOuterClass.FriendOnlineState;
import emu.grasscutter.net.proto.PlatformTypeOuterClass;
import emu.grasscutter.net.proto.ProfilePictureOuterClass.ProfilePicture;
import lombok.Getter;
import org.bson.types.ObjectId;
@Entity(value = "friendships", useDiscriminator = false)
public class Friendship {
@Id private ObjectId id;
@Getter
@Transient private Player owner;
@Getter
@Indexed private int ownerId;
@Getter
@Indexed private int friendId;
private boolean isFriend;
@Getter
private int askerId;
private PlayerProfile profile;
@ -33,10 +38,6 @@ public class Friendship {
this.askerId = asker.getUid();
}
public Player getOwner() {
return owner;
}
public void setOwner(Player owner) {
this.owner = owner;
}
@ -49,18 +50,6 @@ public class Friendship {
this.isFriend = b;
}
public int getOwnerId() {
return ownerId;
}
public int getFriendId() {
return friendId;
}
public int getAskerId() {
return askerId;
}
public void setAskerId(int askerId) {
this.askerId = askerId;
}

View File

@ -2,8 +2,11 @@ package emu.grasscutter.game.gacha;
import dev.morphia.annotations.*;
import java.util.Date;
import lombok.Getter;
import org.bson.types.ObjectId;
@Getter
@Entity(value = "gachas", useDiscriminator = false)
public class GachaRecord {
@Id private ObjectId id;
@ -23,42 +26,22 @@ public class GachaRecord {
this.gachaType = gachaType;
}
public int getOwnerId() {
return ownerId;
}
public void setOwnerId(int ownerId) {
this.ownerId = ownerId;
}
public int getGachaType() {
return gachaType;
}
public void setGachaType(int type) {
this.gachaType = type;
}
public Date getTransactionDate() {
return transactionDate;
}
public void setTransactionDate(Date transactionDate) {
this.transactionDate = transactionDate;
}
public int getItemID() {
return itemID;
}
public void setItemID(int itemID) {
this.itemID = itemID;
}
public ObjectId getId() {
return id;
}
public void setId(ObjectId id) {
this.id = id;
}

View File

@ -26,11 +26,14 @@ import it.unimi.dsi.fastutil.ints.*;
import java.nio.file.*;
import java.util.*;
import java.util.concurrent.ThreadLocalRandom;
import lombok.Getter;
import org.greenrobot.eventbus.Subscribe;
public class GachaSystem extends BaseGameSystem {
private static final int starglitterId = 221;
private static final int stardustId = 222;
@Getter
private final Int2ObjectMap<GachaBanner> gachaBanners;
private WatchService watchService;
@ -41,10 +44,6 @@ public class GachaSystem extends BaseGameSystem {
this.startWatcher(server);
}
public Int2ObjectMap<GachaBanner> getGachaBanners() {
return gachaBanners;
}
public int randomRange(int min, int max) { // Both are inclusive
return ThreadLocalRandom.current().nextInt(max - min + 1) + min;
}

View File

@ -5,6 +5,7 @@ import java.util.*;
import java.util.stream.Stream;
import lombok.*;
@Getter
@RequiredArgsConstructor
public enum BagTab {
TAB_NONE(0),
@ -30,7 +31,7 @@ public enum BagTab {
});
}
@Getter private final int value;
private final int value;
/**
* Fetches the bag tab by its value.

View File

@ -5,6 +5,7 @@ import java.util.*;
import java.util.stream.Stream;
import lombok.Getter;
@Getter
public enum EquipType {
EQUIP_NONE(0),
EQUIP_BRACER(1),
@ -26,7 +27,7 @@ public enum EquipType {
});
}
@Getter private final int value;
private final int value;
EquipType(int value) {
this.value = value;

View File

@ -28,6 +28,7 @@ import org.bson.types.ObjectId;
@Entity(value = "items", useDiscriminator = false)
public class GameItem {
@Id private ObjectId id;
@Getter
@Indexed private int ownerId;
@Getter @Setter private int itemId;
@Getter @Setter private int count;
@ -112,10 +113,6 @@ public class GameItem {
}
}
public int getOwnerId() {
return ownerId;
}
public void setOwner(Player player) {
this.ownerId = player.getUid();
this.guid = player.getNextGameGuid();

View File

@ -21,10 +21,13 @@ import it.unimi.dsi.fastutil.ints.*;
import it.unimi.dsi.fastutil.longs.*;
import java.util.*;
import javax.annotation.Nullable;
import lombok.Getter;
import lombok.val;
public class Inventory extends BasePlayerManager implements Iterable<GameItem> {
private final Long2ObjectMap<GameItem> store;
@Getter
private final Int2ObjectMap<InventoryTab> inventoryTypes;
public Inventory(Player player) {
@ -50,10 +53,6 @@ public class Inventory extends BasePlayerManager implements Iterable<GameItem> {
return store;
}
public Int2ObjectMap<InventoryTab> getInventoryTypes() {
return inventoryTypes;
}
public InventoryTab getInventoryTab(ItemType type) {
return getInventoryTypes().get(type.getValue());
}

View File

@ -1,5 +1,8 @@
package emu.grasscutter.game.inventory;
import lombok.Getter;
@Getter
public class ItemDef {
private int itemId;
private int count;
@ -9,18 +12,10 @@ public class ItemDef {
this.count = count;
}
public int getItemId() {
return itemId;
}
public void setItemId(int itemId) {
this.itemId = itemId;
}
public int getCount() {
return count;
}
public void setCount(int count) {
this.count = count;
}

View File

@ -5,6 +5,7 @@ import java.util.*;
import java.util.stream.Stream;
import lombok.Getter;
@Getter
public enum ItemQuality {
QUALITY_NONE(0),
QUALITY_WHITE(1),
@ -26,7 +27,7 @@ public enum ItemQuality {
});
}
@Getter private final int value;
private final int value;
ItemQuality(int value) {
this.value = value;

View File

@ -5,6 +5,7 @@ import java.util.*;
import java.util.stream.Stream;
import lombok.Getter;
@Getter
public enum ItemType {
ITEM_NONE(0),
ITEM_VIRTUAL(1),
@ -26,7 +27,7 @@ public enum ItemType {
});
}
@Getter private final int value;
private final int value;
ItemType(int value) {
this.value = value;

View File

@ -5,6 +5,7 @@ import java.util.*;
import java.util.stream.Stream;
import lombok.Getter;
@Getter
public enum MaterialType {
MATERIAL_NONE(0),
MATERIAL_FOOD(1),
@ -60,7 +61,7 @@ public enum MaterialType {
});
}
@Getter private final int value;
private final int value;
MaterialType(int value) {
this.value = value;

View File

@ -11,11 +11,15 @@ import emu.grasscutter.net.proto.MailCollectStateOuterClass.MailCollectState;
import emu.grasscutter.net.proto.MailTextContentOuterClass.MailTextContent;
import java.time.Instant;
import java.util.*;
import lombok.Getter;
import org.bson.types.ObjectId;
@Entity(value = "mail", useDiscriminator = false)
public final class Mail {
@Getter
@Id private ObjectId id;
@Getter
@Indexed private int ownerUid;
public final MailContent mailContent;
public final List<MailItem> itemList;
@ -59,14 +63,6 @@ public final class Mail {
this.stateValue = state; // Different mailboxes, 1 = Default, 3 = Gift-box.
}
public ObjectId getId() {
return id;
}
public int getOwnerUid() {
return ownerUid;
}
public void setOwnerUid(int ownerUid) {
this.ownerUid = ownerUid;
}

View File

@ -5,8 +5,11 @@ import emu.grasscutter.database.DatabaseHelper;
import emu.grasscutter.game.player.*;
import emu.grasscutter.server.event.player.PlayerReceiveMailEvent;
import emu.grasscutter.server.packet.send.*;
import lombok.Getter;
import java.util.*;
@Getter
public class MailHandler extends BasePlayerManager {
private final List<Mail> mail;
@ -16,10 +19,6 @@ public class MailHandler extends BasePlayerManager {
this.mail = new ArrayList<>();
}
public List<Mail> getMail() {
return mail;
}
// ---------------------MAIL------------------------
public void sendMail(Mail message) {

View File

@ -8,12 +8,16 @@ import emu.grasscutter.game.props.FightProperty;
import emu.grasscutter.game.world.*;
import emu.grasscutter.scripts.data.*;
import emu.grasscutter.utils.Utils;
import lombok.Getter;
import java.util.*;
public final class BlossomActivity {
private final SceneGroup tempSceneGroup;
@Getter
private final WorldChallenge challenge;
@Getter
private final EntityGadget gadget;
private EntityGadget chest;
private int step;
@ -49,10 +53,6 @@ public final class BlossomActivity {
// this.challengeTriggers.add(new InTimeTrigger());
}
public WorldChallenge getChallenge() {
return this.challenge;
}
public void setMonsters(List<EntityMonster> monsters) {
this.activeMonsters.clear();
this.activeMonsters.addAll(monsters);
@ -119,10 +119,6 @@ public final class BlossomActivity {
}
}
public EntityGadget getGadget() {
return gadget;
}
public EntityGadget getChest() {
if (chest == null) {
EntityGadget rewardGadget =

View File

@ -3,9 +3,10 @@ package emu.grasscutter.game.managers.blossom;
import java.util.*;
import lombok.Getter;
@Getter
public class BlossomConfig {
@Getter private int monsterFightingVolume;
private int monsterFightingVolume;
// @Getter private Int2ObjectMap<IntList> monsterIdsPerDifficulty; // Need to wrangle Gson for
// this
@Getter private Map<Integer, List<Integer>> monsterIdsPerDifficulty;
private Map<Integer, List<Integer>> monsterIdsPerDifficulty;
}

View File

@ -5,6 +5,7 @@ import it.unimi.dsi.fastutil.ints.*;
import java.util.stream.*;
import lombok.Getter;
@Getter
public enum BlossomType {
GOLD(70360056, 101001001, 1),
BLUE(70360057, 101002003, 2);
@ -12,9 +13,9 @@ public enum BlossomType {
private static final Int2ObjectMap<BlossomType> map =
new Int2ObjectOpenHashMap<>(
Stream.of(values()).collect(Collectors.toMap(BlossomType::getGadgetId, x -> x)));
@Getter private final int gadgetId;
@Getter private final int circleCampId;
@Getter private final int blossomChestId;
private final int gadgetId;
private final int circleCampId;
private final int blossomChestId;
BlossomType(int gadgetId, int circleCampId, int blossomChestId) {
this.gadgetId = gadgetId;

Some files were not shown because too many files have changed in this diff Show More