Skip to content

Commit 8e881d2

Browse files
authored
Fix map color of spruce and birch leaves. (#1817)
1 parent 41bf928 commit 8e881d2

File tree

1 file changed

+7
-0
lines changed
  • chunky/src/java/se/llbit/chunky/block/minecraft

1 file changed

+7
-0
lines changed

chunky/src/java/se/llbit/chunky/block/minecraft/Leaves.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,21 +24,28 @@
2424
import se.llbit.chunky.world.biome.Biome;
2525

2626
public class Leaves extends AbstractModelBlock {
27+
private final int tint;
2728

2829
public Leaves(String name, Texture texture) {
2930
super(name, texture);
3031
solid = false;
3132
this.model = new LeafModel(texture);
33+
this.tint = -1;
3234
}
3335

3436
public Leaves(String name, Texture texture, int tint) {
3537
super(name, texture);
3638
solid = false;
3739
this.model = new LeafModel(texture, tint);
40+
this.tint = tint;
3841
}
3942

4043
@Override
4144
public int getMapColor(Biome biome) {
45+
if (this.tint >= 0) {
46+
// this leave type has a blending color that is independent from the biome (eg. spruce or birch leaves)
47+
return this.tint | 0xFF000000;
48+
}
4249
return biome.foliageColor | 0xFF000000;
4350
}
4451
}

0 commit comments

Comments
 (0)