RedditCraft | Reddit Forum With Minecraft Integrations [1.8.8 - 1.18.1] [Spigot & Paper] icon

RedditCraft | Reddit Forum With Minecraft Integrations [1.8.8 - 1.18.1] [Spigot & Paper] -----

Use a subreddit with Minecraft integrations as your server forums software.




[​IMG]
Use a subreddit with Minecraft integrations as your server forums software.

[​IMG] [​IMG]

Dependencies:
RedditAPI - required, Vault - required, PlaceholderAPI (optional)

What?

RedditCraft is a plugin that serves to integrate the presence of a player in-game to an authenticated reddit account on a subreddit of your choice.

[​IMG]




Why?
  • Subreddits provide rich and dynamic experiences, only enhanced by RedditCraft's Minecraft integrations.
  • Your data is in good hands - everyone's heard of reddit, as it's a highly established forums provider.
  • Since RedditCraft hooks directly into your server, we can provide an ever growing set of complex Minecraft integrations. Future plans for in-game features include IP banning, notifications, posting, and more.
  • Users familiar with reddit will instantly know how to use your forum - no re-learning software for no real reason.
  • Subreddits bring most of what popular Minecraft forums providers bring already, and RedditCraft resolves an essential element they were lacking: fluent Minecraft integration.
  • Subreddits are highly customisable, and with their recent design upgrades, they're at the forefront of web technology.
  • Freshness - make your server stand out with a unique, engaging forums experience!
Features
  • Simple Authentication: RedditCraft provides a simple way for players to authenticate their reddit account in-game.
  • Advanced Flair Management: RedditCraft can automatically generate custom flairs for players' reddit accounts, and set/remove them without a click.
  • Rich Admin Tools: RedditCraft provides a complete set of tools for admins to manage account authentication, flairs on accounts, and more.
  • PlaceholderAPI Placeholder Support: RedditCraft provides placeholders for players' reddit account names.
  • Automation: RedditCraft tries its best to automate as much as possible for you!

Important Note

Due to the 60 request per minute rate limit for the Reddit API, if your server expects to have more than 30 players authenticating their reddit account per minute, it's not recommended to use this plugin. Going beyond the rate limit will not block commands (this plugin runs commands on separate threads to not block the main thread), but they will become slow.


Dependencies (Requirements)
  • RedditAPI - Essential. Required for interfacing with reddit. You will need to download this plugin and configure it such that it loads without errors. NOTE: Ensure you create a *NEW* reddit account for the reddit bot to use (otherwise you will be spammed with verification messages).
  • A MySQL database - Essential. In its current state, the plugin only supports MySQL databases, and requires one to store its internal data. Note that in the future other database technologies will be supported.
  • Vault - Essential. Required for obtaining players' prefixes and permission data.
  • PlaceholderAPI - Optional (recommended). This plugin may be required for accessing the placeholders provided by RedditCraft, notably the placeholder for a player's authenticated reddit account username.
Usage

One must firstly setup a reddit bot for their subreddit, which requires setting up the RedditAPI plugin. The reddit bot must be created in on new reddit account, which will be the verification reddit account for the subreddit.
Do not load RedditCraft without having setup RedditAPI.

Once RedditAPI has been setup with a working bot, one must create a subreddit for their server, with the above reddit bot as a moderator, and the required user flair groups added.
Then, fill the config with the required information.

The plugin does not provide design graphics for your subreddit, i.e the background, banner, etc., so you must configure the design of your subreddit manually.

You must add flair groups to your subreddit and copy their IDs into your config correctly for the plugin to work. See the "Flair Management" section below.

Migration
If you're using the plugin on a server that already has a running forums system, it's recommended you migrate to the subreddit by running both RedditCraft and your old forums simultaneously. You should alert players on the old forums to migrate to the subreddit, by firstly authenticating their reddit account. Make sure you have setup flairs correctly in RedditCraft before beginning the migration procedure. Once sufficiently many users have migrated, you can void the old forums, but make sure to keep stored any important data from it. RedditCraft is not liable for any information loss due to the migration from other forums software.


