<commit_before>package com.lothrazar.cyclicmagic.item.tool;
import java.util.HashMap;
import java.util.Map;
import com.lothrazar.cyclicmagic.IHasConfig;
import com.lothrazar.cyclicmagic.IHasRecipe;
import com.lothrazar.cyclicmagic.item.BaseTool;
import com.lothrazar.cyclicmagic.util.Const;
import com.lothrazar.cyclicmagic.util.UtilChat;
import net.minecraft.block.Block;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.EnumDyeColor;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumActionResult;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumHand;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import net.minecraftforge.common.config.Configuration;
import net.minecraftforge.fml.common.registry.GameRegistry;

public class ItemToolProspector extends BaseTool implements IHasRecipe, IHasConfig {
  private static final int DURABILITY = 2000;
  private static final int COOLDOWN = 12;
  private static int range = 16;
  public ItemToolProspector() {
    super(DURABILITY);
  }
  @Override
  public EnumActionResult onItemUse(ItemStack stack, EntityPlayer player, World worldObj, BlockPos pos, EnumHand hand, EnumFacing side, float hitX, float hitY, float hitZ) {
    if (side == null || pos == null) { return super.onItemUse(stack, player, worldObj, pos, hand, side, hitX, hitY, hitZ); }
    Map<String, Integer> mapList = new HashMap<String, Integer>();
    String name;
    if (!worldObj.isRemote) {
      EnumFacing direction = side.getOpposite();
      BlockPos current = pos;
      IBlockState at = worldObj.getBlockState(current);
      Block blockAt = at.getBlock();
      for (int i = 0; i < range; i++) {
        if (at != null && at.getBlock() != null) {
          
//          name = blockAt.getUnlocalizedName();
          int m = blockAt.getMetaFromState(at);
          ItemStack s = new ItemStack(Item.getItemFromBlock(blockAt),1,m);
          name = s.getDisplayName();
          if (name == "tile.air.name" || at.getBlock() == Blocks.AIR) {
//            name = "Air";//workaround for no lang entry
            
          }
          if (mapList.containsKey(name)) {
            mapList.put(name, mapList.get(name) + 1);
          }
          else {
            mapList.put(name, 1);<commit_msg>refactor language translation for prospector blocks with metadata<commit_after>package com.lothrazar.cyclicmagic.item.tool;
import java.util.HashMap;
import java.util.Map;
import com.lothrazar.cyclicmagic.IHasConfig;
import com.lothrazar.cyclicmagic.IHasRecipe;
import com.lothrazar.cyclicmagic.item.BaseTool;
import com.lothrazar.cyclicmagic.util.Const;
import com.lothrazar.cyclicmagic.util.UtilChat;
import net.minecraft.block.Block;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.EnumDyeColor;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumActionResult;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumHand;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import net.minecraftforge.common.config.Configuration;
import net.minecraftforge.fml.common.registry.GameRegistry;

public class ItemToolProspector extends BaseTool implements IHasRecipe, IHasConfig {
  private static final int DURABILITY = 2000;
  private static final int COOLDOWN = 12;
  private static int range = 16;
  public ItemToolProspector() {
    super(DURABILITY);
  }
  @Override
  public EnumActionResult onItemUse(ItemStack stack, EntityPlayer player, World worldObj, BlockPos pos, EnumHand hand, EnumFacing side, float hitX, float hitY, float hitZ) {
    if (side == null || pos == null) { return super.onItemUse(stack, player, worldObj, pos, hand, side, hitX, hitY, hitZ); }
    Map<String, Integer> mapList = new HashMap<String, Integer>();
    String name;
    if (!worldObj.isRemote) {
      EnumFacing direction = side.getOpposite();
      BlockPos current = pos;
      IBlockState at = worldObj.getBlockState(current);
      Block blockAt = at.getBlock();
      ItemStack s;
      for (int i = 0; i < range; i++) {
        if (at != null && at.getBlock() != null) {
          
//          name = blockAt.getUnlocalizedName();
          s = new ItemStack(Item.getItemFromBlock(blockAt),1,blockAt.getMetaFromState(at));
          name = s.getDisplayName();
          if (name == "tile.air.name" || at.getBlock() == Blocks.AIR) {
//            name = "Air";//workaround for no lang entry
            
          }
          if (mapList.containsKey(name)) {
            mapList.put(name, mapList.get(name) + 1);
          }
          else {
            mapList.put(name, 1);
{'fraction_non_alphanumeric': 0.1130663430420712, 'fraction_numerical': 0.0048543689320388345, 'mean_word_length': 3.608574091332712, 'pattern_counts': {'":': 0, '<': 9, '<?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': '5938128', 'n_tokens_mistral': 1553, 'n_tokens_neox': 1536, 'n_words': 352}