Skip to content

Commit

Permalink
Merge pull request #55 from PrototypeTrousers/fix-ie-colors
Browse files Browse the repository at this point in the history
Fix Immersive Engineering Redstone connectors missing their color
  • Loading branch information
Asek3 authored Oct 12, 2024
2 parents 29c95c4 + 7271f5b commit d6685cb
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 2 deletions.
1 change: 1 addition & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ dependencies {
//implementation rfg.deobf("curse.maven:thermfound-222880:2926428")
//implementation rfg.deobf("curse.maven:thermdyn-227443:2920505")
//implementation rfg.deobf("curse.maven:ae2-223794:2747063")
//implementation rfg.deobf("curse.maven:ie-231951:2974106")
}

jar {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,9 @@ private void renderQuadList(IBlockAccess world, IBlockState state, BlockPos pos,
lighter.calculate((ModelQuadView) quad, pos, light, cullFace, quadFace, quad.shouldApplyDiffuseLighting());

if (quad.hasTintIndex() && colorizer == null) {
colorizer = this.blockColors.getColorProvider(state);
if (this.blockColors.hasColorProvider(state)) {
colorizer = this.blockColors.getColorProvider(state);
}
}

this.renderQuad(world, state, pos, sink, offset, colorizer, quad, light, renderData);
Expand All @@ -129,7 +131,7 @@ private void renderQuad(IBlockAccess world, IBlockState state, BlockPos pos, Mod

int[] colors = null;

if (bakedQuad.hasTintIndex()) {
if (bakedQuad.hasTintIndex() && colorProvider != null) {
colors = this.biomeColorBlender.getColors(colorProvider, world, state, pos, src);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@

public interface BlockColorsExtended {
IBlockColor getColorProvider(IBlockState state);
boolean hasColorProvider(IBlockState state);
}
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,9 @@ private void preRegisterColor(IBlockColor provider, Block[] blocks, CallbackInfo
public IBlockColor getColorProvider(IBlockState state) {
return this.blocksToColor.get(state.getBlock());
}

@Override
public boolean hasColorProvider(IBlockState state) {
return this.blocksToColor.get(state.getBlock()) != DEFAULT_PROVIDER;
}
}

0 comments on commit d6685cb

Please sign in to comment.