broken shit

This commit is contained in:
2026-02-11 09:36:28 +01:00
parent 6626e118a8
commit 53dd405852
12 changed files with 98 additions and 72 deletions

View File

@@ -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);
}
}

View File

@@ -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

View File

@@ -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

View File

@@ -96,33 +96,14 @@ public class Szar implements ModInitializer {
.strength(7.0f, 1200.0f) // very hard, bedrock-tier vibe
.requiresTool()
);
public static final ConfiguredFeature<OreFeatureConfig, ?> 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<ConfiguredFeature<?, ?>> URANIUM_ORE_KEY =
RegistryKey.of(RegistryKeys.CONFIGURED_FEATURE, new Identifier(MOD_ID, "uranium_ore"));
// PlacedFeature Key
public static final RegistryKey<PlacedFeature> 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<Long> 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<ConfiguredFeature<?, ?>> context) {
var stoneTag = new TagMatchRuleTest(BlockTags.STONE_ORE_REPLACEABLES);
var deepslateTag = new TagMatchRuleTest(BlockTags.DEEPSLATE_ORE_REPLACEABLES);
List<OreFeatureConfig.Target> 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<PlacedFeature> context) {
RegistryEntry<ConfiguredFeature<?, ?>> 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()
)
));
}
}
}

View File

@@ -0,0 +1,7 @@
{
"variants": {
"": {
"model": "szar:block/uranium_ore"
}
}
}

View File

@@ -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"
}

View File

@@ -0,0 +1,6 @@
{
"parent": "minecraft:block/cube_all",
"textures": {
"all": "szar:block/uranium_ore"
}
}

View File

@@ -0,0 +1,3 @@
{
"parent": "szar:block/uranium_ore"
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 860 B

View File

@@ -0,0 +1,24 @@
{
"type": "minecraft:block",
"pools": [
{
"rolls": 1,
"entries": [
{
"type": "minecraft:item",
"name": "szar:uranium_ore"
}
],
"conditions": [
{
"condition": "minecraft:match_tool",
"predicate": {
"items": [
"minecraft:netherite_pickaxe"
]
}
}
]
}
]
}

View File

@@ -1,19 +0,0 @@
{
"type": "minecraft:ore",
"config": {
"targets": [
{
"target": {
"predicate_type": "minecraft:tag_match",
"tag": "minecraft:stone_ore_replaceables"
},
"state": {
"Name": "szar:uranium_block",
"Properties": {}
}
}
],
"size": 1,
"discard_chance_on_air_exposure": 0.0
}
}

View File

@@ -1,23 +0,0 @@
{
"feature": "szar:uranium_ore",
"placement": [
{
"type": "minecraft:count",
"count": 1
},
{
"type": "minecraft:in_square"
},
{
"type": "minecraft:height_range",
"height": {
"type": "minecraft:uniform",
"min_inclusive": {"below_top": 378},
"max_inclusive": {"below_top": 382}
}
},
{
"type": "minecraft:biome"
}
]
}