Skip to content

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:

  1. Create one or more JSON configs (see Json Documentation)
  2. 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
  3. Add the MMD Maven to your build.gradle
  maven {
    name 'MMD'
    url 'https://maven.mcmoddev.com/'
  }
  1. Add MMD OreSpawn to your build.gradle as a build-dep
  deobfCompile "com.mcmoddev:OreSpawn:${mc_version}-${orespawn_version}"
  1. 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
	}
}
  1. 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.