Skip to content

Commit 86c32ff

Browse files
Copilotrubensworks
andauthored
Add leaf particle colors for Undead Leaves (#1189)
* Add Undead Leaves particle tint client config Agent-Logs-Url: https://github.com/CyclopsMC/EvilCraft/sessions/0cdeefb6-bc60-4c58-bf4e-65d4ada5d15c Co-authored-by: rubensworks <440384+rubensworks@users.noreply.github.com> * Document Undead Leaves particle tint color constant Agent-Logs-Url: https://github.com/CyclopsMC/EvilCraft/sessions/0cdeefb6-bc60-4c58-bf4e-65d4ada5d15c Co-authored-by: rubensworks <440384+rubensworks@users.noreply.github.com> * Fix color registration --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: rubensworks <440384+rubensworks@users.noreply.github.com> Co-authored-by: Ruben Taelman <rubensworks@gmail.com>
1 parent 8237aff commit 86c32ff

2 files changed

Lines changed: 34 additions & 2 deletions

File tree

src/main/java/org/cyclops/evilcraft/block/BlockUndeadLeavesConfig.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,16 @@
33
import net.minecraft.world.level.block.ComposterBlock;
44
import net.minecraft.world.level.block.SoundType;
55
import org.cyclops.cyclopscore.config.ConfigurablePropertyCommon;
6+
import org.cyclops.cyclopscore.config.extendedconfig.BlockClientConfig;
67
import org.cyclops.cyclopscore.config.extendedconfig.BlockConfigCommon;
7-
import org.cyclops.cyclopscore.init.IModBase;
88
import org.cyclops.evilcraft.EvilCraft;
99

1010
/**
1111
* Config for the {@link BlockUndeadLeaves}.
1212
* @author rubensworks
1313
*
1414
*/
15-
public class BlockUndeadLeavesConfig extends BlockConfigCommon<IModBase> {
15+
public class BlockUndeadLeavesConfig extends BlockConfigCommon<EvilCraft> {
1616

1717
@ConfigurablePropertyCommon(category = "block", comment = "How much Blood (mB) can be produced at most as a Blood Stain on each random tick.")
1818
public static int maxBloodStainAmount = 25;
@@ -36,4 +36,9 @@ public void onRegistryRegistered() {
3636
ComposterBlock.COMPOSTABLES.put(getItemInstance(), 0.3F);
3737
}
3838

39+
@Override
40+
public BlockClientConfig<EvilCraft> constructBlockClientConfig() {
41+
return new BlockUndeadLeavesConfigClient(this);
42+
}
43+
3944
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
package org.cyclops.evilcraft.block;
2+
3+
import net.minecraft.client.color.block.BlockTintSources;
4+
import net.neoforged.neoforge.client.event.RegisterColorHandlersEvent;
5+
import org.cyclops.cyclopscore.config.extendedconfig.BlockClientConfig;
6+
import org.cyclops.cyclopscore.config.extendedconfig.BlockConfigCommon;
7+
import org.cyclops.evilcraft.EvilCraft;
8+
9+
import java.util.List;
10+
11+
/**
12+
* @author rubensworks
13+
*/
14+
public class BlockUndeadLeavesConfigClient extends BlockClientConfig<EvilCraft> {
15+
16+
// Dominant Undead Leaves texture color (#2E0F0F = R46 G15 B15), encoded as ARGB 0xFF2E0F0F.
17+
private static final int UNDEAD_LEAVES_COLOR = -13758705;
18+
19+
public BlockUndeadLeavesConfigClient(BlockConfigCommon<EvilCraft> blockConfig) {
20+
super(blockConfig);
21+
blockConfig.getMod().getModEventBus().addListener(this::onRegisterColors);
22+
}
23+
24+
public void onRegisterColors(RegisterColorHandlersEvent.BlockTintSources event) {
25+
event.register(List.of(BlockTintSources.constant(UNDEAD_LEAVES_COLOR)), getBlockConfig().getInstance());
26+
}
27+
}

0 commit comments

Comments
 (0)