Skip to content

Commit

Permalink
Merge branch 'releases/1.20.1' into Power
Browse files Browse the repository at this point in the history
  • Loading branch information
Gu-ZT committed Apr 18, 2024
2 parents 11ec43c + 96dfb2d commit 1b69222
Show file tree
Hide file tree
Showing 104 changed files with 919 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,19 +41,14 @@ public static void init(RegistrateRecipeProvider provider) {
.unlockedBy(AnvilCraftDatagen.hasItem(ModItemTags.STONE), AnvilCraftDatagen.has(ModItemTags.STONE))
.save(provider, AnvilCraft.of("heating/" + BuiltInRegistries.BLOCK.getKey(Blocks.LAVA).getPath()));
AnvilRecipe.Builder.create(RecipeCategory.MISC)
<<<<<<< Updated upstream
=======
.icon(Items.LAVA_BUCKET)
.hasBlock(ModBlocks.HEATER.get(), new Vec3(0.0, -2.0, 0.0), Map.entry(OVERLOAD, false))
.hasBlock(Blocks.CAULDRON)
.hasItemIngredient(new Vec3(0.0, -1.0, 0.0), 1, ModItemTags.STONE_FORGE)
.setBlock(Blocks.LAVA_CAULDRON)
.unlockedBy(AnvilCraftDatagen.hasItem(ModItemTags.STONE_FORGE),
AnvilCraftDatagen.has(ModItemTags.STONE_FORGE))
.save(provider, AnvilCraft
.of("heating/" + BuiltInRegistries.BLOCK.getKey(Blocks.LAVA).getPath()) + "_forge");
.unlockedBy(AnvilCraftDatagen.hasItem(ModItemTags.STONE_FORGE), AnvilCraftDatagen.has(ModItemTags.STONE_FORGE))

Check warning on line 49 in common/src/main/java/dev/dubhe/anvilcraft/data/generator/recipe/SuperHeatingRecipesLoader.java

View workflow job for this annotation

GitHub Actions / checkstyle

[Checkstyle] reported by reviewdog 🐶 Line is longer than 120 characters (found 123). Raw Output: /home/runner/work/AnvilCraftMod/AnvilCraftMod/common/src/main/java/dev/dubhe/anvilcraft/data/generator/recipe/SuperHeatingRecipesLoader.java:49:0: warning: Line is longer than 120 characters (found 123). (com.puppycrawl.tools.checkstyle.checks.sizes.LineLengthCheck)
.save(provider, AnvilCraft.of("heating/" + BuiltInRegistries.BLOCK.getKey(Blocks.LAVA).getPath()));
AnvilRecipe.Builder.create(RecipeCategory.MISC)
>>>>>>> Stashed changes
.icon(ModItems.ROYAL_STEEL_INGOT)
.hasBlock(ModBlocks.HEATER.get(), new Vec3(0.0, -2.0, 0.0), Map.entry(OVERLOAD, false))
.hasBlock(Blocks.CAULDRON)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,19 @@ public static void init(RegistrateRecipeProvider provider) {
.unlockedBy(AnvilCraftDatagen.hasItem(ModItems.DOUGH.get()), AnvilCraftDatagen.has(ModItems.DOUGH))
.save(provider, AnvilCraft.of("generic_cooking_bread"));

SimpleCookingRecipeBuilder.campfireCooking(Ingredient.of(ModItemTags.DOUGH_FORGE), RecipeCategory.FOOD,
Items.BREAD, 0.35f, 600)
.unlockedBy(AnvilCraftDatagen.hasItem(ModItems.DOUGH.get()), AnvilCraftDatagen.has(ModItems.DOUGH))
.save(provider, AnvilCraft.of("campfire_cooking_bread_forge"));
SimpleCookingRecipeBuilder.smoking(Ingredient.of(ModItemTags.DOUGH_FORGE), RecipeCategory.FOOD,
Items.BREAD, 0.35f, 100)
.unlockedBy(AnvilCraftDatagen.hasItem(ModItems.DOUGH.get()), AnvilCraftDatagen.has(ModItems.DOUGH))
.save(provider, AnvilCraft.of("smoking_bread_forge"));
SimpleCookingRecipeBuilder.generic(Ingredient.of(ModItemTags.DOUGH_FORGE), RecipeCategory.FOOD,
Items.BREAD, 0.35f, 600, RecipeSerializer.SMOKING_RECIPE)
.unlockedBy(AnvilCraftDatagen.hasItem(ModItems.DOUGH.get()), AnvilCraftDatagen.has(ModItems.DOUGH))
.save(provider, AnvilCraft.of("generic_cooking_bread_forge"));

VanillaRecipeProvider.stonecutterResultFromBase(provider, RecipeCategory.BUILDING_BLOCKS,
ModBlocks.CUT_ROYAL_STEEL_STAIRS, ModBlocks.CUT_ROYAL_STEEL_BLOCK);
VanillaRecipeProvider.stonecutterResultFromBase(provider, RecipeCategory.BUILDING_BLOCKS,
Expand Down
33 changes: 23 additions & 10 deletions common/src/main/java/dev/dubhe/anvilcraft/init/ModBlocks.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import dev.dubhe.anvilcraft.block.StampingPlatformBlock;
import dev.dubhe.anvilcraft.data.generator.AnvilCraftDatagen;
import dev.dubhe.anvilcraft.item.CursedBlockItem;
import net.minecraft.core.registries.BuiltInRegistries;
import net.minecraft.data.recipes.RecipeCategory;
import net.minecraft.data.recipes.ShapedRecipeBuilder;
import net.minecraft.tags.BlockTags;
Expand Down Expand Up @@ -47,16 +48,28 @@ public class ModBlocks {
.simpleItem()
.defaultLoot()
.tag(BlockTags.MINEABLE_WITH_PICKAXE)
.recipe((ctx, provider) -> ShapedRecipeBuilder.shaped(RecipeCategory.TOOLS, ctx.get())
.pattern("BAB")
.pattern("B B")
.pattern("B B")
.define('A', ModItemTags.IRON_PLATES)
.define('B', Items.IRON_INGOT)
.unlockedBy("has_" + ModItemTags.IRON_PLATES.location().getPath(),
AnvilCraftDatagen.has(ModItemTags.IRON_PLATES))
.unlockedBy(AnvilCraftDatagen.hasItem(Items.IRON_INGOT), AnvilCraftDatagen.has(Items.IRON_INGOT))
.save(provider))
.recipe((ctx, provider) -> {
ShapedRecipeBuilder.shaped(RecipeCategory.TOOLS, ctx.get())
.pattern("BAB")
.pattern("B B")
.pattern("B B")
.define('A', ModItemTags.IRON_PLATES)
.define('B', Items.IRON_INGOT)
.unlockedBy("has_" + ModItemTags.IRON_PLATES.location().getPath(),
AnvilCraftDatagen.has(ModItemTags.IRON_PLATES))
.unlockedBy(AnvilCraftDatagen.hasItem(Items.IRON_INGOT), AnvilCraftDatagen.has(Items.IRON_INGOT))
.save(provider);
ShapedRecipeBuilder.shaped(RecipeCategory.TOOLS, ctx.get())
.pattern("BAB")
.pattern("B B")
.pattern("B B")
.define('A', ModItemTags.IRON_PLATES_FORGE)
.define('B', Items.IRON_INGOT)
.unlockedBy("has_" + ModItemTags.IRON_PLATES_FORGE.location().getPath(),
AnvilCraftDatagen.has(ModItemTags.IRON_PLATES_FORGE))
.unlockedBy(AnvilCraftDatagen.hasItem(Items.IRON_INGOT), AnvilCraftDatagen.has(Items.IRON_INGOT))
.save(provider, BuiltInRegistries.ITEM.getKey(ctx.get().asItem()) + "_forge");
})
.register();
public static final BlockEntry<? extends Block> CORRUPTED_BEACON = REGISTRATE
.block("corrupted_beacon", CorruptedBeaconBlock::new)
Expand Down
22 changes: 21 additions & 1 deletion common/src/main/java/dev/dubhe/anvilcraft/init/ModItemTags.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,35 @@ public class ModItemTags {
public static final TagKey<Item> PLATES = bindC("plates");
public static final TagKey<Item> GOLD_PLATES = bindC("gold_plates");
public static final TagKey<Item> IRON_PLATES = bindC("iron_plates");
public static final TagKey<Item> STONE = bindC("stone");

public static final TagKey<Item> FLOUR_FORGE = bindForge("flour");
public static final TagKey<Item> WHEAT_FLOUR_FORGE = bindForge("flour/wheat");
public static final TagKey<Item> DOUGH_FORGE = bindForge("dough");
public static final TagKey<Item> WHEAT_DOUGH_FORGE = bindForge("dough/wheat");
public static final TagKey<Item> PICKAXES_FORGE = bindForge("pickaxes");
public static final TagKey<Item> AXES_FORGE = bindForge("axes");
public static final TagKey<Item> HOES_FORGE = bindForge("hoes");
public static final TagKey<Item> SHOVELS_FORGE = bindForge("shovels");
public static final TagKey<Item> SWORDS_FORGE = bindForge("swords");
public static final TagKey<Item> FOODS_FORGE = bindForge("foods");
public static final TagKey<Item> PLATES_FORGE = bindForge("plates");
public static final TagKey<Item> GOLD_PLATES_FORGE = bindForge("gold_plates");
public static final TagKey<Item> IRON_PLATES_FORGE = bindForge("iron_plates");
public static final TagKey<Item> STONE_FORGE = bindForge("stone");

public static final TagKey<Item> ROYAL_STEEL_PICKAXE_BASE = bind("royal_steel_pickaxe_base");
public static final TagKey<Item> CAPACITOR = bind("capacitor");
public static final TagKey<Item> STONE = bindC("stone");


private static @NotNull TagKey<Item> bindC(String id) {
return TagKey.create(Registries.ITEM, new ResourceLocation("c", id));
}

private static @NotNull TagKey<Item> bindForge(String id) {
return TagKey.create(Registries.ITEM, new ResourceLocation("forge", id));
}

private static @NotNull TagKey<Item> bind(String id) {
return TagKey.create(Registries.ITEM, AnvilCraft.of(id));
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,26 +1,48 @@
{
"variants": {
"facing=down": {
"facing=down,overload=false": {
"model": "anvilcraft:block/auto_crafter_vertical",
"x": 180
},
"facing=east": {
"facing=east,overload=false": {
"model": "anvilcraft:block/auto_crafter",
"y": 90
},
"facing=north": {
"facing=north,overload=false": {
"model": "anvilcraft:block/auto_crafter"
},
"facing=south": {
"facing=south,overload=false": {
"model": "anvilcraft:block/auto_crafter",
"y": 180
},
"facing=up": {
"facing=up,overload=false": {
"model": "anvilcraft:block/auto_crafter_vertical"
},
"facing=west": {
"facing=west,overload=false": {
"model": "anvilcraft:block/auto_crafter",
"y": 270
},
"facing=down,overload=true": {
"model": "anvilcraft:block/auto_crafter_vertical_off",
"x": 180
},
"facing=east,overload=true": {
"model": "anvilcraft:block/auto_crafter_off",
"y": 90
},
"facing=north,overload=true": {
"model": "anvilcraft:block/auto_crafter_off"
},
"facing=south,overload=true": {
"model": "anvilcraft:block/auto_crafter_off",
"y": 180
},
"facing=up,overload=true": {
"model": "anvilcraft:block/auto_crafter_vertical_off"
},
"facing=west,overload=true": {
"model": "anvilcraft:block/auto_crafter_off",
"y": 270
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"credit": "Made by XeKr with Blockbench",
"parent": "minecraft:block/cube",
"textures": {
"0": "anvilcraft:block/auto_crafter_top_off",
"1": "anvilcraft:block/auto_crafter_front_off",
"2": "anvilcraft:block/auto_crafter_left_off",
"3": "anvilcraft:block/auto_crafter_right_off",
"4": "anvilcraft:block/auto_crafter_back_off",
"5": "anvilcraft:block/auto_crafter_bottom_off",
"particle": "anvilcraft:block/auto_crafter_top_off"
},
"elements": [
{
"from": [0, 0, 0],
"to": [16, 16, 16],
"faces": {
"north": {"uv": [0, 0, 16, 16], "texture": "#1"},
"east": {"uv": [0, 0, 16, 16], "texture": "#2"},
"south": {"uv": [0, 0, 16, 16], "texture": "#4"},
"west": {"uv": [0, 0, 16, 16], "texture": "#3"},
"up": {"uv": [0, 0, 16, 16], "rotation": 180, "texture": "#0"},
"down": {"uv": [0, 0, 16, 16], "rotation": 180, "texture": "#5"}
}
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"parent": "minecraft:block/cube",
"textures": {
"0": "anvilcraft:block/auto_crafter_top_vertical",
"1": "anvilcraft:block/auto_crafter_side",
"1": "anvilcraft:block/auto_crafter_bottom",
"2": "anvilcraft:block/auto_crafter_bottom_vertical",
"particle": "anvilcraft:block/auto_crafter_top_vertical"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"credit": "Made by XeKr with Blockbench",
"parent": "minecraft:block/cube",
"textures": {
"0": "anvilcraft:block/auto_crafter_top_vertical_off",
"1": "anvilcraft:block/auto_crafter_bottom_off",
"2": "anvilcraft:block/auto_crafter_bottom_vertical_off",
"particle": "anvilcraft:block/auto_crafter_top_vertical_off"
},
"elements": [
{
"from": [0, 0, 0],
"to": [16, 16, 16],
"faces": {
"north": {"uv": [0, 0, 16, 16], "texture": "#1"},
"east": {"uv": [0, 0, 16, 16], "texture": "#1"},
"south": {"uv": [0, 0, 16, 16], "texture": "#1"},
"west": {"uv": [0, 0, 16, 16], "texture": "#1"},
"up": {"uv": [0, 0, 16, 16], "texture": "#0"},
"down": {"uv": [0, 0, 16, 16], "texture": "#2"}
}
}
]
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"animation": {
"frametime": 20,
"interpolate": true
}
}
9 changes: 8 additions & 1 deletion fabric/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,15 @@ tasks.register('dataCopy', Copy) {
into forge_project.file('src/generated')
}

tasks.register('copyForgeData', Copy) {
group 'loom'
from project.file('src/generated/resources/data/c')
into project.file('src/generated/resources/data/forge')
}

dataCopy.dependsOn(dataDelete)
dataDelete.dependsOn(runDataCommon)
dataDelete.dependsOn(copyForgeData)
copyForgeData.dependsOn(runDataCommon)

sourcesJar {
def commonSources = common_project.sourcesJar
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"parent": "minecraft:recipes/root",
"criteria": {
"has_dough": {
"conditions": {
"items": [
{
"items": [
"anvilcraft:dough"
]
}
]
},
"trigger": "minecraft:inventory_changed"
},
"has_the_recipe": {
"conditions": {
"recipe": "anvilcraft:campfire_cooking_bread_forge"
},
"trigger": "minecraft:recipe_unlocked"
}
},
"requirements": [
[
"has_dough",
"has_the_recipe"
]
],
"rewards": {
"recipes": [
"anvilcraft:campfire_cooking_bread_forge"
]
},
"sends_telemetry_event": false
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"parent": "minecraft:recipes/root",
"criteria": {
"has_dough": {
"conditions": {
"items": [
{
"items": [
"anvilcraft:dough"
]
}
]
},
"trigger": "minecraft:inventory_changed"
},
"has_the_recipe": {
"conditions": {
"recipe": "anvilcraft:generic_cooking_bread_forge"
},
"trigger": "minecraft:recipe_unlocked"
}
},
"requirements": [
[
"has_dough",
"has_the_recipe"
]
],
"rewards": {
"recipes": [
"anvilcraft:generic_cooking_bread_forge"
]
},
"sends_telemetry_event": false
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"parent": "minecraft:recipes/root",
"criteria": {
"has_dough": {
"conditions": {
"items": [
{
"items": [
"anvilcraft:dough"
]
}
]
},
"trigger": "minecraft:inventory_changed"
},
"has_the_recipe": {
"conditions": {
"recipe": "anvilcraft:smoking_bread_forge"
},
"trigger": "minecraft:recipe_unlocked"
}
},
"requirements": [
[
"has_dough",
"has_the_recipe"
]
],
"rewards": {
"recipes": [
"anvilcraft:smoking_bread_forge"
]
},
"sends_telemetry_event": false
}
Loading

0 comments on commit 1b69222

Please sign in to comment.