From 363910101ec864e18809b14f55ff7a15a955a9bb Mon Sep 17 00:00:00 2001 From: bconlon Date: Thu, 26 Sep 2024 12:14:22 -0700 Subject: [PATCH] improv: proper block mineability --- .../59eb3dbb5f86130e09b3c62d89b9525ee01cf52d | 3 +++ .../f6a74cd8da2df68a12670b9fea0a3123992a1ca1 | 3 ++- .../loot_tables/blocks/pyral_block.json | 20 +++++++++++++++++++ .../loot_tables/blocks/valkyrum_block.json | 20 +++++++++++++++++++ .../tags/blocks/needs_iron_tool.json | 6 ++++++ .../block/ReforgingBlocks.java | 4 ++-- .../data/ReforgingData.java | 6 ++---- .../generators/loot/ReforgingBlockLoot.java | 8 ++++++++ .../tags/ReforgingBlockTagData.java | 3 +++ 9 files changed, 66 insertions(+), 7 deletions(-) create mode 100644 src/generated/resources/.cache/59eb3dbb5f86130e09b3c62d89b9525ee01cf52d create mode 100644 src/generated/resources/data/aether/loot_tables/blocks/pyral_block.json create mode 100644 src/generated/resources/data/aether/loot_tables/blocks/valkyrum_block.json create mode 100644 src/generated/resources/data/minecraft/tags/blocks/needs_iron_tool.json diff --git a/src/generated/resources/.cache/59eb3dbb5f86130e09b3c62d89b9525ee01cf52d b/src/generated/resources/.cache/59eb3dbb5f86130e09b3c62d89b9525ee01cf52d new file mode 100644 index 0000000..2099f97 --- /dev/null +++ b/src/generated/resources/.cache/59eb3dbb5f86130e09b3c62d89b9525ee01cf52d @@ -0,0 +1,3 @@ +// 1.19.4 2024-09-26T12:14:01.5437642 Loot Tables +6ec8d4cf44fafe9a7498266804eccce403459e64 data/aether/loot_tables/blocks/pyral_block.json +73f0dcb1483cc00c50559edabae00c48d8d3c171 data/aether/loot_tables/blocks/valkyrum_block.json diff --git a/src/generated/resources/.cache/f6a74cd8da2df68a12670b9fea0a3123992a1ca1 b/src/generated/resources/.cache/f6a74cd8da2df68a12670b9fea0a3123992a1ca1 index 4451361..fa367bd 100644 --- a/src/generated/resources/.cache/f6a74cd8da2df68a12670b9fea0a3123992a1ca1 +++ b/src/generated/resources/.cache/f6a74cd8da2df68a12670b9fea0a3123992a1ca1 @@ -1,3 +1,4 @@ -// 1.19.4 2024-05-09T14:08:13.1975917 Tags for minecraft:block mod id aether_treasure_reforging +// 1.19.4 2024-09-26T12:14:01.5957595 Tags for minecraft:block mod id aether_treasure_reforging 2ef60f386a62d5b7f99c520a1390f317b79e22aa data/forge/tags/blocks/storage_blocks.json 2ef60f386a62d5b7f99c520a1390f317b79e22aa data/minecraft/tags/blocks/mineable/pickaxe.json +2ef60f386a62d5b7f99c520a1390f317b79e22aa data/minecraft/tags/blocks/needs_iron_tool.json diff --git a/src/generated/resources/data/aether/loot_tables/blocks/pyral_block.json b/src/generated/resources/data/aether/loot_tables/blocks/pyral_block.json new file mode 100644 index 0000000..7e9afb5 --- /dev/null +++ b/src/generated/resources/data/aether/loot_tables/blocks/pyral_block.json @@ -0,0 +1,20 @@ +{ + "type": "minecraft:block", + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ], + "entries": [ + { + "type": "minecraft:item", + "name": "aether_treasure_reforging:pyral_block" + } + ], + "rolls": 1.0 + } + ] +} \ No newline at end of file diff --git a/src/generated/resources/data/aether/loot_tables/blocks/valkyrum_block.json b/src/generated/resources/data/aether/loot_tables/blocks/valkyrum_block.json new file mode 100644 index 0000000..d982ce6 --- /dev/null +++ b/src/generated/resources/data/aether/loot_tables/blocks/valkyrum_block.json @@ -0,0 +1,20 @@ +{ + "type": "minecraft:block", + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ], + "entries": [ + { + "type": "minecraft:item", + "name": "aether_treasure_reforging:valkyrum_block" + } + ], + "rolls": 1.0 + } + ] +} \ No newline at end of file diff --git a/src/generated/resources/data/minecraft/tags/blocks/needs_iron_tool.json b/src/generated/resources/data/minecraft/tags/blocks/needs_iron_tool.json new file mode 100644 index 0000000..77d9d46 --- /dev/null +++ b/src/generated/resources/data/minecraft/tags/blocks/needs_iron_tool.json @@ -0,0 +1,6 @@ +{ + "values": [ + "aether:valkyrum_block", + "aether:pyral_block" + ] +} \ No newline at end of file diff --git a/src/main/java/com/aetherteam/treasure_reforging/block/ReforgingBlocks.java b/src/main/java/com/aetherteam/treasure_reforging/block/ReforgingBlocks.java index f9927eb..b456d80 100644 --- a/src/main/java/com/aetherteam/treasure_reforging/block/ReforgingBlocks.java +++ b/src/main/java/com/aetherteam/treasure_reforging/block/ReforgingBlocks.java @@ -20,8 +20,8 @@ public class ReforgingBlocks { public static final DeferredRegister BLOCKS = DeferredRegister.create(ForgeRegistries.BLOCKS, Aether.MODID); - public static final RegistryObject VALKYRUM_BLOCK = register("valkyrum_block", () -> new FacingPillarBlock(Block.Properties.of(Material.METAL, MaterialColor.QUARTZ).strength(50.0F, 1200.0F).requiresCorrectToolForDrops().sound(SoundType.METAL))); - public static final RegistryObject PYRAL_BLOCK = register("pyral_block", () -> new Block(Block.Properties.of(Material.METAL, MaterialColor.COLOR_ORANGE).strength(50.0F, 1200.0F).requiresCorrectToolForDrops().sound(SoundType.METAL))); + public static final RegistryObject VALKYRUM_BLOCK = register("valkyrum_block", () -> new FacingPillarBlock(Block.Properties.of(Material.METAL, MaterialColor.QUARTZ).strength(5.0F, 6.0F).requiresCorrectToolForDrops().sound(SoundType.METAL))); + public static final RegistryObject PYRAL_BLOCK = register("pyral_block", () -> new Block(Block.Properties.of(Material.METAL, MaterialColor.COLOR_ORANGE).strength(5.0F, 6.0F).requiresCorrectToolForDrops().sound(SoundType.METAL))); private static RegistryObject baseRegister(String name, Supplier block, Function, Supplier> item) { RegistryObject register = BLOCKS.register(name, block); diff --git a/src/main/java/com/aetherteam/treasure_reforging/data/ReforgingData.java b/src/main/java/com/aetherteam/treasure_reforging/data/ReforgingData.java index 94ade07..7cad37c 100644 --- a/src/main/java/com/aetherteam/treasure_reforging/data/ReforgingData.java +++ b/src/main/java/com/aetherteam/treasure_reforging/data/ReforgingData.java @@ -1,9 +1,6 @@ package com.aetherteam.treasure_reforging.data; -import com.aetherteam.treasure_reforging.data.generators.ReforgingBlockStateData; -import com.aetherteam.treasure_reforging.data.generators.ReforgingItemModelData; -import com.aetherteam.treasure_reforging.data.generators.ReforgingLanguageData; -import com.aetherteam.treasure_reforging.data.generators.ReforgingRecipeData; +import com.aetherteam.treasure_reforging.data.generators.*; import com.aetherteam.treasure_reforging.data.generators.tags.ReforgingBlockTagData; import com.aetherteam.treasure_reforging.data.generators.tags.ReforgingItemTagData; import net.minecraft.SharedConstants; @@ -34,6 +31,7 @@ public static void dataSetup(GatherDataEvent event) { // Server Data generator.addProvider(event.includeServer(), new ReforgingRecipeData(packOutput)); + generator.addProvider(event.includeServer(), ReforgingLootTableData.create(packOutput)); ReforgingBlockTagData blockTags = new ReforgingBlockTagData(packOutput, lookupProvider, fileHelper); generator.addProvider(event.includeServer(), blockTags); generator.addProvider(event.includeServer(), new ReforgingItemTagData(packOutput, lookupProvider, blockTags.contentsGetter(), fileHelper)); diff --git a/src/main/java/com/aetherteam/treasure_reforging/data/generators/loot/ReforgingBlockLoot.java b/src/main/java/com/aetherteam/treasure_reforging/data/generators/loot/ReforgingBlockLoot.java index 7ff975d..fdad255 100644 --- a/src/main/java/com/aetherteam/treasure_reforging/data/generators/loot/ReforgingBlockLoot.java +++ b/src/main/java/com/aetherteam/treasure_reforging/data/generators/loot/ReforgingBlockLoot.java @@ -4,8 +4,11 @@ import com.aetherteam.treasure_reforging.block.ReforgingBlocks; import net.minecraft.world.flag.FeatureFlags; import net.minecraft.world.item.Item; +import net.minecraft.world.level.block.Block; import java.util.Set; +import java.util.function.Supplier; +import java.util.stream.Collectors; public class ReforgingBlockLoot extends NitrogenBlockLootSubProvider { private static final Set EXPLOSION_RESISTANT = Set.of(); @@ -19,4 +22,9 @@ public void generate() { this.dropSelf(ReforgingBlocks.VALKYRUM_BLOCK.get()); this.dropSelf(ReforgingBlocks.PYRAL_BLOCK.get()); } + + @Override + public Iterable getKnownBlocks() { + return ReforgingBlocks.BLOCKS.getEntries().stream().map(Supplier::get).collect(Collectors.toList()); + } } diff --git a/src/main/java/com/aetherteam/treasure_reforging/data/generators/tags/ReforgingBlockTagData.java b/src/main/java/com/aetherteam/treasure_reforging/data/generators/tags/ReforgingBlockTagData.java index b2e7cf1..a09b2e2 100644 --- a/src/main/java/com/aetherteam/treasure_reforging/data/generators/tags/ReforgingBlockTagData.java +++ b/src/main/java/com/aetherteam/treasure_reforging/data/generators/tags/ReforgingBlockTagData.java @@ -22,6 +22,9 @@ public void addTags(HolderLookup.Provider provider) { this.tag(BlockTags.MINEABLE_WITH_PICKAXE).add( ReforgingBlocks.VALKYRUM_BLOCK.get(), ReforgingBlocks.PYRAL_BLOCK.get()); + this.tag(BlockTags.NEEDS_IRON_TOOL).add( + ReforgingBlocks.VALKYRUM_BLOCK.get(), + ReforgingBlocks.PYRAL_BLOCK.get()); this.tag(Tags.Blocks.STORAGE_BLOCKS).add( ReforgingBlocks.VALKYRUM_BLOCK.get(),