diff --git a/lib/lodestone-1.20.1-1.4.18.jar b/lib/lodestone-1.20.1-1.4.18.jar deleted file mode 100644 index e89924c42..000000000 Binary files a/lib/lodestone-1.20.1-1.4.18.jar and /dev/null differ diff --git a/lib/lodestone-1.20.1-1.4.19.jar b/lib/lodestone-1.20.1-1.4.19.jar deleted file mode 100644 index 380b50b94..000000000 Binary files a/lib/lodestone-1.20.1-1.4.19.jar and /dev/null differ diff --git a/lib/lodestone-1.20.1-1.4.20.jar b/lib/lodestone-1.20.1-1.4.20.jar deleted file mode 100644 index 7fbdab976..000000000 Binary files a/lib/lodestone-1.20.1-1.4.20.jar and /dev/null differ diff --git a/src/generated/resources/data/malum/worldgen/configured_feature/natural_quartz_ore.json b/src/generated/resources/data/malum/worldgen/configured_feature/natural_quartz_ore.json index 235aeb66b..80edd638e 100644 --- a/src/generated/resources/data/malum/worldgen/configured_feature/natural_quartz_ore.json +++ b/src/generated/resources/data/malum/worldgen/configured_feature/natural_quartz_ore.json @@ -12,6 +12,15 @@ "predicate_type": "minecraft:tag_match", "tag": "minecraft:stone_ore_replaceables" } + }, + { + "state": { + "Name": "malum:deepslate_quartz_ore" + }, + "target": { + "predicate_type": "minecraft:tag_match", + "tag": "minecraft:deepslate_ore_replaceables" + } } ] } diff --git a/src/generated/resources/data/malum/worldgen/configured_feature/runewood_tree.json b/src/generated/resources/data/malum/worldgen/configured_feature/runewood_tree.json new file mode 100644 index 000000000..6d4ffa711 --- /dev/null +++ b/src/generated/resources/data/malum/worldgen/configured_feature/runewood_tree.json @@ -0,0 +1,4 @@ +{ + "type": "malum:runewood_tree", + "config": {} +} \ No newline at end of file diff --git a/src/generated/resources/data/malum/worldgen/configured_feature/soulwood_tree.json b/src/generated/resources/data/malum/worldgen/configured_feature/soulwood_tree.json new file mode 100644 index 000000000..cfc46d45f --- /dev/null +++ b/src/generated/resources/data/malum/worldgen/configured_feature/soulwood_tree.json @@ -0,0 +1,4 @@ +{ + "type": "malum:soulwood_tree", + "config": {} +} \ No newline at end of file diff --git a/src/main/java/com/sammy/malum/MalumMod.java b/src/main/java/com/sammy/malum/MalumMod.java index 294975e1a..675dbe7c5 100644 --- a/src/main/java/com/sammy/malum/MalumMod.java +++ b/src/main/java/com/sammy/malum/MalumMod.java @@ -99,37 +99,25 @@ public static void gatherData(GatherDataEvent event) { MalumItemModels itemModelsProvider = new MalumItemModels(output, helper); - - MalumBlockStates blockStateProvider = new MalumBlockStates(output, helper, itemModelsProvider); - MalumLang langProvider = new MalumLang(output); - MalumBlockLootTables lootTablesProvider = new MalumBlockLootTables(output); - MalumRecipes recipeProvider = new MalumRecipes(output); - MalumVanillaRecipeReplacements vanillaRecipeReplacementsProvider = new MalumVanillaRecipeReplacements(output); - MalumSpiritInfusionRecipes spiritInfusionRecipesProvider = new MalumSpiritInfusionRecipes(output); - MalumSpiritFocusingRecipes spiritFocusingRecipesProvider = new MalumSpiritFocusingRecipes(output); - MalumSpiritTransmutationRecipes spiritTransmutationRecipesProvider = new MalumSpiritTransmutationRecipes(output); - MalumVoidFavorRecipes voidFavorRecipesProvider = new MalumVoidFavorRecipes(output); - MalumWorldgenProvider worldgenProvider = new MalumWorldgenProvider(output, provider); MalumBlockTags blockTagsProvider = new MalumBlockTags(output, provider, helper); - MalumBiomeTags malumBiomeTags = new MalumBiomeTags(output, provider, helper); - generator.addProvider(event.includeClient(), blockStateProvider); + generator.addProvider(event.includeClient(), new MalumBlockStates(output, helper, itemModelsProvider)); generator.addProvider(event.includeClient(), itemModelsProvider); - generator.addProvider(event.includeClient(), langProvider); + generator.addProvider(event.includeClient(), new MalumLang(output)); //TODO generator.addProvider(event.includeServer(), blockTagsProvider); - generator.addProvider(event.includeServer(), lootTablesProvider); + generator.addProvider(event.includeServer(), new MalumBlockLootTables(output)); //TODO generator.addProvider(event.includeServer(), new MalumItemTags(output, provider, blockTagsProvider.contentsGetter(), helper)); - generator.addProvider(event.includeServer(), recipeProvider); - generator.addProvider(event.includeServer(), vanillaRecipeReplacementsProvider); - generator.addProvider(event.includeServer(), spiritInfusionRecipesProvider); - generator.addProvider(event.includeServer(), spiritFocusingRecipesProvider); - generator.addProvider(event.includeServer(), spiritTransmutationRecipesProvider); - generator.addProvider(event.includeServer(), voidFavorRecipesProvider); + generator.addProvider(event.includeServer(), new MalumRecipes(output)); + generator.addProvider(event.includeServer(), new MalumVanillaRecipeReplacements(output)); + generator.addProvider(event.includeServer(), new MalumSpiritInfusionRecipes(output)); + generator.addProvider(event.includeServer(), new MalumSpiritFocusingRecipes(output)); + generator.addProvider(event.includeServer(), new MalumSpiritTransmutationRecipes(output)); + generator.addProvider(event.includeServer(), new MalumVoidFavorRecipes(output)); - generator.addProvider(event.includeServer(), worldgenProvider); - generator.addProvider(event.includeServer(), malumBiomeTags); + generator.addProvider(event.includeServer(), new MalumWorldgenProvider(output, provider)); + generator.addProvider(event.includeServer(), new MalumBiomeTags(output, provider, helper)); } } } \ No newline at end of file diff --git a/src/main/java/com/sammy/malum/config/CommonConfig.java b/src/main/java/com/sammy/malum/config/CommonConfig.java index 6727e68ca..78953d356 100644 --- a/src/main/java/com/sammy/malum/config/CommonConfig.java +++ b/src/main/java/com/sammy/malum/config/CommonConfig.java @@ -12,7 +12,7 @@ public class CommonConfig extends LodestoneConfig { //worldgen - /*TODO + public static ConfigValueHolder GENERATE_RUNEWOOD_TREES = new ConfigValueHolder<>(MALUM, "common/worldgen/runewood", (builder -> builder.comment("Should runewood trees naturally generate?") .define("generateRunewood", true))); @@ -122,7 +122,7 @@ public class CommonConfig extends LodestoneConfig { .defineList("cthonicGoldDimensions", new ArrayList<>(List.of("minecraft:overworld")), s -> s instanceof String)); - */ + public static ConfigValueHolder ULTIMATE_REBOUND = new ConfigValueHolder<>(MALUM, "common/item/rebound", (builder -> builder.comment("If set to true, you may put rebound on any weapon in the game.") .define("enableUltimateRebound", false))); diff --git a/src/main/java/com/sammy/malum/data/MalumBiomeTags.java b/src/main/java/com/sammy/malum/data/MalumBiomeTags.java index d8b993bd3..bd4c321e2 100644 --- a/src/main/java/com/sammy/malum/data/MalumBiomeTags.java +++ b/src/main/java/com/sammy/malum/data/MalumBiomeTags.java @@ -25,5 +25,6 @@ protected void addTags(HolderLookup.Provider pProvider) { tag(BiomeTagRegistry.HAS_SOULSTONE).addTag(BiomeTags.IS_OVERWORLD); tag(BiomeTagRegistry.HAS_BRILLIANT).addTag(BiomeTags.IS_OVERWORLD); tag(BiomeTagRegistry.HAS_BLAZING_QUARTZ).addTag(BiomeTags.IS_NETHER); + tag(BiomeTagRegistry.HAS_RUNEWOOD).addTag(BiomeTags.IS_OVERWORLD);//Todo change to Forest and add rare for plains } } diff --git a/src/main/java/com/sammy/malum/data/MalumWorldgenProvider.java b/src/main/java/com/sammy/malum/data/MalumWorldgenProvider.java index 92f0087dc..f4e980849 100644 --- a/src/main/java/com/sammy/malum/data/MalumWorldgenProvider.java +++ b/src/main/java/com/sammy/malum/data/MalumWorldgenProvider.java @@ -56,6 +56,11 @@ public static void bootstrap(BootstapContext context) { getPlacedHolderSet(context, PlacedFeatureRegistry.ORE_NATURAL_QUARTZ), BiomeTagRegistry.HAS_SOULSTONE, GenerationStep.Decoration.UNDERGROUND_ORES)); + register(context, "runwood_tree", () -> + addFeatureModifier(context, + getPlacedHolderSet(context, PlacedFeatureRegistry.RUNEWOOD_TREE), + BiomeTagRegistry.HAS_RUNEWOOD, GenerationStep.Decoration.VEGETAL_DECORATION)); + } public static HolderSet getPlacedHolderSet(BootstapContext context, ResourceKey... placedFeatures) { diff --git a/src/main/java/com/sammy/malum/registry/common/worldgen/BiomeTagRegistry.java b/src/main/java/com/sammy/malum/registry/common/worldgen/BiomeTagRegistry.java index b768a33cd..04f24100d 100644 --- a/src/main/java/com/sammy/malum/registry/common/worldgen/BiomeTagRegistry.java +++ b/src/main/java/com/sammy/malum/registry/common/worldgen/BiomeTagRegistry.java @@ -9,4 +9,5 @@ public class BiomeTagRegistry { public static final TagKey HAS_SOULSTONE = TagKey.create(Registries.BIOME, MalumMod.malumPath("has_soulstone")); public static final TagKey HAS_BRILLIANT = TagKey.create(Registries.BIOME, MalumMod.malumPath("has_brilliant")); public static final TagKey HAS_BLAZING_QUARTZ = TagKey.create(Registries.BIOME, MalumMod.malumPath("has_blazing_quartz")); + public static final TagKey HAS_RUNEWOOD = TagKey.create(Registries.BIOME, MalumMod.malumPath("has_runewood")); } diff --git a/src/main/java/com/sammy/malum/registry/common/worldgen/ConfiguredFeatureRegistry.java b/src/main/java/com/sammy/malum/registry/common/worldgen/ConfiguredFeatureRegistry.java index aaf861017..d4b33241c 100644 --- a/src/main/java/com/sammy/malum/registry/common/worldgen/ConfiguredFeatureRegistry.java +++ b/src/main/java/com/sammy/malum/registry/common/worldgen/ConfiguredFeatureRegistry.java @@ -1,8 +1,10 @@ package com.sammy.malum.registry.common.worldgen; import com.sammy.malum.MalumMod; +import com.sammy.malum.common.worldgen.RunewoodTreeFeature; import com.sammy.malum.registry.common.block.BlockRegistry; import net.minecraft.core.Holder; +import net.minecraft.core.HolderGetter; import net.minecraft.core.registries.Registries; import net.minecraft.data.worldgen.BootstapContext; import net.minecraft.data.worldgen.features.FeatureUtils; @@ -10,6 +12,7 @@ import net.minecraft.tags.BlockTags; import net.minecraft.world.level.levelgen.feature.ConfiguredFeature; import net.minecraft.world.level.levelgen.feature.Feature; +import net.minecraft.world.level.levelgen.feature.configurations.FeatureConfiguration; import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration; import net.minecraft.world.level.levelgen.feature.configurations.OreConfiguration; import net.minecraft.world.level.levelgen.feature.configurations.RandomFeatureConfiguration; @@ -25,7 +28,8 @@ public class ConfiguredFeatureRegistry { public static final ResourceKey> CONFIGURED_SOULSTONE_ORE = ResourceKey.create(Registries.CONFIGURED_FEATURE, MalumMod.malumPath("soulstone_ore")); public static final ResourceKey> CONFIGURED_BRILLIANT_ORE = ResourceKey.create(Registries.CONFIGURED_FEATURE, MalumMod.malumPath("brilliant_ore")); public static final ResourceKey> CONFIGURED_NATURAL_QUARTZ_ORE = ResourceKey.create(Registries.CONFIGURED_FEATURE, MalumMod.malumPath("natural_quartz_ore")); - + public static final ResourceKey> CONFIGURED_RUNEWOOD_TREE = ResourceKey.create(Registries.CONFIGURED_FEATURE, MalumMod.malumPath("runewood_tree")); + public static final ResourceKey> CONFIGURED_SOULWOOD_TREE = ResourceKey.create(Registries.CONFIGURED_FEATURE, MalumMod.malumPath("soulwood_tree")); private static final RuleTest STONE_ORE_REPLACEABLES = new TagMatchTest(BlockTags.STONE_ORE_REPLACEABLES); private static final RuleTest DEEPSLATE_ORE_REPLACEABLES = new TagMatchTest(BlockTags.DEEPSLATE_ORE_REPLACEABLES); @@ -43,16 +47,22 @@ public class ConfiguredFeatureRegistry { OreConfiguration.target(DEEPSLATE_ORE_REPLACEABLES, BlockRegistry.DEEPSLATE_QUARTZ_ORE.get().defaultBlockState())); public static void bootstrap(BootstapContext> context) { - register(context, ConfiguredFeatureRegistry.CONFIGURED_SOULSTONE_ORE, () -> addOreConfig(SOULSTONE_TARGET_LIST, 30)); - register(context, ConfiguredFeatureRegistry.CONFIGURED_BRILLIANT_ORE, () -> addOreConfig(BRILLIANT_TARGET_LIST, 30)); - register(context, ConfiguredFeatureRegistry.CONFIGURED_NATURAL_QUARTZ_ORE, () -> addOreConfig(NATURAL_QUARTZ_TARGET_LIST, 30)); + HolderGetter> features = context.lookup(Registries.CONFIGURED_FEATURE); + + + context.register(ConfiguredFeatureRegistry.CONFIGURED_SOULSTONE_ORE, addOreConfig(SOULSTONE_TARGET_LIST, 30)); + context.register(ConfiguredFeatureRegistry.CONFIGURED_BRILLIANT_ORE, addOreConfig(BRILLIANT_TARGET_LIST, 30)); + context.register(ConfiguredFeatureRegistry.CONFIGURED_NATURAL_QUARTZ_ORE, addOreConfig(NATURAL_QUARTZ_TARGET_LIST, 30)); + + context.register(ConfiguredFeatureRegistry.CONFIGURED_RUNEWOOD_TREE, addTreeConfig(FeatureRegistry.RUNEWOOD_TREE.get())); + //register(context, ConfiguredFeatureRegistry.CONFIGURED_SOULWOOD_TREE, () -> addTreeConfig(FeatureRegistry.SOULWOOD_TREE.get())); } - private static ConfiguredFeature addOreConfig(List targetList, int veinSize) { - return new ConfiguredFeature<>(Feature.ORE, new OreConfiguration(targetList, veinSize)); + private static ConfiguredFeature addTreeConfig(Feature feature) { + return new ConfiguredFeature<>(feature, FeatureConfiguration.NONE); } - private static void register(BootstapContext> context, ResourceKey> featureKey, Supplier> feature) { - context.register(featureKey, feature.get()); + private static ConfiguredFeature addOreConfig(List targetList, int veinSize) { + return new ConfiguredFeature<>(Feature.ORE, new OreConfiguration(targetList, veinSize)); } } diff --git a/src/main/java/com/sammy/malum/registry/common/worldgen/FeatureRegistry.java b/src/main/java/com/sammy/malum/registry/common/worldgen/FeatureRegistry.java index 551e0b3c8..3d288e81b 100644 --- a/src/main/java/com/sammy/malum/registry/common/worldgen/FeatureRegistry.java +++ b/src/main/java/com/sammy/malum/registry/common/worldgen/FeatureRegistry.java @@ -38,7 +38,6 @@ import static com.sammy.malum.MalumMod.MALUM; import static net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration.INSTANCE; -@Mod.EventBusSubscriber(modid = MalumMod.MALUM, bus = Mod.EventBusSubscriber.Bus.MOD) public class FeatureRegistry { public static final DeferredRegister> FEATURE_TYPES = DeferredRegister.create(ForgeRegistries.FEATURES, MALUM); diff --git a/src/main/java/com/sammy/malum/registry/common/worldgen/PlacedFeatureRegistry.java b/src/main/java/com/sammy/malum/registry/common/worldgen/PlacedFeatureRegistry.java index 1c692f4ae..d9a3413d5 100644 --- a/src/main/java/com/sammy/malum/registry/common/worldgen/PlacedFeatureRegistry.java +++ b/src/main/java/com/sammy/malum/registry/common/worldgen/PlacedFeatureRegistry.java @@ -1,13 +1,17 @@ package com.sammy.malum.registry.common.worldgen; import com.sammy.malum.MalumMod; +import com.sammy.malum.config.CommonConfig; import net.minecraft.core.Holder; +import net.minecraft.core.HolderGetter; import net.minecraft.core.registries.Registries; import net.minecraft.data.worldgen.BootstapContext; +import net.minecraft.data.worldgen.placement.PlacementUtils; import net.minecraft.resources.ResourceKey; import net.minecraft.world.level.levelgen.VerticalAnchor; import net.minecraft.world.level.levelgen.feature.ConfiguredFeature; import net.minecraft.world.level.levelgen.placement.*; +import team.lodestar.lodestone.systems.worldgen.ChancePlacementFilter; import java.util.List; @@ -26,28 +30,37 @@ public class PlacedFeatureRegistry { public static final ResourceKey GEODE_CTHONIC_GOLD_FEATURE = ResourceKey.create(Registries.PLACED_FEATURE, MalumMod.malumPath("geode_rare_earth")); */ + public static final ResourceKey RUNEWOOD_TREE = ResourceKey.create(Registries.PLACED_FEATURE, MalumMod.malumPath("runewood_tree")); + public static final ResourceKey RARE_RUNEWOOD_TREE = ResourceKey.create(Registries.PLACED_FEATURE, MalumMod.malumPath("rare_runewood_tree")); - public static void bootstrap(BootstapContext context) { - register(context, PlacedFeatureRegistry.ORE_SOULSTONE, addOreFeature(context.lookup(Registries.CONFIGURED_FEATURE) - .get(ConfiguredFeatureRegistry.CONFIGURED_SOULSTONE_ORE).orElseThrow(), -16, 112, 16)); + public static void bootstrap(BootstapContext context) {//TODO fix all parameters + HolderGetter> features = context.lookup(Registries.CONFIGURED_FEATURE); + context.register(RUNEWOOD_TREE, addTreeFeature(features.getOrThrow(ConfiguredFeatureRegistry.CONFIGURED_RUNEWOOD_TREE), 3, 0.02f)); + context.register(ORE_SOULSTONE, addOreFeature(features.getOrThrow(ConfiguredFeatureRegistry.CONFIGURED_SOULSTONE_ORE), -16, 112, 16)); + context.register(ORE_BRILLIANT, addOreFeature(features.getOrThrow(ConfiguredFeatureRegistry.CONFIGURED_BRILLIANT_ORE), -16, 112, 16)); + context.register(ORE_NATURAL_QUARTZ, addOreFeature(features.getOrThrow(ConfiguredFeatureRegistry.CONFIGURED_NATURAL_QUARTZ_ORE), -16, 112, 16)); - register(context, PlacedFeatureRegistry.ORE_BRILLIANT, addOreFeature(context.lookup(Registries.CONFIGURED_FEATURE) - .get(ConfiguredFeatureRegistry.CONFIGURED_BRILLIANT_ORE).orElseThrow(), -16, 112, 16)); - register(context, PlacedFeatureRegistry.ORE_NATURAL_QUARTZ, addOreFeature(context.lookup(Registries.CONFIGURED_FEATURE) - .get(ConfiguredFeatureRegistry.CONFIGURED_NATURAL_QUARTZ_ORE).orElseThrow(), -16, 112, 16)); + //register(context, PlacedFeatureRegistry.RARE_RUNEWOOD_TREE, addTreeFeature(context.lookup(Registries.CONFIGURED_FEATURE).get(ConfiguredFeatureRegistry.CONFIGURED_RUNEWOOD_TREE).orElseThrow(), 3, 0.01f)); } private static PlacedFeature addOreFeature(Holder> configureFeature, int minHeight, int maxHeight, int count) { - return addFeaturePlacement(configureFeature, HeightRangePlacement.triangle(VerticalAnchor.absolute(minHeight), VerticalAnchor.absolute(maxHeight)), CountPlacement.of(count), InSquarePlacement.spread(), BiomeFilter.biome()); + return new PlacedFeature(configureFeature, List.of( + HeightRangePlacement.triangle(VerticalAnchor.absolute(minHeight), VerticalAnchor.absolute(maxHeight)), + CountPlacement.of(count), + InSquarePlacement.spread(), + BiomeFilter.biome()) + ); } - private static PlacedFeature addFeaturePlacement(Holder> configureFeature, PlacementModifier... placementModifiers) { - return new PlacedFeature(configureFeature, List.of(placementModifiers)); - } - - private static void register(BootstapContext context, ResourceKey featureKey, PlacedFeature feature) { - context.register(featureKey, feature); + private static PlacedFeature addTreeFeature(Holder> configureFeature, int count, float chance) { + return new PlacedFeature(configureFeature, List.of( + PlacementUtils.HEIGHTMAP, + CountPlacement.of(count), + new ChancePlacementFilter(chance), + InSquarePlacement.spread(), + BiomeFilter.biome()) + ); } }