-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0282897
commit a9d42dc
Showing
6 changed files
with
98 additions
and
27 deletions.
There are no files selected for viewing
45 changes: 30 additions & 15 deletions
45
...r/metatags/minecraft/block/flammable.json → ...r/metatags/minecraft/block/flammable.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,69 +1,84 @@ | ||
{ | ||
"replace": false, | ||
"values": { | ||
"hollow:oak_hollow_log": { | ||
"hollow:acacia_hollow_log": { | ||
"burn": 5, | ||
"spread": 5 | ||
}, | ||
"hollow:stripped_oak_hollow_log": { | ||
"hollow:birch_hollow_log": { | ||
"burn": 5, | ||
"spread": 5 | ||
}, | ||
"hollow:spruce_hollow_log": { | ||
"hollow:cherry_hollow_log": { | ||
"burn": 5, | ||
"spread": 5 | ||
}, | ||
"hollow:stripped_spruce_hollow_log": { | ||
"hollow:crimson_hollow_stem": { | ||
"burn": 5, | ||
"spread": 5 | ||
}, | ||
"hollow:birch_hollow_log": { | ||
"hollow:dark_oak_hollow_log": { | ||
"burn": 5, | ||
"spread": 5 | ||
}, | ||
"hollow:stripped_birch_hollow_log": { | ||
"hollow:jungle_hollow_log": { | ||
"burn": 5, | ||
"spread": 5 | ||
}, | ||
"hollow:jungle_hollow_log": { | ||
"hollow:mangrove_hollow_log": { | ||
"burn": 5, | ||
"spread": 5 | ||
}, | ||
"hollow:stripped_jungle_hollow_log": { | ||
"hollow:oak_hollow_log": { | ||
"burn": 5, | ||
"spread": 5 | ||
}, | ||
"hollow:acacia_hollow_log": { | ||
"hollow:spruce_hollow_log": { | ||
"burn": 5, | ||
"spread": 5 | ||
}, | ||
"hollow:stripped_acacia_hollow_log": { | ||
"burn": 5, | ||
"spread": 5 | ||
}, | ||
"hollow:dark_oak_hollow_log": { | ||
"hollow:stripped_birch_hollow_log": { | ||
"burn": 5, | ||
"spread": 5 | ||
}, | ||
"hollow:stripped_dark_oak_hollow_log": { | ||
"hollow:stripped_cherry_hollow_log": { | ||
"burn": 5, | ||
"spread": 5 | ||
}, | ||
"hollow:cherry_hollow_log": { | ||
"hollow:stripped_crimson_hollow_stem": { | ||
"burn": 5, | ||
"spread": 5 | ||
}, | ||
"hollow:stripped_cherry_hollow_log": { | ||
"hollow:stripped_dark_oak_hollow_log": { | ||
"burn": 5, | ||
"spread": 5 | ||
}, | ||
"hollow:mangrove_hollow_log": { | ||
"hollow:stripped_jungle_hollow_log": { | ||
"burn": 5, | ||
"spread": 5 | ||
}, | ||
"hollow:stripped_mangrove_hollow_log": { | ||
"burn": 5, | ||
"spread": 5 | ||
}, | ||
"hollow:stripped_oak_hollow_log": { | ||
"burn": 5, | ||
"spread": 5 | ||
}, | ||
"hollow:stripped_spruce_hollow_log": { | ||
"burn": 5, | ||
"spread": 5 | ||
}, | ||
"hollow:stripped_warped_hollow_stem": { | ||
"burn": 5, | ||
"spread": 5 | ||
}, | ||
"hollow:warped_hollow_stem": { | ||
"burn": 5, | ||
"spread": 5 | ||
} | ||
} | ||
} |
1 change: 0 additions & 1 deletion
1
.../metatags/minecraft/block/oxidizable.json → .../metatags/minecraft/block/oxidizable.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 7 additions & 8 deletions
15
.../metatags/minecraft/block/strippable.json → .../metatags/minecraft/block/strippable.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,14 @@ | ||
{ | ||
"replace": false, | ||
"values": { | ||
"hollow:oak_hollow_log": "hollow:stripped_oak_hollow_log", | ||
"hollow:spruce_hollow_log": "hollow:stripped_spruce_hollow_log", | ||
"hollow:birch_hollow_log": "hollow:stripped_birch_hollow_log", | ||
"hollow:jungle_hollow_log": "hollow:stripped_jungle_hollow_log", | ||
"hollow:acacia_hollow_log": "hollow:stripped_acacia_hollow_log", | ||
"hollow:dark_oak_hollow_log": "hollow:stripped_dark_oak_hollow_log", | ||
"hollow:birch_hollow_log": "hollow:stripped_birch_hollow_log", | ||
"hollow:cherry_hollow_log": "hollow:stripped_cherry_hollow_log", | ||
"hollow:crimson_hollow_stem": "hollow:stripped_crimson_hollow_stem", | ||
"hollow:warped_hollow_stem": "hollow:stripped_warped_hollow_stem", | ||
"hollow:dark_oak_hollow_log": "hollow:stripped_dark_oak_hollow_log", | ||
"hollow:jungle_hollow_log": "hollow:stripped_jungle_hollow_log", | ||
"hollow:mangrove_hollow_log": "hollow:stripped_mangrove_hollow_log", | ||
"hollow:cherry_hollow_log": "hollow:stripped_cherry_hollow_log" | ||
"hollow:oak_hollow_log": "hollow:stripped_oak_hollow_log", | ||
"hollow:spruce_hollow_log": "hollow:stripped_spruce_hollow_log", | ||
"hollow:warped_hollow_stem": "hollow:stripped_warped_hollow_stem" | ||
} | ||
} |
5 changes: 2 additions & 3 deletions
5
...ter/metatags/minecraft/block/waxable.json → ...ter/metatags/minecraft/block/waxable.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,8 @@ | ||
{ | ||
"replace": false, | ||
"values": { | ||
"hollow:copper_pillar": "hollow:waxed_copper_pillar", | ||
"hollow:exposed_copper_pillar": "hollow:waxed_exposed_copper_pillar", | ||
"hollow:weathered_copper_pillar": "hollow:waxed_weathered_copper_pillar", | ||
"hollow:oxidized_copper_pillar": "hollow:waxed_oxidized_copper_pillar" | ||
"hollow:oxidized_copper_pillar": "hollow:waxed_oxidized_copper_pillar", | ||
"hollow:weathered_copper_pillar": "hollow:waxed_weathered_copper_pillar" | ||
} | ||
} |
58 changes: 58 additions & 0 deletions
58
src/main/java/dev/spiritstudios/hollow/datagen/BlockMetatagProvider.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
package dev.spiritstudios.hollow.datagen; | ||
|
||
import dev.spiritstudios.hollow.block.HollowLogBlock; | ||
import dev.spiritstudios.hollow.registry.HollowBlockRegistrar; | ||
import dev.spiritstudios.specter.api.block.BlockMetatags; | ||
import dev.spiritstudios.specter.api.block.FlammableBlockData; | ||
import dev.spiritstudios.specter.api.core.util.ReflectionHelper; | ||
import dev.spiritstudios.specter.api.registry.metatag.datagen.MetatagProvider; | ||
import net.fabricmc.fabric.api.datagen.v1.FabricDataOutput; | ||
import net.minecraft.block.Block; | ||
import net.minecraft.data.DataOutput; | ||
import net.minecraft.registry.RegistryWrapper; | ||
|
||
import java.util.concurrent.CompletableFuture; | ||
import java.util.function.Consumer; | ||
|
||
public class BlockMetatagProvider extends MetatagProvider<Block> { | ||
protected BlockMetatagProvider(FabricDataOutput dataOutput, CompletableFuture<RegistryWrapper.WrapperLookup> registriesFuture) { | ||
super(dataOutput, registriesFuture, DataOutput.OutputType.DATA_PACK); | ||
} | ||
|
||
@Override | ||
protected void configure(Consumer<MetatagBuilder<Block, ?>> provider, RegistryWrapper.WrapperLookup lookup) { | ||
MetatagBuilder<Block, FlammableBlockData> flammableBuilder = create(BlockMetatags.FLAMMABLE); | ||
|
||
ReflectionHelper.forEachStaticField( | ||
HollowBlockRegistrar.class, | ||
HollowLogBlock.class, | ||
(block, name, field) -> { | ||
flammableBuilder.put(block, new FlammableBlockData(5, 5)); | ||
}); | ||
|
||
provider.accept(flammableBuilder); | ||
|
||
provider.accept(create(BlockMetatags.WAXABLE) | ||
.put(HollowBlockRegistrar.COPPER_PILLAR, HollowBlockRegistrar.WAXED_COPPER_PILLAR) | ||
.put(HollowBlockRegistrar.EXPOSED_COPPER_PILLAR, HollowBlockRegistrar.WAXED_EXPOSED_COPPER_PILLAR) | ||
.put(HollowBlockRegistrar.WEATHERED_COPPER_PILLAR, HollowBlockRegistrar.WAXED_WEATHERED_COPPER_PILLAR) | ||
.put(HollowBlockRegistrar.OXIDIZED_COPPER_PILLAR, HollowBlockRegistrar.WAXED_OXIDIZED_COPPER_PILLAR)); | ||
|
||
provider.accept(create(BlockMetatags.STRIPPABLE) | ||
.put(HollowBlockRegistrar.OAK_HOLLOW_LOG, HollowBlockRegistrar.STRIPPED_OAK_HOLLOW_LOG) | ||
.put(HollowBlockRegistrar.SPRUCE_HOLLOW_LOG, HollowBlockRegistrar.STRIPPED_SPRUCE_HOLLOW_LOG) | ||
.put(HollowBlockRegistrar.BIRCH_HOLLOW_LOG, HollowBlockRegistrar.STRIPPED_BIRCH_HOLLOW_LOG) | ||
.put(HollowBlockRegistrar.JUNGLE_HOLLOW_LOG, HollowBlockRegistrar.STRIPPED_JUNGLE_HOLLOW_LOG) | ||
.put(HollowBlockRegistrar.ACACIA_HOLLOW_LOG, HollowBlockRegistrar.STRIPPED_ACACIA_HOLLOW_LOG) | ||
.put(HollowBlockRegistrar.DARK_OAK_HOLLOW_LOG, HollowBlockRegistrar.STRIPPED_DARK_OAK_HOLLOW_LOG) | ||
.put(HollowBlockRegistrar.CRIMSON_HOLLOW_STEM, HollowBlockRegistrar.STRIPPED_CRIMSON_HOLLOW_STEM) | ||
.put(HollowBlockRegistrar.WARPED_HOLLOW_STEM, HollowBlockRegistrar.STRIPPED_WARPED_HOLLOW_STEM) | ||
.put(HollowBlockRegistrar.MANGROVE_HOLLOW_LOG, HollowBlockRegistrar.STRIPPED_MANGROVE_HOLLOW_LOG) | ||
.put(HollowBlockRegistrar.CHERRY_HOLLOW_LOG, HollowBlockRegistrar.STRIPPED_CHERRY_HOLLOW_LOG)); | ||
|
||
provider.accept(create(BlockMetatags.OXIDIZABLE) | ||
.put(HollowBlockRegistrar.COPPER_PILLAR, HollowBlockRegistrar.EXPOSED_COPPER_PILLAR) | ||
.put(HollowBlockRegistrar.EXPOSED_COPPER_PILLAR, HollowBlockRegistrar.WEATHERED_COPPER_PILLAR) | ||
.put(HollowBlockRegistrar.WEATHERED_COPPER_PILLAR, HollowBlockRegistrar.OXIDIZED_COPPER_PILLAR)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters