private void OnPlace(BlockPlaceEventArgs e) { foreach (EventListener el in Plugins) { if (el.Event == Event.BlockPlace) { IBlockListener l = el.Listener as IBlockListener; l.OnPlace(e); } } }
/// <summary> /// Raises the block placement event /// </summary> /// <param name="entity">entity who placed the block</param> /// <param name="block">block that has been placed</param> /// <returns>resulting event args</returns> protected virtual bool RaisePlaceEvent(IEntityBase entity, StructBlock block) { BlockPlaceEventArgs e = new BlockPlaceEventArgs(this, entity); block.World.Server.PluginManager.CallEvent(Event.BlockPlace, e); // Destruction made not by the living can not be interrupted? if (entity == null) return true; return !e.EventCanceled; }