diff --git a/src/main/java/emu/grasscutter/data/binout/AbilityEmbryoEntry.java b/src/main/java/emu/grasscutter/data/binout/AbilityEmbryoEntry.java index 43d5471c5..a7b1ee98a 100644 --- a/src/main/java/emu/grasscutter/data/binout/AbilityEmbryoEntry.java +++ b/src/main/java/emu/grasscutter/data/binout/AbilityEmbryoEntry.java @@ -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; - } } diff --git a/src/main/java/emu/grasscutter/data/binout/AbilityModifierEntry.java b/src/main/java/emu/grasscutter/data/binout/AbilityModifierEntry.java index 9087b94cc..8787b5304 100644 --- a/src/main/java/emu/grasscutter/data/binout/AbilityModifierEntry.java +++ b/src/main/java/emu/grasscutter/data/binout/AbilityModifierEntry.java @@ -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 onModifierAdded; + @Getter public final List onThinkInterval; + @Getter public final List 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 getOnAdded() { return onModifierAdded; } - public List getOnThinkInterval() { - return onThinkInterval; - } - - public List getOnRemoved() { - return onRemoved; - } } diff --git a/src/main/java/emu/grasscutter/data/binout/MainQuestData.java b/src/main/java/emu/grasscutter/data/binout/MainQuestData.java index da7b589c7..72e427294 100644 --- a/src/main/java/emu/grasscutter/data/binout/MainQuestData.java +++ b/src/main/java/emu/grasscutter/data/binout/MainQuestData.java @@ -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 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 getTalks() { - return talks; - } - public void onLoad() { if (this.talks == null) this.talks = new ArrayList<>(); if (this.subQuests == null) this.subQuests = new SubQuestData[0]; diff --git a/src/main/java/emu/grasscutter/data/binout/OpenConfigEntry.java b/src/main/java/emu/grasscutter/data/binout/OpenConfigEntry.java index c5f9c1a40..21a301207 100644 --- a/src/main/java/emu/grasscutter/data/binout/OpenConfigEntry.java +++ b/src/main/java/emu/grasscutter/data/binout/OpenConfigEntry.java @@ -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; - } } } diff --git a/src/main/java/emu/grasscutter/data/binout/ScenePointEntry.java b/src/main/java/emu/grasscutter/data/binout/ScenePointEntry.java index 3ca40f32e..4b9d805b0 100644 --- a/src/main/java/emu/grasscutter/data/binout/ScenePointEntry.java +++ b/src/main/java/emu/grasscutter/data/binout/ScenePointEntry.java @@ -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) { diff --git a/src/main/java/emu/grasscutter/data/binout/config/ConfigLevelEntity.java b/src/main/java/emu/grasscutter/data/binout/config/ConfigLevelEntity.java index 9afe5a5d1..fc63f002b 100644 --- a/src/main/java/emu/grasscutter/data/binout/config/ConfigLevelEntity.java +++ b/src/main/java/emu/grasscutter/data/binout/config/ConfigLevelEntity.java @@ -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 abilities; - @Getter private List monsterAbilities; - @Getter private List avatarAbilities; - @Getter private List teamAbilities; - @Getter private List preloadMonsterEntityIDs; + private List abilities; + private List monsterAbilities; + private List avatarAbilities; + private List teamAbilities; + private List preloadMonsterEntityIDs; - @Getter private String dropElemControlType; + private String dropElemControlType; } diff --git a/src/main/java/emu/grasscutter/data/binout/routes/RotAngleType.java b/src/main/java/emu/grasscutter/data/binout/routes/RotAngleType.java index cd8287a72..4116be5c8 100644 --- a/src/main/java/emu/grasscutter/data/binout/routes/RotAngleType.java +++ b/src/main/java/emu/grasscutter/data/binout/routes/RotAngleType.java @@ -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; diff --git a/src/main/java/emu/grasscutter/data/binout/routes/RouteType.java b/src/main/java/emu/grasscutter/data/binout/routes/RouteType.java index 55b4cd04b..558b23e0d 100644 --- a/src/main/java/emu/grasscutter/data/binout/routes/RouteType.java +++ b/src/main/java/emu/grasscutter/data/binout/routes/RouteType.java @@ -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; diff --git a/src/main/java/emu/grasscutter/data/common/CurveInfo.java b/src/main/java/emu/grasscutter/data/common/CurveInfo.java index d9f814723..ffb6ae2be 100644 --- a/src/main/java/emu/grasscutter/data/common/CurveInfo.java +++ b/src/main/java/emu/grasscutter/data/common/CurveInfo.java @@ -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; - } } diff --git a/src/main/java/emu/grasscutter/data/common/FightPropData.java b/src/main/java/emu/grasscutter/data/common/FightPropData.java index cdc634a39..9bc31f781 100644 --- a/src/main/java/emu/grasscutter/data/common/FightPropData.java +++ b/src/main/java/emu/grasscutter/data/common/FightPropData.java @@ -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); } diff --git a/src/main/java/emu/grasscutter/data/common/ItemParamData.java b/src/main/java/emu/grasscutter/data/common/ItemParamData.java index c77235976..e1d768ae3 100644 --- a/src/main/java/emu/grasscutter/data/common/ItemParamData.java +++ b/src/main/java/emu/grasscutter/data/common/ItemParamData.java @@ -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; } diff --git a/src/main/java/emu/grasscutter/data/common/ItemParamStringData.java b/src/main/java/emu/grasscutter/data/common/ItemParamStringData.java index 7f864fc9e..dbb3cc2da 100644 --- a/src/main/java/emu/grasscutter/data/common/ItemParamStringData.java +++ b/src/main/java/emu/grasscutter/data/common/ItemParamStringData.java @@ -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(";"); diff --git a/src/main/java/emu/grasscutter/data/common/ItemUseData.java b/src/main/java/emu/grasscutter/data/common/ItemUseData.java index e1af1a0b2..bd09ca4d8 100644 --- a/src/main/java/emu/grasscutter/data/common/ItemUseData.java +++ b/src/main/java/emu/grasscutter/data/common/ItemUseData.java @@ -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; - } } diff --git a/src/main/java/emu/grasscutter/data/common/OpenCondData.java b/src/main/java/emu/grasscutter/data/common/OpenCondData.java index b379106a8..8627c681f 100644 --- a/src/main/java/emu/grasscutter/data/common/OpenCondData.java +++ b/src/main/java/emu/grasscutter/data/common/OpenCondData.java @@ -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 paramList; - public String getCondType() { - return condType; - } - public void setCondType(String cType) { condType = cType; } - public List getParamList() { - return paramList; - } - public void setParamList(List pList) { paramList = pList; } diff --git a/src/main/java/emu/grasscutter/data/common/PropGrowCurve.java b/src/main/java/emu/grasscutter/data/common/PropGrowCurve.java index d7951917d..8c60834b2 100644 --- a/src/main/java/emu/grasscutter/data/common/PropGrowCurve.java +++ b/src/main/java/emu/grasscutter/data/common/PropGrowCurve.java @@ -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; - } } diff --git a/src/main/java/emu/grasscutter/data/excels/CombineData.java b/src/main/java/emu/grasscutter/data/excels/CombineData.java index b44305589..d15de8ff2 100644 --- a/src/main/java/emu/grasscutter/data/excels/CombineData.java +++ b/src/main/java/emu/grasscutter/data/excels/CombineData.java @@ -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 randomItems; + @Getter private List 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 getRandomItems() { - return randomItems; - } - - public List getMaterialItems() { - return materialItems; - } - - public String getRecipeType() { - return recipeType; - } } diff --git a/src/main/java/emu/grasscutter/data/excels/CookBonusData.java b/src/main/java/emu/grasscutter/data/excels/CookBonusData.java index 1a2de3884..b02cb7945 100644 --- a/src/main/java/emu/grasscutter/data/excels/CookBonusData.java +++ b/src/main/java/emu/grasscutter/data/excels/CookBonusData.java @@ -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]; } diff --git a/src/main/java/emu/grasscutter/data/excels/EnvAnimalGatherConfigData.java b/src/main/java/emu/grasscutter/data/excels/EnvAnimalGatherConfigData.java index 002c75141..9612eb3ed 100644 --- a/src/main/java/emu/grasscutter/data/excels/EnvAnimalGatherConfigData.java +++ b/src/main/java/emu/grasscutter/data/excels/EnvAnimalGatherConfigData.java @@ -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 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; } diff --git a/src/main/java/emu/grasscutter/data/excels/EquipAffixData.java b/src/main/java/emu/grasscutter/data/excels/EquipAffixData.java index d95fb6154..194ef810f 100644 --- a/src/main/java/emu/grasscutter/data/excels/EquipAffixData.java +++ b/src/main/java/emu/grasscutter/data/excels/EquipAffixData.java @@ -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 parsed = new ArrayList<>(getAddProps().length); diff --git a/src/main/java/emu/grasscutter/data/excels/FetterCharacterCardData.java b/src/main/java/emu/grasscutter/data/excels/FetterCharacterCardData.java index bdd7fa441..7097e7c7c 100644 --- a/src/main/java/emu/grasscutter/data/excels/FetterCharacterCardData.java +++ b/src/main/java/emu/grasscutter/data/excels/FetterCharacterCardData.java @@ -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() {} } diff --git a/src/main/java/emu/grasscutter/data/excels/FetterData.java b/src/main/java/emu/grasscutter/data/excels/FetterData.java index 08eea561c..94c42c217 100644 --- a/src/main/java/emu/grasscutter/data/excels/FetterData.java +++ b/src/main/java/emu/grasscutter/data/excels/FetterData.java @@ -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 openCond; @@ -24,10 +27,6 @@ public class FetterData extends GameResource { return fetterId; } - public int getAvatarId() { - return avatarId; - } - public List getOpenConds() { return openCond; } diff --git a/src/main/java/emu/grasscutter/data/excels/GatherData.java b/src/main/java/emu/grasscutter/data/excels/GatherData.java index a9129be66..716974af9 100644 --- a/src/main/java/emu/grasscutter/data/excels/GatherData.java +++ b/src/main/java/emu/grasscutter/data/excels/GatherData.java @@ -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; } diff --git a/src/main/java/emu/grasscutter/data/excels/OpenStateData.java b/src/main/java/emu/grasscutter/data/excels/OpenStateData.java index 9d8d187c3..6c4dc0cdb 100644 --- a/src/main/java/emu/grasscutter/data/excels/OpenStateData.java +++ b/src/main/java/emu/grasscutter/data/excels/OpenStateData.java @@ -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; } } diff --git a/src/main/java/emu/grasscutter/data/excels/RefreshPolicyExcelConfigData.java b/src/main/java/emu/grasscutter/data/excels/RefreshPolicyExcelConfigData.java index 6429728f8..6c48ec1b2 100644 --- a/src/main/java/emu/grasscutter/data/excels/RefreshPolicyExcelConfigData.java +++ b/src/main/java/emu/grasscutter/data/excels/RefreshPolicyExcelConfigData.java @@ -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 list, int low, int high, int value) { while (low < high) { diff --git a/src/main/java/emu/grasscutter/data/excels/RewardData.java b/src/main/java/emu/grasscutter/data/excels/RewardData.java index 1b817aec2..ecf799e05 100644 --- a/src/main/java/emu/grasscutter/data/excels/RewardData.java +++ b/src/main/java/emu/grasscutter/data/excels/RewardData.java @@ -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 rewardItemList; @Override @@ -14,10 +17,6 @@ public class RewardData extends GameResource { return rewardId; } - public List getRewardItemList() { - return rewardItemList; - } - @Override public void onLoad() { rewardItemList = rewardItemList.stream().filter(i -> i.getId() > 0).toList(); diff --git a/src/main/java/emu/grasscutter/data/excels/ShopGoodsData.java b/src/main/java/emu/grasscutter/data/excels/ShopGoodsData.java index 5c1482f4d..697ea74a3 100644 --- a/src/main/java/emu/grasscutter/data/excels/ShopGoodsData.java +++ b/src/main/java/emu/grasscutter/data/excels/ShopGoodsData.java @@ -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 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 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; - } } diff --git a/src/main/java/emu/grasscutter/data/excels/StatuePromoteData.java b/src/main/java/emu/grasscutter/data/excels/StatuePromoteData.java index fd3afc8eb..32d3f205d 100644 --- a/src/main/java/emu/grasscutter/data/excels/StatuePromoteData.java +++ b/src/main/java/emu/grasscutter/data/excels/StatuePromoteData.java @@ -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() { diff --git a/src/main/java/emu/grasscutter/data/excels/activity/ActivityCondExcelConfigData.java b/src/main/java/emu/grasscutter/data/excels/activity/ActivityCondExcelConfigData.java index ebb1d3c4f..afe41f20e 100644 --- a/src/main/java/emu/grasscutter/data/excels/activity/ActivityCondExcelConfigData.java +++ b/src/main/java/emu/grasscutter/data/excels/activity/ActivityCondExcelConfigData.java @@ -15,9 +15,10 @@ public class ActivityCondExcelConfigData extends GameResource { LogicType condComb; List cond; + @Getter public static class ActivityConfigCondition { - @Getter private ActivityConditions type; - @Getter private List param; + private ActivityConditions type; + private List param; public int[] paramArray() { return param.stream().mapToInt(Integer::intValue).toArray(); diff --git a/src/main/java/emu/grasscutter/data/excels/activity/ActivityShopData.java b/src/main/java/emu/grasscutter/data/excels/activity/ActivityShopData.java index 0f8d2ceb2..56af01206 100644 --- a/src/main/java/emu/grasscutter/data/excels/activity/ActivityShopData.java +++ b/src/main/java/emu/grasscutter/data/excels/activity/ActivityShopData.java @@ -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 sheetList; + private int scheduleId; + private ShopType shopType; + private List sheetList; @Override public int getId() { diff --git a/src/main/java/emu/grasscutter/data/excels/avatar/AvatarCostumeData.java b/src/main/java/emu/grasscutter/data/excels/avatar/AvatarCostumeData.java index 9468a4c57..47b4db756 100644 --- a/src/main/java/emu/grasscutter/data/excels/avatar/AvatarCostumeData.java +++ b/src/main/java/emu/grasscutter/data/excels/avatar/AvatarCostumeData.java @@ -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); diff --git a/src/main/java/emu/grasscutter/data/excels/avatar/AvatarCurveData.java b/src/main/java/emu/grasscutter/data/excels/avatar/AvatarCurveData.java index 6b58a711b..5b201156f 100644 --- a/src/main/java/emu/grasscutter/data/excels/avatar/AvatarCurveData.java +++ b/src/main/java/emu/grasscutter/data/excels/avatar/AvatarCurveData.java @@ -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 getCurveInfos() { return curveInfoMap; } diff --git a/src/main/java/emu/grasscutter/data/excels/avatar/AvatarFlycloakData.java b/src/main/java/emu/grasscutter/data/excels/avatar/AvatarFlycloakData.java index dda483808..8799c1ba6 100644 --- a/src/main/java/emu/grasscutter/data/excels/avatar/AvatarFlycloakData.java +++ b/src/main/java/emu/grasscutter/data/excels/avatar/AvatarFlycloakData.java @@ -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() {} } diff --git a/src/main/java/emu/grasscutter/data/excels/avatar/AvatarLevelData.java b/src/main/java/emu/grasscutter/data/excels/avatar/AvatarLevelData.java index 1eae299e3..a2d30b13d 100644 --- a/src/main/java/emu/grasscutter/data/excels/avatar/AvatarLevelData.java +++ b/src/main/java/emu/grasscutter/data/excels/avatar/AvatarLevelData.java @@ -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; - } } diff --git a/src/main/java/emu/grasscutter/data/excels/avatar/AvatarPromoteData.java b/src/main/java/emu/grasscutter/data/excels/avatar/AvatarPromoteData.java index 8972de6e9..b871929fc 100644 --- a/src/main/java/emu/grasscutter/data/excels/avatar/AvatarPromoteData.java +++ b/src/main/java/emu/grasscutter/data/excels/avatar/AvatarPromoteData.java @@ -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 diff --git a/src/main/java/emu/grasscutter/data/excels/avatar/AvatarTalentData.java b/src/main/java/emu/grasscutter/data/excels/avatar/AvatarTalentData.java index 5f91ca3c3..291f75877 100644 --- a/src/main/java/emu/grasscutter/data/excels/avatar/AvatarTalentData.java +++ b/src/main/java/emu/grasscutter/data/excels/avatar/AvatarTalentData.java @@ -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 parsed = new ArrayList<>(getAddProps().length); diff --git a/src/main/java/emu/grasscutter/data/excels/codex/CodexMaterialData.java b/src/main/java/emu/grasscutter/data/excels/codex/CodexMaterialData.java index ee14db8e2..fa28411dc 100644 --- a/src/main/java/emu/grasscutter/data/excels/codex/CodexMaterialData.java +++ b/src/main/java/emu/grasscutter/data/excels/codex/CodexMaterialData.java @@ -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); diff --git a/src/main/java/emu/grasscutter/data/excels/codex/CodexQuestData.java b/src/main/java/emu/grasscutter/data/excels/codex/CodexQuestData.java index 1b373bfbe..547d89f8b 100644 --- a/src/main/java/emu/grasscutter/data/excels/codex/CodexQuestData.java +++ b/src/main/java/emu/grasscutter/data/excels/codex/CodexQuestData.java @@ -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; } diff --git a/src/main/java/emu/grasscutter/data/excels/codex/CodexWeaponData.java b/src/main/java/emu/grasscutter/data/excels/codex/CodexWeaponData.java index 7d585839e..a7124bda1 100644 --- a/src/main/java/emu/grasscutter/data/excels/codex/CodexWeaponData.java +++ b/src/main/java/emu/grasscutter/data/excels/codex/CodexWeaponData.java @@ -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); diff --git a/src/main/java/emu/grasscutter/data/excels/dungeon/DungeonChallengeConfigData.java b/src/main/java/emu/grasscutter/data/excels/dungeon/DungeonChallengeConfigData.java index 12f81f303..fd9722f1f 100644 --- a/src/main/java/emu/grasscutter/data/excels/dungeon/DungeonChallengeConfigData.java +++ b/src/main/java/emu/grasscutter/data/excels/dungeon/DungeonChallengeConfigData.java @@ -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 diff --git a/src/main/java/emu/grasscutter/data/excels/dungeon/DungeonPassConfigData.java b/src/main/java/emu/grasscutter/data/excels/dungeon/DungeonPassConfigData.java index 4c92c341b..6d1c3d7f9 100644 --- a/src/main/java/emu/grasscutter/data/excels/dungeon/DungeonPassConfigData.java +++ b/src/main/java/emu/grasscutter/data/excels/dungeon/DungeonPassConfigData.java @@ -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 conds; + private int id; + private LogicType logicType; + @Setter private List conds; + @Getter public static class DungeonPassCondition { - @Getter private DungeonPassConditionType condType; - @Getter int[] param; + private DungeonPassConditionType condType; + int[] param; } @Override diff --git a/src/main/java/emu/grasscutter/data/excels/quest/QuestData.java b/src/main/java/emu/grasscutter/data/excels/quest/QuestData.java index a0463f6d1..7b0174136 100644 --- a/src/main/java/emu/grasscutter/data/excels/quest/QuestData.java +++ b/src/main/java/emu/grasscutter/data/excels/quest/QuestData.java @@ -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 acceptCond; - @Getter private List finishCond; - @Getter private List failCond; - @Getter private List beginExec; - @Getter private List finishExec; - @Getter private List failExec; - @Getter private Guide guide; + private List acceptCond; + private List finishCond; + private List failCond; + private List beginExec; + private List finishExec; + private List failExec; + private Guide guide; - @Getter private List trialAvatarList; - @Getter private List gainItems; + private List trialAvatarList; + private List gainItems; public static String questConditionKey( @Nonnull Enum type, int firstParam, @Nullable String paramsStr) { diff --git a/src/main/java/emu/grasscutter/data/excels/reliquary/ReliquarySetData.java b/src/main/java/emu/grasscutter/data/excels/reliquary/ReliquarySetData.java index 022d2997e..153c0777e 100644 --- a/src/main/java/emu/grasscutter/data/excels/reliquary/ReliquarySetData.java +++ b/src/main/java/emu/grasscutter/data/excels/reliquary/ReliquarySetData.java @@ -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() {} } diff --git a/src/main/java/emu/grasscutter/data/excels/tower/TowerScheduleData.java b/src/main/java/emu/grasscutter/data/excels/tower/TowerScheduleData.java index 7652e644b..321d04e62 100644 --- a/src/main/java/emu/grasscutter/data/excels/tower/TowerScheduleData.java +++ b/src/main/java/emu/grasscutter/data/excels/tower/TowerScheduleData.java @@ -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 getEntranceFloorId() { - return entranceFloorId; - } - - public List getSchedules() { - return schedules; - } - - public int getMonthlyLevelConfigId() { - return monthlyLevelConfigId; - } - + @Getter public static class ScheduleDetail { private List floorList; - public List getFloorList() { - return floorList; - } } } diff --git a/src/main/java/emu/grasscutter/data/excels/weapon/WeaponLevelData.java b/src/main/java/emu/grasscutter/data/excels/weapon/WeaponLevelData.java index a35b9b9c2..3d326ea6b 100644 --- a/src/main/java/emu/grasscutter/data/excels/weapon/WeaponLevelData.java +++ b/src/main/java/emu/grasscutter/data/excels/weapon/WeaponLevelData.java @@ -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; - } } diff --git a/src/main/java/emu/grasscutter/data/excels/weapon/WeaponPromoteData.java b/src/main/java/emu/grasscutter/data/excels/weapon/WeaponPromoteData.java index 775737e11..228716f8f 100644 --- a/src/main/java/emu/grasscutter/data/excels/weapon/WeaponPromoteData.java +++ b/src/main/java/emu/grasscutter/data/excels/weapon/WeaponPromoteData.java @@ -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 diff --git a/src/main/java/emu/grasscutter/data/excels/world/WeatherData.java b/src/main/java/emu/grasscutter/data/excels/world/WeatherData.java index 631134257..9db8809e4 100644 --- a/src/main/java/emu/grasscutter/data/excels/world/WeatherData.java +++ b/src/main/java/emu/grasscutter/data/excels/world/WeatherData.java @@ -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() { diff --git a/src/main/java/emu/grasscutter/data/excels/world/WorldLevelData.java b/src/main/java/emu/grasscutter/data/excels/world/WorldLevelData.java index 0967c9871..00cc9b87a 100644 --- a/src/main/java/emu/grasscutter/data/excels/world/WorldLevelData.java +++ b/src/main/java/emu/grasscutter/data/excels/world/WorldLevelData.java @@ -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() {} } diff --git a/src/main/java/emu/grasscutter/data/server/Grid.java b/src/main/java/emu/grasscutter/data/server/Grid.java index 25f84559b..c42431c30 100644 --- a/src/main/java/emu/grasscutter/data/server/Grid.java +++ b/src/main/java/emu/grasscutter/data/server/Grid.java @@ -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>, Geometry> gridOptimized = null; private final transient Set nearbyGroups = new HashSet<>(100); + /** + * -- GETTER -- + * + * @return The correctly loaded grid map. + */ + @Getter public Map> 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> getGrid() { - return this.grid; - } - public Set getNearbyGroups(int vision_level, Position position) { this.optimize(); // Check to see if the grid is optimized. diff --git a/src/main/java/emu/grasscutter/database/DatabaseManager.java b/src/main/java/emu/grasscutter/database/DatabaseManager.java index 7331bccb7..52fc274f7 100644 --- a/src/main/java/emu/grasscutter/database/DatabaseManager.java +++ b/src/main/java/emu/grasscutter/database/DatabaseManager.java @@ -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; diff --git a/src/main/java/emu/grasscutter/game/Account.java b/src/main/java/emu/grasscutter/game/Account.java index e13475705..bbdab85c4 100644 --- a/src/main/java/emu/grasscutter/game/Account.java +++ b/src/main/java/emu/grasscutter/game/Account.java @@ -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 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 getPermissions() { - return this.permissions; - } - public boolean addPermission(String permission) { if (this.permissions.contains(permission)) return false; this.permissions.add(permission); diff --git a/src/main/java/emu/grasscutter/game/CoopRequest.java b/src/main/java/emu/grasscutter/game/CoopRequest.java index f1caf0f8b..ca4c0c6aa 100644 --- a/src/main/java/emu/grasscutter/game/CoopRequest.java +++ b/src/main/java/emu/grasscutter/game/CoopRequest.java @@ -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(); } diff --git a/src/main/java/emu/grasscutter/game/ability/AbilityModifierController.java b/src/main/java/emu/grasscutter/game/ability/AbilityModifierController.java index a95c4fbda..d5f8d760f 100644 --- a/src/main/java/emu/grasscutter/game/ability/AbilityModifierController.java +++ b/src/main/java/emu/grasscutter/game/ability/AbilityModifierController.java @@ -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) { diff --git a/src/main/java/emu/grasscutter/game/achievement/AchievementControlReturns.java b/src/main/java/emu/grasscutter/game/achievement/AchievementControlReturns.java index c177f8035..942eb52ca 100644 --- a/src/main/java/emu/grasscutter/game/achievement/AchievementControlReturns.java +++ b/src/main/java/emu/grasscutter/game/achievement/AchievementControlReturns.java @@ -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; diff --git a/src/main/java/emu/grasscutter/game/activity/trialavatar/TrialAvatarActivityHandler.java b/src/main/java/emu/grasscutter/game/activity/trialavatar/TrialAvatarActivityHandler.java index 719607721..20835fe81 100644 --- a/src/main/java/emu/grasscutter/game/activity/trialavatar/TrialAvatarActivityHandler.java +++ b/src/main/java/emu/grasscutter/game/activity/trialavatar/TrialAvatarActivityHandler.java @@ -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) { diff --git a/src/main/java/emu/grasscutter/game/avatar/AvatarStorage.java b/src/main/java/emu/grasscutter/game/avatar/AvatarStorage.java index 1d2002e7b..5d30007c6 100644 --- a/src/main/java/emu/grasscutter/game/avatar/AvatarStorage.java +++ b/src/main/java/emu/grasscutter/game/avatar/AvatarStorage.java @@ -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 { + @Getter private final Int2ObjectMap avatars; private final Long2ObjectMap avatarsGuid; @@ -28,10 +31,6 @@ public class AvatarStorage extends BasePlayerManager implements Iterable this.avatarsGuid = new Long2ObjectOpenHashMap<>(); } - public Int2ObjectMap getAvatars() { - return avatars; - } - public int getAvatarCount() { return this.avatars.size(); } diff --git a/src/main/java/emu/grasscutter/game/battlepass/BattlePassMission.java b/src/main/java/emu/grasscutter/game/battlepass/BattlePassMission.java index afd895224..27286ad00 100644 --- a/src/main/java/emu/grasscutter/game/battlepass/BattlePassMission.java +++ b/src/main/java/emu/grasscutter/game/battlepass/BattlePassMission.java @@ -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; } diff --git a/src/main/java/emu/grasscutter/game/battlepass/BattlePassReward.java b/src/main/java/emu/grasscutter/game/battlepass/BattlePassReward.java index 6433563d7..d37518f45 100644 --- a/src/main/java/emu/grasscutter/game/battlepass/BattlePassReward.java +++ b/src/main/java/emu/grasscutter/game/battlepass/BattlePassReward.java @@ -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(); diff --git a/src/main/java/emu/grasscutter/game/chat/ChatSystem.java b/src/main/java/emu/grasscutter/game/chat/ChatSystem.java index 9bd64ba32..bd1797270 100644 --- a/src/main/java/emu/grasscutter/game/chat/ChatSystem.java +++ b/src/main/java/emu/grasscutter/game/chat/ChatSystem.java @@ -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>> 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[/!]")) diff --git a/src/main/java/emu/grasscutter/game/city/CityInfoData.java b/src/main/java/emu/grasscutter/game/city/CityInfoData.java index 5c8bde72f..6cff23158 100644 --- a/src/main/java/emu/grasscutter/game/city/CityInfoData.java +++ b/src/main/java/emu/grasscutter/game/city/CityInfoData.java @@ -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; diff --git a/src/main/java/emu/grasscutter/game/combine/CombineResult.java b/src/main/java/emu/grasscutter/game/combine/CombineResult.java index df8ace74b..e5099e755 100644 --- a/src/main/java/emu/grasscutter/game/combine/CombineResult.java +++ b/src/main/java/emu/grasscutter/game/combine/CombineResult.java @@ -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 material; private List result; private List extra; private List back; - public List getMaterial() { - return material; - } - public void setMaterial(List material) { this.material = material; } - public List getResult() { - return result; - } - public void setResult(List result) { this.result = result; } - public List getExtra() { - return extra; - } - public void setExtra(List extra) { this.extra = extra; } - public List getBack() { - return back; - } - public void setBack(List back) { this.back = back; } diff --git a/src/main/java/emu/grasscutter/game/combine/ReliquaryDecomposeEntry.java b/src/main/java/emu/grasscutter/game/combine/ReliquaryDecomposeEntry.java index 856278535..ae2697af5 100644 --- a/src/main/java/emu/grasscutter/game/combine/ReliquaryDecomposeEntry.java +++ b/src/main/java/emu/grasscutter/game/combine/ReliquaryDecomposeEntry.java @@ -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 items; - public int getConfigId() { - return configId; - } - public void setConfigId(int configId) { this.configId = configId; } - public List getItems() { - return items; - } - public void setItems(List items) { this.items = items; } diff --git a/src/main/java/emu/grasscutter/game/drop/DropData.java b/src/main/java/emu/grasscutter/game/drop/DropData.java index e82681f59..9cc033b02 100644 --- a/src/main/java/emu/grasscutter/game/drop/DropData.java +++ b/src/main/java/emu/grasscutter/game/drop/DropData.java @@ -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; } diff --git a/src/main/java/emu/grasscutter/game/drop/DropInfo.java b/src/main/java/emu/grasscutter/game/drop/DropInfo.java index 0484d777a..f46e4986d 100644 --- a/src/main/java/emu/grasscutter/game/drop/DropInfo.java +++ b/src/main/java/emu/grasscutter/game/drop/DropInfo.java @@ -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 dropDataList; - public int getMonsterId() { - return monsterId; - } - - public List getDropDataList() { - return dropDataList; - } } diff --git a/src/main/java/emu/grasscutter/game/drop/DropSystemLegacy.java b/src/main/java/emu/grasscutter/game/drop/DropSystemLegacy.java index 00bdfcb45..2a3bea754 100644 --- a/src/main/java/emu/grasscutter/game/drop/DropSystemLegacy.java +++ b/src/main/java/emu/grasscutter/game/drop/DropSystemLegacy.java @@ -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> dropData; @@ -23,10 +26,6 @@ public class DropSystemLegacy extends BaseGameSystem { this.load(); } - public Int2ObjectMap> getDropData() { - return dropData; - } - public synchronized void load() { getDropData().clear(); try { diff --git a/src/main/java/emu/grasscutter/game/dungeons/DungeonDrop.java b/src/main/java/emu/grasscutter/game/dungeons/DungeonDrop.java index f329eab9c..23807a498 100644 --- a/src/main/java/emu/grasscutter/game/dungeons/DungeonDrop.java +++ b/src/main/java/emu/grasscutter/game/dungeons/DungeonDrop.java @@ -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 drops; - public int getDungeonId() { - return dungeonId; - } - public void setDungeonId(int dungeonId) { this.dungeonId = dungeonId; } - public List getDrops() { - return drops; - } - public void setDrops(List drops) { this.drops = drops; } diff --git a/src/main/java/emu/grasscutter/game/dungeons/DungeonDropEntry.java b/src/main/java/emu/grasscutter/game/dungeons/DungeonDropEntry.java index 80e7b80af..a44592b54 100644 --- a/src/main/java/emu/grasscutter/game/dungeons/DungeonDropEntry.java +++ b/src/main/java/emu/grasscutter/game/dungeons/DungeonDropEntry.java @@ -1,7 +1,10 @@ package emu.grasscutter.game.dungeons; +import lombok.Getter; + import java.util.List; +@Getter public class DungeonDropEntry { private List counts; private List items; @@ -9,42 +12,22 @@ public class DungeonDropEntry { private List itemProbabilities; private boolean mpDouble; - public List getCounts() { - return counts; - } - public void setCounts(List counts) { this.counts = counts; } - public List getItems() { - return items; - } - public void setItems(List items) { this.items = items; } - public List getProbabilities() { - return probabilities; - } - public void setProbabilities(List probabilities) { this.probabilities = probabilities; } - public List getItemProbabilities() { - return itemProbabilities; - } - public void setItemProbabilities(List itemProbabilities) { this.itemProbabilities = itemProbabilities; } - public boolean isMpDouble() { - return mpDouble; - } - public void setMpDouble(boolean mpDouble) { this.mpDouble = mpDouble; } diff --git a/src/main/java/emu/grasscutter/game/dungeons/DungeonEndStats.java b/src/main/java/emu/grasscutter/game/dungeons/DungeonEndStats.java index f204860a7..8c6d1a288 100644 --- a/src/main/java/emu/grasscutter/game/dungeons/DungeonEndStats.java +++ b/src/main/java/emu/grasscutter/game/dungeons/DungeonEndStats.java @@ -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, diff --git a/src/main/java/emu/grasscutter/game/dungeons/challenge/DungeonChallenge.java b/src/main/java/emu/grasscutter/game/dungeons/challenge/DungeonChallenge.java index 86a27021b..ab218b57f 100644 --- a/src/main/java/emu/grasscutter/game/dungeons/challenge/DungeonChallenge.java +++ b/src/main/java/emu/grasscutter/game/dungeons/challenge/DungeonChallenge.java @@ -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; } diff --git a/src/main/java/emu/grasscutter/game/dungeons/dungeon_results/BaseDungeonResult.java b/src/main/java/emu/grasscutter/game/dungeons/dungeon_results/BaseDungeonResult.java index 367c6baa1..08c271ff6 100644 --- a/src/main/java/emu/grasscutter/game/dungeons/dungeon_results/BaseDungeonResult.java +++ b/src/main/java/emu/grasscutter/game/dungeons/dungeon_results/BaseDungeonResult.java @@ -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; diff --git a/src/main/java/emu/grasscutter/game/dungeons/enums/DungeonPassConditionType.java b/src/main/java/emu/grasscutter/game/dungeons/enums/DungeonPassConditionType.java index cfd1a47ee..a28e445e6 100644 --- a/src/main/java/emu/grasscutter/game/dungeons/enums/DungeonPassConditionType.java +++ b/src/main/java/emu/grasscutter/game/dungeons/enums/DungeonPassConditionType.java @@ -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; diff --git a/src/main/java/emu/grasscutter/game/dungeons/enums/DungeonType.java b/src/main/java/emu/grasscutter/game/dungeons/enums/DungeonType.java index a5b5993fa..78c5de72f 100644 --- a/src/main/java/emu/grasscutter/game/dungeons/enums/DungeonType.java +++ b/src/main/java/emu/grasscutter/game/dungeons/enums/DungeonType.java @@ -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; diff --git a/src/main/java/emu/grasscutter/game/dungeons/enums/SettleShowType.java b/src/main/java/emu/grasscutter/game/dungeons/enums/SettleShowType.java index 1a591408c..6bf6d1b4f 100644 --- a/src/main/java/emu/grasscutter/game/dungeons/enums/SettleShowType.java +++ b/src/main/java/emu/grasscutter/game/dungeons/enums/SettleShowType.java @@ -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; diff --git a/src/main/java/emu/grasscutter/game/entity/EntityAvatar.java b/src/main/java/emu/grasscutter/game/entity/EntityAvatar.java index 8a4303430..764f7e426 100644 --- a/src/main/java/emu/grasscutter/game/entity/EntityAvatar.java +++ b/src/main/java/emu/grasscutter/game/entity/EntityAvatar.java @@ -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); diff --git a/src/main/java/emu/grasscutter/game/entity/EntityItem.java b/src/main/java/emu/grasscutter/game/entity/EntityItem.java index 3946ab3f3..5da370503 100644 --- a/src/main/java/emu/grasscutter/game/entity/EntityItem.java +++ b/src/main/java/emu/grasscutter/game/entity/EntityItem.java @@ -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); diff --git a/src/main/java/emu/grasscutter/game/entity/EntitySolarIsotomaClientGadget.java b/src/main/java/emu/grasscutter/game/entity/EntitySolarIsotomaClientGadget.java index 9d3e13cdb..981bd1fa6 100644 --- a/src/main/java/emu/grasscutter/game/entity/EntitySolarIsotomaClientGadget.java +++ b/src/main/java/emu/grasscutter/game/entity/EntitySolarIsotomaClientGadget.java @@ -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) { diff --git a/src/main/java/emu/grasscutter/game/entity/EntityWorld.java b/src/main/java/emu/grasscutter/game/entity/EntityWorld.java index da6fbd7ae..586e6b386 100644 --- a/src/main/java/emu/grasscutter/game/entity/EntityWorld.java +++ b/src/main/java/emu/grasscutter/game/entity/EntityWorld.java @@ -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); diff --git a/src/main/java/emu/grasscutter/game/entity/gadget/GadgetContent.java b/src/main/java/emu/grasscutter/game/entity/gadget/GadgetContent.java index 091957832..01208e301 100644 --- a/src/main/java/emu/grasscutter/game/entity/gadget/GadgetContent.java +++ b/src/main/java/emu/grasscutter/game/entity/gadget/GadgetContent.java @@ -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); diff --git a/src/main/java/emu/grasscutter/game/entity/gadget/GadgetGatherObject.java b/src/main/java/emu/grasscutter/game/entity/gadget/GadgetGatherObject.java index 03aab7d27..cbeecaf76 100644 --- a/src/main/java/emu/grasscutter/game/entity/gadget/GadgetGatherObject.java +++ b/src/main/java/emu/grasscutter/game/entity/gadget/GadgetGatherObject.java @@ -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; } diff --git a/src/main/java/emu/grasscutter/game/entity/gadget/platform/BaseRoute.java b/src/main/java/emu/grasscutter/game/entity/gadget/platform/BaseRoute.java index 0575e2ad9..221cfbd90 100644 --- a/src/main/java/emu/grasscutter/game/entity/gadget/platform/BaseRoute.java +++ b/src/main/java/emu/grasscutter/game/entity/gadget/platform/BaseRoute.java @@ -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; diff --git a/src/main/java/emu/grasscutter/game/entity/gadget/platform/ConfigRoute.java b/src/main/java/emu/grasscutter/game/entity/gadget/platform/ConfigRoute.java index a70a8e769..26ff78b29 100644 --- a/src/main/java/emu/grasscutter/game/entity/gadget/platform/ConfigRoute.java +++ b/src/main/java/emu/grasscutter/game/entity/gadget/platform/ConfigRoute.java @@ -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 scheduledIndexes; + @Setter private int routeId; + @Setter private int startIndex; + @Setter private List scheduledIndexes; public ConfigRoute(SceneGadget gadget) { super(gadget); diff --git a/src/main/java/emu/grasscutter/game/entity/gadget/platform/PointArrayRoute.java b/src/main/java/emu/grasscutter/game/entity/gadget/platform/PointArrayRoute.java index cd0c67efe..3174ba9e7 100644 --- a/src/main/java/emu/grasscutter/game/entity/gadget/platform/PointArrayRoute.java +++ b/src/main/java/emu/grasscutter/game/entity/gadget/platform/PointArrayRoute.java @@ -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); diff --git a/src/main/java/emu/grasscutter/game/expedition/ExpeditionRewardData.java b/src/main/java/emu/grasscutter/game/expedition/ExpeditionRewardData.java index 8d322794d..37299e27c 100644 --- a/src/main/java/emu/grasscutter/game/expedition/ExpeditionRewardData.java +++ b/src/main/java/emu/grasscutter/game/expedition/ExpeditionRewardData.java @@ -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)); diff --git a/src/main/java/emu/grasscutter/game/expedition/ExpeditionRewardDataList.java b/src/main/java/emu/grasscutter/game/expedition/ExpeditionRewardDataList.java index 2712bfd27..0851abfc8 100644 --- a/src/main/java/emu/grasscutter/game/expedition/ExpeditionRewardDataList.java +++ b/src/main/java/emu/grasscutter/game/expedition/ExpeditionRewardDataList.java @@ -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; + private int hourTime; + private List expeditionRewardData; public List getRewards() { List rewards = new ArrayList<>(); diff --git a/src/main/java/emu/grasscutter/game/expedition/ExpeditionRewardInfo.java b/src/main/java/emu/grasscutter/game/expedition/ExpeditionRewardInfo.java index b39475b83..8685ceddc 100644 --- a/src/main/java/emu/grasscutter/game/expedition/ExpeditionRewardInfo.java +++ b/src/main/java/emu/grasscutter/game/expedition/ExpeditionRewardInfo.java @@ -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; + private int expId; + private List expeditionRewardDataList; } diff --git a/src/main/java/emu/grasscutter/game/friends/Friendship.java b/src/main/java/emu/grasscutter/game/friends/Friendship.java index 21d483a29..41d80133a 100644 --- a/src/main/java/emu/grasscutter/game/friends/Friendship.java +++ b/src/main/java/emu/grasscutter/game/friends/Friendship.java @@ -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; } diff --git a/src/main/java/emu/grasscutter/game/gacha/GachaRecord.java b/src/main/java/emu/grasscutter/game/gacha/GachaRecord.java index b1bbc7172..3122e81b2 100644 --- a/src/main/java/emu/grasscutter/game/gacha/GachaRecord.java +++ b/src/main/java/emu/grasscutter/game/gacha/GachaRecord.java @@ -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; } diff --git a/src/main/java/emu/grasscutter/game/gacha/GachaSystem.java b/src/main/java/emu/grasscutter/game/gacha/GachaSystem.java index 649aa5972..3ef45bd39 100644 --- a/src/main/java/emu/grasscutter/game/gacha/GachaSystem.java +++ b/src/main/java/emu/grasscutter/game/gacha/GachaSystem.java @@ -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 gachaBanners; private WatchService watchService; @@ -41,10 +44,6 @@ public class GachaSystem extends BaseGameSystem { this.startWatcher(server); } - public Int2ObjectMap getGachaBanners() { - return gachaBanners; - } - public int randomRange(int min, int max) { // Both are inclusive return ThreadLocalRandom.current().nextInt(max - min + 1) + min; } diff --git a/src/main/java/emu/grasscutter/game/inventory/BagTab.java b/src/main/java/emu/grasscutter/game/inventory/BagTab.java index 697374b75..30fba692c 100644 --- a/src/main/java/emu/grasscutter/game/inventory/BagTab.java +++ b/src/main/java/emu/grasscutter/game/inventory/BagTab.java @@ -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. diff --git a/src/main/java/emu/grasscutter/game/inventory/EquipType.java b/src/main/java/emu/grasscutter/game/inventory/EquipType.java index 00bf4e078..5efd255f1 100644 --- a/src/main/java/emu/grasscutter/game/inventory/EquipType.java +++ b/src/main/java/emu/grasscutter/game/inventory/EquipType.java @@ -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; diff --git a/src/main/java/emu/grasscutter/game/inventory/GameItem.java b/src/main/java/emu/grasscutter/game/inventory/GameItem.java index 239ac8e9f..edea4ad33 100644 --- a/src/main/java/emu/grasscutter/game/inventory/GameItem.java +++ b/src/main/java/emu/grasscutter/game/inventory/GameItem.java @@ -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(); diff --git a/src/main/java/emu/grasscutter/game/inventory/Inventory.java b/src/main/java/emu/grasscutter/game/inventory/Inventory.java index 841921ac2..39a8d716c 100644 --- a/src/main/java/emu/grasscutter/game/inventory/Inventory.java +++ b/src/main/java/emu/grasscutter/game/inventory/Inventory.java @@ -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 { private final Long2ObjectMap store; + @Getter private final Int2ObjectMap inventoryTypes; public Inventory(Player player) { @@ -50,10 +53,6 @@ public class Inventory extends BasePlayerManager implements Iterable { return store; } - public Int2ObjectMap getInventoryTypes() { - return inventoryTypes; - } - public InventoryTab getInventoryTab(ItemType type) { return getInventoryTypes().get(type.getValue()); } diff --git a/src/main/java/emu/grasscutter/game/inventory/ItemDef.java b/src/main/java/emu/grasscutter/game/inventory/ItemDef.java index 0dde8fd05..c1dd29797 100644 --- a/src/main/java/emu/grasscutter/game/inventory/ItemDef.java +++ b/src/main/java/emu/grasscutter/game/inventory/ItemDef.java @@ -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; } diff --git a/src/main/java/emu/grasscutter/game/inventory/ItemQuality.java b/src/main/java/emu/grasscutter/game/inventory/ItemQuality.java index 954230d62..659527761 100644 --- a/src/main/java/emu/grasscutter/game/inventory/ItemQuality.java +++ b/src/main/java/emu/grasscutter/game/inventory/ItemQuality.java @@ -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; diff --git a/src/main/java/emu/grasscutter/game/inventory/ItemType.java b/src/main/java/emu/grasscutter/game/inventory/ItemType.java index c6ab80e33..237d22318 100644 --- a/src/main/java/emu/grasscutter/game/inventory/ItemType.java +++ b/src/main/java/emu/grasscutter/game/inventory/ItemType.java @@ -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; diff --git a/src/main/java/emu/grasscutter/game/inventory/MaterialType.java b/src/main/java/emu/grasscutter/game/inventory/MaterialType.java index e53764744..ba34eb632 100644 --- a/src/main/java/emu/grasscutter/game/inventory/MaterialType.java +++ b/src/main/java/emu/grasscutter/game/inventory/MaterialType.java @@ -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; diff --git a/src/main/java/emu/grasscutter/game/mail/Mail.java b/src/main/java/emu/grasscutter/game/mail/Mail.java index 7acfd5a22..be585a000 100644 --- a/src/main/java/emu/grasscutter/game/mail/Mail.java +++ b/src/main/java/emu/grasscutter/game/mail/Mail.java @@ -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 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; } diff --git a/src/main/java/emu/grasscutter/game/mail/MailHandler.java b/src/main/java/emu/grasscutter/game/mail/MailHandler.java index 2862f6ebe..a14b0cafb 100644 --- a/src/main/java/emu/grasscutter/game/mail/MailHandler.java +++ b/src/main/java/emu/grasscutter/game/mail/MailHandler.java @@ -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; @@ -16,10 +19,6 @@ public class MailHandler extends BasePlayerManager { this.mail = new ArrayList<>(); } - public List getMail() { - return mail; - } - // ---------------------MAIL------------------------ public void sendMail(Mail message) { diff --git a/src/main/java/emu/grasscutter/game/managers/blossom/BlossomActivity.java b/src/main/java/emu/grasscutter/game/managers/blossom/BlossomActivity.java index d73778cca..b8237fcea 100644 --- a/src/main/java/emu/grasscutter/game/managers/blossom/BlossomActivity.java +++ b/src/main/java/emu/grasscutter/game/managers/blossom/BlossomActivity.java @@ -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 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 = diff --git a/src/main/java/emu/grasscutter/game/managers/blossom/BlossomConfig.java b/src/main/java/emu/grasscutter/game/managers/blossom/BlossomConfig.java index a8652e8fe..f151aad48 100644 --- a/src/main/java/emu/grasscutter/game/managers/blossom/BlossomConfig.java +++ b/src/main/java/emu/grasscutter/game/managers/blossom/BlossomConfig.java @@ -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 monsterIdsPerDifficulty; // Need to wrangle Gson for // this - @Getter private Map> monsterIdsPerDifficulty; + private Map> monsterIdsPerDifficulty; } diff --git a/src/main/java/emu/grasscutter/game/managers/blossom/BlossomType.java b/src/main/java/emu/grasscutter/game/managers/blossom/BlossomType.java index 069e469c5..b87074346 100644 --- a/src/main/java/emu/grasscutter/game/managers/blossom/BlossomType.java +++ b/src/main/java/emu/grasscutter/game/managers/blossom/BlossomType.java @@ -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 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; diff --git a/src/main/java/emu/grasscutter/game/managers/deforestation/HitTreeRecord.java b/src/main/java/emu/grasscutter/game/managers/deforestation/HitTreeRecord.java index f29467eae..45fb27507 100644 --- a/src/main/java/emu/grasscutter/game/managers/deforestation/HitTreeRecord.java +++ b/src/main/java/emu/grasscutter/game/managers/deforestation/HitTreeRecord.java @@ -1,6 +1,13 @@ package emu.grasscutter.game.managers.deforestation; +import lombok.Getter; + public class HitTreeRecord { + /** + * -- GETTER -- + * get unique id + */ + @Getter private final int unique; private short count; // hit this tree times private long time; // last available hitting time @@ -36,11 +43,6 @@ public class HitTreeRecord { } } - /** get unique id */ - public int getUnique() { - return unique; - } - @Override public String toString() { return "HitTreeRecord{" + "unique=" + unique + ", count=" + count + ", time=" + time + '}'; diff --git a/src/main/java/emu/grasscutter/game/managers/energy/EnergyDropEntry.java b/src/main/java/emu/grasscutter/game/managers/energy/EnergyDropEntry.java index 6832294a0..b42c2e6ef 100644 --- a/src/main/java/emu/grasscutter/game/managers/energy/EnergyDropEntry.java +++ b/src/main/java/emu/grasscutter/game/managers/energy/EnergyDropEntry.java @@ -1,16 +1,12 @@ package emu.grasscutter.game.managers.energy; +import lombok.Getter; + import java.util.List; +@Getter public class EnergyDropEntry { private int dropId; private List dropList; - public int getDropId() { - return this.dropId; - } - - public List getDropList() { - return this.dropList; - } } diff --git a/src/main/java/emu/grasscutter/game/managers/energy/EnergyDropInfo.java b/src/main/java/emu/grasscutter/game/managers/energy/EnergyDropInfo.java index 2ba4d5842..72d3763b3 100644 --- a/src/main/java/emu/grasscutter/game/managers/energy/EnergyDropInfo.java +++ b/src/main/java/emu/grasscutter/game/managers/energy/EnergyDropInfo.java @@ -1,14 +1,10 @@ package emu.grasscutter.game.managers.energy; +import lombok.Getter; + +@Getter public class EnergyDropInfo { private int ballId; private int count; - public int getBallId() { - return this.ballId; - } - - public int getCount() { - return this.count; - } } diff --git a/src/main/java/emu/grasscutter/game/managers/energy/SkillParticleGenerationEntry.java b/src/main/java/emu/grasscutter/game/managers/energy/SkillParticleGenerationEntry.java index b7047a930..80fbcc686 100644 --- a/src/main/java/emu/grasscutter/game/managers/energy/SkillParticleGenerationEntry.java +++ b/src/main/java/emu/grasscutter/game/managers/energy/SkillParticleGenerationEntry.java @@ -1,16 +1,12 @@ package emu.grasscutter.game.managers.energy; +import lombok.Getter; + import java.util.List; +@Getter public class SkillParticleGenerationEntry { private int avatarId; private List amountList; - public int getAvatarId() { - return this.avatarId; - } - - public List getAmountList() { - return this.amountList; - } } diff --git a/src/main/java/emu/grasscutter/game/managers/energy/SkillParticleGenerationInfo.java b/src/main/java/emu/grasscutter/game/managers/energy/SkillParticleGenerationInfo.java index c9ce4067a..d46ee16ef 100644 --- a/src/main/java/emu/grasscutter/game/managers/energy/SkillParticleGenerationInfo.java +++ b/src/main/java/emu/grasscutter/game/managers/energy/SkillParticleGenerationInfo.java @@ -1,14 +1,10 @@ package emu.grasscutter.game.managers.energy; +import lombok.Getter; + +@Getter public class SkillParticleGenerationInfo { private int value; private int chance; - public int getValue() { - return this.value; - } - - public int getChance() { - return this.chance; - } } diff --git a/src/main/java/emu/grasscutter/game/managers/forging/ActiveForgeData.java b/src/main/java/emu/grasscutter/game/managers/forging/ActiveForgeData.java index fd2408645..f27d5cc9a 100644 --- a/src/main/java/emu/grasscutter/game/managers/forging/ActiveForgeData.java +++ b/src/main/java/emu/grasscutter/game/managers/forging/ActiveForgeData.java @@ -1,17 +1,24 @@ package emu.grasscutter.game.managers.forging; import dev.morphia.annotations.Entity; +import lombok.Getter; @Entity public class ActiveForgeData { + @Getter private int forgeId; + @Getter private int avatarId; + @Getter private int count; + @Getter private int startTime; + @Getter private int forgeTime; private int lastUnfinishedCount; + @Getter private boolean changed; public int getFinishedCount(int currentTime) { @@ -35,50 +42,26 @@ public class ActiveForgeData { return this.startTime + this.forgeTime * this.count; } - public int getForgeId() { - return this.forgeId; - } - public void setForgeId(int value) { this.forgeId = value; } - public int getAvatarId() { - return this.avatarId; - } - public void setAvatarId(int value) { this.avatarId = value; } - public int getCount() { - return count; - } - public void setCount(int value) { this.count = value; } - public int getStartTime() { - return this.startTime; - } - public void setStartTime(int value) { this.startTime = value; } - public int getForgeTime() { - return this.forgeTime; - } - public void setForgeTime(int value) { this.forgeTime = value; } - public boolean isChanged() { - return this.changed; - } - public void setChanged(boolean value) { this.changed = value; } diff --git a/src/main/java/emu/grasscutter/game/managers/mapmark/MapMark.java b/src/main/java/emu/grasscutter/game/managers/mapmark/MapMark.java index 6960a8595..a8f05337c 100644 --- a/src/main/java/emu/grasscutter/game/managers/mapmark/MapMark.java +++ b/src/main/java/emu/grasscutter/game/managers/mapmark/MapMark.java @@ -5,7 +5,9 @@ import emu.grasscutter.game.world.Position; import emu.grasscutter.net.proto.MapMarkFromTypeOuterClass.MapMarkFromType; import emu.grasscutter.net.proto.MapMarkPointOuterClass.MapMarkPoint; import emu.grasscutter.net.proto.MapMarkPointTypeOuterClass.MapMarkPointType; +import lombok.Getter; +@Getter @Entity public class MapMark { private int sceneId; @@ -32,31 +34,4 @@ public class MapMark { this.questId = mapMarkPoint.getQuestId(); } - public int getSceneId() { - return this.sceneId; - } - - public String getName() { - return this.name; - } - - public Position getPosition() { - return this.position; - } - - public MapMarkPointType getMapMarkPointType() { - return this.mapMarkPointType; - } - - public int getMonsterId() { - return this.monsterId; - } - - public MapMarkFromType getMapMarkFromType() { - return this.mapMarkFromType; - } - - public int getQuestId() { - return this.questId; - } } diff --git a/src/main/java/emu/grasscutter/game/player/BasePlayerDataManager.java b/src/main/java/emu/grasscutter/game/player/BasePlayerDataManager.java index a8f70bfb4..8e29adee6 100644 --- a/src/main/java/emu/grasscutter/game/player/BasePlayerDataManager.java +++ b/src/main/java/emu/grasscutter/game/player/BasePlayerDataManager.java @@ -1,7 +1,9 @@ package emu.grasscutter.game.player; +import lombok.Getter; import lombok.NonNull; +@Getter public abstract class BasePlayerDataManager { protected transient Player player; @@ -11,10 +13,6 @@ public abstract class BasePlayerDataManager { this.player = player; } - public Player getPlayer() { - return this.player; - } - public void setPlayer(Player player) { if (this.player == null) { this.player = player; diff --git a/src/main/java/emu/grasscutter/game/player/BasePlayerManager.java b/src/main/java/emu/grasscutter/game/player/BasePlayerManager.java index 1a42840b5..c2447cefb 100644 --- a/src/main/java/emu/grasscutter/game/player/BasePlayerManager.java +++ b/src/main/java/emu/grasscutter/game/player/BasePlayerManager.java @@ -2,10 +2,10 @@ package emu.grasscutter.game.player; import lombok.*; +@Getter public abstract class BasePlayerManager { protected final transient Player player; - @Getter @Setter(AccessLevel.PROTECTED) protected boolean loaded = false; @@ -13,10 +13,6 @@ public abstract class BasePlayerManager { this.player = player; } - public Player getPlayer() { - return this.player; - } - /** Saves the player to the database */ public void save() { getPlayer().save(); diff --git a/src/main/java/emu/grasscutter/game/player/Player.java b/src/main/java/emu/grasscutter/game/player/Player.java index e951dd307..684f1c1eb 100644 --- a/src/main/java/emu/grasscutter/game/player/Player.java +++ b/src/main/java/emu/grasscutter/game/player/Player.java @@ -1645,10 +1645,10 @@ public class Player implements PlayerHook, FieldFetch { .formatted(this.id, this.nickname, this.account); } + @Getter public enum SceneLoadState { NONE(0), LOADING(1), INIT(2), LOADED(3); - @Getter private final int value; SceneLoadState(int value) { diff --git a/src/main/java/emu/grasscutter/game/player/PlayerBirthday.java b/src/main/java/emu/grasscutter/game/player/PlayerBirthday.java index 85301daa6..7fa3f5f6e 100644 --- a/src/main/java/emu/grasscutter/game/player/PlayerBirthday.java +++ b/src/main/java/emu/grasscutter/game/player/PlayerBirthday.java @@ -2,7 +2,9 @@ package emu.grasscutter.game.player; import dev.morphia.annotations.Entity; import emu.grasscutter.net.proto.BirthdayOuterClass.Birthday; +import lombok.Getter; +@Getter @Entity public class PlayerBirthday { private int day; @@ -32,19 +34,11 @@ public class PlayerBirthday { return this; } - public int getDay() { - return this.day; - } - public PlayerBirthday setDay(int value) { this.day = value; return this; } - public int getMonth() { - return this.month; - } - public PlayerBirthday setMonth(int value) { this.month = value; return this; diff --git a/src/main/java/emu/grasscutter/game/player/PlayerCollectionRecords.java b/src/main/java/emu/grasscutter/game/player/PlayerCollectionRecords.java index 1d1488bd4..1f3f1e1c8 100644 --- a/src/main/java/emu/grasscutter/game/player/PlayerCollectionRecords.java +++ b/src/main/java/emu/grasscutter/game/player/PlayerCollectionRecords.java @@ -1,6 +1,8 @@ package emu.grasscutter.game.player; import dev.morphia.annotations.Entity; +import lombok.Getter; + import java.util.*; @Entity(useDiscriminator = false) @@ -43,6 +45,7 @@ public class PlayerCollectionRecords { } } + @Getter @Entity public static class CollectionRecord { private int configId; @@ -56,12 +59,5 @@ public class PlayerCollectionRecords { this.expiredTime = expiredTime; } - public int getConfigId() { - return configId; - } - - public long getExpiredTime() { - return expiredTime; - } } } diff --git a/src/main/java/emu/grasscutter/game/player/PlayerProgress.java b/src/main/java/emu/grasscutter/game/player/PlayerProgress.java index 43ce48554..dffaea0e8 100644 --- a/src/main/java/emu/grasscutter/game/player/PlayerProgress.java +++ b/src/main/java/emu/grasscutter/game/player/PlayerProgress.java @@ -83,11 +83,12 @@ public class PlayerProgress { return questProgressCountMap.merge(progressId, 0, Integer::min); } + @Getter @Entity @NoArgsConstructor public static class ItemEntry { - @Getter private int itemId; - @Getter @Setter private int obtainedCount; + private int itemId; + @Setter private int obtainedCount; ItemEntry(int itemId) { this.itemId = itemId; diff --git a/src/main/java/emu/grasscutter/game/player/TeamInfo.java b/src/main/java/emu/grasscutter/game/player/TeamInfo.java index 397682cde..86c76fef5 100644 --- a/src/main/java/emu/grasscutter/game/player/TeamInfo.java +++ b/src/main/java/emu/grasscutter/game/player/TeamInfo.java @@ -5,8 +5,11 @@ import static emu.grasscutter.config.Configuration.GAME_OPTIONS; import dev.morphia.annotations.Entity; import emu.grasscutter.game.avatar.Avatar; import emu.grasscutter.net.proto.AvatarTeamOuterClass.AvatarTeam; +import lombok.Getter; + import java.util.*; +@Getter @Entity public final class TeamInfo { private String name; @@ -22,18 +25,10 @@ public final class TeamInfo { this.avatars = avatars; } - public String getName() { - return name; - } - public void setName(String name) { this.name = name; } - public List getAvatars() { - return avatars; - } - public int size() { return avatars.size(); } diff --git a/src/main/java/emu/grasscutter/game/props/ActionReason.java b/src/main/java/emu/grasscutter/game/props/ActionReason.java index 57867ed35..251aa6fbc 100644 --- a/src/main/java/emu/grasscutter/game/props/ActionReason.java +++ b/src/main/java/emu/grasscutter/game/props/ActionReason.java @@ -1,9 +1,12 @@ package emu.grasscutter.game.props; import it.unimi.dsi.fastutil.ints.*; +import lombok.Getter; + import java.util.*; import java.util.stream.Stream; +@Getter public enum ActionReason { None(0), QuestItem(1), @@ -206,7 +209,4 @@ public enum ActionReason { return stringMap.getOrDefault(name, None); } - public int getValue() { - return value; - } } diff --git a/src/main/java/emu/grasscutter/game/props/BattlePassMissionRefreshType.java b/src/main/java/emu/grasscutter/game/props/BattlePassMissionRefreshType.java index d95a858a1..d5273f4e9 100644 --- a/src/main/java/emu/grasscutter/game/props/BattlePassMissionRefreshType.java +++ b/src/main/java/emu/grasscutter/game/props/BattlePassMissionRefreshType.java @@ -1,5 +1,8 @@ package emu.grasscutter.game.props; +import lombok.Getter; + +@Getter public enum BattlePassMissionRefreshType { BATTLE_PASS_MISSION_REFRESH_DAILY(0), BATTLE_PASS_MISSION_REFRESH_CYCLE_CROSS_SCHEDULE(1), // Weekly @@ -12,7 +15,4 @@ public enum BattlePassMissionRefreshType { this.value = value; } - public int getValue() { - return value; - } } diff --git a/src/main/java/emu/grasscutter/game/props/BattlePassMissionStatus.java b/src/main/java/emu/grasscutter/game/props/BattlePassMissionStatus.java index 385f0775f..1abc80f1d 100644 --- a/src/main/java/emu/grasscutter/game/props/BattlePassMissionStatus.java +++ b/src/main/java/emu/grasscutter/game/props/BattlePassMissionStatus.java @@ -1,7 +1,9 @@ package emu.grasscutter.game.props; import emu.grasscutter.net.proto.BattlePassMissionOuterClass.BattlePassMission.MissionStatus; +import lombok.Getter; +@Getter public enum BattlePassMissionStatus { MISSION_STATUS_INVALID(0, MissionStatus.MISSION_STATUS_INVALID), MISSION_STATUS_UNFINISHED(1, MissionStatus.MISSION_STATUS_UNFINISHED), @@ -16,11 +18,4 @@ public enum BattlePassMissionStatus { this.missionStatus = missionStatus; // In case proto enum values change later } - public int getValue() { - return value; - } - - public MissionStatus getMissionStatus() { - return missionStatus; - } } diff --git a/src/main/java/emu/grasscutter/game/props/CampTargetType.java b/src/main/java/emu/grasscutter/game/props/CampTargetType.java index a1076a0ae..955b642cc 100644 --- a/src/main/java/emu/grasscutter/game/props/CampTargetType.java +++ b/src/main/java/emu/grasscutter/game/props/CampTargetType.java @@ -2,9 +2,12 @@ package emu.grasscutter.game.props; import emu.grasscutter.scripts.constants.IntValueEnum; import it.unimi.dsi.fastutil.ints.*; +import lombok.Getter; + import java.util.*; import java.util.stream.Stream; +@Getter public enum CampTargetType implements IntValueEnum { None(0), Alliance(1), @@ -32,10 +35,6 @@ public enum CampTargetType implements IntValueEnum { this.value = value; } - public int getValue() { - return value; - } - public static CampTargetType getTypeByValue(int value) { return map.getOrDefault(value, None); } diff --git a/src/main/java/emu/grasscutter/game/props/ClimateType.java b/src/main/java/emu/grasscutter/game/props/ClimateType.java index 71a7c28e4..39ed137b0 100644 --- a/src/main/java/emu/grasscutter/game/props/ClimateType.java +++ b/src/main/java/emu/grasscutter/game/props/ClimateType.java @@ -1,9 +1,12 @@ package emu.grasscutter.game.props; import it.unimi.dsi.fastutil.ints.*; +import lombok.Getter; + import java.util.*; import java.util.stream.Stream; +@Getter public enum ClimateType { CLIMATE_NONE(0), CLIMATE_SUNNY(1), @@ -45,10 +48,6 @@ public enum ClimateType { return stringMap.getOrDefault(name, CLIMATE_NONE); } - public int getValue() { - return this.value; - } - public String getShortName() { return this.name().substring(8).toLowerCase(); } diff --git a/src/main/java/emu/grasscutter/game/props/ElementType.java b/src/main/java/emu/grasscutter/game/props/ElementType.java index 9ef59130c..5a8c49725 100644 --- a/src/main/java/emu/grasscutter/game/props/ElementType.java +++ b/src/main/java/emu/grasscutter/game/props/ElementType.java @@ -7,6 +7,7 @@ import java.util.*; import java.util.stream.Stream; import lombok.Getter; +@Getter public enum ElementType implements IntValueEnum { None(0, FightProperty.FIGHT_PROP_CUR_WIND_ENERGY, FightProperty.FIGHT_PROP_MAX_WIND_ENERGY), Fire( @@ -80,12 +81,12 @@ public enum ElementType implements IntValueEnum { }); } - @Getter private final int value; - @Getter private final int teamResonanceId; - @Getter private final FightProperty curEnergyProp; - @Getter private final FightProperty maxEnergyProp; - @Getter private final int depotIndex; - @Getter private final int configHash; + private final int value; + private final int teamResonanceId; + private final FightProperty curEnergyProp; + private final FightProperty maxEnergyProp; + private final int depotIndex; + private final int configHash; ElementType(int value, FightProperty curEnergyProp, FightProperty maxEnergyProp) { this(value, curEnergyProp, maxEnergyProp, 0, null, 0); diff --git a/src/main/java/emu/grasscutter/game/props/EnterReason.java b/src/main/java/emu/grasscutter/game/props/EnterReason.java index 7ef342e86..683c486db 100644 --- a/src/main/java/emu/grasscutter/game/props/EnterReason.java +++ b/src/main/java/emu/grasscutter/game/props/EnterReason.java @@ -1,9 +1,12 @@ package emu.grasscutter.game.props; import it.unimi.dsi.fastutil.ints.*; +import lombok.Getter; + import java.util.*; import java.util.stream.Stream; +@Getter public enum EnterReason { None(0), Login(1), @@ -64,7 +67,4 @@ public enum EnterReason { return stringMap.getOrDefault(name, None); } - public int getValue() { - return value; - } } diff --git a/src/main/java/emu/grasscutter/game/props/EntityIdType.java b/src/main/java/emu/grasscutter/game/props/EntityIdType.java index cee0a2981..622069146 100644 --- a/src/main/java/emu/grasscutter/game/props/EntityIdType.java +++ b/src/main/java/emu/grasscutter/game/props/EntityIdType.java @@ -1,7 +1,10 @@ package emu.grasscutter.game.props; +import lombok.Getter; + import java.util.*; +@Getter public enum EntityIdType { AVATAR(0x01), MONSTER(0x02), @@ -35,7 +38,4 @@ public enum EntityIdType { return map.getOrDefault(entityId, EntityType.None); } - public int getId() { - return id; - } } diff --git a/src/main/java/emu/grasscutter/game/props/EntityType.java b/src/main/java/emu/grasscutter/game/props/EntityType.java index 7d074b841..883258582 100644 --- a/src/main/java/emu/grasscutter/game/props/EntityType.java +++ b/src/main/java/emu/grasscutter/game/props/EntityType.java @@ -2,9 +2,12 @@ package emu.grasscutter.game.props; import emu.grasscutter.scripts.constants.IntValueEnum; import it.unimi.dsi.fastutil.ints.*; +import lombok.Getter; + import java.util.*; import java.util.stream.Stream; +@Getter public enum EntityType implements IntValueEnum { None(0), Avatar(1), @@ -102,7 +105,4 @@ public enum EntityType implements IntValueEnum { return stringMap.getOrDefault(name, None); } - public int getValue() { - return value; - } } diff --git a/src/main/java/emu/grasscutter/game/props/FetterState.java b/src/main/java/emu/grasscutter/game/props/FetterState.java index aac46461d..8ee65407d 100644 --- a/src/main/java/emu/grasscutter/game/props/FetterState.java +++ b/src/main/java/emu/grasscutter/game/props/FetterState.java @@ -1,9 +1,12 @@ package emu.grasscutter.game.props; import it.unimi.dsi.fastutil.ints.*; +import lombok.Getter; + import java.util.*; import java.util.stream.Stream; +@Getter public enum FetterState { NONE(0), NOT_OPEN(1), @@ -36,7 +39,4 @@ public enum FetterState { return stringMap.getOrDefault(name, NONE); } - public int getValue() { - return value; - } } diff --git a/src/main/java/emu/grasscutter/game/props/FightProperty.java b/src/main/java/emu/grasscutter/game/props/FightProperty.java index f94bc78a5..bd4990495 100644 --- a/src/main/java/emu/grasscutter/game/props/FightProperty.java +++ b/src/main/java/emu/grasscutter/game/props/FightProperty.java @@ -8,6 +8,7 @@ import java.util.function.Consumer; import java.util.stream.Stream; import lombok.Getter; +@Getter public enum FightProperty { FIGHT_PROP_NONE(0), FIGHT_PROP_BASE_HP(1), @@ -240,10 +241,6 @@ public enum FightProperty { return !flatProps.contains(prop); } - public int getId() { - return id; - } - @Getter public static class CompoundProperty { private final FightProperty result; diff --git a/src/main/java/emu/grasscutter/game/props/GrowCurve.java b/src/main/java/emu/grasscutter/game/props/GrowCurve.java index 2ec0db35d..4734350f7 100644 --- a/src/main/java/emu/grasscutter/game/props/GrowCurve.java +++ b/src/main/java/emu/grasscutter/game/props/GrowCurve.java @@ -1,9 +1,12 @@ package emu.grasscutter.game.props; import it.unimi.dsi.fastutil.ints.*; +import lombok.Getter; + import java.util.*; import java.util.stream.Stream; +@Getter public enum GrowCurve { GROW_CURVE_NONE(0), GROW_CURVE_HP(1), @@ -97,7 +100,4 @@ public enum GrowCurve { return stringMap.getOrDefault(name, GROW_CURVE_NONE); } - public int getId() { - return id; - } } diff --git a/src/main/java/emu/grasscutter/game/props/ItemUseAction/ItemUseInt.java b/src/main/java/emu/grasscutter/game/props/ItemUseAction/ItemUseInt.java index 34ec476d8..dd0eec681 100644 --- a/src/main/java/emu/grasscutter/game/props/ItemUseAction/ItemUseInt.java +++ b/src/main/java/emu/grasscutter/game/props/ItemUseAction/ItemUseInt.java @@ -2,8 +2,9 @@ package emu.grasscutter.game.props.ItemUseAction; import lombok.Getter; +@Getter public abstract class ItemUseInt extends ItemUseAction { - @Getter protected int i = 0; + protected int i = 0; public ItemUseInt(String[] useParam) { try { diff --git a/src/main/java/emu/grasscutter/game/props/ItemUseOp.java b/src/main/java/emu/grasscutter/game/props/ItemUseOp.java index 6fd704e6a..66eff8ed6 100644 --- a/src/main/java/emu/grasscutter/game/props/ItemUseOp.java +++ b/src/main/java/emu/grasscutter/game/props/ItemUseOp.java @@ -1,8 +1,11 @@ package emu.grasscutter.game.props; import it.unimi.dsi.fastutil.ints.*; +import lombok.Getter; + import java.util.stream.Stream; +@Getter public enum ItemUseOp { ITEM_USE_NONE(0), ITEM_USE_ACCEPT_QUEST(1), @@ -65,7 +68,4 @@ public enum ItemUseOp { return map.getOrDefault(value, ITEM_USE_NONE); } - public int getValue() { - return value; - } } diff --git a/src/main/java/emu/grasscutter/game/props/ItemUseTarget.java b/src/main/java/emu/grasscutter/game/props/ItemUseTarget.java index c1eda8fa3..5ad8671c2 100644 --- a/src/main/java/emu/grasscutter/game/props/ItemUseTarget.java +++ b/src/main/java/emu/grasscutter/game/props/ItemUseTarget.java @@ -1,8 +1,11 @@ package emu.grasscutter.game.props; import it.unimi.dsi.fastutil.ints.*; +import lombok.Getter; + import java.util.stream.Stream; +@Getter public enum ItemUseTarget { ITEM_USE_TARGET_NONE(0), ITEM_USE_TARGET_CUR_AVATAR(1), @@ -29,7 +32,4 @@ public enum ItemUseTarget { return map.getOrDefault(value, ITEM_USE_TARGET_NONE); } - public int getValue() { - return value; - } } diff --git a/src/main/java/emu/grasscutter/game/props/LifeState.java b/src/main/java/emu/grasscutter/game/props/LifeState.java index 1785b2faf..52a0622e0 100644 --- a/src/main/java/emu/grasscutter/game/props/LifeState.java +++ b/src/main/java/emu/grasscutter/game/props/LifeState.java @@ -1,9 +1,12 @@ package emu.grasscutter.game.props; import it.unimi.dsi.fastutil.ints.*; +import lombok.Getter; + import java.util.*; import java.util.stream.Stream; +@Getter public enum LifeState { LIFE_NONE(0), LIFE_ALIVE(1), @@ -36,7 +39,4 @@ public enum LifeState { return stringMap.getOrDefault(name, LIFE_NONE); } - public int getValue() { - return value; - } } diff --git a/src/main/java/emu/grasscutter/game/props/MonsterType.java b/src/main/java/emu/grasscutter/game/props/MonsterType.java index 69558ee83..adc080d4b 100644 --- a/src/main/java/emu/grasscutter/game/props/MonsterType.java +++ b/src/main/java/emu/grasscutter/game/props/MonsterType.java @@ -1,9 +1,12 @@ package emu.grasscutter.game.props; import it.unimi.dsi.fastutil.ints.*; +import lombok.Getter; + import java.util.*; import java.util.stream.Stream; +@Getter public enum MonsterType { MONSTER_NONE(0), MONSTER_ORDINARY(1), @@ -38,7 +41,4 @@ public enum MonsterType { return stringMap.getOrDefault(name, MONSTER_NONE); } - public int getValue() { - return value; - } } diff --git a/src/main/java/emu/grasscutter/game/props/PlayerProperty.java b/src/main/java/emu/grasscutter/game/props/PlayerProperty.java index 4c5995873..9c4d40b59 100644 --- a/src/main/java/emu/grasscutter/game/props/PlayerProperty.java +++ b/src/main/java/emu/grasscutter/game/props/PlayerProperty.java @@ -4,6 +4,7 @@ import it.unimi.dsi.fastutil.ints.*; import java.util.stream.Stream; import lombok.Getter; +@Getter public enum PlayerProperty { PROP_NONE(0), PROP_EXP(1001, 0), @@ -73,8 +74,8 @@ public enum PlayerProperty { Stream.of(values()).forEach(e -> map.put(e.getId(), e)); } - @Getter private final int id, min, max; - @Getter private final boolean dynamicRange; + private final int id, min, max; + private final boolean dynamicRange; PlayerProperty(int id, int min, int max, boolean dynamicRange) { this.id = id; diff --git a/src/main/java/emu/grasscutter/game/props/RefreshType.java b/src/main/java/emu/grasscutter/game/props/RefreshType.java index 8f1baa132..5df028a79 100644 --- a/src/main/java/emu/grasscutter/game/props/RefreshType.java +++ b/src/main/java/emu/grasscutter/game/props/RefreshType.java @@ -1,9 +1,12 @@ package emu.grasscutter.game.props; import it.unimi.dsi.fastutil.ints.*; +import lombok.Getter; + import java.util.*; import java.util.stream.Stream; +@Getter public enum RefreshType { REFRESH_NONE(0), REFRESH_INTERVAL(1), @@ -28,10 +31,6 @@ public enum RefreshType { this.value = value; } - public int getValue() { - return value; - } - public static RefreshType getTypeByValue(int value) { return map.getOrDefault(value, REFRESH_NONE); } diff --git a/src/main/java/emu/grasscutter/game/props/SceneType.java b/src/main/java/emu/grasscutter/game/props/SceneType.java index 09bd084b3..48015a7e8 100644 --- a/src/main/java/emu/grasscutter/game/props/SceneType.java +++ b/src/main/java/emu/grasscutter/game/props/SceneType.java @@ -1,9 +1,12 @@ package emu.grasscutter.game.props; import it.unimi.dsi.fastutil.ints.*; +import lombok.Getter; + import java.util.*; import java.util.stream.Stream; +@Getter public enum SceneType { SCENE_NONE(0), SCENE_WORLD(1), @@ -39,7 +42,4 @@ public enum SceneType { return stringMap.getOrDefault(name, SCENE_NONE); } - public int getValue() { - return value; - } } diff --git a/src/main/java/emu/grasscutter/game/props/ServerBuffType.java b/src/main/java/emu/grasscutter/game/props/ServerBuffType.java index 7393fbf9d..a55e13f3b 100644 --- a/src/main/java/emu/grasscutter/game/props/ServerBuffType.java +++ b/src/main/java/emu/grasscutter/game/props/ServerBuffType.java @@ -1,8 +1,11 @@ package emu.grasscutter.game.props; import it.unimi.dsi.fastutil.ints.*; +import lombok.Getter; + import java.util.stream.Stream; +@Getter public enum ServerBuffType { SERVER_BUFF_NONE(0), SERVER_BUFF_AVATAR(1), @@ -27,7 +30,4 @@ public enum ServerBuffType { return map.getOrDefault(value, SERVER_BUFF_NONE); } - public int getValue() { - return value; - } } diff --git a/src/main/java/emu/grasscutter/game/props/WatcherTriggerType.java b/src/main/java/emu/grasscutter/game/props/WatcherTriggerType.java index 98ae0a3c3..36c855635 100644 --- a/src/main/java/emu/grasscutter/game/props/WatcherTriggerType.java +++ b/src/main/java/emu/grasscutter/game/props/WatcherTriggerType.java @@ -1,9 +1,12 @@ package emu.grasscutter.game.props; import it.unimi.dsi.fastutil.ints.*; +import lombok.Getter; + import java.util.*; import java.util.stream.Stream; +@Getter public enum WatcherTriggerType { TRIGGER_NONE(0), TRIGGER_COMBAT_CONFIG_COMMON(1), @@ -331,7 +334,4 @@ public enum WatcherTriggerType { return stringMap.getOrDefault(name, TRIGGER_NONE); } - public int getValue() { - return value; - } } diff --git a/src/main/java/emu/grasscutter/game/props/WeaponType.java b/src/main/java/emu/grasscutter/game/props/WeaponType.java index 5d1b9640d..d70af53be 100644 --- a/src/main/java/emu/grasscutter/game/props/WeaponType.java +++ b/src/main/java/emu/grasscutter/game/props/WeaponType.java @@ -1,9 +1,12 @@ package emu.grasscutter.game.props; import it.unimi.dsi.fastutil.ints.*; +import lombok.Getter; + import java.util.*; import java.util.stream.Stream; +@Getter public enum WeaponType { WEAPON_NONE(0), WEAPON_SWORD_ONE_HAND(1, 10, 5), @@ -54,15 +57,4 @@ public enum WeaponType { return stringMap.getOrDefault(name, WEAPON_NONE); } - public int getValue() { - return value; - } - - public int getEnergyGainInitialProbability() { - return energyGainInitialProbability; - } - - public int getEnergyGainIncreaseProbability() { - return energyGainIncreaseProbability; - } } diff --git a/src/main/java/emu/grasscutter/game/quest/RewindData.java b/src/main/java/emu/grasscutter/game/quest/RewindData.java index d17ee1876..825593297 100644 --- a/src/main/java/emu/grasscutter/game/quest/RewindData.java +++ b/src/main/java/emu/grasscutter/game/quest/RewindData.java @@ -8,9 +8,10 @@ public class RewindData { AvatarData avatar; List npcs; + @Getter @Data public static class AvatarData { - @Getter private String pos; + private String pos; } @Data diff --git a/src/main/java/emu/grasscutter/game/quest/enums/LogicType.java b/src/main/java/emu/grasscutter/game/quest/enums/LogicType.java index 17d7aac83..dd2e5cd91 100644 --- a/src/main/java/emu/grasscutter/game/quest/enums/LogicType.java +++ b/src/main/java/emu/grasscutter/game/quest/enums/LogicType.java @@ -3,8 +3,11 @@ package emu.grasscutter.game.quest.enums; import emu.grasscutter.Grasscutter; import java.util.*; import java.util.function.BooleanSupplier; + +import lombok.Getter; import org.jetbrains.annotations.NotNull; +@Getter public enum LogicType { LOGIC_NONE(0), LOGIC_AND(1), @@ -89,7 +92,4 @@ public enum LogicType { } } - public int getValue() { - return value; - } } diff --git a/src/main/java/emu/grasscutter/game/quest/enums/ParentQuestState.java b/src/main/java/emu/grasscutter/game/quest/enums/ParentQuestState.java index a89b09f3a..02019c360 100644 --- a/src/main/java/emu/grasscutter/game/quest/enums/ParentQuestState.java +++ b/src/main/java/emu/grasscutter/game/quest/enums/ParentQuestState.java @@ -1,5 +1,8 @@ package emu.grasscutter.game.quest.enums; +import lombok.Getter; + +@Getter public enum ParentQuestState { PARENT_QUEST_STATE_NONE(0), PARENT_QUEST_STATE_FINISHED(1), @@ -12,7 +15,4 @@ public enum ParentQuestState { this.value = id; } - public int getValue() { - return value; - } } diff --git a/src/main/java/emu/grasscutter/game/quest/enums/QuestCond.java b/src/main/java/emu/grasscutter/game/quest/enums/QuestCond.java index 24d8fcf07..9cb1faa83 100644 --- a/src/main/java/emu/grasscutter/game/quest/enums/QuestCond.java +++ b/src/main/java/emu/grasscutter/game/quest/enums/QuestCond.java @@ -1,9 +1,12 @@ package emu.grasscutter.game.quest.enums; import it.unimi.dsi.fastutil.ints.*; +import lombok.Getter; + import java.util.*; import java.util.stream.Stream; +@Getter public enum QuestCond implements QuestTrigger { QUEST_COND_NONE(0), QUEST_COND_STATE_EQUAL(1), @@ -92,10 +95,6 @@ public enum QuestCond implements QuestTrigger { this.value = id; } - public int getValue() { - return value; - } - private static final Int2ObjectMap contentMap = new Int2ObjectOpenHashMap<>(); private static final Map contentStringMap = new HashMap<>(); diff --git a/src/main/java/emu/grasscutter/game/quest/enums/QuestContent.java b/src/main/java/emu/grasscutter/game/quest/enums/QuestContent.java index a7e66b874..053b559e5 100644 --- a/src/main/java/emu/grasscutter/game/quest/enums/QuestContent.java +++ b/src/main/java/emu/grasscutter/game/quest/enums/QuestContent.java @@ -1,9 +1,12 @@ package emu.grasscutter.game.quest.enums; import it.unimi.dsi.fastutil.ints.*; +import lombok.Getter; + import java.util.*; import java.util.stream.Stream; +@Getter public enum QuestContent implements QuestTrigger { QUEST_CONTENT_NONE(0), QUEST_CONTENT_KILL_MONSTER(1), // currently unused @@ -88,10 +91,6 @@ public enum QuestContent implements QuestTrigger { this.value = id; } - public int getValue() { - return value; - } - private static final Int2ObjectMap contentMap = new Int2ObjectOpenHashMap<>(); private static final Map contentStringMap = new HashMap<>(); diff --git a/src/main/java/emu/grasscutter/game/quest/enums/QuestExec.java b/src/main/java/emu/grasscutter/game/quest/enums/QuestExec.java index 31924ca12..2b14a98b2 100644 --- a/src/main/java/emu/grasscutter/game/quest/enums/QuestExec.java +++ b/src/main/java/emu/grasscutter/game/quest/enums/QuestExec.java @@ -1,9 +1,12 @@ package emu.grasscutter.game.quest.enums; import it.unimi.dsi.fastutil.ints.*; +import lombok.Getter; + import java.util.*; import java.util.stream.Stream; +@Getter public enum QuestExec implements QuestTrigger { QUEST_EXEC_NONE(0), QUEST_EXEC_DEL_PACK_ITEM(1), @@ -85,10 +88,6 @@ public enum QuestExec implements QuestTrigger { this.value = id; } - public int getValue() { - return value; - } - private static final Int2ObjectMap contentMap = new Int2ObjectOpenHashMap<>(); private static final Map contentStringMap = new HashMap<>(); diff --git a/src/main/java/emu/grasscutter/game/quest/enums/QuestGuideType.java b/src/main/java/emu/grasscutter/game/quest/enums/QuestGuideType.java index 90cd6ea2d..d9bbac8d4 100644 --- a/src/main/java/emu/grasscutter/game/quest/enums/QuestGuideType.java +++ b/src/main/java/emu/grasscutter/game/quest/enums/QuestGuideType.java @@ -1,5 +1,8 @@ package emu.grasscutter.game.quest.enums; +import lombok.Getter; + +@Getter public enum QuestGuideType { QUEST_GUIDE_NONE(0), QUEST_GUIDE_LOCATION(1), @@ -11,7 +14,4 @@ public enum QuestGuideType { this.value = id; } - public int getValue() { - return value; - } } diff --git a/src/main/java/emu/grasscutter/game/quest/enums/QuestShowType.java b/src/main/java/emu/grasscutter/game/quest/enums/QuestShowType.java index 2ea9c61f4..db76cdf7d 100644 --- a/src/main/java/emu/grasscutter/game/quest/enums/QuestShowType.java +++ b/src/main/java/emu/grasscutter/game/quest/enums/QuestShowType.java @@ -1,5 +1,8 @@ package emu.grasscutter.game.quest.enums; +import lombok.Getter; + +@Getter public enum QuestShowType { QUEST_SHOW(0), QUEST_HIDDEN(1); @@ -10,7 +13,4 @@ public enum QuestShowType { this.value = id; } - public int getValue() { - return value; - } } diff --git a/src/main/java/emu/grasscutter/game/quest/enums/QuestState.java b/src/main/java/emu/grasscutter/game/quest/enums/QuestState.java index 0bccccb34..692343835 100644 --- a/src/main/java/emu/grasscutter/game/quest/enums/QuestState.java +++ b/src/main/java/emu/grasscutter/game/quest/enums/QuestState.java @@ -1,7 +1,9 @@ package emu.grasscutter.game.quest.enums; import emu.grasscutter.scripts.constants.IntValueEnum; +import lombok.Getter; +@Getter public enum QuestState implements IntValueEnum { QUEST_STATE_NONE(0), QUEST_STATE_UNSTARTED(1), @@ -22,7 +24,4 @@ public enum QuestState implements IntValueEnum { this.value = id; } - public int getValue() { - return value; - } } diff --git a/src/main/java/emu/grasscutter/game/quest/enums/QuestType.java b/src/main/java/emu/grasscutter/game/quest/enums/QuestType.java index be1e31fe7..8fa4d6e75 100644 --- a/src/main/java/emu/grasscutter/game/quest/enums/QuestType.java +++ b/src/main/java/emu/grasscutter/game/quest/enums/QuestType.java @@ -1,5 +1,8 @@ package emu.grasscutter.game.quest.enums; +import lombok.Getter; + +@Getter public enum QuestType { AQ(0), FQ(1), @@ -16,7 +19,4 @@ public enum QuestType { this.value = id; } - public int getValue() { - return value; - } } diff --git a/src/main/java/emu/grasscutter/game/quest/enums/ShowQuestGuideType.java b/src/main/java/emu/grasscutter/game/quest/enums/ShowQuestGuideType.java index d59d1737b..f5c7d14d1 100644 --- a/src/main/java/emu/grasscutter/game/quest/enums/ShowQuestGuideType.java +++ b/src/main/java/emu/grasscutter/game/quest/enums/ShowQuestGuideType.java @@ -1,5 +1,8 @@ package emu.grasscutter.game.quest.enums; +import lombok.Getter; + +@Getter public enum ShowQuestGuideType { QUEST_GUIDE_ITEM_ENABLE(0), QUEST_GUIDE_ITEM_DISABLE(1), @@ -11,7 +14,4 @@ public enum ShowQuestGuideType { this.value = id; } - public int getValue() { - return value; - } } diff --git a/src/main/java/emu/grasscutter/game/shop/ShopLimit.java b/src/main/java/emu/grasscutter/game/shop/ShopLimit.java index 827826803..e75e7ef24 100644 --- a/src/main/java/emu/grasscutter/game/shop/ShopLimit.java +++ b/src/main/java/emu/grasscutter/game/shop/ShopLimit.java @@ -1,7 +1,9 @@ package emu.grasscutter.game.shop; import dev.morphia.annotations.Entity; +import lombok.Getter; +@Getter @Entity public class ShopLimit { private int shopGoodId; @@ -9,34 +11,18 @@ public class ShopLimit { private int hasBoughtInPeriod = 0; private int nextRefreshTime = 0; - public int getShopGoodId() { - return shopGoodId; - } - public void setShopGoodId(int shopGoodId) { this.shopGoodId = shopGoodId; } - public int getHasBought() { - return hasBought; - } - public void setHasBought(int hasBought) { this.hasBought = hasBought; } - public int getNextRefreshTime() { - return nextRefreshTime; - } - public void setNextRefreshTime(int nextRefreshTime) { this.nextRefreshTime = nextRefreshTime; } - public int getHasBoughtInPeriod() { - return hasBoughtInPeriod; - } - public void setHasBoughtInPeriod(int hasBoughtInPeriod) { this.hasBoughtInPeriod = hasBoughtInPeriod; } diff --git a/src/main/java/emu/grasscutter/game/shop/ShopSystem.java b/src/main/java/emu/grasscutter/game/shop/ShopSystem.java index b1e47d9f4..71c6122ab 100644 --- a/src/main/java/emu/grasscutter/game/shop/ShopSystem.java +++ b/src/main/java/emu/grasscutter/game/shop/ShopSystem.java @@ -9,11 +9,14 @@ import emu.grasscutter.data.excels.ShopGoodsData; import emu.grasscutter.server.game.*; import emu.grasscutter.utils.Utils; import it.unimi.dsi.fastutil.ints.*; +import lombok.Getter; + import java.util.*; public class ShopSystem extends BaseGameSystem { private static final int REFRESH_HOUR = 4; // In GMT+8 server private static final String TIME_ZONE = "Asia/Shanghai"; // GMT+8 Timezone + @Getter private final Int2ObjectMap> shopData; private final Int2ObjectMap> shopChestData; @@ -36,10 +39,6 @@ public class ShopSystem extends BaseGameSystem { }; } - public Int2ObjectMap> getShopData() { - return shopData; - } - public List getShopChestData(int chestId) { return this.shopChestData.get(chestId); } diff --git a/src/main/java/emu/grasscutter/game/shop/ShopTable.java b/src/main/java/emu/grasscutter/game/shop/ShopTable.java index a2990d7ff..78a8c201e 100644 --- a/src/main/java/emu/grasscutter/game/shop/ShopTable.java +++ b/src/main/java/emu/grasscutter/game/shop/ShopTable.java @@ -1,23 +1,18 @@ package emu.grasscutter.game.shop; +import lombok.Getter; + import java.util.*; +@Getter public class ShopTable { private int shopId; private List items = new ArrayList<>(); - public int getShopId() { - return shopId; - } - public void setShopId(int shopId) { this.shopId = shopId; } - public List getItems() { - return items; - } - public void setItems(List items) { this.items = items; } diff --git a/src/main/java/emu/grasscutter/game/talk/TalkExec.java b/src/main/java/emu/grasscutter/game/talk/TalkExec.java index f6a7aefde..0e92462cc 100644 --- a/src/main/java/emu/grasscutter/game/talk/TalkExec.java +++ b/src/main/java/emu/grasscutter/game/talk/TalkExec.java @@ -5,6 +5,7 @@ import java.util.*; import java.util.stream.Stream; import lombok.*; +@Getter @AllArgsConstructor public enum TalkExec { TALK_EXEC_NONE(0), @@ -56,5 +57,5 @@ public enum TalkExec { return execStringMap.getOrDefault(name, TALK_EXEC_NONE); } - @Getter private final int value; + private final int value; } diff --git a/src/main/java/emu/grasscutter/game/tower/TowerLevelRecord.java b/src/main/java/emu/grasscutter/game/tower/TowerLevelRecord.java index 245ec327d..12afe9f58 100644 --- a/src/main/java/emu/grasscutter/game/tower/TowerLevelRecord.java +++ b/src/main/java/emu/grasscutter/game/tower/TowerLevelRecord.java @@ -1,8 +1,11 @@ package emu.grasscutter.game.tower; import dev.morphia.annotations.Entity; +import lombok.Getter; + import java.util.*; +@Getter @Entity public class TowerLevelRecord { /** floorId in config */ @@ -33,26 +36,14 @@ public class TowerLevelRecord { return passedLevelMap.values().stream().mapToInt(Integer::intValue).sum(); } - public int getFloorId() { - return floorId; - } - public void setFloorId(int floorId) { this.floorId = floorId; } - public Map getPassedLevelMap() { - return passedLevelMap; - } - public void setPassedLevelMap(Map passedLevelMap) { this.passedLevelMap = passedLevelMap; } - public int getFloorStarRewardProgress() { - return floorStarRewardProgress; - } - public void setFloorStarRewardProgress(int floorStarRewardProgress) { this.floorStarRewardProgress = floorStarRewardProgress; } diff --git a/src/main/java/emu/grasscutter/game/tower/TowerScheduleConfig.java b/src/main/java/emu/grasscutter/game/tower/TowerScheduleConfig.java index ae6f86b00..c82ca6e23 100644 --- a/src/main/java/emu/grasscutter/game/tower/TowerScheduleConfig.java +++ b/src/main/java/emu/grasscutter/game/tower/TowerScheduleConfig.java @@ -1,33 +1,24 @@ package emu.grasscutter.game.tower; +import lombok.Getter; + import java.util.Date; +@Getter public class TowerScheduleConfig { private int scheduleId; private Date scheduleStartTime; private Date nextScheduleChangeTime; - public int getScheduleId() { - return scheduleId; - } - public void setScheduleId(int scheduleId) { this.scheduleId = scheduleId; } - public Date getScheduleStartTime() { - return scheduleStartTime; - } - public void setScheduleStartTime(Date scheduleStartTime) { this.scheduleStartTime = scheduleStartTime; } - public Date getNextScheduleChangeTime() { - return nextScheduleChangeTime; - } - public void setNextScheduleChangeTime(Date nextScheduleChangeTime) { this.nextScheduleChangeTime = nextScheduleChangeTime; } diff --git a/src/main/java/emu/grasscutter/game/tower/TowerSystem.java b/src/main/java/emu/grasscutter/game/tower/TowerSystem.java index 18c1036cd..5369ecb40 100644 --- a/src/main/java/emu/grasscutter/game/tower/TowerSystem.java +++ b/src/main/java/emu/grasscutter/game/tower/TowerSystem.java @@ -4,8 +4,11 @@ import emu.grasscutter.Grasscutter; import emu.grasscutter.data.*; import emu.grasscutter.data.excels.tower.TowerScheduleData; import emu.grasscutter.server.game.*; +import lombok.Getter; + import java.util.*; +@Getter public class TowerSystem extends BaseGameSystem { private TowerScheduleConfig towerScheduleConfig; @@ -23,10 +26,6 @@ public class TowerSystem extends BaseGameSystem { } } - public TowerScheduleConfig getTowerScheduleConfig() { - return towerScheduleConfig; - } - public TowerScheduleData getCurrentTowerScheduleData() { var data = GameData.getTowerScheduleDataMap().get(towerScheduleConfig.getScheduleId()); if (data == null) { diff --git a/src/main/java/emu/grasscutter/game/world/GridPosition.java b/src/main/java/emu/grasscutter/game/world/GridPosition.java index bd0e2e2ed..e7e02d5ba 100644 --- a/src/main/java/emu/grasscutter/game/world/GridPosition.java +++ b/src/main/java/emu/grasscutter/game/world/GridPosition.java @@ -6,16 +6,17 @@ import java.io.*; import java.util.List; import lombok.*; +@Getter @Entity public final class GridPosition implements Serializable { @Serial private static final long serialVersionUID = -2001232300615923575L; - @Getter @Setter private int x; + @Setter private int x; - @Getter @Setter private int z; + @Setter private int z; - @Getter @Setter private int width; + @Setter private int width; public GridPosition() {} diff --git a/src/main/java/emu/grasscutter/game/world/Location.java b/src/main/java/emu/grasscutter/game/world/Location.java index e6f5ca4fb..a1c720ee5 100644 --- a/src/main/java/emu/grasscutter/game/world/Location.java +++ b/src/main/java/emu/grasscutter/game/world/Location.java @@ -3,9 +3,11 @@ package emu.grasscutter.game.world; import dev.morphia.annotations.*; import lombok.*; +@Getter @Entity public class Location extends Position { - @Transient @Getter @Setter private Scene scene; + @Transient + @Setter private Scene scene; public Location(Scene scene, Position position) { this.set(position); diff --git a/src/main/java/emu/grasscutter/game/world/Position.java b/src/main/java/emu/grasscutter/game/world/Position.java index 0c8483a13..854c57aaa 100644 --- a/src/main/java/emu/grasscutter/game/world/Position.java +++ b/src/main/java/emu/grasscutter/game/world/Position.java @@ -12,6 +12,7 @@ import java.util.List; import lombok.*; import lombok.experimental.Accessors; +@Getter @Entity @Accessors(chain = true) public class Position implements Serializable { @@ -24,21 +25,18 @@ public class Position implements Serializable { @SerializedName( value = "x", alternate = {"_x", "X"}) - @Getter @Setter private float x; @SerializedName( value = "y", alternate = {"_y", "Y"}) - @Getter @Setter private float y; @SerializedName( value = "z", alternate = {"_z", "Z"}) - @Getter @Setter private float z; diff --git a/src/main/java/emu/grasscutter/game/world/SpawnDataEntry.java b/src/main/java/emu/grasscutter/game/world/SpawnDataEntry.java index 8e903c469..0c9d3e2ce 100644 --- a/src/main/java/emu/grasscutter/game/world/SpawnDataEntry.java +++ b/src/main/java/emu/grasscutter/game/world/SpawnDataEntry.java @@ -4,17 +4,18 @@ import emu.grasscutter.data.GameDepot; import java.util.*; import lombok.*; +@Getter public class SpawnDataEntry { - @Getter @Setter private transient SpawnGroupEntry group; - @Getter private int monsterId; - @Getter private int gadgetId; - @Getter private int configId; - @Getter private int level; - @Getter private int poseId; - @Getter private int gatherItemId; - @Getter private int gadgetState; - @Getter private Position pos; - @Getter private Position rot; + @Setter private transient SpawnGroupEntry group; + private int monsterId; + private int gadgetId; + private int configId; + private int level; + private int poseId; + private int gatherItemId; + private int gadgetState; + private Position pos; + private Position rot; public GridBlockId getBlockId() { int scale = GridBlockId.getScale(gadgetId); @@ -25,18 +26,20 @@ public class SpawnDataEntry { (int) (pos.getZ() / GameDepot.BLOCK_SIZE[scale])); } + @Getter public static class SpawnGroupEntry { - @Getter private int sceneId; - @Getter private int groupId; - @Getter private int blockId; - @Getter @Setter private List spawns; + private int sceneId; + private int groupId; + private int blockId; + @Setter private List spawns; } + @Getter public static class GridBlockId { - @Getter private final int sceneId; - @Getter private final int scale; - @Getter private final int x; - @Getter private final int z; + private final int sceneId; + private final int scale; + private final int x; + private final int z; public GridBlockId(int sceneId, int scale, int x, int z) { this.sceneId = sceneId; diff --git a/src/main/java/emu/grasscutter/game/world/World.java b/src/main/java/emu/grasscutter/game/world/World.java index 115a57c80..bc7c6b8b7 100644 --- a/src/main/java/emu/grasscutter/game/world/World.java +++ b/src/main/java/emu/grasscutter/game/world/World.java @@ -51,6 +51,7 @@ public class World implements Iterable { @Getter private final EntityWorld entity; private int nextEntityId = 0; private int nextPeerId = 0; + @Getter private int worldLevel; @Getter private boolean isMultiplayer = false; @@ -121,10 +122,6 @@ public class World implements Iterable { return ++this.nextPeerId; } - public int getWorldLevel() { - return worldLevel; - } - public void setWorldLevel(int worldLevel) { this.worldLevel = worldLevel; } diff --git a/src/main/java/emu/grasscutter/game/world/WorldDataSystem.java b/src/main/java/emu/grasscutter/game/world/WorldDataSystem.java index 39bc93717..5dd2d10bf 100644 --- a/src/main/java/emu/grasscutter/game/world/WorldDataSystem.java +++ b/src/main/java/emu/grasscutter/game/world/WorldDataSystem.java @@ -11,9 +11,12 @@ import emu.grasscutter.scripts.data.*; import emu.grasscutter.server.game.*; import java.util.*; import java.util.concurrent.ConcurrentHashMap; + +import lombok.Getter; import org.luaj.vm2.LuaError; public class WorldDataSystem extends BaseGameSystem { + @Getter private final Map chestInteractHandlerMap; // chestType-Handler private final Map sceneInvestigationGroupMap; // @@ -44,10 +47,6 @@ public class WorldDataSystem extends BaseGameSystem { } } - public Map getChestInteractHandlerMap() { - return chestInteractHandlerMap; - } - public RewardPreviewData getRewardByBossId(int monsterId) { var investigationMonsterData = GameData.getInvestigationMonsterDataMap().values().parallelStream() diff --git a/src/main/java/emu/grasscutter/net/packet/BasePacket.java b/src/main/java/emu/grasscutter/net/packet/BasePacket.java index da9a9436b..e6bf489f6 100644 --- a/src/main/java/emu/grasscutter/net/packet/BasePacket.java +++ b/src/main/java/emu/grasscutter/net/packet/BasePacket.java @@ -2,15 +2,20 @@ package emu.grasscutter.net.packet; import com.google.protobuf.GeneratedMessageV3; import emu.grasscutter.net.proto.PacketHeadOuterClass.PacketHead; +import lombok.Getter; + import java.io.*; public class BasePacket { private static final int const1 = 17767; // 0x4567 private static final int const2 = -30293; // 0x89ab public final boolean shouldEncrypt = true; + @Getter private int opcode; private boolean shouldBuildHeader = false; + @Getter private byte[] header; + @Getter private byte[] data; // Encryption private boolean useDispatchKey; @@ -29,10 +34,6 @@ public class BasePacket { this.shouldBuildHeader = buildHeader; } - public int getOpcode() { - return opcode; - } - public void setOpcode(int opcode) { this.opcode = opcode; } @@ -45,10 +46,6 @@ public class BasePacket { this.useDispatchKey = useDispatchKey; } - public byte[] getHeader() { - return header; - } - public void setHeader(byte[] header) { this.header = header; } @@ -57,10 +54,6 @@ public class BasePacket { return shouldBuildHeader; } - public byte[] getData() { - return data; - } - public void setData(byte[] data) { this.data = data; } diff --git a/src/main/java/emu/grasscutter/plugin/api/ServerHelper.java b/src/main/java/emu/grasscutter/plugin/api/ServerHelper.java index 67bc2f023..852a28246 100644 --- a/src/main/java/emu/grasscutter/plugin/api/ServerHelper.java +++ b/src/main/java/emu/grasscutter/plugin/api/ServerHelper.java @@ -7,11 +7,20 @@ import emu.grasscutter.game.player.Player; import emu.grasscutter.server.game.GameServer; import emu.grasscutter.server.http.*; import emu.grasscutter.server.scheduler.ServerTaskScheduler; +import lombok.Getter; + import java.util.*; import java.util.stream.Stream; /** Hooks into the {@link GameServer} class, adding convenient ways to do certain things. */ public final class ServerHelper { + /** + * -- GETTER -- + * Gets the server hook instance. + * + * @return A {@link ServerHelper} singleton. + */ + @Getter private static ServerHelper instance; private final GameServer gameServer; private final HttpServer httpServer; @@ -29,15 +38,6 @@ public final class ServerHelper { instance = this; } - /** - * Gets the server hook instance. - * - * @return A {@link ServerHelper} singleton. - */ - public static ServerHelper getInstance() { - return instance; - } - /** * @return The server's current run mode. */ diff --git a/src/main/java/emu/grasscutter/scripts/SceneScriptManager.java b/src/main/java/emu/grasscutter/scripts/SceneScriptManager.java index f37f57ebe..30bb4fe3e 100644 --- a/src/main/java/emu/grasscutter/scripts/SceneScriptManager.java +++ b/src/main/java/emu/grasscutter/scripts/SceneScriptManager.java @@ -30,11 +30,13 @@ import java.util.concurrent.atomic.AtomicInteger; import java.util.stream.Collectors; import javax.annotation.*; import kotlin.Pair; +import lombok.Getter; import lombok.val; import org.luaj.vm2.*; import org.luaj.vm2.lib.jse.CoerceJavaToLua; public class SceneScriptManager { + @Getter private final Scene scene; private final Map variables; private SceneMeta meta; @@ -54,9 +56,12 @@ public class SceneScriptManager { private final Map sceneGroups; private final Map sceneGroupsInstances; private final Map cachedSceneGroupsInstances; + @Getter private ScriptMonsterTideService scriptMonsterTideService; + @Getter private final ScriptMonsterSpawnService scriptMonsterSpawnService; /** blockid - loaded groupSet */ + @Getter private final Map> loadedGroupSetPerBlock; private static final Int2ObjectMap> groupGridsCache = new Int2ObjectOpenHashMap<>(); @@ -100,10 +105,6 @@ public class SceneScriptManager { new Thread(this::init).start(); } - public Scene getScene() { - return scene; - } - public SceneConfig getConfig() { for (int i = 0; i < 10; ++i) { if (this.isInit) { @@ -385,10 +386,6 @@ public class SceneScriptManager { .ifPresent(entityRegion -> this.regions.remove(entityRegion.getId())); } - public Map> getLoadedGroupSetPerBlock() { - return loadedGroupSetPerBlock; - } - // TODO optimize public SceneGroup getGroupById(int groupId) { for (var block : getBlocks().values()) { @@ -1009,14 +1006,6 @@ public class SceneScriptManager { } } - public ScriptMonsterTideService getScriptMonsterTideService() { - return scriptMonsterTideService; - } - - public ScriptMonsterSpawnService getScriptMonsterSpawnService() { - return scriptMonsterSpawnService; - } - public EntityGadget createGadget(int groupId, int blockId, SceneGadget g) { return createGadget(groupId, blockId, g, g.state); } diff --git a/src/main/java/emu/grasscutter/scripts/data/SceneBlock.java b/src/main/java/emu/grasscutter/scripts/data/SceneBlock.java index 16bc5ac14..58138fa27 100644 --- a/src/main/java/emu/grasscutter/scripts/data/SceneBlock.java +++ b/src/main/java/emu/grasscutter/scripts/data/SceneBlock.java @@ -22,12 +22,9 @@ public class SceneBlock { public Map groups; public RTree sceneGroupIndex; + @Getter private transient boolean loaded; // Not an actual variable in the scripts either - public boolean isLoaded() { - return this.loaded; - } - public void setLoaded(boolean loaded) { this.loaded = loaded; } diff --git a/src/main/java/emu/grasscutter/scripts/data/SceneGroup.java b/src/main/java/emu/grasscutter/scripts/data/SceneGroup.java index de1a0ef8c..9728ca900 100644 --- a/src/main/java/emu/grasscutter/scripts/data/SceneGroup.java +++ b/src/main/java/emu/grasscutter/scripts/data/SceneGroup.java @@ -37,8 +37,11 @@ public final class SceneGroup { public SceneReplaceable is_replaceable; /* These are not script variables. */ + @Getter private transient boolean loaded; + @Getter private transient CompiledScript script; + @Getter private transient Bindings bindings; public String overrideScriptPath; @@ -48,10 +51,6 @@ public final class SceneGroup { return group; } - public boolean isLoaded() { - return this.loaded; - } - public void setLoaded(boolean loaded) { this.loaded = loaded; } @@ -64,10 +63,6 @@ public final class SceneGroup { return this.garbages == null ? null : this.garbages.gadgets; } - public CompiledScript getScript() { - return this.script; - } - public SceneSuite getSuiteByIndex(int index) { if (index < 1 || index > suites.size()) { return null; @@ -75,10 +70,6 @@ public final class SceneGroup { return this.suites.get(index - 1); } - public Bindings getBindings() { - return this.bindings; - } - public synchronized SceneGroup load(int sceneId) { if (this.loaded) { return this; diff --git a/src/main/java/emu/grasscutter/scripts/data/ScriptArgs.java b/src/main/java/emu/grasscutter/scripts/data/ScriptArgs.java index 9e607861c..883c66e0b 100644 --- a/src/main/java/emu/grasscutter/scripts/data/ScriptArgs.java +++ b/src/main/java/emu/grasscutter/scripts/data/ScriptArgs.java @@ -1,11 +1,15 @@ package emu.grasscutter.scripts.data; +import lombok.Getter; import lombok.ToString; @ToString public class ScriptArgs { + @Getter public int param1; + @Getter public int param2; + @Getter public int param3; public int source_eid; // Source entity public int target_eid; @@ -28,28 +32,16 @@ public class ScriptArgs { this.param2 = param2; } - public int getParam1() { - return param1; - } - public ScriptArgs setParam1(int param1) { this.param1 = param1; return this; } - public int getParam2() { - return param2; - } - public ScriptArgs setParam2(int param2) { this.param2 = param2; return this; } - public int getParam3() { - return param3; - } - public ScriptArgs setParam3(int param3) { this.param3 = param3; return this; diff --git a/src/main/java/emu/grasscutter/server/dispatch/DispatchClient.java b/src/main/java/emu/grasscutter/server/dispatch/DispatchClient.java index 80d943ee8..e663d2892 100644 --- a/src/main/java/emu/grasscutter/server/dispatch/DispatchClient.java +++ b/src/main/java/emu/grasscutter/server/dispatch/DispatchClient.java @@ -21,11 +21,12 @@ import org.java_websocket.client.WebSocketClient; import org.java_websocket.handshake.ServerHandshake; import org.slf4j.Logger; +@Getter public final class DispatchClient extends WebSocketClient implements IDispatcher { - @Getter private final Logger logger = Grasscutter.getLogger(); - @Getter private final Map> handlers = new HashMap<>(); + private final Logger logger = Grasscutter.getLogger(); + private final Map> handlers = new HashMap<>(); - @Getter private final Map>> callbacks = new HashMap<>(); + private final Map>> callbacks = new HashMap<>(); public DispatchClient(URI serverUri) { super(serverUri); diff --git a/src/main/java/emu/grasscutter/server/dispatch/DispatchServer.java b/src/main/java/emu/grasscutter/server/dispatch/DispatchServer.java index 0427ede80..e58309a1d 100644 --- a/src/main/java/emu/grasscutter/server/dispatch/DispatchServer.java +++ b/src/main/java/emu/grasscutter/server/dispatch/DispatchServer.java @@ -19,11 +19,12 @@ import org.java_websocket.server.WebSocketServer; import org.slf4j.Logger; /* Internal communications server. */ +@Getter public final class DispatchServer extends WebSocketServer implements IDispatcher { - @Getter private final Logger logger = Grasscutter.getLogger(); - @Getter private final Map> handlers = new HashMap<>(); + private final Logger logger = Grasscutter.getLogger(); + private final Map> handlers = new HashMap<>(); - @Getter private final Map>> callbacks = new HashMap<>(); + private final Map>> callbacks = new HashMap<>(); /** * Constructs a new {@code DispatchServer} instance. diff --git a/src/main/java/emu/grasscutter/server/event/EventHandler.java b/src/main/java/emu/grasscutter/server/event/EventHandler.java index c43cfc1a3..d9b0450b3 100644 --- a/src/main/java/emu/grasscutter/server/event/EventHandler.java +++ b/src/main/java/emu/grasscutter/server/event/EventHandler.java @@ -3,6 +3,7 @@ package emu.grasscutter.server.event; import emu.grasscutter.Grasscutter; import emu.grasscutter.plugin.Plugin; import emu.grasscutter.utils.objects.EventConsumer; +import lombok.Getter; public final class EventHandler { /** @@ -57,6 +58,13 @@ public final class EventHandler { private final Class eventClass; private EventConsumer listener; + /** + * -- GETTER -- + * Returns the handler's priority. + * + * @return The priority of the handler. + */ + @Getter private HandlerPriority priority; private boolean handleCanceled; private Plugin plugin; @@ -83,15 +91,6 @@ public final class EventHandler { return this.listener; } - /** - * Returns the handler's priority. - * - * @return The priority of the handler. - */ - public HandlerPriority getPriority() { - return this.priority; - } - /** * Returns if the handler will ignore cancelled events. * diff --git a/src/main/java/emu/grasscutter/server/event/dispatch/QueryAllRegionsEvent.java b/src/main/java/emu/grasscutter/server/event/dispatch/QueryAllRegionsEvent.java index 937f9f8f7..e2f4c3439 100644 --- a/src/main/java/emu/grasscutter/server/event/dispatch/QueryAllRegionsEvent.java +++ b/src/main/java/emu/grasscutter/server/event/dispatch/QueryAllRegionsEvent.java @@ -1,7 +1,9 @@ package emu.grasscutter.server.event.dispatch; import emu.grasscutter.server.event.types.ServerEvent; +import lombok.Getter; +@Getter public final class QueryAllRegionsEvent extends ServerEvent { private String regionList; @@ -11,10 +13,6 @@ public final class QueryAllRegionsEvent extends ServerEvent { this.regionList = regionList; } - public String getRegionList() { - return this.regionList; - } - public void setRegionList(String regionList) { this.regionList = regionList; } diff --git a/src/main/java/emu/grasscutter/server/event/dispatch/QueryCurrentRegionEvent.java b/src/main/java/emu/grasscutter/server/event/dispatch/QueryCurrentRegionEvent.java index 6ae59362d..c0a8e4743 100644 --- a/src/main/java/emu/grasscutter/server/event/dispatch/QueryCurrentRegionEvent.java +++ b/src/main/java/emu/grasscutter/server/event/dispatch/QueryCurrentRegionEvent.java @@ -1,7 +1,9 @@ package emu.grasscutter.server.event.dispatch; import emu.grasscutter.server.event.types.ServerEvent; +import lombok.Getter; +@Getter public final class QueryCurrentRegionEvent extends ServerEvent { private String regionInfo; @@ -11,10 +13,6 @@ public final class QueryCurrentRegionEvent extends ServerEvent { this.regionInfo = regionInfo; } - public String getRegionInfo() { - return this.regionInfo; - } - public void setRegionInfo(String regionInfo) { this.regionInfo = regionInfo; } diff --git a/src/main/java/emu/grasscutter/server/event/entity/EntityCreationEvent.java b/src/main/java/emu/grasscutter/server/event/entity/EntityCreationEvent.java index c59408fdd..e6dc26fe9 100644 --- a/src/main/java/emu/grasscutter/server/event/entity/EntityCreationEvent.java +++ b/src/main/java/emu/grasscutter/server/event/entity/EntityCreationEvent.java @@ -6,6 +6,7 @@ import javax.annotation.Nullable; import lombok.*; /** Invoked when an entity is created. */ +@Getter @AllArgsConstructor public final class EntityCreationEvent extends Event { /** @@ -21,9 +22,9 @@ public final class EntityCreationEvent extends Event { return type.cast(event.getEntity()); } - @Getter @Setter private Class entityType; - @Getter @Setter private Class[] constructorArgTypes; - @Getter @Setter private Object[] constructorArgs; + @Setter private Class entityType; + @Setter private Class[] constructorArgTypes; + @Setter private Object[] constructorArgs; /** * Creates a new entity. Returns null if the entity could not be created. diff --git a/src/main/java/emu/grasscutter/server/event/entity/EntityDamageEvent.java b/src/main/java/emu/grasscutter/server/event/entity/EntityDamageEvent.java index 34527941a..8995fe15e 100644 --- a/src/main/java/emu/grasscutter/server/event/entity/EntityDamageEvent.java +++ b/src/main/java/emu/grasscutter/server/event/entity/EntityDamageEvent.java @@ -7,10 +7,11 @@ import emu.grasscutter.server.event.types.EntityEvent; import javax.annotation.Nullable; import lombok.*; +@Getter public final class EntityDamageEvent extends EntityEvent implements Cancellable { - @Getter @Setter private float damage; - @Getter @Setter private ElementType attackElementType; - @Getter @Nullable private final GameEntity damager; + @Setter private float damage; + @Setter private ElementType attackElementType; + @Nullable private final GameEntity damager; public EntityDamageEvent( GameEntity entity, diff --git a/src/main/java/emu/grasscutter/server/event/entity/EntityDeathEvent.java b/src/main/java/emu/grasscutter/server/event/entity/EntityDeathEvent.java index 2f6c3c1df..4a8d40215 100644 --- a/src/main/java/emu/grasscutter/server/event/entity/EntityDeathEvent.java +++ b/src/main/java/emu/grasscutter/server/event/entity/EntityDeathEvent.java @@ -6,9 +6,10 @@ import emu.grasscutter.server.event.types.EntityEvent; import javax.annotation.Nullable; import lombok.Getter; +@Getter public final class EntityDeathEvent extends EntityEvent { - @Getter private final Location deathLocation; - @Getter @Nullable private final GameEntity killer; + private final Location deathLocation; + @Nullable private final GameEntity killer; public EntityDeathEvent(GameEntity entity, int killerId) { super(entity); diff --git a/src/main/java/emu/grasscutter/server/event/entity/EntityMoveEvent.java b/src/main/java/emu/grasscutter/server/event/entity/EntityMoveEvent.java index 7c0bcc54f..410458818 100644 --- a/src/main/java/emu/grasscutter/server/event/entity/EntityMoveEvent.java +++ b/src/main/java/emu/grasscutter/server/event/entity/EntityMoveEvent.java @@ -4,7 +4,9 @@ import emu.grasscutter.game.entity.GameEntity; import emu.grasscutter.game.world.Position; import emu.grasscutter.net.proto.MotionStateOuterClass.MotionState; import emu.grasscutter.server.event.types.EntityEvent; +import lombok.Getter; +@Getter public final class EntityMoveEvent extends EntityEvent { private final Position position, rotation; private final MotionState motionState; @@ -18,15 +20,4 @@ public final class EntityMoveEvent extends EntityEvent { this.motionState = motionState; } - public Position getPosition() { - return this.position; - } - - public Position getRotation() { - return this.rotation; - } - - public MotionState getMotionState() { - return this.motionState; - } } diff --git a/src/main/java/emu/grasscutter/server/event/game/PlayerCreationEvent.java b/src/main/java/emu/grasscutter/server/event/game/PlayerCreationEvent.java index 24cf09235..b234c8e1c 100644 --- a/src/main/java/emu/grasscutter/server/event/game/PlayerCreationEvent.java +++ b/src/main/java/emu/grasscutter/server/event/game/PlayerCreationEvent.java @@ -3,7 +3,9 @@ package emu.grasscutter.server.event.game; import emu.grasscutter.game.player.Player; import emu.grasscutter.server.event.types.GameEvent; import emu.grasscutter.server.game.GameSession; +import lombok.Getter; +@Getter public final class PlayerCreationEvent extends GameEvent { private final GameSession session; private Class playerClass; @@ -13,14 +15,6 @@ public final class PlayerCreationEvent extends GameEvent { this.playerClass = playerClass; } - public GameSession getSession() { - return this.session; - } - - public Class getPlayerClass() { - return this.playerClass; - } - public void setPlayerClass(Class playerClass) { this.playerClass = playerClass; } diff --git a/src/main/java/emu/grasscutter/server/event/game/ReceiveCommandFeedbackEvent.java b/src/main/java/emu/grasscutter/server/event/game/ReceiveCommandFeedbackEvent.java index b0c14e2f0..5709deb30 100644 --- a/src/main/java/emu/grasscutter/server/event/game/ReceiveCommandFeedbackEvent.java +++ b/src/main/java/emu/grasscutter/server/event/game/ReceiveCommandFeedbackEvent.java @@ -3,10 +3,13 @@ package emu.grasscutter.server.event.game; import emu.grasscutter.game.player.Player; import emu.grasscutter.server.event.Cancellable; import emu.grasscutter.server.event.types.ServerEvent; +import lombok.Getter; + import javax.annotation.Nullable; public final class ReceiveCommandFeedbackEvent extends ServerEvent implements Cancellable { @Nullable private final Player player; + @Getter private String message; public ReceiveCommandFeedbackEvent(@Nullable Player player, String message) { @@ -16,10 +19,6 @@ public final class ReceiveCommandFeedbackEvent extends ServerEvent implements Ca this.message = message; } - public String getMessage() { - return this.message; - } - public void setMessage(String message) { this.message = message; } diff --git a/src/main/java/emu/grasscutter/server/event/game/ReceivePacketEvent.java b/src/main/java/emu/grasscutter/server/event/game/ReceivePacketEvent.java index 4f21297cf..8eab8e2c9 100644 --- a/src/main/java/emu/grasscutter/server/event/game/ReceivePacketEvent.java +++ b/src/main/java/emu/grasscutter/server/event/game/ReceivePacketEvent.java @@ -3,7 +3,9 @@ package emu.grasscutter.server.event.game; import emu.grasscutter.server.event.Cancellable; import emu.grasscutter.server.event.types.ServerEvent; import emu.grasscutter.server.game.GameSession; +import lombok.Getter; +@Getter public final class ReceivePacketEvent extends ServerEvent implements Cancellable { private final GameSession gameSession; private final int packetId; @@ -17,18 +19,6 @@ public final class ReceivePacketEvent extends ServerEvent implements Cancellable this.packetData = packetData; } - public GameSession getGameSession() { - return this.gameSession; - } - - public int getPacketId() { - return this.packetId; - } - - public byte[] getPacketData() { - return this.packetData; - } - public void setPacketData(byte[] packetData) { this.packetData = packetData; } diff --git a/src/main/java/emu/grasscutter/server/event/game/SendPacketEvent.java b/src/main/java/emu/grasscutter/server/event/game/SendPacketEvent.java index 7a6125ba7..b37722bd4 100644 --- a/src/main/java/emu/grasscutter/server/event/game/SendPacketEvent.java +++ b/src/main/java/emu/grasscutter/server/event/game/SendPacketEvent.java @@ -4,7 +4,9 @@ import emu.grasscutter.net.packet.BasePacket; import emu.grasscutter.server.event.Cancellable; import emu.grasscutter.server.event.types.ServerEvent; import emu.grasscutter.server.game.GameSession; +import lombok.Getter; +@Getter public final class SendPacketEvent extends ServerEvent implements Cancellable { private final GameSession gameSession; private BasePacket packet; @@ -16,14 +18,6 @@ public final class SendPacketEvent extends ServerEvent implements Cancellable { this.packet = packet; } - public GameSession getGameSession() { - return this.gameSession; - } - - public BasePacket getPacket() { - return this.packet; - } - public void setPacket(BasePacket packet) { this.packet = packet; } diff --git a/src/main/java/emu/grasscutter/server/event/internal/ServerLogEvent.java b/src/main/java/emu/grasscutter/server/event/internal/ServerLogEvent.java index 911e6d0fc..121271b9f 100644 --- a/src/main/java/emu/grasscutter/server/event/internal/ServerLogEvent.java +++ b/src/main/java/emu/grasscutter/server/event/internal/ServerLogEvent.java @@ -2,7 +2,9 @@ package emu.grasscutter.server.event.internal; import ch.qos.logback.classic.spi.ILoggingEvent; import emu.grasscutter.server.event.types.ServerEvent; +import lombok.Getter; +@Getter public final class ServerLogEvent extends ServerEvent { private final ILoggingEvent loggingEvent; private final String consoleMessage; @@ -14,11 +16,4 @@ public final class ServerLogEvent extends ServerEvent { this.consoleMessage = consoleMessage; } - public ILoggingEvent getLoggingEvent() { - return this.loggingEvent; - } - - public String getConsoleMessage() { - return this.consoleMessage; - } } diff --git a/src/main/java/emu/grasscutter/server/event/internal/ServerStartEvent.java b/src/main/java/emu/grasscutter/server/event/internal/ServerStartEvent.java index a5e60d7e4..e9951098b 100644 --- a/src/main/java/emu/grasscutter/server/event/internal/ServerStartEvent.java +++ b/src/main/java/emu/grasscutter/server/event/internal/ServerStartEvent.java @@ -1,8 +1,11 @@ package emu.grasscutter.server.event.internal; import emu.grasscutter.server.event.types.ServerEvent; +import lombok.Getter; + import java.time.OffsetDateTime; +@Getter public final class ServerStartEvent extends ServerEvent { private final OffsetDateTime startTime; @@ -12,7 +15,4 @@ public final class ServerStartEvent extends ServerEvent { this.startTime = startTime; } - public OffsetDateTime getStartTime() { - return this.startTime; - } } diff --git a/src/main/java/emu/grasscutter/server/event/internal/ServerStopEvent.java b/src/main/java/emu/grasscutter/server/event/internal/ServerStopEvent.java index 2fc6bc6a4..eff1b97c7 100644 --- a/src/main/java/emu/grasscutter/server/event/internal/ServerStopEvent.java +++ b/src/main/java/emu/grasscutter/server/event/internal/ServerStopEvent.java @@ -1,8 +1,11 @@ package emu.grasscutter.server.event.internal; import emu.grasscutter.server.event.types.ServerEvent; +import lombok.Getter; + import java.time.OffsetDateTime; +@Getter public final class ServerStopEvent extends ServerEvent { private final OffsetDateTime stopTime; @@ -12,7 +15,4 @@ public final class ServerStopEvent extends ServerEvent { this.stopTime = stopTime; } - public OffsetDateTime getStopTime() { - return this.stopTime; - } } diff --git a/src/main/java/emu/grasscutter/server/event/player/PlayerCompleteQuestEvent.java b/src/main/java/emu/grasscutter/server/event/player/PlayerCompleteQuestEvent.java index 255d1b281..54beed142 100644 --- a/src/main/java/emu/grasscutter/server/event/player/PlayerCompleteQuestEvent.java +++ b/src/main/java/emu/grasscutter/server/event/player/PlayerCompleteQuestEvent.java @@ -6,8 +6,9 @@ import emu.grasscutter.server.event.Cancellable; import emu.grasscutter.server.event.types.PlayerEvent; import lombok.Getter; +@Getter public final class PlayerCompleteQuestEvent extends PlayerEvent implements Cancellable { - @Getter private final GameQuest quest; + private final GameQuest quest; public PlayerCompleteQuestEvent(Player player, GameQuest quest) { super(player); diff --git a/src/main/java/emu/grasscutter/server/event/player/PlayerEnterAreaEvent.java b/src/main/java/emu/grasscutter/server/event/player/PlayerEnterAreaEvent.java index 88c48c25e..ef040cdaf 100644 --- a/src/main/java/emu/grasscutter/server/event/player/PlayerEnterAreaEvent.java +++ b/src/main/java/emu/grasscutter/server/event/player/PlayerEnterAreaEvent.java @@ -4,8 +4,9 @@ import emu.grasscutter.game.player.Player; import emu.grasscutter.server.event.types.PlayerEvent; import lombok.Getter; +@Getter public final class PlayerEnterAreaEvent extends PlayerEvent { - @Getter private final int areaId, areaType; + private final int areaId, areaType; public PlayerEnterAreaEvent(Player player) { super(player); diff --git a/src/main/java/emu/grasscutter/server/event/player/PlayerEnterDungeonEvent.java b/src/main/java/emu/grasscutter/server/event/player/PlayerEnterDungeonEvent.java index b976e99b1..4e49272d7 100644 --- a/src/main/java/emu/grasscutter/server/event/player/PlayerEnterDungeonEvent.java +++ b/src/main/java/emu/grasscutter/server/event/player/PlayerEnterDungeonEvent.java @@ -5,8 +5,9 @@ import emu.grasscutter.game.player.Player; import emu.grasscutter.server.event.types.PlayerEvent; import lombok.Getter; +@Getter public final class PlayerEnterDungeonEvent extends PlayerEvent { - @Getter private final DungeonData dungeon; + private final DungeonData dungeon; public PlayerEnterDungeonEvent(Player player, DungeonData dungeon) { super(player); diff --git a/src/main/java/emu/grasscutter/server/event/player/PlayerForgeItemEvent.java b/src/main/java/emu/grasscutter/server/event/player/PlayerForgeItemEvent.java index d669762a4..42681438f 100644 --- a/src/main/java/emu/grasscutter/server/event/player/PlayerForgeItemEvent.java +++ b/src/main/java/emu/grasscutter/server/event/player/PlayerForgeItemEvent.java @@ -5,8 +5,9 @@ import emu.grasscutter.game.player.Player; import emu.grasscutter.server.event.types.PlayerEvent; import lombok.*; +@Getter public final class PlayerForgeItemEvent extends PlayerEvent { - @Getter @Setter private GameItem itemForged; + @Setter private GameItem itemForged; public PlayerForgeItemEvent(Player player, GameItem itemForged) { super(player); diff --git a/src/main/java/emu/grasscutter/server/event/player/PlayerOpenChestEvent.java b/src/main/java/emu/grasscutter/server/event/player/PlayerOpenChestEvent.java index e397ff33b..9d6059226 100644 --- a/src/main/java/emu/grasscutter/server/event/player/PlayerOpenChestEvent.java +++ b/src/main/java/emu/grasscutter/server/event/player/PlayerOpenChestEvent.java @@ -5,7 +5,9 @@ import emu.grasscutter.game.player.Player; import emu.grasscutter.game.world.ChestReward; import emu.grasscutter.server.event.Cancellable; import emu.grasscutter.server.event.types.PlayerEvent; +import lombok.Getter; +@Getter public final class PlayerOpenChestEvent extends PlayerEvent implements Cancellable { private final GadgetChest chest; private ChestReward reward; @@ -17,15 +19,8 @@ public final class PlayerOpenChestEvent extends PlayerEvent implements Cancellab this.reward = reward; } - public GadgetChest getChest() { - return this.chest; - } - public void setReward(ChestReward reward) { this.reward = reward; } - public ChestReward getReward() { - return this.reward; - } } diff --git a/src/main/java/emu/grasscutter/server/event/player/PlayerReceiveMailEvent.java b/src/main/java/emu/grasscutter/server/event/player/PlayerReceiveMailEvent.java index c008a9783..c71ef50f8 100644 --- a/src/main/java/emu/grasscutter/server/event/player/PlayerReceiveMailEvent.java +++ b/src/main/java/emu/grasscutter/server/event/player/PlayerReceiveMailEvent.java @@ -4,7 +4,9 @@ import emu.grasscutter.game.mail.Mail; import emu.grasscutter.game.player.Player; import emu.grasscutter.server.event.Cancellable; import emu.grasscutter.server.event.types.PlayerEvent; +import lombok.Getter; +@Getter public final class PlayerReceiveMailEvent extends PlayerEvent implements Cancellable { private Mail message; @@ -14,10 +16,6 @@ public final class PlayerReceiveMailEvent extends PlayerEvent implements Cancell this.message = message; } - public Mail getMessage() { - return this.message; - } - public void setMessage(Mail message) { this.message = message; } diff --git a/src/main/java/emu/grasscutter/server/event/player/PlayerTeamDeathEvent.java b/src/main/java/emu/grasscutter/server/event/player/PlayerTeamDeathEvent.java index 524d27078..84f7771d2 100644 --- a/src/main/java/emu/grasscutter/server/event/player/PlayerTeamDeathEvent.java +++ b/src/main/java/emu/grasscutter/server/event/player/PlayerTeamDeathEvent.java @@ -9,8 +9,9 @@ import lombok.Getter; * This event is invoked when the ENTIRE TEAM dies. To listen for one player death, use {@link * emu.grasscutter.server.event.entity.EntityDeathEvent}. */ +@Getter public final class PlayerTeamDeathEvent extends PlayerEvent { - @Getter private final EntityAvatar selectedAvatar; + private final EntityAvatar selectedAvatar; public PlayerTeamDeathEvent(Player player, EntityAvatar selectedAvatar) { super(player); diff --git a/src/main/java/emu/grasscutter/server/event/player/PlayerUseFoodEvent.java b/src/main/java/emu/grasscutter/server/event/player/PlayerUseFoodEvent.java index d5482e93f..e04a14766 100644 --- a/src/main/java/emu/grasscutter/server/event/player/PlayerUseFoodEvent.java +++ b/src/main/java/emu/grasscutter/server/event/player/PlayerUseFoodEvent.java @@ -8,9 +8,10 @@ import emu.grasscutter.server.event.types.PlayerEvent; import lombok.*; /** This event is invoked when the player uses food on an avatar. */ +@Getter public final class PlayerUseFoodEvent extends PlayerEvent implements Cancellable { - @Getter private final EntityAvatar selectedAvatar; - @Getter @Setter private ItemData foodUsed; + private final EntityAvatar selectedAvatar; + @Setter private ItemData foodUsed; public PlayerUseFoodEvent(Player player, ItemData foodUsed, EntityAvatar selectedAvatar) { super(player); diff --git a/src/main/java/emu/grasscutter/server/event/types/EntityEvent.java b/src/main/java/emu/grasscutter/server/event/types/EntityEvent.java index e009612ad..12948bdbf 100644 --- a/src/main/java/emu/grasscutter/server/event/types/EntityEvent.java +++ b/src/main/java/emu/grasscutter/server/event/types/EntityEvent.java @@ -2,8 +2,10 @@ package emu.grasscutter.server.event.types; import emu.grasscutter.game.entity.GameEntity; import emu.grasscutter.server.event.Event; +import lombok.Getter; /** An event that is related to entity interactions. */ +@Getter public abstract class EntityEvent extends Event { protected final GameEntity entity; @@ -11,7 +13,4 @@ public abstract class EntityEvent extends Event { this.entity = entity; } - public GameEntity getEntity() { - return this.entity; - } } diff --git a/src/main/java/emu/grasscutter/server/event/types/PlayerEvent.java b/src/main/java/emu/grasscutter/server/event/types/PlayerEvent.java index 2d1a77492..b506f95e5 100644 --- a/src/main/java/emu/grasscutter/server/event/types/PlayerEvent.java +++ b/src/main/java/emu/grasscutter/server/event/types/PlayerEvent.java @@ -2,8 +2,10 @@ package emu.grasscutter.server.event.types; import emu.grasscutter.game.player.Player; import emu.grasscutter.server.event.Event; +import lombok.Getter; /** An event that is related to player interactions. */ +@Getter public abstract class PlayerEvent extends Event { protected final Player player; @@ -11,7 +13,4 @@ public abstract class PlayerEvent extends Event { this.player = player; } - public Player getPlayer() { - return this.player; - } } diff --git a/src/main/java/emu/grasscutter/server/game/BaseGameSystem.java b/src/main/java/emu/grasscutter/server/game/BaseGameSystem.java index 3fd3db05c..883cd2b7f 100644 --- a/src/main/java/emu/grasscutter/server/game/BaseGameSystem.java +++ b/src/main/java/emu/grasscutter/server/game/BaseGameSystem.java @@ -1,5 +1,8 @@ package emu.grasscutter.server.game; +import lombok.Getter; + +@Getter public abstract class BaseGameSystem { protected final GameServer server; @@ -7,7 +10,4 @@ public abstract class BaseGameSystem { this.server = server; } - public GameServer getServer() { - return this.server; - } } diff --git a/src/main/java/emu/grasscutter/server/game/GameSession.java b/src/main/java/emu/grasscutter/server/game/GameSession.java index 160644407..092bf72d3 100644 --- a/src/main/java/emu/grasscutter/server/game/GameSession.java +++ b/src/main/java/emu/grasscutter/server/game/GameSession.java @@ -17,6 +17,7 @@ import java.nio.file.Path; import lombok.*; public class GameSession implements GameSessionManager.KcpChannel { + @Getter private final GameServer server; private GameSessionManager.KcpTunnel tunnel; @@ -44,10 +45,6 @@ public class GameSession implements GameSessionManager.KcpChannel { } } - public GameServer getServer() { - return server; - } - public InetSocketAddress getAddress() { try { return tunnel.getAddress(); diff --git a/src/main/java/emu/grasscutter/server/game/GameSessionManager.java b/src/main/java/emu/grasscutter/server/game/GameSessionManager.java index 5c6ef7770..ed1b292ff 100644 --- a/src/main/java/emu/grasscutter/server/game/GameSessionManager.java +++ b/src/main/java/emu/grasscutter/server/game/GameSessionManager.java @@ -12,6 +12,7 @@ import lombok.Getter; public class GameSessionManager { @Getter private static final DefaultEventLoop logicThread = new DefaultEventLoop(); private static final ConcurrentHashMap sessions = new ConcurrentHashMap<>(); + @Getter private static final KcpListener listener = new KcpListener() { @Override @@ -90,10 +91,6 @@ public class GameSessionManager { } }; - public static KcpListener getListener() { - return listener; - } - public interface KcpTunnel { InetSocketAddress getAddress(); diff --git a/src/main/java/emu/grasscutter/server/http/dispatch/RegionHandler.java b/src/main/java/emu/grasscutter/server/http/dispatch/RegionHandler.java index 94d1ba60e..cc29fbe28 100644 --- a/src/main/java/emu/grasscutter/server/http/dispatch/RegionHandler.java +++ b/src/main/java/emu/grasscutter/server/http/dispatch/RegionHandler.java @@ -22,6 +22,8 @@ import java.time.Instant; import java.util.*; import java.util.concurrent.ConcurrentHashMap; import java.util.regex.Pattern; + +import lombok.Getter; import org.slf4j.Logger; /** Handles requests related to region queries. */ @@ -321,6 +323,7 @@ public final class RegionHandler implements Router { } /** Region data container. */ + @Getter public static class RegionData { private final QueryCurrRegionHttpRsp regionQuery; private final String base64; @@ -330,13 +333,6 @@ public final class RegionHandler implements Router { this.base64 = b64; } - public QueryCurrRegionHttpRsp getRegionQuery() { - return this.regionQuery; - } - - public String getBase64() { - return this.base64; - } } /** diff --git a/src/main/java/emu/grasscutter/server/scheduler/AsyncServerTask.java b/src/main/java/emu/grasscutter/server/scheduler/AsyncServerTask.java index 38e4c2a02..b152bdeb6 100644 --- a/src/main/java/emu/grasscutter/server/scheduler/AsyncServerTask.java +++ b/src/main/java/emu/grasscutter/server/scheduler/AsyncServerTask.java @@ -14,7 +14,14 @@ public final class AsyncServerTask implements Runnable { /* Has the task already been started? */ private boolean started = false; + /** + * -- GETTER -- + * Returns the state of the task. + * + * @return True if the task has finished execution, false otherwise. + */ /* Has the task finished execution? */ + @Getter private boolean finished = false; /* The result produced in the async task. */ @Nullable private Object result = null; @@ -49,15 +56,6 @@ public final class AsyncServerTask implements Runnable { return this.started; } - /** - * Returns the state of the task. - * - * @return True if the task has finished execution, false otherwise. - */ - public boolean isFinished() { - return this.finished; - } - /** Runs the task. */ @Override public void run() { diff --git a/src/main/java/emu/grasscutter/utils/lang/Language.java b/src/main/java/emu/grasscutter/utils/lang/Language.java index e079dfa60..fe172270e 100644 --- a/src/main/java/emu/grasscutter/utils/lang/Language.java +++ b/src/main/java/emu/grasscutter/utils/lang/Language.java @@ -19,6 +19,7 @@ import java.util.concurrent.ConcurrentHashMap; import java.util.regex.*; import java.util.stream.*; import lombok.EqualsAndHashCode; +import lombok.Getter; public final class Language { private static final Map cachedLanguages = new ConcurrentHashMap<>(); @@ -28,6 +29,11 @@ public final class Language { private static boolean scannedTextmaps = false; // Ensure that we don't infinitely rescan on cache misses that don't exist private static Int2ObjectMap textMapStrings; + /** + * -- GETTER -- + * get language code + */ + @Getter private final String languageCode; private final Map translations = new ConcurrentHashMap<>(); @@ -406,11 +412,6 @@ public final class Language { } } - /** get language code */ - public String getLanguageCode() { - return languageCode; - } - /** * Returns the value (as a string) from a nested key. * diff --git a/src/main/java/emu/grasscutter/utils/objects/ServerLogEventAppender.java b/src/main/java/emu/grasscutter/utils/objects/ServerLogEventAppender.java index efb5775e7..5bcfbda13 100644 --- a/src/main/java/emu/grasscutter/utils/objects/ServerLogEventAppender.java +++ b/src/main/java/emu/grasscutter/utils/objects/ServerLogEventAppender.java @@ -4,8 +4,11 @@ import ch.qos.logback.classic.spi.ILoggingEvent; import ch.qos.logback.core.AppenderBase; import ch.qos.logback.core.encoder.Encoder; import emu.grasscutter.server.event.internal.ServerLogEvent; +import lombok.Getter; + import java.nio.charset.StandardCharsets; +@Getter public final class ServerLogEventAppender extends AppenderBase { private Encoder encoder; @@ -17,10 +20,6 @@ public final class ServerLogEventAppender extends AppenderBase { sle.call(); } - public Encoder getEncoder() { - return this.encoder; - } - public void setEncoder(Encoder encoder) { this.encoder = encoder; }