<commit_before>package com.github.igotyou.FactoryMod.properties;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

import org.bukkit.Material;
import org.bukkit.configuration.ConfigurationSection;

import com.github.igotyou.FactoryMod.FactoryModPlugin;
import com.github.igotyou.FactoryMod.utility.ItemList;
import com.github.igotyou.FactoryMod.utility.NamedItemStack;

public class RepairFactoryProperties implements IFactoryProperties{

	private ItemList<NamedItemStack> constructionMaterials;
	private ItemList<NamedItemStack> fuel;
	private ItemList<NamedItemStack> repairMaterials;
	private ItemList<NamedItemStack> recipeMaterials;
	private List<Material> allowedRepairable;
	private int energyTime;
	private String name;
	private int repair;
	private double repairTime;
	private double productionTime;
	private int resetLevel;
	
	public RepairFactoryProperties(ItemList<NamedItemStack> constructionMaterials, ItemList<NamedItemStack> fuel,
			ItemList<NamedItemStack> repairMaterials, int energyTime, String name,int repair, double repairTime,
			double productionTime, int resetLevel, ItemList<NamedItemStack> recipeMaterials, List<Material> allowedRepairable){
		this.constructionMaterials = constructionMaterials;
		this.fuel = fuel;
		this.repairMaterials = repairMaterials;
		this.energyTime = energyTime;
		this.name = name;
		this.repair = repair;
		this.repairTime = repairTime;
		this.productionTime = productionTime;
		this.resetLevel = resetLevel;
		this.recipeMaterials = recipeMaterials;
		this.allowedRepairable = allowedRepairable;
	}
	
	public int getRepair() {
		return repair;
	}
	
	public ItemList<NamedItemStack> getConstructionMaterials(){
		return constructionMaterials;
	}
	
	public ItemList<NamedItemStack> getFuel(){
		return fuel;
	}
	
	public ItemList<NamedItemStack> getRepairMaterials(){
		return repairMaterials;
	}
	
	public ItemList<NamedItemStack> getRecipeMaterials(){
		return recipeMaterials;
	}
	
	public List<Material> getAllowedRepairable(){
		return allowedRepairable;
	}
	
	public int getEnergyTime()
	{
		return energyTime;
	}
	
	public String getName()
	{
		return name;
	}

	public double getRepairTime() 
	{
		return repairTime;
	}
	
	public double getProductionTime(){
		return productionTime;
	}
	
	public int getResetLevel() {
		return resetLevel;
	}
	
	public static RepairFactoryProperties fromConfig(FactoryModPlugin plugin, ConfigurationSection section){
		ItemList<NamedItemStack> rfFuel = plugin.getItems(section.getConfigurationSection("fuel"));
		if (rfFuel.isEmpty()){
			rfFuel = new ItemList<NamedItemStack>();
			rfFuel.add(new NamedItemStack(Material.getMaterial("COAL"), 1, (short) 1, "Charcoal"));
		}
		ConfigurationSection costs = section.getConfigurationSection("costs");
		ItemList<NamedItemStack> rfConstructionCost = plugin.getItems(costs.getConfigurationSection("construction"));
		ItemList<NamedItemStack> rfRepairCost = plugin.getItems(costs.getConfigurationSection("repair"));
		ItemList<NamedItemStack> rfRecipeUse = plugin.getItems(costs.getConfigurationSection("recipe"));
		ItemList<NamedItemStack> rfAllowed = plugin.getItems(section.getConfigurationSection("repairable"));
		int rfEnergyTime = section.getInt("fuel_time");
		int rfRepair = costs.getInt("repair_multiple", 1);
		String rfName = section.getString("name", "Repair Factory");
		int repairTime = section.getInt("repair_time", 12);
		int productionTime = section.getInt("production_time");
		int resetLevel = section.getInt("reset_level");
		
		// We only care about raw material types for repair purposes.
		Iterator<NamedItemStack> canRepair = rfAllowed.iterator();
		List<Material> repairable = new ArrayList<Material>();
		
		while (canRepair.hasNext()) {
			NamedItemStack repair = canRepair.next();
			
			repairable.add(repair.getType());
			
			FactoryModPlugin.sendConsoleMessage("Adding repairable: " + repair.getType());
		}
		return new RepairFactoryProperties(rfConstructionCost, rfFuel, rfRepairCost, rfEnergyTime, rfName,
				rfRepair, repairTime, productionTime, resetLevel, rfRecipeUse, repairable);
	}
}
<commit_msg>Added default level for reset and fixed default factory name to reset factory<commit_after>package com.github.igotyou.FactoryMod.properties;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

import org.bukkit.Material;
import org.bukkit.configuration.ConfigurationSection;

