mirror of
https://github.com/Grasscutters/Grasscutter.git
synced 2026-06-13 12:23:42 +08:00
Add drowning. Better movement ticking.
This commit is contained in:
committed by
Melledy
Unverified
parent
81998b9cf9
commit
93b3265d72
+27
-1
@@ -9,6 +9,10 @@ import emu.grasscutter.net.packet.BasePacket;
|
||||
import emu.grasscutter.net.packet.PacketOpcodes;
|
||||
import emu.grasscutter.net.proto.AvatarLifeStateChangeNotifyOuterClass.AvatarLifeStateChangeNotify;
|
||||
import emu.grasscutter.net.proto.PlayerDieTypeOuterClass.PlayerDieType;
|
||||
import emu.grasscutter.net.proto.ServerBuffOuterClass;
|
||||
import emu.grasscutter.net.proto.ServerBuffOuterClass.ServerBuff;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class PacketAvatarLifeStateChangeNotify extends BasePacket {
|
||||
|
||||
@@ -22,7 +26,7 @@ public class PacketAvatarLifeStateChangeNotify extends BasePacket {
|
||||
|
||||
this.setData(proto);
|
||||
}
|
||||
public PacketAvatarLifeStateChangeNotify(Avatar avatar,int attackerId,LifeState lifeState) {
|
||||
public PacketAvatarLifeStateChangeNotify(Avatar avatar, int attackerId, LifeState lifeState) {
|
||||
super(PacketOpcodes.AvatarLifeStateChangeNotify);
|
||||
|
||||
AvatarLifeStateChangeNotify proto = AvatarLifeStateChangeNotify.newBuilder()
|
||||
@@ -33,4 +37,26 @@ public class PacketAvatarLifeStateChangeNotify extends BasePacket {
|
||||
|
||||
this.setData(proto);
|
||||
}
|
||||
|
||||
public PacketAvatarLifeStateChangeNotify(Avatar avatar, LifeState lifeState, PlayerDieType dieType) {
|
||||
this(avatar, lifeState, null, "", dieType);
|
||||
}
|
||||
|
||||
public PacketAvatarLifeStateChangeNotify(Avatar avatar, LifeState lifeState, GameEntity sourceEntity,
|
||||
String attackTag, PlayerDieType dieType) {
|
||||
super(PacketOpcodes.AvatarLifeStateChangeNotify);
|
||||
|
||||
AvatarLifeStateChangeNotify.Builder proto = AvatarLifeStateChangeNotify.newBuilder();
|
||||
|
||||
proto.setAvatarGuid(avatar.getGuid());
|
||||
proto.setLifeState(lifeState.getValue());
|
||||
if (sourceEntity != null) {
|
||||
proto.setSourceEntityId(sourceEntity.getId());
|
||||
}
|
||||
proto.setDieType(dieType);
|
||||
proto.setAttackTag((attackTag));
|
||||
|
||||
this.setData(proto.build());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user