generated from JamCoreModding/multi-loader-template-mod
-
Notifications
You must be signed in to change notification settings - Fork 2
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
1 parent
8856425
commit 9ac39f6
Showing
21 changed files
with
325 additions
and
54 deletions.
There are no files selected for viewing
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 |
---|---|---|
|
@@ -23,4 +23,5 @@ eclipse | |
run | ||
.architectury-transformer | ||
|
||
backup | ||
backup | ||
.cache |
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
4 changes: 2 additions & 2 deletions
4
...tility_belt/models/item/utility_belt.json → ...tility_belt/models/item/utility_belt.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,6 +1,6 @@ | ||
{ | ||
"parent": "item/generated", | ||
"parent": "minecraft:item/generated", | ||
"textures": { | ||
"layer0": "utility_belt:item/utility_belt" | ||
} | ||
} | ||
} |
3 changes: 1 addition & 2 deletions
3
...rces/data/accessories/tags/item/belt.json → ...rces/data/accessories/tags/item/belt.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,6 +1,5 @@ | ||
{ | ||
"replace": false, | ||
"values": [ | ||
"utility_belt:utility_belt" | ||
] | ||
} | ||
} |
51 changes: 23 additions & 28 deletions
51
...utility_belt/advancement/obtain_belt.json → ...belt/advancement/obtain_utility_belt.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,40 +1,35 @@ | ||
{ | ||
"parent": "minecraft:story/smelt_iron", | ||
"display": { | ||
"icon": { | ||
"id": "utility_belt:utility_belt" | ||
}, | ||
"title": { | ||
"translate": "advancements.utility_belt.utility_belt.title" | ||
}, | ||
"description": { | ||
"translate": "advancements.utility_belt.utility_belt.description" | ||
}, | ||
"frame": "task", | ||
"show_toast": true, | ||
"announce_to_chat": true, | ||
"hidden": false | ||
}, | ||
"rewards": { | ||
"experience": 25 | ||
}, | ||
"criteria": { | ||
"utility_belt": { | ||
"trigger": "minecraft:inventory_changed", | ||
"obtain_belt": { | ||
"conditions": { | ||
"items": [ | ||
{ | ||
"items": [ | ||
"utility_belt:utility_belt" | ||
] | ||
"items": "utility_belt:utility_belt" | ||
} | ||
] | ||
} | ||
}, | ||
"trigger": "minecraft:inventory_changed" | ||
} | ||
}, | ||
"display": { | ||
"description": { | ||
"translate": "advancements.utility_belt.utility_belt.description" | ||
}, | ||
"icon": { | ||
"count": 1, | ||
"id": "utility_belt:utility_belt" | ||
}, | ||
"title": { | ||
"translate": "advancements.utility_belt.utility_belt.title" | ||
} | ||
}, | ||
"requirements": [ | ||
[ | ||
"utility_belt" | ||
"obtain_belt" | ||
] | ||
] | ||
} | ||
], | ||
"rewards": { | ||
"experience": 25 | ||
}, | ||
"sends_telemetry_event": true | ||
} |
54 changes: 54 additions & 0 deletions
54
common/src/generated/resources/data/utility_belt/advancement/recipes/tools/utility_belt.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 |
---|---|---|
@@ -0,0 +1,54 @@ | ||
{ | ||
"parent": "minecraft:recipes/root", | ||
"criteria": { | ||
"has_diamond": { | ||
"conditions": { | ||
"items": [ | ||
{ | ||
"items": "minecraft:diamond" | ||
} | ||
] | ||
}, | ||
"trigger": "minecraft:inventory_changed" | ||
}, | ||
"has_leather": { | ||
"conditions": { | ||
"items": [ | ||
{ | ||
"items": "minecraft:leather" | ||
} | ||
] | ||
}, | ||
"trigger": "minecraft:inventory_changed" | ||
}, | ||
"has_string": { | ||
"conditions": { | ||
"items": [ | ||
{ | ||
"items": "minecraft:string" | ||
} | ||
] | ||
}, | ||
"trigger": "minecraft:inventory_changed" | ||
}, | ||
"has_the_recipe": { | ||
"conditions": { | ||
"recipe": "utility_belt:utility_belt" | ||
}, | ||
"trigger": "minecraft:recipe_unlocked" | ||
} | ||
}, | ||
"requirements": [ | ||
[ | ||
"has_the_recipe", | ||
"has_diamond", | ||
"has_leather", | ||
"has_string" | ||
] | ||
], | ||
"rewards": { | ||
"recipes": [ | ||
"utility_belt:utility_belt" | ||
] | ||
} | ||
} |
23 changes: 12 additions & 11 deletions
23
...ata/utility_belt/recipe/utility_belt.json → ...ata/utility_belt/recipe/utility_belt.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,23 +1,24 @@ | ||
{ | ||
"type": "minecraft:crafting_shaped", | ||
"pattern": [ | ||
"SDS", | ||
"L L", | ||
"SLS" | ||
], | ||
"category": "equipment", | ||
"key": { | ||
"S": { | ||
"item": "minecraft:string" | ||
}, | ||
"D": { | ||
"item": "minecraft:diamond" | ||
}, | ||
"L": { | ||
"item": "minecraft:leather" | ||
}, | ||
"S": { | ||
"item": "minecraft:string" | ||
} | ||
}, | ||
"pattern": [ | ||
"SDS", | ||
"L L", | ||
"SLS" | ||
], | ||
"result": { | ||
"id": "utility_belt:utility_belt", | ||
"count": 1 | ||
"count": 1, | ||
"id": "utility_belt:utility_belt" | ||
} | ||
} | ||
} |
3 changes: 1 addition & 2 deletions
3
...lt/tags/item/allowed_in_utility_belt.json → ...lt/tags/item/allowed_in_utility_belt.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,9 +1,8 @@ | ||
{ | ||
"replace": false, | ||
"values": [ | ||
{ | ||
"id": "create:wrench", | ||
"required": false | ||
} | ||
] | ||
} | ||
} |
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,33 @@ | ||
plugins { | ||
} | ||
|
||
architectury { | ||
platformSetupLoomIde() | ||
fabric() | ||
} | ||
|
||
fabricApi { | ||
configureDataGeneration { | ||
createSourceSet = false | ||
addToResources = false | ||
outputDirectory = project(":common").file("src/generated/resources") | ||
} | ||
} | ||
|
||
configurations { | ||
common | ||
shadowCommon | ||
compileClasspath.extendsFrom common | ||
runtimeClasspath.extendsFrom common | ||
developmentFabric.extendsFrom common | ||
} | ||
|
||
dependencies { | ||
modImplementation libs.fabric.loader | ||
modImplementation libs.fabric.api | ||
modImplementation libs.architectury.fabric | ||
modImplementation libs.jamlib.fabric | ||
modImplementation libs.accessories.fabric | ||
|
||
common(project(path: ":common", configuration: "namedElements")) { transitive false } | ||
} |
27 changes: 27 additions & 0 deletions
27
datagen/src/main/java/io/github/jamalam360/utility_belt/datagen/Advancements.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,27 @@ | ||
package io.github.jamalam360.utility_belt.datagen; | ||
|
||
import io.github.jamalam360.utility_belt.UtilityBelt; | ||
import net.fabricmc.fabric.api.datagen.v1.FabricDataOutput; | ||
import net.fabricmc.fabric.api.datagen.v1.provider.FabricAdvancementProvider; | ||
import net.minecraft.advancements.*; | ||
import net.minecraft.advancements.critereon.InventoryChangeTrigger; | ||
import net.minecraft.core.HolderLookup; | ||
import net.minecraft.network.chat.Component; | ||
|
||
import java.util.concurrent.CompletableFuture; | ||
import java.util.function.Consumer; | ||
|
||
public class Advancements extends FabricAdvancementProvider { | ||
protected Advancements(FabricDataOutput output, CompletableFuture<HolderLookup.Provider> registryLookup) { | ||
super(output, registryLookup); | ||
} | ||
|
||
@Override | ||
public void generateAdvancement(HolderLookup.Provider registryLookup, Consumer<AdvancementHolder> consumer) { | ||
Advancement.Builder.advancement() | ||
.display(UtilityBelt.UTILITY_BELT_ITEM.get(), Component.translatable("advancements.utility_belt.utility_belt.title"), Component.translatable("advancements.utility_belt.utility_belt.description"), null, AdvancementType.TASK, true, true, false) | ||
.addCriterion("obtain_belt", InventoryChangeTrigger.TriggerInstance.hasItems(UtilityBelt.UTILITY_BELT_ITEM.get())) | ||
.rewards(AdvancementRewards.Builder.experience(25)) | ||
.save(consumer, "utility_belt:obtain_utility_belt"); | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
datagen/src/main/java/io/github/jamalam360/utility_belt/datagen/Datagen.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,17 @@ | ||
package io.github.jamalam360.utility_belt.datagen; | ||
|
||
import io.github.jamalam360.utility_belt.UtilityBelt; | ||
import net.fabricmc.fabric.api.datagen.v1.DataGeneratorEntrypoint; | ||
import net.fabricmc.fabric.api.datagen.v1.FabricDataGenerator; | ||
|
||
public class Datagen implements DataGeneratorEntrypoint { | ||
@Override | ||
public void onInitializeDataGenerator(FabricDataGenerator gen) { | ||
UtilityBelt.LOGGER.info("Generating data and assets..."); | ||
FabricDataGenerator.Pack pack = gen.createPack(); | ||
pack.addProvider(Advancements::new); | ||
pack.addProvider(Models::new); | ||
pack.addProvider(Recipes::new); | ||
pack.addProvider(Tags::new); | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
datagen/src/main/java/io/github/jamalam360/utility_belt/datagen/Models.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,24 @@ | ||
package io.github.jamalam360.utility_belt.datagen; | ||
|
||
import io.github.jamalam360.utility_belt.UtilityBelt; | ||
import net.fabricmc.fabric.api.datagen.v1.FabricDataOutput; | ||
import net.fabricmc.fabric.api.datagen.v1.provider.FabricModelProvider; | ||
import net.minecraft.data.models.BlockModelGenerators; | ||
import net.minecraft.data.models.ItemModelGenerators; | ||
import net.minecraft.data.models.model.ModelTemplates; | ||
|
||
public class Models extends FabricModelProvider { | ||
public Models(FabricDataOutput output) { | ||
super(output); | ||
} | ||
|
||
@Override | ||
public void generateBlockStateModels(BlockModelGenerators gen) { | ||
|
||
} | ||
|
||
@Override | ||
public void generateItemModels(ItemModelGenerators gen) { | ||
gen.generateFlatItem(UtilityBelt.UTILITY_BELT_ITEM.get(), ModelTemplates.FLAT_ITEM); | ||
} | ||
} |
30 changes: 30 additions & 0 deletions
30
datagen/src/main/java/io/github/jamalam360/utility_belt/datagen/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,30 @@ | ||
package io.github.jamalam360.utility_belt.datagen; | ||
|
||
import io.github.jamalam360.utility_belt.UtilityBelt; | ||
import net.fabricmc.fabric.api.datagen.v1.FabricDataOutput; | ||
import net.fabricmc.fabric.api.datagen.v1.provider.FabricRecipeProvider; | ||
import net.minecraft.core.HolderLookup; | ||
import net.minecraft.data.recipes.RecipeCategory; | ||
import net.minecraft.data.recipes.RecipeOutput; | ||
import net.minecraft.data.recipes.ShapedRecipeBuilder; | ||
import net.minecraft.world.item.Items; | ||
|
||
import java.util.concurrent.CompletableFuture; | ||
|
||
public class Recipes extends FabricRecipeProvider { | ||
public Recipes(FabricDataOutput output, CompletableFuture<HolderLookup.Provider> registriesFuture) { | ||
super(output, registriesFuture); | ||
} | ||
|
||
@Override | ||
public void buildRecipes(RecipeOutput exporter) { | ||
ShapedRecipeBuilder | ||
.shaped(RecipeCategory.TOOLS, UtilityBelt.UTILITY_BELT_ITEM.get()) | ||
.pattern("SDS").pattern("L L").pattern("SLS") | ||
.define('S', Items.STRING).define('D', Items.DIAMOND).define('L', Items.LEATHER) | ||
.unlockedBy("has_diamond", has(Items.DIAMOND)) | ||
.unlockedBy("has_leather", has(Items.LEATHER)) | ||
.unlockedBy("has_string", has(Items.STRING)) | ||
.save(exporter); | ||
} | ||
} |
Oops, something went wrong.