fix: make those fields final

This commit is contained in:
Breno A. 2024-06-09 08:47:56 -03:00
parent 76fd5b2e9c
commit 6bb349d92b
40 changed files with 151 additions and 151 deletions

View File

@ -569,8 +569,8 @@ public final class GameData {
private static final Int2IntMap trialAvatarIndexIdTrialActivityDataDataMap = private static final Int2IntMap trialAvatarIndexIdTrialActivityDataDataMap =
new Int2IntOpenHashMap(); new Int2IntOpenHashMap();
private static Map<Integer, List<Integer>> fetters = new HashMap<>(); private static final Map<Integer, List<Integer>> fetters = new HashMap<>();
private static Map<Integer, List<ShopGoodsData>> shopGoods = new HashMap<>(); private static final Map<Integer, List<ShopGoodsData>> shopGoods = new HashMap<>();
// Getters with different names that stay for now // Getters with different names that stay for now
public static Int2ObjectMap<MainQuestData> getMainQuestDataMap() { public static Int2ObjectMap<MainQuestData> getMainQuestDataMap() {

View File

@ -13,17 +13,17 @@ import lombok.*;
public class GameDepot { public class GameDepot {
public static final int[] BLOCK_SIZE = new int[] {50, 500}; // Scales public static final int[] BLOCK_SIZE = new int[] {50, 500}; // Scales
private static Int2ObjectMap<WeightedList<ReliquaryMainPropData>> relicRandomMainPropDepot = private static final Int2ObjectMap<WeightedList<ReliquaryMainPropData>> relicRandomMainPropDepot =
new Int2ObjectOpenHashMap<>(); new Int2ObjectOpenHashMap<>();
private static Int2ObjectMap<List<ReliquaryMainPropData>> relicMainPropDepot = private static final Int2ObjectMap<List<ReliquaryMainPropData>> relicMainPropDepot =
new Int2ObjectOpenHashMap<>(); new Int2ObjectOpenHashMap<>();
private static Int2ObjectMap<List<ReliquaryAffixData>> relicAffixDepot = private static final Int2ObjectMap<List<ReliquaryAffixData>> relicAffixDepot =
new Int2ObjectOpenHashMap<>(); new Int2ObjectOpenHashMap<>();
@Getter @Setter private static Map<String, AvatarConfig> playerAbilities = new HashMap<>(); @Getter @Setter private static Map<String, AvatarConfig> playerAbilities = new HashMap<>();
@Getter @Getter
private static HashMap<SpawnDataEntry.GridBlockId, ArrayList<SpawnDataEntry>> spawnLists = private static final HashMap<SpawnDataEntry.GridBlockId, ArrayList<SpawnDataEntry>> spawnLists =
new HashMap<>(); new HashMap<>();
@Getter @Setter private static BlossomConfig blossomConfig; @Getter @Setter private static BlossomConfig blossomConfig;

View File

@ -51,8 +51,8 @@ public class OpenConfigEntry {
} }
public static class SkillPointModifier { public static class SkillPointModifier {
private int skillId; private final int skillId;
private int delta; private final int delta;
public SkillPointModifier(int skillId, int delta) { public SkillPointModifier(int skillId, int delta) {
this.skillId = skillId; this.skillId = skillId;

View File

@ -24,7 +24,7 @@ public class ItemData extends GameResource {
@Getter(onMethod_ = @Override) @Getter(onMethod_ = @Override)
private int id; private int id;
private int stackLimit = 1; private final int stackLimit = 1;
private int maxUseCount; private int maxUseCount;
private int rankLevel; private int rankLevel;
private String effectName; private String effectName;
@ -37,7 +37,7 @@ public class ItemData extends GameResource {
private int[] destroyReturnMaterialCount; private int[] destroyReturnMaterialCount;
// Enums // Enums
private ItemType itemType = ItemType.ITEM_NONE; private final ItemType itemType = ItemType.ITEM_NONE;
private MaterialType materialType = MaterialType.MATERIAL_NONE; private MaterialType materialType = MaterialType.MATERIAL_NONE;
private EquipType equipType = EquipType.EQUIP_NONE; private EquipType equipType = EquipType.EQUIP_NONE;
private String effectType; private String effectType;
@ -48,10 +48,10 @@ public class ItemData extends GameResource {
private int[] satiationParams; private int[] satiationParams;
// Usable item // Usable item
private ItemUseTarget useTarget = ItemUseTarget.ITEM_USE_TARGET_NONE; private final ItemUseTarget useTarget = ItemUseTarget.ITEM_USE_TARGET_NONE;
private List<ItemUseData> itemUse; private List<ItemUseData> itemUse;
private List<ItemUseAction> itemUseActions; private List<ItemUseAction> itemUseActions;
private boolean useOnGain = false; private final boolean useOnGain = false;
// Relic // Relic
private int mainPropDepotId; private int mainPropDepotId;
@ -79,7 +79,7 @@ public class ItemData extends GameResource {
private int comfort; private int comfort;
private List<Integer> furnType; private List<Integer> furnType;
private List<Integer> furnitureGadgetID; private List<Integer> furnitureGadgetID;
private SpecialFurnitureType specialFurnitureType = SpecialFurnitureType.NOT_SPECIAL; private final SpecialFurnitureType specialFurnitureType = SpecialFurnitureType.NOT_SPECIAL;
@SerializedName( @SerializedName(
value = "roomSceneId", value = "roomSceneId",

View File

@ -9,7 +9,7 @@ public class PlayerLevelData extends GameResource {
private int level; private int level;
private int exp; private int exp;
private int rewardId; private int rewardId;
private int expeditionLimitAdd = 0; private final int expeditionLimitAdd = 0;
private int unlockWorldLevel; private int unlockWorldLevel;
private long unlockDescTextMapHash; private long unlockDescTextMapHash;

View File

@ -25,7 +25,7 @@ public class ProudSkillData extends GameResource {
@Getter private long nameTextMapHash; @Getter private long nameTextMapHash;
@Transient private Iterable<ItemParamData> totalCostItems; @Transient private Iterable<ItemParamData> totalCostItems;
@Transient @Getter private Object2FloatMap<String> paramListMap = new Object2FloatOpenHashMap<>(); @Transient @Getter private final Object2FloatMap<String> paramListMap = new Object2FloatOpenHashMap<>();
@Override @Override
public int getId() { public int getId() {

View File

@ -14,7 +14,7 @@ public class AchievementData extends GameResource {
private static final AtomicBoolean isDivided = new AtomicBoolean(); private static final AtomicBoolean isDivided = new AtomicBoolean();
private int goalId; private int goalId;
private int preStageAchievementId; private int preStageAchievementId;
private Set<Integer> groupAchievementIdList = new HashSet<>(); private final Set<Integer> groupAchievementIdList = new HashSet<>();
private boolean isParent; private boolean isParent;
private long titleTextMapHash; private long titleTextMapHash;
private long descTextMapHash; private long descTextMapHash;

View File

@ -55,7 +55,7 @@ public class AvatarData extends GameResource {
@Getter @Getter
private IntList abilities; private IntList abilities;
@Getter @Getter
private List<String> abilitieNames = new ArrayList<>(); private final List<String> abilitieNames = new ArrayList<>();
@Getter @Getter
private List<Integer> fetters; private List<Integer> fetters;

View File

@ -30,8 +30,8 @@ public class TowerLevelData extends GameResource {
// Just packaging condition parameters for convenience. // Just packaging condition parameters for convenience.
@Getter @Getter
public class TowerCondTimeParams { public class TowerCondTimeParams {
private int param1; private final int param1;
private int minimumTimeInSeconds; private final int minimumTimeInSeconds;
public TowerCondTimeParams(int param1, int minimumTimeInSeconds) { public TowerCondTimeParams(int param1, int minimumTimeInSeconds) {
this.param1 = param1; this.param1 = param1;
@ -41,9 +41,9 @@ public class TowerLevelData extends GameResource {
@Getter @Getter
public class TowerCondHpParams { public class TowerCondHpParams {
private int sceneId; private final int sceneId;
private int configId; private final int configId;
private int minimumHpPercentage; private final int minimumHpPercentage;
public TowerCondHpParams(int sceneId, int configId, int minimumHpPercentage) { public TowerCondHpParams(int sceneId, int configId, int minimumHpPercentage) {
this.sceneId = sceneId; this.sceneId = sceneId;

View File

@ -9,7 +9,7 @@ import java.util.*;
public class Grid { public class Grid {
public transient RTree<Map.Entry<GridPosition, Set<Integer>>, Geometry> gridOptimized = null; public transient RTree<Map.Entry<GridPosition, Set<Integer>>, Geometry> gridOptimized = null;
private transient Set<Integer> nearbyGroups = new HashSet<>(100); private final transient Set<Integer> nearbyGroups = new HashSet<>(100);
public Map<GridPosition, Set<Integer>> grid = new LinkedHashMap<>(); public Map<GridPosition, Set<Integer>> grid = new LinkedHashMap<>();

View File

@ -24,7 +24,7 @@ public class Account {
private String token; private String token;
private String sessionKey; // Session token for dispatch server private String sessionKey; // Session token for dispatch server
private List<String> permissions; private final List<String> permissions;
private Locale locale; private Locale locale;
private String banReason; private String banReason;

View File

@ -12,20 +12,20 @@ import java.util.*;
import lombok.Getter; import lombok.Getter;
public class Ability { public class Ability {
@Getter private AbilityData data; @Getter private final AbilityData data;
@Getter private GameEntity owner; @Getter private final GameEntity owner;
@Getter private Player playerOwner; @Getter private final Player playerOwner;
@Getter private AbilityManager manager; @Getter private final AbilityManager manager;
@Getter private Map<String, AbilityModifierController> modifiers = new HashMap<>(); @Getter private final Map<String, AbilityModifierController> modifiers = new HashMap<>();
@Getter private Object2FloatMap<String> abilitySpecials = new Object2FloatOpenHashMap<>(); @Getter private final Object2FloatMap<String> abilitySpecials = new Object2FloatOpenHashMap<>();
@Getter @Getter
private static Map<String, Object2FloatMap<String>> abilitySpecialsModified = new HashMap<>(); private static final Map<String, Object2FloatMap<String>> abilitySpecialsModified = new HashMap<>();
@Getter private int hash; @Getter private final int hash;
@Getter private Set<Integer> avatarSkillStartIds; @Getter private final Set<Integer> avatarSkillStartIds;
public Ability(AbilityData data, GameEntity owner, Player playerOwner) { public Ability(AbilityData data, GameEntity owner, Player playerOwner) {
this.data = data; this.data = data;

View File

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

View File

@ -9,8 +9,8 @@ import lombok.*;
@Getter @Getter
public class Achievement { public class Achievement {
@Setter private Status status; @Setter private Status status;
private int id; private final int id;
private int totalProgress; private final int totalProgress;
@Setter private int curProgress; @Setter private int curProgress;
@Setter private int finishTimestampSec; @Setter private int finishTimestampSec;

View File

@ -61,13 +61,13 @@ public class Avatar {
private List<Integer> fetters; private List<Integer> fetters;
private Map<Integer, Integer> skillLevelMap = new Int2IntArrayMap(7); // Talent levels private final Map<Integer, Integer> skillLevelMap = new Int2IntArrayMap(7); // Talent levels
@Transient @Getter @Transient @Getter
private Map<Integer, Integer> skillExtraChargeMap = new Int2IntArrayMap(2); // Charges private final Map<Integer, Integer> skillExtraChargeMap = new Int2IntArrayMap(2); // Charges
@Transient @Transient
private Map<Integer, Integer> proudSkillBonusMap = private final Map<Integer, Integer> proudSkillBonusMap =
new Int2IntArrayMap(2); // Talent bonus levels (from const) new Int2IntArrayMap(2); // Talent bonus levels (from const)
@Getter private int skillDepotId; @Getter private int skillDepotId;

View File

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

View File

@ -29,13 +29,13 @@ public class EntityClientGadget extends EntityBaseGadget {
@Getter private final Player owner; @Getter private final Player owner;
@Getter(onMethod_ = @Override) @Getter(onMethod_ = @Override)
private int gadgetId; private final int gadgetId;
@Getter private int ownerEntityId; @Getter private final int ownerEntityId;
@Getter private int targetEntityId; @Getter private final int targetEntityId;
@Getter private boolean asyncLoad; @Getter private final boolean asyncLoad;
@Getter private int originalOwnerEntityId; @Getter private final int originalOwnerEntityId;
@Getter private final GadgetData gadgetData; @Getter private final GadgetData gadgetData;
private ConfigEntityGadget configGadget; private ConfigEntityGadget configGadget;

View File

@ -50,13 +50,13 @@ public class EntityMonster extends GameEntity {
@Getter private final Position bornPos; @Getter private final Position bornPos;
@Getter private final int level; @Getter private final int level;
@Getter private EntityWeapon weaponEntity; @Getter private EntityWeapon weaponEntity;
@Getter private Map<Integer, EntityMonster> summonTagMap; @Getter private final Map<Integer, EntityMonster> summonTagMap;
@Getter @Setter private int summonedTag; @Getter @Setter private int summonedTag;
@Getter @Setter private int ownerEntityId; @Getter @Setter private int ownerEntityId;
@Getter @Setter private int poseId; @Getter @Setter private int poseId;
@Getter @Setter private int aiId = -1; @Getter @Setter private int aiId = -1;
@Getter private List<Player> playerOnBattle; @Getter private final List<Player> playerOnBattle;
@Nullable @Getter @Setter private SceneMonster metaMonster; @Nullable @Getter @Setter private SceneMonster metaMonster;
public EntityMonster( public EntityMonster(

View File

@ -10,7 +10,7 @@ import it.unimi.dsi.fastutil.ints.*;
public class EntityTeam extends GameEntity { public class EntityTeam extends GameEntity {
private Player player; private final Player player;
public EntityTeam(Player player) { public EntityTeam(Player player) {
super(player.getScene()); super(player.getScene());

View File

@ -36,7 +36,7 @@ public class EntityVehicle extends EntityBaseGadget {
@Getter private final int gadgetId; @Getter private final int gadgetId;
@Getter @Setter private float curStamina; @Getter @Setter private float curStamina;
@Getter private List<VehicleMember> vehicleMembers; @Getter private final List<VehicleMember> vehicleMembers;
@Nullable @Getter private ConfigEntityGadget configGadget; @Nullable @Getter private ConfigEntityGadget configGadget;
public EntityVehicle( public EntityVehicle(

View File

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

View File

@ -44,13 +44,13 @@ public abstract class GameEntity {
@Getter @Setter private EntityController entityController; @Getter @Setter private EntityController entityController;
@Getter private ElementType lastAttackType = ElementType.None; @Getter private ElementType lastAttackType = ElementType.None;
@Getter private List<Ability> instancedAbilities = new ArrayList<>(); @Getter private final List<Ability> instancedAbilities = new ArrayList<>();
@Getter @Getter
private Int2ObjectMap<AbilityModifierController> instancedModifiers = private final Int2ObjectMap<AbilityModifierController> instancedModifiers =
new Int2ObjectOpenHashMap<>(); new Int2ObjectOpenHashMap<>();
@Getter private Map<String, Float> globalAbilityValues = new HashMap<>(); @Getter private final Map<String, Float> globalAbilityValues = new HashMap<>();
public GameEntity(Scene scene) { public GameEntity(Scene scene) {
this.scene = scene; this.scene = scene;

View File

@ -8,7 +8,7 @@ import emu.grasscutter.net.proto.SceneGadgetInfoOuterClass.SceneGadgetInfo;
import lombok.val; import lombok.val;
public class GadgetAbility extends GadgetContent { public class GadgetAbility extends GadgetContent {
private EntityBaseGadget parent; private final EntityBaseGadget parent;
public GadgetAbility(EntityGadget gadget, EntityBaseGadget parent) { public GadgetAbility(EntityGadget gadget, EntityBaseGadget parent) {
super(gadget); super(gadget);

View File

@ -24,8 +24,8 @@ public class PlayerProfile {
private int worldLevel; private int worldLevel;
private int lastActiveTime; private int lastActiveTime;
private boolean isInDuel = false; // TODO: Implement duels. (TCG) private final boolean isInDuel = false; // TODO: Implement duels. (TCG)
private boolean isDuelObservable = false; // TODO: Implement duels. (TCG) private final boolean isDuelObservable = false; // TODO: Implement duels. (TCG)
@Getter private int enterHomeOption; @Getter private int enterHomeOption;

View File

@ -39,24 +39,24 @@ public class GachaBanner {
@Getter private String previewPrefabPath; @Getter private String previewPrefabPath;
@Getter private String titlePath; @Getter private String titlePath;
private int costItemId = 0; private int costItemId = 0;
private int costItemAmount = 1; private final int costItemAmount = 1;
private int costItemId10 = 0; private int costItemId10 = 0;
private int costItemAmount10 = 10; private final int costItemAmount10 = 10;
@Getter private int beginTime = 0; @Getter private final int beginTime = 0;
@Getter private int endTime = 1924992000; @Getter private final int endTime = 1924992000;
@Getter private int gachaTimesLimit = Integer.MAX_VALUE; @Getter private final int gachaTimesLimit = Integer.MAX_VALUE;
@Getter private int[] rateUpItems4 = {}; @Getter private final int[] rateUpItems4 = {};
@Getter private int[] rateUpItems5 = {}; @Getter private final int[] rateUpItems5 = {};
// This now handles default values for the fields below // This now handles default values for the fields below
@Getter private BannerType bannerType = BannerType.STANDARD; @Getter private final BannerType bannerType = BannerType.STANDARD;
// These don't change between banner types (apart from Standard having three extra 4star avatars) // These don't change between banner types (apart from Standard having three extra 4star avatars)
@Getter @Getter
private int[] fallbackItems3 = { private final int[] fallbackItems3 = {
11301, 11302, 11306, 12301, 12302, 12305, 13303, 14301, 14302, 14304, 15301, 15302, 15304 11301, 11302, 11306, 12301, 12302, 12305, 13303, 14301, 14302, 14304, 15301, 15302, 15304
}; };
@Getter private int[] fallbackItems4Pool1 = DEFAULT_FALLBACK_ITEMS_4_POOL_1; @Getter private final int[] fallbackItems4Pool1 = DEFAULT_FALLBACK_ITEMS_4_POOL_1;
@Getter private int[] fallbackItems4Pool2 = DEFAULT_FALLBACK_ITEMS_4_POOL_2; @Getter private final int[] fallbackItems4Pool2 = DEFAULT_FALLBACK_ITEMS_4_POOL_2;
// Different banner types have different defaults, see above for default values and the enum for // Different banner types have different defaults, see above for default values and the enum for
// which are used where. // which are used where.
@Getter private int[] fallbackItems5Pool1; @Getter private int[] fallbackItems5Pool1;
@ -66,33 +66,33 @@ public class GachaBanner {
private int eventChance4 = -1; // Chance to win a featured event item private int eventChance4 = -1; // Chance to win a featured event item
private int eventChance5 = -1; // Chance to win a featured event item private int eventChance5 = -1; // Chance to win a featured event item
// //
@Getter private boolean removeC6FromPool = false; @Getter private final boolean removeC6FromPool = false;
@Getter @Getter
private boolean autoStripRateUpFromFallback = private final boolean autoStripRateUpFromFallback =
true; // Ensures that featured items won't "double dip" into the losing pool true; // Ensures that featured items won't "double dip" into the losing pool
private int[][] poolBalanceWeights4 = { private final int[][] poolBalanceWeights4 = {
{1, 255}, {17, 255}, {21, 10455} {1, 255}, {17, 255}, {21, 10455}
}; // Used to ensure that players won't go too many rolls without getting something from pool 1 }; // Used to ensure that players won't go too many rolls without getting something from pool 1
// (avatar) or pool 2 (weapon) // (avatar) or pool 2 (weapon)
private int[][] poolBalanceWeights5 = {{1, 30}, {147, 150}, {181, 10230}}; private final int[][] poolBalanceWeights5 = {{1, 30}, {147, 150}, {181, 10230}};
@Getter private int wishMaxProgress = 2; @Getter private final int wishMaxProgress = 2;
// Deprecated fields that were tolerated in early May 2022 but have apparently still being // Deprecated fields that were tolerated in early May 2022 but have apparently still being
// circulating in new custom configs // circulating in new custom configs
// For now, throw up big scary errors on load telling people that they will be banned outright in // For now, throw up big scary errors on load telling people that they will be banned outright in
// a future version // a future version
@Deprecated private int[] rateUpItems1 = {}; @Deprecated private final int[] rateUpItems1 = {};
@Deprecated private int[] rateUpItems2 = {}; @Deprecated private final int[] rateUpItems2 = {};
@Deprecated private int eventChance = -1; @Deprecated private final int eventChance = -1;
@Deprecated private int costItem = 0; @Deprecated private final int costItem = 0;
@Deprecated private int softPity = -1; @Deprecated private final int softPity = -1;
@Deprecated private int hardPity = -1; @Deprecated private final int hardPity = -1;
@Deprecated private int minItemType = -1; @Deprecated private final int minItemType = -1;
@Deprecated private int maxItemType = -1; @Deprecated private final int maxItemType = -1;
@Getter private boolean deprecated = false; @Getter private boolean deprecated = false;
@Getter private boolean disabled = false; @Getter private final boolean disabled = false;
private void warnDeprecated(String name, String replacement) { private void warnDeprecated(String name, String replacement) {
Grasscutter.getLogger() Grasscutter.getLogger()

View File

@ -11,9 +11,9 @@ public class MapMark {
private int sceneId; private int sceneId;
private String name; private String name;
private Position position; private Position position;
private MapMarkPointType mapMarkPointType; private final MapMarkPointType mapMarkPointType;
private int monsterId; private int monsterId;
private MapMarkFromType mapMarkFromType; private final MapMarkFromType mapMarkFromType;
private int questId; private int questId;
@Deprecated // Morhpia @Deprecated // Morhpia

View File

@ -78,17 +78,17 @@ public class Player implements PlayerHook, FieldFetch {
@Getter private String signature; @Getter private String signature;
@Getter private int headImage; @Getter private int headImage;
@Getter private int nameCardId = 210001; @Getter private int nameCardId = 210001;
@Getter private Position position; @Getter private final Position position;
@Getter @Setter private Position prevPos; @Getter @Setter private Position prevPos;
@Getter @Setter private Position prevPosForHome; @Getter @Setter private Position prevPosForHome;
@Getter @Setter private int prevScene; @Getter @Setter private int prevScene;
@Getter private Position rotation; @Getter private final Position rotation;
@Getter private PlayerBirthday birthday; @Getter private PlayerBirthday birthday;
@Getter private PlayerCodex codex; @Getter private PlayerCodex codex;
@Getter @Setter private boolean showAvatars; @Getter @Setter private boolean showAvatars;
@Getter @Setter private List<Integer> showAvatarList; @Getter @Setter private List<Integer> showAvatarList;
@Getter @Setter private List<Integer> showNameCardList; @Getter @Setter private List<Integer> showNameCardList;
@Getter private Map<Integer, Integer> properties; @Getter private final Map<Integer, Integer> properties;
@Getter @Setter private int currentRealmId; @Getter @Setter private int currentRealmId;
@Getter @Setter private transient boolean isInEditMode; @Getter @Setter private transient boolean isInEditMode;
@Getter @Setter private int widgetId; @Getter @Setter private int widgetId;
@ -98,25 +98,25 @@ public class Player implements PlayerHook, FieldFetch {
@Getter @Setter private boolean inGodMode; @Getter @Setter private boolean inGodMode;
@Getter @Setter private boolean unlimitedStamina; @Getter @Setter private boolean unlimitedStamina;
@Getter private Set<Integer> nameCardList; @Getter private final Set<Integer> nameCardList;
@Getter private Set<Integer> flyCloakList; @Getter private final Set<Integer> flyCloakList;
@Getter private Set<Integer> costumeList; @Getter private final Set<Integer> costumeList;
@Getter private Set<Integer> personalLineList; @Getter private final Set<Integer> personalLineList;
@Getter @Setter private Set<Integer> rewardedLevels; @Getter @Setter private Set<Integer> rewardedLevels;
@Getter @Setter private Set<Integer> homeRewardedLevels; @Getter @Setter private Set<Integer> homeRewardedLevels;
@Getter @Setter private Set<Integer> realmList; @Getter @Setter private Set<Integer> realmList;
@Getter @Setter private Set<Integer> seenRealmList; @Getter @Setter private Set<Integer> seenRealmList;
@Getter private Set<Integer> unlockedForgingBlueprints; @Getter private final Set<Integer> unlockedForgingBlueprints;
@Getter private Set<Integer> unlockedCombines; @Getter private final Set<Integer> unlockedCombines;
@Getter private Set<Integer> unlockedFurniture; @Getter private final Set<Integer> unlockedFurniture;
@Getter private Set<Integer> unlockedFurnitureSuite; @Getter private final Set<Integer> unlockedFurnitureSuite;
@Getter private Map<Long, ExpeditionInfo> expeditionInfo; @Getter private final Map<Long, ExpeditionInfo> expeditionInfo;
@Getter private Map<Integer, Integer> unlockedRecipies; @Getter private final Map<Integer, Integer> unlockedRecipies;
@Getter private List<ActiveForgeData> activeForges; @Getter private final List<ActiveForgeData> activeForges;
@Getter private Map<Integer, ActiveCookCompoundData> activeCookCompounds; @Getter private final Map<Integer, ActiveCookCompoundData> activeCookCompounds;
@Getter private Map<Integer, Integer> questGlobalVariables; @Getter private final Map<Integer, Integer> questGlobalVariables;
@Getter private Map<Integer, Integer> openStates; @Getter private final Map<Integer, Integer> openStates;
@Getter private Map<Integer, Set<Integer>> sceneTags; @Getter private final Map<Integer, Set<Integer>> sceneTags;
@Getter @Setter private Map<Integer, Set<Integer>> unlockedSceneAreas; @Getter @Setter private Map<Integer, Set<Integer>> unlockedSceneAreas;
@Getter @Setter private Map<Integer, Set<Integer>> unlockedScenePoints; @Getter @Setter private Map<Integer, Set<Integer>> unlockedScenePoints;
@Getter @Setter private List<Integer> chatEmojiIdList; @Getter @Setter private List<Integer> chatEmojiIdList;
@ -133,13 +133,13 @@ public class Player implements PlayerHook, FieldFetch {
@Transient @Getter private int areaType = 0; @Transient @Getter private int areaType = 0;
// Player managers go here // Player managers go here
@Getter private transient AvatarStorage avatars; @Getter private final transient AvatarStorage avatars;
@Getter private transient Inventory inventory; @Getter private final transient Inventory inventory;
@Getter private transient FriendsList friendsList; @Getter private final transient FriendsList friendsList;
@Getter private transient MailHandler mailHandler; @Getter private final transient MailHandler mailHandler;
@Getter private transient AbilityManager abilityManager; @Getter private final transient AbilityManager abilityManager;
@Getter private transient QuestManager questManager; @Getter private final transient QuestManager questManager;
@Getter private transient TowerManager towerManager; @Getter private final transient TowerManager towerManager;
@Getter private transient SotSManager sotsManager; @Getter private transient SotSManager sotsManager;
@Getter private transient MapMarksManager mapMarksManager; @Getter private transient MapMarksManager mapMarksManager;
@Getter private transient StaminaManager staminaManager; @Getter private transient StaminaManager staminaManager;
@ -152,10 +152,10 @@ public class Player implements PlayerHook, FieldFetch {
@Getter private transient CookingManager cookingManager; @Getter private transient CookingManager cookingManager;
@Getter private transient CookingCompoundManager cookingCompoundManager; @Getter private transient CookingCompoundManager cookingCompoundManager;
@Getter private transient ActivityManager activityManager; @Getter private transient ActivityManager activityManager;
@Getter private transient PlayerBuffManager buffManager; @Getter private final transient PlayerBuffManager buffManager;
@Getter private transient PlayerProgressManager progressManager; @Getter private transient PlayerProgressManager progressManager;
@Getter private transient SatiationManager satiationManager; @Getter private transient SatiationManager satiationManager;
@Getter private transient TalkManager talkManager; @Getter private final transient TalkManager talkManager;
@Getter @Setter private transient Position lastCheckedPosition = null; @Getter @Setter private transient Position lastCheckedPosition = null;
@ -164,9 +164,9 @@ public class Player implements PlayerHook, FieldFetch {
private PlayerProfile playerProfile; // Getter has null-check private PlayerProfile playerProfile; // Getter has null-check
@Getter private TeamManager teamManager; @Getter private TeamManager teamManager;
private TowerData towerData; // Getter has null-check private TowerData towerData; // Getter has null-check
@Getter private PlayerGachaInfo gachaInfo; @Getter private final PlayerGachaInfo gachaInfo;
private PlayerCollectionRecords collectionRecordStore; // Getter has null-check private PlayerCollectionRecords collectionRecordStore; // Getter has null-check
@Getter private ArrayList<ShopLimit> shopLimit; @Getter private final ArrayList<ShopLimit> shopLimit;
@Getter private transient GameHome home; @Getter private transient GameHome home;
@ -194,11 +194,11 @@ public class Player implements PlayerHook, FieldFetch {
@Getter @Setter private int nextResinRefresh; @Getter @Setter private int nextResinRefresh;
@Getter @Setter private int resinBuyCount; @Getter @Setter private int resinBuyCount;
@Getter @Setter private int lastDailyReset; @Getter @Setter private int lastDailyReset;
@Getter private transient MpSettingType mpSetting = MpSettingType.MP_SETTING_TYPE_ENTER_AFTER_APPLY; @Getter private final transient MpSettingType mpSetting = MpSettingType.MP_SETTING_TYPE_ENTER_AFTER_APPLY;
@Getter private long playerGameTime = 540000; // 9 in-game hours. Present at the start of the game. @Getter private long playerGameTime = 540000; // 9 in-game hours. Present at the start of the game.
@Getter private PlayerProgress playerProgress; @Getter private final PlayerProgress playerProgress;
@Getter private Set<Integer> activeQuestTimers; @Getter private final Set<Integer> activeQuestTimers;
@Getter @Setter private ElementType mainCharacterElement = ElementType.None; @Getter @Setter private ElementType mainCharacterElement = ElementType.None;

View File

@ -14,14 +14,14 @@ public class PlayerCodex {
@Transient private Player player; @Transient private Player player;
// itemId is not codexId! // itemId is not codexId!
@Getter private Set<Integer> unlockedWeapon; @Getter private final Set<Integer> unlockedWeapon;
@Getter private Map<Integer, Integer> unlockedAnimal; @Getter private final Map<Integer, Integer> unlockedAnimal;
@Getter private Set<Integer> unlockedMaterial; @Getter private final Set<Integer> unlockedMaterial;
@Getter private Set<Integer> unlockedBook; @Getter private final Set<Integer> unlockedBook;
@Getter private Set<Integer> unlockedTip; @Getter private final Set<Integer> unlockedTip;
@Getter private Set<Integer> unlockedView; @Getter private final Set<Integer> unlockedView;
@Getter private Set<Integer> unlockedReliquary; @Getter private Set<Integer> unlockedReliquary;
@Getter private Set<Integer> unlockedReliquarySuitCodex; @Getter private final Set<Integer> unlockedReliquarySuitCodex;
public PlayerCodex() { public PlayerCodex() {
this.unlockedWeapon = new HashSet<>(); this.unlockedWeapon = new HashSet<>();

View File

@ -14,21 +14,21 @@ import lombok.*;
@Entity @Entity
public class PlayerProgress { public class PlayerProgress {
@Setter @Transient private Player player; @Setter @Transient private Player player;
private Map<Integer, ItemEntry> itemHistory; private final Map<Integer, ItemEntry> itemHistory;
/* /*
* A list of dungeon IDs which have been completed. * A list of dungeon IDs which have been completed.
* This only applies to one-time dungeons. * This only applies to one-time dungeons.
*/ */
private IntArrayList completedDungeons; private final IntArrayList completedDungeons;
// keep track of EXEC_ADD_QUEST_PROGRESS count, will be used in CONTENT_ADD_QUEST_PROGRESS // keep track of EXEC_ADD_QUEST_PROGRESS count, will be used in CONTENT_ADD_QUEST_PROGRESS
// not sure where to put this, this should be saved to DB but not to individual quest, since // not sure where to put this, this should be saved to DB but not to individual quest, since
// it will be hard to loop and compare // it will be hard to loop and compare
private Map<String, Integer> questProgressCountMap; private final Map<String, Integer> questProgressCountMap;
private Map<Integer, ItemGiveRecord> itemGivings; private final Map<Integer, ItemGiveRecord> itemGivings;
private Map<Integer, BargainRecord> bargains; private final Map<Integer, BargainRecord> bargains;
public PlayerProgress() { public PlayerProgress() {
this.questProgressCountMap = new ConcurrentHashMap<>(); this.questProgressCountMap = new ConcurrentHashMap<>();

View File

@ -10,7 +10,7 @@ import java.util.*;
@Entity @Entity
public final class TeamInfo { public final class TeamInfo {
private String name; private String name;
private List<Integer> avatars; private final List<Integer> avatars;
public TeamInfo() { public TeamInfo() {
this.name = ""; this.name = "";

View File

@ -26,7 +26,7 @@ public final class QuestManager extends BasePlayerManager {
@Getter private final Player player; @Getter private final Player player;
@Getter private final Int2ObjectMap<GameMainQuest> mainQuests; @Getter private final Int2ObjectMap<GameMainQuest> mainQuests;
@Getter private Int2ObjectMap<int[]> acceptProgressLists; @Getter private final Int2ObjectMap<int[]> acceptProgressLists;
@Getter private final List<Integer> loggedQuests; @Getter private final List<Integer> loggedQuests;
private long lastHourCheck = 0; private long lastHourCheck = 0;

View File

@ -79,7 +79,7 @@ public class Scene {
private final List<Runnable> afterLoadedCallbacks = new ArrayList<>(); private final List<Runnable> afterLoadedCallbacks = new ArrayList<>();
private final List<Runnable> afterHostInitCallbacks = new ArrayList<>(); private final List<Runnable> afterHostInitCallbacks = new ArrayList<>();
@Getter private GameEntity sceneEntity; @Getter private final GameEntity sceneEntity;
@Getter private final ServerTaskScheduler scheduler; @Getter private final ServerTaskScheduler scheduler;
public Scene(World world, SceneData sceneData) { public Scene(World world, SceneData sceneData) {

View File

@ -19,11 +19,11 @@ public final class SceneGroupInstance {
@Getter private transient SceneGroup luaGroup; @Getter private transient SceneGroup luaGroup;
@Getter @Setter private int targetSuiteId; @Getter @Setter private int targetSuiteId;
@Getter @Setter private int activeSuiteId; @Getter @Setter private int activeSuiteId;
@Getter private Set<Integer> deadEntities; // Config_ids @Getter private final Set<Integer> deadEntities; // Config_ids
private boolean isCached; private boolean isCached;
@Getter private Map<Integer, Integer> cachedGadgetStates; @Getter private final Map<Integer, Integer> cachedGadgetStates;
@Getter private Map<String, Integer> cachedVariables; @Getter private final Map<String, Integer> cachedVariables;
@Getter @Setter private int lastTimeRefreshed; @Getter @Setter private int lastTimeRefreshed;

View File

@ -33,10 +33,10 @@ public class SpawnDataEntry {
} }
public static class GridBlockId { public static class GridBlockId {
@Getter private int sceneId; @Getter private final int sceneId;
@Getter private int scale; @Getter private final int scale;
@Getter private int x; @Getter private final int x;
@Getter private int z; @Getter private final int z;
public GridBlockId(int sceneId, int scale, int x, int z) { public GridBlockId(int sceneId, int scale, int x, int z) {
this.sceneId = sceneId; this.sceneId = sceneId;

View File

@ -48,7 +48,7 @@ public class World implements Iterable<Player> {
@Getter private final List<Player> players; @Getter private final List<Player> players;
@Getter private final Int2ObjectMap<Scene> scenes; @Getter private final Int2ObjectMap<Scene> scenes;
@Getter private EntityWorld entity; @Getter private final EntityWorld entity;
private int nextEntityId = 0; private int nextEntityId = 0;
private int nextPeerId = 0; private int nextPeerId = 0;
private int worldLevel; private int worldLevel;

View File

@ -55,7 +55,7 @@ public class SceneScriptManager {
private final Map<Integer, SceneGroupInstance> sceneGroupsInstances; private final Map<Integer, SceneGroupInstance> sceneGroupsInstances;
private final Map<Integer, SceneGroupInstance> cachedSceneGroupsInstances; private final Map<Integer, SceneGroupInstance> cachedSceneGroupsInstances;
private ScriptMonsterTideService scriptMonsterTideService; private ScriptMonsterTideService scriptMonsterTideService;
private ScriptMonsterSpawnService scriptMonsterSpawnService; private final ScriptMonsterSpawnService scriptMonsterSpawnService;
/** blockid - loaded groupSet */ /** blockid - loaded groupSet */
private final Map<Integer, Set<SceneGroup>> loadedGroupSetPerBlock; private final Map<Integer, Set<SceneGroup>> loadedGroupSetPerBlock;

View File

@ -29,12 +29,12 @@ public class ScriptLoader {
@Getter private static ScriptLib scriptLib; @Getter private static ScriptLib scriptLib;
@Getter private static LuaValue scriptLibLua; @Getter private static LuaValue scriptLibLua;
/** suggest GC to remove it if the memory is less */ /** suggest GC to remove it if the memory is less */
private static Map<String, SoftReference<String>> scriptSources = new ConcurrentHashMap<>(); private static final Map<String, SoftReference<String>> scriptSources = new ConcurrentHashMap<>();
private static Map<String, SoftReference<CompiledScript>> scriptsCache = private static final Map<String, SoftReference<CompiledScript>> scriptsCache =
new ConcurrentHashMap<>(); new ConcurrentHashMap<>();
/** sceneId - SceneMeta */ /** sceneId - SceneMeta */
private static Map<Integer, SoftReference<SceneMeta>> sceneMetaCache = new ConcurrentHashMap<>(); private static final Map<Integer, SoftReference<SceneMeta>> sceneMetaCache = new ConcurrentHashMap<>();
private static final AtomicReference<Bindings> currentBindings = new AtomicReference<>(null); private static final AtomicReference<Bindings> currentBindings = new AtomicReference<>(null);
private static final AtomicReference<ScriptContext> currentContext = new AtomicReference<>(null); private static final AtomicReference<ScriptContext> currentContext = new AtomicReference<>(null);

View File

@ -11,8 +11,8 @@ import org.luaj.vm2.*;
public class EntityController { public class EntityController {
private static final Set<String> SERVER_CALLED = Set.of("OnBeHurt", "OnDie", "OnTimer"); private static final Set<String> SERVER_CALLED = Set.of("OnBeHurt", "OnDie", "OnTimer");
private transient CompiledScript entityController; private final transient CompiledScript entityController;
private transient Bindings entityControllerBindings; private final transient Bindings entityControllerBindings;
public EntityController(CompiledScript entityController, Bindings entityControllerBindings) { public EntityController(CompiledScript entityController, Bindings entityControllerBindings) {
this.entityController = entityController; this.entityController = entityController;

View File

@ -6,7 +6,7 @@ import lombok.*;
@Getter @Getter
public final class SceneBlockLoadedEvent extends ServerEvent { public final class SceneBlockLoadedEvent extends ServerEvent {
private SceneBlock block; private final SceneBlock block;
public SceneBlockLoadedEvent(SceneBlock block) { public SceneBlockLoadedEvent(SceneBlock block) {
super(Type.GAME); super(Type.GAME);

View File

@ -6,7 +6,7 @@ import lombok.*;
@Getter @Getter
public final class SceneMetaLoadEvent extends ServerEvent { public final class SceneMetaLoadEvent extends ServerEvent {
private Scene scene; private final Scene scene;
@Setter private boolean override; @Setter private boolean override;
public SceneMetaLoadEvent(Scene scene) { public SceneMetaLoadEvent(Scene scene) {