Skip to content

Commit

Permalink
修复:新建配置没有自带参数问题
Browse files Browse the repository at this point in the history
  • Loading branch information
1242509682 committed Jun 21, 2024
1 parent 379392f commit 4d6eb08
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
7 changes: 5 additions & 2 deletions GoodNight/Configuration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ internal class Configuration
public HashSet<int> NpcDead = new HashSet<int>();
[JsonProperty("禁止怪物生成表(NpcID)", Order = -5)]
public HashSet<int> Npcs = new HashSet<int>();


#region 读取与创建配置文件方法
public void Write()
Expand All @@ -65,8 +65,11 @@ public static Configuration Read()
{
if (!File.Exists(FilePath))
{
var NewConfig = new Configuration();
NewConfig.PlayersList = new HashSet<string>() {"羽学"};
NewConfig.Npcs = new HashSet<int>() { 4,13,14,15,35,36,50,113,114,125,126,127,128,129,130,131,134,135,136,222,245,246,247,248,249,262,266,370,396,397,398,400,439,440,422,493,507,517,636,657,668 };
new Configuration().Write();
return new Configuration();
return NewConfig;
}
else
{
Expand Down
2 changes: 1 addition & 1 deletion GoodNight/Goodnight.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public class Goodnight : TerrariaPlugin
#region 变量与插件信息
public override string Name => "宵禁";
public override string Author => "Jonesn 羽学 少司命";
public override Version Version => new Version(2, 7, 0);
public override Version Version => new Version(2, 7, 2);
public override string Description => "设置服务器无法进入或禁止生成怪物的时段";
internal static Configuration Config;
#endregion
Expand Down
4 changes: 4 additions & 0 deletions GoodNight/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
## 更新日志

```
v2.7.2
修复检测到没有配置文件时,创建的配置没有参数
不会因为使用/reload重复写入或覆盖原来参数等问题
v2.7.1
优化了对《允许召唤表》播报细节的空检查
Expand Down

0 comments on commit 4d6eb08

Please sign in to comment.