private void Player_QuickSpawnItem_int_int(On.Terraria.Player.orig_QuickSpawnItem_int_int orig, Terraria.Player self, int item, int stack) { if (!TreasureBagValueCalculator.Loading) { orig(self, item, stack); } else { TreasureBagValueCalculator.HandleQuickSpawnItem(self, item, stack); } }
public override void Load() { base.Load(); LoadingHelper.Load(); Instance = ModContent.GetInstance <PboneUtils>(); textures = new ModTextureManager(); recipes = new ModRecipeManager(); ui = new ModUIManager(); bagValues = new TreasureBagValueCalculator(); modPacketManager = new ModPacketManager(this); crossModManager = new CrossModManager(); crossModManager.Load(); Load_IL(); Load_On(); textures.Initialize(); ui.Initialize(); }
public override void Unload() { base.Unload(); if (textures != null) { textures.Dispose(); } if (bagValues != null) { bagValues.Unload(); } Instance = null; textures = null; recipes = null; ui = null; bagValues = null; crossModManager = null; modPacketManager = null; }