-
Notifications
You must be signed in to change notification settings - Fork 14
OreSpawn 3 Simple Integration
dshadowwolf edited this page Jul 13, 2018
·
1 revision
The easiest way to use MMD OreSpawn to generate your ore spawns:
- Create one or more JSON configs (see Json Documentation)
- Put them in your assets directory (
src/main/resources/assets/<your-mod-id>
) in a sub-directory named something you've chosen, make note of this - Add the MMD Maven to your build.gradle
maven {
name 'MMD'
url 'https://maven.mcmoddev.com/'
}
- Add MMD OreSpawn to your build.gradle as a build-dep
deobfCompile "com.mcmoddev:OreSpawn:${mc_version}-${orespawn_version}"
- Add a class to your mod, implementing IOreSpawnPlugin and annotated with @OreSpawnPlugin a) this requires two parameters - your mod id and the name of the directory where you put the JSON files b) you can leave the implementation otherwise blank - just see the BaseMetals source c) a basic skeleton of the minimal integration class is:
import com.mcmoddev.orespawn.api.os3.OS3API;
import com.mcmoddev.orespawn.api.plugin.IOreSpawnPlugin;
import com.mcmoddev.orespawn.api.plugin.OreSpawnPlugin;
@OreSpawnPlugin(modid = <your modId>, resourcePath = <directory in your assets where you put the files>)
public class OreSpawnIntegration implements IOreSpawnPlugin {
@Override
public void register(final OS3API apiInterface) {
// nothing for us to do - all of our ores are in the
// jar and the code handles that
}
}
- Optionally add MMD OreSpawn to the dependencies in your mods @Mod annotation
There is a more complex, programmatic method that can be used - but at this time the API is not considered fully stable and because of that is not fully documented.