Skip to content

Commit

Permalink
✨ add porcelain piece, drop for porcelain blocks, and relative recipes
Browse files Browse the repository at this point in the history
  • Loading branch information
LocusAzzurro committed Jun 20, 2024
1 parent afe91b0 commit 601c806
Show file tree
Hide file tree
Showing 13 changed files with 171 additions and 17 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "ultramarine:item/porcelain_piece"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"parent": "minecraft:recipes/root",
"rewards": {
"recipes": [
"ultramarine:porcelain_parts"
"minecraft:blue_and_white_porcelain_piece_grinding"
]
},
"criteria": {
Expand All @@ -12,7 +12,7 @@
"items": [
{
"items": [
"ultramarine:porcelain_parts"
"ultramarine:blue_and_white_porcelain_piece"
]
}
]
Expand All @@ -21,7 +21,7 @@
"has_the_recipe": {
"trigger": "minecraft:recipe_unlocked",
"conditions": {
"recipe": "ultramarine:porcelain_parts"
"recipe": "minecraft:blue_and_white_porcelain_piece_grinding"
}
}
},
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"parent": "minecraft:recipes/root",
"rewards": {
"recipes": [
"minecraft:porcelain_piece_grinding"
]
},
"criteria": {
"has_porcelain_piece": {
"trigger": "minecraft:inventory_changed",
"conditions": {
"items": [
{
"items": [
"ultramarine:porcelain_piece"
]
}
]
}
},
"has_the_recipe": {
"trigger": "minecraft:recipe_unlocked",
"conditions": {
"recipe": "minecraft:porcelain_piece_grinding"
}
}
},
"requirements": [
[
"has_porcelain_piece",
"has_the_recipe"
]
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"parent": "minecraft:recipes/root",
"rewards": {
"recipes": [
"minecraft:porcelain_parts_from_blue_and_white_porcelain_piece"
]
},
"criteria": {
"has_blue_and_white_porcelain_piece": {
"trigger": "minecraft:inventory_changed",
"conditions": {
"items": [
{
"items": [
"ultramarine:blue_and_white_porcelain_piece"
]
}
]
}
},
"has_the_recipe": {
"trigger": "minecraft:recipe_unlocked",
"conditions": {
"recipe": "minecraft:porcelain_parts_from_blue_and_white_porcelain_piece"
}
}
},
"requirements": [
[
"has_blue_and_white_porcelain_piece",
"has_the_recipe"
]
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"parent": "minecraft:recipes/root",
"rewards": {
"recipes": [
"minecraft:porcelain_parts_from_porcelain_piece"
]
},
"criteria": {
"has_porcelain_piece": {
"trigger": "minecraft:inventory_changed",
"conditions": {
"items": [
{
"items": [
"ultramarine:porcelain_piece"
]
}
]
}
},
"has_the_recipe": {
"trigger": "minecraft:recipe_unlocked",
"conditions": {
"recipe": "minecraft:porcelain_parts_from_porcelain_piece"
}
}
},
"requirements": [
[
"has_porcelain_piece",
"has_the_recipe"
]
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"type": "minecraft:stonecutting",
"ingredient": {
"item": "ultramarine:blue_and_white_porcelain_piece"
},
"result": "minecraft:clay_ball",
"count": 1
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"type": "minecraft:stonecutting",
"ingredient": {
"item": "ultramarine:porcelain_piece"
},
"result": "ultramarine:porcelain_parts",
"count": 1
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"type": "minecraft:stonecutting",
"ingredient": {
"item": "ultramarine:porcelain_piece"
},
"result": "minecraft:clay_ball",
"count": 1
}
Original file line number Diff line number Diff line change
Expand Up @@ -753,6 +753,7 @@ public class ItemRegistry {

public static final RegistryObject<Item> BLUE_AND_WHITE_PORCELAIN_PIECE = simpleItem("blue_and_white_porcelain_piece", ModCreativeTab.MATERIALS);
public static final RegistryObject<Item> BLUE_AND_WHITE_PORCELAIN_SHARDS = simpleItem("blue_and_white_porcelain_shards", ModCreativeTab.MATERIALS);
public static final RegistryObject<Item> PORCELAIN_PIECE = simpleItem("porcelain_piece", ModCreativeTab.MATERIALS);

// PARTS

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,21 +60,26 @@ protected void addTables() {
abundantOre(BlockRegistry.DEEPSLATE_MAGNESITE_ORE, ItemRegistry.MAGNESITE);
ore(BlockRegistry.NETHER_COBALT_ORE, ItemRegistry.RAW_COBALT);

porcelain(BlockRegistry.BLUE_AND_WHITE_PORCELAIN_FLOWERPOT, ItemRegistry.BLUE_AND_WHITE_PORCELAIN_PIECE, ItemRegistry.BLUE_AND_WHITE_PORCELAIN_SHARDS);
porcelainWithShards(BlockRegistry.BLUE_AND_WHITE_PORCELAIN_FLOWERPOT, ItemRegistry.BLUE_AND_WHITE_PORCELAIN_PIECE, ItemRegistry.BLUE_AND_WHITE_PORCELAIN_SHARDS);
//todo blue porcelain flowerpot
porcelain(BlockRegistry.BLUE_AND_WHITE_PORCELAIN_VASE, ItemRegistry.BLUE_AND_WHITE_PORCELAIN_PIECE, ItemRegistry.BLUE_AND_WHITE_PORCELAIN_SHARDS);
porcelain(BlockRegistry.LARGE_BLUE_AND_WHITE_PORCELAIN_VASE, ItemRegistry.BLUE_AND_WHITE_PORCELAIN_PIECE, ItemRegistry.BLUE_AND_WHITE_PORCELAIN_SHARDS);
porcelain(BlockRegistry.SHORT_BLUE_AND_WHITE_PORCELAIN_POT, ItemRegistry.BLUE_AND_WHITE_PORCELAIN_PIECE, ItemRegistry.BLUE_AND_WHITE_PORCELAIN_SHARDS);
porcelain(BlockRegistry.TALL_BLUE_AND_WHITE_PORCELAIN_POT, ItemRegistry.BLUE_AND_WHITE_PORCELAIN_PIECE, ItemRegistry.BLUE_AND_WHITE_PORCELAIN_SHARDS);
porcelain(BlockRegistry.BLUE_AND_WHITE_PORCELAIN_BOWL, ItemRegistry.BLUE_AND_WHITE_PORCELAIN_PIECE, ItemRegistry.BLUE_AND_WHITE_PORCELAIN_SHARDS);
porcelain(BlockRegistry.WINE_POT, ItemRegistry.BLUE_AND_WHITE_PORCELAIN_PIECE, ItemRegistry.BLUE_AND_WHITE_PORCELAIN_SHARDS);
porcelainWithShards(BlockRegistry.BLUE_AND_WHITE_PORCELAIN_VASE, ItemRegistry.BLUE_AND_WHITE_PORCELAIN_PIECE, ItemRegistry.BLUE_AND_WHITE_PORCELAIN_SHARDS);
porcelainWithShards(BlockRegistry.LARGE_BLUE_AND_WHITE_PORCELAIN_VASE, ItemRegistry.BLUE_AND_WHITE_PORCELAIN_PIECE, ItemRegistry.BLUE_AND_WHITE_PORCELAIN_SHARDS);
porcelainWithShards(BlockRegistry.SHORT_BLUE_AND_WHITE_PORCELAIN_POT, ItemRegistry.BLUE_AND_WHITE_PORCELAIN_PIECE, ItemRegistry.BLUE_AND_WHITE_PORCELAIN_SHARDS);
porcelainWithShards(BlockRegistry.TALL_BLUE_AND_WHITE_PORCELAIN_POT, ItemRegistry.BLUE_AND_WHITE_PORCELAIN_PIECE, ItemRegistry.BLUE_AND_WHITE_PORCELAIN_SHARDS);
porcelainWithShards(BlockRegistry.BLUE_AND_WHITE_PORCELAIN_BOWL, ItemRegistry.BLUE_AND_WHITE_PORCELAIN_PIECE, ItemRegistry.BLUE_AND_WHITE_PORCELAIN_SHARDS);
porcelainWithShards(BlockRegistry.WINE_POT, ItemRegistry.BLUE_AND_WHITE_PORCELAIN_PIECE, ItemRegistry.BLUE_AND_WHITE_PORCELAIN_SHARDS);
porcelainPlate(BlockRegistry.PLATED_MOONCAKES, ItemRegistry.BLUE_AND_WHITE_PORCELAIN_PIECE, ItemRegistry.BLUE_AND_WHITE_PORCELAIN_SHARDS);
plateDrop(BlockRegistry.PLATED_MUNG_BEAN_CAKES);
plateDrop(BlockRegistry.PLATED_HAM);
plateDrop(BlockRegistry.PLATED_FISH);



porcelain(BlockRegistry.SMALL_WHITE_PORCELAIN_VASE_BONSAI, ItemRegistry.PORCELAIN_PIECE);
porcelain(BlockRegistry.MEDIUM_WHITE_PORCELAIN_VASE_BONSAI, ItemRegistry.PORCELAIN_PIECE);
porcelain(BlockRegistry.LARGE_WHITE_PORCELAIN_VASE_BONSAI, ItemRegistry.PORCELAIN_PIECE);
porcelain(BlockRegistry.SMALL_GREEN_PORCELAIN_VASE_BONSAI, ItemRegistry.PORCELAIN_PIECE);
porcelain(BlockRegistry.GREEN_PORCELAIN_VASE_BONSAI, ItemRegistry.PORCELAIN_PIECE);
porcelain(BlockRegistry.TALL_BLUE_VASE_BONSAI, ItemRegistry.PORCELAIN_PIECE);
porcelainWithShards(BlockRegistry.TALL_BLUE_AND_WHITE_PORCELAIN_BONSAI, ItemRegistry.BLUE_AND_WHITE_PORCELAIN_PIECE, ItemRegistry.BLUE_AND_WHITE_PORCELAIN_SHARDS);

slab(BlockRegistry.CYAN_BRICK_SLAB, ItemRegistry.CYAN_BRICK_SLAB);
slab(BlockRegistry.BLACK_BRICK_SLAB, ItemRegistry.BLACK_BRICK_SLAB);
Expand All @@ -101,13 +106,17 @@ void abundantOre(RegistryObject<? extends Block> block, RegistryObject<? extends
addLootTable(block.get(), createAbundantOreDrop(block.getId().getPath(), block.get(), item.get(), 1, 3));
}

void porcelain(RegistryObject<? extends Block> block, RegistryObject<? extends Item> piece, RegistryObject<? extends Item> shards){
addLootTable(block.get(), createPorcelainDrop(block.getId().getPath(), block.get(), piece.get(), shards.get()));
void porcelain(RegistryObject<? extends Block> block, RegistryObject<? extends Item> piece){
addLootTable(block.get(), createPorcelainDrop(block.getId().getPath(), block.get(), piece.get()));
}

void porcelainWithShards(RegistryObject<? extends Block> block, RegistryObject<? extends Item> piece, RegistryObject<? extends Item> shards){
addLootTable(block.get(), createPorcelainDropWithShard(block.getId().getPath(), block.get(), piece.get(), shards.get()));
}

void porcelainPlate(RegistryObject<? extends Block> block, RegistryObject<? extends Item> piece, RegistryObject<? extends Item> shards) {
if (block.get() instanceof ConsumableDecorativeBlock consumable && consumable.getPlate().getItem() instanceof BlockItem blockItem)
addLootTable(block.get(), createPorcelainDrop(block.getId().getPath(), blockItem.getBlock(), piece.get(), shards.get()));
addLootTable(block.get(), createPorcelainDropWithShard(block.getId().getPath(), blockItem.getBlock(), piece.get(), shards.get()));
else LOGGER.warn("Porcelain plate loot table was not added for block " + block.get().getDescriptionId());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1812,7 +1812,14 @@ private static void categoryMaterials(@NotNull Consumer<FinishedRecipe> recipeCo
compositeSmelting(ItemRegistry.TALL_BLUE_PORCELAIN_VASE.get(), ItemRegistry.TALL_CLAY_VASE.get(), Items.BLUE_DYE, 0.1f, 200, recipeConsumer);
compositeSmelting(ItemRegistry.TALL_BLUE_AND_WHITE_PORCELAIN_VASE.get(), ItemRegistry.TALL_CLAY_VASE.get(), ItemRegistry.BLUE_AND_WHITE_GLAZE_POWDER.get(), 0.1f, 200, recipeConsumer);

// PORCELAIN dropped by porcelain blocks
// PORCELAIN

SingleItemRecipeBuilder.stonecutting(Ingredient.of(ItemRegistry.PORCELAIN_PIECE.get()), Items.CLAY_BALL)
.unlockedBy(itemUnlockName(ItemRegistry.PORCELAIN_PIECE.get()), itemCriterion(ItemRegistry.PORCELAIN_PIECE.get()))
.save(recipeConsumer, "porcelain_piece_grinding");
SingleItemRecipeBuilder.stonecutting(Ingredient.of(ItemRegistry.BLUE_AND_WHITE_PORCELAIN_PIECE.get()), Items.CLAY_BALL)
.unlockedBy(itemUnlockName(ItemRegistry.BLUE_AND_WHITE_PORCELAIN_PIECE.get()), itemCriterion(ItemRegistry.BLUE_AND_WHITE_PORCELAIN_PIECE.get()))
.save(recipeConsumer, "blue_and_white_porcelain_piece_grinding");

// PARTS

Expand All @@ -1823,7 +1830,12 @@ private static void categoryMaterials(@NotNull Consumer<FinishedRecipe> recipeCo
SingleItemRecipeBuilder.stonecutting(Ingredient.of(ItemRegistry.JADE.get()), ItemRegistry.JADE_PARTS.get(), 2)
.unlockedBy(itemUnlockName(ItemRegistry.JADE.get()), itemCriterion(ItemRegistry.JADE.get()))
.save(recipeConsumer);
simpleStonecutting(ItemRegistry.BLUE_AND_WHITE_PORCELAIN_PIECE.get(), ItemRegistry.PORCELAIN_PARTS.get(), recipeConsumer); //todo add porcelain variants
SingleItemRecipeBuilder.stonecutting(Ingredient.of(ItemRegistry.BLUE_AND_WHITE_PORCELAIN_PIECE.get()), ItemRegistry.PORCELAIN_PARTS.get())
.unlockedBy(itemUnlockName(ItemRegistry.BLUE_AND_WHITE_PORCELAIN_PIECE.get()), itemCriterion(ItemRegistry.BLUE_AND_WHITE_PORCELAIN_PIECE.get()))
.save(recipeConsumer, "porcelain_parts_from_blue_and_white_porcelain_piece");
SingleItemRecipeBuilder.stonecutting(Ingredient.of(ItemRegistry.PORCELAIN_PIECE.get()), ItemRegistry.PORCELAIN_PARTS.get())
.unlockedBy(itemUnlockName(ItemRegistry.PORCELAIN_PIECE.get()), itemCriterion(ItemRegistry.PORCELAIN_PIECE.get()))
.save(recipeConsumer, "porcelain_parts_from_porcelain_piece");
SingleItemRecipeBuilder.stonecutting(Ingredient.of(ItemRegistry.BRONZE_INGOT.get()), ItemRegistry.BRONZE_PARTS.get(), 2)
.unlockedBy(itemUnlockName(ItemRegistry.BRONZE_INGOT.get()), itemCriterion(ItemRegistry.BRONZE_INGOT.get()))
.save(recipeConsumer);
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 601c806

Please sign in to comment.