Skip to content

Commit

Permalink
feat: Bleakmoss
Browse files Browse the repository at this point in the history
  • Loading branch information
Zepalesque committed Jan 1, 2025
1 parent db5ee5a commit 4ff6266
Show file tree
Hide file tree
Showing 8 changed files with 51 additions and 4 deletions.
7 changes: 7 additions & 0 deletions src/main/java/net/zepalesque/redux/Redux.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down
7 changes: 7 additions & 0 deletions src/main/java/net/zepalesque/redux/client/ReduxClient.java
Original file line number Diff line number Diff line change
@@ -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);
}
}
15 changes: 15 additions & 0 deletions src/main/java/net/zepalesque/redux/client/ReduxColors.java
Original file line number Diff line number Diff line change
@@ -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 {

Expand All @@ -16,6 +24,13 @@ public static class Tints {
public static final int BLIGHT_GRASS_COLOR = 0xD5BAFF;
}

public static Optional<Integer> reduxColors(BlockState state, BlockAndTintGetter level, BlockPos pos, int index, Predicate<Integer> 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");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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!");
Expand Down Expand Up @@ -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");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/net/zepalesque/redux/item/ReduxTabs.java
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 4ff6266

Please sign in to comment.