配方生成器
This commit is contained in:
parent
f5040d7abf
commit
82f4d02fef
|
|
@ -0,0 +1,32 @@
|
||||||
|
{
|
||||||
|
"parent": "minecraft:recipes/root",
|
||||||
|
"criteria": {
|
||||||
|
"has_quantum_ring": {
|
||||||
|
"conditions": {
|
||||||
|
"items": [
|
||||||
|
{
|
||||||
|
"items": "ae2:quantum_ring"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"trigger": "minecraft:inventory_changed"
|
||||||
|
},
|
||||||
|
"has_the_recipe": {
|
||||||
|
"conditions": {
|
||||||
|
"recipe": "extendedae_plus:assembler_matrix_crafter_plus"
|
||||||
|
},
|
||||||
|
"trigger": "minecraft:recipe_unlocked"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"requirements": [
|
||||||
|
[
|
||||||
|
"has_the_recipe",
|
||||||
|
"has_quantum_ring"
|
||||||
|
]
|
||||||
|
],
|
||||||
|
"rewards": {
|
||||||
|
"recipes": [
|
||||||
|
"extendedae_plus:assembler_matrix_crafter_plus"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,32 @@
|
||||||
|
{
|
||||||
|
"parent": "minecraft:recipes/root",
|
||||||
|
"criteria": {
|
||||||
|
"has_quantum_ring": {
|
||||||
|
"conditions": {
|
||||||
|
"items": [
|
||||||
|
{
|
||||||
|
"items": "ae2:quantum_ring"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"trigger": "minecraft:inventory_changed"
|
||||||
|
},
|
||||||
|
"has_the_recipe": {
|
||||||
|
"conditions": {
|
||||||
|
"recipe": "extendedae_plus:assembler_matrix_pattern_plus"
|
||||||
|
},
|
||||||
|
"trigger": "minecraft:recipe_unlocked"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"requirements": [
|
||||||
|
[
|
||||||
|
"has_the_recipe",
|
||||||
|
"has_quantum_ring"
|
||||||
|
]
|
||||||
|
],
|
||||||
|
"rewards": {
|
||||||
|
"recipes": [
|
||||||
|
"extendedae_plus:assembler_matrix_pattern_plus"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,32 @@
|
||||||
|
{
|
||||||
|
"parent": "minecraft:recipes/root",
|
||||||
|
"criteria": {
|
||||||
|
"has_quantum_ring": {
|
||||||
|
"conditions": {
|
||||||
|
"items": [
|
||||||
|
{
|
||||||
|
"items": "ae2:quantum_ring"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"trigger": "minecraft:inventory_changed"
|
||||||
|
},
|
||||||
|
"has_the_recipe": {
|
||||||
|
"conditions": {
|
||||||
|
"recipe": "extendedae_plus:assembler_matrix_speed_plus"
|
||||||
|
},
|
||||||
|
"trigger": "minecraft:recipe_unlocked"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"requirements": [
|
||||||
|
[
|
||||||
|
"has_the_recipe",
|
||||||
|
"has_quantum_ring"
|
||||||
|
]
|
||||||
|
],
|
||||||
|
"rewards": {
|
||||||
|
"recipes": [
|
||||||
|
"extendedae_plus:assembler_matrix_speed_plus"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,24 @@
|
||||||
|
{
|
||||||
|
"type": "minecraft:crafting_shaped",
|
||||||
|
"category": "misc",
|
||||||
|
"key": {
|
||||||
|
"B": {
|
||||||
|
"item": "extendedae:assembler_matrix_wall"
|
||||||
|
},
|
||||||
|
"L": {
|
||||||
|
"item": "minecraft:nether_star"
|
||||||
|
},
|
||||||
|
"R": {
|
||||||
|
"item": "extendedae:assembler_matrix_crafter"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"pattern": [
|
||||||
|
"BRB",
|
||||||
|
"RLR",
|
||||||
|
"BRB"
|
||||||
|
],
|
||||||
|
"result": {
|
||||||
|
"count": 1,
|
||||||
|
"id": "extendedae_plus:assembler_matrix_crafter_plus"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,24 @@
|
||||||
|
{
|
||||||
|
"type": "minecraft:crafting_shaped",
|
||||||
|
"category": "misc",
|
||||||
|
"key": {
|
||||||
|
"B": {
|
||||||
|
"item": "extendedae:assembler_matrix_wall"
|
||||||
|
},
|
||||||
|
"L": {
|
||||||
|
"item": "minecraft:nether_star"
|
||||||
|
},
|
||||||
|
"R": {
|
||||||
|
"item": "extendedae:assembler_matrix_pattern"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"pattern": [
|
||||||
|
"BRB",
|
||||||
|
"RLR",
|
||||||
|
"BRB"
|
||||||
|
],
|
||||||
|
"result": {
|
||||||
|
"count": 1,
|
||||||
|
"id": "extendedae_plus:assembler_matrix_pattern_plus"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,24 @@
|
||||||
|
{
|
||||||
|
"type": "minecraft:crafting_shaped",
|
||||||
|
"category": "misc",
|
||||||
|
"key": {
|
||||||
|
"B": {
|
||||||
|
"item": "extendedae:assembler_matrix_wall"
|
||||||
|
},
|
||||||
|
"L": {
|
||||||
|
"item": "minecraft:nether_star"
|
||||||
|
},
|
||||||
|
"R": {
|
||||||
|
"item": "extendedae:assembler_matrix_speed"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"pattern": [
|
||||||
|
"BRB",
|
||||||
|
"RLR",
|
||||||
|
"BRB"
|
||||||
|
],
|
||||||
|
"result": {
|
||||||
|
"count": 1,
|
||||||
|
"id": "extendedae_plus:assembler_matrix_speed_plus"
|
||||||
|
}
|
||||||
|
}
|
||||||
63
src/main/java/com/extendedae_plus/datagen/CrafterRecipe.java
Normal file
63
src/main/java/com/extendedae_plus/datagen/CrafterRecipe.java
Normal file
|
|
@ -0,0 +1,63 @@
|
||||||
|
package com.extendedae_plus.datagen;
|
||||||
|
|
||||||
|
import appeng.core.definitions.AEBlocks;
|
||||||
|
import com.extendedae_plus.ExtendedAEPlus;
|
||||||
|
import com.extendedae_plus.init.ModItems;
|
||||||
|
import com.glodblock.github.extendedae.common.EAESingletons;
|
||||||
|
import net.minecraft.core.HolderLookup;
|
||||||
|
import net.minecraft.data.PackOutput;
|
||||||
|
import net.minecraft.data.recipes.*;
|
||||||
|
import net.minecraft.world.item.Items;
|
||||||
|
import net.minecraft.world.level.ItemLike;
|
||||||
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
|
import java.util.concurrent.CompletableFuture;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ExtendedAE Plus 配方数据生成器
|
||||||
|
* 用于 NeoForge 1.21.1
|
||||||
|
*/
|
||||||
|
public class CrafterRecipe extends RecipeProvider {
|
||||||
|
|
||||||
|
public CrafterRecipe(PackOutput output, CompletableFuture<HolderLookup.Provider> registries) {
|
||||||
|
super(output, registries);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void buildRecipes(@NotNull RecipeOutput output) {
|
||||||
|
|
||||||
|
//超级装配矩阵速度核心
|
||||||
|
ShapedRecipeBuilder.shaped(RecipeCategory.MISC, ModItems.ASSEMBLER_MATRIX_SPEED_PLUS.get())
|
||||||
|
.pattern("BRB")
|
||||||
|
.pattern("RLR")
|
||||||
|
.pattern("BRB")
|
||||||
|
.define('R', EAESingletons.ASSEMBLER_MATRIX_SPEED)
|
||||||
|
.define('L', Items.NETHER_STAR)
|
||||||
|
.define('B', EAESingletons.ASSEMBLER_MATRIX_WALL)
|
||||||
|
.unlockedBy("has_quantum_ring", has(AEBlocks.QUANTUM_RING))
|
||||||
|
.save(output);
|
||||||
|
|
||||||
|
//超级装配矩阵合成核心
|
||||||
|
ShapedRecipeBuilder.shaped(RecipeCategory.MISC, ModItems.ASSEMBLER_MATRIX_CRAFTER_PLUS.get())
|
||||||
|
.pattern("BRB")
|
||||||
|
.pattern("RLR")
|
||||||
|
.pattern("BRB")
|
||||||
|
.define('R', EAESingletons.ASSEMBLER_MATRIX_CRAFTER)
|
||||||
|
.define('L', Items.NETHER_STAR)
|
||||||
|
.define('B', EAESingletons.ASSEMBLER_MATRIX_WALL)
|
||||||
|
.unlockedBy("has_quantum_ring", has(AEBlocks.QUANTUM_RING))
|
||||||
|
.save(output);
|
||||||
|
|
||||||
|
//超级装配矩阵样板核心
|
||||||
|
ShapedRecipeBuilder.shaped(RecipeCategory.MISC, ModItems.ASSEMBLER_MATRIX_PATTERN_PLUS.get())
|
||||||
|
.pattern("BRB")
|
||||||
|
.pattern("RLR")
|
||||||
|
.pattern("BRB")
|
||||||
|
.define('R', EAESingletons.ASSEMBLER_MATRIX_PATTERN)
|
||||||
|
.define('L', Items.NETHER_STAR)
|
||||||
|
.define('B', EAESingletons.ASSEMBLER_MATRIX_WALL)
|
||||||
|
.unlockedBy("has_quantum_ring", has(AEBlocks.QUANTUM_RING))
|
||||||
|
.save(output);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,34 @@
|
||||||
|
package com.extendedae_plus.datagen;
|
||||||
|
|
||||||
|
import com.extendedae_plus.ExtendedAEPlus;
|
||||||
|
import net.minecraft.core.HolderLookup;
|
||||||
|
import net.minecraft.data.DataGenerator;
|
||||||
|
import net.minecraft.data.PackOutput;
|
||||||
|
import net.neoforged.bus.api.SubscribeEvent;
|
||||||
|
import net.neoforged.fml.common.EventBusSubscriber;
|
||||||
|
import net.neoforged.neoforge.common.data.ExistingFileHelper;
|
||||||
|
import net.neoforged.neoforge.data.event.GatherDataEvent;
|
||||||
|
|
||||||
|
import java.util.concurrent.CompletableFuture;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ExtendedAE Plus 数据生成事件总线
|
||||||
|
* 用于 NeoForge 1.21.1
|
||||||
|
*/
|
||||||
|
@EventBusSubscriber(modid = ExtendedAEPlus.MODID)
|
||||||
|
public class DataGenerators {
|
||||||
|
|
||||||
|
@SubscribeEvent
|
||||||
|
public static void gatherData(GatherDataEvent event) {
|
||||||
|
DataGenerator generator = event.getGenerator();
|
||||||
|
CompletableFuture<HolderLookup.Provider> lookupProvider = event.getLookupProvider();
|
||||||
|
|
||||||
|
// 注册配方提供器
|
||||||
|
generator.addProvider(
|
||||||
|
event.includeServer(),
|
||||||
|
new CrafterRecipe(generator.getPackOutput(), lookupProvider)
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue
Block a user