Configuration (config.yml)

One can find the default config.yml file here.


Authentication

RedditCraft provides a simple way for players to authenticate their reddit account in-game. Once authenticated, their reddit username can be resolved in-game, and things like the prefix in-game can be synced to the subreddit automatically.

Authentication Procedure
Below is the procedure a player follows to authenticate their reddit account in-game:
  1. Execute the command /rc auth begin to begin authenticating. This may have to be confirmed with /rc auth confirm, for example if they're already authenticated or in the process of authenticating, it will confirm the override.

  2. The player is sent instructions on the message to send to the server's reddit bot. This includes the subject of the message, the body of the message, and the reddit account to send it to (which is the bot for the subreddit). The body of the message is their Minecraft username.

    [​IMG]

  3. The player has within a specified number of minutes to send the specified message to the server bot.

    [​IMG]

  4. If the bot receives the message within the specified number of minutes, and the message was completely correct, the player's reddit account authenticates successfully.

Flair Management

The second main feature of RedditCraft is its handling of reddit flairs. Only authenticated users can have a flair, and their flair is automatically applied to their reddit account after authenticating.

Flairs are only automatically updated (computed and applied), after authenticating. You will need to call /rc admin flair update <minecraft uuid> each time their rank in-game changes, to update re-compute and update their flair.

Below shows an example flair of the Minecraft player "omarathon" having authenticated to the reddit account "omar_test". Note the flair is from the prefixsync mode, i.e it syncs their prefix in-game:

[​IMG]

Flair Components
Flairs contain the following components:
  • <flair>: the user's resolved "flair", which may be resolved in one of three modes: prefixsync, singlegroups or multiplegroups. It serves as a way to show a player's rank in-game as an element of their flair on the subreddit.
  • <username>: the Minecraft username of the Minecraft account that has authenticated to this reddit account.
These components may be combined in a specified manner to produce the resulting flair. For example "<flair> | <username>" might show "OWNER | omarathon" if the player omarathon is the OWNER.

Flair States
Flairs may be in one of three states:
  • on: both the <flair> and <username> components will be visible in their flair. The user flair group their flairs correspond to are decided by the flair mode (more information below).
  • off: only the <username> component will be visible in their flair. The user flair group their flairs correspond to are specified in the config. One additionally must specify the formatting, i.e "[<username>]" will show "[omarathon]" for the Minecraft player "omarathon".
  • removed: they will have no flair on the subreddit, i.e neither the <flair> nor the <username> components will be visible in their flair.
After a player has authenticated their reddit account, their flair is automatically set to either the on or off state, specified in the config. Players may change their flair state in the database by /rc flair on/off/remove, and then they may update it (sync on the subreddit) by /rc flair update. If they changed it to the removed state, they don't need to update - it happens automatically. The "update" requirement was chosen so a user can call update without changing the state, just to process the state. Also, admins can call update on users to recompute their on/off flair, without having to check what their status was beforehand.

