From 62eff8f1978c84fe1897baecffca38f79439fb7e Mon Sep 17 00:00:00 2001 From: LocusAzzurro Date: Mon, 24 Jun 2024 22:55:48 +0200 Subject: [PATCH] :sparkles: add painting scroll source and painting drops --- src/generated/resources/.cache/cache | 5 +- .../damaged_landscape_painting.json | 34 ++++++++++ .../loot_tables/blocks/painting_scroll.json | 67 ++++++++++++++++++- .../recipes/damaged_landscape_painting.json | 9 +++ .../datagen/BaseLootTableProvider.java | 6 +- .../datagen/ModLootTableProvider.java | 22 ++++++ .../datagen/ModRecipeProvider.java | 7 +- .../ultramarine/event/CommonEventHandler.java | 2 +- .../world/entity/TravellingMerchant.java | 1 + 9 files changed, 146 insertions(+), 7 deletions(-) create mode 100644 src/generated/resources/data/ultramarine/advancements/recipes/ultramarine.decorations/damaged_landscape_painting.json create mode 100644 src/generated/resources/data/ultramarine/recipes/damaged_landscape_painting.json diff --git a/src/generated/resources/.cache/cache b/src/generated/resources/.cache/cache index 21027f49..5ee09f0a 100644 --- a/src/generated/resources/.cache/cache +++ b/src/generated/resources/.cache/cache @@ -3544,6 +3544,7 @@ d0ddfc2e647cafd4b310d3be4dc9965750a52a61 data/ultramarine/advancements/recipes/u c1ed0e5452d61e615f78fa42f9f89376e6a84247 data/ultramarine/advancements/recipes/ultramarine.decorations/chessboard.json ad77f0ad0b41af07928f3bc4fe6e34a791f58aa4 data/ultramarine/advancements/recipes/ultramarine.decorations/couplet.json 62ed9ef342ec8d93b1bc0edc32c7b46490000bc9 data/ultramarine/advancements/recipes/ultramarine.decorations/couplet_top.json +522c84da2ef0f17f0fa9bbfbe317dc7cc97c540e data/ultramarine/advancements/recipes/ultramarine.decorations/damaged_landscape_painting.json 555fc62e5f4823ef79ace948cd7b4c4558092aa4 data/ultramarine/advancements/recipes/ultramarine.decorations/food_hamper.json 14a94ed9dbe49d5260b8290e9d2b91e14c43ce9e data/ultramarine/advancements/recipes/ultramarine.decorations/fruit_box.json 00be1a48bda60ea6d45ea04b0f6c706d30ddece0 data/ultramarine/advancements/recipes/ultramarine.decorations/fu_mark.json @@ -4244,7 +4245,7 @@ a5cc18f62ca479fd3f215531dac6955a362918b1 data/ultramarine/loot_tables/blocks/mix 09ffb768e8008e5c874ce1fcd49a54194adc6593 data/ultramarine/loot_tables/blocks/orange_and_green_carved_wood.json 360c63012577e6e8d1fa7c24dc13c37a33a1a033 data/ultramarine/loot_tables/blocks/painted_chair.json 3d72a967775fc50dbc1ca48679201c9b0946f5f0 data/ultramarine/loot_tables/blocks/painted_screen.json -60858d45b02e1be5171ba0a1932e5da5f7c038dc data/ultramarine/loot_tables/blocks/painting_scroll.json +7fb577c32a896f593dc2532292f687d0afde758e data/ultramarine/loot_tables/blocks/painting_scroll.json 94a96e424ac76db32ac8cc9b583cd1863dc9e9bf data/ultramarine/loot_tables/blocks/pale_yellow_stone.json 69330bb178e5ecd8b526093d5302ad07a8cbe59f data/ultramarine/loot_tables/blocks/pale_yellow_stone_slab.json 45ab62be5eccb32bec09c6f11b6648b6ce91d6b9 data/ultramarine/loot_tables/blocks/pale_yellow_stone_stairs.json @@ -4261,6 +4262,7 @@ b8703adccbe5ab2ca3cd09075b58be44c9b40e60 data/ultramarine/loot_tables/blocks/pol ce62c554a55c6006d7b9c4e86871f0c23517a337 data/ultramarine/loot_tables/blocks/polished_weathered_stone_wall.json 55c6ec49997b794744a28d923c43c3a1aaf7c78a data/ultramarine/loot_tables/blocks/porcelain_inlaid_grand_chair.json 33e2e56619be0b7605698d58e82f23c4abfc643a data/ultramarine/loot_tables/blocks/porcelain_inlaid_table.json +812d325910134691ecdc1d881da4fd277b4be97b data/ultramarine/loot_tables/blocks/porcelain_teapot.json 4c92107bc2cb84bf95964715a3aa5693dd6f7d55 data/ultramarine/loot_tables/blocks/portrait.json 1ba9089a0a8986a8eb139b74415ee94d176f9ee0 data/ultramarine/loot_tables/blocks/purple_silk_fabric_roll.json 0fdb63a81b334329d861b20993679701ceab7c66 data/ultramarine/loot_tables/blocks/qing_golden_dragon_ceiling.json @@ -4583,6 +4585,7 @@ f04a477aaa97b4864c091c6196c6dda450526e3a data/ultramarine/recipes/cyan_floor_til e2726a703d8b4d999267b7025761437ccfa23b34 data/ultramarine/recipes/cyan_roof_tile_edge.json a305a61acb8395726265fcf23c91c727acf763e4 data/ultramarine/recipes/cyan_roof_tile_stairs.json e0051edda41d342d65dc941b4df32740d3ae557a data/ultramarine/recipes/cyan_roof_tiles.json +6d8a439a71704ae7c989536912e10c6e86dbdad0 data/ultramarine/recipes/damaged_landscape_painting.json 1aa1b6cd1784b4d1af58688f25e5d499f37825b4 data/ultramarine/recipes/dark_blue_and_dark_green_carved_wood.json b811fc9aaae904b6bf1d13e0e04d9cf1f61cc2b6 data/ultramarine/recipes/dark_blue_fangxin.json aa9f67e7db38550645ee6e2eae2e45b63d844e30 data/ultramarine/recipes/dark_blue_fangxin_edge.json diff --git a/src/generated/resources/data/ultramarine/advancements/recipes/ultramarine.decorations/damaged_landscape_painting.json b/src/generated/resources/data/ultramarine/advancements/recipes/ultramarine.decorations/damaged_landscape_painting.json new file mode 100644 index 00000000..6854eb31 --- /dev/null +++ b/src/generated/resources/data/ultramarine/advancements/recipes/ultramarine.decorations/damaged_landscape_painting.json @@ -0,0 +1,34 @@ +{ + "parent": "minecraft:recipes/root", + "rewards": { + "recipes": [ + "ultramarine:damaged_landscape_painting" + ] + }, + "criteria": { + "has_horizontal_landscape_painting": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "items": [ + "ultramarine:horizontal_landscape_painting" + ] + } + ] + } + }, + "has_the_recipe": { + "trigger": "minecraft:recipe_unlocked", + "conditions": { + "recipe": "ultramarine:damaged_landscape_painting" + } + } + }, + "requirements": [ + [ + "has_horizontal_landscape_painting", + "has_the_recipe" + ] + ] +} \ No newline at end of file diff --git a/src/generated/resources/data/ultramarine/loot_tables/blocks/painting_scroll.json b/src/generated/resources/data/ultramarine/loot_tables/blocks/painting_scroll.json index c7150a4e..4052fa94 100644 --- a/src/generated/resources/data/ultramarine/loot_tables/blocks/painting_scroll.json +++ b/src/generated/resources/data/ultramarine/loot_tables/blocks/painting_scroll.json @@ -7,8 +7,71 @@ "bonus_rolls": 0.0, "entries": [ { - "type": "minecraft:item", - "name": "ultramarine:painting_scroll" + "type": "minecraft:alternatives", + "children": [ + { + "type": "minecraft:item", + "conditions": [ + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:match_tool", + "predicate": { + "items": [ + "minecraft:shears" + ] + } + } + } + ], + "name": "ultramarine:painting_scroll" + }, + { + "type": "minecraft:group", + "children": [ + { + "type": "minecraft:item", + "name": "minecraft:diamond" + }, + { + "type": "minecraft:item", + "name": "ultramarine:long_hanging_painting" + }, + { + "type": "minecraft:item", + "name": "ultramarine:white_landscape_painting" + }, + { + "type": "minecraft:item", + "name": "ultramarine:horizontal_old_landscape_painting" + }, + { + "type": "minecraft:item", + "name": "ultramarine:horizontal_calligraphy" + }, + { + "type": "minecraft:item", + "name": "ultramarine:horizontal_landscape_painting" + }, + { + "type": "minecraft:item", + "name": "ultramarine:long_yellow_hanging_painting" + }, + { + "type": "minecraft:item", + "name": "ultramarine:portrait" + }, + { + "type": "minecraft:item", + "name": "ultramarine:hanging_painting_fan" + }, + { + "type": "minecraft:item", + "name": "ultramarine:sincere_calligraphy" + } + ] + } + ] } ] } diff --git a/src/generated/resources/data/ultramarine/recipes/damaged_landscape_painting.json b/src/generated/resources/data/ultramarine/recipes/damaged_landscape_painting.json new file mode 100644 index 00000000..52413ff8 --- /dev/null +++ b/src/generated/resources/data/ultramarine/recipes/damaged_landscape_painting.json @@ -0,0 +1,9 @@ +{ + "type": "minecraft:smoking", + "ingredient": { + "item": "ultramarine:horizontal_landscape_painting" + }, + "result": "ultramarine:damaged_landscape_painting", + "experience": 0.1, + "cookingtime": 400 +} \ No newline at end of file diff --git a/src/main/java/com/voxelutopia/ultramarine/datagen/BaseLootTableProvider.java b/src/main/java/com/voxelutopia/ultramarine/datagen/BaseLootTableProvider.java index ef8c3323..0f0786f0 100644 --- a/src/main/java/com/voxelutopia/ultramarine/datagen/BaseLootTableProvider.java +++ b/src/main/java/com/voxelutopia/ultramarine/datagen/BaseLootTableProvider.java @@ -17,6 +17,7 @@ import net.minecraft.data.loot.LootTableProvider; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.item.Item; +import net.minecraft.world.item.Items; import net.minecraft.world.item.enchantment.Enchantments; import net.minecraft.world.level.ItemLike; import net.minecraft.world.level.block.Block; @@ -50,8 +51,9 @@ public abstract class BaseLootTableProvider extends LootTableProvider { private static final Logger LOGGER = Ultramarine.getLogger(); private static final Gson GSON = new GsonBuilder().setPrettyPrinting().disableHtmlEscaping().create(); - private static final LootItemCondition.Builder HAS_SILK_TOUCH = MatchTool.toolMatches(ItemPredicate.Builder.item().hasEnchantment(new EnchantmentPredicate(Enchantments.SILK_TOUCH, MinMaxBounds.Ints.atLeast(1)))); - private static final Set EXPLOSION_RESISTANT = Stream.of(Blocks.BEDROCK).map(ItemLike::asItem).collect(ImmutableSet.toImmutableSet());; + static final LootItemCondition.Builder HAS_SILK_TOUCH = MatchTool.toolMatches(ItemPredicate.Builder.item().hasEnchantment(new EnchantmentPredicate(Enchantments.SILK_TOUCH, MinMaxBounds.Ints.atLeast(1)))); + static final LootItemCondition.Builder HAS_SHEARS = MatchTool.toolMatches(ItemPredicate.Builder.item().of(Items.SHEARS)); + static final Set EXPLOSION_RESISTANT = Stream.of(Blocks.BEDROCK).map(ItemLike::asItem).collect(ImmutableSet.toImmutableSet());; protected final Map lootTables = new HashMap<>(); private final DataGenerator generator; diff --git a/src/main/java/com/voxelutopia/ultramarine/datagen/ModLootTableProvider.java b/src/main/java/com/voxelutopia/ultramarine/datagen/ModLootTableProvider.java index 263813da..fdc070bc 100644 --- a/src/main/java/com/voxelutopia/ultramarine/datagen/ModLootTableProvider.java +++ b/src/main/java/com/voxelutopia/ultramarine/datagen/ModLootTableProvider.java @@ -10,10 +10,14 @@ import net.minecraft.data.DataGenerator; import net.minecraft.world.item.BlockItem; import net.minecraft.world.item.Item; +import net.minecraft.world.item.Items; import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.OreBlock; import net.minecraft.world.level.block.SlabBlock; +import net.minecraft.world.level.storage.loot.LootPool; import net.minecraft.world.level.storage.loot.LootTable; +import net.minecraft.world.level.storage.loot.entries.LootItem; +import net.minecraft.world.level.storage.loot.providers.number.ConstantValue; import net.minecraftforge.registries.RegistryObject; import org.slf4j.Logger; @@ -45,6 +49,7 @@ public ModLootTableProvider(DataGenerator pGenerator) { }) .forEach(NON_SIMPLE_BLOCKS::add); NON_SIMPLE_BLOCKS.addAll(List.of( + BlockRegistry.PAINTING_SCROLL )); } @Override @@ -67,8 +72,10 @@ protected void addTables() { 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); + porcelain(BlockRegistry.PORCELAIN_TEAPOT, ItemRegistry.PORCELAIN_PIECE); 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); @@ -81,6 +88,21 @@ protected void addTables() { 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); + addLootTable(BlockRegistry.PAINTING_SCROLL.get(), LootTable.lootTable() + .withPool(LootPool.lootPool().name("painting_scroll").setRolls(ConstantValue.exactly(1.0F)) + .add(LootItem.lootTableItem(ItemRegistry.PAINTING_SCROLL.get()).when(HAS_SHEARS.invert()) + .otherwise(LootItem.lootTableItem(Items.DIAMOND) + .append(LootItem.lootTableItem(ItemRegistry.LONG_HANGING_PAINTING.get())) + .append(LootItem.lootTableItem(ItemRegistry.WHITE_LANDSCAPE_PAINTING.get())) + .append(LootItem.lootTableItem(ItemRegistry.HORIZONTAL_OLD_LANDSCAPE_PAINTING.get())) + .append(LootItem.lootTableItem(ItemRegistry.HORIZONTAL_CALLIGRAPHY.get())) + .append(LootItem.lootTableItem(ItemRegistry.HORIZONTAL_LANDSCAPE_PAINTING.get())) + .append(LootItem.lootTableItem(ItemRegistry.LONG_YELLOW_HANGING_PAINTING.get())) + .append(LootItem.lootTableItem(ItemRegistry.PORTRAIT.get())) + .append(LootItem.lootTableItem(ItemRegistry.HANGING_PAINTING_FAN.get())) + .append(LootItem.lootTableItem(ItemRegistry.SINCERE_CALLIGRAPHY.get())) + )))); + slab(BlockRegistry.CYAN_BRICK_SLAB, ItemRegistry.CYAN_BRICK_SLAB); slab(BlockRegistry.BLACK_BRICK_SLAB, ItemRegistry.BLACK_BRICK_SLAB); slab(BlockRegistry.BROWNISH_RED_STONE_BRICK_SLAB, ItemRegistry.BROWNISH_RED_STONE_BRICK_SLAB); diff --git a/src/main/java/com/voxelutopia/ultramarine/datagen/ModRecipeProvider.java b/src/main/java/com/voxelutopia/ultramarine/datagen/ModRecipeProvider.java index 76555977..70d6d2de 100644 --- a/src/main/java/com/voxelutopia/ultramarine/datagen/ModRecipeProvider.java +++ b/src/main/java/com/voxelutopia/ultramarine/datagen/ModRecipeProvider.java @@ -883,7 +883,7 @@ private static void categoryDecorations(@NotNull Consumer recipe ItemRegistry.ROYAL_CENSER.get(), 0.5f, 200) .unlockedBy(itemUnlockName(ItemRegistry.BRONZE_CENSER.get()), itemCriterion(ItemRegistry.BRONZE_CENSER.get())) .save(recipeConsumer); - //todo PORCELAIN_TEAPOT + // Porcelain Teapot sold by librarian ShapedRecipeBuilder.shaped(ItemRegistry.BOOTS.get()) .define('B', Items.LEATHER_BOOTS) .define('S', ItemRegistry.SILK.get()) @@ -1027,6 +1027,11 @@ private static void categoryDecorations(@NotNull Consumer recipe .unlockedBy("has_fence", tagUnlock(ItemTags.WOODEN_FENCES)) .save(recipeConsumer); + // WALL HANGING + + SimpleCookingRecipeBuilder.smoking(Ingredient.of(ItemRegistry.HORIZONTAL_LANDSCAPE_PAINTING.get()), ItemRegistry.DAMAGED_LANDSCAPE_PAINTING.get(), 0.1f, 400) + .unlockedBy(itemUnlockName(ItemRegistry.HORIZONTAL_LANDSCAPE_PAINTING.get()), itemCriterion(ItemRegistry.HORIZONTAL_LANDSCAPE_PAINTING.get())).save(recipeConsumer); + // FOOD ShapedRecipeBuilder.shaped(ItemRegistry.FOOD_HAMPER.get()) diff --git a/src/main/java/com/voxelutopia/ultramarine/event/CommonEventHandler.java b/src/main/java/com/voxelutopia/ultramarine/event/CommonEventHandler.java index 78be2261..c7235e00 100644 --- a/src/main/java/com/voxelutopia/ultramarine/event/CommonEventHandler.java +++ b/src/main/java/com/voxelutopia/ultramarine/event/CommonEventHandler.java @@ -239,7 +239,7 @@ public static void villagerTradesHandler(VillagerTradesEvent event){ } if (profession == VillagerProfession.LIBRARIAN){ - trades.get(5).add(($1, $2) -> new MerchantOffer( + trades.get(4).add(($1, $2) -> new MerchantOffer( new ItemStack(Items.EMERALD, 20), new ItemStack(ItemRegistry.XUAN_PAPER.get(), 4), 10, 20, 0.05f diff --git a/src/main/java/com/voxelutopia/ultramarine/world/entity/TravellingMerchant.java b/src/main/java/com/voxelutopia/ultramarine/world/entity/TravellingMerchant.java index 17386df8..44f3b19d 100644 --- a/src/main/java/com/voxelutopia/ultramarine/world/entity/TravellingMerchant.java +++ b/src/main/java/com/voxelutopia/ultramarine/world/entity/TravellingMerchant.java @@ -69,6 +69,7 @@ public Packet getAddEntityPacket() { new MerchantOffer(new ItemStack(ItemRegistry.COPPER_CASH_COIN.get(), 15), new ItemStack(ItemRegistry.PURPLE_SILK_FABRIC_ROLL.get()), 5, 5, 0.05f), new MerchantOffer(new ItemStack(ItemRegistry.COPPER_CASH_COIN.get(), 20), new ItemStack(ItemRegistry.CLAY_DOLL_MALE.get()), 5, 5, 0.05f), new MerchantOffer(new ItemStack(ItemRegistry.COPPER_CASH_COIN.get(), 20), new ItemStack(ItemRegistry.CLAY_DOLL_FEMALE.get()), 5, 5, 0.05f), + new MerchantOffer(new ItemStack(ItemRegistry.COPPER_CASH_COIN.get(), 30), new ItemStack(ItemRegistry.PAINTING_SCROLL.get()), 5, 5, 0.05f), new MerchantOffer(new ItemStack(ItemRegistry.COPPER_CASH_COIN.get(), 10), new ItemStack(ItemRegistry.CHINESE_HERBS_BAG.get()), 5, 5, 0.05f), new MerchantOffer(new ItemStack(Items.AMETHYST_SHARD), new ItemStack(ItemRegistry.COPPER_CASH_COIN.get(), 6), 8, 5, 0.05f), new MerchantOffer(new ItemStack(Items.ENDER_PEARL), new ItemStack(ItemRegistry.COPPER_CASH_COIN.get(), 3), 10, 5, 0.05f),