2021-10-13 05:08:31 +02:00
|
|
|
package de.ellpeck.actuallyadditions.data;
|
|
|
|
|
|
|
|
import de.ellpeck.actuallyadditions.mod.ActuallyAdditions;
|
|
|
|
import de.ellpeck.actuallyadditions.mod.blocks.ActuallyBlocks;
|
|
|
|
import de.ellpeck.actuallyadditions.mod.crafting.LaserRecipe;
|
2021-10-13 22:42:48 +02:00
|
|
|
import de.ellpeck.actuallyadditions.mod.items.ActuallyItems;
|
2024-03-04 22:03:46 +01:00
|
|
|
import de.ellpeck.actuallyadditions.mod.util.NoAdvRecipeOutput;
|
2024-03-04 20:21:48 +01:00
|
|
|
import net.minecraft.core.registries.BuiltInRegistries;
|
2024-03-03 01:20:53 +01:00
|
|
|
import net.minecraft.data.PackOutput;
|
2024-03-04 20:21:48 +01:00
|
|
|
import net.minecraft.data.recipes.RecipeOutput;
|
2024-03-02 21:23:08 +01:00
|
|
|
import net.minecraft.data.recipes.RecipeProvider;
|
|
|
|
import net.minecraft.resources.ResourceLocation;
|
2021-10-13 22:42:48 +02:00
|
|
|
import net.minecraft.tags.ItemTags;
|
2024-03-02 21:23:08 +01:00
|
|
|
import net.minecraft.tags.TagKey;
|
|
|
|
import net.minecraft.world.item.Item;
|
|
|
|
import net.minecraft.world.item.Items;
|
|
|
|
import net.minecraft.world.item.crafting.Ingredient;
|
|
|
|
import net.minecraft.world.level.ItemLike;
|
2024-03-04 20:21:48 +01:00
|
|
|
import net.neoforged.neoforge.common.Tags;
|
2021-10-13 05:08:31 +02:00
|
|
|
|
2024-03-04 22:03:46 +01:00
|
|
|
import javax.annotation.Nonnull;
|
|
|
|
|
2021-10-13 05:08:31 +02:00
|
|
|
public class LaserRecipeGenerator extends RecipeProvider {
|
2024-03-03 01:20:53 +01:00
|
|
|
public LaserRecipeGenerator(PackOutput packOutput) {
|
|
|
|
super(packOutput);
|
2021-10-13 05:08:31 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2024-03-03 01:20:53 +01:00
|
|
|
public String getName() {
|
|
|
|
return "Laser " + super.getName();
|
2021-10-13 05:08:31 +02:00
|
|
|
}
|
|
|
|
|
2024-03-03 01:20:53 +01:00
|
|
|
@Override
|
2024-03-04 22:03:46 +01:00
|
|
|
protected void buildRecipes(@Nonnull RecipeOutput output) {
|
|
|
|
var recipeOutput = new NoAdvRecipeOutput(output);
|
|
|
|
|
2021-10-13 22:42:48 +02:00
|
|
|
//Crystal Blocks
|
2024-03-04 22:03:46 +01:00
|
|
|
laserCrystalizeRecipe(recipeOutput, ActuallyBlocks.RESTONIA_CRYSTAL.getItem(), Tags.Items.STORAGE_BLOCKS_REDSTONE, 400);
|
|
|
|
laserCrystalizeRecipe(recipeOutput, ActuallyBlocks.PALIS_CRYSTAL.getItem(), Tags.Items.STORAGE_BLOCKS_LAPIS, 400);
|
|
|
|
laserCrystalizeRecipe(recipeOutput, ActuallyBlocks.DIAMATINE_CRYSTAL.getItem(), Tags.Items.STORAGE_BLOCKS_DIAMOND, 600);
|
|
|
|
laserCrystalizeRecipe(recipeOutput, ActuallyBlocks.EMERADIC_CRYSTAL.getItem(), Tags.Items.STORAGE_BLOCKS_EMERALD, 1000);
|
|
|
|
laserCrystalizeRecipe(recipeOutput, ActuallyBlocks.VOID_CRYSTAL.getItem(), Tags.Items.STORAGE_BLOCKS_COAL, 600);
|
|
|
|
laserCrystalizeRecipe(recipeOutput, ActuallyBlocks.ENORI_CRYSTAL.getItem(), Tags.Items.STORAGE_BLOCKS_IRON, 800);
|
2021-10-13 05:08:31 +02:00
|
|
|
|
2021-10-13 22:42:48 +02:00
|
|
|
//Crystal Items
|
2024-03-04 22:03:46 +01:00
|
|
|
laserCrystalizeRecipe(recipeOutput, ActuallyItems.RESTONIA_CRYSTAL.get(), Tags.Items.DUSTS_REDSTONE, 40);
|
|
|
|
laserCrystalizeRecipe(recipeOutput, ActuallyItems.PALIS_CRYSTAL.get(), Tags.Items.GEMS_LAPIS, 40);
|
|
|
|
laserCrystalizeRecipe(recipeOutput, ActuallyItems.DIAMATINE_CRYSTAL.get(), Tags.Items.GEMS_DIAMOND, 60);
|
|
|
|
laserCrystalizeRecipe(recipeOutput, ActuallyItems.EMERADIC_CRYSTAL.get(), Tags.Items.GEMS_EMERALD, 100);
|
|
|
|
laserCrystalizeRecipe(recipeOutput, ActuallyItems.VOID_CRYSTAL.get(), ItemTags.COALS, 60);
|
|
|
|
laserCrystalizeRecipe(recipeOutput, ActuallyItems.ENORI_CRYSTAL.get(), Tags.Items.INGOTS_IRON, 80);
|
2021-10-13 05:08:31 +02:00
|
|
|
|
2021-10-13 22:42:48 +02:00
|
|
|
//Lenses
|
2024-03-04 22:03:46 +01:00
|
|
|
laserRecipe(recipeOutput, ActuallyItems.LENS_OF_COLOR.get(), ActuallyItems.LENS.get(), 5000);
|
|
|
|
laserRecipe(recipeOutput, ActuallyItems.LENS_OF_DETONATION.get(), ActuallyItems.LENS_OF_COLOR.get(), 5000);
|
|
|
|
laserRecipe(recipeOutput, ActuallyItems.LENS_OF_CERTAIN_DEATH.get(), ActuallyItems.LENS_OF_DETONATION.get(), 5000);
|
|
|
|
laserRecipe(recipeOutput, ActuallyItems.LENS.get(), ActuallyItems.LENS_OF_CERTAIN_DEATH.get(), 5000);
|
2021-10-13 22:42:48 +02:00
|
|
|
|
|
|
|
//Relays
|
2024-03-04 22:03:46 +01:00
|
|
|
laserRecipe(recipeOutput, ActuallyBlocks.LASER_RELAY_FLUIDS.getItem(), ActuallyBlocks.LASER_RELAY.getItem(), 2000);
|
|
|
|
laserRecipe(recipeOutput, ActuallyBlocks.LASER_RELAY_ITEM.getItem(), ActuallyBlocks.LASER_RELAY_FLUIDS.getItem(), 2000);
|
|
|
|
laserRecipe(recipeOutput, ActuallyBlocks.LASER_RELAY.getItem(), ActuallyBlocks.LASER_RELAY_ITEM.getItem(), 2000);
|
2021-10-13 22:42:48 +02:00
|
|
|
|
|
|
|
//Misc
|
2024-03-04 22:03:46 +01:00
|
|
|
laserRecipe(recipeOutput, Items.SOUL_SAND, Tags.Items.SAND, 20000);
|
|
|
|
laserRecipe(recipeOutput, Items.LEATHER, Items.ROTTEN_FLESH, 20000);
|
|
|
|
laserRecipe(recipeOutput, Items.NETHER_WART, Items.RED_MUSHROOM, 150000);
|
|
|
|
laserRecipe(recipeOutput, Items.PRISMARINE_SHARD, Items.QUARTZ, 30000);
|
|
|
|
laserRecipe(recipeOutput, ActuallyItems.CRYSTALLIZED_CANOLA_SEED.get(), ActuallyItems.CANOLA_SEEDS.get(), 2000);
|
|
|
|
laserRecipe(recipeOutput, ActuallyBlocks.ETHETIC_WHITE_BLOCK.getItem(), Items.QUARTZ_BLOCK, 10);
|
|
|
|
laserRecipe(recipeOutput, ActuallyBlocks.ETHETIC_GREEN_BLOCK.getItem(), Items.CHISELED_QUARTZ_BLOCK, 10);
|
2021-10-13 22:42:48 +02:00
|
|
|
|
|
|
|
}
|
|
|
|
|
2024-03-04 20:21:48 +01:00
|
|
|
private void laserRecipe(RecipeOutput consumer, ItemLike output, Ingredient input, int energy) {
|
|
|
|
ResourceLocation id = new ResourceLocation(ActuallyAdditions.MODID, "laser/" + BuiltInRegistries.ITEM.getKey(output.asItem()).getPath());
|
|
|
|
consumer.accept(id, new LaserRecipe(output.asItem().getDefaultInstance(), input, energy), null);
|
2021-10-13 22:42:48 +02:00
|
|
|
}
|
2024-03-04 20:21:48 +01:00
|
|
|
private void laserRecipe(RecipeOutput consumer, ItemLike output, TagKey<Item> input, int energy) {
|
|
|
|
ResourceLocation id = new ResourceLocation(ActuallyAdditions.MODID, "laser/" + BuiltInRegistries.ITEM.getKey(output.asItem()).getPath());
|
|
|
|
consumer.accept(id, new LaserRecipe(output.asItem().getDefaultInstance(), Ingredient.of(input), energy), null);
|
2021-10-13 22:42:48 +02:00
|
|
|
}
|
2024-03-04 20:21:48 +01:00
|
|
|
private void laserRecipe(RecipeOutput consumer, ItemLike output, ItemLike input, int energy) {
|
|
|
|
ResourceLocation id = new ResourceLocation(ActuallyAdditions.MODID, "laser/" + BuiltInRegistries.ITEM.getKey(output.asItem()).getPath());
|
|
|
|
consumer.accept(id, new LaserRecipe(output.asItem().getDefaultInstance(), Ingredient.of(input), energy), null);;
|
2021-10-13 22:42:48 +02:00
|
|
|
}
|
2024-03-04 20:21:48 +01:00
|
|
|
private void laserCrystalizeRecipe(RecipeOutput consumer, ItemLike output, Ingredient input, int energy) {
|
|
|
|
ResourceLocation id = new ResourceLocation(ActuallyAdditions.MODID, "laser/crystalize_" + BuiltInRegistries.ITEM.getKey(output.asItem()).getPath());
|
|
|
|
consumer.accept(id, new LaserRecipe(output.asItem().getDefaultInstance(), input, energy), null);
|
2021-10-13 22:42:48 +02:00
|
|
|
}
|
2024-03-04 20:21:48 +01:00
|
|
|
private void laserCrystalizeRecipe(RecipeOutput consumer, ItemLike output, TagKey<Item> input, int energy) {
|
|
|
|
ResourceLocation id = new ResourceLocation(ActuallyAdditions.MODID, "laser/crystalize_" + BuiltInRegistries.ITEM.getKey(output.asItem()).getPath());
|
|
|
|
consumer.accept(id, new LaserRecipe(output.asItem().getDefaultInstance(), Ingredient.of(input), energy), null);
|
2021-10-13 22:42:48 +02:00
|
|
|
}
|
2024-03-04 20:21:48 +01:00
|
|
|
private void laserCrystalizeRecipe(RecipeOutput consumer, ItemLike output, ItemLike input, int energy) {
|
|
|
|
ResourceLocation id = new ResourceLocation(ActuallyAdditions.MODID, "laser/crystalize_" + BuiltInRegistries.ITEM.getKey(output.asItem()).getPath());
|
|
|
|
consumer.accept(id, new LaserRecipe(output.asItem().getDefaultInstance(), Ingredient.of(input), energy), null);
|
2021-10-13 05:08:31 +02:00
|
|
|
}
|
|
|
|
}
|