FlockMembershipSystems

public class FlockMembershipSystems

Class FlockMembershipSystems. Provides flockmembershipsystems functionality for the Hytale server.

java.lang.Object > FlockMembershipSystems

Field Summary

flockComponent

final Flock flockComponent

Field flockComponent.

flockData

final PersistentFlockData flockData

Field flockData.

entityGroupComponent

final EntityGroup entityGroupComponent

Field entityGroupComponent.

npcComponent

final NPCEntity npcComponent

Field npcComponent.

roleName

final String roleName

Field roleName.

membership

final FlockMembership membership

Field membership.

uuidComponent

final UUIDComponent uuidComponent

Field uuidComponent.

store

final Store store

Field store.

transformComponent

final TransformComponent transformComponent

Field transformComponent.

flockMembershipComponent

final FlockMembership flockMembershipComponent

Field flockMembershipComponent.

flockId

final UUID flockId

Field flockId.

holder

final Holder holder

Field holder.

persistentFlockData

final PersistentFlockData persistentFlockData

Field persistentFlockData.

oldLeaderRef

final Ref oldLeaderRef

Field oldLeaderRef.

oldLeaderComponent

final FlockMembership oldLeaderComponent

Field oldLeaderComponent.

flockRef

final Ref flockRef

Field flockRef.

leader

final Ref leader

Field leader.

newLeader

final Ref newLeader

Field newLeader.

interimLeader

final Ref interimLeader

Field interimLeader.

interimLeaderMembership

final FlockMembership interimLeaderMembership

Field interimLeaderMembership.

role

final Role role

Field role.

flags

final EnumSet flags

Field flags.

isDead

final boolean isDead

Field isDead.

playerComponent

final Player playerComponent

Field playerComponent.

wasFirstJoiner

final boolean wasFirstJoiner

Field wasFirstJoiner.

flockReference

final Ref flockReference

Field flockReference.

oldLeader

final Ref oldLeader

Field oldLeader.

newLeaderNpcComponent

final NPCEntity newLeaderNpcComponent

Field newLeaderNpcComponent.

source

final Damage.Source source

Field source.

entitySource

final Damage.EntitySource entitySource

Field entitySource.

damageSourceRef

final Ref damageSourceRef

Field damageSourceRef.

entityRef

final Ref entityRef

Field entityRef.

Method Detail

canJoinFlock

static boolean canJoinFlock (@Nonnull final Ref reference, @Nonnull final Ref flockReference, @Nonnull final Store store)

Method canJoinFlock.

Parameters:
@Nonnull final Ref reference
@Nonnull final Ref flockReference
@Nonnull final Store store

join

static void join (@Nonnull final Ref ref, @Nonnull final Ref flockRef, @Nonnull final Store store)

Method join.

Parameters:
@Nonnull final Ref ref
@Nonnull final Ref flockRef
@Nonnull final Store store

canBecomeLeader

static boolean canBecomeLeader (@Nonnull final Ref ref)

Method canBecomeLeader.

Parameters:
@Nonnull final Ref ref

markChunkNeedsSaving

static void markChunkNeedsSaving (@Nonnull final Ref ref, @Nonnull final Store store)

Method markChunkNeedsSaving.

Parameters:
@Nonnull final Ref ref
@Nonnull final Store store

EntityRef

public public EntityRef (@Nonnull final ComponentType flockMembershipComponentType)

Method EntityRef.

Parameters:
@Nonnull final ComponentType flockMembershipComponentType

getQuery

public Query getQuery ()

Method getQuery.

onEntityAdded

public void onEntityAdded (@Nonnull final Ref ref, @Nonnull final AddReason reason, @Nonnull final Store store, @Nonnull final CommandBuffer commandBuffer)

Method onEntityAdded.

Parameters:
@Nonnull final Ref ref
@Nonnull final AddReason reason
@Nonnull final Store store
@Nonnull final CommandBuffer commandBuffer

joinOrCreateFlock

private void joinOrCreateFlock (@Nonnull final Ref ref, @Nonnull final Store store)

Method joinOrCreateFlock.

Parameters:
@Nonnull final Ref ref
@Nonnull final Store store

UUIDComponent

public new UUIDComponent (flockId)

Method UUIDComponent.

Parameters:
flockId flockId

IllegalStateException

