-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bce4410
commit 555ecb7
Showing
4 changed files
with
75 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
src/main/java/com/obsilab/mcsc/world/feature/ModPlacedFeatures.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package com.obsilab.mcsc.world.feature; | ||
|
||
import com.obsilab.mcsc.MCSC; | ||
import net.minecraft.core.registries.Registries; | ||
import net.minecraft.world.level.levelgen.VerticalAnchor; | ||
import net.minecraft.world.level.levelgen.placement.*; | ||
import net.minecraftforge.eventbus.api.IEventBus; | ||
import net.minecraftforge.registries.DeferredRegister; | ||
import net.minecraftforge.registries.RegistryObject; | ||
|
||
import java.util.List; | ||
|
||
public class ModPlacedFeatures { | ||
public static final DeferredRegister<PlacedFeature> PLACED_FEATURES = | ||
DeferredRegister.create(Registries.PLACED_FEATURE, MCSC.MOD_ID); | ||
|
||
public static final RegistryObject<PlacedFeature> BORAX_ORE_PLACED = PLACED_FEATURES.register("borax_ore_placed", | ||
() -> new PlacedFeature(ModConfiguredFeatures.BORAX_ORE.getHolder().get(), | ||
commonOrePlacement(6, // VeinsPerChunk | ||
HeightRangePlacement.triangle( | ||
VerticalAnchor.absolute(0), | ||
VerticalAnchor.absolute(160) | ||
)))); | ||
|
||
|
||
public static List<PlacementModifier> orePlacement(PlacementModifier placementModifier, PlacementModifier placementModifier1) { | ||
return List.of(placementModifier, InSquarePlacement.spread(), placementModifier1, BiomeFilter.biome()); | ||
} | ||
|
||
public static List<PlacementModifier> commonOrePlacement(int i, PlacementModifier placementModifier) { | ||
return orePlacement(CountPlacement.of(i), placementModifier); | ||
} | ||
|
||
public static List<PlacementModifier> rareOrePlacement(int i, PlacementModifier placementModifier) { | ||
return orePlacement(RarityFilter.onAverageOnceEvery(i), placementModifier); | ||
} | ||
|
||
public static void register(IEventBus eventBus) { | ||
PLACED_FEATURES.register(eventBus); | ||
} | ||
|
||
} |
6 changes: 6 additions & 0 deletions
6
src/main/resources/data/mcsc/forge/biome_modifier/add_borax_ore.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"type": "forge:add_features", | ||
"biomes": "#minecraft:is_overworld", | ||
"features": "mcsc:borax_ore_placed", | ||
"step": "underground_ores" | ||
} |