Cleanup: removed IEEP, removed redundant casts, fixed imports, fixed typos.

This commit is contained in:
RainWarrior committed 2016-03-24 22:22:20 +03:00
1 parent 7e4d7077a5
commit a9d23f5e78
133 files changed
+489 -623

No files matched your search

@@ -260,7 +260,7 @@ public class OreDictionary
continue;
}
if(containsMatch(true, (ItemStack[])recipe.recipeItems.toArray(new ItemStack[recipe.recipeItems.size()]), replaceStacks))
if(containsMatch(true, recipe.recipeItems.toArray(new ItemStack[recipe.recipeItems.size()]), replaceStacks))
{
recipesToRemove.add((IRecipe)obj);
IRecipe newRecipe = new ShapelessOreRecipe(recipe, replacements);
@@ -273,7 +273,7 @@ public class OreDictionary
recipes.addAll(recipesToAdd);
if (recipesToRemove.size() > 0)
{
FMLLog.info("Replaced %d ore recipies", recipesToRemove.size());
FMLLog.info("Replaced %d ore recipes", recipesToRemove.size());
}
}
@@ -311,11 +311,11 @@ public class OreDictionary
}
/**
* Gets all the integer ID for the ores that the specified item stakc is registered to.
* Gets all the integer ID for the ores that the specified item stack is registered to.
* If the item stack is not linked to any ore, this will return an empty array and no new entry will be created.
*
* @param stack The item stack of the ore.
* @return An array of ids that this ore is registerd as.
* @return An array of ids that this ore is registered as.
*/
public static int[] getOreIDs(ItemStack stack)
{
@@ -30,7 +30,6 @@ import net.minecraft.item.crafting.RecipesBanners.RecipeAddPattern;
import net.minecraft.item.crafting.RecipesBanners.RecipeDuplicatePattern;
import static net.minecraftforge.oredict.RecipeSorter.Category.*;
@SuppressWarnings("rawtypes")
public class RecipeSorter implements Comparator<IRecipe>
{
public enum Category
@@ -71,7 +70,7 @@ public class RecipeSorter implements Comparator<IRecipe>
}
else
{
throw new IllegalArgumentException("Invalid dependancy: " + dep);
throw new IllegalArgumentException("Invalid dependency: " + dep);
}
}
}
@@ -104,10 +103,10 @@ public class RecipeSorter implements Comparator<IRecipe>
}
};
private static Map<Class, Category> categories = Maps.newHashMap();
//private static Map<String, Class> types = Maps.newHashMap();
private static Map<Class<?>, Category> categories = Maps.newHashMap();
//private static Map<String, Class<?>> types = Maps.newHashMap();
private static Map<String, SortEntry> entries = Maps.newHashMap();
private static Map<Class, Integer> priorities = Maps.newHashMap();
private static Map<Class<?>, Integer> priorities = Maps.newHashMap();
public static RecipeSorter INSTANCE = new RecipeSorter();
private static boolean isDirty = true;
@@ -146,21 +145,21 @@ public class RecipeSorter implements Comparator<IRecipe>
return getPriority(r2) - getPriority(r1); // high priority value first!
}
private static Set<Class> warned = Sets.newHashSet();
private static Set<Class<?>> warned = Sets.newHashSet();
public static void sortCraftManager()
{
bake();
FMLLog.fine("Sorting recipies");
FMLLog.fine("Sorting recipes");
warned.clear();
Collections.sort(CraftingManager.getInstance().getRecipeList(), INSTANCE);
}
public static void register(String name, Class<?> recipe, Category category, String dependancies)
public static void register(String name, Class<?> recipe, Category category, String dependencies)
{
assert(category != UNKNOWN) : "Category must not be unknown!";
isDirty = true;
SortEntry entry = new SortEntry(name, recipe, category, dependancies);
SortEntry entry = new SortEntry(name, recipe, category, dependencies);
entries.put(name, entry);
setCategory(recipe, category);
}
@@ -217,13 +216,13 @@ public class RecipeSorter implements Comparator<IRecipe>
if (ret != null)
{
priorities.put(recipe.getClass(), ret);
FMLLog.fine(" Parent Found: %d - %s", ret.intValue(), cls.getName());
return ret.intValue();
FMLLog.fine(" Parent Found: %d - %s", ret, cls.getName());
return ret;
}
}
}
return ret == null ? 0 : ret.intValue();
return ret == null ? 0 : ret;
}
private static void bake()
@@ -135,15 +135,15 @@ public class ShapedOreRecipe implements IRecipe
for(int i = 0; i < input.length; i++)
{
ItemStack ingred = recipe.recipeItems[i];
ItemStack ingredient = recipe.recipeItems[i];
if(ingred == null) continue;
if(ingredient == null) continue;
input[i] = recipe.recipeItems[i];
for(Entry<ItemStack, String> replace : replacements.entrySet())
{
if(OreDictionary.itemMatches(replace.getKey(), ingred, true))
if(OreDictionary.itemMatches(replace.getKey(), ingredient, true))
{
input[i] = OreDictionary.getOres(replace.getValue());
break;
@@ -60,12 +60,12 @@ public class ShapelessOreRecipe implements IRecipe
{
output = recipe.getRecipeOutput();
for(ItemStack ingred : ((List<ItemStack>)recipe.recipeItems))
for(ItemStack ingredient : recipe.recipeItems)
{
Object finalObj = ingred;
Object finalObj = ingredient;
for(Entry<ItemStack, String> replace : replacements.entrySet())
{
if(OreDictionary.itemMatches(replace.getKey(), ingred, false))
if(OreDictionary.itemMatches(replace.getKey(), ingredient, false))
{
finalObj = OreDictionary.getOres(replace.getValue());
break;