Beispiel #1
0
 private void OnWorldLoaded(WorldLoadEventArgs e)
 {
     foreach (EventListener bl in Plugins)
     {
         IWorldListener ll = (IWorldListener)bl.Listener;
         if (bl.Event == Event.WorldLoad)
             ll.OnWorldLoaded(e);
     }
 }
Beispiel #2
0
        internal bool Load()
        {
            EnsureDirectory();

            //Event
            WorldLoadEventArgs e = new WorldLoadEventArgs(this);
            Server.PluginManager.CallEvent(Event.WorldLoad, e);
            if (e.EventCanceled) return false;
            //End Event

            _chunkProvider = new ChunkProvider(this);
            _generator = _chunkProvider.GetNewGenerator("Default", GetSeed());
            PhysicsBlocks = new ConcurrentDictionary<int, BaseFallingPhysics>();

            if (_generator == null)
            {
                Logger.Log(LogLevel.Error,
                           "No ChunkGenerator found in the Plugins folder! Add the default one from CustomGenerator project and then restart the server.");
                return false;
            }

            InitializeSpawn();
            InitializeWeather();
            Running = true;
            return true;
        }