diff options
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); + temp = new BaseItemPlate(matInfo); + temp = new BaseItemRod(matInfo); + temp = new BaseItemRodLong(matInfo); + } - else { + else { + Item temp; + Block tempBlock; + tempBlock = new BlockBaseModular(unlocalizedName, materialName,BlockTypes.STANDARD, Colour); + tempBlock = new BlockBaseModular(unlocalizedName, materialName,BlockTypes.FRAME, Colour); + temp = new BaseItemIngot(matInfo); + if (hotIngot){ + temp = new BaseItemIngotHot(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); + temp = new BaseItemPlate(matInfo); + temp = new BaseItemPlateDouble(matInfo); + temp = new BaseItemBolt(matInfo); + temp = new BaseItemRod(matInfo); + temp = new BaseItemRodLong(matInfo); + temp = new BaseItemRing(matInfo); + temp = new BaseItemScrew(matInfo); + temp = new BaseItemRotor(matInfo); + temp = new BaseItemGear(matInfo); + } + } else { Item temp; Block tempBlock; tempBlock = new BlockBaseModular(unlocalizedName, materialName,BlockTypes.STANDARD, Colour); - tempBlock = new BlockBaseModular(unlocalizedName, materialName,BlockTypes.FRAME, Colour); temp = new BaseItemIngot(matInfo); - if (hotIngot){ - temp = new BaseItemIngotHot(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); temp = new BaseItemPlate(matInfo); temp = new BaseItemPlateDouble(matInfo); - temp = new BaseItemBolt(matInfo); - temp = new BaseItemRod(matInfo); - temp = new BaseItemRodLong(matInfo); - temp = new BaseItemRing(matInfo); - temp = new BaseItemScrew(matInfo); - temp = new BaseItemRotor(matInfo); - temp = new BaseItemGear(matInfo); } - } else { + } + else if (matInfo.getState() == MaterialState.LIQUID){ Item temp; Block tempBlock; tempBlock = new BlockBaseModular(unlocalizedName, materialName,BlockTypes.STANDARD, Colour); @@ -101,33 +117,29 @@ public class MaterialGenerator { temp = new BaseItemNugget(matInfo); temp = new BaseItemPlate(matInfo); temp = new BaseItemPlateDouble(matInfo); + } + else if (matInfo.getState() == MaterialState.PURE_LIQUID){ + FluidUtils.generateFluidNoPrefix(unlocalizedName, materialName, matInfo.getMeltingPointK(), C); + return true; } - } - else if (matInfo.getState() == MaterialState.LIQUID){ - 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); - temp = new BaseItemPlate(matInfo); - temp = new BaseItemPlateDouble(matInfo); - } - - //Add A jillion Recipes - old code - RecipeGen_AlloySmelter.generateRecipes(matInfo); - RecipeGen_Assembler.generateRecipes(matInfo); - RecipeGen_BlastSmelter.generateARecipe(matInfo); - RecipeGen_DustGeneration.generateRecipes(matInfo); - RecipeGen_Extruder.generateRecipes(matInfo); - RecipeGen_Fluids.generateRecipes(matInfo); - RecipeGen_Plates.generateRecipes(matInfo); - RecipeGen_ShapedCrafting.generateRecipes(matInfo); + //Add A jillion Recipes - old code + RecipeGen_AlloySmelter.generateRecipes(matInfo); + RecipeGen_Assembler.generateRecipes(matInfo); + RecipeGen_BlastSmelter.generateARecipe(matInfo); + RecipeGen_DustGeneration.generateRecipes(matInfo); + RecipeGen_Extruder.generateRecipes(matInfo); + RecipeGen_Fluids.generateRecipes(matInfo); + RecipeGen_Plates.generateRecipes(matInfo); + RecipeGen_ShapedCrafting.generateRecipes(matInfo); + return true; + } catch (Throwable t) + { + Utils.LOG_INFO(""+matInfo.getLocalizedName()+" failed to generate."); + return false; + } } - + public static void generateDusts(final Material matInfo){ final String unlocalizedName = matInfo.getUnlocalizedName(); final String materialName = matInfo.getLocalizedName(); @@ -145,23 +157,24 @@ public class MaterialGenerator { } if (matInfo.getState() == MaterialState.SOLID){ - Item temp; - temp = new BaseItemDust("itemDust"+unlocalizedName, materialName, matInfo, Colour, "Dust", materialTier, sRadiation, false); - temp = new BaseItemDust("itemDustTiny"+unlocalizedName, materialName, matInfo, Colour, "Tiny", materialTier, sRadiation, false); - temp = new BaseItemDust("itemDustSmall"+unlocalizedName, materialName, matInfo, Colour, "Small", materialTier, sRadiation, false); + Item temp; + temp = new BaseItemDust("itemDust"+unlocalizedName, materialName, matInfo, Colour, "Dust", materialTier, sRadiation, false); + temp = new BaseItemDust("itemDustTiny"+unlocalizedName, materialName, matInfo, Colour, "Tiny", materialTier, sRadiation, false); + temp = new BaseItemDust("itemDustSmall"+unlocalizedName, materialName, matInfo, Colour, "Small", materialTier, sRadiation, false); } //Add A jillion Recipes - old code RecipeGen_DustGeneration.addMixerRecipe_Standalone(matInfo); RecipeGen_Fluids.generateRecipes(matInfo); } - + public static void generateNuclearMaterial(final Material matInfo){ generateNuclearMaterial(matInfo, true); } @SuppressWarnings("unused") public static void generateNuclearMaterial(final Material matInfo, final boolean generatePlates){ + try { final String unlocalizedName = matInfo.getUnlocalizedName(); final String materialName = matInfo.getLocalizedName(); final short[] C = matInfo.getRGBA(); @@ -190,6 +203,9 @@ public class MaterialGenerator { RecipeGen_Fluids.generateRecipes(matInfo); RecipeGen_Assembler.generateRecipes(matInfo); RecipeGen_DustGeneration.generateRecipes(matInfo, true); + } catch (Throwable t){ + Utils.LOG_INFO(""+matInfo.getLocalizedName()+" failed to generate."); + } } diff --git a/src/Java/gtPlusPlus/core/material/nuclear/FLUORIDES.java b/src/Java/gtPlusPlus/core/material/nuclear/FLUORIDES.java index e4576eea7b..87830ab493 100644 --- a/src/Java/gtPlusPlus/core/material/nuclear/FLUORIDES.java +++ b/src/Java/gtPlusPlus/core/material/nuclear/FLUORIDES.java @@ -106,11 +106,11 @@ public class FLUORIDES { public static final Material BERYLLIUM_FLUORIDE = new Material( "Beryllium Fluoride", //Material Name MaterialState.LIQUID, //State - new short[]{120, 180, 120, 0}, //Material Colour - Materials.Beryllium.mMeltingPoint, //Melting Point in C - Materials.Beryllium.mBlastFurnaceTemp, //Boiling Point in C - ((ELEMENT.getInstance().BERYLLIUM.getProtons()+(ELEMENT.getInstance().FLUORINE.getProtons()*2))/3), //Protons - ((ELEMENT.getInstance().BERYLLIUM.getNeutrons()+(ELEMENT.getInstance().FLUORINE.getNeutrons()*2))/3), //Neutrons + new short[]{120, 210, 120, 0}, //Material Colour + -1, + -1, + -1, + -1, false, //Uses Blast furnace? //Material Stacks with Percentage of required elements. new MaterialStack[]{ @@ -134,9 +134,102 @@ public class FLUORIDES { }); + //LFTR sub components + + public static final Material HYDROXIDE = new Material( + "Hydroxide", //Material Name + MaterialState.PURE_LIQUID, //State + new short[]{240, 220, 240, 0}, //Material Colour + -1, //Melting Point in C + -1, //Boiling Point in C + -1, //Protons + -1, + false, //Uses Blast furnace? + //Material Stacks with Percentage of required elements. + new MaterialStack[]{ + new MaterialStack(ELEMENT.getInstance().OXYGEN, 1), + new MaterialStack(ELEMENT.getInstance().HYDROGEN, 1) + }); + + public static final Material AMMONIA = new Material( + "Ammonia", //Material Name + MaterialState.PURE_LIQUID, //State + new short[]{240, 220, 240, 0}, //Material Colour + -77, //Melting Point in C + -33, //Boiling Point in C + -1, //Protons + -1, + false, //Uses Blast furnace? + //Material Stacks with Percentage of required elements. + new MaterialStack[]{ + new MaterialStack(ELEMENT.getInstance().NITROGEN, 1), + new MaterialStack(ELEMENT.getInstance().HYDROGEN, 3) + }); + + public static final Material AMMONIUM = new Material( + "Ammonium", //Material Name + MaterialState.PURE_LIQUID, //State + new short[]{240, 220, 240, 0}, //Material Colour + -1, //Melting Point in C + -1, //Boiling Point in C + -1, //Protons + -1, + false, //Uses Blast furnace? + //Material Stacks with Percentage of required elements. + new MaterialStack[]{ + new MaterialStack(ELEMENT.getInstance().NITROGEN, 1), + new MaterialStack(ELEMENT.getInstance().HYDROGEN, 4) + }); + + public static final Material AMMONIUM_BIFLUORIDE = new Material( + "Ammonium Bifluoride", //Material Name + MaterialState.PURE_LIQUID, //State + new short[]{240, 220, 240, 0}, //Material Colour + 126, //Melting Point in C + 240, //Boiling Point in C + -1, //Protons + -1, + false, //Uses Blast furnace? + //Material Stacks with Percentage of required elements. + new MaterialStack[]{ + new MaterialStack(FLUORIDES.AMMONIUM, 1), + new MaterialStack(ELEMENT.getInstance().HYDROGEN, 1), + new MaterialStack(ELEMENT.getInstance().FLUORINE, 2) + }); + + public static final Material BERYLLIUM_HYDROXIDE = new Material( + "Beryllium Hydroxide", //Material Name + MaterialState.PURE_LIQUID, //State + new short[]{180, 250, 180, 0}, //Material Colour + 1000, //Melting Point in C + -1, //Boiling Point in C + -1, + -1, + false, //Uses Blast furnace? + //Material Stacks with Percentage of required elements. + new MaterialStack[]{ + new MaterialStack(ELEMENT.getInstance().BERYLLIUM, 1), + new MaterialStack(FLUORIDES.HYDROXIDE, 2) + }); + + public static final Material AMMONIUM_TETRAFLUOROBERYLLATE = new Material( + "Ammonium Tetrafluoroberyllate", //Material Name + MaterialState.PURE_LIQUID, //State + new short[]{140, 220, 140, 0}, //Material Colour + 280, //Melting Point in C + -1, //Boiling Point in C + -1, //Protons + -1, + false, //Uses Blast furnace? + //Material Stacks with Percentage of required elements. + new MaterialStack[]{ + new MaterialStack(FLUORIDES.AMMONIUM, 2), + new MaterialStack(FLUORIDES.BERYLLIUM_HYDROXIDE, 1) + }); + + + //LFTR Output - - public static final Material NEPTUNIUM_HEXAFLUORIDE = new Material( "Neptunium Hexafluoride", //Material Name MaterialState.GAS, //State diff --git a/src/Java/gtPlusPlus/core/material/state/MaterialState.java b/src/Java/gtPlusPlus/core/material/state/MaterialState.java index 200e80e8ab..88447395db 100644 --- a/src/Java/gtPlusPlus/core/material/state/MaterialState.java +++ b/src/Java/gtPlusPlus/core/material/state/MaterialState.java @@ -4,7 +4,8 @@ public enum MaterialState { SOLID(0), LIQUID(1), GAS(2), - PLASMA(3); + PLASMA(3), + PURE_LIQUID(4); private int STATE; private MaterialState (final int State){ this.STATE = State; diff --git a/src/Java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java b/src/Java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java index c706acdbd0..6c604b338d 100644 --- a/src/Java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java +++ b/src/Java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java @@ -280,7 +280,7 @@ public class RECIPES_GREGTECH { }catch (final NullPointerException e){Utils.LOG_INFO("FAILED TO LOAD RECIPES - NULL POINTER SOMEWHERE");} - //CaF2 + H2SO4 → CaSO4(solid) + 2 HF + //CaF2 + H2SO4 → CaSO4(solid) + 2 HF try { CORE.RA.addDehydratorRecipe( @@ -303,6 +303,26 @@ public class RECIPES_GREGTECH { 230); //EU }catch (final NullPointerException e){Utils.LOG_INFO("FAILED TO LOAD RECIPES - NULL POINTER SOMEWHERE");} + + //(NH4)2BeF4 → 2 NH3 + 2 HF + BeF2 + try { + CORE.RA.addDehydratorRecipe( + new ItemStack[]{ + ItemUtils.getItemStackOfAmountFromOreDict("cellEmpty", 5) + }, //Item input (Array, up to 2) + FluidUtils.getFluidStack("ammoniumtetrafluoroberyllate", 5000), //Fluid input (slot 1) + null, //Fluid output (slot 2) + new ItemStack[]{ + ItemUtils.getItemStackOfAmountFromOreDict("cellAmmonia", 2), + ItemUtils.getItemStackOfAmountFromOreDict("cellHydrofluoricAcid", 2), + ItemUtils.getItemStackOfAmountFromOreDict("cellBerylliumFluoride", 1) + }, //Output Array of Items - Upto 9, + new int[]{0, 0, 0}, + 5*60*20, //Time in ticks + 120); //EU + + }catch (final NullPointerException e){Utils.LOG_INFO("FAILED TO LOAD RECIPES - NULL POINTER SOMEWHERE");} + } } @@ -370,7 +390,7 @@ public class RECIPES_GREGTECH { FluidUtils.getFluidStack(LiFBeF2ZrF4UF4, 10000), //Output Fluid 1 null, //Output Fluid 2 60*60*20, //Duration - 4740); + 500); //7LiF - BeF2 - ZrF4 - U235 - 590C CORE.RA.addFissionFuel( @@ -382,7 +402,7 @@ public class RECIPES_GREGTECH { FluidUtils.getFluidStack(LiFBeF2ZrF4U235, 10000), //Output Fluid 1 null, //Output Fluid 2 45*60*20, //Duration - 4740); + 500); //7liF - BeF2 - ThF4 - UF4 - 566C CORE.RA.addFissionFuel( @@ -394,7 +414,7 @@ public class RECIPES_GREGTECH { FluidUtils.getFluidStack(LiFBeF2ThF4UF4, 10000), //Output Fluid 1 null, //Output Fluid 2 60*60*20, //Duration - 4740); + 500); }catch (final NullPointerException e){Utils.LOG_INFO("FAILED TO LOAD RECIPES - NULL POINTER SOMEWHERE");} } @@ -466,7 +486,7 @@ public class RECIPES_GREGTECH { ItemUtils.getItemStackOfAmountFromOreDict("nuggetTantalum", 1), ItemUtils.getItemStackOfAmountFromOreDict("dustSmallTungstate", 1), ItemUtils.getSimpleStack(Blocks.obsidian) - }, + }, new int[]{2000, 1000, 250, 250, 250, 250, 500}, 0); @@ -576,8 +596,61 @@ public class RECIPES_GREGTECH { ItemUtils.getItemStackOfAmountFromOreDict("dustLithium7", 16), FluidUtils.getFluidStack("water", 1000), FluidUtils.getFluidStack("lithiumhydroxide", 144*4), - null, + ItemUtils.getItemStackOfAmountFromOreDict("cellEmpty", 1), 300*20); + + + + //LFTR Fuel Related Compounds + + //Hydroxide + GT_Values.RA.addChemicalRecipe( + ItemUtils.getItemStackOfAmountFromOreDict("cellOxygen", 1), + ItemUtils.getItemStackOfAmountFromOreDict("cellHydrogen", 1), + GT_Values.NF, + FluidUtils.getFluidStack("hydroxide", 2000), + ItemUtils.getItemStackOfAmountFromOreDict("cellEmpty", 2), + 8*20); + //Ammonia + GT_Values.RA.addChemicalRecipe( + ItemUtils.getItemStackOfAmountFromOreDict("cellHydrogen", 1), + ItemUtils.getItemStackOfAmountFromOreDict("dustMagnetite", 0), + FluidUtils.getFluidStack("nitrogen", 1000), + FluidUtils.getFluidStack("ammonia", 2000), + ItemUtils.getItemStackOfAmountFromOreDict("cellEmpty", 1), + 14*20); + //Ammonium + GT_Values.RA.addChemicalRecipe( + ItemUtils.getItemStackOfAmountFromOreDict("cellAmmonia", 1), + ItemUtils.getItemStackOfAmountFromOreDict("cellHydrogen", 1), + GT_Values.NF, + FluidUtils.getFluidStack("ammonium", 2000), + ItemUtils.getItemStackOfAmountFromOreDict("cellEmpty", 2), + 20*20); + //Ammonium Bifluoride + GT_Values.RA.addChemicalRecipe( + ItemUtils.getItemStackOfAmountFromOreDict("cellHydrofluoricAcid", 1), + GT_Values.NI, + FluidUtils.getFluidStack("ammonium", 1000), + FluidUtils.getFluidStack("ammoniumbifluoride", 2000), + ItemUtils.getItemStackOfAmountFromOreDict("cellEmpty", 1), + 26*20); + //Beryllium Hydroxide + GT_Values.RA.addChemicalRecipe( + ItemUtils.getItemStackOfAmountFromOreDict("dustBeryllium", 7), + GT_Values.NI, + FluidUtils.getFluidStack("hydroxide", 1000), + FluidUtils.getFluidStack("berylliumhydroxide", 2008), + GT_Values.NI, + 8*20); + //Ammonium Tetrafluoroberyllate + GT_Values.RA.addChemicalRecipe( + ItemUtils.getItemStackOfAmountFromOreDict("cellBerylliumHydroxide", 1), + ItemUtils.getItemStackOfAmountFromOreDict("cellAmmoniumBifluoride", 1), + GT_Values.NF, + FluidUtils.getFluidStack("ammoniumtetrafluoroberyllate", 2000), + ItemUtils.getItemStackOfAmountFromOreDict("cellEmpty", 2), + 32*20); } private static void blastFurnaceRecipes(){ diff --git a/src/Java/gtPlusPlus/core/recipe/RECIPES_Machines.java b/src/Java/gtPlusPlus/core/recipe/RECIPES_Machines.java index eb58ba3928..79d868c7d6 100644 --- a/src/Java/gtPlusPlus/core/recipe/RECIPES_Machines.java +++ b/src/Java/gtPlusPlus/core/recipe/RECIPES_Machines.java @@ -881,7 +881,7 @@ public class RECIPES_Machines { RECIPE_ThermalBoilerCasing); //Lava Filter Recipe - GT_Values.RA.addAssemblerRecipe(ItemUtils.getItemStackWithMeta(LoadedMods.IndustrialCraft2, "IC2:itemPartCarbonMesh", "RawCarbonMesh", 0, 8), GT_Values.NI, ItemUtils.getSimpleStack(ModItems.itemLavaFilter), 80*20, 16); + GT_Values.RA.addAssemblerRecipe(ItemUtils.getItemStackWithMeta(LoadedMods.IndustrialCraft2, "IC2:itemPartCarbonMesh", "RawCarbonMesh", 0, 16), CI.getNumberedCircuit(18), ItemUtils.getSimpleStack(ModItems.itemLavaFilter), 80*20, 16); } if (CORE.configSwitches.enableMultiblock_LiquidFluorideThoriumReactor){ diff --git a/src/Java/gtPlusPlus/core/util/ClassUtils.java b/src/Java/gtPlusPlus/core/util/ClassUtils.java index 20ca894211..498362e817 100644 --- a/src/Java/gtPlusPlus/core/util/ClassUtils.java +++ b/src/Java/gtPlusPlus/core/util/ClassUtils.java @@ -20,6 +20,7 @@ public class ClassUtils { } } + @SuppressWarnings("rawtypes") public static Method getMethodViaReflection(final Class<?> lookupClass, final String methodName, final boolean invoke) throws Exception{ final Class<? extends Class> lookup = lookupClass.getClass(); final Method m = lookup.getDeclaredMethod(methodName); @@ -30,7 +31,7 @@ public class ClassUtils { return m; } - public static Class getNonPublicClass(final String className){ + public static Class<?> getNonPublicClass(final String className){ Class<?> c = null; try { c = Class.forName(className); @@ -60,7 +61,7 @@ public class ClassUtils { try { final Object o = constructor.newInstance(); - return (Class) o; + return (Class<?>) o; } catch (InstantiationException | IllegalAccessException | IllegalArgumentException | InvocationTargetException e) { // TODO Auto-generated catch block diff --git a/src/Java/gtPlusPlus/core/util/entity/EntityUtils.java b/src/Java/gtPlusPlus/core/util/entity/EntityUtils.java index e5c52939ac..a10c0ce4d1 100644 --- a/src/Java/gtPlusPlus/core/util/entity/EntityUtils.java +++ b/src/Java/gtPlusPlus/core/util/entity/EntityUtils.java @@ -1,6 +1,7 @@ package gtPlusPlus.core.util.entity; import cpw.mods.fml.common.registry.EntityRegistry; +import gregtech.api.util.GT_Utility; import ic2.core.IC2Potion; import ic2.core.item.armor.ItemArmorHazmat; import net.minecraft.block.Block; @@ -40,21 +41,22 @@ public class EntityUtils { EntityRegistry.addSpawn(classy, 6, 1, 5, EntityType, baseBiomeGen); //change the values to vary the spawn rarity, biome, etc. } - public static boolean applyRadiationDamageToEntity(final int damage, final World world, final Entity entityHolding){ + public static boolean applyRadiationDamageToEntity(final int stackSize, final int radiationLevel, final World world, final Entity entityHolding){ if (!world.isRemote){ - if ((damage > 0) && (entityHolding instanceof EntityLivingBase)) { + if ((radiationLevel > 0) && (entityHolding instanceof EntityLivingBase)) { final EntityLivingBase entityLiving = (EntityLivingBase) entityHolding; - if (!ItemArmorHazmat.hasCompleteHazmat(entityLiving)) { + if (!ItemArmorHazmat.hasCompleteHazmat(entityLiving) || !GT_Utility.isWearingFullRadioHazmat(entityLiving)) { int duration; if (entityLiving.getActivePotionEffect(IC2Potion.radiation) != null){ //Utils.LOG_INFO("t"); - duration = (damage*5)+entityLiving.getActivePotionEffect(IC2Potion.radiation).getDuration(); + duration = (radiationLevel*5)+entityLiving.getActivePotionEffect(IC2Potion.radiation).getDuration(); } else { //Utils.LOG_INFO("f"); - duration = damage*30; + duration = radiationLevel*30; } - IC2Potion.radiation.applyTo(entityLiving, duration, damage * 15); + //IC2Potion.radiation.applyTo(entityLiving, duration, damage * 15); + GT_Utility.applyRadioactivity(entityLiving, radiationLevel, stackSize); } } return true; diff --git a/src/Java/gtPlusPlus/core/util/fluid/FluidUtils.java b/src/Java/gtPlusPlus/core/util/fluid/FluidUtils.java index b820e674aa..02835a92ef 100644 --- a/src/Java/gtPlusPlus/core/util/fluid/FluidUtils.java +++ b/src/Java/gtPlusPlus/core/util/fluid/FluidUtils.java @@ -311,6 +311,9 @@ public class FluidUtils { if ((aFullContainer != null) && (aEmptyContainer != null) && !FluidContainerRegistry.registerFluidContainer(new FluidStack(rFluid, aFluidAmount), aFullContainer, aEmptyContainer)) { GT_Values.RA.addFluidCannerRecipe(aFullContainer, container(aFullContainer, false), null, new FluidStack(rFluid, aFluidAmount)); } + else { + //Utils.LOG_INFO("Failed creating recipes to fill/empty cells of "+aName+"."); + } return rFluid; } diff --git a/src/Java/gtPlusPlus/core/util/materials/MaterialUtils.java b/src/Java/gtPlusPlus/core/util/materials/MaterialUtils.java index 863ba2b3b8..010f7b0bf0 100644 --- a/src/Java/gtPlusPlus/core/util/materials/MaterialUtils.java +++ b/src/Java/gtPlusPlus/core/util/materials/MaterialUtils.java @@ -14,6 +14,7 @@ public class MaterialUtils { public static short firstID = 791; + @SuppressWarnings({ "rawtypes", "unused" }) private static Class[][] commonTypes = {{Materials.class, int.class, TextureSet.class, float.class, int.class, int.class, int.class, int.class, int.class, int.class, int.class, @@ -32,6 +33,7 @@ public class MaterialUtils { } public static Material generateMaterialFromGtENUM(final Materials material){ + @SuppressWarnings("deprecation") String name = material.name(); final short[] rgba = material.mRGBa; final int melting = material.mMeltingPoint; diff --git a/src/Java/gtPlusPlus/core/util/reflect/ClientProxyFinder.java b/src/Java/gtPlusPlus/core/util/reflect/ClientProxyFinder.java index c1d0279f72..99a9bf2fa9 100644 --- a/src/Java/gtPlusPlus/core/util/reflect/ClientProxyFinder.java +++ b/src/Java/gtPlusPlus/core/util/reflect/ClientProxyFinder.java @@ -12,7 +12,7 @@ public class ClientProxyFinder { final SidedProxy sidedProxy = field.getAnnotation(SidedProxy.class); final Object fieldValue = field.get(modInstance); try { - final Class clientSideClass = Class.forName(sidedProxy.clientSide()); + final Class<?> clientSideClass = Class.forName(sidedProxy.clientSide()); if(clientSideClass.isAssignableFrom(fieldValue.getClass())) { final Object clientProxy = clientSideClass.cast(fieldValue); //do what you want with client proxy instance diff --git a/src/Java/gtPlusPlus/core/util/reflect/ReflectionUtils.java b/src/Java/gtPlusPlus/core/util/reflect/ReflectionUtils.java index c789871b6f..f88f8e32e0 100644 --- a/src/Java/gtPlusPlus/core/util/reflect/ReflectionUtils.java +++ b/src/Java/gtPlusPlus/core/util/reflect/ReflectionUtils.java @@ -102,7 +102,7 @@ public class ReflectionUtils { /** * Allows to change the state of an immutable instance. Huh?!? */ - public static void setFieldValue(Class clazz, String fieldName, Object newValue) throws Exception { + public static void setFieldValue(Class<?> clazz, String fieldName, Object newValue) throws Exception { Field nameField = getField(clazz, fieldName); setValue(clazz, nameField, newValue); } @@ -110,7 +110,7 @@ public class ReflectionUtils { /** * Allows to change the state of final statics. Huh?!? */ - public static void setDefault(Class clazz, String fieldName, Object newValue) throws Exception { + public static void setDefault(Class<?> clazz, String fieldName, Object newValue) throws Exception { Field staticField = clazz.getDeclaredField(fieldName); setValue(null, staticField, newValue); } diff --git a/src/Java/gtPlusPlus/core/util/reflect/ServerProxyFinder.java b/src/Java/gtPlusPlus/core/util/reflect/ServerProxyFinder.java index 2fae02a9fd..38382b4a46 100644 --- a/src/Java/gtPlusPlus/core/util/reflect/ServerProxyFinder.java +++ b/src/Java/gtPlusPlus/core/util/reflect/ServerProxyFinder.java @@ -12,7 +12,7 @@ public class ServerProxyFinder { final SidedProxy sidedProxy = field.getAnnotation(SidedProxy.class); final Object fieldValue = field.get(modInstance); try { - final Class serverSideClass = Class.forName(sidedProxy.serverSide()); + final Class<?> serverSideClass = Class.forName(sidedProxy.serverSide()); if(serverSideClass.isAssignableFrom(fieldValue.getClass())) { final Object serverProxy = serverSideClass.cast(fieldValue); //do what you want with server proxy instance diff --git a/src/Java/gtPlusPlus/core/world/darkworld/biome/Biome_DarkWorld.java b/src/Java/gtPlusPlus/core/world/darkworld/biome/Biome_DarkWorld.java index 3eadb6116e..ed8b3f38b7 100644 --- a/src/Java/gtPlusPlus/core/world/darkworld/biome/Biome_DarkWorld.java +++ b/src/Java/gtPlusPlus/core/world/darkworld/biome/Biome_DarkWorld.java @@ -113,7 +113,8 @@ public class Biome_DarkWorld { return 0xF67A14; } - private boolean addToMonsterSpawnLists(Class EntityClass, int a, int b, int c){ + @SuppressWarnings("unchecked") + private boolean addToMonsterSpawnLists(Class<?> EntityClass, int a, int b, int c){ this.spawnableMonsterList.add(new SpawnListEntry(EntityClass, a, b, c)); this.spawnableCaveCreatureList.add(new SpawnListEntry(EntityClass, a, b, c)); return true; diff --git a/src/Java/gtPlusPlus/nei/GT_NEI_DefaultHandler.java b/src/Java/gtPlusPlus/nei/GT_NEI_DefaultHandler.java index 0f8dcb4649..017fe3012b 100644 --- a/src/Java/gtPlusPlus/nei/GT_NEI_DefaultHandler.java +++ b/src/Java/gtPlusPlus/nei/GT_NEI_DefaultHandler.java @@ -71,7 +71,7 @@ extends TemplateRecipeHandler { public void loadCraftingRecipes(final ItemStack aResult) { final ItemData tPrefixMaterial = GT_OreDictUnificator.getAssociation(aResult); - final ArrayList<ItemStack> tResults = new ArrayList(); + final ArrayList<ItemStack> tResults = new ArrayList<ItemStack>(); tResults.add(aResult); tResults.add(GT_OreDictUnificator.get(true, aResult)); if ((tPrefixMaterial != null) && (!tPrefixMaterial.mBlackListed) && (!tPrefixMaterial.mPrefix.mFamiliarPrefixes.isEmpty())) { @@ -99,14 +99,13 @@ extends TemplateRecipeHandler { } } } - final CachedDefaultRecipe tNEIRecipe; } @Override public void loadUsageRecipes(final ItemStack aInput) { final ItemData tPrefixMaterial = GT_OreDictUnificator.getAssociation(aInput); - final ArrayList<ItemStack> tInputs = new ArrayList(); + final ArrayList<ItemStack> tInputs = new ArrayList<ItemStack>(); tInputs.add(aInput); tInputs.add(GT_OreDictUnificator.get(false, aInput)); if ((tPrefixMaterial != null) && (!tPrefixMaterial.mPrefix.mFamiliarPrefixes.isEmpty())) { @@ -134,7 +133,6 @@ extends TemplateRecipeHandler { } } } - final CachedDefaultRecipe tNEIRecipe; } @Override @@ -322,14 +320,14 @@ extends TemplateRecipeHandler { if (this.permutated) { return; } - final ArrayList<ItemStack> tDisplayStacks = new ArrayList(); + final ArrayList<ItemStack> tDisplayStacks = new ArrayList<ItemStack>(); for (final ItemStack tStack : this.items) { if (GT_Utility.isStackValid(tStack)) { if (tStack.getItemDamage() == 32767) { final List<ItemStack> permutations = codechicken.nei.ItemList.itemMap.get(tStack.getItem()); if (!permutations.isEmpty()) { ItemStack stack; - for (final Iterator i$ = permutations.iterator(); i$.hasNext(); tDisplayStacks.add(GT_Utility.copyAmount(tStack.stackSize, new Object[]{stack}))) { + for (final Iterator<ItemStack> i$ = permutations.iterator(); i$.hasNext(); tDisplayStacks.add(GT_Utility.copyAmount(tStack.stackSize, new Object[]{stack}))) { stack = (ItemStack) i$.next(); } } else { @@ -354,8 +352,8 @@ extends TemplateRecipeHandler { public class CachedDefaultRecipe extends TemplateRecipeHandler.CachedRecipe { public final GT_Recipe mRecipe; - public final List<PositionedStack> mOutputs = new ArrayList(); - public final List<PositionedStack> mInputs = new ArrayList(); + public final List<PositionedStack> mOutputs = new ArrayList<PositionedStack>(); + public final List<PositionedStack> mInputs = new ArrayList<PositionedStack>(); public CachedDefaultRecipe(final GT_Recipe aRecipe) { super(); diff --git a/src/Java/gtPlusPlus/xmod/bop/blocks/rainforest/SaplingRainforestTree.java b/src/Java/gtPlusPlus/xmod/bop/blocks/rainforest/SaplingRainforestTree.java index e36d24e695..0cd76fa734 100644 --- a/src/Java/gtPlusPlus/xmod/bop/blocks/rainforest/SaplingRainforestTree.java +++ b/src/Java/gtPlusPlus/xmod/bop/blocks/rainforest/SaplingRainforestTree.java @@ -13,16 +13,18 @@ import net.minecraft.world.gen.feature.*; public class SaplingRainforestTree extends SaplingBase { - public SaplingRainforestTree(){ - super("Rainforest Oak Sapling", "rainforestoak", new String[]{"rainforest"}); - } + public SaplingRainforestTree(){ + super("Rainforest Oak Sapling", "rainforestoak", new String[]{"rainforest"}); + } - @Override + @Override public void func_149878_d(World world, int x, int y, int z, Random rand){ Utils.LOG_WARNING("func_149878_d - 1"); if (!net.minecraftforge.event.terraingen.TerrainGen.saplingGrowTree(world, rand, x, y, z)) return; int l = world.getBlockMetadata(x, y, z) & 7; - Object object = rand.nextInt(10) == 0 ? new WorldGenBigTree(true) : new WorldGenTrees(true); + rand.nextInt(10); + new WorldGenBigTree(true); + new WorldGenTrees(true); int i1 = 0; int j1 = 0; boolean flag = false; @@ -40,10 +42,8 @@ public class SaplingRainforestTree extends SaplingBase { { world.setBlock(x, y, z, block, 0, 4); } -//public WorldGenRainForestTree_Ex(Block wood, Block leaves, int woodMeta, int leavesMeta, boolean doBlockNotify, int minTreeHeight, int randomTreeHeight) { - Class C = BOP_Block_Registrator.class; Object o = new WorldGenRainForestTree_Ex(BOP_Block_Registrator.log_Rainforest, BOP_Block_Registrator.leaves_Rainforest, 0, 0, true, 50, 75); - + if (!((WorldGenerator)o).generate(world, rand, x + i1, y, z + j1)) { if (flag) @@ -59,5 +59,5 @@ public class SaplingRainforestTree extends SaplingBase { } } } - + }
\ No newline at end of file diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_AdvancedBoiler.java b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_AdvancedBoiler.java index d3ec2b024b..e480ffbfef 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_AdvancedBoiler.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_AdvancedBoiler.java @@ -60,7 +60,7 @@ public class CONTAINER_AdvancedBoiler this.mWaterAmount = Math.min(54, Math.max(0, this.mWaterAmount * 54 / (this.maxStorage-100))); this.mProcessingEnergy = Math.min(14, Math.max(this.mProcessingEnergy > 0 ? 1 : 0, this.mProcessingEnergy * 14 / 1000)); - Iterator var2 = this.crafters.iterator(); + Iterator<?> var2 = this.crafters.iterator(); while (var2.hasNext()) { ICrafting var1 = (ICrafting) var2.next(); var1.sendProgressBarUpdate(this, 100, this.mTemperature); diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/objects/GregtechItemData.java b/src/Java/gtPlusPlus/xmod/gregtech/api/objects/GregtechItemData.java index 0a5351afdc..fb35c0ac21 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/api/objects/GregtechItemData.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/objects/GregtechItemData.java @@ -120,7 +120,7 @@ public class GregtechItemData { } public ArrayList<GregtechMaterialStack> getAllGT_MaterialStacks() { - final ArrayList<GregtechMaterialStack> rList = new ArrayList(); + final ArrayList<GregtechMaterialStack> rList = new ArrayList<GregtechMaterialStack>(); if (this.hasValidMaterialData()) { rList.add(this.mMaterial); } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityTreeFarm.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityTreeFarm.java index 191312dbfa..dd2837b021 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityTreeFarm.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityTreeFarm.java @@ -65,13 +65,8 @@ public class GregtechMetaTileEntityTreeFarm extends GT_MetaTileEntity_MultiBlock private EntityPlayerMP farmerAI; - private SAWTOOL mCurrentMachineTool = SAWTOOL.NONE; private boolean canChop = false; - private final int cuttingNumber = 0; - private final int cuttingNumber2 = 0; - private final int cuttingNumber3 = 0; - public GregtechMetaTileEntityTreeFarm(final int aID, final String aName, final String aNameRegional) { super(aID, aName, aNameRegional); } @@ -253,10 +248,8 @@ public class GregtechMetaTileEntityTreeFarm extends GT_MetaTileEntity_MultiBlock final SAWTOOL currentInputItem = TreeFarmHelper.isCorrectMachinePart(aStack); if (currentInputItem != SAWTOOL.NONE){ if (currentInputItem == SAWTOOL.SAW){ - this.mCurrentMachineTool = SAWTOOL.SAW; } else { - this.mCurrentMachineTool = SAWTOOL.BUZZSAW; } isValid = true; } @@ -423,6 +416,7 @@ public class GregtechMetaTileEntityTreeFarm extends GT_MetaTileEntity_MultiBlock + @SuppressWarnings("unused") private boolean findLogs(final IGregTechTileEntity aBaseMetaTileEntity){ Utils.LOG_MACHINE_INFO("called findLogs()"); @@ -556,6 +550,7 @@ public class GregtechMetaTileEntityTreeFarm extends GT_MetaTileEntity_MultiBlock return true; } + @SuppressWarnings("deprecation") private boolean plantSaplings(final IGregTechTileEntity aBaseMetaTileEntity){ Utils.LOG_MACHINE_INFO("called plantSaplings()"); final World world = aBaseMetaTileEntity.getWorld(); diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_CatalyticReactor.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_CatalyticReactor.java index ab47262d38..e13360b7c5 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_CatalyticReactor.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_CatalyticReactor.java @@ -58,6 +58,7 @@ public class GregtechMetaTileEntity_CatalyticReactor extends GT_MetaTileEntity_M return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, this.getLocalName(), "LFTR.png"); } + @SuppressWarnings("unused") @Override public boolean checkRecipe(final ItemStack aStack) { if ((this.mInventory[1] == null) || (this.mInventory[1].isItemEqual(GT_ModHandler.getIC2Item("miningPipe", 1L)) && (this.mInventory[1].stackSize < this.mInventory[1].getMaxStackSize()))) { diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_Refinery.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_Refinery.java index e99a8d2b44..47f225f53c 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_Refinery.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_Refinery.java @@ -2,6 +2,7 @@ package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi; import java.util.ArrayList; +import gregtech.api.enums.GT_Values; import gregtech.api.enums.TAE; import gregtech.api.enums.Textures; import gregtech.api.gui.GT_GUIContainer_MultiMachine; @@ -10,8 +11,11 @@ import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase; import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.util.CustomRecipeMap; import gregtech.api.util.GT_ModHandler; +import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; +import gregtech.api.util.Recipe_GT; import gtPlusPlus.core.block.ModBlocks; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.util.Utils; @@ -23,8 +27,8 @@ import net.minecraftforge.fluids.FluidStack; public class GregtechMetaTileEntity_Refinery extends GT_MetaTileEntity_MultiBlockBase { - private boolean completedCycle = false; - + public GT_Recipe mLastRecipe; + public GregtechMetaTileEntity_Refinery(final int aID, final String aName, final String aNameRegional) { super(aID, aName, aNameRegional); } @@ -39,13 +43,13 @@ public class GregtechMetaTileEntity_Refinery extends GT_MetaTileEntity_MultiBloc "Controller Block for the Fission Fuel Processing Unit", "Size(WxHxD): 3x9x3", "Controller (Front middle at bottom)", "3x2x3 Base platform of Hastelloy-X", - "1x7x1 Incoloy-DS Fluid Containment Block pillar (Center of base)", - "1x4x1 Hastelloy-N Sealant Blocks (Each Incoloy-DS Fluid Containment side and on top)", - "1x1x1 Zeron-100 Reactor Shielding (Second Sealant Tower layer, Surrounding Fluid Containment)", + "1x6x1 Incoloy-DS Fluid Containment Block pillar (Center of base, From layer 3 upwards)", + "4x Zeron-100 Reactor Shielding (Each side of Second Sealant Tower layer, Surrounding Incoloy-DS Fluid Containment)", + "Hastelloy-N Sealant Blocks (Each side of Incoloy-DS Fluid Containment casings, except layer 2 and one on top)", "4x Input Hatch (One of base platform)", "2x Output Hatch (One of base platform)", "1x Output Bus (One of base platform)", - "2x Maintenance Hatch (One of base platform)", + "1x Maintenance Hatch (One of base platform)", "1x ZPM or better Muffler (One of base platform)", "1x Energy Hatch (One of base platform)", CORE.GT_Tooltip @@ -64,76 +68,41 @@ public class GregtechMetaTileEntity_Refinery extends GT_MetaTileEntity_MultiBloc public Object getClientGUI(final int aID, final InventoryPlayer aPlayerInventory, final IGregTechTileEntity aBaseMetaTileEntity) { return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, this.getLocalName(), "LFTR.png"); } - + @Override - public boolean checkRecipe(final ItemStack aStack) { - if ((this.mInventory[1] == null) || (this.mInventory[1].isItemEqual(GT_ModHandler.getIC2Item("miningPipe", 1L)) && (this.mInventory[1].stackSize < this.mInventory[1].getMaxStackSize()))) { - final ArrayList<ItemStack> tItems = this.getStoredInputs(); - for (ItemStack tStack : tItems) { - if (tStack.isItemEqual(GT_ModHandler.getIC2Item("miningPipe", 1L))) { - if (tStack.stackSize < 2) { - tStack = null; - } else { - tStack.stackSize--; - } - - } - if (this.mInventory[1] == null) { - this.mInventory[1] = GT_ModHandler.getIC2Item("miningPipe", 1L); - } else { - this.mInventory[1].stackSize++; - } - } - } - FluidStack tFluid = null;//GT_Utility.getUndergroundOil(getBaseMetaTileEntity().getWorld(), getBaseMetaTileEntity().getXCoord(), getBaseMetaTileEntity().getZCoord()); - { - return false; - } - } - - private boolean moveOneDown() { - if ((this.mInventory[1] == null) || (this.mInventory[1].stackSize < 1) - || (!GT_Utility.areStacksEqual(this.mInventory[1], GT_ModHandler.getIC2Item("miningPipe", 1L)))) { - return false; - } - final int xDir = ForgeDirection.getOrientation(this.getBaseMetaTileEntity().getBackFacing()).offsetX; - final int zDir = ForgeDirection.getOrientation(this.getBaseMetaTileEntity().getBackFacing()).offsetZ; - final int yHead = this.getYOfPumpHead(); - if (yHead < 1) { - return false; - } - if (this.getBaseMetaTileEntity().getBlock(this.getBaseMetaTileEntity().getXCoord() + xDir, yHead - 1, this.getBaseMetaTileEntity().getZCoord() + zDir) == Blocks.bedrock) { - return false; - } - if (!(this.getBaseMetaTileEntity().getWorld().setBlock(this.getBaseMetaTileEntity().getXCoord() + xDir, yHead - 1, this.getBaseMetaTileEntity().getZCoord() + zDir, GT_Utility.getBlockFromStack(GT_ModHandler.getIC2Item("miningPipeTip", 1L))))) { - return false; - } - if (yHead != this.getBaseMetaTileEntity().getYCoord()) { - this.getBaseMetaTileEntity().getWorld().setBlock(this.getBaseMetaTileEntity().getXCoord() + xDir, yHead, this.getBaseMetaTileEntity().getZCoord() + zDir, GT_Utility.getBlockFromStack(GT_ModHandler.getIC2Item("miningPipe", 1L))); - } - this.getBaseMetaTileEntity().decrStackSize(1, 1); - return true; - } - - private int getYOfPumpHead() { - final int xDir = ForgeDirection.getOrientation(this.getBaseMetaTileEntity().getBackFacing()).offsetX; - final int zDir = ForgeDirection.getOrientation(this.getBaseMetaTileEntity().getBackFacing()).offsetZ; - int y = this.getBaseMetaTileEntity().getYCoord() - 1; - while (this.getBaseMetaTileEntity().getBlock(this.getBaseMetaTileEntity().getXCoord() + xDir, y, this.getBaseMetaTileEntity().getZCoord() + zDir) == GT_Utility.getBlockFromStack(GT_ModHandler.getIC2Item("miningPipe", 1L))) { - y--; - } - if (y == (this.getBaseMetaTileEntity().getYCoord() - 1)) { - if (this.getBaseMetaTileEntity().getBlock(this.getBaseMetaTileEntity().getXCoord() + xDir, y, this.getBaseMetaTileEntity().getZCoord() + zDir) != GT_Utility.getBlockFromStack(GT_ModHandler.getIC2Item("miningPipeTip", 1L))) { - return y + 1; - } - } else if ((this.getBaseMetaTileEntity().getBlock(this.getBaseMetaTileEntity().getXCoord() + xDir, y, this.getBaseMetaTileEntity().getZCoord() + zDir) != GT_Utility - .getBlockFromStack(GT_ModHandler.getIC2Item("miningPipeTip", 1L))) && (this.mInventory[1] != null) && (this.mInventory[1].stackSize > 0) && GT_Utility.areStacksEqual(this.mInventory[1], GT_ModHandler.getIC2Item("miningPipe", 1L))) { - this.getBaseMetaTileEntity().getWorld().setBlock(this.getBaseMetaTileEntity().getXCoord() + xDir, y, this.getBaseMetaTileEntity().getZCoord() + zDir, - GT_Utility.getBlockFromStack(GT_ModHandler.getIC2Item("miningPipeTip", 1L))); - this.getBaseMetaTileEntity().decrStackSize(0, 1); - } - return y; - } + public boolean checkRecipe(ItemStack aStack) { + ArrayList<FluidStack> tFluidList = getStoredFluids(); + int tFluidList_sS=tFluidList.size(); + for (int i = 0; i < tFluidList_sS - 1; i++) { + for (int j = i + 1; j < tFluidList_sS; j++) { + if (GT_Utility.areFluidsEqual((FluidStack) tFluidList.get(i), (FluidStack) tFluidList.get(j))) { + if (((FluidStack) tFluidList.get(i)).amount >= ((FluidStack) tFluidList.get(j)).amount) { + tFluidList.remove(j--); tFluidList_sS=tFluidList.size(); + } else { + tFluidList.remove(i--); tFluidList_sS=tFluidList.size(); + break; + } + } + } + } + if (tFluidList.size() > 1) { + FluidStack[] tFluids = tFluidList.toArray(new FluidStack[tFluidList.size()]); + GT_Recipe tRecipe = CustomRecipeMap.sFissionFuelProcessing.findRecipe(this.getBaseMetaTileEntity(), this.mLastRecipe, false, GT_Values.V[4], tFluids, new ItemStack[]{}); + if (tRecipe == null) { + this.mLastRecipe = null; + return false; + } + if (tRecipe.isRecipeInputEqual(true, tFluids, new ItemStack[]{})) { + this.mLastRecipe = tRecipe; + this.mEUt = this.mLastRecipe.mEUt; + this.mMaxProgresstime = this.mLastRecipe.mDuration; + this.mEfficiencyIncrease = 10000; + this.mOutputFluids = this.mLastRecipe.mFluidOutputs; + return true; + } + } + return false; + } @Override public boolean checkMachine(final IGregTechTileEntity aBaseMetaTileEntity, final ItemStack aStack) { @@ -147,55 +116,68 @@ public class GregtechMetaTileEntity_Refinery extends GT_MetaTileEntity_MultiBloc if ((!this.addToMachineList(tTileEntity, TAE.GTPP_INDEX(18))) && (!this.addEnergyInputToMachineList(tTileEntity, TAE.GTPP_INDEX(18)))) { if (aBaseMetaTileEntity.getBlockOffset(xDir + i, Y, zDir + j) != ModBlocks.blockCasings2Misc) { - Utils.LOG_INFO("Wrong Block."); + Utils.LOG_INFO("1 Wrong Block. Found "+aBaseMetaTileEntity.getBlockOffset(xDir + i, Y, zDir + j).getLocalizedName()); return false; } if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, Y, zDir + j) != 2) { - Utils.LOG_INFO("Wrong Meta 1."); + Utils.LOG_INFO("1 Wrong Meta. Found "+aBaseMetaTileEntity.getBlockOffset(xDir + i, Y, zDir + j).getLocalizedName()+" | Expected Meta 2 | Got Meta "+aBaseMetaTileEntity.getMetaIDOffset(xDir + i, Y, zDir + j)); return false; } } else { - Utils.LOG_INFO("Added Hatch. "+tTileEntity.getInventoryName()); + //Utils.LOG_INFO("Added Hatch. "+tTileEntity.getInventoryName()); } } Y = 1; - Utils.LOG_INFO("Checking at Y+1 as well."); + //Utils.LOG_INFO("Checking at Y+1 as well."); final IGregTechTileEntity tTileEntity2 = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, Y, zDir + j); if ((!this.addToMachineList(tTileEntity2, TAE.GTPP_INDEX(18))) && (!this.addEnergyInputToMachineList(tTileEntity2, TAE.GTPP_INDEX(18)))) { if (aBaseMetaTileEntity.getBlockOffset(xDir + i, Y, zDir + j) != ModBlocks.blockCasings2Misc) { - Utils.LOG_INFO("Wrong Block."); + Utils.LOG_INFO("2 Wrong Block. Found "+aBaseMetaTileEntity.getBlockOffset(xDir, Y, zDir).getLocalizedName()); return false; } if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, Y, zDir + j) != 2) { - Utils.LOG_INFO("Wrong Meta 1."); + Utils.LOG_INFO("2 Wrong Meta. Found "+aBaseMetaTileEntity.getBlockOffset(xDir, Y, zDir).getLocalizedName()+" | Expected Meta 2 | Got Meta "+aBaseMetaTileEntity.getMetaIDOffset(xDir, Y, zDir)); return false; } } else { - Utils.LOG_INFO("Added Hatch. "+tTileEntity2.getInventoryName()); + //Utils.LOG_INFO("Added Hatch. "+tTileEntity2.getInventoryName()); } } } - for (int y = 2; y < 6; y++) { - if (aBaseMetaTileEntity.getBlockOffset(xDir, y, zDir) != ModBlocks.blockCasings2Misc) { //Must Define meta for center blocks - Utils.LOG_INFO("Wrong Block."); - return false; + for (int y = 2; y < 7; y++) { + if (y<=6){ + if (aBaseMetaTileEntity.getBlockOffset(xDir, y, zDir) != ModBlocks.blockCasings2Misc) { //Must Define meta for center blocks + Utils.LOG_INFO("3 Wrong Block. Found "+aBaseMetaTileEntity.getBlockOffset(xDir, y, zDir).getLocalizedName()); + return false; + } + if (aBaseMetaTileEntity.getMetaIDOffset(xDir, y, zDir) != 3) { + Utils.LOG_INFO("3 Wrong Meta. Found "+aBaseMetaTileEntity.getBlockOffset(xDir, y, zDir).getLocalizedName()+" | Expected Meta 3 | Got Meta "+aBaseMetaTileEntity.getMetaIDOffset(xDir, y, zDir)); + return false; + } } - if (aBaseMetaTileEntity.getMetaIDOffset(xDir, y, zDir) != 3) { - Utils.LOG_INFO("Wrong Meta. 2"); - return false; + if (y==6){ + if (aBaseMetaTileEntity.getBlockOffset(xDir, y + 1, zDir) != ModBlocks.blockCasings2Misc) { + Utils.LOG_INFO("8 Wrong Block. Found "+aBaseMetaTileEntity.getBlockOffset(xDir, y+1, zDir).getLocalizedName()+" | "+aBaseMetaTileEntity.getMetaIDOffset(xDir, y+1, zDir)); + return false; + } + if (aBaseMetaTileEntity.getMetaIDOffset(xDir, y + 1, zDir) != 1) { + Utils.LOG_INFO("8 Wrong Meta. Found "+aBaseMetaTileEntity.getBlockOffset(xDir, y+1, zDir).getLocalizedName()+" | Expected Meta 1 | Got Meta "+aBaseMetaTileEntity.getMetaIDOffset(xDir, y + 1, zDir)); + return false; + } } if (aBaseMetaTileEntity.getBlockOffset(xDir + 1, y, zDir) != ModBlocks.blockCasings2Misc) { - Utils.LOG_INFO("Wrong Block.1"); + //Utils.LOG_INFO("4 Wrong Block. Found "+aBaseMetaTileEntity.getBlockOffset(xDir, y, zDir).getLocalizedName()); if (y==3){ if (aBaseMetaTileEntity.getBlockOffset(xDir + 1, y, zDir) == ModBlocks.blockCasingsMisc) { if (aBaseMetaTileEntity.getMetaIDOffset(xDir + 1, y, zDir) != 13) { + Utils.LOG_INFO("4 Wrong Meta. Found "+aBaseMetaTileEntity.getBlockOffset(xDir, y, zDir).getLocalizedName()+" | Expected Meta 13 | Got Meta "+aBaseMetaTileEntity.getMetaIDOffset(xDir, y, zDir)); return false; } - Utils.LOG_INFO("Found Zeron-Casing."); + Utils.LOG_INFO("Found Zeron-Casing at "+(aBaseMetaTileEntity.getYCoord()+y)); } } else { @@ -205,13 +187,14 @@ public class GregtechMetaTileEntity_Refinery extends GT_MetaTileEntity_MultiBloc } if (aBaseMetaTileEntity.getBlockOffset(xDir - 1, y, zDir) != ModBlocks.blockCasings2Misc) { - Utils.LOG_INFO("Wrong Block.2"); + //Utils.LOG_INFO("5 Wrong Block. Found "+aBaseMetaTileEntity.getBlockOffset(xDir, y, zDir).getLocalizedName()); if (y==3){ if (aBaseMetaTileEntity.getBlockOffset(xDir + 1, y, zDir) == ModBlocks.blockCasingsMisc) { if (aBaseMetaTileEntity.getMetaIDOffset(xDir + 1, y, zDir) != 13) { + Utils.LOG_INFO("5 Wrong Meta. Found "+aBaseMetaTileEntity.getBlockOffset(xDir, y, zDir).getLocalizedName()+" | Expected Meta 13 | Got Meta "+aBaseMetaTileEntity.getMetaIDOffset(xDir, y, zDir)); return false; } - Utils.LOG_INFO("Found Zeron-Casing."); + Utils.LOG_INFO("Found Zeron-Casing at "+(aBaseMetaTileEntity.getYCoord()+y)); } } else { @@ -221,13 +204,14 @@ public class GregtechMetaTileEntity_Refinery extends GT_MetaTileEntity_MultiBloc } if (aBaseMetaTileEntity.getBlockOffset(xDir, y, zDir + 1) != ModBlocks.blockCasings2Misc) { - Utils.LOG_INFO("Wrong Block.3"); + //Utils.LOG_INFO("6 Wrong Block. Found "+aBaseMetaTileEntity.getBlockOffset(xDir, y, zDir).getLocalizedName()); if (y==3){ if (aBaseMetaTileEntity.getBlockOffset(xDir + 1, y, zDir) == ModBlocks.blockCasingsMisc) { if (aBaseMetaTileEntity.getMetaIDOffset(xDir + 1, y, zDir) != 13) { + Utils.LOG_INFO("6 Wrong Meta. Found "+aBaseMetaTileEntity.getBlockOffset(xDir, y, zDir).getLocalizedName()+" | Expected Meta 13 | Got Meta "+aBaseMetaTileEntity.getMetaIDOffset(xDir, y, zDir)); return false; } - Utils.LOG_INFO("Found Zeron-Casing."); + Utils.LOG_INFO("Found Zeron-Casing at "+(aBaseMetaTileEntity.getYCoord()+y)); } } else { @@ -236,33 +220,26 @@ public class GregtechMetaTileEntity_Refinery extends GT_MetaTileEntity_MultiBloc } } if (aBaseMetaTileEntity.getBlockOffset(xDir, y, zDir - 1) != ModBlocks.blockCasings2Misc) { - Utils.LOG_INFO("Wrong Block.4"); + //Utils.LOG_INFO("7 Wrong Block. Found "+aBaseMetaTileEntity.getBlockOffset(xDir, y, zDir).getLocalizedName()); if (y==3){ if (aBaseMetaTileEntity.getBlockOffset(xDir + 1, y, zDir) == ModBlocks.blockCasingsMisc) { if (aBaseMetaTileEntity.getMetaIDOffset(xDir + 1, y, zDir) != 13) { + Utils.LOG_INFO("7 Wrong Meta. Found "+aBaseMetaTileEntity.getBlockOffset(xDir, y, zDir).getLocalizedName()+" | Expected Meta 13 | Got Meta "+aBaseMetaTileEntity.getMetaIDOffset(xDir, y, zDir)); return false; } - Utils.LOG_INFO("Found Zeron-Casing."); + Utils.LOG_INFO("Found Zeron-Casing at "+(aBaseMetaTileEntity.getYCoord()+y)); } } else { Utils.LOG_INFO("debug.4"); return false; } - } - if (aBaseMetaTileEntity.getBlockOffset(xDir, y + 3, zDir) != ModBlocks.blockCasings2Misc) { - Utils.LOG_INFO("Wrong Block.5"); - return false; - } - if (aBaseMetaTileEntity.getMetaIDOffset(xDir, y + 3, zDir) != 3) { - Utils.LOG_INFO("Wrong Meta. 3"); - return false; - } + } } if ((this.mInputHatches.size() != 4) || (this.mOutputHatches.size() != 2) || (this.mOutputBusses.size() != 1) || (this.mMufflerHatches.size() != 1) || - (this.mMaintenanceHatches.size() != 2) || (this.mEnergyHatches.size() < 1)){ + (this.mMaintenanceHatches.size() != 1) || (this.mEnergyHatches.size() != 1)){ Utils.LOG_INFO("Wrong Hatch count."); return false; } @@ -270,8 +247,8 @@ public class GregtechMetaTileEntity_Refinery extends GT_MetaTileEntity_MultiBloc if (this.mMufflerHatches.get(0).mTier < 7){ Utils.LOG_INFO("Your Muffler must be AT LEAST ZPM tier or higher."); } - } - Utils.LOG_INFO("Multiblock Formed."); + } + Utils.LOG_INFO("Fission Fuel Production Plant Formed."); return true; } @@ -287,7 +264,7 @@ public class GregtechMetaTileEntity_Refinery extends GT_MetaTileEntity_MultiBloc @Override public int getPollutionPerTick(final ItemStack aStack) { - return 0; + return 200; } @Override @@ -296,7 +273,7 @@ public class GregtechMetaTileEntity_Refinery extends GT_MetaTileEntity_MultiBloc } public int getAmountOfOutputs() { - return 3; + return 5; } @Override diff --git a/src/Java/gtPlusPlus/xmod/ic2/block/RTGGenerator/BlockRTG.java b/src/Java/gtPlusPlus/xmod/ic2/block/RTGGenerator/BlockRTG.java index 7038d98a7d..4c4984a3b6 100644 --- a/src/Java/gtPlusPlus/xmod/ic2/block/RTGGenerator/BlockRTG.java +++ b/src/Java/gtPlusPlus/xmod/ic2/block/RTGGenerator/BlockRTG.java @@ -42,6 +42,7 @@ extends BlockMultiID GameRegistry.registerTileEntity(TileEntityKineticWindGenerator.class, "Wind Ripper Mach II"); } + @SuppressWarnings({ "rawtypes", "unchecked" }) @Override public void getSubBlocks(final Item j, final CreativeTabs tabs, final List itemList) { final Item item = Item.getItemFromBlock(this); |