Skip to content

Commit

Permalink
feat: broadcast health changed events (was owner events)
Browse files Browse the repository at this point in the history
  • Loading branch information
skaldarnar committed Jun 24, 2021
1 parent f246296 commit 8c234fd
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
import com.google.common.base.Preconditions;
import org.terasology.engine.entitySystem.entity.EntityRef;
import org.terasology.engine.entitySystem.prefab.Prefab;
import org.terasology.engine.network.OwnerEvent;
import org.terasology.engine.network.BroadcastEvent;

/**
* This event is sent after damage has been dealt to an entity.
*/
@OwnerEvent
@BroadcastEvent
public class OnDamagedEvent extends OnHealthChangedEvent {
private final Prefab damageType;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@

import org.terasology.engine.entitySystem.entity.EntityRef;
import org.terasology.engine.entitySystem.event.Event;
import org.terasology.engine.network.BroadcastEvent;

/**
* This event (or a subtype) is sent whenever health changes
*
*/
@BroadcastEvent
public class OnHealthChangedEvent implements Event {
protected EntityRef instigator;
protected int change;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@

import com.google.common.base.Preconditions;
import org.terasology.engine.entitySystem.entity.EntityRef;
import org.terasology.engine.network.OwnerEvent;
import org.terasology.engine.network.BroadcastEvent;

/**
* A <i>notification event</i> to inform that an entity was restored. This is the final event of the {@link
* org.terasology.module.health.systems.RestorationAuthoritySystem Restoration Event Flow}.
*/
@OwnerEvent
@BroadcastEvent
public class OnRestoredEvent extends OnHealthChangedEvent {
/**
* INTERNAL: Only required for internal replication of network events
Expand Down

0 comments on commit 8c234fd

Please sign in to comment.