Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

修复:初始箱子都保存的问题 #487

Merged
merged 15 commits into from
Sep 28, 2024
6 changes: 3 additions & 3 deletions src/AutoBroadcast/AutoBroadcast.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public class AutoBroadcast : TerrariaPlugin
public override string Name => "AutoBroadcast";
public override string Author => "Scavenger";
public override string Description => "自动广播插件";
public override Version Version => new Version(1, 0, 3);
public override Version Version => new Version(1, 0, 4);
public string ConfigPath => Path.Combine(TShock.SavePath, "AutoBroadcastConfig.json");
public ABConfig Config = new ABConfig();
public DateTime LastCheck = DateTime.UtcNow;
Expand Down Expand Up @@ -40,7 +40,7 @@ public void OnInitialize(EventArgs args)
this.autobc();
TShockAPI.Hooks.GeneralHooks.ReloadEvent += (_) =>
{
TSPlayer.Server.SendSuccessMessage("自定广播配置已重读!");
TSPlayer.Server.SendSuccessMessage(GetString("自定广播配置已重读!"));
this.autobc();
};
}
Expand All @@ -54,7 +54,7 @@ public void autobc()
catch (Exception ex)
{
this.Config = new ABConfig();
TShock.Log.Error("[AutoBroadcast]配置读取发生错误!\n{0}".SFormat(ex.ToString()));
TShock.Log.Error(GetString("[AutoBroadcast]配置读取发生错误!\n{0}").SFormat(ex.ToString()));
}
}

Expand Down
3 changes: 2 additions & 1 deletion src/AutoBroadcast/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
## 更新日志

```
暂无
v1.0.4
i18n预定
```

## 指令
Expand Down
4 changes: 2 additions & 2 deletions src/AutoPluginManager/Plugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ public void LoadPlugins(IEnumerable<PluginVersionInfo> Plugins)
}
}
}

}
}

