Remove few util methods
This commit is contained in:
1 parent
0acb1f71d7
commit
c65b6e9ce9
2 files changed
-17
No files matched your search
@@ -11,7 +11,6 @@ namespace CalamityMod
|
||||
{
|
||||
public static CalamityPlayer Calamity(this Player player) => player.GetModPlayer<CalamityPlayer>();
|
||||
public static CalamityGlobalNPC Calamity(this NPC npc) => npc.GetGlobalNPC<CalamityGlobalNPC>();
|
||||
public static CalamityVanillaAIOverrideNPC AIOverrideNPC(this NPC npc) => npc.GetGlobalNPC<CalamityVanillaAIOverrideNPC>();
|
||||
public static CalamityTileCollisionHarmNPC FlungNPC(this NPC npc) => npc.GetGlobalNPC<CalamityTileCollisionHarmNPC>();
|
||||
public static CalamityPolarityNPC PolarityNPC(this NPC npc) => npc.GetGlobalNPC<CalamityPolarityNPC>();
|
||||
public static CalamityGlobalItem Calamity(this Item item) => item.GetGlobalItem<CalamityGlobalItem>();
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
|
||||
namespace CalamityMod
|
||||
@@ -9,19 +7,5 @@ namespace CalamityMod
|
||||
{
|
||||
internal static readonly string AlphanumericCharacters = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
|
||||
public static string GenerateRandomAlphanumericString(int length) => new string(Enumerable.Repeat(AlphanumericCharacters, length).Select(s => s[Main.rand.Next(s.Length)]).ToArray());
|
||||
|
||||
public static string ColorMessage(this Color color, string text, bool newline = false)
|
||||
{
|
||||
int bufferSize = text.Length < 200 ? 256 : text.Length + 32;
|
||||
StringBuilder sb = new(bufferSize);
|
||||
sb.Append("[c/");
|
||||
sb.Append(color.Hex3());
|
||||
sb.Append(':');
|
||||
sb.Append(text);
|
||||
sb.Append(']');
|
||||
if (newline)
|
||||
sb.Append('\n');
|
||||
return sb.ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user