diff --git a/src/main/java/net/zepalesque/redux/Redux.java b/src/main/java/net/zepalesque/redux/Redux.java index 44f18f159..c902a1305 100644 --- a/src/main/java/net/zepalesque/redux/Redux.java +++ b/src/main/java/net/zepalesque/redux/Redux.java @@ -11,6 +11,7 @@ import net.neoforged.fml.ModContainer; import net.neoforged.fml.ModList; import net.neoforged.fml.common.Mod; +import net.neoforged.fml.event.lifecycle.FMLClientSetupEvent; import net.neoforged.fml.event.lifecycle.FMLCommonSetupEvent; import net.neoforged.neoforge.event.AddPackFindersEvent; import net.neoforged.neoforge.network.event.RegisterPayloadHandlersEvent; @@ -22,6 +23,7 @@ import net.zepalesque.redux.blockset.flower.ReduxFlowerSets; import net.zepalesque.redux.blockset.stone.ReduxStoneSets; import net.zepalesque.redux.blockset.wood.ReduxWoodSets; +import net.zepalesque.redux.client.ReduxClient; import net.zepalesque.redux.client.ReduxColors; import net.zepalesque.redux.client.audio.ReduxSounds; import net.zepalesque.redux.client.particle.ReduxParticles; @@ -61,6 +63,7 @@ public class Redux { public Redux(ModContainer mod, IEventBus bus, Dist dist) { bus.addListener(EventPriority.LOWEST, ReduxData::dataSetup); bus.addListener(this::commonSetup); + bus.addListener(this::clientSetup); bus.addListener(this::registerDataMaps); bus.addListener(this::packSetup); bus.addListener(this::registerPackets); @@ -109,6 +112,10 @@ private void commonSetup(final FMLCommonSetupEvent event) { }); } + private void clientSetup(final FMLClientSetupEvent event) { + event.enqueueWork(ReduxClient::registerTintOverrides); + } + public void registerPackets(RegisterPayloadHandlersEvent event) { PayloadRegistrar registrar = event.registrar(MODID).versioned("1.0.0").optional(); registrar.playToServer(AerjumpPacket.Request.TYPE, AerjumpPacket.Request.STREAM_CODEC, AerjumpPacket.Request::execute); diff --git a/src/main/java/net/zepalesque/redux/client/ReduxClient.java b/src/main/java/net/zepalesque/redux/client/ReduxClient.java index e4916ff9d..ec4533227 100644 --- a/src/main/java/net/zepalesque/redux/client/ReduxClient.java +++ b/src/main/java/net/zepalesque/redux/client/ReduxClient.java @@ -1,4 +1,11 @@ package net.zepalesque.redux.client; +import net.zepalesque.unity.block.natural.AetherShortGrassBlock; +import net.zepalesque.unity.client.UnityColors; + public class ReduxClient { + + public static void registerTintOverrides() { + AetherShortGrassBlock.COLOR_OVERRIDES.add(ReduxColors::reduxColors); + } } diff --git a/src/main/java/net/zepalesque/redux/client/ReduxColors.java b/src/main/java/net/zepalesque/redux/client/ReduxColors.java index 1fb6cd10b..bafa59964 100644 --- a/src/main/java/net/zepalesque/redux/client/ReduxColors.java +++ b/src/main/java/net/zepalesque/redux/client/ReduxColors.java @@ -1,13 +1,21 @@ package net.zepalesque.redux.client; import com.aetherteam.aether.block.AetherBlocks; +import net.minecraft.core.BlockPos; +import net.minecraft.world.level.BlockAndTintGetter; +import net.minecraft.world.level.block.state.BlockState; import net.neoforged.neoforge.client.event.RegisterColorHandlersEvent; import net.zepalesque.redux.Redux; import net.zepalesque.redux.block.ReduxBlocks; import net.zepalesque.redux.blockset.util.TintableSet; +import net.zepalesque.redux.data.ReduxTags; import net.zepalesque.unity.client.UnityColors; import net.zepalesque.zenith.api.blockset.BlockSet; import net.zepalesque.zenith.api.blockset.type.AbstractFlowerSet; +import org.jetbrains.annotations.Nullable; + +import java.util.Optional; +import java.util.function.Predicate; public class ReduxColors { @@ -16,6 +24,13 @@ public static class Tints { public static final int BLIGHT_GRASS_COLOR = 0xD5BAFF; } + public static Optional reduxColors(BlockState state, BlockAndTintGetter level, BlockPos pos, int index, Predicate indexGoal, boolean useBelowProperties) { + if (level.getBlockState(pos.below()).is(ReduxTags.Blocks.SHORT_AETHER_GRASS_BLIGHT_COLORING)) { + return UnityColors.encapsulate(Tints.BLIGHT_GRASS_COLOR); + } + return Optional.empty(); + } + public static void blockColors(RegisterColorHandlersEvent.Block event) { Redux.LOGGER.debug("Beginning block color registration for the Aether: Redux"); 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 789f3bd63..c46966c11 100644 --- a/src/main/java/net/zepalesque/redux/data/gen/ReduxItemModelData.java +++ b/src/main/java/net/zepalesque/redux/data/gen/ReduxItemModelData.java @@ -84,6 +84,9 @@ protected void registerModels() { this.item(ReduxBlocks.LOGICATOR.get().asItem(), "misc/"); this.item(ReduxItems.AERBOUND_CAPE.get(), "accessories/"); + + this.itemBlock(ReduxBlocks.BLEAKMOSS_BLOCK.get()); + this.itemBlock(ReduxBlocks.BLEAKMOSS_CARPET.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 c7fd0021e..2c47236fe 100644 --- a/src/main/java/net/zepalesque/redux/data/gen/ReduxLanguageData.java +++ b/src/main/java/net/zepalesque/redux/data/gen/ReduxLanguageData.java @@ -70,9 +70,8 @@ protected void addTranslations() { addBlock(ReduxBlocks.POTTED_SKYSPROUTS); addLore(ReduxBlocks.SKYSPROUTS, "A relative of the common Wyndsprouts, this flowering grass is found in the Skyfields."); - addBlock(ReduxBlocks.LOGICATOR, "Redstone Logicator"); - addLore(ReduxBlocks.LOGICATOR, "A fascinating circuit made with an exotic material not found in the Aether - Redstone. This little diode takes in two inputs on the side, and will perform a logical operation on the two for the output. The operation is controlled by the torch on the top and the back input. The torch controls AND/OR mode, and the back input controls exclusivity (XNOR/XOR)."); - + addBlock(ReduxBlocks.BLEAKMOSS_BLOCK); + addLore(ReduxBlocks.BLEAKMOSS_BLOCK, "A corrupted, blighted variation of the Aether's Flutemoss. This can be found in the Blight."); addItem(ReduxItems.AERBOUND_CAPE); addLore(ReduxItems.AERBOUND_CAPE, "A cape found in the Bronze Dungeon. It allows the wearer to double-jump!"); @@ -149,6 +148,9 @@ protected void addTranslations() { addBlock(ReduxBlocks.REFINED_SENTRITE_BLOCK, "Block of Refined Sentrite"); addLore(ReduxBlocks.REFINED_SENTRITE_BLOCK, "A block of the refined form of Sentrite, crafted with Refined Sentrite."); + addBlock(ReduxBlocks.LOGICATOR, "Redstone Logicator"); + addLore(ReduxBlocks.LOGICATOR, "A fascinating circuit made with an exotic material not found in the Aether - Redstone. This little diode takes in two inputs on the side, and will perform a logical operation on the two for the output. The operation is controlled by the torch on the top and the back input. The torch controls AND/OR mode, and the back input controls exclusivity (XNOR/XOR)."); + addTooltip("shift_info", "Hold [%s] for more info..."); addTooltip("infusion_charge", "Infusion Charge: %s"); addTooltip("infusion_info", "Can be infused by right-clicking the item in your inventory while hovering over it with an Ambrosium Shard"); 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 a48ea87d6..76fba1b39 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 @@ -88,6 +88,9 @@ protected void generate() { this.add(ReduxBlocks.GOLDEN_VINES.get(), shears()); this.add(ReduxBlocks.GOLDEN_VINES_PLANT.get(), shears().apply(ReduxBlocks.GOLDEN_VINES.get())); + this.dropSelf(ReduxBlocks.BLEAKMOSS_BLOCK.get()); + this.dropSelf(ReduxBlocks.BLEAKMOSS_CARPET.get()); + this.dropSelf(ReduxBlocks.LOGICATOR.get()); } 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 b8a056a28..ba70064d4 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 @@ -51,7 +51,13 @@ protected void addTags(HolderLookup.Provider provider) { this.tag(BlockTags.MINEABLE_WITH_HOE).add( ReduxBlocks.GILDENROOT_LEAVES.get(), ReduxBlocks.GOLDEN_CLOVERS.get(), - ReduxBlocks.GILDENROOT_LEAF_PILE.get() + ReduxBlocks.GILDENROOT_LEAF_PILE.get(), + ReduxBlocks.BLEAKMOSS_BLOCK.get(), + ReduxBlocks.BLEAKMOSS_CARPET.get() + ); + + this.tag(ReduxTags.Blocks.SHORT_AETHER_GRASS_BLIGHT_COLORING).add( + ReduxBlocks.BLEAKMOSS_BLOCK.get() ); this.tag(BlockTags.INSIDE_STEP_SOUND_BLOCKS).add( diff --git a/src/main/java/net/zepalesque/redux/item/ReduxTabs.java b/src/main/java/net/zepalesque/redux/item/ReduxTabs.java index 77209deb1..6f0fedba2 100644 --- a/src/main/java/net/zepalesque/redux/item/ReduxTabs.java +++ b/src/main/java/net/zepalesque/redux/item/ReduxTabs.java @@ -43,6 +43,10 @@ public static void buildCreativeModeTabs(BuildCreativeModeTabContentsEvent event ); TabUtil.putAfter(event, ReduxFlowerSets.AURUM.flower(), ReduxBlocks.GOLDEN_CLOVERS); + + // TODO: Insert Enchanted Moss (NAME PENDING) into here before Bleakmoss + TabUtil.putAfter(event, UnityBlocks.FLUTEMOSS_CARPET, ReduxBlocks.BLEAKMOSS_BLOCK, ReduxBlocks.BLEAKMOSS_CARPET); + } else if (TabUtil.isForTab(event, AetherCreativeTabs.AETHER_DUNGEON_BLOCKS)) { TabUtil.putAfter(event, AetherBlocks.CARVED_STONE,