diff --git a/src/main/java/net/zepalesque/redux/block/ReduxBlocks.java b/src/main/java/net/zepalesque/redux/block/ReduxBlocks.java index fa1a942cf..8602f432b 100644 --- a/src/main/java/net/zepalesque/redux/block/ReduxBlocks.java +++ b/src/main/java/net/zepalesque/redux/block/ReduxBlocks.java @@ -12,6 +12,7 @@ import net.minecraft.world.level.block.ChainBlock; import net.minecraft.world.level.block.FlowerPotBlock; import net.minecraft.world.level.block.LanternBlock; +import net.minecraft.world.level.block.PinkPetalsBlock; import net.minecraft.world.level.block.RotatedPillarBlock; import net.minecraft.world.level.block.SaplingBlock; import net.minecraft.world.level.block.SoundType; @@ -20,6 +21,7 @@ import net.minecraft.world.level.block.state.BlockBehaviour.OffsetType; import net.minecraft.world.level.block.state.properties.NoteBlockInstrument; import net.minecraft.world.level.material.MapColor; +import net.minecraft.world.level.material.PushReaction; import net.neoforged.neoforge.registries.DeferredBlock; import net.neoforged.neoforge.registries.DeferredRegister; import net.zepalesque.redux.Redux; @@ -27,6 +29,7 @@ import net.zepalesque.redux.block.dungeon.RunelightBlock; import net.zepalesque.redux.block.dungeon.TrappedPillarBlock; import net.zepalesque.redux.block.natural.AetherShortGrassBlock; +import net.zepalesque.redux.block.natural.GoldenCloversBlock; import net.zepalesque.redux.block.natural.crop.WyndoatsBlock; import net.zepalesque.redux.block.natural.leaves.FallingLeavesBlock; import net.zepalesque.redux.block.state.ReduxBlockBuilders; @@ -47,12 +50,17 @@ public class ReduxBlocks extends ReduxBlockBuilders { .hasPostProcess((state, level, pos) -> true) )); - public static final DeferredBlock CLOUDROOT_SAPLING = register("cloudroot_sapling", - () -> new SaplingBlock(ReduxTreeGrowers.CLOUDROOT, Properties.ofFullCopy(Blocks.OAK_SAPLING).mapColor(MapColor.QUARTZ))); - public static DeferredBlock CLOUDROOT_LEAVES = register("cloudroot_leaves", () -> new FallingLeavesBlock(ReduxParticles.CLOUDROOT_LEAF, Properties.ofFullCopy(AetherBlocks.SKYROOT_LEAVES.get()).mapColor(MapColor.QUARTZ))); + public static DeferredBlock GOLDEN_CLOVERS = register("golden_clovers", + () -> new GoldenCloversBlock(BlockBehaviour.Properties.of() + .mapColor(MapColor.GOLD) + .noCollission() + .sound(SoundType.PINK_PETALS) + .pushReaction(PushReaction.DESTROY) + )); + public static final DeferredBlock CARVED_PILLAR = register("carved_pillar", () -> new RotatedPillarBlock(Properties.of().mapColor(MapColor.STONE).instrument(NoteBlockInstrument.BASEDRUM).strength(0.5F, 6.0F).requiresCorrectToolForDrops())); public static final DeferredBlock SENTRY_PILLAR = register("sentry_pillar", () -> new RotatedPillarBlock(Properties.ofFullCopy(CARVED_PILLAR.get()).lightLevel(state -> 11))); public static final DeferredBlock CARVED_BASE = register("carved_base", () -> new Block(Properties.of().mapColor(MapColor.STONE).instrument(NoteBlockInstrument.BASEDRUM).strength(0.5F, 6.0F).requiresCorrectToolForDrops())); diff --git a/src/main/java/net/zepalesque/redux/block/natural/GoldenCloversBlock.java b/src/main/java/net/zepalesque/redux/block/natural/GoldenCloversBlock.java index e9ccaaca8..0e87e4b94 100644 --- a/src/main/java/net/zepalesque/redux/block/natural/GoldenCloversBlock.java +++ b/src/main/java/net/zepalesque/redux/block/natural/GoldenCloversBlock.java @@ -1,10 +1,20 @@ package net.zepalesque.redux.block.natural; +import com.aetherteam.aether.block.AetherBlockStateProperties; +import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.PinkPetalsBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.StateDefinition; -// TODO: Make these different somehow public class GoldenCloversBlock extends PinkPetalsBlock { public GoldenCloversBlock(Properties properties) { super(properties); + this.registerDefaultState(this.defaultBlockState().setValue(AetherBlockStateProperties.DOUBLE_DROPS, false)); + } + + @Override + protected void createBlockStateDefinition(StateDefinition.Builder builder) { + super.createBlockStateDefinition(builder); + builder.add(AetherBlockStateProperties.DOUBLE_DROPS); } } diff --git a/src/main/java/net/zepalesque/redux/blockset/flower/ReduxFlowerSets.java b/src/main/java/net/zepalesque/redux/blockset/flower/ReduxFlowerSets.java index 2e9841862..228cb29fc 100644 --- a/src/main/java/net/zepalesque/redux/blockset/flower/ReduxFlowerSets.java +++ b/src/main/java/net/zepalesque/redux/blockset/flower/ReduxFlowerSets.java @@ -3,30 +3,40 @@ import com.aetherteam.aether.block.AetherBlocks; import com.aetherteam.aether.item.AetherCreativeTabs; import net.minecraft.data.recipes.RecipeCategory; +import net.minecraft.tags.BlockTags; import net.minecraft.world.effect.MobEffects; import net.minecraft.world.item.Items; -import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.Blocks; +import net.minecraft.world.level.block.SaplingBlock; import net.minecraft.world.level.block.state.BlockBehaviour.Properties; -import net.minecraft.world.phys.shapes.VoxelShape; +import net.minecraft.world.level.material.MapColor; import net.zepalesque.redux.Redux; import net.zepalesque.redux.block.natural.bush.CustomBoundsFlowerBlock; -import net.zepalesque.redux.blockset.flower.type.AetherFlowerSet; import net.zepalesque.redux.blockset.flower.type.BaseFlowerSet; import net.zepalesque.redux.blockset.flower.type.EnchantedFlowerSet; -import net.zepalesque.redux.blockset.stone.ReduxStoneSets; +import net.zepalesque.redux.blockset.flower.type.UntintedFlowerSet; +import net.zepalesque.redux.world.tree.ReduxTreeGrowers; import net.zepalesque.zenith.api.blockset.AbstractFlowerSet; -import net.zepalesque.zenith.api.blockset.AbstractStoneSet; import net.zepalesque.zenith.block.util.CommonPlantBounds; public class ReduxFlowerSets { public static final BaseFlowerSet AURUM = register(new EnchantedFlowerSet<>("aurum", "natural/", () -> new CustomBoundsFlowerBlock.Enchanted(CommonPlantBounds.FLOWER, - () -> MobEffects.LUCK, 60, Properties.ofFullCopy(Blocks.DANDELION).hasPostProcess((s, l, p) -> true)), 1, null)) + () -> MobEffects.LUCK, 60, Properties.ofFullCopy(Blocks.DANDELION).hasPostProcess((s, l, p) -> true)), 1, 0xFFFFFF) .creativeTab(AetherCreativeTabs.AETHER_NATURAL_BLOCKS, AetherBlocks.WHITE_FLOWER) .craftsIntoShapeless(1, () -> Items.YELLOW_DYE, 1, RecipeCategory.MISC) - .withLore("A golden flower found in the Gilded Groves. Some say it brings good luck!"); + .withFlowerTag(BlockTags.FLOWERS) + .withPotTag(BlockTags.FLOWER_POTS) + .withLore("A golden flower found in the Gilded Groves. Some say it brings good luck!")); + + public static final BaseFlowerSet CLOUDROOT_SAPLING = register(new UntintedFlowerSet<>("cloudroot_sapling", "natural/", + () -> new SaplingBlock(ReduxTreeGrowers.CLOUDROOT, Properties.ofFullCopy(Blocks.OAK_SAPLING).mapColor(MapColor.QUARTZ))) + .creativeTab(AetherCreativeTabs.AETHER_NATURAL_BLOCKS, AetherBlocks.SKYROOT_SAPLING) + .withFlowerTag(BlockTags.SAPLINGS) + .withPotTag(BlockTags.FLOWER_POTS) + .compost(0.3F) + .withLore("The sapling of the Cloudroot tree. It can be grown by waiting or using Bone Meal.")); public static T register(T set) { Redux.BLOCK_SETS.add(set); diff --git a/src/main/java/net/zepalesque/redux/blockset/flower/type/UntintedFlowerSet.java b/src/main/java/net/zepalesque/redux/blockset/flower/type/UntintedFlowerSet.java new file mode 100644 index 000000000..59f61c60d --- /dev/null +++ b/src/main/java/net/zepalesque/redux/blockset/flower/type/UntintedFlowerSet.java @@ -0,0 +1,26 @@ +package net.zepalesque.redux.blockset.flower.type; + +import net.minecraft.world.level.block.Block; +import net.zepalesque.redux.data.prov.ReduxBlockStateProvider; +import net.zepalesque.redux.data.prov.ReduxItemModelProvider; +import net.zepalesque.zenith.util.lambda.Consumers; + +import java.util.function.Supplier; + +public class UntintedFlowerSet extends BaseFlowerSet{ + public UntintedFlowerSet(String id, String textureFolder, Supplier constructor) { + super(id, textureFolder, constructor); + } + + @Override + public void blockData(ReduxBlockStateProvider data) { + data.crossBlock(this.flower().get(), this.textureFolder); + Consumers.C3 pot = this.usePottedPrefix ? data::potAlt : data::pottedPlant; + pot.accept(this.pot().get(), this.flower().get(), this.textureFolder); + } + + @Override + public void itemData(ReduxItemModelProvider data) { + data.itemBlockFlat(this.flower().get(), this.textureFolder); + } +} diff --git a/src/main/java/net/zepalesque/redux/data/gen/ReduxBlockStateData.java b/src/main/java/net/zepalesque/redux/data/gen/ReduxBlockStateData.java index 6ba75e32c..54ebdfe53 100644 --- a/src/main/java/net/zepalesque/redux/data/gen/ReduxBlockStateData.java +++ b/src/main/java/net/zepalesque/redux/data/gen/ReduxBlockStateData.java @@ -21,7 +21,6 @@ protected void registerStatesAndModels() { this.tintableShortGrass(ReduxBlocks.SHORT_AETHER_GRASS.get(), "natural/"); this.block(ReduxBlocks.CLOUDROOT_LEAVES.get(), "natural/"); - this.crossBlock(ReduxBlocks.CLOUDROOT_SAPLING.get(), "natural/"); this.pillar(ReduxBlocks.CARVED_PILLAR.get(), "dungeon/"); this.pillar(ReduxBlocks.SENTRY_PILLAR.get(), "dungeon/"); @@ -59,5 +58,7 @@ protected void registerStatesAndModels() { this.block(ReduxBlocks.VERIDIUM_BLOCK.get(), "construction/"); this.block(ReduxBlocks.REFINED_SENTRITE_BLOCK.get(), "construction/"); + this.flowerbed(ReduxBlocks.GOLDEN_CLOVERS.get(), "natural/"); + } } diff --git a/src/main/java/net/zepalesque/redux/data/gen/ReduxItemModelData.java b/src/main/java/net/zepalesque/redux/data/gen/ReduxItemModelData.java index 71d66831d..c9483ec3d 100644 --- a/src/main/java/net/zepalesque/redux/data/gen/ReduxItemModelData.java +++ b/src/main/java/net/zepalesque/redux/data/gen/ReduxItemModelData.java @@ -20,7 +20,6 @@ protected void registerModels() { itemBlockFlatCustomTexture(ReduxBlocks.SHORT_AETHER_GRASS.get(), "natural/aether_medium_grass"); this.itemBlock(ReduxBlocks.CLOUDROOT_LEAVES.get()); - this.itemBlockFlat(ReduxBlocks.CLOUDROOT_SAPLING.get(), "natural/"); this.itemBlock(ReduxBlocks.CARVED_BASE.get()); this.itemBlock(ReduxBlocks.CARVED_PILLAR.get()); @@ -76,6 +75,8 @@ protected void registerModels() { this.itemBlock(ReduxBlocks.VERIDIUM_BLOCK.get()); this.itemBlock(ReduxBlocks.REFINED_SENTRITE_BLOCK.get()); + item(ReduxBlocks.GOLDEN_CLOVERS.get().asItem(), "misc/"); + } diff --git a/src/main/java/net/zepalesque/redux/data/gen/ReduxLanguageData.java b/src/main/java/net/zepalesque/redux/data/gen/ReduxLanguageData.java index 1ed8fdd7e..1eaf431cd 100644 --- a/src/main/java/net/zepalesque/redux/data/gen/ReduxLanguageData.java +++ b/src/main/java/net/zepalesque/redux/data/gen/ReduxLanguageData.java @@ -24,8 +24,8 @@ protected void addTranslations() { addBlock(ReduxBlocks.CLOUDROOT_LEAVES); addLore(ReduxBlocks.CLOUDROOT_LEAVES, "Leaves of the Cloudroot tree, a variation of Skyroot that has been touched by Ambrosium but has not fully adapted as Golden Oaks have. These sometimes will drop Cloudroot Saplings"); - addBlock(ReduxBlocks.CLOUDROOT_SAPLING); - addLore(ReduxBlocks.CLOUDROOT_SAPLING, "The sapling of the Cloudroot tree. It can be grown by waiting or using Bone Meal."); + addBlock(ReduxBlocks.GOLDEN_CLOVERS); + addLore(ReduxBlocks.GOLDEN_CLOVERS, "A nice patch of clovers that can be found in the Gilded Groves."); addBlock(ReduxBlocks.CARVED_PILLAR); addLore(ReduxBlocks.CARVED_PILLAR, "A pillar made of Carved Stone. Pillars look nice for supporting a build, along with giving it nice corners."); diff --git a/src/main/java/net/zepalesque/redux/data/gen/ReduxMapData.java b/src/main/java/net/zepalesque/redux/data/gen/ReduxMapData.java index 35d9edda3..996a18889 100644 --- a/src/main/java/net/zepalesque/redux/data/gen/ReduxMapData.java +++ b/src/main/java/net/zepalesque/redux/data/gen/ReduxMapData.java @@ -29,7 +29,6 @@ protected void gather() { var compostables = this.builder(NeoForgeDataMaps.COMPOSTABLES); this.addCompost(compostables, ReduxBlocks.CLOUDROOT_LEAVES, 0.3F); - this.addCompost(compostables, ReduxBlocks.CLOUDROOT_SAPLING, 0.3F); this.addCompost(compostables, ReduxBlocks.SHORT_AETHER_GRASS, 0.3F); this.addCompost(compostables, ReduxItems.WYND_OATS, 0.3F); this.addCompost(compostables, ReduxBlocks.WYNDSPROUTS, 0.3F); diff --git a/src/main/java/net/zepalesque/redux/data/gen/ReduxRecipeData.java b/src/main/java/net/zepalesque/redux/data/gen/ReduxRecipeData.java index 123e5b8fc..51783c984 100644 --- a/src/main/java/net/zepalesque/redux/data/gen/ReduxRecipeData.java +++ b/src/main/java/net/zepalesque/redux/data/gen/ReduxRecipeData.java @@ -14,6 +14,7 @@ import net.minecraft.sounds.SoundEvents; import net.zepalesque.redux.Redux; import net.zepalesque.redux.block.ReduxBlocks; +import net.zepalesque.redux.blockset.flower.ReduxFlowerSets; import net.zepalesque.redux.blockset.stone.ReduxStoneSets; import net.zepalesque.redux.client.audio.ReduxSounds; import net.zepalesque.redux.data.prov.ReduxRecipeProvider; @@ -42,7 +43,7 @@ protected void buildRecipes(@NotNull RecipeOutput output) { smeltingOreRecipe(ReduxItems.REFINED_SENTRITE.get(), ReduxStoneSets.SENTRITE.block().get(), 0.8F, 300).save(output, name("refine_sentrite_smelt")); blastingOreRecipe(ReduxItems.REFINED_SENTRITE.get(), ReduxStoneSets.SENTRITE.block().get(), 0.8F, 150).save(output, name("refine_sentrite_blast")); - enchantingRecipe(RecipeCategory.DECORATIONS, ReduxBlocks.CLOUDROOT_SAPLING.get(), AetherBlocks.SKYROOT_SAPLING.get(), 0.1F, 1000).save(output); + enchantingRecipe(RecipeCategory.DECORATIONS, ReduxFlowerSets.CLOUDROOT_SAPLING.flower().get(), AetherBlocks.SKYROOT_SAPLING.get(), 0.1F, 1000).save(output); ambrosiumEnchanting(ReduxBlocks.CLOUDROOT_LEAVES.get(), AetherBlocks.SKYROOT_LEAVES.get()).save(output); stonecuttingRecipe(output, RecipeCategory.BUILDING_BLOCKS, ReduxBlocks.CARVED_BASE.get(), AetherBlocks.CARVED_STONE.get()); diff --git a/src/main/java/net/zepalesque/redux/data/gen/loot/ReduxBlockLoot.java b/src/main/java/net/zepalesque/redux/data/gen/loot/ReduxBlockLoot.java index 7633a7951..a3df1a832 100644 --- a/src/main/java/net/zepalesque/redux/data/gen/loot/ReduxBlockLoot.java +++ b/src/main/java/net/zepalesque/redux/data/gen/loot/ReduxBlockLoot.java @@ -11,6 +11,7 @@ import net.zepalesque.redux.Redux; import net.zepalesque.redux.block.ReduxBlocks; import net.zepalesque.redux.block.natural.crop.WyndoatsBlock; +import net.zepalesque.redux.blockset.flower.ReduxFlowerSets; import net.zepalesque.redux.data.prov.loot.ReduxBlockLootProvider; import net.zepalesque.redux.item.ReduxItems; @@ -33,9 +34,8 @@ protected void generate() { this.add(ReduxBlocks.SHORT_AETHER_GRASS.get(), shears()); - this.dropSelf(ReduxBlocks.CLOUDROOT_SAPLING.get()); this.add(ReduxBlocks.CLOUDROOT_LEAVES.get(), - (leaves) -> droppingWithChancesAndSkyrootSticks(leaves, ReduxBlocks.CLOUDROOT_SAPLING.get(), BlockLootAccessor.aether$getNormalLeavesSaplingChances())); + (leaves) -> droppingWithChancesAndSkyrootSticks(leaves, ReduxFlowerSets.CLOUDROOT_SAPLING.flower().get(), BlockLootAccessor.aether$getNormalLeavesSaplingChances())); this.dropSelf(ReduxBlocks.CARVED_PILLAR.get()); this.dropSelf(ReduxBlocks.SENTRY_PILLAR.get()); @@ -80,6 +80,8 @@ protected void generate() { this.dropSelf(ReduxBlocks.VERIDIUM_BLOCK.get()); this.dropSelf(ReduxBlocks.RAW_VERIDIUM_BLOCK.get()); this.dropSelf(ReduxBlocks.REFINED_SENTRITE_BLOCK.get()); + + this.createPetalsDrops(ReduxBlocks.GOLDEN_CLOVERS.get()); } @Override diff --git a/src/main/java/net/zepalesque/redux/data/gen/tags/ReduxBlockTagsData.java b/src/main/java/net/zepalesque/redux/data/gen/tags/ReduxBlockTagsData.java index 0a47c6417..f223a71de 100644 --- a/src/main/java/net/zepalesque/redux/data/gen/tags/ReduxBlockTagsData.java +++ b/src/main/java/net/zepalesque/redux/data/gen/tags/ReduxBlockTagsData.java @@ -41,7 +41,16 @@ protected void addTags(HolderLookup.Provider provider) { ReduxBlocks.CLOUDROOT_LEAVES.get() ); this.tag(BlockTags.MINEABLE_WITH_HOE).add( - ReduxBlocks.CLOUDROOT_LEAVES.get() + ReduxBlocks.CLOUDROOT_LEAVES.get(), + ReduxBlocks.GOLDEN_CLOVERS.get() + ); + + this.tag(BlockTags.INSIDE_STEP_SOUND_BLOCKS).add( + ReduxBlocks.GOLDEN_CLOVERS.get() + ); + + this.tag(BlockTags.SWORD_EFFICIENT).add( + ReduxBlocks.GOLDEN_CLOVERS.get() ); this.tag(AetherTags.Blocks.SENTRY_BLOCKS).add( diff --git a/src/main/java/net/zepalesque/redux/data/prov/ReduxBlockStateProvider.java b/src/main/java/net/zepalesque/redux/data/prov/ReduxBlockStateProvider.java index 6a9966477..eed943848 100644 --- a/src/main/java/net/zepalesque/redux/data/prov/ReduxBlockStateProvider.java +++ b/src/main/java/net/zepalesque/redux/data/prov/ReduxBlockStateProvider.java @@ -9,6 +9,7 @@ import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.ChainBlock; import net.minecraft.world.level.block.LanternBlock; +import net.minecraft.world.level.block.PinkPetalsBlock; import net.minecraft.world.level.block.state.properties.BlockStateProperties; import net.minecraft.world.level.block.state.properties.IntegerProperty; import net.neoforged.neoforge.client.model.generators.BlockModelBuilder; @@ -16,6 +17,7 @@ import net.neoforged.neoforge.client.model.generators.ModelBuilder; import net.neoforged.neoforge.client.model.generators.ModelFile; import net.neoforged.neoforge.client.model.generators.ModelProvider; +import net.neoforged.neoforge.client.model.generators.MultiPartBlockStateBuilder; import net.neoforged.neoforge.common.data.ExistingFileHelper; import net.zepalesque.redux.Redux; import net.zepalesque.redux.block.construction.LayeredBookshelfBlock; @@ -292,4 +294,32 @@ public void tintedPotOverlayAlt(Block block, Block flower, String location) { .texture("overlay", this.modLoc("block/" + location + "potted_" + this.name(flower) + "_overlay")).renderType("cutout"); this.getVariantBuilder(block).partialState().addModels(new ConfiguredModel(pot)); } + + // Other + + public void flowerbed(Block block, String location) { + ModelFile flowerbed1 = this.models().withExistingParent(this.name(block) + "_1", mcLoc("flowerbed_1")) + .texture("flowerbed", this.texture(this.name(block), location)) + .texture("stem", this.extend(this.texture(this.name(block), location), "_stem")) + .renderType("cutout"); + ModelFile flowerbed2 = this.models().withExistingParent(this.name(block) + "_2", mcLoc("flowerbed_2")) + .texture("flowerbed", this.texture(this.name(block), location)) + .texture("stem", this.extend(this.texture(this.name(block), location), "_stem")) + .renderType("cutout"); + ModelFile flowerbed3 = this.models().withExistingParent(this.name(block) + "_3", mcLoc("flowerbed_3")) + .texture("flowerbed", this.texture(this.name(block), location)) + .texture("stem", this.extend(this.texture(this.name(block), location), "_stem")) + .renderType("cutout"); + ModelFile flowerbed4 = this.models().withExistingParent(this.name(block) + "_4", mcLoc("flowerbed_4")) + .texture("flowerbed", this.texture(this.name(block), location)) + .texture("stem", this.extend(this.texture(this.name(block), location), "_stem")) + .renderType("cutout"); + MultiPartBlockStateBuilder builder = this.getMultipartBuilder(block); + for (Direction d : new Direction[] {Direction.NORTH, Direction.EAST, Direction.SOUTH, Direction.WEST}) { + builder.part().modelFile(flowerbed1).rotationY(d.getOpposite().get2DDataValue() * 90).addModel().condition(PinkPetalsBlock.AMOUNT, 1, 2, 3, 4).condition(PinkPetalsBlock.FACING, d).end(); + builder.part().modelFile(flowerbed2).rotationY(d.getOpposite().get2DDataValue() * 90).addModel().condition(PinkPetalsBlock.AMOUNT, 2, 3, 4).condition(PinkPetalsBlock.FACING, d).end(); + builder.part().modelFile(flowerbed3).rotationY(d.getOpposite().get2DDataValue() * 90).addModel().condition(PinkPetalsBlock.AMOUNT, 3, 4).condition(PinkPetalsBlock.FACING, d).end(); + builder.part().modelFile(flowerbed4).rotationY(d.getOpposite().get2DDataValue() * 90).addModel().condition(PinkPetalsBlock.AMOUNT, 4).condition(PinkPetalsBlock.FACING, d).end(); + } + } } diff --git a/src/main/java/net/zepalesque/redux/data/resource/builders/ReduxFeatureBuilders.java b/src/main/java/net/zepalesque/redux/data/resource/builders/ReduxFeatureBuilders.java index 71784182a..983e45d76 100644 --- a/src/main/java/net/zepalesque/redux/data/resource/builders/ReduxFeatureBuilders.java +++ b/src/main/java/net/zepalesque/redux/data/resource/builders/ReduxFeatureBuilders.java @@ -1,13 +1,16 @@ package net.zepalesque.redux.data.resource.builders; import com.aetherteam.aether.block.AetherBlockStateProperties; +import net.minecraft.core.Direction; import net.minecraft.core.Vec3i; import net.minecraft.core.registries.Registries; import net.minecraft.data.worldgen.BootstapContext; import net.minecraft.data.worldgen.placement.PlacementUtils; import net.minecraft.resources.ResourceKey; import net.minecraft.resources.ResourceLocation; +import net.minecraft.util.random.SimpleWeightedRandomList; import net.minecraft.world.level.block.Block; +import net.minecraft.world.level.block.PinkPetalsBlock; import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.levelgen.blockpredicates.BlockPredicate; import net.minecraft.world.level.levelgen.feature.ConfiguredFeature; @@ -16,6 +19,7 @@ import net.minecraft.world.level.levelgen.feature.configurations.RandomPatchConfiguration; import net.minecraft.world.level.levelgen.feature.configurations.SimpleBlockConfiguration; import net.minecraft.world.level.levelgen.feature.stateproviders.BlockStateProvider; +import net.minecraft.world.level.levelgen.feature.stateproviders.WeightedStateProvider; import net.neoforged.neoforge.registries.DeferredHolder; import net.zepalesque.redux.Redux; import net.zepalesque.redux.block.state.ReduxStates; @@ -71,4 +75,16 @@ protected static BlockState naturalDrops(Supplier block) { BlockState b = block.get().defaultBlockState(); return b.hasProperty(ReduxStates.NATURAL_GEN) ? drops(b.setValue(ReduxStates.NATURAL_GEN, true)) : drops(b); } + + + protected static BlockStateProvider petals(BlockState state) { + SimpleWeightedRandomList.Builder builder = SimpleWeightedRandomList.builder(); + for (Direction d : PinkPetalsBlock.FACING.getPossibleValues()) { + BlockState temp = state.setValue(PinkPetalsBlock.FACING, d); + for (int i : PinkPetalsBlock.AMOUNT.getPossibleValues()) { + builder.add(temp.setValue(PinkPetalsBlock.AMOUNT, i), i); + } + } + return new WeightedStateProvider(builder); + } } diff --git a/src/main/java/net/zepalesque/redux/data/resource/builders/biome/GildedGroves.java b/src/main/java/net/zepalesque/redux/data/resource/builders/biome/GildedGroves.java index f8d73793f..a3f78cd35 100644 --- a/src/main/java/net/zepalesque/redux/data/resource/builders/biome/GildedGroves.java +++ b/src/main/java/net/zepalesque/redux/data/resource/builders/biome/GildedGroves.java @@ -84,6 +84,7 @@ public static Biome generate(BootstapContext context) { .addFeature(GenerationStep.Decoration.VEGETAL_DECORATION, AetherPlacedFeatures.HOLIDAY_TREE_PLACEMENT) .addFeature(GenerationStep.Decoration.VEGETAL_DECORATION, AetherPlacedFeatures.GRASS_PATCH_PLACEMENT) .addFeature(GenerationStep.Decoration.VEGETAL_DECORATION, ReduxPlacements.AURUM_PATCH) + .addFeature(GenerationStep.Decoration.VEGETAL_DECORATION, ReduxPlacements.GOLDEN_CLOVERS_PATCH) .addFeature(GenerationStep.Decoration.TOP_LAYER_MODIFICATION, AetherPlacedFeatures.COLD_AERCLOUD_PLACEMENT) .addFeature(GenerationStep.Decoration.TOP_LAYER_MODIFICATION, ReduxPlacements.SPARSE_BLUE_AERCLOUD) diff --git a/src/main/java/net/zepalesque/redux/data/resource/registries/ReduxFeatureConfig.java b/src/main/java/net/zepalesque/redux/data/resource/registries/ReduxFeatureConfig.java index 33f4e573e..3422d1039 100644 --- a/src/main/java/net/zepalesque/redux/data/resource/registries/ReduxFeatureConfig.java +++ b/src/main/java/net/zepalesque/redux/data/resource/registries/ReduxFeatureConfig.java @@ -67,6 +67,7 @@ public class ReduxFeatureConfig extends ReduxFeatureBuilders { public static final ResourceKey> AURUM_PATCH = createKey(name(ReduxFlowerSets.AURUM.flower()) + "_patch"); + public static final ResourceKey> GOLDEN_CLOVERS_PATCH = createKey(name(ReduxBlocks.GOLDEN_CLOVERS) + "_patch"); public static final ResourceKey> CLOUDBED = createKey("cloudbed"); @@ -154,8 +155,8 @@ public static void bootstrap(BootstapContext> context) { register(context, GROVE_TREES, Feature.RANDOM_SELECTOR, new RandomFeatureConfiguration(List.of( - new WeightedPlacedFeature(PlacementUtils.inlinePlaced(configs.getOrThrow(CLOUDROOT_TREE), PlacementUtils.filteredByBlockSurvival(ReduxBlocks.CLOUDROOT_SAPLING.get())), 0.2F), - new WeightedPlacedFeature(PlacementUtils.inlinePlaced(configs.getOrThrow(LARGE_CLOUDROOT_TREE), PlacementUtils.filteredByBlockSurvival(ReduxBlocks.CLOUDROOT_SAPLING.get())), 0.15F)), + new WeightedPlacedFeature(PlacementUtils.inlinePlaced(configs.getOrThrow(CLOUDROOT_TREE), PlacementUtils.filteredByBlockSurvival(ReduxFlowerSets.CLOUDROOT_SAPLING.flower().get())), 0.2F), + new WeightedPlacedFeature(PlacementUtils.inlinePlaced(configs.getOrThrow(LARGE_CLOUDROOT_TREE), PlacementUtils.filteredByBlockSurvival(ReduxFlowerSets.CLOUDROOT_SAPLING.flower().get())), 0.15F)), PlacementUtils.inlinePlaced(configs.getOrThrow(GROVE_GOLDEN_OAK_TREE), PlacementUtils.filteredByBlockSurvival(AetherBlocks.GOLDEN_OAK_SAPLING.get())))); register(context, SENTRITE_ORE, Feature.ORE, new OreConfiguration(new TagMatchTest(AetherTags.Blocks.HOLYSTONE), @@ -164,6 +165,9 @@ public static void bootstrap(BootstapContext> context) { register(context, AURUM_PATCH, Feature.FLOWER, patch(12, 7, 3, prov(ReduxFlowerSets.AURUM.flower()))); + register(context, GOLDEN_CLOVERS_PATCH, Feature.FLOWER, + patch(8, 3, 3, petals(drops(ReduxBlocks.GOLDEN_CLOVERS)))); + register(context, SURFACE_RULE_WATER_LAKE, ZenithFeatures.SURFACE_RULE_LAKE.get(), new SurfaceRuleLakeFeature.Config(BlockStateProvider.simple(Blocks.WATER))); diff --git a/src/main/java/net/zepalesque/redux/data/resource/registries/ReduxPlacements.java b/src/main/java/net/zepalesque/redux/data/resource/registries/ReduxPlacements.java index 32ebd3137..1bbc99aa1 100644 --- a/src/main/java/net/zepalesque/redux/data/resource/registries/ReduxPlacements.java +++ b/src/main/java/net/zepalesque/redux/data/resource/registries/ReduxPlacements.java @@ -44,6 +44,7 @@ public class ReduxPlacements { public static final ResourceKey SENTRITE_ORE = copyKey(ReduxFeatureConfig.SENTRITE_ORE); public static final ResourceKey GROVE_TREES = copyKey(ReduxFeatureConfig.GROVE_TREES); public static final ResourceKey AURUM_PATCH = copyKey(ReduxFeatureConfig.AURUM_PATCH); + public static final ResourceKey GOLDEN_CLOVERS_PATCH = copyKey(ReduxFeatureConfig.AURUM_PATCH); public static final ResourceKey SPARSE_BLUE_AERCLOUD = createKey("sparse_blue_aercloud"); public static final ResourceKey DENSE_BLUE_AERCLOUD = createKey("dense_blue_aercloud"); @@ -88,6 +89,12 @@ public static void bootstrap(BootstapContext context) { RarityFilter.onAverageOnceEvery(12), BiomeFilter.biome()); + register(context, GOLDEN_CLOVERS_PATCH, configs.getOrThrow(ReduxFeatureConfig.GOLDEN_CLOVERS_PATCH), + threshold, + ImprovedLayerPlacementModifier.of(Heightmap.Types.MOTION_BLOCKING, BiasedToBottomInt.of(0, 2), 4), + RarityFilter.onAverageOnceEvery(6), + BiomeFilter.biome()); + register(context, SPARSE_BLUE_AERCLOUD, configs.getOrThrow(AetherConfiguredFeatures.BLUE_AERCLOUD_CONFIGURATION), AetherPlacedFeatureBuilders.aercloudPlacement(32, 64, 48)); diff --git a/src/main/java/net/zepalesque/redux/item/ReduxTabs.java b/src/main/java/net/zepalesque/redux/item/ReduxTabs.java index ccb619519..dabed452b 100644 --- a/src/main/java/net/zepalesque/redux/item/ReduxTabs.java +++ b/src/main/java/net/zepalesque/redux/item/ReduxTabs.java @@ -13,6 +13,7 @@ import net.neoforged.neoforge.event.BuildCreativeModeTabContentsEvent; import net.zepalesque.redux.Redux; import net.zepalesque.redux.block.ReduxBlocks; +import net.zepalesque.redux.blockset.flower.ReduxFlowerSets; import net.zepalesque.redux.blockset.stone.ReduxStoneSets; import net.zepalesque.zenith.api.blockset.AbstractFlowerSet; import net.zepalesque.zenith.api.blockset.AbstractStoneSet; @@ -34,19 +35,9 @@ public static void buildCreativeModeTabs(BuildCreativeModeTabContentsEvent event sup = set.addToCreativeTab(event, sup); } -/* sup = null; - for (AbstractStoneSet set : Redux.STONE_SETS) { - sup = set.addToCreativeTab(event, sup); - } - - sup = null; - for (AbstractFlowerSet set : Redux.FLOWER_SETS) { - sup = set.addToCreativeTab(event, sup); - }*/ - if (tab == AetherCreativeTabs.AETHER_NATURAL_BLOCKS.get()) { TabUtil.putAfter(AetherBlocks.SKYROOT_LEAVES, ReduxBlocks.CLOUDROOT_LEAVES, event); - TabUtil.putAfter(AetherBlocks.SKYROOT_SAPLING, ReduxBlocks.CLOUDROOT_SAPLING, event); + TabUtil.putAfter(ReduxFlowerSets.AURUM.flower(), ReduxBlocks.GOLDEN_CLOVERS, event); } if (tab == AetherCreativeTabs.AETHER_DUNGEON_BLOCKS.get()) {