mirror of
https://github.com/Grasscutters/Grasscutter.git
synced 2025-01-04 23:53:20 +08:00
refactor(lombok): add Setter where possible
This commit is contained in:
parent
8f4120fcd3
commit
dd9f59fbfc
@ -93,9 +93,10 @@ public final class ClearCommand implements CommandHandler {
|
||||
}
|
||||
}
|
||||
|
||||
@Setter
|
||||
private static class ClearItemParameters {
|
||||
@Setter public int lvl = 1;
|
||||
@Setter public int refinement = 1;
|
||||
@Setter public int rank = 4;
|
||||
public int lvl = 1;
|
||||
public int refinement = 1;
|
||||
public int rank = 4;
|
||||
}
|
||||
}
|
||||
|
@ -4,14 +4,15 @@ import emu.grasscutter.data.*;
|
||||
import emu.grasscutter.data.common.ItemParamData;
|
||||
import lombok.*;
|
||||
|
||||
@Setter
|
||||
@Getter
|
||||
@ResourceType(name = "StatuePromoteExcelConfigData.json")
|
||||
public class StatuePromoteData extends GameResource {
|
||||
@Setter private int level;
|
||||
@Setter private int cityId;
|
||||
@Setter private ItemParamData[] costItems;
|
||||
@Setter private int[] rewardIdList;
|
||||
@Setter private int stamina;
|
||||
private int level;
|
||||
private int cityId;
|
||||
private ItemParamData[] costItems;
|
||||
private int[] rewardIdList;
|
||||
private int stamina;
|
||||
|
||||
@Override
|
||||
public int getId() {
|
||||
|
@ -9,24 +9,30 @@ import java.util.*;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import org.bson.Document;
|
||||
|
||||
@Entity(value = "accounts", useDiscriminator = false)
|
||||
public class Account {
|
||||
@Setter
|
||||
@Getter
|
||||
@Id private String id;
|
||||
|
||||
@Setter
|
||||
@Getter
|
||||
@Indexed(options = @IndexOptions(unique = true))
|
||||
@Collation(locale = "simple", caseLevel = true)
|
||||
private String username;
|
||||
|
||||
@Setter
|
||||
@Getter
|
||||
private String password; // Unused for now
|
||||
|
||||
private int reservedPlayerId;
|
||||
@Setter
|
||||
private String email;
|
||||
|
||||
@Setter
|
||||
@Getter
|
||||
private String token;
|
||||
@Getter
|
||||
@ -37,13 +43,17 @@ public class Account {
|
||||
*/
|
||||
@Getter
|
||||
private final List<String> permissions;
|
||||
@Setter
|
||||
@Getter
|
||||
private Locale locale;
|
||||
|
||||
@Setter
|
||||
@Getter
|
||||
private String banReason;
|
||||
@Setter
|
||||
@Getter
|
||||
private int banEndTime;
|
||||
@Setter
|
||||
@Getter
|
||||
private int banStartTime;
|
||||
private boolean isBanned;
|
||||
@ -80,22 +90,6 @@ public class Account {
|
||||
return (wildcardParts.length == permissionParts.length);
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public void setUsername(String username) {
|
||||
this.username = username;
|
||||
}
|
||||
|
||||
public void setPassword(String password) {
|
||||
this.password = password;
|
||||
}
|
||||
|
||||
public void setToken(String token) {
|
||||
this.token = token;
|
||||
}
|
||||
|
||||
public int getReservedPlayerUid() {
|
||||
return this.reservedPlayerId;
|
||||
}
|
||||
@ -113,32 +107,12 @@ public class Account {
|
||||
}
|
||||
}
|
||||
|
||||
public void setEmail(String email) {
|
||||
this.email = email;
|
||||
}
|
||||
|
||||
public String generateSessionKey() {
|
||||
this.sessionKey = Utils.bytesToHex(Crypto.createSessionKey(32));
|
||||
this.save();
|
||||
return this.sessionKey;
|
||||
}
|
||||
|
||||
public void setLocale(Locale locale) {
|
||||
this.locale = locale;
|
||||
}
|
||||
|
||||
public void setBanReason(String banReason) {
|
||||
this.banReason = banReason;
|
||||
}
|
||||
|
||||
public void setBanEndTime(int banEndTime) {
|
||||
this.banEndTime = banEndTime;
|
||||
}
|
||||
|
||||
public void setBanStartTime(int banStartTime) {
|
||||
this.banStartTime = banStartTime;
|
||||
}
|
||||
|
||||
public boolean isBanned() {
|
||||
if (banEndTime > 0 && banEndTime < System.currentTimeMillis() / 1000) {
|
||||
this.isBanned = false;
|
||||
|
@ -16,10 +16,11 @@ import java.util.*;
|
||||
import java.util.stream.Stream;
|
||||
import lombok.*;
|
||||
|
||||
@Setter
|
||||
@Getter
|
||||
@GameActivity(ActivityType.NEW_ACTIVITY_TRIAL_AVATAR)
|
||||
public class TrialAvatarActivityHandler extends ActivityHandler {
|
||||
@Setter private int selectedTrialAvatarIndex;
|
||||
private int selectedTrialAvatarIndex;
|
||||
|
||||
@Override
|
||||
public void onInitPlayerActivityData(PlayerActivityData playerActivityData) {
|
||||
|
@ -5,13 +5,16 @@ import emu.grasscutter.data.GameData;
|
||||
import emu.grasscutter.data.excels.BattlePassMissionData;
|
||||
import emu.grasscutter.game.props.BattlePassMissionStatus;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@Entity
|
||||
public class BattlePassMission {
|
||||
@Getter
|
||||
private int id;
|
||||
@Setter
|
||||
@Getter
|
||||
private int progress;
|
||||
@Setter
|
||||
private BattlePassMissionStatus status;
|
||||
|
||||
@Transient private BattlePassMissionData data;
|
||||
@ -30,10 +33,6 @@ public class BattlePassMission {
|
||||
return this.data;
|
||||
}
|
||||
|
||||
public void setProgress(int value) {
|
||||
this.progress = value;
|
||||
}
|
||||
|
||||
public void addProgress(int addProgress, int maxProgress) {
|
||||
this.progress = Math.min(addProgress + this.progress, maxProgress);
|
||||
}
|
||||
@ -43,10 +42,6 @@ public class BattlePassMission {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(BattlePassMissionStatus status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public boolean isFinshed() {
|
||||
return getStatus().getValue() >= 2;
|
||||
}
|
||||
|
@ -4,15 +4,15 @@ import dev.morphia.annotations.Entity;
|
||||
import emu.grasscutter.net.proto.CityInfoOuterClass.CityInfo;
|
||||
import lombok.*;
|
||||
|
||||
@Setter
|
||||
@Getter
|
||||
@Entity
|
||||
public class CityInfoData {
|
||||
@Setter private int cityId;
|
||||
private int cityId;
|
||||
|
||||
@Setter
|
||||
private int level = 1; // level of the city (include level SotS, level Frostbearing Trees, etc.)
|
||||
|
||||
@Setter private int numCrystal = 0; // number of crystals in the city
|
||||
private int numCrystal = 0; // number of crystals in the city
|
||||
|
||||
public CityInfoData(int cityId) {
|
||||
this.cityId = cityId;
|
||||
|
@ -2,9 +2,11 @@ package emu.grasscutter.game.combine;
|
||||
|
||||
import emu.grasscutter.data.common.ItemParamData;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Setter
|
||||
@Getter
|
||||
public class CombineResult {
|
||||
private List<ItemParamData> material;
|
||||
@ -12,19 +14,4 @@ public class CombineResult {
|
||||
private List<ItemParamData> extra;
|
||||
private List<ItemParamData> back;
|
||||
|
||||
public void setMaterial(List<ItemParamData> material) {
|
||||
this.material = material;
|
||||
}
|
||||
|
||||
public void setResult(List<ItemParamData> result) {
|
||||
this.result = result;
|
||||
}
|
||||
|
||||
public void setExtra(List<ItemParamData> extra) {
|
||||
this.extra = extra;
|
||||
}
|
||||
|
||||
public void setBack(List<ItemParamData> back) {
|
||||
this.back = back;
|
||||
}
|
||||
}
|
||||
|
@ -1,19 +1,14 @@
|
||||
package emu.grasscutter.game.combine;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Setter
|
||||
@Getter
|
||||
public class ReliquaryDecomposeEntry {
|
||||
private int configId;
|
||||
private List<Integer> items;
|
||||
|
||||
public void setConfigId(int configId) {
|
||||
this.configId = configId;
|
||||
}
|
||||
|
||||
public void setItems(List<Integer> items) {
|
||||
this.items = items;
|
||||
}
|
||||
}
|
||||
|
@ -1,26 +1,21 @@
|
||||
package emu.grasscutter.game.drop;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Deprecated
|
||||
public class DropData {
|
||||
private int minWeight;
|
||||
private int maxWeight;
|
||||
@Setter
|
||||
private int itemId;
|
||||
private int minCount;
|
||||
private int maxCount;
|
||||
private boolean share = false;
|
||||
@Setter
|
||||
private boolean give = false;
|
||||
|
||||
public void setGive(boolean give) {
|
||||
this.give = give;
|
||||
}
|
||||
|
||||
public void setItemId(int itemId) {
|
||||
this.itemId = itemId;
|
||||
}
|
||||
|
||||
public void setIsShare(boolean share) {
|
||||
this.share = share;
|
||||
}
|
||||
|
@ -1,19 +1,14 @@
|
||||
package emu.grasscutter.game.dungeons;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Setter
|
||||
@Getter
|
||||
public class DungeonDrop {
|
||||
private int dungeonId;
|
||||
private List<DungeonDropEntry> drops;
|
||||
|
||||
public void setDungeonId(int dungeonId) {
|
||||
this.dungeonId = dungeonId;
|
||||
}
|
||||
|
||||
public void setDrops(List<DungeonDropEntry> drops) {
|
||||
this.drops = drops;
|
||||
}
|
||||
}
|
||||
|
@ -1,9 +1,11 @@
|
||||
package emu.grasscutter.game.dungeons;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Setter
|
||||
@Getter
|
||||
public class DungeonDropEntry {
|
||||
private List<Integer> counts;
|
||||
@ -12,23 +14,4 @@ public class DungeonDropEntry {
|
||||
private List<Integer> itemProbabilities;
|
||||
private boolean mpDouble;
|
||||
|
||||
public void setCounts(List<Integer> counts) {
|
||||
this.counts = counts;
|
||||
}
|
||||
|
||||
public void setItems(List<Integer> items) {
|
||||
this.items = items;
|
||||
}
|
||||
|
||||
public void setProbabilities(List<Integer> probabilities) {
|
||||
this.probabilities = probabilities;
|
||||
}
|
||||
|
||||
public void setItemProbabilities(List<Integer> itemProbabilities) {
|
||||
this.itemProbabilities = itemProbabilities;
|
||||
}
|
||||
|
||||
public void setMpDouble(boolean mpDouble) {
|
||||
this.mpDouble = mpDouble;
|
||||
}
|
||||
}
|
||||
|
@ -5,9 +5,11 @@ import emu.grasscutter.game.dungeons.enums.DungeonPassConditionType;
|
||||
import emu.grasscutter.game.world.Scene;
|
||||
import emu.grasscutter.scripts.data.SceneGroup;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Setter
|
||||
@Getter
|
||||
public final class DungeonChallenge extends WorldChallenge {
|
||||
|
||||
@ -24,10 +26,6 @@ public final class DungeonChallenge extends WorldChallenge {
|
||||
super(scene, group, challengeId, challengeIndex, paramList, timeLimit, goal, challengeTriggers);
|
||||
}
|
||||
|
||||
public void setStage(boolean stage) {
|
||||
this.stage = stage;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void done() {
|
||||
super.done();
|
||||
|
@ -6,13 +6,14 @@ import emu.grasscutter.net.proto.PlatformInfoOuterClass.PlatformInfo;
|
||||
import emu.grasscutter.scripts.data.SceneGadget;
|
||||
import lombok.*;
|
||||
|
||||
@Setter
|
||||
@Getter
|
||||
public abstract class BaseRoute {
|
||||
@Setter private boolean isStarted;
|
||||
@Setter private boolean isActive;
|
||||
@Setter private Position startRot;
|
||||
@Setter private int startSceneTime;
|
||||
@Setter private int stopSceneTime;
|
||||
private boolean isStarted;
|
||||
private boolean isActive;
|
||||
private Position startRot;
|
||||
private int startSceneTime;
|
||||
private int stopSceneTime;
|
||||
|
||||
BaseRoute(Position startRot, boolean isStarted, boolean isActive) {
|
||||
this.startRot = startRot;
|
||||
|
@ -6,12 +6,13 @@ import emu.grasscutter.scripts.data.SceneGadget;
|
||||
import java.util.*;
|
||||
import lombok.*;
|
||||
|
||||
@Setter
|
||||
@Getter
|
||||
public class ConfigRoute extends BaseRoute {
|
||||
|
||||
@Setter private int routeId;
|
||||
@Setter private int startIndex;
|
||||
@Setter private List<Integer> scheduledIndexes;
|
||||
private int routeId;
|
||||
private int startIndex;
|
||||
private List<Integer> scheduledIndexes;
|
||||
|
||||
public ConfigRoute(SceneGadget gadget) {
|
||||
super(gadget);
|
||||
|
@ -6,11 +6,12 @@ import emu.grasscutter.scripts.data.SceneGadget;
|
||||
import lombok.*;
|
||||
|
||||
/** TODO implement point array routes, read from missing resources */
|
||||
@Setter
|
||||
@Getter
|
||||
public class PointArrayRoute extends BaseRoute {
|
||||
|
||||
@Setter int currentPoint;
|
||||
@Setter int pointArrayId;
|
||||
int currentPoint;
|
||||
int pointArrayId;
|
||||
|
||||
public PointArrayRoute(SceneGadget gadget) {
|
||||
super(gadget);
|
||||
|
@ -8,12 +8,14 @@ import emu.grasscutter.net.proto.FriendOnlineStateOuterClass.FriendOnlineState;
|
||||
import emu.grasscutter.net.proto.PlatformTypeOuterClass;
|
||||
import emu.grasscutter.net.proto.ProfilePictureOuterClass.ProfilePicture;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import org.bson.types.ObjectId;
|
||||
|
||||
@Entity(value = "friendships", useDiscriminator = false)
|
||||
public class Friendship {
|
||||
@Id private ObjectId id;
|
||||
|
||||
@Setter
|
||||
@Getter
|
||||
@Transient private Player owner;
|
||||
|
||||
@ -21,7 +23,9 @@ public class Friendship {
|
||||
@Indexed private int ownerId;
|
||||
@Getter
|
||||
@Indexed private int friendId;
|
||||
@Setter
|
||||
private boolean isFriend;
|
||||
@Setter
|
||||
@Getter
|
||||
private int askerId;
|
||||
|
||||
@ -38,22 +42,10 @@ public class Friendship {
|
||||
this.askerId = asker.getUid();
|
||||
}
|
||||
|
||||
public void setOwner(Player owner) {
|
||||
this.owner = owner;
|
||||
}
|
||||
|
||||
public boolean isFriend() {
|
||||
return isFriend;
|
||||
}
|
||||
|
||||
public void setIsFriend(boolean b) {
|
||||
this.isFriend = b;
|
||||
}
|
||||
|
||||
public void setAskerId(int askerId) {
|
||||
this.askerId = askerId;
|
||||
}
|
||||
|
||||
public PlayerProfile getFriendProfile() {
|
||||
return profile;
|
||||
}
|
||||
|
@ -4,8 +4,10 @@ import dev.morphia.annotations.*;
|
||||
import java.util.Date;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import org.bson.types.ObjectId;
|
||||
|
||||
@Setter
|
||||
@Getter
|
||||
@Entity(value = "gachas", useDiscriminator = false)
|
||||
public class GachaRecord {
|
||||
@ -26,26 +28,6 @@ public class GachaRecord {
|
||||
this.gachaType = gachaType;
|
||||
}
|
||||
|
||||
public void setOwnerId(int ownerId) {
|
||||
this.ownerId = ownerId;
|
||||
}
|
||||
|
||||
public void setGachaType(int type) {
|
||||
this.gachaType = type;
|
||||
}
|
||||
|
||||
public void setTransactionDate(Date transactionDate) {
|
||||
this.transactionDate = transactionDate;
|
||||
}
|
||||
|
||||
public void setItemID(int itemID) {
|
||||
this.itemID = itemID;
|
||||
}
|
||||
|
||||
public void setId(ObjectId id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return toJsonString();
|
||||
}
|
||||
|
@ -1,7 +1,9 @@
|
||||
package emu.grasscutter.game.inventory;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@Setter
|
||||
@Getter
|
||||
public class ItemDef {
|
||||
private int itemId;
|
||||
@ -12,11 +14,4 @@ public class ItemDef {
|
||||
this.count = count;
|
||||
}
|
||||
|
||||
public void setItemId(int itemId) {
|
||||
this.itemId = itemId;
|
||||
}
|
||||
|
||||
public void setCount(int count) {
|
||||
this.count = count;
|
||||
}
|
||||
}
|
||||
|
@ -13,12 +13,14 @@ import java.time.Instant;
|
||||
import java.util.*;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import org.bson.types.ObjectId;
|
||||
|
||||
@Entity(value = "mail", useDiscriminator = false)
|
||||
public final class Mail {
|
||||
@Getter
|
||||
@Id private ObjectId id;
|
||||
@Setter
|
||||
@Getter
|
||||
@Indexed private int ownerUid;
|
||||
public final MailContent mailContent;
|
||||
@ -63,10 +65,6 @@ public final class Mail {
|
||||
this.stateValue = state; // Different mailboxes, 1 = Default, 3 = Gift-box.
|
||||
}
|
||||
|
||||
public void setOwnerUid(int ownerUid) {
|
||||
this.ownerUid = ownerUid;
|
||||
}
|
||||
|
||||
public MailDataOuterClass.MailData toProto(Player player) {
|
||||
return MailDataOuterClass.MailData.newBuilder()
|
||||
.setMailId(player.getMailId(this))
|
||||
|
@ -2,22 +2,29 @@ package emu.grasscutter.game.managers.forging;
|
||||
|
||||
import dev.morphia.annotations.Entity;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@Entity
|
||||
public class ActiveForgeData {
|
||||
@Setter
|
||||
@Getter
|
||||
private int forgeId;
|
||||
@Setter
|
||||
@Getter
|
||||
private int avatarId;
|
||||
@Setter
|
||||
@Getter
|
||||
private int count;
|
||||
|
||||
@Setter
|
||||
@Getter
|
||||
private int startTime;
|
||||
@Setter
|
||||
@Getter
|
||||
private int forgeTime;
|
||||
|
||||
private int lastUnfinishedCount;
|
||||
@Setter
|
||||
@Getter
|
||||
private boolean changed;
|
||||
|
||||
@ -42,30 +49,6 @@ public class ActiveForgeData {
|
||||
return this.startTime + this.forgeTime * this.count;
|
||||
}
|
||||
|
||||
public void setForgeId(int value) {
|
||||
this.forgeId = value;
|
||||
}
|
||||
|
||||
public void setAvatarId(int value) {
|
||||
this.avatarId = value;
|
||||
}
|
||||
|
||||
public void setCount(int value) {
|
||||
this.count = value;
|
||||
}
|
||||
|
||||
public void setStartTime(int value) {
|
||||
this.startTime = value;
|
||||
}
|
||||
|
||||
public void setForgeTime(int value) {
|
||||
this.forgeTime = value;
|
||||
}
|
||||
|
||||
public void setChanged(boolean value) {
|
||||
this.changed = value;
|
||||
}
|
||||
|
||||
public boolean updateChanged(int currentTime) {
|
||||
int currentUnfinished = this.getUnfinishedCount(currentTime);
|
||||
|
||||
|
@ -6,12 +6,14 @@ import dev.morphia.annotations.Entity;
|
||||
import emu.grasscutter.game.avatar.Avatar;
|
||||
import emu.grasscutter.net.proto.AvatarTeamOuterClass.AvatarTeam;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
@Getter
|
||||
@Entity
|
||||
public final class TeamInfo {
|
||||
@Setter
|
||||
private String name;
|
||||
private final List<Integer> avatars;
|
||||
|
||||
@ -25,10 +27,6 @@ public final class TeamInfo {
|
||||
this.avatars = avatars;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public int size() {
|
||||
return avatars.size();
|
||||
}
|
||||
|
@ -2,7 +2,9 @@ package emu.grasscutter.game.shop;
|
||||
|
||||
import dev.morphia.annotations.Entity;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@Setter
|
||||
@Getter
|
||||
@Entity
|
||||
public class ShopLimit {
|
||||
@ -11,19 +13,4 @@ public class ShopLimit {
|
||||
private int hasBoughtInPeriod = 0;
|
||||
private int nextRefreshTime = 0;
|
||||
|
||||
public void setShopGoodId(int shopGoodId) {
|
||||
this.shopGoodId = shopGoodId;
|
||||
}
|
||||
|
||||
public void setHasBought(int hasBought) {
|
||||
this.hasBought = hasBought;
|
||||
}
|
||||
|
||||
public void setNextRefreshTime(int nextRefreshTime) {
|
||||
this.nextRefreshTime = nextRefreshTime;
|
||||
}
|
||||
|
||||
public void setHasBoughtInPeriod(int hasBoughtInPeriod) {
|
||||
this.hasBoughtInPeriod = hasBoughtInPeriod;
|
||||
}
|
||||
}
|
||||
|
@ -1,19 +1,14 @@
|
||||
package emu.grasscutter.game.shop;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
@Setter
|
||||
@Getter
|
||||
public class ShopTable {
|
||||
private int shopId;
|
||||
private List<ShopInfo> items = new ArrayList<>();
|
||||
|
||||
public void setShopId(int shopId) {
|
||||
this.shopId = shopId;
|
||||
}
|
||||
|
||||
public void setItems(List<ShopInfo> items) {
|
||||
this.items = items;
|
||||
}
|
||||
}
|
||||
|
@ -2,9 +2,11 @@ package emu.grasscutter.game.tower;
|
||||
|
||||
import dev.morphia.annotations.Entity;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
@Setter
|
||||
@Getter
|
||||
@Entity
|
||||
public class TowerLevelRecord {
|
||||
@ -36,15 +38,4 @@ public class TowerLevelRecord {
|
||||
return passedLevelMap.values().stream().mapToInt(Integer::intValue).sum();
|
||||
}
|
||||
|
||||
public void setFloorId(int floorId) {
|
||||
this.floorId = floorId;
|
||||
}
|
||||
|
||||
public void setPassedLevelMap(Map<Integer, Integer> passedLevelMap) {
|
||||
this.passedLevelMap = passedLevelMap;
|
||||
}
|
||||
|
||||
public void setFloorStarRewardProgress(int floorStarRewardProgress) {
|
||||
this.floorStarRewardProgress = floorStarRewardProgress;
|
||||
}
|
||||
}
|
||||
|
@ -1,9 +1,11 @@
|
||||
package emu.grasscutter.game.tower;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Setter
|
||||
@Getter
|
||||
public class TowerScheduleConfig {
|
||||
private int scheduleId;
|
||||
@ -11,15 +13,4 @@ public class TowerScheduleConfig {
|
||||
private Date scheduleStartTime;
|
||||
private Date nextScheduleChangeTime;
|
||||
|
||||
public void setScheduleId(int scheduleId) {
|
||||
this.scheduleId = scheduleId;
|
||||
}
|
||||
|
||||
public void setScheduleStartTime(Date scheduleStartTime) {
|
||||
this.scheduleStartTime = scheduleStartTime;
|
||||
}
|
||||
|
||||
public void setNextScheduleChangeTime(Date nextScheduleChangeTime) {
|
||||
this.nextScheduleChangeTime = nextScheduleChangeTime;
|
||||
}
|
||||
}
|
||||
|
@ -6,17 +6,18 @@ import java.io.*;
|
||||
import java.util.List;
|
||||
import lombok.*;
|
||||
|
||||
@Setter
|
||||
@Getter
|
||||
@Entity
|
||||
public final class GridPosition implements Serializable {
|
||||
@Serial
|
||||
private static final long serialVersionUID = -2001232300615923575L;
|
||||
|
||||
@Setter private int x;
|
||||
private int x;
|
||||
|
||||
@Setter private int z;
|
||||
private int z;
|
||||
|
||||
@Setter private int width;
|
||||
private int width;
|
||||
|
||||
public GridPosition() {}
|
||||
|
||||
|
@ -3,11 +3,12 @@ package emu.grasscutter.game.world;
|
||||
import dev.morphia.annotations.*;
|
||||
import lombok.*;
|
||||
|
||||
@Setter
|
||||
@Getter
|
||||
@Entity
|
||||
public class Location extends Position {
|
||||
@Transient
|
||||
@Setter private Scene scene;
|
||||
private Scene scene;
|
||||
|
||||
public Location(Scene scene, Position position) {
|
||||
this.set(position);
|
||||
|
@ -12,6 +12,7 @@ import java.util.List;
|
||||
import lombok.*;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
@Setter
|
||||
@Getter
|
||||
@Entity
|
||||
@Accessors(chain = true)
|
||||
@ -25,19 +26,16 @@ public class Position implements Serializable {
|
||||
@SerializedName(
|
||||
value = "x",
|
||||
alternate = {"_x", "X"})
|
||||
@Setter
|
||||
private float x;
|
||||
|
||||
@SerializedName(
|
||||
value = "y",
|
||||
alternate = {"_y", "Y"})
|
||||
@Setter
|
||||
private float y;
|
||||
|
||||
@SerializedName(
|
||||
value = "z",
|
||||
alternate = {"_z", "Z"})
|
||||
@Setter
|
||||
private float z;
|
||||
|
||||
public Position() {}
|
||||
|
@ -39,6 +39,7 @@ import java.util.concurrent.ThreadPoolExecutor;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import javax.annotation.Nullable;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.val;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
@ -51,6 +52,7 @@ public class World implements Iterable<Player> {
|
||||
@Getter private final EntityWorld entity;
|
||||
private int nextEntityId = 0;
|
||||
private int nextPeerId = 0;
|
||||
@Setter
|
||||
@Getter
|
||||
private int worldLevel;
|
||||
|
||||
@ -122,10 +124,6 @@ public class World implements Iterable<Player> {
|
||||
return ++this.nextPeerId;
|
||||
}
|
||||
|
||||
public void setWorldLevel(int worldLevel) {
|
||||
this.worldLevel = worldLevel;
|
||||
}
|
||||
|
||||
protected synchronized void setHost(Player host) {
|
||||
this.host = host;
|
||||
}
|
||||
|
@ -3,6 +3,7 @@ package emu.grasscutter.net.packet;
|
||||
import com.google.protobuf.GeneratedMessageV3;
|
||||
import emu.grasscutter.net.proto.PacketHeadOuterClass.PacketHead;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.io.*;
|
||||
|
||||
@ -10,14 +11,18 @@ public class BasePacket {
|
||||
private static final int const1 = 17767; // 0x4567
|
||||
private static final int const2 = -30293; // 0x89ab
|
||||
public final boolean shouldEncrypt = true;
|
||||
@Setter
|
||||
@Getter
|
||||
private int opcode;
|
||||
private boolean shouldBuildHeader = false;
|
||||
@Setter
|
||||
@Getter
|
||||
private byte[] header;
|
||||
@Setter
|
||||
@Getter
|
||||
private byte[] data;
|
||||
// Encryption
|
||||
@Setter
|
||||
private boolean useDispatchKey;
|
||||
|
||||
public BasePacket(int opcode) {
|
||||
@ -34,30 +39,14 @@ public class BasePacket {
|
||||
this.shouldBuildHeader = buildHeader;
|
||||
}
|
||||
|
||||
public void setOpcode(int opcode) {
|
||||
this.opcode = opcode;
|
||||
}
|
||||
|
||||
public boolean useDispatchKey() {
|
||||
return useDispatchKey;
|
||||
}
|
||||
|
||||
public void setUseDispatchKey(boolean useDispatchKey) {
|
||||
this.useDispatchKey = useDispatchKey;
|
||||
}
|
||||
|
||||
public void setHeader(byte[] header) {
|
||||
this.header = header;
|
||||
}
|
||||
|
||||
public boolean shouldBuildHeader() {
|
||||
return shouldBuildHeader;
|
||||
}
|
||||
|
||||
public void setData(byte[] data) {
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
public void setData(GeneratedMessageV3 proto) {
|
||||
this.data = proto.toByteArray();
|
||||
}
|
||||
|
@ -22,13 +22,10 @@ public class SceneBlock {
|
||||
public Map<Integer, SceneGroup> groups;
|
||||
public RTree<SceneGroup, Geometry> sceneGroupIndex;
|
||||
|
||||
@Setter
|
||||
@Getter
|
||||
private transient boolean loaded; // Not an actual variable in the scripts either
|
||||
|
||||
public void setLoaded(boolean loaded) {
|
||||
this.loaded = loaded;
|
||||
}
|
||||
|
||||
public boolean contains(Position pos) {
|
||||
int range = Grasscutter.getConfig().server.game.loadEntitiesForPlayerRange;
|
||||
return pos.getX() <= (this.max.getX() + range)
|
||||
|
@ -24,6 +24,7 @@ public class SceneGadget extends SceneObject {
|
||||
* isOneOff=false, like investigation points, it will disappear temporarily, and appear again in
|
||||
* next big world resource refresh routine.
|
||||
*/
|
||||
@Setter
|
||||
public boolean isOneoff;
|
||||
|
||||
public int draft_id;
|
||||
@ -35,7 +36,4 @@ public class SceneGadget extends SceneObject {
|
||||
public Explore explore;
|
||||
public int trigger_count;
|
||||
|
||||
public void setIsOneoff(boolean isOneoff) {
|
||||
this.isOneoff = isOneoff;
|
||||
}
|
||||
}
|
||||
|
@ -37,6 +37,7 @@ public final class SceneGroup {
|
||||
public SceneReplaceable is_replaceable;
|
||||
|
||||
/* These are not script variables. */
|
||||
@Setter
|
||||
@Getter
|
||||
private transient boolean loaded;
|
||||
@Getter
|
||||
@ -51,10 +52,6 @@ public final class SceneGroup {
|
||||
return group;
|
||||
}
|
||||
|
||||
public void setLoaded(boolean loaded) {
|
||||
this.loaded = loaded;
|
||||
}
|
||||
|
||||
public int getBusinessType() {
|
||||
return this.business == null ? 0 : this.business.type;
|
||||
}
|
||||
|
@ -2,7 +2,9 @@ package emu.grasscutter.server.event.dispatch;
|
||||
|
||||
import emu.grasscutter.server.event.types.ServerEvent;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@Setter
|
||||
@Getter
|
||||
public final class QueryAllRegionsEvent extends ServerEvent {
|
||||
private String regionList;
|
||||
@ -13,7 +15,4 @@ public final class QueryAllRegionsEvent extends ServerEvent {
|
||||
this.regionList = regionList;
|
||||
}
|
||||
|
||||
public void setRegionList(String regionList) {
|
||||
this.regionList = regionList;
|
||||
}
|
||||
}
|
||||
|
@ -2,7 +2,9 @@ package emu.grasscutter.server.event.dispatch;
|
||||
|
||||
import emu.grasscutter.server.event.types.ServerEvent;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@Setter
|
||||
@Getter
|
||||
public final class QueryCurrentRegionEvent extends ServerEvent {
|
||||
private String regionInfo;
|
||||
@ -13,7 +15,4 @@ public final class QueryCurrentRegionEvent extends ServerEvent {
|
||||
this.regionInfo = regionInfo;
|
||||
}
|
||||
|
||||
public void setRegionInfo(String regionInfo) {
|
||||
this.regionInfo = regionInfo;
|
||||
}
|
||||
}
|
||||
|
@ -6,6 +6,7 @@ import javax.annotation.Nullable;
|
||||
import lombok.*;
|
||||
|
||||
/** Invoked when an entity is created. */
|
||||
@Setter
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public final class EntityCreationEvent extends Event {
|
||||
@ -22,9 +23,9 @@ public final class EntityCreationEvent extends Event {
|
||||
return type.cast(event.getEntity());
|
||||
}
|
||||
|
||||
@Setter private Class<? extends GameEntity> entityType;
|
||||
@Setter private Class<?>[] constructorArgTypes;
|
||||
@Setter private Object[] constructorArgs;
|
||||
private Class<? extends GameEntity> entityType;
|
||||
private Class<?>[] constructorArgTypes;
|
||||
private Object[] constructorArgs;
|
||||
|
||||
/**
|
||||
* Creates a new entity. Returns null if the entity could not be created.
|
||||
|
@ -4,10 +4,12 @@ import emu.grasscutter.game.player.Player;
|
||||
import emu.grasscutter.server.event.types.GameEvent;
|
||||
import emu.grasscutter.server.game.GameSession;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
public final class PlayerCreationEvent extends GameEvent {
|
||||
private final GameSession session;
|
||||
@Setter
|
||||
private Class<? extends Player> playerClass;
|
||||
|
||||
public PlayerCreationEvent(GameSession session, Class<? extends Player> playerClass) {
|
||||
@ -15,7 +17,4 @@ public final class PlayerCreationEvent extends GameEvent {
|
||||
this.playerClass = playerClass;
|
||||
}
|
||||
|
||||
public void setPlayerClass(Class<? extends Player> playerClass) {
|
||||
this.playerClass = playerClass;
|
||||
}
|
||||
}
|
||||
|
@ -4,11 +4,13 @@ import emu.grasscutter.game.player.Player;
|
||||
import emu.grasscutter.server.event.Cancellable;
|
||||
import emu.grasscutter.server.event.types.ServerEvent;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
public final class ReceiveCommandFeedbackEvent extends ServerEvent implements Cancellable {
|
||||
@Nullable private final Player player;
|
||||
@Setter
|
||||
@Getter
|
||||
private String message;
|
||||
|
||||
@ -19,10 +21,6 @@ public final class ReceiveCommandFeedbackEvent extends ServerEvent implements Ca
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
public void setMessage(String message) {
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
@Nullable public Player getPlayer() {
|
||||
return this.player;
|
||||
}
|
||||
|
@ -4,11 +4,13 @@ import emu.grasscutter.server.event.Cancellable;
|
||||
import emu.grasscutter.server.event.types.ServerEvent;
|
||||
import emu.grasscutter.server.game.GameSession;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
public final class ReceivePacketEvent extends ServerEvent implements Cancellable {
|
||||
private final GameSession gameSession;
|
||||
private final int packetId;
|
||||
@Setter
|
||||
private byte[] packetData;
|
||||
|
||||
public ReceivePacketEvent(GameSession gameSession, int packetId, byte[] packetData) {
|
||||
@ -19,7 +21,4 @@ public final class ReceivePacketEvent extends ServerEvent implements Cancellable
|
||||
this.packetData = packetData;
|
||||
}
|
||||
|
||||
public void setPacketData(byte[] packetData) {
|
||||
this.packetData = packetData;
|
||||
}
|
||||
}
|
||||
|
@ -5,10 +5,12 @@ import emu.grasscutter.server.event.Cancellable;
|
||||
import emu.grasscutter.server.event.types.ServerEvent;
|
||||
import emu.grasscutter.server.game.GameSession;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
public final class SendPacketEvent extends ServerEvent implements Cancellable {
|
||||
private final GameSession gameSession;
|
||||
@Setter
|
||||
private BasePacket packet;
|
||||
|
||||
public SendPacketEvent(GameSession gameSession, BasePacket packet) {
|
||||
@ -18,7 +20,4 @@ public final class SendPacketEvent extends ServerEvent implements Cancellable {
|
||||
this.packet = packet;
|
||||
}
|
||||
|
||||
public void setPacket(BasePacket packet) {
|
||||
this.packet = packet;
|
||||
}
|
||||
}
|
||||
|
@ -5,9 +5,10 @@ import emu.grasscutter.game.player.Player;
|
||||
import emu.grasscutter.server.event.types.PlayerEvent;
|
||||
import lombok.*;
|
||||
|
||||
@Setter
|
||||
@Getter
|
||||
public final class PlayerForgeItemEvent extends PlayerEvent {
|
||||
@Setter private GameItem itemForged;
|
||||
private GameItem itemForged;
|
||||
|
||||
public PlayerForgeItemEvent(Player player, GameItem itemForged) {
|
||||
super(player);
|
||||
|
@ -6,10 +6,12 @@ import emu.grasscutter.game.world.ChestReward;
|
||||
import emu.grasscutter.server.event.Cancellable;
|
||||
import emu.grasscutter.server.event.types.PlayerEvent;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
public final class PlayerOpenChestEvent extends PlayerEvent implements Cancellable {
|
||||
private final GadgetChest chest;
|
||||
@Setter
|
||||
private ChestReward reward;
|
||||
|
||||
public PlayerOpenChestEvent(Player player, GadgetChest chest, ChestReward reward) {
|
||||
@ -19,8 +21,4 @@ public final class PlayerOpenChestEvent extends PlayerEvent implements Cancellab
|
||||
this.reward = reward;
|
||||
}
|
||||
|
||||
public void setReward(ChestReward reward) {
|
||||
this.reward = reward;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -5,7 +5,9 @@ import emu.grasscutter.game.player.Player;
|
||||
import emu.grasscutter.server.event.Cancellable;
|
||||
import emu.grasscutter.server.event.types.PlayerEvent;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@Setter
|
||||
@Getter
|
||||
public final class PlayerReceiveMailEvent extends PlayerEvent implements Cancellable {
|
||||
private Mail message;
|
||||
@ -16,7 +18,4 @@ public final class PlayerReceiveMailEvent extends PlayerEvent implements Cancell
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
public void setMessage(Mail message) {
|
||||
this.message = message;
|
||||
}
|
||||
}
|
||||
|
@ -5,9 +5,11 @@ import ch.qos.logback.core.AppenderBase;
|
||||
import ch.qos.logback.core.encoder.Encoder;
|
||||
import emu.grasscutter.server.event.internal.ServerLogEvent;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.nio.charset.StandardCharsets;
|
||||
|
||||
@Setter
|
||||
@Getter
|
||||
public final class ServerLogEventAppender<E> extends AppenderBase<E> {
|
||||
private Encoder<E> encoder;
|
||||
@ -20,7 +22,4 @@ public final class ServerLogEventAppender<E> extends AppenderBase<E> {
|
||||
sle.call();
|
||||
}
|
||||
|
||||
public void setEncoder(Encoder<E> encoder) {
|
||||
this.encoder = encoder;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user