internal static void RebuildHooks() { foreach (var hook in hooks) { hook.arr = ModLoader.BuildGlobalHook(players, hook.method).Select(p => p.index).ToArray(); } }
private static void RebuildHooks() { foreach (var hook in hooks) { hook.arr = ModLoader.BuildGlobalHook(Systems, hook.method); } }
internal static void ResizeArrays() { Array.Resize(ref Main.pvpBuff, nextBuff); Array.Resize(ref Main.persistentBuff, nextBuff); Array.Resize(ref Main.vanityPet, nextBuff); Array.Resize(ref Main.lightPet, nextBuff); Array.Resize(ref Main.meleeBuff, nextBuff); Array.Resize(ref Main.debuff, nextBuff); Array.Resize(ref Main.buffNoSave, nextBuff); Array.Resize(ref Main.buffNoTimeDisplay, nextBuff); Array.Resize(ref Main.buffDoubleApply, nextBuff); Array.Resize(ref Main.buffAlpha, nextBuff); Array.Resize(ref Main.buffTexture, nextBuff); Array.Resize(ref Lang._buffNameCache, nextBuff); Array.Resize(ref Lang._buffDescriptionCache, nextBuff); for (int k = BuffID.Count; k < nextBuff; k++) { Lang._buffNameCache[k] = LocalizedText.Empty; Lang._buffDescriptionCache[k] = LocalizedText.Empty; } ModLoader.BuildGlobalHook(ref HookUpdatePlayer, globalBuffs, g => g.Update); ModLoader.BuildGlobalHook(ref HookUpdateNPC, globalBuffs, g => g.Update); ModLoader.BuildGlobalHook(ref HookReApplyPlayer, globalBuffs, g => g.ReApply); ModLoader.BuildGlobalHook(ref HookReApplyNPC, globalBuffs, g => g.ReApply); ModLoader.BuildGlobalHook(ref HookModifyBuffTip, globalBuffs, g => g.ModifyBuffTip); ModLoader.BuildGlobalHook(ref HookCustomBuffTipSize, globalBuffs, g => g.CustomBuffTipSize); ModLoader.BuildGlobalHook(ref HookDrawCustomBuffTip, globalBuffs, g => g.DrawCustomBuffTip); }
internal static void ResizeArrays(bool unloading = false) { //Textures Array.Resize(ref TextureAssets.Wall, nextWall); //Sets LoaderUtils.ResetStaticMembers(typeof(WallID), true); //Etc Array.Resize(ref Main.wallHouse, nextWall); Array.Resize(ref Main.wallDungeon, nextWall); Array.Resize(ref Main.wallLight, nextWall); Array.Resize(ref Main.wallBlend, nextWall); Array.Resize(ref Main.wallLargeFrames, nextWall); Array.Resize(ref Main.wallFrame, nextWall); Array.Resize(ref Main.wallFrameCounter, nextWall); ModLoader.BuildGlobalHook(ref HookKillSound, globalWalls, g => g.KillSound); ModLoader.BuildGlobalHook(ref HookNumDust, globalWalls, g => g.NumDust); ModLoader.BuildGlobalHook(ref HookCreateDust, globalWalls, g => g.CreateDust); ModLoader.BuildGlobalHook(ref HookDrop, globalWalls, g => g.Drop); ModLoader.BuildGlobalHook(ref HookKillWall, globalWalls, g => g.KillWall); ModLoader.BuildGlobalHook(ref HookCanExplode, globalWalls, g => g.CanExplode); ModLoader.BuildGlobalHook(ref HookModifyLight, globalWalls, g => g.ModifyLight); ModLoader.BuildGlobalHook(ref HookRandomUpdate, globalWalls, g => g.RandomUpdate); ModLoader.BuildGlobalHook(ref HookPreDraw, globalWalls, g => g.PreDraw); ModLoader.BuildGlobalHook(ref HookPostDraw, globalWalls, g => g.PostDraw); ModLoader.BuildGlobalHook(ref HookPlaceInWorld, globalWalls, g => g.PlaceInWorld); if (!unloading) { loaded = true; } }
//change initial size of Terraria.Player.ownedProjectileCounts to ProjectileLoader.ProjectileCount() internal static void ResizeArrays() { Array.Resize(ref Main.projectileLoaded, nextProjectile); Array.Resize(ref Main.projectileTexture, nextProjectile); Array.Resize(ref Main.projHostile, nextProjectile); Array.Resize(ref Main.projHook, nextProjectile); Array.Resize(ref Main.projFrames, nextProjectile); Array.Resize(ref Main.projPet, nextProjectile); Array.Resize(ref ProjectileID.Sets.ForcePlateDetection, nextProjectile); Array.Resize(ref ProjectileID.Sets.TrailingMode, nextProjectile); Array.Resize(ref ProjectileID.Sets.TrailCacheLength, nextProjectile); Array.Resize(ref ProjectileID.Sets.LightPet, nextProjectile); Array.Resize(ref ProjectileID.Sets.Homing, nextProjectile); Array.Resize(ref ProjectileID.Sets.MinionSacrificable, nextProjectile); Array.Resize(ref ProjectileID.Sets.DontAttachHideToAlpha, nextProjectile); Array.Resize(ref ProjectileID.Sets.NeedsUUID, nextProjectile); Array.Resize(ref ProjectileID.Sets.StardustDragon, nextProjectile); for (int k = ProjectileID.Count; k < nextProjectile; k++) { Main.projectileLoaded[k] = true; Main.projFrames[k] = 1; ProjectileID.Sets.TrailingMode[k] = -1; ProjectileID.Sets.TrailCacheLength[k] = 10; } ModLoader.BuildGlobalHook(ref HookSetDefaults, globalProjectiles, g => g.SetDefaults); ModLoader.BuildGlobalHook(ref HookPreAI, globalProjectiles, g => g.PreAI); ModLoader.BuildGlobalHook(ref HookAI, globalProjectiles, g => g.AI); ModLoader.BuildGlobalHook(ref HookPostAI, globalProjectiles, g => g.PostAI); ModLoader.BuildGlobalHook(ref HookShouldUpdatePosition, globalProjectiles, g => g.ShouldUpdatePosition); ModLoader.BuildGlobalHook(ref HookTileCollideStyle, globalProjectiles, g => g.TileCollideStyle); ModLoader.BuildGlobalHook(ref HookOnTileCollide, globalProjectiles, g => g.OnTileCollide); ModLoader.BuildGlobalHook(ref HookPreKill, globalProjectiles, g => g.PreKill); ModLoader.BuildGlobalHook(ref HookKill, globalProjectiles, g => g.Kill); ModLoader.BuildGlobalHook(ref HookCanDamage, globalProjectiles, g => g.CanDamage); ModLoader.BuildGlobalHook(ref HookMinionContactDamage, globalProjectiles, g => g.MinionContactDamage); ModLoader.BuildGlobalHook(ref HookCanHitNPC, globalProjectiles, g => g.CanHitNPC); ModLoader.BuildGlobalHook(ref HookModifyHitNPC, globalProjectiles, g => g.ModifyHitNPC); ModLoader.BuildGlobalHook(ref HookOnHitNPC, globalProjectiles, g => g.OnHitNPC); ModLoader.BuildGlobalHook(ref HookCanHitPvp, globalProjectiles, g => g.CanHitPvp); ModLoader.BuildGlobalHook(ref HookModifyHitPvp, globalProjectiles, g => g.ModifyHitPvp); ModLoader.BuildGlobalHook(ref HookOnHitPvp, globalProjectiles, g => g.OnHitPvp); ModLoader.BuildGlobalHook(ref HookCanHitPlayer, globalProjectiles, g => g.CanHitPlayer); ModLoader.BuildGlobalHook(ref HookModifyHitPlayer, globalProjectiles, g => g.ModifyHitPlayer); ModLoader.BuildGlobalHook(ref HookOnHitPlayer, globalProjectiles, g => g.OnHitPlayer); ModLoader.BuildGlobalHook(ref HookColliding, globalProjectiles, g => g.Colliding); ModLoader.BuildGlobalHook(ref HookGetAlpha, globalProjectiles, g => g.GetAlpha); ModLoader.BuildGlobalHook(ref HookPreDrawExtras, globalProjectiles, g => g.PreDrawExtras); ModLoader.BuildGlobalHook(ref HookPreDraw, globalProjectiles, g => g.PreDraw); ModLoader.BuildGlobalHook(ref HookPostDraw, globalProjectiles, g => g.PostDraw); ModLoader.BuildGlobalHook(ref HookCanUseGrapple, globalProjectiles, g => g.CanUseGrapple); ModLoader.BuildGlobalHook(ref HookSingleGrappleHook, globalProjectiles, g => g.SingleGrappleHook); ModLoader.BuildGlobalHook(ref HookUseGrapple, globalProjectiles, g => g.UseGrapple); ModLoader.BuildGlobalHook(ref HookNumGrappleHooks, globalProjectiles, g => g.NumGrappleHooks); ModLoader.BuildGlobalHook(ref HookGrappleRetreatSpeed, globalProjectiles, g => g.GrappleRetreatSpeed); ModLoader.BuildGlobalHook(ref HookDrawBehind, globalProjectiles, g => g.DrawBehind); }
//change initial size of Terraria.Player.ownedProjectileCounts to ProjectileLoader.ProjectileCount() internal static void ResizeArrays() { Array.Resize(ref Main.projectileLoaded, nextProjectile); Array.Resize(ref Main.projectileTexture, nextProjectile); Array.Resize(ref Main.projHostile, nextProjectile); Array.Resize(ref Main.projHook, nextProjectile); Array.Resize(ref Main.projFrames, nextProjectile); Array.Resize(ref Main.projPet, nextProjectile); Array.Resize(ref Lang._projectileNameCache, nextProjectile); Array.Resize(ref ProjectileID.Sets.YoyosLifeTimeMultiplier, nextProjectile); Array.Resize(ref ProjectileID.Sets.YoyosMaximumRange, nextProjectile); Array.Resize(ref ProjectileID.Sets.YoyosTopSpeed, nextProjectile); Array.Resize(ref ProjectileID.Sets.CanDistortWater, nextProjectile); Array.Resize(ref ProjectileID.Sets.MinionShot, nextProjectile); Array.Resize(ref ProjectileID.Sets.SentryShot, nextProjectile); Array.Resize(ref ProjectileID.Sets.ForcePlateDetection, nextProjectile); Array.Resize(ref ProjectileID.Sets.TrailingMode, nextProjectile); Array.Resize(ref ProjectileID.Sets.TrailCacheLength, nextProjectile); Array.Resize(ref ProjectileID.Sets.LightPet, nextProjectile); Array.Resize(ref ProjectileID.Sets.Homing, nextProjectile); Array.Resize(ref ProjectileID.Sets.IsADD2Turret, nextProjectile); Array.Resize(ref ProjectileID.Sets.TurretFeature, nextProjectile); Array.Resize(ref ProjectileID.Sets.MinionTargettingFeature, nextProjectile); Array.Resize(ref ProjectileID.Sets.MinionSacrificable, nextProjectile); Array.Resize(ref ProjectileID.Sets.DontAttachHideToAlpha, nextProjectile); Array.Resize(ref ProjectileID.Sets.NeedsUUID, nextProjectile); Array.Resize(ref ProjectileID.Sets.StardustDragon, nextProjectile); Array.Resize(ref ProjectileID.Sets.NoLiquidDistortion, nextProjectile); for (int k = ProjectileID.Count; k < nextProjectile; k++) { Lang._projectileNameCache[k] = LocalizedText.Empty; ProjectileID.Sets.YoyosLifeTimeMultiplier[k] = -1; ProjectileID.Sets.YoyosMaximumRange[k] = 200f; ProjectileID.Sets.YoyosTopSpeed[k] = 10f; ProjectileID.Sets.CanDistortWater[k] = true; Main.projectileLoaded[k] = true; Main.projFrames[k] = 1; ProjectileID.Sets.TrailingMode[k] = -1; ProjectileID.Sets.TrailCacheLength[k] = 10; } Array.Resize(ref Projectile.perIDStaticNPCImmunity, nextProjectile); for (int i = 0; i < nextProjectile; i++) { Projectile.perIDStaticNPCImmunity[i] = new uint[200]; } InstancedGlobals = globalProjectiles.Where(g => g.InstancePerEntity).ToArray(); for (int i = 0; i < InstancedGlobals.Length; i++) { InstancedGlobals[i].instanceIndex = i; } foreach (var hook in hooks) { hook.arr = ModLoader.BuildGlobalHook(globalProjectiles, hook.method); } }
internal static void ResizeAndFillArrays(bool unloading = false) { ModLoader.BuildGlobalHook(ref HookChooseUgBgStyle, globalBgStyles, g => g.ChooseUgBgStyle); ModLoader.BuildGlobalHook(ref HookChooseSurfaceBgStyle, globalBgStyles, g => g.ChooseSurfaceBgStyle); ModLoader.BuildGlobalHook(ref HookFillUgTextureArray, globalBgStyles, g => g.FillUgTextureArray); ModLoader.BuildGlobalHook(ref HookModifyFarSurfaceFades, globalBgStyles, g => g.ModifyFarSurfaceFades); if (!unloading) { loaded = true; } }
internal static void ResizeArrays(bool unloading = false) { Array.Resize(ref Main.wallLoaded, nextWall); for (int k = WallID.Count; k < nextWall; k++) { Main.wallLoaded[k] = true; } Resize2DArray(ref Main.wallAltTexture, nextWall); Resize2DArray(ref Main.wallAltTextureInit, nextWall); Resize2DArray(ref Main.wallAltTextureDrawn, nextWall); Array.Resize(ref Main.wallTexture, nextWall); Array.Resize(ref Main.wallHouse, nextWall); Array.Resize(ref Main.wallDungeon, nextWall); Array.Resize(ref Main.wallLight, nextWall); Array.Resize(ref Main.wallBlend, nextWall); Array.Resize(ref Main.wallLargeFrames, nextWall); Array.Resize(ref Main.wallFrame, nextWall); Array.Resize(ref Main.wallFrameCounter, nextWall); Array.Resize(ref WallID.Sets.Conversion.Grass, nextWall); Array.Resize(ref WallID.Sets.Conversion.Stone, nextWall); Array.Resize(ref WallID.Sets.Conversion.Sandstone, nextWall); Array.Resize(ref WallID.Sets.Conversion.HardenedSand, nextWall); Array.Resize(ref WallID.Sets.Transparent, nextWall); Array.Resize(ref WallID.Sets.Corrupt, nextWall); Array.Resize(ref WallID.Sets.Crimson, nextWall); Array.Resize(ref WallID.Sets.Hallow, nextWall); ModLoader.BuildGlobalHook(ref HookKillSound, globalWalls, g => g.KillSound); ModLoader.BuildGlobalHook(ref HookNumDust, globalWalls, g => g.NumDust); ModLoader.BuildGlobalHook(ref HookCreateDust, globalWalls, g => g.CreateDust); ModLoader.BuildGlobalHook(ref HookDrop, globalWalls, g => g.Drop); ModLoader.BuildGlobalHook(ref HookKillWall, globalWalls, g => g.KillWall); ModLoader.BuildGlobalHook(ref HookCanExplode, globalWalls, g => g.CanExplode); ModLoader.BuildGlobalHook(ref HookModifyLight, globalWalls, g => g.ModifyLight); ModLoader.BuildGlobalHook(ref HookRandomUpdate, globalWalls, g => g.RandomUpdate); ModLoader.BuildGlobalHook(ref HookPreDraw, globalWalls, g => g.PreDraw); ModLoader.BuildGlobalHook(ref HookPostDraw, globalWalls, g => g.PostDraw); ModLoader.BuildGlobalHook(ref HookPlaceInWorld, globalWalls, g => g.PlaceInWorld); if (!unloading) { loaded = true; } }
//change initial size of Terraria.Player.npcTypeNoAggro and NPCBannerBuff to NPCLoader.NPCCount() //in Terraria.Main.MouseText replace 251 with NPCLoader.NPCCount() //in Terraria.Main.DrawNPCs and Terraria.NPC.NPCLoot remove type too high check //replace a lot of 540 immediates //in Terraria.GameContent.UI.EmoteBubble make CountNPCs internal internal static void ResizeArrays(bool unloading) { //Textures Array.Resize(ref TextureAssets.Npc, nextNPC); //Sets LoaderUtils.ReloadSets(typeof(NPCID.Sets)); //Etc Array.Resize(ref Main.townNPCCanSpawn, nextNPC); Array.Resize(ref Main.slimeRainNPC, nextNPC); Array.Resize(ref Main.npcCatchable, nextNPC); Array.Resize(ref Main.npcFrameCount, nextNPC); Array.Resize(ref NPC.killCount, nextNPC); Array.Resize(ref NPC.npcsFoundForCheckActive, nextNPC); Array.Resize(ref Lang._npcNameCache, nextNPC); Array.Resize(ref EmoteBubble.CountNPCs, nextNPC); Array.Resize(ref WorldGen.TownManager._hasRoom, nextNPC); for (int k = NPCID.Count; k < nextNPC; k++) { Main.npcFrameCount[k] = 1; Lang._npcNameCache[k] = LocalizedText.Empty; } InstancedGlobals = globalNPCs.Where(g => g.InstancePerEntity).ToArray(); for (int i = 0; i < InstancedGlobals.Length; i++) { InstancedGlobals[i].instanceIndex = i; } foreach (var hook in hooks) { hook.arr = ModLoader.BuildGlobalHook(globalNPCs, hook.method); } if (!unloading) { loaded = true; } }
//change initial size of Terraria.Player.ownedProjectileCounts to ProjectileLoader.ProjectileCount() internal static void ResizeArrays() { //Textures Array.Resize(ref TextureAssets.Projectile, nextProjectile); //Sets LoaderUtils.ResetStaticMembers(typeof(ProjectileID), true); //Etc Array.Resize(ref Main.projHostile, nextProjectile); Array.Resize(ref Main.projHook, nextProjectile); Array.Resize(ref Main.projFrames, nextProjectile); Array.Resize(ref Main.projPet, nextProjectile); Array.Resize(ref Lang._projectileNameCache, nextProjectile); for (int k = ProjectileID.Count; k < nextProjectile; k++) { Main.projFrames[k] = 1; Lang._projectileNameCache[k] = LocalizedText.Empty; } Array.Resize(ref Projectile.perIDStaticNPCImmunity, nextProjectile); for (int i = 0; i < nextProjectile; i++) { Projectile.perIDStaticNPCImmunity[i] = new uint[200]; } InstancedGlobals = globalProjectiles.Where(g => g.InstancePerEntity).ToArray(); for (int i = 0; i < InstancedGlobals.Length; i++) { InstancedGlobals[i].instanceIndex = i; } foreach (var hook in hooks) { hook.arr = ModLoader.BuildGlobalHook(globalProjectiles, hook.method); } }
internal static void ResizeArrays() { //Textures Array.Resize(ref TextureAssets.Buff, nextBuff); //Sets LoaderUtils.ResetStaticMembers(typeof(BuffID), true); //Etc Array.Resize(ref Main.pvpBuff, nextBuff); Array.Resize(ref Main.persistentBuff, nextBuff); Array.Resize(ref Main.vanityPet, nextBuff); Array.Resize(ref Main.lightPet, nextBuff); Array.Resize(ref Main.meleeBuff, nextBuff); Array.Resize(ref Main.debuff, nextBuff); Array.Resize(ref Main.buffNoSave, nextBuff); Array.Resize(ref Main.buffNoTimeDisplay, nextBuff); Array.Resize(ref Main.buffDoubleApply, nextBuff); Array.Resize(ref Main.buffAlpha, nextBuff); Array.Resize(ref Lang._buffNameCache, nextBuff); Array.Resize(ref Lang._buffDescriptionCache, nextBuff); for (int k = BuffID.Count; k < nextBuff; k++) { Lang._buffNameCache[k] = LocalizedText.Empty; Lang._buffDescriptionCache[k] = LocalizedText.Empty; } extraPlayerBuffCount = ModLoader.Mods.Any() ? ModLoader.Mods.Max(m => (int)m.ExtraPlayerBuffSlots) : 0; //Hooks ModLoader.BuildGlobalHook(ref HookUpdatePlayer, globalBuffs, g => g.Update); ModLoader.BuildGlobalHook(ref HookUpdateNPC, globalBuffs, g => g.Update); ModLoader.BuildGlobalHook(ref HookReApplyPlayer, globalBuffs, g => g.ReApply); ModLoader.BuildGlobalHook(ref HookReApplyNPC, globalBuffs, g => g.ReApply); ModLoader.BuildGlobalHook(ref HookModifyBuffTip, globalBuffs, g => g.ModifyBuffTip); ModLoader.BuildGlobalHook(ref HookCustomBuffTipSize, globalBuffs, g => g.CustomBuffTipSize); ModLoader.BuildGlobalHook(ref HookDrawCustomBuffTip, globalBuffs, g => g.DrawCustomBuffTip); }
internal static void ResizeArrays() { Array.Resize(ref Main.pvpBuff, nextBuff); Array.Resize(ref Main.persistentBuff, nextBuff); Array.Resize(ref Main.vanityPet, nextBuff); Array.Resize(ref Main.lightPet, nextBuff); Array.Resize(ref Main.meleeBuff, nextBuff); Array.Resize(ref Main.debuff, nextBuff); Array.Resize(ref Main.buffName, nextBuff); Array.Resize(ref Main.buffTip, nextBuff); Array.Resize(ref Main.buffNoSave, nextBuff); Array.Resize(ref Main.buffNoTimeDisplay, nextBuff); Array.Resize(ref Main.buffDoubleApply, nextBuff); Array.Resize(ref Main.buffAlpha, nextBuff); Array.Resize(ref Main.buffTexture, nextBuff); ModLoader.BuildGlobalHook(ref HookUpdatePlayer, globalBuffs, g => g.Update); ModLoader.BuildGlobalHook(ref HookUpdateNPC, globalBuffs, g => g.Update); ModLoader.BuildGlobalHook(ref HookReApplyPlayer, globalBuffs, g => g.ReApply); ModLoader.BuildGlobalHook(ref HookReApplyNPC, globalBuffs, g => g.ReApply); ModLoader.BuildGlobalHook(ref HookModifyBuffTip, globalBuffs, g => g.ModifyBuffTip); ModLoader.BuildGlobalHook(ref HookCustomBuffTipSize, globalBuffs, g => g.CustomBuffTipSize); ModLoader.BuildGlobalHook(ref HookDrawCustomBuffTip, globalBuffs, g => g.DrawCustomBuffTip); }
//change initial size of Terraria.Player.ownedProjectileCounts to ProjectileLoader.ProjectileCount() internal static void ResizeArrays() { Array.Resize(ref Main.projectileLoaded, nextProjectile); Array.Resize(ref Main.projectileTexture, nextProjectile); Array.Resize(ref Main.projHostile, nextProjectile); Array.Resize(ref Main.projHook, nextProjectile); Array.Resize(ref Main.projFrames, nextProjectile); Array.Resize(ref Main.projPet, nextProjectile); Array.Resize(ref ProjectileID.Sets.YoyosLifeTimeMultiplier, nextProjectile); Array.Resize(ref ProjectileID.Sets.YoyosMaximumRange, nextProjectile); Array.Resize(ref ProjectileID.Sets.YoyosTopSpeed, nextProjectile); Array.Resize(ref ProjectileID.Sets.CanDistortWater, nextProjectile); Array.Resize(ref ProjectileID.Sets.MinionShot, nextProjectile); Array.Resize(ref ProjectileID.Sets.SentryShot, nextProjectile); Array.Resize(ref ProjectileID.Sets.ForcePlateDetection, nextProjectile); Array.Resize(ref ProjectileID.Sets.TrailingMode, nextProjectile); Array.Resize(ref ProjectileID.Sets.TrailCacheLength, nextProjectile); Array.Resize(ref ProjectileID.Sets.LightPet, nextProjectile); Array.Resize(ref ProjectileID.Sets.Homing, nextProjectile); Array.Resize(ref ProjectileID.Sets.IsADD2Turret, nextProjectile); Array.Resize(ref ProjectileID.Sets.TurretFeature, nextProjectile); Array.Resize(ref ProjectileID.Sets.MinionTargettingFeature, nextProjectile); Array.Resize(ref ProjectileID.Sets.MinionSacrificable, nextProjectile); Array.Resize(ref ProjectileID.Sets.DontAttachHideToAlpha, nextProjectile); Array.Resize(ref ProjectileID.Sets.NeedsUUID, nextProjectile); Array.Resize(ref ProjectileID.Sets.StardustDragon, nextProjectile); Array.Resize(ref ProjectileID.Sets.NoLiquidDistortion, nextProjectile); for (int k = ProjectileID.Count; k < nextProjectile; k++) { ProjectileID.Sets.YoyosLifeTimeMultiplier[k] = -1; ProjectileID.Sets.YoyosMaximumRange[k] = 200f; ProjectileID.Sets.YoyosTopSpeed[k] = 10f; ProjectileID.Sets.CanDistortWater[k] = true; Main.projectileLoaded[k] = true; Main.projFrames[k] = 1; ProjectileID.Sets.TrailingMode[k] = -1; ProjectileID.Sets.TrailCacheLength[k] = 10; } Array.Resize(ref Projectile.perIDStaticNPCImmunity, nextProjectile); for (int i = 0; i < nextProjectile; i++) { Projectile.perIDStaticNPCImmunity[i] = new int[200]; } ModLoader.BuildGlobalHook(ref HookSetDefaults, globalProjectiles, g => g.SetDefaults); ModLoader.BuildGlobalHook(ref HookPreAI, globalProjectiles, g => g.PreAI); ModLoader.BuildGlobalHook(ref HookAI, globalProjectiles, g => g.AI); ModLoader.BuildGlobalHook(ref HookPostAI, globalProjectiles, g => g.PostAI); ModLoader.BuildGlobalHook(ref HookShouldUpdatePosition, globalProjectiles, g => g.ShouldUpdatePosition); ModLoader.BuildGlobalHook(ref HookTileCollideStyle, globalProjectiles, g => g.TileCollideStyle); ModLoader.BuildGlobalHook(ref HookOnTileCollide, globalProjectiles, g => g.OnTileCollide); ModLoader.BuildGlobalHook(ref HookCanCutTiles, globalProjectiles, g => g.CanCutTiles); ModLoader.BuildGlobalHook(ref HookCutTiles, globalProjectiles, g => g.CutTiles); ModLoader.BuildGlobalHook(ref HookPreKill, globalProjectiles, g => g.PreKill); ModLoader.BuildGlobalHook(ref HookKill, globalProjectiles, g => g.Kill); ModLoader.BuildGlobalHook(ref HookCanDamage, globalProjectiles, g => g.CanDamage); ModLoader.BuildGlobalHook(ref HookMinionContactDamage, globalProjectiles, g => g.MinionContactDamage); ModLoader.BuildGlobalHook(ref HookCanHitNPC, globalProjectiles, g => g.CanHitNPC); ModLoader.BuildGlobalHook(ref HookModifyHitNPC, globalProjectiles, g => g.ModifyHitNPC); ModLoader.BuildGlobalHook(ref HookOnHitNPC, globalProjectiles, g => g.OnHitNPC); ModLoader.BuildGlobalHook(ref HookCanHitPvp, globalProjectiles, g => g.CanHitPvp); ModLoader.BuildGlobalHook(ref HookModifyHitPvp, globalProjectiles, g => g.ModifyHitPvp); ModLoader.BuildGlobalHook(ref HookOnHitPvp, globalProjectiles, g => g.OnHitPvp); ModLoader.BuildGlobalHook(ref HookCanHitPlayer, globalProjectiles, g => g.CanHitPlayer); ModLoader.BuildGlobalHook(ref HookModifyHitPlayer, globalProjectiles, g => g.ModifyHitPlayer); ModLoader.BuildGlobalHook(ref HookOnHitPlayer, globalProjectiles, g => g.OnHitPlayer); ModLoader.BuildGlobalHook(ref HookColliding, globalProjectiles, g => g.Colliding); ModLoader.BuildGlobalHook(ref HookGetAlpha, globalProjectiles, g => g.GetAlpha); ModLoader.BuildGlobalHook(ref HookPreDrawExtras, globalProjectiles, g => g.PreDrawExtras); ModLoader.BuildGlobalHook(ref HookPreDraw, globalProjectiles, g => g.PreDraw); ModLoader.BuildGlobalHook(ref HookPostDraw, globalProjectiles, g => g.PostDraw); ModLoader.BuildGlobalHook(ref HookCanUseGrapple, globalProjectiles, g => g.CanUseGrapple); ModLoader.BuildGlobalHook(ref HookSingleGrappleHook, globalProjectiles, g => g.SingleGrappleHook); ModLoader.BuildGlobalHook(ref HookUseGrapple, globalProjectiles, g => g.UseGrapple); ModLoader.BuildGlobalHook(ref HookNumGrappleHooks, globalProjectiles, g => g.NumGrappleHooks); ModLoader.BuildGlobalHook(ref HookGrappleRetreatSpeed, globalProjectiles, g => g.GrappleRetreatSpeed); ModLoader.BuildGlobalHook(ref HookDrawBehind, globalProjectiles, g => g.DrawBehind); }
//change initial size of Terraria.Player.npcTypeNoAggro and NPCBannerBuff to NPCLoader.NPCCount() //in Terraria.Main.MouseText replace 251 with NPCLoader.NPCCount() //in Terraria.Main.DrawNPCs and Terraria.NPC.NPCLoot remove type too high check //replace a lot of 540 immediates //in Terraria.GameContent.UI.EmoteBubble make CountNPCs internal internal static void ResizeArrays(bool unloading) { Array.Resize(ref Main.NPCLoaded, nextNPC); Array.Resize(ref Main.townNPCCanSpawn, nextNPC); Array.Resize(ref Main.slimeRainNPC, nextNPC); Array.Resize(ref Main.npcTexture, nextNPC); Array.Resize(ref Main.npcAltTextures, nextNPC); Array.Resize(ref Main.npcCatchable, nextNPC); Array.Resize(ref Main.npcFrameCount, nextNPC); Array.Resize(ref NPC.killCount, nextNPC); Array.Resize(ref NPC.npcsFoundForCheckActive, nextNPC); Array.Resize(ref Lang._npcNameCache, nextNPC); Array.Resize(ref EmoteBubble.CountNPCs, nextNPC); Array.Resize(ref WorldGen.TownManager._hasRoom, nextNPC); Array.Resize(ref NPCID.Sets.TrailingMode, nextNPC); Array.Resize(ref NPCID.Sets.BelongsToInvasionOldOnesArmy, nextNPC); Array.Resize(ref NPCID.Sets.TeleportationImmune, nextNPC); Array.Resize(ref NPCID.Sets.UsesNewTargetting, nextNPC); Array.Resize(ref NPCID.Sets.FighterUsesDD2PortalAppearEffect, nextNPC); Array.Resize(ref NPCID.Sets.StatueSpawnedDropRarity, nextNPC); Array.Resize(ref NPCID.Sets.NoEarlymodeLootWhenSpawnedFromStatue, nextNPC); Array.Resize(ref NPCID.Sets.NeedsExpertScaling, nextNPC); Array.Resize(ref NPCID.Sets.ProjectileNPC, nextNPC); Array.Resize(ref NPCID.Sets.SavesAndLoads, nextNPC); Array.Resize(ref NPCID.Sets.TrailCacheLength, nextNPC); Array.Resize(ref NPCID.Sets.MPAllowedEnemies, nextNPC); Array.Resize(ref NPCID.Sets.TownCritter, nextNPC); Array.Resize(ref NPCID.Sets.HatOffsetY, nextNPC); Array.Resize(ref NPCID.Sets.FaceEmote, nextNPC); Array.Resize(ref NPCID.Sets.ExtraFramesCount, nextNPC); Array.Resize(ref NPCID.Sets.AttackFrameCount, nextNPC); Array.Resize(ref NPCID.Sets.DangerDetectRange, nextNPC); Array.Resize(ref NPCID.Sets.AttackTime, nextNPC); Array.Resize(ref NPCID.Sets.AttackAverageChance, nextNPC); Array.Resize(ref NPCID.Sets.AttackType, nextNPC); Array.Resize(ref NPCID.Sets.PrettySafe, nextNPC); Array.Resize(ref NPCID.Sets.MagicAuraColor, nextNPC); Array.Resize(ref NPCID.Sets.BossHeadTextures, nextNPC); Array.Resize(ref NPCID.Sets.ExcludedFromDeathTally, nextNPC); Array.Resize(ref NPCID.Sets.TechnicallyABoss, nextNPC); Array.Resize(ref NPCID.Sets.MustAlwaysDraw, nextNPC); Array.Resize(ref NPCID.Sets.ExtraTextureCount, nextNPC); Array.Resize(ref NPCID.Sets.NPCFramingGroup, nextNPC); Array.Resize(ref NPCID.Sets.TownNPCsFramingGroups, nextNPC); for (int k = NPCID.Count; k < nextNPC; k++) { Main.NPCLoaded[k] = true; Main.npcFrameCount[k] = 1; Lang._npcNameCache[k] = LocalizedText.Empty; NPCID.Sets.TrailingMode[k] = -1; NPCID.Sets.StatueSpawnedDropRarity[k] = -1f; NPCID.Sets.TrailCacheLength[k] = 10; NPCID.Sets.DangerDetectRange[k] = -1; NPCID.Sets.AttackTime[k] = -1; NPCID.Sets.AttackAverageChance[k] = 1; NPCID.Sets.AttackType[k] = -1; NPCID.Sets.PrettySafe[k] = -1; NPCID.Sets.MagicAuraColor[k] = Color.White; NPCID.Sets.BossHeadTextures[k] = -1; } InstancedGlobals = globalNPCs.Where(g => g.InstancePerEntity).ToArray(); for (int i = 0; i < InstancedGlobals.Length; i++) { InstancedGlobals[i].instanceIndex = i; } foreach (var hook in hooks) { hook.arr = ModLoader.BuildGlobalHook(globalNPCs, hook.method); } if (!unloading) { loaded = true; } }
internal static void ResizeArrays(bool unloading = false) { //Textures Array.Resize(ref TextureAssets.Tile, nextTile); Array.Resize(ref TextureAssets.HighlightMask, nextTile); //Sets LoaderUtils.ResetStaticMembers(typeof(TileID), true); //Etc Array.Resize(ref Main.SceneMetrics._tileCounts, nextTile); Array.Resize(ref Main.PylonSystem._sceneMetrics._tileCounts, nextTile); Array.Resize(ref Main.tileLighted, nextTile); Array.Resize(ref Main.tileMergeDirt, nextTile); Array.Resize(ref Main.tileCut, nextTile); Array.Resize(ref Main.tileAlch, nextTile); Array.Resize(ref Main.tileShine, nextTile); Array.Resize(ref Main.tileShine2, nextTile); Array.Resize(ref Main.tileStone, nextTile); Array.Resize(ref Main.tileAxe, nextTile); Array.Resize(ref Main.tileHammer, nextTile); Array.Resize(ref Main.tileWaterDeath, nextTile); Array.Resize(ref Main.tileLavaDeath, nextTile); Array.Resize(ref Main.tileTable, nextTile); Array.Resize(ref Main.tileBlockLight, nextTile); Array.Resize(ref Main.tileNoSunLight, nextTile); Array.Resize(ref Main.tileDungeon, nextTile); Array.Resize(ref Main.tileSpelunker, nextTile); Array.Resize(ref Main.tileSolidTop, nextTile); Array.Resize(ref Main.tileSolid, nextTile); Array.Resize(ref Main.tileBouncy, nextTile); Array.Resize(ref Main.tileLargeFrames, nextTile); Array.Resize(ref Main.tileRope, nextTile); Array.Resize(ref Main.tileBrick, nextTile); Array.Resize(ref Main.tileMoss, nextTile); Array.Resize(ref Main.tileNoAttach, nextTile); Array.Resize(ref Main.tileNoFail, nextTile); Array.Resize(ref Main.tileObsidianKill, nextTile); Array.Resize(ref Main.tileFrameImportant, nextTile); Array.Resize(ref Main.tilePile, nextTile); Array.Resize(ref Main.tileBlendAll, nextTile); Array.Resize(ref Main.tileContainer, nextTile); Array.Resize(ref Main.tileSign, nextTile); Array.Resize(ref Main.tileSand, nextTile); Array.Resize(ref Main.tileFlame, nextTile); Array.Resize(ref Main.tileFrame, nextTile); Array.Resize(ref Main.tileFrameCounter, nextTile); Array.Resize(ref Main.tileMerge, nextTile); Array.Resize(ref Main.tileOreFinderPriority, nextTile); Array.Resize(ref Main.tileGlowMask, nextTile); Array.Resize(ref Main.tileCracked, nextTile); Array.Resize(ref WorldGen.tileCounts, nextTile); Array.Resize(ref WorldGen.houseTile, nextTile); //Array.Resize(ref GameContent.Biomes.CaveHouseBiome._blacklistedTiles, nextTile); Array.Resize(ref GameContent.Biomes.CorruptionPitBiome.ValidTiles, nextTile); Array.Resize(ref HouseUtils.BlacklistedTiles, nextTile); Array.Resize(ref HouseUtils.BeelistedTiles, nextTile); for (int i = 0; i < nextTile; i++) //oh dear { Array.Resize(ref Main.tileMerge[i], nextTile); } for (int i = TileID.Count; i < nextTile; i++) { Main.tileGlowMask[i] = -1; //If we don't this, every modded tile will have a glowmask by default. } while (TileObjectData._data.Count < nextTile) { TileObjectData._data.Add(null); } //Hooks ModLoader.BuildGlobalHook(ref HookKillSound, globalTiles, g => g.KillSound); ModLoader.BuildGlobalHook(ref HookNumDust, globalTiles, g => g.NumDust); ModLoader.BuildGlobalHook(ref HookCreateDust, globalTiles, g => g.CreateDust); ModLoader.BuildGlobalHook(ref HookDropCritterChance, globalTiles, g => g.DropCritterChance); ModLoader.BuildGlobalHook(ref HookDrop, globalTiles, g => g.Drop); ModLoader.BuildGlobalHook(ref HookCanKillTile, globalTiles, g => g.CanKillTile); ModLoader.BuildGlobalHook(ref HookKillTile, globalTiles, g => g.KillTile); ModLoader.BuildGlobalHook(ref HookCanExplode, globalTiles, g => g.CanExplode); ModLoader.BuildGlobalHook(ref HookNearbyEffects, globalTiles, g => g.NearbyEffects); ModLoader.BuildGlobalHook(ref HookModifyLight, globalTiles, g => g.ModifyLight); ModLoader.BuildGlobalHook(ref HookDangersense, globalTiles, g => g.Dangersense); ModLoader.BuildGlobalHook(ref HookSetSpriteEffects, globalTiles, g => g.SetSpriteEffects); ModLoader.BuildGlobalHook(ref HookAnimateTile, globalTiles, g => g.AnimateTile); ModLoader.BuildGlobalHook(ref HookPreDraw, globalTiles, g => g.PreDraw); ModLoader.BuildGlobalHook(ref HookDrawEffects, globalTiles, g => g.DrawEffects); ModLoader.BuildGlobalHook(ref HookPostDraw, globalTiles, g => g.PostDraw); ModLoader.BuildGlobalHook(ref HookSpecialDraw, globalTiles, g => g.SpecialDraw); ModLoader.BuildGlobalHook(ref HookRandomUpdate, globalTiles, g => g.RandomUpdate); ModLoader.BuildGlobalHook(ref HookTileFrame, globalTiles, g => g.TileFrame); ModLoader.BuildGlobalHook(ref HookCanPlace, globalTiles, g => g.CanPlace); ModLoader.BuildGlobalHook(ref HookAdjTiles, globalTiles, g => g.AdjTiles); ModLoader.BuildGlobalHook(ref HookRightClick, globalTiles, g => g.RightClick); ModLoader.BuildGlobalHook(ref HookMouseOver, globalTiles, g => g.MouseOver); ModLoader.BuildGlobalHook(ref HookMouseOverFar, globalTiles, g => g.MouseOverFar); ModLoader.BuildGlobalHook(ref HookAutoSelect, globalTiles, g => g.AutoSelect); ModLoader.BuildGlobalHook(ref HookPreHitWire, globalTiles, g => g.PreHitWire); ModLoader.BuildGlobalHook(ref HookHitWire, globalTiles, g => g.HitWire); ModLoader.BuildGlobalHook(ref HookSlope, globalTiles, g => g.Slope); ModLoader.BuildGlobalHook(ref HookFloorVisuals, globalTiles, g => g.FloorVisuals); ModLoader.BuildGlobalHook(ref HookChangeWaterfallStyle, globalTiles, g => g.ChangeWaterfallStyle); ModLoader.BuildGlobalHook(ref HookSaplingGrowthType, globalTiles, g => g.SaplingGrowthType); ModLoader.BuildGlobalHook(ref HookPlaceInWorld, globalTiles, g => g.PlaceInWorld); if (!unloading) { loaded = true; } }
internal static void ResizeArrays() { NetWorlds = ModLoader.BuildGlobalHook <ModWorld, Action <BinaryWriter> >(worlds, w => w.NetSend); }
internal static void ResizeArrays(bool unloading = false) { Array.Resize(ref Main.tileSetsLoaded, nextTile); for (int k = TileID.Count; k < nextTile; k++) { Main.tileSetsLoaded[k] = true; } Array.Resize(ref Main.highlightMaskTexture, nextTile); Resize2DArray(ref Main.tileAltTexture, nextTile); Resize2DArray(ref Main.tileAltTextureInit, nextTile); Resize2DArray(ref Main.tileAltTextureDrawn, nextTile); Array.Resize(ref Main.tileTexture, nextTile); Array.Resize(ref Main.tileLighted, nextTile); Array.Resize(ref Main.tileMergeDirt, nextTile); Array.Resize(ref Main.tileCut, nextTile); Array.Resize(ref Main.tileAlch, nextTile); Array.Resize(ref Main.tileShine, nextTile); Array.Resize(ref Main.tileShine2, nextTile); Array.Resize(ref Main.tileStone, nextTile); Array.Resize(ref Main.tileAxe, nextTile); Array.Resize(ref Main.tileHammer, nextTile); Array.Resize(ref Main.tileWaterDeath, nextTile); Array.Resize(ref Main.tileLavaDeath, nextTile); Array.Resize(ref Main.tileTable, nextTile); Array.Resize(ref Main.tileBlockLight, nextTile); Array.Resize(ref Main.tileNoSunLight, nextTile); Array.Resize(ref Main.tileDungeon, nextTile); Array.Resize(ref Main.tileSpelunker, nextTile); Array.Resize(ref Main.tileSolidTop, nextTile); Array.Resize(ref Main.tileSolid, nextTile); Array.Resize(ref Main.tileBouncy, nextTile); Array.Resize(ref Main.tileValue, nextTile); Array.Resize(ref Main.tileLargeFrames, nextTile); Array.Resize(ref Main.tileRope, nextTile); Array.Resize(ref Main.tileBrick, nextTile); Array.Resize(ref Main.tileMoss, nextTile); Array.Resize(ref Main.tileNoAttach, nextTile); Array.Resize(ref Main.tileNoFail, nextTile); Array.Resize(ref Main.tileObsidianKill, nextTile); Array.Resize(ref Main.tileFrameImportant, nextTile); Array.Resize(ref Main.tilePile, nextTile); Array.Resize(ref Main.tileBlendAll, nextTile); Array.Resize(ref Main.tileGlowMask, nextTile); Array.Resize(ref Main.tileContainer, nextTile); Array.Resize(ref Main.tileSign, nextTile); Array.Resize(ref Main.tileMerge, nextTile); for (int k = 0; k < nextTile; k++) //oh dear { Array.Resize(ref Main.tileMerge[k], nextTile); } Array.Resize(ref Main.tileSand, nextTile); Array.Resize(ref Main.tileFlame, nextTile); Array.Resize(ref Main.tileFrame, nextTile); Array.Resize(ref Main.tileFrameCounter, nextTile); Array.Resize(ref Main.screenTileCounts, nextTile); Array.Resize(ref WorldGen.tileCounts, nextTile); Array.Resize(ref WorldGen.houseTile, nextTile); Array.Resize(ref GameContent.Biomes.CaveHouseBiome._blacklistedTiles, nextTile); Array.Resize(ref GameContent.Biomes.CorruptionPitBiome.ValidTiles, nextTile); Array.Resize(ref TileID.Sets.Conversion.Grass, nextTile); Array.Resize(ref TileID.Sets.Conversion.Stone, nextTile); Array.Resize(ref TileID.Sets.Conversion.Ice, nextTile); Array.Resize(ref TileID.Sets.Conversion.Sand, nextTile); Array.Resize(ref TileID.Sets.Conversion.HardenedSand, nextTile); Array.Resize(ref TileID.Sets.Conversion.Sandstone, nextTile); Array.Resize(ref TileID.Sets.Conversion.Thorn, nextTile); Array.Resize(ref TileID.Sets.Conversion.Moss, nextTile); Array.Resize(ref TileID.Sets.Platforms, nextTile); Array.Resize(ref TileID.Sets.GemsparkFramingTypes, nextTile); Array.Resize(ref TileID.Sets.TeamTiles, nextTile); Array.Resize(ref TileID.Sets.ConveyorDirection, nextTile); Array.Resize(ref TileID.Sets.HasSlopeFrames, nextTile); Array.Resize(ref TileID.Sets.TileInteractRead, nextTile); Array.Resize(ref TileID.Sets.HasOutlines, nextTile); Array.Resize(ref TileID.Sets.AllTiles, nextTile); Array.Resize(ref TileID.Sets.Mud, nextTile); Array.Resize(ref TileID.Sets.Snow, nextTile); Array.Resize(ref TileID.Sets.Ices, nextTile); Array.Resize(ref TileID.Sets.IcesSlush, nextTile); Array.Resize(ref TileID.Sets.IcesSnow, nextTile); Array.Resize(ref TileID.Sets.GrassSpecial, nextTile); Array.Resize(ref TileID.Sets.JungleSpecial, nextTile); Array.Resize(ref TileID.Sets.HellSpecial, nextTile); Array.Resize(ref TileID.Sets.Leaves, nextTile); Array.Resize(ref TileID.Sets.GeneralPlacementTiles, nextTile); Array.Resize(ref TileID.Sets.CanBeClearedDuringGeneration, nextTile); Array.Resize(ref TileID.Sets.Corrupt, nextTile); Array.Resize(ref TileID.Sets.Hallow, nextTile); Array.Resize(ref TileID.Sets.Crimson, nextTile); Array.Resize(ref TileID.Sets.BlocksStairs, nextTile); Array.Resize(ref TileID.Sets.BlocksStairsAbove, nextTile); Array.Resize(ref TileID.Sets.NotReallySolid, nextTile); Array.Resize(ref TileID.Sets.ChecksForMerge, nextTile); Array.Resize(ref TileID.Sets.FramesOnKillWall, nextTile); Array.Resize(ref TileID.Sets.AvoidedByNPCs, nextTile); Array.Resize(ref TileID.Sets.InteractibleByNPCs, nextTile); Array.Resize(ref TileID.Sets.HousingWalls, nextTile); Array.Resize(ref TileID.Sets.BreakableWhenPlacing, nextTile); Array.Resize(ref TileID.Sets.TouchDamageVines, nextTile); Array.Resize(ref TileID.Sets.TouchDamageSands, nextTile); Array.Resize(ref TileID.Sets.TouchDamageHot, nextTile); Array.Resize(ref TileID.Sets.TouchDamageOther, nextTile); Array.Resize(ref TileID.Sets.Falling, nextTile); Array.Resize(ref TileID.Sets.Ore, nextTile); Array.Resize(ref TileID.Sets.ForceObsidianKill, nextTile); for (int k = TileID.Count; k < nextTile; k++) { TileID.Sets.AllTiles[k] = true; TileID.Sets.GeneralPlacementTiles[k] = true; TileID.Sets.CanBeClearedDuringGeneration[k] = true; } while (TileObjectData._data.Count < nextTile) { TileObjectData._data.Add(null); } ModLoader.BuildGlobalHook(ref HookKillSound, globalTiles, g => g.KillSound); ModLoader.BuildGlobalHook(ref HookNumDust, globalTiles, g => g.NumDust); ModLoader.BuildGlobalHook(ref HookCreateDust, globalTiles, g => g.CreateDust); ModLoader.BuildGlobalHook(ref HookDropCritterChance, globalTiles, g => g.DropCritterChance); ModLoader.BuildGlobalHook(ref HookDrop, globalTiles, g => g.Drop); ModLoader.BuildGlobalHook(ref HookCanKillTile, globalTiles, g => g.CanKillTile); ModLoader.BuildGlobalHook(ref HookKillTile, globalTiles, g => g.KillTile); ModLoader.BuildGlobalHook(ref HookCanExplode, globalTiles, g => g.CanExplode); ModLoader.BuildGlobalHook(ref HookNearbyEffects, globalTiles, g => g.NearbyEffects); ModLoader.BuildGlobalHook(ref HookModifyLight, globalTiles, g => g.ModifyLight); ModLoader.BuildGlobalHook(ref HookDangersense, globalTiles, g => g.Dangersense); ModLoader.BuildGlobalHook(ref HookSetSpriteEffects, globalTiles, g => g.SetSpriteEffects); ModLoader.BuildGlobalHook(ref HookAnimateTile, globalTiles, g => g.AnimateTile); ModLoader.BuildGlobalHook(ref HookPreDraw, globalTiles, g => g.PreDraw); ModLoader.BuildGlobalHook(ref HookDrawEffects, globalTiles, g => g.DrawEffects); ModLoader.BuildGlobalHook(ref HookPostDraw, globalTiles, g => g.PostDraw); ModLoader.BuildGlobalHook(ref HookRandomUpdate, globalTiles, g => g.RandomUpdate); ModLoader.BuildGlobalHook(ref HookTileFrame, globalTiles, g => g.TileFrame); ModLoader.BuildGlobalHook(ref HookCanPlace, globalTiles, g => g.CanPlace); ModLoader.BuildGlobalHook(ref HookAdjTiles, globalTiles, g => g.AdjTiles); ModLoader.BuildGlobalHook(ref HookRightClick, globalTiles, g => g.RightClick); ModLoader.BuildGlobalHook(ref HookMouseOver, globalTiles, g => g.MouseOver); ModLoader.BuildGlobalHook(ref HookMouseOverFar, globalTiles, g => g.MouseOverFar); ModLoader.BuildGlobalHook(ref HookAutoSelect, globalTiles, g => g.AutoSelect); ModLoader.BuildGlobalHook(ref HookHitWire, globalTiles, g => g.HitWire); ModLoader.BuildGlobalHook(ref HookSlope, globalTiles, g => g.Slope); ModLoader.BuildGlobalHook(ref HookChangeWaterfallStyle, globalTiles, g => g.ChangeWaterfallStyle); ModLoader.BuildGlobalHook(ref HookSaplingGrowthType, globalTiles, g => g.SaplingGrowthType); if (!unloading) { loaded = true; } }
internal static void ResizeArrays() { NetSystems = ModLoader.BuildGlobalHook <ModSystem, Action <BinaryWriter> >(Systems, s => s.NetSend); RebuildHooks(); }