import com.github.igotyou.FactoryMod.FactoryModPlugin;
import com.github.igotyou.FactoryMod.utility.ItemList;
import com.github.igotyou.FactoryMod.utility.NamedItemStack;

public class RepairFactoryProperties implements IFactoryProperties{

	private ItemList<NamedItemStack> constructionMaterials;
	private ItemList<NamedItemStack> fuel;
	private ItemList<NamedItemStack> repairMaterials;
	private ItemList<NamedItemStack> recipeMaterials;
	private List<Material> allowedRepairable;
	private int energyTime;
	private String name;
	private int repair;
	private double repairTime;
	private double productionTime;
	private int resetLevel;
	
	public RepairFactoryProperties(ItemList<NamedItemStack> constructionMaterials, ItemList<NamedItemStack> fuel,
			ItemList<NamedItemStack> repairMaterials, int energyTime, String name,int repair, double repairTime,
			double productionTime, int resetLevel, ItemList<NamedItemStack> recipeMaterials, List<Material> allowedRepairable){
		this.constructionMaterials = constructionMaterials;
		this.fuel = fuel;
		this.repairMaterials = repairMaterials;
		this.energyTime = energyTime;
		this.name = name;
		this.repair = repair;
		this.repairTime = repairTime;
		this.productionTime = productionTime;
		this.resetLevel = resetLevel;
		this.recipeMaterials = recipeMaterials;
		this.allowedRepairable = allowedRepairable;
	}
	
	public int getRepair() {
		return repair;
	}
	
	public ItemList<NamedItemStack> getConstructionMaterials(){
		return constructionMaterials;
	}
	
	public ItemList<NamedItemStack> getFuel(){
		return fuel;
	}
	
	public ItemList<NamedItemStack> getRepairMaterials(){
		return repairMaterials;
	}
	
	public ItemList<NamedItemStack> getRecipeMaterials(){
		return recipeMaterials;
	}
	
	public List<Material> getAllowedRepairable(){
		return allowedRepairable;
	}
	
	public int getEnergyTime()
	{
		return energyTime;
	}
	
	public String getName()
	{
		return name;
	}

	public double getRepairTime() 
	{
		return repairTime;
	}
	
	public double getProductionTime(){
		return productionTime;
	}
	
	public int getResetLevel() {
		return resetLevel;
	}
	
	public static RepairFactoryProperties fromConfig(FactoryModPlugin plugin, ConfigurationSection section){
		ItemList<NamedItemStack> rfFuel = plugin.getItems(section.getConfigurationSection("fuel"));
		if (rfFuel.isEmpty()){
			rfFuel = new ItemList<NamedItemStack>();
			rfFuel.add(new NamedItemStack(Material.getMaterial("COAL"), 1, (short) 1, "Charcoal"));
		}
		ConfigurationSection costs = section.getConfigurationSection("costs");
		ItemList<NamedItemStack> rfConstructionCost = plugin.getItems(costs.getConfigurationSection("construction"));
		ItemList<NamedItemStack> rfRepairCost = plugin.getItems(costs.getConfigurationSection("repair"));
		ItemList<NamedItemStack> rfRecipeUse = plugin.getItems(costs.getConfigurationSection("recipe"));
		ItemList<NamedItemStack> rfAllowed = plugin.getItems(section.getConfigurationSection("repairable"));
		int rfEnergyTime = section.getInt("fuel_time");
		int rfRepair = costs.getInt("repair_multiple", 1);
		String rfName = section.getString("name", "Reset Factory");
		int repairTime = section.getInt("repair_time", 12);
		int productionTime = section.getInt("production_time");
		int resetLevel = section.getInt("reset_level", 1);
		
		// We only care about raw material types for repair purposes.
		Iterator<NamedItemStack> canRepair = rfAllowed.iterator();
		List<Material> repairable = new ArrayList<Material>();
		
		while (canRepair.hasNext()) {
			NamedItemStack repair = canRepair.next();
			
			repairable.add(repair.getType());
			
			FactoryModPlugin.sendConsoleMessage("Adding repairable: " + repair.getType());
		}
		return new RepairFactoryProperties(rfConstructionCost, rfFuel, rfRepairCost, rfEnergyTime, rfName,
				rfRepair, repairTime, productionTime, resetLevel, rfRecipeUse, repairable);
	}
}

{'fraction_non_alphanumeric': 0.09592181467181467, 'fraction_numerical': 0.0013272200772200772, 'mean_word_length': 6.207826086956522, 'pattern_counts': {'":': 0, '<': 51, '<?xml version=': 0, '>': 51, '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': '1794921', 'n_tokens_mistral': 2637, 'n_tokens_neox': 2385, 'n_words': 517}