Maybe fixed colormatic's mod compat?
This commit is contained in:
+5
-1
@@ -49,7 +49,11 @@ public class TintGetterOverrideFast implements BlockAndTintGetter {
|
||||
@Override
|
||||
public int getBlockTint(BlockPos blockPos, ColorResolver colorResolver) {
|
||||
Biome b = _getBiome(blockPos);
|
||||
return tintCaches.get(colorResolver).computeIfAbsent(b, (key) -> colorResolver.getColor(b, blockPos.getX(), blockPos.getZ()));
|
||||
ConcurrentHashMap<Biome, Integer> concurrentHashMap = this.tintCaches.get(colorResolver);
|
||||
if (concurrentHashMap == null) { // This is a compat fix for Colormatic's mixin
|
||||
this.tintCaches.put(colorResolver, concurrentHashMap = new ConcurrentHashMap<>());
|
||||
}
|
||||
return concurrentHashMap.computeIfAbsent(b, (key) -> colorResolver.getColor(b, blockPos.getX(), blockPos.getZ()));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+4
@@ -72,6 +72,10 @@ public class TintGetterOverrideSmooth implements BlockAndTintGetter {
|
||||
@Override
|
||||
public int getBlockTint(BlockPos blockPos, ColorResolver colorResolver) {
|
||||
BlockTintCache blockTintCache = this.tintCaches.get(colorResolver);
|
||||
if (blockTintCache == null) { // This is a compat fix for Colormatic's mixin
|
||||
this.tintCaches.put(colorResolver,
|
||||
blockTintCache = new BlockTintCache((pos) -> calculateBlockTint(pos, colorResolver)));
|
||||
}
|
||||
return blockTintCache.getColor(blockPos);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user