Flair Modes
As above, the <flair> component of flairs can be resolved via three modes. Flair modes also decide the user flair group for their reddit user to be in (these are specified in the user flairs section of the subreddit modtools, and allow one to specify the colours for the flairs, or even css classes for them). Below each are explained:
  • prefixsync: the simplest flair mode. Simply obtains the prefix for the player in-game, via the Vault API.
    Users will all belong to the same user flair group, specified in the config as the "custom" user flair group. Therefore, flairs may only be of a single colour. Prefix colours are NOT synced.
  • singlegroups: a flair mode where Minecraft players may belong to a single specified group, if they have access to the group's permission node. The mappings between the groups and their required permission nodes are to be specified in the config.
    Each group has its own corresponding user flair group, therefore each group may be a different colour. The flair mode will pick the group of the highest precedence, and the order of precedence for the groups is also defined in the config.
    This flair mode is recommended for servers where players have prefixes with single components, i.e they have single ranks. If so, each rank could have its own group, and user flair groups could be defined for each group, such that it has the colour of the corresponding rank prefix (as an example).
  • multiplegroups: the most complex flair mode, recommended for servers where players have prefixes composed of multiple ranks. As in the singlegroups mode, one defines groups predicated upon having access to a given permission node. However, these groups may be part of "flair groups", akin to tracks in LuckPerms. The mode will obtain a concatenation of the highest group of the user in all of the flair groups, where the delimiter is specified in the config. The order of precedence for the flair groups, as well as their contained flairs, are defined in the config.
    For example, you may have the following flair groups: staff, donors and standard. Then, within the staff flair group the highest flair is OWNER, which requires the group.owner permission. Then the second highest is ADMIN, which requires the group.admin permission, and so on. If a player has the "HELPER" staff flair, "GOD" donator rank and "MEMBER" standard rank, then with the " | " delimiter this flair mode may obtain: "HELPER | GOD | MEMBER".
    All flairs obtained from this flair mode belong to the custom user flair group, defined in the config. Therefore, flairs may only be of a single colour.
As a guide, if your server has prefixes and you'd just like user's prefixes to be synced as flairs on the subreddit, then use the prefixsync mode. However, if your server has simple prefixes containing single ranks, you may want to use the singlegroups mode as this allows colouring of individual groups. If you'd like full customisability of flair groups based upon permission nodes, where players may belong to multiple groups and have a concatenation of groups, then use the multiplegroups mode. However, since LuckPerms tracks achieves a similar result, you may still want to use prefixsync instead of this mode if your server uses LuckPerms. But if you'd like flairs to be completely different to prefixes, and the prefixes themselves rely on tracks, then use this mode.

