Skip to content

Commit

Permalink
feat: new attack message field
Browse files Browse the repository at this point in the history
  • Loading branch information
ItsNature committed Aug 21, 2023
1 parent 154ae78 commit a74d509
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,12 @@
@Value
public class ApolloPlayerAttackEvent implements Event {

// TODO: docs
long instantiationTimeMs;

PlayerInfo playerInfo;

PlayerInfo attackerInfo;

double distance;
}
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,9 @@ private void onReceivePacket(ApolloReceivePacketEvent event) {
event.unpack(PlayerAttackMessage.class).ifPresent(packet -> {
ApolloPlayerAttackEvent playerAttackEvent = new ApolloPlayerAttackEvent(
NetworkTypes.fromProtobuf(packet.getPacketInfo().getInstantiationTime()),
NetworkTypes.fromProtobuf(packet.getPlayerInfo()),
NetworkTypes.fromProtobuf(packet.getAttackerInfo())
NetworkTypes.fromProtobuf(packet.getTargetInfo()),
NetworkTypes.fromProtobuf(packet.getAttackerInfo()),
packet.getDistance()
);

EventBus.EventResult<ApolloPlayerAttackEvent> result = EventBus.getBus().post(playerAttackEvent);
Expand Down

0 comments on commit a74d509

Please sign in to comment.