Skip to content

Commit

Permalink
Issues fixed with ore gen
Browse files Browse the repository at this point in the history
  • Loading branch information
RealYusufIsmail committed Nov 26, 2023
1 parent 997c532 commit d4af3ac
Show file tree
Hide file tree
Showing 18 changed files with 193 additions and 28 deletions.
4 changes: 4 additions & 0 deletions forge/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

All notable changes to this project will be documented in this file.

# [1.20.1-1.0.7.beta7] - 2023-11-26

### Fixed issue with ore generation. Now all ores will generate in the overworld.

# [1.20.1-1.0.7.beta6] - 2023-11-25

### Added support for the new dimension called ChronoRealm. To activate build a normal portal using enderite block and ignite useing the enderite sword. Documentation will be added in the future.
Expand Down
2 changes: 1 addition & 1 deletion forge/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ kotlin.code.style=official
org.gradle.jvmargs=-Xmx3G
org.gradle.daemon=false

modVersion = 1.20.1-1.0.7.beta6
modVersion = 1.20.1-1.0.7.beta7
mcVersion = 1.20.1
projectId = 480779
modId = temporalsmith
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
// 1.20.1 2023-11-24T11:59:52.3927342 Registries
// 1.20.1 2023-11-26T11:49:26.914369 Registries
40e43a07a21eb92762a71d83f82b794e55d2405d data/temporalsmith/forge/biome_modifier/add_aqumarine_ore.json
6b1bd1f5192827b4c1b935ef43bc8344e7ed9b6f data/temporalsmith/forge/biome_modifier/add_enderite_ore.json
07cff8acbbd023a45fcae7acb9d757807d793fe2 data/temporalsmith/forge/biome_modifier/add_graphite_ore.json
dc4a1c8776b49c89d1efac51d73fb85642985706 data/temporalsmith/forge/biome_modifier/add_imperium_ore.json
0b2e8d21bfb83dfa1d0d687c625dbbebb0c79d1a data/temporalsmith/forge/biome_modifier/add_rainbow_ore.json
404fb81a6363d0760da316e8e2399fae1624c4e2 data/temporalsmith/forge/biome_modifier/add_ruby_ore.json
6161e883a542612fdfb52f4370104673ab2e1bca data/temporalsmith/forge/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
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"type": "forge:add_features",
"biomes": "#minecraft:is_overworld",
"features": "temporalsmith:aqumarine_ore",
"step": "underground_ores"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"type": "forge:add_features",
"biomes": "#minecraft:is_end",
"features": "temporalsmith:enderite_ore",
"step": "underground_ores"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"type": "forge:add_features",
"biomes": "#minecraft:is_overworld",
"features": "temporalsmith:graphite_ore",
"step": "underground_ores"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"type": "forge:add_features",
"biomes": "#minecraft:is_overworld",
"features": "temporalsmith:imperium_ore",
"step": "underground_ores"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"type": "forge:add_features",
"biomes": "#minecraft:is_overworld",
"features": "temporalsmith:rainbow_ore",
"step": "underground_ores"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"type": "forge:add_features",
"biomes": "#minecraft:is_overworld",
"features": "temporalsmith:ruby_ore",
"step": "underground_ores"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"type": "forge:add_features",
"biomes": "#minecraft:is_overworld",
"features": "temporalsmith:sapphire_ore",
"step": "underground_ores"
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
package io.github.realyusufismail.temporalsmith.datagen.world

import io.github.realyusufismail.temporalsmith.TemporalSmith.ArmorAndToolsMod.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
Expand All @@ -27,6 +28,7 @@ import net.minecraft.core.RegistrySetBuilder
import net.minecraft.core.registries.Registries
import net.minecraft.data.PackOutput
import net.minecraftforge.common.data.DatapackBuiltinEntriesProvider
import net.minecraftforge.registries.ForgeRegistries

