Skip to content

Commit

Permalink
更新:journeyUnlock 解锁旅途物品的卸载函数
Browse files Browse the repository at this point in the history
  • Loading branch information
THEXN committed Aug 3, 2024
1 parent a2eae9d commit 058a1e9
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 10 deletions.
3 changes: 2 additions & 1 deletion journeyUnlock/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
## 更新日志

```
暂无
v1.0.1.1
完善卸载函数
```

## 指令
Expand Down
22 changes: 13 additions & 9 deletions journeyUnlock/journeyUnlock.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using Terraria.Net;
using TerrariaApi.Server;
using TShockAPI;
using TShockAPI.Hooks;

namespace journeyUnlock
{
Expand All @@ -16,24 +17,27 @@ public class journeyUnlock : TerrariaPlugin

public override string Name => "journeyUnlock";

public override Version Version => new(1, 0, 1, 0);
public override Version Version => new(1, 0, 1, 1);

public journeyUnlock(Main game) : base(game)
{
}

public override void Initialize()
{
Commands.ChatCommands.Add(new Command(
permissions: new List<string> { "journeyunlock.unlock" },
cmd: this.unlockCommand,
"journeyunlock", "junlock", "i解锁")
Commands.ChatCommands.Add(new Command("journeyunlock.unlock" ,unlockCommand,"journeyunlock", "junlock", "i解锁")
{ AllowServer = false });

Commands.ChatCommands.Add(new Command(
permissions: new List<string> { "journeyunlock.unlockfor" },
cmd: this.unlockForCommand,
"unlockfor", "unlockf", "g解锁玩家"));
Commands.ChatCommands.Add(new Command("journeyunlock.unlockfor",unlockForCommand,"unlockfor", "unlockf", "g解锁玩家"));
}

protected override void Dispose(bool disposing)
{
if (disposing)
{
Commands.ChatCommands.RemoveAll(x => x.CommandDelegate == unlockCommand || x.CommandDelegate == unlockForCommand);
}
base.Dispose(disposing);
}

private void unlock(Player tplayer, TSPlayer sender, string parameter, bool isSelf)
Expand Down

0 comments on commit 058a1e9

Please sign in to comment.