World Gen Prep

This commit is contained in:
Vos
2025-11-12 21:03:29 -06:00
parent 31814d6bf5
commit 0cae1de4e9
4 changed files with 90 additions and 0 deletions
@@ -11,6 +11,7 @@ import com.acethewildfire.acesbs.sounds.ModSounds;
import com.acethewildfire.acesbs.util.HammerUsageEvent;
import com.acethewildfire.acesbs.util.UpdateRecipies;
import com.acethewildfire.acesbs.util.YouMonsterEvent;
import com.acethewildfire.acesbs.world.gen.ModWorldGeneration;
import net.fabricmc.api.ModInitializer;
import net.fabricmc.fabric.api.event.player.AttackEntityCallback;
@@ -45,6 +46,7 @@ public class AcesBS implements ModInitializer {
ModEffects.registerEffects();
ModPotions.registerPotions();
ModEnchantmentEffects.registerModEnchantments();
ModWorldGeneration.generateModWorldGen();
ModDataComponentTypes.registerDataComponentsTypes();
@@ -0,0 +1,32 @@
package com.acethewildfire.acesbs.world;
import com.acethewildfire.acesbs.AcesBS;
import net.minecraft.registry.Registerable;
import net.minecraft.registry.RegistryKey;
import net.minecraft.registry.RegistryKeys;
import net.minecraft.util.Identifier;
import net.minecraft.world.gen.feature.ConfiguredFeature;
import net.minecraft.world.gen.feature.Feature;
import net.minecraft.world.gen.feature.FeatureConfig;
public class ModConfiguredFeatures {
// CF -> PF -> WG
// CF: Could be a house
// PF: How is it placed
// WG: Where it is placed
public static void bootstrap(Registerable<ConfiguredFeature<?, ?>> context) {
}
public static RegistryKey<ConfiguredFeature<?, ?>> registerKey(String name) {
return RegistryKey.of(RegistryKeys.CONFIGURED_FEATURE, Identifier.of(AcesBS.MOD_ID, name));
}
private static <FC extends FeatureConfig, F extends Feature<FC>> void register(Registerable<ConfiguredFeature<?, ?>> context,
RegistryKey<ConfiguredFeature<?, ?>> key, F feature, FC configuration) {
context.register(key, new ConfiguredFeature<>(feature, configuration));
}
}
@@ -0,0 +1,43 @@
package com.acethewildfire.acesbs.world;
import com.acethewildfire.acesbs.AcesBS;
import net.minecraft.registry.Registerable;
import net.minecraft.registry.RegistryKey;
import net.minecraft.registry.RegistryKeys;
import net.minecraft.registry.entry.RegistryEntry;
import net.minecraft.util.Identifier;
import net.minecraft.world.gen.feature.ConfiguredFeature;
import net.minecraft.world.gen.feature.Feature;
import net.minecraft.world.gen.feature.FeatureConfig;
import net.minecraft.world.gen.feature.PlacedFeature;
import net.minecraft.world.gen.placementmodifier.PlacementModifier;
import java.util.List;
public class ModPlacedFeatures {
// CF -> PF -> WG
// CF: Could be a house
// PF: How is it placed
// WG: Where it is placed
public static void bootstrap(Registerable<PlacedFeature> context) {
var configuredFeatures = context.getRegistryLookup(RegistryKeys.CONFIGURED_FEATURE);
}
public static RegistryKey<PlacedFeature> registerKey(String name) {
return RegistryKey.of(RegistryKeys.PLACED_FEATURE, Identifier.of(AcesBS.MOD_ID, name));
}
private static void register(Registerable<PlacedFeature> context, RegistryKey<PlacedFeature> key, RegistryEntry<ConfiguredFeature<?, ?>> configuration,
List<PlacementModifier> modifiers) {
context.register(key, new PlacedFeature(configuration, List.copyOf(modifiers)));
}
private static <FC extends FeatureConfig, F extends Feature<FC>> void register(Registerable<PlacedFeature> context, RegistryKey<PlacedFeature> key,
RegistryEntry<ConfiguredFeature<?, ?>> configuration,
PlacementModifier... modifiers) {
register(context, key, configuration, List.of(modifiers));
}
}
@@ -0,0 +1,13 @@
package com.acethewildfire.acesbs.world.gen;
import com.acethewildfire.acesbs.AcesBS;
public class ModWorldGeneration {
public static void generateModWorldGen() {
AcesBS.LOGGER.info("Registering Mod World Gen for " + AcesBS.MOD_ID);
}
}