public new IllegalStateException (String.format("Entity %s attempting to reload into group with ID %s despite already being a member", ref, flockId)

Method IllegalStateException.

Parameters:
String.format("Entity %s attempting to reload into group with ID %s despite already being a member"
ref ref
flockId flockId

if

public else if (entityGroup.getLeaderRef()

Method if.

Parameters:
entityGroup.getLeaderRef( entityGroup.getLeaderRef(

onEntityRemove

public void onEntityRemove (@Nonnull final Ref ref, @Nonnull final RemoveReason reason, @Nonnull final Store store, @Nonnull final CommandBuffer commandBuffer)

Method onEntityRemove.

Parameters:
@Nonnull final Ref ref
@Nonnull final RemoveReason reason
@Nonnull final Store store
@Nonnull final CommandBuffer commandBuffer

markNeedsSave

static void markNeedsSave (@Nonnull final Ref ref, @Nonnull final Store store, @Nonnull final Flock flockComponent)

Method markNeedsSave.

Parameters:
@Nonnull final Ref ref
@Nonnull final Store store
@Nonnull final Flock flockComponent

setInterimLeader

static void setInterimLeader (@Nonnull final Store store, @Nonnull final FlockMembership interimLeaderMembership, @Nonnull final EntityGroup entityGroup, final Ref interimLeader, @Nonnull final Flock flockComponent, @Nonnull final UUID flockId)

Method setInterimLeader.

Parameters:
@Nonnull final Store store
@Nonnull final FlockMembership interimLeaderMembership
@Nonnull final EntityGroup entityGroup
final Ref interimLeader
@Nonnull final Flock flockComponent
@Nonnull final UUID flockId

RefChange

public public RefChange (@Nonnull final ComponentType flockMembershipComponentType)

Method RefChange.

Parameters:
@Nonnull final ComponentType flockMembershipComponentType

componentType

public FlockMembership> componentType ()

Method componentType.

onComponentAdded

public void onComponentAdded (@Nonnull final Ref ref, @Nonnull final FlockMembership component, @Nonnull final Store store, @Nonnull final CommandBuffer commandBuffer)

Method onComponentAdded.

Parameters:
@Nonnull final Ref ref
@Nonnull final FlockMembership component
@Nonnull final Store store
@Nonnull final CommandBuffer commandBuffer

onComponentSet

public void onComponentSet (@Nonnull final Ref ref, final FlockMembership oldComponent, @Nonnull final FlockMembership newComponent, @Nonnull final Store store, @Nonnull final CommandBuffer commandBuffer)

Method onComponentSet.

Parameters:
@Nonnull final Ref ref
final FlockMembership oldComponent
@Nonnull final FlockMembership newComponent
@Nonnull final Store store
@Nonnull final CommandBuffer commandBuffer

onComponentRemoved

public void onComponentRemoved (@Nonnull final Ref ref, @Nonnull final FlockMembership component, @Nonnull final Store store, @Nonnull final CommandBuffer commandBuffer)

Method onComponentRemoved.

Parameters:
@Nonnull final Ref ref
@Nonnull final FlockMembership component
@Nonnull final Store store
@Nonnull final CommandBuffer commandBuffer

doJoin

private void doJoin (@Nonnull final Ref ref, @Nonnull final FlockMembership membershipComponent, @Nonnull final Store store, @Nonnull final CommandBuffer commandBuffer)

Method doJoin.

Parameters:
@Nonnull final Ref ref
@Nonnull final FlockMembership membershipComponent
@Nonnull final Store store
@Nonnull final CommandBuffer commandBuffer

doLeave

static void doLeave (@Nonnull final Ref ref, @Nonnull final FlockMembership membershipComponent, @Nonnull final Store store, @Nonnull final CommandBuffer commandBuffer)

Method doLeave.

Parameters:
@Nonnull final Ref ref
@Nonnull final FlockMembership membershipComponent
@Nonnull final Store store
@Nonnull final CommandBuffer commandBuffer

setNewLeader

static void setNewLeader (@Nonnull final UUID flockId, @Nonnull final EntityGroup entityGroup, @Nonnull final Flock flock, @Nonnull final Ref ref, @Nonnull final Store store, @Nonnull final CommandBuffer commandBuffer)

Method setNewLeader.

Parameters:
@Nonnull final UUID flockId
@Nonnull final EntityGroup entityGroup
@Nonnull final Flock flock
@Nonnull final Ref ref
@Nonnull final Store store
@Nonnull final CommandBuffer commandBuffer

OnDamageReceived

public public OnDamageReceived ()

Method OnDamageReceived.

getGroup

public SystemGroup getGroup ()

Method getGroup.

handle

public void handle (final int index, @Nonnull final ArchetypeChunk archetypeChunk, @Nonnull final Store store, @Nonnull final CommandBuffer commandBuffer, @Nonnull final Damage danage)

Method handle.

Parameters:
final int index
@Nonnull final ArchetypeChunk archetypeChunk
@Nonnull final Store store
@Nonnull final CommandBuffer commandBuffer
@Nonnull final Damage danage

NPCAddedFromWorldGen

public public NPCAddedFromWorldGen ()

Method NPCAddedFromWorldGen.

onEntityAdd

public void onEntityAdd (@Nonnull final Holder holder, @Nonnull final AddReason reason, @Nonnull final Store store)

Method onEntityAdd.

Parameters:
@Nonnull final Holder holder
@Nonnull final AddReason reason
@Nonnull final Store store

onEntityRemoved

public void onEntityRemoved (@Nonnull final Holder holder, @Nonnull final RemoveReason reason, @Nonnull final Store store)

Method onEntityRemoved.

Parameters:
@Nonnull final Holder holder
@Nonnull final RemoveReason reason
@Nonnull final Store store