ore gen
This commit is contained in:
19
CHANGELOG.MD
19
CHANGELOG.MD
@@ -1,6 +1,25 @@
|
||||
# Changelog
|
||||
|
||||
|
||||
## 1.1.1
|
||||
- Horse Armor
|
||||
- Player Armor
|
||||
- Now able to enchant the armor
|
||||
- Custom Armor Trim and Material
|
||||
- Music Disc
|
||||
- Tool Set
|
||||
- Nugget is Eatable
|
||||
- Custom Painting
|
||||
- Ore Gen
|
||||
|
||||
# Modrinth changle
|
||||
|
||||
- Horse Armor
|
||||
- Player Armor
|
||||
- Music Disc
|
||||
- Ore Gen
|
||||
- Custom Painting
|
||||
|
||||
## 1.10
|
||||
- added tools, and sword
|
||||
- datagen for no more json files*
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
package xyz.sillyangel.nugget.worldgen;
|
||||
|
||||
import net.minecraft.tags.BlockTags;
|
||||
import net.minecraft.world.level.levelgen.feature.configurations.OreConfiguration;
|
||||
import net.minecraft.world.level.levelgen.structure.templatesystem.RuleTest;
|
||||
import net.minecraft.world.level.levelgen.structure.templatesystem.TagMatchTest;
|
||||
import xyz.sillyangel.nugget.NuggetMod;
|
||||
import net.minecraft.core.registries.Registries;
|
||||
import net.minecraft.data.worldgen.BootstrapContext;
|
||||
@@ -8,12 +12,25 @@ import net.minecraft.resources.ResourceLocation;
|
||||
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 xyz.sillyangel.nugget.block.ModBlocks;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class ModConfiguredFeatures {
|
||||
|
||||
public static void bootstrap(BootstrapContext<ConfiguredFeature<?, ?>> context) {
|
||||
public static final ResourceKey<ConfiguredFeature<?, ?>> OVERWORLD_NUGGET_ORE = registerKey("nugget_ore");
|
||||
|
||||
|
||||
public static void bootstrap(BootstrapContext<ConfiguredFeature<?, ?>> context) {
|
||||
RuleTest stoneReplaceables = new TagMatchTest(BlockTags.STONE_ORE_REPLACEABLES);
|
||||
RuleTest deepslateReplaceables = new TagMatchTest(BlockTags.DEEPSLATE_ORE_REPLACEABLES);
|
||||
|
||||
List<OreConfiguration.TargetBlockState> overworldNuggetOres = List.of(
|
||||
OreConfiguration.target(stoneReplaceables, ModBlocks.NUGGET_ORE.get().defaultBlockState()),
|
||||
OreConfiguration.target(deepslateReplaceables, ModBlocks.NUGGET_DEEPSLATE_ORE.get().defaultBlockState()));
|
||||
|
||||
register(context, OVERWORLD_NUGGET_ORE, Feature.ORE, new OreConfiguration(overworldNuggetOres, 9));
|
||||
|
||||
}
|
||||
|
||||
public static ResourceKey<ConfiguredFeature<?, ?>> registerKey(String name) {
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
package xyz.sillyangel.nugget.worldgen;
|
||||
|
||||
import net.minecraft.world.level.levelgen.placement.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class ModOrePlacement {
|
||||
public static List<PlacementModifier> orePlacement(PlacementModifier pCountPlacement, PlacementModifier pHeightRange) {
|
||||
return List.of(pCountPlacement, InSquarePlacement.spread(), pHeightRange, BiomeFilter.biome());
|
||||
}
|
||||
|
||||
public static List<PlacementModifier> commonOrePlacement(int pCount, PlacementModifier pHeightRange) {
|
||||
return orePlacement(CountPlacement.of(pCount), pHeightRange);
|
||||
}
|
||||
|
||||
public static List<PlacementModifier> rareOrePlacement(int pChance, PlacementModifier pHeightRange) {
|
||||
return orePlacement(RarityFilter.onAverageOnceEvery(pChance), pHeightRange);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user