<commit_before>package crazypants.enderio.material;

import java.util.List;

import com.enderio.core.client.handlers.SpecialTooltipHandler;

import crazypants.enderio.EnderIO;
import crazypants.enderio.EnderIOTab;
import crazypants.enderio.ModObject;
import crazypants.enderio.capacitor.CapacitorHelper;
import crazypants.enderio.capacitor.CapacitorHelper.SetType;
import crazypants.enderio.capacitor.CapacitorKey;
import crazypants.enderio.capacitor.DefaultCapacitorData;
import crazypants.enderio.capacitor.ICapacitorData;
import crazypants.enderio.capacitor.ICapacitorDataItem;
import crazypants.util.ClientUtil;
import net.minecraft.client.renderer.block.model.ModelBakery;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.math.MathHelper;
import net.minecraftforge.fml.common.registry.GameRegistry;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;

public class ItemCapacitor extends Item implements ICapacitorDataItem {

  public static ItemCapacitor create() {
    ItemCapacitor result = new ItemCapacitor();
    result.init();
    return result;
  }

  protected ItemCapacitor() {
    setCreativeTab(EnderIOTab.tabEnderIO);
    setUnlocalizedName(ModObject.itemBasicCapacitor.getUnlocalisedName());
    setRegistryName(ModObject.itemBasicCapacitor.getUnlocalisedName());
    setHasSubtypes(true);
    setMaxDamage(0);
    setMaxStackSize(64);
  }

  protected void init() {
    GameRegistry.register(this);
  }

  @SideOnly(Side.CLIENT)
  public void registerRenderers() {
    final ResourceLocation[] resourceLocations = DefaultCapacitorData.getResourceLocations();
    ModelBakery.registerItemVariants(this, resourceLocations);
    for (int i = 0; i < resourceLocations.length; i++) {
      ClientUtil.regRenderer(this, i, resourceLocations[i]);
    }
  }
  
  @Override
  public String getUnlocalizedName(ItemStack stack) {
    return getCapacitorData(stack).getUnlocalizedName();
  }

  @Override  
  @SideOnly(Side.CLIENT)
  public void getSubItems(Item par1, CreativeTabs par2CreativeTabs, List<ItemStack> par3List) {
    for (int j = 0; j < DefaultCapacitorData.values().length; ++j) {
      par3List.add(new ItemStack(par1, 1, j));
    }
    final ItemStack stack = CapacitorHelper.addCapData(CapacitorHelper.addCapData(new ItemStack(par1, 1, 0), SetType.NAME, null, 1), SetType.NAME,
        CapacitorKey.ALLOY_SMELTER_POWER_USE, 5);
    stack.setStackDisplayName("Smelting Capacitor"); // TODO remove this test
    par3List.add(stack);
  }

  @Override
  public int getMetadata(ItemStack stack) {
    return MathHelper.clamp_int(stack != null ? stack.getItemDamage() : 0, 0, DefaultCapacitorData.values().length - 1);
  }

  @Override
  @SideOnly(Side.CLIENT)
  public void addInformation(ItemStack stack, EntityPlayer par2EntityPlayer, List<String> par3List, boolean par4) {
    if (getMetadata(stack) > 0) {
      par3List.add(EnderIO.lang.localize("machine.tooltip.upgrade"));
      if(SpecialTooltipHandler.showAdvancedTooltips()) {
        SpecialTooltipHandler.addDetailedTooltipFromResources(par3List, "enderio.machine.tooltip.upgrade");
      } else {
        SpecialTooltipHandler.addShowDetailsTooltip(par3List);
      }
    }

  }

  @Override
  public ICapacitorData getCapacitorData(ItemStack stack) {
    return DefaultCapacitorData.values()[getMetadata(stack)];
  }

}
<commit_msg>Fixed Wrong Parameter<commit_after>package crazypants.enderio.material;

import java.util.List;

import com.enderio.core.client.handlers.SpecialTooltipHandler;

