Skip to content

Commit

Permalink
feat: Shaderoot Trees
Browse files Browse the repository at this point in the history
  • Loading branch information
Zepalesque committed Jan 5, 2025
1 parent c8e7c5f commit c962586
Show file tree
Hide file tree
Showing 14 changed files with 119 additions and 7 deletions.
6 changes: 6 additions & 0 deletions src/main/java/net/zepalesque/redux/block/ReduxBlocks.java
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,12 @@ public class ReduxBlocks extends ReduxBlockBuilders {
public static DeferredBlock<LeafPileBlock> GILDENROOT_LEAF_PILE = register("gildenroot_leaf_pile",
() -> new LeafPileBlock(GILDENROOT_LEAVES));

public static DeferredBlock<FallingLeavesBlock> SHADEROOT_LEAVES = register("shaderoot_leaves",
() -> new FallingLeavesBlock(ReduxParticles.SHADEROOT_LEAF, Properties.ofFullCopy(AetherBlocks.SKYROOT_LEAVES.get()).mapColor(MapColor.TERRACOTTA_PURPLE)));

public static DeferredBlock<LeafPileBlock> SHADEROOT_LEAF_PILE = register("shaderoot_leaf_pile",
() -> new LeafPileBlock(SHADEROOT_LEAVES));

public static DeferredBlock<GoldenCloversBlock> GOLDEN_CLOVERS = register("golden_clovers",
() -> new GoldenCloversBlock(BlockBehaviour.Properties.of()
.mapColor(MapColor.GOLD)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,13 @@ public class ReduxFlowerSets {
.compost(0.3F)
.withLore("The sapling of the Gildenroot tree. It can be grown by waiting or using Bone Meal."));

public static final BaseFlowerSet<SaplingBlock> SHADEROOT_SAPLING = register(new UntintedFlowerSet<>("shaderoot_sapling", "natural/",
() -> new SaplingBlock(ReduxTreeGrowers.SHADEROOT, Properties.ofFullCopy(Blocks.OAK_SAPLING).mapColor(MapColor.TERRACOTTA_PURPLE)))
.tabAfter(AetherCreativeTabs.AETHER_NATURAL_BLOCKS, () -> ReduxFlowerSets.GILDENROOT_SAPLING.flower().get(), BlockSet.TabAdditionPhase.BEFORE)
.withFlowerTag(BlockTags.SAPLINGS)
.compost(0.3F)
.withLore("The sapling of the Gildenroot tree. It can be grown by waiting or using Bone Meal."));

public static final BaseFlowerSet<CustomBoundsBushBlock> LUCKY_CLOVER = register(new CloverSet<>("lucky_clover", "natural/",
() -> new CustomBoundsBushBlock(Block.box(5.0D, 0.0D, 5.0D, 11.0D, 10.0D, 11.0D), Properties.ofFullCopy(Blocks.DANDELION).mapColor(MapColor.GOLD)))
.tabAfter(AetherCreativeTabs.AETHER_NATURAL_BLOCKS, ReduxBlocks.GOLDEN_CLOVERS, BlockSet.TabAdditionPhase.AFTER)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ public class ReduxParticles {
public static final DeferredRegister<ParticleType<?>> PARTICLES = DeferredRegister.create(BuiltInRegistries.PARTICLE_TYPE, Redux.MODID);

public static final DeferredHolder<ParticleType<?>, SimpleParticleType> GILDENROOT_LEAF = PARTICLES.register("gildenroot_leaf", () -> new SimpleParticleType(false));
public static final DeferredHolder<ParticleType<?>, SimpleParticleType> SHADEROOT_LEAF = PARTICLES.register("shaderoot_leaf", () -> new SimpleParticleType(false));
public static final DeferredHolder<ParticleType<?>, SimpleParticleType> WHIRLWIND_LIGHTNING = PARTICLES.register("whirlwind_lightning", () -> new SimpleParticleType(false));

public static final DeferredHolder<ParticleType<?>, SimpleParticleType> SPARK = PARTICLES.register("spark", () -> new SimpleParticleType(false));
Expand All @@ -34,6 +35,7 @@ public class ReduxParticles {
@OnlyIn(Dist.CLIENT)
public static void registerParticleFactories(RegisterParticleProvidersEvent event) {
event.registerSpriteSet(GILDENROOT_LEAF.get(), ReduxLeafParticle.Provider::new);
event.registerSpriteSet(SHADEROOT_LEAF.get(), ReduxLeafParticle.Provider::new);
event.registerSpriteSet(WHIRLWIND_LIGHTNING.get(), ReduxGlowParticle.Lightning::new);
event.registerSpriteSet(SPARK.get(), SparkParticle.Provider::new);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ protected void registerStatesAndModels() {
this.block(ReduxBlocks.GILDENROOT_LEAVES.get(), "natural/");
this.leafPile(ReduxBlocks.GILDENROOT_LEAF_PILE.get(), ReduxBlocks.GILDENROOT_LEAVES.get(), "natural/");

this.block(ReduxBlocks.SHADEROOT_LEAVES.get(), "natural/");
this.leafPile(ReduxBlocks.SHADEROOT_LEAF_PILE.get(), ReduxBlocks.SHADEROOT_LEAVES.get(), "natural/");

this.pillar(ReduxBlocks.CARVED_PILLAR.get(), "dungeon/");
this.pillar(ReduxBlocks.SENTRY_PILLAR.get(), "dungeon/");
this.baseBrick(ReduxBlocks.CARVED_BASE.get(), "dungeon/");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ protected void registerModels() {
this.itemBlock(ReduxBlocks.GILDENROOT_LEAVES.get());
this.leafPile(ReduxBlocks.GILDENROOT_LEAF_PILE.get());

this.itemBlock(ReduxBlocks.SHADEROOT_LEAVES.get());
this.leafPile(ReduxBlocks.SHADEROOT_LEAF_PILE.get());

this.itemBlock(ReduxBlocks.CARVED_BASE.get());
this.itemBlock(ReduxBlocks.CARVED_PILLAR.get());
this.itemBlock(ReduxBlocks.SENTRY_BASE.get());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ protected void addTranslations() {
addBlock(ReduxBlocks.GILDENROOT_LEAF_PILE);
addLore(ReduxBlocks.GILDENROOT_LEAF_PILE, "A pile of Gildenroot Leaves. These can be stacked on top of eachother to make various sizes!");

addBlock(ReduxBlocks.SHADEROOT_LEAVES);
addLore(ReduxBlocks.SHADEROOT_LEAVES, "Leaves of the Shaderoot tree, a corrupted variation of Skyroot that has been inflicted by the Blight.");

addBlock(ReduxBlocks.SHADEROOT_LEAF_PILE);
addLore(ReduxBlocks.SHADEROOT_LEAF_PILE, "A pile of Shaderoot Leaves. These can be stacked on top of eachother to make various sizes!");

addBlock(ReduxBlocks.GOLDEN_CLOVERS);
addLore(ReduxBlocks.GOLDEN_CLOVERS, "A nice patch of clovers that can be found in the Gilded Groves.");

Expand Down
2 changes: 2 additions & 0 deletions src/main/java/net/zepalesque/redux/data/gen/ReduxMapData.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ protected void gather() {
var compostables = this.builder(NeoForgeDataMaps.COMPOSTABLES);
this.addCompost(compostables, ReduxBlocks.GILDENROOT_LEAVES, 0.3F);
this.addCompost(compostables, ReduxBlocks.GILDENROOT_LEAF_PILE, 0.05F);
this.addCompost(compostables, ReduxBlocks.SHADEROOT_LEAVES, 0.3F);
this.addCompost(compostables, ReduxBlocks.SHADEROOT_LEAF_PILE, 0.05F);
this.addCompost(compostables, ReduxItems.WYND_OATS, 0.3F);
this.addCompost(compostables, ReduxBlocks.WYNDSPROUTS, 0.3F);
this.addCompost(compostables, ReduxItems.WYND_OAT_PANICLE, 0.65F);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ protected void buildRecipes(@NotNull RecipeOutput output) {

enchantingRecipe(RecipeCategory.DECORATIONS, ReduxFlowerSets.GILDENROOT_SAPLING.flower().get(), AetherBlocks.SKYROOT_SAPLING.get(), 0.1F, 1000).save(output);
ambrosiumEnchanting(ReduxBlocks.GILDENROOT_LEAVES.get(), AetherBlocks.SKYROOT_LEAVES.get()).save(output);
layerBlock(output, ReduxBlocks.GILDENROOT_LEAF_PILE.get(), ReduxBlocks.GILDENROOT_LEAVES.get(), 6);

layerBlock(output, ReduxBlocks.SHADEROOT_LEAF_PILE.get(), ReduxBlocks.SHADEROOT_LEAVES.get(), 6);

stonecuttingRecipe(output, RecipeCategory.BUILDING_BLOCKS, ReduxBlocks.CARVED_BASE.get(), AetherBlocks.CARVED_STONE.get());
stonecuttingRecipe(output, RecipeCategory.BUILDING_BLOCKS, ReduxBlocks.CARVED_PILLAR.get(), AetherBlocks.CARVED_STONE.get());
Expand Down Expand Up @@ -217,6 +220,5 @@ protected void buildRecipes(@NotNull RecipeOutput output) {

oreBlockStorageRecipesRecipesWithCustomUnpacking(output, RecipeCategory.MISC, ReduxItems.REFINED_SENTRITE.get(), RecipeCategory.BUILDING_BLOCKS, ReduxBlocks.REFINED_SENTRITE_BLOCK.get(), "refined_sentrite_from_refined_sentrite_block", "refined_sentrite");

layerBlock(output, ReduxBlocks.GILDENROOT_LEAF_PILE.get(), ReduxBlocks.GILDENROOT_LEAVES.get(), 6);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,20 @@ protected void generate() {
Redux.BLOCK_SETS.forEach(set -> set.lootData(this));

this.add(ReduxBlocks.GILDENROOT_LEAVES.get(),
(leaves) -> droppingWithChancesAndSkyrootSticks(leaves, ReduxFlowerSets.GILDENROOT_SAPLING.flower().get(), BlockLootAccessor.aether$getNormalLeavesSaplingChances()));

(leaves) -> droppingWithChancesAndSkyrootSticks(
leaves, ReduxFlowerSets.GILDENROOT_SAPLING.flower().get(),
BlockLootAccessor.aether$getNormalLeavesSaplingChances())
);
this.add(ReduxBlocks.GILDENROOT_LEAF_PILE.get(), shears());

this.add(ReduxBlocks.SHADEROOT_LEAVES.get(),
(leaves) -> droppingWithChancesAndSkyrootSticks(
leaves, ReduxFlowerSets.SHADEROOT_SAPLING.flower().get(),
BlockLootAccessor.aether$getNormalLeavesSaplingChances())
);
this.add(ReduxBlocks.SHADEROOT_LEAF_PILE.get(), shears());


this.dropSelf(ReduxBlocks.CARVED_PILLAR.get());
this.dropSelf(ReduxBlocks.SENTRY_PILLAR.get());
this.dropSelf(ReduxBlocks.CARVED_BASE.get());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,11 @@ public static Biome generate(BootstrapContext<Biome> context) {
.grassColorOverride(0xb1_ff_cb)
.foliageColorOverride(0xb1_ff_cb)
.grassColorModifier(BiomeSpecialEffects.GrassColorModifier.NONE)
// TODO: Consider doing some music stuff
.backgroundMusic(ReduxMusic.DEFAULT_AETHER_MUSIC)
.build())
.mobSpawnSettings(
// TODO: Blight spawns
new MobSpawnSettings.Builder()
.addMobCharge(AetherEntityTypes.COCKATRICE.get(), 0.5, 0.15)
.addMobCharge(AetherEntityTypes.ZEPHYR.get(), 0.6, 0.16)
Expand Down Expand Up @@ -72,6 +74,7 @@ public static Biome generate(BootstrapContext<Biome> context) {

.addFeature(GenerationStep.Decoration.LAKES, ReduxPlacements.SURFACE_RULE_WATER_LAKE)

// TODO: Ore balancing
.addFeature(GenerationStep.Decoration.UNDERGROUND_ORES, AetherPlacedFeatures.ORE_AETHER_DIRT_PLACEMENT)
.addFeature(GenerationStep.Decoration.UNDERGROUND_ORES, AetherPlacedFeatures.ORE_ICESTONE_PLACEMENT)
.addFeature(GenerationStep.Decoration.UNDERGROUND_ORES, AetherPlacedFeatures.ORE_AMBROSIUM_PLACEMENT)
Expand All @@ -81,14 +84,16 @@ public static Biome generate(BootstrapContext<Biome> context) {

.addFeature(GenerationStep.Decoration.FLUID_SPRINGS, AetherPlacedFeatures.WATER_SPRING_PLACEMENT)

.addFeature(GenerationStep.Decoration.VEGETAL_DECORATION, AetherPlacedFeatures.SKYROOT_FOREST_TREES_PLACEMENT)
// TODO: Blight plants
.addFeature(GenerationStep.Decoration.VEGETAL_DECORATION, ReduxPlacements.BLIGHT_TREES)
.addFeature(GenerationStep.Decoration.VEGETAL_DECORATION, AetherPlacedFeatures.HOLIDAY_TREE_PLACEMENT)
.addFeature(GenerationStep.Decoration.VEGETAL_DECORATION, AetherPlacedFeatures.GRASS_PATCH_PLACEMENT)
.addFeature(GenerationStep.Decoration.VEGETAL_DECORATION, AetherPlacedFeatures.TALL_GRASS_PATCH_PLACEMENT)
.addFeature(GenerationStep.Decoration.VEGETAL_DECORATION, AetherPlacedFeatures.WHITE_FLOWER_PATCH_PLACEMENT)
.addFeature(GenerationStep.Decoration.VEGETAL_DECORATION, AetherPlacedFeatures.PURPLE_FLOWER_PATCH_PLACEMENT)
.addFeature(GenerationStep.Decoration.VEGETAL_DECORATION, AetherPlacedFeatures.BERRY_BUSH_PATCH_PLACEMENT)

// TODO: Aercloud balancing
.addFeature(GenerationStep.Decoration.TOP_LAYER_MODIFICATION, AetherPlacedFeatures.CRYSTAL_ISLAND_PLACEMENT)
.addFeature(GenerationStep.Decoration.TOP_LAYER_MODIFICATION, AetherPlacedFeatures.COLD_AERCLOUD_PLACEMENT)
.addFeature(GenerationStep.Decoration.TOP_LAYER_MODIFICATION, AetherPlacedFeatures.BLUE_AERCLOUD_PLACEMENT)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ public class ReduxFeatureConfig extends ReduxFeatureBuilders {

public static final ResourceKey<ConfiguredFeature<?, ?>> GROVE_TREES = createKey("gilded_groves_trees");

public static final ResourceKey<ConfiguredFeature<?, ?>> BLIGHT_TREES = createKey("the_blight_trees");

public static final ResourceKey<ConfiguredFeature<?, ?>> SURFACE_RULE_WATER_LAKE = createKey("surface_rule_water_lake");

public static final ResourceKey<ConfiguredFeature<?, ?>> AMBROSIUM_ROCK = createKey("ambrosium_rock");
Expand All @@ -96,6 +98,9 @@ public class ReduxFeatureConfig extends ReduxFeatureBuilders {
public static final ResourceKey<ConfiguredFeature<?, ?>> BLEAKMOSS_VEGETATION = createKey("bleakmoss_vegetation");
public static final ResourceKey<ConfiguredFeature<?, ?>> BLEAKMOSS_BONEMEAL = createKey("bleakmoss_bonemeal");

public static final ResourceKey<ConfiguredFeature<?, ?>> SMALL_SHADEROOT_TREE = createKey("small_shaderoot");


// Overrides
public static final ResourceKey<ConfiguredFeature<?, ?>> CRYSTAL_TREE = AetherConfiguredFeatures.CRYSTAL_TREE_CONFIGURATION;
public static final ResourceKey<ConfiguredFeature<?, ?>> SKYROOT_TREE = AetherConfiguredFeatures.SKYROOT_TREE_CONFIGURATION;
Expand Down Expand Up @@ -126,6 +131,15 @@ public static void bootstrap(BootstrapContext<ConfiguredFeature<?, ?>> context)
new TwoLayersFeatureSize(1, 0, 1)
).ignoreVines().build());

register(context, SMALL_SHADEROOT_TREE, Feature.TREE,
new TreeConfiguration.TreeConfigurationBuilder(
BlockStateProvider.simple(AetherFeatureStates.SKYROOT_LOG),
new StraightTrunkPlacer(4, 2, 0),
prov(ReduxBlocks.SHADEROOT_LEAVES),
new SkyrootFoliagePlacer(ConstantInt.of(2), ConstantInt.of(0)),
new TwoLayersFeatureSize(1, 0, 1)
).ignoreVines().build());

register(context, LARGE_GILDENROOT_TREE, Feature.TREE,
new TreeConfiguration.TreeConfigurationBuilder(
BlockStateProvider.simple(AetherFeatureStates.SKYROOT_LOG),
Expand Down Expand Up @@ -210,8 +224,28 @@ public static void bootstrap(BootstrapContext<ConfiguredFeature<?, ?>> context)

register(context, GROVE_TREES, Feature.RANDOM_SELECTOR,
new RandomFeatureConfiguration(List.of(
new WeightedPlacedFeature(PlacementUtils.inlinePlaced(configs.getOrThrow(GROVE_GILDED_TREES), PlacementUtils.filteredByBlockSurvival(ReduxFlowerSets.GILDENROOT_SAPLING.flower().get())), 0.375F)),
PlacementUtils.inlinePlaced(configs.getOrThrow(GROVE_GOLDEN_TREES), PlacementUtils.filteredByBlockSurvival(AetherBlocks.GOLDEN_OAK_SAPLING.get()))));
new WeightedPlacedFeature(
PlacementUtils.inlinePlaced(
configs.getOrThrow(GROVE_GILDED_TREES),
PlacementUtils.filteredByBlockSurvival(ReduxFlowerSets.GILDENROOT_SAPLING.flower().get()))
, 0.375F)),
PlacementUtils.inlinePlaced(
configs.getOrThrow(GROVE_GOLDEN_TREES),
PlacementUtils.filteredByBlockSurvival(AetherBlocks.GOLDEN_OAK_SAPLING.get())
)));

register(context, BLIGHT_TREES, Feature.RANDOM_SELECTOR,
new RandomFeatureConfiguration(List.of(
new WeightedPlacedFeature(
PlacementUtils.inlinePlaced(
configs.getOrThrow(SMALL_SHADEROOT_TREE),
PlacementUtils.filteredByBlockSurvival(ReduxFlowerSets.SHADEROOT_SAPLING.flower().get()))
, 0.375F)),
// TODO: Blightwillow
PlacementUtils.inlinePlaced(
configs.getOrThrow(SMALL_SHADEROOT_TREE),
PlacementUtils.filteredByBlockSurvival(AetherBlocks.GOLDEN_OAK_SAPLING.get())
)));

register(context, SENTRITE_ORE, Feature.ORE, new OreConfiguration(new TagMatchTest(AetherTags.Blocks.HOLYSTONE),
drops(ReduxStoneSets.SENTRITE.block()), 48, 0.0F));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
import net.minecraft.world.level.levelgen.placement.PlacedFeature;
import net.minecraft.world.level.levelgen.placement.RarityFilter;
import net.zepalesque.redux.block.ReduxBlocks;
import net.zepalesque.redux.blockset.flower.ReduxFlowerSets;
import net.zepalesque.redux.data.resource.builders.ReduxPlacementBuilders;

public class ReduxPlacements extends ReduxPlacementBuilders {
Expand All @@ -58,6 +59,10 @@ public class ReduxPlacements extends ReduxPlacementBuilders {
public static final ResourceKey<PlacedFeature> SURFACE_RULE_WATER_LAKE = copyKey(ReduxFeatureConfig.SURFACE_RULE_WATER_LAKE);
public static final ResourceKey<PlacedFeature> WYNDSPROUTS_PATCH = copyKey(ReduxFeatureConfig.WYNDSPROUTS_PATCH);


public static final ResourceKey<PlacedFeature> BLIGHT_TREES = copyKey(ReduxFeatureConfig.BLIGHT_TREES);


public static final ResourceKey<PlacedFeature> SPARSE_WYNDSPROUTS_PATCH = createKey("sparse_" + name(ReduxBlocks.WYNDSPROUTS) + "_patch");

public static final ResourceKey<PlacedFeature> BONEMEAL_OVERRIDE = AetherPlacedFeatures.AETHER_GRASS_BONEMEAL;
Expand Down Expand Up @@ -112,6 +117,19 @@ public static void bootstrap(BootstrapContext<PlacedFeature> context) {
blacklist
);

register(context, BLIGHT_TREES, configs.getOrThrow(ReduxFeatureConfig.BLIGHT_TREES),
CountPlacement.of(new WeightedListInt(SimpleWeightedRandomList.<IntProvider>builder()
.add(ConstantInt.of(6), 9)
.add(ConstantInt.of(4), 3)
.add(ConstantInt.of(2), 5)
.add(ConstantInt.of(10), 1)
.build())),
ImprovedLayerPlacementModifier.of(Heightmap.Types.OCEAN_FLOOR, ConstantInt.of(2), 4),
BiomeFilter.biome(),
PlacementUtils.filteredByBlockSurvival(ReduxFlowerSets.SHADEROOT_SAPLING.flower().get()),
blacklist
);

register(context, AURUM_PATCH, configs.getOrThrow(ReduxFeatureConfig.AURUM_PATCH),
threshold,
ImprovedLayerPlacementModifier.of(Heightmap.Types.MOTION_BLOCKING, UniformInt.of(0, 2), 4),
Expand Down
4 changes: 3 additions & 1 deletion src/main/java/net/zepalesque/redux/item/ReduxTabs.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ public static void buildCreativeModeTabs(BuildCreativeModeTabContentsEvent event

TabUtil.putAfter(event, UnityBlocks.SKYROOT_LEAF_PILE,
ReduxBlocks.GILDENROOT_LEAVES,
ReduxBlocks.GILDENROOT_LEAF_PILE
ReduxBlocks.GILDENROOT_LEAF_PILE,
ReduxBlocks.SHADEROOT_LEAVES,
ReduxBlocks.SHADEROOT_LEAF_PILE
);

TabUtil.putAfter(event, ReduxFlowerSets.AURUM.flower(), ReduxBlocks.GOLDEN_CLOVERS);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,16 @@ public class ReduxTreeGrowers {
Optional.empty(),
Optional.empty()
);

public static final TreeGrower SHADEROOT = new TreeGrower(
"gildenroot",
0.3F,
Optional.empty(),
Optional.empty(),
Optional.of(ReduxFeatureConfig.SMALL_SHADEROOT_TREE),
// Optional.of(ReduxFeatureConfig.LARGE_GILDENROOT_TREE),
Optional.empty(),
Optional.empty(),
Optional.empty()
);
}

0 comments on commit c962586

Please sign in to comment.