fix: sync team avatar changes (#2320)

This commit is contained in:
hamusuke 2023-08-30 01:20:17 +09:00 committed by GitHub
parent b72f81e720
commit 667008ecf1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,27 +1,42 @@
package emu.grasscutter.game.player; package emu.grasscutter.game.player;
import dev.morphia.annotations.*; import dev.morphia.annotations.Entity;
import emu.grasscutter.*; import dev.morphia.annotations.Transient;
import emu.grasscutter.GameConstants;
import emu.grasscutter.Grasscutter;
import emu.grasscutter.data.GameData; import emu.grasscutter.data.GameData;
import emu.grasscutter.data.excels.avatar.AvatarSkillDepotData; import emu.grasscutter.data.excels.avatar.AvatarSkillDepotData;
import emu.grasscutter.game.avatar.Avatar; import emu.grasscutter.game.avatar.Avatar;
import emu.grasscutter.game.entity.*; import emu.grasscutter.game.entity.EntityAvatar;
import emu.grasscutter.game.props.*; import emu.grasscutter.game.entity.EntityBaseGadget;
import emu.grasscutter.game.world.*; import emu.grasscutter.game.entity.EntityTeam;
import emu.grasscutter.net.packet.*; import emu.grasscutter.game.props.ElementType;
import emu.grasscutter.net.proto.*; import emu.grasscutter.game.props.EnterReason;
import emu.grasscutter.game.props.FightProperty;
import emu.grasscutter.game.world.Position;
import emu.grasscutter.game.world.Scene;
import emu.grasscutter.game.world.World;
import emu.grasscutter.net.packet.BasePacket;
import emu.grasscutter.net.packet.PacketOpcodes;
import emu.grasscutter.net.proto.AbilityControlBlockOuterClass;
import emu.grasscutter.net.proto.AbilityEmbryoOuterClass;
import emu.grasscutter.net.proto.EnterTypeOuterClass.EnterType; import emu.grasscutter.net.proto.EnterTypeOuterClass.EnterType;
import emu.grasscutter.net.proto.MotionStateOuterClass.MotionState; import emu.grasscutter.net.proto.MotionStateOuterClass.MotionState;
import emu.grasscutter.net.proto.PlayerDieTypeOuterClass.PlayerDieType; import emu.grasscutter.net.proto.PlayerDieTypeOuterClass.PlayerDieType;
import emu.grasscutter.net.proto.RetcodeOuterClass.Retcode; import emu.grasscutter.net.proto.RetcodeOuterClass.Retcode;
import emu.grasscutter.net.proto.TrialAvatarGrantRecordOuterClass.TrialAvatarGrantRecord.GrantReason; import emu.grasscutter.net.proto.TrialAvatarGrantRecordOuterClass.TrialAvatarGrantRecord.GrantReason;
import emu.grasscutter.net.proto.VisionTypeOuterClass;
import emu.grasscutter.server.event.entity.EntityCreationEvent; import emu.grasscutter.server.event.entity.EntityCreationEvent;
import emu.grasscutter.server.event.player.PlayerTeamDeathEvent; import emu.grasscutter.server.event.player.PlayerTeamDeathEvent;
import emu.grasscutter.server.packet.send.*; import emu.grasscutter.server.packet.send.*;
import emu.grasscutter.utils.Utils; import emu.grasscutter.utils.Utils;
import it.unimi.dsi.fastutil.ints.*; import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap;
import it.unimi.dsi.fastutil.ints.IntOpenHashSet;
import it.unimi.dsi.fastutil.ints.IntSet;
import it.unimi.dsi.fastutil.objects.Object2IntOpenHashMap; import it.unimi.dsi.fastutil.objects.Object2IntOpenHashMap;
import lombok.*; import lombok.Getter;
import lombok.Setter;
import lombok.val;
import java.util.*; import java.util.*;
import java.util.stream.Stream; import java.util.stream.Stream;
@ -352,8 +367,8 @@ public final class TeamManager extends BasePlayerDataManager {
/** Updates all properties of the active team. */ /** Updates all properties of the active team. */
public void updateTeamProperties() { public void updateTeamProperties() {
this.updateTeamResonances(); // Update team resonances. this.updateTeamResonances(); // Update team resonances.
this.getPlayer() this.getWorld()
.sendPacket(new PacketSceneTeamUpdateNotify(this.getPlayer())); // Notify the player. .broadcastPacket(new PacketSceneTeamUpdateNotify(this.getPlayer())); // Notify the all players in the world.
// Skill charges packet - Yes, this is official server behavior as of 2.6.0 // Skill charges packet - Yes, this is official server behavior as of 2.6.0
this.getActiveTeam().stream() this.getActiveTeam().stream()