2025-11-24 22:52:51 +03:00

41 lines
1.4 KiB
Java

/*
* Decompiled with CFR 0.152.
*
* Could not load the following classes:
* it.unimi.dsi.fastutil.ints.Int2IntFunction
*/
package net.minecraft.client.renderer.blockentity;
import it.unimi.dsi.fastutil.ints.Int2IntFunction;
import net.minecraft.client.renderer.LevelRenderer;
import net.minecraft.client.renderer.LightTexture;
import net.minecraft.world.level.block.DoubleBlockCombiner;
import net.minecraft.world.level.block.entity.BlockEntity;
public class BrightnessCombiner<S extends BlockEntity>
implements DoubleBlockCombiner.Combiner<S, Int2IntFunction> {
@Override
public Int2IntFunction acceptDouble(S first, S second) {
return i -> {
int firstCoords = LevelRenderer.getLightColor(first.getLevel(), first.getBlockPos());
int secondCoords = LevelRenderer.getLightColor(second.getLevel(), second.getBlockPos());
int firstBlock = LightTexture.block(firstCoords);
int secondBlock = LightTexture.block(secondCoords);
int firstSky = LightTexture.sky(firstCoords);
int secondSky = LightTexture.sky(secondCoords);
return LightTexture.pack(Math.max(firstBlock, secondBlock), Math.max(firstSky, secondSky));
};
}
@Override
public Int2IntFunction acceptSingle(S single) {
return i -> i;
}
@Override
public Int2IntFunction acceptNone() {
return i -> i;
}
}