Skip to content

Commit cb1d64e

Browse files
committed
fixed jail command conflict
1 parent 2ef1481 commit cb1d64e

3 files changed

Lines changed: 8 additions & 1 deletion

File tree

AdminTools/Commands/Jail.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ namespace AdminTools.Commands
1414
[CommandHandler(typeof(GameConsoleCommandHandler))]
1515
public class Jail : ICommand, IUsageProvider
1616
{
17-
public string Command { get; } = "jail";
17+
public string Command { get; } = Main.Instance.Config.JailCommandName;
1818

1919
public string[] Aliases { get; } = Array.Empty<string>();
2020

AdminTools/Config.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,8 @@ public class Config : IConfig
2222

2323
[Description("Whether or not to disable RoundLock & LobbyLock when Waiting For Players")]
2424
public bool DisableLockOnWaiting { get; set; } = false;
25+
26+
[Description("Name of the jail command, useful if you're also using cedmod (or another plugin) that causes conflicts.")]
27+
public string JailCommandName { get; set; } = "jail";
2528
}
2629
}

AdminTools/Main.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ public class Main : Plugin<Config>
3434
public override Version Version { get; } = new(7, 1, 4);
3535
public override Version RequiredExiledVersion { get; } = new(8, 8, 0);
3636

37+
public static Main Instance;
38+
3739
public override void OnEnabled()
3840
{
3941
try
@@ -55,6 +57,7 @@ public override void OnEnabled()
5557
Log.Error($"Loading error: {e}");
5658
}
5759

60+
Instance = this;
5861
EventHandlers = new(this);
5962

6063
if (Config.ExtendedCommandUsage)
@@ -70,6 +73,7 @@ public override void OnDisabled()
7073
{
7174
Harmony?.UnpatchAll(Harmony.Id);
7275
EventHandlers = null;
76+
Instance = null;
7377

7478
base.OnDisabled();
7579
}

0 commit comments

Comments
 (0)