Interface DeleteModule

All Superinterfaces:
ModuleLocalization, ModuleSimple

public interface DeleteModule extends ModuleLocalization
Lets a moderator withdraw a message that was already delivered, and keeps the history needed to do so.
  • Method Details

    • config

      Description copied from interface: ModuleSimple
      The config section this module reads its settings from.
      Specified by:
      config in interface ModuleSimple
      Returns:
      the settings
    • permission

      Description copied from interface: ModuleSimple
      The permission that gates this module.
      Specified by:
      permission in interface ModuleSimple
      Returns:
      the permission
    • localization

      Description copied from interface: ModuleLocalization
      The localization section for a player, picked from their chosen language.
      Specified by:
      localization in interface ModuleLocalization
      Parameters:
      fPlayer - the player the text is for
      Returns:
      the localization settings
    • clearHistory

      void clearHistory(FPlayer fPlayer)
      Forgets every message held for a player, so none of them can be withdrawn any more.
      Parameters:
      fPlayer - the player
    • addTag

      MessageContext addTag(MessageContext messageContext)
      Registers the tag that draws the withdraw button.
      Parameters:
      messageContext - the message being formatted
      Returns:
      the context with the tag added
    • save

      void save(FPlayer receiver, UUID messageUUID, net.kyori.adventure.text.Component component, boolean needToCache)
      Remembers a delivered message so it can be withdrawn later.
      Parameters:
      receiver - who received it
      messageUUID - the message id
      component - the rendered message
      needToCache - whether to keep the rendered form, which is only needed on some platforms
    • isCached

      boolean isCached(net.kyori.adventure.text.Component component)
      Whether a rendered message is one this module is holding.
      Parameters:
      component - the rendered message
      Returns:
      true if it is held
    • removeCache

      void removeCache(net.kyori.adventure.text.Component component)
      Forgets a held message.
      Parameters:
      component - the rendered message
    • remove

      boolean remove(FEntity sender, UUID messageUUID)
      Withdraws a message from everyone who received it.
      Parameters:
      sender - who wrote it
      messageUUID - the message id
      Returns:
      true if anything was withdrawn
    • sendUpdate

      void sendUpdate(UUID receiver)
      Redraws a reader's chat after something was withdrawn.
      Parameters:
      receiver - the reader