From 53dd40585207ae5a1965dd272c2524a61be502fd Mon Sep 17 00:00:00 2001 From: TGdoesCode Date: Wed, 11 Feb 2026 09:36:28 +0100 Subject: [PATCH] broken shit --- .../szar/client/SzarDataGenerator.java | 9 ++- .../79d6404f7b0803346bb38c848032926817f10037 | 2 +- .../e8da7d0da6535b734ad1b062d141fd76f701db77 | 2 +- src/main/java/dev/tggamesyt/szar/Szar.java | 72 +++++++++++------- .../assets/szar/blockstates/uranium_ore.json | 7 ++ .../resources/assets/szar/lang/en_us.json | 3 +- .../assets/szar/models/block/uranium_ore.json | 6 ++ .../assets/szar/models/item/uranium_ore.json | 3 + .../szar/textures/block/uranium_ore.png | Bin 0 -> 860 bytes .../szar/loot_tables/blocks/uranium_ore.json | 24 ++++++ .../configured_feature/uranium_ore.json | 19 ----- .../worldgen/placed_feature/uranium_ore.json | 23 ------ 12 files changed, 98 insertions(+), 72 deletions(-) create mode 100644 src/main/resources/assets/szar/blockstates/uranium_ore.json create mode 100644 src/main/resources/assets/szar/models/block/uranium_ore.json create mode 100644 src/main/resources/assets/szar/models/item/uranium_ore.json create mode 100644 src/main/resources/assets/szar/textures/block/uranium_ore.png create mode 100644 src/main/resources/data/szar/loot_tables/blocks/uranium_ore.json delete mode 100644 src/main/resources/data/szar/worldgen/configured_feature/uranium_ore.json delete mode 100644 src/main/resources/data/szar/worldgen/placed_feature/uranium_ore.json diff --git a/src/client/java/dev/tggamesyt/szar/client/SzarDataGenerator.java b/src/client/java/dev/tggamesyt/szar/client/SzarDataGenerator.java index 76a3a50..7583bb6 100644 --- a/src/client/java/dev/tggamesyt/szar/client/SzarDataGenerator.java +++ b/src/client/java/dev/tggamesyt/szar/client/SzarDataGenerator.java @@ -2,8 +2,11 @@ package dev.tggamesyt.szar.client; import dev.tggamesyt.szar.ModItemTagProvider; import dev.tggamesyt.szar.ModPoiTagProvider; +import dev.tggamesyt.szar.Szar; import net.fabricmc.fabric.api.datagen.v1.DataGeneratorEntrypoint; import net.fabricmc.fabric.api.datagen.v1.FabricDataGenerator; +import net.minecraft.registry.RegistryBuilder; +import net.minecraft.registry.RegistryKeys; import net.minecraft.registry.RegistryWrapper; public class SzarDataGenerator implements DataGeneratorEntrypoint { @@ -11,8 +14,12 @@ public class SzarDataGenerator implements DataGeneratorEntrypoint { @Override public void onInitializeDataGenerator(FabricDataGenerator fabricDataGenerator) { FabricDataGenerator.Pack pack = fabricDataGenerator.createPack(); - pack.addProvider(ModPoiTagProvider::new); pack.addProvider(ModItemTagProvider::new); } + @Override + public void buildRegistry(RegistryBuilder registryBuilder) { + registryBuilder.addRegistry(RegistryKeys.CONFIGURED_FEATURE, Szar.ModConfiguredFeatures::boostrap); + registryBuilder.addRegistry(RegistryKeys.PLACED_FEATURE, Szar.ModPlacedFeatures::boostrap); + } } diff --git a/src/main/generated/.cache/79d6404f7b0803346bb38c848032926817f10037 b/src/main/generated/.cache/79d6404f7b0803346bb38c848032926817f10037 index af8def3..83c1b0b 100644 --- a/src/main/generated/.cache/79d6404f7b0803346bb38c848032926817f10037 +++ b/src/main/generated/.cache/79d6404f7b0803346bb38c848032926817f10037 @@ -1,2 +1,2 @@ -// 1.20.1 2026-02-08T13:35:45.6214131 szar/Tags for minecraft:point_of_interest_type +// 1.20.1 2026-02-11T09:35:00.8808882 szar/Tags for minecraft:point_of_interest_type eba137b51c50a7143a3668876f41adaa1447b1d1 data\minecraft\tags\point_of_interest_type\acquirable_job_site.json diff --git a/src/main/generated/.cache/e8da7d0da6535b734ad1b062d141fd76f701db77 b/src/main/generated/.cache/e8da7d0da6535b734ad1b062d141fd76f701db77 index 74a909f..90f177c 100644 --- a/src/main/generated/.cache/e8da7d0da6535b734ad1b062d141fd76f701db77 +++ b/src/main/generated/.cache/e8da7d0da6535b734ad1b062d141fd76f701db77 @@ -1,2 +1,2 @@ -// 1.20.1 2026-02-08T13:35:45.6204179 szar/Tags for minecraft:item +// 1.20.1 2026-02-11T09:35:00.8798931 szar/Tags for minecraft:item 6995bcff12c66325bf8878f8f536d542b4b8776e data\minecraft\tags\items\music_discs.json diff --git a/src/main/java/dev/tggamesyt/szar/Szar.java b/src/main/java/dev/tggamesyt/szar/Szar.java index 40af4d2..3bed2dc 100644 --- a/src/main/java/dev/tggamesyt/szar/Szar.java +++ b/src/main/java/dev/tggamesyt/szar/Szar.java @@ -96,33 +96,14 @@ public class Szar implements ModInitializer { .strength(7.0f, 1200.0f) // very hard, bedrock-tier vibe .requiresTool() ); - public static final ConfiguredFeature URANIUM_ORE_CONFIGURED = - new ConfiguredFeature<>( - Feature.ORE, - new OreFeatureConfig( - new TagMatchRuleTest(BlockTags.STONE_ORE_REPLACEABLES), - Szar.URANIUM_BLOCK.getDefaultState(), - 4 - ) - ); - public static final PlacedFeature URANIUM_ORE_PLACED = - new PlacedFeature( - RegistryEntry.of(URANIUM_ORE_CONFIGURED), - List.of( - CountPlacementModifier.of(2), // veins per chunk - HeightRangePlacementModifier.uniform( - YOffset.fixed(-63), // 1 block above bottom - YOffset.fixed(-60) // 4 blocks above bedrock, adjust for vein height - ), - SquarePlacementModifier.of(), - BiomePlacementModifier.of() - ) - ); + // ConfiguredFeature Key + public static final RegistryKey> URANIUM_ORE_KEY = + RegistryKey.of(RegistryKeys.CONFIGURED_FEATURE, new Identifier(MOD_ID, "uranium_ore")); + + // PlacedFeature Key public static final RegistryKey URANIUM_ORE_PLACED_KEY = - RegistryKey.of( - RegistryKeys.PLACED_FEATURE, - new Identifier(MOD_ID, "uranium_ore") - ); + RegistryKey.of(RegistryKeys.PLACED_FEATURE, new Identifier(MOD_ID, "uranium_ore_placed")); + public static final TrackedData LAST_CRIME_TICK = DataTracker.registerData(PlayerEntity.class, TrackedDataHandlerRegistry.LONG); public static final Block NIGGERITEBLOCK = @@ -527,6 +508,12 @@ public class Szar implements ModInitializer { new Identifier(MOD_ID, "cannabis_patch") ) ); + // Hook generation (RegistryKey only) + BiomeModifications.addFeature( + BiomeSelectors.foundInOverworld(), + GenerationStep.Feature.UNDERGROUND_ORES, + URANIUM_ORE_PLACED_KEY + ); AttackEntityCallback.EVENT.register((player, world, hand, entity, hitResult) -> { if (!world.isClient && entity instanceof LivingEntity victim) { @@ -970,5 +957,38 @@ public class Szar implements ModInitializer { ANIMATION_TIMINGS_SECONDS.put(PlaneAnimation.LAND_STARTED, -1f); // looping ANIMATION_TIMINGS_SECONDS.put(PlaneAnimation.LIFT_UP, 1.5f); // 1.5s * 20 ticks } + // Kaupenjoe-style ConfiguredFeature bootstrap + public static class ModConfiguredFeatures { + public static void boostrap(Registerable> context) { + var stoneTag = new TagMatchRuleTest(BlockTags.STONE_ORE_REPLACEABLES); + var deepslateTag = new TagMatchRuleTest(BlockTags.DEEPSLATE_ORE_REPLACEABLES); + + List targets = List.of( + OreFeatureConfig.createTarget(stoneTag, URANIUM_BLOCK.getDefaultState()), + OreFeatureConfig.createTarget(deepslateTag, URANIUM_BLOCK.getDefaultState()) + ); + + context.register(URANIUM_ORE_KEY, new ConfiguredFeature<>(Feature.ORE, new OreFeatureConfig(targets, 4))); + } + } + + // Kaupenjoe-style PlacedFeature bootstrap + public static class ModPlacedFeatures { + public static void boostrap(Registerable context) { + RegistryEntry> configuredEntry = + context.getRegistryLookup(RegistryKeys.CONFIGURED_FEATURE) + .getOrThrow(URANIUM_ORE_KEY); + + context.register(URANIUM_ORE_PLACED_KEY, new PlacedFeature( + configuredEntry, + List.of( + CountPlacementModifier.of(2), + SquarePlacementModifier.of(), + HeightRangePlacementModifier.uniform(YOffset.fixed(-63), YOffset.fixed(-20)), + BiomePlacementModifier.of() + ) + )); + } + } } diff --git a/src/main/resources/assets/szar/blockstates/uranium_ore.json b/src/main/resources/assets/szar/blockstates/uranium_ore.json new file mode 100644 index 0000000..1f80b03 --- /dev/null +++ b/src/main/resources/assets/szar/blockstates/uranium_ore.json @@ -0,0 +1,7 @@ +{ + "variants": { + "": { + "model": "szar:block/uranium_ore" + } + } +} diff --git a/src/main/resources/assets/szar/lang/en_us.json b/src/main/resources/assets/szar/lang/en_us.json index 4abbe3c..acd1dfe 100644 --- a/src/main/resources/assets/szar/lang/en_us.json +++ b/src/main/resources/assets/szar/lang/en_us.json @@ -56,5 +56,6 @@ "item.szar.epstein_spawn_egg": "Epstein Spawn Egg", "item.szar.detonator": "Detonator", - "entity.szar.atom": "Atom" + "entity.szar.atom": "Atom", + "block.szar.uranium_ore": "Uranium Ore" } diff --git a/src/main/resources/assets/szar/models/block/uranium_ore.json b/src/main/resources/assets/szar/models/block/uranium_ore.json new file mode 100644 index 0000000..0f1723f --- /dev/null +++ b/src/main/resources/assets/szar/models/block/uranium_ore.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cube_all", + "textures": { + "all": "szar:block/uranium_ore" + } +} diff --git a/src/main/resources/assets/szar/models/item/uranium_ore.json b/src/main/resources/assets/szar/models/item/uranium_ore.json new file mode 100644 index 0000000..58243b8 --- /dev/null +++ b/src/main/resources/assets/szar/models/item/uranium_ore.json @@ -0,0 +1,3 @@ +{ + "parent": "szar:block/uranium_ore" +} diff --git a/src/main/resources/assets/szar/textures/block/uranium_ore.png b/src/main/resources/assets/szar/textures/block/uranium_ore.png new file mode 100644 index 0000000000000000000000000000000000000000..1a484385215feb7966264067145c0aeebcdde93e GIT binary patch literal 860 zcmV-i1Ec(jP)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi@Bjb~@By*vxK{uG01G&Uc4v(000woMObt}b#!QNasW_7Mj%vgZ)|fQK}Q?UcQ60|04;h{ zSad{Xb7OL8aCB*JZU6uXnae0CDX`MlFE20GD@aMxEy>T%Db`EQ&jkQ(p9t}nuPnF# z00MkTL_t(IPgPS(PZMDjJ?%t`1)4T(MT&(&5Lgh3_@c3OqYGCiZgfW?>B1FjyPFs` zM*o956PGSYOf=CDBZ@H^RBS=%1L$;^X~Bk;ma*sJG0Cnv@rW*1qaS7cB;Lo?KGiucKTFy zu`Elv{L1&h$W>9T)^Pvv_tpe?SgsMo&&SZ;--lPP9VqXF(W``HI!82m#qxN%+MMhW z3D2-gEQ5&_T~IHA&4j}2?2O9FrBVrgzhA1(J^g}_>20K6MsT{bM-py7TtG)?8Sj_6 zP&evw7Y>J@BoYagRm(0DGxLi$JF$VEpX=B)4{>;E4SC%w3C`{{eEV3J@qe!rMGv8n zOeQViZWss+x~1}Q6xOR^ZC`F#$8pNaz`%fd>%lvOhqsZ<^r4cjiMo23QygIaSq9^m zH5i{R$RzAcP-Je(kw{#(Y_V82D0O3vmi-yifxHSp==#ann#v;5qz0WIsF3zI2Lzo m@0oVuOjPdeL{cU+O~YT^&r$NKTy5q60000