/// <summary> /// A function called to make sure an event gets notificated for changes in a subevent. /// </summary> /// <example>A SetBlocksEvent calls parent.update() (parent most likely is a ProcessPacketEvent) when the SetBlocksEvent gets cancelled.</example> public override void update() { foreach (BaseEvent _event in this.subevents) { _event.update(); if (_event is ICancellable) { if ((_event as ICancellable).IsCancelled == true) { IsCancelled = true; } } if (_event is Events.Environment.SetBlocksEvent) { List <BlockChangeInfo> listBlockPosType = new List <BlockChangeInfo>(); listBlockPosType.AddRange((_event as Events.Environment.SetBlocksEvent).BlockChangeInfos); packet.GetType().GetField("fd0000").SetValue(packet, listBlockPosType); } if (_event is Events.Entities.EntityMoveEvent) { Events.Entities.EntityMoveEvent __event = (_event as Events.Entities.EntityMoveEvent); packet.GetType().GetField("pos").SetValue(packet, __event.Pos); packet.GetType().GetField("rot").SetValue(packet, __event.Rot); } } }
/// <summary> /// A function called to make sure an event gets notificated for changes in a subevent. /// </summary> /// <example>A SetBlocksEvent calls parent.update() (parent most likely is a ProcessPacketEvent) when the SetBlocksEvent gets cancelled.</example> public override void update() { foreach (BaseEvent _event in this.subevents) { _event.update(); if (_event is ICancellable) { if ((_event as ICancellable).IsCancelled == true) { IsCancelled = true; } } if (_event is Events.Entities.EntityMoveEvent) { Events.Entities.EntityMoveEvent __event = (_event as Events.Entities.EntityMoveEvent); packet.GetType().GetField("pos").SetValue(packet, __event.Pos); packet.GetType().GetField("rot").SetValue(packet, __event.Rot); } } }