tModLoader Spawn Boost Mod?

Potency

Terrarian
The spawn boost mod I used to use provided by jopo is outdated.

Code:
using Terraria;
using Terraria.ModLoader;

namespace SpawnBoostMod
{
  class SpawnBoostMod : Mod
  {
  public SpawnBoostMod()
  {
  Properties = new ModProperties()
  {
  Autoload = true,
  };
  }
  }

  class SpawnRateMultiplierGlobalNPC : GlobalNPC
  {
  float multiplier = 5f;
  public override void EditSpawnRate(Player player, ref int spawnRate, ref int maxSpawns)
  {
  spawnRate = (int)(spawnRate / multiplier);
  maxSpawns = (int)(maxSpawns * 2);
  }
  }
}

Is it possible somebody can fix this for the current version of TML? All I want is for the amount of max spawns to be doubled across all biomes.
 
Last edited:
Pretty sure nothing here changed, still works.
 
Pretty sure nothing here changed, still works.
Code:
SpawnBoostMod.SpawnRateMultiplierGlobalNPC has instance fields but does not set InstancePerEntity to true. Either use static fields, or per instance globals
  at Terraria.ModLoader.NPCLoader.VerifyGlobalNPC(GlobalNPC npc)
  at Terraria.ModLoader.Mod.AddGlobalNPC(String name, GlobalNPC globalNPC)
  at Terraria.ModLoader.Mod.AutoloadGlobalNPC(Type type)
  at Terraria.ModLoader.Mod.Autoload()
  at Terraria.ModLoader.ModLoader.do_Load(Object threadContext)
I keep getting this error every time I build it.
 
Code:
SpawnBoostMod.SpawnRateMultiplierGlobalNPC has instance fields but does not set InstancePerEntity to true. Either use static fields, or per instance globals
  at Terraria.ModLoader.NPCLoader.VerifyGlobalNPC(GlobalNPC npc)
  at Terraria.ModLoader.Mod.AddGlobalNPC(String name, GlobalNPC globalNPC)
  at Terraria.ModLoader.Mod.AutoloadGlobalNPC(Type type)
  at Terraria.ModLoader.Mod.Autoload()
  at Terraria.ModLoader.ModLoader.do_Load(Object threadContext)
I keep getting this error every time I build it.
K, just change "float multiplier = 5f;" to "static float multiplier = 5f;"
 
Back
Top Bottom