Compare commits

...

2 Commits

Author SHA1 Message Date
github-actions
2bb2da44bc Format code [skip actions] 2024-06-09 15:12:09 +00:00
Breno A.
bfc2c7c096 refactor: fix lombok 2024-06-09 12:09:50 -03:00
9 changed files with 28 additions and 15 deletions

View File

@ -8,7 +8,7 @@ import lombok.Getter;
@ResourceType(name = "RewardPreviewExcelConfigData.json", loadPriority = LoadPriority.HIGH)
public class RewardPreviewData extends GameResource {
@Getter(onMethod_ = @Override)
@Getter(onMethod = @__(@Override))
private int id;
private ItemParamStringData[] previewItems;

View File

@ -13,7 +13,6 @@ import lombok.experimental.FieldDefaults;
@Getter
@ResourceType(name = "QuestExcelConfigData.json")
@Getter
@ToString
public class QuestData extends GameResource {
private int subId;

View File

@ -8,7 +8,7 @@ import lombok.Getter;
@ResourceType(name = "ReliquaryMainPropExcelConfigData.json")
@Getter
public class ReliquaryMainPropData extends GameResource {
@Getter(onMethod_ = @Override)
@Getter(onMethod = @__(@Override))
private int id;
private int propDepotId;

View File

@ -9,7 +9,7 @@ import lombok.Getter;
@ResourceType(name = "SceneExcelConfigData.json")
@Getter
public final class SceneData extends GameResource {
@Getter(onMethod_ = @Override)
@Getter(onMethod = @__(@Override))
private int id;
@SerializedName("type")

View File

@ -8,7 +8,7 @@ import lombok.Getter;
@ResourceType(name = "SceneTagConfigData.json")
@Getter
public final class SceneTagData extends GameResource {
@Getter(onMethod_ = @Override)
@Getter(onMethod = @__(@Override))
private int id;
@SerializedName("DJCOAOBDIHP")

View File

@ -10,7 +10,7 @@ import lombok.experimental.FieldDefaults;
@Data
@FieldDefaults(level = AccessLevel.PRIVATE)
public class TrialAvatarActivityDataData extends GameResource {
@Getter(onMethod_ = @Override)
@Getter(onMethod = @__({@Override}))
private int id;
private int trialAvatarIndexId;

View File

@ -93,8 +93,8 @@ public class FriendsList extends BasePlayerManager {
// Handle
if (result == DealAddFriendResultType.DEAL_ADD_FRIEND_RESULT_TYPE_ACCEPT) { // Request accepted
myFriendship.setIsFriend(true);
theirFriendship.setIsFriend(true);
myFriendship.setFriend(true);
theirFriendship.setFriend(true);
this.getPendingFriends().remove(myFriendship.getOwnerId());
this.addFriend(myFriendship);

View File

@ -7,19 +7,28 @@ import emu.grasscutter.data.GameData;
import emu.grasscutter.data.common.ItemParamData;
import emu.grasscutter.data.excels.ItemData;
import emu.grasscutter.database.DatabaseHelper;
import emu.grasscutter.game.avatar.*;
import emu.grasscutter.game.avatar.Avatar;
import emu.grasscutter.game.avatar.AvatarStorage;
import emu.grasscutter.game.entity.EntityAvatar;
import emu.grasscutter.game.player.*;
import emu.grasscutter.game.props.*;
import emu.grasscutter.game.player.BasePlayerManager;
import emu.grasscutter.game.player.Player;
import emu.grasscutter.game.props.ActionReason;
import emu.grasscutter.game.props.ItemUseAction.UseItemParams;
import emu.grasscutter.game.props.PlayerProperty;
import emu.grasscutter.game.props.WatcherTriggerType;
import emu.grasscutter.game.quest.enums.QuestContent;
import emu.grasscutter.net.proto.ItemParamOuterClass.ItemParam;
import emu.grasscutter.server.event.player.PlayerObtainItemEvent;
import emu.grasscutter.server.packet.send.*;
import emu.grasscutter.utils.Utils;
import it.unimi.dsi.fastutil.ints.*;
import it.unimi.dsi.fastutil.longs.*;
import java.util.*;
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 java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
import javax.annotation.Nullable;
import lombok.Getter;
import lombok.val;
@ -447,6 +456,7 @@ public class Inventory extends BasePlayerManager implements Iterable<GameItem> {
itemId); // What if we ever want to operate on weapons/relics/furniture? :Syield
// (item == null) ? 0 : item.getCount(); // What if we ever want to
// operate on weapons/relics/furniture? :S
yield (item == null) ? 0 : item.getCount();
}
};
}

View File

@ -13,7 +13,7 @@ public class BasePacket {
@Setter @Getter private int opcode;
private boolean shouldBuildHeader = false;
@Setter @Getter private byte[] header;
@Setter @Getter private byte[] data;
@Getter private byte[] data;
// Encryption
@Setter private boolean useDispatchKey;
@ -48,6 +48,10 @@ public class BasePacket {
this.data = proto.build().toByteArray();
}
public void setData(byte[] packet) {
this.data = packet;
}
public BasePacket buildHeader(int clientSequence) {
if (this.getHeader() != null && clientSequence == 0) {
return this;