Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fall back to non-vertex-specific coloring if mods override color providers #2158

Merged

Conversation

embeddedt
Copy link
Contributor

Currently the Sodium color provider registry unconditionally replaces the color providers on blended vanilla blocks (e.g. leaves). That causes mods replacing vanilla color providers to have their changes ignored. To address this, we only replace the color provider if it wasn't already overriden by a mod. The block in question will no longer use per-vertex blending, but the mod's logic will run as it does in vanilla.

@jellysquid3 jellysquid3 added this to the Sodium 0.5.4 milestone Nov 11, 2023
Copy link
Member

@IMS212 IMS212 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, just some minor questions.

@Unique
private final ReferenceSet<Block> overridenBlocks = new ReferenceOpenHashSet<>();


Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

weird spacing

// it means a mod is using custom logic and we need to disable per-vertex coloring
if (this.blocksToColor.put(block, provider) != null) {
this.overridenBlocks.add(block);
SodiumClientMod.logger().info("Block {} had its color provider replaced and will not use per-vertex coloring", Registries.BLOCK.getId(block));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we get the name of the provider it's using, maybe?

@embeddedt embeddedt requested a review from IMS212 December 4, 2023 19:24
@IMS212 IMS212 merged commit 2b9910e into CaffeineMC:dev Dec 4, 2023
1 check passed
@embeddedt embeddedt deleted the fix/overwriting-custom-resolver branch December 22, 2023 16:53
IMS212 added a commit to IMS212/sodium-fabric that referenced this pull request Aug 6, 2024
…tom-resolver

Fall back to non-vertex-specific coloring if mods override color providers
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants