//////////////// public void WireHit(int i, int j) { var myworld = ModContent.GetInstance <EmittersWorld>(); var x = (ushort)i; var y = (ushort)j; EmitterDefinition edef = myworld.GetEmitter(x, y); SoundEmitterDefinition sdef = myworld.GetSoundEmitter(x, y); HologramDefinition hdef = myworld.GetHologram(x, y); if (edef != null) { if (EmittersConfig.Instance.DebugModeInfo) { Main.NewText("Toggling emitter at " + x + ", " + y + " " + (edef.IsActivated?"off":"on")); } edef.Activate(!edef.IsActivated); } if (sdef != null) { if (EmittersConfig.Instance.DebugModeInfo) { Main.NewText("Toggling sound emitter at " + x + ", " + y + " " + (sdef.IsActivated?"off":"on")); } sdef.Activate(!sdef.IsActivated); } if (hdef != null) { if (EmittersConfig.Instance.DebugModeInfo) { Main.NewText("Toggling hologram at " + x + ", " + y + " " + (hdef.IsActivated?"off":"on")); } hdef.Activate(!hdef.IsActivated); } }
protected override void ReceiveOnServer(int fromWho) { var myworld = ModContent.GetInstance <EmittersWorld>(); HologramDefinition def = myworld.GetHologram(this.TileX, this.TileY); def.Activate(this.IsActivated); }