Expand Down Expand Up @@ -534,4 +534,4 @@ private static List<PluginUpdateInfo> UpdatePlugin(List<PluginUpdateInfo> plugin
return pluginUpdateInfos;
}
#endregion
}
}
4 changes: 2 additions & 2 deletions src/AutoReset/AutoResetPlugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -321,8 +321,8 @@ void ShowHelpText()
// 世界信息
case "信息":
case "info":
op.SendInfoMessage(GetString($"地图名: {(Config.SetWorld.Name ?? Main.worldName)}\n") +
GetString($"种子: {(Config.SetWorld.Seed ?? GetString("随机"))}"));
op.SendInfoMessage(GetString($"地图名: {Config.SetWorld.Name ?? Main.worldName}\n") +
GetString($"种子: {Config.SetWorld.Seed ?? GetString("随机")}"));
break;
case "名字":
case "name":
Expand Down
8 changes: 4 additions & 4 deletions src/AutoStoreItems/AutoStoreItems.cs
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,10 @@ private void OnGameUpdate(EventArgs args)
if (Timer % Config.ItemTime == 0)
{
if ((Config.Hand ? inv.type == plr.TPlayer.inventory[plr.TPlayer.selectedItem].type : inv.type == item) &&
(Config.bank1 && !Stored && (Stored = AutoStoredItem(plr, plr.TPlayer.bank.item, PlayerItemSlotID.Bank1_0, "存钱罐")) ||
Config.bank2 && !Stored && (Stored = AutoStoredItem(plr, plr.TPlayer.bank2.item, PlayerItemSlotID.Bank2_0, "保险箱")) ||
Config.bank3 && !Stored && (Stored = AutoStoredItem(plr, plr.TPlayer.bank3.item, PlayerItemSlotID.Bank3_0, "护卫熔炉")) ||
Config.bank4 && !Stored && (Stored = AutoStoredItem(plr, plr.TPlayer.bank4.item, PlayerItemSlotID.Bank4_0, "虚空袋"))))
((Config.bank1 && !Stored && (Stored = AutoStoredItem(plr, plr.TPlayer.bank.item, PlayerItemSlotID.Bank1_0, "存钱罐"))) ||
(Config.bank2 && !Stored && (Stored = AutoStoredItem(plr, plr.TPlayer.bank2.item, PlayerItemSlotID.Bank2_0, "保险箱"))) ||
(Config.bank3 && !Stored && (Stored = AutoStoredItem(plr, plr.TPlayer.bank3.item, PlayerItemSlotID.Bank3_0, "护卫熔炉"))) ||
(Config.bank4 && !Stored && (Stored = AutoStoredItem(plr, plr.TPlayer.bank4.item, PlayerItemSlotID.Bank4_0, "虚空袋")))))
{
break;
}
Expand Down
2 changes: 1 addition & 1 deletion src/BagPing/BagPing.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ private void OnNpcKilled(NpcKilledEventArgs e)
if (e.npc.boss)
{
TSPlayer.All.SendSuccessMessage(TShock.Utils.ItemTag(new Item() { netID = 3318, stack = 1, prefix = 0 })
+GetString( $"宝藏袋掉落在坐标({(int) e.npc.position.X / 16},{(int) e.npc.position.Y / 16}),已在小地图上标记!"));
+ GetString($"宝藏袋掉落在坐标({(int) e.npc.position.X / 16},{(int) e.npc.position.Y / 16}),已在小地图上标记!"));
Task.Run(() =>
{
for (var i = 0; i < 4; i++)
Expand Down
27 changes: 13 additions & 14 deletions src/BanNpc/Plugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public class Plugin : TerrariaPlugin

public override string Name => "禁止怪物";

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

private static Config Config { get; set; } = new();

Expand All @@ -34,14 +34,13 @@ private void LoadConfig()
}
else
{
TShock.Log.ConsoleError("未找到禁止怪物表,已为您创建!" +
"修改配置后输入/bm reload可以应用新的配置。");
TShock.Log.ConsoleError(GetString("未找到禁止怪物表,已为您创建!\n修改配置后输入/bm reload可以应用新的配置。"));
}
Config.Write(PATH);
}
catch (Exception ex)
{
TShock.Log.ConsoleError("禁止怪物表读取错误:" + ex.ToString());
TShock.Log.ConsoleError(GetString("禁止怪物表读取错误:") + ex.ToString());
}
}
private GeneralHooks.ReloadEventD _reloadHandler;
Expand Down Expand Up @@ -75,11 +74,11 @@ private void BanCommand(CommandArgs args)
{
if (Config.Npcs.Count < 1)
{
args.Player.SendInfoMessage("当前阻止表为空.");
args.Player.SendInfoMessage(GetString("当前阻止表为空."));
}
else
{
args.Player.SendInfoMessage("阻止怪物表: " + string.Join(", ", Config.Npcs.Select(x => TShock.Utils.GetNPCById(x)?.FullName + "({0})".SFormat(x))));
args.Player.SendInfoMessage(GetString("阻止怪物表: ") + string.Join(", ", Config.Npcs.Select(x => TShock.Utils.GetNPCById(x)?.FullName + "({0})".SFormat(x))));
}

return;
Expand All @@ -90,7 +89,7 @@ private void BanCommand(CommandArgs args)
var matchedNPCs = TShock.Utils.GetNPCByIdOrName(args.Parameters[1]);
if (matchedNPCs.Count == 0)
{
args.Player.SendErrorMessage("无效NPC: {0} !", args.Parameters[1]);
args.Player.SendErrorMessage(GetString("无效NPC: {0} !"), args.Parameters[1]);
return;
}
else if (matchedNPCs.Count > 1)
Expand All @@ -108,12 +107,12 @@ private void BanCommand(CommandArgs args)
{
if (Config.Npcs.Contains(npc.netID))
{
args.Player.SendErrorMessage("NPC ID {0} 已在阻止列表中!", npc.netID);
args.Player.SendErrorMessage(GetString("NPC ID {0} 已在阻止列表中!"), npc.netID);
return;
}
Config.Npcs.Add(npc.netID);
Config.Write(PATH);
args.Player.SendSuccessMessage("已成功将NPC ID添加到阻止列表: {0}!", npc.netID);
args.Player.SendSuccessMessage(GetString("已成功将NPC ID添加到阻止列表: {0}!"), npc.netID);
break;
}
case "delete":
Expand All @@ -122,17 +121,17 @@ private void BanCommand(CommandArgs args)
{
if (!Config.Npcs.Contains(npc.netID))
{
args.Player.SendErrorMessage("NPC ID {0} 不在筛选列表中!", npc.netID);
args.Player.SendErrorMessage(GetString("NPC ID {0} 不在筛选列表中!"), npc.netID);
return;
}
Config.Npcs.Remove(npc.netID);
Config.Write(PATH);
args.Player.SendSuccessMessage("已成功从阻止列表中删除NPC ID: {0}!", npc.netID);
args.Player.SendSuccessMessage(GetString("已成功从阻止列表中删除NPC ID: {0}!"), npc.netID);
break;
}
default:
{
args.Player.SendErrorMessage("语法错误: /bm <add/del> [name or ID]");
args.Player.SendErrorMessage(GetString("语法错误: /bm <add/del> [name or ID]"));
break;
}
}
Expand All @@ -141,8 +140,8 @@ private void BanCommand(CommandArgs args)
{
args.Player.SendInfoMessage("/bm");
args.Player.SendInfoMessage("/bm list");
args.Player.SendInfoMessage("/bm add [name or ID]");
args.Player.SendInfoMessage("/bm del [name or ID]");
args.Player.SendInfoMessage(GetString("/bm add [name or ID]"));
args.Player.SendInfoMessage(GetString("/bm del [name or ID]"));
return;
}
}
Expand Down
2 changes: 2 additions & 0 deletions src/BanNpc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
## 更新日志

