From 46c42536c976416ffa63eb7f19227f4e8f6f6f23 Mon Sep 17 00:00:00 2001 From: Lucas Nicodemus Date: Wed, 19 Apr 2017 17:22:46 -0600 Subject: [PATCH] Replace calls to Main.buffName to Lang.GetBuffName --- TShockAPI/Commands.cs | 4 ++-- TShockAPI/Utils.cs | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/TShockAPI/Commands.cs b/TShockAPI/Commands.cs index 04d19f70..9c6ca1bf 100644 --- a/TShockAPI/Commands.cs +++ b/TShockAPI/Commands.cs @@ -5517,7 +5517,7 @@ namespace TShockAPI } else if (found.Count > 1) { - TShock.Utils.SendMultipleMatchError(args.Player, found.Select(f => Main.buffName[f])); + TShock.Utils.SendMultipleMatchError(args.Player, found.Select(f => Lang.GetBuffName(f))); return; } id = found[0]; @@ -5568,7 +5568,7 @@ namespace TShockAPI } else if (found.Count > 1) { - TShock.Utils.SendMultipleMatchError(args.Player, found.Select(b => Main.buffName[b])); + TShock.Utils.SendMultipleMatchError(args.Player, found.Select(b => Lang.GetBuffName(b))); return; } id = found[0]; diff --git a/TShockAPI/Utils.cs b/TShockAPI/Utils.cs index df0c8a72..fd680370 100644 --- a/TShockAPI/Utils.cs +++ b/TShockAPI/Utils.cs @@ -435,7 +435,7 @@ namespace TShockAPI /// name public string GetBuffName(int id) { - return (id > 0 && id < Main.maxBuffTypes) ? Main.buffName[id] : "null"; + return (id > 0 && id < Main.maxBuffTypes) ? Lang.GetBuffName(id) : "null"; } /// @@ -445,7 +445,7 @@ namespace TShockAPI /// description public string GetBuffDescription(int id) { - return (id > 0 && id < Main.maxBuffTypes) ? Main.buffTip[id] : "null"; + return (id > 0 && id < Main.maxBuffTypes) ? Lang.GetBuffName(id) : "null"; } /// @@ -459,14 +459,14 @@ namespace TShockAPI string buffname; for (int i = 1; i < Main.maxBuffTypes; i++) { - buffname = Main.buffName[i]; + buffname = Lang.GetBuffName(i); if (!String.IsNullOrWhiteSpace(buffname) && buffname.ToLower() == nameLower) return new List {i}; } var found = new List(); for (int i = 1; i < Main.maxBuffTypes; i++) { - buffname = Main.buffName[i]; + buffname = Lang.GetBuffName(i); if (!String.IsNullOrWhiteSpace(buffname) && buffname.ToLower().StartsWith(nameLower)) found.Add(i); } @@ -1209,9 +1209,9 @@ namespace TShockAPI List elements = new List(); for (int i = 0; i < Main.maxBuffTypes; i++) { - if (!String.IsNullOrEmpty(Main.buffName[i])) + if (!String.IsNullOrEmpty(Lang.GetBuffName(i))) { - object[] element = new object[] { i, Main.buffName[i], Main.buffTip[i] }; + object[] element = new object[] { i, Lang.GetBuffName(i), Main.buffTip[i] }; elements.Add(element); } }