<commit_before>package crazypants.enderio.handler.darksteel;

import java.util.List;
import java.util.Map;
import java.util.WeakHashMap;

import javax.annotation.Nonnull;

import crazypants.enderio.Log;
import crazypants.enderio.item.darksteel.upgrade.elytra.CapeFilterLayer;
import net.minecraft.client.entity.AbstractClientPlayer;
import net.minecraft.client.renderer.entity.RenderLivingBase;
import net.minecraft.client.renderer.entity.RenderPlayer;
import net.minecraft.client.renderer.entity.layers.LayerCape;
import net.minecraft.client.renderer.entity.layers.LayerRenderer;
import net.minecraftforge.client.event.RenderPlayerEvent;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.fml.relauncher.ReflectionHelper;
import net.minecraftforge.fml.relauncher.ReflectionHelper.UnableToAccessFieldException;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;

public class UpgradeRenderManager {

  // no WeakHashSet in Java...
  private static final Map<RenderPlayer, Object> injected = new WeakHashMap<RenderPlayer, Object>();

  private UpgradeRenderManager() {
  }

  public static void init(@Nonnull FMLPreInitializationEvent event) {
    MinecraftForge.EVENT_BUS.register(UpgradeRenderDispatcher.class);
  }

  @SideOnly(Side.CLIENT)
  @SubscribeEvent
  public static void onPlayerRenderPre(RenderPlayerEvent.Pre event) {
    final RenderPlayer renderer = event.getRenderer();
    if (renderer != null && !injected.containsKey(renderer)) {
      UpgradeRenderManager.replaceCapeLayer(renderer);
      renderer.addLayer(new UpgradeRenderDispatcher(renderer));
      injected.put(renderer, null);
    }
  }<commit_msg>Fix DS upgrades not rendering<commit_after>package crazypants.enderio.handler.darksteel;

import java.util.List;
import java.util.Map;
import java.util.WeakHashMap;

import javax.annotation.Nonnull;

import crazypants.enderio.EnderIO;
import crazypants.enderio.Log;
import crazypants.enderio.item.darksteel.upgrade.elytra.CapeFilterLayer;
import net.minecraft.client.entity.AbstractClientPlayer;
import net.minecraft.client.renderer.entity.RenderLivingBase;
import net.minecraft.client.renderer.entity.RenderPlayer;
import net.minecraft.client.renderer.entity.layers.LayerCape;
import net.minecraft.client.renderer.entity.layers.LayerRenderer;
import net.minecraftforge.client.event.RenderPlayerEvent;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.fml.common.Mod.EventBusSubscriber;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.fml.relauncher.ReflectionHelper;
import net.minecraftforge.fml.relauncher.ReflectionHelper.UnableToAccessFieldException;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;

@EventBusSubscriber(modid = EnderIO.MODID)
public class UpgradeRenderManager {

  // no WeakHashSet in Java...
  private static final Map<RenderPlayer, Object> injected = new WeakHashMap<RenderPlayer, Object>();

  private UpgradeRenderManager() {
  }

  public static void init(@Nonnull FMLPreInitializationEvent event) {
    MinecraftForge.EVENT_BUS.register(UpgradeRenderDispatcher.class);
  }

  @SideOnly(Side.CLIENT)
  @SubscribeEvent
  public static void onPlayerRenderPre(RenderPlayerEvent.Pre event) {
    final RenderPlayer renderer = event.getRenderer();
    if (renderer != null && !injected.containsKey(renderer)) {
      UpgradeRenderManager.replaceCapeLayer(renderer);
      renderer.addLayer(new UpgradeRenderDispatcher(renderer));
      injected.put(renderer, null);
    }
  }
{'fraction_non_alphanumeric': 0.09531290913851793, 'fraction_numerical': 0.0, 'mean_word_length': 6.234848484848484, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '2895495', 'n_tokens_mistral': 1161, 'n_tokens_neox': 1160, 'n_words': 180}