Class ReactionFactory

java.lang.Object
ovh.mythmc.social.api.reaction.ReactionFactory

public abstract class ReactionFactory extends Object
Abstract factory for handling and displaying Reaction instances.

A ReactionFactory is responsible for executing reactions for specific users, including both visual and interactive effects.

Subclasses must implement the actual behavior for displaying and playing reactions according to the platform or environment.

See Also:
  • Constructor Details

    • ReactionFactory

      public ReactionFactory()
  • Method Details

    • displayReaction

      protected abstract void displayReaction(@NotNull @NotNull SocialUser user, @NotNull @NotNull Reaction reaction)
      Displays a reaction to a specific user.

      This method is intended to handle the visual or UI aspects of a reaction, such as showing textures, particles, or other effects.

      Parameters:
      user - the user for whom the reaction is displayed
      reaction - the reaction to display
    • play

      public abstract void play(@NotNull @NotNull SocialUser user, @NotNull @NotNull Reaction reaction)
      Plays a reaction for a specific user.

      This method triggers the full reaction behavior, including visual, auditory, or interactive effects, and may call displayReaction(SocialUser, Reaction) internally.

      Parameters:
      user - the user who receives the reaction
      reaction - the reaction to play