use of org.apollo.game.model.area.collision.CollisionUpdateListener in project apollo by apollo-rsps.
the class World method init.
/**
* Initialises the world by loading definitions from the specified file
* system.
*
* @param release The release number.
* @param fs The file system.
* @param manager The plugin manager. TODO move this.
* @throws Exception If there was a failure when loading plugins.
*/
public void init(int release, IndexedFileSystem fs, PluginManager manager) throws Exception {
releaseNumber = release;
SynchronousDecoder firstStageDecoder = new SynchronousDecoder(new NpcDefinitionDecoder(fs), new ItemDefinitionDecoder(fs), new ObjectDefinitionDecoder(fs), new MapIndexDecoder(fs), EquipmentDefinitionParser.fromFile("data/equipment-" + release + "" + ".dat"));
firstStageDecoder.block();
SynchronousDecoder secondStageDecoder = new SynchronousDecoder(new WorldObjectsDecoder(fs, this, regions), new WorldMapDecoder(fs, collisionManager));
secondStageDecoder.block();
// Build collision matrices for the first time
collisionManager.build(false);
regions.addRegionListener(new CollisionUpdateListener(collisionManager));
// Must be exactly here because of ordering issues.
npcMovement = new NpcMovementTask(collisionManager);
scheduler.schedule(npcMovement);
manager.start();
commandDispatcher.init(manager.getAuthors());
pluginManager = manager;
}
Aggregations