Skip to content

Resolve "Allow mods to add new maps to be preloaded"

hazel requested to merge hazel_meow/isleward:466-modmaps-2 into v0.3.1-rebased

Closes #466 (closed)

Allows mods to hook onBeforeGetMapList and add an object. The map object should have a string name (becomes the thread's name as well) and a path. The path is from src/server to the directory that holds the map directory.

Example: my mod is in src/server/mods/abcd. My mod has a folder (src/server/mods/abcd/maps) that has another folder (src/server/mods/abcd/maps/testmap) which is a map. In my mod index.js, I listen for onBeforeGetMapList and append to the list this object:

{
    name: 'testmap'
    path: 'mods/abcd/maps' // the directory that holds all your maps, relative to src/server
}

Credit to googz for !293 (closed) and me !295 (closed)

Merge request reports