unicornbloods / Thaumic-Mixins

Thaumcraft 4 Mixins to fix some bugs and add missing configuration
MIT License
2 stars 3 forks source link

TC4-focused Admin Commands #5

Closed rndmorris closed 1 month ago

rndmorris commented 1 month ago

This adds a /tmixins command with several sub-commands, useful for dev testing or server administration.

Sub-commands

findResearch

Usage: /tmixins findResearch <search text...>

Argument Description
search text Only results containing this text will be returned. The text can contain spaces.

Filters through all research registered with Thaumcraft, returning any whose name or key contains the search text. For ease of searching, results are grouped by category.

forgetResearch

Usage: /tmixins forgetResearch <player> <research key | *> [refund sticky warp]

Argument Description
player The player whose completed research will be modified
research key The key of the root research to remove. Providing * instead will remove all of that player's research. Research registered as auto-unlocking is unaffected, though its children might be.
refund sticky warp If true, an amount of sticky warp equal to that given by completing any forgotten research will be removed.

Uncompletes some or all of the named player's completed research, allowing it to be completed again. If the research gave permanent warp, an equivalent amount is removed. If refund sticky warp is set, also removes an amount of sticky warp equal to that gained from the removed research.

forgetScanned

Usage: /tmixins forgetScanned <player> <objects | entities | nodes | *>

Argument Description
player The player whose completed scans will be modified
objects | entities | nodes Specifies the type of scan to reset. If * is provided, all will be reset.

Clears the appropriate list of scanned things for the player, allowing them to be scanned again. Due to technical limitations (the list of scanned things involves hashes), this is all-or-nothing.

listResearch

Usage: /tmixins listResearch <player> [search text...]

Argument Description
player The player whose completed research will be queried
search text Only completed research whose key contains this text will be returned. The text can contain spaces.

Returns the named player's list of completed research keys. Can optionally be filtered by search text.

Configuration

This creates a new "commands" section in the config file.

Enable Command (boolean)

Enables the /tmixins command. Default true.

Command Required Permission Level (integer)

Sets the level of permission required to use the command. Accepts [0, 4]. default: 2. Per Minecraft.wiki (may be inaccurate for 1.7.10?) Level Description
0 all
1 moderator
2 gamemaster
3 admin
4 owner

findResearch Enabled (boolean)

Enables the findResearch sub-command. Default true.

forgetResearch Enabled (boolean)

Enables the forgetResearch sub-command. Default true.

forgetScanned Enabled (boolean)

Enables the forgetScanned sub-command. Default true.

listResearch Enabled (boolean)

Enables the listResearch sub-command. Default true.