Grasscutter/src/main/java/emu/grasscutter/server/packet/send/PacketSceneEntityAppearNotify.java
WetABQ addfb5eb5d [BREAKING CHANGE] proto auto compiled by gradle (#226)
* [BREAK] proto auto compiled by gradle

* [BREAK] move proto to submodule

* update gitmodules

* [BREAK] move proto to submodule

* move proto to submodule

* fix merge conflict

* fix github action after merging

* fix merge conflicts and del submodule

* upload the proto
2022-04-26 14:44:30 -07:00

50 lines
1.6 KiB
Java

package emu.grasscutter.server.packet.send;
import java.util.Collection;
import emu.grasscutter.game.GenshinPlayer;
import emu.grasscutter.game.entity.GenshinEntity;
import emu.grasscutter.net.packet.GenshinPacket;
import emu.grasscutter.net.packet.PacketOpcodes;
import emu.grasscutter.net.proto.SceneEntityAppearNotifyOuterClass.SceneEntityAppearNotify;
import emu.grasscutter.net.proto.VisionTypeOuterClass.VisionType;
public class PacketSceneEntityAppearNotify extends GenshinPacket {
public PacketSceneEntityAppearNotify(GenshinEntity entity) {
super(PacketOpcodes.SceneEntityAppearNotify, true);
SceneEntityAppearNotify.Builder proto = SceneEntityAppearNotify.newBuilder()
.setAppearType(VisionType.VISION_BORN)
.addEntityList(entity.toProto());
this.setData(proto.build());
}
public PacketSceneEntityAppearNotify(GenshinEntity 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(GenshinPlayer player) {
this(player.getTeamManager().getCurrentAvatarEntity());
}
public PacketSceneEntityAppearNotify(Collection<GenshinEntity> 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());
}
}