Skip to content

Commit

Permalink
Removed *Config.Instance
Browse files Browse the repository at this point in the history
  • Loading branch information
gardenappl committed Mar 19, 2020
1 parent f354903 commit acdf0d5
Show file tree
Hide file tree
Showing 82 changed files with 101 additions and 105 deletions.
4 changes: 2 additions & 2 deletions Commands/WorldGenCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public override void Action(CommandCaller caller, string input, string[] args)
}
if(args[0].Equals("hellforge", StringComparison.OrdinalIgnoreCase))
{
if(!ServerConfig.Instance.AncientForges)
if(!ModContent.GetInstance<ServerConfig>().AncientForges)
{
Main.NewText(Language.GetTextValue("Mods.GoldensMisc.Command.WorldGen.HellforgeDisabled"));
return;
Expand All @@ -35,7 +35,7 @@ public override void Action(CommandCaller caller, string input, string[] args)
}
else if(args[0].Equals("forge", StringComparison.OrdinalIgnoreCase))
{
if(!ServerConfig.Instance.AncientForges)
if(!ModContent.GetInstance<ServerConfig>().AncientForges)
{
Main.NewText(Language.GetTextValue("Mods.GoldensMisc.Command.WorldGen.ForgeDisabled"));
return;
Expand Down
4 changes: 0 additions & 4 deletions Config.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ public override bool Autoload(ref string name)

public override ConfigScope Mode => ConfigScope.ServerSide;

public static ServerConfig Instance;

public override bool AcceptClientChanges(ModConfig pendingConfig, int whoAmI, ref string message)
{
message = Language.GetTextValue("Mods.GoldensMisc.Config.ServerBlocked");
Expand Down Expand Up @@ -197,8 +195,6 @@ public override bool Autoload(ref string name)

public override ConfigScope Mode => ConfigScope.ClientSide;

public static ClientConfig Instance;

[Label("$Mods.GoldensMisc.Config.CellPhoneResprite")]
[Tooltip("$Mods.GoldensMisc.Config.CellPhoneResprite.Desc")]
[ReloadRequired]
Expand Down
12 changes: 6 additions & 6 deletions GoldensMisc.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,20 +36,20 @@ public override void Load()
AutofisherHooks.Initialize();
VanillaTweaksLoaded = ModLoader.GetMod("VanillaTweaks") != null;

if (ServerConfig.Instance.WormholeMirror)
if (ModContent.GetInstance<ServerConfig>().WormholeMirror)
WormholeHacks.Load();

if(!Main.dedServ)
{
MiscGlowMasks.Load();
if(ClientConfig.Instance.CellPhoneResprite)
if(ModContent.GetInstance<ClientConfig>().CellPhoneResprite)
{
CellPhoneTexture = Main.itemTexture[ItemID.CellPhone];
Main.itemTexture[ItemID.CellPhone] = GetTexture("Items/Tools/CellPhone_Resprite");
}
// SkyManager.Instance["GoldensMisc:Laputa"] = new LaputaSky();

if(ServerConfig.Instance.ExtraDyes)
if(ModContent.GetInstance<ServerConfig>().ExtraDyes)
{
GameShaders.Armor.BindShader(ModContent.ItemType<MatrixDye>(), new ArmorShaderData(Main.PixelShaderRef, "ArmorPhase")).UseImage("Images/Misc/noise").UseColor(0f, 1.0f, 0.2f);
GameShaders.Armor.BindShader(ModContent.ItemType<VirtualDye>(), new ArmorShaderData(Main.PixelShaderRef, "ArmorPhase")).UseImage("Images/Misc/noise").UseColor(1f, 0.1f, 0.1f);
Expand All @@ -62,7 +62,7 @@ public override void Load()
GameShaders.Armor.BindShader(ModContent.ItemType<ChlorophyteDye>(), new ReflectiveArmorShaderData(Main.PixelShaderRef, "ArmorReflectiveColor")).UseColor(0.5f, 1.1f, 0.1f);
}
}
if(ServerConfig.Instance.SpearofJustice)
if(ModContent.GetInstance<ServerConfig>().SpearofJustice)
{
AddProjectile("MagicSpearMiniAlt", new MagicSpearMini());
}
Expand All @@ -71,13 +71,13 @@ public override void Load()
public override void PostSetupContent()
{
var hotkeysMod = ModLoader.GetMod("HelpfulHotkeys");
if(hotkeysMod != null && ServerConfig.Instance.WormholeMirror)
if(hotkeysMod != null && ModContent.GetInstance<ServerConfig>().WormholeMirror)
{
hotkeysMod.Call("RegisterRecallItem", ModContent.ItemType<WormholeDoubleMirror>());
hotkeysMod.Call("RegisterRecallItem", ModContent.ItemType<WormholeIceMirror>());
hotkeysMod.Call("RegisterRecallItem", ModContent.ItemType<WormholeCellPhone>());
}
if(ServerConfig.Instance.ChestVacuum)
if(ModContent.GetInstance<ServerConfig>().ChestVacuum)
{
ModContent.GetInstance<Tiles.ChestVacuum>().SetDefaultsPostContent();
}
Expand Down
2 changes: 1 addition & 1 deletion Items/Consumable/GodStone.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class GodStone : ModItem
{
public override bool Autoload(ref string name)
{
return ServerConfig.Instance.GodStone;
return ModContent.GetInstance<ServerConfig>().GodStone;
}

public override void SetDefaults()
Expand Down
2 changes: 1 addition & 1 deletion Items/Consumable/InertStone.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class InertStone : ModItem
{
public override bool Autoload(ref string name)
{
return ServerConfig.Instance.MagicStones;
return ModContent.GetInstance<ServerConfig>().MagicStones;
}

public override void SetDefaults()
Expand Down
2 changes: 1 addition & 1 deletion Items/Consumable/LifeStone.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public class LifeStone : ModItem
{
public override bool Autoload(ref string name)
{
return ServerConfig.Instance.MagicStones;
return ModContent.GetInstance<ServerConfig>().MagicStones;
}

byte uses = 0;
Expand Down
2 changes: 1 addition & 1 deletion Items/Consumable/ManaStone.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public class ManaStone : ModItem
{
public override bool Autoload(ref string name)
{
return ServerConfig.Instance.MagicStones;
return ModContent.GetInstance<ServerConfig>().MagicStones;
}

byte uses = 0;
Expand Down
2 changes: 1 addition & 1 deletion Items/Equipable/DemonCrown.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class DemonCrown : ModItem
{
public override bool Autoload(ref string name)
{
return ServerConfig.Instance.DemonCrown;
return ModContent.GetInstance<ServerConfig>().DemonCrown;
}

public override void SetDefaults()
Expand Down
2 changes: 1 addition & 1 deletion Items/Equipable/HeartLocket.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public class HeartLocket : ModItem
{
public override bool Autoload(ref string name)
{
return ServerConfig.Instance.HeartLocket;
return ModContent.GetInstance<ServerConfig>().HeartLocket;
}

public override void SetDefaults()
Expand Down
2 changes: 1 addition & 1 deletion Items/Equipable/MagnetismRing.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class MagnetismRing : ModItem
{
public override bool Autoload(ref string name)
{
return ServerConfig.Instance.Magnet;
return ModContent.GetInstance<ServerConfig>().Magnet;
}

public override void SetDefaults()
Expand Down
2 changes: 1 addition & 1 deletion Items/Equipable/NinjaGear.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class NinjaGear : ModItem
{
public override bool Autoload(ref string name)
{
return ServerConfig.Instance.NinjaGear;
return ModContent.GetInstance<ServerConfig>().NinjaGear;
}

public override void SetDefaults()
Expand Down
2 changes: 1 addition & 1 deletion Items/Equipable/OrbofLight.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public class OrbofLight : ModItem
{
public override bool Autoload(ref string name)
{
return ServerConfig.Instance.AncientOrb;
return ModContent.GetInstance<ServerConfig>().AncientOrb;
}

public override void SetDefaults()
Expand Down
2 changes: 1 addition & 1 deletion Items/Equipable/ReinforcedHorseshoe.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class ReinforcedHorseshoe : ModItem
{
public override bool Autoload(ref string name)
{
return ServerConfig.Instance.ReinforcedVest;
return ModContent.GetInstance<ServerConfig>().ReinforcedVest;
}

public override void SetDefaults()
Expand Down
2 changes: 1 addition & 1 deletion Items/Equipable/ReinforcedVest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public class ReinforcedVest : ModItem
{
public override bool Autoload(ref string name)
{
return ServerConfig.Instance.ReinforcedVest;
return ModContent.GetInstance<ServerConfig>().ReinforcedVest;
}

public override void SetDefaults()
Expand Down
2 changes: 1 addition & 1 deletion Items/Equipable/UniversalMagnet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public class UniversalMagnet : ModItem
{
public override bool Autoload(ref string name)
{
return ServerConfig.Instance.Magnet;
return ModContent.GetInstance<ServerConfig>().Magnet;
}

public override void SetDefaults()
Expand Down
2 changes: 1 addition & 1 deletion Items/Equipable/Vanity/AdamantiteDye.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public class AdamantiteDye : ModItem
{
public override bool Autoload(ref string name)
{
return ServerConfig.Instance.ExtraDyes;
return ModContent.GetInstance<ServerConfig>().ExtraDyes;
}

public override void SetDefaults()
Expand Down
4 changes: 2 additions & 2 deletions Items/Equipable/Vanity/BaseballCap.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public class BaseballCap : ModItem
{
public override bool Autoload(ref string name)
{
return ServerConfig.Instance.BaseballBats;
return ModContent.GetInstance<ServerConfig>().BaseballBats;
}

public override void SetDefaults()
Expand All @@ -37,7 +37,7 @@ public class BaseballCapBackwards : ModItem
{
public override bool Autoload(ref string name)
{
return ServerConfig.Instance.BaseballBats;
return ModContent.GetInstance<ServerConfig>().BaseballBats;
}

public override void SetDefaults()
Expand Down
2 changes: 1 addition & 1 deletion Items/Equipable/Vanity/ChlorophyteDye.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public class ChlorophyteDye : ModItem
{
public override bool Autoload(ref string name)
{
return ServerConfig.Instance.ExtraDyes;
return ModContent.GetInstance<ServerConfig>().ExtraDyes;
}

public override void SetDefaults()
Expand Down
2 changes: 1 addition & 1 deletion Items/Equipable/Vanity/CobaltDye.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public class CobaltDye : ModItem
{
public override bool Autoload(ref string name)
{
return ServerConfig.Instance.ExtraDyes;
return ModContent.GetInstance<ServerConfig>().ExtraDyes;
}

public override void SetDefaults()
Expand Down
2 changes: 1 addition & 1 deletion Items/Equipable/Vanity/MatrixDye.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public class MatrixDye : ModItem
{
public override bool Autoload(ref string name)
{
return ServerConfig.Instance.ExtraDyes;
return ModContent.GetInstance<ServerConfig>().ExtraDyes;
}

public override void SetDefaults()
Expand Down
2 changes: 1 addition & 1 deletion Items/Equipable/Vanity/MythrilDye.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public class MythrilDye : ModItem
{
public override bool Autoload(ref string name)
{
return ServerConfig.Instance.ExtraDyes;
return ModContent.GetInstance<ServerConfig>().ExtraDyes;
}

public override void SetDefaults()
Expand Down
2 changes: 1 addition & 1 deletion Items/Equipable/Vanity/OrichalcumDye.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public class OrichalcumDye : ModItem
{
public override bool Autoload(ref string name)
{
return ServerConfig.Instance.ExtraDyes;
return ModContent.GetInstance<ServerConfig>().ExtraDyes;
}

public override void SetDefaults()
Expand Down
2 changes: 1 addition & 1 deletion Items/Equipable/Vanity/PalladiumDye.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public class PalladiumDye : ModItem
{
public override bool Autoload(ref string name)
{
return ServerConfig.Instance.ExtraDyes;
return ModContent.GetInstance<ServerConfig>().ExtraDyes;
}

public override void SetDefaults()
Expand Down
2 changes: 1 addition & 1 deletion Items/Equipable/Vanity/TitaniumDye.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public class TitaniumDye : ModItem
{
public override bool Autoload(ref string name)
{
return ServerConfig.Instance.ExtraDyes;
return ModContent.GetInstance<ServerConfig>().ExtraDyes;
}

public override void SetDefaults()
Expand Down
2 changes: 1 addition & 1 deletion Items/Equipable/Vanity/VirtualDye.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public class VirtualDye : ModItem
{
public override bool Autoload(ref string name)
{
return ServerConfig.Instance.ExtraDyes;
return ModContent.GetInstance<ServerConfig>().ExtraDyes;
}

public override void SetDefaults()
Expand Down
2 changes: 1 addition & 1 deletion Items/ItemTweaks.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public class ItemTweaks : GlobalItem

public override void SetDefaults(Item item)
{
if(ServerConfig.Instance.AltStaffs)
if(ModContent.GetInstance<ServerConfig>().AltStaffs)
{
switch(item.type)
{
Expand Down
2 changes: 1 addition & 1 deletion Items/Materials/WormholeCrystal.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public class WormholeCrystal : ModItem
{
public override bool Autoload(ref string name)
{
return ServerConfig.Instance.WormholeMirror;
return ModContent.GetInstance<ServerConfig>().WormholeMirror;
}

public override void SetStaticDefaults()
Expand Down
2 changes: 1 addition & 1 deletion Items/Placeable/AncientForge.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public class AncientForge : ModItem
{
public override bool Autoload(ref string name)
{
return ServerConfig.Instance.AncientForges;
return ModContent.GetInstance<ServerConfig>().AncientForges;
}

public override void SetDefaults()
Expand Down
2 changes: 1 addition & 1 deletion Items/Placeable/AncientHellforge.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class AncientHellforge : ModItem
{
public override bool Autoload(ref string name)
{
return ServerConfig.Instance.AncientForges;
return ModContent.GetInstance<ServerConfig>().AncientForges;
}

public override void SetDefaults()
Expand Down
2 changes: 1 addition & 1 deletion Items/Placeable/Autofisher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class Autofisher : ModItem
{
public override bool Autoload(ref string name)
{
return ServerConfig.Instance.Autofisher;
return ModContent.GetInstance<ServerConfig>().Autofisher;
}

public override void SetDefaults()
Expand Down
2 changes: 1 addition & 1 deletion Items/Placeable/ChestVacuum.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public class ChestVacuum : ModItem
{
public override bool Autoload(ref string name)
{
return ServerConfig.Instance.ChestVacuum;
return ModContent.GetInstance<ServerConfig>().ChestVacuum;
}

public override void SetDefaults()
Expand Down
2 changes: 1 addition & 1 deletion Items/Placeable/RedChimney.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public class RedChimney : ModItem
{
public override bool Autoload(ref string name)
{
return ServerConfig.Instance.RedBrickFurniture;
return ModContent.GetInstance<ServerConfig>().RedBrickFurniture;
}

public override void SetDefaults()
Expand Down
2 changes: 1 addition & 1 deletion Items/Placeable/RedFireplace.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public class RedFireplace : ModItem
{
public override bool Autoload(ref string name)
{
return ServerConfig.Instance.RedBrickFurniture;
return ModContent.GetInstance<ServerConfig>().RedBrickFurniture;
}

public override void SetDefaults()
Expand Down
2 changes: 1 addition & 1 deletion Items/Placeable/SandstoneSlabWall.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public class SandstoneSlabWall : ModItem
{
public override bool Autoload(ref string name)
{
return ServerConfig.Instance.BuildingMaterials;
return ModContent.GetInstance<ServerConfig>().BuildingMaterials;
}

public override void SetDefaults()
Expand Down
6 changes: 3 additions & 3 deletions Items/Tools/RodofWarping.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public class RodofWarping : ModItem
{
public override bool Autoload(ref string name)
{
return ServerConfig.Instance.RodofWarping;
return ModContent.GetInstance<ServerConfig>().RodofWarping;
}

public override void SetStaticDefaults()
Expand Down Expand Up @@ -52,7 +52,7 @@ public override bool UseItem(Player player)
{
player.Teleport(teleportPos, 1);
NetMessage.SendData(65, -1, -1, null, 0, (float) player.whoAmI, teleportPos.X, teleportPos.Y, 1);
if(ServerConfig.Instance.RodofWarpingChaosState > 0f)
if(ModContent.GetInstance<ServerConfig>().RodofWarpingChaosState > 0f)
{
if(player.chaosState)
{
Expand All @@ -67,7 +67,7 @@ public override bool UseItem(Player player)
player.lifeRegenCount = 0;
player.lifeRegenTime = 0;
}
player.AddBuff(BuffID.ChaosState, (int)Math.Floor(ServerConfig.Instance.RodofWarpingChaosState * 60));
player.AddBuff(BuffID.ChaosState, (int)Math.Floor(ModContent.GetInstance<ServerConfig>().RodofWarpingChaosState * 60));
}
}
}
Expand Down
Loading

0 comments on commit acdf0d5

Please sign in to comment.