2018-10-16 01:36:30 +02:00
|
|
|
package de.ellpeck.naturesaura.recipes;
|
|
|
|
|
2018-11-12 01:29:33 +01:00
|
|
|
import de.ellpeck.naturesaura.api.NaturesAuraAPI;
|
2020-10-24 15:58:38 +02:00
|
|
|
import de.ellpeck.naturesaura.api.misc.WeatherType;
|
2020-04-29 16:38:50 +02:00
|
|
|
import de.ellpeck.naturesaura.api.misc.WeightedOre;
|
2021-12-04 19:17:21 +01:00
|
|
|
import net.minecraft.resources.ResourceLocation;
|
|
|
|
import net.minecraft.world.entity.EntityType;
|
|
|
|
import net.minecraft.world.item.ItemStack;
|
|
|
|
import net.minecraft.world.item.Items;
|
|
|
|
import net.minecraft.world.item.crafting.Recipe;
|
|
|
|
import net.minecraft.world.item.crafting.RecipeSerializer;
|
|
|
|
import net.minecraft.world.level.block.Blocks;
|
2023-02-15 23:45:50 +01:00
|
|
|
import net.minecraftforge.registries.ForgeRegistries;
|
2018-12-31 17:32:38 +01:00
|
|
|
|
2020-04-29 00:24:07 +02:00
|
|
|
import java.util.List;
|
2019-02-24 11:49:45 +01:00
|
|
|
|
2020-04-29 16:38:50 +02:00
|
|
|
public final class ModRecipes {
|
2018-10-16 01:36:30 +02:00
|
|
|
|
2021-12-04 19:17:21 +01:00
|
|
|
public static final RecipeType<AltarRecipe> ALTAR_TYPE = new RecipeType<>();
|
2022-06-27 15:24:04 +02:00
|
|
|
public static final RecipeSerializer<AltarRecipe> ALTAR_SERIALIZER = new AltarRecipe.Serializer();
|
2020-04-29 00:11:43 +02:00
|
|
|
|
2021-12-04 19:17:21 +01:00
|
|
|
public static final RecipeType<AnimalSpawnerRecipe> ANIMAL_SPAWNER_TYPE = new RecipeType<>();
|
|
|
|
public static final RecipeSerializer<AnimalSpawnerRecipe> ANIMAL_SPAWNER_SERIALIZER = new AnimalSpawnerRecipe.Serializer();
|
2018-10-18 13:34:37 +02:00
|
|
|
|
2021-12-04 19:17:21 +01:00
|
|
|
public static final RecipeType<OfferingRecipe> OFFERING_TYPE = new RecipeType<>();
|
|
|
|
public static final RecipeSerializer<OfferingRecipe> OFFERING_SERIALIZER = new OfferingRecipe.Serializer();
|
2018-10-31 01:17:58 +01:00
|
|
|
|
2021-12-04 19:17:21 +01:00
|
|
|
public static final RecipeType<TreeRitualRecipe> TREE_RITUAL_TYPE = new RecipeType<>();
|
|
|
|
public static final RecipeSerializer<TreeRitualRecipe> TREE_RITUAL_SERIALIZER = new TreeRitualRecipe.Serializer();
|
2018-11-20 19:59:18 +01:00
|
|
|
|
2020-04-29 16:38:50 +02:00
|
|
|
public static void init() {
|
2018-11-20 19:59:18 +01:00
|
|
|
NaturesAuraAPI.BOTANIST_PICKAXE_CONVERSIONS.put(
|
2021-12-04 19:17:21 +01:00
|
|
|
Blocks.COBBLESTONE.defaultBlockState(),
|
|
|
|
Blocks.MOSSY_COBBLESTONE.defaultBlockState());
|
2018-11-20 19:59:18 +01:00
|
|
|
NaturesAuraAPI.BOTANIST_PICKAXE_CONVERSIONS.put(
|
2021-12-04 19:17:21 +01:00
|
|
|
Blocks.STONE_BRICKS.defaultBlockState(),
|
|
|
|
Blocks.MOSSY_STONE_BRICKS.defaultBlockState());
|
2019-02-01 17:42:59 +01:00
|
|
|
NaturesAuraAPI.BOTANIST_PICKAXE_CONVERSIONS.put(
|
2021-12-04 19:17:21 +01:00
|
|
|
Blocks.COBBLESTONE_WALL.defaultBlockState(),
|
|
|
|
Blocks.MOSSY_COBBLESTONE_WALL.defaultBlockState());
|
2020-01-22 20:31:09 +01:00
|
|
|
NaturesAuraAPI.BOTANIST_PICKAXE_CONVERSIONS.put(
|
2021-12-04 19:17:21 +01:00
|
|
|
Blocks.STONE_BRICK_WALL.defaultBlockState(),
|
|
|
|
Blocks.MOSSY_STONE_BRICK_WALL.defaultBlockState());
|
2018-11-20 19:59:18 +01:00
|
|
|
|
2022-06-27 15:24:04 +02:00
|
|
|
ModRecipes.ore(NaturesAuraAPI.OVERWORLD_ORES, "ores/coal", 5000);
|
|
|
|
ModRecipes.ore(NaturesAuraAPI.NETHER_ORES, "ores/nether/coal", 5000);
|
|
|
|
ModRecipes.ore(NaturesAuraAPI.OVERWORLD_ORES, "ores/iron", 3000);
|
|
|
|
ModRecipes.ore(NaturesAuraAPI.NETHER_ORES, "ores/nether/iron", 3000);
|
|
|
|
ModRecipes.ore(NaturesAuraAPI.OVERWORLD_ORES, "ores/gold", 500);
|
|
|
|
ModRecipes.ore(NaturesAuraAPI.NETHER_ORES, "ores/nether/gold", 500);
|
|
|
|
ModRecipes.ore(NaturesAuraAPI.OVERWORLD_ORES, "ores/diamond", 50);
|
|
|
|
ModRecipes.ore(NaturesAuraAPI.NETHER_ORES, "ores/nether/diamond", 50);
|
|
|
|
ModRecipes.ore(NaturesAuraAPI.OVERWORLD_ORES, "ores/lapis", 250);
|
|
|
|
ModRecipes.ore(NaturesAuraAPI.NETHER_ORES, "ores/nether/lapis", 250);
|
|
|
|
ModRecipes.ore(NaturesAuraAPI.OVERWORLD_ORES, "ores/redstone", 200);
|
|
|
|
ModRecipes.ore(NaturesAuraAPI.NETHER_ORES, "ores/nether/redstone", 200);
|
|
|
|
ModRecipes.ore(NaturesAuraAPI.OVERWORLD_ORES, "ores/emerald", 30);
|
|
|
|
ModRecipes.ore(NaturesAuraAPI.NETHER_ORES, "ores/nether/emerald", 30);
|
|
|
|
ModRecipes.ore(NaturesAuraAPI.NETHER_ORES, "ores/quartz", 8000);
|
|
|
|
ModRecipes.ore(NaturesAuraAPI.NETHER_ORES, "ores/netherite_scrap", 30);
|
|
|
|
|
|
|
|
ModRecipes.ore(NaturesAuraAPI.OVERWORLD_ORES, "ores/copper", 2000);
|
|
|
|
ModRecipes.ore(NaturesAuraAPI.NETHER_ORES, "ores/nether/copper", 2000);
|
|
|
|
ModRecipes.ore(NaturesAuraAPI.OVERWORLD_ORES, "ores/tin", 1800);
|
|
|
|
ModRecipes.ore(NaturesAuraAPI.NETHER_ORES, "ores/nether/tin", 1800);
|
|
|
|
ModRecipes.ore(NaturesAuraAPI.OVERWORLD_ORES, "ores/lead", 1500);
|
|
|
|
ModRecipes.ore(NaturesAuraAPI.NETHER_ORES, "ores/nether/lead", 1500);
|
|
|
|
ModRecipes.ore(NaturesAuraAPI.OVERWORLD_ORES, "ores/silver", 1000);
|
|
|
|
ModRecipes.ore(NaturesAuraAPI.NETHER_ORES, "ores/nether/silver", 1000);
|
|
|
|
ModRecipes.ore(NaturesAuraAPI.OVERWORLD_ORES, "ores/nickel", 100);
|
|
|
|
ModRecipes.ore(NaturesAuraAPI.NETHER_ORES, "ores/nether/nickel", 100);
|
|
|
|
ModRecipes.ore(NaturesAuraAPI.OVERWORLD_ORES, "ores/platinum", 20);
|
|
|
|
ModRecipes.ore(NaturesAuraAPI.NETHER_ORES, "ores/nether/platinum", 20);
|
|
|
|
ModRecipes.ore(NaturesAuraAPI.OVERWORLD_ORES, "ores/aluminum", 1200);
|
|
|
|
ModRecipes.ore(NaturesAuraAPI.OVERWORLD_ORES, "ores/aluminium", 1200);
|
|
|
|
ModRecipes.ore(NaturesAuraAPI.OVERWORLD_ORES, "ores/osmium", 1500);
|
|
|
|
ModRecipes.ore(NaturesAuraAPI.OVERWORLD_ORES, "ores/zinc", 1000);
|
|
|
|
ModRecipes.ore(NaturesAuraAPI.OVERWORLD_ORES, "ores/yellorite", 1200);
|
|
|
|
ModRecipes.ore(NaturesAuraAPI.OVERWORLD_ORES, "ores/uranium", 400);
|
|
|
|
ModRecipes.ore(NaturesAuraAPI.OVERWORLD_ORES, "ores/apatite", 700);
|
|
|
|
ModRecipes.ore(NaturesAuraAPI.OVERWORLD_ORES, "ores/ruby", 40);
|
|
|
|
ModRecipes.ore(NaturesAuraAPI.OVERWORLD_ORES, "ores/peridot", 40);
|
|
|
|
ModRecipes.ore(NaturesAuraAPI.OVERWORLD_ORES, "ores/topaz", 40);
|
|
|
|
ModRecipes.ore(NaturesAuraAPI.OVERWORLD_ORES, "ores/tanzanite", 40);
|
|
|
|
ModRecipes.ore(NaturesAuraAPI.OVERWORLD_ORES, "ores/malachite", 40);
|
|
|
|
ModRecipes.ore(NaturesAuraAPI.OVERWORLD_ORES, "ores/sapphire", 40);
|
|
|
|
ModRecipes.ore(NaturesAuraAPI.OVERWORLD_ORES, "ores/amber", 150);
|
|
|
|
ModRecipes.ore(NaturesAuraAPI.OVERWORLD_ORES, "ores/resonating", 50);
|
|
|
|
ModRecipes.ore(NaturesAuraAPI.OVERWORLD_ORES, "ores/sulfur", 600);
|
|
|
|
ModRecipes.ore(NaturesAuraAPI.OVERWORLD_ORES, "ores/saltpeter", 250);
|
|
|
|
ModRecipes.ore(NaturesAuraAPI.NETHER_ORES, "ores/firestone", 30);
|
|
|
|
ModRecipes.ore(NaturesAuraAPI.OVERWORLD_ORES, "ores/salt", 2900);
|
|
|
|
ModRecipes.ore(NaturesAuraAPI.OVERWORLD_ORES, "ores/draconium", 5);
|
|
|
|
ModRecipes.ore(NaturesAuraAPI.NETHER_ORES, "ores/cobalt", 50);
|
|
|
|
ModRecipes.ore(NaturesAuraAPI.NETHER_ORES, "ores/ardite", 50);
|
2019-03-12 19:34:59 +01:00
|
|
|
|
2020-05-17 21:08:06 +02:00
|
|
|
NaturesAuraAPI.PROJECTILE_GENERATIONS.put(EntityType.EGG, 10000);
|
|
|
|
NaturesAuraAPI.PROJECTILE_GENERATIONS.put(EntityType.SNOWBALL, 7000);
|
|
|
|
NaturesAuraAPI.PROJECTILE_GENERATIONS.put(EntityType.SMALL_FIREBALL, 35000);
|
|
|
|
NaturesAuraAPI.PROJECTILE_GENERATIONS.put(EntityType.ENDER_PEARL, 50000);
|
|
|
|
NaturesAuraAPI.PROJECTILE_GENERATIONS.put(EntityType.EXPERIENCE_BOTTLE, 200000);
|
|
|
|
NaturesAuraAPI.PROJECTILE_GENERATIONS.put(EntityType.ARROW, 30000);
|
|
|
|
NaturesAuraAPI.PROJECTILE_GENERATIONS.put(EntityType.SPECTRAL_ARROW, 40000);
|
|
|
|
NaturesAuraAPI.PROJECTILE_GENERATIONS.put(EntityType.SHULKER_BULLET, 300000);
|
|
|
|
NaturesAuraAPI.PROJECTILE_GENERATIONS.put(EntityType.LLAMA_SPIT, 100000);
|
2020-01-24 17:05:41 +01:00
|
|
|
NaturesAuraAPI.PROJECTILE_GENERATIONS.put(EntityType.TRIDENT, 3000000);
|
2020-10-24 15:58:38 +02:00
|
|
|
|
|
|
|
NaturesAuraAPI.WEATHER_CHANGER_CONVERSIONS.put(new ItemStack(Blocks.SUNFLOWER), WeatherType.SUN);
|
|
|
|
NaturesAuraAPI.WEATHER_CHANGER_CONVERSIONS.put(new ItemStack(Items.DARK_PRISMARINE), WeatherType.RAIN);
|
|
|
|
NaturesAuraAPI.WEATHER_CHANGER_CONVERSIONS.put(new ItemStack(Items.FIRE_CHARGE), WeatherType.THUNDERSTORM);
|
2018-12-31 17:32:38 +01:00
|
|
|
}
|
|
|
|
|
2020-04-29 16:38:50 +02:00
|
|
|
private static void ore(List<WeightedOre> list, String name, int weight) {
|
2021-12-15 16:30:22 +01:00
|
|
|
var res = new ResourceLocation("forge", name);
|
2020-04-29 16:38:50 +02:00
|
|
|
list.add(new WeightedOre(res, weight));
|
2019-02-24 11:49:45 +01:00
|
|
|
}
|
|
|
|
|
2021-12-04 19:17:21 +01:00
|
|
|
private static class RecipeType<T extends Recipe<?>> implements net.minecraft.world.item.crafting.RecipeType<T> {
|
|
|
|
|
2020-04-29 16:38:50 +02:00
|
|
|
@Override
|
|
|
|
public String toString() {
|
2023-02-15 23:45:50 +01:00
|
|
|
return ForgeRegistries.RECIPE_TYPES.getKey(this).toString();
|
2020-04-29 16:38:50 +02:00
|
|
|
}
|
2020-04-26 19:37:15 +02:00
|
|
|
}
|
2018-10-16 01:36:30 +02:00
|
|
|
}
|