Skip to content

Commit

Permalink
improv: proper block mineability
Browse files Browse the repository at this point in the history
  • Loading branch information
bconlon1 committed Sep 26, 2024
1 parent d9ca5d7 commit 5c59bdc
Show file tree
Hide file tree
Showing 9 changed files with 67 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// 1.20.4 2024-09-26T11:12:33.5755532 Loot Tables
dbf3240a71731dbbf8e009549358fe06b1606d8f data/aether/loot_tables/blocks/pyral_block.json
d324f3492facdf203fc3d8b1d86c5d86f01b5453 data/aether/loot_tables/blocks/valkyrum_block.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// 1.20.4 2024-05-10T22:53:15.5331013 Tags for minecraft:block mod id aether_treasure_reforging
// 1.20.4 2024-09-26T10:52:05.454581 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
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"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
}
],
"random_sequence": "aether:blocks/pyral_block"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"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
}
],
"random_sequence": "aether:blocks/valkyrum_block"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"values": [
"aether:valkyrum_block",
"aether:pyral_block"
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
public class ReforgingBlocks {
public static final DeferredRegister.Blocks BLOCKS = DeferredRegister.createBlocks(Aether.MODID);

public static final DeferredBlock<FacingPillarBlock> VALKYRUM_BLOCK = register("valkyrum_block", () -> new FacingPillarBlock(Block.Properties.of().mapColor(MapColor.QUARTZ).instrument(NoteBlockInstrument.CHIME).strength(50.0F, 1200.0F).requiresCorrectToolForDrops().sound(SoundType.METAL)));
public static final DeferredBlock<Block> PYRAL_BLOCK = register("pyral_block", () -> new Block(Block.Properties.of().mapColor(MapColor.COLOR_ORANGE).instrument(NoteBlockInstrument.DIDGERIDOO).strength(50.0F, 1200.0F).requiresCorrectToolForDrops().sound(SoundType.METAL)));
public static final DeferredBlock<FacingPillarBlock> VALKYRUM_BLOCK = register("valkyrum_block", () -> new FacingPillarBlock(Block.Properties.of().mapColor(MapColor.QUARTZ).instrument(NoteBlockInstrument.CHIME).strength(5.0F, 6.0F).requiresCorrectToolForDrops().sound(SoundType.METAL)));
public static final DeferredBlock<Block> PYRAL_BLOCK = register("pyral_block", () -> new Block(Block.Properties.of().mapColor(MapColor.COLOR_ORANGE).instrument(NoteBlockInstrument.DIDGERIDOO).strength(5.0F, 6.0F).requiresCorrectToolForDrops().sound(SoundType.METAL)));

private static <T extends Block> DeferredBlock<T> baseRegister(String name, Supplier<? extends T> block, Function<DeferredBlock<T>, Supplier<? extends Item>> item) {
DeferredBlock<T> register = BLOCKS.register(name, block);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ public static void dataSetup(GatherDataEvent event) {
// Server Data
generator.addProvider(event.includeServer(), new ReforgingRegistrySets(packOutput, lookupProvider));
generator.addProvider(event.includeServer(), new ReforgingRecipeData(packOutput));
generator.addProvider(event.includeServer(), ReforgingLootTableData.create(packOutput));
generator.addProvider(event.includeServer(), new ReforgingLootModifierData(packOutput));
ReforgingBlockTagData blockTags = new ReforgingBlockTagData(packOutput, lookupProvider, fileHelper);
generator.addProvider(event.includeServer(), blockTags);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<Item> EXPLOSION_RESISTANT = Set.of();
Expand All @@ -19,4 +22,9 @@ public void generate() {
this.dropSelf(ReforgingBlocks.VALKYRUM_BLOCK.get());
this.dropSelf(ReforgingBlocks.PYRAL_BLOCK.get());
}

@Override
public Iterable<Block> getKnownBlocks() {
return ReforgingBlocks.BLOCKS.getEntries().stream().map(Supplier::get).collect(Collectors.toList());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down

0 comments on commit 5c59bdc

Please sign in to comment.