/*
* LightingHelper - Derived and adapted from @Mineshopper / carpentersblocks
* Copyright (c) 2013-2021.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation version 2.1
* of the License.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
package gregtech.api.util;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.EntityRenderer;
import net.minecraft.client.renderer.RenderBlocks;
import net.minecraft.client.renderer.Tessellator;
@SuppressWarnings("unused")
@SideOnly(Side.CLIENT)
public class LightingHelper {
public static final int NORMAL_BRIGHTNESS = 0xff00ff;
public static final int MAX_BRIGHTNESS = 0xf000f0;
public static final float NO_Z_FIGHT_OFFSET = 1.0F / 1024.0F;
protected static final float[] LIGHTNESS = {0.5F, 1.0F, 0.8F, 0.8F, 0.6F, 0.6F};
private final RenderBlocks renderBlocks;
/**
* Brightness for side.
*/
private int brightness;
/**
* Ambient occlusion values for all four corners of side.
*/
private float aoTopLeft, aoBottomLeft, aoBottomRight, aoTopRight;
private boolean hasLightnessOverride;
private float lightnessOverride;
private boolean hasBrightnessOverride;
private int brightnessOverride;
private boolean hasColorOverride;
private int colorOverride = 0xffffff;
/**
* Class constructor specifying the {@link RenderBlocks}.
*
* @param renderBlocks the {@link RenderBlocks}
*/
public LightingHelper(RenderBlocks renderBlocks) {
this.renderBlocks = renderBlocks;
if (renderBlocks.useInventoryTint)