Class ReplicatedEntity<D extends ReplicatedData>

    • Constructor Detail

      • ReplicatedEntity

        public ReplicatedEntity()
    • Method Detail

      • emptyData

        public abstract D emptyData​(ReplicatedDataFactory factory)
        Implement by returning the initial empty replicated data object. This object will be passed into the command handlers.

        Also known as the "zero" or "neutral" state.

        The initial data cannot be null.

        Parameters:
        factory - the factory to create the initial empty replicated data object
      • commandContext

        protected CommandContext commandContext()
        Additional context and metadata for a command handler.

        It will throw an exception if accessed from the entity constructor.

      • _internalSetCommandContext

        public final void _internalSetCommandContext​(java.util.Optional<CommandContext> context)
        INTERNAL API