Commit d32f706c authored by KingRainbow44's avatar KingRainbow44
Browse files

Merge branch 'development' into api

# Conflicts:
#	src/main/java/emu/grasscutter/plugin/api/ServerHook.java
parents 47d8fd3c f0d728b4
package emu.grasscutter.server.packet.send;
import emu.grasscutter.net.packet.GenshinPacket;
import emu.grasscutter.net.packet.BasePacket;
import emu.grasscutter.net.packet.PacketOpcodes;
import emu.grasscutter.net.proto.AskAddFriendRspOuterClass.AskAddFriendRsp;
public class PacketAskAddFriendRsp extends GenshinPacket {
public class PacketAskAddFriendRsp extends BasePacket {
public PacketAskAddFriendRsp(int targetUid) {
super(PacketOpcodes.AskAddFriendRsp);
......
package emu.grasscutter.server.packet.send;
import emu.grasscutter.game.avatar.GenshinAvatar;
import emu.grasscutter.net.packet.GenshinPacket;
import emu.grasscutter.game.avatar.Avatar;
import emu.grasscutter.net.packet.BasePacket;
import emu.grasscutter.net.packet.PacketOpcodes;
import emu.grasscutter.net.proto.AvatarAddNotifyOuterClass.AvatarAddNotify;
public class PacketAvatarAddNotify extends GenshinPacket {
public class PacketAvatarAddNotify extends BasePacket {
public PacketAvatarAddNotify(GenshinAvatar avatar, boolean addedToTeam) {
public PacketAvatarAddNotify(Avatar avatar, boolean addedToTeam) {
super(PacketOpcodes.AvatarAddNotify);
AvatarAddNotify proto = AvatarAddNotify.newBuilder()
......
package emu.grasscutter.server.packet.send;
import emu.grasscutter.game.entity.EntityAvatar;
import emu.grasscutter.net.packet.GenshinPacket;
import emu.grasscutter.net.packet.BasePacket;
import emu.grasscutter.net.packet.PacketOpcodes;
import emu.grasscutter.net.proto.AvatarChangeCostumeNotifyOuterClass.AvatarChangeCostumeNotify;
public class PacketAvatarChangeCostumeNotify extends GenshinPacket {
public class PacketAvatarChangeCostumeNotify extends BasePacket {
public PacketAvatarChangeCostumeNotify(EntityAvatar entity) {
super(PacketOpcodes.AvatarChangeCostumeNotify);
AvatarChangeCostumeNotify proto = AvatarChangeCostumeNotify.newBuilder()
.setEntity(entity.toProto())
.setEntityInfo(entity.toProto())
.build();
this.setData(proto);
......
package emu.grasscutter.server.packet.send;
import emu.grasscutter.net.packet.GenshinPacket;
import emu.grasscutter.net.packet.BasePacket;
import emu.grasscutter.net.packet.PacketOpcodes;
import emu.grasscutter.net.proto.AvatarChangeCostumeRspOuterClass.AvatarChangeCostumeRsp;
import emu.grasscutter.net.proto.RetcodeOuterClass;
public class PacketAvatarChangeCostumeRsp extends GenshinPacket {
public class PacketAvatarChangeCostumeRsp extends BasePacket {
public PacketAvatarChangeCostumeRsp(long avatarGuid, int costumeId) {
super(PacketOpcodes.AvatarChangeCostumeRsp);
......@@ -21,7 +22,7 @@ public class PacketAvatarChangeCostumeRsp extends GenshinPacket {
super(PacketOpcodes.AvatarChangeCostumeRsp);
AvatarChangeCostumeRsp proto = AvatarChangeCostumeRsp.newBuilder()
.setRetcode(1)
.setRetcode(RetcodeOuterClass.Retcode.RET_SVR_ERROR_VALUE)
.build();
this.setData(proto);
......
......@@ -2,17 +2,17 @@ package emu.grasscutter.server.packet.send;
import java.util.Map.Entry;
import emu.grasscutter.game.GenshinPlayer;
import emu.grasscutter.game.TeamInfo;
import emu.grasscutter.game.avatar.GenshinAvatar;
import emu.grasscutter.net.packet.GenshinPacket;
import emu.grasscutter.game.avatar.Avatar;
import emu.grasscutter.game.player.Player;
import emu.grasscutter.game.player.TeamInfo;
import emu.grasscutter.net.packet.BasePacket;
import emu.grasscutter.net.packet.PacketOpcodes;
import emu.grasscutter.net.proto.AvatarDataNotifyOuterClass.AvatarDataNotify;
import emu.grasscutter.net.proto.AvatarTeamOuterClass.AvatarTeam;
public class PacketAvatarDataNotify extends GenshinPacket {
public class PacketAvatarDataNotify extends BasePacket {
public PacketAvatarDataNotify(GenshinPlayer player) {
public PacketAvatarDataNotify(Player player) {
super(PacketOpcodes.AvatarDataNotify, 2);
AvatarDataNotify.Builder proto = AvatarDataNotify.newBuilder()
......@@ -21,7 +21,7 @@ public class PacketAvatarDataNotify extends GenshinPacket {
.addAllOwnedFlycloakList(player.getFlyCloakList())
.addAllOwnedCostumeList(player.getCostumeList());
for (GenshinAvatar avatar : player.getAvatars()) {
for (Avatar avatar : player.getAvatars()) {
proto.addAvatarList(avatar.toProto());
}
......@@ -31,7 +31,7 @@ public class PacketAvatarDataNotify extends GenshinPacket {
.setTeamName(teamInfo.getName());
for (int i = 0; i < teamInfo.getAvatars().size(); i++) {
GenshinAvatar avatar = player.getAvatars().getAvatarById(teamInfo.getAvatars().get(i));
Avatar avatar = player.getAvatars().getAvatarById(teamInfo.getAvatars().get(i));
avatarTeam.addAvatarGuidList(avatar.getGuid());
}
......
package emu.grasscutter.server.packet.send;
import emu.grasscutter.net.packet.GenshinPacket;
import emu.grasscutter.net.packet.BasePacket;
import emu.grasscutter.net.packet.PacketOpcodes;
import emu.grasscutter.net.proto.AvatarDieAnimationEndRspOuterClass.AvatarDieAnimationEndRsp;
public class PacketAvatarDieAnimationEndRsp extends GenshinPacket {
public class PacketAvatarDieAnimationEndRsp extends BasePacket {
public PacketAvatarDieAnimationEndRsp(long dieGuid, int skillId) {
super(PacketOpcodes.AvatarDieAnimationEndRsp);
......
package emu.grasscutter.server.packet.send;
import emu.grasscutter.game.avatar.GenshinAvatar;
import emu.grasscutter.game.avatar.Avatar;
import emu.grasscutter.game.inventory.EquipType;
import emu.grasscutter.game.inventory.GenshinItem;
import emu.grasscutter.net.packet.GenshinPacket;
import emu.grasscutter.game.inventory.GameItem;
import emu.grasscutter.net.packet.BasePacket;
import emu.grasscutter.net.packet.PacketOpcodes;
import emu.grasscutter.net.proto.AvatarEquipChangeNotifyOuterClass.AvatarEquipChangeNotify;
public class PacketAvatarEquipChangeNotify extends GenshinPacket {
public class PacketAvatarEquipChangeNotify extends BasePacket {
public PacketAvatarEquipChangeNotify(GenshinAvatar avatar, GenshinItem item) {
public PacketAvatarEquipChangeNotify(Avatar avatar, GameItem item) {
super(PacketOpcodes.AvatarEquipChangeNotify);
AvatarEquipChangeNotify.Builder proto = AvatarEquipChangeNotify.newBuilder()
......@@ -27,7 +27,7 @@ public class PacketAvatarEquipChangeNotify extends GenshinPacket {
this.setData(proto);
}
public PacketAvatarEquipChangeNotify(GenshinAvatar avatar, EquipType slot) {
public PacketAvatarEquipChangeNotify(Avatar avatar, EquipType slot) {
super(PacketOpcodes.AvatarEquipChangeNotify);
AvatarEquipChangeNotify.Builder proto = AvatarEquipChangeNotify.newBuilder()
......
package emu.grasscutter.server.packet.send;
import emu.grasscutter.game.avatar.GenshinAvatar;
import emu.grasscutter.game.avatar.Avatar;
import emu.grasscutter.game.props.FetterState;
import emu.grasscutter.net.packet.GenshinPacket;
import emu.grasscutter.net.packet.BasePacket;
import emu.grasscutter.net.packet.PacketOpcodes;
import emu.grasscutter.net.proto.AvatarFetterDataNotifyOuterClass.AvatarFetterDataNotify;
import emu.grasscutter.net.proto.AvatarFetterInfoOuterClass.AvatarFetterInfo;
import emu.grasscutter.net.proto.FetterDataOuterClass.FetterData;
public class PacketAvatarFetterDataNotify extends GenshinPacket {
public class PacketAvatarFetterDataNotify extends BasePacket {
public PacketAvatarFetterDataNotify(GenshinAvatar avatar) {
public PacketAvatarFetterDataNotify(Avatar avatar) {
super(PacketOpcodes.AvatarFetterDataNotify);
int fetterLevel = avatar.getFetterLevel();
......
package emu.grasscutter.server.packet.send;
import emu.grasscutter.net.packet.GenshinPacket;
import emu.grasscutter.net.packet.BasePacket;
import emu.grasscutter.net.packet.PacketOpcodes;
import emu.grasscutter.net.proto.AvatarFetterLevelRewardRspOuterClass.AvatarFetterLevelRewardRsp;
public class PacketAvatarFetterLevelRewardRsp extends GenshinPacket {
public class PacketAvatarFetterLevelRewardRsp extends BasePacket {
public PacketAvatarFetterLevelRewardRsp(long guid, int fetterLevel, int rewardId) {
super(PacketOpcodes.AvatarFetterLevelRewardRsp);
......
package emu.grasscutter.server.packet.send;
import emu.grasscutter.game.avatar.GenshinAvatar;
import emu.grasscutter.net.packet.GenshinPacket;
import emu.grasscutter.game.avatar.Avatar;
import emu.grasscutter.net.packet.BasePacket;
import emu.grasscutter.net.packet.PacketOpcodes;
import emu.grasscutter.net.proto.AvatarFightPropNotifyOuterClass.AvatarFightPropNotify;
public class PacketAvatarFightPropNotify extends GenshinPacket {
public class PacketAvatarFightPropNotify extends BasePacket {
public PacketAvatarFightPropNotify(GenshinAvatar avatar) {
public PacketAvatarFightPropNotify(Avatar avatar) {
super(PacketOpcodes.AvatarFightPropNotify);
AvatarFightPropNotify proto = AvatarFightPropNotify.newBuilder()
......
package emu.grasscutter.server.packet.send;
import emu.grasscutter.game.avatar.GenshinAvatar;
import emu.grasscutter.game.avatar.Avatar;
import emu.grasscutter.game.props.FightProperty;
import emu.grasscutter.net.packet.GenshinPacket;
import emu.grasscutter.net.packet.BasePacket;
import emu.grasscutter.net.packet.PacketOpcodes;
import emu.grasscutter.net.proto.AvatarFightPropUpdateNotifyOuterClass.AvatarFightPropUpdateNotify;
public class PacketAvatarFightPropUpdateNotify extends GenshinPacket {
public class PacketAvatarFightPropUpdateNotify extends BasePacket {
public PacketAvatarFightPropUpdateNotify(GenshinAvatar avatar, FightProperty prop) {
public PacketAvatarFightPropUpdateNotify(Avatar avatar, FightProperty prop) {
super(PacketOpcodes.AvatarFightPropUpdateNotify);
AvatarFightPropUpdateNotify proto = AvatarFightPropUpdateNotify.newBuilder()
......
package emu.grasscutter.server.packet.send;
import emu.grasscutter.game.avatar.GenshinAvatar;
import emu.grasscutter.net.packet.GenshinPacket;
import emu.grasscutter.game.avatar.Avatar;
import emu.grasscutter.net.packet.BasePacket;
import emu.grasscutter.net.packet.PacketOpcodes;
import emu.grasscutter.net.proto.AvatarFlycloakChangeNotifyOuterClass.AvatarFlycloakChangeNotify;
public class PacketAvatarFlycloakChangeNotify extends GenshinPacket {
public class PacketAvatarFlycloakChangeNotify extends BasePacket {
public PacketAvatarFlycloakChangeNotify(GenshinAvatar avatar) {
public PacketAvatarFlycloakChangeNotify(Avatar avatar) {
super(PacketOpcodes.AvatarFlycloakChangeNotify);
AvatarFlycloakChangeNotify proto = AvatarFlycloakChangeNotify.newBuilder()
......
package emu.grasscutter.server.packet.send;
import emu.grasscutter.net.packet.GenshinPacket;
import emu.grasscutter.net.packet.BasePacket;
import emu.grasscutter.net.packet.PacketOpcodes;
import emu.grasscutter.net.proto.AvatarGainCostumeNotifyOuterClass.AvatarGainCostumeNotify;
public class PacketAvatarGainCostumeNotify extends GenshinPacket {
public class PacketAvatarGainCostumeNotify extends BasePacket {
public PacketAvatarGainCostumeNotify(int costumeId) {
super(PacketOpcodes.AvatarGainCostumeNotify);
......
package emu.grasscutter.server.packet.send;
import emu.grasscutter.net.packet.GenshinPacket;
import emu.grasscutter.net.packet.BasePacket;
import emu.grasscutter.net.packet.PacketOpcodes;
import emu.grasscutter.net.proto.AvatarGainFlycloakNotifyOuterClass.AvatarGainFlycloakNotify;
public class PacketAvatarGainFlycloakNotify extends GenshinPacket {
public class PacketAvatarGainFlycloakNotify extends BasePacket {
public PacketAvatarGainFlycloakNotify(int flycloak) {
super(PacketOpcodes.AvatarGainFlycloakNotify);
......
package emu.grasscutter.server.packet.send;
import emu.grasscutter.game.avatar.GenshinAvatar;
import emu.grasscutter.game.avatar.Avatar;
import emu.grasscutter.game.props.FightProperty;
import emu.grasscutter.game.props.LifeState;
import emu.grasscutter.net.packet.GenshinPacket;
import emu.grasscutter.net.packet.BasePacket;
import emu.grasscutter.net.packet.PacketOpcodes;
import emu.grasscutter.net.proto.AvatarLifeStateChangeNotifyOuterClass.AvatarLifeStateChangeNotify;
public class PacketAvatarLifeStateChangeNotify extends GenshinPacket {
public class PacketAvatarLifeStateChangeNotify extends BasePacket {
public PacketAvatarLifeStateChangeNotify(GenshinAvatar avatar) {
public PacketAvatarLifeStateChangeNotify(Avatar avatar) {
super(PacketOpcodes.AvatarLifeStateChangeNotify);
AvatarLifeStateChangeNotify proto = AvatarLifeStateChangeNotify.newBuilder()
......
package emu.grasscutter.server.packet.send;
import emu.grasscutter.game.avatar.GenshinAvatar;
import emu.grasscutter.net.packet.GenshinPacket;
import emu.grasscutter.game.avatar.Avatar;
import emu.grasscutter.net.packet.BasePacket;
import emu.grasscutter.net.packet.PacketOpcodes;
import emu.grasscutter.net.proto.AvatarPromoteRspOuterClass.AvatarPromoteRsp;
public class PacketAvatarPromoteRsp extends GenshinPacket {
public class PacketAvatarPromoteRsp extends BasePacket {
public PacketAvatarPromoteRsp(GenshinAvatar avatar) {
public PacketAvatarPromoteRsp(Avatar avatar) {
super(PacketOpcodes.AvatarPromoteRsp);
AvatarPromoteRsp proto = AvatarPromoteRsp.newBuilder()
......
package emu.grasscutter.server.packet.send;
import emu.grasscutter.game.avatar.GenshinAvatar;
import emu.grasscutter.game.avatar.Avatar;
import emu.grasscutter.game.props.PlayerProperty;
import emu.grasscutter.net.packet.GenshinPacket;
import emu.grasscutter.net.packet.BasePacket;
import emu.grasscutter.net.packet.PacketOpcodes;
import emu.grasscutter.net.proto.AvatarPropNotifyOuterClass.AvatarPropNotify;
public class PacketAvatarPropNotify extends GenshinPacket {
public PacketAvatarPropNotify(GenshinAvatar avatar) {
public class PacketAvatarPropNotify extends BasePacket {
public PacketAvatarPropNotify(Avatar avatar) {
super(PacketOpcodes.AvatarPropNotify);
AvatarPropNotify proto = AvatarPropNotify.newBuilder()
......@@ -22,7 +22,7 @@ public class PacketAvatarPropNotify extends GenshinPacket {
this.setData(proto);
}
public PacketAvatarPropNotify(GenshinAvatar avatar, PlayerProperty prop, int value) {
public PacketAvatarPropNotify(Avatar avatar, PlayerProperty prop, int value) {
super(PacketOpcodes.AvatarPropNotify);
AvatarPropNotify proto = AvatarPropNotify.newBuilder()
......
package emu.grasscutter.server.packet.send;
import emu.grasscutter.game.avatar.GenshinAvatar;
import emu.grasscutter.net.packet.GenshinPacket;
import emu.grasscutter.game.avatar.Avatar;
import emu.grasscutter.net.packet.BasePacket;
import emu.grasscutter.net.packet.PacketOpcodes;
import emu.grasscutter.net.proto.AvatarSkillChangeNotifyOuterClass.AvatarSkillChangeNotify;
public class PacketAvatarSkillChangeNotify extends GenshinPacket {
public class PacketAvatarSkillChangeNotify extends BasePacket {
public PacketAvatarSkillChangeNotify(GenshinAvatar avatar, int skillId, int oldLevel, int curLevel) {
public PacketAvatarSkillChangeNotify(Avatar avatar, int skillId, int oldLevel, int curLevel) {
super(PacketOpcodes.AvatarSkillChangeNotify);
AvatarSkillChangeNotify proto = AvatarSkillChangeNotify.newBuilder()
......
package emu.grasscutter.server.packet.send;
import emu.grasscutter.game.avatar.GenshinAvatar;
import emu.grasscutter.net.packet.GenshinPacket;
import emu.grasscutter.game.avatar.Avatar;
import emu.grasscutter.net.packet.BasePacket;
import emu.grasscutter.net.packet.PacketOpcodes;
import emu.grasscutter.net.proto.AvatarSkillUpgradeRspOuterClass.AvatarSkillUpgradeRsp;
public class PacketAvatarSkillUpgradeRsp extends GenshinPacket {
public class PacketAvatarSkillUpgradeRsp extends BasePacket {
public PacketAvatarSkillUpgradeRsp(GenshinAvatar avatar, int skillId, int oldLevel, int newLevel) {
public PacketAvatarSkillUpgradeRsp(Avatar avatar, int skillId, int oldLevel, int newLevel) {
super(PacketOpcodes.AvatarSkillUpgradeRsp);
AvatarSkillUpgradeRsp proto = AvatarSkillUpgradeRsp.newBuilder()
......
......@@ -2,17 +2,17 @@ package emu.grasscutter.server.packet.send;
import java.util.Map.Entry;
import emu.grasscutter.game.GenshinPlayer;
import emu.grasscutter.game.TeamInfo;
import emu.grasscutter.game.avatar.GenshinAvatar;
import emu.grasscutter.net.packet.GenshinPacket;
import emu.grasscutter.game.avatar.Avatar;
import emu.grasscutter.game.player.Player;
import emu.grasscutter.game.player.TeamInfo;
import emu.grasscutter.net.packet.BasePacket;
import emu.grasscutter.net.packet.PacketOpcodes;
import emu.grasscutter.net.proto.AvatarTeamOuterClass.AvatarTeam;
import emu.grasscutter.net.proto.AvatarTeamUpdateNotifyOuterClass.AvatarTeamUpdateNotify;
public class PacketAvatarTeamUpdateNotify extends GenshinPacket {
public class PacketAvatarTeamUpdateNotify extends BasePacket {
public PacketAvatarTeamUpdateNotify(GenshinPlayer player) {
public PacketAvatarTeamUpdateNotify(Player player) {
super(PacketOpcodes.AvatarTeamUpdateNotify);
AvatarTeamUpdateNotify.Builder proto = AvatarTeamUpdateNotify.newBuilder();
......@@ -23,7 +23,7 @@ public class PacketAvatarTeamUpdateNotify extends GenshinPacket {
.setTeamName(teamInfo.getName());
for (int i = 0; i < teamInfo.getAvatars().size(); i++) {
GenshinAvatar avatar = player.getAvatars().getAvatarById(teamInfo.getAvatars().get(i));
Avatar avatar = player.getAvatars().getAvatarById(teamInfo.getAvatars().get(i));
avatarTeam.addAvatarGuidList(avatar.getGuid());
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment