mirror of
https://github.com/TeamMidnightDust/ThisRocks.git
synced 2025-12-18 20:05:08 +01:00
This Rocks 1.2.0
-Added geysers! -Added Granite, Diorite, Andesite, Gravel, Netherrack and Soul Soil rocks! -Tweaked worldgen to fix some minor issues.
This commit is contained in:
@@ -23,11 +23,14 @@ public class FeatureInjector {
|
||||
// Rocks
|
||||
if (biome.getCategory() != Biome.Category.NETHER && biome.getCategory() != Biome.Category.THEEND && biome.getCategory() != Biome.Category.BEACH && biome.getCategory() != Biome.Category.DESERT && biome.getCategory() != Biome.Category.MESA && biome.getCategory() != Biome.Category.ICY && biome.getCategory() != Biome.Category.OCEAN) {
|
||||
addFeature(biome, GenerationStep.Feature.TOP_LAYER_MODIFICATION, RockFeatures.ROCK_FEATURE);
|
||||
addFeature(biome, GenerationStep.Feature.TOP_LAYER_MODIFICATION, RockFeatures.GRANITE_ROCK_FEATURE);
|
||||
addFeature(biome, GenerationStep.Feature.TOP_LAYER_MODIFICATION, RockFeatures.DIORITE_ROCK_FEATURE);
|
||||
addFeature(biome, GenerationStep.Feature.TOP_LAYER_MODIFICATION, RockFeatures.ANDESITE_ROCK_FEATURE);
|
||||
}
|
||||
if ((biome.getCategory() == Biome.Category.BEACH) || (biome.getCategory() == Biome.Category.DESERT)) {
|
||||
if ((biome.getCategory() == Biome.Category.BEACH) || (biome.getCategory() == Biome.Category.DESERT || biome.getCategory() == Biome.Category.MESA)) {
|
||||
addFeature(biome, GenerationStep.Feature.TOP_LAYER_MODIFICATION, RockFeatures.SAND_ROCK_FEATURE);
|
||||
}
|
||||
if (biome.getCategory() == Biome.Category.MESA) {
|
||||
if (biome.getCategory() == Biome.Category.MESA || biome.getCategory() == Biome.Category.DESERT) {
|
||||
addFeature(biome, GenerationStep.Feature.TOP_LAYER_MODIFICATION, RockFeatures.RED_SAND_ROCK_FEATURE);
|
||||
}
|
||||
if (biome.getCategory() == Biome.Category.THEEND) {
|
||||
@@ -66,6 +69,18 @@ public class FeatureInjector {
|
||||
addFeature(biome, GenerationStep.Feature.TOP_LAYER_MODIFICATION, MiscFeatures.UNDERWATER_STARFISH_FEATURE);
|
||||
addFeature(biome, GenerationStep.Feature.TOP_LAYER_MODIFICATION, MiscFeatures.UNDERWATER_SEASHELL_FEATURE);
|
||||
}
|
||||
if (biome.getCategory() == Biome.Category.NETHER) {
|
||||
addFeature(biome, GenerationStep.Feature.TOP_LAYER_MODIFICATION, NetherFeatures.NETHERRACK_ROCK_FEATURE);
|
||||
addFeature(biome, GenerationStep.Feature.TOP_LAYER_MODIFICATION, NetherFeatures.SOUL_SOIL_ROCK_FEATURE);
|
||||
addFeature(biome, GenerationStep.Feature.TOP_LAYER_MODIFICATION, NetherFeatures.NETHER_GRAVEL_ROCK_FEATURE);
|
||||
addFeature(biome, GenerationStep.Feature.TOP_LAYER_MODIFICATION, NetherFeatures.NETHER_GEYSER_FEATURE);
|
||||
}
|
||||
if (biome.getCategory() != Biome.Category.NETHER) {
|
||||
addFeature(biome, GenerationStep.Feature.TOP_LAYER_MODIFICATION, RockFeatures.GRAVEL_ROCK_FEATURE);
|
||||
}
|
||||
if (biome.getCategory() == Biome.Category.ICY) {
|
||||
addFeature(biome, GenerationStep.Feature.TOP_LAYER_MODIFICATION, MiscFeatures.SNOWY_GEYSER_FEATURE);
|
||||
}
|
||||
}
|
||||
|
||||
public static void addFeature(Biome biome, GenerationStep.Feature step, ConfiguredFeature<?, ?> feature) {
|
||||
|
||||
@@ -14,6 +14,7 @@ public class FeatureRegistry<FC extends FeatureConfig> {
|
||||
|
||||
public static final UnderwaterFeature UNDERWATER_STARFISH_FEATURE;
|
||||
public static final UnderwaterFeature UNDERWATER_SEASHELL_FEATURE;
|
||||
public static final SnowFeature SNOWY_GEYSER_FEATURE;
|
||||
|
||||
private static <C extends FeatureConfig, F extends Feature<C>> F register(String name, F feature) {
|
||||
return Registry.register(Registry.FEATURE, name, feature);
|
||||
@@ -29,8 +30,12 @@ public class FeatureRegistry<FC extends FeatureConfig> {
|
||||
.addState(RocksMain.Seashell.getDefaultState().with(RocksMain.SEASHELL_VARIATION,SeashellVariation.PINK).with(Properties.WATERLOGGED, true), 2)
|
||||
.addState(RocksMain.Seashell.getDefaultState().with(RocksMain.SEASHELL_VARIATION,SeashellVariation.WHITE).with(Properties.WATERLOGGED, true), 6);
|
||||
|
||||
private static final WeightedBlockStateProvider GeyserStates = new WeightedBlockStateProvider()
|
||||
.addState(RocksMain.Geyser.getDefaultState().with(Properties.SNOWY, true), 1);
|
||||
|
||||
static {
|
||||
UNDERWATER_STARFISH_FEATURE = (UnderwaterFeature)register("underwater_starfish", new UnderwaterFeature(ProbabilityConfig.CODEC, StarfishStates));
|
||||
UNDERWATER_SEASHELL_FEATURE = (UnderwaterFeature)register("underwater_seashell", new UnderwaterFeature(ProbabilityConfig.CODEC, SeashellStates));
|
||||
UNDERWATER_STARFISH_FEATURE = register("underwater_starfish", new UnderwaterFeature(ProbabilityConfig.CODEC, StarfishStates));
|
||||
UNDERWATER_SEASHELL_FEATURE = register("underwater_seashell", new UnderwaterFeature(ProbabilityConfig.CODEC, SeashellStates));
|
||||
SNOWY_GEYSER_FEATURE = register("snowy_geyser", new SnowFeature(ProbabilityConfig.CODEC, GeyserStates));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
package eu.midnightdust.motschen.rocks.world;
|
||||
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
import eu.midnightdust.motschen.rocks.RocksMain;
|
||||
import eu.midnightdust.motschen.rocks.blockstates.SeashellVariation;
|
||||
import eu.midnightdust.motschen.rocks.blockstates.StarfishVariation;
|
||||
import eu.midnightdust.motschen.rocks.blockstates.StickVariation;
|
||||
import net.minecraft.block.Blocks;
|
||||
import net.minecraft.util.Identifier;
|
||||
import net.minecraft.util.registry.BuiltinRegistries;
|
||||
import net.minecraft.util.registry.Registry;
|
||||
import net.minecraft.world.gen.ProbabilityConfig;
|
||||
import net.minecraft.world.gen.feature.*;
|
||||
import net.minecraft.world.gen.placer.SimpleBlockPlacer;
|
||||
import net.minecraft.world.gen.stateprovider.SimpleBlockStateProvider;
|
||||
import net.minecraft.world.gen.stateprovider.WeightedBlockStateProvider;
|
||||
|
||||
public class MiscFeatures {
|
||||
@@ -21,8 +21,8 @@ public class MiscFeatures {
|
||||
.addState(RocksMain.Seashell.getDefaultState().with(RocksMain.SEASHELL_VARIATION,SeashellVariation.PINK), 2)
|
||||
.addState(RocksMain.Seashell.getDefaultState().with(RocksMain.SEASHELL_VARIATION,SeashellVariation.WHITE), 6),
|
||||
SimpleBlockPlacer.INSTANCE))
|
||||
.tries(1).spreadX(0).spreadY(0).spreadZ(0)
|
||||
.build()).decorate(ConfiguredFeatures.Decorators.FIRE).applyChance(1);
|
||||
.tries(1).spreadX(0).spreadY(0).spreadZ(0).whitelist(ImmutableSet.of(Blocks.SAND, Blocks.SANDSTONE, Blocks.RED_SAND, Blocks.RED_SANDSTONE))
|
||||
.build()).decorate(ConfiguredFeatures.Decorators.FIRE);
|
||||
public static ConfiguredFeature<?, ?> STARFISH_FEATURE = Feature.RANDOM_PATCH.configure(
|
||||
(new RandomPatchFeatureConfig.Builder(
|
||||
new WeightedBlockStateProvider()
|
||||
@@ -30,11 +30,12 @@ public class MiscFeatures {
|
||||
.addState(RocksMain.Starfish.getDefaultState().with(RocksMain.STARFISH_VARIATION,StarfishVariation.PINK), 6)
|
||||
.addState(RocksMain.Starfish.getDefaultState().with(RocksMain.STARFISH_VARIATION,StarfishVariation.ORANGE), 7),
|
||||
SimpleBlockPlacer.INSTANCE))
|
||||
.tries(1).spreadX(0).spreadY(0).spreadZ(0)
|
||||
.build()).decorate(ConfiguredFeatures.Decorators.FIRE).applyChance(1);
|
||||
.tries(1).spreadX(0).spreadY(0).spreadZ(0).whitelist(ImmutableSet.of(Blocks.SAND, Blocks.SANDSTONE, Blocks.RED_SAND, Blocks.RED_SANDSTONE))
|
||||
.build()).decorate(ConfiguredFeatures.Decorators.FIRE);
|
||||
|
||||
public static ConfiguredFeature<?, ?> UNDERWATER_STARFISH_FEATURE = FeatureRegistry.UNDERWATER_STARFISH_FEATURE.configure(new ProbabilityConfig(1));
|
||||
public static ConfiguredFeature<?, ?> UNDERWATER_SEASHELL_FEATURE = FeatureRegistry.UNDERWATER_SEASHELL_FEATURE.configure(new ProbabilityConfig(1));
|
||||
public static ConfiguredFeature<?, ?> SNOWY_GEYSER_FEATURE = FeatureRegistry.SNOWY_GEYSER_FEATURE.configure(new ProbabilityConfig(1)).decorate(ConfiguredFeatures.Decorators.FIRE);
|
||||
|
||||
public static void init() {
|
||||
Registry<ConfiguredFeature<?, ?>> registry = BuiltinRegistries.CONFIGURED_FEATURE;
|
||||
@@ -42,6 +43,7 @@ public class MiscFeatures {
|
||||
Registry.register(registry, new Identifier(RocksMain.MOD_ID, "starfish"), STARFISH_FEATURE);
|
||||
Registry.register(registry, new Identifier(RocksMain.MOD_ID, "underwater_starfish"), UNDERWATER_STARFISH_FEATURE);
|
||||
Registry.register(registry, new Identifier(RocksMain.MOD_ID, "underwater_seashell"), UNDERWATER_SEASHELL_FEATURE);
|
||||
Registry.register(registry, new Identifier(RocksMain.MOD_ID, "snowy_geyser"), SNOWY_GEYSER_FEATURE);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,66 @@
|
||||
package eu.midnightdust.motschen.rocks.world;
|
||||
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
import eu.midnightdust.motschen.rocks.RocksMain;
|
||||
import eu.midnightdust.motschen.rocks.blockstates.RockVariation;
|
||||
import net.minecraft.block.Blocks;
|
||||
import net.minecraft.util.Identifier;
|
||||
import net.minecraft.util.registry.BuiltinRegistries;
|
||||
import net.minecraft.util.registry.Registry;
|
||||
import net.minecraft.world.gen.feature.ConfiguredFeature;
|
||||
import net.minecraft.world.gen.feature.ConfiguredFeatures;
|
||||
import net.minecraft.world.gen.feature.Feature;
|
||||
import net.minecraft.world.gen.feature.RandomPatchFeatureConfig;
|
||||
import net.minecraft.world.gen.placer.SimpleBlockPlacer;
|
||||
import net.minecraft.world.gen.stateprovider.WeightedBlockStateProvider;
|
||||
|
||||
public class NetherFeatures {
|
||||
|
||||
public static ConfiguredFeature<?, ?> NETHERRACK_ROCK_FEATURE = Feature.RANDOM_PATCH.configure(
|
||||
(new RandomPatchFeatureConfig.Builder(
|
||||
new WeightedBlockStateProvider()
|
||||
.addState(RocksMain.NetherrackRock.getDefaultState().with(RocksMain.ROCK_VARIATION, RockVariation.TINY), 10)
|
||||
.addState(RocksMain.NetherrackRock.getDefaultState().with(RocksMain.ROCK_VARIATION,RockVariation.SMALL), 7)
|
||||
.addState(RocksMain.NetherrackRock.getDefaultState().with(RocksMain.ROCK_VARIATION,RockVariation.MEDIUM), 5)
|
||||
.addState(RocksMain.NetherrackRock.getDefaultState().with(RocksMain.ROCK_VARIATION,RockVariation.LARGE), 1),
|
||||
SimpleBlockPlacer.INSTANCE))
|
||||
.tries(1).spreadX(0).spreadY(0).spreadZ(0)
|
||||
.whitelist(ImmutableSet.of(Blocks.NETHERRACK,Blocks.WARPED_NYLIUM,Blocks.CRIMSON_NYLIUM)).cannotProject().build()).decorate(ConfiguredFeatures.Decorators.FIRE).repeat(128);
|
||||
public static ConfiguredFeature<?, ?> SOUL_SOIL_ROCK_FEATURE = Feature.RANDOM_PATCH.configure(
|
||||
(new RandomPatchFeatureConfig.Builder(
|
||||
new WeightedBlockStateProvider()
|
||||
.addState(RocksMain.SoulSoilRock.getDefaultState().with(RocksMain.ROCK_VARIATION, RockVariation.TINY), 10)
|
||||
.addState(RocksMain.SoulSoilRock.getDefaultState().with(RocksMain.ROCK_VARIATION,RockVariation.SMALL), 7)
|
||||
.addState(RocksMain.SoulSoilRock.getDefaultState().with(RocksMain.ROCK_VARIATION,RockVariation.MEDIUM), 5)
|
||||
.addState(RocksMain.SoulSoilRock.getDefaultState().with(RocksMain.ROCK_VARIATION,RockVariation.LARGE), 1),
|
||||
SimpleBlockPlacer.INSTANCE))
|
||||
.tries(1).spreadX(0).spreadY(0).spreadZ(0)
|
||||
.whitelist(ImmutableSet.of(Blocks.SOUL_SOIL,Blocks.SOUL_SAND)).cannotProject().build()).decorate(ConfiguredFeatures.Decorators.FIRE).repeat(128);
|
||||
public static ConfiguredFeature<?, ?> NETHER_GRAVEL_ROCK_FEATURE = Feature.RANDOM_PATCH.configure(
|
||||
(new RandomPatchFeatureConfig.Builder(
|
||||
new WeightedBlockStateProvider()
|
||||
.addState(RocksMain.GravelRock.getDefaultState().with(RocksMain.ROCK_VARIATION, RockVariation.TINY), 10)
|
||||
.addState(RocksMain.GravelRock.getDefaultState().with(RocksMain.ROCK_VARIATION,RockVariation.SMALL), 7)
|
||||
.addState(RocksMain.GravelRock.getDefaultState().with(RocksMain.ROCK_VARIATION,RockVariation.MEDIUM), 5)
|
||||
.addState(RocksMain.GravelRock.getDefaultState().with(RocksMain.ROCK_VARIATION,RockVariation.LARGE), 1),
|
||||
SimpleBlockPlacer.INSTANCE))
|
||||
.tries(1).spreadX(0).spreadY(0).spreadZ(0)
|
||||
.whitelist(ImmutableSet.of(Blocks.GRAVEL)).cannotProject().build()).decorate(ConfiguredFeatures.Decorators.FIRE).repeat(128);
|
||||
public static ConfiguredFeature<?, ?> NETHER_GEYSER_FEATURE = Feature.RANDOM_PATCH.configure(
|
||||
(new RandomPatchFeatureConfig.Builder(
|
||||
new WeightedBlockStateProvider()
|
||||
.addState(RocksMain.NetherGeyser.getDefaultState(),1),
|
||||
SimpleBlockPlacer.INSTANCE))
|
||||
.tries(1).spreadX(0).spreadY(0).spreadZ(0)
|
||||
.whitelist(ImmutableSet.of(Blocks.NETHERRACK)).cannotProject().build()).decorate(ConfiguredFeatures.Decorators.FIRE).repeat(16);
|
||||
|
||||
public static void init() {
|
||||
Registry<ConfiguredFeature<?, ?>> registry = BuiltinRegistries.CONFIGURED_FEATURE;
|
||||
|
||||
Registry.register(registry, new Identifier(RocksMain.MOD_ID, "netherrack_rock"), NETHERRACK_ROCK_FEATURE);
|
||||
Registry.register(registry, new Identifier(RocksMain.MOD_ID, "soul_soil_rock"), SOUL_SOIL_ROCK_FEATURE);
|
||||
Registry.register(registry, new Identifier(RocksMain.MOD_ID, "nether_gravel_rock"), NETHER_GRAVEL_ROCK_FEATURE);
|
||||
Registry.register(registry, new Identifier(RocksMain.MOD_ID, "nether_geyser"), NETHER_GEYSER_FEATURE);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,7 +1,9 @@
|
||||
package eu.midnightdust.motschen.rocks.world;
|
||||
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
import eu.midnightdust.motschen.rocks.RocksMain;
|
||||
import eu.midnightdust.motschen.rocks.blockstates.RockVariation;
|
||||
import net.minecraft.block.Blocks;
|
||||
import net.minecraft.util.Identifier;
|
||||
import net.minecraft.util.registry.BuiltinRegistries;
|
||||
import net.minecraft.util.registry.Registry;
|
||||
@@ -18,8 +20,38 @@ public class RockFeatures {
|
||||
.addState(RocksMain.Rock.getDefaultState().with(RocksMain.ROCK_VARIATION,RockVariation.MEDIUM), 5)
|
||||
.addState(RocksMain.Rock.getDefaultState().with(RocksMain.ROCK_VARIATION,RockVariation.LARGE), 1),
|
||||
SimpleBlockPlacer.INSTANCE))
|
||||
.tries(1).spreadX(0).spreadY(0).spreadZ(0)
|
||||
.build()).decorate(ConfiguredFeatures.Decorators.FIRE).applyChance(1);
|
||||
.tries(1).spreadX(0).spreadY(0).spreadZ(0).blacklist(ImmutableSet.of(Blocks.ICE.getDefaultState(),Blocks.SAND.getDefaultState(),Blocks.RED_SAND.getDefaultState()))
|
||||
.build()).decorate(ConfiguredFeatures.Decorators.FIRE);
|
||||
public static ConfiguredFeature<?, ?> GRANITE_ROCK_FEATURE = Feature.RANDOM_PATCH.configure(
|
||||
(new RandomPatchFeatureConfig.Builder(
|
||||
new WeightedBlockStateProvider()
|
||||
.addState(RocksMain.GraniteRock.getDefaultState().with(RocksMain.ROCK_VARIATION,RockVariation.TINY), 10)
|
||||
.addState(RocksMain.GraniteRock.getDefaultState().with(RocksMain.ROCK_VARIATION,RockVariation.SMALL), 7)
|
||||
.addState(RocksMain.GraniteRock.getDefaultState().with(RocksMain.ROCK_VARIATION,RockVariation.MEDIUM), 5)
|
||||
.addState(RocksMain.GraniteRock.getDefaultState().with(RocksMain.ROCK_VARIATION,RockVariation.LARGE), 1),
|
||||
SimpleBlockPlacer.INSTANCE))
|
||||
.tries(1).spreadX(0).spreadY(0).spreadZ(0).whitelist(ImmutableSet.of(Blocks.GRANITE))
|
||||
.build()).decorate(ConfiguredFeatures.Decorators.FIRE);
|
||||
public static ConfiguredFeature<?, ?> DIORITE_ROCK_FEATURE = Feature.RANDOM_PATCH.configure(
|
||||
(new RandomPatchFeatureConfig.Builder(
|
||||
new WeightedBlockStateProvider()
|
||||
.addState(RocksMain.DioriteRock.getDefaultState().with(RocksMain.ROCK_VARIATION,RockVariation.TINY), 10)
|
||||
.addState(RocksMain.DioriteRock.getDefaultState().with(RocksMain.ROCK_VARIATION,RockVariation.SMALL), 7)
|
||||
.addState(RocksMain.DioriteRock.getDefaultState().with(RocksMain.ROCK_VARIATION,RockVariation.MEDIUM), 5)
|
||||
.addState(RocksMain.DioriteRock.getDefaultState().with(RocksMain.ROCK_VARIATION,RockVariation.LARGE), 1),
|
||||
SimpleBlockPlacer.INSTANCE))
|
||||
.tries(1).spreadX(0).spreadY(0).spreadZ(0).whitelist(ImmutableSet.of(Blocks.DIORITE))
|
||||
.build()).decorate(ConfiguredFeatures.Decorators.FIRE);
|
||||
public static ConfiguredFeature<?, ?> ANDESITE_ROCK_FEATURE = Feature.RANDOM_PATCH.configure(
|
||||
(new RandomPatchFeatureConfig.Builder(
|
||||
new WeightedBlockStateProvider()
|
||||
.addState(RocksMain.AndesiteRock.getDefaultState().with(RocksMain.ROCK_VARIATION,RockVariation.TINY), 10)
|
||||
.addState(RocksMain.AndesiteRock.getDefaultState().with(RocksMain.ROCK_VARIATION,RockVariation.SMALL), 7)
|
||||
.addState(RocksMain.AndesiteRock.getDefaultState().with(RocksMain.ROCK_VARIATION,RockVariation.MEDIUM), 5)
|
||||
.addState(RocksMain.AndesiteRock.getDefaultState().with(RocksMain.ROCK_VARIATION,RockVariation.LARGE), 1),
|
||||
SimpleBlockPlacer.INSTANCE))
|
||||
.tries(1).spreadX(0).spreadY(0).spreadZ(0).whitelist(ImmutableSet.of(Blocks.ANDESITE))
|
||||
.build()).decorate(ConfiguredFeatures.Decorators.FIRE);
|
||||
public static ConfiguredFeature<?, ?> SAND_ROCK_FEATURE = Feature.RANDOM_PATCH.configure(
|
||||
(new RandomPatchFeatureConfig.Builder(
|
||||
new WeightedBlockStateProvider()
|
||||
@@ -28,8 +60,8 @@ public class RockFeatures {
|
||||
.addState(RocksMain.SandRock.getDefaultState().with(RocksMain.ROCK_VARIATION,RockVariation.MEDIUM), 5)
|
||||
.addState(RocksMain.SandRock.getDefaultState().with(RocksMain.ROCK_VARIATION,RockVariation.LARGE), 1),
|
||||
SimpleBlockPlacer.INSTANCE))
|
||||
.tries(1).spreadX(0).spreadY(0).spreadZ(0)
|
||||
.build()).decorate(ConfiguredFeatures.Decorators.FIRE).applyChance(1);
|
||||
.tries(1).spreadX(0).spreadY(0).spreadZ(0).whitelist(ImmutableSet.of(Blocks.SAND, Blocks.SANDSTONE))
|
||||
.build()).decorate(ConfiguredFeatures.Decorators.FIRE);
|
||||
public static ConfiguredFeature<?, ?> RED_SAND_ROCK_FEATURE = Feature.RANDOM_PATCH.configure(
|
||||
(new RandomPatchFeatureConfig.Builder(
|
||||
new WeightedBlockStateProvider()
|
||||
@@ -38,8 +70,8 @@ public class RockFeatures {
|
||||
.addState(RocksMain.RedSandRock.getDefaultState().with(RocksMain.ROCK_VARIATION,RockVariation.MEDIUM), 5)
|
||||
.addState(RocksMain.RedSandRock.getDefaultState().with(RocksMain.ROCK_VARIATION,RockVariation.LARGE), 1),
|
||||
SimpleBlockPlacer.INSTANCE))
|
||||
.tries(1).spreadX(0).spreadY(0).spreadZ(0)
|
||||
.build()).decorate(ConfiguredFeatures.Decorators.FIRE).applyChance(1);
|
||||
.tries(1).spreadX(0).spreadY(0).spreadZ(0).whitelist(ImmutableSet.of(Blocks.RED_SAND, Blocks.RED_SANDSTONE))
|
||||
.build()).decorate(ConfiguredFeatures.Decorators.FIRE);
|
||||
public static ConfiguredFeature<?, ?> END_STONE_ROCK_FEATURE = Feature.RANDOM_PATCH.configure(
|
||||
(new RandomPatchFeatureConfig.Builder(
|
||||
new WeightedBlockStateProvider()
|
||||
@@ -49,14 +81,28 @@ public class RockFeatures {
|
||||
.addState(RocksMain.EndstoneRock.getDefaultState().with(RocksMain.ROCK_VARIATION,RockVariation.LARGE), 1),
|
||||
SimpleBlockPlacer.INSTANCE))
|
||||
.tries(1).spreadX(0).spreadY(0).spreadZ(0)
|
||||
.build()).decorate(ConfiguredFeatures.Decorators.FIRE).applyChance(1);
|
||||
.build()).decorate(ConfiguredFeatures.Decorators.FIRE);
|
||||
public static ConfiguredFeature<?, ?> GRAVEL_ROCK_FEATURE = Feature.RANDOM_PATCH.configure(
|
||||
(new RandomPatchFeatureConfig.Builder(
|
||||
new WeightedBlockStateProvider()
|
||||
.addState(RocksMain.GravelRock.getDefaultState().with(RocksMain.ROCK_VARIATION,RockVariation.TINY), 10)
|
||||
.addState(RocksMain.GravelRock.getDefaultState().with(RocksMain.ROCK_VARIATION,RockVariation.SMALL), 7)
|
||||
.addState(RocksMain.GravelRock.getDefaultState().with(RocksMain.ROCK_VARIATION,RockVariation.MEDIUM), 5)
|
||||
.addState(RocksMain.GravelRock.getDefaultState().with(RocksMain.ROCK_VARIATION,RockVariation.LARGE), 1),
|
||||
SimpleBlockPlacer.INSTANCE))
|
||||
.tries(1).spreadX(0).spreadY(0).spreadZ(0).whitelist(ImmutableSet.of(Blocks.GRAVEL))
|
||||
.build()).decorate(ConfiguredFeatures.Decorators.FIRE);
|
||||
|
||||
public static void init() {
|
||||
Registry<ConfiguredFeature<?, ?>> registry = BuiltinRegistries.CONFIGURED_FEATURE;
|
||||
Registry.register(registry, new Identifier(RocksMain.MOD_ID, "rock"), ROCK_FEATURE);
|
||||
Registry.register(registry, new Identifier(RocksMain.MOD_ID, "granite_rock"), GRANITE_ROCK_FEATURE);
|
||||
Registry.register(registry, new Identifier(RocksMain.MOD_ID, "diorite_rock"), DIORITE_ROCK_FEATURE);
|
||||
Registry.register(registry, new Identifier(RocksMain.MOD_ID, "andesite_rock"), ANDESITE_ROCK_FEATURE);
|
||||
Registry.register(registry, new Identifier(RocksMain.MOD_ID, "sand_rock"), SAND_ROCK_FEATURE);
|
||||
Registry.register(registry, new Identifier(RocksMain.MOD_ID, "red_sand_rock"), RED_SAND_ROCK_FEATURE);
|
||||
Registry.register(registry, new Identifier(RocksMain.MOD_ID, "endstone_rock"), END_STONE_ROCK_FEATURE);
|
||||
Registry.register(registry, new Identifier(RocksMain.MOD_ID, "gravel_rock"), GRAVEL_ROCK_FEATURE);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
package eu.midnightdust.motschen.rocks.world;
|
||||
|
||||
import com.mojang.serialization.Codec;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.Blocks;
|
||||
import net.minecraft.state.property.Properties;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.Heightmap;
|
||||
import net.minecraft.world.StructureWorldAccess;
|
||||
import net.minecraft.world.gen.ProbabilityConfig;
|
||||
import net.minecraft.world.gen.chunk.ChunkGenerator;
|
||||
import net.minecraft.world.gen.feature.Feature;
|
||||
import net.minecraft.world.gen.stateprovider.WeightedBlockStateProvider;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
public class SnowFeature extends Feature<ProbabilityConfig> {
|
||||
WeightedBlockStateProvider weightedBlockStateProvider1;
|
||||
|
||||
public SnowFeature(Codec<ProbabilityConfig> codec, WeightedBlockStateProvider weightedBlockStateProvider) {
|
||||
super(codec);
|
||||
weightedBlockStateProvider1 = weightedBlockStateProvider;
|
||||
}
|
||||
|
||||
public boolean generate(StructureWorldAccess structureWorldAccess, ChunkGenerator chunkGenerator, Random random, BlockPos blockPos, ProbabilityConfig probabilityConfig) {
|
||||
boolean bl = false;
|
||||
int i = random.nextInt(8) - random.nextInt(8);
|
||||
int j = random.nextInt(8) - random.nextInt(8);
|
||||
int k = structureWorldAccess.getTopY(Heightmap.Type.OCEAN_FLOOR, blockPos.getX() + i, blockPos.getZ() + j);
|
||||
BlockPos blockPos2 = new BlockPos(blockPos.getX() + i, k, blockPos.getZ() + j);
|
||||
int chance = random.nextInt(8);
|
||||
|
||||
if (structureWorldAccess.getBlockState(blockPos2).isOf(Blocks.SNOW) && chance == 1) {
|
||||
|
||||
BlockState blockState = weightedBlockStateProvider1.getBlockState(random,blockPos);
|
||||
|
||||
if (blockState.canPlaceAt(structureWorldAccess, blockPos2)) {
|
||||
structureWorldAccess.setBlockState(blockPos2, blockState, 1);
|
||||
if (structureWorldAccess.getBlockState(blockPos2.down()) == Blocks.GRASS_BLOCK.getDefaultState()) {
|
||||
structureWorldAccess.setBlockState(blockPos2.down(), Blocks.GRASS_BLOCK.getDefaultState().with(Properties.SNOWY, true), 1);
|
||||
}
|
||||
|
||||
bl = true;
|
||||
}
|
||||
}
|
||||
|
||||
return bl;
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,9 @@
|
||||
package eu.midnightdust.motschen.rocks.world;
|
||||
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
import eu.midnightdust.motschen.rocks.RocksMain;
|
||||
import eu.midnightdust.motschen.rocks.blockstates.RockVariation;
|
||||
import eu.midnightdust.motschen.rocks.blockstates.StickVariation;
|
||||
import net.minecraft.block.Blocks;
|
||||
import net.minecraft.util.Identifier;
|
||||
import net.minecraft.util.registry.BuiltinRegistries;
|
||||
import net.minecraft.util.registry.Registry;
|
||||
@@ -21,8 +22,8 @@ public class StickFeatures {
|
||||
.addState(RocksMain.OakStick.getDefaultState().with(RocksMain.STICK_VARIATION,StickVariation.MEDIUM), 5)
|
||||
.addState(RocksMain.OakStick.getDefaultState().with(RocksMain.STICK_VARIATION,StickVariation.LARGE), 1),
|
||||
SimpleBlockPlacer.INSTANCE))
|
||||
.tries(1).spreadX(0).spreadY(0).spreadZ(0)
|
||||
.build()).decorate(ConfiguredFeatures.Decorators.FIRE).applyChance(1);
|
||||
.tries(1).spreadX(0).spreadY(0).spreadZ(0).whitelist(ImmutableSet.of(Blocks.GRASS_BLOCK))
|
||||
.build()).decorate(ConfiguredFeatures.Decorators.FIRE);
|
||||
public static ConfiguredFeature<?, ?> SPRUCE_STICK_FEATURE = Feature.RANDOM_PATCH.configure(
|
||||
(new RandomPatchFeatureConfig.Builder(
|
||||
new WeightedBlockStateProvider()
|
||||
@@ -32,7 +33,7 @@ public class StickFeatures {
|
||||
.addState(RocksMain.Pinecone.getDefaultState(), 1),
|
||||
SimpleBlockPlacer.INSTANCE))
|
||||
.tries(1).spreadX(0).spreadY(0).spreadZ(0)
|
||||
.build()).decorate(ConfiguredFeatures.Decorators.FIRE).applyChance(1);
|
||||
.build()).decorate(ConfiguredFeatures.Decorators.FIRE);
|
||||
public static ConfiguredFeature<?, ?> BIRCH_STICK_FEATURE = Feature.RANDOM_PATCH.configure(
|
||||
(new RandomPatchFeatureConfig.Builder(
|
||||
new WeightedBlockStateProvider()
|
||||
@@ -41,7 +42,7 @@ public class StickFeatures {
|
||||
.addState(RocksMain.BirchStick.getDefaultState().with(RocksMain.STICK_VARIATION,StickVariation.LARGE), 1),
|
||||
SimpleBlockPlacer.INSTANCE))
|
||||
.tries(1).spreadX(0).spreadY(0).spreadZ(0)
|
||||
.build()).decorate(ConfiguredFeatures.Decorators.FIRE).applyChance(1);
|
||||
.build()).decorate(ConfiguredFeatures.Decorators.FIRE);
|
||||
public static ConfiguredFeature<?, ?> ACACIA_STICK_FEATURE = Feature.RANDOM_PATCH.configure(
|
||||
(new RandomPatchFeatureConfig.Builder(
|
||||
new WeightedBlockStateProvider()
|
||||
@@ -50,7 +51,7 @@ public class StickFeatures {
|
||||
.addState(RocksMain.AcaciaStick.getDefaultState().with(RocksMain.STICK_VARIATION,StickVariation.LARGE), 1),
|
||||
SimpleBlockPlacer.INSTANCE))
|
||||
.tries(1).spreadX(0).spreadY(0).spreadZ(0)
|
||||
.build()).decorate(ConfiguredFeatures.Decorators.FIRE).applyChance(1);
|
||||
.build()).decorate(ConfiguredFeatures.Decorators.FIRE);
|
||||
public static ConfiguredFeature<?, ?> JUNGLE_STICK_FEATURE = Feature.RANDOM_PATCH.configure(
|
||||
(new RandomPatchFeatureConfig.Builder(
|
||||
new WeightedBlockStateProvider()
|
||||
@@ -59,7 +60,7 @@ public class StickFeatures {
|
||||
.addState(RocksMain.JungleStick.getDefaultState().with(RocksMain.STICK_VARIATION,StickVariation.LARGE), 1),
|
||||
SimpleBlockPlacer.INSTANCE))
|
||||
.tries(1).spreadX(0).spreadY(0).spreadZ(0)
|
||||
.build()).decorate(ConfiguredFeatures.Decorators.FIRE).applyChance(1);
|
||||
.build()).decorate(ConfiguredFeatures.Decorators.FIRE);
|
||||
public static ConfiguredFeature<?, ?> DARK_OAK_STICK_FEATURE = Feature.RANDOM_PATCH.configure(
|
||||
(new RandomPatchFeatureConfig.Builder(
|
||||
new WeightedBlockStateProvider()
|
||||
@@ -68,7 +69,7 @@ public class StickFeatures {
|
||||
.addState(RocksMain.DarkOakStick.getDefaultState().with(RocksMain.STICK_VARIATION,StickVariation.LARGE), 1),
|
||||
SimpleBlockPlacer.INSTANCE))
|
||||
.tries(1).spreadX(0).spreadY(0).spreadZ(0)
|
||||
.build()).decorate(ConfiguredFeatures.Decorators.FIRE).applyChance(1);
|
||||
.build()).decorate(ConfiguredFeatures.Decorators.FIRE);
|
||||
|
||||
public static void init() {
|
||||
Registry<ConfiguredFeature<?, ?>> registry = BuiltinRegistries.CONFIGURED_FEATURE;
|
||||
|
||||
@@ -1,21 +1,14 @@
|
||||
package eu.midnightdust.motschen.rocks.world;
|
||||
|
||||
import com.mojang.serialization.Codec;
|
||||
import eu.midnightdust.motschen.rocks.RocksMain;
|
||||
import eu.midnightdust.motschen.rocks.blockstates.StarfishVariation;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.Blocks;
|
||||
import net.minecraft.block.RailPlacementHelper;
|
||||
import net.minecraft.block.TallSeagrassBlock;
|
||||
import net.minecraft.block.enums.DoubleBlockHalf;
|
||||
import net.minecraft.state.property.Properties;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.Heightmap;
|
||||
import net.minecraft.world.StructureWorldAccess;
|
||||
import net.minecraft.world.gen.ProbabilityConfig;
|
||||
import net.minecraft.world.gen.chunk.ChunkGenerator;
|
||||
import net.minecraft.world.gen.feature.Feature;
|
||||
import net.minecraft.world.gen.placer.SimpleBlockPlacer;
|
||||
import net.minecraft.world.gen.stateprovider.WeightedBlockStateProvider;
|
||||
|
||||
import java.util.Random;
|
||||
@@ -35,8 +28,6 @@ public class UnderwaterFeature extends Feature<ProbabilityConfig> {
|
||||
BlockPos blockPos2 = new BlockPos(blockPos.getX() + i, k, blockPos.getZ() + j);
|
||||
|
||||
if (structureWorldAccess.getBlockState(blockPos2).isOf(Blocks.WATER)) {
|
||||
boolean bl2 = random.nextDouble() < (double)probabilityConfig.probability;
|
||||
boolean bl3 = random.nextDouble() < (double)2;
|
||||
|
||||
BlockState blockState = weightedBlockStateProvider1.getBlockState(random,blockPos);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user