diff --git a/neoforge/CHANGELOG.md b/neoforge/CHANGELOG.md index 0105c9e1..1b050513 100644 --- a/neoforge/CHANGELOG.md +++ b/neoforge/CHANGELOG.md @@ -2,6 +2,10 @@ All notable changes to this project will be documented in this file. +# [1.20.2-2.0.0.beta9] - 2023-11-24 + +### Ore gen has now been tested and fixed. All ores should now generate properly. + # [1.20.2-2.0.0.beta8] - 2023-11-24 ### Minor bug fixes. diff --git a/neoforge/gradle.properties b/neoforge/gradle.properties index 71091ba4..e18a33f5 100644 --- a/neoforge/gradle.properties +++ b/neoforge/gradle.properties @@ -2,7 +2,7 @@ kotlin.code.style=official org.gradle.jvmargs=-Xmx3G org.gradle.daemon=false -modVersion = 1.20.2-2.0.0.beta8 +modVersion = 1.20.2-2.0.0.beta9 mcVersion = 1.20.2 projectId = 480779 modId = temporalsmith diff --git a/neoforge/src/generated/resources/.cache/103d9f3f36b01595f1aa5172191e60eff02e6924 b/neoforge/src/generated/resources/.cache/103d9f3f36b01595f1aa5172191e60eff02e6924 index 92ca352e..c371d1fc 100644 --- a/neoforge/src/generated/resources/.cache/103d9f3f36b01595f1aa5172191e60eff02e6924 +++ b/neoforge/src/generated/resources/.cache/103d9f3f36b01595f1aa5172191e60eff02e6924 @@ -1,4 +1,11 @@ -// 1.20.2 2023-11-16T22:20:28.533679 Registries +// 1.20.2 2023-11-25T22:58:36.998559 Registries +8811f7ebb0231c679e9da0ded45180c8d5784e4f data/temporalsmith/neoforge/biome_modifier/add_aqumarine_ore.json +970aeb29b13aa54f84e12f7b883e51d26d76c942 data/temporalsmith/neoforge/biome_modifier/add_enderite_ore.json +e01058f2c8e6e8613f1091c97da5a3ca2d5e02ec data/temporalsmith/neoforge/biome_modifier/add_graphite_ore.json +218a15536ac4219b6def8a8c5f03abacdff73ece data/temporalsmith/neoforge/biome_modifier/add_imperium_ore.json +dba70b28432105f6e973f655c23212620d93fd32 data/temporalsmith/neoforge/biome_modifier/add_rainbow_ore.json +0416c6da5c3d71c0d613f3b76db4513442ffe94d data/temporalsmith/neoforge/biome_modifier/add_ruby_ore.json +5475fc5a7c3c864d7388d28b1e12ca7ac58e248d data/temporalsmith/neoforge/biome_modifier/add_sapphire_ore.json 52e07796b3598ae2784352122ffaaf4500ac1385 data/temporalsmith/worldgen/configured_feature/aqumarine_ore.json 06d2f6fc59b416a218d7f1908e39c8e8cd38f0cd data/temporalsmith/worldgen/configured_feature/enderite_ore.json 200476c7e225de0670ae88f408d09f3539f4a637 data/temporalsmith/worldgen/configured_feature/graphite_ore.json diff --git a/neoforge/src/generated/resources/data/temporalsmith/neoforge/biome_modifier/add_aqumarine_ore.json b/neoforge/src/generated/resources/data/temporalsmith/neoforge/biome_modifier/add_aqumarine_ore.json new file mode 100644 index 00000000..22254872 --- /dev/null +++ b/neoforge/src/generated/resources/data/temporalsmith/neoforge/biome_modifier/add_aqumarine_ore.json @@ -0,0 +1,6 @@ +{ + "type": "neoforge:add_features", + "biomes": "#minecraft:is_overworld", + "features": "temporalsmith:aqumarine_ore", + "step": "underground_ores" +} \ No newline at end of file diff --git a/neoforge/src/generated/resources/data/temporalsmith/neoforge/biome_modifier/add_enderite_ore.json b/neoforge/src/generated/resources/data/temporalsmith/neoforge/biome_modifier/add_enderite_ore.json new file mode 100644 index 00000000..376b81bb --- /dev/null +++ b/neoforge/src/generated/resources/data/temporalsmith/neoforge/biome_modifier/add_enderite_ore.json @@ -0,0 +1,6 @@ +{ + "type": "neoforge:add_features", + "biomes": "#minecraft:is_end", + "features": "temporalsmith:enderite_ore", + "step": "underground_ores" +} \ No newline at end of file diff --git a/neoforge/src/generated/resources/data/temporalsmith/neoforge/biome_modifier/add_graphite_ore.json b/neoforge/src/generated/resources/data/temporalsmith/neoforge/biome_modifier/add_graphite_ore.json new file mode 100644 index 00000000..aa1f3bbd --- /dev/null +++ b/neoforge/src/generated/resources/data/temporalsmith/neoforge/biome_modifier/add_graphite_ore.json @@ -0,0 +1,6 @@ +{ + "type": "neoforge:add_features", + "biomes": "#minecraft:is_overworld", + "features": "temporalsmith:graphite_ore", + "step": "underground_ores" +} \ No newline at end of file diff --git a/neoforge/src/generated/resources/data/temporalsmith/neoforge/biome_modifier/add_imperium_ore.json b/neoforge/src/generated/resources/data/temporalsmith/neoforge/biome_modifier/add_imperium_ore.json new file mode 100644 index 00000000..46f34d08 --- /dev/null +++ b/neoforge/src/generated/resources/data/temporalsmith/neoforge/biome_modifier/add_imperium_ore.json @@ -0,0 +1,6 @@ +{ + "type": "neoforge:add_features", + "biomes": "#minecraft:is_overworld", + "features": "temporalsmith:imperium_ore", + "step": "underground_ores" +} \ No newline at end of file diff --git a/neoforge/src/generated/resources/data/temporalsmith/neoforge/biome_modifier/add_rainbow_ore.json b/neoforge/src/generated/resources/data/temporalsmith/neoforge/biome_modifier/add_rainbow_ore.json new file mode 100644 index 00000000..883c2d71 --- /dev/null +++ b/neoforge/src/generated/resources/data/temporalsmith/neoforge/biome_modifier/add_rainbow_ore.json @@ -0,0 +1,6 @@ +{ + "type": "neoforge:add_features", + "biomes": "#minecraft:is_overworld", + "features": "temporalsmith:rainbow_ore", + "step": "underground_ores" +} \ No newline at end of file diff --git a/neoforge/src/generated/resources/data/temporalsmith/neoforge/biome_modifier/add_ruby_ore.json b/neoforge/src/generated/resources/data/temporalsmith/neoforge/biome_modifier/add_ruby_ore.json new file mode 100644 index 00000000..bcf5d49a --- /dev/null +++ b/neoforge/src/generated/resources/data/temporalsmith/neoforge/biome_modifier/add_ruby_ore.json @@ -0,0 +1,6 @@ +{ + "type": "neoforge:add_features", + "biomes": "#minecraft:is_overworld", + "features": "temporalsmith:ruby_ore", + "step": "underground_ores" +} \ No newline at end of file diff --git a/neoforge/src/generated/resources/data/temporalsmith/neoforge/biome_modifier/add_sapphire_ore.json b/neoforge/src/generated/resources/data/temporalsmith/neoforge/biome_modifier/add_sapphire_ore.json new file mode 100644 index 00000000..d26d7cfb --- /dev/null +++ b/neoforge/src/generated/resources/data/temporalsmith/neoforge/biome_modifier/add_sapphire_ore.json @@ -0,0 +1,6 @@ +{ + "type": "neoforge:add_features", + "biomes": "#minecraft:is_overworld", + "features": "temporalsmith:sapphire_ore", + "step": "underground_ores" +} \ No newline at end of file diff --git a/neoforge/src/main/kotlin/io/github/realyusufismail/temporalsmith/datagen/world/ModWorldGenProvider.kt b/neoforge/src/main/kotlin/io/github/realyusufismail/temporalsmith/datagen/world/ModWorldGenProvider.kt index ccd4dce0..a6577bf6 100644 --- a/neoforge/src/main/kotlin/io/github/realyusufismail/temporalsmith/datagen/world/ModWorldGenProvider.kt +++ b/neoforge/src/main/kotlin/io/github/realyusufismail/temporalsmith/datagen/world/ModWorldGenProvider.kt @@ -19,6 +19,7 @@ package io.github.realyusufismail.temporalsmith.datagen.world import io.github.realyusufismail.temporalsmith.TemporalSmith.TemporalSmith.MOD_ID +import io.github.realyusufismail.temporalsmith.worldgen.ModBiomeModifiers import io.github.realyusufismail.temporalsmith.worldgen.ModConfiguredFeatures import io.github.realyusufismail.temporalsmith.worldgen.ModPlacedFeatures import java.util.concurrent.CompletableFuture @@ -27,6 +28,7 @@ import net.minecraft.core.RegistrySetBuilder import net.minecraft.core.registries.Registries import net.minecraft.data.PackOutput import net.neoforged.neoforge.common.data.DatapackBuiltinEntriesProvider +import net.neoforged.neoforge.registries.NeoForgeRegistries class ModWorldGenProvider( output: PackOutput, @@ -35,4 +37,5 @@ class ModWorldGenProvider( RegistrySetBuilder() .add(Registries.CONFIGURED_FEATURE, ModConfiguredFeatures::bootstrap) .add(Registries.PLACED_FEATURE, ModPlacedFeatures::bootstrap) + .add(NeoForgeRegistries.Keys.BIOME_MODIFIERS, ModBiomeModifiers::bootStrap) ) : DatapackBuiltinEntriesProvider(output, registries, builder, mutableSetOf(MOD_ID)) diff --git a/neoforge/src/main/kotlin/io/github/realyusufismail/temporalsmith/worldgen/ModBiomeModifiers.kt b/neoforge/src/main/kotlin/io/github/realyusufismail/temporalsmith/worldgen/ModBiomeModifiers.kt new file mode 100644 index 00000000..382d4073 --- /dev/null +++ b/neoforge/src/main/kotlin/io/github/realyusufismail/temporalsmith/worldgen/ModBiomeModifiers.kt @@ -0,0 +1,100 @@ +/* + * Copyright 2023 RealYusufIsmail. + * + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * + * you may not use this file except in compliance with the License. + * + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package io.github.realyusufismail.temporalsmith.worldgen + +import io.github.realyusufismail.temporalsmith.TemporalSmith.TemporalSmith.MOD_ID +import net.minecraft.core.HolderSet +import net.minecraft.core.registries.Registries +import net.minecraft.data.worldgen.BootstapContext +import net.minecraft.resources.ResourceKey +import net.minecraft.resources.ResourceLocation +import net.minecraft.tags.BiomeTags +import net.minecraft.world.level.levelgen.GenerationStep +import net.neoforged.neoforge.common.world.BiomeModifier +import net.neoforged.neoforge.common.world.BiomeModifiers +import net.neoforged.neoforge.registries.NeoForgeRegistries + +object ModBiomeModifiers { + val ADD_RUBY_ORE: ResourceKey = registerKey("add_ruby_ore") + val ADD_SAPPHIRE_ORE: ResourceKey = registerKey("add_sapphire_ore") + val ADD_GRAPHITE_ORE: ResourceKey = registerKey("add_graphite_ore") + val ADD_AQUMARINE_ORE: ResourceKey = registerKey("add_aqumarine_ore") + val ADD_RAINBOW_ORE: ResourceKey = registerKey("add_rainbow_ore") + val ADD_IMPERIUM_ORE: ResourceKey = registerKey("add_imperium_ore") + val ADD_ENDERITE_ORE: ResourceKey = registerKey("add_enderite_ore") + + fun bootStrap(context: BootstapContext) { + val placedFeatures = context.lookup(Registries.PLACED_FEATURE) + val biomes = context.lookup(Registries.BIOME) + + context.register( + ADD_RUBY_ORE, + BiomeModifiers.AddFeaturesBiomeModifier( + biomes.getOrThrow(BiomeTags.IS_OVERWORLD), + HolderSet.direct(placedFeatures.getOrThrow(ModPlacedFeatures.RUBY_ORE)), + GenerationStep.Decoration.UNDERGROUND_ORES)) + + context.register( + ADD_SAPPHIRE_ORE, + BiomeModifiers.AddFeaturesBiomeModifier( + biomes.getOrThrow(BiomeTags.IS_OVERWORLD), + HolderSet.direct(placedFeatures.getOrThrow(ModPlacedFeatures.SAPPHIRE_ORE)), + GenerationStep.Decoration.UNDERGROUND_ORES)) + + context.register( + ADD_GRAPHITE_ORE, + BiomeModifiers.AddFeaturesBiomeModifier( + biomes.getOrThrow(BiomeTags.IS_OVERWORLD), + HolderSet.direct(placedFeatures.getOrThrow(ModPlacedFeatures.GRAPHITE_ORE)), + GenerationStep.Decoration.UNDERGROUND_ORES)) + + context.register( + ADD_AQUMARINE_ORE, + BiomeModifiers.AddFeaturesBiomeModifier( + biomes.getOrThrow(BiomeTags.IS_OVERWORLD), + HolderSet.direct(placedFeatures.getOrThrow(ModPlacedFeatures.AQUMARINE_ORE)), + GenerationStep.Decoration.UNDERGROUND_ORES)) + + context.register( + ADD_RAINBOW_ORE, + BiomeModifiers.AddFeaturesBiomeModifier( + biomes.getOrThrow(BiomeTags.IS_OVERWORLD), + HolderSet.direct(placedFeatures.getOrThrow(ModPlacedFeatures.RAINBOW_ORE)), + GenerationStep.Decoration.UNDERGROUND_ORES)) + + context.register( + ADD_IMPERIUM_ORE, + BiomeModifiers.AddFeaturesBiomeModifier( + biomes.getOrThrow(BiomeTags.IS_OVERWORLD), + HolderSet.direct(placedFeatures.getOrThrow(ModPlacedFeatures.IMPERIUM_ORE)), + GenerationStep.Decoration.UNDERGROUND_ORES)) + + context.register( + ADD_ENDERITE_ORE, + BiomeModifiers.AddFeaturesBiomeModifier( + biomes.getOrThrow(BiomeTags.IS_END), + HolderSet.direct(placedFeatures.getOrThrow(ModPlacedFeatures.ENDERITE_ORE)), + GenerationStep.Decoration.UNDERGROUND_ORES)) + } + + private fun registerKey(name: String): ResourceKey { + return ResourceKey.create( + NeoForgeRegistries.Keys.BIOME_MODIFIERS, ResourceLocation(MOD_ID, name)) + } +} diff --git a/neoforge/src/main/kotlin/io/github/realyusufismail/temporalsmith/worldgen/ModConfiguredFeatures.kt b/neoforge/src/main/kotlin/io/github/realyusufismail/temporalsmith/worldgen/ModConfiguredFeatures.kt index 1a01d4cb..48a19ea7 100644 --- a/neoforge/src/main/kotlin/io/github/realyusufismail/temporalsmith/worldgen/ModConfiguredFeatures.kt +++ b/neoforge/src/main/kotlin/io/github/realyusufismail/temporalsmith/worldgen/ModConfiguredFeatures.kt @@ -34,6 +34,7 @@ import net.minecraft.world.level.levelgen.structure.templatesystem.BlockMatchTes import net.minecraft.world.level.levelgen.structure.templatesystem.RuleTest import net.minecraft.world.level.levelgen.structure.templatesystem.TagMatchTest +/** @see net.minecraft.data.worldgen.features.OreFeatures */ object ModConfiguredFeatures { // overworld @@ -102,6 +103,7 @@ object ModConfiguredFeatures { OreConfiguration.target( netherrackReplaceables, BlockInit.IMPERIUM_ORE.get().defaultBlockState())) + // the number is the vein size register(context, OVERWORLD_RUBY_ORE, Feature.ORE, OreConfiguration(ruby, 4)) register(context, OVERWORLD_SAPPHIRE_ORE, Feature.ORE, OreConfiguration(sapphire, 3)) register(context, OVERWORLD_GRAPHITE_ORE, Feature.ORE, OreConfiguration(graphite, 4)) diff --git a/neoforge/src/main/kotlin/io/github/realyusufismail/temporalsmith/worldgen/ModOrePlacement.kt b/neoforge/src/main/kotlin/io/github/realyusufismail/temporalsmith/worldgen/ModOrePlacement.kt index 79732495..00228e74 100644 --- a/neoforge/src/main/kotlin/io/github/realyusufismail/temporalsmith/worldgen/ModOrePlacement.kt +++ b/neoforge/src/main/kotlin/io/github/realyusufismail/temporalsmith/worldgen/ModOrePlacement.kt @@ -21,7 +21,7 @@ package io.github.realyusufismail.temporalsmith.worldgen import net.minecraft.world.level.levelgen.placement.* object ModOrePlacement { - fun orePlacement( + private fun orePlacement( placementModifier: PlacementModifier, placementModifier1: PlacementModifier ): List { diff --git a/neoforge/src/main/kotlin/io/github/realyusufismail/temporalsmith/worldgen/ModPlacedFeatures.kt b/neoforge/src/main/kotlin/io/github/realyusufismail/temporalsmith/worldgen/ModPlacedFeatures.kt index 18259528..474e595a 100644 --- a/neoforge/src/main/kotlin/io/github/realyusufismail/temporalsmith/worldgen/ModPlacedFeatures.kt +++ b/neoforge/src/main/kotlin/io/github/realyusufismail/temporalsmith/worldgen/ModPlacedFeatures.kt @@ -30,6 +30,7 @@ import net.minecraft.world.level.levelgen.placement.HeightRangePlacement import net.minecraft.world.level.levelgen.placement.PlacedFeature import net.minecraft.world.level.levelgen.placement.PlacementModifier +/** @see net.minecraft.data.worldgen.placement.OrePlacements */ object ModPlacedFeatures { val RUBY_ORE: ResourceKey = createKey("ruby_ore") @@ -65,7 +66,9 @@ object ModPlacedFeatures { ModOrePlacement.commonOrePlacement( 3, // veins per chunk HeightRangePlacement.uniform( - VerticalAnchor.absolute(-64), VerticalAnchor.absolute(20)))) + // veins from y level -64 to 20 + VerticalAnchor.absolute(-64), + VerticalAnchor.absolute(20)))) register( context, @@ -110,7 +113,7 @@ object ModPlacedFeatures { ModOrePlacement.commonOrePlacement( 4, HeightRangePlacement.uniform( - VerticalAnchor.absolute(-64), VerticalAnchor.absolute(40)))) + VerticalAnchor.absolute(-64), VerticalAnchor.absolute(80)))) register( context, @@ -119,7 +122,7 @@ object ModPlacedFeatures { ModOrePlacement.commonOrePlacement( 4, HeightRangePlacement.uniform( - VerticalAnchor.absolute(-64), VerticalAnchor.absolute(50)))) + VerticalAnchor.absolute(-64), VerticalAnchor.absolute(40)))) } private fun createKey(name: String): ResourceKey { diff --git a/neoforge/src/main/resources/META-INF/mods.toml b/neoforge/src/main/resources/META-INF/mods.toml index c5a9b7e1..426ebb4e 100644 --- a/neoforge/src/main/resources/META-INF/mods.toml +++ b/neoforge/src/main/resources/META-INF/mods.toml @@ -4,7 +4,7 @@ license = "Apache 2.0" #mandatory issueTrackerURL = "https://github.com/RealYusufIsmail-Mc-Mods/TemporalSmith/issues" [[mods]] modId = "temporalsmith" -version = "1.20.2-1.0.0.beta8" +version = "1.20.2-1.0.0.beta9" displayName = "TemporalSmith: Aetheric Arsenal Expansion" logoFile = "logo.png" updateJSONURL = "https://forge.curseupdate.com/480779/temporalsmith" @@ -30,6 +30,6 @@ side = "BOTH" [[dependencies.temporalsmith]] modId = "realyusufismailcore" mandatory = true -versionRange = "[1.20.2-1.0.3,)" +versionRange = "[1.20.2-1.1.2,)" ordering = "NONE" side = "BOTH" \ No newline at end of file