Datagen for Mining Tags

This commit is contained in:
Martin Prokoph
2024-08-01 00:07:17 +02:00
parent c39bc6429e
commit d18046f74f
10 changed files with 158 additions and 4 deletions

View File

@@ -1,4 +1,4 @@
// 1.21 2024-07-31T22:56:58.458132274 Decorative/Recipes
// 1.21 2024-08-01T00:03:07.702740398 Decorative/Recipes
8840e1834a4e8b1459b63b4054e28fa51c26e72e data/decorative/recipe/wall_clock.json
c7ad4b64d576aee115925400b1fa6500d81d02c9 data/decorative/advancement/recipes/decorations/spruce_log_with_axe.json
cf0bf274ee073450f6c4fd3b5fd7b3d711bd2e60 data/decorative/recipe/gray_lamp.json

View File

@@ -1,4 +1,4 @@
// 1.21 2024-07-31T22:56:58.464282543 Decorative/Block Loot Tables
// 1.21 2024-08-01T00:03:07.708091331 Decorative/Block Loot Tables
89cdb12dd315c74b635244350ea725b1cc5cff53 data/decorative/loot_table/blocks/orange_lamp.json
db0783aa5f2aebcde11576ff95da049cf278b336 data/decorative/loot_table/blocks/mangrove_log_with_axe.json
e13c9b7a44df3ef0e24e4878355b435a7c9b596e data/decorative/loot_table/blocks/yellow_digital_clock.json

View File

@@ -1,3 +1,3 @@
// 1.21 2024-07-31T22:56:58.463872214 Decorative/decorative
// 1.21 2024-08-01T00:03:07.707624524 Decorative/decorative
0f026ea055880052079f9153d9bb8c0b76de000e data/decorative/worldgen/placed_feature/rocky_asphalt.json
8dfd1b980dfd7aba3fa12e1ea506a3c9fc463929 data/decorative/worldgen/configured_feature/rocky_asphalt.json

View File

@@ -0,0 +1,4 @@
// 1.21 2024-08-01T00:03:07.707245874 Decorative/Tags for minecraft:block
f2d5d3644e53c993deebe7b145b6da3246698fba data/minecraft/tags/block/mineable/pickaxe.json
943ffdbb1391ecf5d726ad5897b8e4b41366d8ce data/minecraft/tags/block/mineable/axe.json
8c82b629723744035dfdff5c75a81e15d1db82c1 data/minecraft/tags/block/needs_stone_tool.json

View File

@@ -0,0 +1,15 @@
{
"values": [
"decorative:oak_log_with_axe",
"decorative:spruce_log_with_axe",
"decorative:birch_log_with_axe",
"decorative:acacia_log_with_axe",
"decorative:cherry_log_with_axe",
"decorative:jungle_log_with_axe",
"decorative:dark_oak_log_with_axe",
"decorative:crimson_stem_with_axe",
"decorative:warped_stem_with_axe",
"decorative:mangrove_log_with_axe",
"decorative:bamboo_block_with_axe"
]
}

View File

@@ -0,0 +1,89 @@
{
"values": [
"decorative:rocky_asphalt",
"decorative:road",
"decorative:road_white_short",
"decorative:road_white_long",
"decorative:traffic_cone",
"decorative:fire_hydrant",
"decorative:guardrail",
"decorative:sign_post",
"decorative:empty_sign",
"decorative:stop_sign",
"decorative:five_sign",
"decorative:ten_sign",
"decorative:twenty_sign",
"decorative:thirty_sign",
"decorative:forty_sign",
"decorative:fifty_sign",
"decorative:sixty_sign",
"decorative:seventy_sign",
"decorative:eighty_sign",
"decorative:ninety_sign",
"decorative:onehundred_sign",
"decorative:onehundredten_sign",
"decorative:stone_path",
"decorative:bird_bath",
"decorative:water_pump",
"decorative:pool_wall",
"decorative:springboard",
"decorative:pool_sprinkler",
"decorative:kitchen_tiles",
"decorative:wall_clock",
"decorative:television",
"decorative:old_television",
"decorative:ceilingfan",
"decorative:shower_head",
"decorative:sliding_door",
"decorative:christmas_tree",
"decorative:christmas_lights",
"decorative:white_lamp",
"decorative:orange_lamp",
"decorative:magenta_lamp",
"decorative:light_blue_lamp",
"decorative:yellow_lamp",
"decorative:lime_lamp",
"decorative:pink_lamp",
"decorative:gray_lamp",
"decorative:light_gray_lamp",
"decorative:cyan_lamp",
"decorative:purple_lamp",
"decorative:blue_lamp",
"decorative:brown_lamp",
"decorative:green_lamp",
"decorative:red_lamp",
"decorative:black_lamp",
"decorative:white_double_lamp",
"decorative:orange_double_lamp",
"decorative:magenta_double_lamp",
"decorative:light_blue_double_lamp",
"decorative:yellow_double_lamp",
"decorative:lime_double_lamp",
"decorative:pink_double_lamp",
"decorative:gray_double_lamp",
"decorative:light_gray_double_lamp",
"decorative:cyan_double_lamp",
"decorative:purple_double_lamp",
"decorative:blue_double_lamp",
"decorative:brown_double_lamp",
"decorative:green_double_lamp",
"decorative:red_double_lamp",
"decorative:black_double_lamp",
"decorative:white_digital_clock",
"decorative:orange_digital_clock",
"decorative:magenta_digital_clock",
"decorative:light_blue_digital_clock",
"decorative:yellow_digital_clock",
"decorative:lime_digital_clock",
"decorative:pink_digital_clock",
"decorative:gray_digital_clock",
"decorative:light_gray_digital_clock",
"decorative:cyan_digital_clock",
"decorative:purple_digital_clock",
"decorative:blue_digital_clock",
"decorative:brown_digital_clock",
"decorative:green_digital_clock",
"decorative:red_digital_clock",
"decorative:black_digital_clock"
]
}

