-
-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(redirect_qb_to_pb): ✨ add plugin redirect_qb_to_pb
- Loading branch information
1 parent
7804bca
commit a5e7e7a
Showing
6 changed files
with
48 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"id": "redirect_qb_to_pb", | ||
"version": "1.0.0", | ||
"name": "Redirect qb to pb", | ||
"description": { | ||
"en_us": "Redirect !!qb to !!pb", | ||
"zh_cn": "将 !!qb 重定向到 !!pb" | ||
}, | ||
"author": "Andy Zhang", | ||
"link": "https://github.com/AnzhiZhang/MCDReforgedPlugins/tree/master/src/redirect_qb_to_pb" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Redirect pb to qb | ||
|
||
> [QuickBackupM](https://github.com/TISUnion/QuickBackupM) is a classic saves backup plugin. Recently, [PrimeBackup](https://github.com/TISUnion/PrimeBackup) has become its alternative. Due to historical reasons, many servers still have the historical habit of using `!!pb`. Since PrimeBackup does not support the multi-command prefix function, this plugin was made to solve this problem. | ||
You can now use `!!qb` equivalent to `!!pb`. | ||
|
||
> [!WARNING] | ||
> There may be incompatibilities with the QuickBackupM plugin. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Redirect pb to qb | ||
|
||
> [QuickBackupM](https://github.com/TISUnion/QuickBackupM) 是经典的存档备份插件,近日,[PrimeBackup](https://github.com/TISUnion/PrimeBackup) 成为了它的替代品,由于历史原因,许多服务器仍然有使用 `!!pb` 的历史习惯。由于 PrimeBackup 无法支持多指令前缀的功能,由此诞生此插件。 | ||
您现在可以使用 `!!qb` 等效 `!!pb`。 | ||
|
||
> [!WARNING] | ||
> 可能会有与 QuickBackupM 插件不兼容的情况。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
from mcdreforged.api.command import * | ||
from mcdreforged.api.types import PluginServerInterface | ||
|
||
|
||
def on_load(server: PluginServerInterface, prev_module): | ||
server.register_command( | ||
Literal('!!qb') | ||
.runs(handler) | ||
.then( | ||
GreedyText('content') | ||
.runs(handler) | ||
) | ||
) | ||
|
||
|
||
def handler(src, ctx): | ||
src.get_server().execute_command(f'!!pb {ctx.get("content", "")}', src) |