Note that the singlegroups mode is the only mode which provides dynamic flair colouring (it's not possible with the others due to their composed nature).


Placeholders (PAPI)

If you have PlaceholderAPI installed, RedditCraft provides the %redditcraft_authenticatedredditusername% placeholder, which shows the authenticated reddit username associated with a Minecraft player.
If it doesn't exist, or an error occurs while obtaining it, it will show different messages as configurable in the config.

WARNING: Since the plugin doesn't have caching optimisations at present, quickly updating placeholders will cause lots of database queries. If you're using the placeholder, make sure it's set to a reasonable update duration such as every 2 seconds or so. If this placeholder is being obtained for many players, monitor the performance of your server and do not use it if it causes lag.



Commands and Permissions

Important Note
In order to have access to any redditcraft commands, a player must have the redditcraft permission (if they have redditcraft.* but not redditcraft, no commands will work!).

Permission Wildcards
Note that permission wildcards also work, such that if one has the permission node redditcraft.authentication.* then they will have access to all subcommands of redditcraft.authentication.

Selectors
Selectors are menu commands. Each selector has associated with it a "help" or "?" subcommand, which will show the help message. If the selector has permission x then the player must have the permission x.help to view this help message, and it's also shown when calling the command associated with the selector (one does not need to call the "help" or "?" subcommand).

Handlers
Handlers are "executors", i.e endpoints where something will happen.

Recommended Normal Player Permissions
  • redditcraft
  • redditcraft.help (if you want to show them the help menu when calling /redditcraft or /rc)
  • redditcraft.authentication.*
  • redditcraft.flair.*
If you wish to not allow players to customise the flairs manually, or restrict options like the /rc flair remove command, then do give individual permission nodes instead! You should not give non-staff players access to any of the redditcraft.admin commands (if you do, be sure you know it won't be exploitable!)

Recommended Staff Player Permissions
If the staff member is of "operator" status, i.e an admin, where they're trusted with all commands, give them the redditcraft and redditcraft.* permission nodes. If you'd like to only give your staff members individual admin commands, assign them via redditcraft.admin.X but make sure to give them access to the help menus and selectors leading to it .

The Commands and Permissions!
A detailed list of each command, what it does, and its permission nodes are listed below.

Code (Text):
reddit
type: handler
description: sends the caller a link to the server's subreddit
node: reddit
aliases: redditlink

redditcraft
type: selector
description: main command
node: redditcraft
aliases: rc

    authentication
    type: selector
    description: player authentication commands
    node: redditcraft.authentication
    aliases: auth

        begin <reddit username>
        type: handler
        description: begin authenticating the given reddit account to the caller's Minecraft account
        node: redditcraft.authentication.begin
        aliases:

        status
        type: handler
        description: see the authentication status for the reddit account associated with the caller's Minecraft account
        node: redditcraft.authentication.status
        aliases:

        confirm
        type: handler
        description: confirm an authentication procedure request (users will be prompted to use this if required)
        node: redditcraft.authentication.confirm
        aliases:

    flair
    type: selector
    description: player flair management commands. NOTE that these commands only work if the sender's Minecraft account has an authenticated reddit account
    node: redditcraft.flair
    aliases: prefix

        on
        type: handler
        description: changes caller's authenticated reddit account's flair status to on. after updating, their reddit account flair will contain both the flair and username components
        node: redditcraft.flair.on
        aliases: true

        off
        type: handler
        description: changes caller's authenticated reddit account's flair status to off. after updating, their reddit account flair will contain only the username component
        node: redditcraft.flair.off
        aliases: false

        remove
        type: handler
        description: removes the flair from the caller's authenticated reddit account entirely from the subreddit. the caller does not need to update for this to be applied, and they will not have a flair as a result
        node: redditcraft.flair.remove
        aliases: null

        status
        type: handler
        description: obtains caller's flair status of their authenticated reddit account from the database. note this may differ from their flair on the subreddit, since their flair status may have been changed in the database via the ``on``/``off`` commands, and not updated yet from calling ``update``
        node: redditcraft.flair.status
        aliases:

        update
        type: handler
        description: updates caller's authenticated reddit account's flair on the subreddit in accordance to their local flair status in the database (as obtainable via ``status``)
        node: redditcraft.flair.update
        aliases: show

    admin
    type: selector
    description: server administration commands (recommended for admins/ops)
    node: redditcraft.admin
    aliases:

        authentication
        type: selector
        description: admin authentication management commands
        node: redditcraft.admin.authentication
        aliases: auth

            verification
            type: selector
            description: admin verification management commands (the verifier is the process that checks the inbox of the redditcraft bot for authentication messages and processes them)
            node: redditcraft.admin.authentication.verification
            aliases: verifier, verify

                run [silent/quiet]
                type: handler
                description: force-run the verifier process. if silent/quiet optional parameter is provided, results will not be sent to caller (in-case of spam with lots of verifications)
                node: redditcraft.admin.authentication.verification.run
                aliases:

            garbagecollector
            type: selector
            description: admin database garbage collection management commands (the garbage collector is the procedure on the database where expired authentication tokens are removed)
            node: redditcraft.admin.authentication.garbagecollector
            aliases: garbage

                run
                type: handler
                description: force-run the garbage collection process on the database
                node: redditcraft.admin.authentication.garbagecollector.run
                aliases: collect

            force <minecraft uuid> <reddit username>
            type: handler
            description: force-authenticate the given reddit account to the Minecraft account with the given uuid (if they have authenticated a reddit account already it will be invalidated, if someone else has authenticated to the given reddit account it won't work as it violates principle)
            node: redditcraft.admin.authentication.force
            aliases:
 
            status <minecraft uuid>
            type: handler
            description: obtain the authentication status for the Minecraft account with the given uuid
            node: redditcraft.admin.authentication.status
            aliases:

 
            void <minecraft uuid>
            type: handler
            description: void (unauthenticate if authenticated, cancel authentication attempt if in progress) the Minecraft player's authentication status with the given uuid
            node: redditcraft.admin.authentication.void
            aliases:

            invalidatetokens
            type: handler
            description: invalidate all in-progress authentication tokens/attempts
            node: redditcraft.admin.authentication.invalidatetokens
            aliases: canceltokens, it, ct

            resolve <reddit/minecraft> <reddit username/minecraft uuid> [all/*]
            type: handler
            description: resolve the Minecraft account authenticated with the given reddit username, or the reddit account authenticated with the given Minecraft uuid. all/* additional parameter resolves all ASSOCIATED accounts, not just authenticated ones (i.e also in-progress, failed, etc)
            node: redditcraft.admin.authentication.resolve
            aliases: whois, get

        flair
        type: selector
        description: admin flair management commands. NOTE that if the "quiet" optional parameter is available for the command then the results will not be sent to the sender (to prevent potential spam), and if "all"/"*" is available instead of the uuid then the command will apply to all authenticated uuids in the database (dangerous!)
        node: redditcraft.admin.flair
        aliases: prefix

            on <minecraft uuid/all/*> [quiet]
            type: handler
            description: attempt to turn on the flair (locally, in the database) for the reddit account authenticated with Minecraft account of the given uuid (will need to call ``update`` for it to update)
            node: redditcraft.admin.flair.on
            aliases:

            off <minecraft uuid/all/*> [quiet]
            type: handler
            description: attempt to turn off the flair (locally, in the database) for the reddit account authenticated with Minecraft account of the given uuid (will need to call ``update`` for it to update)
            node: redditcraft.admin.flair.off
            aliases:

            remove <minecraft uuid/all/*> [quiet]
            type: handler
            description: attempt to remove the flair from the reddit account authenticated with Minecraft account of the given uuid (do NOT need to call ``update`` for it to update - it will occur automatically)
            node: redditcraft.admin.flair.remove
            aliases:

            update <minecraft uuid/all/*> [quiet]
            type: handler
            description: attempt to update the flair (change their flair on the subreddit in accordance to their local flair status in the database) for the reddit account authenticated with Minecraft account of the given uuid
            node: redditcraft.admin.flair.update
            aliases:

            status <minecraft uuid>
            type: handler
            description: attempt to obtain the flair status (locally, in the database) for the reddit account authenticated with Minecraft account of the given uuid
            node: redditcraft.admin.flair.status
            aliases:

        reload
        type: handler
        description: attempt to reload RedditCraft
        node: redditcraft.admin.reload
        aliases:
 
        reset
        type: handler
        description: reset the database data (all authenticated accounts will become unauthenticated and all in-progress authentication tokens will expire) and reload the plugin (dangerous!) - IMPORTANT NOTE: one is recommended to call "/rc admin flair remove all" before calling this to remove all the flairs from the subreddit
        node: redditcraft.admin.reset
        aliases:

Future Developments

Since RedditCraft is a new plugin, there is a long list of possible future developments. Until it's made stable on its current version(s), large new features will not be added. Below is a list of potential focuses:
  • Support for more database systems
  • Banning reddit accounts from the subreddit in-game. IP bans, too
  • Bungeecord, Sponge
  • Caching / additional optimisation

Source Code, Bugs, and Contributions

The source code is freely available on this plugin's GitHub repository. If you find any bugs, please report them by raising an issue in the repository, or via Discord (before writing a nasty review).
If you wish to contribute, I'd kindly ask you to make a pull request in the repository. Contributions are massively appreciated, for I (omarathon) am the sole developer of this plugin.


Donations

If you wish to donate to the author of this plugin, please find the donation link in the plugin description. They're highly appreciated, and encourage future development of the plugin, but are in no way necessary.
Resource Information
Author:
----------
Total Downloads: 1,783
First Release: Sep 27, 2019
Last Update: Jun 5, 2022
Category: ---------------
All-Time Rating:
1 ratings
Find more info at youtu.be...
Version -----
Released: --------------------
Downloads: ------
Version Rating:
----------------------
-- ratings