<commit_before>package crazypants.enderio;

import java.io.IOException;

import javax.annotation.Nonnull;
import javax.xml.stream.XMLStreamException;

import crazypants.enderio.config.recipes.InvalidRecipeConfigException;
import crazypants.enderio.config.recipes.RecipeFactory;
import crazypants.enderio.config.recipes.xml.Recipes;
import crazypants.enderio.sound.SoundRegistry;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.MobEffects;
import net.minecraft.potion.PotionEffect;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.World;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.fml.common.gameevent.TickEvent.ClientTickEvent;
import net.minecraftforge.fml.common.gameevent.TickEvent.Phase;
import net.minecraftforge.fml.common.gameevent.TickEvent.ServerTickEvent;

public class CommonProxy {

  protected long serverTickCount = 0;
  protected long clientTickCount = 0;
  protected final TickTimer tickTimer = new TickTimer();

  public CommonProxy() {
  }

  public World getClientWorld() {
    return null;
  }

  public EntityPlayer getClientPlayer() {
    return null;
  }

  public double getReachDistanceForPlayer(EntityPlayer entityPlayer) {
    return 5;
  }

  public void loadIcons() {
  }
  
  public void preInit() {       
  }
  
  private static final String[] RECIPE_FILES = { "aliases", "materials", "items", "machines" };

  public void init() {
    MinecraftForge.EVENT_BUS.register(tickTimer);
    SoundRegistry.init();

    for (String filename : RECIPE_FILES) {
      try {
        Recipes recipes = RecipeFactory.readFile(new Recipes(), "recipes", "recipe_" + filename);
        if (recipes.isValid()) {
          recipes.register();
        } else {
          Log.warn("Recipes config file recipe_" + filename + ".xml is empty or invalid!");
        }
      } catch (InvalidRecipeConfigException e) {
        Log.warn("Recipes config file recipe_" + filename + ".xml is invalid: " + e.getMessage());
      } catch (IOException e) {
        Log.warn("Error while reading recipes config file recipe_" + filename + ".xml: " + e.getMessage());
      } catch (XMLStreamException e) {
        Log.warn("Recipes config file recipe_" + filename + ".xml is invalid: " + e.getMessage());
      }
    }
  }

  public long getTickCount() {
    return serverTickCount;
  }

  public boolean isAnEiInstalled() {
    return false;
  }

  public void setInstantConfusionOnPlayer(EntityPlayer ent, int duration) {
    ent.addPotionEffect(new PotionEffect(MobEffects.NAUSEA, duration, 1, true, true));
  }

  protected void onServerTick() {
    ++serverTickCount;
  }

  protected void onClientTick() {
  }

  public final class TickTimer {

    @SubscribeEvent
    public void onTick(ServerTickEvent evt) {<commit_msg>Made errors in recipes config files fatal.<commit_after>package crazypants.enderio;

import java.io.IOException;

import javax.annotation.Nonnull;
import javax.xml.stream.XMLStreamException;

import crazypants.enderio.config.recipes.InvalidRecipeConfigException;
import crazypants.enderio.config.recipes.RecipeFactory;
import crazypants.enderio.config.recipes.xml.Recipes;
import crazypants.enderio.sound.SoundRegistry;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.MobEffects;
import net.minecraft.potion.PotionEffect;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.World;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.fml.common.gameevent.TickEvent.ClientTickEvent;
import net.minecraftforge.fml.common.gameevent.TickEvent.Phase;
import net.minecraftforge.fml.common.gameevent.TickEvent.ServerTickEvent;

public class CommonProxy {

  protected long serverTickCount = 0;
  protected long clientTickCount = 0;
  protected final TickTimer tickTimer = new TickTimer();

  public CommonProxy() {
  }

  public World getClientWorld() {
    return null;
  }

  public EntityPlayer getClientPlayer() {
    return null;
  }

  public double getReachDistanceForPlayer(EntityPlayer entityPlayer) {
    return 5;
  }

  public void loadIcons() {
  }
  
  public void preInit() {       
  }
  
  private static final String[] RECIPE_FILES = { "aliases", "materials", "items", "machines" };

  public void init() {
    MinecraftForge.EVENT_BUS.register(tickTimer);
    SoundRegistry.init();

    for (String filename : RECIPE_FILES) {
      try {
        Recipes recipes = RecipeFactory.readFile(new Recipes(), "recipes", "recipe_" + filename);
        if (recipes.isValid()) {
          recipes.register();
        } else {
          throw new InvalidRecipeConfigException("Recipes config file recipe_" + filename + ".xml is empty or invalid!");
        }
      } catch (InvalidRecipeConfigException e) {
        throw new RuntimeException("Recipes config file recipe_" + filename + ".xml is invalid: " + e.getMessage());
      } catch (IOException e) {
        throw new RuntimeException("Error while reading recipes config file recipe_" + filename + ".xml: " + e.getMessage());
      } catch (XMLStreamException e) {
        throw new RuntimeException("Recipes config file recipe_" + filename + ".xml is invalid: " + e.getMessage());
      }
    }
  }

  public long getTickCount() {
    return serverTickCount;
  }

  public boolean isAnEiInstalled() {
    return false;
  }

  public void setInstantConfusionOnPlayer(EntityPlayer ent, int duration) {
    ent.addPotionEffect(new PotionEffect(MobEffects.NAUSEA, duration, 1, true, true));
  }

  protected void onServerTick() {
    ++serverTickCount;
  }

  protected void onClientTick() {
  }

  public final class TickTimer {

    @SubscribeEvent
    public void onTick(ServerTickEvent evt) {
{'fraction_non_alphanumeric': 0.1022707870923681, 'fraction_numerical': 0.0013658869728529965, 'mean_word_length': 3.930976430976431, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 12}, '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': '4257604', 'n_tokens_mistral': 1767, 'n_tokens_neox': 1725, 'n_words': 398}