
[SUGGESTION] Recipes based on BiomeID and DimID
RenanVieira88 opened this issue ยท 2 comments
You can use the RecipeCheckEvent:
import mods.modularmachinery.RecipeCheckEvent;
// RecipeBuilder...
.addCheckHandler(function(event as RecipeCheckEvent) {
val ctrl = event.controller;
val world = ctrl.world;
// matches dimensionId... (Example: Overworld)
if (!world.dimension != 0) {
// Logic if does not match the dimension.
event.setFailed("Cause by ....");
}
// matches dimensionName...(Example: world)
if (!world.dimensionType.contains("world")) {
// Logic if does not match the dimension.
event.setFailed("Cause by ....");
}
val biome = world.getBiome(ctrl.pos);
if (!biome.id.contains("biomeID")) {
// Logic if does not match the biome.
event.setFailed("Cause by ....");
}
})