class ModWorldGenProvider(
output: PackOutput,
Expand All @@ -35,4 +37,5 @@ class ModWorldGenProvider(
RegistrySetBuilder()
.add(Registries.CONFIGURED_FEATURE, ModConfiguredFeatures::bootstrap)
.add(Registries.PLACED_FEATURE, ModPlacedFeatures::bootstrap)
.add(ForgeRegistries.Keys.BIOME_MODIFIERS, ModBiomeModifiers::bootStrap)
) : DatapackBuiltinEntriesProvider(output, registries, builder, mutableSetOf(MOD_ID))
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,17 @@
*/
package io.github.realyusufismail.temporalsmith.worldgen

import io.github.realyusufismail.temporalsmith.TemporalSmith.TemporalSmith.MOD_ID
import io.github.realyusufismail.temporalsmith.TemporalSmith.ArmorAndToolsMod.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
import net.minecraftforge.common.world.BiomeModifier
import net.minecraftforge.common.world.ForgeBiomeModifiers
import net.minecraftforge.registries.ForgeRegistries

object ModBiomeModifiers {
val ADD_RUBY_ORE: ResourceKey<BiomeModifier> = registerKey("add_ruby_ore")
Expand All @@ -45,56 +45,56 @@ object ModBiomeModifiers {

context.register(
ADD_RUBY_ORE,
BiomeModifiers.AddFeaturesBiomeModifier(
ForgeBiomeModifiers.AddFeaturesBiomeModifier(
biomes.getOrThrow(BiomeTags.IS_OVERWORLD),
HolderSet.direct(placedFeatures.getOrThrow(ModPlacedFeatures.RUBY_ORE)),
GenerationStep.Decoration.UNDERGROUND_ORES))

context.register(
ADD_SAPPHIRE_ORE,
BiomeModifiers.AddFeaturesBiomeModifier(
ForgeBiomeModifiers.AddFeaturesBiomeModifier(
biomes.getOrThrow(BiomeTags.IS_OVERWORLD),
HolderSet.direct(placedFeatures.getOrThrow(ModPlacedFeatures.SAPPHIRE_ORE)),
GenerationStep.Decoration.UNDERGROUND_ORES))

context.register(
ADD_GRAPHITE_ORE,
BiomeModifiers.AddFeaturesBiomeModifier(
ForgeBiomeModifiers.AddFeaturesBiomeModifier(
biomes.getOrThrow(BiomeTags.IS_OVERWORLD),
HolderSet.direct(placedFeatures.getOrThrow(ModPlacedFeatures.GRAPHITE_ORE)),
GenerationStep.Decoration.UNDERGROUND_ORES))

context.register(
ADD_AQUMARINE_ORE,
BiomeModifiers.AddFeaturesBiomeModifier(
ForgeBiomeModifiers.AddFeaturesBiomeModifier(
biomes.getOrThrow(BiomeTags.IS_OVERWORLD),
HolderSet.direct(placedFeatures.getOrThrow(ModPlacedFeatures.AQUMARINE_ORE)),
GenerationStep.Decoration.UNDERGROUND_ORES))

context.register(
ADD_RAINBOW_ORE,
BiomeModifiers.AddFeaturesBiomeModifier(
ForgeBiomeModifiers.AddFeaturesBiomeModifier(
biomes.getOrThrow(BiomeTags.IS_OVERWORLD),
HolderSet.direct(placedFeatures.getOrThrow(ModPlacedFeatures.RAINBOW_ORE)),
GenerationStep.Decoration.UNDERGROUND_ORES))

context.register(
ADD_IMPERIUM_ORE,
BiomeModifiers.AddFeaturesBiomeModifier(
ForgeBiomeModifiers.AddFeaturesBiomeModifier(
biomes.getOrThrow(BiomeTags.IS_OVERWORLD),
HolderSet.direct(placedFeatures.getOrThrow(ModPlacedFeatures.IMPERIUM_ORE)),
GenerationStep.Decoration.UNDERGROUND_ORES))

context.register(
ADD_ENDERITE_ORE,
BiomeModifiers.AddFeaturesBiomeModifier(
ForgeBiomeModifiers.AddFeaturesBiomeModifier(
biomes.getOrThrow(BiomeTags.IS_END),
HolderSet.direct(placedFeatures.getOrThrow(ModPlacedFeatures.ENDERITE_ORE)),
GenerationStep.Decoration.UNDERGROUND_ORES))
}

private fun registerKey(name: String): ResourceKey<BiomeModifier> {
return ResourceKey.create(
NeoForgeRegistries.Keys.BIOME_MODIFIERS, ResourceLocation(MOD_ID, name))
ForgeRegistries.Keys.BIOME_MODIFIERS, ResourceLocation(MOD_ID, name))
}
}
15 changes: 9 additions & 6 deletions forge/src/main/resources/META-INF/mods.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,19 @@ license = "Apache 2.0" #mandatory
issueTrackerURL = "https://github.com/RealYusufIsmail-Mc-Mods/TemporalSmith"
[[mods]]
modId = "temporalsmith"
version = "1.20.1-1.0.7.beta6"
version = "1.20.1-1.0.7.beta7"
displayName = "TemporalSmith: Aetheric Arsenal Expansion"
logoFile = "logo.png"
updateJSONURL = "https://forge.curseupdate.com/480779/temporalsmith"
description ='''
Descend into the boundless realms of TemporalSmith, where time intertwines with the craft of the Aetheric Arsenal.
Unleash the power of enchanted swords and tools forged beyond the constraints of time. Explore mystical dimensions, each brimming with unique challenges and treasures.
Elevate your Minecraft experience with a fusion of temporal mastery, otherworldly landscapes, and an expansive array of armaments.
The journey awaits; delve into the time-woven secrets of TemporalSmith. (A lot of stuff to be added)
'''
Descend into the boundless realms of TemporalSmith, where time intertwines with the craft of the Aetheric Arsenal.
Unleash the power of enchanted swords and tools forged beyond the constraints of time. Explore mystical dimensions, each brimming with unique challenges and treasures.
Elevate your Minecraft experience with a fusion of temporal mastery, otherworldly landscapes, and an expansive array of armaments.
The journey awaits; delve into the time-woven secrets of TemporalSmith. (A lot of stuff to be added)
'''
# A dependency - use the . to indicate dependency for a specific modid. Dependencies are optional.
[[dependencies.temporalsmith]]
modId = "forge"
Expand Down
2 changes: 1 addition & 1 deletion neoforge/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

All notable changes to this project will be documented in this file.

# [1.20.2-2.0.0.beta9] - 2023-11-24
# [1.20.2-2.0.0.beta9] - 2023-11-26

### Ore gen has now been tested and fixed. All ores should now generate properly.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +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.ModBiomesModifiers
import io.github.realyusufismail.temporalsmith.worldgen.ModConfiguredFeatures
import io.github.realyusufismail.temporalsmith.worldgen.ModPlacedFeatures
import java.util.concurrent.CompletableFuture
Expand All @@ -37,5 +37,5 @@ class ModWorldGenProvider(
RegistrySetBuilder()
.add(Registries.CONFIGURED_FEATURE, ModConfiguredFeatures::bootstrap)
.add(Registries.PLACED_FEATURE, ModPlacedFeatures::bootstrap)
.add(NeoForgeRegistries.Keys.BIOME_MODIFIERS, ModBiomeModifiers::bootStrap)
.add(NeoForgeRegistries.Keys.BIOME_MODIFIERS, ModBiomesModifiers::bootStrap)
) : DatapackBuiltinEntriesProvider(output, registries, builder, mutableSetOf(MOD_ID))
Original file line number Diff line number Diff line change
@@ -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 ModBiomesModifiers {
val ADD_RUBY_ORE: ResourceKey<BiomeModifier> = registerKey("add_ruby_ore")
val ADD_SAPPHIRE_ORE: ResourceKey<BiomeModifier> = registerKey("add_sapphire_ore")
val ADD_GRAPHITE_ORE: ResourceKey<BiomeModifier> = registerKey("add_graphite_ore")
val ADD_AQUMARINE_ORE: ResourceKey<BiomeModifier> = registerKey("add_aqumarine_ore")
val ADD_RAINBOW_ORE: ResourceKey<BiomeModifier> = registerKey("add_rainbow_ore")
val ADD_IMPERIUM_ORE: ResourceKey<BiomeModifier> = registerKey("add_imperium_ore")
val ADD_ENDERITE_ORE: ResourceKey<BiomeModifier> = registerKey("add_enderite_ore")

fun bootStrap(context: BootstapContext<BiomeModifier>) {
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<BiomeModifier> {
return ResourceKey.create(
NeoForgeRegistries.Keys.BIOME_MODIFIERS, ResourceLocation(MOD_ID, name))
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ object ModPlacedFeatures {
ModOrePlacement.commonOrePlacement(
4,
HeightRangePlacement.uniform(
VerticalAnchor.absolute(-64), VerticalAnchor.absolute(20))))
VerticalAnchor.absolute(-64), VerticalAnchor.absolute(40))))

register(
context,
Expand Down
14 changes: 10 additions & 4 deletions neoforge/src/main/resources/META-INF/mods.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,15 @@ displayName = "TemporalSmith: Aetheric Arsenal Expansion"
logoFile = "logo.png"
updateJSONURL = "https://forge.curseupdate.com/480779/temporalsmith"
displayURL = "https://www.curseforge.com/minecraft/mc-mods/temporalsmith"
description = '''
Descend into the boundless realms of TemporalSmith, where time intertwines with the craft of the Aetheric Arsenal. Unleash the power of enchanted swords and tools forged beyond the constraints of time. Explore mystical dimensions, each brimming with unique challenges and treasures. Elevate your Minecraft experience with a fusion of temporal mastery, otherworldly landscapes, and an expansive array of armaments. The journey awaits; delve into the time-woven secrets of TemporalSmith. (A lot of stuff to be added)'''
description ='''
Descend into the boundless realms of TemporalSmith, where time intertwines with the craft of the Aetheric Arsenal.
Unleash the power of enchanted swords and tools forged beyond the constraints of time. Explore mystical dimensions, each brimming with unique challenges and treasures.
Elevate your Minecraft experience with a fusion of temporal mastery, otherworldly landscapes, and an expansive array of armaments.
The journey awaits; delve into the time-woven secrets of TemporalSmith. (A lot of stuff to be added)
'''
# A dependency - use the . to indicate dependency for a specific modid. Dependencies are optional.
[[dependencies.temporalsmith]]
modId = "neoforge"
Expand All @@ -30,6 +36,6 @@ side = "BOTH"
[[dependencies.temporalsmith]]
modId = "realyusufismailcore"
mandatory = true
versionRange = "[1.20.2-1.1.2,)"
versionRange = "[1.20.2-1.1.1,)"
ordering = "NONE"
side = "BOTH"
side = "BOTH"

0 comments on commit d4af3ac

Please sign in to comment.