diff --git a/build.gradle b/build.gradle index 2315f2c..4c4d395 100644 --- a/build.gradle +++ b/build.gradle @@ -17,7 +17,7 @@ buildscript { apply plugin: 'forge' -version = "0.9.0" +version = "0.9.1" group= "modtweaker" // http://maven.apache.org/guides/mini/guide-naming-conventions.html archivesBaseName = "ModTweaker~2" diff --git a/src/main/java/modtweaker2/ModProps.java b/src/main/java/modtweaker2/ModProps.java index 3beb52a..1326aba 100644 --- a/src/main/java/modtweaker2/ModProps.java +++ b/src/main/java/modtweaker2/ModProps.java @@ -4,6 +4,6 @@ public class ModProps { public static final String NAME = "Mod Tweaker 2", name = NAME; public static final String MODID = "modtweaker2", modid = MODID; - public static final String VERSION = "0.9.0", version = VERSION; + public static final String VERSION = "0.9.1", version = VERSION; public static final String DEPENDENCIES = "required-after:MineTweaker3", dependencies = DEPENDENCIES; } diff --git a/src/main/java/modtweaker2/helpers/InputHelper.java b/src/main/java/modtweaker2/helpers/InputHelper.java index c8b899d..83a8fd7 100644 --- a/src/main/java/modtweaker2/helpers/InputHelper.java +++ b/src/main/java/modtweaker2/helpers/InputHelper.java @@ -41,16 +41,14 @@ public class InputHelper { public static IItemStack[] toStacks(IIngredient[] iIngredient) { ArrayList stacks = new ArrayList(); + for (IIngredient ing : iIngredient) { for (IItemStack stack : ing.getItems()) { stacks.add(stack); } } - IItemStack[] returnArray = new IItemStack[stacks.size()]; - for(int i = 0; i < returnArray.length;i++){ - returnArray[i] = stacks.get(i); - } - return returnArray; + + return stacks.toArray(new IItemStack[stacks.size()]); } public static boolean isABlock(ItemStack block) { @@ -62,11 +60,11 @@ public class InputHelper { } public static ItemStack toStack(IItemStack iStack) { - if (iStack == null) + if (iStack == null) { return null; - else { + } else { Object internal = iStack.getInternal(); - if (internal == null || !(internal instanceof ItemStack)) { + if (!(internal instanceof ItemStack)) { LogHelper.logError("Not a valid item stack: " + iStack); } @@ -79,8 +77,9 @@ public class InputHelper { } public static IIngredient toIngredient(FluidStack stack) { - if(stack == null) + if(stack == null) { return null; + } return new MCLiquidStack(stack); } @@ -102,9 +101,9 @@ public class InputHelper { } public static ItemStack[] toStacks(IItemStack[] iStack) { - if (iStack == null) + if (iStack == null) { return null; - else { + } else { ItemStack[] output = new ItemStack[iStack.length]; for (int i = 0; i < iStack.length; i++) { output[i] = toStack(iStack[i]); diff --git a/src/main/java/modtweaker2/helpers/ReflectionHelper.java b/src/main/java/modtweaker2/helpers/ReflectionHelper.java index d2a0a0b..73fb3c5 100644 --- a/src/main/java/modtweaker2/helpers/ReflectionHelper.java +++ b/src/main/java/modtweaker2/helpers/ReflectionHelper.java @@ -53,7 +53,7 @@ public class ReflectionHelper { Constructor constructor = clazz.getDeclaredConstructor(types); constructor.setAccessible(true); return constructor; - } catch (Exception ex) { LogHelper.logError("Exception getting constructore of " + clazz.getName(), ex); } + } catch (Exception ex) { LogHelper.logError("Exception getting constructor of " + clazz.getName(), ex); } return null; } @@ -73,7 +73,7 @@ public class ReflectionHelper { Field result = cls.getDeclaredField(field); result.setAccessible(true); return (T) result.get(object); - } catch (Exception ex) {} + } catch (Exception ex) { LogHelper.logError("Exception in getObject()", ex); } } LogHelper.logError("Could not retrieve any object for the provided field names."); @@ -99,7 +99,7 @@ public class ReflectionHelper { modifiersField.setAccessible(true); modifiersField.setInt(result, result.getModifiers() & ~Modifier.FINAL); return (T) result.get(object); - } catch (Exception ex) {} + } catch (Exception ex) { LogHelper.logError("Exception in getFinalObject()", ex); } } LogHelper.logError("Could not retrieve any final object for the provided field names."); @@ -120,7 +120,7 @@ public class ReflectionHelper { Field result = clazz.getDeclaredField(field); result.setAccessible(true); return (T) result.get(null); - } catch (Exception e) {} + } catch (Exception e) { LogHelper.logError("Exception in getStaticObject()", e); } } LogHelper.logError("Could not retrieve any static object for the provided field names."); @@ -138,7 +138,7 @@ public class ReflectionHelper { try { Class clazz = Class.forName(className); return getStaticObject(clazz, fieldNames); - } catch (ClassNotFoundException e) { } + } catch (ClassNotFoundException e) { LogHelper.logError("Exception in getStaticObject()", e); } LogHelper.logError("Could not retrieve any static object for the provided field names."); @@ -150,7 +150,7 @@ public class ReflectionHelper { Field f = cls.getDeclaredField(field); f.setAccessible(true); f.setInt(null, var); - } catch (Exception e) {} + } catch (Exception e) { LogHelper.logError("Exception in setPrivateValue()", e); } } @SuppressWarnings({ "rawtypes", "unchecked" }) diff --git a/src/main/java/modtweaker2/mods/mekanism/handlers/Infuser.java b/src/main/java/modtweaker2/mods/mekanism/handlers/Infuser.java index 61eab9c..a13d787 100644 --- a/src/main/java/modtweaker2/mods/mekanism/handlers/Infuser.java +++ b/src/main/java/modtweaker2/mods/mekanism/handlers/Infuser.java @@ -52,6 +52,7 @@ public class Infuser { ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// @SuppressWarnings({ "unchecked", "rawtypes" }) + @ZenMethod public static void removeRecipe(IIngredient itemOutput, @Optional IIngredient itemInput, @Optional String infuseType) { if(itemOutput == null) { LogHelper.logError(String.format("Required parameters missing for %s Recipe.", name)); diff --git a/src/main/java/modtweaker2/mods/thaumcraft/ThaumcraftHelper.java b/src/main/java/modtweaker2/mods/thaumcraft/ThaumcraftHelper.java index ae9d160..90d21dc 100644 --- a/src/main/java/modtweaker2/mods/thaumcraft/ThaumcraftHelper.java +++ b/src/main/java/modtweaker2/mods/thaumcraft/ThaumcraftHelper.java @@ -12,12 +12,10 @@ import thaumcraft.api.aspects.AspectList; import thaumcraft.api.research.ResearchCategories; public class ThaumcraftHelper { - public static ArrayList recipes = null; public static HashMap warpList; static { try { - recipes = ReflectionHelper.getStaticObject(ThaumcraftApi.class, "recipes"); warpList = ReflectionHelper.getStaticObject(ThaumcraftApi.class, "warpMap"); } catch (Exception e) {} }