import crazypants.enderio.EnderIO;
import crazypants.enderio.EnderIOTab;
import crazypants.enderio.ModObject;
import crazypants.enderio.capacitor.CapacitorHelper;
import crazypants.enderio.capacitor.CapacitorHelper.SetType;
import crazypants.enderio.capacitor.CapacitorKey;
import crazypants.enderio.capacitor.DefaultCapacitorData;
import crazypants.enderio.capacitor.ICapacitorData;
import crazypants.enderio.capacitor.ICapacitorDataItem;
import crazypants.util.ClientUtil;
import net.minecraft.client.renderer.block.model.ModelBakery;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.math.MathHelper;
import net.minecraftforge.fml.common.registry.GameRegistry;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;

public class ItemCapacitor extends Item implements ICapacitorDataItem {

  public static ItemCapacitor create() {
    ItemCapacitor result = new ItemCapacitor();
    result.init();
    return result;
  }

  protected ItemCapacitor() {
    setCreativeTab(EnderIOTab.tabEnderIO);
    setUnlocalizedName(ModObject.itemBasicCapacitor.getUnlocalisedName());
    setRegistryName(ModObject.itemBasicCapacitor.getUnlocalisedName());
    setHasSubtypes(true);
    setMaxDamage(0);
    setMaxStackSize(64);
  }

  protected void init() {
    GameRegistry.register(this);
  }

  @SideOnly(Side.CLIENT)
  public void registerRenderers() {
    final ResourceLocation[] resourceLocations = DefaultCapacitorData.getResourceLocations();
    ModelBakery.registerItemVariants(this, resourceLocations);
    for (int i = 0; i < resourceLocations.length; i++) {
      ClientUtil.regRenderer(this, i, resourceLocations[i]);
    }
  }
  
  @Override
  public String getUnlocalizedName(ItemStack stack) {
    return getCapacitorData(stack).getUnlocalizedName();
  }

  @Override  
  @SideOnly(Side.CLIENT)
  public void getSubItems(Item par1, CreativeTabs par2CreativeTabs, List<ItemStack> par3List) {
    for (int j = 0; j < DefaultCapacitorData.values().length; ++j) {
      par3List.add(new ItemStack(par1, 1, j));
    }
    final ItemStack stack = CapacitorHelper.addCapData(CapacitorHelper.addCapData(new ItemStack(par1, 1, 0), SetType.LEVEL, null, 1), SetType.NAME,
        CapacitorKey.ALLOY_SMELTER_POWER_USE, 5);
    stack.setStackDisplayName("Smelting Capacitor"); // TODO remove this test
    par3List.add(stack);
  }

  @Override
  public int getMetadata(ItemStack stack) {
    return MathHelper.clamp_int(stack != null ? stack.getItemDamage() : 0, 0, DefaultCapacitorData.values().length - 1);
  }

  @Override
  @SideOnly(Side.CLIENT)
  public void addInformation(ItemStack stack, EntityPlayer par2EntityPlayer, List<String> par3List, boolean par4) {
    if (getMetadata(stack) > 0) {
      par3List.add(EnderIO.lang.localize("machine.tooltip.upgrade"));
      if(SpecialTooltipHandler.showAdvancedTooltips()) {
        SpecialTooltipHandler.addDetailedTooltipFromResources(par3List, "enderio.machine.tooltip.upgrade");
      } else {
        SpecialTooltipHandler.addShowDetailsTooltip(par3List);
      }
    }

  }

  @Override
  public ICapacitorData getCapacitorData(ItemStack stack) {
    return DefaultCapacitorData.values()[getMetadata(stack)];
  }

}

{'fraction_non_alphanumeric': 0.10271563247502462, 'fraction_numerical': 0.007598142676234698, 'mean_word_length': 5.175499565595135, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 9, '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': '5323762', 'n_tokens_mistral': 2348, 'n_tokens_neox': 2328, 'n_words': 372}