```
v1.0.0.2
i18n预备
v1.0.0.1
补全卸载函数
```
Expand Down
4 changes: 2 additions & 2 deletions src/BedSet/Plugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class Plugin : TerrariaPlugin
public override string Author => "cmgy";
public override string Description => "";
public override string Name => "BedSet 床设置";
public override Version Version => new(1, 0, 0, 1);
public override Version Version => new(1, 0, 0, 2);

private Config Config { get; set; } = new();
public Plugin(Main game) : base(game) { }
Expand All @@ -39,7 +39,7 @@ private void CBed(CommandArgs args)
Y = args.Player.TileY
};
}
args.Player.SendSuccessMessage("出生点位置设置成功!");
args.Player.SendSuccessMessage(GetString("出生点位置设置成功!"));
this.Config.Write();
}

Expand Down
2 changes: 2 additions & 0 deletions src/BedSet/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
## 更新日志

```
1.0.0.2
i18n预备
1.0.0.1
修正位置偏移
```
Expand Down
4 changes: 2 additions & 2 deletions src/BetterWhitelist/Main.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@ private void BetterWhitelistCommand(CommandArgs args)
args.Player.SendInfoMessage(GetString("-------[BetterWhitelist]-------"));
args.Player.SendInfoMessage(GetString("/bwl help, 显示帮助信息\n") +
GetString("/bwl add {name}, 添加玩家名到白名单中\n") +
GetString("/bwl del {name}, 将玩家移出白名单\n")+
GetString("/bwl del {name}, 将玩家移出白名单\n") +
GetString("/bwl list, 显示白名单上的全部玩家\n") +
GetString( "/bwl true, 启用插件\n") +
GetString("/bwl true, 启用插件\n") +
GetString("/bwl false, 关闭插件\n") +
GetString("/bwl reload, 重载插件"));
break;
Expand Down
14 changes: 7 additions & 7 deletions src/BridgeBuilder/BridgeBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace BridgeBuilder;
public class BridgeBuilder : TerrariaPlugin
{
public override string Name => "BridgeBuilder";
public override Version Version => new Version(1, 0, 8);
public override Version Version => new Version(1, 0, 9);
public override string Author => "Soofa,肝帝熙恩汉化1449";
public override string Description => "铺桥!";
public static Configuration Config;
Expand All @@ -27,7 +27,7 @@ private static void LoadConfig()
private static void ReloadConfig(ReloadEventArgs args)
{
LoadConfig();
args.Player?.SendSuccessMessage("[铺桥] 重新加载配置完毕。");
args.Player?.SendSuccessMessage(GetString("[铺桥] 重新加载配置完毕。"));
}

public override void Initialize()
Expand All @@ -36,7 +36,7 @@ public override void Initialize()
TShockAPI.Commands.ChatCommands.Add(new("bridgebuilder.bridge", this.BridgeCmd, "bridge", "桥来")
{
AllowServer = false,
HelpText = "朝着你看的方向建造桥梁。(你需要持有一定数量的平台或团队块或种植盆。)"
HelpText = GetString("朝着你看的方向建造桥梁。(你需要持有一定数量的平台或团队块或种植盆。)")
});
LoadConfig();
}
Expand Down Expand Up @@ -79,7 +79,7 @@ await Task.Run(() =>

if (selectedItem.createTile < 0 && selectedItem.createWall < 0)
{
plr.SendErrorMessage("你手持的物品无法放置。");
plr.SendErrorMessage(GetString("你手持的物品无法放置。"));
return;
}

Expand All @@ -88,7 +88,7 @@ await Task.Run(() =>

if (j < 0 || j >= Main.maxTilesY)
{
plr.SendErrorMessage("无法在这里建造桥梁。");
plr.SendErrorMessage(GetString("无法在这里建造桥梁。"));
return;
}

Expand Down Expand Up @@ -117,11 +117,11 @@ await Task.Run(() =>

if (placedCount > 0)
{
plr.SendSuccessMessage($"{placedCount}格桥梁建造完成!");
plr.SendSuccessMessage(GetString($"{placedCount}格桥梁建造完成!"));
}
else
{
plr.SendErrorMessage("没有足够的空间或物品来建造桥梁。");
plr.SendErrorMessage(GetString("没有足够的空间或物品来建造桥梁。"));
}

NetMessage.SendData((int) PacketTypes.PlayerSlot, -1, -1, NetworkText.FromLiteral(plr.SelectedItem.Name), plr.Index, plr.TPlayer.selectedItem);
Expand Down
2 changes: 2 additions & 0 deletions src/BridgeBuilder/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
## 更新日志

```
1.0.9
i18n预备
1.0.8
补全卸载函数
1.0.7
Expand Down
12 changes: 6 additions & 6 deletions src/BuildMaster/BuildPlayer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@ public void Join(BuildRoom room)
{
if (room.GetPlayerCount() >= room.MaxPlayer)
{
this.SendInfoMessage("此房间满人了");
this.SendInfoMessage(GetString("此房间满人了"));
return;
}
if (room.Status != 0)
{
this.SendInfoMessage("该房间状态无法加入游戏");
this.SendInfoMessage(GetString("该房间状态无法加入游戏"));
return;
}
if (ConfigUtils.GetRoomByID(this.CurrentRoomID) != null)
Expand All @@ -51,7 +51,7 @@ public void Join(BuildRoom room)
}
this.Join(room.ID);
room.Players.Add(this);
room.Broadcast("玩家 " + this.Name + " 加入了房间", Color.MediumAquamarine);
room.Broadcast(GetString("玩家 ") + this.Name + GetString(" 加入了房间"), Color.MediumAquamarine);
this.Teleport(room.WaitingPoint);
if (!room.Loaded)
{
Expand All @@ -64,16 +64,16 @@ public void Leave()
var roomByID = ConfigUtils.GetRoomByID(this.CurrentRoomID);
if (roomByID == null)
{
this.SendInfoMessage("房间不存在");
this.SendInfoMessage(GetString("房间不存在"));
return;
}
if (roomByID.Status != 0)
{
this.SendInfoMessage("该房间状态无法离开游戏");
this.SendInfoMessage(GetString("该房间状态无法离开游戏"));
return;
}
roomByID.Players.Remove(this);
roomByID.Broadcast("玩家 " + this.Name + " 离开了房间", Color.Crimson);
roomByID.Broadcast(GetString("玩家 ") + this.Name + GetString(" 离开了房间"), Color.Crimson);
this.Teleport(Main.spawnTileX, Main.spawnTileY);
((MiniPlayer) this).Leave();
}
Expand Down
Loading
Loading