<commit_before>package crazypants.enderio.machine.gauge;

import java.util.Map;
import java.util.Map.Entry;

import javax.annotation.Nonnull;

import org.lwjgl.opengl.GL11;

import com.enderio.core.client.render.ManagedTESR;

import crazypants.enderio.EnderIO;
import crazypants.enderio.machine.capbank.render.FillGaugeBakery;
import crazypants.enderio.power.IPowerInterface;
import net.minecraft.block.state.IBlockState;
import net.minecraft.client.renderer.RenderHelper;
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumFacing;
import net.minecraft.world.World;

public class TESRGauge extends ManagedTESR<TileGauge> {

  public TESRGauge() {
    super(EnderIO.blockGauge);
  }

  @Override
  protected void renderTileEntity(@Nonnull TileGauge te, @Nonnull IBlockState blockState, float partialTicks, int destroyStage) {
    RenderHelper.enableStandardItemLighting();
    World world = te.getWorld();
    Map<EnumFacing, IPowerInterface> sides = BlockGauge.getDisplays(world, te.getPos());
    if (!sides.isEmpty()) {
      for (Entry<EnumFacing, IPowerInterface> side : sides.entrySet()) {
        IPowerInterface eh = side.getValue();
        EnumFacing face = side.getKey().getOpposite();
        int energyStored = eh.getEnergyStored();
        int maxEnergyStored = eh.getMaxEnergyStored();
        float ratio = maxEnergyStored > 0 ? (float) energyStored / (float) maxEnergyStored : 0f;
        FillGaugeBakery bakery = new FillGaugeBakery(world, ((TileEntity) eh).getPos(), face, BlockGauge.gaugeIcon.get(TextureAtlasSprite.class), ratio);
        if (bakery.canRender()) {
          GL11.glPushMatrix();
          GL11.glTranslated(-face.getFrontOffsetX(), -face.getFrontOffsetY(), -face.getFrontOffsetZ());
          bakery.render();
          GL11.glPopMatrix();
        }
      }<commit_msg>Fix RF Gauge being left out in the rain when RF got replaced<commit_after>package crazypants.enderio.machine.gauge;

import java.util.Map;
import java.util.Map.Entry;

import javax.annotation.Nonnull;

import org.lwjgl.opengl.GL11;

import com.enderio.core.client.render.ManagedTESR;

import crazypants.enderio.EnderIO;
import crazypants.enderio.machine.capbank.render.FillGaugeBakery;
import crazypants.enderio.power.IPowerInterface;
import net.minecraft.block.state.IBlockState;
import net.minecraft.client.renderer.RenderHelper;
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.util.EnumFacing;
import net.minecraft.world.World;

public class TESRGauge extends ManagedTESR<TileGauge> {

  public TESRGauge() {
    super(EnderIO.blockGauge);
  }

  @Override
  protected void renderTileEntity(@Nonnull TileGauge te, @Nonnull IBlockState blockState, float partialTicks, int destroyStage) {
    RenderHelper.enableStandardItemLighting();
    World world = te.getWorld();
    Map<EnumFacing, IPowerInterface> sides = BlockGauge.getDisplays(world, te.getPos());
    if (!sides.isEmpty()) {
      for (Entry<EnumFacing, IPowerInterface> side : sides.entrySet()) {
        IPowerInterface eh = side.getValue();
        EnumFacing face = side.getKey().getOpposite();
        int energyStored = eh.getEnergyStored();
        int maxEnergyStored = eh.getMaxEnergyStored();
        float ratio = maxEnergyStored > 0 ? (float) energyStored / (float) maxEnergyStored : 0f;
        FillGaugeBakery bakery = new FillGaugeBakery(world, te.getPos().offset(side.getKey()), face, BlockGauge.gaugeIcon.get(TextureAtlasSprite.class), ratio);
        if (bakery.canRender()) {
          GL11.glPushMatrix();
          GL11.glTranslated(-face.getFrontOffsetX(), -face.getFrontOffsetY(), -face.getFrontOffsetZ());
          bakery.render();
          GL11.glPopMatrix();
        }
      }
{'fraction_non_alphanumeric': 0.11374407582938388, 'fraction_numerical': 0.0052659294365455505, 'mean_word_length': 4.2690707350901524, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2559475', 'n_tokens_mistral': 1239, 'n_tokens_neox': 1212, 'n_words': 219}