generated from NeoForgeMDKs/MDK-1.21-NeoGradle
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
MCZME
committed
Aug 13, 2024
1 parent
a5c5eb5
commit 0336a98
Showing
20 changed files
with
471 additions
and
45 deletions.
There are no files selected for viewing
6 changes: 4 additions & 2 deletions
6
src/generated/resources/.cache/9fb1092f32d4fcbf9e061ffd718d4ec689c6c95e
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
// 1.21 2024-08-12T04:47:15.7919427 Recipes | ||
58cbad8a6a47dab3adccda12ea358f3d04aee08a data/lingshi/recipe/chopping_board/rice.json | ||
// 1.21 2024-08-14T05:22:07.8393123 Recipes | ||
80c03e628f24c66af32ca2f2a7f7efcfedeacb9f data/lingshi/advancement/recipes/skillet/dd.json | ||
4f3b846962abd318042306445c7ecd01a176ef1f data/lingshi/recipe/chopping_board/rice.json | ||
f8fc62d1b3c33ff6e83d1d8f585d6dc4deff2cd3 data/lingshi/recipe/skillet/dd.json |
4 changes: 2 additions & 2 deletions
4
src/generated/resources/.cache/e0d3d0b8d9c807675613821fa865a35f707cd83f
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
// 1.21 2024-08-13T22:21:22.8027373 Data Maps | ||
3136fc55269a4deb6ec159d30383e6941c2ee6a1 data/lingshi/data_maps/item/cooking_food.json | ||
// 1.21 2024-08-14T01:55:49.7601336 Data Maps | ||
a8bc32918970acec484472a12e6492804a8783f1 data/lingshi/data_maps/item/cooking_food.json |
6 changes: 4 additions & 2 deletions
6
src/generated/resources/data/lingshi/data_maps/item/cooking_food.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,12 @@ | ||
{ | ||
"values": { | ||
"lingshi:rice": { | ||
"time": 15.0 | ||
"complete_time": 25.0, | ||
"cooked_time": 15.0 | ||
}, | ||
"minecraft:apple": { | ||
"time": 5.0 | ||
"complete_time": 20.0, | ||
"cooked_time": 5.0 | ||
} | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
src/generated/resources/data/lingshi/recipe/chopping_board/rice.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
67 changes: 67 additions & 0 deletions
67
src/main/java/mczme/lingshi/common/data/builder/SkilletRecipeBuilder.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
package mczme.lingshi.common.data.builder; | ||
|
||
import mczme.lingshi.common.recipe.SkilletRecipe; | ||
import mczme.lingshi.lingshi; | ||
import net.minecraft.advancements.Advancement; | ||
import net.minecraft.advancements.AdvancementRequirements; | ||
import net.minecraft.advancements.AdvancementRewards; | ||
import net.minecraft.advancements.Criterion; | ||
import net.minecraft.advancements.critereon.RecipeUnlockedTrigger; | ||
import net.minecraft.data.recipes.RecipeBuilder; | ||
import net.minecraft.data.recipes.RecipeOutput; | ||
import net.minecraft.resources.ResourceLocation; | ||
import net.minecraft.world.item.Item; | ||
import net.minecraft.world.item.ItemStack; | ||
import net.minecraft.world.item.crafting.Ingredient; | ||
import net.neoforged.neoforge.fluids.FluidStack; | ||
import org.jetbrains.annotations.Nullable; | ||
|
||
import java.util.LinkedHashMap; | ||
import java.util.List; | ||
import java.util.Map; | ||
|
||
public class SkilletRecipeBuilder implements RecipeBuilder { | ||
|
||
private final List<Ingredient> items; | ||
private final List<FluidStack> fluids; | ||
private final ItemStack result; | ||
|
||
protected final Map<String, Criterion<?>> criteria = new LinkedHashMap<>(); | ||
@Nullable | ||
protected String group; | ||
|
||
public SkilletRecipeBuilder(List<Ingredient> items, List<FluidStack> fluids, ItemStack result) { | ||
this.items = items; | ||
this.fluids = fluids; | ||
this.result = result; | ||
} | ||
|
||
@Override | ||
public RecipeBuilder unlockedBy(String pName, Criterion<?> pCriterion) { | ||
this.criteria.put(pName, pCriterion); | ||
return this; | ||
} | ||
|
||
@Override | ||
public RecipeBuilder group(@Nullable String pGroupName) { | ||
this.group = pGroupName; | ||
return this; | ||
} | ||
|
||
@Override | ||
public Item getResult() { | ||
return this.result.getItem(); | ||
} | ||
|
||
@Override | ||
public void save(RecipeOutput pRecipeOutput, ResourceLocation pId) { | ||
ResourceLocation id = ResourceLocation.fromNamespaceAndPath(lingshi.MODID,"skillet/"+pId.getPath()); | ||
Advancement.Builder advancement = pRecipeOutput.advancement() | ||
.addCriterion("has_the_recipe", RecipeUnlockedTrigger.unlocked(id)) | ||
.rewards(AdvancementRewards.Builder.recipe(id)) | ||
.requirements(AdvancementRequirements.Strategy.OR); | ||
this.criteria.forEach(advancement::addCriterion); | ||
SkilletRecipe recipe = new SkilletRecipe(this.items, this.fluids, this.result); | ||
pRecipeOutput.accept(id, recipe, advancement.build(id.withPrefix("recipes/"))); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
src/main/java/mczme/lingshi/common/data/recipe/Recipes.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package mczme.lingshi.common.data.recipe; | ||
|
||
import net.minecraft.advancements.Criterion; | ||
import net.minecraft.advancements.critereon.InventoryChangeTrigger; | ||
import net.minecraft.advancements.critereon.ItemPredicate; | ||
import net.minecraft.advancements.critereon.MinMaxBounds; | ||
import net.minecraft.core.HolderLookup; | ||
import net.minecraft.data.PackOutput; | ||
import net.minecraft.data.recipes.RecipeOutput; | ||
import net.minecraft.data.recipes.RecipeProvider; | ||
import net.minecraft.tags.TagKey; | ||
import net.minecraft.world.item.Item; | ||
import net.minecraft.world.level.ItemLike; | ||
|
||
import java.util.concurrent.CompletableFuture; | ||
|
||
public class Recipes extends RecipeProvider { | ||
public Recipes(PackOutput pOutput, CompletableFuture<HolderLookup.Provider> pRegistries) { | ||
super(pOutput, pRegistries); | ||
} | ||
|
||
@Override | ||
protected void buildRecipes(RecipeOutput output) { | ||
new ChoppingBoardRecipeDatagen(output); | ||
new SkilletRecipeDatagen(output); | ||
} | ||
|
||
public static Criterion<InventoryChangeTrigger.TriggerInstance> has(MinMaxBounds.Ints pCount, ItemLike pItem) { | ||
return inventoryTrigger(ItemPredicate.Builder.item().of(pItem).withCount(pCount)); | ||
} | ||
|
||
public static Criterion<InventoryChangeTrigger.TriggerInstance> has(ItemLike pItemLike) { | ||
return inventoryTrigger(ItemPredicate.Builder.item().of(pItemLike)); | ||
} | ||
|
||
public static Criterion<InventoryChangeTrigger.TriggerInstance> has(TagKey<Item> pTag) { | ||
return inventoryTrigger(ItemPredicate.Builder.item().of(pTag)); | ||
} | ||
|
||
} |
Oops, something went wrong.