diff options
Diffstat (limited to 'src')
40 files changed, 447 insertions, 273 deletions
diff --git a/src/Java/gregtech/api/util/CustomRecipeMap.java b/src/Java/gregtech/api/util/CustomRecipeMap.java index d2149bd332..3a0f1724b0 100644 --- a/src/Java/gregtech/api/util/CustomRecipeMap.java +++ b/src/Java/gregtech/api/util/CustomRecipeMap.java @@ -7,6 +7,7 @@ import java.util.*; import gregtech.api.GregTech_API; import gregtech.api.interfaces.tileentity.IHasWorldObjectAndCoords; import gregtech.api.objects.GT_ItemStack; +import gtPlusPlus.core.util.Utils; import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidStack; @@ -19,7 +20,7 @@ public class CustomRecipeMap/* extends GT_Recipe_Map*/{ //public static final CustomRecipeMap sOreWasherRecipes = new GT_Recipe_Map_OreWasher(new HashSet<GT_Recipe>(0), "ic.recipe.orewasher", "Ore Washer", "ic2.blockOreWashingPlant", RES_PATH_GUI + "basicmachines/OreWasher", 1, 3, 1, 1, 1, E, 1, E, true, false); //Fission Fuel Plant Recipes - public static final CustomRecipeMap sFissionFuelProcessing = new CustomRecipeMap(new HashSet<GT_Recipe>(50), "gt.recipe.fissionfuel", "Fission Fuel Processing", null, RES_PATH_GUI + "basicmachines/FissionFuel", 0, 0, 0, 9, 1, E, 1, E, true, true); + public static final CustomRecipeMap sFissionFuelProcessing = new CustomRecipeMap(new HashSet<GT_Recipe>(50), "gt.recipe.fissionfuel", "Fission Fuel Processing", null, RES_PATH_GUI + "basicmachines/FissionFuel", 0, 0, 0, 4, 1, E, 1, E, true, true); /** * HashMap of Recipes based on their Items @@ -205,6 +206,7 @@ public class CustomRecipeMap/* extends GT_Recipe_Map*/{ public GT_Recipe findRecipe(final IHasWorldObjectAndCoords aTileEntity, final GT_Recipe aRecipe, final boolean aNotUnificated, final long aVoltage, final FluidStack[] aFluids, final ItemStack aSpecialSlot, ItemStack... aInputs) { // No Recipes? Well, nothing to be found then. if (this.mRecipeList.isEmpty()) { + Utils.LOG_INFO("BAD RECIPE"); return null; } @@ -213,6 +215,7 @@ public class CustomRecipeMap/* extends GT_Recipe_Map*/{ if (GregTech_API.sPostloadFinished) { if (this.mMinimalInputFluids > 0) { if (aFluids == null) { + Utils.LOG_INFO("BAD RECIPE [1]"); return null; } int tAmount = 0; @@ -222,11 +225,13 @@ public class CustomRecipeMap/* extends GT_Recipe_Map*/{ } } if (tAmount < this.mMinimalInputFluids) { + Utils.LOG_INFO("BAD RECIPE [2]"); return null; } } if (this.mMinimalInputItems > 0) { if (aInputs == null) { + Utils.LOG_INFO("BAD RECIPE [3]"); return null; } int tAmount = 0; @@ -236,6 +241,7 @@ public class CustomRecipeMap/* extends GT_Recipe_Map*/{ } } if (tAmount < this.mMinimalInputItems) { + Utils.LOG_INFO("BAD RECIPE [4]"); return null; } } @@ -296,6 +302,7 @@ public class CustomRecipeMap/* extends GT_Recipe_Map*/{ } // And nothing has been found. + Utils.LOG_INFO("BAD RECIPE [5]"); return null; } diff --git a/src/Java/gregtech/api/util/Recipe_GT.java b/src/Java/gregtech/api/util/Recipe_GT.java index fbd5d9eb4f..36a056f0c0 100644 --- a/src/Java/gregtech/api/util/Recipe_GT.java +++ b/src/Java/gregtech/api/util/Recipe_GT.java @@ -254,7 +254,7 @@ public class Recipe_GT extends GT_Recipe{ //RTG Fuel Map public static final GT_Recipe.GT_Recipe_Map_Fuel sRTGFuels = new Recipe_GT.GT_Recipe_Map_Fuel( - new HashSet(10), "gt.recipe.RTGgenerators", "RTG", null, + new HashSet<GT_Recipe>(10), "gt.recipe.RTGgenerators", "RTG", null, "gregtech:textures/gui/basicmachines/Default", 1, 1, 0, 0, 1, "Fuel Value: ", 365, " Minecraft Days", true, true); //Thermal Boiler map diff --git a/src/Java/gtPlusPlus/core/gui/beta/Gui_ID_Registry.java b/src/Java/gtPlusPlus/core/gui/beta/Gui_ID_Registry.java index cf1811781a..10c09390d9 100644 --- a/src/Java/gtPlusPlus/core/gui/beta/Gui_ID_Registry.java +++ b/src/Java/gtPlusPlus/core/gui/beta/Gui_ID_Registry.java @@ -6,8 +6,8 @@ import gtPlusPlus.core.interfaces.IGuiManagerMiscUtils; public class Gui_ID_Registry { - private static final Map<Class<? extends IGuiManagerMiscUtils>, MU_GuiId> classMap = new HashMap(); - private static final Map<Integer, MU_GuiId> idMap = new HashMap(); + private static final Map<Class<? extends IGuiManagerMiscUtils>, MU_GuiId> classMap = new HashMap<Class<? extends IGuiManagerMiscUtils>, MU_GuiId>(); + private static final Map<Integer, MU_GuiId> idMap = new HashMap<Integer, MU_GuiId>(); private static int nextId = 0; static @@ -33,7 +33,7 @@ public class Gui_ID_Registry MU_GuiId guiId = classMap.get(guiHandlerClass); if (guiId == null) { for (final Map.Entry<Class<? extends IGuiManagerMiscUtils>, MU_GuiId> classGuiIdEntry : classMap.entrySet()) { - if (((Class)classGuiIdEntry.getKey()).isAssignableFrom(guiHandlerClass)) + if (((Class<?>)classGuiIdEntry.getKey()).isAssignableFrom(guiHandlerClass)) { guiId = classGuiIdEntry.getValue(); break; diff --git a/src/Java/gtPlusPlus/core/handler/workbench/Workbench_CraftingHandler.java b/src/Java/gtPlusPlus/core/handler/workbench/Workbench_CraftingHandler.java index 289446eb07..951f69723c 100644 --- a/src/Java/gtPlusPlus/core/handler/workbench/Workbench_CraftingHandler.java +++ b/src/Java/gtPlusPlus/core/handler/workbench/Workbench_CraftingHandler.java @@ -14,7 +14,7 @@ import net.minecraft.world.World; public class Workbench_CraftingHandler { private static final Workbench_CraftingHandler instance = new Workbench_CraftingHandler(); - private final List recipes = new ArrayList(); + private final List<IRecipe> recipes = new ArrayList<IRecipe>(); public static final Workbench_CraftingHandler getInstance() { return instance; @@ -66,7 +66,7 @@ public class Workbench_CraftingHandler { } } - final HashMap hashmap = new HashMap(); + final HashMap<Character, ItemStack> hashmap = new HashMap<Character, ItemStack>(); for (; i < par2ArrayOfObj.length; i += 2) { @@ -110,7 +110,7 @@ public class Workbench_CraftingHandler { public void addShapelessRecipe(final ItemStack par1ItemStack, final Object par2ArrayOfObj[]) { - final ArrayList arraylist = new ArrayList(); + final ArrayList<ItemStack> arraylist = new ArrayList<ItemStack>(); final Object aobj[] = par2ArrayOfObj; final int i = aobj.length; @@ -146,9 +146,6 @@ public class Workbench_CraftingHandler { public ItemStack findMatchingRecipe(final InventoryCrafting par1InventoryCrafting, final World par2World) { int i = 0; - ItemStack itemstack = null; - ItemStack itemstack1 = null; - for (int j = 0; j < par1InventoryCrafting.getSizeInventory(); j++) { final ItemStack itemstack2 = par1InventoryCrafting.getStackInSlot(j); @@ -160,12 +157,10 @@ public class Workbench_CraftingHandler { if (i == 0) { - itemstack = itemstack2; } if (i == 1) { - itemstack1 = itemstack2; } i++; @@ -202,7 +197,7 @@ public class Workbench_CraftingHandler { } - public List getRecipeList() + public List<IRecipe> getRecipeList() { return this.recipes; } diff --git a/src/Java/gtPlusPlus/core/handler/workbench/Workbench_RecipeSorter.java b/src/Java/gtPlusPlus/core/handler/workbench/Workbench_RecipeSorter.java index b68ae89e5c..92a7dd56d3 100644 --- a/src/Java/gtPlusPlus/core/handler/workbench/Workbench_RecipeSorter.java +++ b/src/Java/gtPlusPlus/core/handler/workbench/Workbench_RecipeSorter.java @@ -4,7 +4,7 @@ import java.util.Comparator; import net.minecraft.item.crafting.*; -public class Workbench_RecipeSorter implements Comparator +public class Workbench_RecipeSorter implements Comparator<Object> { final Workbench_CraftingHandler CraftingManagerCrafter; diff --git a/src/Java/gtPlusPlus/core/item/ModItems.java b/src/Java/gtPlusPlus/core/item/ModItems.java index ec32b0bb9f..30d85628b9 100644 --- a/src/Java/gtPlusPlus/core/item/ModItems.java +++ b/src/Java/gtPlusPlus/core/item/ModItems.java @@ -316,9 +316,6 @@ public final class ModItems { MaterialGenerator.generateNuclearMaterial(ELEMENT.getInstance().CALIFORNIUM, false); MaterialGenerator.generateNuclearMaterial(ELEMENT.getInstance().EINSTEINIUM, false); MaterialGenerator.generateNuclearMaterial(ELEMENT.getInstance().FERMIUM, false); - - - //Nuclear Isotopes @@ -354,6 +351,13 @@ public final class ModItems { MaterialGenerator.generate(ALLOY.TANTALUM_CARBIDE); MaterialGenerator.generate(ALLOY.NIOBIUM_CARBIDE); + //LFTR Fuel components + MaterialGenerator.generate(FLUORIDES.HYDROXIDE); //LFTR fuel component + MaterialGenerator.generate(FLUORIDES.AMMONIA); //LFTR fuel component + MaterialGenerator.generate(FLUORIDES.AMMONIUM); //LFTR fuel component + MaterialGenerator.generate(FLUORIDES.AMMONIUM_BIFLUORIDE); //LFTR fuel component + MaterialGenerator.generate(FLUORIDES.BERYLLIUM_HYDROXIDE); //LFTR fuel component + MaterialGenerator.generate(FLUORIDES.AMMONIUM_TETRAFLUOROBERYLLATE); //LFTR fuel component //Generate Fluorides MaterialGenerator.generateNuclearMaterial(FLUORIDES.FLUORITE); @@ -368,7 +372,7 @@ public final class ModItems { MaterialGenerator.generateNuclearMaterial(FLUORIDES.NEPTUNIUM_HEXAFLUORIDE); MaterialGenerator.generateNuclearMaterial(FLUORIDES.TECHNETIUM_HEXAFLUORIDE); MaterialGenerator.generateNuclearMaterial(FLUORIDES.SELENIUM_HEXAFLUORIDE); - + //Generate Reactor Fuel Salts MaterialGenerator.generateNuclearMaterial(NUCLIDE.LiFBeF2ZrF4U235); MaterialGenerator.generateNuclearMaterial(NUCLIDE.LiFBeF2ZrF4UF4); @@ -583,6 +587,7 @@ public final class ModItems { CoalTar.run(); //Misc Items + @SuppressWarnings("unused") Item tI; tI = new BaseItemMisc("Chilly", new short[]{0,64,196}, 32, MiscTypes.POTION, new String[]{"It's Blue"}); tI = new BaseItemMisc("4000DC's", new short[]{180,100,30}, 1, MiscTypes.BIGKEY, new String[]{"It opens things."}); @@ -700,7 +705,7 @@ public final class ModItems { RfEuBattery = new RF2EU_Battery(); //Baubles Mod Test - try {final Class baublesTest = Class.forName("baubles.api.IBauble"); + try {final Class<?> baublesTest = Class.forName("baubles.api.IBauble"); if (baublesTest != null){ COMPAT_Baubles.run(); } diff --git a/src/Java/gtPlusPlus/core/item/base/BaseItemBrain.java b/src/Java/gtPlusPlus/core/item/base/BaseItemBrain.java index 2521671223..815f3c49c0 100644 --- a/src/Java/gtPlusPlus/core/item/base/BaseItemBrain.java +++ b/src/Java/gtPlusPlus/core/item/base/BaseItemBrain.java @@ -56,7 +56,7 @@ public class BaseItemBrain extends Item{ // This is a fun method which allows us to run some code when our item is // shown in a creative tab. I am going to use it to add all the brain // types. - @SuppressWarnings("unchecked") + @SuppressWarnings({ "rawtypes", "unchecked" }) @Override @SideOnly(Side.CLIENT) public void getSubItems(final Item item, final CreativeTabs tab, final List itemList) @@ -84,7 +84,7 @@ public class BaseItemBrain extends Item{ } // This code will allow us to tell the items apart in game. You can change - @SuppressWarnings("unchecked") + @SuppressWarnings({ "rawtypes", "unchecked" }) // texture based on nbt data, but I won't be covering that. @Override @SideOnly(Side.CLIENT) diff --git a/src/Java/gtPlusPlus/core/item/base/BaseItemComponent.java b/src/Java/gtPlusPlus/core/item/base/BaseItemComponent.java index 35f1942040..26860ebad3 100644 --- a/src/Java/gtPlusPlus/core/item/base/BaseItemComponent.java +++ b/src/Java/gtPlusPlus/core/item/base/BaseItemComponent.java @@ -189,7 +189,7 @@ public class BaseItemComponent extends Item{ if (this.componentMaterial != null){ if (entityHolding instanceof EntityPlayer){ if (!((EntityPlayer) entityHolding).capabilities.isCreativeMode){ - EntityUtils.applyRadiationDamageToEntity(this.componentMaterial.vRadiationLevel, world, entityHolding); + EntityUtils.applyRadiationDamageToEntity(iStack.stackSize, this.componentMaterial.vRadiationLevel, world, entityHolding); } } } diff --git a/src/Java/gtPlusPlus/core/item/base/BaseItemWithCharge.java b/src/Java/gtPlusPlus/core/item/base/BaseItemWithCharge.java index 38c0ee567f..33d7602b4e 100644 --- a/src/Java/gtPlusPlus/core/item/base/BaseItemWithCharge.java +++ b/src/Java/gtPlusPlus/core/item/base/BaseItemWithCharge.java @@ -26,6 +26,7 @@ public class BaseItemWithCharge extends Item{ this.int_Max_Charge = constructor_Max_Charge; } + @SuppressWarnings({ "rawtypes", "unchecked" }) @Override public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) { int NBT_Charge = this.int_Charge; diff --git a/src/Java/gtPlusPlus/core/item/base/BasicSpawnEgg.java b/src/Java/gtPlusPlus/core/item/base/BasicSpawnEgg.java index f856185cdb..4bff33493e 100644 --- a/src/Java/gtPlusPlus/core/item/base/BasicSpawnEgg.java +++ b/src/Java/gtPlusPlus/core/item/base/BasicSpawnEgg.java @@ -185,6 +185,7 @@ public class BasicSpawnEgg extends ItemMonsterPlacer /** * returns a list of items with the same ID, but different meta (eg: dye returns 16 items) */ + @SuppressWarnings({ "rawtypes", "unchecked" }) @Override @SideOnly(Side.CLIENT) public void getSubItems(final Item parItem, final CreativeTabs parTab, final List parList){ diff --git a/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDust.java b/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDust.java index adc9f8a62a..d22e606e78 100644 --- a/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDust.java +++ b/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDust.java @@ -112,7 +112,7 @@ public class BaseItemDust extends Item{ protected final int sRadiation; @Override public void onUpdate(final ItemStack iStack, final World world, final Entity entityHolding, final int p_77663_4_, final boolean p_77663_5_) { - EntityUtils.applyRadiationDamageToEntity(this.sRadiation, world, entityHolding); + EntityUtils.applyRadiationDamageToEntity(iStack.stackSize, this.sRadiation, world, entityHolding); } @SuppressWarnings({ "unchecked", "rawtypes" }) diff --git a/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDustUnique.java b/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDustUnique.java index 5eae18f2b1..4771e15258 100644 --- a/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDustUnique.java +++ b/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDustUnique.java @@ -9,14 +9,11 @@ import gregtech.api.util.GT_OreDictUnificator; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.util.StringUtils; import gtPlusPlus.core.util.Utils; -import gtPlusPlus.core.util.entity.EntityUtils; import gtPlusPlus.core.util.item.ItemUtils; import gtPlusPlus.core.util.math.MathUtils; -import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -import net.minecraft.world.World; public class BaseItemDustUnique extends Item{ @@ -97,11 +94,8 @@ public class BaseItemDustUnique extends Item{ } protected final int sRadiation; - @Override - public void onUpdate(final ItemStack iStack, final World world, final Entity entityHolding, final int p_77663_4_, final boolean p_77663_5_) { - EntityUtils.applyRadiationDamageToEntity(this.sRadiation, world, entityHolding); - } + @SuppressWarnings({ "rawtypes", "unchecked" }) @Override public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) { if (this.sRadiation > 0){ diff --git a/src/Java/gtPlusPlus/core/item/base/dusts/decimal/BaseItemCentidust.java b/src/Java/gtPlusPlus/core/item/base/dusts/decimal/BaseItemCentidust.java index 981e78a563..aff5431e9d 100644 --- a/src/Java/gtPlusPlus/core/item/base/dusts/decimal/BaseItemCentidust.java +++ b/src/Java/gtPlusPlus/core/item/base/dusts/decimal/BaseItemCentidust.java @@ -35,6 +35,7 @@ public class BaseItemCentidust extends Item{ return (this.materialName+ " Centidust"); } + @SuppressWarnings({ "rawtypes", "unchecked" }) @Override public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) { if ((this.materialName != null) && (this.materialName != "") && !this.materialName.equals("")){ diff --git a/src/Java/gtPlusPlus/core/item/base/dusts/decimal/BaseItemDecidust.java b/src/Java/gtPlusPlus/core/item/base/dusts/decimal/BaseItemDecidust.java index 1db3520136..ce68c36d96 100644 --- a/src/Java/gtPlusPlus/core/item/base/dusts/decimal/BaseItemDecidust.java +++ b/src/Java/gtPlusPlus/core/item/base/dusts/decimal/BaseItemDecidust.java @@ -35,6 +35,7 @@ public class BaseItemDecidust extends Item{ return (this.materialName+ " Decidust"); } + @SuppressWarnings({ "rawtypes", "unchecked" }) @Override public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) { if ((this.materialName != null) && (this.materialName != "") && !this.materialName.equals("")){ diff --git a/src/Java/gtPlusPlus/core/item/base/foods/BaseItemHotFood.java b/src/Java/gtPlusPlus/core/item/base/foods/BaseItemHotFood.java index 69be546843..0467d2647e 100644 --- a/src/Java/gtPlusPlus/core/item/base/foods/BaseItemHotFood.java +++ b/src/Java/gtPlusPlus/core/item/base/foods/BaseItemHotFood.java @@ -56,6 +56,7 @@ public class BaseItemHotFood extends BaseItemFood{ super.onUpdate(iStack, world, entityHolding, p_77663_4_, p_77663_5_); } + @SuppressWarnings({ "rawtypes", "unchecked" }) @Override public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) { if ((this.materialName != null) && (this.materialName != "") && !this.materialName.equals("")){ diff --git a/src/Java/gtPlusPlus/core/item/base/ingots/BaseItemIngot_OLD.java b/src/Java/gtPlusPlus/core/item/base/ingots/BaseItemIngot_OLD.java index 5d14660190..ca887937df 100644 --- a/src/Java/gtPlusPlus/core/item/base/ingots/BaseItemIngot_OLD.java +++ b/src/Java/gtPlusPlus/core/item/base/ingots/BaseItemIngot_OLD.java @@ -95,6 +95,6 @@ public class BaseItemIngot_OLD extends Item{ protected final int sRadiation; @Override public void onUpdate(final ItemStack iStack, final World world, final Entity entityHolding, final int p_77663_4_, final boolean p_77663_5_) { - EntityUtils.applyRadiationDamageToEntity(this.sRadiation, world, entityHolding); + EntityUtils.applyRadiationDamageToEntity(iStack.stackSize, this.sRadiation, world, entityHolding); } } diff --git a/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockGtBlock.java b/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockGtBlock.java index d7de10141f..b3478d33fe 100644 --- a/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockGtBlock.java +++ b/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockGtBlock.java @@ -63,7 +63,7 @@ public class ItemBlockGtBlock extends ItemBlock{ @Override public void onUpdate(final ItemStack iStack, final World world, final Entity entityHolding, final int p_77663_4_, final boolean p_77663_5_) { - EntityUtils.applyRadiationDamageToEntity(this.sRadiation, world, entityHolding); + EntityUtils.applyRadiationDamageToEntity(iStack.stackSize, this.sRadiation, world, entityHolding); } } diff --git a/src/Java/gtPlusPlus/core/item/base/plates/BaseItemPlate_OLD.java b/src/Java/gtPlusPlus/core/item/base/plates/BaseItemPlate_OLD.java index 0300a63848..326ecc7385 100644 --- a/src/Java/gtPlusPlus/core/item/base/plates/BaseItemPlate_OLD.java +++ b/src/Java/gtPlusPlus/core/item/base/plates/BaseItemPlate_OLD.java @@ -63,6 +63,6 @@ public class BaseItemPlate_OLD extends Item{ protected final int sRadiation; @Override public void onUpdate(final ItemStack iStack, final World world, final Entity entityHolding, final int p_77663_4_, final boolean p_77663_5_) { - EntityUtils.applyRadiationDamageToEntity(this.sRadiation, world, entityHolding); + EntityUtils.applyRadiationDamageToEntity(iStack.stackSize, this.sRadiation, world, entityHolding); } } diff --git a/src/Java/gtPlusPlus/core/material/Material.java b/src/Java/gtPlusPlus/core/material/Material.java index d4d306d5af..c25b818aa2 100644 --- a/src/Java/gtPlusPlus/core/material/Material.java +++ b/src/Java/gtPlusPlus/core/material/Material.java @@ -237,7 +237,11 @@ public class Material { } final Materials isValid = Materials.get(this.getLocalizedName()); - if (isValid == Materials._NULL){ + + if (FluidUtils.getFluidStack(localizedName, 1) != null){ + this.vMoltenFluid = FluidUtils.getFluidStack(localizedName, 1).getFluid(); + } + else if (isValid == Materials._NULL){ this.vMoltenFluid = this.generateFluid(); } else { diff --git a/src/Java/gtPlusPlus/core/material/MaterialGenerator.java b/src/Java/gtPlusPlus/core/material/MaterialGenerator.java index fd53a9be4d..00388c4a5c 100644 --- a/src/Java/gtPlusPlus/core/material/MaterialGenerator.java +++ b/src/Java/gtPlusPlus/core/material/MaterialGenerator.java @@ -17,7 +17,9 @@ import gtPlusPlus.core.item.base.rotors.BaseItemRotor; import gtPlusPlus.core.item.base.screws.BaseItemScrew; import gtPlusPlus.core.material.state.MaterialState; import gtPlusPlus.core.util.Utils; +import gtPlusPlus.core.util.fluid.FluidUtils; import gtPlusPlus.core.util.item.ItemUtils; +import gtPlusPlus.xmod.gregtech.api.enums.GregtechOrePrefixes.GT_Materials; import gtPlusPlus.xmod.gregtech.loaders.*; import net.minecraft.block.Block; import net.minecraft.item.Item; @@ -33,64 +35,78 @@ public class MaterialGenerator { generate(matInfo, generateEverything, true); } - public static void generate(final Material matInfo, final boolean generateEverything, final boolean generateBlastSmelterRecipes){ - final String unlocalizedName = matInfo.getUnlocalizedName(); - final String materialName = matInfo.getLocalizedName(); - final short[] C = matInfo.getRGBA(); - final int Colour = Utils.rgbtoHexValue(C[0], C[1], C[2]); - final boolean hotIngot = matInfo.requiresBlastFurnace(); - int materialTier = matInfo.vTier; //TODO - - if ((materialTier > 10) || (materialTier <= 0)){ - materialTier = 2; - } - - int sRadiation = 0; - if (ItemUtils.isRadioactive(materialName) || matInfo.vRadiationLevel != 0){ - sRadiation = matInfo.vRadiationLevel; - } + public static boolean generate(final Material matInfo, final boolean generateEverything, final boolean generateBlastSmelterRecipes){ + try { + final String unlocalizedName = matInfo.getUnlocalizedName(); + final String materialName = matInfo.getLocalizedName(); + final short[] C = matInfo.getRGBA(); + final int Colour = Utils.rgbtoHexValue(C[0], C[1], C[2]); + final boolean hotIngot = matInfo.requiresBlastFurnace(); + int materialTier = matInfo.vTier; //TODO + + if ((materialTier > 10) || (materialTier <= 0)){ + materialTier = 2; + } - if (matInfo.getState() == MaterialState.SOLID){ - if (generateEverything == true){ - if (sRadiation >= 1){ - Item temp; - Block tempBlock; - tempBlock = new BlockBaseModular(unlocalizedName, materialName,BlockTypes.STANDARD, Colour); - temp = new BaseItemIngot(matInfo); + int sRadiation = 0; + if (ItemUtils.isRadioactive(materialName) || matInfo.vRadiationLevel != 0){ + sRadiation = matInfo.vRadiationLevel; + } - temp = new BaseItemDust("itemDust"+unlocalizedName, materialName, matInfo, Colour, "Dust", materialTier, sRadiation); - temp = new BaseItemDust("itemDustTiny"+unlocalizedName, materialName, matInfo, Colour, "Tiny", materialTier, sRadiation); - temp = new BaseItemDust("itemDustSmall"+unlocalizedName, materialName, matInfo, Colour, "Small", materialTier, sRadiation); - temp = new BaseItemNugget(matInfo); - temp = new BaseItemPlate(matInfo); - temp = new BaseItemRod(matInfo); - temp = new BaseItemRodLong(matInfo); - } + if (matInfo.getState() == MaterialState.SOLID){ + if (generateEverything == true){ + if (sRadiation >= 1){ + Item temp; + Block tempBlock; + tempBlock = new BlockBaseModular(unlocalizedName, materialName,BlockTypes.STANDARD, Colour); + temp = new BaseItemIngot(matInfo); + + temp = new BaseItemDust("itemDust"+unlocalizedName, materialName, matInfo, Colour, "Dust", materialTier, sRadiation); + temp = new BaseItemDust("itemDustTiny"+unlocalizedName, materialName, matInfo, Colour, "Tiny", materialTier, sRadiation); + temp = new BaseItemDust("itemDustSmall"+unlocalizedName, materialName, matInfo, Colour, "Small", materialTier, sRadiation); + temp = new BaseItemNugget(matInfo); |
