public override void Initialize(EntityProperties properties, ICoreAPI api, long InChunkIndex3d) { // Temporary code for VS 1.15 dev team to remove previously created "land" salmon which don't have the correct entity if (properties.Habitat == EnumHabitat.Underwater && !(this.GetType().Name == "EntityFish")) { this.Alive = false; } base.Initialize(properties, api, InChunkIndex3d); if (World.Side == EnumAppSide.Server) { servercontrols = controls; } WatchedAttributes.RegisterModifiedListener("mountedOn", updateMountedState); if (WatchedAttributes["mountedOn"] != null) { MountedOn = World.ClassRegistry.CreateMountable(WatchedAttributes["mountedOn"] as TreeAttribute); if (MountedOn != null) { TryMount(MountedOn); } } }
/// <summary> /// Copies the controls from the provided controls to this set of controls. /// </summary> /// <param name="controls">The controls to copy over.</param> public void SetFrom(EntityControls controls) { for (int i = 0; i < controls.flags.Length; i++) { flags[i] = controls.flags[i]; } FlyMode = controls.FlyMode; FlyPlaneLock = controls.FlyPlaneLock; IsFlying = controls.IsFlying; NoClip = controls.NoClip; }
public override void Initialize(EntityProperties properties, ICoreAPI api, long InChunkIndex3d) { base.Initialize(properties, api, InChunkIndex3d); if (World.Side == EnumAppSide.Server) { servercontrols = controls; } if (WatchedAttributes["mountedOn"] != null) { MountedOn = World.ClassRegistry.CreateMountable(WatchedAttributes["mountedOn"] as TreeAttribute); if (MountedOn != null) { MountedOn.DidMount(this); } } }
public EntityAgent() : base() { controls = new EntityControls(); servercontrols = new EntityControls(); }