View File

@@ -0,0 +1,5 @@
{
"values": [
"decorative:rocky_asphalt"
]
}

View File

@@ -2,6 +2,7 @@ package eu.midnightdust.motschen.decorative;
import eu.midnightdust.motschen.decorative.datagen.LootTables;
import eu.midnightdust.motschen.decorative.datagen.Recipes;
import eu.midnightdust.motschen.decorative.datagen.Tags;
import eu.midnightdust.motschen.decorative.world.OreFeatures;
import net.fabricmc.fabric.api.datagen.v1.DataGeneratorEntrypoint;
import net.fabricmc.fabric.api.datagen.v1.FabricDataGenerator;
@@ -21,6 +22,7 @@ public class DecorativeDataGen implements DataGeneratorEntrypoint {
FabricDataGenerator.Pack pack = fabricDataGenerator.createPack();
pack.addProvider(WorldGenData::new);
pack.addProvider(LootTables.BlockLootTables::new);
pack.addProvider(Tags.Blocks::new);
pack.addProvider(Recipes::new);
System.out.println("Initialized dataGen");
}

View File

@@ -24,7 +24,7 @@ public class StonePath extends Block implements FactoryBlock {
private static final VoxelShape SHAPE;
public StonePath() {
super(AbstractBlock.Settings.copy(Blocks.STONE).nonOpaque().sounds(BlockSoundGroup.STONE));
super(AbstractBlock.Settings.copy(Blocks.SHORT_GRASS).nonOpaque().sounds(BlockSoundGroup.STONE));
}
@Override

View File

@@ -0,0 +1,39 @@
package eu.midnightdust.motschen.decorative.datagen;
import eu.midnightdust.motschen.decorative.DecorativeMain;
import eu.midnightdust.motschen.decorative.init.LogsWithAxes;
import net.fabricmc.fabric.api.datagen.v1.FabricDataOutput;
import net.fabricmc.fabric.api.datagen.v1.provider.FabricTagProvider;
import net.minecraft.block.Block;
import net.minecraft.registry.RegistryKeys;
import net.minecraft.registry.RegistryWrapper;
import net.minecraft.registry.tag.TagKey;
import net.minecraft.util.Identifier;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.CompletableFuture;
public class Tags {
public static class Blocks extends FabricTagProvider.BlockTagProvider {
private static final TagKey<Block> PICKAXE_MINEABLE = TagKey.of(RegistryKeys.BLOCK, Identifier.ofVanilla("mineable/pickaxe"));
private static final TagKey<Block> AXE_MINEABLE = TagKey.of(RegistryKeys.BLOCK, Identifier.ofVanilla("mineable/axe"));
private static final TagKey<Block> NEEDS_STONE_TOOL = TagKey.of(RegistryKeys.BLOCK, Identifier.ofVanilla("needs_stone_tool"));
public Blocks(FabricDataOutput output, CompletableFuture<RegistryWrapper.WrapperLookup> registriesFuture) {
super(output, registriesFuture);
}
@Override
protected void configure(RegistryWrapper.WrapperLookup arg) {
List<Block> pickaxeBlocks = new ArrayList<>(DecorativeMain.BLOCKS);
pickaxeBlocks.removeAll(LogsWithAxes.TYPES);
getOrCreateTagBuilder(PICKAXE_MINEABLE).setReplace(false)
.add(pickaxeBlocks.toArray(new Block[0]));
getOrCreateTagBuilder(AXE_MINEABLE).setReplace(false)
.add(LogsWithAxes.TYPES.toArray(new Block[0]));
getOrCreateTagBuilder(NEEDS_STONE_TOOL).setReplace(false)
.add(DecorativeMain.RockyAsphalt);
}
}
}