Grasscutter/src/main/java/emu/grasscutter/server/packet/send/PacketSceneEntityAppearNotify.java
Yazawazi f139818224 [Anime Game Version update] Support 2.7 (#1072)
* feature(2.7 version): support 2.7 version & upload new protos

1. Support GC in GI 2.7.0;
2. Upload new protos;
3. Fix some bugs cuz by new protos.

BREAKING CHANGE: all

* fix(database helper): fix player uid issues

* fix(ability embryo): uint32 to fixed32

* fix(proto): map mark

rename MAP_MARK_FROM_TYPE_NOE to MAP_MARK_FROM_TYPE_NONE

* fix(game version): change game version to 2.7.0

* perf(proto): remove unused protos

1. Remove unused protos;
2. Temporarily commented out some of the proto fields.

* fix(proto): uint32 to fixed32
2022-05-30 20:06:25 -07:00

50 lines
1.6 KiB
Java

package emu.grasscutter.server.packet.send;
import java.util.Collection;
import emu.grasscutter.game.entity.GameEntity;
import emu.grasscutter.game.player.Player;
import emu.grasscutter.net.packet.BasePacket;
import emu.grasscutter.net.packet.PacketOpcodes;
import emu.grasscutter.net.proto.SceneEntityAppearNotifyOuterClass.SceneEntityAppearNotify;
import emu.grasscutter.net.proto.VisionTypeOuterClass.VisionType;
public class PacketSceneEntityAppearNotify extends BasePacket {
public PacketSceneEntityAppearNotify(GameEntity entity) {
super(PacketOpcodes.SceneEntityAppearNotify, true);
SceneEntityAppearNotify.Builder proto = SceneEntityAppearNotify.newBuilder()
.setAppearType(VisionType.VISION_TYPE_BORN)
.addEntityList(entity.toProto());
this.setData(proto.build());
}
public PacketSceneEntityAppearNotify(GameEntity entity, VisionType vision, int param) {
super(PacketOpcodes.SceneEntityAppearNotify, true);
SceneEntityAppearNotify.Builder proto = SceneEntityAppearNotify.newBuilder()
.setAppearType(vision)
.setParam(param)
.addEntityList(entity.toProto());
this.setData(proto.build());
}
public PacketSceneEntityAppearNotify(Player player) {
this(player.getTeamManager().getCurrentAvatarEntity());
}
public PacketSceneEntityAppearNotify(Collection<GameEntity> entities, VisionType visionType) {
super(PacketOpcodes.SceneEntityAppearNotify, true);
SceneEntityAppearNotify.Builder proto = SceneEntityAppearNotify.newBuilder()
.setAppearType(visionType);
entities.forEach(e -> proto.addEntityList(e.toProto()));
this.setData(proto.build());
}
}