diff --git a/gradle.properties b/gradle.properties index 1a58cc434..2263b7548 100644 --- a/gradle.properties +++ b/gradle.properties @@ -19,7 +19,7 @@ aether_version=1.20.4-1.4.1-neoforge nitrogen_version=1.20.4-1.1.4-neoforge cumulus_version=1.20.4-1.0.1-neoforge curios_version=7.3.4 -zenith_version=1.0.74 +zenith_version=1.0.77 aeroblender_version=5271794 terrablender_version=1.20.4-3.3.0.12 terrablender_version_minimum=1.20.4-3.3.0.0 diff --git a/src/main/java/net/zepalesque/redux/Redux.java b/src/main/java/net/zepalesque/redux/Redux.java index ec458d8a6..652ecc867 100644 --- a/src/main/java/net/zepalesque/redux/Redux.java +++ b/src/main/java/net/zepalesque/redux/Redux.java @@ -31,6 +31,7 @@ import net.zepalesque.redux.world.biome.tint.ReduxBiomeTints; import net.zepalesque.redux.world.feature.gen.ReduxFeatures; import net.zepalesque.redux.world.tree.foliage.ReduxFoliagePlacers; +import net.zepalesque.zenith.api.blockset.AbstractFlowerSet; import net.zepalesque.zenith.api.blockset.AbstractStoneSet; import net.zepalesque.zenith.api.blockset.AbstractWoodSet; import org.slf4j.Logger; @@ -44,8 +45,8 @@ public class Redux { public static final Logger LOGGER = LogUtils.getLogger(); public static final Collection WOOD_SETS = new ArrayList<>(); - public static final Collection STONE_SETS = new ArrayList<>(); + public static final Collection FLOWER_SETS = new ArrayList<>(); public Redux(IEventBus bus, Dist dist) { bus.addListener(ReduxData::dataSetup); diff --git a/src/main/java/net/zepalesque/redux/blockset/flower/ReduxFlowerSets.java b/src/main/java/net/zepalesque/redux/blockset/flower/ReduxFlowerSets.java new file mode 100644 index 000000000..9c0e95ced --- /dev/null +++ b/src/main/java/net/zepalesque/redux/blockset/flower/ReduxFlowerSets.java @@ -0,0 +1,35 @@ +package net.zepalesque.redux.blockset.flower; + +import com.aetherteam.aether.block.AetherBlocks; +import com.aetherteam.aether.item.AetherCreativeTabs; +import net.minecraft.data.recipes.RecipeCategory; +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.state.BlockBehaviour.Properties; +import net.minecraft.world.phys.shapes.VoxelShape; +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.stone.ReduxStoneSets; +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 AetherFlowerSet<>("aurum", "natural/", + () -> new CustomBoundsFlowerBlock(CommonPlantBounds.FLOWER, + () -> MobEffects.LUCK, 60, Properties.ofFullCopy(Blocks.DANDELION)), 1, /*TODO*/ 0xFFED96)) + .creativeTab(AetherCreativeTabs.AETHER_NATURAL_BLOCKS, AetherBlocks.WHITE_FLOWER) + .craftsIntoShapeless(1, () -> Items.YELLOW_DYE, 1, RecipeCategory.MISC); + + public static T register(T set) { + Redux.FLOWER_SETS.add(set); + return set; + } + + public static void init() {} +} diff --git a/src/main/java/net/zepalesque/redux/blockset/flower/type/AetherFlowerSet.java b/src/main/java/net/zepalesque/redux/blockset/flower/type/AetherFlowerSet.java new file mode 100644 index 000000000..9928aa2d8 --- /dev/null +++ b/src/main/java/net/zepalesque/redux/blockset/flower/type/AetherFlowerSet.java @@ -0,0 +1,28 @@ +package net.zepalesque.redux.blockset.flower.type; + +import net.minecraft.world.level.block.Block; +import net.zepalesque.redux.block.ReduxBlocks; +import net.zepalesque.redux.data.prov.ReduxBlockStateProvider; +import net.zepalesque.redux.data.prov.ReduxItemModelProvider; +import net.zepalesque.zenith.util.lambda.Consumers; +import org.apache.logging.log4j.util.TriConsumer; + +import java.util.function.Supplier; + +public class AetherFlowerSet extends TintedFlowerSet { + public AetherFlowerSet(String id, String textureFolder, Supplier constructor, int tintdex, int itemTint) { + super(id, textureFolder, constructor, tintdex, itemTint); + } + + @Override + public void blockData(ReduxBlockStateProvider data) { + data.crossTintedOverlay(this.flower().get(), this.textureFolder); + Consumers.C3 pot = this.usePottedPrefix ? data::tintedPotOverlayAlt : data::tintedPotOverlay; + pot.accept(this.pot().get(), this.flower().get(), this.textureFolder); + } + + @Override + public void itemData(ReduxItemModelProvider data) { + data.itemBlockFlatTintOverlay(this.flower().get(), this.textureFolder); + } +} diff --git a/src/main/java/net/zepalesque/redux/blockset/flower/type/BaseFlowerSet.java b/src/main/java/net/zepalesque/redux/blockset/flower/type/BaseFlowerSet.java index bde519a34..78b3fd45b 100644 --- a/src/main/java/net/zepalesque/redux/blockset/flower/type/BaseFlowerSet.java +++ b/src/main/java/net/zepalesque/redux/blockset/flower/type/BaseFlowerSet.java @@ -6,7 +6,6 @@ import net.minecraft.data.recipes.ShapedRecipeBuilder; import net.minecraft.data.recipes.ShapelessRecipeBuilder; import net.minecraft.tags.TagKey; -import net.minecraft.world.effect.MobEffect; import net.minecraft.world.item.BlockItem; import net.minecraft.world.item.CreativeModeTab; import net.minecraft.world.item.Item; @@ -14,17 +13,13 @@ import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.Blocks; import net.minecraft.world.level.block.FlowerPotBlock; -import net.minecraft.world.level.block.SoundType; -import net.minecraft.world.level.block.state.BlockBehaviour.OffsetType; import net.minecraft.world.level.block.state.BlockBehaviour.Properties; -import net.minecraft.world.phys.shapes.VoxelShape; import net.neoforged.neoforge.client.event.EntityRenderersEvent; import net.neoforged.neoforge.event.BuildCreativeModeTabContentsEvent; import net.neoforged.neoforge.registries.DeferredBlock; import net.neoforged.neoforge.registries.DeferredRegister; import net.neoforged.neoforge.registries.datamaps.builtin.NeoForgeDataMaps; import net.zepalesque.redux.block.ReduxBlocks; -import net.zepalesque.redux.block.natural.bush.CustomBoundsFlowerBlock; import net.zepalesque.redux.blockset.util.MutableLoreGeneration; import net.zepalesque.redux.data.prov.ReduxDataMapProvider; import net.zepalesque.redux.data.prov.ReduxLanguageProvider; @@ -47,12 +42,13 @@ import java.util.function.Supplier; import java.util.function.UnaryOperator; -public abstract class BaseFlowerSet extends AbstractFlowerSet implements MutableLoreGeneration { +@SuppressWarnings("unchecked") +public abstract class BaseFlowerSet extends AbstractFlowerSet implements MutableLoreGeneration> { public final String id, textureFolder; protected String lore; - protected final VoxelShape shape; - private float compost = 0.65F; + protected float compost = 0.65F; + protected boolean usePottedPrefix = false; protected final Map, RecipeCategory>> crafted = new HashMap<>(); protected final Map, Integer, RecipeCategory>> shapeless = new HashMap<>(); @@ -64,33 +60,28 @@ public abstract class BaseFlowerSet extends AbstractFlowerSet implements Mutable @Nullable protected Pair flammability = Pair.of(60, 100); - protected final DeferredBlock flower; + protected final DeferredBlock flower; protected final DeferredBlock pot; - private UnaryOperator properties; - private UnaryOperator potProperties; + protected UnaryOperator potProperties; - public BaseFlowerSet(String id, String textureFolder, VoxelShape shape, Supplier effect, int duration, OffsetType offset, SoundType sound) { + public BaseFlowerSet(String id, String textureFolder, Supplier constructor) { this.id = id; DeferredRegister.Blocks blocks = ReduxBlocks.BLOCKS; DeferredRegister.Items items = ReduxItems.ITEMS; this.textureFolder = textureFolder; - this.shape = shape; - this.flower = flower(blocks, items, id, effect, duration, offset, sound); + this.flower = flower(blocks, items, id, constructor); this.pot = pot(blocks, id); } @Override - protected DeferredBlock flower(DeferredRegister.Blocks registry, DeferredRegister.Items items, String id, Supplier effect, int duration, OffsetType offset, SoundType sound) { - var flower = registry.register(id, () -> new CustomBoundsFlowerBlock(this.shape, effect, duration, this.properties.apply(Properties.ofFullCopy(Blocks.DANDELION) - .sound(sound) - .offsetType(offset) - ))); + protected DeferredBlock flower(DeferredRegister.Blocks registry, DeferredRegister.Items items, String id, Supplier constructor) { + var flower = registry.register(id, constructor); items.register(flower.getId().getPath(), () -> new BlockItem(flower.get(), new Item.Properties())); return flower; } @Override - public DeferredBlock flower() { + public DeferredBlock flower() { return this.flower; } @@ -105,63 +96,56 @@ public DeferredBlock pot() { } @Override - public AbstractFlowerSet craftsInto(Supplier block, CraftingMatrix shape, RecipeCategory category) { + public BaseFlowerSet craftsInto(Supplier block, CraftingMatrix shape, RecipeCategory category) { this.crafted.put(shape, Pair.of(block, category)); return this; } @Override - public AbstractFlowerSet craftsIntoShapeless(int ingredientCount, Supplier result, int resultCount, RecipeCategory category) { + public BaseFlowerSet craftsIntoShapeless(int ingredientCount, Supplier result, int resultCount, RecipeCategory category) { this.shapeless.put(ingredientCount, Triple.of(result, resultCount, category)); return this; } @Override - public AbstractFlowerSet withFlowerTag(TagKey tag) { + public BaseFlowerSet withFlowerTag(TagKey tag) { this.tags.add(tag); return this; } @Override - public AbstractFlowerSet withPotTag(TagKey tag) { + public BaseFlowerSet withPotTag(TagKey tag) { this.potTags.add(tag); return this; } @Override - public AbstractFlowerSet withItemTag(TagKey tag) { + public BaseFlowerSet withItemTag(TagKey tag) { this.itemTags.add(tag); return this; } @Override - public AbstractFlowerSet creativeTab(Supplier tab, Supplier placeAfter) { + public BaseFlowerSet creativeTab(Supplier tab, Supplier placeAfter) { this.creativeTabOrdering.put(tab, placeAfter); return this; } @Override - public AbstractFlowerSet compost(float amount) { + public BaseFlowerSet compost(float amount) { this.compost = amount; return this; } @Override - public AbstractFlowerSet withProperties(UnaryOperator prop) { - UnaryOperator old = this.properties; - this.properties = original -> prop.apply(old.apply(original)); - return this; - } - - @Override - public AbstractFlowerSet withPotProperties(UnaryOperator prop) { + public BaseFlowerSet withPotProperties(UnaryOperator prop) { UnaryOperator old = this.potProperties; this.potProperties = original -> prop.apply(old.apply(original)); return this; } @Override - public AbstractFlowerSet flammable(int encouragement, int flammability) { + public BaseFlowerSet flammable(int encouragement, int flammability) { this.flammability = Pair.of(encouragement, flammability); return this; } @@ -228,11 +212,17 @@ public void lootData(ReduxBlockLootProvider data) { } @Override - public BaseFlowerSet withLore(String lore) { + public BaseFlowerSet withLore(String lore) { this.lore = lore; return this; } + @Override + public BaseFlowerSet withPottedPrefix() { + this.usePottedPrefix = true; + return this; + } + // Ignore the prev value, implementation is different here @Override public Supplier addToCreativeTab(BuildCreativeModeTabContentsEvent event, Supplier prev) { diff --git a/src/main/java/net/zepalesque/redux/blockset/flower/type/TintedFlowerSet.java b/src/main/java/net/zepalesque/redux/blockset/flower/type/TintedFlowerSet.java new file mode 100644 index 000000000..75c110cd1 --- /dev/null +++ b/src/main/java/net/zepalesque/redux/blockset/flower/type/TintedFlowerSet.java @@ -0,0 +1,26 @@ +package net.zepalesque.redux.blockset.flower.type; + +import net.minecraft.world.level.block.Block; +import net.zepalesque.redux.blockset.util.TintableSet; + +import java.util.function.Supplier; + +public abstract class TintedFlowerSet extends BaseFlowerSet implements TintableSet { + private final int tintdex, itemTint; + + public TintedFlowerSet(String id, String textureFolder, Supplier constructor, int tintdex, int itemTint) { + super(id, textureFolder, constructor); + this.tintdex = tintdex; + this.itemTint = itemTint; + } + + @Override + public int getTintIndex() { + return this.tintdex; + } + + @Override + public int getDefaultItemTint() { + return this.itemTint; + } +} diff --git a/src/main/java/net/zepalesque/redux/blockset/stone/ReduxStoneSets.java b/src/main/java/net/zepalesque/redux/blockset/stone/ReduxStoneSets.java index 24b2556e5..dad8cf419 100644 --- a/src/main/java/net/zepalesque/redux/blockset/stone/ReduxStoneSets.java +++ b/src/main/java/net/zepalesque/redux/blockset/stone/ReduxStoneSets.java @@ -3,6 +3,7 @@ import com.aetherteam.aether.AetherTags; 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.level.block.SoundType; import net.minecraft.world.level.material.MapColor; diff --git a/src/main/java/net/zepalesque/redux/blockset/stone/type/BaseStoneSet.java b/src/main/java/net/zepalesque/redux/blockset/stone/type/BaseStoneSet.java index 92bf4c7cf..f833e5107 100644 --- a/src/main/java/net/zepalesque/redux/blockset/stone/type/BaseStoneSet.java +++ b/src/main/java/net/zepalesque/redux/blockset/stone/type/BaseStoneSet.java @@ -21,13 +21,12 @@ import net.minecraft.world.level.block.state.properties.NoteBlockInstrument; import net.minecraft.world.level.material.MapColor; import net.neoforged.neoforge.client.event.EntityRenderersEvent; -import net.neoforged.neoforge.common.data.DataMapProvider; import net.neoforged.neoforge.event.BuildCreativeModeTabContentsEvent; import net.neoforged.neoforge.registries.DeferredBlock; import net.neoforged.neoforge.registries.DeferredRegister; import net.zepalesque.redux.block.ReduxBlocks; +import net.zepalesque.redux.blockset.flower.type.BaseFlowerSet; import net.zepalesque.redux.blockset.util.MutableLoreGeneration; -import net.zepalesque.redux.blockset.util.ReduxGeneration; import net.zepalesque.redux.data.prov.ReduxBlockStateProvider; import net.zepalesque.redux.data.prov.ReduxDataMapProvider; import net.zepalesque.redux.data.prov.ReduxItemModelProvider; @@ -42,11 +41,9 @@ import net.zepalesque.zenith.mixin.mixins.common.accessor.FireAccessor; import net.zepalesque.zenith.util.DatagenUtil; import net.zepalesque.zenith.util.TabUtil; -import org.apache.commons.lang3.tuple.Triple; import java.util.ArrayList; import java.util.HashMap; -import java.util.Hashtable; import java.util.List; import java.util.Map; import java.util.function.Supplier; diff --git a/src/main/java/net/zepalesque/redux/blockset/util/MutableLoreGeneration.java b/src/main/java/net/zepalesque/redux/blockset/util/MutableLoreGeneration.java index ca799d795..f1eb84f13 100644 --- a/src/main/java/net/zepalesque/redux/blockset/util/MutableLoreGeneration.java +++ b/src/main/java/net/zepalesque/redux/blockset/util/MutableLoreGeneration.java @@ -1,5 +1,7 @@ package net.zepalesque.redux.blockset.util; -public interface MutableLoreGeneration> extends ReduxGeneration { +import net.zepalesque.redux.blockset.flower.type.BaseFlowerSet; + +public interface MutableLoreGeneration> extends ReduxGeneration { T withLore(String lore); } diff --git a/src/main/java/net/zepalesque/redux/blockset/util/TintableSet.java b/src/main/java/net/zepalesque/redux/blockset/util/TintableSet.java new file mode 100644 index 000000000..668fa59b8 --- /dev/null +++ b/src/main/java/net/zepalesque/redux/blockset/util/TintableSet.java @@ -0,0 +1,8 @@ +package net.zepalesque.redux.blockset.util; + +public interface TintableSet { + + int getTintIndex(); + + int getDefaultItemTint(); +} diff --git a/src/main/java/net/zepalesque/redux/client/ReduxColors.java b/src/main/java/net/zepalesque/redux/client/ReduxColors.java index 1d5a2dcd4..cf9855729 100644 --- a/src/main/java/net/zepalesque/redux/client/ReduxColors.java +++ b/src/main/java/net/zepalesque/redux/client/ReduxColors.java @@ -13,11 +13,14 @@ import net.zepalesque.redux.Redux; import net.zepalesque.redux.block.ReduxBlocks; import net.zepalesque.redux.block.state.ReduxStates; +import net.zepalesque.redux.blockset.util.TintableSet; import net.zepalesque.redux.data.ReduxTags; import net.zepalesque.redux.world.biome.tint.ReduxBiomeTints; +import net.zepalesque.zenith.api.blockset.AbstractFlowerSet; import javax.annotation.Nullable; import java.util.function.Consumer; +import java.util.function.Predicate; public class ReduxColors { @@ -31,15 +34,19 @@ public static class Tints { public static void blockColors(RegisterColorHandlersEvent.Block event) { Redux.LOGGER.debug("Beginning block color registration for the Aether: Redux"); - event.register((state, level, pos, index) -> getColor(state, level, pos, index, 1, false), AetherBlocks.AETHER_GRASS_BLOCK.get()); - event.register((state, level, pos, index) -> getColor(state, level, pos, index, 0, true), ReduxBlocks.SHORT_AETHER_GRASS.get()); - event.register((state, level, pos, index) -> getColor(state, level, pos, index, 1, true), + event.register((state, level, pos, index) -> getColor(state, level, pos, index, i -> i == 1, false), AetherBlocks.AETHER_GRASS_BLOCK.get()); + event.register((state, level, pos, index) -> getColor(state, level, pos, index, i -> i == 0, true), ReduxBlocks.SHORT_AETHER_GRASS.get()); + event.register((state, level, pos, index) -> getColor(state, level, pos, index, i -> i == 1, true), AetherBlocks.WHITE_FLOWER.get(), AetherBlocks.POTTED_WHITE_FLOWER.get(), AetherBlocks.PURPLE_FLOWER.get(), AetherBlocks.POTTED_PURPLE_FLOWER.get() ); - + for (AbstractFlowerSet set : Redux.FLOWER_SETS) { + if (set instanceof TintableSet tintable) { + event.register((state, level, pos, index) -> getColor(state, level, pos, index, i -> i == tintable.getTintIndex(), true), set.flower().get()); + } + } } public static void itemColors(RegisterColorHandlersEvent.Item event) { @@ -57,6 +64,12 @@ public static void itemColors(RegisterColorHandlersEvent.Item event) { ReduxBlocks.SPLITFERN.get())*/ ); + for (AbstractFlowerSet set : Redux.FLOWER_SETS) { + if (set instanceof TintableSet tintable) { + event.register((stack, tintIndex) -> tintIndex == tintable.getTintIndex() ? tintable.getDefaultItemTint() : 0xFFFFFF, set.flower().get()); + } + } + } public static void resolvers(RegisterColorHandlersEvent.ColorResolvers event) { @@ -74,8 +87,8 @@ private static int getAverageColor(BlockAndTintGetter level, BlockPos blockPos, return Tints.AETHER_GRASS_COLOR; } - public static int getColor(BlockState state, @Nullable BlockAndTintGetter level, @Nullable BlockPos pos, int index, int indexGoal, boolean useBelowProperties) { - if (index == indexGoal) { + public static int getColor(BlockState state, @Nullable BlockAndTintGetter level, @Nullable BlockPos pos, int index, Predicate indexGoal, boolean useBelowProperties) { + if (indexGoal.test(index)) { if (level != null && pos != null) { if (level.getBlockState(pos.below()).is(ReduxTags.Blocks.BLIGHT_GRASS_BLOCKS) && useBelowProperties) { return Tints.BLIGHT_GRASS_COLOR; 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 4db07fc1d..4c21435d7 100644 --- a/src/main/java/net/zepalesque/redux/data/gen/ReduxBlockStateData.java +++ b/src/main/java/net/zepalesque/redux/data/gen/ReduxBlockStateData.java @@ -19,6 +19,7 @@ protected void registerStatesAndModels() { Redux.WOOD_SETS.forEach(set -> set.blockData(this)); Redux.STONE_SETS.forEach(set -> set.blockData(this)); + Redux.FLOWER_SETS.forEach(set -> set.blockData(this)); this.tintableShortGrass(ReduxBlocks.SHORT_AETHER_GRASS.get(), "natural/"); this.block(ReduxBlocks.CLOUDROOT_LEAVES.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 b836abfa5..e21a5d1ee 100644 --- a/src/main/java/net/zepalesque/redux/data/gen/ReduxItemModelData.java +++ b/src/main/java/net/zepalesque/redux/data/gen/ReduxItemModelData.java @@ -18,6 +18,7 @@ public ReduxItemModelData(PackOutput output, ExistingFileHelper helper) { protected void registerModels() { Redux.WOOD_SETS.forEach(set -> set.itemData(this)); Redux.STONE_SETS.forEach(set -> set.itemData(this)); + Redux.FLOWER_SETS.forEach(set -> set.itemData(this)); itemBlockFlatCustomTexture(ReduxBlocks.SHORT_AETHER_GRASS.get(), "natural/aether_medium_grass"); this.itemBlock(ReduxBlocks.CLOUDROOT_LEAVES.get()); 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 e95b6e52e..de76143e9 100644 --- a/src/main/java/net/zepalesque/redux/data/gen/ReduxLanguageData.java +++ b/src/main/java/net/zepalesque/redux/data/gen/ReduxLanguageData.java @@ -18,6 +18,7 @@ public ReduxLanguageData(PackOutput output) { protected void addTranslations() { Redux.WOOD_SETS.forEach(set -> set.langData(this)); Redux.STONE_SETS.forEach(set -> set.langData(this)); + Redux.FLOWER_SETS.forEach(set -> set.langData(this)); addBlock(ReduxBlocks.SHORT_AETHER_GRASS); addLore(ReduxBlocks.SHORT_AETHER_GRASS, "Blades of the Aether's grass. It feels slightly cool to the touch."); 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 61c990557..be81de273 100644 --- a/src/main/java/net/zepalesque/redux/data/gen/ReduxMapData.java +++ b/src/main/java/net/zepalesque/redux/data/gen/ReduxMapData.java @@ -22,6 +22,7 @@ public ReduxMapData(PackOutput packOutput, CompletableFuture set.mapData(this)); Redux.STONE_SETS.forEach(set -> set.mapData(this)); + Redux.FLOWER_SETS.forEach(set -> set.mapData(this)); var biomeTints = this.builder(ReduxBiomeTints.AETHER_GRASS.get().getDataMap()); biomeTints.add(AetherBiomes.SKYROOT_FOREST, 0xA2F2BC, false); 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 cb27c2e41..5aace9f16 100644 --- a/src/main/java/net/zepalesque/redux/data/gen/ReduxRecipeData.java +++ b/src/main/java/net/zepalesque/redux/data/gen/ReduxRecipeData.java @@ -33,6 +33,7 @@ public ReduxRecipeData(PackOutput output, CompletableFuture set.recipeData(this, output)); Redux.STONE_SETS.forEach(set -> set.recipeData(this, output)); + Redux.FLOWER_SETS.forEach(set -> set.recipeData(this, output)); oreBlockStorageRecipesRecipesWithCustomUnpacking(output, RecipeCategory.MISC, ReduxItems.VERIDIUM_NUGGET.get(), RecipeCategory.MISC, ReduxItems.VERIDIUM_INGOT.get(), "veridium_nugget", "veridium_nugget_to_veridium_ingot"); oreBlockStorageRecipesRecipesWithCustomUnpacking(output, RecipeCategory.MISC, ReduxItems.SENTRITE_CHUNK.get(), RecipeCategory.MISC, ReduxItems.REFINED_SENTRITE.get(), "sentrite_chunk", "sentrite_chunk_to_refined_sentrite"); 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 4e0b0c451..1e5cb949b 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 @@ -31,6 +31,7 @@ public ReduxBlockLoot() { protected void generate() { Redux.WOOD_SETS.forEach(set -> set.lootData(this)); Redux.STONE_SETS.forEach(set -> set.lootData(this)); + Redux.FLOWER_SETS.forEach(set -> set.lootData(this)); this.add(ReduxBlocks.SHORT_AETHER_GRASS.get(), shears()); 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 dac999977..bfdb99dd6 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 @@ -28,6 +28,7 @@ public ReduxBlockTagsData(PackOutput output, CompletableFuture set.blockTagData(this)); Redux.STONE_SETS.forEach(set -> set.blockTagData(this)); + Redux.FLOWER_SETS.forEach(set -> set.blockTagData(this)); // Adds every single Redux block as a block that should be treaded as an Aether Block and get the tool debuff IntrinsicTagAppender tag = this.tag(AetherTags.Blocks.TREATED_AS_AETHER_BLOCK); diff --git a/src/main/java/net/zepalesque/redux/data/gen/tags/ReduxItemTagsData.java b/src/main/java/net/zepalesque/redux/data/gen/tags/ReduxItemTagsData.java index ed425ecad..19d0745cf 100644 --- a/src/main/java/net/zepalesque/redux/data/gen/tags/ReduxItemTagsData.java +++ b/src/main/java/net/zepalesque/redux/data/gen/tags/ReduxItemTagsData.java @@ -24,6 +24,7 @@ public ReduxItemTagsData(PackOutput output, CompletableFuture set.itemTagData(this)); Redux.STONE_SETS.forEach(set -> set.itemTagData(this)); + Redux.FLOWER_SETS.forEach(set -> set.itemTagData(this)); this.tag(ItemTags.PICKAXES).add(ReduxItems.VERIDIUM_PICKAXE.get(), ReduxItems.INFUSED_VERIDIUM_PICKAXE.get()); this.tag(ItemTags.SHOVELS).add(ReduxItems.VERIDIUM_SHOVEL.get(), ReduxItems.INFUSED_VERIDIUM_SHOVEL.get()); 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 b9fcf2c18..1a53f1076 100644 --- a/src/main/java/net/zepalesque/redux/data/prov/ReduxBlockStateProvider.java +++ b/src/main/java/net/zepalesque/redux/data/prov/ReduxBlockStateProvider.java @@ -237,4 +237,46 @@ public void chain(Block block, String location) { return builder.build(); })); } + + public void potAlt(Block block, Block flower, String location) { + ModelFile pot = this.models().withExistingParent(this.name(block), mcLoc("block/flower_pot_cross")) + .texture("plant", this.modLoc("block/" + location + "potted_" + this.name(flower))).renderType("cutout"); + this.getVariantBuilder(block).partialState().addModels(new ConfiguredModel(pot)); + } + public void tintedPotDualGloverlay(Block block, Block flower, String location) { + ModelFile pot = this.models().withExistingParent(this.name(block), Redux.loc("block/pot/flower_pot_tinted_dual_gloverlay")) + .texture("plant", this.modLoc("block/" + location + this.name(flower))) + .texture("glow", this.modLoc("block/" + location + this.name(flower) + "_glow")) + .texture("overlay", this.modLoc("block/" + location + this.name(flower) + "_overlay")).renderType("cutout"); + this.getVariantBuilder(block).partialState().addModels(new ConfiguredModel(pot)); + } + public void tintedPotGlowOverlay(Block block, Block flower, String location) { + ModelFile pot = this.models().withExistingParent(this.name(block), Redux.loc("block/pot/flower_pot_tinted_glowing_overlay")) + .texture("plant", this.modLoc("block/" + location + this.name(flower))) + .texture("overlay", this.modLoc("block/" + location + this.name(flower) + "_glow")).renderType("cutout"); + this.getVariantBuilder(block).partialState().addModels(new ConfiguredModel(pot)); + } + public void tintedPotGlowOverlayAlt(Block block, Block flower, String location) { + ModelFile pot = this.models().withExistingParent(this.name(block), Redux.loc("block/pot/flower_pot_tinted_glowing_overlay")) + .texture("plant", this.modLoc("block/" + location + "potted_" + this.name(flower))) + .texture("overlay", this.modLoc("block/" + location + "potted_" + this.name(flower) + "_glow")).renderType("cutout"); + this.getVariantBuilder(block).partialState().addModels(new ConfiguredModel(pot)); + } + public void tintedPotOverlay(Block block, Block flower, String location) { + ModelFile pot = this.models().withExistingParent(this.name(block), Redux.loc("block/pot/flower_pot_tinted_overlay")) + .texture("plant", this.modLoc("block/" + location + this.name(flower))) + .texture("overlay", this.modLoc("block/" + location + this.name(flower) + "_overlay")).renderType("cutout"); + this.getVariantBuilder(block).partialState().addModels(new ConfiguredModel(pot)); + } + public void tintedPot(Block block, Block flower, String location) { + ModelFile pot = this.models().withExistingParent(this.name(block), Redux.loc("block/pot/flower_pot_tinted")) + .texture("plant", this.modLoc("block/" + location + this.name(flower))).renderType("cutout"); + this.getVariantBuilder(block).partialState().addModels(new ConfiguredModel(pot)); + } + public void tintedPotOverlayAlt(Block block, Block flower, String location) { + ModelFile pot = this.models().withExistingParent(this.name(block), Redux.loc("block/pot/flower_pot_tinted_overlay")) + .texture("plant", this.modLoc("block/" + location + "potted_" + this.name(flower))) + .texture("overlay", this.modLoc("block/" + location + "potted_" + this.name(flower) + "_overlay")).renderType("cutout"); + this.getVariantBuilder(block).partialState().addModels(new ConfiguredModel(pot)); + } } diff --git a/src/main/java/net/zepalesque/redux/item/ReduxTabs.java b/src/main/java/net/zepalesque/redux/item/ReduxTabs.java index a3aa96ecf..10b06832c 100644 --- a/src/main/java/net/zepalesque/redux/item/ReduxTabs.java +++ b/src/main/java/net/zepalesque/redux/item/ReduxTabs.java @@ -14,6 +14,7 @@ import net.zepalesque.redux.Redux; import net.zepalesque.redux.block.ReduxBlocks; import net.zepalesque.redux.blockset.stone.ReduxStoneSets; +import net.zepalesque.zenith.api.blockset.AbstractFlowerSet; import net.zepalesque.zenith.api.blockset.AbstractStoneSet; import net.zepalesque.zenith.api.blockset.AbstractWoodSet; import net.zepalesque.zenith.util.TabUtil; @@ -37,6 +38,11 @@ public static void buildCreativeModeTabs(BuildCreativeModeTabContentsEvent event 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);