diff options
Diffstat (limited to 'src/main/java/gtPlusPlus/xmod/gregtech')
400 files changed, 20066 insertions, 27882 deletions
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/HANDLER_GT.java b/src/main/java/gtPlusPlus/xmod/gregtech/HANDLER_GT.java index 44d6fb3a09..96b17f0685 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/HANDLER_GT.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/HANDLER_GT.java @@ -3,6 +3,14 @@ package gtPlusPlus.xmod.gregtech; import static gtPlusPlus.core.recipe.common.CI.bits; import static gtPlusPlus.core.util.minecraft.MaterialUtils.getMaterialName; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; + +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidStack; + import cpw.mods.fml.common.event.FMLLoadCompleteEvent; import gregtech.api.GregTech_API; import gregtech.api.enums.Element; @@ -65,12 +73,6 @@ import gtPlusPlus.xmod.gregtech.loaders.recipe.RecipeLoader_MolecularTransformer import gtPlusPlus.xmod.gregtech.recipes.RecipesToRemove; import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechConduits; import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechNitroDieselFix; -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraftforge.fluids.FluidStack; public class HANDLER_GT { @@ -195,8 +197,7 @@ public class HANDLER_GT { FluidStack aFluid = aRecipe.mFluidInputs[0]; if (aFluid != null && aFluid.amount > 0) { ItemStack tDataOrb = GregtechMTE_ElementalDuplicator.getSpecialSlotStack(aRecipe); - Materials tMaterial = Element.get(Behaviour_DataOrb.getDataName(tDataOrb)) - .mLinkedMaterials + Materials tMaterial = Element.get(Behaviour_DataOrb.getDataName(tDataOrb)).mLinkedMaterials .get(0); FluidStack aOutputFluid = null; ItemStack aOutputItem = null; @@ -211,18 +212,20 @@ public class HANDLER_GT { GTPP_Recipe aNewRecipe = new GTPP_Recipe( false, new ItemStack[] {}, - new ItemStack[] {!aUsingFluid ? aOutputItem : null}, + new ItemStack[] { !aUsingFluid ? aOutputItem : null }, aRecipe.mSpecialItems, null, aRecipe.mFluidInputs, - new FluidStack[] {aUsingFluid ? aOutputFluid : null}, + new FluidStack[] { aUsingFluid ? aOutputFluid : null }, aRecipe.mDuration, aRecipe.mEUt, aRecipe.mFluidInputs[0].amount); GTPP_Recipe_Map.sElementalDuplicatorRecipes.add(aNewRecipe); - Logger.INFO("[EM] Generated recipe for " + tMaterial.mLocalizedName + ", Outputs " - + (aUsingFluid ? "Fluid" : "Dust")); + Logger.INFO( + "[EM] Generated recipe for " + tMaterial.mLocalizedName + + ", Outputs " + + (aUsingFluid ? "Fluid" : "Dust")); } } else { Logger.INFO("[EM] Bad UU Requirement. " + RecipeUtils.getRecipeInfo(aRecipe)); @@ -235,8 +238,11 @@ public class HANDLER_GT { } } int aSize = GTPP_Recipe_Map.sElementalDuplicatorRecipes.mRecipeList.size(); - Logger.INFO("[EM] Generated " + aSize + "/" + GT_Recipe_Map.sReplicatorFakeRecipes.mRecipeList.size() - + " Replicator recipes."); + Logger.INFO( + "[EM] Generated " + aSize + + "/" + + GT_Recipe_Map.sReplicatorFakeRecipes.mRecipeList.size() + + " Replicator recipes."); } private static void convertPyroToCokeOven() { @@ -254,8 +260,8 @@ public class HANDLER_GT { } } - private static GT_Recipe replaceItemInRecipeWithAnother( - GT_Recipe aRecipe, ItemStack aExisting, ItemStack aNewItem) { + private static GT_Recipe replaceItemInRecipeWithAnother(GT_Recipe aRecipe, ItemStack aExisting, + ItemStack aNewItem) { ItemStack[] aInputItemsCopy = aRecipe.mInputs; String aOutputName = ItemUtils.getItemName(aRecipe.mOutputs[0]); boolean aDidChange = false; @@ -294,8 +300,9 @@ public class HANDLER_GT { boolean aHardCasings = aHardCasingsTest != null ? (boolean) aHardCasingsTest : false; - Logger.INFO("Are Hard casings/hulls enabled within GT? " - + (aHardCasingsTest == null ? "Version does not support config option" : aHardCasings)); + Logger.INFO( + "Are Hard casings/hulls enabled within GT? " + + (aHardCasingsTest == null ? "Version does not support config option" : aHardCasings)); // Static objects to save memory ItemStack aCasing_LUV = CI.machineCasing_LuV; @@ -313,8 +320,8 @@ public class HANDLER_GT { int aTier_UV = 7; // int aTier_MAX = 8; - ItemStack[] aCasings = new ItemStack[] {aCasing_LUV, aCasing_ZPM, aCasing_UV, aCasing_MAX}; - ItemStack[] aHulls = new ItemStack[] {aHull_LUV, aHull_ZPM, aHull_UV, aHull_MAX}; + ItemStack[] aCasings = new ItemStack[] { aCasing_LUV, aCasing_ZPM, aCasing_UV, aCasing_MAX }; + ItemStack[] aHulls = new ItemStack[] { aHull_LUV, aHull_ZPM, aHull_UV, aHull_MAX }; // Remove Hand Crafting Recipes @@ -339,8 +346,7 @@ public class HANDLER_GT { AutoMap<Pair<GT_Recipe, GT_Recipe>> aDataToModify = new AutoMap<Pair<GT_Recipe, GT_Recipe>>(); - Outer: - for (final GT_Recipe r : GT_Recipe.GT_Recipe_Map.sAssemblerRecipes.mRecipeList) { + Outer: for (final GT_Recipe r : GT_Recipe.GT_Recipe_Map.sAssemblerRecipes.mRecipeList) { if (r != null && r.mOutputs != null && r.mOutputs.length > 0) { @@ -348,8 +354,7 @@ public class HANDLER_GT { GT_Recipe aNewRecipe = r.copy(); // Casings - Inner: - for (ItemStack aCasingObject : aCasings) { + Inner: for (ItemStack aCasingObject : aCasings) { if (GT_Utility.areStacksEqual(aOldRecipeCopy.mOutputs[0], aCasingObject)) { String aOutputName = ItemUtils.getItemName(aOldRecipeCopy.mOutputs[0]); Logger.INFO("Attempting to Modify Assembly Recipe for " + aOutputName); @@ -389,8 +394,7 @@ public class HANDLER_GT { } // Hulls - Inner: - for (ItemStack aHullObject : aHulls) { + Inner: for (ItemStack aHullObject : aHulls) { if (GT_Utility.areStacksEqual(aOldRecipeCopy.mOutputs[0], aHullObject)) { String aOutputName = ItemUtils.getItemName(aOldRecipeCopy.mOutputs[0]); Logger.INFO("Attempting to Modify Assembly Recipe for " + aOutputName); @@ -441,72 +445,60 @@ public class HANDLER_GT { } Logger.INFO("Adding new Shaped recipes for Casings."); - GT_ModHandler.addCraftingRecipe(ItemList.Casing_LuV.get(1), bits, new Object[] { - "PPP", "PwP", "PPP", 'P', ELEMENT.getInstance().SELENIUM.getPlate(1) - }); GT_ModHandler.addCraftingRecipe( - ItemList.Casing_ZPM.get(1), bits, new Object[] {"PPP", "PwP", "PPP", 'P', CI.getPlate(aTier_ZPM, 1)}); + ItemList.Casing_LuV.get(1), + bits, + new Object[] { "PPP", "PwP", "PPP", 'P', ELEMENT.getInstance().SELENIUM.getPlate(1) }); + GT_ModHandler.addCraftingRecipe( + ItemList.Casing_ZPM.get(1), + bits, + new Object[] { "PPP", "PwP", "PPP", 'P', CI.getPlate(aTier_ZPM, 1) }); GT_ModHandler.addCraftingRecipe( - ItemList.Casing_UV.get(1), bits, new Object[] {"PPP", "PwP", "PPP", 'P', CI.getPlate(aTier_UV, 1)}); + ItemList.Casing_UV.get(1), + bits, + new Object[] { "PPP", "PwP", "PPP", 'P', CI.getPlate(aTier_UV, 1) }); if (!aHardCasings) { Logger.INFO("Adding new easy Shaped recipes for Hulls."); GT_ModHandler.addCraftingRecipe( - ItemList.Hull_LuV.get(1), RecipeBits.NOT_REMOVABLE | RecipeBits.BUFFERED, new Object[] { - "CMC", 'M', ItemList.Casing_LuV, 'C', OrePrefixes.cableGt01.get(Materials.VanadiumGallium) - }); + ItemList.Hull_LuV.get(1), + RecipeBits.NOT_REMOVABLE | RecipeBits.BUFFERED, + new Object[] { "CMC", 'M', ItemList.Casing_LuV, 'C', + OrePrefixes.cableGt01.get(Materials.VanadiumGallium) }); GT_ModHandler.addCraftingRecipe( ItemList.Hull_ZPM.get(1), RecipeBits.NOT_REMOVABLE | RecipeBits.BUFFERED, - new Object[] {"CMC", 'M', ItemList.Casing_ZPM, 'C', OrePrefixes.cableGt01.get(Materials.Naquadah)}); + new Object[] { "CMC", 'M', ItemList.Casing_ZPM, 'C', + OrePrefixes.cableGt01.get(Materials.Naquadah) }); GT_ModHandler.addCraftingRecipe( - ItemList.Hull_UV.get(1), RecipeBits.NOT_REMOVABLE | RecipeBits.BUFFERED, new Object[] { - "CMC", 'M', ItemList.Casing_UV, 'C', OrePrefixes.wireGt04.get(Materials.NaquadahAlloy) - }); + ItemList.Hull_UV.get(1), + RecipeBits.NOT_REMOVABLE | RecipeBits.BUFFERED, + new Object[] { "CMC", 'M', ItemList.Casing_UV, 'C', + OrePrefixes.wireGt04.get(Materials.NaquadahAlloy) }); } else { Materials aPolytetrafluoroethylene = MaterialUtils.getMaterial("Polytetrafluoroethylene", "Plastic"); Logger.INFO("Adding new hard Shaped recipes for Hulls."); GT_ModHandler.addCraftingRecipe( - ItemList.Hull_LuV.get(1), RecipeBits.NOT_REMOVABLE | RecipeBits.BUFFERED, new Object[] { - "PHP", - "CMC", - 'M', - ItemList.Casing_LuV, - 'C', - OrePrefixes.cableGt01.get(Materials.VanadiumGallium), - 'H', - ELEMENT.getInstance().SELENIUM.getPlate(1), - 'P', - OrePrefixes.plate.get(Materials.Plastic) - }); + ItemList.Hull_LuV.get(1), + RecipeBits.NOT_REMOVABLE | RecipeBits.BUFFERED, + new Object[] { "PHP", "CMC", 'M', ItemList.Casing_LuV, 'C', + OrePrefixes.cableGt01.get(Materials.VanadiumGallium), 'H', + ELEMENT.getInstance().SELENIUM.getPlate(1), 'P', + OrePrefixes.plate.get(Materials.Plastic) }); GT_ModHandler.addCraftingRecipe( - ItemList.Hull_ZPM.get(1), RecipeBits.NOT_REMOVABLE | RecipeBits.BUFFERED, new Object[] { - "PHP", - "CMC", - 'M', - ItemList.Casing_ZPM, - 'C', - OrePrefixes.cableGt01.get(Materials.Naquadah), - 'H', - CI.getPlate(aTier_ZPM, 1), - 'P', - OrePrefixes.plate.get(aPolytetrafluoroethylene) - }); + ItemList.Hull_ZPM.get(1), + RecipeBits.NOT_REMOVABLE | RecipeBits.BUFFERED, + new Object[] { "PHP", "CMC", 'M', ItemList.Casing_ZPM, 'C', + OrePrefixes.cableGt01.get(Materials.Naquadah), 'H', CI.getPlate(aTier_ZPM, 1), 'P', + OrePrefixes.plate.get(aPolytetrafluoroethylene) }); GT_ModHandler.addCraftingRecipe( - ItemList.Hull_UV.get(1), RecipeBits.NOT_REMOVABLE | RecipeBits.BUFFERED, new Object[] { - "PHP", - "CMC", - 'M', - ItemList.Casing_UV, - 'C', - OrePrefixes.wireGt04.get(Materials.NaquadahAlloy), - 'H', - CI.getPlate(aTier_UV, 1), - 'P', - OrePrefixes.plate.get(aPolytetrafluoroethylene) - }); + ItemList.Hull_UV.get(1), + RecipeBits.NOT_REMOVABLE | RecipeBits.BUFFERED, + new Object[] { "PHP", "CMC", 'M', ItemList.Casing_UV, 'C', + OrePrefixes.wireGt04.get(Materials.NaquadahAlloy), 'H', CI.getPlate(aTier_UV, 1), 'P', + OrePrefixes.plate.get(aPolytetrafluoroethylene) }); } } @@ -517,11 +509,9 @@ public class HANDLER_GT { Collection<GT_Recipe> aAssRecipes = GT_Recipe.GT_Recipe_Map.sAssemblerRecipes.mRecipeList; // 170, 172, 174, 176 if (aAssRecipes.size() > 0 && (CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK || CORE.GTNH)) { - recipe: - for (GT_Recipe aG : aAssRecipes) { + recipe: for (GT_Recipe aG : aAssRecipes) { if (aG.mOutputs != null && aG.mOutputs.length > 0) { - outputs: - for (ItemStack aI : aG.mOutputs) { + outputs: for (ItemStack aI : aG.mOutputs) { if (aI == null) { continue; } @@ -533,19 +523,23 @@ public class HANDLER_GT { int aMeta = aI.getItemDamage(); if (aMeta >= 170 && aMeta <= 176) { // Found a Turbine - int aCutoff = aMeta == 170 - ? CUT + int aCutoff = aMeta == 170 ? CUT : (aMeta == 172 ? CUT * 2 : (aMeta == 174 ? CUT * 3 : CUT * 4)); - String aType = aMeta == 170 - ? "Small " + String aType = aMeta == 170 ? "Small " : (aMeta == 172 ? "" : (aMeta == 174 ? "Large " : "Huge ")); Materials aMainMaterial = GT_MetaGenerated_Tool.getPrimaryMaterial(aI); Materials aSecondaryMaterial = GT_MetaGenerated_Tool.getSecondaryMaterial(aI); long rotorDurabilityMax = GT_MetaGenerated_Tool.getToolMaxDamage(aI); if (rotorDurabilityMax < aCutoff) { - Logger.WARNING("[Turbine Cleanup] " + getMaterialName(aMainMaterial) + " " + aType - + "Turbines have " + rotorDurabilityMax - + ", which is below the cutoff durability of " + aCutoff + ", disabling."); + Logger.WARNING( + "[Turbine Cleanup] " + getMaterialName(aMainMaterial) + + " " + + aType + + "Turbines have " + + rotorDurabilityMax + + ", which is below the cutoff durability of " + + aCutoff + + ", disabling."); aG.mEnabled = false; aG.mHidden = true; aG.mCanBeBuffered = false; diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/energy/IC2ElectricItem.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/energy/IC2ElectricItem.java index d4a7f97051..78b5cced08 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/energy/IC2ElectricItem.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/energy/IC2ElectricItem.java @@ -9,6 +9,7 @@ import net.minecraft.item.ItemStack; * The item should have a maximum damage of 13. */ public interface IC2ElectricItem { + /** * Determine if the item can be used in a machine or as an armor part to supply energy. * @@ -38,8 +39,8 @@ public interface IC2ElectricItem { double getMaxCharge(ItemStack itemStack); /** - * Get the item's tier, lower tiers can't send energy to higher ones. - * Batteries are Tier 1, Energy Crystals are Tier 2, Lapotron Crystals are Tier 3. + * Get the item's tier, lower tiers can't send energy to higher ones. Batteries are Tier 1, Energy Crystals are Tier + * 2, Lapotron Crystals are Tier 3. * * @return Item's tier */ diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/energy/IC2ElectricItemManager.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/energy/IC2ElectricItemManager.java index 4ec01ce63c..007d66de66 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/energy/IC2ElectricItemManager.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/energy/IC2ElectricItemManager.java @@ -6,26 +6,24 @@ import net.minecraft.item.ItemStack; /** * This interface specifies a manager to handle the various tasks for electric items. * - * The default implementation does the following: - * - store and retrieve the charge - * - handle charging, taking amount, tier, transfer limit, canProvideEnergy and simulate into account - * - replace item IDs if appropriate (getChargedItemId() and getEmptyItemId()) - * - update and manage the damage value for the visual charge indicator + * The default implementation does the following: - store and retrieve the charge - handle charging, taking amount, + * tier, transfer limit, canProvideEnergy and simulate into account - replace item IDs if appropriate + * (getChargedItemId() and getEmptyItemId()) - update and manage the damage value for the visual charge indicator * - * @note If you're implementing your own variant (ISpecialElectricItem), you can delegate to the - * default implementations through ElectricItem.rawManager. The default implementation is designed - * to minimize its dependency on its own constraints/structure and delegates most work back to the - * more atomic features in the gateway manager. + * @note If you're implementing your own variant (ISpecialElectricItem), you can delegate to the default implementations + * through ElectricItem.rawManager. The default implementation is designed to minimize its dependency on its own + * constraints/structure and delegates most work back to the more atomic features in the gateway manager. */ public interface IC2ElectricItemManager { + /** * Charge an item with a specified amount of energy. * - * @param itemStack electric item's stack - * @param amount amount of energy to charge in EU - * @param tier tier of the charging device, has to be at least as high as the item to charge + * @param itemStack electric item's stack + * @param amount amount of energy to charge in EU + * @param tier tier of the charging device, has to be at least as high as the item to charge * @param ignoreTransferLimit ignore the transfer limit specified by getTransferLimit() - * @param simulate don't actually change the item, just determine the return value + * @param simulate don't actually change the item, just determine the return value * @return Energy transferred into the electric item */ double charge(ItemStack stack, double amount, int tier, boolean ignoreTransferLimit, boolean simulate); @@ -33,20 +31,15 @@ public interface IC2ElectricItemManager { /** * Discharge an item by a specified amount of energy * - * @param itemStack electric item's stack - * @param amount amount of energy to discharge in EU - * @param tier tier of the discharging device, has to be at least as high as the item to discharge + * @param itemStack electric item's stack + * @param amount amount of energy to discharge in EU + * @param tier tier of the discharging device, has to be at least as high as the item to discharge * @param ignoreTransferLimit ignore the transfer limit specified by getTransferLimit() - * @param externally use the supplied item externally, i.e. to power something else as if it was a battery - * @param simulate don't actually discharge the item, just determine the return value + * @param externally use the supplied item externally, i.e. to power something else as if it was a battery + * @param simulate don't actually discharge the item, just determine the return value * @return Energy retrieved from the electric item */ - double discharge( - ItemStack stack, - double amount, - int tier, - boolean ignoreTransferLimit, - boolean externally, + double discharge(ItemStack stack, double amount, int tier, boolean ignoreTransferLimit, boolean externally, boolean simulate); /** @@ -58,34 +51,34 @@ public interface IC2ElectricItemManager { double getCharge(ItemStack stack); /** - * Determine if the specified electric item has at least a specific amount of EU. - * This is supposed to be used in the item code during operation, for example if you want to implement your own electric item. - * BatPacks are not taken into account. + * Determine if the specified electric item has at least a specific amount of EU. This is supposed to be used in the + * item code during operation, for example if you want to implement your own electric item. BatPacks are not taken + * into account. * * @param itemStack electric item's stack - * @param amount minimum amount of energy required + * @param amount minimum amount of energy required * @return true if there's enough energy */ boolean canUse(ItemStack stack, double amount); /** - * Try to retrieve a specific amount of energy from an Item, and if applicable, a BatPack. - * This is supposed to be used in the item code during operation, for example if you want to implement your own electric item. + * Try to retrieve a specific amount of energy from an Item, and if applicable, a BatPack. This is supposed to be + * used in the item code during operation, for example if you want to implement your own electric item. * * @param itemStack electric item's stack - * @param amount amount of energy to discharge in EU - * @param entity entity holding the item + * @param amount amount of energy to discharge in EU + * @param entity entity holding the item * @return true if the operation succeeded */ boolean use(ItemStack stack, double amount, EntityLivingBase entity); /** - * Charge an item from the BatPack a player is wearing. - * This is supposed to be used in the item code during operation, for example if you want to implement your own electric item. - * use() already contains this functionality. + * Charge an item from the BatPack a player is wearing. This is supposed to be used in the item code during + * operation, for example if you want to implement your own electric item. use() already contains this + * functionality. * * @param itemStack electric item's stack - * @param entity entity holding the item + * @param entity entity holding the item */ void chargeFromArmor(ItemStack stack, EntityLivingBase entity); diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/enums/CustomGtTextures.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/enums/CustomGtTextures.java index a31e728e23..74c9d9ee5b 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/enums/CustomGtTextures.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/enums/CustomGtTextures.java @@ -1,22 +1,25 @@ package gtPlusPlus.xmod.gregtech.api.enums; +import net.minecraft.client.renderer.texture.TextureMap; +import net.minecraft.util.IIcon; +import net.minecraft.util.ResourceLocation; + import gregtech.api.GregTech_API; import gregtech.api.interfaces.IIconContainer; import gregtech.api.interfaces.ITexture; import gregtech.api.objects.GT_RenderedTexture; import gtPlusPlus.core.lib.CORE; -import net.minecraft.client.renderer.texture.TextureMap; -import net.minecraft.util.IIcon; -import net.minecraft.util.ResourceLocation; public class CustomGtTextures { + public enum ItemIcons implements IIconContainer, Runnable { + VOID, // The Empty Texture RENDERING_ERROR, PUMP, SKOOKUMCHOOCHER; - public static final ITexture[] ERROR_RENDERING = new ITexture[] {new GT_RenderedTexture(RENDERING_ERROR)}; + public static final ITexture[] ERROR_RENDERING = new ITexture[] { new GT_RenderedTexture(RENDERING_ERROR) }; protected IIcon mIcon, mOverlay; @@ -46,6 +49,7 @@ public class CustomGtTextures { } public static class CustomIcon implements IIconContainer, Runnable { + protected IIcon mIcon, mOverlay; protected String mIconName; diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/enums/CustomOrePrefix.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/enums/CustomOrePrefix.java index c0c4e6a5c8..fcbbd019a9 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/enums/CustomOrePrefix.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/enums/CustomOrePrefix.java @@ -2,28 +2,14 @@ package gtPlusPlus.xmod.gregtech.api.enums; import static gregtech.api.enums.GT_Values.B; -import gregtech.api.enums.OrePrefixes; import net.minecraftforge.common.util.EnumHelper; +import gregtech.api.enums.OrePrefixes; + public enum CustomOrePrefix { - milled( - "Milled Ores", - "Milled ", - " Ore", - true, - true, - false, - false, - false, - false, - false, - false, - false, - true, - B[3], - -1, - 64, - -1); + + milled("Milled Ores", "Milled ", " Ore", true, true, false, false, false, false, false, false, false, true, B[3], + -1, 64, -1); private final String mRegularLocalName; private final String mLocalizedMaterialPre; @@ -45,24 +31,11 @@ public enum CustomOrePrefix { private OrePrefixes mSelfReference; - private CustomOrePrefix( - String aRegularLocalName, - String aLocalizedMaterialPre, - String aLocalizedMaterialPost, - boolean aIsUnificatable, - boolean aIsMaterialBased, - boolean aIsSelfReferencing, - boolean aIsContainer, - boolean aDontUnificateActively, - boolean aIsUsedForBlocks, - boolean aAllowNormalRecycling, - boolean aGenerateDefaultItem, - boolean aIsEnchantable, - boolean aIsUsedForOreProcessing, - int aMaterialGenerationBits, - long aMaterialAmount, - int aDefaultStackSize, - int aTextureindex) { + private CustomOrePrefix(String aRegularLocalName, String aLocalizedMaterialPre, String aLocalizedMaterialPost, + boolean aIsUnificatable, boolean aIsMaterialBased, boolean aIsSelfReferencing, boolean aIsContainer, + boolean aDontUnificateActively, boolean aIsUsedForBlocks, boolean aAllowNormalRecycling, + boolean aGenerateDefaultItem, boolean aIsEnchantable, boolean aIsUsedForOreProcessing, + int aMaterialGenerationBits, long aMaterialAmount, int aDefaultStackSize, int aTextureindex) { mRegularLocalName = aRegularLocalName; mLocalizedMaterialPre = aLocalizedMaterialPre; @@ -88,44 +61,13 @@ public enum CustomOrePrefix { mSelfReference = EnumHelper.addEnum( OrePrefixes.class, this.name(), - new Class[] { - String.class, - String.class, - String.class, - boolean.class, - boolean.class, - boolean.class, - boolean.class, - boolean.class, - boolean.class, - boolean.class, - boolean.class, - boolean.class, - boolean.class, - int.class, - long.class, - int.class, - int.class - }, - new Object[] { - mRegularLocalName, - mLocalizedMaterialPre, - mLocalizedMaterialPost, - mIsUnificatable, - mIsMaterialBased, - mIsSelfReferencing, - mIsContainer, - mDontUnificateActively, - mIsUsedForBlocks, - mAllowNormalRecycling, - mGenerateDefaultItem, - mIsEnchantable, - mIsUsedForOreProcessing, - mMaterialGenerationBits, - mMaterialAmount, - mDefaultStackSize, - mTextureindex - }); + new Class[] { String.class, String.class, String.class, boolean.class, boolean.class, boolean.class, + boolean.class, boolean.class, boolean.class, boolean.class, boolean.class, boolean.class, + boolean.class, int.class, long.class, int.class, int.class }, + new Object[] { mRegularLocalName, mLocalizedMaterialPre, mLocalizedMaterialPost, mIsUnificatable, + mIsMaterialBased, mIsSelfReferencing, mIsContainer, mDontUnificateActively, mIsUsedForBlocks, + mAllowNormalRecycling, mGenerateDefaultItem, mIsEnchantable, mIsUsedForOreProcessing, + mMaterialGenerationBits, mMaterialAmount, mDefaultStackSize, mTextureindex }); return mSelfReference != null; } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java index 355b1c7477..2506af7af5 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java @@ -2,15 +2,16 @@ package gtPlusPlus.xmod.gregtech.api.enums; import static gregtech.api.enums.GT_Values.W; -import gregtech.api.util.GT_ModHandler; -import gregtech.api.util.GT_OreDictUnificator; -import gregtech.api.util.GT_Utility; -import gtPlusPlus.xmod.gregtech.api.interfaces.GregtechItemContainer; import net.minecraft.block.Block; import net.minecraft.init.Blocks; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; +import gregtech.api.util.GT_ModHandler; +import gregtech.api.util.GT_OreDictUnificator; +import gregtech.api.util.GT_Utility; +import gtPlusPlus.xmod.gregtech.api.interfaces.GregtechItemContainer; + /** * Class containing all non-OreDict Items of GregTech. */ @@ -308,7 +309,7 @@ public enum GregtechItemList implements GregtechItemContainer { Casing_Reactor_II, // Multitank - /*Industrial_MultiTank,*/ + /* Industrial_MultiTank, */ Industrial_MultiTankDense, Casing_MultitankExterior, @@ -379,9 +380,9 @@ public enum GregtechItemList implements GregtechItemContainer { Casing_Multi_Use, // Bedrock Mining Platforms - /*BedrockMiner_MKI, */ - /*BedrockMiner_MKII, */ - /*BedrockMiner_MKIII, */ + /* BedrockMiner_MKI, */ + /* BedrockMiner_MKII, */ + /* BedrockMiner_MKIII, */ Casing_BedrockMiner, // Large Packager @@ -413,7 +414,7 @@ public enum GregtechItemList implements GregtechItemContainer { Casing_Naq_Reactor_A, Casing_Naq_Reactor_B, Casing_Naq_Reactor_C, - /*Controller_Naq_Reactor, */ + /* Controller_Naq_Reactor, */ Casing_Containment, // Arc Furnace @@ -757,7 +758,7 @@ public enum GregtechItemList implements GregtechItemContainer { Charger_MAX, // Tiny Fusion - /*Miniature_Fusion, */ + /* Miniature_Fusion, */ // Component Makers Machine_LV_Component_Maker, @@ -932,7 +933,7 @@ public enum GregtechItemList implements GregtechItemContainer { GT_Chisel_HV, // Plasma Tank - /*Plasma_Tank,*/ + /* Plasma_Tank, */ // ---------------------------------------------------------------------------- @@ -968,11 +969,11 @@ public enum GregtechItemList implements GregtechItemContainer { FakeMachineCasingPlate_UV, FakeMachineCasingPlate_MAX, -// ---------------------------------------------------------------------------- + // ---------------------------------------------------------------------------- -; + ; - public static final GregtechItemList[] DYE_ONLY_ITEMS = {Energy_Buffer_1by1_EV, Energy_Buffer_1by1_EV}; + public static final GregtechItemList[] DYE_ONLY_ITEMS = { Energy_Buffer_1by1_EV, Energy_Buffer_1by1_EV }; private ItemStack mStack; private boolean mHasNotBeenSet = true; @@ -1028,8 +1029,8 @@ public enum GregtechItemList implements GregtechItemContainer { if (GT_Utility.isStackInvalid(aStack)) { return false; } - return GT_Utility.areUnificationsEqual( - (ItemStack) aStack, aWildcard ? this.getWildcard(1) : this.get(1), aIgnoreNBT); + return GT_Utility + .areUnificationsEqual((ItemStack) aStack, aWildcard ? this.getWildcard(1) : this.get(1), aIgnoreNBT); } public static Block getBlockFromStack(Object aStack) { @@ -1078,8 +1079,8 @@ public enum GregtechItemList implements GregtechItemContainer { if (GT_Utility.isStackInvalid(this.mStack)) { return GT_Utility.copyAmount(aAmount, aReplacements); } - return GT_Utility.copyAmountAndMetaData( - aAmount, this.mStack.getMaxDamage() - 1, GT_OreDictUnificator.get(this.mStack)); + return GT_Utility + .copyAmountAndMetaData(aAmount, this.mStack.getMaxDamage() - 1, GT_OreDictUnificator.get(this.mStack)); } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/enums/GregtechOreDictNames.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/enums/GregtechOreDictNames.java index b535236575..4bd8831098 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/enums/GregtechOreDictNames.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/enums/GregtechOreDictNames.java @@ -1,29 +1,18 @@ package gtPlusPlus.xmod.gregtech.api.enums; -/* Electric Components. - * - * usual Materials for this are: - * Primitive (Tier 1) - * Basic (Tier 2) as used by UE as well : IC2 Circuit and RE-Battery - * Good (Tier 3) - * Advanced (Tier 4) as used by UE as well : Advanced Circuit, Advanced Battery and Lithium Battery - * Data (Tier 5) : Data Storage Circuit - * Elite (Tier 6) as used by UE as well : Energy Crystal and Data Control Circuit - * Master (Tier 7) : Energy Flow Circuit and Lapotron Crystal - * Ultimate (Tier 8) : Data Orb and Lapotronic Energy Orb - * Infinite (Cheaty) - * -Circuits - Circuit_Primitive, Circuit_Basic, Circuit_Good, Circuit_Advanced, - Circuit_Data, Circuit_Elite, Circuit_Master, Tool_DataOrb, Circuit_Ultimate, Tool_DataStick, - Circuit_IV, Circuit_LuV, Circuit_ZPM, -Circuit Parts - Circuit_Board_IV, Circuit_Board_LuV, Circuit_Board_ZPM, - Circuit_Parts_Crystal_Chip_IV, Circuit_Parts_Crystal_Chip_LuV, Circuit_Parts_Crystal_Chip_ZPM, - Circuit_Parts_IV, Circuit_Parts_LuV, Circuit_Parts_ZPM, - Circuit_Parts_Wiring_IV, Circuit_Parts_Wiring_LuV, Circuit_Parts_Wiring_ZPM; +/* + * Electric Components. usual Materials for this are: Primitive (Tier 1) Basic (Tier 2) as used by UE as well : IC2 + * Circuit and RE-Battery Good (Tier 3) Advanced (Tier 4) as used by UE as well : Advanced Circuit, Advanced Battery and + * Lithium Battery Data (Tier 5) : Data Storage Circuit Elite (Tier 6) as used by UE as well : Energy Crystal and Data + * Control Circuit Master (Tier 7) : Energy Flow Circuit and Lapotron Crystal Ultimate (Tier 8) : Data Orb and + * Lapotronic Energy Orb Infinite (Cheaty) Circuits Circuit_Primitive, Circuit_Basic, Circuit_Good, Circuit_Advanced, + * Circuit_Data, Circuit_Elite, Circuit_Master, Tool_DataOrb, Circuit_Ultimate, Tool_DataStick, Circuit_IV, Circuit_LuV, + * Circuit_ZPM, Circuit Parts Circuit_Board_IV, Circuit_Board_LuV, Circuit_Board_ZPM, Circuit_Parts_Crystal_Chip_IV, + * Circuit_Parts_Crystal_Chip_LuV, Circuit_Parts_Crystal_Chip_ZPM, Circuit_Parts_IV, Circuit_Parts_LuV, + * Circuit_Parts_ZPM, Circuit_Parts_Wiring_IV, Circuit_Parts_Wiring_LuV, Circuit_Parts_Wiring_ZPM; */ public enum GregtechOreDictNames { + buffer_core, itemGregConduit, Circuit_IV, diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/enums/GregtechOrePrefixes.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/enums/GregtechOrePrefixes.java index 03d2741fe3..f71e07f0a3 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/enums/GregtechOrePrefixes.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/enums/GregtechOrePrefixes.java @@ -3,6 +3,13 @@ package gtPlusPlus.xmod.gregtech.api.enums; import static gregtech.api.enums.GT_Values.*; import static gtPlusPlus.core.util.Utils.getTcAspectStack; +import java.util.*; + +import net.minecraft.enchantment.Enchantment; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidStack; + import gregtech.api.enums.*; import gregtech.api.enums.TC_Aspects.TC_AspectStack; import gregtech.api.interfaces.*; @@ -13,486 +20,88 @@ import gtPlusPlus.core.lib.CORE; import gtPlusPlus.xmod.gregtech.api.interfaces.internal.Interface_OreRecipeRegistrator; import gtPlusPlus.xmod.gregtech.api.objects.GregtechItemData; import gtPlusPlus.xmod.gregtech.api.objects.GregtechMaterialStack; -import java.util.*; -import net.minecraft.enchantment.Enchantment; -import net.minecraft.item.ItemStack; -import net.minecraftforge.fluids.Fluid; -import net.minecraftforge.fluids.FluidStack; public enum GregtechOrePrefixes { - /* Electric Components. - * - * usual Materials for this are: - * Primitive (Tier 1) - * Basic (Tier 2) as used by UE as well : IC2 Circuit and RE-Battery - * Good (Tier 3) - * Advanced (Tier 4) as used by UE as well : Advanced Circuit, Advanced Battery and Lithium Battery - * Data (Tier 5) : Data Storage Circuit - * Elite (Tier 6) as used by UE as well : Energy Crystal and Data Control Circuit - * Master (Tier 7) : Energy Flow Circuit and Lapotron Crystal - * Ultimate (Tier 8) : Data Orb and Lapotronic Energy Orb - * Infinite (Cheaty) + + /* + * Electric Components. usual Materials for this are: Primitive (Tier 1) Basic (Tier 2) as used by UE as well : IC2 + * Circuit and RE-Battery Good (Tier 3) Advanced (Tier 4) as used by UE as well : Advanced Circuit, Advanced Battery + * and Lithium Battery Data (Tier 5) : Data Storage Circuit Elite (Tier 6) as used by UE as well : Energy Crystal + * and Data Control Circuit Master (Tier 7) : Energy Flow Circuit and Lapotron Crystal Ultimate (Tier 8) : Data Orb + * and Lapotronic Energy Orb Infinite (Cheaty) */ - ingotHot( - "Hot Ingots", - "Hot ", - " Ingot", - true, - true, - false, - false, - false, - false, - false, - true, - false, - false, - B[1], - M * 1, - 16, - 12), // A hot Ingot, which has to be cooled down by a Vacuum Freezer. - ingot( - "Ingots", "", " Ingot", true, true, false, false, false, false, false, true, false, false, B[1], M * 1, 64, + ingotHot("Hot Ingots", "Hot ", " Ingot", true, true, false, false, false, false, false, true, false, false, B[1], + M * 1, 16, 12), // A hot Ingot, which has to be cooled down by a Vacuum Freezer. + ingot("Ingots", "", " Ingot", true, true, false, false, false, false, false, true, false, false, B[1], M * 1, 64, 11), // A regular Ingot. Introduced by Eloraam - dustTiny( - "Tiny Dusts", - "Tiny Pile of ", - " Dust", - true, - true, - false, - false, - false, - false, - false, - true, - false, - false, - B[0] | B[1] | B[2] | B[3], - M / 9, - 64, - 0), // 1/9th of a Dust. - dustSmall( - "Small Dusts", - "Small Pile of ", - " Dust", - true, - true, - false, - false, - false, - false, - false, - true, - false, - false, - B[0] | B[1] | B[2] | B[3], - M / 4, - 64, - 1), // 1/4th of a Dust. - dustImpure( - "Impure Dusts", - "Impure Pile of ", - " Dust", - true, - true, - false, - false, - false, - false, - false, - true, - false, - true, - B[3], - M * 1, - 64, - 3), // Dust with impurities. 1 Unit of Main Material and 1/9 - 1/4 Unit of secondary Material - dustRefined( - "Refined Dusts", - "Refined Pile of ", - " Dust", - true, - true, - false, - false, - false, - false, - false, - true, - false, - true, - B[3], - M * 1, - 64, - 2), - dustPure( - "Purified Dusts", - "Purified Pile of ", - " Dust", - true, - true, - false, - false, - false, - false, - false, - true, - false, - true, - B[3], - M * 1, - 64, - 4), - dust( - "Dusts", - "", - " Dust", - true, - true, - false, - false, - false, - false, - false, - true, - false, - false, - B[0] | B[1] | B[2] | B[3], - M * 1, - 64, - 2), // Pure Dust worth of one Ingot or Gem. Introduced by Alblaka. - nugget( - "Nuggets", "", " Nugget", true, true, false, false, false, false, false, true, false, false, B[1], M / 9, - 64, 9), // A Nugget. Introduced by Eloraam - plate( - "Plates", - "", - " Plate", - true, - true, - false, - false, - false, - false, - true, - true, - false, - false, - B[1] | B[2], - M * 1, - 64, - 17), // Regular Plate made of one Ingot/Dust. Introduced by Calclavia - block( - "Storage Blocks", - "Block of ", - "", - true, - true, - false, - false, - false, - true, - true, - false, - false, - false, - 0, - M * 9, - 64, - 71), // Storage Block consisting out of 9 Ingots/Gems/Dusts. Introduced by CovertJaguar - gem( - "Gemstones", - "", - "", - true, - true, - true, - false, - false, - false, - true, - true, - false, - false, - B[2], - M * 1, - 64, - 8), // A regular Gem worth one Dust. Introduced by Eloraam - gemChipped( - "Chipped Gemstones", - "Chipped ", - "", - true, - true, - true, - false, - false, - false, - true, - true, - false, - false, - B[2], - M / 4, - 64, - 59), // A regular Gem worth one small Dust. Introduced by TerraFirmaCraft - gemFlawed( - "Flawed Gemstones", - "Flawed ", - "", - true, - true, - true, - false, - false, - false, - true, - true, - false, - false, - B[2], - M / 2, - 64, - 60), // A regular Gem worth two small Dusts. Introduced by TerraFirmaCraft - gemFlawless( - "Flawless Gemstones", - "Flawless ", - "", - true, - true, - true, - false, - false, - false, - true, - true, - false, - false, - B[2], - M * 2, - 32, - 61), // A regular Gem worth two Dusts. Introduced by TerraFirmaCraft - gemExquisite( - "Exquisite Gemstones", - "Exquisite ", - "", - true, - true, - true, - false, - false, - false, - true, - true, - false, - false, - B[2], - M * 4, - 16, - 62), // A regular Gem worth four Dusts. Introduced by TerraFirmaCraft - stick( - "Sticks/Rods", - "", - " Rod", - true, - true, - false, - false, - false, - false, - true, - true, - false, - false, - B[1] | B[2], - M / 2, - 64, - 23), // Stick made of half an Ingot. Introduced by Eloraam - type2( - "16x Wires", - "16x ", - " Wire", - true, - true, - false, - false, - false, - false, - true, - false, - false, - false, - 0, - M * 8, - 64, + dustTiny("Tiny Dusts", "Tiny Pile of ", " Dust", true, true, false, false, false, false, false, true, false, false, + B[0] | B[1] | B[2] | B[3], M / 9, 64, 0), // 1/9th of a Dust. + dustSmall("Small Dusts", "Small Pile of ", " Dust", true, true, false, false, false, false, false, true, false, + false, B[0] | B[1] | B[2] | B[3], M / 4, 64, 1), // 1/4th of a Dust. + dustImpure("Impure Dusts", "Impure Pile of ", " Dust", true, true, false, false, false, false, false, true, false, + true, B[3], M * 1, 64, 3), // Dust with impurities. 1 Unit of Main Material and 1/9 - 1/4 Unit of secondary + // Material + dustRefined("Refined Dusts", "Refined Pile of ", " Dust", true, true, false, false, false, false, false, true, + false, true, B[3], M * 1, 64, 2), + dustPure("Purified Dusts", "Purified Pile of ", " Dust", true, true, false, false, false, false, false, true, false, + true, B[3], M * 1, 64, 4), + dust("Dusts", "", " Dust", true, true, false, false, false, false, false, true, false, false, + B[0] | B[1] | B[2] | B[3], M * 1, 64, 2), // Pure Dust worth of one Ingot or Gem. Introduced by Alblaka. + nugget("Nuggets", "", " Nugget", true, true, false, false, false, false, false, true, false, false, B[1], M / 9, 64, + 9), // A Nugget. Introduced by Eloraam + plate("Plates", "", " Plate", true, true, false, false, false, false, true, true, false, false, B[1] | B[2], M * 1, + 64, 17), // Regular Plate made of one Ingot/Dust. Introduced by Calclavia + block("Storage Blocks", "Block of ", "", true, true, false, false, false, true, true, false, false, false, 0, M * 9, + 64, 71), // Storage Block consisting out of 9 Ingots/Gems/Dusts. Introduced by CovertJaguar + gem("Gemstones", "", "", true, true, true, false, false, false, true, true, false, false, B[2], M * 1, 64, 8), // A + // regular + // Gem + // worth + // one + // Dust. + // Introduced + // by + // Eloraam + gemChipped("Chipped Gemstones", "Chipped ", "", true, true, true, false, false, false, true, true, false, false, + B[2], M / 4, 64, 59), // A regular Gem worth one small Dust. Introduced by TerraFirmaCraft + gemFlawed("Flawed Gemstones", "Flawed ", "", true, true, true, false, false, false, true, true, false, false, B[2], + M / 2, 64, 60), // A regular Gem worth two small Dusts. Introduced by TerraFirmaCraft + gemFlawless("Flawless Gemstones", "Flawless ", "", true, true, true, false, false, false, true, true, false, false, + B[2], M * 2, 32, 61), // A regular Gem worth two Dusts. Introduced by TerraFirmaCraft + gemExquisite("Exquisite Gemstones", "Exquisite ", "", true, true, true, false, false, false, true, true, false, + false, B[2], M * 4, 16, 62), // A regular Gem worth four Dusts. Introduced by TerraFirmaCraft + stick("Sticks/Rods", "", " Rod", true, true, false, false, false, false, true, true, false, false, B[1] | B[2], + M / 2, 64, 23), // Stick made of half an Ingot. Introduced by Eloraam + type2("16x Wires", "16x ", " Wire", true, true, false, false, false, false, true, false, false, false, 0, M * 8, 64, -1), - toolSkookumChoocher( - "Skookum Choocher", - "", - " Skookum Choocher", - true, - true, - false, - false, - false, - false, - true, - true, - false, - false, - B[6], - M * 6, - 16, - 37), // consisting out of 6 Ingots. - toolAngleGrinder( - "Angle Grinder", - "", - "Angle Grinder", - true, - true, - false, - false, - false, - false, - true, - true, - false, - false, - B[6], - M * 6, - 16, - 37), // consisting out of 6 Ingots. - toolElectricSnips( - "Electric Snips", - "", - "Electric Snips", - true, - true, - false, - false, - false, - false, - true, - true, - false, - false, - B[6], - M * 6, - 16, - 37), // consisting out of 6 Ingots. - toolElectricLighter( - "Electric Lighter", - "", - "Electric Lighter", - true, - true, - false, - false, - false, - false, - true, - true, - false, - false, - B[6], - M * 6, - 16, - 37), // consisting out of 6 Ingots. - toolElectricButcherKnife( - "Electric Butcher Knife", - "", - "Electric Butcher Knife", - true, - true, - false, - false, - false, - false, - true, - true, - false, - false, - B[6], - M * 6, - 16, - 37), // consisting out of 6 Ingots. - - batterySingleuse( - "Single Use Batteries", - "", - "", - false, - true, - false, - false, - false, - false, - false, - false, - false, - false, - 0, - -1, - 64, - -1), - battery( - "Reusable Batteries", - "", - "", - false, - true, - false, - false, - false, - false, - false, - false, - false, - false, - 0, - -1, - 64, - -1), // Introduced by Calclavia - circuit( - "Circuits", - "", - "", - true, - true, - false, - false, - false, - false, - false, - false, - false, - false, - 0, - -1, - 64, - -1), // Introduced by Calclavia - chipset( - "Chipsets", - "", - "", - true, - true, - false, - false, - false, - false, - false, - false, - false, - false, - 0, - -1, - 64, - -1), // Introduced by Buildcraft - computer("Computers", "", "", true, true, false, false, true, false, false, false, false, false, 0, -1, 64, -1), - ; // A whole Computer. "computerMaster" = ComputerCube + toolSkookumChoocher("Skookum Choocher", "", " Skookum Choocher", true, true, false, false, false, false, true, true, + false, false, B[6], M * 6, 16, 37), // consisting out of 6 Ingots. + toolAngleGrinder("Angle Grinder", "", "Angle Grinder", true, true, false, false, false, false, true, true, false, + false, B[6], M * 6, 16, 37), // consisting out of 6 Ingots. + toolElectricSnips("Electric Snips", "", "Electric Snips", true, true, false, false, false, false, true, true, false, + false, B[6], M * 6, 16, 37), // consisting out of 6 Ingots. + toolElectricLighter("Electric Lighter", "", "Electric Lighter", true, true, false, false, false, false, true, true, + false, false, B[6], M * 6, 16, 37), // consisting out of 6 Ingots. + toolElectricButcherKnife("Electric Butcher Knife", "", "Electric Butcher Knife", true, true, false, false, false, + false, true, true, false, false, B[6], M * 6, 16, 37), // consisting out of 6 Ingots. + + batterySingleuse("Single Use Batteries", "", "", false, true, false, false, false, false, false, false, false, + false, 0, -1, 64, -1), + battery("Reusable Batteries", "", "", false, true, false, false, false, false, false, false, false, false, 0, -1, + 64, -1), // Introduced by Calclavia + circuit("Circuits", "", "", true, true, false, false, false, false, false, false, false, false, 0, -1, 64, -1), // Introduced + // by + // Calclavia + chipset("Chipsets", "", "", true, true, false, false, false, false, false, false, false, false, 0, -1, 64, -1), // Introduced + // by + // Buildcraft + computer("Computers", "", "", true, true, false, false, true, false, false, false, false, false, 0, -1, 64, -1),; // A + // whole + // Computer. + // "computerMaster" + // = + // ComputerCube public static volatile int VERSION = 508; @@ -503,28 +112,17 @@ public enum GregtechOrePrefixes { public final ArrayList<ItemStack> mPrefixedItems = new ArrayList<>(); public final short mTextureIndex; public final String mRegularLocalName, mLocalizedMaterialPre, mLocalizedMaterialPost; - public final boolean mIsUsedForOreProcessing, - mIsEnchantable, - mIsUnificatable, - mIsMaterialBased, - mIsSelfReferencing, - mIsContainer, - mDontUnificateActively, - mIsUsedForBlocks, - mAllowNormalRecycling, - mGenerateDefaultItem; + public final boolean mIsUsedForOreProcessing, mIsEnchantable, mIsUnificatable, mIsMaterialBased, mIsSelfReferencing, + mIsContainer, mDontUnificateActively, mIsUsedForBlocks, mAllowNormalRecycling, mGenerateDefaultItem; public final List<TC_AspectStack> mAspects = new ArrayList<>(); public final Collection<GregtechOrePrefixes> mFamiliarPrefixes = new HashSet<>(); /** - * Used to determine the amount of Material this Prefix contains. - * Multiply or Divide GregTech_API.MATERIAL_UNIT to get the Amounts in comparision to one Ingot. - * 0 = Null - * Negative = Undefined Amount + * Used to determine the amount of Material this Prefix contains. Multiply or Divide GregTech_API.MATERIAL_UNIT to + * get the Amounts in comparision to one Ingot. 0 = Null Negative = Undefined Amount */ public final long mMaterialAmount; - private final Collection<Materials> mNotGeneratedItems = new HashSet<>(), - mIgnoredMaterials = new HashSet<>(), + private final Collection<Materials> mNotGeneratedItems = new HashSet<>(), mIgnoredMaterials = new HashSet<>(), mGeneratedItems = new HashSet<>(); private final ArrayList<Interface_OreRecipeRegistrator> mOreProcessing = new ArrayList<>(); private final ArrayList<Interface_OreRecipeRegistrator> mOreProcessingFake = new ArrayList<>(); @@ -539,24 +137,12 @@ public enum GregtechOrePrefixes { */ public int mMaterialGenerationBits = 0; - private GregtechOrePrefixes( - final String aRegularLocalName, - final String aLocalizedMaterialPre, - final String aLocalizedMaterialPost, - final boolean aIsUnificatable, - final boolean aIsMaterialBased, - final boolean aIsSelfReferencing, - final boolean aIsContainer, - final boolean aDontUnificateActively, - final boolean aIsUsedForBlocks, - final boolean aAllowNormalRecycling, - final boolean aGenerateDefaultItem, - final boolean aIsEnchantable, - final boolean aIsUsedForOreProcessing, - final int aMaterialGenerationBits, - final long aMaterialAmount, - final int aDefaultStackSize, - final int aTextureindex) { + private GregtechOrePrefixes(final String aRegularLocalName, final String aLocalizedMaterialPre, + final String aLocalizedMaterialPost, final boolean aIsUnificatable, final boolean aIsMaterialBased, + final boolean aIsSelfReferencing, final boolean aIsContainer, final boolean aDontUnificateActively, + final boolean aIsUsedForBlocks, final boolean aAllowNormalRecycling, final boolean aGenerateDefaultItem, + final boolean aIsEnchantable, final boolean aIsUsedForOreProcessing, final int aMaterialGenerationBits, + final long aMaterialAmount, final int aDefaultStackSize, final int aTextureindex) { this.mIsUnificatable = aIsUnificatable; this.mIsMaterialBased = aIsMaterialBased; this.mIsSelfReferencing = aIsSelfReferencing; @@ -599,19 +185,18 @@ public enum GregtechOrePrefixes { getTcAspectStack(TC_Aspects.FABRICO.name(), 1).addToAspectList(this.mAspects); } else if (this.name().startsWith("tool")) { getTcAspectStack(TC_Aspects.INSTRUMENTUM.name(), 2).addToAspectList(this.mAspects); - } else if (this.name().startsWith("gem") - || this.name().startsWith("crystal") - || this.name().startsWith("lens")) { - getTcAspectStack(TC_Aspects.VITREUS.name(), 1).addToAspectList(this.mAspects); - } else if (this.name().startsWith("crate")) { - getTcAspectStack(TC_Aspects.ITER.name(), 2).addToAspectList(this.mAspects); - } else if (this.name().startsWith("circuit")) { - getTcAspectStack("COGNITIO", 1); - } else if (this.name().startsWith("computer")) { - getTcAspectStack("COGNITIO", 4).addToAspectList(this.mAspects); - } else if (this.name().startsWith("battery")) { - getTcAspectStack(TC_Aspects.ELECTRUM.name(), 1).addToAspectList(this.mAspects); - } + } else + if (this.name().startsWith("gem") || this.name().startsWith("crystal") || this.name().startsWith("lens")) { + getTcAspectStack(TC_Aspects.VITREUS.name(), 1).addToAspectList(this.mAspects); + } else if (this.name().startsWith("crate")) { + getTcAspectStack(TC_Aspects.ITER.name(), 2).addToAspectList(this.mAspects); + } else if (this.name().startsWith("circuit")) { + getTcAspectStack("COGNITIO", 1); + } else if (this.name().startsWith("computer")) { + getTcAspectStack("COGNITIO", 4).addToAspectList(this.mAspects); + } else if (this.name().startsWith("battery")) { + getTcAspectStack(TC_Aspects.ELECTRUM.name(), 1).addToAspectList(this.mAspects); + } } public static GregtechOrePrefixes getOrePrefix(final String aOre) { @@ -695,8 +280,7 @@ public enum GregtechOrePrefixes { } public boolean doGenerateItem(final Materials aMaterial) { - return (aMaterial != null) - && (aMaterial != Materials._NULL) + return (aMaterial != null) && (aMaterial != Materials._NULL) && (((aMaterial.mTypes & this.mMaterialGenerationBits) != 0) || this.mGeneratedItems.contains(aMaterial)) && !this.mNotGeneratedItems.contains(aMaterial) @@ -726,16 +310,21 @@ public enum GregtechOrePrefixes { return this.mOreProcessing.add(aRegistrator); } - public void processOre( - final GT_Materials aMaterial, final String aOreDictName, final String aModName, final ItemStack aStack) { + public void processOre(final GT_Materials aMaterial, final String aOreDictName, final String aModName, + final ItemStack aStack) { if ((aMaterial != null) && ((aMaterial != GT_Materials._NULL) || this.mIsSelfReferencing || !this.mIsMaterialBased) && GT_Utility.isStackValid(aStack)) { for (final Interface_OreRecipeRegistrator tRegistrator : this.mOreProcessing) { if (D2) { GT_Log.ore.println( - "Processing '" + aOreDictName + "' with the Prefix '" + this.name() + "' and the Material '" - + aMaterial.name() + "' at " + GT_Utility.getClassName(tRegistrator)); + "Processing '" + aOreDictName + + "' with the Prefix '" + + this.name() + + "' and the Material '" + + aMaterial.name() + + "' at " + + GT_Utility.getClassName(tRegistrator)); } tRegistrator.registerOre(this, aMaterial, aOreDictName, aModName, GT_Utility.copyAmount(1, aStack)); } @@ -743,16 +332,20 @@ public enum GregtechOrePrefixes { } // TODO - public void processOre( - final Materials aMaterial, final String aOreDictName, final String aModName, final ItemStack aStack) { - if ((aMaterial != null) - && ((aMaterial != Materials._NULL) || this.mIsSelfReferencing || !this.mIsMaterialBased) + public void processOre(final Materials aMaterial, final String aOreDictName, final String aModName, + final ItemStack aStack) { + if ((aMaterial != null) && ((aMaterial != Materials._NULL) || this.mIsSelfReferencing || !this.mIsMaterialBased) && GT_Utility.isStackValid(aStack)) { for (final Interface_OreRecipeRegistrator tRegistrator : this.mOreProcessingFake) { if (D2) { GT_Log.ore.println( - "Processing '" + aOreDictName + "' with the Prefix '" + this.name() + "' and the Material '" - + aMaterial.name() + "' at " + GT_Utility.getClassName(tRegistrator)); + "Processing '" + aOreDictName + + "' with the Prefix '" + + this.name() + + "' and the Material '" + + aMaterial.name() + + "' at " + + GT_Utility.getClassName(tRegistrator)); } tRegistrator.registerOre(this, aMaterial, aOreDictName, aModName, GT_Utility.copyAmount(1, aStack)); } @@ -775,727 +368,166 @@ public enum GregtechOrePrefixes { public enum GT_Materials implements IColorModulationContainer, ISubTagContainer { /** - * This is the Default Material returned in case no Material has been found or a NullPointer has been inserted at a location where it shouldn't happen. + * This is the Default Material returned in case no Material has been found or a NullPointer has been inserted + * at a location where it shouldn't happen. * <p/> * Mainly for preventing NullPointer Exceptions and providing Default Values. * * Unknown Material Components. Dead End Section. * - * Alkalus Range 730-799 & 970-998 - * (aMetaItemSubID, TextureSet, aToolSpeed, aToolDurability, aToolQuality, aTypes, R, G, B, Alpha, aLocalName, - * aFuelType, aFuelPower, aMeltingPoint, aBlastFurnaceTemp, aBlastFurnaceRequired, aTransparent, aOreValue, aDensityMultiplier, aDensityDivider, aColor - * this(aMetaItemSubID, aIconSet, aToolSpeed, aToolDurability, aToolQuality, true); + * Alkalus Range 730-799 & 970-998 (aMetaItemSubID, TextureSet, aToolSpeed, aToolDurability, aToolQuality, + * aTypes, R, G, B, Alpha, aLocalName, aFuelType, aFuelPower, aMeltingPoint, aBlastFurnaceTemp, + * aBlastFurnaceRequired, aTransparent, aOreValue, aDensityMultiplier, aDensityDivider, aColor + * this(aMetaItemSubID, aIconSet, aToolSpeed, aToolDurability, aToolQuality, true); * */ - _NULL( - -1, - TextureSet.SET_NONE, - 1.0F, - 0, - 0, - 0, - 255, - 255, - 255, - 0, - "NULL", - 0, - 0, - 0, - 0, - false, - false, - 1, - 1, - 1, - Dyes._NULL, - Element._NULL, - Arrays.asList(getTcAspectStack(TC_Aspects.VACUOS.name(), 1))), + _NULL(-1, TextureSet.SET_NONE, 1.0F, 0, 0, 0, 255, 255, 255, 0, "NULL", 0, 0, 0, 0, false, false, 1, 1, 1, + Dyes._NULL, Element._NULL, Arrays.asList(getTcAspectStack(TC_Aspects.VACUOS.name(), 1))), // Lapis(526, TextureSet.SET_LAPIS, 1.0F, 0, 1, 1 | 4 | 8, 70, 70, 220, 0, "Lapis", 0, 0, -1, 0, false, false, // 3, 1, 1, Dyes.dyeBlue, 2, Arrays.asList(new MaterialStack(Materials.Lazurite, 12), new // MaterialStack(Materials.Sodalite, 2), new MaterialStack(Materials.Pyrite, 1), new // MaterialStack(Materials.Calcite, 1)), Arrays.asList(getTcAspectStack(TC_Aspects.SENSUS, 1))), - Pyrotheum( - 20, - TextureSet.SET_FLUID, - 1.0F, - 0, - 1, - 2 | 16 | 32, - 255, - 128, - 0, - 0, - "Pyrotheum", - 0, - 0, - -1, - 0, - false, - false, - 2, - 3, - 1, - Dyes.dyeYellow, - 2, + Pyrotheum(20, TextureSet.SET_FLUID, 1.0F, 0, 1, 2 | 16 | 32, 255, 128, 0, 0, "Pyrotheum", 0, 0, -1, 0, false, + false, 2, 3, 1, Dyes.dyeYellow, 2, Arrays.asList( new MaterialStack(Materials.Coal, 1), new MaterialStack(Materials.Redstone, 1), new MaterialStack(Materials.Blaze, 1), new MaterialStack(Materials.Sulfur, 1)), Arrays.asList(getTcAspectStack("PRAECANTATIO", 2), getTcAspectStack(TC_Aspects.IGNIS, 1))), - Cryotheum( - 21, - TextureSet.SET_FLUID, - 1.0F, - 0, - 1, - 2 | 16 | 32, - 102, - 178, - 255, - 0, - "Cryotheum", - 0, - 0, - -1, - 0, - false, - false, - 2, - 3, - 1, - Dyes.dyeLightBlue, - 2, + Cryotheum(21, TextureSet.SET_FLUID, 1.0F, 0, 1, 2 | 16 | 32, 102, 178, 255, 0, "Cryotheum", 0, 0, -1, 0, false, + false, 2, 3, 1, Dyes.dyeLightBlue, 2, Arrays.asList( new MaterialStack(Materials.Blizz, 1), new MaterialStack(Materials.Redstone, 1), new MaterialStack(Materials.Snow, 1), new MaterialStack(Materials.Niter, 1)), Arrays.asList(getTcAspectStack("PRAECANTATIO", 2), getTcAspectStack(TC_Aspects.GELUM, 1))), - Ender( - 22, - TextureSet.SET_FLUID, - 1.0F, - 0, - 2, - 1, - 255, - 255, - 255, - 0, - "Ender", - 0, - 0, - -1, - 0, - false, - false, - 3, - 1, - 1, + Ender(22, TextureSet.SET_FLUID, 1.0F, 0, 2, 1, 255, 255, 255, 0, "Ender", 0, 0, -1, 0, false, false, 3, 1, 1, Dyes.dyeGreen), /** * Circuitry, Batteries and other Technical things */ - Symbiotic( - -1, - TextureSet.SET_NONE, - 1.0F, - 0, - 0, - 0, - 255, - 255, - 255, - 0, - "IV Tier", - 0, - 0, - -1, - 0, - false, - false, - 1, - 1, - 1, - Dyes.dyeLightGray, + Symbiotic(-1, TextureSet.SET_NONE, 1.0F, 0, 0, 0, 255, 255, 255, 0, "IV Tier", 0, 0, -1, 0, false, false, 1, 1, + 1, Dyes.dyeLightGray, Arrays.asList(getTcAspectStack(TC_Aspects.ELECTRUM, 4), getTcAspectStack(TC_Aspects.MACHINA, 4))), - Neutronic( - -1, - TextureSet.SET_NONE, - 1.0F, - 0, - 0, - 0, - 255, - 255, - 255, - 0, - "LuV Tier", - 0, - 0, - -1, - 0, - false, - false, - 1, - 1, - 1, - Dyes.dyeLightGray, + Neutronic(-1, TextureSet.SET_NONE, 1.0F, 0, 0, 0, 255, 255, 255, 0, "LuV Tier", 0, 0, -1, 0, false, false, 1, 1, + 1, Dyes.dyeLightGray, Arrays.asList(getTcAspectStack(TC_Aspects.ELECTRUM, 6), getTcAspectStack(TC_Aspects.MACHINA, 6))), - Quantum( - -1, - TextureSet.SET_NONE, - 1.0F, - 0, - 0, - 0, - 255, - 255, - 255, - 0, - "ZPM Tier", - 0, - 0, - -1, - 0, - false, - false, - 1, - 1, - 1, - Dyes.dyeLightGray, + Quantum(-1, TextureSet.SET_NONE, 1.0F, 0, 0, 0, 255, 255, 255, 0, "ZPM Tier", 0, 0, -1, 0, false, false, 1, 1, + 1, Dyes.dyeLightGray, Arrays.asList(getTcAspectStack(TC_Aspects.ELECTRUM, 8), getTcAspectStack(TC_Aspects.MACHINA, 8))), - Superconductor( - -1, - TextureSet.SET_NONE, - 1.0F, - 0, - 0, - 0, - 190, - 240, - 190, - 0, - "Superconductor", - 0, - 0, - -1, - 0, - false, - false, - 1, - 1, - 1, - Dyes.dyeGreen, - Arrays.asList(getTcAspectStack(TC_Aspects.ELECTRUM, 8))), - - Staballoy( - 30, - TextureSet.SET_ROUGH, - 10.0F, - 5120, - 4, - 1 | 2 | 16 | 32 | 64 | 128, - 68, - 75, - 66, - 0, - "Staballoy", - 0, - 0, - 1500, - 2800, - true, - false, - 1, - 3, - 1, - Dyes.dyeGreen, - 2, + Superconductor(-1, TextureSet.SET_NONE, 1.0F, 0, 0, 0, 190, 240, 190, 0, "Superconductor", 0, 0, -1, 0, false, + false, 1, 1, 1, Dyes.dyeGreen, Arrays.asList(getTcAspectStack(TC_Aspects.ELECTRUM, 8))), + + Staballoy(30, TextureSet.SET_ROUGH, 10.0F, 5120, 4, 1 | 2 | 16 | 32 | 64 | 128, 68, 75, 66, 0, "Staballoy", 0, + 0, 1500, 2800, true, false, 1, 3, 1, Dyes.dyeGreen, 2, Arrays.asList(new MaterialStack(Materials.Titanium, 1), new MaterialStack(Materials.Uranium, 9)), Arrays.asList(getTcAspectStack(TC_Aspects.METALLUM, 8), getTcAspectStack(TC_Aspects.STRONTIO, 3))), - Bedrockium( - 31, - TextureSet.SET_FINE, - 8.0F, - 8196, - 3, - 1 | 2 | 16 | 32 | 64 | 128, - 39, - 39, - 39, - 0, - "Bedrockium", - 0, - 0, - -1, - 0, - false, - false, - 1, - 5, - 1, - Dyes.dyeLightGray, - 2, + Bedrockium(31, TextureSet.SET_FINE, 8.0F, 8196, 3, 1 | 2 | 16 | 32 | 64 | 128, 39, 39, 39, 0, "Bedrockium", 0, + 0, -1, 0, false, false, 1, 5, 1, Dyes.dyeLightGray, 2, Arrays.asList(new MaterialStack(Materials.Carbon, 63), new MaterialStack(Materials.Carbon, 56)), Arrays.asList(getTcAspectStack(TC_Aspects.VACUOS, 8), getTcAspectStack(TC_Aspects.TUTAMEN, 3))), - BloodSteel( - 32, - TextureSet.SET_METALLIC, - 11.0F, - 768, - 4, - 1 | 2 | 16 | 32 | 64 | 128, - 142, - 28, - 0, - 0, - "Blood Steel", - 0, - 0, - -1, - 0, - false, - false, - 1, - 1, - 1, - Dyes.dyeRed, - 2, + BloodSteel(32, TextureSet.SET_METALLIC, 11.0F, 768, 4, 1 | 2 | 16 | 32 | 64 | 128, 142, 28, 0, 0, "Blood Steel", + 0, 0, -1, 0, false, false, 1, 1, 1, Dyes.dyeRed, 2, Arrays.asList(new MaterialStack(Materials.Steel, 3)), Arrays.asList(getTcAspectStack(TC_Aspects.VICTUS, 8), getTcAspectStack(TC_Aspects.IGNIS, 3))), - Void( - 33, - TextureSet.SET_METALLIC, - 6.0F, - 1280, - 3, - 1 | 2 | 16 | 32 | 64 | 128, - 82, - 17, - 82, - 0, - "Void Metal", - 0, - 0, - -1, - 0, - false, - false, - 3, - 1, - 1, - Dyes.dyeBlack, + Void(33, TextureSet.SET_METALLIC, 6.0F, 1280, 3, 1 | 2 | 16 | 32 | 64 | 128, 82, 17, 82, 0, "Void Metal", 0, 0, + -1, 0, false, false, 3, 1, 1, Dyes.dyeBlack, Arrays.asList(getTcAspectStack("PRAECANTATIO", 5), getTcAspectStack(TC_Aspects.VACUOS, 7))), - ConductiveIron( - 34, - TextureSet.SET_METALLIC, - 5.0F, - 256, - 2, - 1 | 2, - 164, - 109, - 100, - 0, - "Conductive Iron", - 0, - 0, - -1, - 0, - false, - false, - 3, - 1, - 1, - Dyes.dyeRed, - 2, + ConductiveIron(34, TextureSet.SET_METALLIC, 5.0F, 256, 2, 1 | 2, 164, 109, 100, 0, "Conductive Iron", 0, 0, -1, + 0, false, false, 3, 1, 1, Dyes.dyeRed, 2, Arrays.asList(new MaterialStack(Materials.Iron, 6), new MaterialStack(Materials.Redstone, 2)), Arrays.asList(getTcAspectStack(TC_Aspects.POTENTIA, 2), getTcAspectStack(TC_Aspects.METALLUM, 2))), - ElectricalSteel( - 35, - TextureSet.SET_METALLIC, - 7.0F, - 768, - 3, - 1 | 2 | 64 | 128, - 194, - 194, - 194, - 0, - "Electrical Steel", - 0, - 0, - 1811, - 1000, - true, - false, - 3, - 1, - 1, - Dyes.dyeLightGray, - 2, + ElectricalSteel(35, TextureSet.SET_METALLIC, 7.0F, 768, 3, 1 | 2 | 64 | 128, 194, 194, 194, 0, + "Electrical Steel", 0, 0, 1811, 1000, true, false, 3, 1, 1, Dyes.dyeLightGray, 2, Arrays.asList( new MaterialStack(Materials.Iron, 3), new MaterialStack(Materials.Coal, 2), new MaterialStack(Materials.Silicon, 2)), Arrays.asList(getTcAspectStack(TC_Aspects.MAGNETO, 2), getTcAspectStack(TC_Aspects.ELECTRUM, 5))), - EnergeticAlloy( - 36, - TextureSet.SET_SHINY, - 5.0F, - 512, - 3, - 1 | 2 | 64 | 128, - 252, - 152, - 45, - 0, - "Energetic Alloy", - 0, - 0, - -1, - 0, - false, - false, - 3, - 1, - 1, - Dyes.dyeOrange, - 2, + EnergeticAlloy(36, TextureSet.SET_SHINY, 5.0F, 512, 3, 1 | 2 | 64 | 128, 252, 152, 45, 0, "Energetic Alloy", 0, + 0, -1, 0, false, false, 3, 1, 1, Dyes.dyeOrange, 2, Arrays.asList( new MaterialStack(Materials.Gold, 3), new MaterialStack(Materials.Glowstone, 2), new MaterialStack(Materials.Redstone, 2)), Arrays.asList(getTcAspectStack(TC_Aspects.POTENTIA, 4), getTcAspectStack(TC_Aspects.LUX, 3))), - VibrantAlloy( - 37, - TextureSet.SET_SHINY, - 7.0F, - 1280, - 4, - 1 | 2 | 64 | 128, - 204, - 242, - 142, - 0, - "Vibrant Alloy", - 0, - 0, - -1, - 0, - false, - false, - 3, - 1, - 1, - Dyes.dyeLime, - 2, + VibrantAlloy(37, TextureSet.SET_SHINY, 7.0F, 1280, 4, 1 | 2 | 64 | 128, 204, 242, 142, 0, "Vibrant Alloy", 0, 0, + -1, 0, false, false, 3, 1, 1, Dyes.dyeLime, 2, Arrays.asList( - new MaterialStack(Materials.EnergeticAlloy, 1), new MaterialStack(Materials.EnderPearl, 3)), + new MaterialStack(Materials.EnergeticAlloy, 1), + new MaterialStack(Materials.EnderPearl, 3)), Arrays.asList(getTcAspectStack(TC_Aspects.MACHINA, 5), getTcAspectStack(TC_Aspects.TELUM, 4))), - PulsatingIron( - 38, - TextureSet.SET_SHINY, - 5.0F, - 256, - 2, - 1 | 2 | 64 | 128, - 50, - 91, - 21, - 0, - "Pulsating Iron", - 0, - 0, - -1, - 0, - false, - false, - 3, - 1, - 1, - Dyes.dyeGreen, - 2, + PulsatingIron(38, TextureSet.SET_SHINY, 5.0F, 256, 2, 1 | 2 | 64 | 128, 50, 91, 21, 0, "Pulsating Iron", 0, 0, + -1, 0, false, false, 3, 1, 1, Dyes.dyeGreen, 2, Arrays.asList(new MaterialStack(Materials.Iron, 2), new MaterialStack(Materials.EnderPearl, 2)), Arrays.asList(getTcAspectStack(TC_Aspects.ALIENIS, 3), getTcAspectStack(TC_Aspects.METALLUM, 3))), - /* TODO*/ RedstoneAlloy( - 39, - TextureSet.SET_METALLIC, - 1.0F, - 256, - 2, - 1 | 2 | 16 | 32 | 64, - 178, - 34, - 34, - 0, - "Redstone Alloy", - 0, - 0, - -1, - 0, - false, - false, - 3, - 1, - 1, - Dyes.dyeRed, - 2, + /* TODO */ RedstoneAlloy(39, TextureSet.SET_METALLIC, 1.0F, 256, 2, 1 | 2 | 16 | 32 | 64, 178, 34, 34, 0, + "Redstone Alloy", 0, 0, -1, 0, false, false, 3, 1, 1, Dyes.dyeRed, 2, Arrays.asList(new MaterialStack(Materials.Iron, 2), new MaterialStack(Materials.Redstone, 4))), // Needs more Use, I think. - Tantalloy60( - 40, - TextureSet.SET_DULL, - 8.0F, - 5120, - 3, - 1 | 2 | 16 | 32 | 64 | 128, - 68, - 75, - 166, - 0, - "Tantalloy-60", - 0, - 0, - 3035, - 2200, - true, - false, - 1, - 2, - 1, - Dyes.dyeLightBlue, - 2, + Tantalloy60(40, TextureSet.SET_DULL, 8.0F, 5120, 3, 1 | 2 | 16 | 32 | 64 | 128, 68, 75, 166, 0, "Tantalloy-60", + 0, 0, 3035, 2200, true, false, 1, 2, 1, Dyes.dyeLightBlue, 2, Arrays.asList(new MaterialStack(Materials.Tungsten, 1), new MaterialStack(Materials.Tantalum, 9)), Arrays.asList(getTcAspectStack(TC_Aspects.METALLUM, 8), getTcAspectStack(TC_Aspects.STRONTIO, 3))), - Tantalloy61( - 41, - TextureSet.SET_DULL, - 7.0F, - 5120, - 2, - 1 | 2 | 16 | 32 | 64 | 128, - 122, - 135, - 196, - 0, - "Tantalloy-61", - 0, - 0, - 3015, - 2150, - true, - false, - 1, - 2, - 1, - Dyes.dyeLightBlue, - 2, + Tantalloy61(41, TextureSet.SET_DULL, 7.0F, 5120, 2, 1 | 2 | 16 | 32 | 64 | 128, 122, 135, 196, 0, + "Tantalloy-61", 0, 0, 3015, 2150, true, false, 1, 2, 1, Dyes.dyeLightBlue, 2, Arrays.asList( new MaterialStack(Materials.Tungsten, 1), new MaterialStack(Materials.Tantalum, 9), new MaterialStack(Materials.Titanium, 1)), Arrays.asList(getTcAspectStack(TC_Aspects.METALLUM, 8), getTcAspectStack(TC_Aspects.STRONTIO, 3))), - Potin( - 42, - TextureSet.SET_METALLIC, - 7.0F, - 5120, - 2, - 1 | 2 | 16 | 32 | 64 | 128, - 201, - 151, - 129, - 0, - "Potin", - 0, - 0, - 3015, - 2150, - true, - false, - 1, - 2, - 1, - Dyes.dyeLightBlue, - 2, + Potin(42, TextureSet.SET_METALLIC, 7.0F, 5120, 2, 1 | 2 | 16 | 32 | 64 | 128, 201, 151, 129, 0, "Potin", 0, 0, + 3015, 2150, true, false, 1, 2, 1, Dyes.dyeLightBlue, 2, Arrays.asList( new MaterialStack(Materials.Tungsten, 1), new MaterialStack(Materials.Tantalum, 9), new MaterialStack(Materials.Titanium, 1)), Arrays.asList(getTcAspectStack(TC_Aspects.METALLUM, 8), getTcAspectStack(TC_Aspects.STRONTIO, 3))), - Inconel792( - 43, - TextureSet.SET_METALLIC, - 7.0F, - 5120, - 2, - 1 | 2 | 16 | 32 | 64 | 128, - 108, - 240, - 118, - 0, - "Inconel-792", - 0, - 0, - 3015, - 2150, - true, - false, - 1, - 2, - 1, - Dyes.dyeLightBlue, - 2, + Inconel792(43, TextureSet.SET_METALLIC, 7.0F, 5120, 2, 1 | 2 | 16 | 32 | 64 | 128, 108, 240, 118, 0, + "Inconel-792", 0, 0, 3015, 2150, true, false, 1, 2, 1, Dyes.dyeLightBlue, 2, Arrays.asList( new MaterialStack(Materials.Tungsten, 1), new MaterialStack(Materials.Tantalum, 9), new MaterialStack(Materials.Titanium, 1)), Arrays.asList(getTcAspectStack(TC_Aspects.METALLUM, 8), getTcAspectStack(TC_Aspects.STRONTIO, 3))), - Inconel690( - 44, - TextureSet.SET_DULL, - 7.0F, - 5120, - 2, - 1 | 2 | 16 | 32 | 64 | 128, - 118, - 220, - 138, - 0, - "Inconel-690", - 0, - 0, - 3015, - 2150, - true, - false, - 1, - 2, - 1, - Dyes.dyeLightBlue, - 2, + Inconel690(44, TextureSet.SET_DULL, 7.0F, 5120, 2, 1 | 2 | 16 | 32 | 64 | 128, 118, 220, 138, 0, "Inconel-690", + 0, 0, 3015, 2150, true, false, 1, 2, 1, Dyes.dyeLightBlue, 2, Arrays.asList( new MaterialStack(Materials.Tungsten, 1), new MaterialStack(Materials.Tantalum, 9), new MaterialStack(Materials.Titanium, 1)), Arrays.asList(getTcAspectStack(TC_Aspects.METALLUM, 8), getTcAspectStack(TC_Aspects.STRONTIO, 3))), - MaragingSteel300( - 45, - TextureSet.SET_METALLIC, - 7.0F, - 5120, - 2, - 1 | 2 | 16 | 32 | 64 | 128, - 150, - 150, - 150, - 0, - "Maraging Steel 300", - 0, - 0, - 3015, - 2150, - true, - false, - 1, - 2, - 1, - Dyes.dyeLightBlue, - 2, + MaragingSteel300(45, TextureSet.SET_METALLIC, 7.0F, 5120, 2, 1 | 2 | 16 | 32 | 64 | 128, 150, 150, 150, 0, + "Maraging Steel 300", 0, 0, 3015, 2150, true, false, 1, 2, 1, Dyes.dyeLightBlue, 2, Arrays.asList( new MaterialStack(Materials.Tungsten, 1), new MaterialStack(Materials.Tantalum, 9), new MaterialStack(Materials.Titanium, 1)), Arrays.asList(getTcAspectStack(TC_Aspects.METALLUM, 8), getTcAspectStack(TC_Aspects.STRONTIO, 3))), - MaragingSteel350( - 46, - TextureSet.SET_METALLIC, - 7.0F, - 5120, - 2, - 1 | 2 | 16 | 32 | 64 | 128, - 160, - 160, - 160, - 0, - "Maraging Steel 350", - 0, - 0, - 3015, - 2150, - true, - false, - 1, - 2, - 1, - Dyes.dyeLightBlue, - 2, + MaragingSteel350(46, TextureSet.SET_METALLIC, 7.0F, 5120, 2, 1 | 2 | 16 | 32 | 64 | 128, 160, 160, 160, 0, + "Maraging Steel 350", 0, 0, 3015, 2150, true, false, 1, 2, 1, Dyes.dyeLightBlue, 2, Arrays.asList( new MaterialStack(Materials.Tungsten, 1), new MaterialStack(Materials.Tantalum, 9), new MaterialStack(Materials.Titanium, 1)), Arrays.asList(getTcAspectStack(TC_Aspects.METALLUM, 8), getTcAspectStack(TC_Aspects.STRONTIO, 3))), - HastelloyX( - 47, - TextureSet.SET_SHINY, - 7.0F, - 5120, - 2, - 1 | 2 | 16 | 32 | 64 | 128, - 255, - 193, - 37, - 0, - "Hastelloy-X", - 0, - 0, - 3015, - 2150, - true, - false, - 1, - 2, - 1, - Dyes.dyeLightBlue, - 2, + HastelloyX(47, TextureSet.SET_SHINY, 7.0F, 5120, 2, 1 | 2 | 16 | 32 | 64 | 128, 255, 193, 37, 0, "Hastelloy-X", + 0, 0, 3015, 2150, true, false, 1, 2, 1, Dyes.dyeLightBlue, 2, Arrays.asList( new MaterialStack(Materials.Tungsten, 1), new MaterialStack(Materials.Tantalum, 9), new MaterialStack(Materials.Titanium, 1)), Arrays.asList(getTcAspectStack(TC_Aspects.METALLUM, 8), getTcAspectStack(TC_Aspects.STRONTIO, 3))), - TriniumNaquadahCarbonite( - 48, - TextureSet.SET_SHINY, - 7.0F, - 5120, - 2, - 1 | 2 | 16 | 32 | 64 | 128, - 255, - 233, - 0, - 0, - "Trinium Naquadah Carbonite", - 0, - 0, - 3015, - 2150, - true, - false, - 1, - 2, - 1, - Dyes.dyeLightBlue, - 2, + TriniumNaquadahCarbonite(48, TextureSet.SET_SHINY, 7.0F, 5120, 2, 1 | 2 | 16 | 32 | 64 | 128, 255, 233, 0, 0, + "Trinium Naquadah Carbonite", 0, 0, 3015, 2150, true, false, 1, 2, 1, Dyes.dyeLightBlue, 2, Arrays.asList( new MaterialStack(Materials.Tungsten, 1), new MaterialStack(Materials.Tantalum, 9), @@ -1503,289 +535,78 @@ public enum GregtechOrePrefixes { Arrays.asList(getTcAspectStack(TC_Aspects.METALLUM, 8), getTcAspectStack(TC_Aspects.STRONTIO, 3))), // Radioactive Materials - HydrofluoricAcid( - -1, - TextureSet.SET_FLUID, - 1.0F, - 0, - 1, - 2 | 16 | 32, - 200, - 200, - 200, - 0, - "Hydrofluoric Acid", - 0, - 0, - -1, - 0, - false, - false, - 2, - 3, - 1, - Dyes.dyeWhite, - 2, + HydrofluoricAcid(-1, TextureSet.SET_FLUID, 1.0F, 0, 1, 2 | 16 | 32, 200, 200, 200, 0, "Hydrofluoric Acid", 0, 0, + -1, 0, false, false, 2, 3, 1, Dyes.dyeWhite, 2, Arrays.asList( new MaterialStack(Materials.Coal, 1), new MaterialStack(Materials.Redstone, 1), new MaterialStack(Materials.Blaze, 1), new MaterialStack(Materials.Sulfur, 1))), - UraniumHexaFluoride( - -1, - TextureSet.SET_FLUID, - 1.0F, - 0, - 1, - 2 | 16 | 32, - 73, - 220, - 83, - 0, - "Uranium Hexafluoride", - 0, - 0, - -1, - 0, - false, - false, - 2, - 3, - 1, - Dyes.dyeLime, - 2, + UraniumHexaFluoride(-1, TextureSet.SET_FLUID, 1.0F, 0, 1, 2 | 16 | 32, 73, 220, 83, 0, "Uranium Hexafluoride", + 0, 0, -1, 0, false, false, 2, 3, 1, Dyes.dyeLime, 2, Arrays.asList( new MaterialStack(Materials.Coal, 1), new MaterialStack(Materials.Redstone, 1), new MaterialStack(Materials.Blaze, 1), new MaterialStack(Materials.Sulfur, 1))), - UraniumTetraFluoride( - -1, - TextureSet.SET_FLUID, - 1.0F, - 0, - 1, - 2 | 16 | 32, - 73, - 220, - 83, - 0, - "Uranium Tetrafluoride", - 0, - 0, - -1, - 0, - false, - false, - 2, - 3, - 1, - Dyes.dyeLime, - 2, + UraniumTetraFluoride(-1, TextureSet.SET_FLUID, 1.0F, 0, 1, 2 | 16 | 32, 73, 220, 83, 0, "Uranium Tetrafluoride", + 0, 0, -1, 0, false, false, 2, 3, 1, Dyes.dyeLime, 2, Arrays.asList( new MaterialStack(Materials.Coal, 1), new MaterialStack(Materials.Redstone, 1), new MaterialStack(Materials.Blaze, 1), new MaterialStack(Materials.Sulfur, 1))), - ThoriumTetraFluoride( - -1, - TextureSet.SET_FLUID, - 1.0F, - 0, - 1, - 2 | 16 | 32, - 15, - 120, - 15, - 0, - "Thorium Tetrafluoride", - 0, - 0, - -1, - 0, - false, - false, - 2, - 3, - 1, - Dyes.dyeGreen, - 2, + ThoriumTetraFluoride(-1, TextureSet.SET_FLUID, 1.0F, 0, 1, 2 | 16 | 32, 15, 120, 15, 0, "Thorium Tetrafluoride", + 0, 0, -1, 0, false, false, 2, 3, 1, Dyes.dyeGreen, 2, Arrays.asList( new MaterialStack(Materials.Coal, 1), new MaterialStack(Materials.Redstone, 1), new MaterialStack(Materials.Blaze, 1), new MaterialStack(Materials.Sulfur, 1))), - SulfurousAcid( - -1, - TextureSet.SET_FLUID, - 1.0F, - 0, - 1, - 2 | 16 | 32, - 110, - 220, - 30, - 0, - "Sulfurous Acid", - 0, - 0, - -1, - 0, - false, - false, - 2, - 3, - 1, - Dyes.dyeWhite, - 2, + SulfurousAcid(-1, TextureSet.SET_FLUID, 1.0F, 0, 1, 2 | 16 | 32, 110, 220, 30, 0, "Sulfurous Acid", 0, 0, -1, 0, + false, false, 2, 3, 1, Dyes.dyeWhite, 2, Arrays.asList( new MaterialStack(Materials.Coal, 1), new MaterialStack(Materials.Redstone, 1), new MaterialStack(Materials.Blaze, 1), new MaterialStack(Materials.Sulfur, 1))), - SulfurDioxide( - -1, - TextureSet.SET_FLUID, - 1.0F, - 0, - 1, - 2 | 16 | 32, - 150, - 200, - 50, - 0, - "Sulfur Dioxide", - 0, - 0, - -1, - 0, - false, - false, - 2, - 3, - 1, - Dyes.dyeWhite, - 2, + SulfurDioxide(-1, TextureSet.SET_FLUID, 1.0F, 0, 1, 2 | 16 | 32, 150, 200, 50, 0, "Sulfur Dioxide", 0, 0, -1, 0, + false, false, 2, 3, 1, Dyes.dyeWhite, 2, Arrays.asList( new MaterialStack(Materials.Coal, 1), new MaterialStack(Materials.Redstone, 1), new MaterialStack(Materials.Blaze, 1), new MaterialStack(Materials.Sulfur, 1))), - HydrogenChloride( - -1, - TextureSet.SET_FLUID, - 1.0F, - 0, - 1, - 2 | 16 | 32, - 150, - 240, - 90, - 0, - "Hydrogen Chloride", - 0, - 0, - -1, - 0, - false, - false, - 2, - 3, - 1, - Dyes.dyeWhite, - 2, + HydrogenChloride(-1, TextureSet.SET_FLUID, 1.0F, 0, 1, 2 | 16 | 32, 150, 240, 90, 0, "Hydrogen Chloride", 0, 0, + -1, 0, false, false, 2, 3, 1, Dyes.dyeWhite, 2, Arrays.asList( new MaterialStack(Materials.Coal, 1), new MaterialStack(Materials.Redstone, 1), new MaterialStack(Materials.Blaze, 1), new MaterialStack(Materials.Sulfur, 1))), - SulfuricApatite( - -1, - TextureSet.SET_FLUID, - 1.0F, - 0, - 1, - 2 | 16 | 32, - 0, - 105, - 105, - 0, - "Sulfuric Apatite Solution", - 0, - 0, - -1, - 0, - false, - false, - 2, - 3, - 1, - Dyes.dyeWhite, - 2, + SulfuricApatite(-1, TextureSet.SET_FLUID, 1.0F, 0, 1, 2 | 16 | 32, 0, 105, 105, 0, "Sulfuric Apatite Solution", + 0, 0, -1, 0, false, false, 2, 3, 1, Dyes.dyeWhite, 2, Arrays.asList( new MaterialStack(Materials.Coal, 1), new MaterialStack(Materials.Redstone, 1), new MaterialStack(Materials.Blaze, 1), new MaterialStack(Materials.Sulfur, 1))), - SulfuricLithium( - -1, - TextureSet.SET_FLUID, - 1.0F, - 0, - 1, - 2 | 16 | 32, - 0, - 105, - 105, - 0, - "Sulfuric Lithium Solution", - 0, - 0, - -1, - 0, - false, - false, - 2, - 3, - 1, - Dyes.dyeWhite, - 2, + SulfuricLithium(-1, TextureSet.SET_FLUID, 1.0F, 0, 1, 2 | 16 | 32, 0, 105, 105, 0, "Sulfuric Lithium Solution", + 0, 0, -1, 0, false, false, 2, 3, 1, Dyes.dyeWhite, 2, Arrays.asList( new MaterialStack(Materials.Coal, 1), new MaterialStack(Materials.Redstone, 1), new MaterialStack(Materials.Blaze, 1), new MaterialStack(Materials.Sulfur, 1))), - LithiumHydroxide( - -1, - TextureSet.SET_FLUID, - 1.0F, - 0, - 1, - 2 | 16 | 32, - 0, - 105, - 105, - 0, - "Lithium Hydroxide", - 0, - 0, - -1, - 0, - false, - false, - 2, - 3, - 1, - Dyes.dyeWhite, - 2, + LithiumHydroxide(-1, TextureSet.SET_FLUID, 1.0F, 0, 1, 2 | 16 | 32, 0, 105, 105, 0, "Lithium Hydroxide", 0, 0, + -1, 0, false, false, 2, 3, 1, Dyes.dyeWhite, 2, Arrays.asList( new MaterialStack(Materials.Coal, 1), new MaterialStack(Materials.Redstone, 1), new MaterialStack(Materials.Blaze, 1), - new MaterialStack(Materials.Sulfur, 1))), - ; + new MaterialStack(Materials.Sulfur, 1))),; /** * List of all Materials. @@ -1793,25 +614,24 @@ public enum GregtechOrePrefixes { public static final Collection<GT_Materials> VALUES = new HashSet<>(Arrays.asList(values())); static { - /*Primitive.add(SubTag.NO_SMASHING, SubTag.NO_SMELTING); - Basic.add(SubTag.NO_SMASHING, SubTag.NO_SMELTING); - Good.add(SubTag.NO_SMASHING, SubTag.NO_SMELTING); - Advanced.add(SubTag.NO_SMASHING, SubTag.NO_SMELTING); - Data.add(SubTag.NO_SMASHING, SubTag.NO_SMELTING); - Elite.add(SubTag.NO_SMASHING, SubTag.NO_SMELTING); - Master.add(SubTag.NO_SMASHING, SubTag.NO_SMELTING); - Ultimate.add(SubTag.NO_SMASHING, SubTag.NO_SMELTING); - Superconductor.add(SubTag.NO_SMASHING, SubTag.NO_SMELTING); - Infinite.add(SubTag.NO_SMASHING, SubTag.NO_SMELTING);*/ + /* + * Primitive.add(SubTag.NO_SMASHING, SubTag.NO_SMELTING); Basic.add(SubTag.NO_SMASHING, SubTag.NO_SMELTING); + * Good.add(SubTag.NO_SMASHING, SubTag.NO_SMELTING); Advanced.add(SubTag.NO_SMASHING, SubTag.NO_SMELTING); + * Data.add(SubTag.NO_SMASHING, SubTag.NO_SMELTING); Elite.add(SubTag.NO_SMASHING, SubTag.NO_SMELTING); + * Master.add(SubTag.NO_SMASHING, SubTag.NO_SMELTING); Ultimate.add(SubTag.NO_SMASHING, SubTag.NO_SMELTING); + * Superconductor.add(SubTag.NO_SMASHING, SubTag.NO_SMELTING); Infinite.add(SubTag.NO_SMASHING, + * SubTag.NO_SMELTING); + */ Symbiotic.add(SubTag.NO_SMASHING, SubTag.NO_SMELTING); Neutronic.add(SubTag.NO_SMASHING, SubTag.NO_SMELTING); Quantum.add(SubTag.NO_SMASHING, SubTag.NO_SMELTING); } /** - * This Array can be changed dynamically by a Tick Handler in order to get a glowing Effect on all GT Meta Items out of this Material. + * This Array can be changed dynamically by a Tick Handler in order to get a glowing Effect on all GT Meta Items + * out of this Material. */ - public final short[] mRGBa = new short[] {255, 255, 255, 0}, mMoltenRGBa = new short[] {255, 255, 255, 0}; + public final short[] mRGBa = new short[] { 255, 255, 255, 0 }, mMoltenRGBa = new short[] { 255, 255, 255, 0 }; public final TextureSet mIconSet; public final int mMetaItemSubID; @@ -1829,37 +649,22 @@ public enum GregtechOrePrefixes { public String mChemicalFormula = "?", mDefaultLocalName = "null"; public Dyes mColor = Dyes._NULL; public short mMeltingPoint = 0, mBlastFurnaceTemp = 0; - public int mTypes = 0, - mDurability = 16, - mFuelPower = 0, - mFuelType = 0, - mExtraData = 0, - mOreValue = 0, - mOreMultiplier = 1, - mByProductMultiplier = 1, - mSmeltingMultiplier = 1; + public int mTypes = 0, mDurability = 16, mFuelPower = 0, mFuelType = 0, mExtraData = 0, mOreValue = 0, + mOreMultiplier = 1, mByProductMultiplier = 1, mSmeltingMultiplier = 1; public long mDensity = M; public Element mElement = null; - public GT_Materials mDirectSmelting = this, - mOreReplacement = this, - mMacerateInto = this, - mSmeltInto = this, - mArcSmeltInto = this, - mHandleMaterial = this; + public GT_Materials mDirectSmelting = this, mOreReplacement = this, mMacerateInto = this, mSmeltInto = this, + mArcSmeltInto = this, mHandleMaterial = this; public byte mToolQuality = 0; public Fluid mSolid = null, mFluid = null, mGas = null, mPlasma = null; /** - * This Fluid is used as standard Unit for Molten Materials. 1296 is a Molten Block, what means 144 is one Material Unit worth + * This Fluid is used as standard Unit for Molten Materials. 1296 is a Molten Block, what means 144 is one + * Material Unit worth */ public Fluid mStandardMoltenFluid = null; - private GT_Materials( - final int aMetaItemSubID, - final TextureSet aIconSet, - final float aToolSpeed, - final int aToolDurability, - final int aToolQuality, - final boolean aUnificatable) { + private GT_Materials(final int aMetaItemSubID, final TextureSet aIconSet, final float aToolSpeed, + final int aToolDurability, final int aToolQuality, final boolean aUnificatable) { this.mUnificatable = aUnificatable; this.mMaterialInto = this; this.mMetaItemSubID = aMetaItemSubID; @@ -1890,20 +695,17 @@ public enum GregtechOrePrefixes { /** * @param aMetaItemSubID the Sub-ID used in my own MetaItems. Range 0-1000. -1 for no Material - * @param aTypes which kind of Items should be generated. Bitmask as follows: - * 1 = Dusts of all kinds. - * 2 = Dusts, Ingots, Plates, Rods/Sticks, Machine Components and other Metal specific things. - * 4 = Dusts, Gems, Plates, Lenses (if transparent). - * 8 = Dusts, Impure Dusts, crushed Ores, purified Ores, centrifuged Ores etc. - * 16 = Cells - * 32 = Plasma Cells - * 64 = Tool Heads - * 128 = Gears + * @param aTypes which kind of Items should be generated. Bitmask as follows: 1 = Dusts of all + * kinds. 2 = Dusts, Ingots, Plates, Rods/Sticks, Machine Components and other + * Metal specific things. 4 = Dusts, Gems, Plates, Lenses (if transparent). 8 = + * Dusts, Impure Dusts, crushed Ores, purified Ores, centrifuged Ores etc. 16 = + * Cells 32 = Plasma Cells 64 = Tool Heads 128 = Gears * @param aR, aG, aB Color of the Material 0-255 each. * @param aA transparency of the Material Texture. 0 = fully visible, 255 = Invisible. * @param aLocalName The Name used as Default for localization. * @param aFuelType Type of Generator to get Energy from this Material. - * @param aFuelPower EU generated. Will be multiplied by 1000, also additionally multiplied by 2 for Gems. + * @param aFuelPower EU generated. Will be multiplied by 1000, also additionally multiplied by 2 for + * Gems. * @param aAmplificationValue Amount of UUM amplifier gotten from this. * @param aUUMEnergy Amount of EU needed to shape the UUM into this Material. * @param aMeltingPoint Used to determine the smelting Costs in Furnii. @@ -1911,28 +713,12 @@ public enum GregtechOrePrefixes { * @param aBlastFurnaceRequired If this requires a Blast Furnace. * @param aColor Vanilla MC Wool Color which comes the closest to this. */ - private GT_Materials( - final int aMetaItemSubID, - final TextureSet aIconSet, - final float aToolSpeed, - final int aToolDurability, - final int aToolQuality, - final int aTypes, - final int aR, - final int aG, - final int aB, - final int aA, - final String aLocalName, - final int aFuelType, - final int aFuelPower, - final int aMeltingPoint, - final int aBlastFurnaceTemp, - final boolean aBlastFurnaceRequired, - final boolean aTransparent, - final int aOreValue, - final int aDensityMultiplier, - final int aDensityDivider, - final Dyes aColor) { + private GT_Materials(final int aMetaItemSubID, final TextureSet aIconSet, final float aToolSpeed, + final int aToolDurability, final int aToolQuality, final int aTypes, final int aR, final int aG, + final int aB, final int aA, final String aLocalName, final int aFuelType, final int aFuelPower, + final int aMeltingPoint, final int aBlastFurnaceTemp, final boolean aBlastFurnaceRequired, + final boolean aTransparent, final int aOreValue, final int aDensityMultiplier, + final int aDensityDivider, final Dyes aColor) { this(aMetaItemSubID, aIconSet, aToolSpeed, aToolDurability, aToolQuality, true); this.mDefaultLocalName = aLocalName; this.mMeltingPoint = (short) aMeltingPoint; @@ -1959,29 +745,12 @@ public enum GregtechOrePrefixes { } } - private GT_Materials( - final int aMetaItemSubID, - final TextureSet aIconSet, - final float aToolSpeed, - final int aToolDurability, - final int aToolQuality, - final int aTypes, - final int aR, - final int aG, - final int aB, - final int aA, - final String aLocalName, - final int aFuelType, - final int aFuelPower, - final int aMeltingPoint, - final int aBlastFurnaceTemp, - final boolean aBlastFurnaceRequired, - final boolean aTransparent, - final int aOreValue, - final int aDensityMultiplier, - final int aDensityDivider, - final Dyes aColor, - final List<TC_AspectStack> aAspects) { + private GT_Materials(final int aMetaItemSubID, final TextureSet aIconSet, final float aToolSpeed, + final int aToolDurability, final int aToolQuality, final int aTypes, final int aR, final int aG, + final int aB, final int aA, final String aLocalName, final int aFuelType, final int aFuelPower, + final int aMeltingPoint, final int aBlastFurnaceTemp, final boolean aBlastFurnaceRequired, + final boolean aTransparent, final int aOreValue, final int aDensityMultiplier, + final int aDensityDivider, final Dyes aColor, final List<TC_AspectStack> aAspects) { this( aMetaItemSubID, aIconSet, @@ -2010,29 +779,12 @@ public enum GregtechOrePrefixes { /** * @param aElement The Element Enum represented by this Material */ - private GT_Materials( - final int aMetaItemSubID, - final TextureSet aIconSet, - final float aToolSpeed, - final int aToolDurability, - final int aToolQuality, - final int aTypes, - final int aR, - final int aG, - final int aB, - final int aA, - final String aLocalName, - final int aFuelType, - final int aFuelPower, - final int aMeltingPoint, - final int aBlastFurnaceTemp, - final boolean aBlastFurnaceRequired, - final boolean aTransparent, - final int aOreValue, - final int aDensityMultiplier, - final int aDensityDivider, - final Dyes aColor, - final Element aElement, + private GT_Materials(final int aMetaItemSubID, final TextureSet aIconSet, final float aToolSpeed, + final int aToolDurability, final int aToolQuality, final int aTypes, final int aR, final int aG, + final int aB, final int aA, final String aLocalName, final int aFuelType, final int aFuelPower, + final int aMeltingPoint, final int aBlastFurnaceTemp, final boolean aBlastFurnaceRequired, + final boolean aTransparent, final int aOreValue, final int aDensityMultiplier, + final int aDensityDivider, final Dyes aColor, final Element aElement, final List<TC_AspectStack> aAspects) { this( aMetaItemSubID, @@ -2067,29 +819,12 @@ public enum GregtechOrePrefixes { this.mAspects.addAll(aAspects); } - private GT_Materials( - final int aMetaItemSubID, - final TextureSet aIconSet, - final float aToolSpeed, - final int aToolDurability, - final int aToolQuality, - final int aTypes, - final int aR, - final int aG, - final int aB, - final int aA, - final String aLocalName, - final int aFuelType, - final int aFuelPower, - final int aMeltingPoint, - final int aBlastFurnaceTemp, - final boolean aBlastFurnaceRequired, - final boolean aTransparent, - final int aOreValue, - final int aDensityMultiplier, - final int aDensityDivider, - final Dyes aColor, - final int aExtraData, + private GT_Materials(final int aMetaItemSubID, final TextureSet aIconSet, final float aToolSpeed, + final int aToolDurability, final int aToolQuality, final int aTypes, final int aR, final int aG, + final int aB, final int aA, final String aLocalName, final int aFuelType, final int aFuelPower, + final int aMeltingPoint, final int aBlastFurnaceTemp, final boolean aBlastFurnaceRequired, + final boolean aTransparent, final int aOreValue, final int aDensityMultiplier, + final int aDensityDivider, final Dyes aColor, final int aExtraData, final List<MaterialStack> aMaterialList) { this( aMetaItemSubID, @@ -2118,31 +853,13 @@ public enum GregtechOrePrefixes { null); } - private GT_Materials( - final int aMetaItemSubID, - final TextureSet aIconSet, - final float aToolSpeed, - final int aToolDurability, - final int aToolQuality, - final int aTypes, - final int aR, - final int aG, - final int aB, - final int aA, - final String aLocalName, - final int aFuelType, - final int aFuelPower, - final int aMeltingPoint, - final int aBlastFurnaceTemp, - final boolean aBlastFurnaceRequired, - final boolean aTransparent, - final int aOreValue, - final int aDensityMultiplier, - final int aDensityDivider, - final Dyes aColor, - final int aExtraData, - final List<MaterialStack> aMaterialList, - final List<TC_AspectStack> aAspects) { + private GT_Materials(final int aMetaItemSubID, final TextureSet aIconSet, final float aToolSpeed, + final int aToolDurability, final int aToolQuality, final int aTypes, final int aR, final int aG, + final int aB, final int aA, final String aLocalName, final int aFuelType, final int aFuelPower, + final int aMeltingPoint, final int aBlastFurnaceTemp, final boolean aBlastFurnaceRequired, + final boolean aTransparent, final int aOreValue, final int aDensityMultiplier, + final int aDensityDivider, final Dyes aColor, final int aExtraData, + final List<MaterialStack> aMaterialList, final List<TC_AspectStack> aAspects) { this( aMetaItemSubID, aIconSet, @@ -2221,17 +938,16 @@ public enum GregtechOrePrefixes { public static void init(final GT_Config aConfiguration) { for (final GT_Materials tMaterial : VALUES) { final String tString = tMaterial.toString().toLowerCase(); - tMaterial.mHeatDamage = (float) - aConfiguration.get(ConfigCategories.Materials.heatdamage, tString, tMaterial.mHeatDamage); + tMaterial.mHeatDamage = (float) aConfiguration + .get(ConfigCategories.Materials.heatdamage, tString, tMaterial.mHeatDamage); if (tMaterial.mBlastFurnaceRequired) { - tMaterial.mBlastFurnaceRequired = - aConfiguration.get(ConfigCategories.Materials.blastfurnacerequirements, tString, true); + tMaterial.mBlastFurnaceRequired = aConfiguration + .get(ConfigCategories.Materials.blastfurnacerequirements, tString, true); } - if (tMaterial.mBlastFurnaceRequired - && aConfiguration.get( - ConfigCategories.Materials.blastinductionsmelter, - tString, - tMaterial.mBlastFurnaceTemp < 1500)) {} + if (tMaterial.mBlastFurnaceRequired && aConfiguration.get( + ConfigCategories.Materials.blastinductionsmelter, + tString, + tMaterial.mBlastFurnaceTemp < 1500)) {} // GT_ModHandler.ThermalExpansion.addSmelterBlastOre(tMaterial); // tMaterial.mHandleMaterial = (tMaterial == Desh ? tMaterial.mHandleMaterial : tMaterial == Diamond || // tMaterial == Thaumium ? Wood : tMaterial.contains(SubTag.BURNING) ? Blaze : @@ -2320,8 +1036,7 @@ public enum GregtechOrePrefixes { } if ((aMultiplier >= (M * 2)) && !this.mMaterialList.isEmpty()) { return (((this.mElement != null) - || ((this.mMaterialList.size() < 2) - && (this.mMaterialList.get(0).mAmount == 1))) + || ((this.mMaterialList.size() < 2) && (this.mMaterialList.get(0).mAmount == 1))) ? this.mChemicalFormula : "(" + this.mChemicalFormula + ")") + aMultiplier; @@ -2414,8 +1129,8 @@ public enum GregtechOrePrefixes { } /** - * Adds a Material to the List of Byproducts when grinding this Ore. - * Is used for more precise Ore grinding, so that it is possible to choose between certain kinds of Materials. + * Adds a Material to the List of Byproducts when grinding this Ore. Is used for more precise Ore grinding, so + * that it is possible to choose between certain kinds of Materials. */ public GT_Materials addOreByProduct(final GT_Materials aMaterial) { if (!this.mOreByProducts.contains(aMaterial.mMaterialInto)) { @@ -2425,8 +1140,8 @@ public enum GregtechOrePrefixes { } /** - * Adds multiple Materials to the List of Byproducts when grinding this Ore. - * Is used for more precise Ore grinding, so that it is possible to choose between certain kinds of Materials. + * Adds multiple Materials to the List of Byproducts when grinding this Ore. Is used for more precise Ore + * grinding, so that it is possible to choose between certain kinds of Materials. */ public GT_Materials addOreByProducts(final GT_Materials... aMaterials) { for (final GT_Materials tMaterial : aMaterials) { @@ -2438,8 +1153,7 @@ public enum GregtechOrePrefixes { } /** - * If this Ore gives multiple drops of its Main Material. - * Lapis Ore for example gives about 6 drops. + * If this Ore gives multiple drops of its Main Material. Lapis Ore for example gives about 6 drops. */ public GT_Materials setOreMultiplier(final int aOreMultiplier) { if (aOreMultiplier > 0) { @@ -2459,8 +1173,7 @@ public enum GregtechOrePrefixes { } /** - * If this Ore gives multiple drops of its Main Material. - * Lapis Ore for example gives about 6 drops. + * If this Ore gives multiple drops of its Main Material. Lapis Ore for example gives about 6 drops. */ public GT_Materials setSmeltingMultiplier(final int aSmeltingMultiplier) { if (aSmeltingMultiplier > 0) { @@ -2480,8 +1193,8 @@ public enum GregtechOrePrefixes { } /** - * This Material should be the Main Material this Ore gets ground into. - * Example, Chromite giving Chrome or Tungstate giving Tungsten. + * This Material should be the Main Material this Ore gets ground into. Example, Chromite giving Chrome or + * Tungstate giving Tungsten. */ public GT_Materials setOreReplacement(final GT_Materials aMaterial) { if (aMaterial != null) { diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/enums/GregtechTextureSet.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/enums/GregtechTextureSet.java index 4874e84b7b..87d85a578e 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/enums/GregtechTextureSet.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/enums/GregtechTextureSet.java @@ -4,31 +4,20 @@ import gregtech.api.enums.Textures; import gregtech.api.interfaces.IIconContainer; public class GregtechTextureSet { + public static final GregtechTextureSet SET_NONE = new GregtechTextureSet("NONE"), - SET_DULL = new GregtechTextureSet("DULL"), - SET_RUBY = new GregtechTextureSet("RUBY"), - SET_OPAL = new GregtechTextureSet("OPAL"), - SET_LEAF = new GregtechTextureSet("LEAF"), - SET_WOOD = new GregtechTextureSet("WOOD"), - SET_SAND = new GregtechTextureSet("SAND"), - SET_FINE = new GregtechTextureSet("FINE"), - SET_FIERY = new GregtechTextureSet("FIERY"), - SET_FLUID = new GregtechTextureSet("FLUID"), - SET_ROUGH = new GregtechTextureSet("ROUGH"), - SET_PAPER = new GregtechTextureSet("PAPER"), - SET_GLASS = new GregtechTextureSet("GLASS"), - SET_FLINT = new GregtechTextureSet("FLINT"), - SET_LAPIS = new GregtechTextureSet("LAPIS"), - SET_SHINY = new GregtechTextureSet("SHINY"), - SET_SHARDS = new GregtechTextureSet("SHARDS"), - SET_POWDER = new GregtechTextureSet("POWDER"), - SET_QUARTZ = new GregtechTextureSet("QUARTZ"), - SET_EMERALD = new GregtechTextureSet("EMERALD"), - SET_DIAMOND = new GregtechTextureSet("DIAMOND"), - SET_LIGNITE = new GregtechTextureSet("LIGNITE"), - SET_MAGNETIC = new GregtechTextureSet("MAGNETIC"), - SET_METALLIC = new GregtechTextureSet("METALLIC"), - SET_NETHERSTAR = new GregtechTextureSet("NETHERSTAR"), + SET_DULL = new GregtechTextureSet("DULL"), SET_RUBY = new GregtechTextureSet("RUBY"), + SET_OPAL = new GregtechTextureSet("OPAL"), SET_LEAF = new GregtechTextureSet("LEAF"), + SET_WOOD = new GregtechTextureSet("WOOD"), SET_SAND = new GregtechTextureSet("SAND"), + SET_FINE = new GregtechTextureSet("FINE"), SET_FIERY = new GregtechTextureSet("FIERY"), + SET_FLUID = new GregtechTextureSet("FLUID"), SET_ROUGH = new GregtechTextureSet("ROUGH"), + SET_PAPER = new GregtechTextureSet("PAPER"), SET_GLASS = new GregtechTextureSet("GLASS"), + SET_FLINT = new GregtechTextureSet("FLINT"), SET_LAPIS = new GregtechTextureSet("LAPIS"), + SET_SHINY = new GregtechTextureSet("SHINY"), SET_SHARDS = new GregtechTextureSet("SHARDS"), + SET_POWDER = new GregtechTextureSet("POWDER"), SET_QUARTZ = new GregtechTextureSet("QUARTZ"), + SET_EMERALD = new GregtechTextureSet("EMERALD"), SET_DIAMOND = new GregtechTextureSet("DIAMOND"), + SET_LIGNITE = new GregtechTextureSet("LIGNITE"), SET_MAGNETIC = new GregtechTextureSet("MAGNETIC"), + SET_METALLIC = new GregtechTextureSet("METALLIC"), SET_NETHERSTAR = new GregtechTextureSet("NETHERSTAR"), SET_GEM_VERTICAL = new GregtechTextureSet("GEM_VERTICAL"), SET_GEM_HORIZONTAL = new GregtechTextureSet("GEM_HORIZONTAL"); @@ -38,8 +27,8 @@ public class GregtechTextureSet { public GregtechTextureSet(final String aSetName) { this.mSetName = aSetName; this.mTextures[0] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/turbineBlade"); - this.mTextures[1] = - new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/toolHeadSkookumChoocher"); + this.mTextures[1] = new Textures.ItemIcons.CustomIcon( + "materialicons/" + this.mSetName + "/toolHeadSkookumChoocher"); this.mTextures[2] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void"); this.mTextures[3] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void"); this.mTextures[4] = new Textures.ItemIcons.CustomIcon("materialicons/" + this.mSetName + "/void"); diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/enums/GregtechTextures.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/enums/GregtechTextures.java index b4251bd646..dee662ac20 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/enums/GregtechTextures.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/enums/GregtechTextures.java @@ -1,15 +1,18 @@ package gtPlusPlus.xmod.gregtech.api.enums; +import net.minecraft.client.renderer.texture.TextureMap; +import net.minecraft.util.IIcon; +import net.minecraft.util.ResourceLocation; + import gtPlusPlus.core.lib.CORE; import gtPlusPlus.xmod.gregtech.api.interfaces.internal.Interface_IconContainer; import gtPlusPlus.xmod.gregtech.api.interfaces.internal.Interface_Texture; import gtPlusPlus.xmod.gregtech.common.Meta_GT_Proxy; -import net.minecraft.client.renderer.texture.TextureMap; -import net.minecraft.util.IIcon; -import net.minecraft.util.ResourceLocation; public class GregtechTextures { + public enum BlockIcons implements Interface_IconContainer, Runnable { + VOID, LARGECENTRIFUGE1, @@ -30,31 +33,14 @@ public class GregtechTextures { LARGECENTRIFUGE_ACTIVE7, LARGECENTRIFUGE_ACTIVE8, LARGECENTRIFUGE_ACTIVE9; - public static final Interface_IconContainer[] - CENTRIFUGE = - new Interface_IconContainer[] { - LARGECENTRIFUGE1, - LARGECENTRIFUGE2, - LARGECENTRIFUGE3, - LARGECENTRIFUGE4, - LARGECENTRIFUGE5, - LARGECENTRIFUGE6, - LARGECENTRIFUGE7, - LARGECENTRIFUGE8, - LARGECENTRIFUGE9 - }, - CENTRIFUGE_ACTIVE = - new Interface_IconContainer[] { - LARGECENTRIFUGE_ACTIVE1, - LARGECENTRIFUGE_ACTIVE2, - LARGECENTRIFUGE_ACTIVE3, - LARGECENTRIFUGE_ACTIVE4, - LARGECENTRIFUGE_ACTIVE5, - LARGECENTRIFUGE_ACTIVE6, - LARGECENTRIFUGE_ACTIVE7, - LARGECENTRIFUGE_ACTIVE8, - LARGECENTRIFUGE_ACTIVE9 - }; + + public static final Interface_IconContainer[] CENTRIFUGE = new Interface_IconContainer[] { LARGECENTRIFUGE1, + LARGECENTRIFUGE2, LARGECENTRIFUGE3, LARGECENTRIFUGE4, LARGECENTRIFUGE5, LARGECENTRIFUGE6, + LARGECENTRIFUGE7, LARGECENTRIFUGE8, LARGECENTRIFUGE9 }, + CENTRIFUGE_ACTIVE = new Interface_IconContainer[] { LARGECENTRIFUGE_ACTIVE1, LARGECENTRIFUGE_ACTIVE2, + LARGECENTRIFUGE_ACTIVE3, LARGECENTRIFUGE_ACTIVE4, LARGECENTRIFUGE_ACTIVE5, + LARGECENTRIFUGE_ACTIVE6, LARGECENTRIFUGE_ACTIVE7, LARGECENTRIFUGE_ACTIVE8, + LARGECENTRIFUGE_ACTIVE9 }; public static Interface_Texture[] GT_CASING_BLOCKS = new Interface_Texture[64]; @@ -85,6 +71,7 @@ public class GregtechTextures { } public static class CustomIcon implements Interface_IconContainer, Runnable { + protected IIcon mIcon; protected String mIconName; @@ -116,6 +103,7 @@ public class GregtechTextures { } public enum ItemIcons implements Interface_IconContainer, Runnable { + VOID, // The Empty Texture RENDERING_ERROR, // The Purple/Black Texture SKOOKUMCHOOCHER, // The Skookum Tool Texture @@ -124,29 +112,13 @@ public class GregtechTextures { TURBINE_LARGE, TURBINE_HUGE; - /* public static final Interface_IconContainer[] - DURABILITY_BAR = new Interface_IconContainer[]{ - DURABILITY_BAR_0, - DURABILITY_BAR_1, - DURABILITY_BAR_2, - DURABILITY_BAR_3, - DURABILITY_BAR_4, - DURABILITY_BAR_5, - DURABILITY_BAR_6, - DURABILITY_BAR_7, - DURABILITY_BAR_8, - }, - ENERGY_BAR = new Interface_IconContainer[]{ - ENERGY_BAR_0, - ENERGY_BAR_1, - ENERGY_BAR_2, - ENERGY_BAR_3, - ENERGY_BAR_4, - ENERGY_BAR_5, - ENERGY_BAR_6, - ENERGY_BAR_7, - ENERGY_BAR_8, - };*/ + /* + * public static final Interface_IconContainer[] DURABILITY_BAR = new Interface_IconContainer[]{ + * DURABILITY_BAR_0, DURABILITY_BAR_1, DURABILITY_BAR_2, DURABILITY_BAR_3, DURABILITY_BAR_4, DURABILITY_BAR_5, + * DURABILITY_BAR_6, DURABILITY_BAR_7, DURABILITY_BAR_8, }, ENERGY_BAR = new Interface_IconContainer[]{ + * ENERGY_BAR_0, ENERGY_BAR_1, ENERGY_BAR_2, ENERGY_BAR_3, ENERGY_BAR_4, ENERGY_BAR_5, ENERGY_BAR_6, + * ENERGY_BAR_7, ENERGY_BAR_8, }; + */ // public static final Interface_Texture[] ERROR_RENDERING = new Interface_Texture[]{new // GregtechRenderedTexture(RENDERING_ERROR)}; @@ -179,6 +151,7 @@ public class GregtechTextures { } public static class CustomIcon implements Interface_IconContainer, Runnable { + protected IIcon mIcon, mOverlay; protected String mIconName; diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/GTPP_UITextures.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/GTPP_UITextures.java index bd649fea76..26de142e22 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/GTPP_UITextures.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/GTPP_UITextures.java @@ -2,47 +2,47 @@ package gtPlusPlus.xmod.gregtech.api.gui; import static gtPlusPlus.core.lib.CORE.MODID; -import com.gtnewhorizons.modularui.api.drawable.AdaptableUITexture; -import com.gtnewhorizons.modularui.api.drawable.UITexture; import java.util.stream.Collectors; import java.util.stream.IntStream; +import com.gtnewhorizons.modularui.api.drawable.AdaptableUITexture; +import com.gtnewhorizons.modularui.api.drawable.UITexture; + public class GTPP_UITextures { public static final UITexture OVERLAY_SLOT_COAL = UITexture.fullImage(MODID, "gui/overlay_slot/coal"); - public static final UITexture OVERLAY_SLOT_CANISTER_DARK = - UITexture.fullImage(MODID, "gui/overlay_slot/canister_dark"); + public static final UITexture OVERLAY_SLOT_CANISTER_DARK = UITexture + .fullImage(MODID, "gui/overlay_slot/canister_dark"); - public static final AdaptableUITexture BACKGROUND_YELLOW = - AdaptableUITexture.of(MODID, "gui/background/yellow", 176, 166, 4); + public static final AdaptableUITexture BACKGROUND_YELLOW = AdaptableUITexture + .of(MODID, "gui/background/yellow", 176, 166, 4); - public static final AdaptableUITexture SLOT_ITEM_YELLOW = - AdaptableUITexture.of(MODID, "gui/slot/item_yellow", 18, 18, 1); + public static final AdaptableUITexture SLOT_ITEM_YELLOW = AdaptableUITexture + .of(MODID, "gui/slot/item_yellow", 18, 18, 1); public static final AdaptableUITexture[] SLOT_INVENTORY_MANAGER = new AdaptableUITexture[] { - AdaptableUITexture.of(MODID, "gui/slot/red", 18, 18, 1), - AdaptableUITexture.of(MODID, "gui/slot/green", 18, 18, 1), - AdaptableUITexture.of(MODID, "gui/slot/blue", 18, 18, 1), - AdaptableUITexture.of(MODID, "gui/slot/cyan", 18, 18, 1), - AdaptableUITexture.of(MODID, "gui/slot/magenta", 18, 18, 1), - AdaptableUITexture.of(MODID, "gui/slot/yellow", 18, 18, 1), - }; + AdaptableUITexture.of(MODID, "gui/slot/red", 18, 18, 1), + AdaptableUITexture.of(MODID, "gui/slot/green", 18, 18, 1), + AdaptableUITexture.of(MODID, "gui/slot/blue", 18, 18, 1), + AdaptableUITexture.of(MODID, "gui/slot/cyan", 18, 18, 1), + AdaptableUITexture.of(MODID, "gui/slot/magenta", 18, 18, 1), + AdaptableUITexture.of(MODID, "gui/slot/yellow", 18, 18, 1), }; public static final UITexture BUTTON_STANDARD_BRONZE = UITexture.fullImage(MODID, "gui/button/standard_bronze"); public static final UITexture BUTTON_STANDARD_16x16 = UITexture.fullImage(MODID, "gui/button/standard_16x16"); public static final UITexture OVERLAY_SLOT_WEED_EX = UITexture.fullImage(MODID, "gui/overlay_slot/weed_ex"); public static final UITexture OVERLAY_SLOT_FERTILIZER = UITexture.fullImage(MODID, "gui/overlay_slot/fertilizer"); - public static final UITexture OVERLAY_SLOT_ELECTRIC_TOOL = - UITexture.fullImage(MODID, "gui/overlay_slot/electric_tool"); - public static final UITexture OVERLAY_SLOT_PAGE_PRINTED_BRONZE = - UITexture.fullImage(MODID, "gui/overlay_slot/page_printed_bronze"); + public static final UITexture OVERLAY_SLOT_ELECTRIC_TOOL = UITexture + .fullImage(MODID, "gui/overlay_slot/electric_tool"); + public static final UITexture OVERLAY_SLOT_PAGE_PRINTED_BRONZE = UITexture + .fullImage(MODID, "gui/overlay_slot/page_printed_bronze"); public static final UITexture OVERLAY_SLOT_ARROW = UITexture.fullImage(MODID, "gui/overlay_slot/arrow"); - public static final UITexture OVERLAY_SLOT_ARROW_BRONZE = - UITexture.fullImage(MODID, "gui/overlay_slot/arrow_bronze"); - public static final UITexture OVERLAY_SLOT_CRAFT_OUTPUT = - UITexture.fullImage(MODID, "gui/overlay_slot/craft_output"); - public static final UITexture OVERLAY_SLOT_CRAFT_OUTPUT_BRONZE = - UITexture.fullImage(MODID, "gui/overlay_slot/craft_output_bronze"); + public static final UITexture OVERLAY_SLOT_ARROW_BRONZE = UITexture + .fullImage(MODID, "gui/overlay_slot/arrow_bronze"); + public static final UITexture OVERLAY_SLOT_CRAFT_OUTPUT = UITexture + .fullImage(MODID, "gui/overlay_slot/craft_output"); + public static final UITexture OVERLAY_SLOT_CRAFT_OUTPUT_BRONZE = UITexture + .fullImage(MODID, "gui/overlay_slot/craft_output_bronze"); public static final UITexture OVERLAY_SLOT_PARK = UITexture.fullImage(MODID, "gui/overlay_slot/park"); public static final UITexture OVERLAY_SLOT_PARK_BRONZE = UITexture.fullImage(MODID, "gui/overlay_slot/park_bronze"); public static final UITexture OVERLAY_SLOT_INGOT = UITexture.fullImage(MODID, "gui/overlay_slot/ingot"); @@ -50,90 +50,80 @@ public class GTPP_UITextures { public static final UITexture OVERLAY_SLOT_TURBINE = UITexture.fullImage(MODID, "gui/overlay_slot/turbine"); public static final UITexture OVERLAY_SLOT_CHEST = UITexture.fullImage(MODID, "gui/overlay_slot/chest"); public static final UITexture[] OVERLAY_SLOT_INVENTORY_MANAGER_COLOR = new UITexture[] { - UITexture.fullImage(MODID, "gui/overlay_slot/red"), - UITexture.fullImage(MODID, "gui/overlay_slot/green"), - UITexture.fullImage(MODID, "gui/overlay_slot/blue"), - UITexture.fullImage(MODID, "gui/overlay_slot/cyan"), - UITexture.fullImage(MODID, "gui/overlay_slot/magenta"), - UITexture.fullImage(MODID, "gui/overlay_slot/yellow"), - }; + UITexture.fullImage(MODID, "gui/overlay_slot/red"), UITexture.fullImage(MODID, "gui/overlay_slot/green"), + UITexture.fullImage(MODID, "gui/overlay_slot/blue"), UITexture.fullImage(MODID, "gui/overlay_slot/cyan"), + UITexture.fullImage(MODID, "gui/overlay_slot/magenta"), + UITexture.fullImage(MODID, "gui/overlay_slot/yellow"), }; public static final UITexture[] OVERLAY_SLOT_INVENTORY_MANAGER_ARROW = new UITexture[] { - UITexture.fullImage(MODID, "gui/overlay_slot/arrow_red"), - UITexture.fullImage(MODID, "gui/overlay_slot/arrow_green"), - UITexture.fullImage(MODID, "gui/overlay_slot/arrow_blue"), - UITexture.fullImage(MODID, "gui/overlay_slot/arrow_cyan"), - UITexture.fullImage(MODID, "gui/overlay_slot/arrow_magenta"), - UITexture.fullImage(MODID, "gui/overlay_slot/arrow_yellow"), - }; + UITexture.fullImage(MODID, "gui/overlay_slot/arrow_red"), + UITexture.fullImage(MODID, "gui/overlay_slot/arrow_green"), + UITexture.fullImage(MODID, "gui/overlay_slot/arrow_blue"), + UITexture.fullImage(MODID, "gui/overlay_slot/arrow_cyan"), + UITexture.fullImage(MODID, "gui/overlay_slot/arrow_magenta"), + UITexture.fullImage(MODID, "gui/overlay_slot/arrow_yellow"), }; - public static final UITexture PROGRESSBAR_FLUID_REACTOR = - UITexture.fullImage(MODID, "gui/progressbar/fluid_reactor"); + public static final UITexture PROGRESSBAR_FLUID_REACTOR = UITexture + .fullImage(MODID, "gui/progressbar/fluid_reactor"); public static final UITexture PROGRESSBAR_BOILER_EMPTY = UITexture.fullImage(MODID, "gui/progressbar/boiler_empty"); public static final UITexture PROGRESSBAR_FUEL = UITexture.fullImage(MODID, "gui/progressbar/fuel"); public static final UITexture PROGRESSBAR_ARROW_2 = UITexture.fullImage(MODID, "gui/progressbar/arrow_2"); - public static final UITexture PROGRESSBAR_COMPUTER_ENERGY = - UITexture.fullImage(MODID, "gui/progressbar/computer_energy"); + public static final UITexture PROGRESSBAR_COMPUTER_ENERGY = UITexture + .fullImage(MODID, "gui/progressbar/computer_energy"); public static final UITexture PROGRESSBAR_PSS_ENERGY = UITexture.fullImage(MODID, "gui/progressbar/pss_energy"); - public static final AdaptableUITexture TAB_TITLE_YELLOW = - AdaptableUITexture.of(MODID, "gui/tab/title_yellow", 28, 28, 4); - public static final AdaptableUITexture TAB_TITLE_ANGULAR_YELLOW = - AdaptableUITexture.of(MODID, "gui/tab/title_angular_yellow", 28, 28, 4); - public static final AdaptableUITexture TAB_TITLE_DARK_YELLOW = - AdaptableUITexture.of(MODID, "gui/tab/title_dark_yellow", 28, 28, 4); + public static final AdaptableUITexture TAB_TITLE_YELLOW = AdaptableUITexture + .of(MODID, "gui/tab/title_yellow", 28, 28, 4); + public static final AdaptableUITexture TAB_TITLE_ANGULAR_YELLOW = AdaptableUITexture + .of(MODID, "gui/tab/title_angular_yellow", 28, 28, 4); + public static final AdaptableUITexture TAB_TITLE_DARK_YELLOW = AdaptableUITexture + .of(MODID, "gui/tab/title_dark_yellow", 28, 28, 4); - public static final UITexture OVERLAY_BUTTON_HARVESTER_MODE = - UITexture.fullImage(MODID, "gui/overlay_button/harvester_mode"); + public static final UITexture OVERLAY_BUTTON_HARVESTER_MODE = UITexture + .fullImage(MODID, "gui/overlay_button/harvester_mode"); public static final UITexture OVERLAY_BUTTON_FLUSH = UITexture.fullImage(MODID, "gui/overlay_button/flush"); - public static final UITexture OVERLAY_BUTTON_FLUSH_BRONZE = - UITexture.fullImage(MODID, "gui/overlay_button/flush_bronze"); - public static final UITexture OVERLAY_BUTTON_AUTOMATION = - UITexture.fullImage(MODID, "gui/overlay_button/automation"); + public static final UITexture OVERLAY_BUTTON_FLUSH_BRONZE = UITexture + .fullImage(MODID, "gui/overlay_button/flush_bronze"); + public static final UITexture OVERLAY_BUTTON_AUTOMATION = UITexture + .fullImage(MODID, "gui/overlay_button/automation"); public static final UITexture OVERLAY_BUTTON_LOCK = UITexture.fullImage(MODID, "gui/overlay_button/lock"); - public static final UITexture[] OVERLAY_BUTTON_THROUGHPUT = IntStream.range( - 0, 4) // GT_MetaTileEntity_ElectricAutoWorkbench#MAX_THROUGHPUT + public static final UITexture[] OVERLAY_BUTTON_THROUGHPUT = IntStream.range(0, 4) // GT_MetaTileEntity_ElectricAutoWorkbench#MAX_THROUGHPUT .mapToObj(i -> UITexture.fullImage(MODID, "gui/overlay_button/throughput_" + i)) - .collect(Collectors.toList()) - .toArray(new UITexture[0]); - public static final UITexture[] OVERLAY_BUTTON_MODE = IntStream.range( - 0, 10) // GT_MetaTileEntity_ElectricAutoWorkbench#MAX_MODES - .mapToObj(i -> UITexture.fullImage(MODID, "gui/overlay_button/mode_" + i)) - .collect(Collectors.toList()) + .collect(Collectors.toList()).toArray(new UITexture[0]); + public static final UITexture[] OVERLAY_BUTTON_MODE = IntStream.range(0, 10) // GT_MetaTileEntity_ElectricAutoWorkbench#MAX_MODES + .mapToObj(i -> UITexture.fullImage(MODID, "gui/overlay_button/mode_" + i)).collect(Collectors.toList()) .toArray(new UITexture[0]); - public static final UITexture OVERLAY_BUTTON_COMPUTER_MODE = - UITexture.fullImage(MODID, "gui/overlay_button/computer_mode"); + public static final UITexture OVERLAY_BUTTON_COMPUTER_MODE = UITexture + .fullImage(MODID, "gui/overlay_button/computer_mode"); public static final UITexture OVERLAY_BUTTON_SAVE = UITexture.fullImage(MODID, "gui/overlay_button/save"); public static final UITexture OVERLAY_BUTTON_LOAD = UITexture.fullImage(MODID, "gui/overlay_button/load"); - public static final UITexture OVERLAY_BUTTON_NUCLEAR_SWITCH = - UITexture.fullImage(MODID, "gui/overlay_button/nuclear_switch"); - public static final UITexture OVERLAY_BUTTON_ARROW_LEFT = - UITexture.fullImage(MODID, "gui/overlay_button/arrow_left"); - public static final UITexture OVERLAY_BUTTON_ARROW_RIGHT = - UITexture.fullImage(MODID, "gui/overlay_button/arrow_right"); + public static final UITexture OVERLAY_BUTTON_NUCLEAR_SWITCH = UITexture + .fullImage(MODID, "gui/overlay_button/nuclear_switch"); + public static final UITexture OVERLAY_BUTTON_ARROW_LEFT = UITexture + .fullImage(MODID, "gui/overlay_button/arrow_left"); + public static final UITexture OVERLAY_BUTTON_ARROW_RIGHT = UITexture + .fullImage(MODID, "gui/overlay_button/arrow_right"); public static final UITexture[] OVERLAY_BUTTON_DIRECTION = new UITexture[] { - UITexture.fullImage(MODID, "gui/overlay_button/bottom"), - UITexture.fullImage(MODID, "gui/overlay_button/top"), - UITexture.fullImage(MODID, "gui/overlay_button/north"), - UITexture.fullImage(MODID, "gui/overlay_button/south"), - UITexture.fullImage(MODID, "gui/overlay_button/west"), - UITexture.fullImage(MODID, "gui/overlay_button/east"), - }; + UITexture.fullImage(MODID, "gui/overlay_button/bottom"), + UITexture.fullImage(MODID, "gui/overlay_button/top"), + UITexture.fullImage(MODID, "gui/overlay_button/north"), + UITexture.fullImage(MODID, "gui/overlay_button/south"), + UITexture.fullImage(MODID, "gui/overlay_button/west"), + UITexture.fullImage(MODID, "gui/overlay_button/east"), }; public static final UITexture[] OVERLAY_BUTTON_DIRECTION_GRAY = new UITexture[] { - UITexture.fullImage(MODID, "gui/overlay_button/bottom_gray"), - UITexture.fullImage(MODID, "gui/overlay_button/top_gray"), - UITexture.fullImage(MODID, "gui/overlay_button/north_gray"), - UITexture.fullImage(MODID, "gui/overlay_button/south_gray"), - UITexture.fullImage(MODID, "gui/overlay_button/west_gray"), - UITexture.fullImage(MODID, "gui/overlay_button/east_gray"), - }; + UITexture.fullImage(MODID, "gui/overlay_button/bottom_gray"), + UITexture.fullImage(MODID, "gui/overlay_button/top_gray"), + UITexture.fullImage(MODID, "gui/overlay_button/north_gray"), + UITexture.fullImage(MODID, "gui/overlay_button/south_gray"), + UITexture.fullImage(MODID, "gui/overlay_button/west_gray"), + UITexture.fullImage(MODID, "gui/overlay_button/east_gray"), }; public static final UITexture OVERLAY_BUTTON_TIP_GREEN = UITexture.fullImage(MODID, "gui/overlay_button/tip_green"); public static final UITexture OVERLAY_BUTTON_TIP_RED = UITexture.fullImage(MODID, "gui/overlay_button/tip_red"); - public static final UITexture OVERLAY_BUTTON_ACTIVE_STATE = - UITexture.fullImage(MODID, "gui/overlay_button/active_state"); - public static final UITexture OVERLAY_BUTTON_CHANGE_MODE = - UITexture.fullImage(MODID, "gui/overlay_button/change_mode"); - public static final UITexture OVERLAY_BUTTON_PLUS_MINUS = - UITexture.fullImage(MODID, "gui/overlay_button/plus_minus"); + public static final UITexture OVERLAY_BUTTON_ACTIVE_STATE = UITexture + .fullImage(MODID, "gui/overlay_button/active_state"); + public static final UITexture OVERLAY_BUTTON_CHANGE_MODE = UITexture + .fullImage(MODID, "gui/overlay_button/change_mode"); + public static final UITexture OVERLAY_BUTTON_PLUS_MINUS = UITexture + .fullImage(MODID, "gui/overlay_button/plus_minus"); public static final UITexture PICTURE_WORKBENCH_CIRCLE = UITexture.fullImage(MODID, "gui/picture/workbench_circle"); public static final UITexture PICTURE_ARROW_WHITE_DOWN = UITexture.fullImage(MODID, "gui/picture/arrow_white_down"); @@ -142,10 +132,10 @@ public class GTPP_UITextures { public static final UITexture PICTURE_COMPUTER_GRID = UITexture.fullImage(MODID, "gui/picture/computer_grid"); public static final UITexture PICTURE_ARROWS_SEPARATE = UITexture.fullImage(MODID, "gui/picture/arrows_separate"); public static final UITexture PICTURE_ARROWS_FUSION = UITexture.fullImage(MODID, "gui/picture/arrows_fusion"); - public static final UITexture PICTURE_REDSTONE_CIRCUIT_SCREEN = - UITexture.fullImage(MODID, "gui/picture/redstone_circuit_screen"); - public static final UITexture PICTURE_ELECTRICITY_ERROR = - UITexture.fullImage(MODID, "gui/picture/electricity_error"); + public static final UITexture PICTURE_REDSTONE_CIRCUIT_SCREEN = UITexture + .fullImage(MODID, "gui/picture/redstone_circuit_screen"); + public static final UITexture PICTURE_ELECTRICITY_ERROR = UITexture + .fullImage(MODID, "gui/picture/electricity_error"); public static final UITexture PICTURE_ELECTRICITY_FINE = UITexture.fullImage(MODID, "gui/picture/electricity_fine"); public static final UITexture PICTURE_ENERGY_FRAME = UITexture.fullImage(MODID, "gui/picture/energy_frame"); } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/widget/DataStickSlotWidget.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/widget/DataStickSlotWidget.java index dbda217c27..7070fe5c8d 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/widget/DataStickSlotWidget.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/widget/DataStickSlotWidget.java @@ -4,6 +4,7 @@ import com.gtnewhorizons.modularui.api.ModularUITextures; import com.gtnewhorizons.modularui.api.forge.IItemHandlerModifiable; import com.gtnewhorizons.modularui.common.internal.wrapper.BaseSlot; import com.gtnewhorizons.modularui.common.widget.SlotWidget; + import gregtech.api.enums.ItemList; import gregtech.api.gui.modularui.GT_UITextures; import gregtech.api.util.GT_Utility; @@ -12,6 +13,7 @@ public class DataStickSlotWidget extends SlotWidget { public DataStickSlotWidget(IItemHandlerModifiable handler, int index) { this(new BaseSlot(handler, index) { + @Override public int getSlotStackLimit() { return 1; @@ -21,8 +23,9 @@ public class DataStickSlotWidget extends SlotWidget { private DataStickSlotWidget(BaseSlot slot) { super(slot); - setFilter(stack -> GT_Utility.areStacksEqual(stack, ItemList.Tool_DataStick.get(1), true) - || GT_Utility.areStacksEqual(stack, ItemList.Tool_DataOrb.get(1), true)); + setFilter( + stack -> GT_Utility.areStacksEqual(stack, ItemList.Tool_DataStick.get(1), true) + || GT_Utility.areStacksEqual(stack, ItemList.Tool_DataOrb.get(1), true)); setBackground(ModularUITextures.ITEM_SLOT, GT_UITextures.OVERLAY_SLOT_DATA_ORB); } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/widget/ElectricSlotWidget.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/widget/ElectricSlotWidget.java index b575c3c4bd..d555317717 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/widget/ElectricSlotWidget.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/widget/ElectricSlotWidget.java @@ -1,18 +1,21 @@ package gtPlusPlus.xmod.gregtech.api.gui.widget; +import net.minecraft.item.ItemStack; + import com.gtnewhorizons.modularui.api.forge.IItemHandlerModifiable; import com.gtnewhorizons.modularui.common.internal.wrapper.BaseSlot; import com.gtnewhorizons.modularui.common.widget.SlotWidget; + import gregtech.api.items.GT_MetaGenerated_Tool; import ic2.api.info.Info; import ic2.api.item.ElectricItem; import ic2.api.item.IElectricItem; -import net.minecraft.item.ItemStack; public class ElectricSlotWidget extends SlotWidget { public ElectricSlotWidget(IItemHandlerModifiable handler, int index) { this(new BaseSlot(handler, index, false) { + @Override public int getSlotStackLimit() { return 1; @@ -22,9 +25,9 @@ public class ElectricSlotWidget extends SlotWidget { private ElectricSlotWidget(BaseSlot slot) { super(slot); - setFilter(stack -> (accepts(stack)) - || (stack.getItem() instanceof GT_MetaGenerated_Tool) - || (stack.getItem() instanceof IElectricItem)); + setFilter( + stack -> (accepts(stack)) || (stack.getItem() instanceof GT_MetaGenerated_Tool) + || (stack.getItem() instanceof IElectricItem)); } private boolean accepts(final ItemStack stack) { diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/GregtechItemContainer.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/GregtechItemContainer.java index d49f1e9ed0..9431739c45 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/GregtechItemContainer.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/GregtechItemContainer.java @@ -5,6 +5,7 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemStack; public interface GregtechItemContainer { + public Item getItem(); public Block getBlock(); diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/IHeatEntity.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/IHeatEntity.java index cf1f137e0d..00265fc893 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/IHeatEntity.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/IHeatEntity.java @@ -1,8 +1,9 @@ package gtPlusPlus.xmod.gregtech.api.interfaces; -import ic2.api.energy.tile.IHeatSource; import net.minecraftforge.common.util.ForgeDirection; +import ic2.api.energy.tile.IHeatSource; + public interface IHeatEntity extends IHeatSource, IHeatSink { public int getHeatBuffer(); diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/IMetaTileEntityHeatPipe.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/IMetaTileEntityHeatPipe.java index 60477c9f31..cb5d875071 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/IMetaTileEntityHeatPipe.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/IMetaTileEntityHeatPipe.java @@ -1,9 +1,11 @@ package gtPlusPlus.xmod.gregtech.api.interfaces; -import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import java.util.ArrayList; + import net.minecraft.tileentity.TileEntity; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; + public interface IMetaTileEntityHeatPipe extends IMetaTileEntity { long transferHeat(byte var1, long var2, long var4, ArrayList<TileEntity> var6); diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/IGregtech_RecipeAdder.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/IGregtech_RecipeAdder.java index 8d1e9d597e..094e151fc8 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/IGregtech_RecipeAdder.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/IGregtech_RecipeAdder.java @@ -1,61 +1,45 @@ package gtPlusPlus.xmod.gregtech.api.interfaces.internal; -import gregtech.api.enums.Materials; -import gtPlusPlus.core.material.Material; import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.FluidStack; +import gregtech.api.enums.Materials; +import gtPlusPlus.core.material.Material; + public interface IGregtech_RecipeAdder { + /** * Adds a Coke Oven Recipe * - * @param aInput1 = first Input (not null, and respects StackSize) - * @param aInputb = second Input (can be null, and respects StackSize) - * @param aFluidOutput = Output of the Creosote (not null, and respects StackSize) - * @param aFluidInput = fluid Input (can be null, and respects StackSize) - * @param aOutput = Output of the Coal/coke (can be null, and respects StackSize) - * @param aDuration = Duration (must be >= 0) - * @param aEUt = EU needed for heating up (must be >= 0) + * @param aInput1 = first Input (not null, and respects StackSize) + * @param aInputb = second Input (can be null, and respects StackSize) + * @param aFluidOutput = Output of the Creosote (not null, and respects StackSize) + * @param aFluidInput = fluid Input (can be null, and respects StackSize) + * @param aOutput = Output of the Coal/coke (can be null, and respects StackSize) + * @param aDuration = Duration (must be >= 0) + * @param aEUt = EU needed for heating up (must be >= 0) * @return true if the Recipe got added, otherwise false. */ // public boolean addCokeOvenRecipe(boolean aOptimize, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecial, // FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue); - public boolean addCokeOvenRecipe( - ItemStack aInput1, - ItemStack aInput2, - FluidStack aFluidInput, - FluidStack aFluidOutput, - ItemStack aOutput, - int aDuration, - int aEUt); + public boolean addCokeOvenRecipe(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, + FluidStack aFluidOutput, ItemStack aOutput, int aDuration, int aEUt); - public boolean addCokeOvenRecipe( - int aCircuit, - ItemStack aInput2, - FluidStack[] aFluidInputs, - FluidStack[] aFluidOutputs, - ItemStack[] aOutputs, - int aDuration, - int aEUt); + public boolean addCokeOvenRecipe(int aCircuit, ItemStack aInput2, FluidStack[] aFluidInputs, + FluidStack[] aFluidOutputs, ItemStack[] aOutputs, int aDuration, int aEUt); - public boolean addCokeOvenRecipe( - ItemStack aInput1, - ItemStack aInput2, - FluidStack[] aFluidInputs, - FluidStack[] aFluidOutputs, - ItemStack[] aOutputs, - int aDuration, - int aEUt); + public boolean addCokeOvenRecipe(ItemStack aInput1, ItemStack aInput2, FluidStack[] aFluidInputs, + FluidStack[] aFluidOutputs, ItemStack[] aOutputs, int aDuration, int aEUt); public boolean addFuel(ItemStack aInput1, ItemStack aOutput1, int aEU, int aType); /** * Adds a Matter Fabricator Recipe * - * @param aFluidOutput = Output of the UU-Matter (not null, and respects StackSize) - * @param aFluidInput = fluid Input (can be UU_Amp or null, and respects StackSize) - * @param aDuration = Duration (must be >= 0) - * @param aEUt = EU needed for heating up (must be >= 0) + * @param aFluidOutput = Output of the UU-Matter (not null, and respects StackSize) + * @param aFluidInput = fluid Input (can be UU_Amp or null, and respects StackSize) + * @param aDuration = Duration (must be >= 0) + * @param aEUt = EU needed for heating up (must be >= 0) * @return true if the Recipe got added, otherwise false. */ public boolean addMatterFabricatorRecipe(FluidStack aFluidInput, FluidStack aFluidOutput, int aDuration, int aEUt); @@ -63,62 +47,62 @@ public interface IGregtech_RecipeAdder { /** * Adds a Matter Fabricator Recipe * - * @param aItemInput = ItemStack Input, can be null I assume. - * @param aFluidInput = fluid Input (can be UU_Amp or null, and respects StackSize) - * @param aFluidOutput = Output of the UU-Matter (not null, and respects StackSize) - * @param aDuration = Duration (must be >= 0) - * @param aEUt = EU needed for heating up (must be >= 0) + * @param aItemInput = ItemStack Input, can be null I assume. + * @param aFluidInput = fluid Input (can be UU_Amp or null, and respects StackSize) + * @param aFluidOutput = Output of the UU-Matter (not null, and respects StackSize) + * @param aDuration = Duration (must be >= 0) + * @param aEUt = EU needed for heating up (must be >= 0) * @return true if the Recipe got added, otherwise false. */ - public boolean addMatterFabricatorRecipe( - ItemStack aItemInput, FluidStack aFluidInput, FluidStack aFluidOutput, int aDuration, int aEUt); + public boolean addMatterFabricatorRecipe(ItemStack aItemInput, FluidStack aFluidInput, FluidStack aFluidOutput, + int aDuration, int aEUt); /** * Adds a Recipe for the Dehydrator. (up to 9 Outputs) * - * @param aInput = Input itemstack (not null, and respects StackSize) - * @param aFluidInput = fluid Input (can be UU_Amp or null, and respects StackSize) - * @param aOutputItems = Itemstack[] (not null, and respects StackSize) - * @param aDuration = Duration (must be >= 0) - * @param aEUt = EU needed for heating up (must be >= 0) + * @param aInput = Input itemstack (not null, and respects StackSize) + * @param aFluidInput = fluid Input (can be UU_Amp or null, and respects StackSize) + * @param aOutputItems = Itemstack[] (not null, and respects StackSize) + * @param aDuration = Duration (must be >= 0) + * @param aEUt = EU needed for heating up (must be >= 0) * @return true if the Recipe got added, otherwise false. */ // public boolean addDehydratorRecipe(ItemStack aInput, FluidStack aFluid, ItemStack[] aOutputItems, int aDuration, // int aEUt); - /*public boolean addDehydratorRecipe(FluidStack aFluid, FluidStack aOutputFluid, ItemStack[] aOutputItems, int aDuration, int aEUt);*/ - /*public boolean addDehydratorRecipe(ItemStack aItemA, ItemStack aItemB, ItemStack[] aOutputItems, int aDuration, int aEUt); - public boolean addDehydratorRecipe(ItemStack aItemA, ItemStack aItemB, FluidStack aFluid, ItemStack[] aOutputItems, FluidStack aOutputFluid, int aDuration, int aEUt);*/ + /* + * public boolean addDehydratorRecipe(FluidStack aFluid, FluidStack aOutputFluid, ItemStack[] aOutputItems, int + * aDuration, int aEUt); + */ + /* + * public boolean addDehydratorRecipe(ItemStack aItemA, ItemStack aItemB, ItemStack[] aOutputItems, int aDuration, + * int aEUt); public boolean addDehydratorRecipe(ItemStack aItemA, ItemStack aItemB, FluidStack aFluid, ItemStack[] + * aOutputItems, FluidStack aOutputFluid, int aDuration, int aEUt); + */ /** * Adds a Recipe for the Dehydrator. (up to 9 Outputs) * - * @param aInput = ItemStack[] (not null, and respects StackSize) - * @param aFluidInput = fluid Input (can be UU_Amp or null, and respects StackSize) - * @param aFluidOutput = Output of the UU-Matter (not null, and respects StackSize) - * @param aOutputItems = ItemStack[] (not null, and respects StackSize) - * @param aChances = Output Change (can be == 0) - * @param aDuration = Duration (must be >= 0) - * @param aEUt = EU needed for heating up (must be >= 0) + * @param aInput = ItemStack[] (not null, and respects StackSize) + * @param aFluidInput = fluid Input (can be UU_Amp or null, and respects StackSize) + * @param aFluidOutput = Output of the UU-Matter (not null, and respects StackSize) + * @param aOutputItems = ItemStack[] (not null, and respects StackSize) + * @param aChances = Output Change (can be == 0) + * @param aDuration = Duration (must be >= 0) + * @param aEUt = EU needed for heating up (must be >= 0) * @return true if the Recipe got added, otherwise false. */ - public boolean addDehydratorRecipe( - ItemStack[] aInput, - FluidStack aFluidInput, - FluidStack aFluidOutput, - ItemStack[] aOutputItems, - int[] aChances, - int aDuration, - int aEUt); + public boolean addDehydratorRecipe(ItemStack[] aInput, FluidStack aFluidInput, FluidStack aFluidOutput, + ItemStack[] aOutputItems, int[] aChances, int aDuration, int aEUt); /** * Adds a Recipe for the Alloy Blast Smelter. (up to 9 Inputs) * - * @param aInput = ItemStack[] (not null, and respects StackSize) - * @param aFluidOutput = Output of the Molten Metal (not null, and respects StackSize) - * @param aChances = Output Chance (can be == 0) - * @param aDuration = Duration (must be >= 0) - * @param aEUt = EU per tick needed for heating up (must be >= 0) + * @param aInput = ItemStack[] (not null, and respects StackSize) + * @param aFluidOutput = Output of the Molten Metal (not null, and respects StackSize) + * @param aChances = Output Chance (can be == 0) + * @param aDuration = Duration (must be >= 0) + * @param aEUt = EU per tick needed for heating up (must be >= 0) * @return true if the Recipe got added, otherwise false. */ public boolean addBlastSmelterRecipe(ItemStack[] aInput, FluidStack aOutput, int aChance, int aDuration, int aEUt); @@ -126,183 +110,126 @@ public interface IGregtech_RecipeAdder { /** * Adds a Recipe for the Alloy Blast Smelter. (up to 9 Inputs) * - * @param aInput = ItemStack[] (not null, and respects StackSize) - * @param aFluidInput = Input of a fluid (can be null, and respects StackSize) - * @param aFluidOutput = Output of the Molten Metal (not null, and respects StackSize) - * @param aChances = Output Chance (can be == 0) - * @param aDuration = Duration (must be >= 0) - * @param aEUt = EU per tick needed for heating up (must be >= 0) + * @param aInput = ItemStack[] (not null, and respects StackSize) + * @param aFluidInput = Input of a fluid (can be null, and respects StackSize) + * @param aFluidOutput = Output of the Molten Metal (not null, and respects StackSize) + * @param aChances = Output Chance (can be == 0) + * @param aDuration = Duration (must be >= 0) + * @param aEUt = EU per tick needed for heating up (must be >= 0) * @return true if the Recipe got added, otherwise false. */ - public boolean addBlastSmelterRecipe( - ItemStack[] aInput, FluidStack aInputFluid, FluidStack aOutput, int aChance, int aDuration, int aEUt); + public boolean addBlastSmelterRecipe(ItemStack[] aInput, FluidStack aInputFluid, FluidStack aOutput, int aChance, + int aDuration, int aEUt); /** * Adds a Recipe for the Alloy Blast Smelter. (up to 9 Inputs, More than 1 Fluids) * - * @param aInput = ItemStack[] (not null, and respects StackSize) - * @param aFluidInput = FluidStack[] (can be null, and respects StackSize) - * @param aFluidOutput = Output of the Molten Metal (not null, and respects StackSize) - * @param aChances = Output Chance (can be == 0) - * @param aDuration = Duration (must be >= 0) - * @param aEUt = EU per tick needed for heating up (must be >= 0) + * @param aInput = ItemStack[] (not null, and respects StackSize) + * @param aFluidInput = FluidStack[] (can be null, and respects StackSize) + * @param aFluidOutput = Output of the Molten Metal (not null, and respects StackSize) + * @param aChances = Output Chance (can be == 0) + * @param aDuration = Duration (must be >= 0) + * @param aEUt = EU per tick needed for heating up (must be >= 0) * @return true if the Recipe got added, otherwise false. */ - public boolean addBlastSmelterRecipe( - ItemStack[] aInput, FluidStack[] aInputFluid, FluidStack aOutput, int aChance, int aDuration, int aEUt); + public boolean addBlastSmelterRecipe(ItemStack[] aInput, FluidStack[] aInputFluid, FluidStack aOutput, int aChance, + int aDuration, int aEUt); /** * Adds a Recipe for the Alloy Blast Smelter. (up to 9 Inputs) * - * @param aInput = ItemStack[] (not null, and respects StackSize) - * @param aFluidInput = Input of a fluid (can be null, and respects StackSize) - * @param aFluidOutput = Output of the Molten Metal (not null, and respects StackSize) - * @param aOutputStack = Item Output (Can be null) - * @param aChances = Output Chance (can be == 0) - * @param aDuration = Duration (must be >= 0) - * @param aEUt = EU per tick needed for heating up (must be >= 0) + * @param aInput = ItemStack[] (not null, and respects StackSize) + * @param aFluidInput = Input of a fluid (can be null, and respects StackSize) + * @param aFluidOutput = Output of the Molten Metal (not null, and respects StackSize) + * @param aOutputStack = Item Output (Can be null) + * @param aChances = Output Chance (can be == 0) + * @param aDuration = Duration (must be >= 0) + * @param aEUt = EU per tick needed for heating up (must be >= 0) * @return true if the Recipe got added, otherwise false. */ - public boolean addBlastSmelterRecipe( - ItemStack[] aInput, - FluidStack aInputFluid, - FluidStack aOutput, - ItemStack[] aOutputStack, - int[] aChance, - int aDuration, - int aEUt); + public boolean addBlastSmelterRecipe(ItemStack[] aInput, FluidStack aInputFluid, FluidStack aOutput, + ItemStack[] aOutputStack, int[] aChance, int aDuration, int aEUt); - public boolean addBlastSmelterRecipe( - ItemStack[] aInput, - FluidStack aInputFluid, - FluidStack aOutput, - int aChance, - int aDuration, - int aEUt, - int aSpecialValue); - - public boolean addBlastSmelterRecipe( - ItemStack[] aInput, - FluidStack aInputFluid, - FluidStack aOutput, - ItemStack[] aOutputStack, - int[] aChance, - int aDuration, - int aEUt, - int aSpecialValue, + public boolean addBlastSmelterRecipe(ItemStack[] aInput, FluidStack aInputFluid, FluidStack aOutput, int aChance, + int aDuration, int aEUt, int aSpecialValue); + + public boolean addBlastSmelterRecipe(ItemStack[] aInput, FluidStack aInputFluid, FluidStack aOutput, + ItemStack[] aOutputStack, int[] aChance, int aDuration, int aEUt, int aSpecialValue, boolean aOptimizeRecipe); /** * Adds a Recipe for the Alloy Blast Smelter. (up to 9 Inputs, More than 1 fluids) * - * @param aInput = ItemStack[] (not null, and respects StackSize) - * @param aFluidInput = FluidStack[] (can be null, and respects StackSize) - * @param aFluidOutput = Output of the Molten Metal (not null, and respects StackSize) - * @param aOutputStack = Item Output (Can be null) - * @param aChances = Output Chance (can be == 0) - * @param aDuration = Duration (must be >= 0) - * @param aEUt = EU per tick needed for heating up (must be >= 0) + * @param aInput = ItemStack[] (not null, and respects StackSize) + * @param aFluidInput = FluidStack[] (can be null, and respects StackSize) + * @param aFluidOutput = Output of the Molten Metal (not null, and respects StackSize) + * @param aOutputStack = Item Output (Can be null) + * @param aChances = Output Chance (can be == 0) + * @param aDuration = Duration (must be >= 0) + * @param aEUt = EU per tick needed for heating up (must be >= 0) * @return true if the Recipe got added, otherwise false. */ - public boolean addBlastSmelterRecipe( - ItemStack[] aInput, - FluidStack[] aInputFluid, - FluidStack aOutput, - ItemStack[] aOutputStack, - int[] aChance, - int aDuration, - int aEUt); + public boolean addBlastSmelterRecipe(ItemStack[] aInput, FluidStack[] aInputFluid, FluidStack aOutput, + ItemStack[] aOutputStack, int[] aChance, int aDuration, int aEUt); - public boolean addBlastSmelterRecipe( - ItemStack[] aInput, - FluidStack[] aInputFluid, - FluidStack aOutput, - int aChance, - int aDuration, - int aEUt, - int aSpecialValue); - - public boolean addBlastSmelterRecipe( - ItemStack[] aInput, - FluidStack[] aInputFluid, - FluidStack aOutput, - ItemStack[] aOutputStack, - int[] aChance, - int aDuration, - int aEUt, - int aSpecialValue, + public boolean addBlastSmelterRecipe(ItemStack[] aInput, FluidStack[] aInputFluid, FluidStack aOutput, int aChance, + int aDuration, int aEUt, int aSpecialValue); + + public boolean addBlastSmelterRecipe(ItemStack[] aInput, FluidStack[] aInputFluid, FluidStack aOutput, + ItemStack[] aOutputStack, int[] aChance, int aDuration, int aEUt, int aSpecialValue, boolean aOptimizeRecipe); /** * Adds a Recipe for the LFTRr. (up to 9 Inputs) * - * @param aInput = ItemStack[] (not null, and respects StackSize) + * @param aInput = ItemStack[] (not null, and respects StackSize) * @param aFluidInput = Input of a fluid (can be null, and respects StackSize) - * @param aFluidOutput = Output of the Molten Salts (not null, and respects StackSize) + * @param aFluidOutput = Output of the Molten Salts (not null, and respects StackSize) * @param aOutputStack = Item Output (Can be null) - * @param aChances = Output Chance (can be == 0) - * @param aDuration = Duration (must be >= 0) - * @param aEUt = EU per tick needed for heating up (must be >= 0) - * @param aSpecialValue = Power produced in EU/t per dynamo + * @param aChances = Output Chance (can be == 0) + * @param aDuration = Duration (must be >= 0) + * @param aEUt = EU per tick needed for heating up (must be >= 0) + * @param aSpecialValue = Power produced in EU/t per dynamo * @return true if the Recipe got added, otherwise false. */ - public boolean addBlastSmelterRecipe( - ItemStack[] aInput, - FluidStack aInputFluid, - FluidStack aOutput, - ItemStack[] aOutputStack, - int[] aChance, - int aDuration, - int aEUt, - int aSpecialValue); + public boolean addBlastSmelterRecipe(ItemStack[] aInput, FluidStack aInputFluid, FluidStack aOutput, + ItemStack[] aOutputStack, int[] aChance, int aDuration, int aEUt, int aSpecialValue); /** * Adds a Recipe for the Quantum Force Smelter (up to 9 Inputs) * * **/ - public boolean addQuantumTransformerRecipe( - ItemStack[] aInput, - FluidStack[] aFluidInput, - FluidStack[] aFluidOutput, - ItemStack[] aOutputStack, - int[] aChances, - int aDuration, - int aEUt, - int aSpecialValue); - - /** Adds a Recipe for the LFTRr. (up to 9 Inputs, More than 1 fluids) + public boolean addQuantumTransformerRecipe(ItemStack[] aInput, FluidStack[] aFluidInput, FluidStack[] aFluidOutput, + ItemStack[] aOutputStack, int[] aChances, int aDuration, int aEUt, int aSpecialValue); + + /** + * Adds a Recipe for the LFTRr. (up to 9 Inputs, More than 1 fluids) * - * @param aInput = ItemStack[] (not null, and respects StackSize) + * @param aInput = ItemStack[] (not null, and respects StackSize) * @param aFluidInput = FluidStack[] (can be null, and respects StackSize) - * @param aFluidOutput = Output of the Molten Salts (not null, and respects StackSize) + * @param aFluidOutput = Output of the Molten Salts (not null, and respects StackSize) * @param aOutputStack = Item Output (Can be null) - * @param aChances = Output Chance (can be == 0) - * @param aDuration = Duration (must be >= 0) - * @param aEUt = EU per tick needed for heating up (must be >= 0) - * @param aSpecialValue = Power produced in EU/t per dynamo + * @param aChances = Output Chance (can be == 0) + * @param aDuration = Duration (must be >= 0) + * @param aEUt = EU per tick needed for heating up (must be >= 0) + * @param aSpecialValue = Power produced in EU/t per dynamo * @return true if the Recipe got added, otherwise false. */ - public boolean addBlastSmelterRecipe( - ItemStack[] aInput, - FluidStack[] aInputFluid, - FluidStack aOutput, - ItemStack[] aOutputStack, - int[] aChance, - int aDuration, - int aEUt, - int aSpecialValue); + public boolean addBlastSmelterRecipe(ItemStack[] aInput, FluidStack[] aInputFluid, FluidStack aOutput, + ItemStack[] aOutputStack, int[] aChance, int aDuration, int aEUt, int aSpecialValue); public boolean addLFTRRecipe(ItemStack aInput1, ItemStack aInput2, ItemStack aOutput1, int aDuration, int aEUt); - public boolean addLFTRRecipe( - ItemStack aInput1, FluidStack aInput2, ItemStack aOutput1, FluidStack aOutput2, int aDuration, int aEUt); + public boolean addLFTRRecipe(ItemStack aInput1, FluidStack aInput2, ItemStack aOutput1, FluidStack aOutput2, + int aDuration, int aEUt); public boolean addLFTRRecipe(FluidStack aInput1, FluidStack aInput2, FluidStack aOutput1, int aDuration, int aEUt); /** * Adds a custom Semifluid fuel for the GT++ SemiFluid Generators. - * @param aFuelItem - A Fluidstack to be consumed. + * + * @param aFuelItem - A Fluidstack to be consumed. * @param aFuelValue - Fuel value in thousands (1 = 1000) * @return - Was the Fuel added? */ @@ -310,135 +237,62 @@ public interface IGregtech_RecipeAdder { /** * Adds a custom Semifluid fuel for the GT++ SemiFluid Generators. - * @param aFuelItem - A Fluidstack to be consumed. + * + * @param aFuelItem - A Fluidstack to be consumed. * @param aFuelValue - Fuel value in thousands (1 = 1000) * @return - Was the Fuel added? */ public boolean addSemifluidFuel(ItemStack aFuelItem, int aFuelValue); - public boolean addFissionFuel( - FluidStack aInput1, - FluidStack aInput2, - FluidStack aInput3, - FluidStack aInput4, - FluidStack aInput5, - FluidStack aInput6, - FluidStack aInput7, - FluidStack aInput8, - FluidStack aInput9, - FluidStack aOutput1, - FluidStack aOutput2, - int aDuration, - int aEUt); + public boolean addFissionFuel(FluidStack aInput1, FluidStack aInput2, FluidStack aInput3, FluidStack aInput4, + FluidStack aInput5, FluidStack aInput6, FluidStack aInput7, FluidStack aInput8, FluidStack aInput9, + FluidStack aOutput1, FluidStack aOutput2, int aDuration, int aEUt); - public boolean addFissionFuel( - boolean aOptimise, - FluidStack aInput1, - FluidStack aInput2, - FluidStack aInput3, - FluidStack aInput4, - FluidStack aInput5, - FluidStack aInput6, - FluidStack aInput7, - FluidStack aInput8, - FluidStack aInput9, - FluidStack aOutput1, - FluidStack aOutput2, - int aDuration, - int aEUt); + public boolean addFissionFuel(boolean aOptimise, FluidStack aInput1, FluidStack aInput2, FluidStack aInput3, + FluidStack aInput4, FluidStack aInput5, FluidStack aInput6, FluidStack aInput7, FluidStack aInput8, + FluidStack aInput9, FluidStack aOutput1, FluidStack aOutput2, int aDuration, int aEUt); - public boolean addCyclotronRecipe( - ItemStack aInput, - FluidStack aFluidInput, - ItemStack[] aOutputs, - FluidStack aFluidOutput, - int[] aChances, - int aDuration, - int aEUt, - int aSpecialValue); - - boolean addCyclotronRecipe( - ItemStack[] aInputs, - FluidStack aFluidInput, - ItemStack[] aOutput, - FluidStack aFluidOutput, - int[] aChances, - int aDuration, - int aEUt, - int aSpecialValue); - - public boolean addMixerRecipe( - ItemStack aInput1, - ItemStack aInput2, - ItemStack aInput3, - ItemStack aInput4, - FluidStack aFluidInput, - FluidStack aFluidOutput, - ItemStack aOutput1, - ItemStack aOutput2, - ItemStack aOutput3, - ItemStack aOutput4, - int aDuration, - int aEUt); + public boolean addCyclotronRecipe(ItemStack aInput, FluidStack aFluidInput, ItemStack[] aOutputs, + FluidStack aFluidOutput, int[] aChances, int aDuration, int aEUt, int aSpecialValue); + + boolean addCyclotronRecipe(ItemStack[] aInputs, FluidStack aFluidInput, ItemStack[] aOutput, + FluidStack aFluidOutput, int[] aChances, int aDuration, int aEUt, int aSpecialValue); + + public boolean addMixerRecipe(ItemStack aInput1, ItemStack aInput2, ItemStack aInput3, ItemStack aInput4, + FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3, + ItemStack aOutput4, int aDuration, int aEUt); /** * Adds a Recipe for the Machine Component Assembler. (up to 6 Inputs) * - * @param aInputs = ItemStack[] (not null, and respects StackSize) - * @param aFluidInput = Input of a fluid (can be null, and respects StackSize) - * @param aOutput1 = Output ItemStack (not null, and respects StackSize) - * @param aDuration = Duration (must be >= 0) - * @param aEUt = EU per tick needed for heating up (must be >= 0) + * @param aInputs = ItemStack[] (not null, and respects StackSize) + * @param aFluidInput = Input of a fluid (can be null, and respects StackSize) + * @param aOutput1 = Output ItemStack (not null, and respects StackSize) + * @param aDuration = Duration (must be >= 0) + * @param aEUt = EU per tick needed for heating up (must be >= 0) * @return true if the Recipe got added, otherwise false. */ - public boolean addComponentMakerRecipe( - ItemStack[] aInputs, FluidStack aFluidInput, ItemStack aOutput1, int aDuration, int aEUt); - - public boolean addMultiblockCentrifugeRecipe( - ItemStack[] aInputs, - FluidStack[] aFluidInputs, - FluidStack[] aFluidOutputs, - ItemStack[] aOutputs, - int[] aChances, - int aDuration, - int aEUtick, - int aSpecial); - - public boolean addMultiblockElectrolyzerRecipe( - ItemStack[] aInputs, - FluidStack[] aFluidInputs, - FluidStack[] aFluidOutputs, - ItemStack[] aOutputs, - int[] aChances, - int aDuration, - int aEUtick, - int aSpecial); - - public boolean addAdvancedFreezerRecipe( - ItemStack[] aInputs, - FluidStack[] aFluidInputs, - FluidStack[] aFluidOutputs, - ItemStack[] aOutputs, - int[] aChances, - int aDuration, - int aEUtick, - int aSpecial); - - public boolean addAssemblerRecipeWithOreDict( - Object aInput1, int aAmount1, Object aInput2, int aAmount2, ItemStack aOutput, int a1, int a2); - - public boolean addAssemblerRecipeWithOreDict( - Object aInput1, - int aAmount1, - Object aInput2, - int aAmount2, - FluidStack aInputFluid, - ItemStack aOutput, - int a1, - int a2); - - public boolean addSixSlotAssemblingRecipe( - ItemStack[] aInputs, FluidStack aInputFluid, ItemStack aOutput1, int aDuration, int aEUt); + public boolean addComponentMakerRecipe(ItemStack[] aInputs, FluidStack aFluidInput, ItemStack aOutput1, + int aDuration, int aEUt); + + public boolean addMultiblockCentrifugeRecipe(ItemStack[] aInputs, FluidStack[] aFluidInputs, + FluidStack[] aFluidOutputs, ItemStack[] aOutputs, int[] aChances, int aDuration, int aEUtick, int aSpecial); + + public boolean addMultiblockElectrolyzerRecipe(ItemStack[] aInputs, FluidStack[] aFluidInputs, + FluidStack[] aFluidOutputs, ItemStack[] aOutputs, int[] aChances, int aDuration, int aEUtick, int aSpecial); + + public boolean addAdvancedFreezerRecipe(ItemStack[] aInputs, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, + ItemStack[] aOutputs, int[] aChances, int aDuration, int aEUtick, int aSpecial); + + public boolean addAssemblerRecipeWithOreDict(Object aInput1, int aAmount1, Object aInput2, int aAmount2, + ItemStack aOutput, int a1, int a2); + + public boolean addAssemblerRecipeWithOreDict(Object aInput1, int aAmount1, Object aInput2, int aAmount2, + FluidStack aInputFluid, ItemStack aOutput, int a1, int a2); + + public boolean addSixSlotAssemblingRecipe(ItemStack[] aInputs, FluidStack aInputFluid, ItemStack aOutput1, + int aDuration, int aEUt); + /** * Adds an Assemblyline Recipe * @@ -448,291 +302,157 @@ public interface IGregtech_RecipeAdder { * @param aDuration must be > 0 * @param aEUt should be > 0 */ - public boolean addAssemblylineRecipe( - ItemStack aResearchItem, - int aResearchTime, - ItemStack[] aInputs, - FluidStack[] aFluidInputs, - ItemStack aOutput, - int aDuration, - int aEUt); + public boolean addAssemblylineRecipe(ItemStack aResearchItem, int aResearchTime, ItemStack[] aInputs, + FluidStack[] aFluidInputs, ItemStack aOutput, int aDuration, int aEUt); /** * Adds a Assemblyline Recipe * - * @param aInputs elements should be: ItemStack for single item; - * ItemStack[] for multiple equivalent items; + * @param aInputs elements should be: ItemStack for single item; ItemStack[] for multiple equivalent items; * {OreDict, amount} for oredict. */ - boolean addAssemblylineRecipe( - ItemStack aResearchItem, - int aResearchTime, - Object[] aInputs, - FluidStack[] aFluidInputs, - ItemStack aOutput1, - int aDuration, - int aEUt); + boolean addAssemblylineRecipe(ItemStack aResearchItem, int aResearchTime, Object[] aInputs, + FluidStack[] aFluidInputs, ItemStack aOutput1, int aDuration, int aEUt); + + public boolean addChemicalRecipe(ItemStack input1, ItemStack input2, FluidStack inputFluid, FluidStack outputFluid, + ItemStack output, int time, int eu); + + public boolean addChemicalRecipe(ItemStack input1, ItemStack input2, FluidStack inputFluid, FluidStack outputFluid, + ItemStack output, Object object, int time, int eu); + + public boolean addChemicalRecipe(ItemStack input1, ItemStack input2, FluidStack inputFluid, FluidStack outputFluid, + ItemStack output, ItemStack object, int time); - public boolean addChemicalRecipe( - ItemStack input1, - ItemStack input2, - FluidStack inputFluid, - FluidStack outputFluid, - ItemStack output, - int time, - int eu); - - public boolean addChemicalRecipe( - ItemStack input1, - ItemStack input2, - FluidStack inputFluid, - FluidStack outputFluid, - ItemStack output, - Object object, - int time, - int eu); - - public boolean addChemicalRecipe( - ItemStack input1, - ItemStack input2, - FluidStack inputFluid, - FluidStack outputFluid, - ItemStack output, - ItemStack object, - int time); - - public boolean addChemicalRecipe( - ItemStack input1, - ItemStack input2, - int aCircuit, - FluidStack inputFluid, - FluidStack outputFluid, - ItemStack output, - ItemStack output2, - int time, - int eu); - - public boolean addMultiblockChemicalRecipe( - ItemStack[] itemStacks, - FluidStack[] fluidStacks, - FluidStack[] fluidStacks2, - ItemStack[] outputs, - int time, - int eu); + public boolean addChemicalRecipe(ItemStack input1, ItemStack input2, int aCircuit, FluidStack inputFluid, + FluidStack outputFluid, ItemStack output, ItemStack output2, int time, int eu); + + public boolean addMultiblockChemicalRecipe(ItemStack[] itemStacks, FluidStack[] fluidStacks, + FluidStack[] fluidStacks2, ItemStack[] outputs, int time, int eu); public boolean addCompressorRecipe(ItemStack aInput1, ItemStack aOutput1, int aDuration, int aEUt); - public boolean addBrewingRecipe( - ItemStack aIngredient, FluidStack aInput, FluidStack aOutput, int aTime, int aEu, boolean aHidden); + public boolean addBrewingRecipe(ItemStack aIngredient, FluidStack aInput, FluidStack aOutput, int aTime, int aEu, + boolean aHidden); - public boolean addBrewingRecipe( - int aCircuit, FluidStack aInput, FluidStack aOutput, int aTime, int aEu, boolean aHidden); + public boolean addBrewingRecipe(int aCircuit, FluidStack aInput, FluidStack aOutput, int aTime, int aEu, + boolean aHidden); public boolean addSmeltingAndAlloySmeltingRecipe(ItemStack aDust, ItemStack aOutput); public boolean addFluidExtractionRecipe(ItemStack input, FluidStack output, int aTime, int aEu); - public boolean addFluidExtractionRecipe( - ItemStack aContainer, ItemStack aFullContainer, FluidStack rFluidOut, int aTime, int aEu); + public boolean addFluidExtractionRecipe(ItemStack aContainer, ItemStack aFullContainer, FluidStack rFluidOut, + int aTime, int aEu); public boolean addFluidCannerRecipe(ItemStack aContainer, ItemStack aFullContainer, FluidStack rFluidIn); - public boolean addFluidCannerRecipe( - ItemStack aContainer, ItemStack aFullContainer, FluidStack rFluidIn, FluidStack rFluidOut); + public boolean addFluidCannerRecipe(ItemStack aContainer, ItemStack aFullContainer, FluidStack rFluidIn, + FluidStack rFluidOut); - public boolean addFluidCannerRecipe( - ItemStack aContainer, - ItemStack aFullContainer, - FluidStack rFluidIn, - FluidStack rFluidOut, - int aTime, - int aEu); + public boolean addFluidCannerRecipe(ItemStack aContainer, ItemStack aFullContainer, FluidStack rFluidIn, + FluidStack rFluidOut, int aTime, int aEu); /** * Adds a Fusion reactor Recipe * - * @param aInput1 = first Input (not null, and respects StackSize) - * @param aInput2 = second Input (not null, and respects StackSize) - * @param plasma = Output of the Fusion (can be null, and respects StackSize) - * @param aFusionDurationInTicks = How many ticks the Fusion lasts (must be > 0) - * @param aEu = The EU generated per Tick (can even be negative!) - * @param aSpecial = EU needed for heating the Reactor up (must be >= 0) + * @param aInput1 = first Input (not null, and respects StackSize) + * @param aInput2 = second Input (not null, and respects StackSize) + * @param plasma = Output of the Fusion (can be null, and respects StackSize) + * @param aFusionDurationInTicks = How many ticks the Fusion lasts (must be > 0) + * @param aEu = The EU generated per Tick (can even be negative!) + * @param aSpecial = EU needed for heating the Reactor up (must be >= 0) */ - public boolean addFusionReactorRecipe( - ItemStack aInputStackA, - ItemStack aInputStackB, - FluidStack plasma, - int aFusionDurationInTicks, - int aEu, - int aSpecial); + public boolean addFusionReactorRecipe(ItemStack aInputStackA, ItemStack aInputStackB, FluidStack plasma, + int aFusionDurationInTicks, int aEu, int aSpecial); + /** * Adds a Fusion reactor Recipe * - * @param aInput1 = first Input (not null, and respects StackSize) - * @param aInput2 = second Input (not null, and respects StackSize) - * @param plasma = Output of the Fusion (can be null, and respects StackSize) - * @param aOutputChance = chance to output plasma (can be 0) - * @param aFusionDurationInTicks = How many ticks the Fusion lasts (must be > 0) - * @param aEu = The EU generated per Tick (can even be negative!) - * @param aSpecial = EU needed for heating the Reactor up (must be >= 0) + * @param aInput1 = first Input (not null, and respects StackSize) + * @param aInput2 = second Input (not null, and respects StackSize) + * @param plasma = Output of the Fusion (can be null, and respects StackSize) + * @param aOutputChance = chance to output plasma (can be 0) + * @param aFusionDurationInTicks = How many ticks the Fusion lasts (must be > 0) + * @param aEu = The EU generated per Tick (can even be negative!) + * @param aSpecial = EU needed for heating the Reactor up (must be >= 0) */ - public boolean addFusionReactorRecipe( - FluidStack aInputStackA, - FluidStack aInputStackB, - FluidStack plasma, - int aOutputChance, - int aFusionDurationInTicks, - int aEu, - int aSpecial); + public boolean addFusionReactorRecipe(FluidStack aInputStackA, FluidStack aInputStackB, FluidStack plasma, + int aOutputChance, int aFusionDurationInTicks, int aEu, int aSpecial); + /** * Adds a Fusion reactor Recipe * - * @param aInput1 = first Input (not null, and respects StackSize) - * @param aInput2 = second Input (not null, and respects StackSize) - * @param plasma = Output of the Fusion (can be null, and respects StackSize) - * @param aOutputChance = chance to output plasma (can be 0) - * @param aFusionDurationInTicks = How many ticks the Fusion lasts (must be > 0) - * @param aEu = The EU generated per Tick (can even be negative!) - * @param aSpecial = EU needed for heating the Reactor up (must be >= 0) + * @param aInput1 = first Input (not null, and respects StackSize) + * @param aInput2 = second Input (not null, and respects StackSize) + * @param plasma = Output of the Fusion (can be null, and respects StackSize) + * @param aOutputChance = chance to output plasma (can be 0) + * @param aFusionDurationInTicks = How many ticks the Fusion lasts (must be > 0) + * @param aEu = The EU generated per Tick (can even be negative!) + * @param aSpecial = EU needed for heating the Reactor up (must be >= 0) */ - public boolean addFusionReactorRecipe( - ItemStack aInputStackA, - ItemStack aInputStackB, - FluidStack plasma, - int aOutputChance, - int aFusionDurationInTicks, - int aEu, - int aSpecial); - - public boolean addVacuumFurnaceRecipe( - ItemStack aInput1, - ItemStack aInput2, - FluidStack aFluidInput, - FluidStack aFluidOutput, - ItemStack aOutput1, - ItemStack aOutput2, - int aDuration, - int aEUt, - int aLevel); - - public boolean addVacuumFurnaceRecipe( - ItemStack[] aInputs, - FluidStack[] aFluidInputs, - ItemStack[] aOutputs, - FluidStack[] aFluidOutputs, - int aDuration, - int aEUt, - int aLevel); + public boolean addFusionReactorRecipe(ItemStack aInputStackA, ItemStack aInputStackB, FluidStack plasma, + int aOutputChance, int aFusionDurationInTicks, int aEu, int aSpecial); + + public boolean addVacuumFurnaceRecipe(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, + FluidStack aFluidOutput, ItemStack aOutput1, ItemStack aOutput2, int aDuration, int aEUt, int aLevel); + + public boolean addVacuumFurnaceRecipe(ItemStack[] aInputs, FluidStack[] aFluidInputs, ItemStack[] aOutputs, + FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aLevel); public boolean addUvLaserRecipe(ItemStack aInput1, ItemStack aOutput, int time, long eu); public boolean addIrLaserRecipe(ItemStack aInput1, ItemStack aOutput, int time, long eu); - public boolean addChemicalPlantRecipe( - ItemStack[] aInputs, - FluidStack[] aInputFluids, - ItemStack[] aOutputs, - FluidStack[] aFluidOutputs, - int time, - long eu, - int aTier); - - public boolean addChemicalPlantRecipe( - ItemStack[] aInputs, - FluidStack[] aInputFluids, - ItemStack[] aOutputs, - FluidStack[] aFluidOutputs, - int[] aChances, - int time, - long eu, - int aTier); - - public boolean addBlastRecipe( - ItemStack[] aInputs, - FluidStack[] aInputFluids, - ItemStack[] aOutputs, - FluidStack[] aFluidOutputs, - int time, - long eu, - int aHeat); - - public boolean addPyrolyseRecipe( - ItemStack aInput, - FluidStack aFluidInput, - int intCircuit, - ItemStack aOutput, - FluidStack aFluidOutput, - int aDuration, - int aEUt); + public boolean addChemicalPlantRecipe(ItemStack[] aInputs, FluidStack[] aInputFluids, ItemStack[] aOutputs, + FluidStack[] aFluidOutputs, int time, long eu, int aTier); + + public boolean addChemicalPlantRecipe(ItemStack[] aInputs, FluidStack[] aInputFluids, ItemStack[] aOutputs, + FluidStack[] aFluidOutputs, int[] aChances, int time, long eu, int aTier); + + public boolean addBlastRecipe(ItemStack[] aInputs, FluidStack[] aInputFluids, ItemStack[] aOutputs, + FluidStack[] aFluidOutputs, int time, long eu, int aHeat); + + public boolean addPyrolyseRecipe(ItemStack aInput, FluidStack aFluidInput, int intCircuit, ItemStack aOutput, + FluidStack aFluidOutput, int aDuration, int aEUt); public boolean addExtractorRecipe(ItemStack aInput, ItemStack aOutput, int aDuration, int aEUt); public boolean addExtractorRecipe(ItemStack aInput, ItemStack aOutput, int aChance, int aDuration, int aEUt); - public boolean addDistilleryRecipe( - ItemStack aCircuit, - FluidStack aInput, - FluidStack aOutput, - ItemStack aSolidOutput, - int aDuration, - int aEUt, - boolean aHidden); + public boolean addDistilleryRecipe(ItemStack aCircuit, FluidStack aInput, FluidStack aOutput, + ItemStack aSolidOutput, int aDuration, int aEUt, boolean aHidden); - public boolean addPulverisationRecipe( - final ItemStack aInput, ItemStack aOutput1, ItemStack aOutput2, final ItemStack aOutput3); + public boolean addPulverisationRecipe(final ItemStack aInput, ItemStack aOutput1, ItemStack aOutput2, + final ItemStack aOutput3); public boolean addMillingRecipe(Materials aMat, int aEU); public boolean addMillingRecipe(Material aMat, int aEU); - public boolean addFlotationRecipe( - Materials aMat, - ItemStack aXanthate, - FluidStack[] aInputFluids, - FluidStack[] aOutputFluids, - int aTime, - int aEU); - - public boolean addFlotationRecipe( - Material aMat, - ItemStack aXanthate, - FluidStack[] aInputFluids, - FluidStack[] aOutputFluids, - int aTime, - int aEU); - - public boolean addpackagerRecipe( - ItemStack aRecipeType, ItemStack aInput1, ItemStack aInput2, ItemStack aOutputStack1); + public boolean addFlotationRecipe(Materials aMat, ItemStack aXanthate, FluidStack[] aInputFluids, + FluidStack[] aOutputFluids, int aTime, int aEU); + + public boolean addFlotationRecipe(Material aMat, ItemStack aXanthate, FluidStack[] aInputFluids, + FluidStack[] aOutputFluids, int aTime, int aEU); + + public boolean addpackagerRecipe(ItemStack aRecipeType, ItemStack aInput1, ItemStack aInput2, + ItemStack aOutputStack1); public boolean addFuelForRTG(ItemStack aFuelPellet, int aFuelDays, int aVoltage); - public boolean addColdTrapRecipe( - int aCircuit, - ItemStack aInput, - FluidStack aFluidInput, - ItemStack[] aOutputs, - int[] aChances, - FluidStack aFluidOutput, - int aTime, - int aEU); - - public boolean addReactorProcessingUnitRecipe( - ItemStack aInput1, - ItemStack aInput2, - FluidStack aFluidInput, - ItemStack[] aOutputs, - int[] aChances, - FluidStack aFluidOutput, - int aTime, - int aEU); - - public boolean addFluidHeaterRecipe( - ItemStack aCircuit, FluidStack aInput, FluidStack aOutput, int aDuration, int aEUt); + public boolean addColdTrapRecipe(int aCircuit, ItemStack aInput, FluidStack aFluidInput, ItemStack[] aOutputs, + int[] aChances, FluidStack aFluidOutput, int aTime, int aEU); + + public boolean addReactorProcessingUnitRecipe(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, + ItemStack[] aOutputs, int[] aChances, FluidStack aFluidOutput, int aTime, int aEU); + + public boolean addFluidHeaterRecipe(ItemStack aCircuit, FluidStack aInput, FluidStack aOutput, int aDuration, + int aEUt); public boolean addVacuumFreezerRecipe(ItemStack aInput, ItemStack aOutput, int aDuration, int aEU); public boolean addMolecularTransformerRecipe(ItemStack aInput, ItemStack aOutput, int aDuration, int aEU); - public boolean addMolecularTransformerRecipe( - ItemStack aInput, ItemStack aOutput, int aDuration, int aEU, int aAmps); + public boolean addMolecularTransformerRecipe(ItemStack aInput, ItemStack aOutput, int aDuration, int aEU, + int aAmps); } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/Interface_IconContainer.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/Interface_IconContainer.java index b597c221f5..2f4eaf4293 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/Interface_IconContainer.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/Interface_IconContainer.java @@ -4,6 +4,7 @@ import net.minecraft.util.IIcon; import net.minecraft.util.ResourceLocation; public interface Interface_IconContainer { + /** * @return A regular Icon. */ diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/Interface_ItemBehaviour.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/Interface_ItemBehaviour.java index 85ebb53217..6896d6ffb1 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/Interface_ItemBehaviour.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/Interface_ItemBehaviour.java @@ -1,8 +1,7 @@ package gtPlusPlus.xmod.gregtech.api.interfaces.internal; -import gregtech.api.enums.SubTag; -import gtPlusPlus.xmod.gregtech.api.items.Gregtech_MetaItem_Base; import java.util.List; + import net.minecraft.dispenser.IBlockSource; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; @@ -12,34 +11,18 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.world.World; +import gregtech.api.enums.SubTag; +import gtPlusPlus.xmod.gregtech.api.items.Gregtech_MetaItem_Base; + public interface Interface_ItemBehaviour<E extends Item> { + public boolean onLeftClickEntity(E aItem, ItemStack aStack, EntityPlayer aPlayer, Entity aEntity); - public boolean onItemUse( - E aItem, - ItemStack aStack, - EntityPlayer aPlayer, - World aWorld, - int aX, - int aY, - int aZ, - int aSide, - float hitX, - float hitY, - float hitZ); - - public boolean onItemUseFirst( - E aItem, - ItemStack aStack, - EntityPlayer aPlayer, - World aWorld, - int aX, - int aY, - int aZ, - int aSide, - float hitX, - float hitY, - float hitZ); + public boolean onItemUse(E aItem, ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ, + int aSide, float hitX, float hitY, float hitZ); + + public boolean onItemUseFirst(E aItem, ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ, + int aSide, float hitX, float hitY, float hitZ); public ItemStack onItemRightClick(E aItem, ItemStack aStack, World aWorld, EntityPlayer aPlayer); @@ -55,9 +38,9 @@ public interface Interface_ItemBehaviour<E extends Item> { public boolean hasProjectile(Gregtech_MetaItem_Base aItem, SubTag aProjectileType, ItemStack aStack); - public EntityArrow getProjectile( - E aItem, SubTag aProjectileType, ItemStack aStack, World aWorld, double aX, double aY, double aZ); + public EntityArrow getProjectile(E aItem, SubTag aProjectileType, ItemStack aStack, World aWorld, double aX, + double aY, double aZ); - public EntityArrow getProjectile( - E aItem, SubTag aProjectileType, ItemStack aStack, World aWorld, EntityLivingBase aEntity, float aSpeed); + public EntityArrow getProjectile(E aItem, SubTag aProjectileType, ItemStack aStack, World aWorld, + EntityLivingBase aEntity, float aSpeed); } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/Interface_OreRecipeRegistrator.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/Interface_OreRecipeRegistrator.java index ec6bcae20c..1a8fdc175c 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/Interface_OreRecipeRegistrator.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/Interface_OreRecipeRegistrator.java @@ -1,29 +1,24 @@ package gtPlusPlus.xmod.gregtech.api.interfaces.internal; +import net.minecraft.item.ItemStack; + import gregtech.api.enums.Materials; import gtPlusPlus.xmod.gregtech.api.enums.GregtechOrePrefixes; import gtPlusPlus.xmod.gregtech.api.enums.GregtechOrePrefixes.GT_Materials; -import net.minecraft.item.ItemStack; public interface Interface_OreRecipeRegistrator { + /** - * Contains a Code Fragment, used in the OrePrefix to register Recipes. Better than using a switch/case, like I did before. + * Contains a Code Fragment, used in the OrePrefix to register Recipes. Better than using a switch/case, like I did + * before. * * @param aPrefix always != null * @param aMaterial always != null, and can be == _NULL if the Prefix is Self Referencing or not Material based! * @param aStack always != null */ - public void registerOre( - GregtechOrePrefixes aPrefix, - GT_Materials aMaterial, - String aOreDictName, - String aModName, + public void registerOre(GregtechOrePrefixes aPrefix, GT_Materials aMaterial, String aOreDictName, String aModName, ItemStack aStack); - public void registerOre( - GregtechOrePrefixes aPrefix, - Materials aMaterial, - String aOreDictName, - String aModName, + public void registerOre(GregtechOrePrefixes aPrefix, Materials aMaterial, String aOreDictName, String aModName, ItemStack copyAmount); } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/Interface_OreRecipeRegistrator_GT.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/Interface_OreRecipeRegistrator_GT.java index 616fdfdebf..230dc6ab8d 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/Interface_OreRecipeRegistrator_GT.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/Interface_OreRecipeRegistrator_GT.java @@ -1,17 +1,20 @@ package gtPlusPlus.xmod.gregtech.api.interfaces.internal; +import net.minecraft.item.ItemStack; + import gregtech.api.enums.OrePrefixes; import gtPlusPlus.xmod.gregtech.api.enums.GregtechOrePrefixes.GT_Materials; -import net.minecraft.item.ItemStack; public interface Interface_OreRecipeRegistrator_GT { + /** - * Contains a Code Fragment, used in the OrePrefix to register Recipes. Better than using a switch/case, like I did before. + * Contains a Code Fragment, used in the OrePrefix to register Recipes. Better than using a switch/case, like I did + * before. * * @param aPrefix always != null * @param aMaterial always != null, and can be == _NULL if the Prefix is Self Referencing or not Material based! * @param aStack always != null */ - public void registerOre( - OrePrefixes aPrefix, GT_Materials aMaterial, String aOreDictName, String aModName, ItemStack aStack); + public void registerOre(OrePrefixes aPrefix, GT_Materials aMaterial, String aOreDictName, String aModName, + ItemStack aStack); } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/Interface_Texture.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/Interface_Texture.java index 5780109a7b..53d3055213 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/Interface_Texture.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/Interface_Texture.java @@ -4,6 +4,7 @@ import net.minecraft.block.Block; import net.minecraft.client.renderer.RenderBlocks; public interface Interface_Texture { + public void renderXPos(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ); public void renderXNeg(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ); diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/Interface_ToolStats.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/Interface_ToolStats.java index 6578ddeb0b..b8bb160cf7 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/Interface_ToolStats.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/Interface_ToolStats.java @@ -1,10 +1,7 @@ package gtPlusPlus.xmod.gregtech.api.interfaces.internal; -import gregtech.api.interfaces.IIconContainer; -import gregtech.api.interfaces.IToolStats; -import gregtech.api.items.GT_MetaGenerated_Tool; -import gtPlusPlus.xmod.gregtech.api.items.Gregtech_MetaTool; import java.util.List; + import net.minecraft.block.Block; import net.minecraft.enchantment.Enchantment; import net.minecraft.entity.Entity; @@ -14,12 +11,18 @@ import net.minecraft.item.ItemStack; import net.minecraft.util.DamageSource; import net.minecraftforge.event.world.BlockEvent; +import gregtech.api.interfaces.IIconContainer; +import gregtech.api.interfaces.IToolStats; +import gregtech.api.items.GT_MetaGenerated_Tool; +import gtPlusPlus.xmod.gregtech.api.items.Gregtech_MetaTool; + /** * The Stats for GT Tools. Not including any Material Modifiers. * <p/> * And this is supposed to not have any ItemStack Parameters as these are generic Stats. */ public interface Interface_ToolStats extends IToolStats { + /** * Called when aPlayer crafts this Tool */ @@ -44,7 +47,8 @@ public interface Interface_ToolStats extends IToolStats { public int getToolDamagePerDropConversion(); /** - * @return Damage the Tool receives when being used as Container Item. 100 is one use, however it is usually 8 times more than normal. + * @return Damage the Tool receives when being used as Container Item. 100 is one use, however it is usually 8 times + * more than normal. */ @Override public int getToolDamagePerContainerCraft(); @@ -56,7 +60,8 @@ public interface Interface_ToolStats extends IToolStats { public int getToolDamagePerEntityAttack(); /** - * @return Basic Quality of the Tool, 0 is normal. If increased, it will increase the general quality of all Tools of this Type. Decreasing is also possible. + * @return Basic Quality of the Tool, 0 is normal. If increased, it will increase the general quality of all Tools + * of this Type. Decreasing is also possible. */ @Override public int getBaseQuality(); @@ -130,7 +135,8 @@ public interface Interface_ToolStats extends IToolStats { public boolean isWeapon(); /** - * @return If this Tool is a Ranged Weapon. Return false at isWeapon unless you have a Blade attached to your Bow/Gun or something + * @return If this Tool is a Ranged Weapon. Return false at isWeapon unless you have a Blade attached to your + * Bow/Gun or something */ @Override public boolean isRangedWeapon(); @@ -142,10 +148,12 @@ public interface Interface_ToolStats extends IToolStats { public boolean isMiningTool(); /** - * aBlock.getHarvestTool(aMetaData) can return the following Values for example. - * "axe", "pickaxe", "sword", "shovel", "hoe", "grafter", "saw", "wrench", "crowbar", "file", "hammer", "plow", "plunger", "scoop", "screwdriver", "sense", "scythe", "softhammer", "cutter", "plasmatorch" + * aBlock.getHarvestTool(aMetaData) can return the following Values for example. "axe", "pickaxe", "sword", + * "shovel", "hoe", "grafter", "saw", "wrench", "crowbar", "file", "hammer", "plow", "plunger", "scoop", + * "screwdriver", "sense", "scythe", "softhammer", "cutter", "plasmatorch" * - * @return If this is a minable Block. Tool Quality checks (like Diamond Tier or something) are separate from this check. + * @return If this is a minable Block. Tool Quality checks (like Diamond Tier or something) are separate from this + * check. */ @Override public boolean isMinableBlock(Block aBlock, byte aMetaData); @@ -156,18 +164,8 @@ public interface Interface_ToolStats extends IToolStats { * @return the Amount of modified Items. */ @Override - public int convertBlockDrops( - List<ItemStack> aDrops, - ItemStack aStack, - EntityPlayer aPlayer, - Block aBlock, - int aX, - int aY, - int aZ, - byte aMetaData, - int aFortune, - boolean aSilkTouch, - BlockEvent.HarvestDropsEvent aEvent); + public int convertBlockDrops(List<ItemStack> aDrops, ItemStack aStack, EntityPlayer aPlayer, Block aBlock, int aX, + int aY, int aZ, byte aMetaData, int aFortune, boolean aSilkTouch, BlockEvent.HarvestDropsEvent aEvent); /** * @return Returns a broken Version of the Item. @@ -179,15 +177,15 @@ public interface Interface_ToolStats extends IToolStats { * @return the Damage actually done to the Mob. */ @Override - public float getNormalDamageAgainstEntity( - float aOriginalDamage, Entity aEntity, ItemStack aStack, EntityPlayer aPlayer); + public float getNormalDamageAgainstEntity(float aOriginalDamage, Entity aEntity, ItemStack aStack, + EntityPlayer aPlayer); /** * @return the Damage actually done to the Mob. */ @Override - public float getMagicDamageAgainstEntity( - float aOriginalDamage, Entity aEntity, ItemStack aStack, EntityPlayer aPlayer); + public float getMagicDamageAgainstEntity(float aOriginalDamage, Entity aEntity, ItemStack aStack, + EntityPlayer aPlayer); @Override public IIconContainer getIcon(boolean aIsToolHead, ItemStack aStack); diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/items/Gregtech_Generic_Item.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/items/Gregtech_Generic_Item.java index b9e402a2f6..3eefd1c314 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/items/Gregtech_Generic_Item.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/items/Gregtech_Generic_Item.java @@ -1,17 +1,7 @@ package gtPlusPlus.xmod.gregtech.api.items; -import cpw.mods.fml.common.registry.GameRegistry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import gregtech.api.enums.SubTag; -import gregtech.api.interfaces.IProjectileItem; -import gregtech.api.util.GT_LanguageManager; -import gregtech.api.util.GT_ModHandler; -import gregtech.api.util.GT_Utility; -import gtPlusPlus.core.creative.AddToCreativeTab; -import gtPlusPlus.core.lib.CORE; -import gtPlusPlus.core.util.Utils; import java.util.List; + import net.minecraft.block.BlockDispenser; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.dispenser.*; @@ -25,10 +15,23 @@ import net.minecraft.util.EnumFacing; import net.minecraft.util.IIcon; import net.minecraft.world.World; +import cpw.mods.fml.common.registry.GameRegistry; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import gregtech.api.enums.SubTag; +import gregtech.api.interfaces.IProjectileItem; +import gregtech.api.util.GT_LanguageManager; +import gregtech.api.util.GT_ModHandler; +import gregtech.api.util.GT_Utility; +import gtPlusPlus.core.creative.AddToCreativeTab; +import gtPlusPlus.core.lib.CORE; +import gtPlusPlus.core.util.Utils; + /** * Extended by most Items, also used as a fallback Item, to prevent the accidental deletion when Errors occur. */ public class Gregtech_Generic_Item extends Item implements IProjectileItem { + private final String mName, mTooltip; protected IIcon mIcon; @@ -36,17 +39,16 @@ public class Gregtech_Generic_Item extends Item implements IProjectileItem { this(aUnlocalized, aEnglish, aEnglishTooltip, true); } - public Gregtech_Generic_Item( - final String aUnlocalized, - final String aEnglish, - final String aEnglishTooltip, + public Gregtech_Generic_Item(final String aUnlocalized, final String aEnglish, final String aEnglishTooltip, final boolean aWriteToolTipIntoLangFile) { super(); this.mName = aUnlocalized; GT_LanguageManager.addStringLocalization(this.mName + ".name", aEnglish); if (GT_Utility.isStringValid(aEnglishTooltip)) { GT_LanguageManager.addStringLocalization( - this.mTooltip = this.mName + ".tooltip_main", aEnglishTooltip, aWriteToolTipIntoLangFile); + this.mTooltip = this.mName + ".tooltip_main", + aEnglishTooltip, + aWriteToolTipIntoLangFile); } else { this.mTooltip = null; } @@ -77,8 +79,8 @@ public class Gregtech_Generic_Item extends Item implements IProjectileItem { } @Override - public boolean doesSneakBypassUse( - final World aWorld, final int aX, final int aY, final int aZ, final EntityPlayer aPlayer) { + public boolean doesSneakBypassUse(final World aWorld, final int aX, final int aY, final int aZ, + final EntityPlayer aPlayer) { return true; } @@ -92,8 +94,8 @@ public class Gregtech_Generic_Item extends Item implements IProjectileItem { } @Override - public void addInformation( - final ItemStack aStack, final EntityPlayer aPlayer, final List aList, final boolean aF3_H) { + public void addInformation(final ItemStack aStack, final EntityPlayer aPlayer, final List aList, + final boolean aF3_H) { if ((this.getMaxDamage() > 0) && !this.getHasSubtypes()) { aList.add((aStack.getMaxDamage() - this.getDamage(aStack)) + " / " + aStack.getMaxDamage()); } @@ -128,23 +130,14 @@ public class Gregtech_Generic_Item extends Item implements IProjectileItem { } @Override - public EntityArrow getProjectile( - final SubTag aProjectileType, - final ItemStack aStack, - final World aWorld, - final double aX, - final double aY, - final double aZ) { + public EntityArrow getProjectile(final SubTag aProjectileType, final ItemStack aStack, final World aWorld, + final double aX, final double aY, final double aZ) { return null; } @Override - public EntityArrow getProjectile( - final SubTag aProjectileType, - final ItemStack aStack, - final World aWorld, - final EntityLivingBase aEntity, - final float aSpeed) { + public EntityArrow getProjectile(final SubTag aProjectileType, final ItemStack aStack, final World aWorld, + final EntityLivingBase aEntity, final float aSpeed) { return null; } @@ -164,6 +157,7 @@ public class Gregtech_Generic_Item extends Item implements IProjectileItem { } public static class GT_Item_Dispense extends BehaviorProjectileDispense { + @Override public ItemStack dispenseStack(final IBlockSource aSource, final ItemStack aStack) { return ((Gregtech_Generic_Item) aStack.getItem()).onDispense(aSource, aStack); diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/items/Gregtech_MetaItem.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/items/Gregtech_MetaItem.java index 3daf2d3f31..aa4f6fb45f 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/items/Gregtech_MetaItem.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/items/Gregtech_MetaItem.java @@ -2,6 +2,17 @@ package gtPlusPlus.xmod.gregtech.api.items; import static gregtech.api.enums.GT_Values.D1; +import java.util.*; + +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.EnumAction; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; +import net.minecraft.world.World; + import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.GregTech_API; @@ -18,20 +29,12 @@ import gregtech.api.util.GT_Utility; import gtPlusPlus.core.creative.AddToCreativeTab; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.xmod.gregtech.api.interfaces.internal.Interface_ItemBehaviour; -import java.util.*; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.EnumAction; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; -import net.minecraft.world.World; public abstract class Gregtech_MetaItem extends Gregtech_MetaItem_Base { + /** - * All instances of this Item Class are listed here. - * This gets used to register the Renderer to all Items of this Type, if useStandardMetaItemRenderer() returns true. + * All instances of this Item Class are listed here. This gets used to register the Renderer to all Items of this + * Type, if useStandardMetaItemRenderer() returns true. * <p/> * You can also use the unlocalized Name gotten from getUnlocalizedName() as Key if you want to get a specific Item. */ @@ -110,7 +113,8 @@ public abstract class Gregtech_MetaItem extends Gregtech_MetaItem_Base { if (tRandomData instanceof Interface_ItemBehaviour) { this.addItemBehavior( - this.mOffset + aID, (Interface_ItemBehaviour<Gregtech_MetaItem_Base>) tRandomData); + this.mOffset + aID, + (Interface_ItemBehaviour<Gregtech_MetaItem_Base>) tRandomData); tUseOreDict = false; } if (tRandomData instanceof IItemContainer) { @@ -170,19 +174,14 @@ public abstract class Gregtech_MetaItem extends Gregtech_MetaItem_Base { * @param aMaxCharge Maximum Charge. (if this is == 0 it will remove the Electric Behavior) * @param aTransferLimit Transfer Limit. * @param aTier The electric Tier. - * @param aSpecialData If this Item has a Fixed Charge, like a SingleUse Battery (if > 0). - * Use -1 if you want to make this Battery chargeable (the use and canUse Functions will still discharge if you just use this) - * Use -2 if you want to make this Battery dischargeable. - * Use -3 if you want to make this Battery charge/discharge-able. + * @param aSpecialData If this Item has a Fixed Charge, like a SingleUse Battery (if > 0). Use -1 if you want to + * make this Battery chargeable (the use and canUse Functions will still discharge if you just + * use this) Use -2 if you want to make this Battery dischargeable. Use -3 if you want to make + * this Battery charge/discharge-able. * @return the Item itself for convenience in constructing. */ - public final Gregtech_MetaItem setElectricStats( - final int aMetaValue, - final long aMaxCharge, - final long aTransferLimit, - final long aTier, - final long aSpecialData, - final boolean aUseAnimations) { + public final Gregtech_MetaItem setElectricStats(final int aMetaValue, final long aMaxCharge, + final long aTransferLimit, final long aTier, final long aSpecialData, final boolean aUseAnimations) { if ((aMetaValue < 0) || (aMetaValue >= (this.mOffset + this.mEnabledItems.length()))) { return this; } @@ -191,7 +190,7 @@ public abstract class Gregtech_MetaItem extends Gregtech_MetaItem_Base { } else { this.mElectricStats.put( (short) aMetaValue, - new Long[] {aMaxCharge, Math.max(0, aTransferLimit), Math.max(-1, aTier), aSpecialData}); + new Long[] { aMaxCharge, Math.max(0, aTransferLimit), Math.max(-1, aTier), aSpecialData }); if ((aMetaValue >= this.mOffset) && aUseAnimations) { this.mIconList[aMetaValue - this.mOffset] = Arrays.copyOf( this.mIconList[aMetaValue - this.mOffset], @@ -206,21 +205,21 @@ public abstract class Gregtech_MetaItem extends Gregtech_MetaItem_Base { * @param aMaxCharge Maximum Charge. (if this is == 0 it will remove the Electric Behavior) * @param aTransferLimit Transfer Limit. * @param aTier The electric Tier. - * @param aSpecialData If this Item has a Fixed Charge, like a SingleUse Battery (if > 0). - * Use -1 if you want to make this Battery chargeable (the use and canUse Functions will still discharge if you just use this) - * Use -2 if you want to make this Battery dischargeable. - * Use -3 if you want to make this Battery charge/discharge-able. + * @param aSpecialData If this Item has a Fixed Charge, like a SingleUse Battery (if > 0). Use -1 if you want to + * make this Battery chargeable (the use and canUse Functions will still discharge if you just + * use this) Use -2 if you want to make this Battery dischargeable. Use -3 if you want to make + * this Battery charge/discharge-able. * @return the Item itself for convenience in constructing. */ - public final Gregtech_MetaItem setFluidContainerStats( - final int aMetaValue, final long aCapacity, final long aStacksize) { + public final Gregtech_MetaItem setFluidContainerStats(final int aMetaValue, final long aCapacity, + final long aStacksize) { if ((aMetaValue < 0) || (aMetaValue >= (this.mOffset + this.mEnabledItems.length()))) { return this; } if (aCapacity < 0) { this.mElectricStats.remove((short) aMetaValue); } else { - this.mFluidContainerStats.put((short) aMetaValue, new Long[] {aCapacity, Math.max(1, aStacksize)}); + this.mFluidContainerStats.put((short) aMetaValue, new Long[] { aCapacity, Math.max(1, aStacksize) }); } return this; } @@ -298,11 +297,11 @@ public abstract class Gregtech_MetaItem extends Gregtech_MetaItem_Base { for (short i = 0, j = (short) this.mEnabledItems.length(); i < j; i++) { if (this.mEnabledItems.get(i)) { for (byte k = 1; k < this.mIconList[i].length; k++) { - this.mIconList[i][k] = aIconRegister.registerIcon( - CORE.MODID + ":" + this.getUnlocalizedName() + "/" + i + "/" + k); + this.mIconList[i][k] = aIconRegister + .registerIcon(CORE.MODID + ":" + this.getUnlocalizedName() + "/" + i + "/" + k); } - this.mIconList[i][0] = - aIconRegister.registerIcon(CORE.MODID + ":" + this.getUnlocalizedName() + "/" + i); + this.mIconList[i][0] = aIconRegister + .registerIcon(CORE.MODID + ":" + this.getUnlocalizedName() + "/" + i); } } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/items/Gregtech_MetaItem_Base.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/items/Gregtech_MetaItem_Base.java index a961b28cf7..6ed72a8803 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/items/Gregtech_MetaItem_Base.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/items/Gregtech_MetaItem_Base.java @@ -2,14 +2,10 @@ package gtPlusPlus.xmod.gregtech.api.items; import static gregtech.api.enums.GT_Values.*; -import gregtech.api.enums.SubTag; -import gregtech.api.util.*; -import gtPlusPlus.core.util.Utils; -import gtPlusPlus.xmod.gregtech.api.interfaces.internal.Interface_ItemBehaviour; -import ic2.api.item.*; import java.util.ArrayList; import java.util.HashMap; import java.util.List; + import net.minecraft.dispenser.IBlockSource; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; @@ -24,11 +20,17 @@ import net.minecraft.world.World; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.fluids.IFluidContainerItem; +import gregtech.api.enums.SubTag; +import gregtech.api.util.*; +import gtPlusPlus.core.util.Utils; +import gtPlusPlus.xmod.gregtech.api.interfaces.internal.Interface_ItemBehaviour; +import ic2.api.item.*; + public abstract class Gregtech_MetaItem_Base extends Gregtech_Generic_Item implements ISpecialElectricItem, IElectricItemManager, IFluidContainerItem { + /* ---------- CONSTRUCTOR AND MEMBER VARIABLES ---------- */ - private final HashMap<Short, ArrayList<Interface_ItemBehaviour<Gregtech_MetaItem_Base>>> mItemBehaviors = - new HashMap<>(); + private final HashMap<Short, ArrayList<Interface_ItemBehaviour<Gregtech_MetaItem_Base>>> mItemBehaviors = new HashMap<>(); /** * Creates the Item using these Parameters. @@ -51,8 +53,8 @@ public abstract class Gregtech_MetaItem_Base extends Gregtech_Generic_Item * @param aBehavior the Click Behavior you want to add. * @return the Item itself for convenience in constructing. */ - public final Gregtech_MetaItem_Base addItemBehavior( - final int aMetaValue, final Interface_ItemBehaviour<Gregtech_MetaItem_Base> aBehavior) { + public final Gregtech_MetaItem_Base addItemBehavior(final int aMetaValue, + final Interface_ItemBehaviour<Gregtech_MetaItem_Base> aBehavior) { if ((aMetaValue < 0) || (aMetaValue >= 32766) || (aBehavior == null)) { return this; } @@ -71,8 +73,8 @@ public abstract class Gregtech_MetaItem_Base extends Gregtech_Generic_Item @Override public boolean hasProjectile(final SubTag aProjectileType, final ItemStack aStack) { - final ArrayList<Interface_ItemBehaviour<Gregtech_MetaItem_Base>> tList = - this.mItemBehaviors.get((short) this.getDamage(aStack)); + final ArrayList<Interface_ItemBehaviour<Gregtech_MetaItem_Base>> tList = this.mItemBehaviors + .get((short) this.getDamage(aStack)); if (tList != null) { for (final Interface_ItemBehaviour<Gregtech_MetaItem_Base> tBehavior : tList) { if (tBehavior.hasProjectile(this, aProjectileType, aStack)) { @@ -84,15 +86,10 @@ public abstract class Gregtech_MetaItem_Base extends Gregtech_Generic_Item } @Override - public EntityArrow getProjectile( - final SubTag aProjectileType, - final ItemStack aStack, - final World aWorld, - final double aX, - final double aY, - final double aZ) { - final ArrayList<Interface_ItemBehaviour<Gregtech_MetaItem_Base>> tList = - this.mItemBehaviors.get((short) this.getDamage(aStack)); + public EntityArrow getProjectile(final SubTag aProjectileType, final ItemStack aStack, final World aWorld, + final double aX, final double aY, final double aZ) { + final ArrayList<Interface_ItemBehaviour<Gregtech_MetaItem_Base>> tList = this.mItemBehaviors + .get((short) this.getDamage(aStack)); if (tList != null) { for (final Interface_ItemBehaviour<Gregtech_MetaItem_Base> tBehavior : tList) { final EntityArrow rArrow = tBehavior.getProjectile(this, aProjectileType, aStack, aWorld, aX, aY, aZ); @@ -105,18 +102,14 @@ public abstract class Gregtech_MetaItem_Base extends Gregtech_Generic_Item } @Override - public EntityArrow getProjectile( - final SubTag aProjectileType, - final ItemStack aStack, - final World aWorld, - final EntityLivingBase aEntity, - final float aSpeed) { - final ArrayList<Interface_ItemBehaviour<Gregtech_MetaItem_Base>> tList = - this.mItemBehaviors.get((short) this.getDamage(aStack)); + public EntityArrow getProjectile(final SubTag aProjectileType, final ItemStack aStack, final World aWorld, + final EntityLivingBase aEntity, final float aSpeed) { + final ArrayList<Interface_ItemBehaviour<Gregtech_MetaItem_Base>> tList = this.mItemBehaviors + .get((short) this.getDamage(aStack)); if (tList != null) { for (final Interface_ItemBehaviour<Gregtech_MetaItem_Base> tBehavior : tList) { - final EntityArrow rArrow = - tBehavior.getProjectile(this, aProjectileType, aStack, aWorld, aEntity, aSpeed); + final EntityArrow rArrow = tBehavior + .getProjectile(this, aProjectileType, aStack, aWorld, aEntity, aSpeed); if (rArrow != null) { return rArrow; } @@ -127,8 +120,8 @@ public abstract class Gregtech_MetaItem_Base extends Gregtech_Generic_Item @Override public ItemStack onDispense(final IBlockSource aSource, final ItemStack aStack) { - final ArrayList<Interface_ItemBehaviour<Gregtech_MetaItem_Base>> tList = - this.mItemBehaviors.get((short) this.getDamage(aStack)); + final ArrayList<Interface_ItemBehaviour<Gregtech_MetaItem_Base>> tList = this.mItemBehaviors + .get((short) this.getDamage(aStack)); if (tList != null) { for (final Interface_ItemBehaviour<Gregtech_MetaItem_Base> tBehavior : tList) { if (tBehavior.canDispense(this, aSource, aStack)) { @@ -141,8 +134,8 @@ public abstract class Gregtech_MetaItem_Base extends Gregtech_Generic_Item @Override public boolean isItemStackUsable(final ItemStack aStack) { - final ArrayList<Interface_ItemBehaviour<Gregtech_MetaItem_Base>> tList = - this.mItemBehaviors.get((short) this.getDamage(aStack)); + final ArrayList<Interface_ItemBehaviour<Gregtech_MetaItem_Base>> tList = this.mItemBehaviors + .get((short) this.getDamage(aStack)); if (tList != null) { for (final Interface_ItemBehaviour<Gregtech_MetaItem_Base> tBehavior : tList) { if (!tBehavior.isItemStackUsable(this, aStack)) { @@ -157,8 +150,8 @@ public abstract class Gregtech_MetaItem_Base extends Gregtech_Generic_Item public boolean onLeftClickEntity(final ItemStack aStack, final EntityPlayer aPlayer, final Entity aEntity) { this.use(aStack, 0, aPlayer); this.isItemStackUsable(aStack); - final ArrayList<Interface_ItemBehaviour<Gregtech_MetaItem_Base>> tList = - this.mItemBehaviors.get((short) this.getDamage(aStack)); + final ArrayList<Interface_ItemBehaviour<Gregtech_MetaItem_Base>> tList = this.mItemBehaviors + .get((short) this.getDamage(aStack)); if (tList != null) { for (final Interface_ItemBehaviour<Gregtech_MetaItem_Base> tBehavior : tList) { try { @@ -183,21 +176,12 @@ public abstract class Gregtech_MetaItem_Base extends Gregtech_Generic_Item } @Override - public boolean onItemUse( - final ItemStack aStack, - final EntityPlayer aPlayer, - final World aWorld, - final int aX, - final int aY, - final int aZ, - final int aSide, - final float hitX, - final float hitY, - final float hitZ) { + public boolean onItemUse(final ItemStack aStack, final EntityPlayer aPlayer, final World aWorld, final int aX, + final int aY, final int aZ, final int aSide, final float hitX, final float hitY, final float hitZ) { this.use(aStack, 0, aPlayer); this.isItemStackUsable(aStack); - final ArrayList<Interface_ItemBehaviour<Gregtech_MetaItem_Base>> tList = - this.mItemBehaviors.get((short) this.getDamage(aStack)); + final ArrayList<Interface_ItemBehaviour<Gregtech_MetaItem_Base>> tList = this.mItemBehaviors + .get((short) this.getDamage(aStack)); if (tList != null) { for (final Interface_ItemBehaviour<Gregtech_MetaItem_Base> tBehavior : tList) { try { @@ -222,21 +206,12 @@ public abstract class Gregtech_MetaItem_Base extends Gregtech_Generic_Item } @Override - public boolean onItemUseFirst( - final ItemStack aStack, - final EntityPlayer aPlayer, - final World aWorld, - final int aX, - final int aY, - final int aZ, - final int aSide, - final float hitX, - final float hitY, - final float hitZ) { + public boolean onItemUseFirst(final ItemStack aStack, final EntityPlayer aPlayer, final World aWorld, final int aX, + final int aY, final int aZ, final int aSide, final float hitX, final float hitY, final float hitZ) { this.use(aStack, 0, aPlayer); this.isItemStackUsable(aStack); - final ArrayList<Interface_ItemBehaviour<Gregtech_MetaItem_Base>> tList = - this.mItemBehaviors.get((short) this.getDamage(aStack)); + final ArrayList<Interface_ItemBehaviour<Gregtech_MetaItem_Base>> tList = this.mItemBehaviors + .get((short) this.getDamage(aStack)); if (tList != null) { for (final Interface_ItemBehaviour<Gregtech_MetaItem_Base> tBehavior : tList) { try { @@ -264,8 +239,8 @@ public abstract class Gregtech_MetaItem_Base extends Gregtech_Generic_Item public ItemStack onItemRightClick(ItemStack aStack, final World aWorld, final EntityPlayer aPlayer) { this.use(aStack, 0, aPlayer); this.isItemStackUsable(aStack); - final ArrayList<Interface_ItemBehaviour<Gregtech_MetaItem_Base>> tList = - this.mItemBehaviors.get((short) this.getDamage(aStack)); + final ArrayList<Interface_ItemBehaviour<Gregtech_MetaItem_Base>> tList = this.mItemBehaviors + .get((short) this.getDamage(aStack)); if (tList != null) { for (final Interface_ItemBehaviour<Gregtech_MetaItem_Base> tBehavior : tList) { try { @@ -281,8 +256,8 @@ public abstract class Gregtech_MetaItem_Base extends Gregtech_Generic_Item } @Override - public final void addInformation( - final ItemStack aStack, final EntityPlayer aPlayer, List aList, final boolean aF3_H) { + public final void addInformation(final ItemStack aStack, final EntityPlayer aPlayer, List aList, + final boolean aF3_H) { final String tKey = this.getUnlocalizedName(aStack) + ".tooltip", tString = GT_LanguageManager.getTranslation(tKey); if (GT_Utility.isStringValid(tString) && !tKey.equals(tString)) { @@ -292,18 +267,27 @@ public abstract class Gregtech_MetaItem_Base extends Gregtech_Generic_Item Long[] tStats = this.getElectricStats(aStack); if (tStats != null) { if (tStats[3] > 0) { - aList.add(EnumChatFormatting.AQUA + "Contains " + GT_Utility.formatNumbers(tStats[3]) + " EU Tier: " - + (tStats[2] >= 0 ? tStats[2] : 0) + EnumChatFormatting.GRAY); + aList.add( + EnumChatFormatting.AQUA + "Contains " + + GT_Utility.formatNumbers(tStats[3]) + + " EU Tier: " + + (tStats[2] >= 0 ? tStats[2] : 0) + + EnumChatFormatting.GRAY); } else { final long tCharge = this.getRealCharge(aStack); if ((tStats[3] == -2) && (tCharge <= 0)) { - aList.add(EnumChatFormatting.AQUA + "Empty. You should recycle it properly." - + EnumChatFormatting.GRAY); + aList.add( + EnumChatFormatting.AQUA + "Empty. You should recycle it properly." + + EnumChatFormatting.GRAY); } else { - aList.add(EnumChatFormatting.AQUA + "" + GT_Utility.formatNumbers(tCharge) + " / " - + GT_Utility.formatNumbers(Math.abs(tStats[0])) + " EU - Voltage: " - + V[(int) (tStats[2] >= 0 ? tStats[2] < V.length ? tStats[2] : V.length - 1 : 1)] - + EnumChatFormatting.GRAY); + aList.add( + EnumChatFormatting.AQUA + "" + + GT_Utility.formatNumbers(tCharge) + + " / " + + GT_Utility.formatNumbers(Math.abs(tStats[0])) + + " EU - Voltage: " + + V[(int) (tStats[2] >= 0 ? tStats[2] < V.length ? tStats[2] : V.length - 1 : 1)] + + EnumChatFormatting.GRAY); } } } @@ -311,16 +295,17 @@ public abstract class Gregtech_MetaItem_Base extends Gregtech_Generic_Item tStats = this.getFluidContainerStats(aStack); if ((tStats != null) && (tStats[0] > 0)) { final FluidStack tFluid = this.getFluidContent(aStack); - aList.add(EnumChatFormatting.BLUE - + ((tFluid == null ? "No Fluids Contained" : GT_Utility.getFluidName(tFluid, true))) - + EnumChatFormatting.GRAY); - aList.add(EnumChatFormatting.BLUE - + ((tFluid == null ? 0 : tFluid.amount) + "L / " + tStats[0] + "L") - + EnumChatFormatting.GRAY); + aList.add( + EnumChatFormatting.BLUE + + ((tFluid == null ? "No Fluids Contained" : GT_Utility.getFluidName(tFluid, true))) + + EnumChatFormatting.GRAY); + aList.add( + EnumChatFormatting.BLUE + ((tFluid == null ? 0 : tFluid.amount) + "L / " + tStats[0] + "L") + + EnumChatFormatting.GRAY); } - final ArrayList<Interface_ItemBehaviour<Gregtech_MetaItem_Base>> tList = - this.mItemBehaviors.get((short) this.getDamage(aStack)); + final ArrayList<Interface_ItemBehaviour<Gregtech_MetaItem_Base>> tList = this.mItemBehaviors + .get((short) this.getDamage(aStack)); if (tList != null) { for (final Interface_ItemBehaviour<Gregtech_MetaItem_Base> tBehavior : tList) { aList = tBehavior.getAdditionalToolTips(this, aList, aStack); @@ -331,14 +316,10 @@ public abstract class Gregtech_MetaItem_Base extends Gregtech_Generic_Item } @Override - public void onUpdate( - final ItemStack aStack, - final World aWorld, - final Entity aPlayer, - final int aTimer, + public void onUpdate(final ItemStack aStack, final World aWorld, final Entity aPlayer, final int aTimer, final boolean aIsInHand) { - final ArrayList<Interface_ItemBehaviour<Gregtech_MetaItem_Base>> tList = - this.mItemBehaviors.get((short) this.getDamage(aStack)); + final ArrayList<Interface_ItemBehaviour<Gregtech_MetaItem_Base>> tList = this.mItemBehaviors + .get((short) this.getDamage(aStack)); if (tList != null) { for (final Interface_ItemBehaviour<Gregtech_MetaItem_Base> tBehavior : tList) { tBehavior.onUpdate(this, aStack, aWorld, aPlayer, aTimer, aIsInHand); @@ -374,29 +355,19 @@ public abstract class Gregtech_MetaItem_Base extends Gregtech_Generic_Item } @Override - public final double charge( - final ItemStack aStack, - final double aCharge, - final int aTier, - final boolean aIgnoreTransferLimit, - final boolean aSimulate) { + public final double charge(final ItemStack aStack, final double aCharge, final int aTier, + final boolean aIgnoreTransferLimit, final boolean aSimulate) { final Long[] tStats = this.getElectricStats(aStack); - if ((tStats == null) - || (tStats[2] > aTier) + if ((tStats == null) || (tStats[2] > aTier) || !((tStats[3] == -1) || (tStats[3] == -3) || ((tStats[3] < 0) && (aCharge == Integer.MAX_VALUE))) || (aStack.stackSize != 1)) { return 0; } - final long tChargeBefore = this.getRealCharge(aStack), - tNewCharge = - aCharge == Integer.MAX_VALUE - ? Long.MAX_VALUE - : Math.min( - Math.abs(tStats[0]), - tChargeBefore - + (aIgnoreTransferLimit - ? (long) aCharge - : Math.min(tStats[1], (long) aCharge))); + final long tChargeBefore = this.getRealCharge(aStack), tNewCharge = aCharge == Integer.MAX_VALUE + ? Long.MAX_VALUE + : Math.min( + Math.abs(tStats[0]), + tChargeBefore + (aIgnoreTransferLimit ? (long) aCharge : Math.min(tStats[1], (long) aCharge))); if (!aSimulate) { this.setCharge(aStack, tNewCharge); } @@ -404,13 +375,8 @@ public abstract class Gregtech_MetaItem_Base extends Gregtech_Generic_Item } @Override - public final double discharge( - final ItemStack aStack, - final double aCharge, - final int aTier, - final boolean aIgnoreTransferLimit, - final boolean aBatteryAlike, - final boolean aSimulate) { + public final double discharge(final ItemStack aStack, final double aCharge, final int aTier, + final boolean aIgnoreTransferLimit, final boolean aBatteryAlike, final boolean aSimulate) { final Long[] tStats = this.getElectricStats(aStack); if ((tStats == null) || (tStats[2] > aTier)) { return 0; @@ -427,14 +393,8 @@ public abstract class Gregtech_MetaItem_Base extends Gregtech_Generic_Item } return tStats[3]; } - final long tChargeBefore = this.getRealCharge(aStack), - tNewCharge = - Math.max( - 0, - tChargeBefore - - (aIgnoreTransferLimit - ? (long) aCharge - : Math.min(tStats[1], (long) aCharge))); + final long tChargeBefore = this.getRealCharge(aStack), tNewCharge = Math + .max(0, tChargeBefore - (aIgnoreTransferLimit ? (long) aCharge : Math.min(tStats[1], (long) aCharge))); if (!aSimulate) { this.setCharge(aStack, tNewCharge); } @@ -570,8 +530,7 @@ public abstract class Gregtech_MetaItem_Base extends Gregtech_Generic_Item } final Long[] tStats = this.getFluidContainerStats(aStack); - if ((tStats == null) - || (tStats[0] <= 0) + if ((tStats == null) || (tStats[0] <= 0) || (aFluid == null) || (aFluid.getFluid().getID() <= 0) || (aFluid.amount <= 0)) { diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/items/Gregtech_MetaItem_X32.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/items/Gregtech_MetaItem_X32.java index a7f7cae271..c87b46e696 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/items/Gregtech_MetaItem_X32.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/items/Gregtech_MetaItem_X32.java @@ -1,5 +1,13 @@ package gtPlusPlus.xmod.gregtech.api.items; +import java.util.Arrays; +import java.util.List; + +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; + import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.GregTech_API; @@ -12,24 +20,21 @@ import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Utility; import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.math.MathUtils; -import java.util.Arrays; -import java.util.List; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; /** * @author Gregorius Techneticies * <p/> * One Item for everything! * <p/> - * This brilliant Item Class is used for automatically generating all possible variations of Material Items, like Dusts, Ingots, Gems, Plates and similar. - * It saves me a ton of work, when adding Items, because I always have to make a new Item SubType for each OreDict Prefix, when adding a new Material. + * This brilliant Item Class is used for automatically generating all possible variations of Material Items, + * like Dusts, Ingots, Gems, Plates and similar. It saves me a ton of work, when adding Items, because I always + * have to make a new Item SubType for each OreDict Prefix, when adding a new Material. * <p/> - * As you can see, up to 32766 Items can be generated using this Class. And the last 766 Items can be custom defined, just to save space and MetaData. + * As you can see, up to 32766 Items can be generated using this Class. And the last 766 Items can be custom + * defined, just to save space and MetaData. * <p/> - * These Items can also have special RightClick abilities, electric Charge or even be set to become a Food alike Item. + * These Items can also have special RightClick abilities, electric Charge or even be set to become a Food alike + * Item. */ public abstract class Gregtech_MetaItem_X32 extends Gregtech_MetaItem { @@ -57,7 +62,8 @@ public abstract class Gregtech_MetaItem_X32 extends Gregtech_MetaItem { if (this.doesMaterialAllowGeneration(tPrefix, tMaterial)) { final ItemStack tStack = new ItemStack(this, 1, i); GT_LanguageManager.addStringLocalization( - this.getUnlocalizedName(tStack) + ".name", this.getDefaultLocalization(tPrefix, tMaterial, i)); + this.getUnlocalizedName(tStack) + ".name", + this.getDefaultLocalization(tPrefix, tMaterial, i)); GT_LanguageManager.addStringLocalization( this.getUnlocalizedName(tStack) + ".tooltip", tMaterial.getToolTip(tPrefix.mMaterialAmount / GT_Values.M)); @@ -67,8 +73,7 @@ public abstract class Gregtech_MetaItem_X32 extends Gregtech_MetaItem { GT_OreDictUnificator.registerOre(tPrefix.get(tMaterial), tStack); } if (((tPrefix == OrePrefixes.stick) || (tPrefix == OrePrefixes.wireFine)) - && ((tMaterial == Materials.Lead) - || (tMaterial == Materials.Tin) + && ((tMaterial == Materials.Lead) || (tMaterial == Materials.Tin) || (tMaterial == Materials.SolderingAlloy))) { GregTech_API.sSolderingMetalList.add(tStack); } @@ -118,19 +123,20 @@ public abstract class Gregtech_MetaItem_X32 extends Gregtech_MetaItem { */ public final IIconContainer getIconContainer(final int aMetaData, final Materials aMaterial) { return (this.mGeneratedPrefixList[aMetaData / 1000] != null) - && (this.mGeneratedPrefixList[aMetaData / 1000].mTextureIndex >= 0) - ? aMaterial.mIconSet.mTextures[this.mGeneratedPrefixList[aMetaData / 1000].mTextureIndex] - : null; + && (this.mGeneratedPrefixList[aMetaData / 1000].mTextureIndex >= 0) + ? aMaterial.mIconSet.mTextures[this.mGeneratedPrefixList[aMetaData / 1000].mTextureIndex] + : null; } /** * @param aPrefix always != null * @param aMaterial always != null - * @param aDoShowAllItems this is the Configuration Setting of the User, if he wants to see all the Stuff like Tiny Dusts or Crushed Ores as well. + * @param aDoShowAllItems this is the Configuration Setting of the User, if he wants to see all the Stuff like Tiny + * Dusts or Crushed Ores as well. * @return if this Item should be visible in NEI or Creative */ - public boolean doesShowInCreative( - final OrePrefixes aPrefix, final Materials aMaterial, final boolean aDoShowAllItems) { + public boolean doesShowInCreative(final OrePrefixes aPrefix, final Materials aMaterial, + final boolean aDoShowAllItems) { return true; } @@ -153,8 +159,7 @@ public abstract class Gregtech_MetaItem_X32 extends Gregtech_MetaItem { @Override public final IIconContainer getIconContainer(final int aMetaData) { - return GregTech_API.sGeneratedMaterials[aMetaData % 1000] == null - ? null + return GregTech_API.sGeneratedMaterials[aMetaData % 1000] == null ? null : this.getIconContainer(aMetaData, GregTech_API.sGeneratedMaterials[aMetaData % 1000]); } @@ -163,7 +168,8 @@ public abstract class Gregtech_MetaItem_X32 extends Gregtech_MetaItem { public final void getSubItems(final Item var1, final CreativeTabs aCreativeTab, final List aList) { for (int i = 0; i < 32000; i++) { if (this.doesMaterialAllowGeneration( - this.mGeneratedPrefixList[i / 1000], GregTech_API.sGeneratedMaterials[i % 1000]) + this.mGeneratedPrefixList[i / 1000], + GregTech_API.sGeneratedMaterials[i % 1000]) && this.doesShowInCreative( this.mGeneratedPrefixList[i / 1000], GregTech_API.sGeneratedMaterials[i % 1000], @@ -199,8 +205,8 @@ public abstract class Gregtech_MetaItem_X32 extends Gregtech_MetaItem { public int getItemStackLimit(final ItemStack aStack) { final int tDamage = this.getDamage(aStack); if ((tDamage < 32000) && (this.mGeneratedPrefixList[tDamage / 1000] != null)) { - return Math.min( - super.getItemStackLimit(aStack), this.mGeneratedPrefixList[tDamage / 1000].mDefaultStackSize); + return Math + .min(super.getItemStackLimit(aStack), this.mGeneratedPrefixList[tDamage / 1000].mDefaultStackSize); } return super.getItemStackLimit(aStack); } @@ -236,7 +242,9 @@ public abstract class Gregtech_MetaItem_X32 extends Gregtech_MetaItem { HEX_OxFFFFFF = 0xffb300; } else if (stack.getDisplayName().contains("MAX")) { HEX_OxFFFFFF = Utils.rgbtoHexValue( - MathUtils.randInt(220, 250), MathUtils.randInt(221, 251), MathUtils.randInt(220, 250)); + MathUtils.randInt(220, 250), + MathUtils.randInt(221, 251), + MathUtils.randInt(220, 250)); } else { HEX_OxFFFFFF = 0xffffff; } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/items/Gregtech_MetaTool.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/items/Gregtech_MetaTool.java index 7cb79a4ad6..11a4c02fbb 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/items/Gregtech_MetaTool.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/items/Gregtech_MetaTool.java @@ -1,21 +1,12 @@ package gtPlusPlus.xmod.gregtech.api.items; -import buildcraft.api.tools.IToolWrench; -import cpw.mods.fml.common.Optional; -import gregtech.api.enchants.Enchantment_Radioactivity; -import gregtech.api.enums.Materials; -import gregtech.api.interfaces.IDamagableItem; -import gregtech.api.interfaces.IToolStats; -import gregtech.api.items.GT_MetaGenerated_Tool; -import gregtech.api.util.GT_ModHandler; -import gregtech.api.util.GT_Utility; -import gtPlusPlus.core.creative.AddToCreativeTab; -import gtPlusPlus.xmod.gregtech.api.interfaces.internal.Interface_ToolStats; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map.Entry; + import mods.railcraft.api.core.items.IToolCrowbar; + import net.minecraft.block.Block; import net.minecraft.enchantment.Enchantment; import net.minecraft.enchantment.EnchantmentHelper; @@ -34,21 +25,33 @@ import net.minecraft.util.MathHelper; import net.minecraft.world.World; import net.minecraftforge.event.world.BlockEvent; +import buildcraft.api.tools.IToolWrench; +import cpw.mods.fml.common.Optional; +import gregtech.api.enchants.Enchantment_Radioactivity; +import gregtech.api.enums.Materials; +import gregtech.api.interfaces.IDamagableItem; +import gregtech.api.interfaces.IToolStats; +import gregtech.api.items.GT_MetaGenerated_Tool; +import gregtech.api.util.GT_ModHandler; +import gregtech.api.util.GT_Utility; +import gtPlusPlus.core.creative.AddToCreativeTab; +import gtPlusPlus.xmod.gregtech.api.interfaces.internal.Interface_ToolStats; + /** * This is an example on how you can create a Tool ItemStack, in this case a Bismuth Wrench: - * GT_MetaGenerated_Tool.sInstances.get("gt.metatool.01").getToolWithStats(16, 1, Materials.Bismuth, Materials.Bismuth, null); + * GT_MetaGenerated_Tool.sInstances.get("gt.metatool.01").getToolWithStats(16, 1, Materials.Bismuth, Materials.Bismuth, + * null); */ -@Optional.InterfaceList({ - @Optional.Interface(iface = "forestry.api.arboriculture.IToolGrafter", modid = "Forestry"), - @Optional.Interface(iface = "mods.railcraft.api.core.items.IToolCrowbar", modid = "Railcraft"), - @Optional.Interface(iface = "buildcraft.api.tools.IToolWrench", modid = "BuildCraft"), - @Optional.Interface(iface = "crazypants.enderio.api.tool.ITool", modid = "EnderIO") -}) +@Optional.InterfaceList({ @Optional.Interface(iface = "forestry.api.arboriculture.IToolGrafter", modid = "Forestry"), + @Optional.Interface(iface = "mods.railcraft.api.core.items.IToolCrowbar", modid = "Railcraft"), + @Optional.Interface(iface = "buildcraft.api.tools.IToolWrench", modid = "BuildCraft"), + @Optional.Interface(iface = "crazypants.enderio.api.tool.ITool", modid = "EnderIO") }) public abstract class Gregtech_MetaTool extends GT_MetaGenerated_Tool implements IDamagableItem, IToolCrowbar, IToolWrench { + /** - * All instances of this Item Class are listed here. - * This gets used to register the Renderer to all Items of this Type, if useStandardMetaItemRenderer() returns true. + * All instances of this Item Class are listed here. This gets used to register the Renderer to all Items of this + * Type, if useStandardMetaItemRenderer() returns true. * <p/> * You can also use the unlocalized Name gotten from getUnlocalizedName() as Key if you want to get a specific Item. */ @@ -75,35 +78,26 @@ public abstract class Gregtech_MetaTool extends GT_MetaGenerated_Tool * Called by the Block Harvesting Event within the GT_Proxy */ @Override - public void onHarvestBlockEvent( - final ArrayList<ItemStack> aDrops, - final ItemStack aStack, - final EntityPlayer aPlayer, - final Block aBlock, - final int aX, - final int aY, - final int aZ, - final byte aMetaData, - final int aFortune, - final boolean aSilkTouch, + public void onHarvestBlockEvent(final ArrayList<ItemStack> aDrops, final ItemStack aStack, + final EntityPlayer aPlayer, final Block aBlock, final int aX, final int aY, final int aZ, + final byte aMetaData, final int aFortune, final boolean aSilkTouch, final BlockEvent.HarvestDropsEvent aEvent) { final IToolStats tStats = this.getToolStats(aStack); if (this.isItemStackUsable(aStack) && (this.getDigSpeed(aStack, aBlock, aMetaData) > 0.0F)) { this.doDamage( aStack, tStats.convertBlockDrops( - aDrops, - aStack, - aPlayer, - aBlock, - aX, - aY, - aZ, - aMetaData, - aFortune, - aSilkTouch, - aEvent) - * tStats.getToolDamagePerDropConversion()); + aDrops, + aStack, + aPlayer, + aBlock, + aX, + aY, + aZ, + aMetaData, + aFortune, + aSilkTouch, + aEvent) * tStats.getToolDamagePerDropConversion()); } } @@ -118,23 +112,23 @@ public abstract class Gregtech_MetaTool extends GT_MetaGenerated_Tool return true; } if (aEntity.canAttackWithItem() && !aEntity.hitByEntity(aPlayer)) { - final float tMagicDamage = tStats.getMagicDamageAgainstEntity( - aEntity instanceof EntityLivingBase - ? EnchantmentHelper.getEnchantmentModifierLiving(aPlayer, (EntityLivingBase) aEntity) - : 0.0F, - aEntity, - aStack, - aPlayer); + final float tMagicDamage = tStats + .getMagicDamageAgainstEntity( + aEntity instanceof EntityLivingBase + ? EnchantmentHelper + .getEnchantmentModifierLiving(aPlayer, (EntityLivingBase) aEntity) + : 0.0F, + aEntity, + aStack, + aPlayer); float tDamage = tStats.getNormalDamageAgainstEntity( - (float) aPlayer.getEntityAttribute(SharedMonsterAttributes.attackDamage) - .getAttributeValue() + (float) aPlayer.getEntityAttribute(SharedMonsterAttributes.attackDamage).getAttributeValue() + this.getToolCombatDamage(aStack), aEntity, aStack, aPlayer); if ((tDamage + tMagicDamage) > 0.0F) { - final boolean tCriticalHit = (aPlayer.fallDistance > 0.0F) - && !aPlayer.onGround + final boolean tCriticalHit = (aPlayer.fallDistance > 0.0F) && !aPlayer.onGround && !aPlayer.isOnLadder() && !aPlayer.isInWater() && !aPlayer.isPotionActive(Potion.blindness) @@ -148,10 +142,9 @@ public abstract class Gregtech_MetaTool extends GT_MetaGenerated_Tool if (aEntity instanceof EntityLivingBase) { aEntity.setFire(EnchantmentHelper.getFireAspectModifier(aPlayer) * 4); } - final int tKnockcack = (aPlayer.isSprinting() ? 1 : 0) - + (aEntity instanceof EntityLivingBase - ? EnchantmentHelper.getKnockbackModifier(aPlayer, (EntityLivingBase) aEntity) - : 0); + final int tKnockcack = (aPlayer.isSprinting() ? 1 : 0) + (aEntity instanceof EntityLivingBase + ? EnchantmentHelper.getKnockbackModifier(aPlayer, (EntityLivingBase) aEntity) + : 0); if (tKnockcack > 0) { aEntity.addVelocity( -MathHelper.sin((aPlayer.rotationYaw * (float) Math.PI) / 180.0F) * tKnockcack * 0.5F, @@ -178,8 +171,8 @@ public abstract class Gregtech_MetaTool extends GT_MetaGenerated_Tool if (aEntity instanceof EntityLivingBase) { aPlayer.addStat(StatList.damageDealtStat, Math.round(tDamage * 10.0F)); } - aEntity.hurtResistantTime = - Math.max(1, tStats.getHurtResistanceTime(aEntity.hurtResistantTime, aEntity)); + aEntity.hurtResistantTime = Math + .max(1, tStats.getHurtResistanceTime(aEntity.hurtResistantTime, aEntity)); aPlayer.addExhaustion(0.3F); this.doDamage(aStack, tStats.getToolDamagePerEntityAttack()); } @@ -208,29 +201,39 @@ public abstract class Gregtech_MetaTool extends GT_MetaGenerated_Tool final int tOffset = this.getElectricStats(aStack) != null ? 2 : 1; if (tStats != null) { final String name = aStack.getUnlocalizedName(); - if (name.equals("gt.metatool.01.170") - || name.equals("gt.metatool.01.172") + if (name.equals("gt.metatool.01.170") || name.equals("gt.metatool.01.172") || name.equals("gt.metatool.01.174") || name.equals("gt.metatool.01.176")) { aList.add( tOffset + 0, - EnumChatFormatting.WHITE + "Durability: " + EnumChatFormatting.GREEN - + (tMaxDamage - getToolDamage(aStack)) + " / " + tMaxDamage + EnumChatFormatting.GRAY); + EnumChatFormatting.WHITE + "Durability: " + + EnumChatFormatting.GREEN + + (tMaxDamage - getToolDamage(aStack)) + + " / " + + tMaxDamage + + EnumChatFormatting.GRAY); aList.add( tOffset + 1, - EnumChatFormatting.WHITE + tMaterial.mDefaultLocalName + EnumChatFormatting.YELLOW + " lvl " - + this.getHarvestLevel(aStack, "") + EnumChatFormatting.GRAY); + EnumChatFormatting.WHITE + tMaterial.mDefaultLocalName + + EnumChatFormatting.YELLOW + + " lvl " + + this.getHarvestLevel(aStack, "") + + EnumChatFormatting.GRAY); aList.add( tOffset + 2, - EnumChatFormatting.WHITE + "Turbine Efficency: " + EnumChatFormatting.BLUE - + (50.0F + (10.0F * this.getToolCombatDamage(aStack))) + EnumChatFormatting.GRAY); + EnumChatFormatting.WHITE + "Turbine Efficency: " + + EnumChatFormatting.BLUE + + (50.0F + (10.0F * this.getToolCombatDamage(aStack))) + + EnumChatFormatting.GRAY); aList.add( tOffset + 3, - EnumChatFormatting.WHITE + "Optimal Steam flow: " + EnumChatFormatting.LIGHT_PURPLE + EnumChatFormatting.WHITE + "Optimal Steam flow: " + + EnumChatFormatting.LIGHT_PURPLE + Math.max( Float.MIN_NORMAL, tStats.getSpeedMultiplier() * getPrimaryMaterial(aStack).mToolSpeed * 1000) - + EnumChatFormatting.GRAY + "L/sec"); + + EnumChatFormatting.GRAY + + "L/sec"); aList.add( tOffset + 3, EnumChatFormatting.WHITE + "Optimal Gas flow(EU burnvalue per tick): " @@ -238,7 +241,8 @@ public abstract class Gregtech_MetaTool extends GT_MetaGenerated_Tool + Math.max( Float.MIN_NORMAL, tStats.getSpeedMultiplier() * getPrimaryMaterial(aStack).mToolSpeed * 25) - + EnumChatFormatting.GRAY + "EU/t"); + + EnumChatFormatting.GRAY + + "EU/t"); aList.add( tOffset + 3, EnumChatFormatting.WHITE + "Optimal Plasma flow(Plasma energyvalue per tick): " @@ -246,24 +250,35 @@ public abstract class Gregtech_MetaTool extends GT_MetaGenerated_Tool + Math.max( Float.MIN_NORMAL, tStats.getSpeedMultiplier() * getPrimaryMaterial(aStack).mToolSpeed * 1000) - + EnumChatFormatting.GRAY + "EU/t"); + + EnumChatFormatting.GRAY + + "EU/t"); } else { aList.add( tOffset + 0, - EnumChatFormatting.WHITE + "Durability: " + EnumChatFormatting.GREEN - + (tMaxDamage - getToolDamage(aStack)) + " / " + tMaxDamage + EnumChatFormatting.GRAY); + EnumChatFormatting.WHITE + "Durability: " + + EnumChatFormatting.GREEN + + (tMaxDamage - getToolDamage(aStack)) + + " / " + + tMaxDamage + + EnumChatFormatting.GRAY); aList.add( tOffset + 1, - EnumChatFormatting.WHITE + tMaterial.mDefaultLocalName + EnumChatFormatting.YELLOW + " lvl " - + this.getHarvestLevel(aStack, "") + EnumChatFormatting.GRAY); + EnumChatFormatting.WHITE + tMaterial.mDefaultLocalName + + EnumChatFormatting.YELLOW + + " lvl " + + this.getHarvestLevel(aStack, "") + + EnumChatFormatting.GRAY); aList.add( tOffset + 2, - EnumChatFormatting.WHITE + "Attack Damage: " + EnumChatFormatting.BLUE - + this.getToolCombatDamage(aStack) + EnumChatFormatting.GRAY); + EnumChatFormatting.WHITE + "Attack Damage: " + + EnumChatFormatting.BLUE + + this.getToolCombatDamage(aStack) + + EnumChatFormatting.GRAY); aList.add( tOffset + 3, - EnumChatFormatting.WHITE + "Mining Speed: " + EnumChatFormatting.LIGHT_PURPLE + EnumChatFormatting.WHITE + "Mining Speed: " + + EnumChatFormatting.LIGHT_PURPLE + Math.max( Float.MIN_NORMAL, tStats.getSpeedMultiplier() * getPrimaryMaterial(aStack).mToolSpeed) @@ -280,29 +295,39 @@ public abstract class Gregtech_MetaTool extends GT_MetaGenerated_Tool final int tOffset = this.getElectricStats(aStack) != null ? 2 : 1; if (tStats != null) { final String name = aStack.getUnlocalizedName(); - if (name.equals("gt.metatool.01.170") - || name.equals("gt.metatool.01.172") + if (name.equals("gt.metatool.01.170") || name.equals("gt.metatool.01.172") || name.equals("gt.metatool.01.174") || name.equals("gt.metatool.01.176")) { aList.add( tOffset + 0, - EnumChatFormatting.WHITE + "Durability: " + EnumChatFormatting.GREEN - + (tMaxDamage - getToolDamage(aStack)) + " / " + tMaxDamage + EnumChatFormatting.GRAY); + EnumChatFormatting.WHITE + "Durability: " + + EnumChatFormatting.GREEN + + (tMaxDamage - getToolDamage(aStack)) + + " / " + + tMaxDamage + + EnumChatFormatting.GRAY); aList.add( tOffset + 1, - EnumChatFormatting.WHITE + tMaterial.mDefaultLocalName + EnumChatFormatting.YELLOW + " lvl " - + this.getHarvestLevel(aStack, "") + EnumChatFormatting.GRAY); + EnumChatFormatting.WHITE + tMaterial.mDefaultLocalName + + EnumChatFormatting.YELLOW + + " lvl " + + this.getHarvestLevel(aStack, "") + + EnumChatFormatting.GRAY); aList.add( tOffset + 2, - EnumChatFormatting.WHITE + "Turbine Efficency: " + EnumChatFormatting.BLUE - + (50.0F + (10.0F * this.getToolCombatDamage(aStack))) + EnumChatFormatting.GRAY); + EnumChatFormatting.WHITE + "Turbine Efficency: " + + EnumChatFormatting.BLUE + + (50.0F + (10.0F * this.getToolCombatDamage(aStack))) + + EnumChatFormatting.GRAY); aList.add( tOffset + 3, - EnumChatFormatting.WHITE + "Optimal Steam flow: " + EnumChatFormatting.LIGHT_PURPLE + EnumChatFormatting.WHITE + "Optimal Steam flow: " + + EnumChatFormatting.LIGHT_PURPLE + Math.max( Float.MIN_NORMAL, tStats.getSpeedMultiplier() * getPrimaryMaterial(aStack).mToolSpeed * 1000) - + EnumChatFormatting.GRAY + "L/sec"); + + EnumChatFormatting.GRAY + + "L/sec"); aList.add( tOffset + 3, EnumChatFormatting.WHITE + "Optimal Gas flow(EU burnvalue per tick): " @@ -310,7 +335,8 @@ public abstract class Gregtech_MetaTool extends GT_MetaGenerated_Tool + Math.max( Float.MIN_NORMAL, tStats.getSpeedMultiplier() * getPrimaryMaterial(aStack).mToolSpeed * 50) - + EnumChatFormatting.GRAY + "EU/t"); + + EnumChatFormatting.GRAY + + "EU/t"); aList.add( tOffset + 3, EnumChatFormatting.WHITE + "Optimal Plasma flow(Plasma energyvalue per tick): " @@ -318,24 +344,35 @@ public abstract class Gregtech_MetaTool extends GT_MetaGenerated_Tool + Math.max( Float.MIN_NORMAL, tStats.getSpeedMultiplier() * getPrimaryMaterial(aStack).mToolSpeed * 1000) - + EnumChatFormatting.GRAY + "EU/t"); + + EnumChatFormatting.GRAY + + "EU/t"); } else { aList.add( tOffset + 0, - EnumChatFormatting.WHITE + "Durability: " + EnumChatFormatting.GREEN - + (tMaxDamage - getToolDamage(aStack)) + " / " + tMaxDamage + EnumChatFormatting.GRAY); + EnumChatFormatting.WHITE + "Durability: " + + EnumChatFormatting.GREEN + + (tMaxDamage - getToolDamage(aStack)) + + " / " + + tMaxDamage + + EnumChatFormatting.GRAY); aList.add( tOffset + 1, - EnumChatFormatting.WHITE + tMaterial.mDefaultLocalName + EnumChatFormatting.YELLOW + " lvl " - + this.getHarvestLevel(aStack, "") + EnumChatFormatting.GRAY); + EnumChatFormatting.WHITE + tMaterial.mDefaultLocalName + + EnumChatFormatting.YELLOW + + " lvl " + + this.getHarvestLevel(aStack, "") + + EnumChatFormatting.GRAY); aList.add( tOffset + 2, - EnumChatFormatting.WHITE + "Attack Damage: " + EnumChatFormatting.BLUE - + this.getToolCombatDamage(aStack) + EnumChatFormatting.GRAY); + EnumChatFormatting.WHITE + "Attack Damage: " + + EnumChatFormatting.BLUE + + this.getToolCombatDamage(aStack) + + EnumChatFormatting.GRAY); aList.add( tOffset + 3, - EnumChatFormatting.WHITE + "Mining Speed: " + EnumChatFormatting.LIGHT_PURPLE + EnumChatFormatting.WHITE + "Mining Speed: " + + EnumChatFormatting.LIGHT_PURPLE + Math.max( Float.MIN_NORMAL, tStats.getSpeedMultiplier() * getPrimaryMaterial(aStack).mToolSpeed) @@ -362,7 +399,9 @@ public abstract class Gregtech_MetaTool extends GT_MetaGenerated_Tool aList.add( tOffset + 3, - EnumChatFormatting.RED + "Heat: " + aNBT.getInteger("Heat") + " K" + EnumChatFormatting.RED + "Heat: " + + aNBT.getInteger("Heat") + + " K" + EnumChatFormatting.GRAY); } } @@ -381,12 +420,8 @@ public abstract class Gregtech_MetaTool extends GT_MetaGenerated_Tool if (aNBT != null) { aNBT = aNBT.getCompoundTag("GT.ToolStats"); if ((aNBT != null) && aNBT.getBoolean("Electric")) { - return new Long[] { - aNBT.getLong("MaxCharge"), - aNBT.getLong("Voltage"), - aNBT.getLong("Tier"), - aNBT.getLong("SpecialData") - }; + return new Long[] { aNBT.getLong("MaxCharge"), aNBT.getLong("Voltage"), aNBT.getLong("Tier"), + aNBT.getLong("SpecialData") }; } } return new Long[] {}; @@ -416,14 +451,8 @@ public abstract class Gregtech_MetaTool extends GT_MetaGenerated_Tool } @Override - public boolean onBlockDestroyed( - final ItemStack aStack, - final World aWorld, - final Block aBlock, - final int aX, - final int aY, - final int aZ, - final EntityLivingBase aPlayer) { + public boolean onBlockDestroyed(final ItemStack aStack, final World aWorld, final Block aBlock, final int aX, + final int aY, final int aZ, final EntityLivingBase aPlayer) { if (!this.isItemStackUsable(aStack)) { return false; } @@ -432,8 +461,9 @@ public abstract class Gregtech_MetaTool extends GT_MetaGenerated_Tool return false; } GT_Utility.doSoundAtClient(tStats.getMiningSound(), 1, 1.0F); - this.doDamage(aStack, (int) - Math.max(1, aBlock.getBlockHardness(aWorld, aX, aY, aZ) * tStats.getToolDamagePerBlockBreak())); + this.doDamage( + aStack, + (int) Math.max(1, aBlock.getBlockHardness(aWorld, aX, aY, aZ) * tStats.getToolDamagePerBlockBreak())); return this.getDigSpeed(aStack, aBlock, aWorld.getBlockMetadata(aX, aY, aZ)) > 0.0F; } @@ -466,8 +496,8 @@ public abstract class Gregtech_MetaTool extends GT_MetaGenerated_Tool } @Override - public boolean canWhack( - final EntityPlayer aPlayer, final ItemStack aStack, final int aX, final int aY, final int aZ) { + public boolean canWhack(final EntityPlayer aPlayer, final ItemStack aStack, final int aX, final int aY, + final int aZ) { if (!this.isItemStackUsable(aStack)) { return false; } @@ -596,8 +626,7 @@ public abstract class Gregtech_MetaTool extends GT_MetaGenerated_Tool } } for (final Entry<Integer, Integer> tEntry : tMap.entrySet()) { - if ((tEntry.getKey() == 33) - || ((tEntry.getKey() == 20) && (tEntry.getValue() > 2)) + if ((tEntry.getKey() == 33) || ((tEntry.getKey() == 20) && (tEntry.getValue() > 2)) || (tEntry.getKey() == Enchantment_Radioactivity.INSTANCE.effectId)) { tResult.put(tEntry.getKey(), tEntry.getValue()); } else { diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/items/tools/GT_MetaGenTool.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/items/tools/GT_MetaGenTool.java index c9f337d47b..77b407109e 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/items/tools/GT_MetaGenTool.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/items/tools/GT_MetaGenTool.java @@ -1,17 +1,10 @@ package gtPlusPlus.xmod.gregtech.api.items.tools; -import gregtech.api.GregTech_API; -import gregtech.api.enchants.Enchantment_Radioactivity; -import gregtech.api.enums.Materials; -import gregtech.api.enums.TC_Aspects.TC_AspectStack; -import gregtech.api.interfaces.IToolStats; -import gregtech.api.items.GT_MetaGenerated_Tool; -import gregtech.api.util.*; -import gtPlusPlus.xmod.gregtech.api.interfaces.internal.Interface_ToolStats; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map.Entry; + import net.minecraft.block.Block; import net.minecraft.enchantment.Enchantment; import net.minecraft.enchantment.EnchantmentHelper; @@ -29,14 +22,25 @@ import net.minecraft.util.MathHelper; import net.minecraft.world.World; import net.minecraftforge.event.world.BlockEvent; +import gregtech.api.GregTech_API; +import gregtech.api.enchants.Enchantment_Radioactivity; +import gregtech.api.enums.Materials; +import gregtech.api.enums.TC_Aspects.TC_AspectStack; +import gregtech.api.interfaces.IToolStats; +import gregtech.api.items.GT_MetaGenerated_Tool; +import gregtech.api.util.*; +import gtPlusPlus.xmod.gregtech.api.interfaces.internal.Interface_ToolStats; + /** * This is an example on how you can create a Tool ItemStack, in this case a Bismuth Wrench: - * GT_MetaGenerated_Tool.sInstances.get("gt.metatool.01").getToolWithStats(16, 1, Materials.Bismuth, Materials.Bismuth, null); + * GT_MetaGenerated_Tool.sInstances.get("gt.metatool.01").getToolWithStats(16, 1, Materials.Bismuth, Materials.Bismuth, + * null); */ public abstract class GT_MetaGenTool extends GT_MetaGenerated_Tool { + /** - * All instances of this Item Class are listed here. - * This gets used to register the Renderer to all Items of this Type, if useStandardMetaItemRenderer() returns true. + * All instances of this Item Class are listed here. This gets used to register the Renderer to all Items of this + * Type, if useStandardMetaItemRenderer() returns true. * <p/> * You can also use the unlocalized Name gotten from getUnlocalizedName() as Key if you want to get a specific Item. */ @@ -86,18 +90,17 @@ public abstract class GT_MetaGenTool extends GT_MetaGenerated_Tool { /** * This adds a Custom Item to the ending Range. * - * @param aID The Id of the assigned Tool Class [0 - 32765] (only even Numbers allowed! Uneven ID's are empty electric Items) + * @param aID The Id of the assigned Tool Class [0 - 32765] (only even Numbers allowed! Uneven + * ID's are empty electric Items) * @param aEnglish The Default Localized Name of the created Item - * @param aToolTip The Default ToolTip of the created Item, you can also insert null for having no ToolTip + * @param aToolTip The Default ToolTip of the created Item, you can also insert null for having no + * ToolTip * @param aToolStats The Food Value of this Item. Can be null as well. - * @param aOreDictNamesAndAspects The OreDict Names you want to give the Item. Also used to assign Thaumcraft Aspects. + * @param aOreDictNamesAndAspects The OreDict Names you want to give the Item. Also used to assign Thaumcraft + * Aspects. * @return An ItemStack containing the newly created Item, but without specific Stats. */ - public final ItemStack addToolEx( - final int aID, - final String aEnglish, - String aToolTip, - final IToolStats aToolStats, + public final ItemStack addToolEx(final int aID, final String aEnglish, String aToolTip, final IToolStats aToolStats, final Object... aOreDictNamesAndAspects) { if (aToolTip == null) { aToolTip = ""; @@ -106,9 +109,11 @@ public abstract class GT_MetaGenTool extends GT_MetaGenerated_Tool { GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + "." + aID + ".name", aEnglish); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + "." + aID + ".tooltip", aToolTip); GT_LanguageManager.addStringLocalization( - this.getUnlocalizedName() + "." + (aID + 1) + ".name", aEnglish + " (Empty)"); + this.getUnlocalizedName() + "." + (aID + 1) + ".name", + aEnglish + " (Empty)"); GT_LanguageManager.addStringLocalization( - this.getUnlocalizedName() + "." + (aID + 1) + ".tooltip", "You need to recharge it"); + this.getUnlocalizedName() + "." + (aID + 1) + ".tooltip", + "You need to recharge it"); this.mToolStats.put((short) aID, aToolStats); this.mToolStats.put((short) (aID + 1), aToolStats); aToolStats.onStatsAddedToTool(this, aID); @@ -138,12 +143,8 @@ public abstract class GT_MetaGenTool extends GT_MetaGenerated_Tool { * @param aSecondaryMaterial Secondary (Rod/Handle) Material of this Tool * @param aElectricArray The Electric Stats of this Tool (or null if not electric) */ - public final ItemStack getToolWithStatsEx( - final int aToolID, - final int aAmount, - final Materials aPrimaryMaterial, - final Materials aSecondaryMaterial, - final long[] aElectricArray) { + public final ItemStack getToolWithStatsEx(final int aToolID, final int aAmount, final Materials aPrimaryMaterial, + final Materials aSecondaryMaterial, final long[] aElectricArray) { final ItemStack rStack = new ItemStack(this, aAmount, aToolID); final IToolStats tToolStats = this.getToolStats(rStack); if (tToolStats != null) { @@ -177,35 +178,26 @@ public abstract class GT_MetaGenTool extends GT_MetaGenerated_Tool { * Called by the Block Harvesting Event within the GT_Proxy */ @Override - public void onHarvestBlockEvent( - final ArrayList<ItemStack> aDrops, - final ItemStack aStack, - final EntityPlayer aPlayer, - final Block aBlock, - final int aX, - final int aY, - final int aZ, - final byte aMetaData, - final int aFortune, - final boolean aSilkTouch, + public void onHarvestBlockEvent(final ArrayList<ItemStack> aDrops, final ItemStack aStack, + final EntityPlayer aPlayer, final Block aBlock, final int aX, final int aY, final int aZ, + final byte aMetaData, final int aFortune, final boolean aSilkTouch, final BlockEvent.HarvestDropsEvent aEvent) { final IToolStats tStats = this.getToolStats(aStack); if (this.isItemStackUsable(aStack) && (this.getDigSpeed(aStack, aBlock, aMetaData) > 0.0F)) { this.doDamage( aStack, tStats.convertBlockDrops( - aDrops, - aStack, - aPlayer, - aBlock, - aX, - aY, - aZ, - aMetaData, - aFortune, - aSilkTouch, - aEvent) - * tStats.getToolDamagePerDropConversion()); + aDrops, + aStack, + aPlayer, + aBlock, + aX, + aY, + aZ, + aMetaData, + aFortune, + aSilkTouch, + aEvent) * tStats.getToolDamagePerDropConversion()); } } @@ -220,23 +212,23 @@ public abstract class GT_MetaGenTool extends GT_MetaGenerated_Tool { return true; } if (aEntity.canAttackWithItem() && !aEntity.hitByEntity(aPlayer)) { - final float tMagicDamage = tStats.getMagicDamageAgainstEntity( - aEntity instanceof EntityLivingBase - ? EnchantmentHelper.getEnchantmentModifierLiving(aPlayer, (EntityLivingBase) aEntity) - : 0.0F, - aEntity, - aStack, - aPlayer); + final float tMagicDamage = tStats + .getMagicDamageAgainstEntity( + aEntity instanceof EntityLivingBase + ? EnchantmentHelper + .getEnchantmentModifierLiving(aPlayer, (EntityLivingBase) aEntity) + : 0.0F, + aEntity, + aStack, + aPlayer); float tDamage = tStats.getNormalDamageAgainstEntity( - (float) aPlayer.getEntityAttribute(SharedMonsterAttributes.attackDamage) - .getAttributeValue() + (float) aPlayer.getEntityAttribute(SharedMonsterAttributes.attackDamage).getAttributeValue() + this.getToolCombatDamage(aStack), aEntity, aStack, aPlayer); if ((tDamage + tMagicDamage) > 0.0F) { - final boolean tCriticalHit = (aPlayer.fallDistance > 0.0F) - && !aPlayer.onGround + final boolean tCriticalHit = (aPlayer.fallDistance > 0.0F) && !aPlayer.onGround && !aPlayer.isOnLadder() && !aPlayer.isInWater() && !aPlayer.isPotionActive(Potion.blindness) @@ -250,10 +242,9 @@ public abstract class GT_MetaGenTool extends GT_MetaGenerated_Tool { if (aEntity instanceof EntityLivingBase) { aEntity.setFire(EnchantmentHelper.getFireAspectModifier(aPlayer) * 4); } - final int tKnockcack = (aPlayer.isSprinting() ? 1 : 0) - + (aEntity instanceof EntityLivingBase - ? EnchantmentHelper.getKnockbackModifier(aPlayer, (EntityLivingBase) aEntity) - : 0); + final int tKnockcack = (aPlayer.isSprinting() ? 1 : 0) + (aEntity instanceof EntityLivingBase + ? EnchantmentHelper.getKnockbackModifier(aPlayer, (EntityLivingBase) aEntity) + : 0); if (tKnockcack > 0) { aEntity.addVelocity( -MathHelper.sin((aPlayer.rotationYaw * (float) Math.PI) / 180.0F) * tKnockcack * 0.5F, @@ -280,8 +271,8 @@ public abstract class GT_MetaGenTool extends GT_MetaGenerated_Tool { if (aEntity instanceof EntityLivingBase) { aPlayer.addStat(StatList.damageDealtStat, Math.round(tDamage * 10.0F)); } - aEntity.hurtResistantTime = - Math.max(1, tStats.getHurtResistanceTime(aEntity.hurtResistantTime, aEntity)); + aEntity.hurtResistantTime = Math + .max(1, tStats.getHurtResistanceTime(aEntity.hurtResistantTime, aEntity)); aPlayer.addExhaustion(0.3F); this.doDamage(aStack, tStats.getToolDamagePerEntityAttack()); } @@ -313,12 +304,8 @@ public abstract class GT_MetaGenTool extends GT_MetaGenerated_Tool { if (aNBT != null) { aNBT = aNBT.getCompoundTag("GT.ToolStats"); if ((aNBT != null) && aNBT.getBoolean("Electric")) { - return new Long[] { - aNBT.getLong("MaxCharge"), - aNBT.getLong("Voltage"), - aNBT.getLong("Tier"), - aNBT.getLong("SpecialData") - }; + return new Long[] { aNBT.getLong("MaxCharge"), aNBT.getLong("Voltage"), aNBT.getLong("Tier"), + aNBT.getLong("SpecialData") }; } } return null; @@ -348,14 +335,8 @@ public abstract class GT_MetaGenTool extends GT_MetaGenerated_Tool { } @Override - public boolean onBlockDestroyed( - final ItemStack aStack, - final World aWorld, - final Block aBlock, - final int aX, - final int aY, - final int aZ, - final EntityLivingBase aPlayer) { + public boolean onBlockDestroyed(final ItemStack aStack, final World aWorld, final Block aBlock, final int aX, + final int aY, final int aZ, final EntityLivingBase aPlayer) { if (!this.isItemStackUsable(aStack)) { return false; } @@ -364,8 +345,9 @@ public abstract class GT_MetaGenTool extends GT_MetaGenerated_Tool { return false; } GT_Utility.doSoundAtClient(tStats.getMiningSound(), 1, 1.0F); - this.doDamage(aStack, (int) - Math.max(1, aBlock.getBlockHardness(aWorld, aX, aY, aZ) * tStats.getToolDamagePerBlockBreak())); + this.doDamage( + aStack, + (int) Math.max(1, aBlock.getBlockHardness(aWorld, aX, aY, aZ) * tStats.getToolDamagePerBlockBreak())); return this.getDigSpeed(aStack, aBlock, aWorld.getBlockMetadata(aX, aY, aZ)) > 0.0F; } @@ -398,22 +380,16 @@ public abstract class GT_MetaGenTool extends GT_MetaGenerated_Tool { } @Override - public float getSaplingModifier( - final ItemStack aStack, - final World aWorld, - final EntityPlayer aPlayer, - final int aX, - final int aY, - final int aZ) { + public float getSaplingModifier(final ItemStack aStack, final World aWorld, final EntityPlayer aPlayer, + final int aX, final int aY, final int aZ) { final IToolStats tStats = this.getToolStats(aStack); - return (tStats != null) && tStats.isGrafter() - ? Math.min(100.0F, (1 + this.getHarvestLevel(aStack, "")) * 20.0F) + return (tStats != null) && tStats.isGrafter() ? Math.min(100.0F, (1 + this.getHarvestLevel(aStack, "")) * 20.0F) : 0.0F; } @Override - public boolean canWhack( - final EntityPlayer aPlayer, final ItemStack aStack, final int aX, final int aY, final int aZ) { + public boolean canWhack(final EntityPlayer aPlayer, final ItemStack aStack, final int aX, final int aY, + final int aZ) { if (!this.isItemStackUsable(aStack)) { return false; } @@ -562,8 +538,7 @@ public abstract class GT_MetaGenTool extends GT_MetaGenerated_Tool { } } for (final Entry<Integer, Integer> tEntry : tMap.entrySet()) { - if ((tEntry.getKey() == 33) - || ((tEntry.getKey() == 20) && (tEntry.getValue() > 2)) + if ((tEntry.getKey() == 33) || ((tEntry.getKey() == 20) && (tEntry.getValue() > 2)) || (tEntry.getKey() == Enchantment_Radioactivity.INSTANCE.effectId)) { tResult.put(tEntry.getKey(), tEntry.getValue()); } else { diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/items/types/ToolType_Base.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/items/types/ToolType_Base.java index e57f2009e7..463b6d9f7f 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/items/types/ToolType_Base.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/items/types/ToolType_Base.java @@ -1,9 +1,7 @@ package gtPlusPlus.xmod.gregtech.api.items.types; -import gregtech.api.enums.SubTag; -import gtPlusPlus.xmod.gregtech.api.interfaces.internal.Interface_ItemBehaviour; -import gtPlusPlus.xmod.gregtech.api.items.Gregtech_MetaItem_Base; import java.util.List; + import net.minecraft.block.BlockDispenser; import net.minecraft.dispenser.BehaviorDefaultDispenseItem; import net.minecraft.dispenser.IBlockSource; @@ -16,71 +14,47 @@ import net.minecraft.item.ItemStack; import net.minecraft.util.EnumFacing; import net.minecraft.world.World; +import gregtech.api.enums.SubTag; +import gtPlusPlus.xmod.gregtech.api.interfaces.internal.Interface_ItemBehaviour; +import gtPlusPlus.xmod.gregtech.api.items.Gregtech_MetaItem_Base; + public class ToolType_Base implements Interface_ItemBehaviour<Gregtech_MetaItem_Base> { + @Override - public boolean onLeftClickEntity( - final Gregtech_MetaItem_Base aItem, - final ItemStack aStack, - final EntityPlayer aPlayer, - final Entity aEntity) { + public boolean onLeftClickEntity(final Gregtech_MetaItem_Base aItem, final ItemStack aStack, + final EntityPlayer aPlayer, final Entity aEntity) { return false; } @Override - public boolean onItemUse( - final Gregtech_MetaItem_Base aItem, - final ItemStack aStack, - final EntityPlayer aPlayer, - final World aWorld, - final int aX, - final int aY, - final int aZ, - final int aSide, - final float hitX, - final float hitY, - final float hitZ) { + public boolean onItemUse(final Gregtech_MetaItem_Base aItem, final ItemStack aStack, final EntityPlayer aPlayer, + final World aWorld, final int aX, final int aY, final int aZ, final int aSide, final float hitX, + final float hitY, final float hitZ) { return false; } @Override - public boolean onItemUseFirst( - final Gregtech_MetaItem_Base aItem, - final ItemStack aStack, - final EntityPlayer aPlayer, - final World aWorld, - final int aX, - final int aY, - final int aZ, - final int aSide, - final float hitX, - final float hitY, - final float hitZ) { + public boolean onItemUseFirst(final Gregtech_MetaItem_Base aItem, final ItemStack aStack, + final EntityPlayer aPlayer, final World aWorld, final int aX, final int aY, final int aZ, final int aSide, + final float hitX, final float hitY, final float hitZ) { return false; } @Override - public ItemStack onItemRightClick( - final Gregtech_MetaItem_Base aItem, - final ItemStack aStack, - final World aWorld, + public ItemStack onItemRightClick(final Gregtech_MetaItem_Base aItem, final ItemStack aStack, final World aWorld, final EntityPlayer aPlayer) { return aStack; } @Override - public List<String> getAdditionalToolTips( - final Gregtech_MetaItem_Base aItem, final List<String> aList, final ItemStack aStack) { + public List<String> getAdditionalToolTips(final Gregtech_MetaItem_Base aItem, final List<String> aList, + final ItemStack aStack) { return aList; } @Override - public void onUpdate( - final Gregtech_MetaItem_Base aItem, - final ItemStack aStack, - final World aWorld, - final Entity aPlayer, - final int aTimer, - final boolean aIsInHand) {} + public void onUpdate(final Gregtech_MetaItem_Base aItem, final ItemStack aStack, final World aWorld, + final Entity aPlayer, final int aTimer, final boolean aIsInHand) {} @Override public boolean isItemStackUsable(final Gregtech_MetaItem_Base aItem, final ItemStack aStack) { @@ -93,8 +67,8 @@ public class ToolType_Base implements Interface_ItemBehaviour<Gregtech_MetaItem_ } @Override - public ItemStack onDispense( - final Gregtech_MetaItem_Base aItem, final IBlockSource aSource, final ItemStack aStack) { + public ItemStack onDispense(final Gregtech_MetaItem_Base aItem, final IBlockSource aSource, + final ItemStack aStack) { final EnumFacing enumfacing = BlockDispenser.func_149937_b(aSource.getBlockMetadata()); final IPosition iposition = BlockDispenser.func_149939_a(aSource); final ItemStack itemstack1 = aStack.splitStack(1); @@ -103,31 +77,20 @@ public class ToolType_Base implements Interface_ItemBehaviour<Gregtech_MetaItem_ } @Override - public boolean hasProjectile( - final Gregtech_MetaItem_Base aItem, final SubTag aProjectileType, final ItemStack aStack) { + public boolean hasProjectile(final Gregtech_MetaItem_Base aItem, final SubTag aProjectileType, + final ItemStack aStack) { return false; } @Override - public EntityArrow getProjectile( - final Gregtech_MetaItem_Base aItem, - final SubTag aProjectileType, - final ItemStack aStack, - final World aWorld, - final double aX, - final double aY, - final double aZ) { + public EntityArrow getProjectile(final Gregtech_MetaItem_Base aItem, final SubTag aProjectileType, + final ItemStack aStack, final World aWorld, final double aX, final double aY, final double aZ) { return null; } @Override - public EntityArrow getProjectile( - final Gregtech_MetaItem_Base aItem, - final SubTag aProjectileType, - final ItemStack aStack, - final World aWorld, - final EntityLivingBase aEntity, - final float aSpeed) { + public EntityArrow getProjectile(final Gregtech_MetaItem_Base aItem, final SubTag aProjectileType, + final ItemStack aStack, final World aWorld, final EntityLivingBase aEntity, final float aSpeed) { return null; } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/items/types/ToolType_HardHammer.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/items/types/ToolType_HardHammer.java index 49063c43c2..6ed462d31f 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/items/types/ToolType_HardHammer.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/items/types/ToolType_HardHammer.java @@ -1,15 +1,8 @@ package gtPlusPlus.xmod.gregtech.api.items.types; -import gregtech.api.GregTech_API; -import gregtech.api.enums.Materials; -import gregtech.api.items.GT_MetaBase_Item; -import gregtech.api.items.GT_MetaGenerated_Tool; -import gregtech.api.objects.ItemData; -import gregtech.api.util.*; -import gregtech.common.blocks.GT_Block_Ores; -import gregtech.common.blocks.GT_TileEntity_Ores; import java.util.List; import java.util.Random; + import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; @@ -19,29 +12,30 @@ import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.IFluidBlock; +import gregtech.api.GregTech_API; +import gregtech.api.enums.Materials; +import gregtech.api.items.GT_MetaBase_Item; +import gregtech.api.items.GT_MetaGenerated_Tool; +import gregtech.api.objects.ItemData; +import gregtech.api.util.*; +import gregtech.common.blocks.GT_Block_Ores; +import gregtech.common.blocks.GT_TileEntity_Ores; + public class ToolType_HardHammer extends ToolType_Base { + private final int mVanillaCosts; private final int mEUCosts; - private final String mTooltip = - GT_LanguageManager.addStringLocalization("gt.behaviour.prospecting", "Usable for Prospecting"); + private final String mTooltip = GT_LanguageManager + .addStringLocalization("gt.behaviour.prospecting", "Usable for Prospecting"); public ToolType_HardHammer(final int aVanillaCosts, final int aEUCosts) { this.mVanillaCosts = aVanillaCosts; this.mEUCosts = aEUCosts; } - public boolean onItemUseFirst( - final GT_MetaBase_Item aItem, - final ItemStack aStack, - final EntityPlayer aPlayer, - final World aWorld, - final int aX, - final int aY, - final int aZ, - final int aSide, - final float hitX, - final float hitY, - final float hitZ) { + public boolean onItemUseFirst(final GT_MetaBase_Item aItem, final ItemStack aStack, final EntityPlayer aPlayer, + final World aWorld, final int aX, final int aY, final int aZ, final int aSide, final float hitX, + final float hitY, final float hitZ) { if (aWorld.isRemote) { return false; } @@ -54,9 +48,16 @@ public class ToolType_HardHammer extends ToolType_Base { ItemData tAssotiation = GT_OreDictUnificator.getAssociation(new ItemStack(aBlock, 1, aMeta)); if ((tAssotiation != null) && (tAssotiation.mPrefix.toString().startsWith("ore"))) { GT_Utility.sendChatToPlayer( - aPlayer, "This is " + tAssotiation.mMaterial.mMaterial.mDefaultLocalName + " Ore."); + aPlayer, + "This is " + tAssotiation.mMaterial.mMaterial.mDefaultLocalName + " Ore."); GT_Utility.sendSoundToPlayers( - aWorld, GregTech_API.sSoundList.get(Integer.valueOf(1)), 1.0F, -1.0F, aX, aY, aZ); + aWorld, + GregTech_API.sSoundList.get(Integer.valueOf(1)), + 1.0F, + -1.0F, + aX, + aY, + aZ); return true; } if ((aBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, Blocks.stone)) @@ -65,7 +66,13 @@ public class ToolType_HardHammer extends ToolType_Base { || (aBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, Blocks.end_stone))) { if (GT_ModHandler.damageOrDechargeItem(aStack, this.mVanillaCosts, this.mEUCosts, aPlayer)) { GT_Utility.sendSoundToPlayers( - aWorld, GregTech_API.sSoundList.get(Integer.valueOf(1)), 1.0F, -1.0F, aX, aY, aZ); + aWorld, + GregTech_API.sSoundList.get(Integer.valueOf(1)), + 1.0F, + -1.0F, + aX, + aY, + aZ); int tX = aX; int tY = aY; int tZ = aZ; @@ -85,8 +92,7 @@ public class ToolType_HardHammer extends ToolType_Base { GT_Utility.sendChatToPlayer(aPlayer, "There is Lava behind this Rock."); break; } - if ((tBlock == Blocks.water) - || (tBlock == Blocks.flowing_water) + if ((tBlock == Blocks.water) || (tBlock == Blocks.flowing_water) || ((tBlock instanceof IFluidBlock))) { GT_Utility.sendChatToPlayer(aPlayer, "There is a Liquid behind this Rock."); break; @@ -113,19 +119,19 @@ public class ToolType_HardHammer extends ToolType_Base { if ((tBlock instanceof GT_Block_Ores)) { final TileEntity tTileEntity = aWorld.getTileEntity(tX, tY, tZ); if ((tTileEntity instanceof GT_TileEntity_Ores)) { - final Materials tMaterial = GregTech_API.sGeneratedMaterials[ - (((GT_TileEntity_Ores) tTileEntity).mMetaData % 1000)]; + final Materials tMaterial = GregTech_API.sGeneratedMaterials[(((GT_TileEntity_Ores) tTileEntity).mMetaData + % 1000)]; if ((tMaterial != null) && (tMaterial != Materials._NULL)) { GT_Utility.sendChatToPlayer( - aPlayer, "Found traces of " + tMaterial.mDefaultLocalName + " Ore."); + aPlayer, + "Found traces of " + tMaterial.mDefaultLocalName + " Ore."); return true; } } } else { tMetaID = aWorld.getBlockMetadata(tX, tY, tZ); tAssotiation = GT_OreDictUnificator.getAssociation(new ItemStack(tBlock, 1, tMetaID)); - if ((tAssotiation != null) - && (tAssotiation.mPrefix.toString().startsWith("ore"))) { + if ((tAssotiation != null) && (tAssotiation.mPrefix.toString().startsWith("ore"))) { GT_Utility.sendChatToPlayer( aPlayer, "Found traces of " + tAssotiation.mMaterial.mMaterial.mDefaultLocalName + " Ore."); @@ -140,8 +146,8 @@ public class ToolType_HardHammer extends ToolType_Base { return false; } - public List<String> getAdditionalToolTips( - final GT_MetaBase_Item aItem, final List<String> aList, final ItemStack aStack) { + public List<String> getAdditionalToolTips(final GT_MetaBase_Item aItem, final List<String> aList, + final ItemStack aStack) { aList.add(this.mTooltip); return aList; } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/items/types/ToolType_Pump.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/items/types/ToolType_Pump.java index f1dd3b391d..1504b45d8e 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/items/types/ToolType_Pump.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/items/types/ToolType_Pump.java @@ -1,36 +1,30 @@ package gtPlusPlus.xmod.gregtech.api.items.types; -import gregtech.api.items.GT_MetaBase_Item; -import gregtech.api.util.GT_LanguageManager; -import gregtech.api.util.GT_Utility; import java.util.List; + import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; +import gregtech.api.items.GT_MetaBase_Item; +import gregtech.api.util.GT_LanguageManager; +import gregtech.api.util.GT_Utility; + public class ToolType_Pump extends ToolType_Base { + private final int mCosts; - private final String mTooltip = GT_LanguageManager.addStringLocalization( - "gt.behaviour.pump", "Sucks in Machine Input Fluid tank contents on Rightclick"); + private final String mTooltip = GT_LanguageManager + .addStringLocalization("gt.behaviour.pump", "Sucks in Machine Input Fluid tank contents on Rightclick"); public ToolType_Pump(final int aCosts) { this.mCosts = aCosts; } - public boolean onItemUseFirst( - final GT_MetaBase_Item aItem, - final ItemStack aStack, - final EntityPlayer aPlayer, - final World aWorld, - final int aX, - final int aY, - final int aZ, - final int aSide, - final float hitX, - final float hitY, - final float hitZ) { + public boolean onItemUseFirst(final GT_MetaBase_Item aItem, final ItemStack aStack, final EntityPlayer aPlayer, + final World aWorld, final int aX, final int aY, final int aZ, final int aSide, final float hitX, + final float hitY, final float hitZ) { if (aWorld.isRemote) { return false; } @@ -41,110 +35,72 @@ public class ToolType_Pump extends ToolType_Base { final byte aMeta = (byte) aWorld.getBlockMetadata(aX, aY, aZ); final byte aTargetSide = GT_Utility.determineWrenchingSide((byte) aSide, hitX, hitY, hitZ); final TileEntity aTileEntity = aWorld.getTileEntity(aX, aY, aZ); - /*try { - if ((aTileEntity != null) && ((aTileEntity instanceof IWrenchable))) { - if (((IWrenchable) aTileEntity).wrenchCanSetFacing(aPlayer, aTargetSide)) { - if ((aPlayer.capabilities.isCreativeMode) || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts))) { - ((IWrenchable) aTileEntity).setFacing(aTargetSide); - GT_Utility.sendSoundToPlayers(aWorld, GregTech_API.sSoundList.get(Integer.valueOf(100)), 1.0F, -1.0F, aX, aY, aZ); - } - return true; - } - if (((IWrenchable) aTileEntity).wrenchCanRemove(aPlayer)) { - final int tDamage = ((IWrenchable) aTileEntity).getWrenchDropRate() < 1.0F ? 10 : 3; - if ((aPlayer.capabilities.isCreativeMode) || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, tDamage * this.mCosts))) { - ItemStack tOutput = ((IWrenchable) aTileEntity).getWrenchDrop(aPlayer); - for (final ItemStack tStack : aBlock.getDrops(aWorld, aX, aY, aZ, aMeta, 0)) { - if (tOutput == null) { - aWorld.spawnEntityInWorld(new EntityItem(aWorld, aX + 0.5D, aY + 0.5D, aZ + 0.5D, tStack)); - } else { - aWorld.spawnEntityInWorld(new EntityItem(aWorld, aX + 0.5D, aY + 0.5D, aZ + 0.5D, tOutput)); - tOutput = null; - } - } - aWorld.setBlockToAir(aX, aY, aZ); - GT_Utility.sendSoundToPlayers(aWorld, GregTech_API.sSoundList.get(Integer.valueOf(100)), 1.0F, -1.0F, aX, aY, aZ); - } - return true; - } - return true; - } - } catch (final Throwable e) { - } - if ((aBlock == Blocks.log) || (aBlock == Blocks.log2) || (aBlock == Blocks.hay_block)) { - if ((aPlayer.capabilities.isCreativeMode) || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts))) { - aWorld.setBlockMetadataWithNotify(aX, aY, aZ, (aMeta + 4) % 12, 3); - GT_Utility.sendSoundToPlayers(aWorld, GregTech_API.sSoundList.get(Integer.valueOf(100)), 1.0F, -1.0F, aX, aY, aZ); - } - return true; - } - if ((aBlock == Blocks.powered_repeater) || (aBlock == Blocks.unpowered_repeater)) { - if ((aPlayer.capabilities.isCreativeMode) || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts))) { - aWorld.setBlockMetadataWithNotify(aX, aY, aZ, ((aMeta / 4) * 4) + (((aMeta % 4) + 1) % 4), 3); - GT_Utility.sendSoundToPlayers(aWorld, GregTech_API.sSoundList.get(Integer.valueOf(100)), 1.0F, -1.0F, aX, aY, aZ); - } - return true; - } - if ((aBlock == Blocks.powered_comparator) || (aBlock == Blocks.unpowered_comparator)) { - if ((aPlayer.capabilities.isCreativeMode) || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts))) { - aWorld.setBlockMetadataWithNotify(aX, aY, aZ, ((aMeta / 4) * 4) + (((aMeta % 4) + 1) % 4), 3); - GT_Utility.sendSoundToPlayers(aWorld, GregTech_API.sSoundList.get(Integer.valueOf(100)), 1.0F, -1.0F, aX, aY, aZ); - } - return true; - } - if ((aBlock == Blocks.crafting_table) || (aBlock == Blocks.bookshelf)) { - if ((aPlayer.capabilities.isCreativeMode) || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts))) { - aWorld.spawnEntityInWorld(new EntityItem(aWorld, aX + 0.5D, aY + 0.5D, aZ + 0.5D, new ItemStack(aBlock, 1, aMeta))); - aWorld.setBlockToAir(aX, aY, aZ); - GT_Utility.sendSoundToPlayers(aWorld, GregTech_API.sSoundList.get(Integer.valueOf(100)), 1.0F, -1.0F, aX, aY, aZ); - } - return true; - } - if (aMeta == aTargetSide) { - if ((aBlock == Blocks.pumpkin) || (aBlock == Blocks.lit_pumpkin) || (aBlock == Blocks.piston) || (aBlock == Blocks.sticky_piston) || (aBlock == Blocks.dispenser) || (aBlock == Blocks.dropper) || (aBlock == Blocks.furnace) || (aBlock == Blocks.lit_furnace) || (aBlock == Blocks.chest) || (aBlock == Blocks.trapped_chest) || (aBlock == Blocks.ender_chest) || (aBlock == Blocks.hopper)) { - if ((aPlayer.capabilities.isCreativeMode) || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts))) { - aWorld.spawnEntityInWorld(new EntityItem(aWorld, aX + 0.5D, aY + 0.5D, aZ + 0.5D, new ItemStack(aBlock, 1, 0))); - aWorld.setBlockToAir(aX, aY, aZ); - GT_Utility.sendSoundToPlayers(aWorld, GregTech_API.sSoundList.get(Integer.valueOf(100)), 1.0F, -1.0F, aX, aY, aZ); - } - return true; - } - } else { - if ((aBlock == Blocks.piston) || (aBlock == Blocks.sticky_piston) || (aBlock == Blocks.dispenser) || (aBlock == Blocks.dropper)) { - if ((aMeta < 6) && ((aPlayer.capabilities.isCreativeMode) || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts)))) { - aWorld.setBlockMetadataWithNotify(aX, aY, aZ, aTargetSide, 3); - GT_Utility.sendSoundToPlayers(aWorld, GregTech_API.sSoundList.get(Integer.valueOf(100)), 1.0F, -1.0F, aX, aY, aZ); - } - return true; - } - if ((aBlock == Blocks.pumpkin) || (aBlock == Blocks.lit_pumpkin) || (aBlock == Blocks.furnace) || (aBlock == Blocks.lit_furnace) || (aBlock == Blocks.chest) || (aBlock == Blocks.ender_chest) || (aBlock == Blocks.trapped_chest)) { - if ((aTargetSide > 1) && ((aPlayer.capabilities.isCreativeMode) || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts)))) { - aWorld.setBlockMetadataWithNotify(aX, aY, aZ, aTargetSide, 3); - GT_Utility.sendSoundToPlayers(aWorld, GregTech_API.sSoundList.get(Integer.valueOf(100)), 1.0F, -1.0F, aX, aY, aZ); - } - return true; - } - if (aBlock == Blocks.hopper) { - if ((aTargetSide != 1) && ((aPlayer.capabilities.isCreativeMode) || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts)))) { - aWorld.setBlockMetadataWithNotify(aX, aY, aZ, aTargetSide, 3); - GT_Utility.sendSoundToPlayers(aWorld, GregTech_API.sSoundList.get(Integer.valueOf(100)), 1.0F, -1.0F, aX, aY, aZ); - } - return true; - } - } - if ((Arrays.asList(aBlock.getValidRotations(aWorld, aX, aY, aZ)).contains(ForgeDirection.getOrientation(aTargetSide))) && - ((aPlayer.capabilities.isCreativeMode) || (!GT_ModHandler.isElectricItem(aStack)) || (GT_ModHandler.canUseElectricItem(aStack, this.mCosts))) && - (aBlock.rotateBlock(aWorld, aX, aY, aZ, ForgeDirection.getOrientation(aTargetSide)))) { - if (!aPlayer.capabilities.isCreativeMode) { - ((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts); - } - GT_Utility.sendSoundToPlayers(aWorld, GregTech_API.sSoundList.get(Integer.valueOf(100)), 1.0F, -1.0F, aX, aY, aZ); - }*/ + /* + * try { if ((aTileEntity != null) && ((aTileEntity instanceof IWrenchable))) { if (((IWrenchable) + * aTileEntity).wrenchCanSetFacing(aPlayer, aTargetSide)) { if ((aPlayer.capabilities.isCreativeMode) || + * (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts))) { ((IWrenchable) + * aTileEntity).setFacing(aTargetSide); GT_Utility.sendSoundToPlayers(aWorld, + * GregTech_API.sSoundList.get(Integer.valueOf(100)), 1.0F, -1.0F, aX, aY, aZ); } return true; } if + * (((IWrenchable) aTileEntity).wrenchCanRemove(aPlayer)) { final int tDamage = ((IWrenchable) + * aTileEntity).getWrenchDropRate() < 1.0F ? 10 : 3; if ((aPlayer.capabilities.isCreativeMode) || + * (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, tDamage * this.mCosts))) { ItemStack tOutput = + * ((IWrenchable) aTileEntity).getWrenchDrop(aPlayer); for (final ItemStack tStack : aBlock.getDrops(aWorld, aX, + * aY, aZ, aMeta, 0)) { if (tOutput == null) { aWorld.spawnEntityInWorld(new EntityItem(aWorld, aX + 0.5D, aY + + * 0.5D, aZ + 0.5D, tStack)); } else { aWorld.spawnEntityInWorld(new EntityItem(aWorld, aX + 0.5D, aY + 0.5D, aZ + * + 0.5D, tOutput)); tOutput = null; } } aWorld.setBlockToAir(aX, aY, aZ); + * GT_Utility.sendSoundToPlayers(aWorld, GregTech_API.sSoundList.get(Integer.valueOf(100)), 1.0F, -1.0F, aX, aY, + * aZ); } return true; } return true; } } catch (final Throwable e) { } if ((aBlock == Blocks.log) || (aBlock == + * Blocks.log2) || (aBlock == Blocks.hay_block)) { if ((aPlayer.capabilities.isCreativeMode) || + * (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts))) { aWorld.setBlockMetadataWithNotify(aX, aY, + * aZ, (aMeta + 4) % 12, 3); GT_Utility.sendSoundToPlayers(aWorld, + * GregTech_API.sSoundList.get(Integer.valueOf(100)), 1.0F, -1.0F, aX, aY, aZ); } return true; } if ((aBlock == + * Blocks.powered_repeater) || (aBlock == Blocks.unpowered_repeater)) { if + * ((aPlayer.capabilities.isCreativeMode) || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts))) { + * aWorld.setBlockMetadataWithNotify(aX, aY, aZ, ((aMeta / 4) * 4) + (((aMeta % 4) + 1) % 4), 3); + * GT_Utility.sendSoundToPlayers(aWorld, GregTech_API.sSoundList.get(Integer.valueOf(100)), 1.0F, -1.0F, aX, aY, + * aZ); } return true; } if ((aBlock == Blocks.powered_comparator) || (aBlock == Blocks.unpowered_comparator)) { + * if ((aPlayer.capabilities.isCreativeMode) || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts))) + * { aWorld.setBlockMetadataWithNotify(aX, aY, aZ, ((aMeta / 4) * 4) + (((aMeta % 4) + 1) % 4), 3); + * GT_Utility.sendSoundToPlayers(aWorld, GregTech_API.sSoundList.get(Integer.valueOf(100)), 1.0F, -1.0F, aX, aY, + * aZ); } return true; } if ((aBlock == Blocks.crafting_table) || (aBlock == Blocks.bookshelf)) { if + * ((aPlayer.capabilities.isCreativeMode) || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts))) { + * aWorld.spawnEntityInWorld(new EntityItem(aWorld, aX + 0.5D, aY + 0.5D, aZ + 0.5D, new ItemStack(aBlock, 1, + * aMeta))); aWorld.setBlockToAir(aX, aY, aZ); GT_Utility.sendSoundToPlayers(aWorld, + * GregTech_API.sSoundList.get(Integer.valueOf(100)), 1.0F, -1.0F, aX, aY, aZ); } return true; } if (aMeta == + * aTargetSide) { if ((aBlock == Blocks.pumpkin) || (aBlock == Blocks.lit_pumpkin) || (aBlock == Blocks.piston) + * || (aBlock == Blocks.sticky_piston) || (aBlock == Blocks.dispenser) || (aBlock == Blocks.dropper) || (aBlock + * == Blocks.furnace) || (aBlock == Blocks.lit_furnace) || (aBlock == Blocks.chest) || (aBlock == + * Blocks.trapped_chest) || (aBlock == Blocks.ender_chest) || (aBlock == Blocks.hopper)) { if + * ((aPlayer.capabilities.isCreativeMode) || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts))) { + * aWorld.spawnEntityInWorld(new EntityItem(aWorld, aX + 0.5D, aY + 0.5D, aZ + 0.5D, new ItemStack(aBlock, 1, + * 0))); aWorld.setBlockToAir(aX, aY, aZ); GT_Utility.sendSoundToPlayers(aWorld, + * GregTech_API.sSoundList.get(Integer.valueOf(100)), 1.0F, -1.0F, aX, aY, aZ); } return true; } } else { if + * ((aBlock == Blocks.piston) || (aBlock == Blocks.sticky_piston) || (aBlock == Blocks.dispenser) || (aBlock == + * Blocks.dropper)) { if ((aMeta < 6) && ((aPlayer.capabilities.isCreativeMode) || (((GT_MetaGenerated_Tool) + * aItem).doDamage(aStack, this.mCosts)))) { aWorld.setBlockMetadataWithNotify(aX, aY, aZ, aTargetSide, 3); + * GT_Utility.sendSoundToPlayers(aWorld, GregTech_API.sSoundList.get(Integer.valueOf(100)), 1.0F, -1.0F, aX, aY, + * aZ); } return true; } if ((aBlock == Blocks.pumpkin) || (aBlock == Blocks.lit_pumpkin) || (aBlock == + * Blocks.furnace) || (aBlock == Blocks.lit_furnace) || (aBlock == Blocks.chest) || (aBlock == + * Blocks.ender_chest) || (aBlock == Blocks.trapped_chest)) { if ((aTargetSide > 1) && + * ((aPlayer.capabilities.isCreativeMode) || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts)))) { + * aWorld.setBlockMetadataWithNotify(aX, aY, aZ, aTargetSide, 3); GT_Utility.sendSoundToPlayers(aWorld, + * GregTech_API.sSoundList.get(Integer.valueOf(100)), 1.0F, -1.0F, aX, aY, aZ); } return true; } if (aBlock == + * Blocks.hopper) { if ((aTargetSide != 1) && ((aPlayer.capabilities.isCreativeMode) || + * (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts)))) { aWorld.setBlockMetadataWithNotify(aX, aY, + * aZ, aTargetSide, 3); GT_Utility.sendSoundToPlayers(aWorld, GregTech_API.sSoundList.get(Integer.valueOf(100)), + * 1.0F, -1.0F, aX, aY, aZ); } return true; } } if ((Arrays.asList(aBlock.getValidRotations(aWorld, aX, aY, + * aZ)).contains(ForgeDirection.getOrientation(aTargetSide))) && ((aPlayer.capabilities.isCreativeMode) || + * (!GT_ModHandler.isElectricItem(aStack)) || (GT_ModHandler.canUseElectricItem(aStack, this.mCosts))) && + * (aBlock.rotateBlock(aWorld, aX, aY, aZ, ForgeDirection.getOrientation(aTargetSide)))) { if + * (!aPlayer.capabilities.isCreativeMode) { ((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts); } + * GT_Utility.sendSoundToPlayers(aWorld, GregTech_API.sSoundList.get(Integer.valueOf(100)), 1.0F, -1.0F, aX, aY, + * aZ); } + */ return false; } - public List<String> getAdditionalToolTips( - final GT_MetaBase_Item aItem, final List<String> aList, final ItemStack aStack) { + public List<String> getAdditionalToolTips(final GT_MetaBase_Item aItem, final List<String> aList, + final ItemStack aStack) { aList.add(this.mTooltip); return aList; } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/items/types/ToolType_Wrench.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/items/types/ToolType_Wrench.java index 6c12663bb6..acd48785f4 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/items/types/ToolType_Wrench.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/items/types/ToolType_Wrench.java @@ -1,14 +1,8 @@ package gtPlusPlus.xmod.gregtech.api.items.types; -import gregtech.api.GregTech_API; -import gregtech.api.items.GT_MetaBase_Item; -import gregtech.api.items.GT_MetaGenerated_Tool; -import gregtech.api.util.GT_LanguageManager; -import gregtech.api.util.GT_ModHandler; -import gregtech.api.util.GT_Utility; -import ic2.api.tile.IWrenchable; import java.util.Arrays; import java.util.List; + import net.minecraft.block.Block; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; @@ -18,27 +12,27 @@ import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; +import gregtech.api.GregTech_API; +import gregtech.api.items.GT_MetaBase_Item; +import gregtech.api.items.GT_MetaGenerated_Tool; +import gregtech.api.util.GT_LanguageManager; +import gregtech.api.util.GT_ModHandler; +import gregtech.api.util.GT_Utility; +import ic2.api.tile.IWrenchable; + public class ToolType_Wrench extends ToolType_Base { + private final int mCosts; - private final String mTooltip = - GT_LanguageManager.addStringLocalization("gt.behaviour.wrench", "Rotates Blocks on Rightclick"); + private final String mTooltip = GT_LanguageManager + .addStringLocalization("gt.behaviour.wrench", "Rotates Blocks on Rightclick"); public ToolType_Wrench(final int aCosts) { this.mCosts = aCosts; } - public boolean onItemUseFirst( - final GT_MetaBase_Item aItem, - final ItemStack aStack, - final EntityPlayer aPlayer, - final World aWorld, - final int aX, - final int aY, - final int aZ, - final int aSide, - final float hitX, - final float hitY, - final float hitZ) { + public boolean onItemUseFirst(final GT_MetaBase_Item aItem, final ItemStack aStack, final EntityPlayer aPlayer, + final World aWorld, final int aX, final int aY, final int aZ, final int aSide, final float hitX, + final float hitY, final float hitZ) { if (aWorld.isRemote) { return false; } @@ -56,7 +50,13 @@ public class ToolType_Wrench extends ToolType_Base { || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts))) { ((IWrenchable) aTileEntity).setFacing(aTargetSide); GT_Utility.sendSoundToPlayers( - aWorld, GregTech_API.sSoundList.get(Integer.valueOf(100)), 1.0F, -1.0F, aX, aY, aZ); + aWorld, + GregTech_API.sSoundList.get(Integer.valueOf(100)), + 1.0F, + -1.0F, + aX, + aY, + aZ); } return true; } @@ -77,20 +77,31 @@ public class ToolType_Wrench extends ToolType_Base { } aWorld.setBlockToAir(aX, aY, aZ); GT_Utility.sendSoundToPlayers( - aWorld, GregTech_API.sSoundList.get(Integer.valueOf(100)), 1.0F, -1.0F, aX, aY, aZ); + aWorld, + GregTech_API.sSoundList.get(Integer.valueOf(100)), + 1.0F, + -1.0F, + aX, + aY, + aZ); } return true; } return true; } - } catch (final Throwable e) { - } + } catch (final Throwable e) {} if ((aBlock == Blocks.log) || (aBlock == Blocks.log2) || (aBlock == Blocks.hay_block)) { if ((aPlayer.capabilities.isCreativeMode) || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts))) { aWorld.setBlockMetadataWithNotify(aX, aY, aZ, (aMeta + 4) % 12, 3); GT_Utility.sendSoundToPlayers( - aWorld, GregTech_API.sSoundList.get(Integer.valueOf(100)), 1.0F, -1.0F, aX, aY, aZ); + aWorld, + GregTech_API.sSoundList.get(Integer.valueOf(100)), + 1.0F, + -1.0F, + aX, + aY, + aZ); } return true; } @@ -99,7 +110,13 @@ public class ToolType_Wrench extends ToolType_Base { || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts))) { aWorld.setBlockMetadataWithNotify(aX, aY, aZ, ((aMeta / 4) * 4) + (((aMeta % 4) + 1) % 4), 3); GT_Utility.sendSoundToPlayers( - aWorld, GregTech_API.sSoundList.get(Integer.valueOf(100)), 1.0F, -1.0F, aX, aY, aZ); + aWorld, + GregTech_API.sSoundList.get(Integer.valueOf(100)), + 1.0F, + -1.0F, + aX, + aY, + aZ); } return true; } @@ -108,7 +125,13 @@ public class ToolType_Wrench extends ToolType_Base { || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts))) { aWorld.setBlockMetadataWithNotify(aX, aY, aZ, ((aMeta / 4) * 4) + (((aMeta % 4) + 1) % 4), 3); GT_Utility.sendSoundToPlayers( - aWorld, GregTech_API.sSoundList.get(Integer.valueOf(100)), 1.0F, -1.0F, aX, aY, aZ); + aWorld, + GregTech_API.sSoundList.get(Integer.valueOf(100)), + 1.0F, + -1.0F, + aX, + aY, + aZ); } return true; } @@ -119,13 +142,18 @@ public class ToolType_Wrench extends ToolType_Base { new EntityItem(aWorld, aX + 0.5D, aY + 0.5D, aZ + 0.5D, new ItemStack(aBlock, 1, aMeta))); aWorld.setBlockToAir(aX, aY, aZ); GT_Utility.sendSoundToPlayers( - aWorld, GregTech_API.sSoundList.get(Integer.valueOf(100)), 1.0F, -1.0F, aX, aY, aZ); + aWorld, + GregTech_API.sSoundList.get(Integer.valueOf(100)), + 1.0F, + -1.0F, + aX, + aY, + aZ); } return true; } if (aMeta == aTargetSide) { - if ((aBlock == Blocks.pumpkin) - || (aBlock == Blocks.lit_pumpkin) + if ((aBlock == Blocks.pumpkin) || (aBlock == Blocks.lit_pumpkin) || (aBlock == Blocks.piston) || (aBlock == Blocks.sticky_piston) || (aBlock == Blocks.dispenser) @@ -142,68 +170,92 @@ public class ToolType_Wrench extends ToolType_Base { new EntityItem(aWorld, aX + 0.5D, aY + 0.5D, aZ + 0.5D, new ItemStack(aBlock, 1, 0))); aWorld.setBlockToAir(aX, aY, aZ); GT_Utility.sendSoundToPlayers( - aWorld, GregTech_API.sSoundList.get(Integer.valueOf(100)), 1.0F, -1.0F, aX, aY, aZ); + aWorld, + GregTech_API.sSoundList.get(Integer.valueOf(100)), + 1.0F, + -1.0F, + aX, + aY, + aZ); } return true; } } else { - if ((aBlock == Blocks.piston) - || (aBlock == Blocks.sticky_piston) + if ((aBlock == Blocks.piston) || (aBlock == Blocks.sticky_piston) || (aBlock == Blocks.dispenser) || (aBlock == Blocks.dropper)) { - if ((aMeta < 6) - && ((aPlayer.capabilities.isCreativeMode) - || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts)))) { + if ((aMeta < 6) && ((aPlayer.capabilities.isCreativeMode) + || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts)))) { aWorld.setBlockMetadataWithNotify(aX, aY, aZ, aTargetSide, 3); GT_Utility.sendSoundToPlayers( - aWorld, GregTech_API.sSoundList.get(Integer.valueOf(100)), 1.0F, -1.0F, aX, aY, aZ); + aWorld, + GregTech_API.sSoundList.get(Integer.valueOf(100)), + 1.0F, + -1.0F, + aX, + aY, + aZ); } return true; } - if ((aBlock == Blocks.pumpkin) - || (aBlock == Blocks.lit_pumpkin) + if ((aBlock == Blocks.pumpkin) || (aBlock == Blocks.lit_pumpkin) || (aBlock == Blocks.furnace) || (aBlock == Blocks.lit_furnace) || (aBlock == Blocks.chest) || (aBlock == Blocks.ender_chest) || (aBlock == Blocks.trapped_chest)) { - if ((aTargetSide > 1) - && ((aPlayer.capabilities.isCreativeMode) - || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts)))) { + if ((aTargetSide > 1) && ((aPlayer.capabilities.isCreativeMode) + || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts)))) { aWorld.setBlockMetadataWithNotify(aX, aY, aZ, aTargetSide, 3); GT_Utility.sendSoundToPlayers( - aWorld, GregTech_API.sSoundList.get(Integer.valueOf(100)), 1.0F, -1.0F, aX, aY, aZ); + aWorld, + GregTech_API.sSoundList.get(Integer.valueOf(100)), + 1.0F, + -1.0F, + aX, + aY, + aZ); } return true; } if (aBlock == Blocks.hopper) { - if ((aTargetSide != 1) - && ((aPlayer.capabilities.isCreativeMode) - || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts)))) { + if ((aTargetSide != 1) && ((aPlayer.capabilities.isCreativeMode) + || (((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts)))) { aWorld.setBlockMetadataWithNotify(aX, aY, aZ, aTargetSide, 3); GT_Utility.sendSoundToPlayers( - aWorld, GregTech_API.sSoundList.get(Integer.valueOf(100)), 1.0F, -1.0F, aX, aY, aZ); + aWorld, + GregTech_API.sSoundList.get(Integer.valueOf(100)), + 1.0F, + -1.0F, + aX, + aY, + aZ); } return true; } } if ((Arrays.asList(aBlock.getValidRotations(aWorld, aX, aY, aZ)) - .contains(ForgeDirection.getOrientation(aTargetSide))) - && ((aPlayer.capabilities.isCreativeMode) - || (!GT_ModHandler.isElectricItem(aStack)) + .contains(ForgeDirection.getOrientation(aTargetSide))) + && ((aPlayer.capabilities.isCreativeMode) || (!GT_ModHandler.isElectricItem(aStack)) || (GT_ModHandler.canUseElectricItem(aStack, this.mCosts))) && (aBlock.rotateBlock(aWorld, aX, aY, aZ, ForgeDirection.getOrientation(aTargetSide)))) { if (!aPlayer.capabilities.isCreativeMode) { ((GT_MetaGenerated_Tool) aItem).doDamage(aStack, this.mCosts); } GT_Utility.sendSoundToPlayers( - aWorld, GregTech_API.sSoundList.get(Integer.valueOf(100)), 1.0F, -1.0F, aX, aY, aZ); + aWorld, + GregTech_API.sSoundList.get(Integer.valueOf(100)), + 1.0F, + -1.0F, + aX, + aY, + aZ); } return false; } - public List<String> getAdditionalToolTips( - final GT_MetaBase_Item aItem, final List<String> aList, final ItemStack aStack) { + public List<String> getAdditionalToolTips(final GT_MetaBase_Item aItem, final List<String> aList, + final ItemStack aStack) { aList.add(this.mTooltip); return aList; } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/BaseCustomTileEntity.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/BaseCustomTileEntity.java index a88105f7f6..aae4494f88 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/BaseCustomTileEntity.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/BaseCustomTileEntity.java @@ -1,5 +1,13 @@ package gtPlusPlus.xmod.gregtech.api.metatileentity; +import java.lang.reflect.Field; +import java.util.ArrayList; +import java.util.Random; + +import net.minecraft.entity.item.EntityItem; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; + import gregtech.GT_Mod; import gregtech.api.GregTech_API; import gregtech.api.enums.GT_Values; @@ -12,12 +20,6 @@ import gtPlusPlus.core.util.minecraft.gregtech.PollutionUtils; import gtPlusPlus.xmod.gregtech.api.interfaces.IBaseCustomMetaTileEntity; import gtPlusPlus.xmod.gregtech.common.StaticFields59; import ic2.api.Direction; -import java.lang.reflect.Field; -import java.util.ArrayList; -import java.util.Random; -import net.minecraft.entity.item.EntityItem; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; public class BaseCustomTileEntity extends BaseMetaTileEntity implements IBaseCustomMetaTileEntity { @@ -76,16 +78,13 @@ public class BaseCustomTileEntity extends BaseMetaTileEntity implements IBaseCus } if (this.getUniversalEnergyCapacity() > 0L && this.getUniversalEnergyStored() >= this.getUniversalEnergyCapacity() / 5L) { - this.doExplosion(this.getOutput() - * (long) - (this.getUniversalEnergyStored() >= this.getUniversalEnergyCapacity() - ? 4 - : (this.getUniversalEnergyStored() >= this.getUniversalEnergyCapacity() / 2L - ? 2 - : 1))); + this.doExplosion( + this.getOutput() * (long) (this.getUniversalEnergyStored() >= this.getUniversalEnergyCapacity() ? 4 + : (this.getUniversalEnergyStored() >= this.getUniversalEnergyCapacity() / 2L ? 2 : 1))); GT_Mod arg9999 = GT_Mod.instance; GT_Mod.achievements.issueAchievement( - this.getWorldObj().getPlayerEntityByName(this.getOwnerName()), "electricproblems"); + this.getWorldObj().getPlayerEntityByName(this.getOwnerName()), + "electricproblems"); } } @@ -147,8 +146,7 @@ public class BaseCustomTileEntity extends BaseMetaTileEntity implements IBaseCus (double) ((float) this.zCoord + tRandom.nextFloat() * 0.8F + 0.1F), new ItemStack(tItem.getItem(), tItem.stackSize, tItem.getItemDamage())); if (tItem.hasTagCompound()) { - tItemEntity.getEntityItem().setTagCompound((NBTTagCompound) - tItem.getTagCompound().copy()); + tItemEntity.getEntityItem().setTagCompound((NBTTagCompound) tItem.getTagCompound().copy()); } tItemEntity.motionX = tRandom.nextGaussian() * 0.0500000007450581D; diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/BaseCustomPower_MTE.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/BaseCustomPower_MTE.java index b3d8b8aa8c..ba67ba6466 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/BaseCustomPower_MTE.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/BaseCustomPower_MTE.java @@ -1,10 +1,11 @@ package gtPlusPlus.xmod.gregtech.api.metatileentity.custom.power; +import net.minecraft.tileentity.TileEntity; +import net.minecraftforge.common.util.ForgeDirection; + import gtPlusPlus.api.objects.Logger; import gtPlusPlus.xmod.gregtech.api.metatileentity.BaseCustomTileEntity; import ic2.api.Direction; -import net.minecraft.tileentity.TileEntity; -import net.minecraftforge.common.util.ForgeDirection; public class BaseCustomPower_MTE extends BaseCustomTileEntity { @@ -21,8 +22,7 @@ public class BaseCustomPower_MTE extends BaseCustomTileEntity { if (mMetaTileEntity == null) { Logger.INFO("Bad Tile"); } - if (this.canAccessData() - && this.mMetaTileEntity.isElectric() + if (this.canAccessData() && this.mMetaTileEntity.isElectric() && this.inputEnergyFrom(aSide) && aAmperage > 0L && aVoltage > 0L @@ -37,8 +37,9 @@ public class BaseCustomPower_MTE extends BaseCustomTileEntity { Logger.INFO("aAmperage: " + aAmperage); Logger.INFO("aVoltage: " + aVoltage); Logger.INFO("this.getStoredEU() < this.getEUCapacity(): " + (this.getStoredEU() < this.getEUCapacity())); - Logger.INFO("this.mMetaTileEntity.maxAmperesIn() >= this.mAcceptedAmperes: " - + (this.mMetaTileEntity.maxAmperesIn() >= this.getInputAmperage())); + Logger.INFO( + "this.mMetaTileEntity.maxAmperesIn() >= this.mAcceptedAmperes: " + + (this.mMetaTileEntity.maxAmperesIn() >= this.getInputAmperage())); Logger.INFO("this.mMetaTileEntity.maxAmperesIn(): " + (this.mMetaTileEntity.maxAmperesIn())); Logger.INFO("this.mAcceptedAmperes: " + (this.getInputAmperage())); return 0L; @@ -47,13 +48,12 @@ public class BaseCustomPower_MTE extends BaseCustomTileEntity { public boolean drainEnergyUnits(byte aSide, long aVoltage, long aAmperage) { Logger.INFO("Draining Energy Units 4"); - if (this.canAccessData() - && this.mMetaTileEntity.isElectric() + if (this.canAccessData() && this.mMetaTileEntity.isElectric() && this.outputsEnergyTo(aSide) && this.getStoredEU() - aVoltage * aAmperage >= this.mMetaTileEntity.getMinimumStoredEU()) { if (this.decreaseStoredEU(aVoltage * aAmperage, false)) { - this.mAverageEUOutput[this.mAverageEUOutputIndex] = - (int) ((long) this.mAverageEUOutput[this.mAverageEUOutputIndex] + aVoltage * aAmperage); + this.mAverageEUOutput[this.mAverageEUOutputIndex] = (int) ((long) this.mAverageEUOutput[this.mAverageEUOutputIndex] + + aVoltage * aAmperage); return true; } else { return false; diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/GTPP_MTE_BasicLosslessGenerator.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/GTPP_MTE_BasicLosslessGenerator.java index 841359c0b2..0060cba12c 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/GTPP_MTE_BasicLosslessGenerator.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/GTPP_MTE_BasicLosslessGenerator.java @@ -1,5 +1,13 @@ package gtPlusPlus.xmod.gregtech.api.metatileentity.custom.power; +import java.util.Collection; +import java.util.Iterator; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidStack; + import gregtech.api.enums.GT_Values; import gregtech.api.enums.Textures.BlockIcons; import gregtech.api.gui.modularui.GT_UIInfos; @@ -10,21 +18,16 @@ import gregtech.api.util.GT_Recipe.GT_Recipe_Map; import gregtech.api.util.GT_Utility; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.util.minecraft.gregtech.PollutionUtils; -import java.util.Collection; -import java.util.Iterator; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; -import net.minecraftforge.fluids.FluidStack; public abstract class GTPP_MTE_BasicLosslessGenerator extends GTPP_MTE_BasicTank { - public GTPP_MTE_BasicLosslessGenerator( - int aID, String aName, String aNameRegional, int aTier, String aDescription, ITexture... aTextures) { + + public GTPP_MTE_BasicLosslessGenerator(int aID, String aName, String aNameRegional, int aTier, String aDescription, + ITexture... aTextures) { super(aID, aName, aNameRegional, aTier, 3, aDescription, aTextures); } - public GTPP_MTE_BasicLosslessGenerator( - int aID, String aName, String aNameRegional, int aTier, String[] aDescription, ITexture... aTextures) { + public GTPP_MTE_BasicLosslessGenerator(int aID, String aName, String aNameRegional, int aTier, + String[] aDescription, ITexture... aTextures) { super(aID, aName, aNameRegional, aTier, 3, aDescription, aTextures); } @@ -55,21 +58,11 @@ public abstract class GTPP_MTE_BasicLosslessGenerator extends GTPP_MTE_BasicTank return rTextures; } - public ITexture[] getTexture( - IGregTechTileEntity aBaseMetaTileEntity, - byte aSide, - byte aFacing, - byte aColorIndex, - boolean aActive, - boolean aRedstone) { - return this.mTextures[ - (aActive ? 5 : 0) - + (aSide == aFacing - ? 0 - : (aSide == GT_Utility.getOppositeSide(aFacing) - ? 1 - : (aSide == 0 ? 2 : (aSide == 1 ? 3 : 4))))][ - aColorIndex + 1]; + public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, + boolean aActive, boolean aRedstone) { + return this.mTextures[(aActive ? 5 : 0) + (aSide == aFacing ? 0 + : (aSide == GT_Utility.getOppositeSide(aFacing) ? 1 + : (aSide == 0 ? 2 : (aSide == 1 ? 3 : 4))))][aColorIndex + 1]; } public String[] getDescription() { @@ -86,23 +79,23 @@ public abstract class GTPP_MTE_BasicLosslessGenerator extends GTPP_MTE_BasicTank } public ITexture[] getFront(byte aColor) { - return new ITexture[] {BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1]}; + return new ITexture[] { BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1] }; } public ITexture[] getBack(byte aColor) { - return new ITexture[] {BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1]}; + return new ITexture[] { BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1] }; } public ITexture[] getBottom(byte aColor) { - return new ITexture[] {BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1]}; + return new ITexture[] { BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1] }; } public ITexture[] getTop(byte aColor) { - return new ITexture[] {BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1]}; + return new ITexture[] { BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1] }; } public ITexture[] getSides(byte aColor) { - return new ITexture[] {BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1]}; + return new ITexture[] { BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1] }; } public ITexture[] getFrontActive(byte aColor) { @@ -198,8 +191,10 @@ public abstract class GTPP_MTE_BasicLosslessGenerator extends GTPP_MTE_BasicTank this.mInventory[this.getStackDisplaySlot()] = new ItemStack(Blocks.fire, 1); } - this.mInventory[this.getStackDisplaySlot()].setStackDisplayName("Generating: " - + (aBaseMetaTileEntity.getUniversalEnergyStored() - this.getMinimumStoredEU()) + " EU"); + this.mInventory[this.getStackDisplaySlot()].setStackDisplayName( + "Generating: " + + (aBaseMetaTileEntity.getUniversalEnergyStored() - this.getMinimumStoredEU()) + + " EU"); } } else { tFuelValue = this.getFuelValue(this.mFluid); @@ -208,9 +203,8 @@ public abstract class GTPP_MTE_BasicLosslessGenerator extends GTPP_MTE_BasicTank long tFluidAmountToUse = Math.min( (long) (this.mFluid.amount / tConsumed), (this.maxEUStore() - aBaseMetaTileEntity.getUniversalEnergyStored()) / (long) tFuelValue); - if (tFluidAmountToUse > 0L - && aBaseMetaTileEntity.increaseStoredEnergyUnits( - tFluidAmountToUse * (long) tFuelValue, true)) { + if (tFluidAmountToUse > 0L && aBaseMetaTileEntity + .increaseStoredEnergyUnits(tFluidAmountToUse * (long) tFuelValue, true)) { PollutionUtils.addPollution(this.getBaseMetaTileEntity(), 10 * this.getPollution()); this.mFluid.amount = (int) ((long) this.mFluid.amount - tFluidAmountToUse * (long) tConsumed); } @@ -235,8 +229,8 @@ public abstract class GTPP_MTE_BasicLosslessGenerator extends GTPP_MTE_BasicTank if (aBaseMetaTileEntity.isServerSide()) { Logger.WARNING("Ticking Servside"); - aBaseMetaTileEntity.setActive(aBaseMetaTileEntity.isAllowedToWork() - && aBaseMetaTileEntity.getUniversalEnergyStored() + aBaseMetaTileEntity.setActive( + aBaseMetaTileEntity.isAllowedToWork() && aBaseMetaTileEntity.getUniversalEnergyStored() >= this.maxEUOutput() + this.getMinimumStoredEU()); } } @@ -264,15 +258,13 @@ public abstract class GTPP_MTE_BasicLosslessGenerator extends GTPP_MTE_BasicTank if ((tLiquid = GT_Utility.getFluidForFilledItem(tFuel.getRepresentativeInput(0), true)) != null && aLiquid.isFluidEqual(tLiquid)) { Logger.WARNING("Fuel Ok"); - return (int) ((long) tFuel.mSpecialValue - * (long) this.getEfficiency() + return (int) ((long) tFuel.mSpecialValue * (long) this.getEfficiency() * (long) this.consumedFluidPerOperation(tLiquid) / 100L); } if ((tLiquid = tFuel.getRepresentativeFluidInput(0)) != null && aLiquid.isFluidEqual(tLiquid)) { Logger.WARNING("Fuel Ok"); - return (int) ((long) tFuel.mSpecialValue - * (long) this.getEfficiency() + return (int) ((long) tFuel.mSpecialValue * (long) this.getEfficiency() * (long) this.consumedFluidPerOperation(tLiquid) / 100L); } @@ -288,11 +280,12 @@ public abstract class GTPP_MTE_BasicLosslessGenerator extends GTPP_MTE_BasicTank public int getFuelValue(ItemStack aStack) { if (!GT_Utility.isStackInvalid(aStack) && this.getRecipes() != null) { Logger.WARNING("Fuel Item OK"); - GT_Recipe tFuel = this.getRecipes() - .findRecipe( - this.getBaseMetaTileEntity(), false, Long.MAX_VALUE, (FluidStack[]) null, new ItemStack[] { - aStack - }); + GT_Recipe tFuel = this.getRecipes().findRecipe( + this.getBaseMetaTileEntity(), + false, + Long.MAX_VALUE, + (FluidStack[]) null, + new ItemStack[] { aStack }); return tFuel != null ? (int) ((long) tFuel.mSpecialValue * 1000L * (long) this.getEfficiency() / 100L) : 0; } else { return 0; @@ -301,13 +294,13 @@ public abstract class GTPP_MTE_BasicLosslessGenerator extends GTPP_MTE_BasicTank public ItemStack getEmptyContainer(ItemStack aStack) { if (!GT_Utility.isStackInvalid(aStack) && this.getRecipes() != null) { - GT_Recipe tFuel = this.getRecipes() - .findRecipe( - this.getBaseMetaTileEntity(), false, Long.MAX_VALUE, (FluidStack[]) null, new ItemStack[] { - aStack - }); - return tFuel != null - ? GT_Utility.copy(new Object[] {tFuel.getOutput(0)}) + GT_Recipe tFuel = this.getRecipes().findRecipe( + this.getBaseMetaTileEntity(), + false, + Long.MAX_VALUE, + (FluidStack[]) null, + new ItemStack[] { aStack }); + return tFuel != null ? GT_Utility.copy(new Object[] { tFuel.getOutput(0) }) : GT_Utility.getContainerItem(aStack, true); } else { return null; @@ -315,9 +308,8 @@ public abstract class GTPP_MTE_BasicLosslessGenerator extends GTPP_MTE_BasicTank } public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { - return super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack) - && (this.getFuelValue(aStack) > 0 - || this.getFuelValue(GT_Utility.getFluidForFilledItem(aStack, true)) > 0); + return super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack) && (this.getFuelValue(aStack) > 0 + || this.getFuelValue(GT_Utility.getFluidForFilledItem(aStack, true)) > 0); } public int getCapacity() { diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/GTPP_MTE_BasicMachine.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/GTPP_MTE_BasicMachine.java index cb3f42b6f6..2721dc437e 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/GTPP_MTE_BasicMachine.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/GTPP_MTE_BasicMachine.java @@ -2,6 +2,17 @@ package gtPlusPlus.xmod.gregtech.api.metatileentity.custom.power; import static gregtech.api.enums.GT_Values.V; +import java.util.Arrays; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraftforge.common.DimensionManager; +import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.fluids.IFluidHandler; + import gregtech.api.GregTech_API; import gregtech.api.enums.ItemList; import gregtech.api.enums.Textures; @@ -16,79 +27,48 @@ import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Recipe.GT_Recipe_Map; import gregtech.api.util.GT_Utility; import gtPlusPlus.api.objects.random.XSTR; -import java.util.Arrays; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.tileentity.TileEntity; -import net.minecraftforge.common.DimensionManager; -import net.minecraftforge.common.util.ForgeDirection; -import net.minecraftforge.fluids.FluidStack; -import net.minecraftforge.fluids.IFluidHandler; /** * NEVER INCLUDE THIS FILE IN YOUR MOD!!! * <p/> - * This is the main construct for my Basic Machines such as the Automatic Extractor - * Extend this class to make a simple Machine + * This is the main construct for my Basic Machines such as the Automatic Extractor Extend this class to make a simple + * Machine */ public abstract class GTPP_MTE_BasicMachine extends GTPP_MTE_BasicTank { + /** * return values for checkRecipe() */ - protected static final int DID_NOT_FIND_RECIPE = 0, - FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS = 1, + protected static final int DID_NOT_FIND_RECIPE = 0, FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS = 1, FOUND_AND_SUCCESSFULLY_USED_RECIPE = 2; public static final int OTHER_SLOT_COUNT = 4; public final ItemStack[] mOutputItems; public final int mInputSlotCount, mAmperage; - public boolean mAllowInputFromOutputSide = false, - mFluidTransfer = false, - mItemTransfer = false, - mHasBeenUpdated = false, - mStuttering = false, - mCharge = false, - mDecharge = false; + public boolean mAllowInputFromOutputSide = false, mFluidTransfer = false, mItemTransfer = false, + mHasBeenUpdated = false, mStuttering = false, mCharge = false, mDecharge = false; public int mMainFacing = -1, mProgresstime = 0, mMaxProgresstime = 0, mEUt = 0, mOutputBlocked = 0; public FluidStack mOutputFluid; public String mGUIName = "", mNEIName = ""; public GT_MetaTileEntity_MultiBlockBase mCleanroom; /** - * Contains the Recipe which has been previously used, or null if there was no previous Recipe, which could have been buffered + * Contains the Recipe which has been previously used, or null if there was no previous Recipe, which could have + * been buffered */ protected GT_Recipe mLastRecipe = null; private FluidStack mFluidOut; /** - * @param aOverlays 0 = SideFacingActive - * 1 = SideFacingInactive - * 2 = FrontFacingActive - * 3 = FrontFacingInactive - * 4 = TopFacingActive - * 5 = TopFacingInactive - * 6 = BottomFacingActive - * 7 = BottomFacingInactive - * ----- Not all Array Elements have to be initialised, you can also just use 8 Parameters for the Default Pipe Texture Overlays ----- - * 8 = BottomFacingPipeActive - * 9 = BottomFacingPipeInactive - * 10 = TopFacingPipeActive - * 11 = TopFacingPipeInactive - * 12 = SideFacingPipeActive - * 13 = SideFacingPipeInactive + * @param aOverlays 0 = SideFacingActive 1 = SideFacingInactive 2 = FrontFacingActive 3 = FrontFacingInactive 4 = + * TopFacingActive 5 = TopFacingInactive 6 = BottomFacingActive 7 = BottomFacingInactive ----- Not + * all Array Elements have to be initialised, you can also just use 8 Parameters for the Default + * Pipe Texture Overlays ----- 8 = BottomFacingPipeActive 9 = BottomFacingPipeInactive 10 = + * TopFacingPipeActive 11 = TopFacingPipeInactive 12 = SideFacingPipeActive 13 = + * SideFacingPipeInactive */ - public GTPP_MTE_BasicMachine( - int aID, - String aName, - String aNameRegional, - int aTier, - int aAmperage, - String aDescription, - int aInputSlotCount, - int aOutputSlotCount, - String aGUIName, - String aNEIName, + public GTPP_MTE_BasicMachine(int aID, String aName, String aNameRegional, int aTier, int aAmperage, + String aDescription, int aInputSlotCount, int aOutputSlotCount, String aGUIName, String aNEIName, ITexture... aOverlays) { super( aID, @@ -105,17 +85,8 @@ public abstract class GTPP_MTE_BasicMachine extends GTPP_MTE_BasicTank { mNEIName = aNEIName; } - public GTPP_MTE_BasicMachine( - int aID, - String aName, - String aNameRegional, - int aTier, - int aAmperage, - String[] aDescription, - int aInputSlotCount, - int aOutputSlotCount, - String aGUIName, - String aNEIName, + public GTPP_MTE_BasicMachine(int aID, String aName, String aNameRegional, int aTier, int aAmperage, + String[] aDescription, int aInputSlotCount, int aOutputSlotCount, String aGUIName, String aNEIName, ITexture... aOverlays) { super( aID, @@ -132,16 +103,8 @@ public abstract class GTPP_MTE_BasicMachine extends GTPP_MTE_BasicTank { mNEIName = aNEIName; } - public GTPP_MTE_BasicMachine( - String aName, - int aTier, - int aAmperage, - String aDescription, - ITexture[][][] aTextures, - int aInputSlotCount, - int aOutputSlotCount, - String aGUIName, - String aNEIName) { + public GTPP_MTE_BasicMachine(String aName, int aTier, int aAmperage, String aDescription, ITexture[][][] aTextures, + int aInputSlotCount, int aOutputSlotCount, String aGUIName, String aNEIName) { super(aName, aTier, OTHER_SLOT_COUNT + aInputSlotCount + aOutputSlotCount + 1, aDescription, aTextures); mInputSlotCount = Math.max(0, aInputSlotCount); mOutputItems = new ItemStack[Math.max(0, aOutputSlotCount)]; @@ -150,16 +113,8 @@ public abstract class GTPP_MTE_BasicMachine extends GTPP_MTE_BasicTank { mNEIName = aNEIName; } - public GTPP_MTE_BasicMachine( - String aName, - int aTier, - int aAmperage, - String[] aDescription, - ITexture[][][] aTextures, - int aInputSlotCount, - int aOutputSlotCount, - String aGUIName, - String aNEIName) { + public GTPP_MTE_BasicMachine(String aName, int aTier, int aAmperage, String[] aDescription, + ITexture[][][] aTextures, int aInputSlotCount, int aOutputSlotCount, String aGUIName, String aNEIName) { super(aName, aTier, OTHER_SLOT_COUNT + aInputSlotCount + aOutputSlotCount + 1, aDescription, aTextures); mInputSlotCount = Math.max(0, aInputSlotCount); mOutputItems = new ItemStack[Math.max(0, aOutputSlotCount)]; @@ -188,13 +143,10 @@ public abstract class GTPP_MTE_BasicMachine extends GTPP_MTE_BasicTank { ITexture[][][] rTextures = new ITexture[14][17][]; aTextures = Arrays.copyOf(aTextures, 14); - for (int i = 0; i < aTextures.length; i++) - if (aTextures[i] != null) - for (byte c = -1; c < 16; c++) { - if (rTextures[i][c + 1] == null) - rTextures[i][c + 1] = - new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[mTier][c + 1], aTextures[i]}; - } + for (int i = 0; i < aTextures.length; i++) if (aTextures[i] != null) for (byte c = -1; c < 16; c++) { + if (rTextures[i][c + 1] == null) rTextures[i][c + 1] = new ITexture[] { + Textures.BlockIcons.MACHINE_CASINGS[mTier][c + 1], aTextures[i] }; + } for (byte c = -1; c < 16; c++) { if (rTextures[0][c + 1] == null) rTextures[0][c + 1] = getSideFacingActive(c); @@ -216,28 +168,16 @@ public abstract class GTPP_MTE_BasicMachine extends GTPP_MTE_BasicTank { } @Override - public ITexture[] getTexture( - IGregTechTileEntity aBaseMetaTileEntity, - byte aSide, - byte aFacing, - byte aColorIndex, - boolean aActive, - boolean aRedstone) { - return mTextures[ - mMainFacing < 2 - ? aSide == aFacing - ? aActive ? 2 : 3 - : aSide == 0 ? aActive ? 6 : 7 : aSide == 1 ? aActive ? 4 : 5 : aActive ? 0 : 1 - : aSide == mMainFacing - ? aActive ? 2 : 3 - : (showPipeFacing() && aSide == aFacing) - ? aSide == 0 - ? aActive ? 8 : 9 - : aSide == 1 ? aActive ? 10 : 11 : aActive ? 12 : 13 - : aSide == 0 - ? aActive ? 6 : 7 - : aSide == 1 ? aActive ? 4 : 5 : aActive ? 0 : 1][ - aColorIndex + 1]; + public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, + boolean aActive, boolean aRedstone) { + return mTextures[mMainFacing < 2 + ? aSide == aFacing ? aActive ? 2 : 3 + : aSide == 0 ? aActive ? 6 : 7 : aSide == 1 ? aActive ? 4 : 5 : aActive ? 0 : 1 + : aSide == mMainFacing ? aActive ? 2 : 3 + : (showPipeFacing() && aSide == aFacing) + ? aSide == 0 ? aActive ? 8 : 9 : aSide == 1 ? aActive ? 10 : 11 : aActive ? 12 : 13 + : aSide == 0 ? aActive ? 6 : 7 + : aSide == 1 ? aActive ? 4 : 5 : aActive ? 0 : 1][aColorIndex + 1]; } @Override @@ -262,8 +202,7 @@ public abstract class GTPP_MTE_BasicMachine extends GTPP_MTE_BasicTank { @Override public boolean isValidSlot(int aIndex) { - return aIndex > 0 - && super.isValidSlot(aIndex) + return aIndex > 0 && super.isValidSlot(aIndex) && aIndex != OTHER_SLOT_COUNT + mInputSlotCount + mOutputItems.length; } @@ -294,9 +233,7 @@ public abstract class GTPP_MTE_BasicMachine extends GTPP_MTE_BasicTank { @Override public boolean isLiquidInput(byte aSide) { - return aSide != mMainFacing - && (mAllowInputFromOutputSide - || aSide != getBaseMetaTileEntity().getFrontFacing()); + return aSide != mMainFacing && (mAllowInputFromOutputSide || aSide != getBaseMetaTileEntity().getFrontFacing()); } @Override @@ -387,8 +324,7 @@ public abstract class GTPP_MTE_BasicMachine extends GTPP_MTE_BasicTank { @Override public boolean isFluidInputAllowed(FluidStack aFluid) { - return getFillableStack() != null - || (getRecipeList() != null && getRecipeList().containsInput(aFluid)); + return getFillableStack() != null || (getRecipeList() != null && getRecipeList().containsInput(aFluid)); } @Override @@ -467,9 +403,8 @@ public abstract class GTPP_MTE_BasicMachine extends GTPP_MTE_BasicTank { if (mOutputFluid != null) aNBT.setTag("mOutputFluid", mOutputFluid.writeToNBT(new NBTTagCompound())); if (mFluidOut != null) aNBT.setTag("mFluidOut", mFluidOut.writeToNBT(new NBTTagCompound())); - for (int i = 0; i < mOutputItems.length; i++) - if (mOutputItems[i] != null) - aNBT.setTag("mOutputItem" + i, mOutputItems[i].writeToNBT(new NBTTagCompound())); + for (int i = 0; i < mOutputItems.length; i++) if (mOutputItems[i] != null) + aNBT.setTag("mOutputItem" + i, mOutputItems[i].writeToNBT(new NBTTagCompound())); } @Override @@ -506,9 +441,9 @@ public abstract class GTPP_MTE_BasicMachine extends GTPP_MTE_BasicTank { if (mProgresstime < 0 || drainEnergyForProcess(mEUt)) { if (++mProgresstime >= mMaxProgresstime) { for (int i = 0; i < mOutputItems.length; i++) - for (int j = 0; j < mOutputItems.length; j++) - if (aBaseMetaTileEntity.addStackToSlot( - getOutputSlot() + ((j + i) % mOutputItems.length), mOutputItems[i])) break; + for (int j = 0; j < mOutputItems.length; j++) if (aBaseMetaTileEntity + .addStackToSlot(getOutputSlot() + ((j + i) % mOutputItems.length), mOutputItems[i])) + break; if (mOutputFluid != null) if (getDrainableStack() == null) setDrainableStack(mOutputFluid.copy()); else if (mOutputFluid.isFluidEqual(getDrainableStack())) @@ -542,8 +477,7 @@ public abstract class GTPP_MTE_BasicMachine extends GTPP_MTE_BasicTank { boolean tRemovedOutputFluid = false; - if (doesAutoOutputFluids() - && getDrainableStack() != null + if (doesAutoOutputFluids() && getDrainableStack() != null && aBaseMetaTileEntity.getFrontFacing() != mMainFacing && (tSucceeded || aTick % 20 == 0)) { IFluidHandler tTank = aBaseMetaTileEntity.getITankContainerAtSide(aBaseMetaTileEntity.getFrontFacing()); @@ -551,28 +485,26 @@ public abstract class GTPP_MTE_BasicMachine extends GTPP_MTE_BasicTank { FluidStack tDrained = drain(1000, false); if (tDrained != null) { int tFilledAmount = tTank.fill( - ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()), tDrained, false); - if (tFilledAmount > 0) - tTank.fill( - ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()), - drain(tFilledAmount, true), - true); + ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()), + tDrained, + false); + if (tFilledAmount > 0) tTank.fill( + ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()), + drain(tFilledAmount, true), + true); } } if (getDrainableStack() == null) tRemovedOutputFluid = true; } - if (doesAutoOutput() - && !isOutputEmpty() + if (doesAutoOutput() && !isOutputEmpty() && aBaseMetaTileEntity.getFrontFacing() != mMainFacing - && (tSucceeded - || mOutputBlocked % 300 == 1 + && (tSucceeded || mOutputBlocked % 300 == 1 || aBaseMetaTileEntity.hasInventoryBeenModified() || aTick % 600 == 0)) { TileEntity tTileEntity2 = aBaseMetaTileEntity.getTileEntityAtSide(aBaseMetaTileEntity.getFrontFacing()); - for (int i = 0, tCosts = 1; - i < mOutputItems.length && tCosts > 0 && aBaseMetaTileEntity.isUniversalEnergyStored(128); - i++) { + for (int i = 0, tCosts = 1; i < mOutputItems.length && tCosts > 0 + && aBaseMetaTileEntity.isUniversalEnergyStored(128); i++) { tCosts = GT_Utility.moveOneItemStack( aBaseMetaTileEntity, tTileEntity2, @@ -588,15 +520,12 @@ public abstract class GTPP_MTE_BasicMachine extends GTPP_MTE_BasicTank { } } - if (mOutputBlocked != 0) - if (isOutputEmpty()) mOutputBlocked = 0; - else mOutputBlocked++; + if (mOutputBlocked != 0) if (isOutputEmpty()) mOutputBlocked = 0; + else mOutputBlocked++; if (allowToCheckRecipe()) { - if (mMaxProgresstime <= 0 - && aBaseMetaTileEntity.isAllowedToWork() - && (tRemovedOutputFluid - || tSucceeded + if (mMaxProgresstime <= 0 && aBaseMetaTileEntity.isAllowedToWork() + && (tRemovedOutputFluid || tSucceeded || aBaseMetaTileEntity.hasInventoryBeenModified() || aTick % 600 == 0 || aBaseMetaTileEntity.hasWorkJustBeenEnabled()) @@ -647,8 +576,8 @@ public abstract class GTPP_MTE_BasicMachine extends GTPP_MTE_BasicTank { if (ItemList.Display_Fluid.isStackEqual(mInventory[tDisplayStackSlot], true, true)) mInventory[tDisplayStackSlot] = null; } else { - mInventory[tDisplayStackSlot] = - GT_Utility.getFluidDisplayStack(getFillableStack(), displaysStackSize()); + mInventory[tDisplayStackSlot] = GT_Utility + .getFluidDisplayStack(getFillableStack(), displaysStackSize()); } } } @@ -694,32 +623,27 @@ public abstract class GTPP_MTE_BasicMachine extends GTPP_MTE_BasicTank { } protected boolean canOutput(GT_Recipe aRecipe) { - return aRecipe != null - && (aRecipe.mNeedsEmptyOutput - ? isOutputEmpty() && getDrainableStack() == null - : canOutput(aRecipe.getFluidOutput(0)) && canOutput(aRecipe.mOutputs)); + return aRecipe != null && (aRecipe.mNeedsEmptyOutput ? isOutputEmpty() && getDrainableStack() == null + : canOutput(aRecipe.getFluidOutput(0)) && canOutput(aRecipe.mOutputs)); } protected boolean canOutput(ItemStack... aOutputs) { if (aOutputs == null) return true; ItemStack[] tOutputSlots = getAllOutputs(); for (int i = 0; i < tOutputSlots.length && i < aOutputs.length; i++) - if (tOutputSlots[i] != null - && aOutputs[i] != null + if (tOutputSlots[i] != null && aOutputs[i] != null && (!GT_Utility.areStacksEqual(tOutputSlots[i], aOutputs[i], false) || tOutputSlots[i].stackSize + aOutputs[i].stackSize > tOutputSlots[i].getMaxStackSize())) { - mOutputBlocked++; - return false; - } + mOutputBlocked++; + return false; + } return true; } protected boolean canOutput(FluidStack aOutput) { - return getDrainableStack() == null - || aOutput == null - || (getDrainableStack().isFluidEqual(aOutput) - && (getDrainableStack().amount <= 0 - || getDrainableStack().amount + aOutput.amount <= getCapacity())); + return getDrainableStack() == null || aOutput == null + || (getDrainableStack().isFluidEqual(aOutput) && (getDrainableStack().amount <= 0 + || getDrainableStack().amount + aOutput.amount <= getCapacity())); } protected ItemStack getInputAt(int aIndex) { @@ -819,15 +743,9 @@ public abstract class GTPP_MTE_BasicMachine extends GTPP_MTE_BasicTank { @Override public String[] getInfoData() { - return new String[] { - mNEIName, - "Progress:", - (mProgresstime / 20) + " secs", - (mMaxProgresstime / 20) + " secs", - "Stored Energy:", - getBaseMetaTileEntity().getStoredEU() + "EU", - getBaseMetaTileEntity().getEUCapacity() + "EU" - }; + return new String[] { mNEIName, "Progress:", (mProgresstime / 20) + " secs", (mMaxProgresstime / 20) + " secs", + "Stored Energy:", getBaseMetaTileEntity().getStoredEU() + "EU", + getBaseMetaTileEntity().getEUCapacity() + "EU" }; } @Override @@ -847,9 +765,8 @@ public abstract class GTPP_MTE_BasicMachine extends GTPP_MTE_BasicTank { @Override public boolean allowCoverOnSide(byte aSide, GT_ItemStack aCoverID) { - return (aSide != mMainFacing - || GregTech_API.getCoverBehavior(aCoverID.toStack()) - .isGUIClickable(aSide, GT_Utility.stackToInt(aCoverID.toStack()), 0, getBaseMetaTileEntity())); + return (aSide != mMainFacing || GregTech_API.getCoverBehavior(aCoverID.toStack()) + .isGUIClickable(aSide, GT_Utility.stackToInt(aCoverID.toStack()), 0, getBaseMetaTileEntity())); } @Override @@ -859,10 +776,10 @@ public abstract class GTPP_MTE_BasicMachine extends GTPP_MTE_BasicTank { @Override public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { - if (aSide == mMainFacing - || aIndex < getInputSlot() + if (aSide == mMainFacing || aIndex < getInputSlot() || aIndex >= getInputSlot() + mInputSlotCount - || (!mAllowInputFromOutputSide && aSide == aBaseMetaTileEntity.getFrontFacing())) return false; + || (!mAllowInputFromOutputSide && aSide == aBaseMetaTileEntity.getFrontFacing())) + return false; for (int i = getInputSlot(), j = i + mInputSlotCount; i < j; i++) if (GT_Utility.areStacksEqual(GT_OreDictUnificator.get(aStack), mInventory[i])) return i == aIndex; return true; @@ -876,7 +793,8 @@ public abstract class GTPP_MTE_BasicMachine extends GTPP_MTE_BasicTank { } /** - * Override this to check the Recipes yourself, super calls to this could be useful if you just want to add a special case + * Override this to check the Recipes yourself, super calls to this could be useful if you just want to add a + * special case * <p/> * I thought about Enum too, but Enum doesn't add support for people adding other return Systems. * <p/> @@ -910,7 +828,7 @@ public abstract class GTPP_MTE_BasicMachine extends GTPP_MTE_BasicTank { mLastRecipe, false, V[mTier], - new FluidStack[] {getFillableStack()}, + new FluidStack[] { getFillableStack() }, getSpecialSlot(), getAllInputs()); if (tRecipe == null) return DID_NOT_FIND_RECIPE; @@ -922,91 +840,78 @@ public abstract class GTPP_MTE_BasicMachine extends GTPP_MTE_BasicTank { } if (tRecipe.mSpecialValue == -200 && (mCleanroom == null || mCleanroom.mEfficiency == 0)) return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; - if (!tRecipe.isRecipeInputEqual(true, new FluidStack[] {getFillableStack()}, getAllInputs())) + if (!tRecipe.isRecipeInputEqual(true, new FluidStack[] { getFillableStack() }, getAllInputs())) return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; for (int i = 0; i < mOutputItems.length; i++) if (getBaseMetaTileEntity().getRandomNumber(10000) < tRecipe.getOutputChance(i)) mOutputItems[i] = tRecipe.getOutput(i); - if (tRecipe.mSpecialValue == -200) - for (int i = 0; i < mOutputItems.length; i++) - if (mOutputItems[i] != null && getBaseMetaTileEntity().getRandomNumber(10000) > mCleanroom.mEfficiency) - mOutputItems[i] = null; + if (tRecipe.mSpecialValue == -200) for (int i = 0; i < mOutputItems.length; i++) + if (mOutputItems[i] != null && getBaseMetaTileEntity().getRandomNumber(10000) > mCleanroom.mEfficiency) + mOutputItems[i] = null; mOutputFluid = tRecipe.getFluidOutput(0); calculateOverclockedNess(tRecipe); return FOUND_AND_SUCCESSFULLY_USED_RECIPE; } public ITexture[] getSideFacingActive(byte aColor) { - return new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1]}; + return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1] }; } public ITexture[] getSideFacingInactive(byte aColor) { - return new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1]}; + return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1] }; } public ITexture[] getFrontFacingActive(byte aColor) { - return new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1]}; + return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1] }; } public ITexture[] getFrontFacingInactive(byte aColor) { - return new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1]}; + return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1] }; } public ITexture[] getTopFacingActive(byte aColor) { - return new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1]}; + return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1] }; } public ITexture[] getTopFacingInactive(byte aColor) { - return new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1]}; + return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1] }; } public ITexture[] getBottomFacingActive(byte aColor) { - return new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1]}; + return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1] }; } public ITexture[] getBottomFacingInactive(byte aColor) { - return new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1]}; + return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1] }; } public ITexture[] getBottomFacingPipeActive(byte aColor) { - return new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], - new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT) - }; + return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], + new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT) }; } public ITexture[] getBottomFacingPipeInactive(byte aColor) { - return new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], - new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT) - }; + return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], + new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT) }; } public ITexture[] getTopFacingPipeActive(byte aColor) { - return new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], - new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT) - }; + return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], + new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT) }; } public ITexture[] getTopFacingPipeInactive(byte aColor) { - return new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], - new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT) - }; + return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], + new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT) }; } public ITexture[] getSideFacingPipeActive(byte aColor) { - return new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], - new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT) - }; + return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], + new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT) }; } public ITexture[] getSideFacingPipeInactive(byte aColor) { - return new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], - new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT) - }; + return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], + new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT) }; } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/GTPP_MTE_BasicTank.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/GTPP_MTE_BasicTank.java index 7e2cfaa94a..679b007111 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/GTPP_MTE_BasicTank.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/GTPP_MTE_BasicTank.java @@ -1,12 +1,13 @@ package gtPlusPlus.xmod.gregtech.api.metatileentity.custom.power; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraftforge.fluids.FluidStack; + import gregtech.api.enums.ItemList; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.util.GT_Utility; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraftforge.fluids.FluidStack; /** * NEVER INCLUDE THIS FILE IN YOUR MOD!!! @@ -20,35 +21,23 @@ public abstract class GTPP_MTE_BasicTank extends GTPP_MTE_TieredMachineBlock { /** * @param aInvSlotCount should be 3 */ - public GTPP_MTE_BasicTank( - int aID, - String aName, - String aNameRegional, - int aTier, - int aInvSlotCount, - String aDescription, - ITexture... aTextures) { + public GTPP_MTE_BasicTank(int aID, String aName, String aNameRegional, int aTier, int aInvSlotCount, + String aDescription, ITexture... aTextures) { super(aID, aName, aNameRegional, aTier, aInvSlotCount, aDescription, aTextures); } - public GTPP_MTE_BasicTank( - int aID, - String aName, - String aNameRegional, - int aTier, - int aInvSlotCount, - String[] aDescription, - ITexture... aTextures) { + public GTPP_MTE_BasicTank(int aID, String aName, String aNameRegional, int aTier, int aInvSlotCount, + String[] aDescription, ITexture... aTextures) { super(aID, aName, aNameRegional, aTier, aInvSlotCount, aDescription, aTextures); } - public GTPP_MTE_BasicTank( - String aName, int aTier, int aInvSlotCount, String aDescription, ITexture[][][] aTextures) { + public GTPP_MTE_BasicTank(String aName, int aTier, int aInvSlotCount, String aDescription, + ITexture[][][] aTextures) { super(aName, aTier, aInvSlotCount, aDescription, aTextures); } - public GTPP_MTE_BasicTank( - String aName, int aTier, int aInvSlotCount, String[] aDescription, ITexture[][][] aTextures) { + public GTPP_MTE_BasicTank(String aName, int aTier, int aInvSlotCount, String[] aDescription, + ITexture[][][] aTextures) { super(aName, aTier, aInvSlotCount, aDescription, aTextures); } @@ -137,8 +126,8 @@ public abstract class GTPP_MTE_BasicTank extends GTPP_MTE_TieredMachineBlock { if (ItemList.Display_Fluid.isStackEqual(mInventory[getStackDisplaySlot()], true, true)) mInventory[getStackDisplaySlot()] = null; } else { - mInventory[getStackDisplaySlot()] = - GT_Utility.getFluidDisplayStack(getDisplayedFluid(), displaysStackSize()); + mInventory[getStackDisplaySlot()] = GT_Utility + .getFluidDisplayStack(getDisplayedFluid(), displaysStackSize()); } } @@ -172,8 +161,8 @@ public abstract class GTPP_MTE_BasicTank extends GTPP_MTE_TieredMachineBlock { } if (doesFillContainers()) { - ItemStack tOutput = - GT_Utility.fillFluidContainer(getDrainableStack(), mInventory[getInputSlot()], false, true); + ItemStack tOutput = GT_Utility + .fillFluidContainer(getDrainableStack(), mInventory[getInputSlot()], false, true); if (tOutput != null && aBaseMetaTileEntity.addStackToSlot(getOutputSlot(), tOutput, 1)) { FluidStack tFluid = GT_Utility.getFluidForFilledItem(tOutput, true); aBaseMetaTileEntity.decrStackSize(getInputSlot(), 1); @@ -196,11 +185,11 @@ public abstract class GTPP_MTE_BasicTank extends GTPP_MTE_TieredMachineBlock { @Override public int fill(FluidStack aFluid, boolean doFill) { - if (aFluid == null - || aFluid.getFluid().getID() <= 0 + if (aFluid == null || aFluid.getFluid().getID() <= 0 || aFluid.amount <= 0 || !canTankBeFilled() - || !isFluidInputAllowed(aFluid)) return 0; + || !isFluidInputAllowed(aFluid)) + return 0; if (getFillableStack() == null || getFillableStack().getFluid().getID() <= 0) { if (aFluid.amount <= getCapacity()) { diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/GTPP_MTE_TieredMachineBlock.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/GTPP_MTE_TieredMachineBlock.java index e45588e126..51596dd8cd 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/GTPP_MTE_TieredMachineBlock.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/GTPP_MTE_TieredMachineBlock.java @@ -6,6 +6,7 @@ import gregtech.api.interfaces.ITexture; import gtPlusPlus.api.objects.data.AutoMap; public abstract class GTPP_MTE_TieredMachineBlock extends MetaTileEntityCustomPower { + /** * Value between [0 - 9] to describe the Tier of this Machine. */ @@ -24,31 +25,19 @@ public abstract class GTPP_MTE_TieredMachineBlock extends MetaTileEntityCustomPo */ public final ITexture[][][] mTextures; - public GTPP_MTE_TieredMachineBlock( - int aID, - String aName, - String aNameRegional, - int aTier, - int aInvSlotCount, - String aDescription, - ITexture... aTextures) { + public GTPP_MTE_TieredMachineBlock(int aID, String aName, String aNameRegional, int aTier, int aInvSlotCount, + String aDescription, ITexture... aTextures) { super(aID, aName, aNameRegional, aInvSlotCount); mTier = (byte) Math.max(0, Math.min(aTier, 9)); - mDescriptionArray = aDescription == null ? new String[0] : new String[] {aDescription}; + mDescriptionArray = aDescription == null ? new String[0] : new String[] { aDescription }; mDescription = mDescriptionArray.length > 0 ? mDescriptionArray[0] : ""; // must always be the last call! if (GT.isClientSide()) mTextures = getTextureSet(aTextures); else mTextures = null; } - public GTPP_MTE_TieredMachineBlock( - int aID, - String aName, - String aNameRegional, - int aTier, - int aInvSlotCount, - String[] aDescription, - ITexture... aTextures) { + public GTPP_MTE_TieredMachineBlock(int aID, String aName, String aNameRegional, int aTier, int aInvSlotCount, + String[] aDescription, ITexture... aTextures) { super(aID, aName, aNameRegional, aInvSlotCount); mTier = (byte) Math.max(0, Math.min(aTier, 9)); mDescriptionArray = aDescription == null ? new String[0] : aDescription; @@ -59,17 +48,17 @@ public abstract class GTPP_MTE_TieredMachineBlock extends MetaTileEntityCustomPo else mTextures = null; } - public GTPP_MTE_TieredMachineBlock( - String aName, int aTier, int aInvSlotCount, String aDescription, ITexture[][][] aTextures) { + public GTPP_MTE_TieredMachineBlock(String aName, int aTier, int aInvSlotCount, String aDescription, + ITexture[][][] aTextures) { super(aName, aInvSlotCount); mTier = (byte) aTier; - mDescriptionArray = aDescription == null ? new String[0] : new String[] {aDescription}; + mDescriptionArray = aDescription == null ? new String[0] : new String[] { aDescription }; mDescription = mDescriptionArray.length > 0 ? mDescriptionArray[0] : ""; mTextures = aTextures; } - public GTPP_MTE_TieredMachineBlock( - String aName, int aTier, int aInvSlotCount, String[] aDescription, ITexture[][][] aTextures) { + public GTPP_MTE_TieredMachineBlock(String aName, int aTier, int aInvSlotCount, String[] aDescription, + ITexture[][][] aTextures) { super(aName, aInvSlotCount); mTier = (byte) aTier; mDescriptionArray = aDescription == null ? new String[0] : aDescription; @@ -105,8 +94,8 @@ public abstract class GTPP_MTE_TieredMachineBlock extends MetaTileEntityCustomPo } /** - * Used Client Side to get a Texture Set for this Block. - * Called after setting the Tier and the Description so that those two are accessible. + * Used Client Side to get a Texture Set for this Block. Called after setting the Tier and the Description so that + * those two are accessible. * * @param aTextures is the optional Array you can give to the Constructor. */ diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/MetaTileEntityCustomPower.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/MetaTileEntityCustomPower.java index 36185b638b..e2b5d1eafc 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/MetaTileEntityCustomPower.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/MetaTileEntityCustomPower.java @@ -1,14 +1,15 @@ package gtPlusPlus.xmod.gregtech.api.metatileentity.custom.power; +import net.minecraft.entity.Entity; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; + import gregtech.api.GregTech_API; import gregtech.api.enums.GT_Values; import gregtech.api.util.GT_Utility; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.CustomMetaTileBase; import gtPlusPlus.xmod.gregtech.common.Meta_GT_Proxy; -import net.minecraft.entity.Entity; -import net.minecraft.init.Blocks; -import net.minecraft.world.World; public abstract class MetaTileEntityCustomPower extends CustomMetaTileBase { @@ -37,35 +38,40 @@ public abstract class MetaTileEntityCustomPower extends CustomMetaTileBase { return; } - float tStrength = aExplosionPower < GT_Values.V[0] - ? 1.0F - : (aExplosionPower < GT_Values.V[1] - ? 2.0F - : (aExplosionPower < GT_Values.V[2] - ? 3.0F - : (aExplosionPower < GT_Values.V[3] - ? 4.0F - : (aExplosionPower < GT_Values.V[4] - ? 5.0F - : (aExplosionPower < GT_Values.V[4] * 2L - ? 6.0F - : (aExplosionPower < GT_Values.V[5] - ? 7.0F - : (aExplosionPower < GT_Values.V[6] - ? 8.0F - : (aExplosionPower < GT_Values.V[7] - ? 9.0F - : 10.0F)))))))); + float tStrength = aExplosionPower + < GT_Values.V[0] + ? 1.0F + : (aExplosionPower < GT_Values.V[1] ? 2.0F + : (aExplosionPower < GT_Values.V[2] ? 3.0F + : (aExplosionPower < GT_Values.V[3] ? 4.0F + : (aExplosionPower < GT_Values.V[4] ? 5.0F + : (aExplosionPower < GT_Values.V[4] * 2L ? 6.0F + : (aExplosionPower < GT_Values.V[5] ? 7.0F + : (aExplosionPower < GT_Values.V[6] ? 8.0F + : (aExplosionPower < GT_Values.V[7] + ? 9.0F + : 10.0F)))))))); int tX = this.getBaseMetaTileEntity().getXCoord(); short tY = this.getBaseMetaTileEntity().getYCoord(); int tZ = this.getBaseMetaTileEntity().getZCoord(); World tWorld = this.getBaseMetaTileEntity().getWorld(); GT_Utility.sendSoundToPlayers( - tWorld, (String) GregTech_API.sSoundList.get(Integer.valueOf(209)), 1.0F, -1.0F, tX, tY, tZ); + tWorld, + (String) GregTech_API.sSoundList.get(Integer.valueOf(209)), + 1.0F, + -1.0F, + tX, + tY, + tZ); tWorld.setBlock(tX, tY, tZ, Blocks.air); if (GregTech_API.sMachineExplosions) { tWorld.createExplosion( - (Entity) null, (double) tX + 0.5D, (double) tY + 0.5D, (double) tZ + 0.5D, tStrength, true); + (Entity) null, + (double) tX + 0.5D, + (double) tY + 0.5D, + (double) tZ + 0.5D, + tStrength, + true); } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicBreaker.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicBreaker.java index b9ffc8740a..8d8ec9b1be 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicBreaker.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicBreaker.java @@ -1,7 +1,13 @@ package gtPlusPlus.xmod.gregtech.api.metatileentity.implementations; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.EnumChatFormatting; + import com.gtnewhorizons.modularui.api.screen.ModularWindow; import com.gtnewhorizons.modularui.api.screen.UIBuildContext; + import gregtech.api.enums.GT_Values; import gregtech.api.enums.Textures.BlockIcons; import gregtech.api.gui.modularui.GT_UIInfos; @@ -15,10 +21,6 @@ import gtPlusPlus.core.lib.CORE; import gtPlusPlus.xmod.gregtech.api.metatileentity.custom.power.GTPP_MTE_TieredMachineBlock; import ic2.api.item.ElectricItem; import ic2.api.item.IElectricItem; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.EnumChatFormatting; public class GT_MetaTileEntity_BasicBreaker extends GTPP_MTE_TieredMachineBlock implements IAddUIWidgets { @@ -30,18 +32,18 @@ public class GT_MetaTileEntity_BasicBreaker extends GTPP_MTE_TieredMachineBlock private long mStored = 0L; private long mMax = 0L; - public GT_MetaTileEntity_BasicBreaker( - int aID, String aName, String aNameRegional, int aTier, String aDescription, int aSlotCount) { + public GT_MetaTileEntity_BasicBreaker(int aID, String aName, String aNameRegional, int aTier, String aDescription, + int aSlotCount) { super(aID, aName, aNameRegional, aTier, aSlotCount, aDescription, new ITexture[0]); } - public GT_MetaTileEntity_BasicBreaker( - String aName, int aTier, String aDescription, ITexture[][][] aTextures, int aSlotCount) { + public GT_MetaTileEntity_BasicBreaker(String aName, int aTier, String aDescription, ITexture[][][] aTextures, + int aSlotCount) { super(aName, aTier, aSlotCount, aDescription, aTextures); } - public GT_MetaTileEntity_BasicBreaker( - String aName, int aTier, String[] aDescription, ITexture[][][] aTextures, int aSlotCount) { + public GT_MetaTileEntity_BasicBreaker(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures, + int aSlotCount) { super(aName, aTier, aSlotCount, aDescription, aTextures); } @@ -49,13 +51,21 @@ public class GT_MetaTileEntity_BasicBreaker extends GTPP_MTE_TieredMachineBlock final String[] desc = new String[6]; int tTier = this.mTier; desc[0] = "" + EnumChatFormatting.BOLD + "16 Fuse Slots"; - desc[1] = "Per each fuse, you may insert " + EnumChatFormatting.YELLOW + (GT_Values.V[tTier]) - + EnumChatFormatting.GRAY + " EU/t"; - desc[2] = "However this " + EnumChatFormatting.ITALIC + EnumChatFormatting.RED + "MUST" - + EnumChatFormatting.GRAY + " be in a single Amp"; + desc[1] = "Per each fuse, you may insert " + EnumChatFormatting.YELLOW + + (GT_Values.V[tTier]) + + EnumChatFormatting.GRAY + + " EU/t"; + desc[2] = "However this " + EnumChatFormatting.ITALIC + + EnumChatFormatting.RED + + "MUST" + + EnumChatFormatting.GRAY + + " be in a single Amp"; desc[3] = "This machine can accept upto a single amp of " + GT_Values.VN[Math.min(tTier + 2, 15)] + " as a result"; - desc[4] = "Breaker Loss: " + EnumChatFormatting.RED + "" + (GT_Values.V[tTier] / 16) + EnumChatFormatting.GRAY + desc[4] = "Breaker Loss: " + EnumChatFormatting.RED + + "" + + (GT_Values.V[tTier] / 16) + + EnumChatFormatting.GRAY + " EU/t"; desc[5] = CORE.GT_Tooltip; return desc; @@ -65,37 +75,30 @@ public class GT_MetaTileEntity_BasicBreaker extends GTPP_MTE_TieredMachineBlock ITexture[][][] rTextures = new ITexture[2][17][]; for (byte i = -1; i < 16; ++i) { - rTextures[0][i + 1] = new ITexture[] { - BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], - this.mInventory.length > 4 - ? BlockIcons.OVERLAYS_ENERGY_IN_MULTI[Math.min(12, mTier)] - : BlockIcons.OVERLAYS_ENERGY_IN[Math.min(12, mTier)] - }; - - rTextures[1][i + 1] = new ITexture[] { - BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], - this.mInventory.length > 4 - ? BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[this.mTier] - : BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier] - }; + rTextures[0][i + 1] = new ITexture[] { BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], + this.mInventory.length > 4 ? BlockIcons.OVERLAYS_ENERGY_IN_MULTI[Math.min(12, mTier)] + : BlockIcons.OVERLAYS_ENERGY_IN[Math.min(12, mTier)] }; + + rTextures[1][i + 1] = new ITexture[] { BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], + this.mInventory.length > 4 ? BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[this.mTier] + : BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier] }; } return rTextures; } - public ITexture[] getTexture( - IGregTechTileEntity aBaseMetaTileEntity, - byte aSide, - byte aFacing, - byte aColorIndex, - boolean aActive, - boolean aRedstone) { + public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, + boolean aActive, boolean aRedstone) { return this.mTextures[aSide == aFacing ? 1 : 0][aColorIndex + 1]; } public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new GT_MetaTileEntity_BasicBreaker( - this.mName, this.mTier, this.mDescriptionArray, this.mTextures, this.mInventory.length); + this.mName, + this.mTier, + this.mDescriptionArray, + this.mTextures, + this.mInventory.length); } public boolean isSimpleMachine() { @@ -198,23 +201,14 @@ public class GT_MetaTileEntity_BasicBreaker extends GTPP_MTE_TieredMachineBlock public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { super.onPostTick(aBaseMetaTileEntity, aTick); if (aBaseMetaTileEntity.isServerSide()) { - /*this.mCharge = aBaseMetaTileEntity.getStoredEU() / 2L > aBaseMetaTileEntity.getEUCapacity() / 3L; - this.mDecharge = aBaseMetaTileEntity.getStoredEU() < aBaseMetaTileEntity.getEUCapacity() / 3L; - this.mBatteryCount = 0; - this.mChargeableCount = 0; - ItemStack[] arg3 = this.mInventory; - int arg4 = arg3.length; - - for (int arg5 = 0; arg5 < arg4; ++arg5) { - ItemStack tStack = arg3[arg5]; - if (GT_ModHandler.isElectricItem(tStack, this.mTier)) { - if (GT_ModHandler.isChargerItem(tStack)) { - ++this.mBatteryCount; - } - - ++this.mChargeableCount; - } - }*/ + /* + * this.mCharge = aBaseMetaTileEntity.getStoredEU() / 2L > aBaseMetaTileEntity.getEUCapacity() / 3L; + * this.mDecharge = aBaseMetaTileEntity.getStoredEU() < aBaseMetaTileEntity.getEUCapacity() / 3L; + * this.mBatteryCount = 0; this.mChargeableCount = 0; ItemStack[] arg3 = this.mInventory; int arg4 = + * arg3.length; for (int arg5 = 0; arg5 < arg4; ++arg5) { ItemStack tStack = arg3[arg5]; if + * (GT_ModHandler.isElectricItem(tStack, this.mTier)) { if (GT_ModHandler.isChargerItem(tStack)) { + * ++this.mBatteryCount; } ++this.mChargeableCount; } } + */ } } @@ -274,11 +268,11 @@ public class GT_MetaTileEntity_BasicBreaker extends GTPP_MTE_TieredMachineBlock tStored = Long.MAX_VALUE; } - return new long[] {tStored, tScale}; + return new long[] { tStored, tScale }; } public String[] getInfoData() { - return new String[] {"Tile Type: " + this.getTileEntityBaseType()}; + return new String[] { "Tile Type: " + this.getTileEntityBaseType() }; } public boolean isGivingInformation() { diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine_GTPP_Recipe.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine_GTPP_Recipe.java index cf92bdc0ba..a47ed592c4 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine_GTPP_Recipe.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine_GTPP_Recipe.java @@ -6,25 +6,10 @@ import gregtech.api.util.GT_Recipe.GT_Recipe_Map; public class GT_MetaTileEntity_BasicMachine_GTPP_Recipe extends GT_MetaTileEntity_BasicMachine_GT_Recipe { - public GT_MetaTileEntity_BasicMachine_GTPP_Recipe( - int aID, - String aName, - String aNameRegional, - int aTier, - String aDescription, - GT_Recipe_Map aRecipes, - int aInputSlots, - int aOutputSlots, - int aTankCapacity, - int aGUIParameterA, - int aGUIParameterB, - String aGUIName, - String aSound, - boolean aSharedTank, - boolean aRequiresFluidForFiltering, - int aSpecialEffect, - String aOverlays, - Object[] aRecipe) { + public GT_MetaTileEntity_BasicMachine_GTPP_Recipe(int aID, String aName, String aNameRegional, int aTier, + String aDescription, GT_Recipe_Map aRecipes, int aInputSlots, int aOutputSlots, int aTankCapacity, + int aGUIParameterA, int aGUIParameterB, String aGUIName, String aSound, boolean aSharedTank, + boolean aRequiresFluidForFiltering, int aSpecialEffect, String aOverlays, Object[] aRecipe) { super( aID, aName, @@ -46,24 +31,10 @@ public class GT_MetaTileEntity_BasicMachine_GTPP_Recipe extends GT_MetaTileEntit aRecipe); } - public GT_MetaTileEntity_BasicMachine_GTPP_Recipe( - String aName, - int aTier, - String aDescription, - GT_Recipe_Map aRecipes, - int aInputSlots, - int aOutputSlots, - int aTankCapacity, - int aAmperage, - int aGUIParameterA, - int aGUIParameterB, - ITexture[][][] aTextures, - String aGUIName, - String aNEIName, - String aSound, - boolean aSharedTank, - boolean aRequiresFluidForFiltering, - int aSpecialEffect) { + public GT_MetaTileEntity_BasicMachine_GTPP_Recipe(String aName, int aTier, String aDescription, + GT_Recipe_Map aRecipes, int aInputSlots, int aOutputSlots, int aTankCapacity, int aAmperage, + int aGUIParameterA, int aGUIParameterB, ITexture[][][] aTextures, String aGUIName, String aNEIName, + String aSound, boolean aSharedTank, boolean aRequiresFluidForFiltering, int aSpecialEffect) { super( aName, aTier, @@ -84,24 +55,10 @@ public class GT_MetaTileEntity_BasicMachine_GTPP_Recipe extends GT_MetaTileEntit aSpecialEffect); } - public GT_MetaTileEntity_BasicMachine_GTPP_Recipe( - String aName, - int aTier, - String[] aDescription, - GT_Recipe_Map aRecipes, - int aInputSlots, - int aOutputSlots, - int aTankCapacity, - int aAmperage, - int aGUIParameterA, - int aGUIParameterB, - ITexture[][][] aTextures, - String aGUIName, - String aNEIName, - String aSound, - boolean aSharedTank, - boolean aRequiresFluidForFiltering, - int aSpecialEffect) { + public GT_MetaTileEntity_BasicMachine_GTPP_Recipe(String aName, int aTier, String[] aDescription, + GT_Recipe_Map aRecipes, int aInputSlots, int aOutputSlots, int aTankCapacity, int aAmperage, + int aGUIParameterA, int aGUIParameterB, ITexture[][][] aTextures, String aGUIName, String aNEIName, + String aSound, boolean aSharedTank, boolean aRequiresFluidForFiltering, int aSpecialEffect) { super( aName, aTier, diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Dehydrator.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Dehydrator.java index 7273977101..6852d7be5f 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Dehydrator.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Dehydrator.java @@ -31,8 +31,8 @@ public class GT_MetaTileEntity_Dehydrator extends GT_MetaTileEntity_BasicMachine // 3 8 } - public GT_MetaTileEntity_Dehydrator( - int aID, String aName, String aNameRegional, int aTier, String aDescription, int aTankCapacity) { + public GT_MetaTileEntity_Dehydrator(int aID, String aName, String aNameRegional, int aTier, String aDescription, + int aTankCapacity) { super( aID, aName, @@ -54,16 +54,9 @@ public class GT_MetaTileEntity_Dehydrator extends GT_MetaTileEntity_BasicMachine null); } - public GT_MetaTileEntity_Dehydrator( - String aName, - int aTier, - String[] aDescription, - GT_Recipe.GT_Recipe_Map aRecipes, - int aTankCapacity, - int aAmperage, - ITexture[][][] aTextures, - String aGUIName, - String aNEIName) { + public GT_MetaTileEntity_Dehydrator(String aName, int aTier, String[] aDescription, + GT_Recipe.GT_Recipe_Map aRecipes, int aTankCapacity, int aAmperage, ITexture[][][] aTextures, + String aGUIName, String aNEIName) { super( aName, aTier, @@ -116,13 +109,8 @@ public class GT_MetaTileEntity_Dehydrator extends GT_MetaTileEntity_BasicMachine } @Override - public ITexture[] getTexture( - final IGregTechTileEntity aBaseMetaTileEntity, - final byte aSide, - final byte aFacing, - final byte aColorIndex, - final boolean aActive, - final boolean aRedstone) { + public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing, + final byte aColorIndex, final boolean aActive, final boolean aRedstone) { return super.getTexture(aBaseMetaTileEntity, aSide, aFacing, aColorIndex, aActive, aRedstone); // return this.mTextures[(aActive ? 5 : 0) + (aSide == aFacing ? 0 : aSide == // GT_Utility.getOppositeSide(aFacing) ? 1 : aSide == 0 ? 2 : aSide == 1 ? 3 : 4)][aColorIndex + 1]; @@ -130,87 +118,79 @@ public class GT_MetaTileEntity_Dehydrator extends GT_MetaTileEntity_BasicMachine @Override public ITexture[] getFrontFacingInactive(final byte aColor) { - return new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], new GT_RenderedTexture(sDehydratorOverlays[0]) - }; + return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], + new GT_RenderedTexture(sDehydratorOverlays[0]) }; } @Override public ITexture[] getBottomFacingInactive(final byte aColor) { - return new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], new GT_RenderedTexture(sDehydratorOverlays[2]) - }; + return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], + new GT_RenderedTexture(sDehydratorOverlays[2]) }; } @Override public ITexture[] getTopFacingInactive(final byte aColor) { - return new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], new GT_RenderedTexture(sDehydratorOverlays[3]) - }; + return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], + new GT_RenderedTexture(sDehydratorOverlays[3]) }; } @Override public ITexture[] getSideFacingInactive(final byte aColor) { - return new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], new GT_RenderedTexture(sDehydratorOverlays[4]) - }; + return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], + new GT_RenderedTexture(sDehydratorOverlays[4]) }; } @Override public ITexture[] getFrontFacingActive(final byte aColor) { - return new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], new GT_RenderedTexture(sDehydratorOverlays[5]) - }; + return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], + new GT_RenderedTexture(sDehydratorOverlays[5]) }; } @Override public ITexture[] getBottomFacingActive(final byte aColor) { - return new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], new GT_RenderedTexture(sDehydratorOverlays[7]) - }; + return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], + new GT_RenderedTexture(sDehydratorOverlays[7]) }; } @Override public ITexture[] getTopFacingActive(final byte aColor) { - return new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], new GT_RenderedTexture(sDehydratorOverlays[8]) - }; + return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], + new GT_RenderedTexture(sDehydratorOverlays[8]) }; } @Override public ITexture[] getSideFacingActive(final byte aColor) { - return new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], new GT_RenderedTexture(sDehydratorOverlays[9]) - }; + return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], + new GT_RenderedTexture(sDehydratorOverlays[9]) }; } @Override public ITexture[] getBottomFacingPipeActive(byte aColor) { - return new ITexture[] {MACHINE_CASINGS[mTier][aColor + 1], TextureFactory.of(OVERLAY_PIPE_OUT)}; + return new ITexture[] { MACHINE_CASINGS[mTier][aColor + 1], TextureFactory.of(OVERLAY_PIPE_OUT) }; } @Override public ITexture[] getBottomFacingPipeInactive(byte aColor) { - return new ITexture[] {MACHINE_CASINGS[mTier][aColor + 1], TextureFactory.of(OVERLAY_PIPE_OUT)}; + return new ITexture[] { MACHINE_CASINGS[mTier][aColor + 1], TextureFactory.of(OVERLAY_PIPE_OUT) }; } @Override public ITexture[] getTopFacingPipeActive(byte aColor) { - return new ITexture[] {MACHINE_CASINGS[mTier][aColor + 1], TextureFactory.of(OVERLAY_PIPE_OUT)}; + return new ITexture[] { MACHINE_CASINGS[mTier][aColor + 1], TextureFactory.of(OVERLAY_PIPE_OUT) }; } @Override public ITexture[] getTopFacingPipeInactive(byte aColor) { - return new ITexture[] {MACHINE_CASINGS[mTier][aColor + 1], TextureFactory.of(OVERLAY_PIPE_OUT)}; + return new ITexture[] { MACHINE_CASINGS[mTier][aColor + 1], TextureFactory.of(OVERLAY_PIPE_OUT) }; } @Override public ITexture[] getSideFacingPipeActive(byte aColor) { - return new ITexture[] {MACHINE_CASINGS[mTier][aColor + 1], TextureFactory.of(OVERLAY_PIPE_OUT)}; + return new ITexture[] { MACHINE_CASINGS[mTier][aColor + 1], TextureFactory.of(OVERLAY_PIPE_OUT) }; } @Override public ITexture[] getSideFacingPipeInactive(byte aColor) { - return new ITexture[] {MACHINE_CASINGS[mTier][aColor + 1], TextureFactory.of(OVERLAY_PIPE_OUT)}; + return new ITexture[] { MACHINE_CASINGS[mTier][aColor + 1], TextureFactory.of(OVERLAY_PIPE_OUT) }; } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_DeluxeMachine.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_DeluxeMachine.java index 299580391a..8b39d1da32 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_DeluxeMachine.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_DeluxeMachine.java @@ -2,6 +2,17 @@ package gtPlusPlus.xmod.gregtech.api.metatileentity.implementations; import static gregtech.api.enums.GT_Values.V; +import java.util.Arrays; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraftforge.common.DimensionManager; +import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.fluids.IFluidHandler; + import gregtech.api.GregTech_API; import gregtech.api.enums.ItemList; import gregtech.api.enums.Textures; @@ -16,78 +27,47 @@ import gregtech.api.util.GT_Recipe.GT_Recipe_Map; import gregtech.api.util.GT_Utility; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.api.objects.random.XSTR; -import java.util.Arrays; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.tileentity.TileEntity; -import net.minecraftforge.common.DimensionManager; -import net.minecraftforge.common.util.ForgeDirection; -import net.minecraftforge.fluids.FluidStack; -import net.minecraftforge.fluids.IFluidHandler; /** * NEVER INCLUDE THIS FILE IN YOUR MOD!!! * <p/> - * This is the main construct for my Basic Machines such as the Automatic Extractor - * Extend this class to make a simple Machine + * This is the main construct for my Basic Machines such as the Automatic Extractor Extend this class to make a simple + * Machine */ public abstract class GT_MetaTileEntity_DeluxeMachine extends GT_MetaTileEntity_DeluxeTank { + /** * return values for checkRecipe() */ - protected static final int DID_NOT_FIND_RECIPE = 0, - FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS = 1, + protected static final int DID_NOT_FIND_RECIPE = 0, FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS = 1, FOUND_AND_SUCCESSFULLY_USED_RECIPE = 2; public static final int OTHER_SLOT_COUNT = 4; public final ItemStack[] mOutputItems; public final int mInputSlotCount, mAmperage; - public boolean mAllowInputFromOutputSide = false, - mFluidTransfer = false, - mItemTransfer = false, - mHasBeenUpdated = false, - mStuttering = false, - mCharge = false, - mDecharge = false; + public boolean mAllowInputFromOutputSide = false, mFluidTransfer = false, mItemTransfer = false, + mHasBeenUpdated = false, mStuttering = false, mCharge = false, mDecharge = false; public int mMainFacing = -1, mProgresstime = 0, mMaxProgresstime = 0, mEUt = 0, mOutputBlocked = 0; public FluidStack mOutputFluid; public String mGUIName = "", mNEIName = ""; /** - * Contains the Recipe which has been previously used, or null if there was no previous Recipe, which could have been buffered + * Contains the Recipe which has been previously used, or null if there was no previous Recipe, which could have + * been buffered */ protected GT_Recipe mLastRecipe = null; private FluidStack mFluidOut; /** - * @param aOverlays 0 = SideFacingActive - * 1 = SideFacingInactive - * 2 = FrontFacingActive - * 3 = FrontFacingInactive - * 4 = TopFacingActive - * 5 = TopFacingInactive - * 6 = BottomFacingActive - * 7 = BottomFacingInactive - * ----- Not all Array Elements have to be initialised, you can also just use 8 Parameters for the Default Pipe Texture Overlays ----- - * 8 = BottomFacingPipeActive - * 9 = BottomFacingPipeInactive - * 10 = TopFacingPipeActive - * 11 = TopFacingPipeInactive - * 12 = SideFacingPipeActive - * 13 = SideFacingPipeInactive + * @param aOverlays 0 = SideFacingActive 1 = SideFacingInactive 2 = FrontFacingActive 3 = FrontFacingInactive 4 = + * TopFacingActive 5 = TopFacingInactive 6 = BottomFacingActive 7 = BottomFacingInactive ----- Not + * all Array Elements have to be initialised, you can also just use 8 Parameters for the Default + * Pipe Texture Overlays ----- 8 = BottomFacingPipeActive 9 = BottomFacingPipeInactive 10 = + * TopFacingPipeActive 11 = TopFacingPipeInactive 12 = SideFacingPipeActive 13 = + * SideFacingPipeInactive */ - public GT_MetaTileEntity_DeluxeMachine( - int aID, - String aName, - String aNameRegional, - int aTier, - int aAmperage, - String aDescription, - int aInputSlotCount, - int aOutputSlotCount, - String aGUIName, - String aNEIName, + public GT_MetaTileEntity_DeluxeMachine(int aID, String aName, String aNameRegional, int aTier, int aAmperage, + String aDescription, int aInputSlotCount, int aOutputSlotCount, String aGUIName, String aNEIName, ITexture... aOverlays) { super( aID, @@ -104,16 +84,8 @@ public abstract class GT_MetaTileEntity_DeluxeMachine extends GT_MetaTileEntity_ mNEIName = aNEIName; } - public GT_MetaTileEntity_DeluxeMachine( - String aName, - int aTier, - int aAmperage, - String aDescription, - ITexture[][][] aTextures, - int aInputSlotCount, - int aOutputSlotCount, - String aGUIName, - String aNEIName) { + public GT_MetaTileEntity_DeluxeMachine(String aName, int aTier, int aAmperage, String aDescription, + ITexture[][][] aTextures, int aInputSlotCount, int aOutputSlotCount, String aGUIName, String aNEIName) { super(aName, aTier, OTHER_SLOT_COUNT + aInputSlotCount + aOutputSlotCount + 1, aDescription, aTextures); mInputSlotCount = Math.max(0, aInputSlotCount); mOutputItems = new ItemStack[Math.max(0, aOutputSlotCount)]; @@ -137,13 +109,10 @@ public abstract class GT_MetaTileEntity_DeluxeMachine extends GT_MetaTileEntity_ ITexture[][][] rTextures = new ITexture[14][17][]; aTextures = Arrays.copyOf(aTextures, 14); - for (int i = 0; i < aTextures.length; i++) - if (aTextures[i] != null) - for (byte c = -1; c < 16; c++) { - if (rTextures[i][c + 1] == null) - rTextures[i][c + 1] = - new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[mTier][c + 1], aTextures[i]}; - } + for (int i = 0; i < aTextures.length; i++) if (aTextures[i] != null) for (byte c = -1; c < 16; c++) { + if (rTextures[i][c + 1] == null) rTextures[i][c + 1] = new ITexture[] { + Textures.BlockIcons.MACHINE_CASINGS[mTier][c + 1], aTextures[i] }; + } for (byte c = -1; c < 16; c++) { if (rTextures[0][c + 1] == null) rTextures[0][c + 1] = getSideFacingActive(c); @@ -165,28 +134,16 @@ public abstract class GT_MetaTileEntity_DeluxeMachine extends GT_MetaTileEntity_ } @Override - public ITexture[] getTexture( - IGregTechTileEntity aBaseMetaTileEntity, - byte aSide, - byte aFacing, - byte aColorIndex, - boolean aActive, - boolean aRedstone) { - return mTextures[ - mMainFacing < 2 - ? aSide == aFacing - ? aActive ? 2 : 3 - : aSide == 0 ? aActive ? 6 : 7 : aSide == 1 ? aActive ? 4 : 5 : aActive ? 0 : 1 - : aSide == mMainFacing - ? aActive ? 2 : 3 - : (showPipeFacing() && aSide == aFacing) - ? aSide == 0 - ? aActive ? 8 : 9 - : aSide == 1 ? aActive ? 10 : 11 : aActive ? 12 : 13 - : aSide == 0 - ? aActive ? 6 : 7 - : aSide == 1 ? aActive ? 4 : 5 : aActive ? 0 : 1][ - aColorIndex + 1]; + public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, + boolean aActive, boolean aRedstone) { + return mTextures[mMainFacing < 2 + ? aSide == aFacing ? aActive ? 2 : 3 + : aSide == 0 ? aActive ? 6 : 7 : aSide == 1 ? aActive ? 4 : 5 : aActive ? 0 : 1 + : aSide == mMainFacing ? aActive ? 2 : 3 + : (showPipeFacing() && aSide == aFacing) + ? aSide == 0 ? aActive ? 8 : 9 : aSide == 1 ? aActive ? 10 : 11 : aActive ? 12 : 13 + : aSide == 0 ? aActive ? 6 : 7 + : aSide == 1 ? aActive ? 4 : 5 : aActive ? 0 : 1][aColorIndex + 1]; } @Override @@ -211,8 +168,7 @@ public abstract class GT_MetaTileEntity_DeluxeMachine extends GT_MetaTileEntity_ @Override public boolean isValidSlot(int aIndex) { - return aIndex > 0 - && super.isValidSlot(aIndex) + return aIndex > 0 && super.isValidSlot(aIndex) && aIndex != OTHER_SLOT_COUNT + mInputSlotCount + mOutputItems.length; } @@ -243,9 +199,7 @@ public abstract class GT_MetaTileEntity_DeluxeMachine extends GT_MetaTileEntity_ @Override public boolean isLiquidInput(byte aSide) { - return aSide != mMainFacing - && (mAllowInputFromOutputSide - || aSide != getBaseMetaTileEntity().getFrontFacing()); + return aSide != mMainFacing && (mAllowInputFromOutputSide || aSide != getBaseMetaTileEntity().getFrontFacing()); } @Override @@ -336,8 +290,7 @@ public abstract class GT_MetaTileEntity_DeluxeMachine extends GT_MetaTileEntity_ @Override public boolean isFluidInputAllowed(FluidStack aFluid) { - return getFillableStack() != null - || (getRecipeList() != null && getRecipeList().containsInput(aFluid)); + return getFillableStack() != null || (getRecipeList() != null && getRecipeList().containsInput(aFluid)); } @Override @@ -416,9 +369,8 @@ public abstract class GT_MetaTileEntity_DeluxeMachine extends GT_MetaTileEntity_ if (mOutputFluid != null) aNBT.setTag("mOutputFluid", mOutputFluid.writeToNBT(new NBTTagCompound())); if (mFluidOut != null) aNBT.setTag("mFluidOut", mFluidOut.writeToNBT(new NBTTagCompound())); - for (int i = 0; i < mOutputItems.length; i++) - if (mOutputItems[i] != null) - aNBT.setTag("mOutputItem" + i, mOutputItems[i].writeToNBT(new NBTTagCompound())); + for (int i = 0; i < mOutputItems.length; i++) if (mOutputItems[i] != null) + aNBT.setTag("mOutputItem" + i, mOutputItems[i].writeToNBT(new NBTTagCompound())); } @Override @@ -457,9 +409,9 @@ public abstract class GT_MetaTileEntity_DeluxeMachine extends GT_MetaTileEntity_ if (mProgresstime < 0 || drainEnergyForProcess(mEUt)) { if (++mProgresstime >= mMaxProgresstime) { for (int i = 0; i < mOutputItems.length; i++) - for (int j = 0; j < mOutputItems.length; j++) - if (aBaseMetaTileEntity.addStackToSlot( - getOutputSlot() + ((j + i) % mOutputItems.length), mOutputItems[i])) break; + for (int j = 0; j < mOutputItems.length; j++) if (aBaseMetaTileEntity + .addStackToSlot(getOutputSlot() + ((j + i) % mOutputItems.length), mOutputItems[i])) + break; if (mOutputFluid != null) if (getDrainableStack() == null) setDrainableStack(mOutputFluid.copy()); else if (mOutputFluid.isFluidEqual(getDrainableStack())) @@ -475,15 +427,14 @@ public abstract class GT_MetaTileEntity_DeluxeMachine extends GT_MetaTileEntity_ } if (mProgresstime > 5) mStuttering = false; XSTR aXSTR = new XSTR(); - if (false && aXSTR.nextInt(5000) == 0) - GT_Utility.sendSoundToPlayers( - aBaseMetaTileEntity.getWorld(), - GregTech_API.sSoundList.get(5), - 10.0F, - -1.0F, - aBaseMetaTileEntity.getXCoord(), - aBaseMetaTileEntity.getYCoord(), - aBaseMetaTileEntity.getZCoord()); + if (false && aXSTR.nextInt(5000) == 0) GT_Utility.sendSoundToPlayers( + aBaseMetaTileEntity.getWorld(), + GregTech_API.sSoundList.get(5), + 10.0F, + -1.0F, + aBaseMetaTileEntity.getXCoord(), + aBaseMetaTileEntity.getYCoord(), + aBaseMetaTileEntity.getZCoord()); } else { if (!mStuttering) { stutterProcess(); @@ -498,8 +449,7 @@ public abstract class GT_MetaTileEntity_DeluxeMachine extends GT_MetaTileEntity_ boolean tRemovedOutputFluid = false; Logger.WARNING("R0"); - if (doesAutoOutputFluids() - && getDrainableStack() != null + if (doesAutoOutputFluids() && getDrainableStack() != null && aBaseMetaTileEntity.getFrontFacing() != mMainFacing && (tSucceeded || aTick % 20 == 0)) { IFluidHandler tTank = aBaseMetaTileEntity.getITankContainerAtSide(aBaseMetaTileEntity.getFrontFacing()); @@ -507,28 +457,26 @@ public abstract class GT_MetaTileEntity_DeluxeMachine extends GT_MetaTileEntity_ FluidStack tDrained = drain(1000, false); if (tDrained != null) { int tFilledAmount = tTank.fill( - ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()), tDrained, false); - if (tFilledAmount > 0) - tTank.fill( - ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()), - drain(tFilledAmount, true), - true); + ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()), + tDrained, + false); + if (tFilledAmount > 0) tTank.fill( + ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()), + drain(tFilledAmount, true), + true); } } if (getDrainableStack() == null) tRemovedOutputFluid = true; } - if (doesAutoOutput() - && !isOutputEmpty() + if (doesAutoOutput() && !isOutputEmpty() && aBaseMetaTileEntity.getFrontFacing() != mMainFacing - && (tSucceeded - || mOutputBlocked % 300 == 1 + && (tSucceeded || mOutputBlocked % 300 == 1 || aBaseMetaTileEntity.hasInventoryBeenModified() || aTick % 600 == 0)) { TileEntity tTileEntity2 = aBaseMetaTileEntity.getTileEntityAtSide(aBaseMetaTileEntity.getFrontFacing()); - for (int i = 0, tCosts = 1; - i < mOutputItems.length && tCosts > 0 && aBaseMetaTileEntity.isUniversalEnergyStored(128); - i++) { + for (int i = 0, tCosts = 1; i < mOutputItems.length && tCosts > 0 + && aBaseMetaTileEntity.isUniversalEnergyStored(128); i++) { tCosts = GT_Utility.moveOneItemStack( aBaseMetaTileEntity, tTileEntity2, @@ -544,9 +492,8 @@ public abstract class GT_MetaTileEntity_DeluxeMachine extends GT_MetaTileEntity_ } } - if (mOutputBlocked != 0) - if (isOutputEmpty()) mOutputBlocked = 0; - else mOutputBlocked++; + if (mOutputBlocked != 0) if (isOutputEmpty()) mOutputBlocked = 0; + else mOutputBlocked++; Logger.WARNING("R1"); if (allowToCheckRecipe()) { Logger.WARNING("R2--------------------------------------------------"); @@ -564,10 +511,8 @@ public abstract class GT_MetaTileEntity_DeluxeMachine extends GT_MetaTileEntity_ Logger.WARNING("R2--------------------------------------------------"); Logger.WARNING("R2-hasEnoughEnergyToCheckRecipe(): " + hasEnoughEnergyToCheckRecipe()); Logger.WARNING("R2--------------------------------------------------"); - if (mMaxProgresstime <= 0 - && aBaseMetaTileEntity.isAllowedToWork() - && (tRemovedOutputFluid - || tSucceeded + if (mMaxProgresstime <= 0 && aBaseMetaTileEntity.isAllowedToWork() + && (tRemovedOutputFluid || tSucceeded || aBaseMetaTileEntity.hasInventoryBeenModified() || aTick % 600 == 0 || aBaseMetaTileEntity.hasWorkJustBeenEnabled()) @@ -620,8 +565,8 @@ public abstract class GT_MetaTileEntity_DeluxeMachine extends GT_MetaTileEntity_ if (ItemList.Display_Fluid.isStackEqual(mInventory[tDisplayStackSlot], true, true)) mInventory[tDisplayStackSlot] = null; } else { - mInventory[tDisplayStackSlot] = - GT_Utility.getFluidDisplayStack(getFillableStack(), displaysStackSize()); + mInventory[tDisplayStackSlot] = GT_Utility + .getFluidDisplayStack(getFillableStack(), displaysStackSize()); } } } @@ -667,32 +612,27 @@ public abstract class GT_MetaTileEntity_DeluxeMachine extends GT_MetaTileEntity_ } protected boolean canOutput(GT_Recipe aRecipe) { - return aRecipe != null - && (aRecipe.mNeedsEmptyOutput - ? isOutputEmpty() && getDrainableStack() == null - : canOutput(aRecipe.getFluidOutput(0)) && canOutput(aRecipe.mOutputs)); + return aRecipe != null && (aRecipe.mNeedsEmptyOutput ? isOutputEmpty() && getDrainableStack() == null + : canOutput(aRecipe.getFluidOutput(0)) && canOutput(aRecipe.mOutputs)); } protected boolean canOutput(ItemStack... aOutputs) { if (aOutputs == null) return true; ItemStack[] tOutputSlots = getAllOutputs(); for (int i = 0; i < tOutputSlots.length && i < aOutputs.length; i++) - if (tOutputSlots[i] != null - && aOutputs[i] != null + if (tOutputSlots[i] != null && aOutputs[i] != null && (!GT_Utility.areStacksEqual(tOutputSlots[i], aOutputs[i], false) || tOutputSlots[i].stackSize + aOutputs[i].stackSize > tOutputSlots[i].getMaxStackSize())) { - mOutputBlocked++; - return false; - } + mOutputBlocked++; + return false; + } return true; } protected boolean canOutput(FluidStack aOutput) { - return getDrainableStack() == null - || aOutput == null - || (getDrainableStack().isFluidEqual(aOutput) - && (getDrainableStack().amount <= 0 - || getDrainableStack().amount + aOutput.amount <= getCapacity())); + return getDrainableStack() == null || aOutput == null + || (getDrainableStack().isFluidEqual(aOutput) && (getDrainableStack().amount <= 0 + || getDrainableStack().amount + aOutput.amount <= getCapacity())); } protected ItemStack getInputAt(int aIndex) { @@ -792,15 +732,9 @@ public abstract class GT_MetaTileEntity_DeluxeMachine extends GT_MetaTileEntity_ @Override public String[] getInfoData() { - return new String[] { - mNEIName, - "Progress:", - (mProgresstime / 20) + " secs", - (mMaxProgresstime / 20) + " secs", - "Stored Energy:", - getBaseMetaTileEntity().getStoredEU() + "EU", - getBaseMetaTileEntity().getEUCapacity() + "EU" - }; + return new String[] { mNEIName, "Progress:", (mProgresstime / 20) + " secs", (mMaxProgresstime / 20) + " secs", + "Stored Energy:", getBaseMetaTileEntity().getStoredEU() + "EU", + getBaseMetaTileEntity().getEUCapacity() + "EU" }; } @Override @@ -814,17 +748,15 @@ public abstract class GT_MetaTileEntity_DeluxeMachine extends GT_MetaTileEntity_ mAllowInputFromOutputSide = !mAllowInputFromOutputSide; GT_Utility.sendChatToPlayer( aPlayer, - mAllowInputFromOutputSide - ? ("Input from Output Side allowed") + mAllowInputFromOutputSide ? ("Input from Output Side allowed") : ("Input from Output Side forbidden")); } } @Override public boolean allowCoverOnSide(byte aSide, GT_ItemStack aCoverID) { - return (aSide != mMainFacing - || GregTech_API.getCoverBehavior(aCoverID.toStack()) - .isGUIClickable(aSide, GT_Utility.stackToInt(aCoverID.toStack()), 0, getBaseMetaTileEntity())); + return (aSide != mMainFacing || GregTech_API.getCoverBehavior(aCoverID.toStack()) + .isGUIClickable(aSide, GT_Utility.stackToInt(aCoverID.toStack()), 0, getBaseMetaTileEntity())); } @Override @@ -834,10 +766,10 @@ public abstract class GT_MetaTileEntity_DeluxeMachine extends GT_MetaTileEntity_ @Override public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { - if (aSide == mMainFacing - || aIndex < getInputSlot() + if (aSide == mMainFacing || aIndex < getInputSlot() || aIndex >= getInputSlot() + mInputSlotCount - || (!mAllowInputFromOutputSide && aSide == aBaseMetaTileEntity.getFrontFacing())) return false; + || (!mAllowInputFromOutputSide && aSide == aBaseMetaTileEntity.getFrontFacing())) + return false; for (int i = getInputSlot(), j = i + mInputSlotCount; i < j; i++) if (GT_Utility.areStacksEqual(GT_OreDictUnificator.get(aStack), mInventory[i])) return i == aIndex; return true; @@ -851,7 +783,8 @@ public abstract class GT_MetaTileEntity_DeluxeMachine extends GT_MetaTileEntity_ } /** - * Override this to check the Recipes yourself, super calls to this could be useful if you just want to add a special case + * Override this to check the Recipes yourself, super calls to this could be useful if you just want to add a + * special case * <p/> * I thought about Enum too, but Enum doesn't add support for people adding other return Systems. * <p/> @@ -885,13 +818,12 @@ public abstract class GT_MetaTileEntity_DeluxeMachine extends GT_MetaTileEntity_ mLastRecipe, false, V[mTier], - new FluidStack[] {getFillableStack()}, + new FluidStack[] { getFillableStack() }, getSpecialSlot(), getAllInputs()); if (tRecipe == null) return DID_NOT_FIND_RECIPE; - if (false - && tRecipe.mSpecialValue == -100 + if (false && tRecipe.mSpecialValue == -100 && !isValidForLowGravity(tRecipe, getBaseMetaTileEntity().getWorld().provider.dimensionId)) return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; if (tRecipe.mCanBeBuffered) mLastRecipe = tRecipe; @@ -899,7 +831,7 @@ public abstract class GT_MetaTileEntity_DeluxeMachine extends GT_MetaTileEntity_ mOutputBlocked++; return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; } - if (!tRecipe.isRecipeInputEqual(true, new FluidStack[] {getFillableStack()}, getAllInputs())) + if (!tRecipe.isRecipeInputEqual(true, new FluidStack[] { getFillableStack() }, getAllInputs())) return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; for (int i = 0; i < mOutputItems.length; i++) if (getBaseMetaTileEntity().getRandomNumber(10000) < tRecipe.getOutputChance(i)) @@ -910,76 +842,64 @@ public abstract class GT_MetaTileEntity_DeluxeMachine extends GT_MetaTileEntity_ } public ITexture[] getSideFacingActive(byte aColor) { - return new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1]}; + return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1] }; } public ITexture[] getSideFacingInactive(byte aColor) { - return new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1]}; + return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1] }; } public ITexture[] getFrontFacingActive(byte aColor) { - return new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1]}; + return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1] }; } public ITexture[] getFrontFacingInactive(byte aColor) { - return new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1]}; + return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1] }; } public ITexture[] getTopFacingActive(byte aColor) { - return new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1]}; + return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1] }; } public ITexture[] getTopFacingInactive(byte aColor) { - return new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1]}; + return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1] }; } public ITexture[] getBottomFacingActive(byte aColor) { - return new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1]}; + return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1] }; } public ITexture[] getBottomFacingInactive(byte aColor) { - return new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1]}; + return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1] }; } public ITexture[] getBottomFacingPipeActive(byte aColor) { - return new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], - new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT) - }; + return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], + new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT) }; } public ITexture[] getBottomFacingPipeInactive(byte aColor) { - return new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], - new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT) - }; + return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], + new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT) }; } public ITexture[] getTopFacingPipeActive(byte aColor) { - return new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], - new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT) - }; + return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], + new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT) }; } public ITexture[] getTopFacingPipeInactive(byte aColor) { - return new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], - new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT) - }; + return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], + new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT) }; } public ITexture[] getSideFacingPipeActive(byte aColor) { - return new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], - new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT) - }; + return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], + new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT) }; } public ITexture[] getSideFacingPipeInactive(byte aColor) { - return new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], - new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT) - }; + return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], + new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT) }; } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_DeluxeTank.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_DeluxeTank.java index 50c2237209..f57293f03c 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_DeluxeTank.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_DeluxeTank.java @@ -1,14 +1,15 @@ package gtPlusPlus.xmod.gregtech.api.metatileentity.implementations; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraftforge.fluids.FluidStack; + import gregtech.api.enums.ItemList; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicTank; import gregtech.api.util.GT_Utility; import gtPlusPlus.api.objects.Logger; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraftforge.fluids.FluidStack; /** * NEVER INCLUDE THIS FILE IN YOUR MOD!!! @@ -22,23 +23,13 @@ public abstract class GT_MetaTileEntity_DeluxeTank extends GT_MetaTileEntity_Bas /** * @param aInvSlotCount should be 3 */ - public GT_MetaTileEntity_DeluxeTank( - final int aID, - final String aName, - final String aNameRegional, - final int aTier, - final int aInvSlotCount, - final String aDescription, - final ITexture... aTextures) { + public GT_MetaTileEntity_DeluxeTank(final int aID, final String aName, final String aNameRegional, final int aTier, + final int aInvSlotCount, final String aDescription, final ITexture... aTextures) { super(aID, aName, aNameRegional, aTier, aInvSlotCount, aDescription, aTextures); } - public GT_MetaTileEntity_DeluxeTank( - final String aName, - final int aTier, - final int aInvSlotCount, - final String aDescription, - final ITexture[][][] aTextures) { + public GT_MetaTileEntity_DeluxeTank(final String aName, final int aTier, final int aInvSlotCount, + final String aDescription, final ITexture[][][] aTextures) { super(aName, aTier, aInvSlotCount, aDescription, aTextures); } @@ -164,35 +155,32 @@ public abstract class GT_MetaTileEntity_DeluxeTank extends GT_MetaTileEntity_Bas @Override public void onPreTick(final IGregTechTileEntity aBaseMetaTileEntity, final long aTick) { if (aBaseMetaTileEntity.isServerSide()) { - if (this.isFluidChangingAllowed() - && (this.getFillableStack() != null) + if (this.isFluidChangingAllowed() && (this.getFillableStack() != null) && (this.getFillableStack().amount <= 0)) { this.setFillableStack(null); } - if (this.displaysItemStack() - && (this.getStackDisplaySlot() >= 0) + if (this.displaysItemStack() && (this.getStackDisplaySlot() >= 0) && (this.getStackDisplaySlot() < this.mInventory.length)) { if (this.getDisplayedFluid() == null) { if (ItemList.Display_Fluid.isStackEqual(this.mInventory[this.getStackDisplaySlot()], true, true)) { this.mInventory[this.getStackDisplaySlot()] = null; } } else { - this.mInventory[this.getStackDisplaySlot()] = - GT_Utility.getFluidDisplayStack(this.getDisplayedFluid(), this.displaysStackSize()); + this.mInventory[this.getStackDisplaySlot()] = GT_Utility + .getFluidDisplayStack(this.getDisplayedFluid(), this.displaysStackSize()); } } - if (this.displaysItemStack() - && (this.getStackDisplaySlot2() >= 0) + if (this.displaysItemStack() && (this.getStackDisplaySlot2() >= 0) && (this.getStackDisplaySlot2() < this.mInventory.length)) { if (this.getDrainableStackEx(2) == null) { if (ItemList.Display_Fluid.isStackEqual(this.mInventory[this.getStackDisplaySlot2()], true, true)) { this.mInventory[this.getStackDisplaySlot2()] = null; } } else { - this.mInventory[this.getStackDisplaySlot2()] = - GT_Utility.getFluidDisplayStack(this.getDrainableStackEx(2), this.displaysStackSize()); + this.mInventory[this.getStackDisplaySlot2()] = GT_Utility + .getFluidDisplayStack(this.getDrainableStackEx(2), this.displaysStackSize()); } } @@ -223,39 +211,43 @@ public abstract class GT_MetaTileEntity_DeluxeTank extends GT_MetaTileEntity_Bas } } } - } else if (tFluid.isFluidEqual(this.getDrainableStackEx(2)) - || (this.getDrainableStackEx(2) == null)) { - if (this.getFillableStackEx(2) == null) { - if (this.isFluidInputAllowed(tFluid) && (tFluid.amount <= this.getCapacity())) { - if (aBaseMetaTileEntity.addStackToSlot( - this.getOutputSlot(), - GT_Utility.getContainerItem(this.mInventory[this.getInputSlot()], true), - 1)) { - this.setFillableStack2(tFluid.copy()); - aBaseMetaTileEntity.decrStackSize(this.getInputSlot(), 1); + } else + if (tFluid.isFluidEqual(this.getDrainableStackEx(2)) || (this.getDrainableStackEx(2) == null)) { + if (this.getFillableStackEx(2) == null) { + if (this.isFluidInputAllowed(tFluid) && (tFluid.amount <= this.getCapacity())) { + if (aBaseMetaTileEntity.addStackToSlot( + this.getOutputSlot(), + GT_Utility.getContainerItem(this.mInventory[this.getInputSlot()], true), + 1)) { + this.setFillableStack2(tFluid.copy()); + aBaseMetaTileEntity.decrStackSize(this.getInputSlot(), 1); + } } - } - } else { - if (tFluid.isFluidEqual(this.getFillableStackEx(2)) - && ((tFluid.amount + this.getFillableStackEx(2).amount) <= this.getCapacity())) { - if (aBaseMetaTileEntity.addStackToSlot( - this.getOutputSlot(), - GT_Utility.getContainerItem(this.mInventory[this.getInputSlot()], true), - 1)) { - this.getFillableStackEx(2).amount += tFluid.amount; - aBaseMetaTileEntity.decrStackSize(this.getInputSlot(), 1); + } else { + if (tFluid.isFluidEqual(this.getFillableStackEx(2)) + && ((tFluid.amount + this.getFillableStackEx(2).amount) + <= this.getCapacity())) { + if (aBaseMetaTileEntity.addStackToSlot( + this.getOutputSlot(), + GT_Utility.getContainerItem(this.mInventory[this.getInputSlot()], true), + 1)) { + this.getFillableStackEx(2).amount += tFluid.amount; + aBaseMetaTileEntity.decrStackSize(this.getInputSlot(), 1); + } } } + } else { + Logger.INFO("Something broke when trying to empty cells between two fluid tank areas."); } - } else { - Logger.INFO("Something broke when trying to empty cells between two fluid tank areas."); - } } } if (this.doesFillContainers()) { final ItemStack tOutput = GT_Utility.fillFluidContainer( - this.getDrainableStack(), this.mInventory[this.getInputSlot()], false, true); + this.getDrainableStack(), + this.mInventory[this.getInputSlot()], + false, + true); if ((tOutput != null) && aBaseMetaTileEntity.addStackToSlot(this.getOutputSlot(), tOutput, 1)) { final FluidStack tFluid = GT_Utility.getFluidForFilledItem(tOutput, true); aBaseMetaTileEntity.decrStackSize(this.getInputSlot(), 1); @@ -282,16 +274,14 @@ public abstract class GT_MetaTileEntity_DeluxeTank extends GT_MetaTileEntity_Bas @Override public int fill(final FluidStack aFluid, final boolean doFill) { - if ((aFluid == null) - || (aFluid.getFluid().getID() <= 0) + if ((aFluid == null) || (aFluid.getFluid().getID() <= 0) || (aFluid.amount <= 0) || !this.canTankBeFilled() || !this.isFluidInputAllowed(aFluid)) { return 0; } - if ((this.getFillableStack() == null) - || (this.getFillableStack().getFluid().getID() <= 0)) { + if ((this.getFillableStack() == null) || (this.getFillableStack().getFluid().getID() <= 0)) { if (aFluid.amount <= this.getCapacity()) { if (doFill) { this.setFillableStack(aFluid.copy()); @@ -358,14 +348,14 @@ public abstract class GT_MetaTileEntity_DeluxeTank extends GT_MetaTileEntity_Bas } @Override - public boolean allowPullStack( - final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, final ItemStack aStack) { + public boolean allowPullStack(final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, + final ItemStack aStack) { return aIndex == this.getOutputSlot(); } @Override - public boolean allowPutStack( - final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, final ItemStack aStack) { + public boolean allowPutStack(final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, + final ItemStack aStack) { return aIndex == this.getInputSlot(); } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_AirIntake.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_AirIntake.java index 6a49e9b84d..cc0bec1026 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_AirIntake.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_AirIntake.java @@ -1,23 +1,24 @@ package gtPlusPlus.xmod.gregtech.api.metatileentity.implementations; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.fluids.Fluid; + import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.util.minecraft.FluidUtils; -import net.minecraft.world.World; -import net.minecraftforge.common.util.ForgeDirection; -import net.minecraftforge.fluids.Fluid; public class GT_MetaTileEntity_Hatch_AirIntake extends GT_MetaTileEntity_Hatch_FluidGenerator { - public GT_MetaTileEntity_Hatch_AirIntake( - final int aID, final String aName, final String aNameRegional, final int aTier) { + public GT_MetaTileEntity_Hatch_AirIntake(final int aID, final String aName, final String aNameRegional, + final int aTier) { super(aID, aName, aNameRegional, aTier); } - public GT_MetaTileEntity_Hatch_AirIntake( - final String aName, final int aTier, final String aDescription, final ITexture[][][] aTextures) { + public GT_MetaTileEntity_Hatch_AirIntake(final String aName, final int aTier, final String aDescription, + final ITexture[][][] aTextures) { super(aName, aTier, aDescription, aTextures); } @@ -56,8 +57,7 @@ public class GT_MetaTileEntity_Hatch_AirIntake extends GT_MetaTileEntity_Hatch_F @Override public boolean doesHatchMeetConditionsToGenerate() { - return this.getBaseMetaTileEntity() - .getAirAtSide(this.getBaseMetaTileEntity().getFrontFacing()); + return this.getBaseMetaTileEntity().getAirAtSide(this.getBaseMetaTileEntity().getFrontFacing()); } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_AirIntake_Extreme.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_AirIntake_Extreme.java index ca640b7a1d..bfc9cc7fc6 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_AirIntake_Extreme.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_AirIntake_Extreme.java @@ -6,13 +6,13 @@ import gregtech.api.metatileentity.MetaTileEntity; public class GT_MetaTileEntity_Hatch_AirIntake_Extreme extends GT_MetaTileEntity_Hatch_AirIntake { - public GT_MetaTileEntity_Hatch_AirIntake_Extreme( - final int aID, final String aName, final String aNameRegional, final int aTier) { + public GT_MetaTileEntity_Hatch_AirIntake_Extreme(final int aID, final String aName, final String aNameRegional, + final int aTier) { super(aID, aName, aNameRegional, aTier); } - public GT_MetaTileEntity_Hatch_AirIntake_Extreme( - final String aName, final int aTier, final String aDescription, final ITexture[][][] aTextures) { + public GT_MetaTileEntity_Hatch_AirIntake_Extreme(final String aName, final int aTier, final String aDescription, + final ITexture[][][] aTextures) { super(aName, aTier, aDescription, aTextures); } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_ControlCore.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_ControlCore.java index 37037f7bbb..5fb855c572 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_ControlCore.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_ControlCore.java @@ -1,7 +1,12 @@ package gtPlusPlus.xmod.gregtech.api.metatileentity.implementations; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; + import com.gtnewhorizons.modularui.api.screen.ModularWindow; import com.gtnewhorizons.modularui.api.screen.UIBuildContext; + import gregtech.api.gui.*; import gregtech.api.gui.modularui.GT_UIInfos; import gregtech.api.interfaces.ITexture; @@ -16,9 +21,6 @@ import gtPlusPlus.core.item.general.ItemControlCore; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.xmod.gregtech.common.StaticFields59; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; public class GT_MetaTileEntity_Hatch_ControlCore extends GT_MetaTileEntity_Hatch { @@ -40,24 +42,24 @@ public class GT_MetaTileEntity_Hatch_ControlCore extends GT_MetaTileEntity_Hatch super(aName, aTier, aTier < 1 ? 1 : aTier == 1 ? 4 : aTier == 2 ? 9 : 16, aDescription, aTextures); } - public GT_MetaTileEntity_Hatch_ControlCore( - String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) { + public GT_MetaTileEntity_Hatch_ControlCore(String aName, int aTier, String[] aDescription, + ITexture[][][] aTextures) { super(aName, aTier, aTier < 1 ? 1 : aTier == 1 ? 4 : aTier == 2 ? 9 : 16, aDescription[0], aTextures); } @Override public String[] getDescription() { - return new String[] {this.mDescription, CORE.GT_Tooltip}; + return new String[] { this.mDescription, CORE.GT_Tooltip }; } @Override public ITexture[] getTexturesActive(ITexture aBaseTexture) { - return new ITexture[] {aBaseTexture, new GT_RenderedTexture(TexturesGtBlock.Overlay_Hatch_Control_Core)}; + return new ITexture[] { aBaseTexture, new GT_RenderedTexture(TexturesGtBlock.Overlay_Hatch_Control_Core) }; } @Override public ITexture[] getTexturesInactive(ITexture aBaseTexture) { - return new ITexture[] {aBaseTexture, new GT_RenderedTexture(TexturesGtBlock.Overlay_Hatch_Control_Core)}; + return new ITexture[] { aBaseTexture, new GT_RenderedTexture(TexturesGtBlock.Overlay_Hatch_Control_Core) }; } @Override @@ -83,7 +85,10 @@ public class GT_MetaTileEntity_Hatch_ControlCore extends GT_MetaTileEntity_Hatch @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new GT_MetaTileEntity_Hatch_ControlCore( - mName, mTier, StaticFields59.getDescriptionArray(this), mTextures); + mName, + mTier, + StaticFields59.getDescriptionArray(this), + mTextures); } @Override @@ -107,19 +112,18 @@ public class GT_MetaTileEntity_Hatch_ControlCore extends GT_MetaTileEntity_Hatch protected void fillStacksIntoFirstSlots() { for (int i = 0; i < mInventory.length; i++) - for (int j = i + 1; j < mInventory.length; j++) - if (mInventory[j] != null - && (mInventory[i] == null || GT_Utility.areStacksEqual(mInventory[i], mInventory[j]))) { - GT_Utility.moveStackFromSlotAToSlotB( - getBaseMetaTileEntity(), - getBaseMetaTileEntity(), - j, - i, - (byte) 64, - (byte) 1, - (byte) 64, - (byte) 1); - } + for (int j = i + 1; j < mInventory.length; j++) if (mInventory[j] != null + && (mInventory[i] == null || GT_Utility.areStacksEqual(mInventory[i], mInventory[j]))) { + GT_Utility.moveStackFromSlotAToSlotB( + getBaseMetaTileEntity(), + getBaseMetaTileEntity(), + j, + i, + (byte) 64, + (byte) 1, + (byte) 64, + (byte) 1); + } } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_DynamoBuffer.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_DynamoBuffer.java index 8405e2b09c..c9ab1e48a0 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_DynamoBuffer.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_DynamoBuffer.java @@ -10,27 +10,28 @@ import gtPlusPlus.core.util.Utils; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; public class GT_MetaTileEntity_Hatch_DynamoBuffer extends GT_MetaTileEntity_Hatch_Dynamo { - public GT_MetaTileEntity_Hatch_DynamoBuffer( - final int aID, final String aName, final String aNameRegional, final int aTier) { + + public GT_MetaTileEntity_Hatch_DynamoBuffer(final int aID, final String aName, final String aNameRegional, + final int aTier) { super(aID, aName, aNameRegional, aTier); } - public GT_MetaTileEntity_Hatch_DynamoBuffer( - final String aName, final int aTier, final String aDescription, final ITexture[][][] aTextures) { + public GT_MetaTileEntity_Hatch_DynamoBuffer(final String aName, final int aTier, final String aDescription, + final ITexture[][][] aTextures) { super(aName, aTier, aDescription, aTextures); } - /*public GT_MetaTileEntity_Hatch_DynamoBuffer(final String aName, final int aTier, final String[] aDescription, - final ITexture[][][] aTextures) { - super(aName, aTier, aDescription, aTextures); - }*/ + /* + * public GT_MetaTileEntity_Hatch_DynamoBuffer(final String aName, final int aTier, final String[] aDescription, + * final ITexture[][][] aTextures) { super(aName, aTier, aDescription, aTextures); } + */ public ITexture[] getTexturesActive(final ITexture aBaseTexture) { - return new ITexture[] {aBaseTexture, TexturesGtBlock.OVERLAYS_ENERGY_OUT_MULTI_BUFFER[this.mTier]}; + return new ITexture[] { aBaseTexture, TexturesGtBlock.OVERLAYS_ENERGY_OUT_MULTI_BUFFER[this.mTier] }; } public ITexture[] getTexturesInactive(final ITexture aBaseTexture) { - return new ITexture[] {aBaseTexture, TexturesGtBlock.OVERLAYS_ENERGY_OUT_MULTI_BUFFER[this.mTier]}; + return new ITexture[] { aBaseTexture, TexturesGtBlock.OVERLAYS_ENERGY_OUT_MULTI_BUFFER[this.mTier] }; } @Override @@ -45,30 +46,26 @@ public class GT_MetaTileEntity_Hatch_DynamoBuffer extends GT_MetaTileEntity_Hatc @Override public MetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) { - return (MetaTileEntity) - new GT_MetaTileEntity_Hatch_DynamoBuffer(this.mName, this.mTier, this.mDescription, this.mTextures); + return (MetaTileEntity) new GT_MetaTileEntity_Hatch_DynamoBuffer( + this.mName, + this.mTier, + this.mDescription, + this.mTextures); } @Override public String[] getDescription() { String[] g; if (CORE.GTNH || (CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK && Utils.getGregtechVersionAsInt() >= 50932)) { - g = new String[] { - "Dynamo with internal storage and additional Amp capacity", - "Does not accept more than " + (this.maxEUOutput() * this.maxAmperesIn()) + "EU/t as input", - CORE.GT_Tooltip - }; + g = new String[] { "Dynamo with internal storage and additional Amp capacity", + "Does not accept more than " + (this.maxEUOutput() * this.maxAmperesIn()) + "EU/t as input", + CORE.GT_Tooltip }; } else { - g = new String[] { - "Dynamo with internal storage and additional Amp capacity", - "Stores " + maxEUStore() + "EU", - "Amperage In: 4", - "Amperage Out: 4", - "Does not accept more than " + (this.maxEUOutput() * this.maxAmperesIn()) + "EU/t as input", - "Large Turbines only supply 1A to this, other Multiblocks can inject more amps", - CORE.GT_Tooltip - }; + g = new String[] { "Dynamo with internal storage and additional Amp capacity", + "Stores " + maxEUStore() + "EU", "Amperage In: 4", "Amperage Out: 4", + "Does not accept more than " + (this.maxEUOutput() * this.maxAmperesIn()) + "EU/t as input", + "Large Turbines only supply 1A to this, other Multiblocks can inject more amps", CORE.GT_Tooltip }; } return g; } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_ElementalDataOrbHolder.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_ElementalDataOrbHolder.java index 964bc8adcf..fc80f604b3 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_ElementalDataOrbHolder.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_ElementalDataOrbHolder.java @@ -1,8 +1,15 @@ package gtPlusPlus.xmod.gregtech.api.metatileentity.implementations; +import java.util.ArrayList; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; + import com.gtnewhorizons.modularui.api.screen.ModularWindow; import com.gtnewhorizons.modularui.api.screen.UIBuildContext; import com.gtnewhorizons.modularui.common.widget.SlotGroup; + import gregtech.api.enums.ItemList; import gregtech.api.gui.modularui.GT_UIInfos; import gregtech.api.gui.modularui.GT_UITextures; @@ -18,42 +25,41 @@ import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.util.minecraft.ItemUtils; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; -import java.util.ArrayList; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; public class GT_MetaTileEntity_Hatch_ElementalDataOrbHolder extends GT_MetaTileEntity_Hatch implements IConfigurationCircuitSupport { + public GT_Recipe_Map mRecipeMap = null; public GT_MetaTileEntity_Hatch_ElementalDataOrbHolder(int aID, String aName, String aNameRegional, int aTier) { - super(aID, aName, aNameRegional, aTier, 17, new String[] { - "Holds Data Orbs for the Elemental Duplicator", - "Can insert/extract the circuit slot", - "Use Circuit to select a slot (1-16)", - CORE.GT_Tooltip - }); - } - - public GT_MetaTileEntity_Hatch_ElementalDataOrbHolder( - String aName, int aTier, String aDescription, ITexture[][][] aTextures) { + super( + aID, + aName, + aNameRegional, + aTier, + 17, + new String[] { "Holds Data Orbs for the Elemental Duplicator", "Can insert/extract the circuit slot", + "Use Circuit to select a slot (1-16)", CORE.GT_Tooltip }); + } + + public GT_MetaTileEntity_Hatch_ElementalDataOrbHolder(String aName, int aTier, String aDescription, + ITexture[][][] aTextures) { super(aName, aTier, 17, aDescription, aTextures); } - public GT_MetaTileEntity_Hatch_ElementalDataOrbHolder( - String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) { + public GT_MetaTileEntity_Hatch_ElementalDataOrbHolder(String aName, int aTier, String[] aDescription, + ITexture[][][] aTextures) { super(aName, aTier, 17, aDescription, aTextures); } @Override public ITexture[] getTexturesActive(ITexture aBaseTexture) { - return new ITexture[] {aBaseTexture, new GT_RenderedTexture(TexturesGtBlock.Overlay_Hatch_Data_Orb)}; + return new ITexture[] { aBaseTexture, new GT_RenderedTexture(TexturesGtBlock.Overlay_Hatch_Data_Orb) }; } @Override public ITexture[] getTexturesInactive(ITexture aBaseTexture) { - return new ITexture[] {aBaseTexture, new GT_RenderedTexture(TexturesGtBlock.Overlay_Hatch_Data_Orb)}; + return new ITexture[] { aBaseTexture, new GT_RenderedTexture(TexturesGtBlock.Overlay_Hatch_Data_Orb) }; } @Override @@ -128,8 +134,7 @@ public class GT_MetaTileEntity_Hatch_ElementalDataOrbHolder extends GT_MetaTileE @Override public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { Logger.INFO("Checking if we can pull " + aStack.getDisplayName() + " from slot " + aIndex); - if (aIndex == mInventory.length - 1 - && ItemUtils.isControlCircuit(aStack) + if (aIndex == mInventory.length - 1 && ItemUtils.isControlCircuit(aStack) && aSide == getBaseMetaTileEntity().getFrontFacing()) { return true; } @@ -139,8 +144,7 @@ public class GT_MetaTileEntity_Hatch_ElementalDataOrbHolder extends GT_MetaTileE @Override public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { Logger.INFO("Checking if we can put " + aStack.getDisplayName() + " into slot " + aIndex); - if (aIndex == mInventory.length - 1 - && ItemUtils.isControlCircuit(aStack) + if (aIndex == mInventory.length - 1 && ItemUtils.isControlCircuit(aStack) && aSide == getBaseMetaTileEntity().getFrontFacing()) { return true; } @@ -158,8 +162,7 @@ public class GT_MetaTileEntity_Hatch_ElementalDataOrbHolder extends GT_MetaTileE @Override public boolean canInsertItem(int aIndex, ItemStack aStack, int aSide) { - if (aIndex == mInventory.length - 1 - && ItemUtils.isControlCircuit(aStack) + if (aIndex == mInventory.length - 1 && ItemUtils.isControlCircuit(aStack) && aSide == getBaseMetaTileEntity().getFrontFacing()) { Logger.INFO("Putting " + aStack.getDisplayName() + " into slot " + aIndex); return true; @@ -203,13 +206,12 @@ public class GT_MetaTileEntity_Hatch_ElementalDataOrbHolder extends GT_MetaTileE @Override public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildContext) { - builder.widget(SlotGroup.ofItemHandler(inventoryHandler, 4) - .startFromSlot(0) - .endAtSlot(15) - .background(getGUITextureSet().getItemSlot(), GT_UITextures.OVERLAY_SLOT_DATA_ORB) - .applyForWidget( - widget -> widget.setFilter(stack -> ItemList.Tool_DataOrb.isStackEqual(stack, false, true))) - .build() - .setPos(52, 7)); + builder.widget( + SlotGroup.ofItemHandler(inventoryHandler, 4).startFromSlot(0).endAtSlot(15) + .background(getGUITextureSet().getItemSlot(), GT_UITextures.OVERLAY_SLOT_DATA_ORB) + .applyForWidget( + widget -> widget + .setFilter(stack -> ItemList.Tool_DataOrb.isStackEqual(stack, false, true))) + .build().setPos(52, 7)); } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Energy_RTG.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Energy_RTG.java index 7f291533a9..0d35795cb3 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Energy_RTG.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Energy_RTG.java @@ -2,8 +2,16 @@ package gtPlusPlus.xmod.gregtech.api.metatileentity.implementations; import static gregtech.api.enums.GT_Values.V; +import java.util.HashMap; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; + import com.gtnewhorizons.modularui.api.screen.ModularWindow; import com.gtnewhorizons.modularui.api.screen.UIBuildContext; + import gregtech.api.gui.modularui.GT_UIInfos; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; @@ -14,23 +22,22 @@ import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.util.minecraft.InventoryUtils; import gtPlusPlus.core.util.minecraft.ItemUtils; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; -import java.util.HashMap; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; public class GT_MetaTileEntity_Hatch_Energy_RTG extends GT_MetaTileEntity_Hatch_Energy { - public GT_MetaTileEntity_Hatch_Energy_RTG( - int aID, String aName, String aNameRegional, int aTier, int aInvSlotCount) { - super(aID, aName, aNameRegional, aTier, aInvSlotCount, new String[] { - "Energy Injector for Multiblocks", "Accepts up to 2 Amps" - }); + public GT_MetaTileEntity_Hatch_Energy_RTG(int aID, String aName, String aNameRegional, int aTier, + int aInvSlotCount) { + super( + aID, + aName, + aNameRegional, + aTier, + aInvSlotCount, + new String[] { "Energy Injector for Multiblocks", "Accepts up to 2 Amps" }); } - public GT_MetaTileEntity_Hatch_Energy_RTG( - String aName, int aTier, int aInvSlotCount, String[] aDescription, ITexture[][][] aTextures) { + public GT_MetaTileEntity_Hatch_Energy_RTG(String aName, int aTier, int aInvSlotCount, String[] aDescription, + ITexture[][][] aTextures) { super(aName, aTier, aInvSlotCount, aDescription, aTextures); } @@ -45,18 +52,14 @@ public class GT_MetaTileEntity_Hatch_Energy_RTG extends GT_MetaTileEntity_Hatch_ @Override public ITexture[] getTexturesActive(ITexture aBaseTexture) { - return new ITexture[] { - aBaseTexture, - TexturesGtBlock.getTextureFromIcon(TexturesGtBlock.Overlay_Hatch_RTG_On, new short[] {220, 220, 220, 0}) - }; + return new ITexture[] { aBaseTexture, TexturesGtBlock + .getTextureFromIcon(TexturesGtBlock.Overlay_Hatch_RTG_On, new short[] { 220, 220, 220, 0 }) }; } @Override public ITexture[] getTexturesInactive(ITexture aBaseTexture) { - return new ITexture[] { - aBaseTexture, - TexturesGtBlock.getTextureFromIcon(TexturesGtBlock.Overlay_Hatch_RTG_Off, new short[] {220, 220, 220, 0}) - }; + return new ITexture[] { aBaseTexture, TexturesGtBlock + .getTextureFromIcon(TexturesGtBlock.Overlay_Hatch_RTG_Off, new short[] { 220, 220, 220, 0 }) }; } @Override @@ -139,8 +142,8 @@ public class GT_MetaTileEntity_Hatch_Energy_RTG extends GT_MetaTileEntity_Hatch_ public Dat(ItemStack aStack) { mStack = aStack; mNBT = (aStack.getTagCompound() != null ? aStack.getTagCompound() : new NBTTagCompound()); - mUniqueDataTag = "" + Item.getIdFromItem(aStack.getItem()) + "" + aStack.getItemDamage() + "" + 1 + "" - + mNBT.getId(); + mUniqueDataTag = "" + Item + .getIdFromItem(aStack.getItem()) + "" + aStack.getItemDamage() + "" + 1 + "" + mNBT.getId(); } public int getKey() { @@ -165,8 +168,9 @@ public class GT_MetaTileEntity_Hatch_Energy_RTG extends GT_MetaTileEntity_Hatch_ mFuelValueMap.put(aKey, aFuelValue); mFuelTypeMap.put(aKey, aDat.getKey()); mFuelTypeMapReverse.put(aDat.getKey(), aKey); - Logger.INFO("RTG Hatch: Registered Fuel Pellet: " + ItemUtils.getItemName(aTemp) + ", Fuel Value: " + aFuelValue - + ", Key: " + aKey + ", Key2: " + aDat.getKey()); + Logger.INFO( + "RTG Hatch: Registered Fuel Pellet: " + ItemUtils.getItemName( + aTemp) + ", Fuel Value: " + aFuelValue + ", Key: " + aKey + ", Key2: " + aDat.getKey()); return true; } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_FluidGenerator.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_FluidGenerator.java index b11b3bc78e..86cddb8220 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_FluidGenerator.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_FluidGenerator.java @@ -1,5 +1,15 @@ package gtPlusPlus.xmod.gregtech.api.metatileentity.implementations; +import java.lang.reflect.Field; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidStack; + import gregtech.api.enums.Textures; import gregtech.api.interfaces.IIconContainer; import gregtech.api.interfaces.ITexture; @@ -12,27 +22,19 @@ import gtPlusPlus.api.objects.random.XSTR; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.util.minecraft.FluidUtils; import gtPlusPlus.core.util.reflect.ReflectionUtils; -import java.lang.reflect.Field; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.world.World; -import net.minecraftforge.common.util.ForgeDirection; -import net.minecraftforge.fluids.Fluid; -import net.minecraftforge.fluids.FluidStack; public abstract class GT_MetaTileEntity_Hatch_FluidGenerator extends GT_MetaTileEntity_Hatch_Input { protected static XSTR floatGen = new XSTR(); public int mProgresstime = 0, mMaxProgresstime = 0; - public GT_MetaTileEntity_Hatch_FluidGenerator( - final int aID, final String aName, final String aNameRegional, final int aTier) { + public GT_MetaTileEntity_Hatch_FluidGenerator(final int aID, final String aName, final String aNameRegional, + final int aTier) { super(aID, aName, aNameRegional, aTier); } - public GT_MetaTileEntity_Hatch_FluidGenerator( - final String aName, final int aTier, final String aDescription, final ITexture[][][] aTextures) { + public GT_MetaTileEntity_Hatch_FluidGenerator(final String aName, final int aTier, final String aDescription, + final ITexture[][][] aTextures) { super(aName, aTier, aDescription, aTextures); } @@ -61,7 +63,7 @@ public abstract class GT_MetaTileEntity_Hatch_FluidGenerator extends GT_MetaTile if (o instanceof String[]) { S = (String[]) o; } else if (o instanceof String) { - S = new String[] {(String) o}; + S = new String[] { (String) o }; } } } @@ -85,19 +87,17 @@ public abstract class GT_MetaTileEntity_Hatch_FluidGenerator extends GT_MetaTile t.printStackTrace(); } - return new String[] {"Broken Tooltip - Report on Github"}; + return new String[] { "Broken Tooltip - Report on Github" }; } public ITexture[] getTexturesActive(final ITexture aBaseTexture) { - return new ITexture[] { - aBaseTexture, new GT_RenderedTexture((IIconContainer) Textures.BlockIcons.OVERLAY_MUFFLER) - }; + return new ITexture[] { aBaseTexture, + new GT_RenderedTexture((IIconContainer) Textures.BlockIcons.OVERLAY_MUFFLER) }; } public ITexture[] getTexturesInactive(final ITexture aBaseTexture) { - return new ITexture[] { - aBaseTexture, new GT_RenderedTexture((IIconContainer) Textures.BlockIcons.OVERLAY_MUFFLER) - }; + return new ITexture[] { aBaseTexture, + new GT_RenderedTexture((IIconContainer) Textures.BlockIcons.OVERLAY_MUFFLER) }; } public boolean isSimpleMachine() { @@ -118,13 +118,13 @@ public abstract class GT_MetaTileEntity_Hatch_FluidGenerator extends GT_MetaTile public abstract MetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity); - public boolean allowPullStack( - final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, final ItemStack aStack) { + public boolean allowPullStack(final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, + final ItemStack aStack) { return false; } - public boolean allowPutStack( - final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, final ItemStack aStack) { + public boolean allowPutStack(final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, + final ItemStack aStack) { return false; } @@ -198,9 +198,8 @@ public abstract class GT_MetaTileEntity_Hatch_FluidGenerator extends GT_MetaTile // Logger.INFO("To add: "+this.getAmountOfFluidToGenerate()); // Logger.INFO("Space Free: "+(this.getCapacity()-this.getFluidAmount())); } - if (this.mFluid == null - || (this.mFluid != null - && (this.getCapacity() - this.getFluidAmount() >= this.getAmountOfFluidToGenerate()))) { + if (this.mFluid == null || (this.mFluid != null + && (this.getCapacity() - this.getFluidAmount() >= this.getAmountOfFluidToGenerate()))) { return true; } return false; @@ -218,8 +217,7 @@ public abstract class GT_MetaTileEntity_Hatch_FluidGenerator extends GT_MetaTile @Override public int fill(FluidStack aFluid, boolean doFill) { - if (aFluid == null - || aFluid.getFluid().getID() <= 0 + if (aFluid == null || aFluid.getFluid().getID() <= 0 || aFluid.amount <= 0 || aFluid.getFluid() != getFluidToGenerate() || !canTankBeFilled()) { diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_InputBattery.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_InputBattery.java index 03ba69a7cc..af9dab15ff 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_InputBattery.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_InputBattery.java @@ -2,8 +2,12 @@ package gtPlusPlus.xmod.gregtech.api.metatileentity.implementations; import static gregtech.api.enums.GT_Values.V; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; + import com.gtnewhorizons.modularui.api.screen.ModularWindow; import com.gtnewhorizons.modularui.api.screen.UIBuildContext; + import gregtech.api.enums.GT_Values; import gregtech.api.gui.modularui.GT_UIInfos; import gregtech.api.interfaces.ITexture; @@ -17,18 +21,17 @@ import gregtech.api.util.GT_Utility; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.xmod.gregtech.api.gui.widget.ElectricSlotWidget; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; public class GT_MetaTileEntity_Hatch_InputBattery extends GT_MetaTileEntity_Hatch { + public final GT_Recipe_Map mRecipeMap = null; public GT_MetaTileEntity_Hatch_InputBattery(int aID, String aName, String aNameRegional, int aTier) { super(aID, aName, aNameRegional, aTier, getSlots(aTier), "Chargeable Item Bus for Multiblocks"); } - public GT_MetaTileEntity_Hatch_InputBattery( - String aName, int aTier, String aDescription, ITexture[][][] aTextures) { + public GT_MetaTileEntity_Hatch_InputBattery(String aName, int aTier, String aDescription, + ITexture[][][] aTextures) { super(aName, aTier, aTier < 1 ? 1 : aTier == 1 ? 4 : aTier == 2 ? 4 : 16, aDescription, aTextures); } @@ -42,7 +45,7 @@ public class GT_MetaTileEntity_Hatch_InputBattery extends GT_MetaTileEntity_Hatc } else { mSlots = 16; } - return new String[] {this.mDescription, "Capacity: " + mSlots + " slots", CORE.GT_Tooltip}; + return new String[] { this.mDescription, "Capacity: " + mSlots + " slots", CORE.GT_Tooltip }; } @Override @@ -77,12 +80,12 @@ public class GT_MetaTileEntity_Hatch_InputBattery extends GT_MetaTileEntity_Hatc @Override public ITexture[] getTexturesActive(ITexture aBaseTexture) { - return new ITexture[] {aBaseTexture, new GT_RenderedTexture(TexturesGtBlock.Overlay_Hatch_Charger)}; + return new ITexture[] { aBaseTexture, new GT_RenderedTexture(TexturesGtBlock.Overlay_Hatch_Charger) }; } @Override public ITexture[] getTexturesInactive(ITexture aBaseTexture) { - return new ITexture[] {aBaseTexture, new GT_RenderedTexture(TexturesGtBlock.Overlay_Hatch_Charger)}; + return new ITexture[] { aBaseTexture, new GT_RenderedTexture(TexturesGtBlock.Overlay_Hatch_Charger) }; } @Override @@ -126,9 +129,7 @@ public class GT_MetaTileEntity_Hatch_InputBattery extends GT_MetaTileEntity_Hatc MetaTileEntity mMetaTileEntity = (MetaTileEntity) aBaseMetaTileEntity.getMetaTileEntity(); if (mMetaTileEntity.rechargerSlotCount() > 0 && aBaseMetaTileEntity.getStoredEU() > 0) { for (int i = mMetaTileEntity.rechargerSlotStartIndex(), - k = mMetaTileEntity.rechargerSlotCount() + i; - i < k; - i++) { + k = mMetaTileEntity.rechargerSlotCount() + i; i < k; i++) { if (aBaseMetaTileEntity.getStoredEU() > 0 && mMetaTileEntity.mInventory[i] != null) { for (int u = 0; u < 10; u++) { aBaseMetaTileEntity.decreaseStoredEnergyUnits( @@ -163,19 +164,18 @@ public class GT_MetaTileEntity_Hatch_InputBattery extends GT_MetaTileEntity_Hatc protected void fillStacksIntoFirstSlots() { for (int i = 0; i < mInventory.length; i++) - for (int j = i + 1; j < mInventory.length; j++) - if (mInventory[j] != null - && (mInventory[i] == null || GT_Utility.areStacksEqual(mInventory[i], mInventory[j]))) { - GT_Utility.moveStackFromSlotAToSlotB( - getBaseMetaTileEntity(), - getBaseMetaTileEntity(), - j, - i, - (byte) 64, - (byte) 1, - (byte) 64, - (byte) 1); - } + for (int j = i + 1; j < mInventory.length; j++) if (mInventory[j] != null + && (mInventory[i] == null || GT_Utility.areStacksEqual(mInventory[i], mInventory[j]))) { + GT_Utility.moveStackFromSlotAToSlotB( + getBaseMetaTileEntity(), + getBaseMetaTileEntity(), + j, + i, + (byte) 64, + (byte) 1, + (byte) 64, + (byte) 1); + } } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Muffler_Adv.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Muffler_Adv.java index f62e0c27e0..4ece1a69f9 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Muffler_Adv.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Muffler_Adv.java @@ -1,8 +1,14 @@ package gtPlusPlus.xmod.gregtech.api.metatileentity.implementations; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; + import com.gtnewhorizons.modularui.api.screen.ModularWindow; import com.gtnewhorizons.modularui.api.screen.UIBuildContext; import com.gtnewhorizons.modularui.common.widget.SlotWidget; + import gregtech.api.enums.GT_Values; import gregtech.api.gui.modularui.GT_UIInfos; import gregtech.api.gui.modularui.GUITextureSet; @@ -20,10 +26,6 @@ import gtPlusPlus.core.util.minecraft.gregtech.PollutionUtils; import gtPlusPlus.xmod.gregtech.api.gui.GTPP_UITextures; import gtPlusPlus.xmod.gregtech.common.StaticFields59; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import net.minecraftforge.common.util.ForgeDirection; public class GT_MetaTileEntity_Hatch_Muffler_Adv extends GT_MetaTileEntity_Hatch_Muffler implements IAddGregtechLogo { @@ -47,11 +49,11 @@ public class GT_MetaTileEntity_Hatch_Muffler_Adv extends GT_MetaTileEntity_Hatch private int mPollutionSmogLimit = 500000; public GT_MetaTileEntity_Hatch_Muffler_Adv(int aID, String aName, String aNameRegional, int aTier) { - super(aID, aName, aNameRegional, aTier, 1, new String[] {""}); + super(aID, aName, aNameRegional, aTier, 1, new String[] { "" }); } - public GT_MetaTileEntity_Hatch_Muffler_Adv( - String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) { + public GT_MetaTileEntity_Hatch_Muffler_Adv(String aName, int aTier, String[] aDescription, + ITexture[][][] aTextures) { super(aName, aTier, 1, aDescription, aTextures); } @@ -64,10 +66,10 @@ public class GT_MetaTileEntity_Hatch_Muffler_Adv extends GT_MetaTileEntity_Hatch desc[mDescArray.length + 1] = "Requires 3 Air on the exhaust face"; desc[mDescArray.length + 2] = "Requires Air Filters"; desc[mDescArray.length + 3] = "Mufflers require T2 Filters from IV-" + GT_Values.VN[9]; - desc[mDescArray.length + 4] = - "Reduces Pollution to " + this.calculatePollutionReductionForTooltip(100) + "%"; - desc[mDescArray.length + 5] = - "Recovers " + (105 - this.calculatePollutionReductionForTooltip(100)) + "% of CO2/CO/SO2"; + desc[mDescArray.length + 4] = "Reduces Pollution to " + this.calculatePollutionReductionForTooltip(100) + + "%"; + desc[mDescArray.length + 5] = "Recovers " + (105 - this.calculatePollutionReductionForTooltip(100)) + + "% of CO2/CO/SO2"; desc[mDescArray.length + 6] = CORE.GT_Tooltip; return desc; } else { @@ -76,11 +78,11 @@ public class GT_MetaTileEntity_Hatch_Muffler_Adv extends GT_MetaTileEntity_Hatch } public ITexture[] getTexturesActive(ITexture aBaseTexture) { - return new ITexture[] {aBaseTexture, new GT_RenderedTexture(TexturesGtBlock.Overlay_Hatch_Muffler_Adv)}; + return new ITexture[] { aBaseTexture, new GT_RenderedTexture(TexturesGtBlock.Overlay_Hatch_Muffler_Adv) }; } public ITexture[] getTexturesInactive(ITexture aBaseTexture) { - return new ITexture[] {aBaseTexture, new GT_RenderedTexture(TexturesGtBlock.Overlay_Hatch_Muffler_Adv)}; + return new ITexture[] { aBaseTexture, new GT_RenderedTexture(TexturesGtBlock.Overlay_Hatch_Muffler_Adv) }; } public boolean isValidSlot(int aIndex) { @@ -89,7 +91,10 @@ public class GT_MetaTileEntity_Hatch_Muffler_Adv extends GT_MetaTileEntity_Hatch public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new GT_MetaTileEntity_Hatch_Muffler_Adv( - this.mName, this.mTier, StaticFields59.getDescriptionArray(this), this.mTextures); + this.mName, + this.mTier, + StaticFields59.getDescriptionArray(this), + this.mTextures); } @Override @@ -99,8 +104,7 @@ public class GT_MetaTileEntity_Hatch_Muffler_Adv extends GT_MetaTileEntity_Hatch } private boolean airCheck() { - if (this.getBaseMetaTileEntity() - .getAirAtSide(this.getBaseMetaTileEntity().getFrontFacing()) + if (this.getBaseMetaTileEntity().getAirAtSide(this.getBaseMetaTileEntity().getFrontFacing()) && this.getBaseMetaTileEntity() .getAirAtSideAndDistance(this.getBaseMetaTileEntity().getFrontFacing(), 1) && this.getBaseMetaTileEntity() @@ -130,8 +134,7 @@ public class GT_MetaTileEntity_Hatch_Muffler_Adv extends GT_MetaTileEntity_Hatch double aVal1 = aPollution * Math.pow(0.64D, (double) (this.mTier - 1)); int aVal2 = (int) aVal1; if (!hasValidFilter()) { - aVal2 = (int) ((double) aPollution * Math.pow(0.7D, (double) (this.mTier - 1))); - ; + aVal2 = (int) ((double) aPollution * Math.pow(0.7D, (double) (this.mTier - 1)));; } return aVal2; } @@ -331,10 +334,8 @@ public class GT_MetaTileEntity_Hatch_Muffler_Adv extends GT_MetaTileEntity_Hatch @Override public GUITextureSet getGUITextureSet() { - return new GUITextureSet() - .setMainBackground(GTPP_UITextures.BACKGROUND_YELLOW) - .setItemSlot(GTPP_UITextures.SLOT_ITEM_YELLOW) - .setTitleTab( + return new GUITextureSet().setMainBackground(GTPP_UITextures.BACKGROUND_YELLOW) + .setItemSlot(GTPP_UITextures.SLOT_ITEM_YELLOW).setTitleTab( GTPP_UITextures.TAB_TITLE_YELLOW, GTPP_UITextures.TAB_TITLE_DARK_YELLOW, GTPP_UITextures.TAB_TITLE_ANGULAR_YELLOW); @@ -342,9 +343,8 @@ public class GT_MetaTileEntity_Hatch_Muffler_Adv extends GT_MetaTileEntity_Hatch @Override public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildContext) { - builder.widget(new SlotWidget(inventoryHandler, 0) - .setFilter(stack -> stack.getItem() instanceof ItemAirFilter) - .setBackground(getGUITextureSet().getItemSlot()) - .setPos(79, 34)); + builder.widget( + new SlotWidget(inventoryHandler, 0).setFilter(stack -> stack.getItem() instanceof ItemAirFilter) + .setBackground(getGUITextureSet().getItemSlot()).setPos(79, 34)); } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Naquadah.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Naquadah.java index 350b7a788a..54cf8f1366 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Naquadah.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Naquadah.java @@ -1,5 +1,11 @@ package gtPlusPlus.xmod.gregtech.api.metatileentity.implementations; +import java.lang.reflect.Field; + +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import net.minecraftforge.fluids.FluidStack; + import gregtech.api.enums.Materials; import gregtech.api.enums.Textures; import gregtech.api.enums.Textures.BlockIcons; @@ -13,10 +19,6 @@ import gregtech.api.util.GT_Utility; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.util.reflect.ReflectionUtils; import gtPlusPlus.xmod.gregtech.common.StaticFields59; -import java.lang.reflect.Field; -import net.minecraft.item.ItemStack; -import net.minecraft.util.EnumChatFormatting; -import net.minecraftforge.fluids.FluidStack; public class GT_MetaTileEntity_Hatch_Naquadah extends GT_MetaTileEntity_Hatch_Input { @@ -29,15 +31,15 @@ public class GT_MetaTileEntity_Hatch_Naquadah extends GT_MetaTileEntity_Hatch_In initHatch(); } - public GT_MetaTileEntity_Hatch_Naquadah( - final String aName, final String aDescription, final ITexture[][][] aTextures) { + public GT_MetaTileEntity_Hatch_Naquadah(final String aName, final String aDescription, + final ITexture[][][] aTextures) { super(aName, 6, aDescription, aTextures); mFluidCapacity = 32000; initHatch(); } - public GT_MetaTileEntity_Hatch_Naquadah( - final String aName, final String[] aDescription, final ITexture[][][] aTextures) { + public GT_MetaTileEntity_Hatch_Naquadah(final String aName, final String[] aDescription, + final ITexture[][][] aTextures) { super(aName, 6, aDescription[0], aTextures); mFluidCapacity = 32000; initHatch(); @@ -56,20 +58,17 @@ public class GT_MetaTileEntity_Hatch_Naquadah extends GT_MetaTileEntity_Hatch_In } public ITexture[] getTexturesActive(final ITexture aBaseTexture) { - return new ITexture[] { - aBaseTexture, - new GT_RenderedTexture((IIconContainer) Textures.BlockIcons.NAQUADAH_REACTOR_FLUID_SIDE_ACTIVE) - }; + return new ITexture[] { aBaseTexture, + new GT_RenderedTexture((IIconContainer) Textures.BlockIcons.NAQUADAH_REACTOR_FLUID_SIDE_ACTIVE) }; } public ITexture[] getTexturesInactive(final ITexture aBaseTexture) { - return new ITexture[] { - aBaseTexture, new GT_RenderedTexture((IIconContainer) Textures.BlockIcons.NAQUADAH_REACTOR_FLUID_SIDE) - }; + return new ITexture[] { aBaseTexture, + new GT_RenderedTexture((IIconContainer) Textures.BlockIcons.NAQUADAH_REACTOR_FLUID_SIDE) }; } - public boolean allowPutStack( - final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, final ItemStack aStack) { + public boolean allowPutStack(final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, + final ItemStack aStack) { if (aSide == aBaseMetaTileEntity.getFrontFacing() && aIndex == 0) { for (FluidStack f : mFluidsToUse) { if (f != null) { @@ -115,14 +114,9 @@ public class GT_MetaTileEntity_Hatch_Naquadah extends GT_MetaTileEntity_Hatch_In String aNaq = aDescCache[0]; String aEnrNaq = aDescCache[1]; String aNaquad = aDescCache[2]; - String[] s2 = new String[] { - "Fluid Input for Multiblocks", - "Capacity: " + getCapacity() + "L", - "Accepted Fluid: " + aNaq, - "Accepted Fluid: " + aEnrNaq, - "Accepted Fluid: " + aNaquad, - CORE.GT_Tooltip - }; + String[] s2 = new String[] { "Fluid Input for Multiblocks", "Capacity: " + getCapacity() + "L", + "Accepted Fluid: " + aNaq, "Accepted Fluid: " + aEnrNaq, "Accepted Fluid: " + aNaquad, + CORE.GT_Tooltip }; return s2; } @@ -130,8 +124,7 @@ public class GT_MetaTileEntity_Hatch_Naquadah extends GT_MetaTileEntity_Hatch_In private String formatFluidString(FluidStack f) { FluidStack mLockedStack = f; - Integer mLockedTemp = 0; - ; + Integer mLockedTemp = 0;; String mTempMod = "" + EnumChatFormatting.RESET; mLockedTemp = mLockedStack.getFluid().getTemperature(); if (mLockedTemp != null) { @@ -168,13 +161,8 @@ public class GT_MetaTileEntity_Hatch_Naquadah extends GT_MetaTileEntity_Hatch_In private Field F1, F2; @Override - public ITexture[] getTexture( - IGregTechTileEntity aBaseMetaTileEntity, - byte aSide, - byte aFacing, - byte aColorIndex, - boolean aActive, - boolean aRedstone) { + public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, + boolean aActive, boolean aRedstone) { byte a1 = 0, a2 = 0; try { if (F1 == null) { @@ -190,32 +178,26 @@ public class GT_MetaTileEntity_Hatch_Naquadah extends GT_MetaTileEntity_Hatch_In if (F2 != null) { a2 = F2.getByte(this); } - } catch (IllegalArgumentException | IllegalAccessException n) { - } + } catch (IllegalArgumentException | IllegalAccessException n) {} int textureIndex = a1 | a2 << 7; byte texturePointer = (byte) (a1 & 127); if (aSide == 1 || aSide == 0) { - ITexture g = textureIndex > 0 - ? StaticFields59.getCasingTexturePages(a2, texturePointer) + ITexture g = textureIndex > 0 ? StaticFields59.getCasingTexturePages(a2, texturePointer) : BlockIcons.MACHINE_CASINGS[this.mTier][aColorIndex + 1]; - return new ITexture[] { - g, new GT_RenderedTexture((IIconContainer) Textures.BlockIcons.NAQUADAH_REACTOR_FLUID_TOP_ACTIVE) - }; + return new ITexture[] { g, + new GT_RenderedTexture((IIconContainer) Textures.BlockIcons.NAQUADAH_REACTOR_FLUID_TOP_ACTIVE) }; } return aSide != aFacing - ? (textureIndex > 0 - ? new ITexture[] {StaticFields59.getCasingTexturePages(a2, texturePointer)} - : new ITexture[] {BlockIcons.MACHINE_CASINGS[this.mTier][aColorIndex + 1]}) + ? (textureIndex > 0 ? new ITexture[] { StaticFields59.getCasingTexturePages(a2, texturePointer) } + : new ITexture[] { BlockIcons.MACHINE_CASINGS[this.mTier][aColorIndex + 1] }) : (textureIndex > 0 - ? (aActive - ? this.getTexturesActive(StaticFields59.getCasingTexturePages(a2, texturePointer)) + ? (aActive ? this.getTexturesActive(StaticFields59.getCasingTexturePages(a2, texturePointer)) : this.getTexturesInactive(StaticFields59.getCasingTexturePages(a2, texturePointer))) - : (aActive - ? this.getTexturesActive(BlockIcons.MACHINE_CASINGS[this.mTier][aColorIndex + 1]) + : (aActive ? this.getTexturesActive(BlockIcons.MACHINE_CASINGS[this.mTier][aColorIndex + 1]) : this.getTexturesInactive(BlockIcons.MACHINE_CASINGS[this.mTier][aColorIndex + 1]))); } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_OutputBattery.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_OutputBattery.java index 101a310506..10b9af5cc9 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_OutputBattery.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_OutputBattery.java @@ -2,8 +2,12 @@ package gtPlusPlus.xmod.gregtech.api.metatileentity.implementations; import static gregtech.api.enums.GT_Values.V; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; + import com.gtnewhorizons.modularui.api.screen.ModularWindow; import com.gtnewhorizons.modularui.api.screen.UIBuildContext; + import gregtech.api.gui.modularui.GT_UIInfos; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; @@ -15,16 +19,15 @@ import gregtech.api.util.GT_Utility; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.xmod.gregtech.api.gui.widget.ElectricSlotWidget; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; public class GT_MetaTileEntity_Hatch_OutputBattery extends GT_MetaTileEntity_Hatch { + public GT_MetaTileEntity_Hatch_OutputBattery(int aID, String aName, String aNameRegional, int aTier) { super(aID, aName, aNameRegional, aTier, getSlots(aTier), "Dischargeable Item Bus for Multiblocks"); } - public GT_MetaTileEntity_Hatch_OutputBattery( - String aName, int aTier, String aDescription, ITexture[][][] aTextures) { + public GT_MetaTileEntity_Hatch_OutputBattery(String aName, int aTier, String aDescription, + ITexture[][][] aTextures) { super(aName, aTier, aTier < 1 ? 1 : aTier == 1 ? 4 : aTier == 2 ? 9 : 16, aDescription, aTextures); } @@ -38,7 +41,7 @@ public class GT_MetaTileEntity_Hatch_OutputBattery extends GT_MetaTileEntity_Hat } else { mSlots = 16; } - return new String[] {this.mDescription, "Capacity: " + mSlots + " slots", CORE.GT_Tooltip}; + return new String[] { this.mDescription, "Capacity: " + mSlots + " slots", CORE.GT_Tooltip }; } @Override @@ -68,12 +71,12 @@ public class GT_MetaTileEntity_Hatch_OutputBattery extends GT_MetaTileEntity_Hat @Override public ITexture[] getTexturesActive(ITexture aBaseTexture) { - return new ITexture[] {aBaseTexture, new GT_RenderedTexture(TexturesGtBlock.Overlay_Hatch_Discharger)}; + return new ITexture[] { aBaseTexture, new GT_RenderedTexture(TexturesGtBlock.Overlay_Hatch_Discharger) }; } @Override public ITexture[] getTexturesInactive(ITexture aBaseTexture) { - return new ITexture[] {aBaseTexture, new GT_RenderedTexture(TexturesGtBlock.Overlay_Hatch_Discharger)}; + return new ITexture[] { aBaseTexture, new GT_RenderedTexture(TexturesGtBlock.Overlay_Hatch_Discharger) }; } @Override @@ -125,19 +128,18 @@ public class GT_MetaTileEntity_Hatch_OutputBattery extends GT_MetaTileEntity_Hat protected void fillStacksIntoFirstSlots() { for (int i = 0; i < mInventory.length; i++) - for (int j = i + 1; j < mInventory.length; j++) - if (mInventory[j] != null - && (mInventory[i] == null || GT_Utility.areStacksEqual(mInventory[i], mInventory[j]))) { - GT_Utility.moveStackFromSlotAToSlotB( - getBaseMetaTileEntity(), - getBaseMetaTileEntity(), - j, - i, - (byte) 64, - (byte) 1, - (byte) 64, - (byte) 1); - } + for (int j = i + 1; j < mInventory.length; j++) if (mInventory[j] != null + && (mInventory[i] == null || GT_Utility.areStacksEqual(mInventory[i], mInventory[j]))) { + GT_Utility.moveStackFromSlotAToSlotB( + getBaseMetaTileEntity(), + getBaseMetaTileEntity(), + j, + i, + (byte) 64, + (byte) 1, + (byte) 64, + (byte) 1); + } } @Override @@ -172,9 +174,7 @@ public class GT_MetaTileEntity_Hatch_OutputBattery extends GT_MetaTileEntity_Hat if (mMetaTileEntity.dechargerSlotCount() > 0 && mMetaTileEntity.getEUVar() < aBaseMetaTileEntity.getEUCapacity()) { for (int i = mMetaTileEntity.dechargerSlotStartIndex(), - k = mMetaTileEntity.dechargerSlotCount() + i; - i < k; - i++) { + k = mMetaTileEntity.dechargerSlotCount() + i; i < k; i++) { if (mMetaTileEntity.mInventory[i] != null && mMetaTileEntity.getEUVar() < aBaseMetaTileEntity.getEUCapacity()) { aBaseMetaTileEntity.increaseStoredEnergyUnits( diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Plasma.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Plasma.java index 7f09abf177..f7d769a285 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Plasma.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Plasma.java @@ -1,6 +1,15 @@ package gtPlusPlus.xmod.gregtech.api.metatileentity.implementations; +import java.lang.reflect.Field; + +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidRegistry; +import net.minecraftforge.fluids.FluidStack; + import com.google.common.collect.BiMap; + import gregtech.api.enums.Textures.BlockIcons; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; @@ -11,12 +20,6 @@ import gtPlusPlus.api.objects.data.AutoMap; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.util.reflect.ReflectionUtils; import gtPlusPlus.xmod.gregtech.common.StaticFields59; -import java.lang.reflect.Field; -import net.minecraft.item.ItemStack; -import net.minecraft.util.EnumChatFormatting; -import net.minecraftforge.fluids.Fluid; -import net.minecraftforge.fluids.FluidRegistry; -import net.minecraftforge.fluids.FluidStack; public class GT_MetaTileEntity_Hatch_Plasma extends GT_MetaTileEntity_Hatch_Output { @@ -30,15 +33,15 @@ public class GT_MetaTileEntity_Hatch_Plasma extends GT_MetaTileEntity_Hatch_Outp initHatch(); } - public GT_MetaTileEntity_Hatch_Plasma( - final String aName, final String aDescription, final ITexture[][][] aTextures) { + public GT_MetaTileEntity_Hatch_Plasma(final String aName, final String aDescription, + final ITexture[][][] aTextures) { super(aName, 6, aDescription, aTextures); mFluidCapacity = 256000; initHatch(); } - public GT_MetaTileEntity_Hatch_Plasma( - final String aName, final String[] aDescription, final ITexture[][][] aTextures) { + public GT_MetaTileEntity_Hatch_Plasma(final String aName, final String[] aDescription, + final ITexture[][][] aTextures) { super(aName, 6, aDescription[0], aTextures); mFluidCapacity = 256000; initHatch(); @@ -67,11 +70,9 @@ public class GT_MetaTileEntity_Hatch_Plasma extends GT_MetaTileEntity_Hatch_Outp } } } - } catch (ClassCastException e) { - } + } catch (ClassCastException e) {} } - } catch (IllegalArgumentException | IllegalAccessException e) { - } + } catch (IllegalArgumentException | IllegalAccessException e) {} } AutoMap<Fluid> mPlasmaCache = new AutoMap<Fluid>(); @@ -94,15 +95,15 @@ public class GT_MetaTileEntity_Hatch_Plasma extends GT_MetaTileEntity_Hatch_Outp } public ITexture[] getTexturesActive(final ITexture aBaseTexture) { - return new ITexture[] {aBaseTexture}; + return new ITexture[] { aBaseTexture }; } public ITexture[] getTexturesInactive(final ITexture aBaseTexture) { - return new ITexture[] {aBaseTexture}; + return new ITexture[] { aBaseTexture }; } - public boolean allowPutStack( - final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, final ItemStack aStack) { + public boolean allowPutStack(final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, + final ItemStack aStack) { if (aSide == aBaseMetaTileEntity.getFrontFacing() && aIndex == 0) { for (Fluid f : mFluidsToUse) { if (f != null) { @@ -148,10 +149,14 @@ public class GT_MetaTileEntity_Hatch_Plasma extends GT_MetaTileEntity_Hatch_Outp String aX = EnumChatFormatting.GRAY + ""; String a1 = EnumChatFormatting.GOLD + "Refined containment" + aX; String a2 = EnumChatFormatting.GOLD + "Capacity: " + EnumChatFormatting.DARK_AQUA + getCapacity() + "L" + aX; - String a3 = EnumChatFormatting.GOLD + "Supports " + EnumChatFormatting.DARK_RED + mTotalPlasmaSupported - + EnumChatFormatting.GOLD + " types of plasma" + aX; - - String[] s2 = new String[] {a1, a2, a3, CORE.GT_Tooltip}; + String a3 = EnumChatFormatting.GOLD + "Supports " + + EnumChatFormatting.DARK_RED + + mTotalPlasmaSupported + + EnumChatFormatting.GOLD + + " types of plasma" + + aX; + + String[] s2 = new String[] { a1, a2, a3, CORE.GT_Tooltip }; return s2; } @@ -169,13 +174,8 @@ public class GT_MetaTileEntity_Hatch_Plasma extends GT_MetaTileEntity_Hatch_Outp private Field F1, F2; @Override - public ITexture[] getTexture( - IGregTechTileEntity aBaseMetaTileEntity, - byte aSide, - byte aFacing, - byte aColorIndex, - boolean aActive, - boolean aRedstone) { + public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, + boolean aActive, boolean aRedstone) { byte a1 = 0, a2 = 0; try { if (F1 == null) { @@ -191,30 +191,25 @@ public class GT_MetaTileEntity_Hatch_Plasma extends GT_MetaTileEntity_Hatch_Outp if (F2 != null) { a2 = F2.getByte(this); } - } catch (IllegalArgumentException | IllegalAccessException n) { - } + } catch (IllegalArgumentException | IllegalAccessException n) {} int textureIndex = a1 | a2 << 7; byte texturePointer = (byte) (a1 & 127); if (aSide == 1 || aSide == 0) { - ITexture g = textureIndex > 0 - ? StaticFields59.getCasingTexturePages(a2, texturePointer) + ITexture g = textureIndex > 0 ? StaticFields59.getCasingTexturePages(a2, texturePointer) : BlockIcons.MACHINE_CASINGS[this.mTier][aColorIndex + 1]; - return new ITexture[] {g}; + return new ITexture[] { g }; } return aSide != aFacing - ? (textureIndex > 0 - ? new ITexture[] {StaticFields59.getCasingTexturePages(a2, texturePointer)} - : new ITexture[] {BlockIcons.MACHINE_CASINGS[this.mTier][aColorIndex + 1]}) + ? (textureIndex > 0 ? new ITexture[] { StaticFields59.getCasingTexturePages(a2, texturePointer) } + : new ITexture[] { BlockIcons.MACHINE_CASINGS[this.mTier][aColorIndex + 1] }) : (textureIndex > 0 - ? (aActive - ? this.getTexturesActive(StaticFields59.getCasingTexturePages(a2, texturePointer)) + ? (aActive ? this.getTexturesActive(StaticFields59.getCasingTexturePages(a2, texturePointer)) : this.getTexturesInactive(StaticFields59.getCasingTexturePages(a2, texturePointer))) - : (aActive - ? this.getTexturesActive(BlockIcons.MACHINE_CASINGS[this.mTier][aColorIndex + 1]) + : (aActive ? this.getTexturesActive(BlockIcons.MACHINE_CASINGS[this.mTier][aColorIndex + 1]) : this.getTexturesInactive(BlockIcons.MACHINE_CASINGS[this.mTier][aColorIndex + 1]))); } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Reservoir.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Reservoir.java index 0a2ccdb8e5..67827bcbf5 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Reservoir.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Reservoir.java @@ -1,12 +1,5 @@ package gtPlusPlus.xmod.gregtech.api.metatileentity.implementations; -import cpw.mods.fml.common.registry.GameRegistry; -import gregtech.api.interfaces.ITexture; -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gregtech.api.metatileentity.MetaTileEntity; -import gregtech.api.objects.GT_RenderedTexture; -import gtPlusPlus.core.lib.LoadedMods; -import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; import net.minecraft.block.Block; import net.minecraft.init.Blocks; import net.minecraft.tileentity.TileEntity; @@ -16,18 +9,26 @@ import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.IFluidHandler; +import cpw.mods.fml.common.registry.GameRegistry; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.MetaTileEntity; +import gregtech.api.objects.GT_RenderedTexture; +import gtPlusPlus.core.lib.LoadedMods; +import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; + public class GT_MetaTileEntity_Hatch_Reservoir extends GT_MetaTileEntity_Hatch_FluidGenerator { private static Block sBlock_EIO; private static Block sBlock_RIO; - public GT_MetaTileEntity_Hatch_Reservoir( - final int aID, final String aName, final String aNameRegional, final int aTier) { + public GT_MetaTileEntity_Hatch_Reservoir(final int aID, final String aName, final String aNameRegional, + final int aTier) { super(aID, aName, aNameRegional, aTier); } - public GT_MetaTileEntity_Hatch_Reservoir( - final String aName, final int aTier, final String aDescription, final ITexture[][][] aTextures) { + public GT_MetaTileEntity_Hatch_Reservoir(final String aName, final int aTier, final String aDescription, + final ITexture[][][] aTextures) { super(aName, aTier, aDescription, aTextures); } @@ -85,8 +86,7 @@ public class GT_MetaTileEntity_Hatch_Reservoir extends GT_MetaTileEntity_Hatch_F @Override public boolean doesHatchMeetConditionsToGenerate() { - Block aWater = this.getBaseMetaTileEntity() - .getBlockAtSide(this.getBaseMetaTileEntity().getFrontFacing()); + Block aWater = this.getBaseMetaTileEntity().getBlockAtSide(this.getBaseMetaTileEntity().getFrontFacing()); if (aWater != null && aWater != Blocks.air) { if (!this.canTankBeFilled()) { return false; @@ -94,18 +94,18 @@ public class GT_MetaTileEntity_Hatch_Reservoir extends GT_MetaTileEntity_Hatch_F setCrossModData(); if (LoadedMods.EnderIO) { if (aWater == sBlock_EIO) { - return isTileValid(this.getBaseMetaTileEntity() - .getTileEntityAtSide(this.getBaseMetaTileEntity().getFrontFacing())); + return isTileValid( + this.getBaseMetaTileEntity() + .getTileEntityAtSide(this.getBaseMetaTileEntity().getFrontFacing())); } } if (LoadedMods.RemoteIO) { if (aWater == sBlock_RIO - && this.getBaseMetaTileEntity() - .getMetaIDAtSide( - this.getBaseMetaTileEntity().getFrontFacing()) + && this.getBaseMetaTileEntity().getMetaIDAtSide(this.getBaseMetaTileEntity().getFrontFacing()) == 0) { - return isTileValid(this.getBaseMetaTileEntity() - .getTileEntityAtSide(this.getBaseMetaTileEntity().getFrontFacing())); + return isTileValid( + this.getBaseMetaTileEntity() + .getTileEntityAtSide(this.getBaseMetaTileEntity().getFrontFacing())); } } return aWater == Blocks.water || aWater == Blocks.flowing_water; @@ -117,10 +117,10 @@ public class GT_MetaTileEntity_Hatch_Reservoir extends GT_MetaTileEntity_Hatch_F public void generateParticles(World aWorld, String name) {} public ITexture[] getTexturesActive(final ITexture aBaseTexture) { - return new ITexture[] {aBaseTexture, new GT_RenderedTexture(TexturesGtBlock.Overlay_Water)}; + return new ITexture[] { aBaseTexture, new GT_RenderedTexture(TexturesGtBlock.Overlay_Water) }; } public ITexture[] getTexturesInactive(final ITexture aBaseTexture) { - return new ITexture[] {aBaseTexture, new GT_RenderedTexture(TexturesGtBlock.Overlay_Water)}; + return new ITexture[] { aBaseTexture, new GT_RenderedTexture(TexturesGtBlock.Overlay_Water) }; } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Steam_BusInput.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Steam_BusInput.java index 4be947d68e..eecef35269 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Steam_BusInput.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Steam_BusInput.java @@ -3,8 +3,13 @@ package gtPlusPlus.xmod.gregtech.api.metatileentity.implementations; import static gregtech.api.enums.Textures.BlockIcons.ITEM_IN_SIGN; import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_PIPE_IN; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; + import com.gtnewhorizons.modularui.api.screen.ModularWindow; import com.gtnewhorizons.modularui.api.screen.UIBuildContext; + import gregtech.GT_Mod; import gregtech.api.enums.Textures; import gregtech.api.gui.modularui.GT_UIInfos; @@ -18,46 +23,46 @@ import gregtech.api.util.GT_LanguageManager; import gregtech.api.util.GT_Recipe.GT_Recipe_Map; import gregtech.api.util.GT_Utility; import gtPlusPlus.core.lib.CORE; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; public class GT_MetaTileEntity_Hatch_Steam_BusInput extends GT_MetaTileEntity_Hatch { + public GT_Recipe_Map mRecipeMap = null; public boolean disableSort; public GT_MetaTileEntity_Hatch_Steam_BusInput(int aID, String aName, String aNameRegional, int aTier) { - super(aID, aName, aNameRegional, aTier, getSlots(aTier), new String[] { - "Item Input for Steam Multiblocks", - "Shift + right click with screwdriver to toggle automatic item shuffling", - "Capacity: 4 stacks", - "Does not work with non-steam multiblocks", - CORE.GT_Tooltip - }); - } - - public GT_MetaTileEntity_Hatch_Steam_BusInput( - String aName, int aTier, String aDescription, ITexture[][][] aTextures) { + super( + aID, + aName, + aNameRegional, + aTier, + getSlots(aTier), + new String[] { "Item Input for Steam Multiblocks", + "Shift + right click with screwdriver to toggle automatic item shuffling", "Capacity: 4 stacks", + "Does not work with non-steam multiblocks", CORE.GT_Tooltip }); + } + + public GT_MetaTileEntity_Hatch_Steam_BusInput(String aName, int aTier, String aDescription, + ITexture[][][] aTextures) { super(aName, aTier, 4, aDescription, aTextures); } - public GT_MetaTileEntity_Hatch_Steam_BusInput( - String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) { + public GT_MetaTileEntity_Hatch_Steam_BusInput(String aName, int aTier, String[] aDescription, + ITexture[][][] aTextures) { super(aName, aTier, 4, aDescription, aTextures); } @Override public ITexture[] getTexturesActive(ITexture aBaseTexture) { return GT_Mod.gregtechproxy.mRenderIndicatorsOnHatch - ? new ITexture[] {aBaseTexture, TextureFactory.of(OVERLAY_PIPE_IN), TextureFactory.of(ITEM_IN_SIGN)} - : new ITexture[] {aBaseTexture, TextureFactory.of(OVERLAY_PIPE_IN)}; + ? new ITexture[] { aBaseTexture, TextureFactory.of(OVERLAY_PIPE_IN), TextureFactory.of(ITEM_IN_SIGN) } + : new ITexture[] { aBaseTexture, TextureFactory.of(OVERLAY_PIPE_IN) }; } @Override public ITexture[] getTexturesInactive(ITexture aBaseTexture) { return GT_Mod.gregtechproxy.mRenderIndicatorsOnHatch - ? new ITexture[] {aBaseTexture, TextureFactory.of(OVERLAY_PIPE_IN), TextureFactory.of(ITEM_IN_SIGN)} - : new ITexture[] {aBaseTexture, TextureFactory.of(OVERLAY_PIPE_IN)}; + ? new ITexture[] { aBaseTexture, TextureFactory.of(OVERLAY_PIPE_IN), TextureFactory.of(ITEM_IN_SIGN) } + : new ITexture[] { aBaseTexture, TextureFactory.of(OVERLAY_PIPE_IN) }; } @Override @@ -110,18 +115,17 @@ public class GT_MetaTileEntity_Hatch_Steam_BusInput extends GT_MetaTileEntity_Ha if (mInventory[i] != null && mInventory[i].stackSize <= 0) mInventory[i] = null; } else { for (int i = 0; i < mInventory.length; i++) - for (int j = i + 1; j < mInventory.length; j++) - if (mInventory[j] != null - && (mInventory[i] == null || GT_Utility.areStacksEqual(mInventory[i], mInventory[j]))) - GT_Utility.moveStackFromSlotAToSlotB( - getBaseMetaTileEntity(), - getBaseMetaTileEntity(), - j, - i, - (byte) 64, - (byte) 1, - (byte) 64, - (byte) 1); + for (int j = i + 1; j < mInventory.length; j++) if (mInventory[j] != null + && (mInventory[i] == null || GT_Utility.areStacksEqual(mInventory[i], mInventory[j]))) + GT_Utility.moveStackFromSlotAToSlotB( + getBaseMetaTileEntity(), + getBaseMetaTileEntity(), + j, + i, + (byte) 64, + (byte) 1, + (byte) 64, + (byte) 1); } } @@ -186,127 +190,85 @@ public class GT_MetaTileEntity_Hatch_Steam_BusInput extends GT_MetaTileEntity_Ha } public ITexture[] getSideFacingActive(byte aColor) { - return new ITexture[] { - new GT_RenderedTexture( - mTier == 1 - ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_SIDE - : Textures.BlockIcons.MACHINE_BRONZE_SIDE) - }; + return new ITexture[] { new GT_RenderedTexture( + mTier == 1 ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_SIDE : Textures.BlockIcons.MACHINE_BRONZE_SIDE) }; } public ITexture[] getSideFacingInactive(byte aColor) { - return new ITexture[] { - new GT_RenderedTexture( - mTier == 1 - ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_SIDE - : Textures.BlockIcons.MACHINE_BRONZE_SIDE) - }; + return new ITexture[] { new GT_RenderedTexture( + mTier == 1 ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_SIDE : Textures.BlockIcons.MACHINE_BRONZE_SIDE) }; } public ITexture[] getFrontFacingActive(byte aColor) { - return new ITexture[] { - new GT_RenderedTexture( - mTier == 1 - ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_SIDE - : Textures.BlockIcons.MACHINE_BRONZE_SIDE) - }; + return new ITexture[] { new GT_RenderedTexture( + mTier == 1 ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_SIDE : Textures.BlockIcons.MACHINE_BRONZE_SIDE) }; } public ITexture[] getFrontFacingInactive(byte aColor) { - return new ITexture[] { - new GT_RenderedTexture( - mTier == 1 - ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_SIDE - : Textures.BlockIcons.MACHINE_BRONZE_SIDE) - }; + return new ITexture[] { new GT_RenderedTexture( + mTier == 1 ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_SIDE : Textures.BlockIcons.MACHINE_BRONZE_SIDE) }; } public ITexture[] getTopFacingActive(byte aColor) { - return new ITexture[] { - new GT_RenderedTexture( - mTier == 1 ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_TOP : Textures.BlockIcons.MACHINE_BRONZE_TOP) - }; + return new ITexture[] { new GT_RenderedTexture( + mTier == 1 ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_TOP : Textures.BlockIcons.MACHINE_BRONZE_TOP) }; } public ITexture[] getTopFacingInactive(byte aColor) { - return new ITexture[] { - new GT_RenderedTexture( - mTier == 1 ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_TOP : Textures.BlockIcons.MACHINE_BRONZE_TOP) - }; + return new ITexture[] { new GT_RenderedTexture( + mTier == 1 ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_TOP : Textures.BlockIcons.MACHINE_BRONZE_TOP) }; } public ITexture[] getBottomFacingActive(byte aColor) { - return new ITexture[] { - new GT_RenderedTexture( - mTier == 1 - ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_BOTTOM - : Textures.BlockIcons.MACHINE_BRONZE_BOTTOM) - }; + return new ITexture[] { new GT_RenderedTexture( + mTier == 1 ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_BOTTOM + : Textures.BlockIcons.MACHINE_BRONZE_BOTTOM) }; } public ITexture[] getBottomFacingInactive(byte aColor) { - return new ITexture[] { - new GT_RenderedTexture( - mTier == 1 - ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_BOTTOM - : Textures.BlockIcons.MACHINE_BRONZE_BOTTOM) - }; + return new ITexture[] { new GT_RenderedTexture( + mTier == 1 ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_BOTTOM + : Textures.BlockIcons.MACHINE_BRONZE_BOTTOM) }; } public ITexture[] getBottomFacingPipeActive(byte aColor) { return new ITexture[] { - new GT_RenderedTexture( - mTier == 1 - ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_BOTTOM - : Textures.BlockIcons.MACHINE_BRONZE_BOTTOM), - new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT) - }; + new GT_RenderedTexture( + mTier == 1 ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_BOTTOM + : Textures.BlockIcons.MACHINE_BRONZE_BOTTOM), + new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT) }; } public ITexture[] getBottomFacingPipeInactive(byte aColor) { return new ITexture[] { - new GT_RenderedTexture( - mTier == 1 - ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_BOTTOM - : Textures.BlockIcons.MACHINE_BRONZE_BOTTOM), - new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT) - }; + new GT_RenderedTexture( + mTier == 1 ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_BOTTOM + : Textures.BlockIcons.MACHINE_BRONZE_BOTTOM), + new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT) }; } public ITexture[] getTopFacingPipeActive(byte aColor) { - return new ITexture[] { - new GT_RenderedTexture( - mTier == 1 ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_TOP : Textures.BlockIcons.MACHINE_BRONZE_TOP), - new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT) - }; + return new ITexture[] { new GT_RenderedTexture( + mTier == 1 ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_TOP : Textures.BlockIcons.MACHINE_BRONZE_TOP), + new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT) }; } public ITexture[] getTopFacingPipeInactive(byte aColor) { - return new ITexture[] { - new GT_RenderedTexture( - mTier == 1 ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_TOP : Textures.BlockIcons.MACHINE_BRONZE_TOP), - new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT) - }; + return new ITexture[] { new GT_RenderedTexture( + mTier == 1 ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_TOP : Textures.BlockIcons.MACHINE_BRONZE_TOP), + new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT) }; } public ITexture[] getSideFacingPipeActive(byte aColor) { - return new ITexture[] { - new GT_RenderedTexture( - mTier == 1 - ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_SIDE - : Textures.BlockIcons.MACHINE_BRONZE_SIDE), - new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT) - }; + return new ITexture[] { new GT_RenderedTexture( + mTier == 1 ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_SIDE : Textures.BlockIcons.MACHINE_BRONZE_SIDE), + new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT) }; } public ITexture[] getSideFacingPipeInactive(byte aColor) { - return new ITexture[] { - new GT_RenderedTexture( - mTier == 1 - ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_SIDE - : Textures.BlockIcons.MACHINE_BRONZE_SIDE), - new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT) - }; + return new ITexture[] { new GT_RenderedTexture( + mTier == 1 ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_SIDE : Textures.BlockIcons.MACHINE_BRONZE_SIDE), + new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT) }; } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Steam_BusOutput.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Steam_BusOutput.java index a6bfd65636..48e27f0729 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Steam_BusOutput.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Steam_BusOutput.java @@ -3,8 +3,12 @@ package gtPlusPlus.xmod.gregtech.api.metatileentity.implementations; import static gregtech.api.enums.Textures.BlockIcons.ITEM_OUT_SIGN; import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_PIPE_OUT; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; + import com.gtnewhorizons.modularui.api.screen.ModularWindow; import com.gtnewhorizons.modularui.api.screen.UIBuildContext; + import gregtech.GT_Mod; import gregtech.api.enums.Textures; import gregtech.api.gui.modularui.GT_UIInfos; @@ -15,41 +19,42 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch; import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.render.TextureFactory; import gtPlusPlus.core.lib.CORE; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; public class GT_MetaTileEntity_Hatch_Steam_BusOutput extends GT_MetaTileEntity_Hatch { - public GT_MetaTileEntity_Hatch_Steam_BusOutput(int aID, String aName, String aNameRegional, int aTier) { - super(aID, aName, aNameRegional, aTier, 4, new String[] { - "Item Output for Steam Multiblocks", - "Capacity: 4 stacks", - "Does not work with non-steam multiblocks", - CORE.GT_Tooltip - }); - } - public GT_MetaTileEntity_Hatch_Steam_BusOutput( - String aName, int aTier, String aDescription, ITexture[][][] aTextures) { + public GT_MetaTileEntity_Hatch_Steam_BusOutput(int aID, String aName, String aNameRegional, int aTier) { + super( + aID, + aName, + aNameRegional, + aTier, + 4, + new String[] { "Item Output for Steam Multiblocks", "Capacity: 4 stacks", + "Does not work with non-steam multiblocks", CORE.GT_Tooltip }); + } + + public GT_MetaTileEntity_Hatch_Steam_BusOutput(String aName, int aTier, String aDescription, + ITexture[][][] aTextures) { super(aName, aTier, 4, aDescription, aTextures); } - public GT_MetaTileEntity_Hatch_Steam_BusOutput( - String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) { + public GT_MetaTileEntity_Hatch_Steam_BusOutput(String aName, int aTier, String[] aDescription, + ITexture[][][] aTextures) { super(aName, aTier, 4, aDescription, aTextures); } @Override public ITexture[] getTexturesActive(ITexture aBaseTexture) { return GT_Mod.gregtechproxy.mRenderIndicatorsOnHatch - ? new ITexture[] {aBaseTexture, TextureFactory.of(OVERLAY_PIPE_OUT), TextureFactory.of(ITEM_OUT_SIGN)} - : new ITexture[] {aBaseTexture, TextureFactory.of(OVERLAY_PIPE_OUT)}; + ? new ITexture[] { aBaseTexture, TextureFactory.of(OVERLAY_PIPE_OUT), TextureFactory.of(ITEM_OUT_SIGN) } + : new ITexture[] { aBaseTexture, TextureFactory.of(OVERLAY_PIPE_OUT) }; } @Override public ITexture[] getTexturesInactive(ITexture aBaseTexture) { return GT_Mod.gregtechproxy.mRenderIndicatorsOnHatch - ? new ITexture[] {aBaseTexture, TextureFactory.of(OVERLAY_PIPE_OUT), TextureFactory.of(ITEM_OUT_SIGN)} - : new ITexture[] {aBaseTexture, TextureFactory.of(OVERLAY_PIPE_OUT)}; + ? new ITexture[] { aBaseTexture, TextureFactory.of(OVERLAY_PIPE_OUT), TextureFactory.of(ITEM_OUT_SIGN) } + : new ITexture[] { aBaseTexture, TextureFactory.of(OVERLAY_PIPE_OUT) }; } @Override @@ -116,127 +121,85 @@ public class GT_MetaTileEntity_Hatch_Steam_BusOutput extends GT_MetaTileEntity_H } public ITexture[] getSideFacingActive(byte aColor) { - return new ITexture[] { - new GT_RenderedTexture( - mTier == 1 - ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_SIDE - : Textures.BlockIcons.MACHINE_BRONZE_SIDE) - }; + return new ITexture[] { new GT_RenderedTexture( + mTier == 1 ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_SIDE : Textures.BlockIcons.MACHINE_BRONZE_SIDE) }; } public ITexture[] getSideFacingInactive(byte aColor) { - return new ITexture[] { - new GT_RenderedTexture( - mTier == 1 - ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_SIDE - : Textures.BlockIcons.MACHINE_BRONZE_SIDE) - }; + return new ITexture[] { new GT_RenderedTexture( + mTier == 1 ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_SIDE : Textures.BlockIcons.MACHINE_BRONZE_SIDE) }; } public ITexture[] getFrontFacingActive(byte aColor) { - return new ITexture[] { - new GT_RenderedTexture( - mTier == 1 - ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_SIDE - : Textures.BlockIcons.MACHINE_BRONZE_SIDE) - }; + return new ITexture[] { new GT_RenderedTexture( + mTier == 1 ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_SIDE : Textures.BlockIcons.MACHINE_BRONZE_SIDE) }; } public ITexture[] getFrontFacingInactive(byte aColor) { - return new ITexture[] { - new GT_RenderedTexture( - mTier == 1 - ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_SIDE - : Textures.BlockIcons.MACHINE_BRONZE_SIDE) - }; + return new ITexture[] { new GT_RenderedTexture( + mTier == 1 ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_SIDE : Textures.BlockIcons.MACHINE_BRONZE_SIDE) }; } public ITexture[] getTopFacingActive(byte aColor) { - return new ITexture[] { - new GT_RenderedTexture( - mTier == 1 ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_TOP : Textures.BlockIcons.MACHINE_BRONZE_TOP) - }; + return new ITexture[] { new GT_RenderedTexture( + mTier == 1 ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_TOP : Textures.BlockIcons.MACHINE_BRONZE_TOP) }; } public ITexture[] getTopFacingInactive(byte aColor) { - return new ITexture[] { - new GT_RenderedTexture( - mTier == 1 ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_TOP : Textures.BlockIcons.MACHINE_BRONZE_TOP) - }; + return new ITexture[] { new GT_RenderedTexture( + mTier == 1 ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_TOP : Textures.BlockIcons.MACHINE_BRONZE_TOP) }; } public ITexture[] getBottomFacingActive(byte aColor) { - return new ITexture[] { - new GT_RenderedTexture( - mTier == 1 - ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_BOTTOM - : Textures.BlockIcons.MACHINE_BRONZE_BOTTOM) - }; + return new ITexture[] { new GT_RenderedTexture( + mTier == 1 ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_BOTTOM + : Textures.BlockIcons.MACHINE_BRONZE_BOTTOM) }; } public ITexture[] getBottomFacingInactive(byte aColor) { - return new ITexture[] { - new GT_RenderedTexture( - mTier == 1 - ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_BOTTOM - : Textures.BlockIcons.MACHINE_BRONZE_BOTTOM) - }; + return new ITexture[] { new GT_RenderedTexture( + mTier == 1 ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_BOTTOM + : Textures.BlockIcons.MACHINE_BRONZE_BOTTOM) }; } public ITexture[] getBottomFacingPipeActive(byte aColor) { return new ITexture[] { - new GT_RenderedTexture( - mTier == 1 - ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_BOTTOM - : Textures.BlockIcons.MACHINE_BRONZE_BOTTOM), - new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT) - }; + new GT_RenderedTexture( + mTier == 1 ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_BOTTOM + : Textures.BlockIcons.MACHINE_BRONZE_BOTTOM), + new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT) }; } public ITexture[] getBottomFacingPipeInactive(byte aColor) { return new ITexture[] { - new GT_RenderedTexture( - mTier == 1 - ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_BOTTOM - : Textures.BlockIcons.MACHINE_BRONZE_BOTTOM), - new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT) - }; + new GT_RenderedTexture( + mTier == 1 ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_BOTTOM + : Textures.BlockIcons.MACHINE_BRONZE_BOTTOM), + new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT) }; } public ITexture[] getTopFacingPipeActive(byte aColor) { - return new ITexture[] { - new GT_RenderedTexture( - mTier == 1 ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_TOP : Textures.BlockIcons.MACHINE_BRONZE_TOP), - new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT) - }; + return new ITexture[] { new GT_RenderedTexture( + mTier == 1 ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_TOP : Textures.BlockIcons.MACHINE_BRONZE_TOP), + new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT) }; } public ITexture[] getTopFacingPipeInactive(byte aColor) { - return new ITexture[] { - new GT_RenderedTexture( - mTier == 1 ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_TOP : Textures.BlockIcons.MACHINE_BRONZE_TOP), - new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT) - }; + return new ITexture[] { new GT_RenderedTexture( + mTier == 1 ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_TOP : Textures.BlockIcons.MACHINE_BRONZE_TOP), + new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT) }; } public ITexture[] getSideFacingPipeActive(byte aColor) { - return new ITexture[] { - new GT_RenderedTexture( - mTier == 1 - ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_SIDE - : Textures.BlockIcons.MACHINE_BRONZE_SIDE), - new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT) - }; + return new ITexture[] { new GT_RenderedTexture( + mTier == 1 ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_SIDE : Textures.BlockIcons.MACHINE_BRONZE_SIDE), + new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT) }; } public ITexture[] getSideFacingPipeInactive(byte aColor) { - return new ITexture[] { - new GT_RenderedTexture( - mTier == 1 - ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_SIDE - : Textures.BlockIcons.MACHINE_BRONZE_SIDE), - new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT) - }; + return new ITexture[] { new GT_RenderedTexture( + mTier == 1 ? Textures.BlockIcons.MACHINE_BRONZEBRICKS_SIDE : Textures.BlockIcons.MACHINE_BRONZE_SIDE), + new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT) }; } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Turbine.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Turbine.java index 2c04c75fe3..00f7c97a01 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Turbine.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Turbine.java @@ -3,9 +3,14 @@ package gtPlusPlus.xmod.gregtech.api.metatileentity.implementations; import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_ST5; import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_ST_ACTIVE5; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; + import com.gtnewhorizons.modularui.api.screen.ModularWindow; import com.gtnewhorizons.modularui.api.screen.UIBuildContext; import com.gtnewhorizons.modularui.common.widget.SlotWidget; + import gregtech.api.GregTech_API; import gregtech.api.enums.Materials; import gregtech.api.gui.modularui.GT_UIInfos; @@ -26,9 +31,6 @@ import gtPlusPlus.core.util.math.MathUtils; import gtPlusPlus.core.util.minecraft.PlayerUtils; import gtPlusPlus.xmod.gregtech.common.StaticFields59; import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production.turbines.GregtechMetaTileEntity_LargerTurbineBase; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; @SuppressWarnings("deprecation") public class GT_MetaTileEntity_Hatch_Turbine extends GT_MetaTileEntity_Hatch { @@ -52,25 +54,21 @@ public class GT_MetaTileEntity_Hatch_Turbine extends GT_MetaTileEntity_Hatch { @Override public String[] getDescription() { - return new String[] { - this.mDescription, - "Right Click with a soldering iron to reset controller link", - "Right Click with a wrench to remove turbine", - "Right Click with a screwdriver for technical information", - "Sneak + Right Click with a wrench to rotate", - "Sneak + Right Click with a screwdriver to disable animations", - CORE.GT_Tooltip - }; + return new String[] { this.mDescription, "Right Click with a soldering iron to reset controller link", + "Right Click with a wrench to remove turbine", + "Right Click with a screwdriver for technical information", + "Sneak + Right Click with a wrench to rotate", + "Sneak + Right Click with a screwdriver to disable animations", CORE.GT_Tooltip }; } @Override public ITexture[] getTexturesActive(ITexture aBaseTexture) { - return new ITexture[] {aBaseTexture, getFrontFacingTurbineTexture()}; + return new ITexture[] { aBaseTexture, getFrontFacingTurbineTexture() }; } @Override public ITexture[] getTexturesInactive(ITexture aBaseTexture) { - return new ITexture[] {aBaseTexture, getFrontFacingTurbineTexture()}; + return new ITexture[] { aBaseTexture, getFrontFacingTurbineTexture() }; } public int getEU() { @@ -159,12 +157,10 @@ public class GT_MetaTileEntity_Hatch_Turbine extends GT_MetaTileEntity_Hatch { public void damageTurbine(long aEUt, int damageFactorLow, float damageFactorHigh) { if (hasTurbine() && MathUtils.randInt(0, 1) == 0) { ItemStack aTurbine = getTurbine(); - ((GT_MetaGenerated_Tool) aTurbine.getItem()) - .doDamage( - aTurbine, - (long) getDamageToComponent(aTurbine) - * (long) Math.min( - (float) aEUt / (float) damageFactorLow, Math.pow(aEUt, damageFactorHigh))); + ((GT_MetaGenerated_Tool) aTurbine.getItem()).doDamage( + aTurbine, + (long) getDamageToComponent(aTurbine) * (long) Math + .min((float) aEUt / (float) damageFactorLow, Math.pow(aEUt, damageFactorHigh))); } } @@ -223,8 +219,8 @@ public class GT_MetaTileEntity_Hatch_Turbine extends GT_MetaTileEntity_Hatch { BlockPos p = BlockPos.generateBlockPos(mControllerLocation); if (p != null) { // Logger.INFO(p.getLocationString()); - IGregTechTileEntity tTileEntity = - getBaseMetaTileEntity().getIGregTechTileEntity(p.xPos, p.yPos, p.zPos); + IGregTechTileEntity tTileEntity = getBaseMetaTileEntity() + .getIGregTechTileEntity(p.xPos, p.yPos, p.zPos); if (tTileEntity != null && tTileEntity.getMetaTileEntity() instanceof GregtechMetaTileEntity_LargerTurbineBase) { return (GregtechMetaTileEntity_LargerTurbineBase) tTileEntity.getMetaTileEntity(); @@ -269,8 +265,7 @@ public class GT_MetaTileEntity_Hatch_Turbine extends GT_MetaTileEntity_Hatch { private ITexture getFrontFacingTurbineTexture() { if (!mHasController) { - return this.getBaseMetaTileEntity().isActive() - ? new GT_RenderedTexture(LARGETURBINE_ST_ACTIVE5) + return this.getBaseMetaTileEntity().isActive() ? new GT_RenderedTexture(LARGETURBINE_ST_ACTIVE5) : new GT_RenderedTexture(LARGETURBINE_ST5); } else { if (usingAnimations()) { @@ -319,17 +314,15 @@ public class GT_MetaTileEntity_Hatch_Turbine extends GT_MetaTileEntity_Hatch { if (mHasController) { PlayerUtils.messagePlayer( aPlayer, - "Controller Location: " - + BlockPos.generateBlockPos(mControllerLocation).getLocationString()); + "Controller Location: " + BlockPos.generateBlockPos(mControllerLocation).getLocationString()); PlayerUtils.messagePlayer(aPlayer, "Controller Active? " + this.isControllerActive()); } - PlayerUtils.messagePlayer( - aPlayer, "Active? " + this.getBaseMetaTileEntity().isActive()); + PlayerUtils.messagePlayer(aPlayer, "Active? " + this.getBaseMetaTileEntity().isActive()); PlayerUtils.messagePlayer(aPlayer, "Has Turbine inserted? " + this.hasTurbine()); if (this.hasTurbine()) { Materials aMat = GT_MetaGenerated_Tool.getPrimaryMaterial(getTurbine()); - String aSize = GregtechMetaTileEntity_LargerTurbineBase.getTurbineSizeString( - GregtechMetaTileEntity_LargerTurbineBase.getTurbineSize(getTurbine())); + String aSize = GregtechMetaTileEntity_LargerTurbineBase + .getTurbineSizeString(GregtechMetaTileEntity_LargerTurbineBase.getTurbineSize(getTurbine())); PlayerUtils.messagePlayer(aPlayer, "Using: " + aMat.mLocalizedName + " " + aSize); } } else { @@ -343,8 +336,8 @@ public class GT_MetaTileEntity_Hatch_Turbine extends GT_MetaTileEntity_Hatch { } @Override - public boolean onWrenchRightClick( - byte aSide, byte aWrenchingSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { + public boolean onWrenchRightClick(byte aSide, byte aWrenchingSide, EntityPlayer aPlayer, float aX, float aY, + float aZ) { if (this.getBaseMetaTileEntity().isServerSide() && !aPlayer.isSneaking()) { ItemStack tCurrentItem = aPlayer.inventory.getCurrentItem(); if (tCurrentItem != null) { @@ -357,8 +350,8 @@ public class GT_MetaTileEntity_Hatch_Turbine extends GT_MetaTileEntity_Hatch { } @Override - public boolean onSolderingToolRightClick( - byte aSide, byte aWrenchingSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { + public boolean onSolderingToolRightClick(byte aSide, byte aWrenchingSide, EntityPlayer aPlayer, float aX, float aY, + float aZ) { if (this.getBaseMetaTileEntity().isServerSide()) { ItemStack tCurrentItem = aPlayer.inventory.getCurrentItem(); if (tCurrentItem != null) { @@ -417,9 +410,8 @@ public class GT_MetaTileEntity_Hatch_Turbine extends GT_MetaTileEntity_Hatch { @Override public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildContext) { - builder.widget(new SlotWidget(inventoryHandler, 0) - .setFilter(GregtechMetaTileEntity_LargerTurbineBase::isValidTurbine) - .setAccess(false, true) - .setPos(79, 34)); + builder.widget( + new SlotWidget(inventoryHandler, 0).setFilter(GregtechMetaTileEntity_LargerTurbineBase::isValidTurbine) + .setAccess(false, true).setPos(79, 34)); } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_TurbineProvider.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_TurbineProvider.java index 63937d42ce..a15a11f34a 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_TurbineProvider.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_TurbineProvider.java @@ -1,8 +1,15 @@ package gtPlusPlus.xmod.gregtech.api.metatileentity.implementations; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.world.World; +import net.minecraft.world.chunk.Chunk; + import com.gtnewhorizons.modularui.api.screen.ModularWindow; import com.gtnewhorizons.modularui.api.screen.UIBuildContext; import com.gtnewhorizons.modularui.common.widget.SlotWidget; + import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; @@ -16,11 +23,6 @@ import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.minecraft.PlayerUtils; import gtPlusPlus.core.util.sys.KeyboardUtils; import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production.turbines.GregtechMetaTileEntity_LargerTurbineBase; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.world.World; -import net.minecraft.world.chunk.Chunk; public class GT_MetaTileEntity_Hatch_TurbineProvider extends GT_MetaTileEntity_Hatch_InputBus { @@ -28,13 +30,13 @@ public class GT_MetaTileEntity_Hatch_TurbineProvider extends GT_MetaTileEntity_H super(aID, aName, aNameRegional, aTier); } - public GT_MetaTileEntity_Hatch_TurbineProvider( - String aName, int aTier, String aDescription, ITexture[][][] aTextures) { + public GT_MetaTileEntity_Hatch_TurbineProvider(String aName, int aTier, String aDescription, + ITexture[][][] aTextures) { super(aName, aTier, aDescription, aTextures); } - public GT_MetaTileEntity_Hatch_TurbineProvider( - String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) { + public GT_MetaTileEntity_Hatch_TurbineProvider(String aName, int aTier, String[] aDescription, + ITexture[][][] aTextures) { super(aName, aTier, aDescription[0], aTextures); } @@ -44,16 +46,11 @@ public class GT_MetaTileEntity_Hatch_TurbineProvider extends GT_MetaTileEntity_H @Override public String[] getDescription() { - return new String[] { - "An automation port for Large Turbines", - "Will attempt once per 1200 ticks to fill the turbine slot of it's parent turbine", - "You may adjust this with a screwdriver", - "Hold shift to adjust in finer amounts", - "Hold control to adjust direction", - "Left Click with Screwdriver to reset", - "This module assumes the entire turbine is in the same Chunk", - CORE.GT_Tooltip - }; + return new String[] { "An automation port for Large Turbines", + "Will attempt once per 1200 ticks to fill the turbine slot of it's parent turbine", + "You may adjust this with a screwdriver", "Hold shift to adjust in finer amounts", + "Hold control to adjust direction", "Left Click with Screwdriver to reset", + "This module assumes the entire turbine is in the same Chunk", CORE.GT_Tooltip }; } private GT_MetaTileEntity_LargeTurbine mParent = null; @@ -214,9 +211,8 @@ public class GT_MetaTileEntity_Hatch_TurbineProvider extends GT_MetaTileEntity_H @Override public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildContext) { - builder.widget(new SlotWidget(inventoryHandler, 0) - .setFilter(GregtechMetaTileEntity_LargerTurbineBase::isValidTurbine) - .setAccess(false, true) - .setPos(79, 34)); + builder.widget( + new SlotWidget(inventoryHandler, 0).setFilter(GregtechMetaTileEntity_LargerTurbineBase::isValidTurbine) + .setAccess(false, true).setPos(79, 34)); } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_SuperBus_Input.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_SuperBus_Input.java index 8854818cac..f3d2d79e19 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_SuperBus_Input.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_SuperBus_Input.java @@ -4,6 +4,7 @@ import com.gtnewhorizons.modularui.api.screen.ModularWindow.Builder; import com.gtnewhorizons.modularui.api.screen.UIBuildContext; import com.gtnewhorizons.modularui.common.widget.Scrollable; import com.gtnewhorizons.modularui.common.widget.SlotWidget; + import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; @@ -12,6 +13,7 @@ import gregtech.api.util.extensions.ArrayExt; import gtPlusPlus.core.lib.CORE; public class GT_MetaTileEntity_SuperBus_Input extends GT_MetaTileEntity_Hatch_InputBus { + public GT_MetaTileEntity_SuperBus_Input(int aID, String aName, String aNameRegional, int aTier) { super(aID, aName, aNameRegional, aTier, getSlots(aTier) + 1); } @@ -32,12 +34,15 @@ public class GT_MetaTileEntity_SuperBus_Input extends GT_MetaTileEntity_Hatch_In public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new GT_MetaTileEntity_SuperBus_Input( - this.mName, this.mTier, ArrayExt.of(this.mDescription), this.mTextures); + this.mName, + this.mTier, + ArrayExt.of(this.mDescription), + this.mTextures); } @Override public String[] getDescription() { - return new String[] {"Item Input for Multiblocks", "" + getSlots(this.mTier) + " Slots", CORE.GT_Tooltip}; + return new String[] { "Item Input for Multiblocks", "" + getSlots(this.mTier) + " Slots", CORE.GT_Tooltip }; } @Override @@ -51,9 +56,9 @@ public class GT_MetaTileEntity_SuperBus_Input extends GT_MetaTileEntity_Hatch_In for (int row = 0; row * 4 < inventoryHandler.getSlots() - 1; row++) { int columnsToMake = Math.min(inventoryHandler.getSlots() - row * 4, 4); for (int column = 0; column < columnsToMake; column++) { - scrollable.widget(new SlotWidget(inventoryHandler, row * 4 + column) - .setPos(column * 18, row * 18) - .setSize(18, 18)); + scrollable.widget( + new SlotWidget(inventoryHandler, row * 4 + column).setPos(column * 18, row * 18) + .setSize(18, 18)); } } builder.widget(scrollable.setSize(18 * 4 + 4, 18 * 4).setPos(52, 7)); diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_SuperBus_Output.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_SuperBus_Output.java index 26fbf7cdd8..418717b1c8 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_SuperBus_Output.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_SuperBus_Output.java @@ -1,9 +1,12 @@ package gtPlusPlus.xmod.gregtech.api.metatileentity.implementations; +import net.minecraft.inventory.IInventory; + import com.gtnewhorizons.modularui.api.screen.ModularWindow.Builder; import com.gtnewhorizons.modularui.api.screen.UIBuildContext; import com.gtnewhorizons.modularui.common.widget.Scrollable; import com.gtnewhorizons.modularui.common.widget.SlotWidget; + import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; @@ -11,7 +14,6 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Outpu import gregtech.api.util.GT_Utility; import gregtech.api.util.extensions.ArrayExt; import gtPlusPlus.core.lib.CORE; -import net.minecraft.inventory.IInventory; public class GT_MetaTileEntity_SuperBus_Output extends GT_MetaTileEntity_Hatch_OutputBus { @@ -39,7 +41,10 @@ public class GT_MetaTileEntity_SuperBus_Output extends GT_MetaTileEntity_Hatch_O public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new GT_MetaTileEntity_SuperBus_Output( - this.mName, this.mTier, ArrayExt.of(this.mDescription), this.mTextures); + this.mName, + this.mTier, + ArrayExt.of(this.mDescription), + this.mTextures); } public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTimer) { @@ -61,9 +66,8 @@ public class GT_MetaTileEntity_SuperBus_Output extends GT_MetaTileEntity_Hatch_O protected void fillStacksIntoFirstSlots() { for (int i = 0; i < this.mInventory.length; ++i) { for (int j = i + 1; j < this.mInventory.length; ++j) { - if (this.mInventory[j] != null - && (this.mInventory[i] == null - || GT_Utility.areStacksEqual(this.mInventory[i], this.mInventory[j]))) { + if (this.mInventory[j] != null && (this.mInventory[i] == null + || GT_Utility.areStacksEqual(this.mInventory[i], this.mInventory[j]))) { GT_Utility.moveStackFromSlotAToSlotB( (IInventory) this.getBaseMetaTileEntity(), (IInventory) this.getBaseMetaTileEntity(), @@ -80,8 +84,8 @@ public class GT_MetaTileEntity_SuperBus_Output extends GT_MetaTileEntity_Hatch_O @Override public String[] getDescription() { - String[] aDesc = - new String[] {"Item Output for Multiblocks", "" + getSlots(this.mTier) + " Slots", CORE.GT_Tooltip}; + String[] aDesc = new String[] { "Item Output for Multiblocks", "" + getSlots(this.mTier) + " Slots", + CORE.GT_Tooltip }; return aDesc; } @@ -91,9 +95,9 @@ public class GT_MetaTileEntity_SuperBus_Output extends GT_MetaTileEntity_Hatch_O for (int row = 0; row * 4 < inventoryHandler.getSlots() - 1; row++) { int columnsToMake = Math.min(inventoryHandler.getSlots() - row * 4, 4); for (int column = 0; column < columnsToMake; column++) { - scrollable.widget(new SlotWidget(inventoryHandler, row * 4 + column) - .setPos(column * 18, row * 18) - .setSize(18, 18)); + scrollable.widget( + new SlotWidget(inventoryHandler, row * 4 + column).setPos(column * 18, row * 18) + .setSize(18, 18)); } } builder.widget(scrollable.setSize(18 * 4 + 4, 18 * 4).setPos(52, 7)); diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GregtechMetaPipeEntityFluid.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GregtechMetaPipeEntityFluid.java index 8f7fd8d4d3..26ed6b2bcd 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GregtechMetaPipeEntityFluid.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GregtechMetaPipeEntityFluid.java @@ -1,5 +1,7 @@ package gtPlusPlus.xmod.gregtech.api.metatileentity.implementations; +import net.minecraft.util.EnumChatFormatting; + import gregtech.api.enums.Dyes; import gregtech.api.enums.OrePrefixes; import gregtech.api.enums.SubTag; @@ -10,7 +12,6 @@ import gregtech.api.metatileentity.implementations.GT_MetaPipeEntity_Fluid; import gregtech.api.render.TextureFactory; import gtPlusPlus.xmod.gregtech.api.enums.GregtechOrePrefixes.GT_Materials; import gtPlusPlus.xmod.gregtech.common.StaticFields59; -import net.minecraft.util.EnumChatFormatting; public class GregtechMetaPipeEntityFluid extends GT_MetaPipeEntity_Fluid { @@ -23,38 +24,18 @@ public class GregtechMetaPipeEntityFluid extends GT_MetaPipeEntity_Fluid { public final GT_Materials mMaterial; private boolean mCheckConnections; - public GregtechMetaPipeEntityFluid( - int aID, - String aName, - String aNameRegional, - float aThickNess, - GT_Materials aMaterial, - int aCapacity, - int aHeatResistance, - boolean aGasProof) { + public GregtechMetaPipeEntityFluid(int aID, String aName, String aNameRegional, float aThickNess, + GT_Materials aMaterial, int aCapacity, int aHeatResistance, boolean aGasProof) { this(aID, aName, aNameRegional, aThickNess, aMaterial, aCapacity, aHeatResistance, aGasProof, 1); } - public GregtechMetaPipeEntityFluid( - final String aName, - final float aThickNess, - final GT_Materials aMaterial, - final int aCapacity, - final int aHeatResistance, - final boolean aGasProof) { + public GregtechMetaPipeEntityFluid(final String aName, final float aThickNess, final GT_Materials aMaterial, + final int aCapacity, final int aHeatResistance, final boolean aGasProof) { this(aName, aThickNess, aMaterial, aCapacity, aHeatResistance, aGasProof, 1); } - public GregtechMetaPipeEntityFluid( - int aID, - String aName, - String aNameRegional, - float aThickNess, - GT_Materials aMaterial, - int aCapacity, - int aHeatResistance, - boolean aGasProof, - int aFluidTypes) { + public GregtechMetaPipeEntityFluid(int aID, String aName, String aNameRegional, float aThickNess, + GT_Materials aMaterial, int aCapacity, int aHeatResistance, boolean aGasProof, int aFluidTypes) { super(aID, aName, aNameRegional, aThickNess, null, aCapacity, aHeatResistance, aGasProof); this.mLastReceivedFrom = 0; this.oLastReceivedFrom = 0; @@ -62,14 +43,8 @@ public class GregtechMetaPipeEntityFluid extends GT_MetaPipeEntity_Fluid { this.mMaterial = aMaterial; } - public GregtechMetaPipeEntityFluid( - String aName, - float aThickNess, - GT_Materials aMaterial, - int aCapacity, - int aHeatResistance, - boolean aGasProof, - int aFluidTypes) { + public GregtechMetaPipeEntityFluid(String aName, float aThickNess, GT_Materials aMaterial, int aCapacity, + int aHeatResistance, boolean aGasProof, int aFluidTypes) { super(aName, aThickNess, null, aCapacity, aHeatResistance, aGasProof); this.mLastReceivedFrom = 0; this.oLastReceivedFrom = 0; @@ -79,8 +54,7 @@ public class GregtechMetaPipeEntityFluid extends GT_MetaPipeEntity_Fluid { @Override public byte getTileEntityBaseType() { - return this.mMaterial == null - ? 4 + return this.mMaterial == null ? 4 : (byte) ((this.mMaterial.contains(SubTag.WOOD) ? 12 : 4) + Math.max(0, Math.min(3, this.mMaterial.mToolQuality))); } @@ -88,80 +62,61 @@ public class GregtechMetaPipeEntityFluid extends GT_MetaPipeEntity_Fluid { @Override public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) { return new GregtechMetaPipeEntityFluid( - this.mName, this.mThickNess, this.mMaterial, this.mCapacity, this.mHeatResistance, this.mGasProof); + this.mName, + this.mThickNess, + this.mMaterial, + this.mCapacity, + this.mHeatResistance, + this.mGasProof); } @Override - public ITexture[] getTexture( - IGregTechTileEntity aBaseMetaTileEntity, - byte aSide, - byte aConnections, - byte aColorIndex, - boolean aConnected, - boolean aRedstone) { + public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aConnections, + byte aColorIndex, boolean aConnected, boolean aRedstone) { float tThickNess = getThickNess(); if (mDisableInput == 0) - return new ITexture[] { - aConnected - ? getBaseTexture(tThickNess, mPipeAmount, mMaterial, aColorIndex) - : TextureFactory.of( - mMaterial.mIconSet.mTextures[OrePrefixes.pipe.mTextureIndex], - Dyes.getModulation(aColorIndex, mMaterial.mRGBa)) - }; + return new ITexture[] { aConnected ? getBaseTexture(tThickNess, mPipeAmount, mMaterial, aColorIndex) + : TextureFactory.of( + mMaterial.mIconSet.mTextures[OrePrefixes.pipe.mTextureIndex], + Dyes.getModulation(aColorIndex, mMaterial.mRGBa)) }; byte tMask = 0; - byte[][] sRestrictionArray = { - {2, 3, 5, 4}, - {2, 3, 4, 5}, - {1, 0, 4, 5}, - {1, 0, 4, 5}, - {1, 0, 2, 3}, - {1, 0, 2, 3} - }; + byte[][] sRestrictionArray = { { 2, 3, 5, 4 }, { 2, 3, 4, 5 }, { 1, 0, 4, 5 }, { 1, 0, 4, 5 }, { 1, 0, 2, 3 }, + { 1, 0, 2, 3 } }; if (aSide >= 0 && aSide < 6) { for (byte i = 0; i < 4; i++) if (isInputDisabledAtSide(sRestrictionArray[aSide][i])) tMask |= 1 << i; - // Full block size renderer flips side 5 and 2 textures, flip restrictor textures to compensate + // Full block size renderer flips side 5 and 2 textures, flip restrictor textures to compensate if (aSide == 5 || aSide == 2) if (tMask > 3 && tMask < 12) tMask = (byte) (tMask ^ 12); } - return new ITexture[] { - aConnected - ? getBaseTexture(tThickNess, mPipeAmount, mMaterial, aColorIndex) - : TextureFactory.of( - mMaterial.mIconSet.mTextures[OrePrefixes.pipe.mTextureIndex], - Dyes.getModulation(aColorIndex, mMaterial.mRGBa)), - getRestrictorTexture(tMask) - }; + return new ITexture[] { aConnected ? getBaseTexture(tThickNess, mPipeAmount, mMaterial, aColorIndex) + : TextureFactory.of( + mMaterial.mIconSet.mTextures[OrePrefixes.pipe.mTextureIndex], + Dyes.getModulation(aColorIndex, mMaterial.mRGBa)), + getRestrictorTexture(tMask) }; } - protected static ITexture getBaseTexture( - float aThickNess, int aPipeAmount, GT_Materials aMaterial, byte aColorIndex) { - if (aPipeAmount >= 9) - return TextureFactory.of( - aMaterial.mIconSet.mTextures[OrePrefixes.pipeNonuple.mTextureIndex], - Dyes.getModulation(aColorIndex, aMaterial.mRGBa)); - if (aPipeAmount >= 4) - return TextureFactory.of( - aMaterial.mIconSet.mTextures[OrePrefixes.pipeQuadruple.mTextureIndex], - Dyes.getModulation(aColorIndex, aMaterial.mRGBa)); - if (aThickNess < 0.124F) - return TextureFactory.of( - aMaterial.mIconSet.mTextures[OrePrefixes.pipe.mTextureIndex], - Dyes.getModulation(aColorIndex, aMaterial.mRGBa)); - if (aThickNess < 0.374F) - return TextureFactory.of( - aMaterial.mIconSet.mTextures[OrePrefixes.pipeTiny.mTextureIndex], - Dyes.getModulation(aColorIndex, aMaterial.mRGBa)); - if (aThickNess < 0.499F) - return TextureFactory.of( - aMaterial.mIconSet.mTextures[OrePrefixes.pipeSmall.mTextureIndex], - Dyes.getModulation(aColorIndex, aMaterial.mRGBa)); - if (aThickNess < 0.749F) - return TextureFactory.of( - aMaterial.mIconSet.mTextures[OrePrefixes.pipeMedium.mTextureIndex], - Dyes.getModulation(aColorIndex, aMaterial.mRGBa)); - if (aThickNess < 0.874F) - return TextureFactory.of( - aMaterial.mIconSet.mTextures[OrePrefixes.pipeLarge.mTextureIndex], - Dyes.getModulation(aColorIndex, aMaterial.mRGBa)); + protected static ITexture getBaseTexture(float aThickNess, int aPipeAmount, GT_Materials aMaterial, + byte aColorIndex) { + if (aPipeAmount >= 9) return TextureFactory.of( + aMaterial.mIconSet.mTextures[OrePrefixes.pipeNonuple.mTextureIndex], + Dyes.getModulation(aColorIndex, aMaterial.mRGBa)); + if (aPipeAmount >= 4) return TextureFactory.of( + aMaterial.mIconSet.mTextures[OrePrefixes.pipeQuadruple.mTextureIndex], + Dyes.getModulation(aColorIndex, aMaterial.mRGBa)); + if (aThickNess < 0.124F) return TextureFactory.of( + aMaterial.mIconSet.mTextures[OrePrefixes.pipe.mTextureIndex], + Dyes.getModulation(aColorIndex, aMaterial.mRGBa)); + if (aThickNess < 0.374F) return TextureFactory.of( + aMaterial.mIconSet.mTextures[OrePrefixes.pipeTiny.mTextureIndex], + Dyes.getModulation(aColorIndex, aMaterial.mRGBa)); + if (aThickNess < 0.499F) return TextureFactory.of( + aMaterial.mIconSet.mTextures[OrePrefixes.pipeSmall.mTextureIndex], + Dyes.getModulation(aColorIndex, aMaterial.mRGBa)); + if (aThickNess < 0.749F) return TextureFactory.of( + aMaterial.mIconSet.mTextures[OrePrefixes.pipeMedium.mTextureIndex], + Dyes.getModulation(aColorIndex, aMaterial.mRGBa)); + if (aThickNess < 0.874F) return TextureFactory.of( + aMaterial.mIconSet.mTextures[OrePrefixes.pipeLarge.mTextureIndex], + Dyes.getModulation(aColorIndex, aMaterial.mRGBa)); return TextureFactory.of( aMaterial.mIconSet.mTextures[OrePrefixes.pipeHuge.mTextureIndex], Dyes.getModulation(aColorIndex, aMaterial.mRGBa)); @@ -170,10 +125,13 @@ public class GregtechMetaPipeEntityFluid extends GT_MetaPipeEntity_Fluid { @Override public String[] getDescription() { return new String[] { - EnumChatFormatting.BLUE + "Fluid Capacity: %%%" + (mCapacity * 20) + "%%% L/sec" + EnumChatFormatting.GRAY, - EnumChatFormatting.RED + "Heat Limit: %%%" + mHeatResistance + "%%% K" + EnumChatFormatting.GRAY, - EnumChatFormatting.DARK_GREEN + "Gas Proof: " + (this.mGasProof) + EnumChatFormatting.GRAY, - // CORE.GT_Tooltip + EnumChatFormatting.BLUE + "Fluid Capacity: %%%" + + (mCapacity * 20) + + "%%% L/sec" + + EnumChatFormatting.GRAY, + EnumChatFormatting.RED + "Heat Limit: %%%" + mHeatResistance + "%%% K" + EnumChatFormatting.GRAY, + EnumChatFormatting.DARK_GREEN + "Gas Proof: " + (this.mGasProof) + EnumChatFormatting.GRAY, + // CORE.GT_Tooltip }; } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GregtechMetaPipeEntity_Cable.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GregtechMetaPipeEntity_Cable.java index eff2413102..1605448cfb 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GregtechMetaPipeEntity_Cable.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GregtechMetaPipeEntity_Cable.java @@ -12,14 +12,14 @@ import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.util.GT_Utility; public class GregtechMetaPipeEntity_Cable extends GT_MetaPipeEntity_Cable implements IMetaTileEntityCable { + private static Textures.BlockIcons INSULATION_MEDIUM_PLUS; static { if (GTNH) { try { - INSULATION_MEDIUM_PLUS = - (Textures.BlockIcons) GT_Utility.getField(Textures.BlockIcons.class, "INSULATION_MEDIUM_PLUS") - .get(null); + INSULATION_MEDIUM_PLUS = (Textures.BlockIcons) GT_Utility + .getField(Textures.BlockIcons.class, "INSULATION_MEDIUM_PLUS").get(null); } catch (IllegalAccessException | NullPointerException e) { throw new Error(e); } @@ -28,18 +28,9 @@ public class GregtechMetaPipeEntity_Cable extends GT_MetaPipeEntity_Cable implem private short[] vRGB = null; - public GregtechMetaPipeEntity_Cable( - final int aID, - final String aName, - final String aNameRegional, - final float aThickNess, - final Materials aMaterial, - final long aCableLossPerMeter, - final long aAmperage, - final long aVoltage, - final boolean aInsulated, - final boolean aCanShock, - final short[] aRGB) { + public GregtechMetaPipeEntity_Cable(final int aID, final String aName, final String aNameRegional, + final float aThickNess, final Materials aMaterial, final long aCableLossPerMeter, final long aAmperage, + final long aVoltage, final boolean aInsulated, final boolean aCanShock, final short[] aRGB) { super( aID, aName, @@ -54,31 +45,16 @@ public class GregtechMetaPipeEntity_Cable extends GT_MetaPipeEntity_Cable implem this.vRGB = aRGB == null || aRGB.length != 4 ? Materials.Iron.mRGBa : aRGB; } - public GregtechMetaPipeEntity_Cable( - final String aName, - final float aThickNess, - final Materials aMaterial, - final long aCableLossPerMeter, - final long aAmperage, - final long aVoltage, - final boolean aInsulated, - final boolean aCanShock, - final short[] aRGB) { + public GregtechMetaPipeEntity_Cable(final String aName, final float aThickNess, final Materials aMaterial, + final long aCableLossPerMeter, final long aAmperage, final long aVoltage, final boolean aInsulated, + final boolean aCanShock, final short[] aRGB) { super(aName, aThickNess, aMaterial, aCableLossPerMeter, aAmperage, aVoltage, aInsulated, aCanShock); this.vRGB = aRGB == null || aRGB.length != 4 ? Materials.Iron.mRGBa : aRGB; } - public GregtechMetaPipeEntity_Cable( - final int aID, - final String aName, - final String aNameRegional, - final float aThickNess, - final long aCableLossPerMeter, - final long aAmperage, - final long aVoltage, - final boolean aInsulated, - final boolean aCanShock, - final short[] aRGB) { + public GregtechMetaPipeEntity_Cable(final int aID, final String aName, final String aNameRegional, + final float aThickNess, final long aCableLossPerMeter, final long aAmperage, final long aVoltage, + final boolean aInsulated, final boolean aCanShock, final short[] aRGB) { this( aID, aName, @@ -93,14 +69,8 @@ public class GregtechMetaPipeEntity_Cable extends GT_MetaPipeEntity_Cable implem aRGB); } - public GregtechMetaPipeEntity_Cable( - final String aName, - final float aThickNess, - final long aCableLossPerMeter, - final long aAmperage, - final long aVoltage, - final boolean aInsulated, - final boolean aCanShock, + public GregtechMetaPipeEntity_Cable(final String aName, final float aThickNess, final long aCableLossPerMeter, + final long aAmperage, final long aVoltage, final boolean aInsulated, final boolean aCanShock, final short[] aRGB) { this(aName, aThickNess, null, aCableLossPerMeter, aAmperage, aVoltage, aInsulated, aCanShock, aRGB); } @@ -120,111 +90,84 @@ public class GregtechMetaPipeEntity_Cable extends GT_MetaPipeEntity_Cable implem } @Override - public ITexture[] getTexture( - IGregTechTileEntity aBaseMetaTileEntity, - byte aSide, - byte aConnections, - byte aColorIndex, - boolean aConnected, - boolean aRedstone) { - return GTNH - ? getTextureGTNH(aBaseMetaTileEntity, aSide, aConnections, aColorIndex, aConnected, aRedstone) + public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aConnections, + byte aColorIndex, boolean aConnected, boolean aRedstone) { + return GTNH ? getTextureGTNH(aBaseMetaTileEntity, aSide, aConnections, aColorIndex, aConnected, aRedstone) : getTexturePure(aBaseMetaTileEntity, aSide, aConnections, aColorIndex, aConnected, aRedstone); } - private ITexture[] getTextureGTNH( - IGregTechTileEntity aBaseMetaTileEntity, - byte aSide, - byte aConnections, - byte aColorIndex, - boolean aConnected, - boolean aRedstone) { + private ITexture[] getTextureGTNH(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aConnections, + byte aColorIndex, boolean aConnected, boolean aRedstone) { Materials wireMaterial = mMaterial; if (wireMaterial == null) { wireMaterial = Materials.Iron; } - if (!mInsulated) - return new ITexture[] { - new GT_RenderedTexture( - wireMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], Dyes.getModulation(aColorIndex, vRGB)) - }; + if (!mInsulated) return new ITexture[] { new GT_RenderedTexture( + wireMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], + Dyes.getModulation(aColorIndex, vRGB)) }; if (aConnected) { float tThickNess = getThickNess(); - if (tThickNess < 0.124F) - return new ITexture[] { - new GT_RenderedTexture( - Textures.BlockIcons.INSULATION_FULL, - Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa)) - }; + if (tThickNess < 0.124F) return new ITexture[] { new GT_RenderedTexture( + Textures.BlockIcons.INSULATION_FULL, + Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa)) }; if (tThickNess < 0.374F) // 0.375 x1 - return new ITexture[] { - new GT_RenderedTexture(wireMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], vRGB), - new GT_RenderedTexture( - Textures.BlockIcons.INSULATION_TINY, - Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa)) - }; + return new ITexture[] { + new GT_RenderedTexture(wireMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], vRGB), + new GT_RenderedTexture( + Textures.BlockIcons.INSULATION_TINY, + Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa)) }; if (tThickNess < 0.499F) // 0.500 x2 - return new ITexture[] { - new GT_RenderedTexture(wireMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], vRGB), - new GT_RenderedTexture( - Textures.BlockIcons.INSULATION_SMALL, - Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa)) - }; + return new ITexture[] { + new GT_RenderedTexture(wireMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], vRGB), + new GT_RenderedTexture( + Textures.BlockIcons.INSULATION_SMALL, + Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa)) }; if (tThickNess < 0.624F) // 0.625 x4 - return new ITexture[] { - new GT_RenderedTexture(wireMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], vRGB), - new GT_RenderedTexture( - Textures.BlockIcons.INSULATION_MEDIUM, - Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa)) - }; + return new ITexture[] { + new GT_RenderedTexture(wireMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], vRGB), + new GT_RenderedTexture( + Textures.BlockIcons.INSULATION_MEDIUM, + Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa)) }; if (tThickNess < 0.749F) // 0.750 x8 - return new ITexture[] { - new GT_RenderedTexture(wireMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], vRGB), - new GT_RenderedTexture( - INSULATION_MEDIUM_PLUS, Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa)) - }; + return new ITexture[] { + new GT_RenderedTexture(wireMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], vRGB), + new GT_RenderedTexture( + INSULATION_MEDIUM_PLUS, + Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa)) }; if (tThickNess < 0.874F) // 0.825 x12 + return new ITexture[] { + new GT_RenderedTexture(wireMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], vRGB), + new GT_RenderedTexture( + Textures.BlockIcons.INSULATION_LARGE, + Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa)) }; return new ITexture[] { new GT_RenderedTexture(wireMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], vRGB), new GT_RenderedTexture( - Textures.BlockIcons.INSULATION_LARGE, - Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa)) - }; - return new ITexture[] { - new GT_RenderedTexture(wireMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], vRGB), - new GT_RenderedTexture( - Textures.BlockIcons.INSULATION_HUGE, - Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa)) - }; + Textures.BlockIcons.INSULATION_HUGE, + Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa)) }; } - return new ITexture[] { - new GT_RenderedTexture( - Textures.BlockIcons.INSULATION_FULL, Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa)) - }; + return new ITexture[] { new GT_RenderedTexture( + Textures.BlockIcons.INSULATION_FULL, + Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa)) }; } - private ITexture[] getTexturePure( - IGregTechTileEntity aBaseMetaTileEntity, - byte aSide, - byte aConnections, - byte aColorIndex, - boolean aConnected, - boolean aRedstone) { + private ITexture[] getTexturePure(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aConnections, + byte aColorIndex, boolean aConnected, boolean aRedstone) { // if (this.vRGB == null || this.vRGB.length < 3 || this.vRGB.length > 4){ - // this.vRGB = new short[]{200, 0, 200, 0}; + // this.vRGB = new short[]{200, 0, 200, 0}; // } // if (this.vRGB.length != 4){ - // short[] tempRGB = this.vRGB; - // this.vRGB = new short[]{tempRGB[0], tempRGB[1], tempRGB[2], 0}; + // short[] tempRGB = this.vRGB; + // this.vRGB = new short[]{tempRGB[0], tempRGB[1], tempRGB[2], 0}; // } // // Materials wireMaterial = this.mMaterial; // // if (wireMaterial == null){ - // wireMaterial = Materials.Iron; + // wireMaterial = Materials.Iron; // } // With the code in constructors it should work @@ -233,63 +176,46 @@ public class GregtechMetaPipeEntity_Cable extends GT_MetaPipeEntity_Cable implem wireMaterial = Materials.Iron; } - if (!(this.mInsulated)) - return new ITexture[] { - new GT_RenderedTexture(wireMaterial.mIconSet.mTextures[69], Dyes.getModulation(aColorIndex, this.vRGB)) - }; + if (!(this.mInsulated)) return new ITexture[] { new GT_RenderedTexture( + wireMaterial.mIconSet.mTextures[69], + Dyes.getModulation(aColorIndex, this.vRGB)) }; if (aConnected) { float tThickNess = getThickNess(); - if (tThickNess < 0.124F) - return new ITexture[] { - new GT_RenderedTexture( - Textures.BlockIcons.INSULATION_FULL, - Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa)) - }; + if (tThickNess < 0.124F) return new ITexture[] { new GT_RenderedTexture( + Textures.BlockIcons.INSULATION_FULL, + Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa)) }; if (tThickNess < 0.374F) - return new ITexture[] { - new GT_RenderedTexture(wireMaterial.mIconSet.mTextures[69], this.vRGB), - new GT_RenderedTexture( - Textures.BlockIcons.INSULATION_TINY, - Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa)) - }; + return new ITexture[] { new GT_RenderedTexture(wireMaterial.mIconSet.mTextures[69], this.vRGB), + new GT_RenderedTexture( + Textures.BlockIcons.INSULATION_TINY, + Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa)) }; if (tThickNess < 0.499F) - return new ITexture[] { - new GT_RenderedTexture(wireMaterial.mIconSet.mTextures[69], this.vRGB), - new GT_RenderedTexture( - Textures.BlockIcons.INSULATION_SMALL, - Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa)) - }; + return new ITexture[] { new GT_RenderedTexture(wireMaterial.mIconSet.mTextures[69], this.vRGB), + new GT_RenderedTexture( + Textures.BlockIcons.INSULATION_SMALL, + Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa)) }; if (tThickNess < 0.624F) - return new ITexture[] { - new GT_RenderedTexture(wireMaterial.mIconSet.mTextures[69], this.vRGB), - new GT_RenderedTexture( - Textures.BlockIcons.INSULATION_MEDIUM, - Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa)) - }; + return new ITexture[] { new GT_RenderedTexture(wireMaterial.mIconSet.mTextures[69], this.vRGB), + new GT_RenderedTexture( + Textures.BlockIcons.INSULATION_MEDIUM, + Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa)) }; if (tThickNess < 0.749F) - return new ITexture[] { - new GT_RenderedTexture(wireMaterial.mIconSet.mTextures[69], this.vRGB), - new GT_RenderedTexture( - Textures.BlockIcons.INSULATION_LARGE, - Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa)) - }; + return new ITexture[] { new GT_RenderedTexture(wireMaterial.mIconSet.mTextures[69], this.vRGB), + new GT_RenderedTexture( + Textures.BlockIcons.INSULATION_LARGE, + Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa)) }; if (tThickNess < 0.874F) - return new ITexture[] { - new GT_RenderedTexture(wireMaterial.mIconSet.mTextures[69], this.vRGB), + return new ITexture[] { new GT_RenderedTexture(wireMaterial.mIconSet.mTextures[69], this.vRGB), + new GT_RenderedTexture( + Textures.BlockIcons.INSULATION_HUGE, + Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa)) }; + return new ITexture[] { new GT_RenderedTexture(wireMaterial.mIconSet.mTextures[69], this.vRGB), new GT_RenderedTexture( - Textures.BlockIcons.INSULATION_HUGE, - Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa)) - }; - return new ITexture[] { - new GT_RenderedTexture(wireMaterial.mIconSet.mTextures[69], this.vRGB), - new GT_RenderedTexture( - Textures.BlockIcons.INSULATION_FULL, - Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa)) - }; + Textures.BlockIcons.INSULATION_FULL, + Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa)) }; } - return new ITexture[] { - new GT_RenderedTexture( - Textures.BlockIcons.INSULATION_FULL, Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa)) - }; + return new ITexture[] { new GT_RenderedTexture( + Textures.BlockIcons.INSULATION_FULL, + Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa)) }; } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GregtechMetaTreeFarmerStructural.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GregtechMetaTreeFarmerStructural.java index 14399e525d..acd2e316aa 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GregtechMetaTreeFarmerStructural.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GregtechMetaTreeFarmerStructural.java @@ -1,48 +1,44 @@ package gtPlusPlus.xmod.gregtech.api.metatileentity.implementations; +import net.minecraft.nbt.NBTTagCompound; + import gregtech.api.enums.Textures; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.objects.GT_RenderedTexture; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.machines.GregtechMetaTreeFarmerBase; -import net.minecraft.nbt.NBTTagCompound; public class GregtechMetaTreeFarmerStructural extends GregtechMetaTreeFarmerBase { @Override public String[] getDescription() { - return new String[] {this.mDescription}; + return new String[] { this.mDescription }; } - public GregtechMetaTreeFarmerStructural( - final int aID, final String aName, final String aNameRegional, final int aTier) { + public GregtechMetaTreeFarmerStructural(final int aID, final String aName, final String aNameRegional, + final int aTier) { super(aID, aName, aNameRegional, aTier, 0, "Structural Blocks for the Tree Farmer."); } - public GregtechMetaTreeFarmerStructural( - final int aID, - final String aName, - final String aNameRegional, - final int aTier, - final int aInvSlotCount, - final String aDescription) { + public GregtechMetaTreeFarmerStructural(final int aID, final String aName, final String aNameRegional, + final int aTier, final int aInvSlotCount, final String aDescription) { super(aID, aName, aNameRegional, aTier, aInvSlotCount, aDescription); } - public GregtechMetaTreeFarmerStructural( - final String aName, - final int aTier, - final int aInvSlotCount, - final String aDescription, - final ITexture[][][] aTextures) { + public GregtechMetaTreeFarmerStructural(final String aName, final int aTier, final int aInvSlotCount, + final String aDescription, final ITexture[][][] aTextures) { super(aName, aTier, aInvSlotCount, aDescription, aTextures); } @Override public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) { return new GregtechMetaTreeFarmerStructural( - this.mName, this.mTier, this.mInventory.length, this.mDescription, this.mTextures); + this.mName, + this.mTier, + this.mInventory.length, + this.mDescription, + this.mTextures); } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/CustomMetaTileBase.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/CustomMetaTileBase.java index 89bbe99771..ca4b938718 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/CustomMetaTileBase.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/CustomMetaTileBase.java @@ -1,12 +1,14 @@ package gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base; +import java.util.Locale; + +import net.minecraft.item.ItemStack; + import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.util.GT_LanguageManager; import gtPlusPlus.xmod.gregtech.api.interfaces.IBaseCustomMetaTileEntity; import gtPlusPlus.xmod.gregtech.common.Meta_GT_Proxy; -import java.util.Locale; -import net.minecraft.item.ItemStack; public abstract class CustomMetaTileBase extends MetaTileEntity { @@ -39,8 +41,7 @@ public abstract class CustomMetaTileBase extends MetaTileEntity { @Override public void setBaseMetaTileEntity(IGregTechTileEntity aBaseMetaTileEntity) { super.setBaseMetaTileEntity(aBaseMetaTileEntity); - if (mBaseCustomMetaTileEntity != null - && aBaseMetaTileEntity == null + if (mBaseCustomMetaTileEntity != null && aBaseMetaTileEntity == null && mBaseCustomMetaTileEntity.getMetaTileEntity() != null) { mBaseCustomMetaTileEntity.getMetaTileEntity().inValidate(); mBaseCustomMetaTileEntity.setMetaTileEntity(null); @@ -56,10 +57,7 @@ public abstract class CustomMetaTileBase extends MetaTileEntity { } public ItemStack getStackForm(long aAmount) { - return new ItemStack( - Meta_GT_Proxy.sBlockMachines, - (int) aAmount, - this.getBaseMetaTileEntity().getMetaTileID()); + return new ItemStack(Meta_GT_Proxy.sBlockMachines, (int) aAmount, this.getBaseMetaTileEntity().getMetaTileID()); } public String getLocalName() { @@ -69,25 +67,17 @@ public abstract class CustomMetaTileBase extends MetaTileEntity { /** * This determines the BaseMetaTileEntity belonging to this MetaTileEntity by using the Meta ID of the Block itself. * <p/> - * 0 = BaseMetaTileEntity, Wrench lvl 0 to dismantlee - * 1 = BaseMetaTileEntity, Wrench lvl 1 to dismantle - * 2 = BaseMetaTileEntity, Wrench lvl 2 to dismantle - * 3 = BaseMetaTileEntity, Wrench lvl 3 to dismantle - * 4 = BaseMetaPipeEntity, Wrench lvl 0 to dismantle - * 5 = BaseMetaPipeEntity, Wrench lvl 1 to dismantle - * 6 = BaseMetaPipeEntity, Wrench lvl 2 to dismantle - * 7 = BaseMetaPipeEntity, Wrench lvl 3 to dismantle - * 8 = BaseMetaPipeEntity, Cutter lvl 0 to dismantle - * 9 = BaseMetaPipeEntity, Cutter lvl 1 to dismantle - * 10 = BaseMetaPipeEntity, Cutter lvl 2 to dismantle - * 11 = BaseMetaPipeEntity, Cutter lvl 3 to dismantle + * 0 = BaseMetaTileEntity, Wrench lvl 0 to dismantlee 1 = BaseMetaTileEntity, Wrench lvl 1 to dismantle 2 = + * BaseMetaTileEntity, Wrench lvl 2 to dismantle 3 = BaseMetaTileEntity, Wrench lvl 3 to dismantle 4 = + * BaseMetaPipeEntity, Wrench lvl 0 to dismantle 5 = BaseMetaPipeEntity, Wrench lvl 1 to dismantle 6 = + * BaseMetaPipeEntity, Wrench lvl 2 to dismantle 7 = BaseMetaPipeEntity, Wrench lvl 3 to dismantle 8 = + * BaseMetaPipeEntity, Cutter lvl 0 to dismantle 9 = BaseMetaPipeEntity, Cutter lvl 1 to dismantle 10 = + * BaseMetaPipeEntity, Cutter lvl 2 to dismantle 11 = BaseMetaPipeEntity, Cutter lvl 3 to dismantle * * == Reserved for Alk now * - * 12 = BaseMetaPipeEntity, Wrench lvl 0 to dismantle - * 13 = BaseMetaPipeEntity, Wrench lvl 1 to dismantle - * 14 = BaseMetaPipeEntity, Wrench lvl 2 to dismantle - * 15 = BaseMetaPipeEntity, Wrench lvl 3 to dismantle + * 12 = BaseMetaPipeEntity, Wrench lvl 0 to dismantle 13 = BaseMetaPipeEntity, Wrench lvl 1 to dismantle 14 = + * BaseMetaPipeEntity, Wrench lvl 2 to dismantle 15 = BaseMetaPipeEntity, Wrench lvl 3 to dismantle */ @Override public byte getTileEntityBaseType() { diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GT_MetaTileEntity_Hatch_CustomFluidBase.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GT_MetaTileEntity_Hatch_CustomFluidBase.java index 16a4184c9d..7eb7eb22f2 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GT_MetaTileEntity_Hatch_CustomFluidBase.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GT_MetaTileEntity_Hatch_CustomFluidBase.java @@ -3,6 +3,12 @@ package gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base; import static gregtech.api.enums.Textures.BlockIcons.FLUID_IN_SIGN; import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_PIPE_IN; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidStack; + import gregtech.GT_Mod; import gregtech.api.gui.modularui.GT_UIInfos; import gregtech.api.interfaces.ITexture; @@ -14,11 +20,6 @@ import gregtech.api.util.GT_Utility; import gregtech.common.gui.modularui.widget.FluidDisplaySlotWidget; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.util.minecraft.FluidUtils; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.util.EnumChatFormatting; -import net.minecraftforge.fluids.Fluid; -import net.minecraftforge.fluids.FluidStack; public class GT_MetaTileEntity_Hatch_CustomFluidBase extends GT_MetaTileEntity_Hatch { @@ -27,35 +28,35 @@ public class GT_MetaTileEntity_Hatch_CustomFluidBase extends GT_MetaTileEntity_H protected FluidStack mLockedStack = null; protected String mTempMod = null; - public GT_MetaTileEntity_Hatch_CustomFluidBase( - Fluid aFluid, int aAmount, final int aID, final String aName, final String aNameRegional) { - super(aID, aName, aNameRegional, 6, 3, new String[] { - "Fluid Input for Multiblocks", "Capacity: " + GT_Utility.formatNumbers(aAmount) + "L" - }); + public GT_MetaTileEntity_Hatch_CustomFluidBase(Fluid aFluid, int aAmount, final int aID, final String aName, + final String aNameRegional) { + super( + aID, + aName, + aNameRegional, + 6, + 3, + new String[] { "Fluid Input for Multiblocks", "Capacity: " + GT_Utility.formatNumbers(aAmount) + "L" }); this.mLockedFluid = aFluid; this.mFluidCapacity = aAmount; } - public GT_MetaTileEntity_Hatch_CustomFluidBase( - Fluid aFluid, int aAmount, final String aName, final String aDescription, final ITexture[][][] aTextures) { + public GT_MetaTileEntity_Hatch_CustomFluidBase(Fluid aFluid, int aAmount, final String aName, + final String aDescription, final ITexture[][][] aTextures) { super(aName, 6, 3, aDescription, aTextures); this.mLockedFluid = aFluid; this.mFluidCapacity = aAmount; } - public GT_MetaTileEntity_Hatch_CustomFluidBase( - Fluid aFluid, - int aAmount, - final String aName, - final String[] aDescription, - final ITexture[][][] aTextures) { + public GT_MetaTileEntity_Hatch_CustomFluidBase(Fluid aFluid, int aAmount, final String aName, + final String[] aDescription, final ITexture[][][] aTextures) { super(aName, 6, 3, aDescription[0], aTextures); this.mLockedFluid = aFluid; this.mFluidCapacity = aAmount; } - public boolean allowPutStack( - final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, final ItemStack aStack) { + public boolean allowPutStack(final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, + final ItemStack aStack) { if (aSide == aBaseMetaTileEntity.getFrontFacing() && aIndex == 0) { FluidStack fs = GT_Utility.getFluidForFilledItem(aStack, true); return fs != null && fs.getFluid() == this.mLockedFluid; @@ -71,15 +72,15 @@ public class GT_MetaTileEntity_Hatch_CustomFluidBase extends GT_MetaTileEntity_H @Override public ITexture[] getTexturesActive(ITexture aBaseTexture) { return GT_Mod.gregtechproxy.mRenderIndicatorsOnHatch - ? new ITexture[] {aBaseTexture, TextureFactory.of(OVERLAY_PIPE_IN), TextureFactory.of(FLUID_IN_SIGN)} - : new ITexture[] {aBaseTexture, TextureFactory.of(OVERLAY_PIPE_IN)}; + ? new ITexture[] { aBaseTexture, TextureFactory.of(OVERLAY_PIPE_IN), TextureFactory.of(FLUID_IN_SIGN) } + : new ITexture[] { aBaseTexture, TextureFactory.of(OVERLAY_PIPE_IN) }; } @Override public ITexture[] getTexturesInactive(ITexture aBaseTexture) { return GT_Mod.gregtechproxy.mRenderIndicatorsOnHatch - ? new ITexture[] {aBaseTexture, TextureFactory.of(OVERLAY_PIPE_IN), TextureFactory.of(FLUID_IN_SIGN)} - : new ITexture[] {aBaseTexture, TextureFactory.of(OVERLAY_PIPE_IN)}; + ? new ITexture[] { aBaseTexture, TextureFactory.of(OVERLAY_PIPE_IN), TextureFactory.of(FLUID_IN_SIGN) } + : new ITexture[] { aBaseTexture, TextureFactory.of(OVERLAY_PIPE_IN) }; } @Override @@ -180,13 +181,10 @@ public class GT_MetaTileEntity_Hatch_CustomFluidBase extends GT_MetaTileEntity_H aColour = EnumChatFormatting.RED; } String aFluidName = "Accepted Fluid: " + aColour - + (mLockedStack != null ? mLockedStack.getLocalizedName() : "Empty") + EnumChatFormatting.RESET; - return new String[] { - "Fluid Input for " + (isSteam ? "Steam " : "") + "Multiblocks", - "Capacity: " + getCapacity() + "L", - aFluidName, - CORE.GT_Tooltip - }; + + (mLockedStack != null ? mLockedStack.getLocalizedName() : "Empty") + + EnumChatFormatting.RESET; + return new String[] { "Fluid Input for " + (isSteam ? "Steam " : "") + "Multiblocks", + "Capacity: " + getCapacity() + "L", aFluidName, CORE.GT_Tooltip }; } public boolean isFluidInputAllowed(final FluidStack aFluid) { @@ -195,7 +193,11 @@ public class GT_MetaTileEntity_Hatch_CustomFluidBase extends GT_MetaTileEntity_H public MetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) { return new GT_MetaTileEntity_Hatch_CustomFluidBase( - this.mLockedFluid, this.mFluidCapacity, this.mName, this.mDescription, this.mTextures); + this.mLockedFluid, + this.mFluidCapacity, + this.mName, + this.mDescription, + this.mTextures); } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMetaPipeEntityBase_Cable.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMetaPipeEntityBase_Cable.java index efc2d008bb..6a5fb9d4d2 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMetaPipeEntityBase_Cable.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMetaPipeEntityBase_Cable.java @@ -2,6 +2,21 @@ package gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base; import static gregtech.api.enums.GT_Values.VN; +import java.lang.reflect.Field; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashSet; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; + import cofh.api.energy.IEnergyReceiver; import gregtech.GT_Mod; import gregtech.api.GregTech_API; @@ -23,21 +38,9 @@ import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.xmod.gregtech.api.enums.GregtechOrePrefixes.GT_Materials; import ic2.api.energy.tile.IEnergySink; -import java.lang.reflect.Field; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashSet; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.world.World; -import net.minecraftforge.common.util.ForgeDirection; public class GregtechMetaPipeEntityBase_Cable extends MetaPipeEntity implements IMetaTileEntityCable { + public final float mThickNess; public final GT_Materials mMaterial; public final long mCableLossPerMeter, mAmperage, mVoltage; @@ -47,17 +50,9 @@ public class GregtechMetaPipeEntityBase_Cable extends MetaPipeEntity implements public short mOverheat; public final int mWireHeatingTicks; - public GregtechMetaPipeEntityBase_Cable( - final int aID, - final String aName, - final String aNameRegional, - final float aThickNess, - final GT_Materials aMaterial, - final long aCableLossPerMeter, - final long aAmperage, - final long aVoltage, - final boolean aInsulated, - final boolean aCanShock) { + public GregtechMetaPipeEntityBase_Cable(final int aID, final String aName, final String aNameRegional, + final float aThickNess, final GT_Materials aMaterial, final long aCableLossPerMeter, final long aAmperage, + final long aVoltage, final boolean aInsulated, final boolean aCanShock) { super(aID, aName, aNameRegional, 0); this.mThickNess = aThickNess; this.mMaterial = aMaterial; @@ -69,14 +64,8 @@ public class GregtechMetaPipeEntityBase_Cable extends MetaPipeEntity implements this.mWireHeatingTicks = this.getGT5Var(); } - public GregtechMetaPipeEntityBase_Cable( - final String aName, - final float aThickNess, - final GT_Materials aMaterial, - final long aCableLossPerMeter, - final long aAmperage, - final long aVoltage, - final boolean aInsulated, + public GregtechMetaPipeEntityBase_Cable(final String aName, final float aThickNess, final GT_Materials aMaterial, + final long aCableLossPerMeter, final long aAmperage, final long aVoltage, final boolean aInsulated, final boolean aCanShock) { super(aName, 0); this.mThickNess = aThickNess; @@ -133,77 +122,73 @@ public class GregtechMetaPipeEntityBase_Cable extends MetaPipeEntity implements } @Override - public ITexture[] getTexture( - final IGregTechTileEntity aBaseMetaTileEntity, - final byte aSide, - final byte aConnections, - final byte aColorIndex, - final boolean aConnected, - final boolean aRedstone) { + public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, + final byte aConnections, final byte aColorIndex, final boolean aConnected, final boolean aRedstone) { if (!this.mInsulated) { - return new ITexture[] { - new GT_RenderedTexture(this.mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], this.mMaterial.mRGBa) - }; + return new ITexture[] { new GT_RenderedTexture( + this.mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], + this.mMaterial.mRGBa) }; } if (aConnected) { final float tThickNess = this.getThickNess(); if (tThickNess < 0.37F) { return new ITexture[] { - new GT_RenderedTexture( - this.mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], this.mMaterial.mRGBa), - new GT_RenderedTexture( - Textures.BlockIcons.INSULATION_TINY, - Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa)) - }; + new GT_RenderedTexture( + this.mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], + this.mMaterial.mRGBa), + new GT_RenderedTexture( + Textures.BlockIcons.INSULATION_TINY, + Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa)) }; } if (tThickNess < 0.49F) { return new ITexture[] { - new GT_RenderedTexture( - this.mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], this.mMaterial.mRGBa), - new GT_RenderedTexture( - Textures.BlockIcons.INSULATION_SMALL, - Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa)) - }; + new GT_RenderedTexture( + this.mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], + this.mMaterial.mRGBa), + new GT_RenderedTexture( + Textures.BlockIcons.INSULATION_SMALL, + Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa)) }; } if (tThickNess < 0.74F) { return new ITexture[] { - new GT_RenderedTexture( - this.mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], this.mMaterial.mRGBa), - new GT_RenderedTexture( - Textures.BlockIcons.INSULATION_MEDIUM, - Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa)) - }; + new GT_RenderedTexture( + this.mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], + this.mMaterial.mRGBa), + new GT_RenderedTexture( + Textures.BlockIcons.INSULATION_MEDIUM, + Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa)) }; } if (tThickNess < 0.99F) { return new ITexture[] { - new GT_RenderedTexture( - this.mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], this.mMaterial.mRGBa), - new GT_RenderedTexture( - Textures.BlockIcons.INSULATION_LARGE, - Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa)) - }; + new GT_RenderedTexture( + this.mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], + this.mMaterial.mRGBa), + new GT_RenderedTexture( + Textures.BlockIcons.INSULATION_LARGE, + Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa)) }; } return new ITexture[] { - new GT_RenderedTexture(this.mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], this.mMaterial.mRGBa), - new GT_RenderedTexture( - Textures.BlockIcons.INSULATION_HUGE, - Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa)) - }; + new GT_RenderedTexture( + this.mMaterial.mIconSet.mTextures[TextureSet.INDEX_wire], + this.mMaterial.mRGBa), + new GT_RenderedTexture( + Textures.BlockIcons.INSULATION_HUGE, + Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa)) }; } - return new ITexture[] { - new GT_RenderedTexture( - Textures.BlockIcons.INSULATION_FULL, Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa)) - }; + return new ITexture[] { new GT_RenderedTexture( + Textures.BlockIcons.INSULATION_FULL, + Dyes.getModulation(aColorIndex, Dyes.CABLE_INSULATION.mRGBa)) }; } @Override - public void onEntityCollidedWithBlock( - final World aWorld, final int aX, final int aY, final int aZ, final Entity aEntity) { - if (this.mCanShock - && ((((BaseMetaPipeEntity) this.getBaseMetaTileEntity()).mConnections & -128) == 0) + public void onEntityCollidedWithBlock(final World aWorld, final int aX, final int aY, final int aZ, + final Entity aEntity) { + if (this.mCanShock && ((((BaseMetaPipeEntity) this.getBaseMetaTileEntity()).mConnections & -128) == 0) && (aEntity instanceof EntityLivingBase)) { GT_Utility.applyElectricityDamage( - (EntityLivingBase) aEntity, this.mTransferredVoltageLast20, this.mTransferredAmperageLast20); + (EntityLivingBase) aEntity, + this.mTransferredVoltageLast20, + this.mTransferredAmperageLast20); } } @@ -212,8 +197,8 @@ public class GregtechMetaPipeEntityBase_Cable extends MetaPipeEntity implements if (!this.mCanShock) { return super.getCollisionBoundingBoxFromPool(aWorld, aX, aY, aZ); } - return AxisAlignedBB.getBoundingBox( - aX + 0.125D, aY + 0.125D, aZ + 0.125D, aX + 0.875D, aY + 0.875D, aZ + 0.875D); + return AxisAlignedBB + .getBoundingBox(aX + 0.125D, aY + 0.125D, aZ + 0.125D, aX + 0.875D, aY + 0.875D, aZ + 0.875D); } @Override @@ -248,21 +233,23 @@ public class GregtechMetaPipeEntityBase_Cable extends MetaPipeEntity implements @Override public long injectEnergyUnits(final byte aSide, final long aVoltage, final long aAmperage) { - if (!this.getBaseMetaTileEntity() - .getCoverBehaviorAtSide(aSide) - .letsEnergyIn( - aSide, - this.getBaseMetaTileEntity().getCoverIDAtSide(aSide), - this.getBaseMetaTileEntity().getCoverDataAtSide(aSide), - this.getBaseMetaTileEntity())) { + if (!this.getBaseMetaTileEntity().getCoverBehaviorAtSide(aSide).letsEnergyIn( + aSide, + this.getBaseMetaTileEntity().getCoverIDAtSide(aSide), + this.getBaseMetaTileEntity().getCoverDataAtSide(aSide), + this.getBaseMetaTileEntity())) { return 0; } return this.transferElectricity( - aSide, aVoltage, aAmperage, new ArrayList<>(Arrays.asList((TileEntity) this.getBaseMetaTileEntity()))); + aSide, + aVoltage, + aAmperage, + new ArrayList<>(Arrays.asList((TileEntity) this.getBaseMetaTileEntity()))); } /** - * Adds support for the newer function added by https://github.com/Blood-Asp/GT5-Unofficial/commit/73ee102b63efd92c0f164a7ed7a79ebcd2619617#diff-3051838621d8ae87aa5ccd1345e1f07d + * Adds support for the newer function added by + * https://github.com/Blood-Asp/GT5-Unofficial/commit/73ee102b63efd92c0f164a7ed7a79ebcd2619617#diff-3051838621d8ae87aa5ccd1345e1f07d */ public long transferElectricity(byte arg0, long arg1, long arg2, HashSet<TileEntity> arg3) { ArrayList<TileEntity> aTiles = new ArrayList<TileEntity>(); @@ -273,42 +260,33 @@ public class GregtechMetaPipeEntityBase_Cable extends MetaPipeEntity implements } @Override - public long transferElectricity( - final byte aSide, - long aVoltage, - final long aAmperage, + public long transferElectricity(final byte aSide, long aVoltage, final long aAmperage, final ArrayList<TileEntity> aAlreadyPassedTileEntityList) { long rUsedAmperes = 0; aVoltage -= this.mCableLossPerMeter; if (aVoltage > 0) { for (byte i = 0; (i < 6) && (aAmperage > rUsedAmperes); i++) { - if ((i != aSide) - && ((this.mConnections & (1 << i)) != 0) - && this.getBaseMetaTileEntity() - .getCoverBehaviorAtSide(i) - .letsEnergyOut( - i, - this.getBaseMetaTileEntity().getCoverIDAtSide(i), - this.getBaseMetaTileEntity().getCoverDataAtSide(i), - this.getBaseMetaTileEntity())) { + if ((i != aSide) && ((this.mConnections & (1 << i)) != 0) + && this.getBaseMetaTileEntity().getCoverBehaviorAtSide(i).letsEnergyOut( + i, + this.getBaseMetaTileEntity().getCoverIDAtSide(i), + this.getBaseMetaTileEntity().getCoverDataAtSide(i), + this.getBaseMetaTileEntity())) { final TileEntity tTileEntity = this.getBaseMetaTileEntity().getTileEntityAtSide(i); if (!aAlreadyPassedTileEntityList.contains(tTileEntity)) { aAlreadyPassedTileEntityList.add(tTileEntity); if (tTileEntity instanceof IEnergyConnected) { if (this.getBaseMetaTileEntity().getColorization() >= 0) { final byte tColor = ((IEnergyConnected) tTileEntity).getColorization(); - if ((tColor >= 0) - && (tColor - != this.getBaseMetaTileEntity().getColorization())) { + if ((tColor >= 0) && (tColor != this.getBaseMetaTileEntity().getColorization())) { continue; } } if ((tTileEntity instanceof IGregTechTileEntity) - && (((IGregTechTileEntity) tTileEntity).getMetaTileEntity() - instanceof IMetaTileEntityCable) + && (((IGregTechTileEntity) tTileEntity) + .getMetaTileEntity() instanceof IMetaTileEntityCable) && ((IGregTechTileEntity) tTileEntity) - .getCoverBehaviorAtSide(GT_Utility.getOppositeSide(i)) - .letsEnergyIn( + .getCoverBehaviorAtSide(GT_Utility.getOppositeSide(i)).letsEnergyIn( GT_Utility.getOppositeSide(i), ((IGregTechTileEntity) tTileEntity) .getCoverIDAtSide(GT_Utility.getOppositeSide(i)), @@ -316,18 +294,18 @@ public class GregtechMetaPipeEntityBase_Cable extends MetaPipeEntity implements .getCoverDataAtSide(GT_Utility.getOppositeSide(i)), ((IGregTechTileEntity) tTileEntity))) { if (((IGregTechTileEntity) tTileEntity).getTimer() > 50) { - rUsedAmperes += ((IMetaTileEntityCable) - ((IGregTechTileEntity) tTileEntity).getMetaTileEntity()) - .transferElectricity( + rUsedAmperes += ((IMetaTileEntityCable) ((IGregTechTileEntity) tTileEntity) + .getMetaTileEntity()).transferElectricity( GT_Utility.getOppositeSide(i), aVoltage, aAmperage - rUsedAmperes, aAlreadyPassedTileEntityList); } } else { - rUsedAmperes += ((IEnergyConnected) tTileEntity) - .injectEnergyUnits( - GT_Utility.getOppositeSide(i), aVoltage, aAmperage - rUsedAmperes); + rUsedAmperes += ((IEnergyConnected) tTileEntity).injectEnergyUnits( + GT_Utility.getOppositeSide(i), + aVoltage, + aAmperage - rUsedAmperes); } // } else if (tTileEntity instanceof IEnergySink) { // ForgeDirection tDirection = @@ -342,8 +320,7 @@ public class GregtechMetaPipeEntityBase_Cable extends MetaPipeEntity implements // aVoltage) < aVoltage) rUsedAmperes++; // } } else if (tTileEntity instanceof IEnergySink) { - final ForgeDirection tDirection = - ForgeDirection.getOrientation(i).getOpposite(); + final ForgeDirection tDirection = ForgeDirection.getOrientation(i).getOpposite(); if (((IEnergySink) tTileEntity) .acceptsEnergyFrom((TileEntity) this.getBaseMetaTileEntity(), tDirection)) { if ((((IEnergySink) tTileEntity).getDemandedEnergy() > 0) @@ -353,16 +330,15 @@ public class GregtechMetaPipeEntityBase_Cable extends MetaPipeEntity implements } } } else if (GregTech_API.mOutputRF && (tTileEntity instanceof IEnergyReceiver)) { - final ForgeDirection tDirection = - ForgeDirection.getOrientation(i).getOpposite(); + final ForgeDirection tDirection = ForgeDirection.getOrientation(i).getOpposite(); final int rfOut = (int) ((aVoltage * GregTech_API.mEUtoRF) / 100); if (((IEnergyReceiver) tTileEntity).receiveEnergy(tDirection, rfOut, true) == rfOut) { ((IEnergyReceiver) tTileEntity).receiveEnergy(tDirection, rfOut, false); rUsedAmperes++; } else if (((IEnergyReceiver) tTileEntity).receiveEnergy(tDirection, rfOut, true) > 0) { if (this.mRestRF == 0) { - final int RFtrans = - ((IEnergyReceiver) tTileEntity).receiveEnergy(tDirection, rfOut, false); + final int RFtrans = ((IEnergyReceiver) tTileEntity) + .receiveEnergy(tDirection, rfOut, false); rUsedAmperes++; this.mRestRF = rfOut - RFtrans; } else { @@ -422,27 +398,21 @@ public class GregtechMetaPipeEntityBase_Cable extends MetaPipeEntity implements this.mConnections = 0; for (byte i = 0, j = 0; i < 6; i++) { j = GT_Utility.getOppositeSide(i); - if (aBaseMetaTileEntity - .getCoverBehaviorAtSide(i) - .alwaysLookConnected( - i, - aBaseMetaTileEntity.getCoverIDAtSide(i), - aBaseMetaTileEntity.getCoverDataAtSide(i), - aBaseMetaTileEntity) - || aBaseMetaTileEntity - .getCoverBehaviorAtSide(i) - .letsEnergyIn( - i, - aBaseMetaTileEntity.getCoverIDAtSide(i), - aBaseMetaTileEntity.getCoverDataAtSide(i), - aBaseMetaTileEntity) - || aBaseMetaTileEntity - .getCoverBehaviorAtSide(i) - .letsEnergyOut( - i, - aBaseMetaTileEntity.getCoverIDAtSide(i), - aBaseMetaTileEntity.getCoverDataAtSide(i), - aBaseMetaTileEntity)) { + if (aBaseMetaTileEntity.getCoverBehaviorAtSide(i).alwaysLookConnected( + i, + aBaseMetaTileEntity.getCoverIDAtSide(i), + aBaseMetaTileEntity.getCoverDataAtSide(i), + aBaseMetaTileEntity) + || aBaseMetaTileEntity.getCoverBehaviorAtSide(i).letsEnergyIn( + i, + aBaseMetaTileEntity.getCoverIDAtSide(i), + aBaseMetaTileEntity.getCoverDataAtSide(i), + aBaseMetaTileEntity) + || aBaseMetaTileEntity.getCoverBehaviorAtSide(i).letsEnergyOut( + i, + aBaseMetaTileEntity.getCoverIDAtSide(i), + aBaseMetaTileEntity.getCoverDataAtSide(i), + aBaseMetaTileEntity)) { final TileEntity tTileEntity = aBaseMetaTileEntity.getTileEntityAtSide(i); if (tTileEntity instanceof IColoredTileEntity) { if (aBaseMetaTileEntity.getColorization() >= 0) { @@ -458,53 +428,42 @@ public class GregtechMetaPipeEntityBase_Cable extends MetaPipeEntity implements this.mConnections |= (1 << i); continue; } - if ((tTileEntity instanceof IGregTechTileEntity) - && (((IGregTechTileEntity) tTileEntity).getMetaTileEntity() - instanceof IMetaTileEntityCable)) { - if (((IGregTechTileEntity) tTileEntity) - .getCoverBehaviorAtSide(j) - .alwaysLookConnected( - j, - ((IGregTechTileEntity) tTileEntity).getCoverIDAtSide(j), - ((IGregTechTileEntity) tTileEntity).getCoverDataAtSide(j), - ((IGregTechTileEntity) tTileEntity)) - || ((IGregTechTileEntity) tTileEntity) - .getCoverBehaviorAtSide(j) - .letsEnergyIn( - j, - ((IGregTechTileEntity) tTileEntity).getCoverIDAtSide(j), - ((IGregTechTileEntity) tTileEntity).getCoverDataAtSide(j), - ((IGregTechTileEntity) tTileEntity)) - || ((IGregTechTileEntity) tTileEntity) - .getCoverBehaviorAtSide(j) - .letsEnergyOut( - j, - ((IGregTechTileEntity) tTileEntity).getCoverIDAtSide(j), - ((IGregTechTileEntity) tTileEntity).getCoverDataAtSide(j), - ((IGregTechTileEntity) tTileEntity))) { + if ((tTileEntity instanceof IGregTechTileEntity) && (((IGregTechTileEntity) tTileEntity) + .getMetaTileEntity() instanceof IMetaTileEntityCable)) { + if (((IGregTechTileEntity) tTileEntity).getCoverBehaviorAtSide(j).alwaysLookConnected( + j, + ((IGregTechTileEntity) tTileEntity).getCoverIDAtSide(j), + ((IGregTechTileEntity) tTileEntity).getCoverDataAtSide(j), + ((IGregTechTileEntity) tTileEntity)) + || ((IGregTechTileEntity) tTileEntity).getCoverBehaviorAtSide(j).letsEnergyIn( + j, + ((IGregTechTileEntity) tTileEntity).getCoverIDAtSide(j), + ((IGregTechTileEntity) tTileEntity).getCoverDataAtSide(j), + ((IGregTechTileEntity) tTileEntity)) + || ((IGregTechTileEntity) tTileEntity).getCoverBehaviorAtSide(j).letsEnergyOut( + j, + ((IGregTechTileEntity) tTileEntity).getCoverIDAtSide(j), + ((IGregTechTileEntity) tTileEntity).getCoverDataAtSide(j), + ((IGregTechTileEntity) tTileEntity))) { this.mConnections |= (1 << i); continue; } } - if ((tTileEntity instanceof IEnergySink) - && ((IEnergySink) tTileEntity) - .acceptsEnergyFrom( - (TileEntity) aBaseMetaTileEntity, ForgeDirection.getOrientation(j))) { + if ((tTileEntity instanceof IEnergySink) && ((IEnergySink) tTileEntity).acceptsEnergyFrom( + (TileEntity) aBaseMetaTileEntity, + ForgeDirection.getOrientation(j))) { this.mConnections |= (1 << i); continue; } - if (GregTech_API.mOutputRF - && (tTileEntity instanceof IEnergyReceiver) + if (GregTech_API.mOutputRF && (tTileEntity instanceof IEnergyReceiver) && ((IEnergyReceiver) tTileEntity).canConnectEnergy(ForgeDirection.getOrientation(j))) { this.mConnections |= (1 << i); continue; } /* - * if (tTileEntity instanceof IEnergyEmitter && - * ((IEnergyEmitter)tTileEntity).emitsEnergyTo(( - * TileEntity)aBaseMetaTileEntity, - * ForgeDirection.getOrientation(j))) { mConnections |= - * (1<<i); continue; } + * if (tTileEntity instanceof IEnergyEmitter && ((IEnergyEmitter)tTileEntity).emitsEnergyTo(( + * TileEntity)aBaseMetaTileEntity, ForgeDirection.getOrientation(j))) { mConnections |= (1<<i); + * continue; } */ } } @@ -513,26 +472,31 @@ public class GregtechMetaPipeEntityBase_Cable extends MetaPipeEntity implements } @Override - public boolean allowPullStack( - final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, final ItemStack aStack) { + public boolean allowPullStack(final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, + final ItemStack aStack) { return false; } @Override - public boolean allowPutStack( - final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, final ItemStack aStack) { + public boolean allowPutStack(final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, + final ItemStack aStack) { return false; } @Override public String[] getDescription() { return new String[] { - "Max Voltage: " + EnumChatFormatting.GREEN + this.mVoltage + " (" + VN[GT_Utility.getTier(this.mVoltage)] - + ")" + EnumChatFormatting.GRAY, - "Max Amperage: " + EnumChatFormatting.YELLOW + this.mAmperage + EnumChatFormatting.GRAY, - "Loss/Meter/Ampere: " + EnumChatFormatting.RED + this.mCableLossPerMeter + EnumChatFormatting.GRAY - + " EU-Volt" - }; + "Max Voltage: " + EnumChatFormatting.GREEN + + this.mVoltage + + " (" + + VN[GT_Utility.getTier(this.mVoltage)] + + ")" + + EnumChatFormatting.GRAY, + "Max Amperage: " + EnumChatFormatting.YELLOW + this.mAmperage + EnumChatFormatting.GRAY, + "Loss/Meter/Ampere: " + EnumChatFormatting.RED + + this.mCableLossPerMeter + + EnumChatFormatting.GRAY + + " EU-Volt" }; } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMetaTileEntity.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMetaTileEntity.java index 41f434f7e6..b727c0d84a 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMetaTileEntity.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMetaTileEntity.java @@ -6,6 +6,7 @@ import gregtech.api.interfaces.ITexture; import gregtech.api.metatileentity.MetaTileEntity; public abstract class GregtechMetaTileEntity extends MetaTileEntity { + /** * Value between [0 - 9] to describe the Tier of this Machine. */ @@ -21,14 +22,8 @@ public abstract class GregtechMetaTileEntity extends MetaTileEntity { */ public final ITexture[][][] mTextures; - public GregtechMetaTileEntity( - final int aID, - final String aName, - final String aNameRegional, - final int aTier, - final int aInvSlotCount, - final String aDescription, - final ITexture... aTextures) { + public GregtechMetaTileEntity(final int aID, final String aName, final String aNameRegional, final int aTier, + final int aInvSlotCount, final String aDescription, final ITexture... aTextures) { super(aID, aName, aNameRegional, aInvSlotCount); this.mTier = (byte) Math.max(0, Math.min(aTier, 9)); this.mDescription = aDescription; @@ -41,12 +36,8 @@ public abstract class GregtechMetaTileEntity extends MetaTileEntity { } } - public GregtechMetaTileEntity( - final String aName, - final int aTier, - final int aInvSlotCount, - final String aDescription, - final ITexture[][][] aTextures) { + public GregtechMetaTileEntity(final String aName, final int aTier, final int aInvSlotCount, + final String aDescription, final ITexture[][][] aTextures) { super(aName, aInvSlotCount); this.mTier = (byte) aTier; this.mDescription = aDescription; @@ -70,15 +61,14 @@ public abstract class GregtechMetaTileEntity extends MetaTileEntity { @Override public String[] getDescription() { - return new String[] {this.mDescription}; + return new String[] { this.mDescription }; } /** - * Used Client Side to get a Texture Set for this Block. Called after - * setting the Tier and the Description so that those two are accessible. + * Used Client Side to get a Texture Set for this Block. Called after setting the Tier and the Description so that + * those two are accessible. * - * @param aTextures - * is the optional Array you can give to the Constructor. + * @param aTextures is the optional Array you can give to the Constructor. */ public abstract ITexture[][][] getTextureSet(ITexture[] aTextures); } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMetaTransformerHiAmp.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMetaTransformerHiAmp.java index e900aac944..f881f6f5f2 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMetaTransformerHiAmp.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMetaTransformerHiAmp.java @@ -1,5 +1,8 @@ package gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.nbt.NBTTagCompound; + import gregtech.api.enums.Textures; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; @@ -8,8 +11,6 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Transformer import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.minecraft.PlayerUtils; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.nbt.NBTTagCompound; public class GregtechMetaTransformerHiAmp extends GT_MetaTileEntity_Transformer { @@ -48,48 +49,30 @@ public class GregtechMetaTransformerHiAmp extends GT_MetaTileEntity_Transformer public ITexture[][][] getTextureSet(ITexture[] aTextures) { ITexture[][][] rTextures = new ITexture[12][17][]; for (byte i = -1; i < 16; i++) { - rTextures[0][i + 1] = new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[mTier][i + 1], Textures.BlockIcons.OVERLAYS_ENERGY_OUT[mTier] - }; - rTextures[1][i + 1] = new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[mTier][i + 1], Textures.BlockIcons.OVERLAYS_ENERGY_OUT[mTier] - }; - rTextures[2][i + 1] = new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[mTier][i + 1], Textures.BlockIcons.OVERLAYS_ENERGY_OUT[mTier] - }; - rTextures[3][i + 1] = new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[mTier][i + 1], - Textures.BlockIcons.OVERLAYS_ENERGY_IN_MULTI[mTier + 1] - }; - rTextures[4][i + 1] = new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[mTier][i + 1], - Textures.BlockIcons.OVERLAYS_ENERGY_IN_MULTI[mTier + 1] - }; - rTextures[5][i + 1] = new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[mTier][i + 1], - Textures.BlockIcons.OVERLAYS_ENERGY_IN_MULTI[mTier + 1] - }; - rTextures[6][i + 1] = new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[mTier][i + 1], Textures.BlockIcons.OVERLAYS_ENERGY_IN[mTier] - }; - rTextures[7][i + 1] = new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[mTier][i + 1], Textures.BlockIcons.OVERLAYS_ENERGY_IN[mTier] - }; - rTextures[8][i + 1] = new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[mTier][i + 1], Textures.BlockIcons.OVERLAYS_ENERGY_IN[mTier] - }; - rTextures[9][i + 1] = new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[mTier][i + 1], - Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[mTier + 1] - }; - rTextures[10][i + 1] = new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[mTier][i + 1], - Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[mTier + 1] - }; - rTextures[11][i + 1] = new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[mTier][i + 1], - Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[mTier + 1] - }; + rTextures[0][i + 1] = new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][i + 1], + Textures.BlockIcons.OVERLAYS_ENERGY_OUT[mTier] }; + rTextures[1][i + 1] = new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][i + 1], + Textures.BlockIcons.OVERLAYS_ENERGY_OUT[mTier] }; + rTextures[2][i + 1] = new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][i + 1], + Textures.BlockIcons.OVERLAYS_ENERGY_OUT[mTier] }; + rTextures[3][i + 1] = new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][i + 1], + Textures.BlockIcons.OVERLAYS_ENERGY_IN_MULTI[mTier + 1] }; + rTextures[4][i + 1] = new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][i + 1], + Textures.BlockIcons.OVERLAYS_ENERGY_IN_MULTI[mTier + 1] }; + rTextures[5][i + 1] = new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][i + 1], + Textures.BlockIcons.OVERLAYS_ENERGY_IN_MULTI[mTier + 1] }; + rTextures[6][i + 1] = new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][i + 1], + Textures.BlockIcons.OVERLAYS_ENERGY_IN[mTier] }; + rTextures[7][i + 1] = new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][i + 1], + Textures.BlockIcons.OVERLAYS_ENERGY_IN[mTier] }; + rTextures[8][i + 1] = new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][i + 1], + Textures.BlockIcons.OVERLAYS_ENERGY_IN[mTier] }; + rTextures[9][i + 1] = new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][i + 1], + Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[mTier + 1] }; + rTextures[10][i + 1] = new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][i + 1], + Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[mTier + 1] }; + rTextures[11][i + 1] = new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][i + 1], + Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[mTier + 1] }; } return rTextures; } @@ -101,9 +84,8 @@ public class GregtechMetaTransformerHiAmp extends GT_MetaTileEntity_Transformer @Override public String[] getDescription() { - return new String[] { - this.mDescription, "Accepts 4A and outputs 16A", "Toggle 2A/8A half-mode with Screwdriver", CORE.GT_Tooltip - }; + return new String[] { this.mDescription, "Accepts 4A and outputs 16A", + "Toggle 2A/8A half-mode with Screwdriver", CORE.GT_Tooltip }; } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java index 5f13bbaf09..84641bd357 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java @@ -1,5 +1,30 @@ package gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.util.*; +import java.util.Map.Entry; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.TimeUnit; +import java.util.function.BiConsumer; +import java.util.function.BiPredicate; +import java.util.function.Function; +import java.util.stream.Collectors; + +import javax.annotation.Nullable; + +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.ChatComponentTranslation; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.StatCollector; +import net.minecraft.world.World; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.oredict.OreDictionary; + import com.gtnewhorizon.structurelib.StructureLibAPI; import com.gtnewhorizon.structurelib.structure.AutoPlaceEnvironment; import com.gtnewhorizon.structurelib.structure.IStructureElement; @@ -11,6 +36,7 @@ import com.gtnewhorizons.modularui.common.widget.DrawableWidget; import com.gtnewhorizons.modularui.common.widget.DynamicPositionedColumn; import com.gtnewhorizons.modularui.common.widget.FakeSyncWidget; import com.gtnewhorizons.modularui.common.widget.TextWidget; + import gregtech.api.GregTech_API; import gregtech.api.enums.GT_Values; import gregtech.api.enums.Materials; @@ -52,28 +78,6 @@ import gtPlusPlus.core.util.reflect.ReflectionUtils; import gtPlusPlus.preloader.CORE_Preloader; import gtPlusPlus.preloader.asm.AsmConfig; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.*; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; -import java.util.*; -import java.util.Map.Entry; -import java.util.concurrent.ConcurrentHashMap; -import java.util.concurrent.TimeUnit; -import java.util.function.BiConsumer; -import java.util.function.BiPredicate; -import java.util.function.Function; -import java.util.stream.Collectors; -import javax.annotation.Nullable; -import net.minecraft.block.Block; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.ChatComponentTranslation; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.StatCollector; -import net.minecraft.world.World; -import net.minecraftforge.fluids.FluidStack; -import net.minecraftforge.oredict.OreDictionary; // Glee8e - 11/12/21 - 2:15pm // Yeah, now I see what's wrong. Someone inherited from GregtechMeta_MultiBlockBase instead of @@ -112,10 +116,9 @@ public abstract class GregtechMeta_MultiBlockBase<T extends GT_MetaTileEntity_Ex Logger.MACHINE_INFO("Found .09 findRecipe method? " + (a09 != null)); try { - calculatePollutionReduction = - GT_MetaTileEntity_Hatch_Muffler.class.getDeclaredMethod("calculatePollutionReduction", int.class); - } catch (NoSuchMethodException | SecurityException e) { - } + calculatePollutionReduction = GT_MetaTileEntity_Hatch_Muffler.class + .getDeclaredMethod("calculatePollutionReduction", int.class); + } catch (NoSuchMethodException | SecurityException e) {} } // Find Recipe Methods @@ -207,76 +210,145 @@ public abstract class GregtechMeta_MultiBlockBase<T extends GT_MetaTileEntity_Ex // Lets borrow the GTNH handling - mInfo.add(StatCollector.translateToLocal("GTPP.multiblock.progress") + ": " + EnumChatFormatting.GREEN - + Integer.toString(mProgresstime / 20) + EnumChatFormatting.RESET + " s / " - + EnumChatFormatting.YELLOW - + Integer.toString(mMaxProgresstime / 20) + EnumChatFormatting.RESET + " s"); + mInfo.add( + StatCollector.translateToLocal("GTPP.multiblock.progress") + ": " + + EnumChatFormatting.GREEN + + Integer.toString(mProgresstime / 20) + + EnumChatFormatting.RESET + + " s / " + + EnumChatFormatting.YELLOW + + Integer.toString(mMaxProgresstime / 20) + + EnumChatFormatting.RESET + + " s"); if (!this.mAllEnergyHatches.isEmpty()) { long storedEnergy = getStoredEnergyInAllEnergyHatches(); long maxEnergy = getMaxEnergyStorageOfAllEnergyHatches(); mInfo.add(StatCollector.translateToLocal("GTPP.multiblock.energy") + ":"); - mInfo.add(StatCollector.translateToLocal("" + EnumChatFormatting.GREEN + Long.toString(storedEnergy) - + EnumChatFormatting.RESET + " EU / " + EnumChatFormatting.YELLOW + Long.toString(maxEnergy) - + EnumChatFormatting.RESET + " EU")); + mInfo.add( + StatCollector.translateToLocal( + "" + EnumChatFormatting.GREEN + + Long.toString(storedEnergy) + + EnumChatFormatting.RESET + + " EU / " + + EnumChatFormatting.YELLOW + + Long.toString(maxEnergy) + + EnumChatFormatting.RESET + + " EU")); mInfo.add(StatCollector.translateToLocal("GTPP.multiblock.mei") + ":"); - mInfo.add(StatCollector.translateToLocal("" + EnumChatFormatting.YELLOW - + Long.toString(getMaxInputVoltage()) + EnumChatFormatting.RESET + " EU/t(*2A) " - + StatCollector.translateToLocal("GTPP.machines.tier") + ": " + EnumChatFormatting.YELLOW - + GT_Values.VN[GT_Utility.getTier(getMaxInputVoltage())] + EnumChatFormatting.RESET)); - ; + mInfo.add( + StatCollector.translateToLocal( + "" + EnumChatFormatting.YELLOW + + Long.toString(getMaxInputVoltage()) + + EnumChatFormatting.RESET + + " EU/t(*2A) " + + StatCollector.translateToLocal("GTPP.machines.tier") + + ": " + + EnumChatFormatting.YELLOW + + GT_Values.VN[GT_Utility.getTier(getMaxInputVoltage())] + + EnumChatFormatting.RESET));; } if (!this.mAllDynamoHatches.isEmpty()) { long storedEnergy = getStoredEnergyInAllDynamoHatches(); long maxEnergy = getMaxEnergyStorageOfAllDynamoHatches(); mInfo.add(StatCollector.translateToLocal("GTPP.multiblock.energy") + " In Dynamos:"); - mInfo.add(StatCollector.translateToLocal("" + EnumChatFormatting.GREEN + Long.toString(storedEnergy) - + EnumChatFormatting.RESET + " EU / " + EnumChatFormatting.YELLOW + Long.toString(maxEnergy) - + EnumChatFormatting.RESET + " EU")); + mInfo.add( + StatCollector.translateToLocal( + "" + EnumChatFormatting.GREEN + + Long.toString(storedEnergy) + + EnumChatFormatting.RESET + + " EU / " + + EnumChatFormatting.YELLOW + + Long.toString(maxEnergy) + + EnumChatFormatting.RESET + + " EU")); } if (-lEUt > 0) { mInfo.add(StatCollector.translateToLocal("GTPP.multiblock.usage") + ":"); - mInfo.add(StatCollector.translateToLocal( - "" + EnumChatFormatting.RED + (-lEUt) + EnumChatFormatting.RESET + " EU/t")); + mInfo.add( + StatCollector.translateToLocal( + "" + EnumChatFormatting.RED + (-lEUt) + EnumChatFormatting.RESET + " EU/t")); } else { mInfo.add(StatCollector.translateToLocal("GTPP.multiblock.generation") + ":"); - mInfo.add(StatCollector.translateToLocal( - "" + EnumChatFormatting.GREEN + lEUt + EnumChatFormatting.RESET + " EU/t")); - } - - mInfo.add(StatCollector.translateToLocal("GTPP.multiblock.problems") + ": " + EnumChatFormatting.RED - + (getIdealStatus() - getRepairStatus()) + EnumChatFormatting.RESET + " " - + StatCollector.translateToLocal("GTPP.multiblock.efficiency") + ": " + EnumChatFormatting.YELLOW - + Float.toString(mEfficiency / 100.0F) + EnumChatFormatting.RESET + " %"); + mInfo.add( + StatCollector.translateToLocal( + "" + EnumChatFormatting.GREEN + lEUt + EnumChatFormatting.RESET + " EU/t")); + } + + mInfo.add( + StatCollector.translateToLocal("GTPP.multiblock.problems") + ": " + + EnumChatFormatting.RED + + (getIdealStatus() - getRepairStatus()) + + EnumChatFormatting.RESET + + " " + + StatCollector.translateToLocal("GTPP.multiblock.efficiency") + + ": " + + EnumChatFormatting.YELLOW + + Float.toString(mEfficiency / 100.0F) + + EnumChatFormatting.RESET + + " %"); if (this.getPollutionPerSecond(null) > 0) { int mPollutionReduction = getPollutionReductionForAllMufflers(); - mInfo.add(StatCollector.translateToLocal("GTPP.multiblock.pollution") + ": " + EnumChatFormatting.RED - + this.getPollutionPerSecond(null) + EnumChatFormatting.RESET + "/sec"); - mInfo.add(StatCollector.translateToLocal("GTPP.multiblock.pollutionreduced") + ": " - + EnumChatFormatting.GREEN + mPollutionReduction + EnumChatFormatting.RESET + " %"); + mInfo.add( + StatCollector.translateToLocal("GTPP.multiblock.pollution") + ": " + + EnumChatFormatting.RED + + this.getPollutionPerSecond(null) + + EnumChatFormatting.RESET + + "/sec"); + mInfo.add( + StatCollector.translateToLocal("GTPP.multiblock.pollutionreduced") + ": " + + EnumChatFormatting.GREEN + + mPollutionReduction + + EnumChatFormatting.RESET + + " %"); } if (this.mControlCoreBus.size() > 0) { int tTier = this.getControlCoreTier(); - mInfo.add(StatCollector.translateToLocal("GTPP.CC.machinetier") + ": " + EnumChatFormatting.GREEN + tTier - + EnumChatFormatting.RESET); - } - - mInfo.add(StatCollector.translateToLocal("GTPP.CC.discount") + ": " + EnumChatFormatting.GREEN - + (getEuDiscountForParallelism()) + EnumChatFormatting.RESET + "%"); - - mInfo.add(StatCollector.translateToLocal("GTPP.CC.parallel") + ": " + EnumChatFormatting.GREEN - + (getMaxParallelRecipes()) + EnumChatFormatting.RESET); - - mInfo.add("Total Time Since Built: " + EnumChatFormatting.DARK_GREEN + Integer.toString(weeks) - + EnumChatFormatting.RESET + " Weeks, " + EnumChatFormatting.DARK_GREEN + Integer.toString(days) - + EnumChatFormatting.RESET + " Days, "); - mInfo.add(EnumChatFormatting.DARK_GREEN + Long.toString(hours) + EnumChatFormatting.RESET + " Hours, " - + EnumChatFormatting.DARK_GREEN + Long.toString(minutes) + EnumChatFormatting.RESET + " Minutes, " - + EnumChatFormatting.DARK_GREEN + Long.toString(second) + EnumChatFormatting.RESET + " Seconds."); + mInfo.add( + StatCollector.translateToLocal("GTPP.CC.machinetier") + ": " + + EnumChatFormatting.GREEN + + tTier + + EnumChatFormatting.RESET); + } + + mInfo.add( + StatCollector.translateToLocal("GTPP.CC.discount") + ": " + + EnumChatFormatting.GREEN + + (getEuDiscountForParallelism()) + + EnumChatFormatting.RESET + + "%"); + + mInfo.add( + StatCollector.translateToLocal("GTPP.CC.parallel") + ": " + + EnumChatFormatting.GREEN + + (getMaxParallelRecipes()) + + EnumChatFormatting.RESET); + + mInfo.add( + "Total Time Since Built: " + EnumChatFormatting.DARK_GREEN + + Integer.toString(weeks) + + EnumChatFormatting.RESET + + " Weeks, " + + EnumChatFormatting.DARK_GREEN + + Integer.toString(days) + + EnumChatFormatting.RESET + + " Days, "); + mInfo.add( + EnumChatFormatting.DARK_GREEN + Long.toString(hours) + + EnumChatFormatting.RESET + + " Hours, " + + EnumChatFormatting.DARK_GREEN + + Long.toString(minutes) + + EnumChatFormatting.RESET + + " Minutes, " + + EnumChatFormatting.DARK_GREEN + + Long.toString(second) + + EnumChatFormatting.RESET + + " Seconds."); mInfo.add("Total Time in ticks: " + EnumChatFormatting.DARK_GREEN + Long.toString(this.mTotalRunTime)); String[] mInfo2 = mInfo.toArray(new String[mInfo.size()]); @@ -340,9 +412,10 @@ public abstract class GregtechMeta_MultiBlockBase<T extends GT_MetaTileEntity_Ex private String[] aCachedToolTip; - /*private final String aRequiresMuffler = "1x Muffler Hatch"; - private final String aRequiresCoreModule = "1x Core Module"; - private final String aRequiresMaint = "1x Maintanence Hatch";*/ + /* + * private final String aRequiresMuffler = "1x Muffler Hatch"; private final String aRequiresCoreModule = + * "1x Core Module"; private final String aRequiresMaint = "1x Maintanence Hatch"; + */ public static final String TAG_HIDE_HATCHES = "TAG_HIDE_HATCHES"; public static final String TAG_HIDE_MAINT = "TAG_HIDE_MAINT"; @@ -411,22 +484,23 @@ public abstract class GregtechMeta_MultiBlockBase<T extends GT_MetaTileEntity_Ex return checkRecipeGeneric(aMaxParallelRecipes, aEUPercent, aSpeedBonusPercent, 10000); } - public boolean checkRecipeGeneric( - int aMaxParallelRecipes, long aEUPercent, int aSpeedBonusPercent, int aOutputChanceRoll) { + public boolean checkRecipeGeneric(int aMaxParallelRecipes, long aEUPercent, int aSpeedBonusPercent, + int aOutputChanceRoll) { ArrayList<ItemStack> tItems = getStoredInputs(); ArrayList<FluidStack> tFluids = getStoredFluids(); ItemStack[] tItemInputs = tItems.toArray(new ItemStack[tItems.size()]); FluidStack[] tFluidInputs = tFluids.toArray(new FluidStack[tFluids.size()]); return checkRecipeGeneric( - tItemInputs, tFluidInputs, aMaxParallelRecipes, aEUPercent, aSpeedBonusPercent, aOutputChanceRoll); + tItemInputs, + tFluidInputs, + aMaxParallelRecipes, + aEUPercent, + aSpeedBonusPercent, + aOutputChanceRoll); } - public boolean checkRecipeGeneric( - GT_Recipe aRecipe, - int aMaxParallelRecipes, - long aEUPercent, - int aSpeedBonusPercent, - int aOutputChanceRoll) { + public boolean checkRecipeGeneric(GT_Recipe aRecipe, int aMaxParallelRecipes, long aEUPercent, + int aSpeedBonusPercent, int aOutputChanceRoll) { if (aRecipe == null) { return false; } @@ -444,13 +518,8 @@ public abstract class GregtechMeta_MultiBlockBase<T extends GT_MetaTileEntity_Ex aRecipe); } - public boolean checkRecipeGeneric( - ItemStack[] aItemInputs, - FluidStack[] aFluidInputs, - int aMaxParallelRecipes, - long aEUPercent, - int aSpeedBonusPercent, - int aOutputChanceRoll) { + public boolean checkRecipeGeneric(ItemStack[] aItemInputs, FluidStack[] aFluidInputs, int aMaxParallelRecipes, + long aEUPercent, int aSpeedBonusPercent, int aOutputChanceRoll) { return checkRecipeGeneric( aItemInputs, aFluidInputs, @@ -462,152 +531,69 @@ public abstract class GregtechMeta_MultiBlockBase<T extends GT_MetaTileEntity_Ex } /* - * public boolean checkRecipeGeneric( ItemStack[] aItemInputs, FluidStack[] - * aFluidInputs, int aMaxParallelRecipes, int aEUPercent, int - * aSpeedBonusPercent, int aOutputChanceRoll, GT_Recipe aRecipe) { // Based on - * the Processing Array. A bit overkill, but very flexible. - * - * - * if (this.doesMachineBoostOutput()) { log("Boosting."); return - * checkRecipeBoostedOutputs(aItemInputs, aFluidInputs, aMaxParallelRecipes, - * aEUPercent, aSpeedBonusPercent, aOutputChanceRoll, aRecipe); } - * - * - * //Control Core to control the Multiblocks behaviour. int aControlCoreTier = - * getControlCoreTier(); - * - * //If no core, return false; if (aControlCoreTier > 0) { - * log("Control core found."); } - * - * - * // Reset outputs and progress stats this.lEUt = 0; this.mMaxProgresstime = 0; - * this.mOutputItems = new ItemStack[]{}; this.mOutputFluids = new - * FluidStack[]{}; - * - * long tVoltage = getMaxInputVoltage(); byte tTier = (byte) Math.max(1, - * GT_Utility.getTier(tVoltage)); log("Running checkRecipeGeneric(0)"); - * - * //Check to see if Voltage Tier > Control Core Tier if (tTier > - * aControlCoreTier) { - * log("Control core found is lower tier than power tier. OK"); tTier = (byte) - * aControlCoreTier; } - * - * tTier = (byte) MathUtils.getValueWithinRange(tTier, 0, 9); - * - * GT_Recipe tRecipe = aRecipe != null ? aRecipe : findRecipe( - * getBaseMetaTileEntity(), mLastRecipe, false, - * gregtech.api.enums.GT_Values.V[tTier], aFluidInputs, aItemInputs); - * - * log("Running checkRecipeGeneric(1)"); // Remember last recipe - an - * optimization for findRecipe() this.mLastRecipe = tRecipe; - * - * if (tRecipe == null) { log("BAD RETURN - 1"); return false; } - * - * if (!this.canBufferOutputs(tRecipe, aMaxParallelRecipes)) { - * log("BAD RETURN - 2"); return false; } - * - * // EU discount float tRecipeEUt = (tRecipe.mEUt * aEUPercent) / 100.0f; float - * tTotalEUt = 0.0f; - * - * int parallelRecipes = 0; - * - * log("parallelRecipes: "+parallelRecipes); - * log("aMaxParallelRecipes: "+aMaxParallelRecipes); - * log("tTotalEUt: "+tTotalEUt); log("tVoltage: "+tVoltage); - * log("tRecipeEUt: "+tRecipeEUt); log("EU1: "+tRecipeEUt); // Count - * recipes to do in parallel, consuming input items and fluids and considering - * input voltage limits for (; parallelRecipes < aMaxParallelRecipes && - * tTotalEUt < (tVoltage - tRecipeEUt); parallelRecipes++) { if - * (!tRecipe.isRecipeInputEqual(true, aFluidInputs, aItemInputs)) { + * public boolean checkRecipeGeneric( ItemStack[] aItemInputs, FluidStack[] aFluidInputs, int aMaxParallelRecipes, + * int aEUPercent, int aSpeedBonusPercent, int aOutputChanceRoll, GT_Recipe aRecipe) { // Based on the Processing + * Array. A bit overkill, but very flexible. if (this.doesMachineBoostOutput()) { log("Boosting."); return + * checkRecipeBoostedOutputs(aItemInputs, aFluidInputs, aMaxParallelRecipes, aEUPercent, aSpeedBonusPercent, + * aOutputChanceRoll, aRecipe); } //Control Core to control the Multiblocks behaviour. int aControlCoreTier = + * getControlCoreTier(); //If no core, return false; if (aControlCoreTier > 0) { log("Control core found."); } // + * Reset outputs and progress stats this.lEUt = 0; this.mMaxProgresstime = 0; this.mOutputItems = new ItemStack[]{}; + * this.mOutputFluids = new FluidStack[]{}; long tVoltage = getMaxInputVoltage(); byte tTier = (byte) Math.max(1, + * GT_Utility.getTier(tVoltage)); log("Running checkRecipeGeneric(0)"); //Check to see if Voltage Tier > Control + * Core Tier if (tTier > aControlCoreTier) { log("Control core found is lower tier than power tier. OK"); tTier = + * (byte) aControlCoreTier; } tTier = (byte) MathUtils.getValueWithinRange(tTier, 0, 9); GT_Recipe tRecipe = aRecipe + * != null ? aRecipe : findRecipe( getBaseMetaTileEntity(), mLastRecipe, false, + * gregtech.api.enums.GT_Values.V[tTier], aFluidInputs, aItemInputs); log("Running checkRecipeGeneric(1)"); // + * Remember last recipe - an optimization for findRecipe() this.mLastRecipe = tRecipe; if (tRecipe == null) { + * log("BAD RETURN - 1"); return false; } if (!this.canBufferOutputs(tRecipe, aMaxParallelRecipes)) { + * log("BAD RETURN - 2"); return false; } // EU discount float tRecipeEUt = (tRecipe.mEUt * aEUPercent) / 100.0f; + * float tTotalEUt = 0.0f; int parallelRecipes = 0; log("parallelRecipes: "+parallelRecipes); + * log("aMaxParallelRecipes: "+aMaxParallelRecipes); log("tTotalEUt: "+tTotalEUt); log("tVoltage: "+tVoltage); + * log("tRecipeEUt: "+tRecipeEUt); log("EU1: "+tRecipeEUt); // Count recipes to do in parallel, consuming input + * items and fluids and considering input voltage limits for (; parallelRecipes < aMaxParallelRecipes && tTotalEUt < + * (tVoltage - tRecipeEUt); parallelRecipes++) { if (!tRecipe.isRecipeInputEqual(true, aFluidInputs, aItemInputs)) { * log("Broke at "+parallelRecipes+"."); break; } - * log("Bumped EU from "+tTotalEUt+" to "+(tTotalEUt+tRecipeEUt)+"."); tTotalEUt - * += tRecipeEUt; log("EU2: "+tTotalEUt); } - * - * if (parallelRecipes == 0) { log("BAD RETURN - 3"); return false; } - * - * log("EU3: "+tTotalEUt); - * - * // -- Try not to fail after this point - inputs have already been consumed! - * -- - * - * - * // Convert speed bonus to duration multiplier // e.g. 100% speed bonus = 200% - * speed = 100%/200% = 50% recipe duration. aSpeedBonusPercent = Math.max(-99, - * aSpeedBonusPercent); float tTimeFactor = 100.0f / (100.0f + - * aSpeedBonusPercent); this.mMaxProgresstime = (int)(tRecipe.mDuration * - * tTimeFactor * 10000); - * - * int aTempEu = (int) Math.floor(tTotalEUt); log("EU4: "+aTempEu); - * this.lEUt = (long) aTempEu; - * - * - * this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000); - * this.mEfficiencyIncrease = 10000; - * - * // Overclock if (this.lEUt <= 16) { this.lEUt = (this.lEUt * (1 << tTier - 1) - * * (1 << tTier - 1)); this.mMaxProgresstime = (this.mMaxProgresstime / (1 << - * tTier - 1)); } else { while (this.lEUt <= - * gregtech.api.enums.GT_Values.V[(tTier - 1)]) { this.lEUt *= 4; - * this.mMaxProgresstime /= 2; } } - * - * if (this.lEUt > 0) { this.lEUt = (-this.lEUt); } - * - * this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime); - * - * // Collect fluid outputs FluidStack[] tOutputFluids = new - * FluidStack[tRecipe.mFluidOutputs.length]; for (int h = 0; h < - * tRecipe.mFluidOutputs.length; h++) { if (tRecipe.getFluidOutput(h) != null) { - * tOutputFluids[h] = tRecipe.getFluidOutput(h).copy(); tOutputFluids[h].amount - * *= parallelRecipes; } } - * - * // Collect output item types ItemStack[] tOutputItems = new - * ItemStack[tRecipe.mOutputs.length]; for (int h = 0; h < - * tRecipe.mOutputs.length; h++) { if (tRecipe.getOutput(h) != null) { - * tOutputItems[h] = tRecipe.getOutput(h).copy(); tOutputItems[h].stackSize = 0; - * } } - * - * // Set output item stack sizes (taking output chance into account) for (int f - * = 0; f < tOutputItems.length; f++) { if (tRecipe.mOutputs[f] != null && - * tOutputItems[f] != null) { for (int g = 0; g < parallelRecipes; g++) { if - * (getBaseMetaTileEntity().getRandomNumber(aOutputChanceRoll) < - * tRecipe.getOutputChance(f)) tOutputItems[f].stackSize += - * tRecipe.mOutputs[f].stackSize; } } } - * - * tOutputItems = removeNulls(tOutputItems); - * - * // Sanitize item stack size, splitting any stacks greater than max stack size - * List<ItemStack> splitStacks = new ArrayList<ItemStack>(); for (ItemStack - * tItem : tOutputItems) { while (tItem.getMaxStackSize() < tItem.stackSize) { - * ItemStack tmp = tItem.copy(); tmp.stackSize = tmp.getMaxStackSize(); - * tItem.stackSize = tItem.stackSize - tItem.getMaxStackSize(); - * splitStacks.add(tmp); } } - * - * if (splitStacks.size() > 0) { ItemStack[] tmp = new - * ItemStack[splitStacks.size()]; tmp = splitStacks.toArray(tmp); tOutputItems = - * ArrayUtils.addAll(tOutputItems, tmp); } - * - * // Strip empty stacks List<ItemStack> tSList = new ArrayList<ItemStack>(); - * for (ItemStack tS : tOutputItems) { if (tS.stackSize > 0) tSList.add(tS); } - * tOutputItems = tSList.toArray(new ItemStack[tSList.size()]); - * - * // Commit outputs this.mOutputItems = tOutputItems; this.mOutputFluids = - * tOutputFluids; updateSlots(); - * - * // Play sounds (GT++ addition - GT multiblocks play no sounds) - * startProcess(); - * + * log("Bumped EU from "+tTotalEUt+" to "+(tTotalEUt+tRecipeEUt)+"."); tTotalEUt += tRecipeEUt; + * log("EU2: "+tTotalEUt); } if (parallelRecipes == 0) { log("BAD RETURN - 3"); return false; } + * log("EU3: "+tTotalEUt); // -- Try not to fail after this point - inputs have already been consumed! -- // Convert + * speed bonus to duration multiplier // e.g. 100% speed bonus = 200% speed = 100%/200% = 50% recipe duration. + * aSpeedBonusPercent = Math.max(-99, aSpeedBonusPercent); float tTimeFactor = 100.0f / (100.0f + + * aSpeedBonusPercent); this.mMaxProgresstime = (int)(tRecipe.mDuration * tTimeFactor * 10000); int aTempEu = (int) + * Math.floor(tTotalEUt); log("EU4: "+aTempEu); this.lEUt = (long) aTempEu; this.mEfficiency = (10000 - + * (getIdealStatus() - getRepairStatus()) * 1000); this.mEfficiencyIncrease = 10000; // Overclock if (this.lEUt <= + * 16) { this.lEUt = (this.lEUt * (1 << tTier - 1) * (1 << tTier - 1)); this.mMaxProgresstime = + * (this.mMaxProgresstime / (1 << tTier - 1)); } else { while (this.lEUt <= gregtech.api.enums.GT_Values.V[(tTier - + * 1)]) { this.lEUt *= 4; this.mMaxProgresstime /= 2; } } if (this.lEUt > 0) { this.lEUt = (-this.lEUt); } + * this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime); // Collect fluid outputs FluidStack[] tOutputFluids = + * new FluidStack[tRecipe.mFluidOutputs.length]; for (int h = 0; h < tRecipe.mFluidOutputs.length; h++) { if + * (tRecipe.getFluidOutput(h) != null) { tOutputFluids[h] = tRecipe.getFluidOutput(h).copy(); + * tOutputFluids[h].amount *= parallelRecipes; } } // Collect output item types ItemStack[] tOutputItems = new + * ItemStack[tRecipe.mOutputs.length]; for (int h = 0; h < tRecipe.mOutputs.length; h++) { if (tRecipe.getOutput(h) + * != null) { tOutputItems[h] = tRecipe.getOutput(h).copy(); tOutputItems[h].stackSize = 0; } } // Set output item + * stack sizes (taking output chance into account) for (int f = 0; f < tOutputItems.length; f++) { if + * (tRecipe.mOutputs[f] != null && tOutputItems[f] != null) { for (int g = 0; g < parallelRecipes; g++) { if + * (getBaseMetaTileEntity().getRandomNumber(aOutputChanceRoll) < tRecipe.getOutputChance(f)) + * tOutputItems[f].stackSize += tRecipe.mOutputs[f].stackSize; } } } tOutputItems = removeNulls(tOutputItems); // + * Sanitize item stack size, splitting any stacks greater than max stack size List<ItemStack> splitStacks = new + * ArrayList<ItemStack>(); for (ItemStack tItem : tOutputItems) { while (tItem.getMaxStackSize() < tItem.stackSize) + * { ItemStack tmp = tItem.copy(); tmp.stackSize = tmp.getMaxStackSize(); tItem.stackSize = tItem.stackSize - + * tItem.getMaxStackSize(); splitStacks.add(tmp); } } if (splitStacks.size() > 0) { ItemStack[] tmp = new + * ItemStack[splitStacks.size()]; tmp = splitStacks.toArray(tmp); tOutputItems = ArrayUtils.addAll(tOutputItems, + * tmp); } // Strip empty stacks List<ItemStack> tSList = new ArrayList<ItemStack>(); for (ItemStack tS : + * tOutputItems) { if (tS.stackSize > 0) tSList.add(tS); } tOutputItems = tSList.toArray(new + * ItemStack[tSList.size()]); // Commit outputs this.mOutputItems = tOutputItems; this.mOutputFluids = + * tOutputFluids; updateSlots(); // Play sounds (GT++ addition - GT multiblocks play no sounds) startProcess(); * log("GOOD RETURN - 1"); return true; } */ public long getMaxInputEnergy() { long rEnergy = 0; - if (mEnergyHatches.size() - == 1) // so it only takes 1 amp is only 1 hatch is present so it works like most gt multies - return mEnergyHatches.get(0).getBaseMetaTileEntity().getInputVoltage(); + if (mEnergyHatches.size() == 1) // so it only takes 1 amp is only 1 hatch is present so it works like most gt + // multies + return mEnergyHatches.get(0).getBaseMetaTileEntity().getInputVoltage(); for (GT_MetaTileEntity_Hatch_Energy tHatch : mEnergyHatches) - if (isValidMetaTileEntity(tHatch)) - rEnergy += tHatch.getBaseMetaTileEntity().getInputVoltage() - * tHatch.getBaseMetaTileEntity().getInputAmperage(); + if (isValidMetaTileEntity(tHatch)) rEnergy += tHatch.getBaseMetaTileEntity().getInputVoltage() + * tHatch.getBaseMetaTileEntity().getInputAmperage(); return rEnergy; } @@ -615,14 +601,8 @@ public abstract class GregtechMeta_MultiBlockBase<T extends GT_MetaTileEntity_Ex return false; } - public boolean checkRecipeGeneric( - ItemStack[] aItemInputs, - FluidStack[] aFluidInputs, - int aMaxParallelRecipes, - long aEUPercent, - int aSpeedBonusPercent, - int aOutputChanceRoll, - GT_Recipe aRecipe) { + public boolean checkRecipeGeneric(ItemStack[] aItemInputs, FluidStack[] aFluidInputs, int aMaxParallelRecipes, + long aEUPercent, int aSpeedBonusPercent, int aOutputChanceRoll, GT_Recipe aRecipe) { // Based on the Processing Array. A bit overkill, but very flexible. // Reset outputs and progress stats @@ -652,7 +632,7 @@ public abstract class GregtechMeta_MultiBlockBase<T extends GT_MetaTileEntity_Ex } /* - * Check for Special Behaviours + * Check for Special Behaviours */ // First populate the map if we need to. @@ -694,14 +674,9 @@ public abstract class GregtechMeta_MultiBlockBase<T extends GT_MetaTileEntity_Ex } } - GT_ParallelHelper helper = new GT_ParallelHelper() - .setRecipe(tRecipe) - .setItemInputs(aItemInputs) - .setFluidInputs(aFluidInputs) - .setAvailableEUt(tEnergy) - .setMaxParallel(aMaxParallelRecipes) - .enableConsumption() - .enableOutputCalculation(); + GT_ParallelHelper helper = new GT_ParallelHelper().setRecipe(tRecipe).setItemInputs(aItemInputs) + .setFluidInputs(aFluidInputs).setAvailableEUt(tEnergy).setMaxParallel(aMaxParallelRecipes) + .enableConsumption().enableOutputCalculation(); if (!mVoidExcess) { helper.enableVoidProtection(this); } @@ -719,13 +694,9 @@ public abstract class GregtechMeta_MultiBlockBase<T extends GT_MetaTileEntity_Ex this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000); this.mEfficiencyIncrease = 10000; - GT_OverclockCalculator calculator = new GT_OverclockCalculator() - .setRecipeEUt(tRecipe.mEUt) - .setEUt(tEnergy) - .setDuration(tRecipe.mDuration) - .setEUtDiscount(aEUPercent / 100.0f) - .setSpeedBoost(100.0f / (100.0f + aSpeedBonusPercent)) - .setParallel(helper.getCurrentParallel()) + GT_OverclockCalculator calculator = new GT_OverclockCalculator().setRecipeEUt(tRecipe.mEUt).setEUt(tEnergy) + .setDuration(tRecipe.mDuration).setEUtDiscount(aEUPercent / 100.0f) + .setSpeedBoost(100.0f / (100.0f + aSpeedBonusPercent)).setParallel(helper.getCurrentParallel()) .calculate(); lEUt = -calculator.getConsumption(); mMaxProgresstime = (int) Math.ceil(calculator.getDuration() * helper.getDurationMultiplier()); @@ -749,6 +720,7 @@ public abstract class GregtechMeta_MultiBlockBase<T extends GT_MetaTileEntity_Ex /** * Does this machine boost it's output? + * * @return - if true, gives additional % to output chances. */ protected boolean doesMachineBoostOutput() { @@ -813,13 +785,8 @@ public abstract class GregtechMeta_MultiBlockBase<T extends GT_MetaTileEntity_Ex * @param aRecipe * @return */ - public boolean checkRecipeBoostedOutputs( - ItemStack[] aItemInputs, - FluidStack[] aFluidInputs, - int aMaxParallelRecipes, - long aEUPercent, - int aSpeedBonusPercent, - int aOutputChanceRoll, + public boolean checkRecipeBoostedOutputs(ItemStack[] aItemInputs, FluidStack[] aFluidInputs, + int aMaxParallelRecipes, long aEUPercent, int aSpeedBonusPercent, int aOutputChanceRoll, GT_Recipe aRecipe) { long tVoltage = getMaxInputVoltage(); @@ -827,8 +794,7 @@ public abstract class GregtechMeta_MultiBlockBase<T extends GT_MetaTileEntity_Ex long tEnergy = getMaxInputEnergy(); log("Running checkRecipeGeneric(0)"); - GT_Recipe tRecipe = aRecipe != null - ? aRecipe + GT_Recipe tRecipe = aRecipe != null ? aRecipe : findRecipe( getBaseMetaTileEntity(), mLastRecipe, @@ -897,8 +863,7 @@ public abstract class GregtechMeta_MultiBlockBase<T extends GT_MetaTileEntity_Ex // Bad modify, let's just use the original recipe. if (!mHasBoostedCurrentRecipe || mBoostedRecipe == null) { - tRecipe = aRecipe != null - ? aRecipe + tRecipe = aRecipe != null ? aRecipe : findRecipe( getBaseMetaTileEntity(), mLastRecipe, @@ -917,14 +882,9 @@ public abstract class GregtechMeta_MultiBlockBase<T extends GT_MetaTileEntity_Ex return false; } - GT_ParallelHelper helper = new GT_ParallelHelper() - .setRecipe(tRecipe) - .setItemInputs(aItemInputs) - .setFluidInputs(aFluidInputs) - .setAvailableEUt(tEnergy) - .setMaxParallel(aMaxParallelRecipes) - .enableConsumption() - .enableOutputCalculation(); + GT_ParallelHelper helper = new GT_ParallelHelper().setRecipe(tRecipe).setItemInputs(aItemInputs) + .setFluidInputs(aFluidInputs).setAvailableEUt(tEnergy).setMaxParallel(aMaxParallelRecipes) + .enableConsumption().enableOutputCalculation(); if (!mVoidExcess) { helper.enableVoidProtection(this); } @@ -940,14 +900,10 @@ public abstract class GregtechMeta_MultiBlockBase<T extends GT_MetaTileEntity_Ex return false; } - GT_OverclockCalculator calculator = new GT_OverclockCalculator() - .setRecipeEUt(tRecipe.mEUt) - .setEUt(tEnergy) - .setDuration(tRecipe.mDuration) - .setEUtDiscount(aEUPercent / 100.0f) + GT_OverclockCalculator calculator = new GT_OverclockCalculator().setRecipeEUt(tRecipe.mEUt).setEUt(tEnergy) + .setDuration(tRecipe.mDuration).setEUtDiscount(aEUPercent / 100.0f) .setSpeedBoost(100.0f / (100.0f + aSpeedBonusPercent)) - .setParallel(Math.min(aMaxParallelRecipes, helper.getCurrentParallel())) - .calculate(); + .setParallel(Math.min(aMaxParallelRecipes, helper.getCurrentParallel())).calculate(); lEUt = -calculator.getConsumption(); mMaxProgresstime = (int) Math.ceil(mMaxProgresstime * helper.getDurationMultiplier()); @@ -991,27 +947,27 @@ public abstract class GregtechMeta_MultiBlockBase<T extends GT_MetaTileEntity_Ex @Override public void explodeMultiblock() { MetaTileEntity tTileEntity; - for (final Iterator<GT_MetaTileEntity_Hatch_InputBattery> localIterator = this.mChargeHatches.iterator(); - localIterator.hasNext(); - tTileEntity.getBaseMetaTileEntity().doExplosion(gregtech.api.enums.GT_Values.V[8])) { + for (final Iterator<GT_MetaTileEntity_Hatch_InputBattery> localIterator = this.mChargeHatches + .iterator(); localIterator.hasNext(); tTileEntity.getBaseMetaTileEntity() + .doExplosion(gregtech.api.enums.GT_Values.V[8])) { tTileEntity = localIterator.next(); } tTileEntity = null; - for (final Iterator<GT_MetaTileEntity_Hatch_OutputBattery> localIterator = this.mDischargeHatches.iterator(); - localIterator.hasNext(); - tTileEntity.getBaseMetaTileEntity().doExplosion(gregtech.api.enums.GT_Values.V[8])) { + for (final Iterator<GT_MetaTileEntity_Hatch_OutputBattery> localIterator = this.mDischargeHatches + .iterator(); localIterator.hasNext(); tTileEntity.getBaseMetaTileEntity() + .doExplosion(gregtech.api.enums.GT_Values.V[8])) { tTileEntity = localIterator.next(); } tTileEntity = null; - for (final Iterator<GT_MetaTileEntity_Hatch> localIterator = this.mTecTechDynamoHatches.iterator(); - localIterator.hasNext(); - tTileEntity.getBaseMetaTileEntity().doExplosion(gregtech.api.enums.GT_Values.V[8])) { + for (final Iterator<GT_MetaTileEntity_Hatch> localIterator = this.mTecTechDynamoHatches + .iterator(); localIterator.hasNext(); tTileEntity.getBaseMetaTileEntity() + .doExplosion(gregtech.api.enums.GT_Values.V[8])) { tTileEntity = localIterator.next(); } tTileEntity = null; - for (final Iterator<GT_MetaTileEntity_Hatch> localIterator = this.mTecTechEnergyHatches.iterator(); - localIterator.hasNext(); - tTileEntity.getBaseMetaTileEntity().doExplosion(gregtech.api.enums.GT_Values.V[8])) { + for (final Iterator<GT_MetaTileEntity_Hatch> localIterator = this.mTecTechEnergyHatches + .iterator(); localIterator.hasNext(); tTileEntity.getBaseMetaTileEntity() + .doExplosion(gregtech.api.enums.GT_Values.V[8])) { tTileEntity = localIterator.next(); } @@ -1089,8 +1045,8 @@ public abstract class GregtechMeta_MultiBlockBase<T extends GT_MetaTileEntity_Ex * Deplete fluid input from a set of restricted hatches. This assumes these hatches can store nothing else but your * expected fluid */ - protected boolean depleteInputFromRestrictedHatches( - Collection<GT_MetaTileEntity_Hatch_CustomFluidBase> aHatches, int aAmount) { + protected boolean depleteInputFromRestrictedHatches(Collection<GT_MetaTileEntity_Hatch_CustomFluidBase> aHatches, + int aAmount) { for (final GT_MetaTileEntity_Hatch_CustomFluidBase tHatch : aHatches) { if (isValidMetaTileEntity(tHatch)) { FluidStack tLiquid = tHatch.getFluid(); @@ -1133,6 +1089,7 @@ public abstract class GregtechMeta_MultiBlockBase<T extends GT_MetaTileEntity_Ex /** * Causes a Random Maint. Issue. + * * @return {@link boolean} - Returns whether or not an issue was caused, should always be true. */ public boolean causeMaintenanceIssue() { @@ -1186,13 +1143,13 @@ public abstract class GregtechMeta_MultiBlockBase<T extends GT_MetaTileEntity_Ex && (this.getPollutionPerSecond(null) > 0 ? !mMufflerHatches.isEmpty() : true); } - public <E> boolean addToMachineListInternal( - ArrayList<E> aList, final IGregTechTileEntity aTileEntity, final int aBaseCasingIndex) { + public <E> boolean addToMachineListInternal(ArrayList<E> aList, final IGregTechTileEntity aTileEntity, + final int aBaseCasingIndex) { return addToMachineListInternal(aList, getMetaTileEntity(aTileEntity), aBaseCasingIndex); } - public <E> boolean addToMachineListInternal( - ArrayList<E> aList, final IMetaTileEntity aTileEntity, final int aBaseCasingIndex) { + public <E> boolean addToMachineListInternal(ArrayList<E> aList, final IMetaTileEntity aTileEntity, + final int aBaseCasingIndex) { if (aTileEntity == null) { return false; } @@ -1219,8 +1176,10 @@ public abstract class GregtechMeta_MultiBlockBase<T extends GT_MetaTileEntity_Ex if (aList.isEmpty()) { if (aTileEntity instanceof GT_MetaTileEntity_Hatch) { if (GTplusplus.CURRENT_LOAD_PHASE == INIT_PHASE.STARTED) { - log("Adding " + aTileEntity.getInventoryName() + " at " - + new BlockPos(aTileEntity.getBaseMetaTileEntity()).getLocationString()); + log( + "Adding " + aTileEntity.getInventoryName() + + " at " + + new BlockPos(aTileEntity.getBaseMetaTileEntity()).getLocationString()); } updateTexture(aTileEntity, aBaseCasingIndex); return aList.add((E) aTileEntity); @@ -1228,8 +1187,10 @@ public abstract class GregtechMeta_MultiBlockBase<T extends GT_MetaTileEntity_Ex } else { IGregTechTileEntity aCur = aTileEntity.getBaseMetaTileEntity(); if (aList.contains(aTileEntity)) { - log("Found Duplicate " + aTileEntity.getInventoryName() + " @ " - + new BlockPos(aCur).getLocationString()); + log( + "Found Duplicate " + aTileEntity.getInventoryName() + + " @ " + + new BlockPos(aCur).getLocationString()); return false; } BlockPos aCurPos = new BlockPos(aCur); @@ -1262,10 +1223,10 @@ public abstract class GregtechMeta_MultiBlockBase<T extends GT_MetaTileEntity_Ex public int getControlCoreTier() { // Always return best tier if config is off. - /*boolean aCoresConfig = gtPlusPlus.core.lib.CORE.ConfigSwitches.requireControlCores; - if (!aCoresConfig) { - return 10; - }*/ + /* + * boolean aCoresConfig = gtPlusPlus.core.lib.CORE.ConfigSwitches.requireControlCores; if (!aCoresConfig) { + * return 10; } + */ if (mControlCoreBus.isEmpty()) { log("No Control Core Modules Found."); @@ -1301,8 +1262,8 @@ public abstract class GregtechMeta_MultiBlockBase<T extends GT_MetaTileEntity_Ex log("Tried to add a secondary control core module."); return false; } - GT_MetaTileEntity_Hatch_ControlCore Module = - (GT_MetaTileEntity_Hatch_ControlCore) getMetaTileEntity(aTileEntity); + GT_MetaTileEntity_Hatch_ControlCore Module = (GT_MetaTileEntity_Hatch_ControlCore) getMetaTileEntity( + aTileEntity); if (Module != null) { if (Module.setOwner(aTileEntity)) { log("Adding control core module."); @@ -1607,7 +1568,8 @@ public abstract class GregtechMeta_MultiBlockBase<T extends GT_MetaTileEntity_Ex /** * TecTech Multi-Amp Dynamo Support - * @param aTileEntity - The Dynamo Hatch + * + * @param aTileEntity - The Dynamo Hatch * @param aBaseCasingIndex - Casing Texture * @return */ @@ -1628,8 +1590,8 @@ public abstract class GregtechMeta_MultiBlockBase<T extends GT_MetaTileEntity_Ex public boolean isThisHatchMultiDynamo(IMetaTileEntity aMetaTileEntity) { Class<?> mDynamoClass; - mDynamoClass = ReflectionUtils.getClass( - "com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_DynamoMulti"); + mDynamoClass = ReflectionUtils + .getClass("com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_DynamoMulti"); if (mDynamoClass != null) { if (mDynamoClass.isInstance(aMetaTileEntity)) { return true; @@ -1660,7 +1622,8 @@ public abstract class GregtechMeta_MultiBlockBase<T extends GT_MetaTileEntity_Ex /** * TecTech Multi-Amp Energy Hatch Support - * @param aTileEntity - The Energy Hatch + * + * @param aTileEntity - The Energy Hatch * @param aBaseCasingIndex - Casing Texture * @return */ @@ -1681,8 +1644,8 @@ public abstract class GregtechMeta_MultiBlockBase<T extends GT_MetaTileEntity_Ex public boolean isThisHatchMultiEnergy(IMetaTileEntity aMetaTileEntity) { Class<?> mDynamoClass; - mDynamoClass = ReflectionUtils.getClass( - "com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_EnergyMulti"); + mDynamoClass = ReflectionUtils + .getClass("com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_EnergyMulti"); if (mDynamoClass != null) { if (mDynamoClass.isInstance(aMetaTileEntity)) { return true; @@ -1746,34 +1709,28 @@ public abstract class GregtechMeta_MultiBlockBase<T extends GT_MetaTileEntity_Ex /** * Custom Find Recipe with Debugging */ - public GT_Recipe findRecipe( - final IHasWorldObjectAndCoords aTileEntity, - final boolean aNotUnificated, - final boolean aDontCheckStackSizes, - final long aVoltage, - final FluidStack[] aFluids, + public GT_Recipe findRecipe(final IHasWorldObjectAndCoords aTileEntity, final boolean aNotUnificated, + final boolean aDontCheckStackSizes, final long aVoltage, final FluidStack[] aFluids, final ItemStack... aInputs) { return this.findRecipe( - aTileEntity, null, aNotUnificated, aDontCheckStackSizes, aVoltage, aFluids, (ItemStack) null, aInputs); + aTileEntity, + null, + aNotUnificated, + aDontCheckStackSizes, + aVoltage, + aFluids, + (ItemStack) null, + aInputs); } - public GT_Recipe findRecipe( - final IHasWorldObjectAndCoords aTileEntity, - final boolean aNotUnificated, - final long aVoltage, - final FluidStack[] aFluids, - final ItemStack... aInputs) { + public GT_Recipe findRecipe(final IHasWorldObjectAndCoords aTileEntity, final boolean aNotUnificated, + final long aVoltage, final FluidStack[] aFluids, final ItemStack... aInputs) { return this.findRecipe(aTileEntity, null, aNotUnificated, aVoltage, aFluids, (ItemStack) null, aInputs); } - public GT_Recipe findRecipe( - final IHasWorldObjectAndCoords aTileEntity, - final GT_Recipe aRecipe, - final boolean aNotUnificated, - final boolean aDontCheckStackSizes, - final long aVoltage, - final FluidStack[] aFluids, - final ItemStack... aInputs) { + public GT_Recipe findRecipe(final IHasWorldObjectAndCoords aTileEntity, final GT_Recipe aRecipe, + final boolean aNotUnificated, final boolean aDontCheckStackSizes, final long aVoltage, + final FluidStack[] aFluids, final ItemStack... aInputs) { return this.findRecipe( aTileEntity, aRecipe, @@ -1785,36 +1742,20 @@ public abstract class GregtechMeta_MultiBlockBase<T extends GT_MetaTileEntity_Ex aInputs); } - public GT_Recipe findRecipe( - final IHasWorldObjectAndCoords aTileEntity, - final GT_Recipe aRecipe, - final boolean aNotUnificated, - final long aVoltage, - final FluidStack[] aFluids, - final ItemStack... aInputs) { + public GT_Recipe findRecipe(final IHasWorldObjectAndCoords aTileEntity, final GT_Recipe aRecipe, + final boolean aNotUnificated, final long aVoltage, final FluidStack[] aFluids, final ItemStack... aInputs) { return this.findRecipe(aTileEntity, aRecipe, aNotUnificated, aVoltage, aFluids, (ItemStack) null, aInputs); } - public GT_Recipe findRecipe( - final IHasWorldObjectAndCoords aTileEntity, - final GT_Recipe aRecipe, - final boolean aNotUnificated, - final long aVoltage, - final FluidStack[] aFluids, - final ItemStack aSpecialSlot, + public GT_Recipe findRecipe(final IHasWorldObjectAndCoords aTileEntity, final GT_Recipe aRecipe, + final boolean aNotUnificated, final long aVoltage, final FluidStack[] aFluids, final ItemStack aSpecialSlot, final ItemStack... aInputs) { return this.findRecipe(aTileEntity, aRecipe, aNotUnificated, true, aVoltage, aFluids, aSpecialSlot, aInputs); } - public GT_Recipe findRecipe( - final IHasWorldObjectAndCoords aTileEntity, - final GT_Recipe aRecipe, - final boolean aNotUnificated, - final boolean aDontCheckStackSizes, - final long aVoltage, - final FluidStack[] aFluids, - final ItemStack aSpecialSlot, - ItemStack... aInputs) { + public GT_Recipe findRecipe(final IHasWorldObjectAndCoords aTileEntity, final GT_Recipe aRecipe, + final boolean aNotUnificated, final boolean aDontCheckStackSizes, final long aVoltage, + final FluidStack[] aFluids, final ItemStack aSpecialSlot, ItemStack... aInputs) { if (this.getRecipeMap().mRecipeList.isEmpty()) { log("No Recipes in Map to search through."); return null; @@ -1860,11 +1801,10 @@ public abstract class GregtechMeta_MultiBlockBase<T extends GT_MetaTileEntity_Ex if (aNotUnificated) { aInputs = GT_OreDictUnificator.getStackArray(true, (Object[]) aInputs); } - if (aRecipe != null - && !aRecipe.mFakeRecipe + if (aRecipe != null && !aRecipe.mFakeRecipe && aRecipe.mCanBeBuffered && aRecipe.isRecipeInputEqual(false, aDontCheckStackSizes, aFluids, aInputs)) { - mRecipeResult = (aRecipe.mEnabled /* && aVoltage * this.getRecipeMap().mAmperage >= aRecipe.mEUt*/) + mRecipeResult = (aRecipe.mEnabled /* && aVoltage * this.getRecipeMap().mAmperage >= aRecipe.mEUt */) ? aRecipe : null; log("x) Found Recipe? " + (mRecipeResult != null ? "true" : "false")); @@ -1872,22 +1812,21 @@ public abstract class GregtechMeta_MultiBlockBase<T extends GT_MetaTileEntity_Ex return mRecipeResult; } } - if (mRecipeResult == null - && this.getRecipeMap().mUsualInputCount >= 0 + if (mRecipeResult == null && this.getRecipeMap().mUsualInputCount >= 0 && aInputs != null && aInputs.length > 0) { for (final ItemStack tStack : aInputs) { if (tStack != null) { - Collection<GT_Recipe> tRecipes = - this.getRecipeMap().mRecipeItemMap.get(new GT_ItemStack(tStack)); + Collection<GT_Recipe> tRecipes = this.getRecipeMap().mRecipeItemMap + .get(new GT_ItemStack(tStack)); if (tRecipes != null) { for (final GT_Recipe tRecipe : tRecipes) { if (!tRecipe.mFakeRecipe && tRecipe.isRecipeInputEqual(false, aDontCheckStackSizes, aFluids, aInputs)) { - mRecipeResult = - (tRecipe.mEnabled /* && aVoltage * this.getRecipeMap().mAmperage >= tRecipe.mEUt*/) - ? tRecipe - : null; + mRecipeResult = (tRecipe.mEnabled /* + * && aVoltage * this.getRecipeMap().mAmperage >= + * tRecipe.mEUt + */) ? tRecipe : null; log("1) Found Recipe? " + (mRecipeResult != null ? "true" : "false")); // return mRecipeResult; } @@ -1895,17 +1834,16 @@ public abstract class GregtechMeta_MultiBlockBase<T extends GT_MetaTileEntity_Ex } // TODO - Investigate if this requires to be in it's own block - tRecipes = this.getRecipeMap() - .mRecipeItemMap - .get(new GT_ItemStack(GT_Utility.copyMetaData(32767L, new Object[] {tStack}))); + tRecipes = this.getRecipeMap().mRecipeItemMap + .get(new GT_ItemStack(GT_Utility.copyMetaData(32767L, new Object[] { tStack }))); if (tRecipes != null) { for (final GT_Recipe tRecipe : tRecipes) { if (!tRecipe.mFakeRecipe && tRecipe.isRecipeInputEqual(false, aDontCheckStackSizes, aFluids, aInputs)) { - mRecipeResult = - (tRecipe.mEnabled /*&& aVoltage * this.getRecipeMap().mAmperage >= tRecipe.mEUt*/) - ? tRecipe - : null; + mRecipeResult = (tRecipe.mEnabled /* + * && aVoltage * this.getRecipeMap().mAmperage >= + * tRecipe.mEUt + */) ? tRecipe : null; log("2) Found Recipe? " + (mRecipeResult != null ? "true" : "false")); // return mRecipeResult; } @@ -1914,22 +1852,21 @@ public abstract class GregtechMeta_MultiBlockBase<T extends GT_MetaTileEntity_Ex } } } - if (mRecipeResult == null - && this.getRecipeMap().mMinimalInputItems == 0 + if (mRecipeResult == null && this.getRecipeMap().mMinimalInputItems == 0 && aFluids != null && aFluids.length > 0) { for (final FluidStack aFluid2 : aFluids) { if (aFluid2 != null) { - final Collection<GT_Recipe> tRecipes = - this.getRecipeMap().mRecipeFluidMap.get(aFluid2.getFluid()); + final Collection<GT_Recipe> tRecipes = this.getRecipeMap().mRecipeFluidMap + .get(aFluid2.getFluid()); if (tRecipes != null) { for (final GT_Recipe tRecipe : tRecipes) { if (!tRecipe.mFakeRecipe && tRecipe.isRecipeInputEqual(false, aDontCheckStackSizes, aFluids, aInputs)) { - mRecipeResult = - (tRecipe.mEnabled /* && aVoltage * this.getRecipeMap().mAmperage >= tRecipe.mEUt*/) - ? tRecipe - : null; + mRecipeResult = (tRecipe.mEnabled /* + * && aVoltage * this.getRecipeMap().mAmperage >= + * tRecipe.mEUt + */) ? tRecipe : null; log("3) Found Recipe? " + (mRecipeResult != null ? "true" : "false")); // return mRecipeResult; } @@ -1943,8 +1880,10 @@ public abstract class GregtechMeta_MultiBlockBase<T extends GT_MetaTileEntity_Ex } if (mRecipeResult == null) { - log("Invalid recipe, Fallback lookup. " - + this.getRecipeMap().mRecipeList.size() + " | " + this.getRecipeMap().mNEIName); + log( + "Invalid recipe, Fallback lookup. " + this.getRecipeMap().mRecipeList.size() + + " | " + + this.getRecipeMap().mNEIName); if (!CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK) { try { return (GT_Recipe) findRecipe08.invoke( @@ -1986,8 +1925,8 @@ public abstract class GregtechMeta_MultiBlockBase<T extends GT_MetaTileEntity_Ex * Custom Tool Handling */ @Override - public boolean onRightclick( - IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer, byte aSide, float aX, float aY, float aZ) { + public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer, byte aSide, float aX, + float aY, float aZ) { // Do Things if (this.getBaseMetaTileEntity().isServerSide()) { // Logger.INFO("Right Clicked Controller."); @@ -2019,8 +1958,12 @@ public abstract class GregtechMeta_MultiBlockBase<T extends GT_MetaTileEntity_Ex if (hatch.mFluid != null) { PlayerUtils.messagePlayer( aPlayer, - "Clearing " + hatch.mFluid.amount + "L of " + hatch.mFluid.getLocalizedName() + " from hatch " - + aHatchIndex + "."); + "Clearing " + hatch.mFluid.amount + + "L of " + + hatch.mFluid.getLocalizedName() + + " from hatch " + + aHatchIndex + + "."); hatch.mFluid = null; } aHatchIndex++; @@ -2029,21 +1972,22 @@ public abstract class GregtechMeta_MultiBlockBase<T extends GT_MetaTileEntity_Ex } @Override - public boolean onSolderingToolRightClick( - byte aSide, byte aWrenchingSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { + public boolean onSolderingToolRightClick(byte aSide, byte aWrenchingSide, EntityPlayer aPlayer, float aX, float aY, + float aZ) { boolean tSuper = super.onSolderingToolRightClick(aSide, aWrenchingSide, aPlayer, aX, aY, aZ); if (aPlayer.isSneaking()) return tSuper; mVoidExcess = !mVoidExcess; - aPlayer.addChatMessage(new ChatComponentTranslation( - mVoidExcess ? "interaction.voidexcess.enabled" : "interaction.voidexcess.disabled")); + aPlayer.addChatMessage( + new ChatComponentTranslation( + mVoidExcess ? "interaction.voidexcess.enabled" : "interaction.voidexcess.disabled")); return true; } protected boolean mUseMultiparallelMode = false; @Override - public boolean onWireCutterRightClick( - byte aSide, byte aWrenchingSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { + public boolean onWireCutterRightClick(byte aSide, byte aWrenchingSide, EntityPlayer aPlayer, float aX, float aY, + float aZ) { if (aPlayer.isSneaking()) { mUseMultiparallelMode = !mUseMultiparallelMode; if (mUseMultiparallelMode) { @@ -2056,21 +2000,15 @@ public abstract class GregtechMeta_MultiBlockBase<T extends GT_MetaTileEntity_Ex return false; } - public boolean isValidBlockForStructure( - IGregTechTileEntity aBaseMetaTileEntity, - int aCasingID, - boolean canBeHatch, - Block aFoundBlock, - int aFoundMeta, - Block aExpectedBlock, - int aExpectedMeta) { + public boolean isValidBlockForStructure(IGregTechTileEntity aBaseMetaTileEntity, int aCasingID, boolean canBeHatch, + Block aFoundBlock, int aFoundMeta, Block aExpectedBlock, int aExpectedMeta) { boolean isHatch = false; if (aBaseMetaTileEntity != null) { // Unsure why this check exists? - /*if (aCasingID < 64) { - aCasingID = TAE.GTPP_INDEX(aCasingID); - }*/ + /* + * if (aCasingID < 64) { aCasingID = TAE.GTPP_INDEX(aCasingID); } + */ isHatch = this.addToMachineList(aBaseMetaTileEntity, aCasingID); if (isHatch) { @@ -2110,8 +2048,14 @@ public abstract class GregtechMeta_MultiBlockBase<T extends GT_MetaTileEntity_Ex return true; } else if (aFoundBlock != aExpectedBlock) { if (GTplusplus.CURRENT_LOAD_PHASE == INIT_PHASE.STARTED) { - log("A1 - Found: " + aFoundBlock.getLocalizedName() + ":" + aFoundMeta + ", Expected: " - + aExpectedBlock.getLocalizedName() + ":" + aExpectedMeta); + log( + "A1 - Found: " + aFoundBlock.getLocalizedName() + + ":" + + aFoundMeta + + ", Expected: " + + aExpectedBlock.getLocalizedName() + + ":" + + aExpectedMeta); // log("Loc: "+(new BlockPos(aBaseMetaTileEntity).getLocationString())); } return false; @@ -2149,31 +2093,24 @@ public abstract class GregtechMeta_MultiBlockBase<T extends GT_MetaTileEntity_Ex } private final void tryTickWaitTimerDown() { - /*if (mStartUpCheck > 10) { - mStartUpCheck = 10; - }*/ + /* + * if (mStartUpCheck > 10) { mStartUpCheck = 10; } + */ } // Only support to use meta to tier /** * accept meta [0, maxMeta) + * * @param maxMeta exclusive */ - public static <T> IStructureElement<T> addTieredBlock( - Block aBlock, - BiConsumer<T, Integer> aSetTheFuckingMeta, - Function<T, Integer> aGetTheFuckingMeta, - int maxMeta) { - return addTieredBlock( - aBlock, - (t, i) -> { - aSetTheFuckingMeta.accept(t, i); - return true; - }, - aGetTheFuckingMeta, - 0, - maxMeta); + public static <T> IStructureElement<T> addTieredBlock(Block aBlock, BiConsumer<T, Integer> aSetTheFuckingMeta, + Function<T, Integer> aGetTheFuckingMeta, int maxMeta) { + return addTieredBlock(aBlock, (t, i) -> { + aSetTheFuckingMeta.accept(t, i); + return true; + }, aGetTheFuckingMeta, 0, maxMeta); } /** @@ -2181,21 +2118,12 @@ public abstract class GregtechMeta_MultiBlockBase<T extends GT_MetaTileEntity_Ex * @param minMeta inclusive * @param maxMeta exclusive */ - public static <T> IStructureElement<T> addTieredBlock( - Block aBlock, - BiConsumer<T, Integer> aSetTheFuckingMeta, - Function<T, Integer> aGetTheFuckingMeta, - int minMeta, - int maxMeta) { - return addTieredBlock( - aBlock, - (t, i) -> { - aSetTheFuckingMeta.accept(t, i); - return true; - }, - aGetTheFuckingMeta, - minMeta, - maxMeta); + public static <T> IStructureElement<T> addTieredBlock(Block aBlock, BiConsumer<T, Integer> aSetTheFuckingMeta, + Function<T, Integer> aGetTheFuckingMeta, int minMeta, int maxMeta) { + return addTieredBlock(aBlock, (t, i) -> { + aSetTheFuckingMeta.accept(t, i); + return true; + }, aGetTheFuckingMeta, minMeta, maxMeta); } /** @@ -2203,14 +2131,11 @@ public abstract class GregtechMeta_MultiBlockBase<T extends GT_MetaTileEntity_Ex * @param minMeta inclusive * @param maxMeta exclusive */ - public static <T> IStructureElement<T> addTieredBlock( - Block aBlock, - BiPredicate<T, Integer> aSetTheFuckingMeta, - Function<T, Integer> aGetTheFuckingMeta, - int minMeta, - int maxMeta) { + public static <T> IStructureElement<T> addTieredBlock(Block aBlock, BiPredicate<T, Integer> aSetTheFuckingMeta, + Function<T, Integer> aGetTheFuckingMeta, int minMeta, int maxMeta) { return new IStructureElement<T>() { + @Override public boolean check(T t, World world, int x, int y, int z) { Block tBlock = world.getBlock(x, y, z); @@ -2247,14 +2172,14 @@ public abstract class GregtechMeta_MultiBlockBase<T extends GT_MetaTileEntity_Ex @Nullable @Override - public BlocksToPlace getBlocksToPlace( - T t, World world, int x, int y, int z, ItemStack trigger, AutoPlaceEnvironment env) { + public BlocksToPlace getBlocksToPlace(T t, World world, int x, int y, int z, ItemStack trigger, + AutoPlaceEnvironment env) { return BlocksToPlace.create(aBlock, getMeta(trigger)); } @Override - public PlaceResult survivalPlaceBlock( - T t, World world, int x, int y, int z, ItemStack trigger, AutoPlaceEnvironment env) { + public PlaceResult survivalPlaceBlock(T t, World world, int x, int y, int z, ItemStack trigger, + AutoPlaceEnvironment env) { if (world.getBlock(x, y, z) == aBlock) { if (world.getBlockMetadata(x, y, z) == getMeta(trigger)) { return PlaceResult.SKIP; @@ -2262,37 +2187,29 @@ public abstract class GregtechMeta_MultiBlockBase<T extends GT_MetaTileEntity_Ex return PlaceResult.REJECT; } return StructureUtility.survivalPlaceBlock( - aBlock, getMeta(trigger), world, x, y, z, env.getSource(), env.getActor(), env.getChatter()); + aBlock, + getMeta(trigger), + world, + x, + y, + z, + env.getSource(), + env.getActor(), + env.getChatter()); } }; } @Override - public ITexture[] getTexture( - IGregTechTileEntity aBaseMetaTileEntity, - byte aSide, - byte aFacing, - byte aColorIndex, - boolean aActive, - boolean aRedstone) { + public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, + boolean aActive, boolean aRedstone) { if (aSide == aFacing) { - if (aActive) - return new ITexture[] { - getCasingTexture(), - TextureFactory.builder() - .addIcon(getActiveOverlay()) - .extFacing() - .build() - }; - return new ITexture[] { - getCasingTexture(), - TextureFactory.builder() - .addIcon(getInactiveOverlay()) - .extFacing() - .build() - }; - } - return new ITexture[] {getCasingTexture()}; + if (aActive) return new ITexture[] { getCasingTexture(), + TextureFactory.builder().addIcon(getActiveOverlay()).extFacing().build() }; + return new ITexture[] { getCasingTexture(), + TextureFactory.builder().addIcon(getInactiveOverlay()).extFacing().build() }; + } + return new ITexture[] { getCasingTexture() }; } protected IIconContainer getActiveOverlay() { @@ -2325,15 +2242,12 @@ public abstract class GregtechMeta_MultiBlockBase<T extends GT_MetaTileEntity_Ex private static final ConcurrentHashMap<String, ItemStack> mToolStacks = new ConcurrentHashMap<>(); protected void addNoPlayerInventoryUI(ModularWindow.Builder builder, UIBuildContext buildContext) { - builder.widget(new DrawableWidget() - .setDrawable(GT_UITextures.PICTURE_SCREEN_BLACK) - .setPos(3, 4) - .setSize(152, 159)); + builder.widget( + new DrawableWidget().setDrawable(GT_UITextures.PICTURE_SCREEN_BLACK).setPos(3, 4).setSize(152, 159)); for (int i = 0; i < 9; i++) { - builder.widget(new DrawableWidget() - .setDrawable(GT_UITextures.BUTTON_STANDARD) - .setPos(155, 3 + i * 18) - .setSize(18, 18)); + builder.widget( + new DrawableWidget().setDrawable(GT_UITextures.BUTTON_STANDARD).setPos(155, 3 + i * 18) + .setSize(18, 18)); } DynamicPositionedColumn screenElements = new DynamicPositionedColumn(); @@ -2342,163 +2256,229 @@ public abstract class GregtechMeta_MultiBlockBase<T extends GT_MetaTileEntity_Ex setupToolDisplay(); - builder.widget(new ItemDrawable(() -> mToolStacks.get(mWrench + "WRENCH")) - .asWidget() - .setPos(156, 58)) + builder.widget(new ItemDrawable(() -> mToolStacks.get(mWrench + "WRENCH")).asWidget().setPos(156, 58)) .widget(new FakeSyncWidget.BooleanSyncer(() -> mWrench, val -> mWrench = val)); - builder.widget(new ItemDrawable(() -> mToolStacks.get(mCrowbar + "CROWBAR")) - .asWidget() - .setPos(156, 76)) + builder.widget(new ItemDrawable(() -> mToolStacks.get(mCrowbar + "CROWBAR")).asWidget().setPos(156, 76)) .widget(new FakeSyncWidget.BooleanSyncer(() -> mCrowbar, val -> mCrowbar = val)); - builder.widget(new ItemDrawable(() -> mToolStacks.get(mHardHammer + "HARDHAMMER")) - .asWidget() - .setPos(156, 94)) - .widget(new TextWidget("H") - .setDefaultColor(COLOR_TEXT_WHITE.get()) - .setPos(167, 103)) + builder.widget(new ItemDrawable(() -> mToolStacks.get(mHardHammer + "HARDHAMMER")).asWidget().setPos(156, 94)) + .widget(new TextWidget("H").setDefaultColor(COLOR_TEXT_WHITE.get()).setPos(167, 103)) .widget(new FakeSyncWidget.BooleanSyncer(() -> mHardHammer, val -> mHardHammer = val)); - builder.widget(new ItemDrawable(() -> mToolStacks.get(mSoftHammer + "SOFTHAMMER")) - .asWidget() - .setPos(156, 112)) - .widget(new TextWidget("M") - .setDefaultColor(COLOR_TEXT_WHITE.get()) - .setPos(167, 121)) + builder.widget(new ItemDrawable(() -> mToolStacks.get(mSoftHammer + "SOFTHAMMER")).asWidget().setPos(156, 112)) + .widget(new TextWidget("M").setDefaultColor(COLOR_TEXT_WHITE.get()).setPos(167, 121)) .widget(new FakeSyncWidget.BooleanSyncer(() -> mSoftHammer, val -> mSoftHammer = val)); - builder.widget(new ItemDrawable(() -> mToolStacks.get(mScrewdriver + "SCREWDRIVER")) - .asWidget() - .setPos(156, 130)) + builder.widget( + new ItemDrawable(() -> mToolStacks.get(mScrewdriver + "SCREWDRIVER")).asWidget().setPos(156, 130)) .widget(new FakeSyncWidget.BooleanSyncer(() -> mScrewdriver, val -> mScrewdriver = val)); - builder.widget(new ItemDrawable(() -> mToolStacks.get(mSolderingTool + "SOLDERING_IRON_LV")) - .asWidget() + builder.widget( + new ItemDrawable(() -> mToolStacks.get(mSolderingTool + "SOLDERING_IRON_LV")).asWidget() .setPos(156, 148)) .widget(new FakeSyncWidget.BooleanSyncer(() -> mSolderingTool, val -> mSolderingTool = val)); - builder.widget(new ItemDrawable( - () -> mToolStacks.get(getBaseMetaTileEntity().isActive() + "GLASS")) - .asWidget() + builder.widget( + new ItemDrawable(() -> mToolStacks.get(getBaseMetaTileEntity().isActive() + "GLASS")).asWidget() .setPos(156, 22)) - .widget(TextWidget.dynamicString(() -> getBaseMetaTileEntity().isActive() ? "On" : "Off") - .setSynced(false) - .setDefaultColor(COLOR_TEXT_WHITE.get()) - .setPos(157, 31)) - .widget(new FakeSyncWidget.BooleanSyncer( - () -> getBaseMetaTileEntity().isActive(), - val -> getBaseMetaTileEntity().setActive(val))); + .widget( + TextWidget.dynamicString(() -> getBaseMetaTileEntity().isActive() ? "On" : "Off") + .setSynced(false).setDefaultColor(COLOR_TEXT_WHITE.get()).setPos(157, 31)) + .widget( + new FakeSyncWidget.BooleanSyncer( + () -> getBaseMetaTileEntity().isActive(), + val -> getBaseMetaTileEntity().setActive(val))); } protected void drawTextsNoPlayerInventory(DynamicPositionedColumn screenElements) { screenElements.setSynced(false).setSpace(0).setPos(6, 7); screenElements - .widget(new TextWidget(GT_Utility.trans("138", "Incomplete Structure.")) - .setDefaultColor(COLOR_TEXT_WHITE.get()) - .setEnabled(widget -> !mMachine)) + .widget( + new TextWidget(GT_Utility.trans("138", "Incomplete Structure.")) + .setDefaultColor(COLOR_TEXT_WHITE.get()).setEnabled(widget -> !mMachine)) .widget(new FakeSyncWidget.BooleanSyncer(() -> mMachine, val -> mMachine = val)) - .widget(TextWidget.dynamicString(() -> StatCollector.translateToLocal("GTPP.machines.input") + " " - + StatCollector.translateToLocal("GTPP.machines.tier") + ": " + EnumChatFormatting.GREEN - + GT_Values.VOLTAGE_NAMES[(int) getInputTier()]) - .setDefaultColor(COLOR_TEXT_WHITE.get()) - .setEnabled(widget -> mMachine && getInputTier() > 0)) - .widget(TextWidget.dynamicString(() -> StatCollector.translateToLocal("GTPP.machines.output") + " " - + StatCollector.translateToLocal("GTPP.machines.tier") + ": " + EnumChatFormatting.GREEN - + GT_Values.VOLTAGE_NAMES[(int) getOutputTier()]) - .setDefaultColor(COLOR_TEXT_WHITE.get()) - .setEnabled(widget -> mMachine && getOutputTier() > 0)) - .widget(TextWidget.dynamicString(() -> StatCollector.translateToLocal("GTPP.multiblock.progress") + ": " - + EnumChatFormatting.GREEN - + getBaseMetaTileEntity().getProgress() / 20 - + EnumChatFormatting.RESET + " s / " + EnumChatFormatting.YELLOW - + getBaseMetaTileEntity().getMaxProgress() / 20 - + EnumChatFormatting.RESET + " s") - .setDefaultColor(COLOR_TEXT_WHITE.get()) - .setEnabled(widget -> mMachine)) - .widget(new TextWidget(StatCollector.translateToLocal("GTPP.multiblock.energy") + ":") - .setDefaultColor(COLOR_TEXT_WHITE.get()) - .setEnabled(widget -> mMachine)) - .widget(TextWidget.dynamicString(() -> StatCollector.translateToLocal( - "" + EnumChatFormatting.GREEN + getStoredEnergyInAllEnergyHatches() - + EnumChatFormatting.RESET + " EU / " + EnumChatFormatting.YELLOW - + getMaxEnergyStorageOfAllEnergyHatches() - + EnumChatFormatting.RESET + " EU")) - .setDefaultColor(COLOR_TEXT_WHITE.get()) - .setEnabled(widget -> mMachine)) - .widget(new TextWidget(StatCollector.translateToLocal("GTPP.multiblock.usage") + ":") - .setDefaultColor(COLOR_TEXT_WHITE.get()) - .setEnabled(widget -> mMachine && getLastRecipeEU() > 0 && getLastRecipeDuration() > 0)) - .widget(TextWidget.dynamicString(() -> StatCollector.translateToLocal("" + EnumChatFormatting.RED - + -getLastRecipeEU() + EnumChatFormatting.RESET + " EU/t/parallel")) - .setDefaultColor(COLOR_TEXT_WHITE.get()) - .setEnabled(widget -> mMachine && getLastRecipeEU() > 0 && getLastRecipeDuration() > 0)) - .widget(TextWidget.dynamicString( - () -> StatCollector.translateToLocal("GTPP.multiblock.generation") + ":") - .setDefaultColor(COLOR_TEXT_WHITE.get()) - .setEnabled(widget -> mMachine && getLastRecipeEU() < 0 && getLastRecipeDuration() > 0)) - .widget(TextWidget.dynamicString(() -> StatCollector.translateToLocal("" + EnumChatFormatting.GREEN - + getLastRecipeEU() + EnumChatFormatting.RESET + " EU/t/parallel")) - .setDefaultColor(COLOR_TEXT_WHITE.get()) - .setEnabled(widget -> mMachine && getLastRecipeEU() < 0 && getLastRecipeDuration() > 0)) - .widget(TextWidget.dynamicString(() -> StatCollector.translateToLocal("GTPP.multiblock.duration") + ": " - + EnumChatFormatting.RED + getLastRecipeDuration() + EnumChatFormatting.RESET - + " ticks") - .setDefaultColor(COLOR_TEXT_WHITE.get()) - .setEnabled(widget -> mMachine && getLastRecipeEU() != 0 && getLastRecipeDuration() > 0)) - .widget(TextWidget.dynamicString(() -> StatCollector.translateToLocal("GTPP.multiblock.specialvalue") - + ": " + EnumChatFormatting.RED + getLastRecipeEU() + EnumChatFormatting.RESET + "") - .setDefaultColor(COLOR_TEXT_WHITE.get()) - .setEnabled(widget -> mMachine - && getLastRecipeEU() != 0 - && getLastRecipeDuration() > 0 - && (mLastRecipe != null ? mLastRecipe.mSpecialValue : 0) > 0)) - .widget(new TextWidget(StatCollector.translateToLocal("GTPP.multiblock.mei") + ":") - .setDefaultColor(COLOR_TEXT_WHITE.get()) - .setEnabled(widget -> mMachine)) - .widget(TextWidget.dynamicString(() -> - StatCollector.translateToLocal("" + EnumChatFormatting.YELLOW + getMaxInputVoltage() - + EnumChatFormatting.RESET + " EU/t(*2A) " + .widget( + TextWidget + .dynamicString( + () -> StatCollector.translateToLocal("GTPP.machines.input") + " " + + StatCollector.translateToLocal("GTPP.machines.tier") + + ": " + + EnumChatFormatting.GREEN + + GT_Values.VOLTAGE_NAMES[(int) getInputTier()]) + .setDefaultColor(COLOR_TEXT_WHITE.get()) + .setEnabled(widget -> mMachine && getInputTier() > 0)) + .widget( + TextWidget.dynamicString( + () -> StatCollector.translateToLocal("GTPP.machines.output") + " " + StatCollector.translateToLocal("GTPP.machines.tier") - + ": " + EnumChatFormatting.YELLOW - + GT_Values.VN[GT_Utility.getTier(getMaxInputVoltage())] - + EnumChatFormatting.RESET)) - .setDefaultColor(COLOR_TEXT_WHITE.get()) - .setEnabled(widget -> mMachine)) - .widget(TextWidget.dynamicString(() -> StatCollector.translateToLocal("GTPP.multiblock.efficiency") - + ": " + EnumChatFormatting.YELLOW + (mEfficiency / 100.0F) + EnumChatFormatting.RESET - + " %") - .setDefaultColor(COLOR_TEXT_WHITE.get()) - .setEnabled(widget -> mMachine)) - .widget(TextWidget.dynamicString(() -> StatCollector.translateToLocal("GTPP.multiblock.pollution") - + ": " + EnumChatFormatting.RED + (getPollutionPerTick(null) * 20) - + EnumChatFormatting.RESET + "/sec") - .setDefaultColor(COLOR_TEXT_WHITE.get()) - .setEnabled(widget -> mMachine)) - .widget(TextWidget.dynamicString( - () -> StatCollector.translateToLocal("GTPP.multiblock.pollutionreduced") + ": " - + EnumChatFormatting.GREEN + getPollutionReductionForAllMufflers() - + EnumChatFormatting.RESET + " %") - .setDefaultColor(COLOR_TEXT_WHITE.get()) - .setEnabled(widget -> mMachine)) - .widget(new TextWidget("Total Time Since Built: ") - .setDefaultColor(COLOR_TEXT_WHITE.get()) - .setEnabled(widget -> mMachine)) - .widget(TextWidget.dynamicString(() -> "" + EnumChatFormatting.DARK_GREEN + getRuntimeWeeksDisplay() - + EnumChatFormatting.RESET + " Weeks,") - .setDefaultColor(COLOR_TEXT_WHITE.get()) - .setEnabled(widget -> mMachine)) - .widget(TextWidget.dynamicString(() -> "" + EnumChatFormatting.DARK_GREEN + getRuntimeDaysDisplay() - + EnumChatFormatting.RESET + " Days,") - .setDefaultColor(COLOR_TEXT_WHITE.get()) - .setEnabled(widget -> mMachine)) - .widget(TextWidget.dynamicString(() -> "" + EnumChatFormatting.DARK_GREEN + getRuntimeHoursDisplay() - + EnumChatFormatting.RESET + " Hours,") - .setDefaultColor(COLOR_TEXT_WHITE.get()) - .setEnabled(widget -> mMachine)) - .widget(TextWidget.dynamicString(() -> "" + EnumChatFormatting.DARK_GREEN + getRuntimeMinutesDisplay() - + EnumChatFormatting.RESET + " Minutes,") - .setDefaultColor(COLOR_TEXT_WHITE.get()) - .setEnabled(widget -> mMachine)) - .widget(TextWidget.dynamicString(() -> "" + EnumChatFormatting.DARK_GREEN + getRuntimeSecondsDisplay() - + EnumChatFormatting.RESET + " Seconds") - .setDefaultColor(COLOR_TEXT_WHITE.get()) - .setEnabled(widget -> mMachine)); + + ": " + + EnumChatFormatting.GREEN + + GT_Values.VOLTAGE_NAMES[(int) getOutputTier()]) + .setDefaultColor(COLOR_TEXT_WHITE.get()) + .setEnabled(widget -> mMachine && getOutputTier() > 0)) + .widget( + TextWidget + .dynamicString( + () -> StatCollector.translateToLocal("GTPP.multiblock.progress") + ": " + + EnumChatFormatting.GREEN + + getBaseMetaTileEntity().getProgress() / 20 + + EnumChatFormatting.RESET + + " s / " + + EnumChatFormatting.YELLOW + + getBaseMetaTileEntity().getMaxProgress() / 20 + + EnumChatFormatting.RESET + + " s") + .setDefaultColor(COLOR_TEXT_WHITE.get()).setEnabled(widget -> mMachine)) + .widget( + new TextWidget(StatCollector.translateToLocal("GTPP.multiblock.energy") + ":") + .setDefaultColor(COLOR_TEXT_WHITE.get()).setEnabled(widget -> mMachine)) + .widget( + TextWidget + .dynamicString( + () -> StatCollector.translateToLocal( + "" + EnumChatFormatting.GREEN + + getStoredEnergyInAllEnergyHatches() + + EnumChatFormatting.RESET + + " EU / " + + EnumChatFormatting.YELLOW + + getMaxEnergyStorageOfAllEnergyHatches() + + EnumChatFormatting.RESET + + " EU")) + .setDefaultColor(COLOR_TEXT_WHITE.get()).setEnabled(widget -> mMachine)) + .widget( + new TextWidget(StatCollector.translateToLocal("GTPP.multiblock.usage") + ":") + .setDefaultColor(COLOR_TEXT_WHITE.get()) + .setEnabled(widget -> mMachine && getLastRecipeEU() > 0 && getLastRecipeDuration() > 0)) + .widget( + TextWidget + .dynamicString( + () -> StatCollector.translateToLocal( + "" + EnumChatFormatting.RED + + -getLastRecipeEU() + + EnumChatFormatting.RESET + + " EU/t/parallel")) + .setDefaultColor(COLOR_TEXT_WHITE.get()) + .setEnabled(widget -> mMachine && getLastRecipeEU() > 0 && getLastRecipeDuration() > 0)) + .widget( + TextWidget + .dynamicString(() -> StatCollector.translateToLocal("GTPP.multiblock.generation") + ":") + .setDefaultColor(COLOR_TEXT_WHITE.get()) + .setEnabled(widget -> mMachine && getLastRecipeEU() < 0 && getLastRecipeDuration() > 0)) + .widget( + TextWidget + .dynamicString( + () -> StatCollector.translateToLocal( + "" + EnumChatFormatting.GREEN + + getLastRecipeEU() + + EnumChatFormatting.RESET + + " EU/t/parallel")) + .setDefaultColor(COLOR_TEXT_WHITE.get()) + .setEnabled(widget -> mMachine && getLastRecipeEU() < 0 && getLastRecipeDuration() > 0)) + .widget( + TextWidget + .dynamicString( + () -> StatCollector.translateToLocal("GTPP.multiblock.duration") + ": " + + EnumChatFormatting.RED + + getLastRecipeDuration() + + EnumChatFormatting.RESET + + " ticks") + .setDefaultColor(COLOR_TEXT_WHITE.get()).setEnabled( + widget -> mMachine && getLastRecipeEU() != 0 && getLastRecipeDuration() > 0)) + .widget( + TextWidget + .dynamicString( + () -> StatCollector.translateToLocal("GTPP.multiblock.specialvalue") + ": " + + EnumChatFormatting.RED + + getLastRecipeEU() + + EnumChatFormatting.RESET + + "") + .setDefaultColor(COLOR_TEXT_WHITE.get()).setEnabled( + widget -> mMachine && getLastRecipeEU() != 0 + && getLastRecipeDuration() > 0 + && (mLastRecipe != null ? mLastRecipe.mSpecialValue : 0) > 0)) + .widget( + new TextWidget(StatCollector.translateToLocal("GTPP.multiblock.mei") + ":") + .setDefaultColor(COLOR_TEXT_WHITE.get()).setEnabled(widget -> mMachine)) + .widget( + TextWidget + .dynamicString( + () -> StatCollector.translateToLocal( + "" + EnumChatFormatting.YELLOW + + getMaxInputVoltage() + + EnumChatFormatting.RESET + + " EU/t(*2A) " + + StatCollector.translateToLocal("GTPP.machines.tier") + + ": " + + EnumChatFormatting.YELLOW + + GT_Values.VN[GT_Utility.getTier(getMaxInputVoltage())] + + EnumChatFormatting.RESET)) + .setDefaultColor(COLOR_TEXT_WHITE.get()).setEnabled(widget -> mMachine)) + .widget( + TextWidget + .dynamicString( + () -> StatCollector.translateToLocal("GTPP.multiblock.efficiency") + ": " + + EnumChatFormatting.YELLOW + + (mEfficiency / 100.0F) + + EnumChatFormatting.RESET + + " %") + .setDefaultColor(COLOR_TEXT_WHITE.get()).setEnabled(widget -> mMachine)) + .widget( + TextWidget + .dynamicString( + () -> StatCollector.translateToLocal("GTPP.multiblock.pollution") + ": " + + EnumChatFormatting.RED + + (getPollutionPerTick(null) * 20) + + EnumChatFormatting.RESET + + "/sec") + .setDefaultColor(COLOR_TEXT_WHITE.get()).setEnabled(widget -> mMachine)) + .widget( + TextWidget + .dynamicString( + () -> StatCollector.translateToLocal("GTPP.multiblock.pollutionreduced") + ": " + + EnumChatFormatting.GREEN + + getPollutionReductionForAllMufflers() + + EnumChatFormatting.RESET + + " %") + .setDefaultColor(COLOR_TEXT_WHITE.get()).setEnabled(widget -> mMachine)) + .widget( + new TextWidget("Total Time Since Built: ").setDefaultColor(COLOR_TEXT_WHITE.get()) + .setEnabled(widget -> mMachine)) + .widget( + TextWidget + .dynamicString( + () -> "" + EnumChatFormatting.DARK_GREEN + + getRuntimeWeeksDisplay() + + EnumChatFormatting.RESET + + " Weeks,") + .setDefaultColor(COLOR_TEXT_WHITE.get()).setEnabled(widget -> mMachine)) + .widget( + TextWidget + .dynamicString( + () -> "" + EnumChatFormatting.DARK_GREEN + + getRuntimeDaysDisplay() + + EnumChatFormatting.RESET + + " Days,") + .setDefaultColor(COLOR_TEXT_WHITE.get()).setEnabled(widget -> mMachine)) + .widget( + TextWidget + .dynamicString( + () -> "" + EnumChatFormatting.DARK_GREEN + + getRuntimeHoursDisplay() + + EnumChatFormatting.RESET + + " Hours,") + .setDefaultColor(COLOR_TEXT_WHITE.get()).setEnabled(widget -> mMachine)) + .widget( + TextWidget + .dynamicString( + () -> "" + EnumChatFormatting.DARK_GREEN + + getRuntimeMinutesDisplay() + + EnumChatFormatting.RESET + + " Minutes,") + .setDefaultColor(COLOR_TEXT_WHITE.get()).setEnabled(widget -> mMachine)) + .widget( + TextWidget + .dynamicString( + () -> "" + EnumChatFormatting.DARK_GREEN + + getRuntimeSecondsDisplay() + + EnumChatFormatting.RESET + + " Seconds") + .setDefaultColor(COLOR_TEXT_WHITE.get()).setEnabled(widget -> mMachine)); } protected int getLastRecipeEU() { @@ -2522,8 +2502,7 @@ public abstract class GregtechMeta_MultiBlockBase<T extends GT_MetaTileEntity_Ex } protected long getRuntimeHoursDisplay() { - return TimeUnit.SECONDS.toHours(getRuntimeSeconds()) - - TimeUnit.DAYS.toHours(getRuntimeDaysDisplay()) + return TimeUnit.SECONDS.toHours(getRuntimeSeconds()) - TimeUnit.DAYS.toHours(getRuntimeDaysDisplay()) - TimeUnit.DAYS.toHours(7 * getRuntimeWeeksDisplay()); } @@ -2540,53 +2519,61 @@ public abstract class GregtechMeta_MultiBlockBase<T extends GT_MetaTileEntity_Ex mToolStacks.put( true + "WRENCH", - GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( - GT_MetaGenerated_Tool_01.WRENCH, 1, GOOD, Materials.Tungsten, null)); + GT_MetaGenerated_Tool_01.INSTANCE + .getToolWithStats(GT_MetaGenerated_Tool_01.WRENCH, 1, GOOD, Materials.Tungsten, null)); mToolStacks.put( true + "CROWBAR", - GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( - GT_MetaGenerated_Tool_01.CROWBAR, 1, GOOD, Materials.Tungsten, null)); + GT_MetaGenerated_Tool_01.INSTANCE + .getToolWithStats(GT_MetaGenerated_Tool_01.CROWBAR, 1, GOOD, Materials.Tungsten, null)); mToolStacks.put( true + "HARDHAMMER", - GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( - GT_MetaGenerated_Tool_01.HARDHAMMER, 1, GOOD, Materials.Tungsten, null)); + GT_MetaGenerated_Tool_01.INSTANCE + .getToolWithStats(GT_MetaGenerated_Tool_01.HARDHAMMER, 1, GOOD, Materials.Tungsten, null)); mToolStacks.put( true + "SOFTHAMMER", - GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( - GT_MetaGenerated_Tool_01.SOFTHAMMER, 1, GOOD, Materials.Tungsten, null)); + GT_MetaGenerated_Tool_01.INSTANCE + .getToolWithStats(GT_MetaGenerated_Tool_01.SOFTHAMMER, 1, GOOD, Materials.Tungsten, null)); mToolStacks.put( true + "SCREWDRIVER", - GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( - GT_MetaGenerated_Tool_01.SCREWDRIVER, 1, GOOD, Materials.Tungsten, null)); + GT_MetaGenerated_Tool_01.INSTANCE + .getToolWithStats(GT_MetaGenerated_Tool_01.SCREWDRIVER, 1, GOOD, Materials.Tungsten, null)); mToolStacks.put( true + "SOLDERING_IRON_LV", GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( - GT_MetaGenerated_Tool_01.SOLDERING_IRON_LV, 1, GOOD, Materials.Tungsten, null)); + GT_MetaGenerated_Tool_01.SOLDERING_IRON_LV, + 1, + GOOD, + Materials.Tungsten, + null)); mToolStacks.put( false + "WRENCH", - GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( - GT_MetaGenerated_Tool_01.WRENCH, 1, BAD, Materials.Tungsten, null)); + GT_MetaGenerated_Tool_01.INSTANCE + .getToolWithStats(GT_MetaGenerated_Tool_01.WRENCH, 1, BAD, Materials.Tungsten, null)); mToolStacks.put( false + "CROWBAR", - GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( - GT_MetaGenerated_Tool_01.CROWBAR, 1, BAD, Materials.Tungsten, null)); + GT_MetaGenerated_Tool_01.INSTANCE + .getToolWithStats(GT_MetaGenerated_Tool_01.CROWBAR, 1, BAD, Materials.Tungsten, null)); mToolStacks.put( false + "HARDHAMMER", - GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( - GT_MetaGenerated_Tool_01.HARDHAMMER, 1, BAD, Materials.Tungsten, null)); + GT_MetaGenerated_Tool_01.INSTANCE + .getToolWithStats(GT_MetaGenerated_Tool_01.HARDHAMMER, 1, BAD, Materials.Tungsten, null)); mToolStacks.put( false + "SOFTHAMMER", - GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( - GT_MetaGenerated_Tool_01.SOFTHAMMER, 1, BAD, Materials.Tungsten, null)); + GT_MetaGenerated_Tool_01.INSTANCE + .getToolWithStats(GT_MetaGenerated_Tool_01.SOFTHAMMER, 1, BAD, Materials.Tungsten, null)); mToolStacks.put( false + "SCREWDRIVER", - GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( - GT_MetaGenerated_Tool_01.SCREWDRIVER, 1, BAD, Materials.Tungsten, null)); + GT_MetaGenerated_Tool_01.INSTANCE + .getToolWithStats(GT_MetaGenerated_Tool_01.SCREWDRIVER, 1, BAD, Materials.Tungsten, null)); mToolStacks.put( false + "SOLDERING_IRON_LV", GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( - GT_MetaGenerated_Tool_01.SOLDERING_IRON_LV, 1, BAD, Materials.Tungsten, null)); + GT_MetaGenerated_Tool_01.SOLDERING_IRON_LV, + 1, + BAD, + Materials.Tungsten, + null)); ItemStack aGlassPane1 = ItemUtils.getItemStackOfAmountFromOreDict("paneGlassRed", 1); ItemStack aGlassPane2 = ItemUtils.getItemStackOfAmountFromOreDict("paneGlassLime", 1); @@ -2595,36 +2582,38 @@ public abstract class GregtechMeta_MultiBlockBase<T extends GT_MetaTileEntity_Ex } public enum GTPPHatchElement implements IHatchElement<GregtechMeta_MultiBlockBase<?>> { + AirIntake(GregtechMeta_MultiBlockBase::addAirIntakeToMachineList, GT_MetaTileEntity_Hatch_AirIntake.class) { + @Override public long count(GregtechMeta_MultiBlockBase<?> t) { return t.mAirIntakes.size(); } }, - ControlCore( - GregtechMeta_MultiBlockBase::addControlCoreToMachineList, GT_MetaTileEntity_Hatch_ControlCore.class) { + ControlCore(GregtechMeta_MultiBlockBase::addControlCoreToMachineList, + GT_MetaTileEntity_Hatch_ControlCore.class) { + @Override public long count(GregtechMeta_MultiBlockBase<?> t) { return t.mControlCoreBus.size(); } }, - TTDynamo( - GregtechMeta_MultiBlockBase::addMultiAmpDynamoToMachineList, + TTDynamo(GregtechMeta_MultiBlockBase::addMultiAmpDynamoToMachineList, "com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_DynamoMulti") { + @Override public long count(GregtechMeta_MultiBlockBase<?> t) { return t.mTecTechDynamoHatches.size(); } }, - TTEnergy( - GregtechMeta_MultiBlockBase::addMultiAmpEnergyToMachineList, + TTEnergy(GregtechMeta_MultiBlockBase::addMultiAmpEnergyToMachineList, "com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_EnergyMulti") { + @Override public long count(GregtechMeta_MultiBlockBase<?> t) { return t.mTecTechEnergyHatches.size(); } - }, - ; + },; @SuppressWarnings("unchecked") private static <T> Class<T> retype(Class<?> clazz) { @@ -2635,19 +2624,15 @@ public abstract class GregtechMeta_MultiBlockBase<T extends GT_MetaTileEntity_Ex private final IGT_HatchAdder<? super GregtechMeta_MultiBlockBase<?>> mAdder; @SafeVarargs - GTPPHatchElement( - IGT_HatchAdder<? super GregtechMeta_MultiBlockBase<?>> aAdder, + GTPPHatchElement(IGT_HatchAdder<? super GregtechMeta_MultiBlockBase<?>> aAdder, Class<? extends IMetaTileEntity>... aMteClasses) { this.mMteClasses = Arrays.asList(aMteClasses); this.mAdder = aAdder; } GTPPHatchElement(IGT_HatchAdder<? super GregtechMeta_MultiBlockBase<?>> aAdder, String... aClassNames) { - this.mMteClasses = Arrays.stream(aClassNames) - .map(ReflectionUtils::getClass) - .filter(Objects::nonNull) - .<Class<? extends IMetaTileEntity>>map(GTPPHatchElement::retype) - .collect(Collectors.toList()); + this.mMteClasses = Arrays.stream(aClassNames).map(ReflectionUtils::getClass).filter(Objects::nonNull) + .<Class<? extends IMetaTileEntity>>map(GTPPHatchElement::retype).collect(Collectors.toList()); this.mAdder = aAdder; } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_SteamMultiBase.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_SteamMultiBase.java index 6aaa37f4ac..d1b4b5d951 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_SteamMultiBase.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_SteamMultiBase.java @@ -4,6 +4,17 @@ import static gregtech.api.enums.GT_Values.V; import static gregtech.api.util.GT_StructureUtility.buildHatchAdder; import static gtPlusPlus.core.util.data.ArrayUtils.removeNulls; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +import net.minecraft.inventory.IInventory; +import net.minecraft.item.ItemStack; +import net.minecraft.util.StatCollector; +import net.minecraftforge.fluids.FluidStack; + +import org.apache.commons.lang3.ArrayUtils; + import gregtech.api.enums.Textures; import gregtech.api.interfaces.IHatchElement; import gregtech.api.interfaces.ITexture; @@ -17,24 +28,13 @@ import gtPlusPlus.api.objects.data.*; import gtPlusPlus.core.util.minecraft.FluidUtils; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Steam_BusInput; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Steam_BusOutput; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import net.minecraft.inventory.IInventory; -import net.minecraft.item.ItemStack; -import net.minecraft.util.StatCollector; -import net.minecraftforge.fluids.FluidStack; -import org.apache.commons.lang3.ArrayUtils; public abstract class GregtechMeta_SteamMultiBase<T extends GregtechMeta_SteamMultiBase<T>> extends GregtechMeta_MultiBlockBase<T> { - public ArrayList<GT_MetaTileEntity_Hatch_Steam_BusInput> mSteamInputs = - new ArrayList<GT_MetaTileEntity_Hatch_Steam_BusInput>(); - public ArrayList<GT_MetaTileEntity_Hatch_Steam_BusOutput> mSteamOutputs = - new ArrayList<GT_MetaTileEntity_Hatch_Steam_BusOutput>(); - public ArrayList<GT_MetaTileEntity_Hatch_CustomFluidBase> mSteamInputFluids = - new ArrayList<GT_MetaTileEntity_Hatch_CustomFluidBase>(); + public ArrayList<GT_MetaTileEntity_Hatch_Steam_BusInput> mSteamInputs = new ArrayList<GT_MetaTileEntity_Hatch_Steam_BusInput>(); + public ArrayList<GT_MetaTileEntity_Hatch_Steam_BusOutput> mSteamOutputs = new ArrayList<GT_MetaTileEntity_Hatch_Steam_BusOutput>(); + public ArrayList<GT_MetaTileEntity_Hatch_CustomFluidBase> mSteamInputFluids = new ArrayList<GT_MetaTileEntity_Hatch_CustomFluidBase>(); protected static final String TT_steaminputbus = StatCollector.translateToLocal("GTPP.MBTT.SteamInputBus"); protected static final String TT_steamoutputbus = StatCollector.translateToLocal("GTPP.MBTT.SteamOutputBus"); @@ -49,20 +49,13 @@ public abstract class GregtechMeta_SteamMultiBase<T extends GregtechMeta_SteamMu } @Override - public ITexture[] getTexture( - final IGregTechTileEntity aBaseMetaTileEntity, - final byte aSide, - final byte aFacing, - final byte aColorIndex, - final boolean aActive, - final boolean aRedstone) { + public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing, + final byte aColorIndex, final boolean aActive, final boolean aRedstone) { if (aSide == aFacing) { - return new ITexture[] { - Textures.BlockIcons.getCasingTextureForId(getCasingTextureIndex()), - aActive ? getFrontOverlayActive() : getFrontOverlay() - }; + return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(getCasingTextureIndex()), + aActive ? getFrontOverlayActive() : getFrontOverlay() }; } - return new ITexture[] {Textures.BlockIcons.getCasingTextureForId(getCasingTextureIndex())}; + return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(getCasingTextureIndex()) }; } protected abstract GT_RenderedTexture getFrontOverlay(); @@ -110,8 +103,10 @@ public abstract class GregtechMeta_SteamMultiBase<T extends GregtechMeta_SteamMu // Remember last recipe - an optimization for findRecipe() this.mLastRecipe = tRecipe; - int aMaxParallelRecipes = - canBufferOutputs(tRecipe.mOutputs, tRecipe.mFluidOutputs, this.getMaxParallelRecipes()); + int aMaxParallelRecipes = canBufferOutputs( + tRecipe.mOutputs, + tRecipe.mFluidOutputs, + this.getMaxParallelRecipes()); if (aMaxParallelRecipes == 0) { log("BAD RETURN - 2"); return false; @@ -366,9 +361,8 @@ public abstract class GregtechMeta_SteamMultiBase<T extends GregtechMeta_SteamMu return 0; } - /* ======================================== - * Item Management - * ======================================== + /* + * ======================================== Item Management ======================================== */ if (aDoesOutputItems) { @@ -407,8 +401,7 @@ public abstract class GregtechMeta_SteamMultiBase<T extends GregtechMeta_SteamMu // A map to hold the items we will be 'inputting' into the output buses. These itemstacks are actually the // recipe outputs. - ConcurrentSet<FlexiblePair<ItemStack, Integer>> aInputMap = - new ConcurrentHashSet<FlexiblePair<ItemStack, Integer>>(); + ConcurrentSet<FlexiblePair<ItemStack, Integer>> aInputMap = new ConcurrentHashSet<FlexiblePair<ItemStack, Integer>>(); // Iterate over the outputs, calculating require stack spacing they will require. for (int i = 0; i < getOutputCount(aOutputs); i++) { @@ -442,11 +435,9 @@ public abstract class GregtechMeta_SteamMultiBase<T extends GregtechMeta_SteamMu if (aInputMap.size() > 0) { // Iterate over the current stored items in the Output busses, if any match and are not full, we can try // account for merging. - busItems: - for (FlexiblePair<ItemStack, Integer> y : aItemMap) { + busItems: for (FlexiblePair<ItemStack, Integer> y : aItemMap) { // Iterate over the 'inputs', we can safely remove these as we go. - outputItems: - for (FlexiblePair<ItemStack, Integer> u : aInputMap) { + outputItems: for (FlexiblePair<ItemStack, Integer> u : aInputMap) { // Create local vars for readability. ItemStack aOutputBusStack = y.getKey(); ItemStack aOutputStack = u.getKey(); @@ -471,8 +462,9 @@ public abstract class GregtechMeta_SteamMultiBase<T extends GregtechMeta_SteamMu // Update the stack size in the bus storage map. y.setValue(64); // Create a new object to iterate over later, with the remainder data; - FlexiblePair<ItemStack, Integer> t = - new FlexiblePair<ItemStack, Integer>(u.getKey(), aRemainder); + FlexiblePair<ItemStack, Integer> t = new FlexiblePair<ItemStack, Integer>( + u.getKey(), + aRemainder); // Remove the 'input' stack from the recipe outputs, so we don't try count it again. aInputMap.remove(u); // Add the remainder stack. @@ -490,8 +482,8 @@ public abstract class GregtechMeta_SteamMultiBase<T extends GregtechMeta_SteamMu // We have stacks that did not merge, do we have space for them? if (aInputMap.size() > 0) { if (aInputMap.size() > aInputBusSlotsFree) { - aParallelRecipes = - (int) Math.floor((double) aInputBusSlotsFree / aInputMap.size() * aParallelRecipes); + aParallelRecipes = (int) Math + .floor((double) aInputBusSlotsFree / aInputMap.size() * aParallelRecipes); // We do not have enough free slots in total to accommodate the remaining managed stacks. log(" Free: " + aInputBusSlotsFree + ", Required: " + aInputMap.size()); if (aParallelRecipes == 0) { @@ -507,9 +499,8 @@ public abstract class GregtechMeta_SteamMultiBase<T extends GregtechMeta_SteamMu } - /* ======================================== - * Fluid Management - * ======================================== + /* + * ======================================== Fluid Management ======================================== */ if (aDoesOutputFluids) { @@ -519,8 +510,7 @@ public abstract class GregtechMeta_SteamMultiBase<T extends GregtechMeta_SteamMu int aEmptyFluidHatches = 0; int aFullFluidHatches = 0; // Create Map for Fluid Output - ArrayList<Triplet<GT_MetaTileEntity_Hatch_Output, FluidStack, Integer>> aOutputHatches = - new ArrayList<Triplet<GT_MetaTileEntity_Hatch_Output, FluidStack, Integer>>(); + ArrayList<Triplet<GT_MetaTileEntity_Hatch_Output, FluidStack, Integer>> aOutputHatches = new ArrayList<Triplet<GT_MetaTileEntity_Hatch_Output, FluidStack, Integer>>(); for (final GT_MetaTileEntity_Hatch_Output tBus : this.mOutputHatches) { if (!isValidMetaTileEntity(tBus)) { continue; @@ -528,12 +518,18 @@ public abstract class GregtechMeta_SteamMultiBase<T extends GregtechMeta_SteamMu aFluidHatches++; // Map the Hatch with the space left for easy checking later. if (tBus.getFluid() == null) { - aOutputHatches.add(new Triplet<GT_MetaTileEntity_Hatch_Output, FluidStack, Integer>( - tBus, null, tBus.getCapacity())); + aOutputHatches.add( + new Triplet<GT_MetaTileEntity_Hatch_Output, FluidStack, Integer>( + tBus, + null, + tBus.getCapacity())); } else { int aSpaceLeft = tBus.getCapacity() - tBus.getFluidAmount(); - aOutputHatches.add(new Triplet<GT_MetaTileEntity_Hatch_Output, FluidStack, Integer>( - tBus, tBus.getFluid(), aSpaceLeft)); + aOutputHatches.add( + new Triplet<GT_MetaTileEntity_Hatch_Output, FluidStack, Integer>( + tBus, + tBus.getFluid(), + aSpaceLeft)); } } // Create a map of all the fluids we would like to output, we can iterate over this and see how many we can @@ -609,9 +605,10 @@ public abstract class GregtechMeta_SteamMultiBase<T extends GregtechMeta_SteamMu aOutputHatches.remove(aOutputHatches.get(i)); i--; // Re-add hatch to hatch list, with new data. - Triplet<GT_MetaTileEntity_Hatch_Output, FluidStack, Integer> aNewHatchData = - new Triplet<GT_MetaTileEntity_Hatch_Output, FluidStack, Integer>( - aHatch, aNewHatchStack, aNewHatchStack.amount); + Triplet<GT_MetaTileEntity_Hatch_Output, FluidStack, Integer> aNewHatchData = new Triplet<GT_MetaTileEntity_Hatch_Output, FluidStack, Integer>( + aHatch, + aNewHatchStack, + aNewHatchStack.amount); aOutputHatches.add(aNewHatchData); break; } @@ -629,9 +626,10 @@ public abstract class GregtechMeta_SteamMultiBase<T extends GregtechMeta_SteamMu aOutputHatches.remove(aOutputHatches.get(i)); i--; // Re-add hatch to hatch list, with new data. - Triplet<GT_MetaTileEntity_Hatch_Output, FluidStack, Integer> aNewHatchData = - new Triplet<GT_MetaTileEntity_Hatch_Output, FluidStack, Integer>( - aHatch, aNewHatchStack, aNewHatchStack.amount); + Triplet<GT_MetaTileEntity_Hatch_Output, FluidStack, Integer> aNewHatchData = new Triplet<GT_MetaTileEntity_Hatch_Output, FluidStack, Integer>( + aHatch, + aNewHatchStack, + aNewHatchStack.amount); aOutputHatches.add(aNewHatchData); // Check next fluid continue; @@ -646,8 +644,7 @@ public abstract class GregtechMeta_SteamMultiBase<T extends GregtechMeta_SteamMu for (Triplet<GT_MetaTileEntity_Hatch_Output, FluidStack, Integer> aFreeHatchCheck : aOutputHatches) { // Free Hatch - if (aFreeHatchCheck.getValue_2() == null - || aFreeHatchCheck.getValue_3() == 0 + if (aFreeHatchCheck.getValue_2() == null || aFreeHatchCheck.getValue_3() == 0 || aFreeHatchCheck.getValue_1().getFluid() == null) { aEmptyFluidHatches++; } @@ -658,10 +655,12 @@ public abstract class GregtechMeta_SteamMultiBase<T extends GregtechMeta_SteamMu if (aOutputFluids.size() > 0) { // Not enough space to add fluids. if (aOutputFluids.size() > aEmptyFluidHatches) { - aParallelRecipes = - (int) Math.floor((double) aEmptyFluidHatches / aOutputFluids.size() * aParallelRecipes); - log("Failed to find enough space for all fluid outputs. Free: " + aEmptyFluidHatches - + ", Required: " + aOutputFluids.size()); + aParallelRecipes = (int) Math + .floor((double) aEmptyFluidHatches / aOutputFluids.size() * aParallelRecipes); + log( + "Failed to find enough space for all fluid outputs. Free: " + aEmptyFluidHatches + + ", Required: " + + aOutputFluids.size()); return 0; } } @@ -703,8 +702,7 @@ public abstract class GregtechMeta_SteamMultiBase<T extends GregtechMeta_SteamMu if (aLiquid != null) return depleteInput(aLiquid); for (GT_MetaTileEntity_Hatch_CustomFluidBase tHatch : mSteamInputFluids) { if (isValidMetaTileEntity(tHatch)) { - if (GT_Utility.areStacksEqual( - aStack, tHatch.getBaseMetaTileEntity().getStackInSlot(0))) { + if (GT_Utility.areStacksEqual(aStack, tHatch.getBaseMetaTileEntity().getStackInSlot(0))) { if (tHatch.getBaseMetaTileEntity().getStackInSlot(0).stackSize >= aStack.stackSize) { tHatch.getBaseMetaTileEntity().decrStackSize(0, aStack.stackSize); return true; @@ -716,8 +714,7 @@ public abstract class GregtechMeta_SteamMultiBase<T extends GregtechMeta_SteamMu tHatch.mRecipeMap = getRecipeMap(); if (isValidMetaTileEntity(tHatch)) { for (int i = tHatch.getBaseMetaTileEntity().getSizeInventory() - 1; i >= 0; i--) { - if (GT_Utility.areStacksEqual( - aStack, tHatch.getBaseMetaTileEntity().getStackInSlot(i))) { + if (GT_Utility.areStacksEqual(aStack, tHatch.getBaseMetaTileEntity().getStackInSlot(i))) { if (tHatch.getBaseMetaTileEntity().getStackInSlot(0).stackSize >= aStack.stackSize) { tHatch.getBaseMetaTileEntity().decrStackSize(0, aStack.stackSize); return true; @@ -803,14 +800,14 @@ public abstract class GregtechMeta_SteamMultiBase<T extends GregtechMeta_SteamMu protected static <T extends GregtechMeta_SteamMultiBase<T>> GT_HatchElementBuilder<T> buildSteamInput( Class<T> typeToken) { - return buildHatchAdder(typeToken) - .adder(GregtechMeta_SteamMultiBase::addToMachineList) - .hatchIds(31040) + return buildHatchAdder(typeToken).adder(GregtechMeta_SteamMultiBase::addToMachineList).hatchIds(31040) .shouldReject(t -> !t.mSteamInputFluids.isEmpty()); } protected enum SteamHatchElement implements IHatchElement<GregtechMeta_SteamMultiBase<?>> { + InputBus_Steam { + @Override public List<? extends Class<? extends IMetaTileEntity>> mteClasses() { return Collections.singletonList(GT_MetaTileEntity_Hatch_Steam_BusInput.class); @@ -822,6 +819,7 @@ public abstract class GregtechMeta_SteamMultiBase<T extends GregtechMeta_SteamMu } }, OutputBus_Steam { + @Override public List<? extends Class<? extends IMetaTileEntity>> mteClasses() { return Collections.singletonList(GT_MetaTileEntity_Hatch_Steam_BusOutput.class); @@ -831,8 +829,7 @@ public abstract class GregtechMeta_SteamMultiBase<T extends GregtechMeta_SteamMu public long count(GregtechMeta_SteamMultiBase<?> t) { return t.mSteamOutputs.size(); } - }, - ; + },; @Override public IGT_HatchAdder<? super GregtechMeta_SteamMultiBase<?>> adder() { diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/generators/GregtechDoubleFuelGeneratorBase.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/generators/GregtechDoubleFuelGeneratorBase.java index 440e59a272..482c9e9910 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/generators/GregtechDoubleFuelGeneratorBase.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/generators/GregtechDoubleFuelGeneratorBase.java @@ -2,6 +2,13 @@ package gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.generat import static gregtech.api.enums.GT_Values.V; +import java.util.Collection; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidStack; + import gregtech.api.enums.Textures; import gregtech.api.gui.modularui.GT_UIInfos; import gregtech.api.interfaces.ITexture; @@ -11,28 +18,18 @@ import gregtech.api.util.GT_Recipe.GT_Recipe_Map; import gregtech.api.util.GT_Utility; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GT_MetaTileEntity_DeluxeTank; -import java.util.Collection; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; -import net.minecraftforge.fluids.FluidStack; public abstract class GregtechDoubleFuelGeneratorBase extends GT_MetaTileEntity_DeluxeTank { private boolean useFuel = false; - public GregtechDoubleFuelGeneratorBase( - final int aID, - final String aName, - final String aNameRegional, - final int aTier, - final String aDescription, - final ITexture... aTextures) { + public GregtechDoubleFuelGeneratorBase(final int aID, final String aName, final String aNameRegional, + final int aTier, final String aDescription, final ITexture... aTextures) { super(aID, aName, aNameRegional, aTier, 4, aDescription, aTextures); } - public GregtechDoubleFuelGeneratorBase( - final String aName, final int aTier, final String aDescription, final ITexture[][][] aTextures) { + public GregtechDoubleFuelGeneratorBase(final String aName, final int aTier, final String aDescription, + final ITexture[][][] aTextures) { super(aName, aTier, 4, aDescription, aTextures); } @@ -55,34 +52,22 @@ public abstract class GregtechDoubleFuelGeneratorBase extends GT_MetaTileEntity_ } @Override - public ITexture[] getTexture( - final IGregTechTileEntity aBaseMetaTileEntity, - final byte aSide, - final byte aFacing, - final byte aColorIndex, - final boolean aActive, - final boolean aRedstone) { - return this.mTextures[ - (aActive ? 5 : 0) - + (aSide == aFacing - ? 0 - : aSide == GT_Utility.getOppositeSide(aFacing) - ? 1 - : aSide == 0 ? 2 : aSide == 1 ? 3 : 4)][ - aColorIndex + 1]; + public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing, + final byte aColorIndex, final boolean aActive, final boolean aRedstone) { + return this.mTextures[(aActive ? 5 : 0) + (aSide == aFacing ? 0 + : aSide == GT_Utility.getOppositeSide(aFacing) ? 1 : aSide == 0 ? 2 : aSide == 1 ? 3 : 4)][aColorIndex + + 1]; } @Override public String[] getDescription() { - return new String[] {this.mDescription, "Fuel Efficiency: " + this.getEfficiency() + "%"}; + return new String[] { this.mDescription, "Fuel Efficiency: " + this.getEfficiency() + "%" }; } - /* @Override - public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) { - if (aBaseMetaTileEntity.isClientSide()) return true; - aBaseMetaTileEntity.openGUI(aPlayer); - return true; - }*/ + /* + * @Override public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) { if + * (aBaseMetaTileEntity.isClientSide()) return true; aBaseMetaTileEntity.openGUI(aPlayer); return true; } + */ @Override public boolean onRightclick(final IGregTechTileEntity aBaseMetaTileEntity, final EntityPlayer aPlayer) { @@ -97,23 +82,23 @@ public abstract class GregtechDoubleFuelGeneratorBase extends GT_MetaTileEntity_ } public ITexture[] getFront(final byte aColor) { - return new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1]}; + return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1] }; } public ITexture[] getBack(final byte aColor) { - return new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1]}; + return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1] }; } public ITexture[] getBottom(final byte aColor) { - return new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1]}; + return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1] }; } public ITexture[] getTop(final byte aColor) { - return new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1]}; + return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1] }; } public ITexture[] getSides(final byte aColor) { - return new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1]}; + return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1] }; } public ITexture[] getFrontActive(final byte aColor) { @@ -226,8 +211,10 @@ public abstract class GregtechDoubleFuelGeneratorBase extends GT_MetaTileEntity_ if (this.mInventory[this.getStackDisplaySlot()] == null) { this.mInventory[this.getStackDisplaySlot()] = new ItemStack(Blocks.fire, 1); } - this.mInventory[this.getStackDisplaySlot()].setStackDisplayName("Generating: " - + (aBaseMetaTileEntity.getUniversalEnergyStored() - this.getMinimumStoredEU()) + " EU"); + this.mInventory[this.getStackDisplaySlot()].setStackDisplayName( + "Generating: " + + (aBaseMetaTileEntity.getUniversalEnergyStored() - this.getMinimumStoredEU()) + + " EU"); } } else { if ((this.mFluid != null) && (this.mFluid2 != null)) { @@ -235,10 +222,11 @@ public abstract class GregtechDoubleFuelGeneratorBase extends GT_MetaTileEntity_ tConsumed = this.consumedFluidPerOperation(this.mFluid); final int tFuelValue2 = this.getFuelValue(this.mFluid2), tConsumed2 = this.consumedFluidPerOperation(this.mFluid2); - if (((tFuelValue > 0) - && (tConsumed > 0) - && (this.mFluid.amount - > tConsumed)) /* && (tFuelValue2 > 0 && tConsumed2 > 0 && mFluid2.amount > tConsumed2)*/) { + if (((tFuelValue > 0) && (tConsumed > 0) + && (this.mFluid.amount > tConsumed)) /* + * && (tFuelValue2 > 0 && tConsumed2 > 0 && + * mFluid2.amount > tConsumed2) + */) { Logger.WARNING("tFuelValue: " + tFuelValue); Logger.WARNING("tConsumed: " + tConsumed); @@ -250,29 +238,25 @@ public abstract class GregtechDoubleFuelGeneratorBase extends GT_MetaTileEntity_ Logger.WARNING("tFuelValue2: " + tFuelValue2); Logger.WARNING("tConsumed2: " + tConsumed2); - Logger.WARNING( - "mFluid2.name: " + this.mFluid2.getFluid().getName()); + Logger.WARNING("mFluid2.name: " + this.mFluid2.getFluid().getName()); Logger.WARNING("mFluid2.amount: " + this.mFluid2.amount); Logger.WARNING("mFluid2.amount > tConsumed2: " + (this.mFluid2.amount > tConsumed2)); long tFluidAmountToUse = Math.min( this.mFluid.amount / tConsumed, (((this.maxEUOutput() * 30) + this.getMinimumStoredEU()) - - aBaseMetaTileEntity.getUniversalEnergyStored()) - / tFuelValue); + - aBaseMetaTileEntity.getUniversalEnergyStored()) / tFuelValue); long tFluidAmountToUse2 = Math.min( this.mFluid2.amount / tConsumed2, (((this.maxEUOutput() * 30) + this.getMinimumStoredEU()) - - aBaseMetaTileEntity.getUniversalEnergyStored()) - / tFuelValue2); + - aBaseMetaTileEntity.getUniversalEnergyStored()) / tFuelValue2); if (tFluidAmountToUse <= 0) { - /*if ((mFluid.amount / tConsumed) == getCapacity()){ - tFluidAmountToUse = 1; - }*/ + /* + * if ((mFluid.amount / tConsumed) == getCapacity()){ tFluidAmountToUse = 1; } + */ - if (aBaseMetaTileEntity.getUniversalEnergyStored() - <= (aBaseMetaTileEntity.getEUCapacity() - - aBaseMetaTileEntity.getUniversalEnergyStored())) { + if (aBaseMetaTileEntity.getUniversalEnergyStored() <= (aBaseMetaTileEntity.getEUCapacity() + - aBaseMetaTileEntity.getUniversalEnergyStored())) { tFluidAmountToUse = 1; Logger.WARNING("========================================================="); Logger.WARNING("tFluidAmountToUse - Updated: " + tFluidAmountToUse); @@ -281,12 +265,11 @@ public abstract class GregtechDoubleFuelGeneratorBase extends GT_MetaTileEntity_ } if (tFluidAmountToUse2 <= 0) { - /*if ((mFluid2.amount / tConsumed) == getCapacity()){ - tFluidAmountToUse2 = 1; - }*/ - if (aBaseMetaTileEntity.getUniversalEnergyStored() - <= (aBaseMetaTileEntity.getEUCapacity() - - aBaseMetaTileEntity.getUniversalEnergyStored())) { + /* + * if ((mFluid2.amount / tConsumed) == getCapacity()){ tFluidAmountToUse2 = 1; } + */ + if (aBaseMetaTileEntity.getUniversalEnergyStored() <= (aBaseMetaTileEntity.getEUCapacity() + - aBaseMetaTileEntity.getUniversalEnergyStored())) { tFluidAmountToUse2 = 1; Logger.WARNING("========================================================="); Logger.WARNING("tFluidAmountToUse2 - Updated: " + tFluidAmountToUse2); @@ -298,42 +281,53 @@ public abstract class GregtechDoubleFuelGeneratorBase extends GT_MetaTileEntity_ Logger.WARNING("tFluidAmountToUse: " + tFluidAmountToUse); Logger.WARNING("========================================================="); - /*Utils.LOG_WARNING("mFluid.amount / tConsumed: "+("fluidAmount:"+mFluid.amount)+(" tConsumed:"+tConsumed)+" | "+(mFluid.amount / tConsumed)); - Utils.LOG_WARNING("maxEUOutput() * 20 + getMinimumStoredEU(): "+(maxEUOutput() * 30 + getMinimumStoredEU())); - Utils.LOG_WARNING("maxEUOutput(): "+maxEUOutput()); - Utils.LOG_WARNING("maxEUOutput() * 20: "+(maxEUOutput() * 30)); - Utils.LOG_WARNING("getMinimumStoredEU(): "+(getMinimumStoredEU())); - Utils.LOG_WARNING("aBaseMetaTileEntity.getUniversalEnergyStored(): "+(aBaseMetaTileEntity.getUniversalEnergyStored())); - Utils.LOG_WARNING("(maxEUOutput() * 20 + getMinimumStoredEU() - aBaseMetaTileEntity.getUniversalEnergyStored()): "+((maxEUOutput() * 30 + getMinimumStoredEU() - aBaseMetaTileEntity.getUniversalEnergyStored()))); - Utils.LOG_WARNING("tFuelValue: "+(tFuelValue)); - Utils.LOG_WARNING("(maxEUOutput() * 20 + getMinimumStoredEU() - aBaseMetaTileEntity.getUniversalEnergyStored()) / tFuelValue): "+((maxEUOutput() * 30 + getMinimumStoredEU() - aBaseMetaTileEntity.getUniversalEnergyStored()) / tFuelValue)); + /* + * Utils.LOG_WARNING("mFluid.amount / tConsumed: "+("fluidAmount:"+mFluid.amount)+(" tConsumed:" + * +tConsumed)+" | "+(mFluid.amount / tConsumed)); + * Utils.LOG_WARNING("maxEUOutput() * 20 + getMinimumStoredEU(): "+(maxEUOutput() * 30 + + * getMinimumStoredEU())); Utils.LOG_WARNING("maxEUOutput(): "+maxEUOutput()); + * Utils.LOG_WARNING("maxEUOutput() * 20: "+(maxEUOutput() * 30)); + * Utils.LOG_WARNING("getMinimumStoredEU(): "+(getMinimumStoredEU())); + * Utils.LOG_WARNING("aBaseMetaTileEntity.getUniversalEnergyStored(): "+(aBaseMetaTileEntity. + * getUniversalEnergyStored())); Utils. + * LOG_WARNING("(maxEUOutput() * 20 + getMinimumStoredEU() - aBaseMetaTileEntity.getUniversalEnergyStored()): " + * +((maxEUOutput() * 30 + getMinimumStoredEU() - + * aBaseMetaTileEntity.getUniversalEnergyStored()))); + * Utils.LOG_WARNING("tFuelValue: "+(tFuelValue)); Utils. + * LOG_WARNING("(maxEUOutput() * 20 + getMinimumStoredEU() - aBaseMetaTileEntity.getUniversalEnergyStored()) / tFuelValue): " + * +((maxEUOutput() * 30 + getMinimumStoredEU() - + * aBaseMetaTileEntity.getUniversalEnergyStored()) / tFuelValue)); */ Logger.WARNING("========================================================="); Logger.WARNING("tFluidAmountToUse2: " + tFluidAmountToUse2); Logger.WARNING("========================================================="); - /*Utils.LOG_WARNING("mFluid2.amount / tConsumed2: "+("fluidAmount2:"+mFluid2.amount)+(" tConsumed2:"+tConsumed2)+" | "+(mFluid2.amount / tConsumed2)); - Utils.LOG_WARNING("maxEUOutput() * 20 + getMinimumStoredEU(): "+(maxEUOutput() * 30 + getMinimumStoredEU())); - Utils.LOG_WARNING("maxEUOutput(): "+maxEUOutput()); - Utils.LOG_WARNING("maxEUOutput() * 20: "+(maxEUOutput() * 30)); - Utils.LOG_WARNING("getMinimumStoredEU(): "+(getMinimumStoredEU())); - Utils.LOG_WARNING("aBaseMetaTileEntity.getUniversalEnergyStored(): "+(aBaseMetaTileEntity.getUniversalEnergyStored())); - Utils.LOG_WARNING("(maxEUOutput() * 20 + getMinimumStoredEU() - aBaseMetaTileEntity.getUniversalEnergyStored()): "+((maxEUOutput() * 30 + getMinimumStoredEU() - aBaseMetaTileEntity.getUniversalEnergyStored()))); - Utils.LOG_WARNING("tFuelValue2: "+(tFuelValue2)); - Utils.LOG_WARNING("(maxEUOutput() * 20 + getMinimumStoredEU() - aBaseMetaTileEntity.getUniversalEnergyStored()) / tFuelValue2): "+((maxEUOutput() * 30 + getMinimumStoredEU() - aBaseMetaTileEntity.getUniversalEnergyStored()) / tFuelValue2)); + /* + * Utils.LOG_WARNING("mFluid2.amount / tConsumed2: "+("fluidAmount2:"+mFluid2.amount)+ + * (" tConsumed2:"+tConsumed2)+" | "+(mFluid2.amount / tConsumed2)); + * Utils.LOG_WARNING("maxEUOutput() * 20 + getMinimumStoredEU(): "+(maxEUOutput() * 30 + + * getMinimumStoredEU())); Utils.LOG_WARNING("maxEUOutput(): "+maxEUOutput()); + * Utils.LOG_WARNING("maxEUOutput() * 20: "+(maxEUOutput() * 30)); + * Utils.LOG_WARNING("getMinimumStoredEU(): "+(getMinimumStoredEU())); + * Utils.LOG_WARNING("aBaseMetaTileEntity.getUniversalEnergyStored(): "+(aBaseMetaTileEntity. + * getUniversalEnergyStored())); Utils. + * LOG_WARNING("(maxEUOutput() * 20 + getMinimumStoredEU() - aBaseMetaTileEntity.getUniversalEnergyStored()): " + * +((maxEUOutput() * 30 + getMinimumStoredEU() - + * aBaseMetaTileEntity.getUniversalEnergyStored()))); + * Utils.LOG_WARNING("tFuelValue2: "+(tFuelValue2)); Utils. + * LOG_WARNING("(maxEUOutput() * 20 + getMinimumStoredEU() - aBaseMetaTileEntity.getUniversalEnergyStored()) / tFuelValue2): " + * +((maxEUOutput() * 30 + getMinimumStoredEU() - + * aBaseMetaTileEntity.getUniversalEnergyStored()) / tFuelValue2)); */ if (((tFluidAmountToUse > 0) - && aBaseMetaTileEntity.increaseStoredEnergyUnits( - tFluidAmountToUse * tFuelValue, true)) - && ((tFluidAmountToUse2 > 0) - && aBaseMetaTileEntity.increaseStoredEnergyUnits( - tFluidAmountToUse2 * tFuelValue2, true))) { + && aBaseMetaTileEntity.increaseStoredEnergyUnits(tFluidAmountToUse * tFuelValue, true)) + && ((tFluidAmountToUse2 > 0) && aBaseMetaTileEntity + .increaseStoredEnergyUnits(tFluidAmountToUse2 * tFuelValue2, true))) { Logger.WARNING("tFuelValue: " + tFuelValue); Logger.WARNING("tConsumed: " + tConsumed); - Logger.WARNING( - "mFluid.name: " + this.mFluid.getFluid().getName()); + Logger.WARNING("mFluid.name: " + this.mFluid.getFluid().getName()); Logger.WARNING("mFluid.amount: " + this.mFluid.amount); Logger.WARNING("mFluid.amount > tConsumed: " + (this.mFluid.amount > tConsumed)); @@ -341,8 +335,7 @@ public abstract class GregtechDoubleFuelGeneratorBase extends GT_MetaTileEntity_ Logger.WARNING("tFuelValue2: " + tFuelValue2); Logger.WARNING("tConsumed2: " + tConsumed2); - Logger.WARNING( - "mFluid2.name: " + this.mFluid2.getFluid().getName()); + Logger.WARNING("mFluid2.name: " + this.mFluid2.getFluid().getName()); Logger.WARNING("mFluid2.amount: " + this.mFluid2.amount); Logger.WARNING("mFluid2.amount > tConsumed2: " + (this.mFluid2.amount > tConsumed2)); @@ -362,18 +355,17 @@ public abstract class GregtechDoubleFuelGeneratorBase extends GT_MetaTileEntity_ Logger.WARNING("tFluidAmountToUse2: " + tFluidAmountToUse2); } } else { - /*Utils.LOG_WARNING("(tFuelValue > 0 && tConsumed > 0 && mFluid.amount > tConsumed) && (tFuelValue2 > 0 && tConsumed2 > 0 && mFluid2.amount > tConsumed2)"); - Utils.LOG_WARNING("tFuelValue: "+tFuelValue); - Utils.LOG_WARNING("tConsumed: "+tConsumed); - Utils.LOG_WARNING("mFluid.amount: "+mFluid.amount); - Utils.LOG_WARNING("mFluid.amount > tConsumed: "+(mFluid.amount > tConsumed)); - - Utils.LOG_WARNING("========================================================="); - - Utils.LOG_WARNING("tFuelValue2: "+tFuelValue2); - Utils.LOG_WARNING("tConsumed2: "+tConsumed2); - Utils.LOG_WARNING("mFluid2.amount: "+mFluid2.amount); - Utils.LOG_WARNING("mFluid2.amount > tConsumed2: "+(mFluid2.amount > tConsumed2)); */ + /* + * Utils. + * LOG_WARNING("(tFuelValue > 0 && tConsumed > 0 && mFluid.amount > tConsumed) && (tFuelValue2 > 0 && tConsumed2 > 0 && mFluid2.amount > tConsumed2)" + * ); Utils.LOG_WARNING("tFuelValue: "+tFuelValue); Utils.LOG_WARNING("tConsumed: "+tConsumed); + * Utils.LOG_WARNING("mFluid.amount: "+mFluid.amount); + * Utils.LOG_WARNING("mFluid.amount > tConsumed: "+(mFluid.amount > tConsumed)); + * Utils.LOG_WARNING("========================================================="); + * Utils.LOG_WARNING("tFuelValue2: "+tFuelValue2); Utils.LOG_WARNING("tConsumed2: "+tConsumed2); + * Utils.LOG_WARNING("mFluid2.amount: "+mFluid2.amount); + * Utils.LOG_WARNING("mFluid2.amount > tConsumed2: "+(mFluid2.amount > tConsumed2)); + */ } } else { Logger.WARNING("One mFluid is null"); @@ -401,8 +393,8 @@ public abstract class GregtechDoubleFuelGeneratorBase extends GT_MetaTileEntity_ } if (aBaseMetaTileEntity.isServerSide()) { - aBaseMetaTileEntity.setActive(aBaseMetaTileEntity.isAllowedToWork() - && (aBaseMetaTileEntity.getUniversalEnergyStored() + aBaseMetaTileEntity.setActive( + aBaseMetaTileEntity.isAllowedToWork() && (aBaseMetaTileEntity.getUniversalEnergyStored() >= (this.maxEUOutput() + this.getMinimumStoredEU()))); } } @@ -425,10 +417,8 @@ public abstract class GregtechDoubleFuelGeneratorBase extends GT_MetaTileEntity_ for (final GT_Recipe tFuel : tRecipeList) { if ((tLiquid = GT_Utility.getFluidForFilledItem(tFuel.getRepresentativeInput(0), true)) != null) { if (aLiquid.isFluidEqual(tLiquid)) { - return (int) (((long) tFuel.mSpecialValue - * this.getEfficiency() - * this.consumedFluidPerOperation(tLiquid)) - / 100); + return (int) (((long) tFuel.mSpecialValue * this.getEfficiency() + * this.consumedFluidPerOperation(tLiquid)) / 100); } } } @@ -440,8 +430,8 @@ public abstract class GregtechDoubleFuelGeneratorBase extends GT_MetaTileEntity_ if (GT_Utility.isStackInvalid(aStack) || (this.getRecipes() == null)) { return 0; } - final GT_Recipe tFuel = - this.getRecipes().findRecipe(this.getBaseMetaTileEntity(), false, Long.MAX_VALUE, null, aStack); + final GT_Recipe tFuel = this.getRecipes() + .findRecipe(this.getBaseMetaTileEntity(), false, Long.MAX_VALUE, null, aStack); if (tFuel != null) { return (int) ((tFuel.mSpecialValue * 1000L * this.getEfficiency()) / 100); } @@ -452,8 +442,8 @@ public abstract class GregtechDoubleFuelGeneratorBase extends GT_MetaTileEntity_ if (GT_Utility.isStackInvalid(aStack) || (this.getRecipes() == null)) { return null; } - final GT_Recipe tFuel = - this.getRecipes().findRecipe(this.getBaseMetaTileEntity(), false, Long.MAX_VALUE, null, aStack); + final GT_Recipe tFuel = this.getRecipes() + .findRecipe(this.getBaseMetaTileEntity(), false, Long.MAX_VALUE, null, aStack); if (tFuel != null) { return GT_Utility.copy(tFuel.getOutput(0)); } @@ -461,11 +451,10 @@ public abstract class GregtechDoubleFuelGeneratorBase extends GT_MetaTileEntity_ } @Override - public boolean allowPutStack( - final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, final ItemStack aStack) { - return super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack) - && ((this.getFuelValue(aStack) > 0) - || (this.getFuelValue(GT_Utility.getFluidForFilledItem(aStack, true)) > 0)); + public boolean allowPutStack(final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, + final ItemStack aStack) { + return super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack) && ((this.getFuelValue(aStack) > 0) + || (this.getFuelValue(GT_Utility.getFluidForFilledItem(aStack, true)) > 0)); } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/generators/GregtechMetaBoilerBase.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/generators/GregtechMetaBoilerBase.java index 5d5c28e375..ddda79e51e 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/generators/GregtechMetaBoilerBase.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/generators/GregtechMetaBoilerBase.java @@ -1,5 +1,14 @@ package gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.generators; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.fluids.FluidTankInfo; +import net.minecraftforge.fluids.IFluidHandler; + import gregtech.api.GregTech_API; import gregtech.api.enums.Materials; import gregtech.api.enums.OrePrefixes; @@ -12,16 +21,9 @@ import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Utility; import gtPlusPlus.core.util.math.MathUtils; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraftforge.common.util.ForgeDirection; -import net.minecraftforge.fluids.FluidStack; -import net.minecraftforge.fluids.FluidTankInfo; -import net.minecraftforge.fluids.IFluidHandler; public abstract class GregtechMetaBoilerBase extends GT_MetaTileEntity_BasicTank { + public int mTemperature = 20; public int mProcessingEnergy = 0; public int mLossTimer = 0; @@ -29,33 +31,24 @@ public abstract class GregtechMetaBoilerBase extends GT_MetaTileEntity_BasicTank public boolean mHadNoWater = false; public long RI = MathUtils.randLong(5L, 30L); - public GregtechMetaBoilerBase( - final int aID, - final String aName, - final String aNameRegional, - final String aDescription, - final ITexture... aTextures) { + public GregtechMetaBoilerBase(final int aID, final String aName, final String aNameRegional, + final String aDescription, final ITexture... aTextures) { super(aID, aName, aNameRegional, 0, 4, aDescription, aTextures); } - public GregtechMetaBoilerBase( - final String aName, final int aTier, final String aDescription, final ITexture[][][] aTextures) { + public GregtechMetaBoilerBase(final String aName, final int aTier, final String aDescription, + final ITexture[][][] aTextures) { super(aName, aTier, 4, aDescription, aTextures); } @Override - public ITexture[] getTexture( - final IGregTechTileEntity aBaseMetaTileEntity, - final byte aSide, - final byte aFacing, - final byte aColorIndex, - final boolean aActive, - final boolean aRedstone) { - ITexture[] tmp = - this.mTextures[aSide >= 2 ? aSide != aFacing ? 2 : ((byte) (aActive ? 4 : 3)) : aSide][aColorIndex + 1]; + public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing, + final byte aColorIndex, final boolean aActive, final boolean aRedstone) { + ITexture[] tmp = this.mTextures[aSide >= 2 ? aSide != aFacing ? 2 : ((byte) (aActive ? 4 : 3)) + : aSide][aColorIndex + 1]; // mTextures[(aSide==aFacing?(aActive?4:3):aSide==GT_Utility.getOppositeSide(aFacing)?2:aSide==0?0:aSide==1?1:2)][aColorIndex+1]; if ((aSide != aFacing) && (tmp.length == 2)) { - tmp = new ITexture[] {tmp[0]}; + tmp = new ITexture[] { tmp[0] }; } return tmp; } @@ -186,8 +179,7 @@ public abstract class GregtechMetaBoilerBase extends GT_MetaTileEntity_BasicTank if (this.mSteam != null) { try { aNBT.setTag("mSteam", this.mSteam.writeToNBT(new NBTTagCompound())); - } catch (final Throwable e) { - } + } catch (final Throwable e) {} } } @@ -215,16 +207,16 @@ public abstract class GregtechMetaBoilerBase extends GT_MetaTileEntity_BasicTank if (i != aBaseMetaTileEntity.getFrontFacing()) { final IFluidHandler tTileEntity = aBaseMetaTileEntity.getITankContainerAtSide(i); if (tTileEntity != null) { - final FluidStack tDrained = aBaseMetaTileEntity.drain( - ForgeDirection.getOrientation(i), Math.max(1, this.mSteam.amount / 2), false); + final FluidStack tDrained = aBaseMetaTileEntity + .drain(ForgeDirection.getOrientation(i), Math.max(1, this.mSteam.amount / 2), false); if (tDrained != null) { - final int tFilledAmount = tTileEntity.fill( - ForgeDirection.getOrientation(i).getOpposite(), tDrained, false); + final int tFilledAmount = tTileEntity + .fill(ForgeDirection.getOrientation(i).getOpposite(), tDrained, false); if (tFilledAmount > 0) { tTileEntity.fill( ForgeDirection.getOrientation(i).getOpposite(), - aBaseMetaTileEntity.drain( - ForgeDirection.getOrientation(i), tFilledAmount, true), + aBaseMetaTileEntity + .drain(ForgeDirection.getOrientation(i), tFilledAmount, true), true); } } @@ -257,53 +249,60 @@ public abstract class GregtechMetaBoilerBase extends GT_MetaTileEntity_BasicTank this.sendSound((byte) 1); this.mSteam.amount = getSteamCapacity() * 3 / 4; } - if ((this.mProcessingEnergy <= 0) - && (aBaseMetaTileEntity.isAllowedToWork()) + if ((this.mProcessingEnergy <= 0) && (aBaseMetaTileEntity.isAllowedToWork()) && (this.mInventory[2] != null)) { - if ((GT_OreDictUnificator.isItemStackInstanceOf( - this.mInventory[2], OrePrefixes.gem.get(Materials.Coal))) - || (GT_OreDictUnificator.isItemStackInstanceOf( - this.mInventory[2], OrePrefixes.dust.get(Materials.Coal))) - || (GT_OreDictUnificator.isItemStackInstanceOf( - this.mInventory[2], OrePrefixes.dustImpure.get(Materials.Coal))) - || (GT_OreDictUnificator.isItemStackInstanceOf( - this.mInventory[2], OrePrefixes.crushed.get(Materials.Coal)))) { - this.mProcessingEnergy += 160; - aBaseMetaTileEntity.decrStackSize(2, 1); - if (aBaseMetaTileEntity.getRandomNumber(3) == 0) { - aBaseMetaTileEntity.addStackToSlot( - 3, GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.DarkAsh, 1L)); - } - } else if (GT_OreDictUnificator.isItemStackInstanceOf( - this.mInventory[2], OrePrefixes.gem.get(Materials.Charcoal))) { + if ((GT_OreDictUnificator + .isItemStackInstanceOf(this.mInventory[2], OrePrefixes.gem.get(Materials.Coal))) + || (GT_OreDictUnificator + .isItemStackInstanceOf(this.mInventory[2], OrePrefixes.dust.get(Materials.Coal))) + || (GT_OreDictUnificator + .isItemStackInstanceOf(this.mInventory[2], OrePrefixes.dustImpure.get(Materials.Coal))) + || (GT_OreDictUnificator + .isItemStackInstanceOf(this.mInventory[2], OrePrefixes.crushed.get(Materials.Coal)))) { this.mProcessingEnergy += 160; aBaseMetaTileEntity.decrStackSize(2, 1); if (aBaseMetaTileEntity.getRandomNumber(3) == 0) { aBaseMetaTileEntity.addStackToSlot( - 3, GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.Ash, 1L)); - } - } else if (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], "fuelCoke")) { - this.mProcessingEnergy += 640; - aBaseMetaTileEntity.decrStackSize(2, 1); - if (aBaseMetaTileEntity.getRandomNumber(2) == 0) { - aBaseMetaTileEntity.addStackToSlot( - 3, GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.Ash, 1L)); - } - } else if ((GT_OreDictUnificator.isItemStackInstanceOf( - this.mInventory[2], OrePrefixes.gem.get(Materials.Lignite))) - || (GT_OreDictUnificator.isItemStackInstanceOf( - this.mInventory[2], OrePrefixes.dust.get(Materials.Lignite))) - || (GT_OreDictUnificator.isItemStackInstanceOf( - this.mInventory[2], OrePrefixes.dustImpure.get(Materials.Lignite))) - || (GT_OreDictUnificator.isItemStackInstanceOf( - this.mInventory[2], OrePrefixes.crushed.get(Materials.Lignite)))) { - this.mProcessingEnergy += 40; - aBaseMetaTileEntity.decrStackSize(2, 1); - if (aBaseMetaTileEntity.getRandomNumber(8) == 0) { - aBaseMetaTileEntity.addStackToSlot( - 3, GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.DarkAsh, 1L)); + 3, + GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.DarkAsh, 1L)); } - } + } else if (GT_OreDictUnificator + .isItemStackInstanceOf(this.mInventory[2], OrePrefixes.gem.get(Materials.Charcoal))) { + this.mProcessingEnergy += 160; + aBaseMetaTileEntity.decrStackSize(2, 1); + if (aBaseMetaTileEntity.getRandomNumber(3) == 0) { + aBaseMetaTileEntity.addStackToSlot( + 3, + GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.Ash, 1L)); + } + } else + if (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], "fuelCoke")) { + this.mProcessingEnergy += 640; + aBaseMetaTileEntity.decrStackSize(2, 1); + if (aBaseMetaTileEntity.getRandomNumber(2) == 0) { + aBaseMetaTileEntity.addStackToSlot( + 3, + GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.Ash, 1L)); + } + } else if ((GT_OreDictUnificator + .isItemStackInstanceOf(this.mInventory[2], OrePrefixes.gem.get(Materials.Lignite))) + || (GT_OreDictUnificator + .isItemStackInstanceOf(this.mInventory[2], OrePrefixes.dust.get(Materials.Lignite))) + || (GT_OreDictUnificator.isItemStackInstanceOf( + this.mInventory[2], + OrePrefixes.dustImpure.get(Materials.Lignite))) + || (GT_OreDictUnificator.isItemStackInstanceOf( + this.mInventory[2], + OrePrefixes.crushed.get(Materials.Lignite)))) { + this.mProcessingEnergy += 40; + aBaseMetaTileEntity.decrStackSize(2, 1); + if (aBaseMetaTileEntity.getRandomNumber(8) == 0) { + aBaseMetaTileEntity.addStackToSlot( + 3, + GT_OreDictUnificator + .get(OrePrefixes.dustTiny, Materials.DarkAsh, 1L)); + } + } } if ((this.mTemperature < 1000) && (this.mProcessingEnergy > 0) && ((aTick % 12L) == 0L)) { this.mProcessingEnergy -= 2; @@ -317,20 +316,19 @@ public abstract class GregtechMetaBoilerBase extends GT_MetaTileEntity_BasicTank // Since this type of machine can have different water and steam capacities, we need to override getTankInfo() to // support returning those different capacities. public FluidTankInfo[] getTankInfo(ForgeDirection aSide) { - return new FluidTankInfo[] { - new FluidTankInfo(this.mFluid, getCapacity()), new FluidTankInfo(this.mSteam, getSteamCapacity()) - }; + return new FluidTankInfo[] { new FluidTankInfo(this.mFluid, getCapacity()), + new FluidTankInfo(this.mSteam, getSteamCapacity()) }; } @Override - public boolean allowPullStack( - final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, final ItemStack aStack) { + public boolean allowPullStack(final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, + final ItemStack aStack) { return (aIndex == 1) || (aIndex == 3); } @Override - public boolean allowPutStack( - final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, final ItemStack aStack) { + public boolean allowPutStack(final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, + final ItemStack aStack) { return aIndex == 2; } @@ -339,16 +337,14 @@ public abstract class GregtechMetaBoilerBase extends GT_MetaTileEntity_BasicTank if (aIndex == 1) { GT_Utility.doSoundAtClient(GregTech_API.sSoundList.get(Integer.valueOf(4)), 2, 1.0F, aX, aY, aZ); for (int l = 0; l < 8; l++) { - this.getBaseMetaTileEntity() - .getWorld() - .spawnParticle( - "largesmoke", - (aX - 0.5D) + Math.random(), - aY, - (aZ - 0.5D) + Math.random(), - 0.0D, - 0.0D, - 0.0D); + this.getBaseMetaTileEntity().getWorld().spawnParticle( + "largesmoke", + (aX - 0.5D) + Math.random(), + aY, + (aZ - 0.5D) + Math.random(), + 0.0D, + 0.0D, + 0.0D); } } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/generators/GregtechMetaSolarGenerator.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/generators/GregtechMetaSolarGenerator.java index e4a6d4bd44..f76bb372ce 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/generators/GregtechMetaSolarGenerator.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/generators/GregtechMetaSolarGenerator.java @@ -2,13 +2,14 @@ package gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.generat import static gregtech.api.enums.GT_Values.V; +import net.minecraft.entity.player.EntityPlayer; + import gregtech.api.enums.Textures; import gregtech.api.gui.modularui.GT_UIInfos; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicTank; import gregtech.api.util.GT_Utility; -import net.minecraft.entity.player.EntityPlayer; public abstract class GregtechMetaSolarGenerator extends GT_MetaTileEntity_BasicTank { @@ -18,18 +19,13 @@ public abstract class GregtechMetaSolarGenerator extends GT_MetaTileEntity_Basic public int mLossTimer = 0; public static int sEnergyPerTick = 16; - public GregtechMetaSolarGenerator( - final int aID, - final String aName, - final String aNameRegional, - final int aTier, - final String aDescription, - final ITexture... aTextures) { + public GregtechMetaSolarGenerator(final int aID, final String aName, final String aNameRegional, final int aTier, + final String aDescription, final ITexture... aTextures) { super(aID, aName, aNameRegional, aTier, 3, aDescription, aTextures); } - public GregtechMetaSolarGenerator( - final String aName, final int aTier, final String aDescription, final ITexture[][][] aTextures) { + public GregtechMetaSolarGenerator(final String aName, final int aTier, final String aDescription, + final ITexture[][][] aTextures) { super(aName, aTier, 3, aDescription, aTextures); } @@ -52,26 +48,16 @@ public abstract class GregtechMetaSolarGenerator extends GT_MetaTileEntity_Basic } @Override - public ITexture[] getTexture( - final IGregTechTileEntity aBaseMetaTileEntity, - final byte aSide, - final byte aFacing, - final byte aColorIndex, - final boolean aActive, - final boolean aRedstone) { - return this.mTextures[ - (aActive ? 5 : 0) - + (aSide == aFacing - ? 0 - : aSide == GT_Utility.getOppositeSide(aFacing) - ? 1 - : aSide == 0 ? 2 : aSide == 1 ? 3 : 4)][ - aColorIndex + 1]; + public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing, + final byte aColorIndex, final boolean aActive, final boolean aRedstone) { + return this.mTextures[(aActive ? 5 : 0) + (aSide == aFacing ? 0 + : aSide == GT_Utility.getOppositeSide(aFacing) ? 1 : aSide == 0 ? 2 : aSide == 1 ? 3 : 4)][aColorIndex + + 1]; } @Override public String[] getDescription() { - return new String[] {this.mDescription, "Efficiency: " + this.getEfficiency() + "%"}; + return new String[] { this.mDescription, "Efficiency: " + this.getEfficiency() + "%" }; } @Override @@ -84,23 +70,23 @@ public abstract class GregtechMetaSolarGenerator extends GT_MetaTileEntity_Basic } public ITexture[] getFront(final byte aColor) { - return new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1]}; + return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1] }; } public ITexture[] getBack(final byte aColor) { - return new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1]}; + return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1] }; } public ITexture[] getBottom(final byte aColor) { - return new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1]}; + return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1] }; } public ITexture[] getTop(final byte aColor) { - return new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1]}; + return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1] }; } public ITexture[] getSides(final byte aColor) { - return new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1]}; + return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1] }; } public ITexture[] getFrontActive(final byte aColor) { @@ -165,8 +151,7 @@ public abstract class GregtechMetaSolarGenerator extends GT_MetaTileEntity_Basic @Override public void onPostTick(final IGregTechTileEntity aBaseMetaTileEntity, final long aTick) { - if (aBaseMetaTileEntity.isServerSide() - && aBaseMetaTileEntity.isAllowedToWork() + if (aBaseMetaTileEntity.isServerSide() && aBaseMetaTileEntity.isAllowedToWork() && (aTick > 20L) && (aBaseMetaTileEntity.getUniversalEnergyStored() < (this.maxEUOutput() + aBaseMetaTileEntity.getEUCapacity()))) { @@ -182,8 +167,7 @@ public abstract class GregtechMetaSolarGenerator extends GT_MetaTileEntity_Basic if ((aTick % 25L) == 0L) { if (this.mSolarCharge > 100) { - if ((this.mProcessingEnergy > 0) - && (aBaseMetaTileEntity.isAllowedToWork()) + if ((this.mProcessingEnergy > 0) && (aBaseMetaTileEntity.isAllowedToWork()) && ((aTick % 256L) == 0L) && (!aBaseMetaTileEntity.getWorld().isThundering() && (aBaseMetaTileEntity.getUniversalEnergyStored() @@ -199,21 +183,19 @@ public abstract class GregtechMetaSolarGenerator extends GT_MetaTileEntity_Basic this.mSolarCharge += 1; } - if ((this.mProcessingEnergy <= 0) - && (aBaseMetaTileEntity.isAllowedToWork()) + if ((this.mProcessingEnergy <= 0) && (aBaseMetaTileEntity.isAllowedToWork()) && ((aTick % 256L) == 0L) && (!aBaseMetaTileEntity.getWorld().isThundering())) { - final boolean bRain = - aBaseMetaTileEntity.getWorld().isRaining() && (aBaseMetaTileEntity.getBiome().rainfall > 0.0F); + final boolean bRain = aBaseMetaTileEntity.getWorld().isRaining() + && (aBaseMetaTileEntity.getBiome().rainfall > 0.0F); this.mProcessingEnergy += (bRain && (aBaseMetaTileEntity.getWorld().skylightSubtracted >= 4)) - || !aBaseMetaTileEntity.getSkyAtSide((byte) 1) - ? 0 - : !bRain && aBaseMetaTileEntity.getWorld().isDaytime() ? 8 : 1; + || !aBaseMetaTileEntity.getSkyAtSide((byte) 1) ? 0 + : !bRain && aBaseMetaTileEntity.getWorld().isDaytime() ? 8 : 1; } if (aBaseMetaTileEntity.isServerSide()) { - aBaseMetaTileEntity.setActive(aBaseMetaTileEntity.isAllowedToWork() - && (aBaseMetaTileEntity.getUniversalEnergyStored() + aBaseMetaTileEntity.setActive( + aBaseMetaTileEntity.isAllowedToWork() && (aBaseMetaTileEntity.getUniversalEnergyStored() >= (this.maxEUOutput() + this.getMinimumStoredEU()))); } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/generators/GregtechRocketFuelGeneratorBase.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/generators/GregtechRocketFuelGeneratorBase.java index db9527c144..bd88b5cb82 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/generators/GregtechRocketFuelGeneratorBase.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/generators/GregtechRocketFuelGeneratorBase.java @@ -2,6 +2,13 @@ package gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.generat import static gregtech.api.enums.GT_Values.V; +import java.util.Collection; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidStack; + import gregtech.api.enums.Textures; import gregtech.api.gui.modularui.GT_UIInfos; import gregtech.api.interfaces.ITexture; @@ -13,24 +20,14 @@ import gregtech.api.util.GT_Utility; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.util.math.MathUtils; import gtPlusPlus.core.util.minecraft.gregtech.PollutionUtils; -import java.util.Collection; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; -import net.minecraftforge.fluids.FluidStack; public abstract class GregtechRocketFuelGeneratorBase extends GT_MetaTileEntity_BasicTank { private boolean useFuel = false; protected int pollMin, pollMax; - public GregtechRocketFuelGeneratorBase( - final int aID, - final String aName, - final String aNameRegional, - final int aTier, - final String aDescription, - final ITexture... aTextures) { + public GregtechRocketFuelGeneratorBase(final int aID, final String aName, final String aNameRegional, + final int aTier, final String aDescription, final ITexture... aTextures) { super(aID, aName, aNameRegional, aTier, 3, aDescription, aTextures); pollMin = (int) (CORE.ConfigSwitches.baseMinPollutionPerSecondRocketFuelGenerator * CORE.ConfigSwitches.pollutionReleasedByTierRocketFuelGenerator[mTier]); @@ -38,8 +35,8 @@ public abstract class GregtechRocketFuelGeneratorBase extends GT_MetaTileEntity_ * CORE.ConfigSwitches.pollutionReleasedByTierRocketFuelGenerator[mTier]); } - public GregtechRocketFuelGeneratorBase( - final String aName, final int aTier, final String aDescription, final ITexture[][][] aTextures) { + public GregtechRocketFuelGeneratorBase(final String aName, final int aTier, final String aDescription, + final ITexture[][][] aTextures) { super(aName, aTier, 3, aDescription, aTextures); pollMin = (int) (CORE.ConfigSwitches.baseMinPollutionPerSecondRocketFuelGenerator * CORE.ConfigSwitches.pollutionReleasedByTierRocketFuelGenerator[mTier]); @@ -66,29 +63,18 @@ public abstract class GregtechRocketFuelGeneratorBase extends GT_MetaTileEntity_ } @Override - public ITexture[] getTexture( - final IGregTechTileEntity aBaseMetaTileEntity, - final byte aSide, - final byte aFacing, - final byte aColorIndex, - final boolean aActive, - final boolean aRedstone) { - return this.mTextures[ - (aActive ? 5 : 0) - + (aSide == aFacing - ? 0 - : aSide == GT_Utility.getOppositeSide(aFacing) - ? 1 - : aSide == 0 ? 2 : aSide == 1 ? 3 : 4)][ - aColorIndex + 1]; + public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing, + final byte aColorIndex, final boolean aActive, final boolean aRedstone) { + return this.mTextures[(aActive ? 5 : 0) + (aSide == aFacing ? 0 + : aSide == GT_Utility.getOppositeSide(aFacing) ? 1 : aSide == 0 ? 2 : aSide == 1 ? 3 : 4)][aColorIndex + + 1]; } @Override public String[] getDescription() { String aPollution = "Causes between " + pollMin + " and " + pollMax + " Pollution per second"; - return new String[] { - this.mDescription, "Fuel Efficiency: " + this.getEfficiency() + "%", aPollution, CORE.GT_Tooltip - }; + return new String[] { this.mDescription, "Fuel Efficiency: " + this.getEfficiency() + "%", aPollution, + CORE.GT_Tooltip }; } @Override @@ -98,23 +84,23 @@ public abstract class GregtechRocketFuelGeneratorBase extends GT_MetaTileEntity_ } public ITexture[] getFront(final byte aColor) { - return new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1]}; + return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1] }; } public ITexture[] getBack(final byte aColor) { - return new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1]}; + return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1] }; } public ITexture[] getBottom(final byte aColor) { - return new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1]}; + return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1] }; } public ITexture[] getTop(final byte aColor) { - return new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1]}; + return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1] }; } public ITexture[] getSides(final byte aColor) { - return new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1]}; + return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1] }; } public ITexture[] getFrontActive(final byte aColor) { @@ -217,53 +203,33 @@ public abstract class GregtechRocketFuelGeneratorBase extends GT_MetaTileEntity_ // super.onPostTick(aBaseMetaTileEntity, aTick); - /*if (aBaseMetaTileEntity.isServerSide() && aBaseMetaTileEntity.isAllowedToWork() && aTick % 10L == 0L) { - int tFuelValue; - if (this.mFluid == null) { - if (aBaseMetaTileEntity.getUniversalEnergyStored() < this.maxEUOutput() + this.getMinimumStoredEU()) { - this.mInventory[this.getStackDisplaySlot()] = null; - } else { - if (this.mInventory[this.getStackDisplaySlot()] == null) { - this.mInventory[this.getStackDisplaySlot()] = new ItemStack(Blocks.fire, 1); - } - - this.mInventory[this.getStackDisplaySlot()].setStackDisplayName("Generating: " - + (aBaseMetaTileEntity.getUniversalEnergyStored() - this.getMinimumStoredEU()) + " EU"); - } - } else { - tFuelValue = this.getFuelValue(this.mFluid); - int tConsumed = this.consumedFluidPerOperation(this.mFluid); - if (tFuelValue > 0 && tConsumed > 0 && this.mFluid.amount > tConsumed) { - long tFluidAmountToUse = Math.min((long) (this.mFluid.amount / tConsumed), - (this.maxEUStore() - aBaseMetaTileEntity.getUniversalEnergyStored()) / (long) tFuelValue); - if (tFluidAmountToUse > 0L && aBaseMetaTileEntity - .increaseStoredEnergyUnits(tFluidAmountToUse * (long) tFuelValue, true)) { - PollutionUtils.addPollution(this.getBaseMetaTileEntity(), 10 * this.getPollution()); - this.mFluid.amount = (int) ((long) this.mFluid.amount - tFluidAmountToUse * (long) tConsumed); - } - } - } - - if (this.mInventory[this.getInputSlot()] != null - && aBaseMetaTileEntity.getUniversalEnergyStored() < this.maxEUOutput() * 20L - + this.getMinimumStoredEU() - && GT_Utility.getFluidForFilledItem(this.mInventory[this.getInputSlot()], true) == null) { - tFuelValue = this.getFuelValue(this.mInventory[this.getInputSlot()]); - if (tFuelValue > 0) { - ItemStack tEmptyContainer = this.getEmptyContainer(this.mInventory[this.getInputSlot()]); - if (aBaseMetaTileEntity.addStackToSlot(this.getOutputSlot(), tEmptyContainer)) { - aBaseMetaTileEntity.increaseStoredEnergyUnits((long) tFuelValue, true); - aBaseMetaTileEntity.decrStackSize(this.getInputSlot(), 1); - PollutionUtils.addPollution(this.getBaseMetaTileEntity(), 10 * this.getPollution()); - } - } - } - } - - if (aBaseMetaTileEntity.isServerSide()) { - aBaseMetaTileEntity.setActive(aBaseMetaTileEntity.isAllowedToWork() && aBaseMetaTileEntity - .getUniversalEnergyStored() >= this.maxEUOutput() + this.getMinimumStoredEU()); - }*/ + /* + * if (aBaseMetaTileEntity.isServerSide() && aBaseMetaTileEntity.isAllowedToWork() && aTick % 10L == 0L) { int + * tFuelValue; if (this.mFluid == null) { if (aBaseMetaTileEntity.getUniversalEnergyStored() < + * this.maxEUOutput() + this.getMinimumStoredEU()) { this.mInventory[this.getStackDisplaySlot()] = null; } else + * { if (this.mInventory[this.getStackDisplaySlot()] == null) { this.mInventory[this.getStackDisplaySlot()] = + * new ItemStack(Blocks.fire, 1); } + * this.mInventory[this.getStackDisplaySlot()].setStackDisplayName("Generating: " + + * (aBaseMetaTileEntity.getUniversalEnergyStored() - this.getMinimumStoredEU()) + " EU"); } } else { tFuelValue + * = this.getFuelValue(this.mFluid); int tConsumed = this.consumedFluidPerOperation(this.mFluid); if (tFuelValue + * > 0 && tConsumed > 0 && this.mFluid.amount > tConsumed) { long tFluidAmountToUse = Math.min((long) + * (this.mFluid.amount / tConsumed), (this.maxEUStore() - aBaseMetaTileEntity.getUniversalEnergyStored()) / + * (long) tFuelValue); if (tFluidAmountToUse > 0L && aBaseMetaTileEntity + * .increaseStoredEnergyUnits(tFluidAmountToUse * (long) tFuelValue, true)) { + * PollutionUtils.addPollution(this.getBaseMetaTileEntity(), 10 * this.getPollution()); this.mFluid.amount = + * (int) ((long) this.mFluid.amount - tFluidAmountToUse * (long) tConsumed); } } } if + * (this.mInventory[this.getInputSlot()] != null && aBaseMetaTileEntity.getUniversalEnergyStored() < + * this.maxEUOutput() * 20L + this.getMinimumStoredEU() && + * GT_Utility.getFluidForFilledItem(this.mInventory[this.getInputSlot()], true) == null) { tFuelValue = + * this.getFuelValue(this.mInventory[this.getInputSlot()]); if (tFuelValue > 0) { ItemStack tEmptyContainer = + * this.getEmptyContainer(this.mInventory[this.getInputSlot()]); if + * (aBaseMetaTileEntity.addStackToSlot(this.getOutputSlot(), tEmptyContainer)) { + * aBaseMetaTileEntity.increaseStoredEnergyUnits((long) tFuelValue, true); + * aBaseMetaTileEntity.decrStackSize(this.getInputSlot(), 1); + * PollutionUtils.addPollution(this.getBaseMetaTileEntity(), 10 * this.getPollution()); } } } } if + * (aBaseMetaTileEntity.isServerSide()) { aBaseMetaTileEntity.setActive(aBaseMetaTileEntity.isAllowedToWork() && + * aBaseMetaTileEntity .getUniversalEnergyStored() >= this.maxEUOutput() + this.getMinimumStoredEU()); } + */ if (aBaseMetaTileEntity.isServerSide() && aBaseMetaTileEntity.isAllowedToWork() && ((aTick % 10) == 0)) { if (this.mFluid == null) { @@ -273,8 +239,10 @@ public abstract class GregtechRocketFuelGeneratorBase extends GT_MetaTileEntity_ if (this.mInventory[this.getStackDisplaySlot()] == null) { this.mInventory[this.getStackDisplaySlot()] = new ItemStack(Blocks.fire, 1); } - this.mInventory[this.getStackDisplaySlot()].setStackDisplayName("Generating: " - + (aBaseMetaTileEntity.getUniversalEnergyStored() - this.getMinimumStoredEU()) + " EU"); + this.mInventory[this.getStackDisplaySlot()].setStackDisplayName( + "Generating: " + + (aBaseMetaTileEntity.getUniversalEnergyStored() - this.getMinimumStoredEU()) + + " EU"); } } else { final int tFuelValue = this.getFuelValue(this.mFluid), @@ -283,8 +251,7 @@ public abstract class GregtechRocketFuelGeneratorBase extends GT_MetaTileEntity_ final long tFluidAmountToUse = Math.min( this.mFluid.amount / tConsumed, (((this.maxEUOutput() * 20) + this.getMinimumStoredEU()) - - aBaseMetaTileEntity.getUniversalEnergyStored()) - / tFuelValue); + - aBaseMetaTileEntity.getUniversalEnergyStored()) / tFuelValue); if ((tFluidAmountToUse > 0) && aBaseMetaTileEntity.increaseStoredEnergyUnits(tFluidAmountToUse * tFuelValue, true)) { int aSafeFloor = (int) Math.max(((tFluidAmountToUse * tConsumed) / 3), 1); @@ -310,8 +277,8 @@ public abstract class GregtechRocketFuelGeneratorBase extends GT_MetaTileEntity_ } if (aBaseMetaTileEntity.isServerSide()) { - aBaseMetaTileEntity.setActive(aBaseMetaTileEntity.isAllowedToWork() - && (aBaseMetaTileEntity.getUniversalEnergyStored() + aBaseMetaTileEntity.setActive( + aBaseMetaTileEntity.isAllowedToWork() && (aBaseMetaTileEntity.getUniversalEnergyStored() >= (this.maxEUOutput() + this.getMinimumStoredEU()))); } } @@ -361,8 +328,8 @@ public abstract class GregtechRocketFuelGeneratorBase extends GT_MetaTileEntity_ if (GT_Utility.isStackInvalid(aStack) || (this.getRecipes() == null)) { return 0; } - final GT_Recipe tFuel = - this.getRecipes().findRecipe(this.getBaseMetaTileEntity(), false, Long.MAX_VALUE, null, aStack); + final GT_Recipe tFuel = this.getRecipes() + .findRecipe(this.getBaseMetaTileEntity(), false, Long.MAX_VALUE, null, aStack); if (tFuel != null) { return (int) ((tFuel.mSpecialValue * 1000L * this.getEfficiency()) / 100); } @@ -373,8 +340,8 @@ public abstract class GregtechRocketFuelGeneratorBase extends GT_MetaTileEntity_ if (GT_Utility.isStackInvalid(aStack) || (this.getRecipes() == null)) { return null; } - final GT_Recipe tFuel = - this.getRecipes().findRecipe(this.getBaseMetaTileEntity(), false, Long.MAX_VALUE, null, aStack); + final GT_Recipe tFuel = this.getRecipes() + .findRecipe(this.getBaseMetaTileEntity(), false, Long.MAX_VALUE, null, aStack); if (tFuel != null) { return GT_Utility.copy(tFuel.getOutput(0)); } @@ -382,11 +349,10 @@ public abstract class GregtechRocketFuelGeneratorBase extends GT_MetaTileEntity_ } @Override - public boolean allowPutStack( - final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, final ItemStack aStack) { - return super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack) - && ((this.getFuelValue(aStack) > 0) - || (this.getFuelValue(GT_Utility.getFluidForFilledItem(aStack, true)) > 0)); + public boolean allowPutStack(final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, + final ItemStack aStack) { + return super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack) && ((this.getFuelValue(aStack) > 0) + || (this.getFuelValue(GT_Utility.getFluidForFilledItem(aStack, true)) > 0)); } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/machines/GregtechMetaSafeBlockBase.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/machines/GregtechMetaSafeBlockBase.java index 5ad0a611a5..efd2a123db 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/machines/GregtechMetaSafeBlockBase.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/machines/GregtechMetaSafeBlockBase.java @@ -2,6 +2,12 @@ package gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.machine import static gregtech.api.enums.GT_Values.V; +import java.util.UUID; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; + import gregtech.api.enums.Textures; import gregtech.api.gui.modularui.GT_UIInfos; import gregtech.api.interfaces.ITexture; @@ -12,68 +18,75 @@ import gregtech.api.util.GT_Utility; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.util.minecraft.PlayerUtils; import gtPlusPlus.core.util.player.PlayerCache; -import java.util.UUID; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; public abstract class GregtechMetaSafeBlockBase extends GT_MetaTileEntity_TieredMachineBlock { + public boolean bOutput = false, bRedstoneIfFull = false, bInvert = false, bUnbreakable = false; public int mSuccess = 0, mTargetStackSize = 0; public UUID ownerUUID; // UnbreakableBlockManager Xasda = new UnbreakableBlockManager(); private boolean value_last = false, value_current = false; - public GregtechMetaSafeBlockBase( - final int aID, - final String aName, - final String aNameRegional, - final int aTier, - final int aInvSlotCount, - final String aDescription) { + public GregtechMetaSafeBlockBase(final int aID, final String aName, final String aNameRegional, final int aTier, + final int aInvSlotCount, final String aDescription) { super(aID, aName, aNameRegional, aTier, aInvSlotCount, aDescription); } - public GregtechMetaSafeBlockBase( - final String aName, - final int aTier, - final int aInvSlotCount, - final String aDescription, - final ITexture[][][] aTextures) { + public GregtechMetaSafeBlockBase(final String aName, final int aTier, final int aInvSlotCount, + final String aDescription, final ITexture[][][] aTextures) { super(aName, aTier, aInvSlotCount, aDescription, aTextures); } @Override public ITexture[][][] getTextureSet(final ITexture[] aTextures) { final ITexture[][][] rTextures = new ITexture[6][17][]; - final ITexture tIcon = this.getOverlayIcon(), - tOut = new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_QCHEST), + final ITexture tIcon = this.getOverlayIcon(), tOut = new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_QCHEST), tUp = new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_VENT); for (byte i = -1; i < 16; i++) { - rTextures[0][i + 1] = - new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], tUp, tIcon}; // Back - rTextures[1][i + 1] = new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], tIcon - }; // Right, Strangely The top side as well when facing East? - rTextures[2][i + 1] = new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], tIcon - }; // Top And Bottom, When Facing South (What the hell?) - rTextures[3][i + 1] = new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], tIcon - }; // Left, Top if facing West and Bottom if facing east? - rTextures[4][i + 1] = new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], tIcon - }; // Top and Bottom when Facing North.. - rTextures[5][i + 1] = - new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], tOut}; // Front + rTextures[0][i + 1] = new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], tUp, tIcon }; // Back + rTextures[1][i + 1] = new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], tIcon }; // Right, + // Strangely + // The + // top + // side + // as + // well + // when + // facing + // East? + rTextures[2][i + 1] = new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], tIcon }; // Top + // And + // Bottom, + // When + // Facing + // South + // (What + // the + // hell?) + rTextures[3][i + 1] = new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], tIcon }; // Left, + // Top + // if + // facing + // West + // and + // Bottom + // if + // facing + // east? + rTextures[4][i + 1] = new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], tIcon }; // Top + // and + // Bottom + // when + // Facing + // North.. + rTextures[5][i + 1] = new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], tOut }; // Front } return rTextures; } @Override - public ITexture[] getTexture( - final IGregTechTileEntity aBaseMetaTileEntity, - final byte aSide, - final byte aFacing, - final byte aColorIndex, - final boolean aActive, - final boolean aRedstone) { + public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing, + final byte aColorIndex, final boolean aActive, final boolean aRedstone) { if (aSide == aFacing) { return this.mTextures[5][aColorIndex + 1]; } @@ -219,16 +232,19 @@ public abstract class GregtechMetaSafeBlockBase extends GT_MetaTileEntity_Tiered } if (aPlayer != null) { final UUID tempUUID = aPlayer.getUniqueID(); - /*if (!aPlayer.worldObj.isRemote){ - //PlayerCache.appendParamChanges(aPlayer.getDisplayName(), aPlayer.getUniqueID().toString()); - }*/ + /* + * if (!aPlayer.worldObj.isRemote){ //PlayerCache.appendParamChanges(aPlayer.getDisplayName(), + * aPlayer.getUniqueID().toString()); } + */ // Utils.LOG_INFO("test"); if (this.ownerUUID == null) { Logger.INFO("No owner yet for this block."); } else { // Utils.LOG_INFO("test"); - Logger.INFO("Current Owner: " + PlayerCache.lookupPlayerByUUID(this.ownerUUID) + " - UUID: " - + this.ownerUUID); + Logger.INFO( + "Current Owner: " + PlayerCache.lookupPlayerByUUID(this.ownerUUID) + + " - UUID: " + + this.ownerUUID); } Logger.WARNING("Is ownerUUID Null"); if (this.ownerUUID == null) { @@ -250,19 +266,21 @@ public abstract class GregtechMetaSafeBlockBase extends GT_MetaTileEntity_Tiered } else { PlayerUtils.messagePlayer(aPlayer, "Access Denied, This does not belong to you."); PlayerUtils.messagePlayer( - aPlayer, "it is owned by: " + PlayerCache.lookupPlayerByUUID(this.ownerUUID)); + aPlayer, + "it is owned by: " + PlayerCache.lookupPlayerByUUID(this.ownerUUID)); Logger.WARNING("Expecting Player : " + PlayerCache.lookupPlayerByUUID(this.ownerUUID)); Logger.ERROR("Access Denied."); return true; } } - /*else { - Utils.LOG_ERROR("This is NOT good. Tell Draknyte1 your safe broke."); - }*/ - /*Utils.LOG_WARNING("Clicky Clicky."); - Utils.messagePlayer(aPlayer, "Owner of this safe, now set."); - aBaseMetaTileEntity.openGUI(aPlayer); */ + /* + * else { Utils.LOG_ERROR("This is NOT good. Tell Draknyte1 your safe broke."); } + */ + /* + * Utils.LOG_WARNING("Clicky Clicky."); Utils.messagePlayer(aPlayer, "Owner of this safe, now set."); + * aBaseMetaTileEntity.openGUI(aPlayer); + */ } return true; @@ -299,14 +317,14 @@ public abstract class GregtechMetaSafeBlockBase extends GT_MetaTileEntity_Tiered } @Override - public boolean allowPullStack( - final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, final ItemStack aStack) { + public boolean allowPullStack(final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, + final ItemStack aStack) { return false; } @Override - public boolean allowPutStack( - final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, final ItemStack aStack) { + public boolean allowPutStack(final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, + final ItemStack aStack) { return aSide != aBaseMetaTileEntity.getBackFacing(); } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/machines/GregtechMetaTreeFarmerBase.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/machines/GregtechMetaTreeFarmerBase.java index 39d61acebc..01a5c38aef 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/machines/GregtechMetaTreeFarmerBase.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/machines/GregtechMetaTreeFarmerBase.java @@ -1,34 +1,27 @@ package gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.machines; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; + import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_TieredMachineBlock; import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.util.GT_Utility; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; public abstract class GregtechMetaTreeFarmerBase extends GT_MetaTileEntity_TieredMachineBlock { + public boolean bOutput = false, bRedstoneIfFull = false, bInvert = false, bUnbreakable = false; public int mSuccess = 0, mTargetStackSize = 0; - public GregtechMetaTreeFarmerBase( - final int aID, - final String aName, - final String aNameRegional, - final int aTier, - final int aInvSlotCount, - final String aDescription) { + public GregtechMetaTreeFarmerBase(final int aID, final String aName, final String aNameRegional, final int aTier, + final int aInvSlotCount, final String aDescription) { super(aID, aName, aNameRegional, aTier, aInvSlotCount, aDescription); } - public GregtechMetaTreeFarmerBase( - final String aName, - final int aTier, - final int aInvSlotCount, - final String aDescription, - final ITexture[][][] aTextures) { + public GregtechMetaTreeFarmerBase(final String aName, final int aTier, final int aInvSlotCount, + final String aDescription, final ITexture[][][] aTextures) { super(aName, aTier, aInvSlotCount, aDescription, aTextures); } @@ -51,21 +44,11 @@ public abstract class GregtechMetaTreeFarmerBase extends GT_MetaTileEntity_Tiere } @Override - public ITexture[] getTexture( - final IGregTechTileEntity aBaseMetaTileEntity, - final byte aSide, - final byte aFacing, - final byte aColorIndex, - final boolean aActive, - final boolean aRedstone) { - return this.mTextures[ - (aActive ? 5 : 0) - + (aSide == aFacing - ? 0 - : aSide == GT_Utility.getOppositeSide(aFacing) - ? 1 - : aSide == 0 ? 2 : aSide == 1 ? 3 : 4)][ - aColorIndex + 1]; + public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing, + final byte aColorIndex, final boolean aActive, final boolean aRedstone) { + return this.mTextures[(aActive ? 5 : 0) + (aSide == aFacing ? 0 + : aSide == GT_Utility.getOppositeSide(aFacing) ? 1 : aSide == 0 ? 2 : aSide == 1 ? 3 : 4)][aColorIndex + + 1]; } @Override @@ -146,35 +129,35 @@ public abstract class GregtechMetaTreeFarmerBase extends GT_MetaTileEntity_Tiere public abstract ITexture getOverlayIcon(); @Override - public boolean allowPullStack( - final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, final ItemStack aStack) { + public boolean allowPullStack(final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, + final ItemStack aStack) { return false; } @Override - public boolean allowPutStack( - final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, final ItemStack aStack) { + public boolean allowPutStack(final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, + final ItemStack aStack) { return false; } public ITexture[] getFront(final byte aColor) { - return new ITexture[] {new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Farm_Manager)}; + return new ITexture[] { new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Farm_Manager) }; } public ITexture[] getBack(final byte aColor) { - return new ITexture[] {new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Farm_Manager)}; + return new ITexture[] { new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Farm_Manager) }; } public ITexture[] getBottom(final byte aColor) { - return new ITexture[] {new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Acacia_Log)}; + return new ITexture[] { new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Acacia_Log) }; } public ITexture[] getTop(final byte aColor) { - return new ITexture[] {new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Podzol)}; + return new ITexture[] { new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Podzol) }; } public ITexture[] getSides(final byte aColor) { - return new ITexture[] {new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Farm_Manager)}; + return new ITexture[] { new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Farm_Manager) }; } public ITexture[] getFrontActive(final byte aColor) { diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/nbthandlers/GT_MetaTileEntity_Hatch_Catalysts.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/nbthandlers/GT_MetaTileEntity_Hatch_Catalysts.java index 46666114c1..77fc114b02 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/nbthandlers/GT_MetaTileEntity_Hatch_Catalysts.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/nbthandlers/GT_MetaTileEntity_Hatch_Catalysts.java @@ -1,12 +1,13 @@ package gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.nbthandlers; +import net.minecraft.item.ItemStack; + import gregtech.api.interfaces.ITexture; import gregtech.api.objects.GT_RenderedTexture; import gtPlusPlus.api.objects.data.AutoMap; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.util.minecraft.ItemUtils; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; -import net.minecraft.item.ItemStack; public class GT_MetaTileEntity_Hatch_Catalysts extends GT_MetaTileEntity_Hatch_NbtConsumable { @@ -24,17 +25,17 @@ public class GT_MetaTileEntity_Hatch_Catalysts extends GT_MetaTileEntity_Hatch_N @Override public ITexture[] getTexturesActive(ITexture aBaseTexture) { - return new ITexture[] {aBaseTexture, new GT_RenderedTexture(TexturesGtBlock.Overlay_Bus_Catalyst)}; + return new ITexture[] { aBaseTexture, new GT_RenderedTexture(TexturesGtBlock.Overlay_Bus_Catalyst) }; } @Override public ITexture[] getTexturesInactive(ITexture aBaseTexture) { - return new ITexture[] {aBaseTexture, new GT_RenderedTexture(TexturesGtBlock.Overlay_Bus_Catalyst)}; + return new ITexture[] { aBaseTexture, new GT_RenderedTexture(TexturesGtBlock.Overlay_Bus_Catalyst) }; } @Override public String[] getDescription() { - return new String[] {this.mDescription, CORE.GT_Tooltip}; + return new String[] { this.mDescription, CORE.GT_Tooltip }; } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/nbthandlers/GT_MetaTileEntity_Hatch_MillingBalls.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/nbthandlers/GT_MetaTileEntity_Hatch_MillingBalls.java index 265088a9e0..e73a70d1eb 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/nbthandlers/GT_MetaTileEntity_Hatch_MillingBalls.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/nbthandlers/GT_MetaTileEntity_Hatch_MillingBalls.java @@ -1,12 +1,13 @@ package gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.nbthandlers; +import net.minecraft.item.ItemStack; + import gregtech.api.interfaces.ITexture; import gregtech.api.objects.GT_RenderedTexture; import gtPlusPlus.api.objects.data.AutoMap; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.util.minecraft.ItemUtils; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; -import net.minecraft.item.ItemStack; public class GT_MetaTileEntity_Hatch_MillingBalls extends GT_MetaTileEntity_Hatch_NbtConsumable { @@ -24,17 +25,17 @@ public class GT_MetaTileEntity_Hatch_MillingBalls extends GT_MetaTileEntity_Hatc @Override public ITexture[] getTexturesActive(ITexture aBaseTexture) { - return new ITexture[] {aBaseTexture, new GT_RenderedTexture(TexturesGtBlock.Overlay_Bus_Milling_Balls)}; + return new ITexture[] { aBaseTexture, new GT_RenderedTexture(TexturesGtBlock.Overlay_Bus_Milling_Balls) }; } @Override public ITexture[] getTexturesInactive(ITexture aBaseTexture) { - return new ITexture[] {aBaseTexture, new GT_RenderedTexture(TexturesGtBlock.Overlay_Bus_Milling_Balls)}; + return new ITexture[] { aBaseTexture, new GT_RenderedTexture(TexturesGtBlock.Overlay_Bus_Milling_Balls) }; } @Override public String[] getDescription() { - return new String[] {this.mDescription, CORE.GT_Tooltip}; + return new String[] { this.mDescription, CORE.GT_Tooltip }; } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/nbthandlers/GT_MetaTileEntity_Hatch_NbtConsumable.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/nbthandlers/GT_MetaTileEntity_Hatch_NbtConsumable.java index 552386e72c..5bfe3f21f6 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/nbthandlers/GT_MetaTileEntity_Hatch_NbtConsumable.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/nbthandlers/GT_MetaTileEntity_Hatch_NbtConsumable.java @@ -1,10 +1,16 @@ package gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.nbthandlers; +import java.lang.reflect.Constructor; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; + import com.gtnewhorizons.modularui.api.screen.ModularWindow; import com.gtnewhorizons.modularui.api.screen.UIBuildContext; import com.gtnewhorizons.modularui.common.widget.DrawableWidget; import com.gtnewhorizons.modularui.common.widget.SlotGroup; import com.gtnewhorizons.modularui.common.widget.TextWidget; + import gregtech.api.gui.modularui.GT_UIInfos; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.modularui.IAddGregtechLogo; @@ -18,9 +24,6 @@ import gtPlusPlus.api.objects.data.AutoMap; import gtPlusPlus.core.util.minecraft.ItemUtils; import gtPlusPlus.core.util.reflect.ReflectionUtils; import gtPlusPlus.xmod.gregtech.common.StaticFields59; -import java.lang.reflect.Constructor; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; public abstract class GT_MetaTileEntity_Hatch_NbtConsumable extends GT_MetaTileEntity_Hatch implements IAddGregtechLogo { @@ -30,40 +33,24 @@ public abstract class GT_MetaTileEntity_Hatch_NbtConsumable extends GT_MetaTileE private final int mTotalSlotCount; private final boolean mAllowDuplicateUsageTypes; - public GT_MetaTileEntity_Hatch_NbtConsumable( - int aID, - String aName, - String aNameRegional, - int aTier, - int aInputSlots, - String aDescription, - boolean aAllowDuplicateTypes) { + public GT_MetaTileEntity_Hatch_NbtConsumable(int aID, String aName, String aNameRegional, int aTier, + int aInputSlots, String aDescription, boolean aAllowDuplicateTypes) { super(aID, aName, aNameRegional, aTier, aInputSlots * 2, aDescription); mInputslotCount = getInputSlotCount(); mTotalSlotCount = getInputSlotCount() * 2; mAllowDuplicateUsageTypes = aAllowDuplicateTypes; } - public GT_MetaTileEntity_Hatch_NbtConsumable( - String aName, - int aTier, - int aInputSlots, - String aDescription, - boolean aAllowDuplicateTypes, - ITexture[][][] aTextures) { + public GT_MetaTileEntity_Hatch_NbtConsumable(String aName, int aTier, int aInputSlots, String aDescription, + boolean aAllowDuplicateTypes, ITexture[][][] aTextures) { super(aName, aTier, aInputSlots * 2, aDescription, aTextures); mInputslotCount = getInputSlotCount(); mTotalSlotCount = getInputSlotCount() * 2; mAllowDuplicateUsageTypes = aAllowDuplicateTypes; } - public GT_MetaTileEntity_Hatch_NbtConsumable( - String aName, - int aTier, - int aInputSlots, - String[] aDescription, - boolean aAllowDuplicateTypes, - ITexture[][][] aTextures) { + public GT_MetaTileEntity_Hatch_NbtConsumable(String aName, int aTier, int aInputSlots, String[] aDescription, + boolean aAllowDuplicateTypes, ITexture[][][] aTextures) { super(aName, aTier, aInputSlots * 2, aDescription, aTextures); mInputslotCount = getInputSlotCount(); mTotalSlotCount = getInputSlotCount() * 2; @@ -101,9 +88,11 @@ public abstract class GT_MetaTileEntity_Hatch_NbtConsumable extends GT_MetaTileE @Override public final MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { Constructor<?> aConstructor = ReflectionUtils.getConstructor( - getHatchEntityClass(), new Class[] {String.class, String[].class, ITexture[][][].class}); + getHatchEntityClass(), + new Class[] { String.class, String[].class, ITexture[][][].class }); GT_MetaTileEntity_Hatch_NbtConsumable aInstance = ReflectionUtils.createNewInstanceFromConstructor( - aConstructor, new Object[] {mName, StaticFields59.getDescriptionArray(this), mTextures}); + aConstructor, + new Object[] { mName, StaticFields59.getDescriptionArray(this), mTextures }); if (aInstance instanceof GT_MetaTileEntity_Hatch_NbtConsumable) { GT_MetaTileEntity_Hatch_NbtConsumable aMetaTile = (GT_MetaTileEntity_Hatch_NbtConsumable) aInstance; return aMetaTile; @@ -269,29 +258,30 @@ public abstract class GT_MetaTileEntity_Hatch_NbtConsumable extends GT_MetaTileE } @Override - public final boolean allowPullStack( - IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { + public final boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, + ItemStack aStack) { return false; } @Override - public final boolean allowPutStack( - IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { - return aSide == getBaseMetaTileEntity().getFrontFacing() - && isItemValidForUsageSlot(aStack) + public final boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, + ItemStack aStack) { + return aSide == getBaseMetaTileEntity().getFrontFacing() && isItemValidForUsageSlot(aStack) && aIndex < mInputslotCount; } /** - * Items that get compared when checking for Usage Slot validity. - * Can return an empty map if isItemValidForUsageSlot() is overridden. + * Items that get compared when checking for Usage Slot validity. Can return an empty map if + * isItemValidForUsageSlot() is overridden. + * * @return */ public abstract AutoMap<ItemStack> getItemsValidForUsageSlots(); /** - * Checks if the given item is valid for Usage Slots. - * Can be overridden for easier handling if you already have methods to check this. + * Checks if the given item is valid for Usage Slots. Can be overridden for easier handling if you already have + * methods to check this. + * * @param aStack * @return */ @@ -316,16 +306,14 @@ public abstract class GT_MetaTileEntity_Hatch_NbtConsumable extends GT_MetaTileE switch (mTotalSlotCount) { case 8: case 18: - builder.widget(new DrawableWidget() - .setDrawable(getGUITextureSet().getGregTechLogo()) - .setSize(17, 17) - .setPos(152, 63)); + builder.widget( + new DrawableWidget().setDrawable(getGUITextureSet().getGregTechLogo()).setSize(17, 17) + .setPos(152, 63)); break; case 32: - builder.widget(new DrawableWidget() - .setDrawable(getGUITextureSet().getGregTechLogo()) - .setSize(17, 17) - .setPos(79, 35)); + builder.widget( + new DrawableWidget().setDrawable(getGUITextureSet().getGregTechLogo()).setSize(17, 17) + .setPos(79, 35)); break; } } @@ -334,55 +322,32 @@ public abstract class GT_MetaTileEntity_Hatch_NbtConsumable extends GT_MetaTileE public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildContext) { switch (mTotalSlotCount) { case 8: - builder.widget(SlotGroup.ofItemHandler(inventoryHandler, 2) - .startFromSlot(0) - .endAtSlot(3) - .build() - .setPos(25, 25)); - builder.widget(SlotGroup.ofItemHandler(inventoryHandler, 2) - .startFromSlot(4) - .endAtSlot(7) - .canInsert(false) - .build() - .setPos(115, 25)); - builder.widget(new TextWidget("Stock") - .setDefaultColor(COLOR_TEXT_GRAY.get()) - .setPos(25, 16)) - .widget(new TextWidget("Active") - .setDefaultColor(COLOR_TEXT_GRAY.get()) - .setPos(115, 16)); + builder.widget( + SlotGroup.ofItemHandler(inventoryHandler, 2).startFromSlot(0).endAtSlot(3).build() + .setPos(25, 25)); + builder.widget( + SlotGroup.ofItemHandler(inventoryHandler, 2).startFromSlot(4).endAtSlot(7).canInsert(false) + .build().setPos(115, 25)); + builder.widget(new TextWidget("Stock").setDefaultColor(COLOR_TEXT_GRAY.get()).setPos(25, 16)) + .widget(new TextWidget("Active").setDefaultColor(COLOR_TEXT_GRAY.get()).setPos(115, 16)); break; case 18: - builder.widget(SlotGroup.ofItemHandler(inventoryHandler, 3) - .startFromSlot(0) - .endAtSlot(8) - .build() - .setPos(25, 19)); - builder.widget(SlotGroup.ofItemHandler(inventoryHandler, 3) - .startFromSlot(9) - .endAtSlot(17) - .canInsert(false) - .build() - .setPos(97, 19)); - builder.widget(new TextWidget("Stock") - .setDefaultColor(COLOR_TEXT_GRAY.get()) - .setPos(25, 14)) - .widget(new TextWidget("Active") - .setDefaultColor(COLOR_TEXT_GRAY.get()) - .setPos(15, 14)); + builder.widget( + SlotGroup.ofItemHandler(inventoryHandler, 3).startFromSlot(0).endAtSlot(8).build() + .setPos(25, 19)); + builder.widget( + SlotGroup.ofItemHandler(inventoryHandler, 3).startFromSlot(9).endAtSlot(17).canInsert(false) + .build().setPos(97, 19)); + builder.widget(new TextWidget("Stock").setDefaultColor(COLOR_TEXT_GRAY.get()).setPos(25, 14)) + .widget(new TextWidget("Active").setDefaultColor(COLOR_TEXT_GRAY.get()).setPos(15, 14)); break; case 32: - builder.widget(SlotGroup.ofItemHandler(inventoryHandler, 4) - .startFromSlot(0) - .endAtSlot(15) - .build() - .setPos(7, 7)); - builder.widget(SlotGroup.ofItemHandler(inventoryHandler, 4) - .startFromSlot(16) - .endAtSlot(31) - .canInsert(false) - .build() - .setPos(96, 7)); + builder.widget( + SlotGroup.ofItemHandler(inventoryHandler, 4).startFromSlot(0).endAtSlot(15).build() + .setPos(7, 7)); + builder.widget( + SlotGroup.ofItemHandler(inventoryHandler, 4).startFromSlot(16).endAtSlot(31).canInsert(false) + .build().setPos(96, 7)); break; } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/objects/GTPP_CopiedBlockTexture.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/objects/GTPP_CopiedBlockTexture.java index 5336b60fc7..6a780d227c 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/objects/GTPP_CopiedBlockTexture.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/objects/GTPP_CopiedBlockTexture.java @@ -1,11 +1,13 @@ package gtPlusPlus.xmod.gregtech.api.objects; +import net.minecraft.block.Block; + import gregtech.api.enums.Dyes; import gregtech.api.objects.GT_CopiedBlockTexture; -import net.minecraft.block.Block; /** * Made this to get rid of deprecation warnings <i>everywhere</i>. + * * @author Alkalus * */ diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/objects/GTPP_RenderedTexture.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/objects/GTPP_RenderedTexture.java index 6764a1e206..0da0136193 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/objects/GTPP_RenderedTexture.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/objects/GTPP_RenderedTexture.java @@ -6,6 +6,7 @@ import gregtech.api.objects.GT_RenderedTexture; /** * Made this to get rid of deprecation warnings <i>everywhere</i>. + * * @author Alkalus * */ diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/objects/GregtechFluid.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/objects/GregtechFluid.java index 40699aa108..32783ec437 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/objects/GregtechFluid.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/objects/GregtechFluid.java @@ -1,10 +1,12 @@ package gtPlusPlus.xmod.gregtech.api.objects; +import net.minecraftforge.fluids.Fluid; + import gregtech.api.GregTech_API; import gtPlusPlus.core.lib.CORE; -import net.minecraftforge.fluids.Fluid; public class GregtechFluid extends Fluid implements Runnable { + public final String mTextureName; private final short[] mRGBa; @@ -17,8 +19,7 @@ public class GregtechFluid extends Fluid implements Runnable { @Override public int getColor() { - return (Math.max(0, Math.min(255, this.mRGBa[0])) << 16) - | (Math.max(0, Math.min(255, this.mRGBa[1])) << 8) + return (Math.max(0, Math.min(255, this.mRGBa[0])) << 16) | (Math.max(0, Math.min(255, this.mRGBa[1])) << 8) | Math.max(0, Math.min(255, this.mRGBa[2])); } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/objects/GregtechItemData.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/objects/GregtechItemData.java index a26cfbb192..787299ef6b 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/objects/GregtechItemData.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/objects/GregtechItemData.java @@ -1,12 +1,15 @@ package gtPlusPlus.xmod.gregtech.api.objects; +import java.util.*; + +import net.minecraft.item.ItemStack; + import gregtech.api.objects.GT_ArrayList; import gtPlusPlus.xmod.gregtech.api.enums.GregtechOrePrefixes; import gtPlusPlus.xmod.gregtech.api.enums.GregtechOrePrefixes.GT_Materials; -import java.util.*; -import net.minecraft.item.ItemStack; public class GregtechItemData { + private static final GregtechMaterialStack[] EMPTY_GT_MaterialStack_ARRAY = new GregtechMaterialStack[0]; public final List<Object> mExtraData = new GT_ArrayList<>(false, 1); @@ -16,14 +19,14 @@ public class GregtechItemData { public boolean mBlackListed = false; public ItemStack mUnificationTarget = null; - public GregtechItemData( - final GregtechOrePrefixes aPrefix, final GT_Materials aMaterial, final boolean aBlackListed) { + public GregtechItemData(final GregtechOrePrefixes aPrefix, final GT_Materials aMaterial, + final boolean aBlackListed) { this.mPrefix = aPrefix; this.mMaterial = aMaterial == null ? null : new GregtechMaterialStack(aMaterial, aPrefix.mMaterialAmount); this.mBlackListed = aBlackListed; this.mByProducts = (aPrefix.mSecondaryMaterial == null) || (aPrefix.mSecondaryMaterial.mMaterial == null) ? EMPTY_GT_MaterialStack_ARRAY - : new GregtechMaterialStack[] {aPrefix.mSecondaryMaterial.clone()}; + : new GregtechMaterialStack[] { aPrefix.mSecondaryMaterial.clone() }; } public GregtechItemData(final GregtechOrePrefixes aPrefix, final GT_Materials aMaterial) { @@ -37,8 +40,7 @@ public class GregtechItemData { if (aByProducts == null) { this.mByProducts = EMPTY_GT_MaterialStack_ARRAY; } else { - final GregtechMaterialStack[] tByProducts = aByProducts.length < 1 - ? EMPTY_GT_MaterialStack_ARRAY + final GregtechMaterialStack[] tByProducts = aByProducts.length < 1 ? EMPTY_GT_MaterialStack_ARRAY : new GregtechMaterialStack[aByProducts.length]; int j = 0; for (int i = 0; i < aByProducts.length; i++) { @@ -53,15 +55,12 @@ public class GregtechItemData { } } - public GregtechItemData( - final GT_Materials aMaterial, final long aAmount, final GregtechMaterialStack... aByProducts) { + public GregtechItemData(final GT_Materials aMaterial, final long aAmount, + final GregtechMaterialStack... aByProducts) { this(new GregtechMaterialStack(aMaterial, aAmount), aByProducts); } - public GregtechItemData( - final GT_Materials aMaterial, - final long aAmount, - final GT_Materials aByProduct, + public GregtechItemData(final GT_Materials aMaterial, final long aAmount, final GT_Materials aByProduct, final long aByProductAmount) { this(new GregtechMaterialStack(aMaterial, aAmount), new GregtechMaterialStack(aByProduct, aByProductAmount)); } @@ -100,6 +99,7 @@ public class GregtechItemData { } Collections.sort(rList, new Comparator<GregtechMaterialStack>() { + @Override public int compare(final GregtechMaterialStack a, final GregtechMaterialStack b) { return a.mAmount == b.mAmount ? 0 : a.mAmount > b.mAmount ? -1 : +1; diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/objects/GregtechMaterialStack.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/objects/GregtechMaterialStack.java index 107202a027..5ffdc4d20e 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/objects/GregtechMaterialStack.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/objects/GregtechMaterialStack.java @@ -3,6 +3,7 @@ package gtPlusPlus.xmod.gregtech.api.objects; import gtPlusPlus.xmod.gregtech.api.enums.GregtechOrePrefixes.GT_Materials; public class GregtechMaterialStack implements Cloneable { + public long mAmount; public GT_Materials mMaterial; @@ -33,8 +34,7 @@ public class GregtechMaterialStack implements Cloneable { } if (aObject instanceof GregtechMaterialStack) { return (((GregtechMaterialStack) aObject).mMaterial == this.mMaterial) - && ((this.mAmount < 0) - || (((GregtechMaterialStack) aObject).mAmount < 0) + && ((this.mAmount < 0) || (((GregtechMaterialStack) aObject).mAmount < 0) || (((GregtechMaterialStack) aObject).mAmount == this.mAmount)); } return false; diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/recipe/ProcessingSkookumChoocherToolRecipes.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/recipe/ProcessingSkookumChoocherToolRecipes.java index ce73d1495f..7f2fda6dd8 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/recipe/ProcessingSkookumChoocherToolRecipes.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/recipe/ProcessingSkookumChoocherToolRecipes.java @@ -1,32 +1,26 @@ package gtPlusPlus.xmod.gregtech.api.recipe; +import net.minecraft.item.ItemStack; + import gregtech.api.enums.Materials; import gregtech.api.enums.OrePrefixes; import gregtech.api.enums.ToolDictNames; import gregtech.api.interfaces.IOreRecipeRegistrator; import gregtech.api.util.GT_ModHandler; import gtPlusPlus.xmod.gregtech.common.items.MetaGeneratedGregtechTools; -import net.minecraft.item.ItemStack; public class ProcessingSkookumChoocherToolRecipes implements IOreRecipeRegistrator { + public ProcessingSkookumChoocherToolRecipes() { // GregtechOrePrefixes.toolSkookumChoocher.add(this); } @Override - public void registerOre( - final OrePrefixes aPrefix, - final Materials aMaterial, - final String aOreDictName, - final String aModName, - final ItemStack aStack) { + public void registerOre(final OrePrefixes aPrefix, final Materials aMaterial, final String aOreDictName, + final String aModName, final ItemStack aStack) { GT_ModHandler.addShapelessCraftingRecipe( MetaGeneratedGregtechTools.INSTANCE.getToolWithStats(7734, 1, aMaterial, aMaterial, null), - new Object[] { - aOreDictName, - OrePrefixes.stick.get(aMaterial), - OrePrefixes.screw.get(aMaterial), - ToolDictNames.craftingToolScrewdriver - }); + new Object[] { aOreDictName, OrePrefixes.stick.get(aMaterial), OrePrefixes.screw.get(aMaterial), + ToolDictNames.craftingToolScrewdriver }); } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/util/GTPP_Config.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/util/GTPP_Config.java index ee4892e11a..cffeb41776 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/util/GTPP_Config.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/util/GTPP_Config.java @@ -2,14 +2,16 @@ package gtPlusPlus.xmod.gregtech.api.util; import static gregtech.api.enums.GT_Values.E; -import gregtech.api.GregTech_API; -import gregtech.api.util.GT_OreDictUnificator; -import gregtech.api.util.GT_Utility; import net.minecraft.item.ItemStack; import net.minecraftforge.common.config.Configuration; import net.minecraftforge.common.config.Property; +import gregtech.api.GregTech_API; +import gregtech.api.util.GT_OreDictUnificator; +import gregtech.api.util.GT_Utility; + public class GTPP_Config implements Runnable { + public static boolean troll = false; public static Configuration sConfigFileIDs; @@ -23,8 +25,8 @@ public class GTPP_Config implements Runnable { public static int addIDConfig(Object aCategory, String aName, int aDefault) { if (GT_Utility.isStringInvalid(aName)) return aDefault; - Property tProperty = - sConfigFileIDs.get(aCategory.toString().replaceAll("\\|", "."), aName.replaceAll("\\|", "."), aDefault); + Property tProperty = sConfigFileIDs + .get(aCategory.toString().replaceAll("\\|", "."), aName.replaceAll("\\|", "."), aDefault); int rResult = tProperty.getInt(aDefault); if (!tProperty.wasRead() && GregTech_API.sPostloadFinished) sConfigFileIDs.save(); return rResult; @@ -37,7 +39,7 @@ public class GTPP_Config implements Runnable { try { if (GT_Utility.isStringValid(rName = aStack.getUnlocalizedName())) return rName.toString(); } catch (Throwable e) { - /*Do nothing*/ + /* Do nothing */ } String sName = aStack.getItem().toString(); String[] tmp = sName.split("@"); @@ -53,7 +55,9 @@ public class GTPP_Config implements Runnable { public boolean get(Object aCategory, String aName, boolean aDefault) { if (GT_Utility.isStringInvalid(aName)) return aDefault; Property tProperty = mConfig.get( - aCategory.toString().replaceAll("\\|", "_"), (aName + "_" + aDefault).replaceAll("\\|", "_"), aDefault); + aCategory.toString().replaceAll("\\|", "_"), + (aName + "_" + aDefault).replaceAll("\\|", "_"), + aDefault); boolean rResult = tProperty.getBoolean(aDefault); if (!tProperty.wasRead() && GregTech_API.sPostloadFinished) mConfig.save(); return rResult; @@ -66,7 +70,9 @@ public class GTPP_Config implements Runnable { public int get(Object aCategory, String aName, int aDefault) { if (GT_Utility.isStringInvalid(aName)) return aDefault; Property tProperty = mConfig.get( - aCategory.toString().replaceAll("\\|", "_"), (aName + "_" + aDefault).replaceAll("\\|", "_"), aDefault); + aCategory.toString().replaceAll("\\|", "_"), + (aName + "_" + aDefault).replaceAll("\\|", "_"), + aDefault); int rResult = tProperty.getInt(aDefault); if (!tProperty.wasRead() && GregTech_API.sPostloadFinished) mConfig.save(); return rResult; @@ -79,7 +85,9 @@ public class GTPP_Config implements Runnable { public double get(Object aCategory, String aName, double aDefault) { if (GT_Utility.isStringInvalid(aName)) return aDefault; Property tProperty = mConfig.get( - aCategory.toString().replaceAll("\\|", "_"), (aName + "_" + aDefault).replaceAll("\\|", "_"), aDefault); + aCategory.toString().replaceAll("\\|", "_"), + (aName + "_" + aDefault).replaceAll("\\|", "_"), + aDefault); double rResult = tProperty.getDouble(aDefault); if (!tProperty.wasRead() && GregTech_API.sPostloadFinished) mConfig.save(); return rResult; @@ -92,7 +100,9 @@ public class GTPP_Config implements Runnable { public String get(Object aCategory, String aName, String aDefault) { if (GT_Utility.isStringInvalid(aName)) return aDefault; Property tProperty = mConfig.get( - aCategory.toString().replaceAll("\\|", "_"), (aName + "_" + aDefault).replaceAll("\\|", "_"), aDefault); + aCategory.toString().replaceAll("\\|", "_"), + (aName + "_" + aDefault).replaceAll("\\|", "_"), + aDefault); String rResult = tProperty.getString(); if (!tProperty.wasRead() && GregTech_API.sPostloadFinished) mConfig.save(); return rResult; diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/util/GregtechOreDictUnificator.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/util/GregtechOreDictUnificator.java index c5671b88b9..52950e1ae0 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/util/GregtechOreDictUnificator.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/util/GregtechOreDictUnificator.java @@ -2,6 +2,16 @@ package gtPlusPlus.xmod.gregtech.api.util; import static gregtech.api.enums.GT_Values.*; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; + +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraftforge.oredict.OreDictionary; + import gregtech.api.GregTech_API; import gregtech.api.enums.Dyes; import gregtech.api.enums.Materials; @@ -14,21 +24,12 @@ import gregtech.api.objects.MaterialStack; import gregtech.api.util.*; import gtPlusPlus.core.util.reflect.ReflectionUtils; import gtPlusPlus.xmod.gregtech.common.StaticFields59; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import net.minecraft.init.Items; -import net.minecraft.item.ItemStack; -import net.minecraftforge.oredict.OreDictionary; public class GregtechOreDictUnificator { private static final Map<String, ItemStack> sName2StackMap = new HashMap<String, ItemStack>(); private static final Map<GT_ItemStack, ItemData> sItemStack2DataMap = new HashMap<GT_ItemStack, ItemData>(); - private static final Map<GT_ItemStack, List<ItemStack>> sUnificationTable = - new HashMap<GT_ItemStack, List<ItemStack>>(); + private static final Map<GT_ItemStack, List<ItemStack>> sUnificationTable = new HashMap<GT_ItemStack, List<ItemStack>>(); private static final GT_HashSet<GT_ItemStack> sNoUnificationList = new GT_HashSet<GT_ItemStack>(); private static int isRegisteringOre = 0, isAddingOre = 0; @@ -41,8 +42,8 @@ public class GregtechOreDictUnificator { } /** - * The Blacklist just prevents the Item from being unificated into something else. - * Useful if you have things like the Industrial Diamond, which is better than regular Diamond, but also usable in absolutely all Diamond Recipes. + * The Blacklist just prevents the Item from being unificated into something else. Useful if you have things like + * the Industrial Diamond, which is better than regular Diamond, but also usable in absolutely all Diamond Recipes. */ public static void addToBlacklist(ItemStack aStack) { if (GT_Utility.isStackValid(aStack) && !GT_Utility.isStackInList(aStack, sNoUnificationList)) @@ -61,23 +62,17 @@ public class GregtechOreDictUnificator { set(aPrefix, aMaterial, aStack, true, false); } - public static void set( - OrePrefixes aPrefix, - Materials aMaterial, - ItemStack aStack, - boolean aOverwrite, + public static void set(OrePrefixes aPrefix, Materials aMaterial, ItemStack aStack, boolean aOverwrite, boolean aAlreadyRegistered) { - if (aMaterial == null - || aPrefix == null + if (aMaterial == null || aPrefix == null || GT_Utility.isStackInvalid(aStack) - || Items.feather.getDamage(aStack) == W) return; + || Items.feather.getDamage(aStack) == W) + return; isAddingOre++; aStack = GT_Utility.copyAmount(1, aStack); if (!aAlreadyRegistered) registerOre(aPrefix.get(aMaterial), aStack); addAssociation(aPrefix, aMaterial, aStack, isBlacklisted(aStack)); - if (aOverwrite - || GT_Utility.isStackInvalid( - sName2StackMap.get(aPrefix.get(aMaterial).toString()))) + if (aOverwrite || GT_Utility.isStackInvalid(sName2StackMap.get(aPrefix.get(aMaterial).toString()))) sName2StackMap.put(aPrefix.get(aMaterial).toString(), aStack); isAddingOre--; } @@ -105,21 +100,18 @@ public class GregtechOreDictUnificator { // if (Materials.mDefaultComponents.contains(aPrefix) && !aPrefix.mDynamicItems.contains((Materials)aMaterial)) // aPrefix.mDynamicItems.add((Materials) aMaterial); if (StaticFields59.geOrePrefixesBooleanPreventableComponents().contains(aPrefix) - && StaticFields59.getOrePrefixesBooleanDisabledItems().contains(aMaterial)) return aReplacement; + && StaticFields59.getOrePrefixesBooleanDisabledItems().contains(aMaterial)) + return aReplacement; return get(aPrefix.get(aMaterial), aReplacement, aAmount, false, true); } - public static ItemStack get( - Object aName, - ItemStack aReplacement, - long aAmount, - boolean aMentionPossibleTypos, + public static ItemStack get(Object aName, ItemStack aReplacement, long aAmount, boolean aMentionPossibleTypos, boolean aNoInvalidAmounts) { if (aNoInvalidAmounts && aAmount < 1) return null; if (!sName2StackMap.containsKey(aName.toString()) && aMentionPossibleTypos) GT_Log.err.println("Unknown Key for Unification, Typo? " + aName); - return GT_Utility.copyAmount( - aAmount, sName2StackMap.get(aName.toString()), getFirstOre(aName, aAmount), aReplacement); + return GT_Utility + .copyAmount(aAmount, sName2StackMap.get(aName.toString()), getFirstOre(aName, aAmount), aReplacement); } public static ItemStack[] setStackArray(boolean aUseBlackList, ItemStack... aStacks) { @@ -158,9 +150,9 @@ public class GregtechOreDictUnificator { if (GT_Utility.isStackInvalid(aStack)) return null; ItemData tPrefixMaterial = getAssociation(aStack); ItemStack rStack = null; - if (tPrefixMaterial == null - || !tPrefixMaterial.hasValidPrefixMaterialData() - || (aUseBlackList && tPrefixMaterial.mBlackListed)) return GT_Utility.copy(aStack); + if (tPrefixMaterial == null || !tPrefixMaterial.hasValidPrefixMaterialData() + || (aUseBlackList && tPrefixMaterial.mBlackListed)) + return GT_Utility.copy(aStack); if (aUseBlackList && !GregTech_API.sUnificationEntriesRegistered && isBlacklisted(aStack)) { tPrefixMaterial.mBlackListed = true; return GT_Utility.copy(aStack); @@ -192,7 +184,7 @@ public class GregtechOreDictUnificator { } } ItemStack[] aStacks = {}; - if (obj instanceof ItemStack) aStacks = new ItemStack[] {(ItemStack) obj}; + if (obj instanceof ItemStack) aStacks = new ItemStack[] { (ItemStack) obj }; else if (obj instanceof ItemStack[]) aStacks = (ItemStack[]) obj; else if (obj instanceof List) aStacks = (ItemStack[]) ((List) obj).toArray(new ItemStack[0]); List<ItemStack> rList = new ArrayList<ItemStack>(); @@ -218,9 +210,8 @@ public class GregtechOreDictUnificator { if (GT_Utility.isStackInvalid(aStack) || aData == null) return; ItemData tData = getItemData(aStack); if (tData == null || !tData.hasValidPrefixMaterialData()) { - if (tData != null) - for (Object tObject : tData.mExtraData) - if (!aData.mExtraData.contains(tObject)) aData.mExtraData.add(tObject); + if (tData != null) for (Object tObject : tData.mExtraData) + if (!aData.mExtraData.contains(tObject)) aData.mExtraData.add(tObject); if (aStack.stackSize > 1) { if (aData.mMaterial != null) aData.mMaterial.mAmount /= aStack.stackSize; for (MaterialStack tMaterial : aData.mByProducts) tMaterial.mAmount /= aStack.stackSize; @@ -228,12 +219,10 @@ public class GregtechOreDictUnificator { } sItemStack2DataMap.put(new GT_ItemStack(aStack), aData); if (aData.hasValidMaterialData()) { - long tValidMaterialAmount = aData.mMaterial.mMaterial.contains(SubTag.NO_RECYCLING) - ? 0 + long tValidMaterialAmount = aData.mMaterial.mMaterial.contains(SubTag.NO_RECYCLING) ? 0 : aData.mMaterial.mAmount >= 0 ? aData.mMaterial.mAmount : M; for (MaterialStack tMaterial : aData.mByProducts) - tValidMaterialAmount += tMaterial.mMaterial.contains(SubTag.NO_RECYCLING) - ? 0 + tValidMaterialAmount += tMaterial.mMaterial.contains(SubTag.NO_RECYCLING) ? 0 : tMaterial.mAmount >= 0 ? tMaterial.mAmount : M; if (tValidMaterialAmount < M) GT_ModHandler.addToRecyclerBlackList(aStack); } @@ -242,8 +231,8 @@ public class GregtechOreDictUnificator { mRunThroughTheList = false; for (Entry<GT_ItemStack, ItemData> tEntry : sItemStack2DataMap.entrySet()) if (!tEntry.getValue().hasValidPrefixData() || tEntry.getValue().mPrefix.mAllowNormalRecycling) - GT_RecipeRegistrator.registerMaterialRecycling( - tEntry.getKey().toStack(), tEntry.getValue()); + GT_RecipeRegistrator + .registerMaterialRecycling(tEntry.getKey().toStack(), tEntry.getValue()); } } else { if (!aData.hasValidPrefixData() || aData.mPrefix.mAllowNormalRecycling) @@ -255,13 +244,11 @@ public class GregtechOreDictUnificator { } } - public static void addAssociation( - OrePrefixes aPrefix, Materials aMaterial, ItemStack aStack, boolean aBlackListed) { + public static void addAssociation(OrePrefixes aPrefix, Materials aMaterial, ItemStack aStack, + boolean aBlackListed) { if (aPrefix == null || aMaterial == null || GT_Utility.isStackInvalid(aStack)) return; - if (Items.feather.getDamage(aStack) == W) - for (byte i = 0; i < 16; i++) - setItemData( - GT_Utility.copyAmountAndMetaData(1, i, aStack), new ItemData(aPrefix, aMaterial, aBlackListed)); + if (Items.feather.getDamage(aStack) == W) for (byte i = 0; i < 16; i++) + setItemData(GT_Utility.copyAmountAndMetaData(1, i, aStack), new ItemData(aPrefix, aMaterial, aBlackListed)); setItemData(aStack, new ItemData(aPrefix, aMaterial, aBlackListed)); } @@ -388,8 +375,7 @@ public class GregtechOreDictUnificator { public static ItemStack getIngotOrDust(MaterialStack aMaterial) { ItemStack rStack = getIngot(aMaterial); - if (aMaterial != null - && aMaterial.mMaterial != null + if (aMaterial != null && aMaterial.mMaterial != null && (aMaterial.mMaterial == Materials.Naquadah || aMaterial.mMaterial == Materials.NaquadahEnriched)) rStack = getDust(aMaterial); if (rStack == null) rStack = getDust(aMaterial); diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/util/SpecialBehaviourTooltipHandler.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/util/SpecialBehaviourTooltipHandler.java index d03d4da099..51987d84fd 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/util/SpecialBehaviourTooltipHandler.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/util/SpecialBehaviourTooltipHandler.java @@ -1,12 +1,14 @@ package gtPlusPlus.xmod.gregtech.api.util; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import gregtech.api.util.GT_Utility; import java.util.HashMap; + import net.minecraft.item.ItemStack; import net.minecraft.util.EnumChatFormatting; import net.minecraftforge.event.entity.player.ItemTooltipEvent; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import gregtech.api.util.GT_Utility; + public class SpecialBehaviourTooltipHandler { private static final HashMap<ItemStack, String> mTooltipCache = new HashMap<ItemStack, String>(); diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/world/GTPP_Worldgen.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/world/GTPP_Worldgen.java index 6f58823eb1..bfbd4e6da3 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/world/GTPP_Worldgen.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/world/GTPP_Worldgen.java @@ -6,6 +6,7 @@ import java.util.List; import java.util.Map; import java.util.Random; import java.util.concurrent.ConcurrentHashMap; + import net.minecraft.world.World; import net.minecraft.world.chunk.IChunkProvider; @@ -30,15 +31,8 @@ public abstract class GTPP_Worldgen { * @param aChunkZ zCoord of the Chunk * @return if the Worldgeneration has been successfully completed */ - public boolean executeWorldgen( - World aWorld, - Random aRandom, - String aBiome, - int aDimensionType, - int aChunkX, - int aChunkZ, - IChunkProvider aChunkGenerator, - IChunkProvider aChunkProvider) { + public boolean executeWorldgen(World aWorld, Random aRandom, String aBiome, int aDimensionType, int aChunkX, + int aChunkZ, IChunkProvider aChunkGenerator, IChunkProvider aChunkProvider) { return false; } @@ -51,15 +45,8 @@ public abstract class GTPP_Worldgen { * @param aChunkZ zCoord of the Chunk * @return if the Worldgeneration has been successfully completed */ - public boolean executeCavegen( - World aWorld, - Random aRandom, - String aBiome, - int aDimensionType, - int aChunkX, - int aChunkZ, - IChunkProvider aChunkGenerator, - IChunkProvider aChunkProvider) { + public boolean executeCavegen(World aWorld, Random aRandom, String aBiome, int aDimensionType, int aChunkX, + int aChunkZ, IChunkProvider aChunkGenerator, IChunkProvider aChunkProvider) { return false; } @@ -67,8 +54,8 @@ public abstract class GTPP_Worldgen { String aDimName = aWorld.provider.getDimensionName(); Boolean tAllowed = mDimensionMap.get(aDimName); if (tAllowed == null) { - boolean tValue = sCustomWorldgenFile.get( - "worldgen.dimensions." + mWorldGenName, aDimName, aDimensionType == aAllowedDimensionType); + boolean tValue = sCustomWorldgenFile + .get("worldgen.dimensions." + mWorldGenName, aDimName, aDimensionType == aAllowedDimensionType); mDimensionMap.put(aDimName, tValue); return tValue; } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/world/GTPP_Worldgen_Boulder.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/world/GTPP_Worldgen_Boulder.java index 26f1b38084..ffb1baf9f0 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/world/GTPP_Worldgen_Boulder.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/world/GTPP_Worldgen_Boulder.java @@ -1,27 +1,20 @@ package gtPlusPlus.xmod.gregtech.api.world; -import gtPlusPlus.core.lib.CORE; import java.util.Collection; import java.util.Random; + import net.minecraft.block.Block; import net.minecraft.block.BlockContainer; import net.minecraft.util.MathHelper; import net.minecraft.world.World; import net.minecraft.world.chunk.IChunkProvider; +import gtPlusPlus.core.lib.CORE; + public class GTPP_Worldgen_Boulder extends GTPP_Worldgen_Ore { - public GTPP_Worldgen_Boulder( - String aName, - boolean aDefault, - Block aBlock, - int aBlockMeta, - int aDimensionType, - int aAmount, - int aSize, - int aProbability, - int aMinY, - int aMaxY, - Collection<String> aBiomeList, + + public GTPP_Worldgen_Boulder(String aName, boolean aDefault, Block aBlock, int aBlockMeta, int aDimensionType, + int aAmount, int aSize, int aProbability, int aMinY, int aMaxY, Collection<String> aBiomeList, boolean aAllowToGenerateinVoid) { super( aName, @@ -39,25 +32,16 @@ public class GTPP_Worldgen_Boulder extends GTPP_Worldgen_Ore { } @Override - public boolean executeWorldgen( - World aWorld, - Random aRandom, - String aBiome, - int aDimensionType, - int aChunkX, - int aChunkZ, - IChunkProvider aChunkGenerator, - IChunkProvider aChunkProvider) { + public boolean executeWorldgen(World aWorld, Random aRandom, String aBiome, int aDimensionType, int aChunkX, + int aChunkZ, IChunkProvider aChunkGenerator, IChunkProvider aChunkProvider) { if (isGenerationAllowed(aWorld, aDimensionType, mDimensionType) && (mBiomeList.isEmpty() || mBiomeList.contains(aBiome)) && (mProbability <= 1 || aRandom.nextInt(mProbability) == 0)) { for (int i = 0; i < mAmount; i++) { - int tX = aChunkX + aRandom.nextInt(16), - tY = mMinY + aRandom.nextInt(mMaxY - mMinY), + int tX = aChunkX + aRandom.nextInt(16), tY = mMinY + aRandom.nextInt(mMaxY - mMinY), tZ = aChunkZ + aRandom.nextInt(16); Block tBlock = aWorld.getBlock(tX, tY - 7, tZ); - if (tBlock != null - && tBlock.isOpaqueCube() + if (tBlock != null && tBlock.isOpaqueCube() && aWorld.getBlock(tX, tY - 6, tZ).isAir(aWorld, tX, tY - 6, tZ)) { float math_pi = CORE.PI; float var6 = aRandom.nextFloat() * math_pi; @@ -101,11 +85,9 @@ public class GTPP_Worldgen_Boulder extends GTPP_Worldgen_Ore { for (int var44 = var34; var44 <= var37; ++var44) { float var45 = (var44 + 0.5F - var24) / (var28); Block block = aWorld.getBlock(var38, var41, var44); - if (var14b + var45 * var45 < 1.0F - && ((mAllowToGenerateinVoid - && aWorld.getBlock(var38, var41, var44) - .isAir(aWorld, var38, var41, var44)) - || (block != null && !(block instanceof BlockContainer)))) { + if (var14b + var45 * var45 < 1.0F && ((mAllowToGenerateinVoid && aWorld + .getBlock(var38, var41, var44).isAir(aWorld, var38, var41, var44)) + || (block != null && !(block instanceof BlockContainer)))) { aWorld.setBlock(var38, var41, var44, mBlock, mBlockMeta, 0); } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/world/GTPP_Worldgen_GT_Ore_Layer.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/world/GTPP_Worldgen_GT_Ore_Layer.java index 0dbd354547..e3f33f45e4 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/world/GTPP_Worldgen_GT_Ore_Layer.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/world/GTPP_Worldgen_GT_Ore_Layer.java @@ -2,22 +2,25 @@ package gtPlusPlus.xmod.gregtech.api.world; import static gtPlusPlus.xmod.gregtech.HANDLER_GT.sCustomWorldgenFile; -import gregtech.api.GregTech_API; -import gregtech.api.enums.GT_Values; -import gregtech.api.enums.Materials; -import gregtech.common.blocks.GT_TileEntity_Ores; -import gregtech.loaders.misc.GT_Achievements; -import gtPlusPlus.core.lib.CORE; -import gtPlusPlus.core.material.Material; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.util.ArrayList; import java.util.Random; + import net.minecraft.util.MathHelper; import net.minecraft.world.World; import net.minecraft.world.chunk.IChunkProvider; +import gregtech.api.GregTech_API; +import gregtech.api.enums.GT_Values; +import gregtech.api.enums.Materials; +import gregtech.common.blocks.GT_TileEntity_Ores; +import gregtech.loaders.misc.GT_Achievements; +import gtPlusPlus.core.lib.CORE; +import gtPlusPlus.core.material.Material; + public class GTPP_Worldgen_GT_Ore_Layer extends GTPP_Worldgen { + public static ArrayList<GTPP_Worldgen_GT_Ore_Layer> sList = new ArrayList<GTPP_Worldgen_GT_Ore_Layer>(); public static int sWeight = 0; public final short mMinY; @@ -33,37 +36,27 @@ public class GTPP_Worldgen_GT_Ore_Layer extends GTPP_Worldgen { public final boolean mDarkWorld; public final String aTextWorldgen = "worldgen.gtpp."; - public GTPP_Worldgen_GT_Ore_Layer( - String aName, - boolean aDefault, - int aMinY, - int aMaxY, - int aWeight, - int aDensity, - int aSize, - boolean aOverworld, - Materials aPrimary, - Materials aSecondary, - Materials aBetween, + public GTPP_Worldgen_GT_Ore_Layer(String aName, boolean aDefault, int aMinY, int aMaxY, int aWeight, int aDensity, + int aSize, boolean aOverworld, Materials aPrimary, Materials aSecondary, Materials aBetween, Materials aSporadic) { super(aName, sList, aDefault); this.mDarkWorld = sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "Overworld", aOverworld); this.mMinY = ((short) sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "MinHeight", aMinY)); - this.mMaxY = ((short) Math.max( - this.mMinY + 5, sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "MaxHeight", aMaxY))); + this.mMaxY = ((short) Math + .max(this.mMinY + 5, sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "MaxHeight", aMaxY))); this.mWeight = ((short) sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "RandomWeight", aWeight)); this.mDensity = ((short) sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "Density", aDensity)); this.mSize = ((short) Math.max(1, sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "Size", aSize))); - this.mPrimaryMeta = ((short) sCustomWorldgenFile.get( - aTextWorldgen + this.mWorldGenName, "OrePrimaryLayer", aPrimary.mMetaItemSubID)); - this.mSecondaryMeta = ((short) sCustomWorldgenFile.get( - aTextWorldgen + this.mWorldGenName, "OreSecondaryLayer", aSecondary.mMetaItemSubID)); - this.mBetweenMeta = ((short) sCustomWorldgenFile.get( - aTextWorldgen + this.mWorldGenName, "OreSporadiclyInbetween", aBetween.mMetaItemSubID)); - this.mSporadicMeta = ((short) sCustomWorldgenFile.get( - aTextWorldgen + this.mWorldGenName, "OreSporaticlyAround", aSporadic.mMetaItemSubID)); - this.mRestrictBiome = - sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "RestrictToBiomeName", "None"); + this.mPrimaryMeta = ((short) sCustomWorldgenFile + .get(aTextWorldgen + this.mWorldGenName, "OrePrimaryLayer", aPrimary.mMetaItemSubID)); + this.mSecondaryMeta = ((short) sCustomWorldgenFile + .get(aTextWorldgen + this.mWorldGenName, "OreSecondaryLayer", aSecondary.mMetaItemSubID)); + this.mBetweenMeta = ((short) sCustomWorldgenFile + .get(aTextWorldgen + this.mWorldGenName, "OreSporadiclyInbetween", aBetween.mMetaItemSubID)); + this.mSporadicMeta = ((short) sCustomWorldgenFile + .get(aTextWorldgen + this.mWorldGenName, "OreSporaticlyAround", aSporadic.mMetaItemSubID)); + this.mRestrictBiome = sCustomWorldgenFile + .get(aTextWorldgen + this.mWorldGenName, "RestrictToBiomeName", "None"); if (this.mEnabled) { GT_Achievements.registerOre( @@ -102,65 +95,53 @@ public class GTPP_Worldgen_GT_Ore_Layer extends GTPP_Worldgen { } } - public GTPP_Worldgen_GT_Ore_Layer( - String aName, - boolean aDefault, - int aMinY, - int aMaxY, - int aWeight, - int aDensity, - int aSize, - Material aPrimary, - Material aSecondary, - Material aBetween, - Material aSporadic) { + public GTPP_Worldgen_GT_Ore_Layer(String aName, boolean aDefault, int aMinY, int aMaxY, int aWeight, int aDensity, + int aSize, Material aPrimary, Material aSecondary, Material aBetween, Material aSporadic) { super(aName, sList, aDefault); this.mDarkWorld = sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "Darkworld", true); this.mMinY = ((short) sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "MinHeight", aMinY)); - this.mMaxY = ((short) Math.max( - this.mMinY + 5, sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "MaxHeight", aMaxY))); + this.mMaxY = ((short) Math + .max(this.mMinY + 5, sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "MaxHeight", aMaxY))); this.mWeight = ((short) sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "RandomWeight", aWeight)); this.mDensity = ((short) sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "Density", aDensity)); this.mSize = ((short) Math.max(1, sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "Size", aSize))); - /*this.mPrimaryMeta = ((short) sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "OrePrimaryLayer", aPrimary.mMetaItemSubID)); - this.mSecondaryMeta = ((short) sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "OreSecondaryLayer", aSecondary.mMetaItemSubID)); - this.mBetweenMeta = ((short) sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "OreSporadiclyInbetween", aBetween.mMetaItemSubID)); - this.mSporadicMeta = ((short) sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "OreSporaticlyAround", aSporadic.mMetaItemSubID)); - */ this.mRestrictBiome = - sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "RestrictToBiomeName", "None"); + /* + * this.mPrimaryMeta = ((short) sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "OrePrimaryLayer", + * aPrimary.mMetaItemSubID)); this.mSecondaryMeta = ((short) sCustomWorldgenFile.get(aTextWorldgen + + * this.mWorldGenName, "OreSecondaryLayer", aSecondary.mMetaItemSubID)); this.mBetweenMeta = ((short) + * sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "OreSporadiclyInbetween", + * aBetween.mMetaItemSubID)); this.mSporadicMeta = ((short) sCustomWorldgenFile.get(aTextWorldgen + + * this.mWorldGenName, "OreSporaticlyAround", aSporadic.mMetaItemSubID)); + */ this.mRestrictBiome = sCustomWorldgenFile + .get(aTextWorldgen + this.mWorldGenName, "RestrictToBiomeName", "None"); if (this.mEnabled) { - /* GT_Achievements.registerOre(GregTech_API.sGeneratedMaterials[(mPrimaryMeta % 1000)], aMinY, aMaxY, aWeight, false, false, false); - GT_Achievements.registerOre(GregTech_API.sGeneratedMaterials[(mSecondaryMeta % 1000)], aMinY, aMaxY, aWeight, false, false, false); - GT_Achievements.registerOre(GregTech_API.sGeneratedMaterials[(mBetweenMeta % 1000)], aMinY, aMaxY, aWeight, false, false, false); - GT_Achievements.registerOre(GregTech_API.sGeneratedMaterials[(mSporadicMeta % 1000)], aMinY, aMaxY, aWeight, false, false, false); + /* + * GT_Achievements.registerOre(GregTech_API.sGeneratedMaterials[(mPrimaryMeta % 1000)], aMinY, aMaxY, + * aWeight, false, false, false); + * GT_Achievements.registerOre(GregTech_API.sGeneratedMaterials[(mSecondaryMeta % 1000)], aMinY, aMaxY, + * aWeight, false, false, false); GT_Achievements.registerOre(GregTech_API.sGeneratedMaterials[(mBetweenMeta + * % 1000)], aMinY, aMaxY, aWeight, false, false, false); + * GT_Achievements.registerOre(GregTech_API.sGeneratedMaterials[(mSporadicMeta % 1000)], aMinY, aMaxY, + * aWeight, false, false, false); */ sWeight += this.mWeight; } } @Override - public boolean executeWorldgen( - World aWorld, - Random aRandom, - String aBiome, - int aDimensionType, - int aChunkX, - int aChunkZ, - IChunkProvider aChunkGenerator, - IChunkProvider aChunkProvider) { + public boolean executeWorldgen(World aWorld, Random aRandom, String aBiome, int aDimensionType, int aChunkX, + int aChunkZ, IChunkProvider aChunkGenerator, IChunkProvider aChunkProvider) { if (!this.mRestrictBiome.equals("None") && !(this.mRestrictBiome.equals(aBiome))) { return false; // Not the correct biome for ore mix } if (!isGenerationAllowed( aWorld, aDimensionType, - ((aDimensionType == -1) && (false)) - || ((aDimensionType == 0) && (this.mDarkWorld)) - || ((aDimensionType == 1) && (false)) - || ((aWorld.provider.getDimensionName().equals("Moon")) && (false)) - || ((aWorld.provider.getDimensionName().equals("Mars")) && (false)) - ? aDimensionType - : aDimensionType ^ 0xFFFFFFFF)) { + ((aDimensionType == -1) && (false)) || ((aDimensionType == 0) && (this.mDarkWorld)) + || ((aDimensionType == 1) && (false)) + || ((aWorld.provider.getDimensionName().equals("Moon")) && (false)) + || ((aWorld.provider.getDimensionName().equals("Mars")) && (false)) ? aDimensionType + : aDimensionType ^ 0xFFFFFFFF)) { return false; } int tMinY = this.mMinY + aRandom.nextInt(this.mMaxY - this.mMinY - 5); @@ -173,12 +154,14 @@ public class GTPP_Worldgen_GT_Ore_Layer extends GTPP_Worldgen { for (int tZ = cZ; tZ <= eZ; tZ++) { if (this.mSecondaryMeta > 0) { for (int i = tMinY - 1; i < tMinY + 2; i++) { - if ((aRandom.nextInt(Math.max( - 1, - Math.max(MathHelper.abs_int(cZ - tZ), MathHelper.abs_int(eZ - tZ)) - / this.mDensity)) - == 0) - || (aRandom.nextInt(Math.max( + if ((aRandom.nextInt( + Math.max( + 1, + Math.max(MathHelper.abs_int(cZ - tZ), MathHelper.abs_int(eZ - tZ)) + / this.mDensity)) + == 0) + || (aRandom.nextInt( + Math.max( 1, Math.max(MathHelper.abs_int(cX - tX), MathHelper.abs_int(eX - tX)) / this.mDensity)) @@ -187,27 +170,27 @@ public class GTPP_Worldgen_GT_Ore_Layer extends GTPP_Worldgen { } } } - if ((this.mBetweenMeta > 0) - && ((aRandom.nextInt(Math.max( - 1, - Math.max(MathHelper.abs_int(cZ - tZ), MathHelper.abs_int(eZ - tZ)) - / this.mDensity)) - == 0) - || (aRandom.nextInt(Math.max( - 1, - Math.max(MathHelper.abs_int(cX - tX), MathHelper.abs_int(eX - tX)) - / this.mDensity)) - == 0))) { + if ((this.mBetweenMeta > 0) && ((aRandom.nextInt( + Math.max(1, Math.max(MathHelper.abs_int(cZ - tZ), MathHelper.abs_int(eZ - tZ)) / this.mDensity)) + == 0) + || (aRandom.nextInt( + Math.max( + 1, + Math.max(MathHelper.abs_int(cX - tX), MathHelper.abs_int(eX - tX)) + / this.mDensity)) + == 0))) { setOreBlock(aWorld, tX, tMinY + 2 + aRandom.nextInt(2), tZ, this.mBetweenMeta, false); } if (this.mPrimaryMeta > 0) { for (int i = tMinY + 3; i < tMinY + 6; i++) { - if ((aRandom.nextInt(Math.max( - 1, - Math.max(MathHelper.abs_int(cZ - tZ), MathHelper.abs_int(eZ - tZ)) - / this.mDensity)) - == 0) - || (aRandom.nextInt(Math.max( + if ((aRandom.nextInt( + Math.max( + 1, + Math.max(MathHelper.abs_int(cZ - tZ), MathHelper.abs_int(eZ - tZ)) + / this.mDensity)) + == 0) + || (aRandom.nextInt( + Math.max( 1, Math.max(MathHelper.abs_int(cX - tX), MathHelper.abs_int(eX - tX)) / this.mDensity)) @@ -216,17 +199,15 @@ public class GTPP_Worldgen_GT_Ore_Layer extends GTPP_Worldgen { } } } - if ((this.mSporadicMeta > 0) - && ((aRandom.nextInt(Math.max( - 1, - Math.max(MathHelper.abs_int(cZ - tZ), MathHelper.abs_int(eZ - tZ)) - / this.mDensity)) - == 0) - || (aRandom.nextInt(Math.max( - 1, - Math.max(MathHelper.abs_int(cX - tX), MathHelper.abs_int(eX - tX)) - / this.mDensity)) - == 0))) { + if ((this.mSporadicMeta > 0) && ((aRandom.nextInt( + Math.max(1, Math.max(MathHelper.abs_int(cZ - tZ), MathHelper.abs_int(eZ - tZ)) / this.mDensity)) + == 0) + || (aRandom.nextInt( + Math.max( + 1, + Math.max(MathHelper.abs_int(cX - tX), MathHelper.abs_int(eX - tX)) + / this.mDensity)) + == 0))) { setOreBlock(aWorld, tX, tMinY - 1 + aRandom.nextInt(7), tZ, this.mSporadicMeta, false); } } @@ -244,13 +225,18 @@ public class GTPP_Worldgen_GT_Ore_Layer extends GTPP_Worldgen { if (mSetOre == null) { try { mSetOre = GT_TileEntity_Ores.class.getMethod( - "setOreBlock", World.class, int.class, int.class, int.class, int.class, boolean.class); + "setOreBlock", + World.class, + int.class, + int.class, + int.class, + int.class, + boolean.class); } catch (SecurityException | NoSuchMethodException e) { try { - mSetOre = GT_TileEntity_Ores.class.getMethod( - "setOreBlock", World.class, int.class, int.class, int.class, int.class); - } catch (SecurityException | NoSuchMethodException r) { - } + mSetOre = GT_TileEntity_Ores.class + .getMethod("setOreBlock", World.class, int.class, int.class, int.class, int.class); + } catch (SecurityException | NoSuchMethodException r) {} } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/world/GTPP_Worldgen_Handler.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/world/GTPP_Worldgen_Handler.java index b295d5be82..8ed90b799f 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/world/GTPP_Worldgen_Handler.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/world/GTPP_Worldgen_Handler.java @@ -28,17 +28,8 @@ public class GTPP_Worldgen_Handler implements Runnable { ore.aSporadic); } - private final GTPP_Worldgen_GT_Ore_Layer generateNewVein( - String mOreMixName, - int minY, - int maxY, - int weight, - int density, - int size, - Material aPrimary, - Material aSecondary, - Material aBetween, - Material aSporadic) { + private final GTPP_Worldgen_GT_Ore_Layer generateNewVein(String mOreMixName, int minY, int maxY, int weight, + int density, int size, Material aPrimary, Material aSecondary, Material aBetween, Material aSporadic) { return new GTPP_Worldgen_GT_Ore_Layer( "ore.mix." + mOreMixName, // String aName, true, // boolean aDefault, diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/world/GTPP_Worldgen_Ore.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/world/GTPP_Worldgen_Ore.java index e93a6c6d38..22b64d6cfc 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/world/GTPP_Worldgen_Ore.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/world/GTPP_Worldgen_Ore.java @@ -2,30 +2,23 @@ package gtPlusPlus.xmod.gregtech.api.world; import static gtPlusPlus.xmod.gregtech.HANDLER_GT.sCustomWorldgenFile; -import gtPlusPlus.xmod.gregtech.HANDLER_GT; import java.util.ArrayList; import java.util.Collection; + import net.minecraft.block.Block; +import gtPlusPlus.xmod.gregtech.HANDLER_GT; + public abstract class GTPP_Worldgen_Ore extends GTPP_Worldgen { + public final int mBlockMeta, mAmount, mSize, mMinY, mMaxY, mProbability, mDimensionType; public final Block mBlock; public final Collection<String> mBiomeList; public final boolean mAllowToGenerateinVoid; private final String aTextWorldgen = "worldgen."; - public GTPP_Worldgen_Ore( - String aName, - boolean aDefault, - Block aBlock, - int aBlockMeta, - int aDimensionType, - int aAmount, - int aSize, - int aProbability, - int aMinY, - int aMaxY, - Collection<String> aBiomeList, + public GTPP_Worldgen_Ore(String aName, boolean aDefault, Block aBlock, int aBlockMeta, int aDimensionType, + int aAmount, int aSize, int aProbability, int aMinY, int aMaxY, Collection<String> aBiomeList, boolean aAllowToGenerateinVoid) { super(aName, HANDLER_GT.sCustomWorldgenList, aDefault); mDimensionType = aDimensionType; diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/world/GTPP_Worldgen_Ore_Normal.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/world/GTPP_Worldgen_Ore_Normal.java index 3f0a6d48c9..b8113d5f86 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/world/GTPP_Worldgen_Ore_Normal.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/world/GTPP_Worldgen_Ore_Normal.java @@ -1,27 +1,20 @@ package gtPlusPlus.xmod.gregtech.api.world; -import gtPlusPlus.core.lib.CORE; import java.util.Collection; import java.util.Random; + import net.minecraft.block.Block; import net.minecraft.init.Blocks; import net.minecraft.util.MathHelper; import net.minecraft.world.World; import net.minecraft.world.chunk.IChunkProvider; +import gtPlusPlus.core.lib.CORE; + public class GTPP_Worldgen_Ore_Normal extends GTPP_Worldgen_Ore { - public GTPP_Worldgen_Ore_Normal( - String aName, - boolean aDefault, - Block aBlock, - int aBlockMeta, - int aDimensionType, - int aAmount, - int aSize, - int aProbability, - int aMinY, - int aMaxY, - Collection<String> aBiomeList, + + public GTPP_Worldgen_Ore_Normal(String aName, boolean aDefault, Block aBlock, int aBlockMeta, int aDimensionType, + int aAmount, int aSize, int aProbability, int aMinY, int aMaxY, Collection<String> aBiomeList, boolean aAllowToGenerateinVoid) { super( aName, @@ -39,21 +32,13 @@ public class GTPP_Worldgen_Ore_Normal extends GTPP_Worldgen_Ore { } @Override - public boolean executeWorldgen( - World aWorld, - Random aRandom, - String aBiome, - int aDimensionType, - int aChunkX, - int aChunkZ, - IChunkProvider aChunkGenerator, - IChunkProvider aChunkProvider) { + public boolean executeWorldgen(World aWorld, Random aRandom, String aBiome, int aDimensionType, int aChunkX, + int aChunkZ, IChunkProvider aChunkGenerator, IChunkProvider aChunkProvider) { if (isGenerationAllowed(aWorld, aDimensionType, mDimensionType) && (mBiomeList.isEmpty() || mBiomeList.contains(aBiome)) && (mProbability <= 1 || aRandom.nextInt(mProbability) == 0)) { for (int i = 0; i < mAmount; i++) { - int tX = aChunkX + aRandom.nextInt(16), - tY = mMinY + aRandom.nextInt(mMaxY - mMinY), + int tX = aChunkX + aRandom.nextInt(16), tY = mMinY + aRandom.nextInt(mMaxY - mMinY), tZ = aChunkZ + aRandom.nextInt(16); if (mAllowToGenerateinVoid || aWorld.getBlock(tX, tY, tZ).isAir(aWorld, tX, tY, tZ)) { float math_pi = CORE.PI; @@ -98,29 +83,26 @@ public class GTPP_Worldgen_Ore_Normal extends GTPP_Worldgen_Ore { for (int var44 = var34; var44 <= var37; ++var44) { float var45 = (var44 + 0.5F - var24) / (var28); Block block = aWorld.getBlock(var38, var41, var44); - if (var14b + var45 * var45 < 1.0F - && ((mAllowToGenerateinVoid - && aWorld.getBlock(var38, var41, var44) - .isAir(aWorld, var38, var41, var44)) - || (block != null - && (block.isReplaceableOreGen( - aWorld, - var38, - var41, - var44, - Blocks.stone) - || block.isReplaceableOreGen( - aWorld, - var38, - var41, - var44, - Blocks.end_stone) - || block.isReplaceableOreGen( - aWorld, - var38, - var41, - var44, - Blocks.netherrack))))) { + if (var14b + var45 * var45 < 1.0F && ((mAllowToGenerateinVoid && aWorld + .getBlock(var38, var41, var44).isAir(aWorld, var38, var41, var44)) + || (block != null && (block.isReplaceableOreGen( + aWorld, + var38, + var41, + var44, + Blocks.stone) + || block.isReplaceableOreGen( + aWorld, + var38, + var41, + var44, + Blocks.end_stone) + || block.isReplaceableOreGen( + aWorld, + var38, + var41, + var44, + Blocks.netherrack))))) { aWorld.setBlock(var38, var41, var44, mBlock, mBlockMeta, 0); } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/world/GT_OreVein_Object.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/world/GT_OreVein_Object.java index c6e9e6c92a..65813693b3 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/world/GT_OreVein_Object.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/world/GT_OreVein_Object.java @@ -14,17 +14,8 @@ public class GT_OreVein_Object { final Material aBetween; // Materials aBetween, final Material aSporadic; // Materials aSporadic - GT_OreVein_Object( - String mOreMixName, - int minY, - int maxY, - int weight, - int density, - int size, - Material aPrimary, - Material aSecondary, - Material aBetween, - Material aSporadic) { + GT_OreVein_Object(String mOreMixName, int minY, int maxY, int weight, int density, int size, Material aPrimary, + Material aSecondary, Material aBetween, Material aSporadic) { this.mOreMixName = mOreMixName; this.minY = minY; this.maxY = maxY; diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/world/WorldGenUtils.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/world/WorldGenUtils.java index 78f04269cf..5ca61cf4d7 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/world/WorldGenUtils.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/world/WorldGenUtils.java @@ -1,9 +1,10 @@ package gtPlusPlus.xmod.gregtech.api.world; -import gtPlusPlus.core.material.Material; import java.util.ArrayList; import java.util.List; +import gtPlusPlus.core.material.Material; + public class WorldGenUtils { static List<GT_OreVein_Object> mOresToRegister = new ArrayList<GT_OreVein_Object>(); @@ -12,19 +13,19 @@ public class WorldGenUtils { mOresToRegister.add(newVein); } - public static boolean generateNewOreVeinObject( - String mOreMixName, - int minY, - int maxY, - int weight, - int density, - int size, - Material aPrimary, - Material aSecondary, - Material aBetween, - Material aSporadic) { + public static boolean generateNewOreVeinObject(String mOreMixName, int minY, int maxY, int weight, int density, + int size, Material aPrimary, Material aSecondary, Material aBetween, Material aSporadic) { GT_OreVein_Object newVein = new GT_OreVein_Object( - mOreMixName, minY, maxY, weight, density, size, aPrimary, aSecondary, aBetween, aSporadic); + mOreMixName, + minY, + maxY, + weight, + density, + size, + aPrimary, + aSecondary, + aBetween, + aSporadic); addNewOreMixForWorldgen(newVein); return true; } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/Meta_GT_Proxy.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/Meta_GT_Proxy.java index 535b4b7169..2ae449e012 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/Meta_GT_Proxy.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/Meta_GT_Proxy.java @@ -1,5 +1,23 @@ package gtPlusPlus.xmod.gregtech.common; +import java.lang.reflect.Constructor; +import java.lang.reflect.Field; +import java.lang.reflect.InvocationTargetException; +import java.util.*; + +import net.minecraft.block.Block; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.EnumChatFormatting; +import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidRegistry; +import net.minecraftforge.fluids.FluidStack; + +import org.apache.commons.lang3.ArrayUtils; + import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.common.registry.LanguageRegistry; import cpw.mods.fml.relauncher.Side; @@ -27,21 +45,6 @@ import gtPlusPlus.xmod.gregtech.common.helpers.MachineUpdateHandler; import gtPlusPlus.xmod.gregtech.common.tileentities.machines.basic.GT_MetaTileEntity_WorldAccelerator; import ic2.core.init.BlocksItems; import ic2.core.init.InternalName; -import java.lang.reflect.Constructor; -import java.lang.reflect.Field; -import java.lang.reflect.InvocationTargetException; -import java.util.*; -import net.minecraft.block.Block; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.EnumChatFormatting; -import net.minecraftforge.fluids.Fluid; -import net.minecraftforge.fluids.FluidRegistry; -import net.minecraftforge.fluids.FluidStack; -import org.apache.commons.lang3.ArrayUtils; public class Meta_GT_Proxy { @@ -60,8 +63,7 @@ public class Meta_GT_Proxy { public static AchievementHandler mAssemblyAchievements; - public static final Map<String, FormattedTooltipString> mCustomGregtechMetaTooltips = - new LinkedHashMap<String, FormattedTooltipString>(); + public static final Map<String, FormattedTooltipString> mCustomGregtechMetaTooltips = new LinkedHashMap<String, FormattedTooltipString>(); /** * Does this feature exist within GT? Saves loading useless content if not. @@ -152,32 +154,13 @@ public class Meta_GT_Proxy { } } - String[] aLangs = new String[] { - "de_DE", "en_US", "en_GB", "en_IC", "es_AR", "es_ES", "es_MX", "es_UY", "es_VE", "fr_CA", "fr_FR", - "it_IT", "ko_KR", "pt_BR", "pt_PT", "ru_RU", "sv_SE", "tr_TR", "zh_CN", "zh_TW", - }; - String[] aLangValues = new String[] { - "Erhitztes Wasser", - "Heated Water", - "Heated Water", - "Heated Water", - "Agua caliente", - "Agua caliente", - "Agua caliente", - "Agua caliente", - "Agua caliente", - "Eau chauffée", - "Eau chauffée", - "Acqua riscaldata", - "온수", - "Água aquecida", - "Água aquecida", - "Вода с подогревом", - "Uppvärmt vatten", - "Isıtılmış Su", - "热水", - "热水", - }; + String[] aLangs = new String[] { "de_DE", "en_US", "en_GB", "en_IC", "es_AR", "es_ES", "es_MX", "es_UY", + "es_VE", "fr_CA", "fr_FR", "it_IT", "ko_KR", "pt_BR", "pt_PT", "ru_RU", "sv_SE", "tr_TR", "zh_CN", + "zh_TW", }; + String[] aLangValues = new String[] { "Erhitztes Wasser", "Heated Water", "Heated Water", "Heated Water", + "Agua caliente", "Agua caliente", "Agua caliente", "Agua caliente", "Agua caliente", "Eau chauffée", + "Eau chauffée", "Acqua riscaldata", "온수", "Água aquecida", "Água aquecida", "Вода с подогревом", + "Uppvärmt vatten", "Isıtılmış Su", "热水", "热水", }; for (int i = 0; i < aLangs.length; i++) { Logger.REFLECTION( "Trying to inject new lang data for " + aLangs[i] + ", using value: " + aLangValues[i]); @@ -248,9 +231,12 @@ public class Meta_GT_Proxy { // Skip this material if (aMoltenFluid == null || aPlasma == null || aPlasma.isFluidEqual(NULL_PLASMA)) { - Logger.INFO("Could not generate Advanced Vacuum Freezer recipe. Cooling " + s - + " plasma. Molten Form Exists? " + (aMoltenFluid != null) + " | Plasma Exists? " - + (aPlasma != null)); + Logger.INFO( + "Could not generate Advanced Vacuum Freezer recipe. Cooling " + s + + " plasma. Molten Form Exists? " + + (aMoltenFluid != null) + + " | Plasma Exists? " + + (aPlasma != null)); continue; } else { // Build a new plasma recipe @@ -260,9 +246,9 @@ public class Meta_GT_Proxy { new ItemStack[] {}, new ItemStack[] {}, null, - new int[] {10000}, - new FluidStack[] {aPlasma, FluidUtils.getFluidStack("cryotheum", aTotalTickTime)}, - new FluidStack[] {aMoltenFluid}, + new int[] { 10000 }, + new FluidStack[] { aPlasma, FluidUtils.getFluidStack("cryotheum", aTotalTickTime) }, + new FluidStack[] { aMoltenFluid }, aTotalTickTime, (int) GT_Values.V[4 + aAtomicTier], aAtomicMass); @@ -316,12 +302,8 @@ public class Meta_GT_Proxy { Constructor<?> g = BaseCustomTileEntity.class.getConstructors()[0]; g.setAccessible(true); return (BaseCustomTileEntity) g.newInstance(); - } catch (InstantiationException - | IllegalAccessException - | IllegalArgumentException - | InvocationTargetException - | SecurityException e) { - } + } catch (InstantiationException | IllegalAccessException | IllegalArgumentException + | InvocationTargetException | SecurityException e) {} } } try { @@ -332,13 +314,10 @@ public class Meta_GT_Proxy { Constructor<?> g = BaseCustomTileEntity.class.getConstructors()[0]; g.setAccessible(true); return (BaseCustomTileEntity) g.newInstance(); - } catch (InstantiationException - | IllegalAccessException - | IllegalArgumentException - | InvocationTargetException - | SecurityException e) { - GT_Log.err.println( - "GT++ Mod: Fatal Error ocurred while initializing TileEntities, crashing Minecraft."); + } catch (InstantiationException | IllegalAccessException | IllegalArgumentException + | InvocationTargetException | SecurityException e) { + GT_Log.err + .println("GT++ Mod: Fatal Error ocurred while initializing TileEntities, crashing Minecraft."); e.printStackTrace(GT_Log.err); CORE.crash( "GT++ Mod: Fatal Error ocurred while initializing custom BaseMetaTileEntities, crashing Minecraft."); @@ -357,11 +336,8 @@ public class Meta_GT_Proxy { Constructor<?> g = BaseCustomPower_MTE.class.getConstructors()[0]; g.setAccessible(true); return (BaseCustomPower_MTE) g.newInstance(); - } catch (InstantiationException - | IllegalAccessException - | IllegalArgumentException - | InvocationTargetException - | SecurityException e) { + } catch (InstantiationException | IllegalAccessException | IllegalArgumentException + | InvocationTargetException | SecurityException e) { // e.printStackTrace(); } } @@ -375,13 +351,10 @@ public class Meta_GT_Proxy { Constructor<?> g = BaseCustomPower_MTE.class.getConstructors()[0]; g.setAccessible(true); return (BaseCustomPower_MTE) g.newInstance(); - } catch (InstantiationException - | IllegalAccessException - | IllegalArgumentException - | InvocationTargetException - | SecurityException e) { - GT_Log.err.println( - "GT++ Mod: Fatal Error ocurred while initializing TileEntities, crashing Minecraft."); + } catch (InstantiationException | IllegalAccessException | IllegalArgumentException + | InvocationTargetException | SecurityException e) { + GT_Log.err + .println("GT++ Mod: Fatal Error ocurred while initializing TileEntities, crashing Minecraft."); e.printStackTrace(GT_Log.err); CORE.crash( "GT++ Mod: Fatal Error ocurred while initializing custom BaseMetaTileEntities, crashing Minecraft."); @@ -410,8 +383,8 @@ public class Meta_GT_Proxy { } } } else { - GT_MetaTileEntity_WorldAccelerator.BlacklistedTileEntiyClassNames = - ArrayUtils.add(GT_MetaTileEntity_WorldAccelerator.BlacklistedTileEntiyClassNames, aClassName); + GT_MetaTileEntity_WorldAccelerator.BlacklistedTileEntiyClassNames = ArrayUtils + .add(GT_MetaTileEntity_WorldAccelerator.BlacklistedTileEntiyClassNames, aClassName); return true; } return false; @@ -452,8 +425,8 @@ public class Meta_GT_Proxy { mCustomGregtechMetaTooltips.put(aNbtTagName, aData); } - public static void conStructGtTileBlockTooltip( - ItemStack aStack, EntityPlayer aPlayer, List<Object> aList, boolean par4) { + public static void conStructGtTileBlockTooltip(ItemStack aStack, EntityPlayer aPlayer, List<Object> aList, + boolean par4) { try { int tDamage = aStack.getItemDamage(); if ((tDamage <= 0) || (tDamage >= GregTech_API.METATILEENTITIES.length)) { @@ -471,18 +444,18 @@ public class Meta_GT_Proxy { if (tString.length >= 2) { StringBuffer tBuffer = new StringBuffer(); Object tRep[] = new String[tString.length / 2]; - for (int j = 0; j < tString.length; j++) - if (j % 2 == 0) tBuffer.append(tString[j]); - else { - tBuffer.append(" %s"); - tRep[j / 2] = tString[j]; - } - aList.add(String.format( - GT_LanguageManager.addStringLocalization( - "TileEntity_DESCRIPTION_" + tDamage + "_Index_" + i++, - tBuffer.toString(), - !GregTech_API.sPostloadFinished), - tRep)); + for (int j = 0; j < tString.length; j++) if (j % 2 == 0) tBuffer.append(tString[j]); + else { + tBuffer.append(" %s"); + tRep[j / 2] = tString[j]; + } + aList.add( + String.format( + GT_LanguageManager.addStringLocalization( + "TileEntity_DESCRIPTION_" + tDamage + "_Index_" + i++, + tBuffer.toString(), + !GregTech_API.sPostloadFinished), + tRep)); } } else { String tTranslated = GT_LanguageManager.addStringLocalization( @@ -506,26 +479,37 @@ public class Meta_GT_Proxy { if ((aOffset) <= 10) { tTier -= 2; aList.add(EnumChatFormatting.BOLD + "16" + " Fuse Slots" + EnumChatFormatting.GRAY); - aList.add("Per each fuse, you may insert " + EnumChatFormatting.YELLOW - + (GT_Values.V[tTier]) + EnumChatFormatting.GRAY + " EU/t"); - aList.add("However this " + EnumChatFormatting.ITALIC + EnumChatFormatting.RED + "MUST" - + EnumChatFormatting.GRAY + " be in a single Amp"); - aList.add("This machine can accept upto a single amp of " - + GT_Values.VN[Math.min(tTier + 2, 12)] + " as a result"); - aList.add(GT_LanguageManager.addStringLocalization( + aList.add( + "Per each fuse, you may insert " + EnumChatFormatting.YELLOW + + (GT_Values.V[tTier]) + + EnumChatFormatting.GRAY + + " EU/t"); + aList.add( + "However this " + EnumChatFormatting.ITALIC + + EnumChatFormatting.RED + + "MUST" + + EnumChatFormatting.GRAY + + " be in a single Amp"); + aList.add( + "This machine can accept upto a single amp of " + + GT_Values.VN[Math.min(tTier + 2, 12)] + + " as a result"); + aList.add( + GT_LanguageManager.addStringLocalization( "TileEntity_Breaker_Loss", - "Breaker Loss: " + EnumChatFormatting.RED + "" + "Breaker Loss: " + EnumChatFormatting.RED + + "" + (GT_Values.V[Math.max(tTier - 1, 0)] / 10) - + EnumChatFormatting.GRAY + " EU/t", - !GregTech_API.sPostloadFinished) - + EnumChatFormatting.GRAY); + + EnumChatFormatting.GRAY + + " EU/t", + !GregTech_API.sPostloadFinished) + EnumChatFormatting.GRAY); } - aList.add(GT_LanguageManager.addStringLocalization( + aList.add( + GT_LanguageManager.addStringLocalization( "TileEntity_Special_Power_1", EnumChatFormatting.RED + "Special Power Handling, please read manual", - !GregTech_API.sPostloadFinished) - + EnumChatFormatting.GRAY); + !GregTech_API.sPostloadFinished) + EnumChatFormatting.GRAY); // aList.add(GT_LanguageManager.addStringLocalization("TileEntity_BreakerBox_2", // EnumChatFormatting.RED+"Special Power Handling, please read manual", // !GregTech_API.sPostloadFinished) + EnumChatFormatting.GRAY); @@ -537,92 +521,126 @@ public class Meta_GT_Proxy { if (tTileEntity.getInputVoltage() > 0L) { String inA = "0"; if (tTileEntity.getInputAmperage() >= 1L) { - inA = " at " + EnumChatFormatting.YELLOW + tTileEntity.getInputAmperage() - + EnumChatFormatting.GRAY + " Amps"; + inA = " at " + EnumChatFormatting.YELLOW + + tTileEntity.getInputAmperage() + + EnumChatFormatting.GRAY + + " Amps"; } else { - inA = " at " + EnumChatFormatting.WHITE + tTileEntity.getInputAmperage() - + EnumChatFormatting.GRAY + " Amps"; + inA = " at " + EnumChatFormatting.WHITE + + tTileEntity.getInputAmperage() + + EnumChatFormatting.GRAY + + " Amps"; } - String a1 = "Voltage IN: " + EnumChatFormatting.GREEN + tTileEntity.getInputVoltage() - + " (" + GT_Values.VN[GT_Utility.getTier(tTileEntity.getInputVoltage())] + ")" - + EnumChatFormatting.GRAY + inA; + String a1 = "Voltage IN: " + EnumChatFormatting.GREEN + + tTileEntity.getInputVoltage() + + " (" + + GT_Values.VN[GT_Utility.getTier(tTileEntity.getInputVoltage())] + + ")" + + EnumChatFormatting.GRAY + + inA; aList.add(a1); } if (tTileEntity.getOutputVoltage() > 0L) { String outA = "0"; if (tTileEntity.getOutputAmperage() >= 1L) { - outA = " at " + EnumChatFormatting.YELLOW + tTileEntity.getOutputAmperage() - + EnumChatFormatting.GRAY + " Amps"; + outA = " at " + EnumChatFormatting.YELLOW + + tTileEntity.getOutputAmperage() + + EnumChatFormatting.GRAY + + " Amps"; } else { - outA = " at " + EnumChatFormatting.WHITE + tTileEntity.getOutputAmperage() - + EnumChatFormatting.GRAY + " Amps"; + outA = " at " + EnumChatFormatting.WHITE + + tTileEntity.getOutputAmperage() + + EnumChatFormatting.GRAY + + " Amps"; } - String a1 = "Voltage OUT: " + EnumChatFormatting.GREEN + tTileEntity.getOutputVoltage() - + " (" + GT_Values.VN[GT_Utility.getTier(tTileEntity.getOutputVoltage())] + ")" - + EnumChatFormatting.GRAY + outA; + String a1 = "Voltage OUT: " + EnumChatFormatting.GREEN + + tTileEntity.getOutputVoltage() + + " (" + + GT_Values.VN[GT_Utility.getTier(tTileEntity.getOutputVoltage())] + + ")" + + EnumChatFormatting.GRAY + + outA; aList.add(a1); } if (tTileEntity.getOutputVoltage() > 0L) { - aList.add(GT_LanguageManager.addStringLocalization( + aList.add( + GT_LanguageManager.addStringLocalization( "TileEntity_Lossess_EU", - "Transmission Loss: " + EnumChatFormatting.DARK_BLUE + "" + "Transmission Loss: " + EnumChatFormatting.DARK_BLUE + + "" + (tDamage < 30500 && tDamage >= 30400 ? 0 : 1), - !GregTech_API.sPostloadFinished) - + EnumChatFormatting.GRAY); + !GregTech_API.sPostloadFinished) + EnumChatFormatting.GRAY); } if (tTileEntity.getEUCapacity() > 0) { - aList.add(GT_LanguageManager.addStringLocalization( - "TileEntity_EUp_STORE2", "Internal Capacity: ", !GregTech_API.sPostloadFinished) - + EnumChatFormatting.BLUE - + tTileEntity.getEUCapacity() + EnumChatFormatting.GRAY + " EU"); + aList.add( + GT_LanguageManager.addStringLocalization( + "TileEntity_EUp_STORE2", + "Internal Capacity: ", + !GregTech_API.sPostloadFinished) + EnumChatFormatting.BLUE + + tTileEntity.getEUCapacity() + + EnumChatFormatting.GRAY + + " EU"); } } - /*if (tTileEntity.getEUCapacity() > 0L) { - if (tTileEntity.getInputVoltage() > 0L) { - aList.add(GT_LanguageManager.addStringLocalization("TileEntity_EUp_IN", "Voltage IN: ", !GregTech_API.sPostloadFinished ) + EnumChatFormatting.GREEN + tTileEntity.getInputVoltage() + " (" + GT_Values.VN[GT_Utility.getTier(tTileEntity.getInputVoltage())] + ")" + EnumChatFormatting.GRAY); - } - if (tTileEntity.getOutputVoltage() > 0L) { - aList.add(GT_LanguageManager.addStringLocalization("TileEntity_EUp_OUT", "Voltage OUT: ", !GregTech_API.sPostloadFinished ) + EnumChatFormatting.GREEN + tTileEntity.getOutputVoltage() + " (" + GT_Values.VN[GT_Utility.getTier(tTileEntity.getOutputVoltage())] + ")" + EnumChatFormatting.GRAY); - } - if (tTileEntity.getOutputAmperage() > 1L) { - aList.add(GT_LanguageManager.addStringLocalization("TileEntity_EUp_AMOUNT", "Amperage: ", !GregTech_API.sPostloadFinished ) + EnumChatFormatting.YELLOW + tTileEntity.getOutputAmperage() + EnumChatFormatting.GRAY); - } - aList.add(GT_LanguageManager.addStringLocalization("TileEntity_EUp_STORE", "Capacity: ", !GregTech_API.sPostloadFinished ) + EnumChatFormatting.BLUE + tTileEntity.getEUCapacity() + EnumChatFormatting.GRAY); - }*/ + /* + * if (tTileEntity.getEUCapacity() > 0L) { if (tTileEntity.getInputVoltage() > 0L) { + * aList.add(GT_LanguageManager.addStringLocalization("TileEntity_EUp_IN", "Voltage IN: ", + * !GregTech_API.sPostloadFinished ) + EnumChatFormatting.GREEN + tTileEntity.getInputVoltage() + " (" + + * GT_Values.VN[GT_Utility.getTier(tTileEntity.getInputVoltage())] + ")" + EnumChatFormatting.GRAY); } + * if (tTileEntity.getOutputVoltage() > 0L) { + * aList.add(GT_LanguageManager.addStringLocalization("TileEntity_EUp_OUT", "Voltage OUT: ", + * !GregTech_API.sPostloadFinished ) + EnumChatFormatting.GREEN + tTileEntity.getOutputVoltage() + " (" + * + GT_Values.VN[GT_Utility.getTier(tTileEntity.getOutputVoltage())] + ")" + EnumChatFormatting.GRAY); + * } if (tTileEntity.getOutputAmperage() > 1L) { + * aList.add(GT_LanguageManager.addStringLocalization("TileEntity_EUp_AMOUNT", "Amperage: ", + * !GregTech_API.sPostloadFinished ) + EnumChatFormatting.YELLOW + tTileEntity.getOutputAmperage() + + * EnumChatFormatting.GRAY); } + * aList.add(GT_LanguageManager.addStringLocalization("TileEntity_EUp_STORE", "Capacity: ", + * !GregTech_API.sPostloadFinished ) + EnumChatFormatting.BLUE + tTileEntity.getEUCapacity() + + * EnumChatFormatting.GRAY); } + */ } NBTTagCompound aNBT = aStack.getTagCompound(); if (aNBT != null) { if (aNBT.getBoolean("mMuffler")) { - aList.add(GT_LanguageManager.addStringLocalization( - "GT_TileEntity_MUFFLER", "has Muffler Upgrade", !GregTech_API.sPostloadFinished)); + aList.add( + GT_LanguageManager.addStringLocalization( + "GT_TileEntity_MUFFLER", + "has Muffler Upgrade", + !GregTech_API.sPostloadFinished)); } if (aNBT.getBoolean("mSteamConverter")) { - aList.add(GT_LanguageManager.addStringLocalization( - "GT_TileEntity_STEAMCONVERTER", "has Steam Upgrade", !GregTech_API.sPostloadFinished)); + aList.add( + GT_LanguageManager.addStringLocalization( + "GT_TileEntity_STEAMCONVERTER", + "has Steam Upgrade", + !GregTech_API.sPostloadFinished)); } int tAmount = 0; if ((tAmount = aNBT.getByte("mSteamTanks")) > 0) { - aList.add(tAmount + " " - + GT_LanguageManager.addStringLocalization( - "GT_TileEntity_STEAMTANKS", - "Steam Tank Upgrades", - !GregTech_API.sPostloadFinished)); + aList.add( + tAmount + " " + + GT_LanguageManager.addStringLocalization( + "GT_TileEntity_STEAMTANKS", + "Steam Tank Upgrades", + !GregTech_API.sPostloadFinished)); } - FluidStack afluid = - net.minecraftforge.fluids.FluidStack.loadFluidStackFromNBT(aNBT.getCompoundTag("mFluid")); + FluidStack afluid = net.minecraftforge.fluids.FluidStack + .loadFluidStackFromNBT(aNBT.getCompoundTag("mFluid")); if (afluid != null) { int tFluidAmount = afluid.amount; if (tFluidAmount > 0) { - aList.add(GT_LanguageManager.addStringLocalization( - "GT_TileEntity_FLUIDTANK", - "Tank Fluid: " + tFluidAmount + "L " + afluid.getLocalizedName() + "", - !GregTech_API.sPostloadFinished)); + aList.add( + GT_LanguageManager.addStringLocalization( + "GT_TileEntity_FLUIDTANK", + "Tank Fluid: " + tFluidAmount + "L " + afluid.getLocalizedName() + "", + !GregTech_API.sPostloadFinished)); } } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/StaticFields59.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/StaticFields59.java index 0f98d8ab55..502674fb18 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/StaticFields59.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/StaticFields59.java @@ -1,5 +1,17 @@ package gtPlusPlus.xmod.gregtech.common; +import java.lang.reflect.Field; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.util.ArrayList; +import java.util.Collection; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; + +import net.minecraft.block.Block; +import net.minecraft.item.ItemStack; + import gregtech.GT_Mod; import gregtech.api.GregTech_API; import gregtech.api.enums.Materials; @@ -17,16 +29,6 @@ import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.reflect.ProxyFinder; import gtPlusPlus.core.util.reflect.ReflectionUtils; -import java.lang.reflect.Field; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; -import java.util.ArrayList; -import java.util.Collection; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; -import net.minecraft.block.Block; -import net.minecraft.item.ItemStack; public class StaticFields59 { @@ -88,14 +90,19 @@ public class StaticFields59 { mPyrolyseRecipes = null; } - mCalculatePollutionReduction = - getMethod(GT_MetaTileEntity_Hatch_Muffler.class, "calculatePollutionReduction", int.class); + mCalculatePollutionReduction = getMethod( + GT_MetaTileEntity_Hatch_Muffler.class, + "calculatePollutionReduction", + int.class); Logger.INFO("[SH] Got Method: calculatePollutionReduction"); // Yep... if (!CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK) { mAddFurnaceRecipe = getMethod( - GT_ModHandler.class, "addSmeltingAndAlloySmeltingRecipe", ItemStack.class, ItemStack.class); + GT_ModHandler.class, + "addSmeltingAndAlloySmeltingRecipe", + ItemStack.class, + ItemStack.class); Logger.INFO("[SH] Got Method: addSmeltingAndAlloySmeltingRecipe"); } else { mAddFurnaceRecipe = getMethod( @@ -182,7 +189,7 @@ public class StaticFields59 { try { return (String[]) mDescriptionArray.get(aTile); } catch (IllegalArgumentException | IllegalAccessException e) { - return new String[] {aTile.mDescription}; + return new String[] { aTile.mDescription }; } } @@ -211,8 +218,7 @@ public class StaticFields59 { proxyGT = Meta_GT_Proxy.mProxies[1]; } else { try { - proxyGT = (client - ? ProxyFinder.getClientProxy(GT_Mod.instance) + proxyGT = (client ? ProxyFinder.getClientProxy(GT_Mod.instance) : ProxyFinder.getServerProxy(GT_Mod.instance)); } catch (final ReflectiveOperationException e1) { proxyGT = null; @@ -228,8 +234,7 @@ public class StaticFields59 { if (proxyGT != null && proxyGT instanceof GT_Proxy) { try { return ReflectionUtils.getField(proxyGT.getClass(), fieldName).get(proxyGT); - } catch (IllegalArgumentException | IllegalAccessException e) { - } + } catch (IllegalArgumentException | IllegalAccessException e) {} } return null; } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GTPP_Block_Machines.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GTPP_Block_Machines.java index 83cbc0065c..a408663ee0 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GTPP_Block_Machines.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GTPP_Block_Machines.java @@ -1,24 +1,8 @@ package gtPlusPlus.xmod.gregtech.common.blocks; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import gregtech.api.GregTech_API; -import gregtech.api.enums.Textures.BlockIcons; -import gregtech.api.interfaces.IDebugableBlock; -import gregtech.api.interfaces.tileentity.ICoverable; -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gregtech.api.items.GT_Generic_Block; -import gregtech.api.metatileentity.BaseMetaPipeEntity; -import gregtech.api.metatileentity.BaseMetaTileEntity; -import gregtech.api.metatileentity.BaseTileEntity; -import gregtech.api.util.GT_Utility; -import gregtech.common.blocks.GT_Material_Machines; -import gtPlusPlus.api.objects.Logger; -import gtPlusPlus.api.objects.random.XSTR; -import gtPlusPlus.xmod.gregtech.common.Meta_GT_Proxy; -import gtPlusPlus.xmod.gregtech.common.render.GTPP_Render_MachineBlock; import java.util.ArrayList; import java.util.List; + import net.minecraft.block.Block; import net.minecraft.block.ITileEntityProvider; import net.minecraft.client.renderer.texture.IIconRegister; @@ -41,7 +25,26 @@ import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import gregtech.api.GregTech_API; +import gregtech.api.enums.Textures.BlockIcons; +import gregtech.api.interfaces.IDebugableBlock; +import gregtech.api.interfaces.tileentity.ICoverable; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.items.GT_Generic_Block; +import gregtech.api.metatileentity.BaseMetaPipeEntity; +import gregtech.api.metatileentity.BaseMetaTileEntity; +import gregtech.api.metatileentity.BaseTileEntity; +import gregtech.api.util.GT_Utility; +import gregtech.common.blocks.GT_Material_Machines; +import gtPlusPlus.api.objects.Logger; +import gtPlusPlus.api.objects.random.XSTR; +import gtPlusPlus.xmod.gregtech.common.Meta_GT_Proxy; +import gtPlusPlus.xmod.gregtech.common.render.GTPP_Render_MachineBlock; + public class GTPP_Block_Machines extends GT_Generic_Block implements IDebugableBlock, ITileEntityProvider { + public static ThreadLocal<IGregTechTileEntity> mTemporaryTileEntity = new ThreadLocal<IGregTechTileEntity>(); public GTPP_Block_Machines() { @@ -104,8 +107,7 @@ public class GTPP_Block_Machines extends GT_Generic_Block implements IDebugableB } public String getLocalizedName() { - String aName = StatCollector.translateToLocal(this.getUnlocalizedName() + ".name"); - ; + String aName = StatCollector.translateToLocal(this.getUnlocalizedName() + ".name");; if (aName.toLowerCase().contains(".name")) { aName = StatCollector.translateToLocal(getUnlocalizedName() + ".name"); } @@ -128,8 +130,7 @@ public class GTPP_Block_Machines extends GT_Generic_Block implements IDebugableB } public int getRenderType() { - return GTPP_Render_MachineBlock.INSTANCE == null - ? super.getRenderType() + return GTPP_Render_MachineBlock.INSTANCE == null ? super.getRenderType() : GTPP_Render_MachineBlock.INSTANCE.mRenderID; } @@ -195,8 +196,8 @@ public class GTPP_Block_Machines extends GT_Generic_Block implements IDebugableB return tTileEntity != null ? tTileEntity.receiveClientEvent(aData1, aData2) : false; } - public void addCollisionBoxesToList( - World aWorld, int aX, int aY, int aZ, AxisAlignedBB inputAABB, List outputAABB, Entity collider) { + public void addCollisionBoxesToList(World aWorld, int aX, int aY, int aZ, AxisAlignedBB inputAABB, List outputAABB, + Entity collider) { TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); if (tTileEntity instanceof IGregTechTileEntity && ((IGregTechTileEntity) tTileEntity).getMetaTileEntity() != null) { @@ -210,18 +211,18 @@ public class GTPP_Block_Machines extends GT_Generic_Block implements IDebugableB public AxisAlignedBB getCollisionBoundingBoxFromPool(World aWorld, int aX, int aY, int aZ) { TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); return tTileEntity instanceof IGregTechTileEntity - && ((IGregTechTileEntity) tTileEntity).getMetaTileEntity() != null - ? ((IGregTechTileEntity) tTileEntity).getCollisionBoundingBoxFromPool(aWorld, aX, aY, aZ) - : super.getCollisionBoundingBoxFromPool(aWorld, aX, aY, aZ); + && ((IGregTechTileEntity) tTileEntity).getMetaTileEntity() != null + ? ((IGregTechTileEntity) tTileEntity).getCollisionBoundingBoxFromPool(aWorld, aX, aY, aZ) + : super.getCollisionBoundingBoxFromPool(aWorld, aX, aY, aZ); } @SideOnly(Side.CLIENT) public AxisAlignedBB getSelectedBoundingBoxFromPool(World aWorld, int aX, int aY, int aZ) { TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); return tTileEntity instanceof IGregTechTileEntity - && ((IGregTechTileEntity) tTileEntity).getMetaTileEntity() != null - ? ((IGregTechTileEntity) tTileEntity).getCollisionBoundingBoxFromPool(aWorld, aX, aY, aZ) - : super.getSelectedBoundingBoxFromPool(aWorld, aX, aY, aZ); + && ((IGregTechTileEntity) tTileEntity).getMetaTileEntity() != null + ? ((IGregTechTileEntity) tTileEntity).getCollisionBoundingBoxFromPool(aWorld, aX, aY, aZ) + : super.getSelectedBoundingBoxFromPool(aWorld, aX, aY, aZ); } public void setBlockBoundsBasedOnState(IBlockAccess blockAccess, int aX, int aY, int aZ) { @@ -264,15 +265,13 @@ public class GTPP_Block_Machines extends GT_Generic_Block implements IDebugableB public float getPlayerRelativeBlockHardness(EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ) { TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); - return tTileEntity instanceof BaseMetaTileEntity - && ((BaseMetaTileEntity) tTileEntity).privateAccess() - && !((BaseMetaTileEntity) tTileEntity).playerOwnsThis(aPlayer, true) - ? -1.0F - : super.getPlayerRelativeBlockHardness(aPlayer, aWorld, aX, aY, aZ); + return tTileEntity instanceof BaseMetaTileEntity && ((BaseMetaTileEntity) tTileEntity).privateAccess() + && !((BaseMetaTileEntity) tTileEntity).playerOwnsThis(aPlayer, true) ? -1.0F + : super.getPlayerRelativeBlockHardness(aPlayer, aWorld, aX, aY, aZ); } - public boolean onBlockActivated( - World aWorld, int aX, int aY, int aZ, EntityPlayer aPlayer, int aSide, float par1, float par2, float par3) { + public boolean onBlockActivated(World aWorld, int aX, int aY, int aZ, EntityPlayer aPlayer, int aSide, float par1, + float par2, float par3) { TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); if (tTileEntity == null) { return false; @@ -289,13 +288,11 @@ public class GTPP_Block_Machines extends GT_Generic_Block implements IDebugableB } } - return tTileEntity instanceof IGregTechTileEntity - ? (((IGregTechTileEntity) tTileEntity).getTimer() < 50L - ? false - : (!aWorld.isRemote && !((IGregTechTileEntity) tTileEntity).isUseableByPlayer(aPlayer) - ? true - : ((IGregTechTileEntity) tTileEntity) - .onRightclick(aPlayer, (byte) aSide, par1, par2, par3))) + return tTileEntity instanceof IGregTechTileEntity ? (((IGregTechTileEntity) tTileEntity).getTimer() < 50L + ? false + : (!aWorld.isRemote && !((IGregTechTileEntity) tTileEntity).isUseableByPlayer(aPlayer) ? true + : ((IGregTechTileEntity) tTileEntity) + .onRightclick(aPlayer, (byte) aSide, par1, par2, par3))) : false; } } @@ -339,8 +336,7 @@ public class GTPP_Block_Machines extends GT_Generic_Block implements IDebugableB (double) ((float) aZ + tRandom.nextFloat() * 0.8F + 0.1F), new ItemStack(tItem.getItem(), tItem.stackSize, tItem.getItemDamage())); if (tItem.hasTagCompound()) { - tItemEntity.getEntityItem().setTagCompound((NBTTagCompound) - tItem.getTagCompound().copy()); + tItemEntity.getEntityItem().setTagCompound((NBTTagCompound) tItem.getTagCompound().copy()); } tItemEntity.motionX = tRandom.nextGaussian() * 0.0500000007450581D; @@ -359,10 +355,8 @@ public class GTPP_Block_Machines extends GT_Generic_Block implements IDebugableB public ArrayList<ItemStack> getDrops(World aWorld, int aX, int aY, int aZ, int aMeta, int aFortune) { TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); - return tTileEntity instanceof IGregTechTileEntity - ? ((IGregTechTileEntity) tTileEntity).getDrops() - : (mTemporaryTileEntity.get() == null - ? new ArrayList() + return tTileEntity instanceof IGregTechTileEntity ? ((IGregTechTileEntity) tTileEntity).getDrops() + : (mTemporaryTileEntity.get() == null ? new ArrayList() : ((IGregTechTileEntity) mTemporaryTileEntity.get()).getDrops()); } @@ -436,10 +430,8 @@ public class GTPP_Block_Machines extends GT_Generic_Block implements IDebugableB public int getLightOpacity(IBlockAccess aWorld, int aX, int aY, int aZ) { TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); - return tTileEntity == null - ? 0 - : (tTileEntity instanceof IGregTechTileEntity - ? ((IGregTechTileEntity) tTileEntity).getLightOpacity() + return tTileEntity == null ? 0 + : (tTileEntity instanceof IGregTechTileEntity ? ((IGregTechTileEntity) tTileEntity).getLightOpacity() : (aWorld.getBlockMetadata(aX, aY, aZ) == 0 ? 255 : 0)); } @@ -449,21 +441,12 @@ public class GTPP_Block_Machines extends GT_Generic_Block implements IDebugableB } public TileEntity createTileEntity(World aWorld, int aMeta) { - return (TileEntity) - (aMeta >= 4 - ? Meta_GT_Proxy.constructBaseMetaTileEntity() - : Meta_GT_Proxy.constructBaseMetaTileEntityCustomPower()); - } - - public float getExplosionResistance( - Entity par1Entity, - World aWorld, - int aX, - int aY, - int aZ, - double explosionX, - double explosionY, - double explosionZ) { + return (TileEntity) (aMeta >= 4 ? Meta_GT_Proxy.constructBaseMetaTileEntity() + : Meta_GT_Proxy.constructBaseMetaTileEntityCustomPower()); + } + + public float getExplosionResistance(Entity par1Entity, World aWorld, int aX, int aY, int aZ, double explosionX, + double explosionY, double explosionZ) { TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); return tTileEntity instanceof IGregTechTileEntity ? ((IGregTechTileEntity) tTileEntity).getBlastResistance((byte) 6) diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GTPP_Item_Machines.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GTPP_Item_Machines.java index 9e732d2443..0a4c5bd4a4 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GTPP_Item_Machines.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GTPP_Item_Machines.java @@ -1,14 +1,7 @@ package gtPlusPlus.xmod.gregtech.common.blocks; -import gregtech.api.GregTech_API; -import gregtech.api.enums.GT_Values; -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gregtech.api.util.GT_ItsNotMyFaultException; -import gregtech.api.util.GT_LanguageManager; -import gregtech.api.util.GT_Log; -import gregtech.api.util.GT_Utility; -import gtPlusPlus.api.objects.Logger; import java.util.List; + import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemBlock; @@ -17,7 +10,17 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumChatFormatting; import net.minecraft.world.World; +import gregtech.api.GregTech_API; +import gregtech.api.enums.GT_Values; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.util.GT_ItsNotMyFaultException; +import gregtech.api.util.GT_LanguageManager; +import gregtech.api.util.GT_Log; +import gregtech.api.util.GT_Utility; +import gtPlusPlus.api.objects.Logger; + public class GTPP_Item_Machines extends ItemBlock { + public GTPP_Item_Machines(Block par1) { super(par1); this.setMaxDamage(0); @@ -40,33 +43,12 @@ public class GTPP_Item_Machines extends ItemBlock { final long tVoltage = aNBT.getInputVoltage(); byte tTier = (byte) ((byte) Math.max(1, GT_Utility.getTier(tVoltage))); - /*if (aNBT.getDescription() != null) { - int tAmount = 0; - String[] arg7 = aNBT.getDescription(); - int arg8 = arg7.length-1; - - if (arg7 != null && arg7.length > 0) { - for (String t : arg7) { - aList.add(t); - } - - } - else { - aList.add("ERROR"); - } - - for (int y = 0; y < arg8; y++) { - String tDescription = arg7[y]; - - if (tDescription != null) { - aList.add(tDescription+"|"+arg8); - continue; - } - else { - continue; - } - } - }*/ + /* + * if (aNBT.getDescription() != null) { int tAmount = 0; String[] arg7 = aNBT.getDescription(); int arg8 + * = arg7.length-1; if (arg7 != null && arg7.length > 0) { for (String t : arg7) { aList.add(t); } } + * else { aList.add("ERROR"); } for (int y = 0; y < arg8; y++) { String tDescription = arg7[y]; if + * (tDescription != null) { aList.add(tDescription+"|"+arg8); continue; } else { continue; } } } + */ if (aNBT.getEUCapacity() > 0L) { @@ -76,26 +58,37 @@ public class GTPP_Item_Machines extends ItemBlock { if ((e - 30400) <= 10) { tTier -= 2; aList.add(EnumChatFormatting.BOLD + "16" + " Fuse Slots" + EnumChatFormatting.GRAY); - aList.add("Per each fuse, you may insert " + EnumChatFormatting.YELLOW - + (GT_Values.V[tTier]) + EnumChatFormatting.GRAY + " EU/t"); - aList.add("However this " + EnumChatFormatting.ITALIC + EnumChatFormatting.RED + "MUST" - + EnumChatFormatting.GRAY + " be in a single Amp"); - aList.add("This machine can accept upto a single amp of " - + GT_Values.VN[Math.min(tTier + 2, 12)] + " as a result"); - aList.add(GT_LanguageManager.addStringLocalization( + aList.add( + "Per each fuse, you may insert " + EnumChatFormatting.YELLOW + + (GT_Values.V[tTier]) + + EnumChatFormatting.GRAY + + " EU/t"); + aList.add( + "However this " + EnumChatFormatting.ITALIC + + EnumChatFormatting.RED + + "MUST" + + EnumChatFormatting.GRAY + + " be in a single Amp"); + aList.add( + "This machine can accept upto a single amp of " + + GT_Values.VN[Math.min(tTier + 2, 12)] + + " as a result"); + aList.add( + GT_LanguageManager.addStringLocalization( "TileEntity_Breaker_Loss", - "Breaker Loss: " + EnumChatFormatting.RED + "" + "Breaker Loss: " + EnumChatFormatting.RED + + "" + (GT_Values.V[Math.max(tTier - 1, 0)] / 10) - + EnumChatFormatting.GRAY + " EU/t", - !GregTech_API.sPostloadFinished) - + EnumChatFormatting.GRAY); + + EnumChatFormatting.GRAY + + " EU/t", + !GregTech_API.sPostloadFinished) + EnumChatFormatting.GRAY); } - aList.add(GT_LanguageManager.addStringLocalization( + aList.add( + GT_LanguageManager.addStringLocalization( "TileEntity_Special_Power_1", EnumChatFormatting.RED + "Special Power Handling, please read manual", - !GregTech_API.sPostloadFinished) - + EnumChatFormatting.GRAY); + !GregTech_API.sPostloadFinished) + EnumChatFormatting.GRAY); // aList.add(GT_LanguageManager.addStringLocalization("TileEntity_BreakerBox_2", // EnumChatFormatting.RED+"Special Power Handling, please read manual", // !GregTech_API.sPostloadFinished) + EnumChatFormatting.GRAY); @@ -107,66 +100,93 @@ public class GTPP_Item_Machines extends ItemBlock { if (aNBT.getInputVoltage() > 0L) { String inA = "0"; if (aNBT.getInputAmperage() >= 1L) { - inA = " at " + EnumChatFormatting.YELLOW + aNBT.getInputAmperage() + EnumChatFormatting.GRAY + inA = " at " + EnumChatFormatting.YELLOW + + aNBT.getInputAmperage() + + EnumChatFormatting.GRAY + " Amps"; } else { - inA = " at " + EnumChatFormatting.WHITE + aNBT.getInputAmperage() + EnumChatFormatting.GRAY + inA = " at " + EnumChatFormatting.WHITE + + aNBT.getInputAmperage() + + EnumChatFormatting.GRAY + " Amps"; } - String a1 = "Voltage IN: " + EnumChatFormatting.GREEN + aNBT.getInputVoltage() - + " (" + GT_Values.VN[GT_Utility.getTier(aNBT.getInputVoltage())] + ")" - + EnumChatFormatting.GRAY + inA; + String a1 = "Voltage IN: " + EnumChatFormatting.GREEN + + aNBT.getInputVoltage() + + " (" + + GT_Values.VN[GT_Utility.getTier(aNBT.getInputVoltage())] + + ")" + + EnumChatFormatting.GRAY + + inA; aList.add(a1); } if (aNBT.getOutputVoltage() > 0L) { String outA = "0"; if (aNBT.getOutputAmperage() >= 1L) { - outA = " at " + EnumChatFormatting.YELLOW + aNBT.getOutputAmperage() - + EnumChatFormatting.GRAY + " Amps"; + outA = " at " + EnumChatFormatting.YELLOW + + aNBT.getOutputAmperage() + + EnumChatFormatting.GRAY + + " Amps"; } else { - outA = " at " + EnumChatFormatting.WHITE + aNBT.getOutputAmperage() - + EnumChatFormatting.GRAY + " Amps"; + outA = " at " + EnumChatFormatting.WHITE + + aNBT.getOutputAmperage() + + EnumChatFormatting.GRAY + + " Amps"; } - String a1 = "Voltage OUT: " + EnumChatFormatting.GREEN + aNBT.getOutputVoltage() - + " (" + GT_Values.VN[GT_Utility.getTier(aNBT.getOutputVoltage())] + ")" - + EnumChatFormatting.GRAY + outA; + String a1 = "Voltage OUT: " + EnumChatFormatting.GREEN + + aNBT.getOutputVoltage() + + " (" + + GT_Values.VN[GT_Utility.getTier(aNBT.getOutputVoltage())] + + ")" + + EnumChatFormatting.GRAY + + outA; aList.add(a1); } - aList.add(GT_LanguageManager.addStringLocalization( + aList.add( + GT_LanguageManager.addStringLocalization( "TileEntity_Lossess_EU", "Transmission Loss: " + EnumChatFormatting.DARK_BLUE + "0", - !GregTech_API.sPostloadFinished) - + EnumChatFormatting.GRAY); - - aList.add(GT_LanguageManager.addStringLocalization( - "TileEntity_EUp_STORE2", "Internal Capacity: ", !GregTech_API.sPostloadFinished) - + EnumChatFormatting.BLUE + aNBT.getEUCapacity() - + EnumChatFormatting.GRAY + " EU"); + !GregTech_API.sPostloadFinished) + EnumChatFormatting.GRAY); + + aList.add( + GT_LanguageManager.addStringLocalization( + "TileEntity_EUp_STORE2", + "Internal Capacity: ", + !GregTech_API.sPostloadFinished) + EnumChatFormatting.BLUE + + aNBT.getEUCapacity() + + EnumChatFormatting.GRAY + + " EU"); } } NBTTagCompound arg16 = aStack.getTagCompound(); if (arg16 != null) { if (arg16.getBoolean("mMuffler")) { - aList.add(GT_LanguageManager.addStringLocalization( - "GT_TileEntity_MUFFLER", "has Muffler Upgrade", !GregTech_API.sPostloadFinished)); + aList.add( + GT_LanguageManager.addStringLocalization( + "GT_TileEntity_MUFFLER", + "has Muffler Upgrade", + !GregTech_API.sPostloadFinished)); } if (arg16.getBoolean("mSteamConverter")) { - aList.add(GT_LanguageManager.addStringLocalization( - "GT_TileEntity_STEAMCONVERTER", "has Steam Upgrade", !GregTech_API.sPostloadFinished)); + aList.add( + GT_LanguageManager.addStringLocalization( + "GT_TileEntity_STEAMCONVERTER", + "has Steam Upgrade", + !GregTech_API.sPostloadFinished)); } boolean arg17 = false; byte arg18; if ((arg18 = arg16.getByte("mSteamTanks")) > 0) { - aList.add(arg18 + " " - + GT_LanguageManager.addStringLocalization( - "GT_TileEntity_STEAMTANKS", - "Steam Tank Upgrades", - !GregTech_API.sPostloadFinished)); + aList.add( + arg18 + " " + + GT_LanguageManager.addStringLocalization( + "GT_TileEntity_STEAMTANKS", + "Steam Tank Upgrades", + !GregTech_API.sPostloadFinished)); } } @@ -177,17 +197,8 @@ public class GTPP_Item_Machines extends ItemBlock { } } - public boolean onItemUseFirst( - ItemStack stack, - EntityPlayer player, - World world, - int x, - int y, - int z, - int side, - float hitX, - float hitY, - float hitZ) { + public boolean onItemUseFirst(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, + float hitX, float hitY, float hitZ) { return false; } @@ -209,18 +220,8 @@ public class GTPP_Item_Machines extends ItemBlock { } } - public boolean placeBlockAt( - ItemStack aStack, - EntityPlayer aPlayer, - World aWorld, - int aX, - int aY, - int aZ, - int side, - float hitX, - float hitY, - float hitZ, - int aMeta) { + public boolean placeBlockAt(ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ, int side, + float hitX, float hitY, float hitZ, int aMeta) { short tDamage = (short) ((short) this.getDamage(aStack) + 30400); // Add Offset; if (tDamage > 0) { if (GregTech_API.METATILEENTITIES[tDamage] == null) { @@ -229,8 +230,12 @@ public class GTPP_Item_Machines extends ItemBlock { byte tMetaData = 32; // byte tMetaData = GregTech_API.METATILEENTITIES[tDamage].getTileEntityBaseType(); - Logger.INFO("Using Meta: " + tMetaData + " for ID " + tDamage + " | " - + GregTech_API.METATILEENTITIES[tDamage].getInventoryName()); + Logger.INFO( + "Using Meta: " + tMetaData + + " for ID " + + tDamage + + " | " + + GregTech_API.METATILEENTITIES[tDamage].getInventoryName()); if (!aWorld.setBlock(aX, aY, aZ, this.field_150939_a, tMetaData, 3)) { return false; } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks.java index 026d3d471f..533676f75b 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks.java @@ -1,5 +1,9 @@ package gtPlusPlus.xmod.gregtech.common.blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; +import net.minecraft.world.IBlockAccess; + import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.enums.TAE; @@ -8,9 +12,6 @@ import gregtech.common.blocks.GT_Material_Casings; import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; import gtPlusPlus.xmod.gregtech.api.objects.GTPP_CopiedBlockTexture; import gtPlusPlus.xmod.gregtech.common.blocks.textures.CasingTextureHandler; -import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; -import net.minecraft.world.IBlockAccess; public class GregtechMetaCasingBlocks extends GregtechMetaCasingBlocksAbstract { @@ -26,12 +27,11 @@ public class GregtechMetaCasingBlocks extends GregtechMetaCasingBlocksAbstract { } GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".0.name", "Centrifuge Casing"); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".1.name", "Structural Coke Oven Casing"); - GT_LanguageManager.addStringLocalization( - this.getUnlocalizedName() + ".2.name", "Heat Resistant Coke Oven Casing"); - GT_LanguageManager.addStringLocalization( - this.getUnlocalizedName() + ".3.name", "Heat Proof Coke Oven Casing"); // 60 - GT_LanguageManager.addStringLocalization( - this.getUnlocalizedName() + ".4.name", "Material Press Machine Casing"); + GT_LanguageManager + .addStringLocalization(this.getUnlocalizedName() + ".2.name", "Heat Resistant Coke Oven Casing"); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".3.name", "Heat Proof Coke Oven Casing"); // 60 + GT_LanguageManager + .addStringLocalization(this.getUnlocalizedName() + ".4.name", "Material Press Machine Casing"); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".5.name", "Electrolyzer Casing"); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".6.name", "Wire Factory Casing"); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".7.name", "Maceration Stack Casing"); @@ -41,8 +41,8 @@ public class GregtechMetaCasingBlocks extends GregtechMetaCasingBlocksAbstract { GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".11.name", "Multitank Exterior Casing"); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".12.name", "Hastelloy-N Reactor Casing"); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".13.name", "Zeron-100 Reactor Shielding"); - GT_LanguageManager.addStringLocalization( - this.getUnlocalizedName() + ".14.name", "Blast Smelter Heat Containment Coil "); + GT_LanguageManager + .addStringLocalization(this.getUnlocalizedName() + ".14.name", "Blast Smelter Heat Containment Coil "); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".15.name", "Blast Smelter Casing Block"); GregtechItemList.Casing_Centrifuge1.set(new ItemStack(this, 1, 0)); GregtechItemList.Casing_CokeOven.set(new ItemStack(this, 1, 1)); @@ -69,8 +69,8 @@ public class GregtechMetaCasingBlocks extends GregtechMetaCasingBlocksAbstract { @Override @SideOnly(Side.CLIENT) - public IIcon getIcon( - final IBlockAccess aWorld, final int xCoord, final int yCoord, final int zCoord, final int aSide) { + public IIcon getIcon(final IBlockAccess aWorld, final int xCoord, final int yCoord, final int zCoord, + final int aSide) { final GregtechMetaCasingBlocks i = this; return CasingTextureHandler.handleCasingsGT(aWorld, xCoord, yCoord, zCoord, aSide, i); } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks2.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks2.java index 3c55d2fa95..320fefb583 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks2.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks2.java @@ -1,5 +1,12 @@ package gtPlusPlus.xmod.gregtech.common.blocks; +import java.util.List; + +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; + import gregtech.api.enums.TAE; import gregtech.api.util.GT_LanguageManager; import gregtech.api.util.GT_Utility; @@ -8,11 +15,6 @@ import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; import gtPlusPlus.xmod.gregtech.api.objects.GTPP_CopiedBlockTexture; import gtPlusPlus.xmod.gregtech.common.blocks.textures.CasingTextureHandler2; import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.storage.GregtechMetaTileEntity_PowerSubStationController; -import java.util.List; -import net.minecraft.block.Block; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; public class GregtechMetaCasingBlocks2 extends GregtechMetaCasingBlocksAbstract { @@ -47,13 +49,13 @@ public class GregtechMetaCasingBlocks2 extends GregtechMetaCasingBlocksAbstract GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".0.name", "Thermal Processing Casing"); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".1.name", "Hastelloy-N Sealant Block"); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".2.name", "Hastelloy-X Structural Block"); - GT_LanguageManager.addStringLocalization( - this.getUnlocalizedName() + ".3.name", "Incoloy-DS Fluid Containment Block"); + GT_LanguageManager + .addStringLocalization(this.getUnlocalizedName() + ".3.name", "Incoloy-DS Fluid Containment Block"); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".4.name", "Wash Plant Casing"); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".5.name", "Industrial Sieve Casing"); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".6.name", "Large Sieve Grate"); - GT_LanguageManager.addStringLocalization( - this.getUnlocalizedName() + ".7.name", "Vanadium Redox Power Cell (EV)"); + GT_LanguageManager + .addStringLocalization(this.getUnlocalizedName() + ".7.name", "Vanadium Redox Power Cell (EV)"); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".8.name", "Sub-Station External Casing"); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".9.name", "Cyclotron Coil"); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".10.name", "Cyclotron Outer Casing"); @@ -61,8 +63,9 @@ public class GregtechMetaCasingBlocks2 extends GregtechMetaCasingBlocksAbstract GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".12.name", "Bulk Production Frame"); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".13.name", "Cutting Factory Frame"); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".14.name", ""); // Unused - GT_LanguageManager.addStringLocalization( - this.getUnlocalizedName() + ".15.name", "Sterile Farm Casing"); // Tree Farmer Textures + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".15.name", "Sterile Farm Casing"); // Tree + // Farmer + // Textures GregtechItemList.Casing_ThermalCentrifuge.set(new ItemStack(this, 1, 0)); GregtechItemList.Casing_Refinery_External.set(new ItemStack(this, 1, 1)); GregtechItemList.Casing_Refinery_Structural.set(new ItemStack(this, 1, 2)); diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks3.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks3.java index 59bcfa5347..de7e6aa953 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks3.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks3.java @@ -1,5 +1,13 @@ package gtPlusPlus.xmod.gregtech.common.blocks; +import java.util.List; + +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; +import net.minecraft.world.IBlockAccess; + import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.enums.TAE; @@ -11,12 +19,6 @@ import gtPlusPlus.xmod.gregtech.api.objects.GTPP_CopiedBlockTexture; import gtPlusPlus.xmod.gregtech.common.blocks.textures.CasingTextureHandler3; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.storage.GregtechMetaTileEntity_PowerSubStationController; -import java.util.List; -import net.minecraft.block.Block; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; -import net.minecraft.world.IBlockAccess; public class GregtechMetaCasingBlocks3 extends GregtechMetaCasingBlocksAbstract { @@ -54,25 +56,26 @@ public class GregtechMetaCasingBlocks3 extends GregtechMetaCasingBlocksAbstract GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".1.name", "Inconel Reinforced Casing"); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".2.name", "Multi-Use Casing"); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".3.name", "Trinium Plated Casing"); - GT_LanguageManager.addStringLocalization( - this.getUnlocalizedName() + ".4.name", "Vanadium Redox Power Cell (IV)"); - GT_LanguageManager.addStringLocalization( - this.getUnlocalizedName() + ".5.name", "Vanadium Redox Power Cell (LuV)"); - GT_LanguageManager.addStringLocalization( - this.getUnlocalizedName() + ".6.name", "Vanadium Redox Power Cell (ZPM)"); - GT_LanguageManager.addStringLocalization( - this.getUnlocalizedName() + ".7.name", "Vanadium Redox Power Cell (UV)"); - GT_LanguageManager.addStringLocalization( - this.getUnlocalizedName() + ".8.name", "Vanadium Redox Power Cell (MAX)"); + GT_LanguageManager + .addStringLocalization(this.getUnlocalizedName() + ".4.name", "Vanadium Redox Power Cell (IV)"); + GT_LanguageManager + .addStringLocalization(this.getUnlocalizedName() + ".5.name", "Vanadium Redox Power Cell (LuV)"); + GT_LanguageManager + .addStringLocalization(this.getUnlocalizedName() + ".6.name", "Vanadium Redox Power Cell (ZPM)"); + GT_LanguageManager + .addStringLocalization(this.getUnlocalizedName() + ".7.name", "Vanadium Redox Power Cell (UV)"); + GT_LanguageManager + .addStringLocalization(this.getUnlocalizedName() + ".8.name", "Vanadium Redox Power Cell (MAX)"); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".9.name", "Supply Depot Casing"); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".10.name", "Advanced Cryogenic Casing"); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".11.name", "Volcanus Casing"); - GT_LanguageManager.addStringLocalization( - this.getUnlocalizedName() + ".12.name", "Fusion Machine Casing MK III"); + GT_LanguageManager + .addStringLocalization(this.getUnlocalizedName() + ".12.name", "Fusion Machine Casing MK III"); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".13.name", "Advanced Fusion Coil"); - GT_LanguageManager.addStringLocalization( - this.getUnlocalizedName() + ".14.name", - "Unnamed"); // Can Use, don't change texture (Used for Fusion MK4) + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".14.name", "Unnamed"); // Can Use, don't + // change texture + // (Used for Fusion + // MK4) GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".15.name", "Containment Casing"); GregtechItemList.Casing_FishPond.set(new ItemStack(this, 1, 0)); GregtechItemList.Casing_Extruder.set(new ItemStack(this, 1, 1)); @@ -98,8 +101,8 @@ public class GregtechMetaCasingBlocks3 extends GregtechMetaCasingBlocksAbstract @SideOnly(Side.CLIENT) @Override - public IIcon getIcon( - final IBlockAccess aWorld, final int xCoord, final int yCoord, final int zCoord, final int aSide) { + public IIcon getIcon(final IBlockAccess aWorld, final int xCoord, final int yCoord, final int zCoord, + final int aSide) { final Block thisBlock = aWorld.getBlock(xCoord, yCoord, zCoord); final int tMeta = aWorld.getBlockMetadata(xCoord, yCoord, zCoord); if ((tMeta != 12) || !GregtechMetaCasingBlocks3.mConnectedMachineTextures) { @@ -108,19 +111,18 @@ public class GregtechMetaCasingBlocks3 extends GregtechMetaCasingBlocksAbstract final int tStartIndex = 0; if (tMeta == 12) { final boolean[] tConnectedSides = { - aWorld.getBlock(xCoord, yCoord - 1, zCoord) == thisBlock - && aWorld.getBlockMetadata(xCoord, yCoord - 1, zCoord) == tMeta, - aWorld.getBlock(xCoord, yCoord + 1, zCoord) == thisBlock - && aWorld.getBlockMetadata(xCoord, yCoord + 1, zCoord) == tMeta, - aWorld.getBlock(xCoord + 1, yCoord, zCoord) == thisBlock - && aWorld.getBlockMetadata(xCoord + 1, yCoord, zCoord) == tMeta, - aWorld.getBlock(xCoord, yCoord, zCoord + 1) == thisBlock - && aWorld.getBlockMetadata(xCoord, yCoord, zCoord + 1) == tMeta, - aWorld.getBlock(xCoord - 1, yCoord, zCoord) == thisBlock - && aWorld.getBlockMetadata(xCoord - 1, yCoord, zCoord) == tMeta, - aWorld.getBlock(xCoord, yCoord, zCoord - 1) == thisBlock - && aWorld.getBlockMetadata(xCoord, yCoord, zCoord - 1) == tMeta - }; + aWorld.getBlock(xCoord, yCoord - 1, zCoord) == thisBlock + && aWorld.getBlockMetadata(xCoord, yCoord - 1, zCoord) == tMeta, + aWorld.getBlock(xCoord, yCoord + 1, zCoord) == thisBlock + && aWorld.getBlockMetadata(xCoord, yCoord + 1, zCoord) == tMeta, + aWorld.getBlock(xCoord + 1, yCoord, zCoord) == thisBlock + && aWorld.getBlockMetadata(xCoord + 1, yCoord, zCoord) == tMeta, + aWorld.getBlock(xCoord, yCoord, zCoord + 1) == thisBlock + && aWorld.getBlockMetadata(xCoord, yCoord, zCoord + 1) == tMeta, + aWorld.getBlock(xCoord - 1, yCoord, zCoord) == thisBlock + && aWorld.getBlockMetadata(xCoord - 1, yCoord, zCoord) == tMeta, + aWorld.getBlock(xCoord, yCoord, zCoord - 1) == thisBlock + && aWorld.getBlockMetadata(xCoord, yCoord, zCoord - 1) == tMeta }; switch (aSide) { case 0: { if (tConnectedSides[0]) { diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks4.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks4.java index 8256f1aa64..b637bd2113 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks4.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks4.java @@ -1,5 +1,8 @@ package gtPlusPlus.xmod.gregtech.common.blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; + import gregtech.api.enums.TAE; import gregtech.api.enums.Textures; import gregtech.api.util.GT_LanguageManager; @@ -7,8 +10,6 @@ import gregtech.common.blocks.GT_Material_Casings; import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; import gtPlusPlus.xmod.gregtech.api.objects.GTPP_CopiedBlockTexture; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; -import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; public class GregtechMetaCasingBlocks4 extends GregtechMetaCasingBlocksAbstract { @@ -24,8 +25,8 @@ public class GregtechMetaCasingBlocks4 extends GregtechMetaCasingBlocksAbstract GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".1.name", "Reactor Piping"); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".2.name", "Naquadah Containment Chamber"); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".3.name", "Tempered Arc Furnace Casing"); - GT_LanguageManager.addStringLocalization( - this.getUnlocalizedName() + ".4.name", "Quantum Force Transformer Coil Casings"); // Unused + GT_LanguageManager + .addStringLocalization(this.getUnlocalizedName() + ".4.name", "Quantum Force Transformer Coil Casings"); // Unused GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".5.name", ""); // Unused GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".6.name", ""); // Unused GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".7.name", ""); // Unused @@ -48,12 +49,12 @@ public class GregtechMetaCasingBlocks4 extends GregtechMetaCasingBlocksAbstract // private static final LargeTurbineTextureHandler mTurbineTextures = new LargeTurbineTextureHandler(); - /*@Override - @SideOnly(Side.CLIENT) - public IIcon getIcon(final IBlockAccess aWorld, final int xCoord, final int yCoord, final int zCoord, final int aSide) { - final GregtechMetaCasingBlocks4 i = this; - return mTurbineTextures.handleCasingsGT(aWorld, xCoord, yCoord, zCoord, aSide, i); - }*/ + /* + * @Override + * @SideOnly(Side.CLIENT) public IIcon getIcon(final IBlockAccess aWorld, final int xCoord, final int yCoord, final + * int zCoord, final int aSide) { final GregtechMetaCasingBlocks4 i = this; return + * mTurbineTextures.handleCasingsGT(aWorld, xCoord, yCoord, zCoord, aSide, i); } + */ @Override public IIcon getIcon(final int aSide, final int aMeta) { diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks5.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks5.java index 68d8349ef3..700e14c711 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks5.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks5.java @@ -1,5 +1,9 @@ package gtPlusPlus.xmod.gregtech.common.blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; +import net.minecraft.world.IBlockAccess; + import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.enums.TAE; @@ -10,9 +14,6 @@ import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; import gtPlusPlus.xmod.gregtech.api.objects.GTPP_CopiedBlockTexture; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGrinderMultiblock; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; -import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; -import net.minecraft.world.IBlockAccess; public class GregtechMetaCasingBlocks5 extends GregtechMetaCasingBlocksAbstract { @@ -23,34 +24,34 @@ public class GregtechMetaCasingBlocks5 extends GregtechMetaCasingBlocksAbstract public GregtechMetaCasingBlocks5() { super(GregtechMetaCasingItems.class, "gtplusplus.blockcasings.5", GT_Material_Casings.INSTANCE); - GT_LanguageManager.addStringLocalization( - this.getUnlocalizedName() + ".0.name", "IsaMill Exterior Casing"); // IsaMill Casing + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".0.name", "IsaMill Exterior Casing"); // IsaMill + // Casing TAE.registerTexture(0, 2, new GTPP_CopiedBlockTexture(this, 6, 0)); - GT_LanguageManager.addStringLocalization( - this.getUnlocalizedName() + ".1.name", "IsaMill Piping"); // IsaMill Pipe - GT_LanguageManager.addStringLocalization( - this.getUnlocalizedName() + ".2.name", "IsaMill Gearbox"); // IsaMill Gearbox - GT_LanguageManager.addStringLocalization( - this.getUnlocalizedName() + ".3.name", "Elemental Confinement Shell"); // Duplicator Casing + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".1.name", "IsaMill Piping"); // IsaMill + // Pipe + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".2.name", "IsaMill Gearbox"); // IsaMill + // Gearbox + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".3.name", "Elemental Confinement Shell"); // Duplicator + // Casing TAE.registerTexture(0, 3, new GTPP_CopiedBlockTexture(this, 6, 3)); - GT_LanguageManager.addStringLocalization( - this.getUnlocalizedName() + ".4.name", "Sparge Tower Exterior Casing"); // Sparge Tower Casing + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".4.name", "Sparge Tower Exterior Casing"); // Sparge + // Tower + // Casing TAE.registerTexture(0, 4, new GTPP_CopiedBlockTexture(this, 6, 4)); - GT_LanguageManager.addStringLocalization( - this.getUnlocalizedName() + ".5.name", "Sturdy Printer Casing"); // Unused + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".5.name", "Sturdy Printer Casing"); // Unused TAE.registerTexture(1, 10, new GTPP_CopiedBlockTexture(this, 6, 5)); - GT_LanguageManager.addStringLocalization( - this.getUnlocalizedName() + ".6.name", "Forge Casing"); // Forge Hammer Casing + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".6.name", "Forge Casing"); // Forge Hammer + // Casing TAE.registerTexture(1, 11, new GTPP_CopiedBlockTexture(this, 6, 6)); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".7.name", "Neutron Pulse Manipulator"); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".8.name", "Cosmic Fabric Manipulator"); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".9.name", "Infinity Infused Manipulator"); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".10.name", "SpaceTime Continuum Ripper"); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".11.name", "Neutron Shielding Core"); - GT_LanguageManager.addStringLocalization( - this.getUnlocalizedName() + ".12.name", "Cosmic Fabric Shielding Core"); - GT_LanguageManager.addStringLocalization( - this.getUnlocalizedName() + ".13.name", "Infinity Infused Shielding Core"); + GT_LanguageManager + .addStringLocalization(this.getUnlocalizedName() + ".12.name", "Cosmic Fabric Shielding Core"); + GT_LanguageManager + .addStringLocalization(this.getUnlocalizedName() + ".13.name", "Infinity Infused Shielding Core"); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".14.name", "SpaceTime Bending Core"); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".15.name", "Force Field Glass"); @@ -134,8 +135,8 @@ public class GregtechMetaCasingBlocks5 extends GregtechMetaCasingBlocksAbstract @Override @SideOnly(Side.CLIENT) - public IIcon getIcon( - final IBlockAccess aWorld, final int xCoord, final int yCoord, final int zCoord, final int aSide) { + public IIcon getIcon(final IBlockAccess aWorld, final int xCoord, final int yCoord, final int zCoord, + final int aSide) { final GregtechMetaCasingBlocks5 i = this; return mGrinderOverlayHandler.handleCasingsGT(aWorld, xCoord, yCoord, zCoord, aSide, i); } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocksAbstract.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocksAbstract.java index 683159de98..2d4973aa9f 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocksAbstract.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocksAbstract.java @@ -1,13 +1,8 @@ package gtPlusPlus.xmod.gregtech.common.blocks; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import gregtech.api.GregTech_API; -import gregtech.api.util.GT_LanguageManager; -import gregtech.common.blocks.GT_Block_Casings_Abstract; -import gtPlusPlus.core.creative.AddToCreativeTab; import java.util.List; import java.util.Random; + import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; @@ -22,15 +17,23 @@ import net.minecraft.util.StatCollector; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import gregtech.api.GregTech_API; +import gregtech.api.util.GT_LanguageManager; +import gregtech.common.blocks.GT_Block_Casings_Abstract; +import gtPlusPlus.core.creative.AddToCreativeTab; + public abstract class GregtechMetaCasingBlocksAbstract extends GT_Block_Casings_Abstract { - public GregtechMetaCasingBlocksAbstract( - final Class<? extends ItemBlock> aItemClass, final String aName, final Material aMaterial) { + + public GregtechMetaCasingBlocksAbstract(final Class<? extends ItemBlock> aItemClass, final String aName, + final Material aMaterial) { super(aItemClass, aName, aMaterial); this.setStepSound(soundTypeMetal); this.setCreativeTab(AddToCreativeTab.tabMachines); GregTech_API.registerMachineBlock(this, -1); - GT_LanguageManager.addStringLocalization( - this.getUnlocalizedName() + "." + 32767 + ".name", "Any Sub Block of this"); + GT_LanguageManager + .addStringLocalization(this.getUnlocalizedName() + "." + 32767 + ".name", "Any Sub Block of this"); } @Override @@ -101,16 +104,16 @@ public abstract class GregtechMetaCasingBlocksAbstract extends GT_Block_Casings_ } @Override - public void breakBlock( - final World aWorld, final int aX, final int aY, final int aZ, final Block aBlock, final int aMetaData) { + public void breakBlock(final World aWorld, final int aX, final int aY, final int aZ, final Block aBlock, + final int aMetaData) { if (GregTech_API.isMachineBlock(this, aWorld.getBlockMetadata(aX, aY, aZ))) { GregTech_API.causeMachineUpdate(aWorld, aX, aY, aZ); } } @Override - public boolean canCreatureSpawn( - final EnumCreatureType type, final IBlockAccess world, final int x, final int y, final int z) { + public boolean canCreatureSpawn(final EnumCreatureType type, final IBlockAccess world, final int x, final int y, + final int z) { return false; } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocksPipeGearbox.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocksPipeGearbox.java index 22c1d87b4e..90fff051eb 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocksPipeGearbox.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocksPipeGearbox.java @@ -1,5 +1,10 @@ package gtPlusPlus.xmod.gregtech.common.blocks; +import java.util.HashMap; + +import net.minecraft.util.IIcon; +import net.minecraft.world.IBlockAccess; + import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.enums.Textures; @@ -7,9 +12,6 @@ import gregtech.api.util.GT_LanguageManager; import gregtech.common.blocks.GT_Material_Casings; import gtPlusPlus.core.material.ALLOY; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; -import java.util.HashMap; -import net.minecraft.util.IIcon; -import net.minecraft.world.IBlockAccess; public class GregtechMetaCasingBlocksPipeGearbox extends GregtechMetaCasingBlocksAbstract { @@ -19,8 +21,8 @@ public class GregtechMetaCasingBlocksPipeGearbox extends GregtechMetaCasingBlock super(GregtechMetaCasingItems.class, "gtplusplus.blockcasings.pipesgears", GT_Material_Casings.INSTANCE); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".0.name", "Eglin Steel Gear Box Casing"); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".1.name", "Inconel-792 Gear Box Casing"); - GT_LanguageManager.addStringLocalization( - this.getUnlocalizedName() + ".2.name", "Incoloy MA956 Gear Box Casing"); + GT_LanguageManager + .addStringLocalization(this.getUnlocalizedName() + ".2.name", "Incoloy MA956 Gear Box Casing"); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".3.name", "Nitinol-60 Gear Box Casing"); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".4.name", "Zeron-100 Gear Box Casing"); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".5.name", "Pikyonium Gear Box Casing"); diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingItems.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingItems.java index 9927060164..f86c6af265 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingItems.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingItems.java @@ -3,6 +3,7 @@ package gtPlusPlus.xmod.gregtech.common.blocks; import net.minecraft.block.Block; public class GregtechMetaCasingItems extends GregtechMetaItemCasingsAbstract { + public GregtechMetaCasingItems(final Block par1) { super(par1); } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaItemCasings1.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaItemCasings1.java index ba4929c011..13d58aac5f 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaItemCasings1.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaItemCasings1.java @@ -1,18 +1,20 @@ package gtPlusPlus.xmod.gregtech.common.blocks; import java.util.List; + import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; public class GregtechMetaItemCasings1 extends GregtechMetaItemCasingsAbstract { + public GregtechMetaItemCasings1(final Block par1) { super(par1); } @Override - public void addInformation( - final ItemStack aStack, final EntityPlayer aPlayer, final List aList, final boolean aF3_H) { + public void addInformation(final ItemStack aStack, final EntityPlayer aPlayer, final List aList, + final boolean aF3_H) { super.addInformation(aStack, aPlayer, aList, aF3_H); switch (this.getDamage(aStack)) { case 0: diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaItemCasingsAbstract.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaItemCasingsAbstract.java index d9102f0994..d6ebda4199 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaItemCasingsAbstract.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaItemCasingsAbstract.java @@ -1,26 +1,28 @@ package gtPlusPlus.xmod.gregtech.common.blocks; -import gregtech.api.util.GT_LanguageManager; import java.util.List; + import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; +import gregtech.api.util.GT_LanguageManager; + public abstract class GregtechMetaItemCasingsAbstract extends ItemBlock { - protected final String mCasing_Centrifuge = GT_LanguageManager.addStringLocalization( - "mu.centrifugecasing", "Warning! Standing in the Centrifuge not recommended"); - protected final String mCasing_CokeOven = - GT_LanguageManager.addStringLocalization("mu.cokeoven", "Sturdy and Strong"); - protected final String mCasing_CokeCoil1 = - GT_LanguageManager.addStringLocalization("mu.coil01tooltip", "Base Heating Capacity = 1350 Kelvin"); - protected final String mCasing_CokeCoil2 = - GT_LanguageManager.addStringLocalization("mu.coil02tooltip", "Base Heating Capacity = 2275 Kelvin"); - protected final String mNoMobsToolTip = - GT_LanguageManager.addStringLocalization("gt.nomobspawnsonthisblock", "Mobs cannot Spawn on this Block"); - protected final String mNoTileEntityToolTip = - GT_LanguageManager.addStringLocalization("gt.notileentityinthisblock", "This is NOT a TileEntity!"); + protected final String mCasing_Centrifuge = GT_LanguageManager + .addStringLocalization("mu.centrifugecasing", "Warning! Standing in the Centrifuge not recommended"); + protected final String mCasing_CokeOven = GT_LanguageManager + .addStringLocalization("mu.cokeoven", "Sturdy and Strong"); + protected final String mCasing_CokeCoil1 = GT_LanguageManager + .addStringLocalization("mu.coil01tooltip", "Base Heating Capacity = 1350 Kelvin"); + protected final String mCasing_CokeCoil2 = GT_LanguageManager + .addStringLocalization("mu.coil02tooltip", "Base Heating Capacity = 2275 Kelvin"); + protected final String mNoMobsToolTip = GT_LanguageManager + .addStringLocalization("gt.nomobspawnsonthisblock", "Mobs cannot Spawn on this Block"); + protected final String mNoTileEntityToolTip = GT_LanguageManager + .addStringLocalization("gt.notileentityinthisblock", "This is NOT a TileEntity!"); public GregtechMetaItemCasingsAbstract(final Block par1) { super(par1); @@ -40,8 +42,8 @@ public abstract class GregtechMetaItemCasingsAbstract extends ItemBlock { } @Override - public void addInformation( - final ItemStack aStack, final EntityPlayer aPlayer, final List aList, final boolean aF3_H) { + public void addInformation(final ItemStack aStack, final EntityPlayer aPlayer, final List aList, + final boolean aF3_H) { super.addInformation(aStack, aPlayer, aList, aF3_H); switch (this.getDamage(aStack)) { case 0: diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaSpecialMachineCasings.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaSpecialMachineCasings.java index f0a69e49d3..5c386fe59a 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaSpecialMachineCasings.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaSpecialMachineCasings.java @@ -1,5 +1,12 @@ package gtPlusPlus.xmod.gregtech.common.blocks; +import java.util.List; + +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; + import gregtech.api.enums.TAE; import gregtech.api.enums.Textures; import gregtech.api.util.GT_LanguageManager; @@ -7,11 +14,6 @@ import gregtech.common.blocks.GT_Material_Casings; import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; import gtPlusPlus.xmod.gregtech.api.objects.GTPP_CopiedBlockTexture; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; -import java.util.List; -import net.minecraft.block.Block; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; public class GregtechMetaSpecialMachineCasings extends GregtechMetaCasingBlocksAbstract { @@ -38,13 +40,13 @@ public class GregtechMetaSpecialMachineCasings extends GregtechMetaCasingBlocksA // Don't register these Textures, They already exist within vanilla GT. (May not exist in 5.08) } GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".0.name", "Strong Bronze Machine Casing"); - GT_LanguageManager.addStringLocalization( - this.getUnlocalizedName() + ".1.name", "Sturdy Aluminium Machine Casing"); - GT_LanguageManager.addStringLocalization( - this.getUnlocalizedName() + ".2.name", "Vigorous Laurenium Machine Casing"); + GT_LanguageManager + .addStringLocalization(this.getUnlocalizedName() + ".1.name", "Sturdy Aluminium Machine Casing"); + GT_LanguageManager + .addStringLocalization(this.getUnlocalizedName() + ".2.name", "Vigorous Laurenium Machine Casing"); TAE.registerTexture(84, new GTPP_CopiedBlockTexture(this, 6, 2)); - GT_LanguageManager.addStringLocalization( - this.getUnlocalizedName() + ".3.name", "Rugged Botmium Machine Casing"); + GT_LanguageManager + .addStringLocalization(this.getUnlocalizedName() + ".3.name", "Rugged Botmium Machine Casing"); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".4.name", ""); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".5.name", ""); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".6.name", ""); diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaSpecialMultiCasings.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaSpecialMultiCasings.java index 47b9d9b093..3d1aa88f6c 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaSpecialMultiCasings.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaSpecialMultiCasings.java @@ -1,5 +1,13 @@ package gtPlusPlus.xmod.gregtech.common.blocks; +import java.util.List; + +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; +import net.minecraft.world.IBlockAccess; + import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.enums.TAE; @@ -10,12 +18,6 @@ import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; import gtPlusPlus.xmod.gregtech.api.objects.GTPP_CopiedBlockTexture; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; import gtPlusPlus.xmod.gregtech.common.blocks.textures.turbine.LargeTurbineTextureHandler; -import java.util.List; -import net.minecraft.block.Block; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; -import net.minecraft.world.IBlockAccess; public class GregtechMetaSpecialMultiCasings extends GregtechMetaCasingBlocksAbstract { @@ -38,29 +40,29 @@ public class GregtechMetaSpecialMultiCasings extends GregtechMetaCasingBlocksAbs public GregtechMetaSpecialMultiCasings() { super(SpecialCasingItemBlock.class, "gtplusplus.blockspecialcasings.1", GT_Material_Casings.INSTANCE); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".0.name", "Turbine Shaft"); - GT_LanguageManager.addStringLocalization( - this.getUnlocalizedName() + ".1.name", "Reinforced Steam Turbine Casing"); - GT_LanguageManager.addStringLocalization( - this.getUnlocalizedName() + ".2.name", "Reinforced HP Steam Turbine Casing"); - GT_LanguageManager.addStringLocalization( - this.getUnlocalizedName() + ".3.name", "Reinforced Gas Turbine Casing"); - GT_LanguageManager.addStringLocalization( - this.getUnlocalizedName() + ".4.name", "Reinforced Plasma Turbine Casing"); + GT_LanguageManager + .addStringLocalization(this.getUnlocalizedName() + ".1.name", "Reinforced Steam Turbine Casing"); + GT_LanguageManager + .addStringLocalization(this.getUnlocalizedName() + ".2.name", "Reinforced HP Steam Turbine Casing"); + GT_LanguageManager + .addStringLocalization(this.getUnlocalizedName() + ".3.name", "Reinforced Gas Turbine Casing"); + GT_LanguageManager + .addStringLocalization(this.getUnlocalizedName() + ".4.name", "Reinforced Plasma Turbine Casing"); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".5.name", "Tesla Containment Casing"); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".6.name", "Structural Solar Casing"); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".7.name", "Salt Containment Casing"); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".8.name", "Thermally Insulated Casing"); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".9.name", "Flotation Cell Casings"); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".10.name", "Reinforced Engine Casing"); - GT_LanguageManager.addStringLocalization( - this.getUnlocalizedName() + ".11.name", "Molecular Containment Casing"); - GT_LanguageManager.addStringLocalization( - this.getUnlocalizedName() + ".12.name", "High Voltage Current Capacitor"); + GT_LanguageManager + .addStringLocalization(this.getUnlocalizedName() + ".11.name", "Molecular Containment Casing"); + GT_LanguageManager + .addStringLocalization(this.getUnlocalizedName() + ".12.name", "High Voltage Current Capacitor"); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".13.name", "Particle Containment Casing"); - GT_LanguageManager.addStringLocalization( - this.getUnlocalizedName() + ".14.name", "Reinforced Heat Exchanger Casing"); - GT_LanguageManager.addStringLocalization( - this.getUnlocalizedName() + ".15.name", "Reinforced SC Turbine Casing"); + GT_LanguageManager + .addStringLocalization(this.getUnlocalizedName() + ".14.name", "Reinforced Heat Exchanger Casing"); + GT_LanguageManager + .addStringLocalization(this.getUnlocalizedName() + ".15.name", "Reinforced SC Turbine Casing"); TAE.registerTexture(1, 12, new GTPP_CopiedBlockTexture(this, 6, 14)); GregtechItemList.Casing_Turbine_Shaft.set(new ItemStack(this, 1, 0)); @@ -83,8 +85,8 @@ public class GregtechMetaSpecialMultiCasings extends GregtechMetaCasingBlocksAbs @Override @SideOnly(Side.CLIENT) - public IIcon getIcon( - final IBlockAccess aWorld, final int xCoord, final int yCoord, final int zCoord, final int aSide) { + public IIcon getIcon(final IBlockAccess aWorld, final int xCoord, final int yCoord, final int zCoord, + final int aSide) { return LargeTurbineTextureHandler.handleCasingsGT(aWorld, xCoord, yCoord, zCoord, aSide, this); } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaSpecialMultiCasings2.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaSpecialMultiCasings2.java index 664f949b30..6237ce7a9e 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaSpecialMultiCasings2.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaSpecialMultiCasings2.java @@ -1,5 +1,13 @@ package gtPlusPlus.xmod.gregtech.common.blocks; +import java.util.List; + +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; +import net.minecraft.world.IBlockAccess; + import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.enums.Textures; @@ -7,12 +15,6 @@ import gregtech.api.util.GT_LanguageManager; import gregtech.common.blocks.GT_Material_Casings; import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; -import java.util.List; -import net.minecraft.block.Block; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; -import net.minecraft.world.IBlockAccess; public class GregtechMetaSpecialMultiCasings2 extends GregtechMetaCasingBlocksAbstract { @@ -70,8 +72,8 @@ public class GregtechMetaSpecialMultiCasings2 extends GregtechMetaCasingBlocksAb @Override @SideOnly(Side.CLIENT) - public IIcon getIcon( - final IBlockAccess aWorld, final int xCoord, final int yCoord, final int zCoord, final int aSide) { + public IIcon getIcon(final IBlockAccess aWorld, final int xCoord, final int yCoord, final int zCoord, + final int aSide) { return getStaticIcon((byte) aSide, (byte) aWorld.getBlockMetadata(xCoord, yCoord, zCoord)); } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaTieredCasingBlocks1.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaTieredCasingBlocks1.java index b511926137..39171a1c05 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaTieredCasingBlocks1.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaTieredCasingBlocks1.java @@ -1,16 +1,18 @@ package gtPlusPlus.xmod.gregtech.common.blocks; +import java.util.List; + +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; + import gregtech.api.enums.GT_Values; import gregtech.api.enums.Textures; import gregtech.api.util.GT_LanguageManager; import gregtech.common.blocks.GT_Material_Casings; import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; -import java.util.List; -import net.minecraft.block.Block; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; public class GregtechMetaTieredCasingBlocks1 extends GregtechMetaCasingBlocksAbstract { diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/fluid/GregtechFluidHandler.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/fluid/GregtechFluidHandler.java index 7ffa95c081..f42768c451 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/fluid/GregtechFluidHandler.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/fluid/GregtechFluidHandler.java @@ -1,5 +1,8 @@ package gtPlusPlus.xmod.gregtech.common.blocks.fluid; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidRegistry; + import gregtech.api.enums.OrePrefixes; import gregtech.api.util.GT_OreDictUnificator; import gtPlusPlus.api.objects.Logger; @@ -8,8 +11,6 @@ import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.minecraft.FluidUtils; import gtPlusPlus.core.util.minecraft.ItemUtils; import gtPlusPlus.xmod.gregtech.api.enums.GregtechOrePrefixes.GT_Materials; -import net.minecraft.item.ItemStack; -import net.minecraftforge.fluids.FluidRegistry; public class GregtechFluidHandler { @@ -21,20 +22,32 @@ public class GregtechFluidHandler { private static void start() { - /* Meta_GT_Proxy.addFluid("lubricant", "Lubricant", Materials.Lubricant, 1, 295, GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Lubricant, 1L), ItemUtils.getEmptyCell(), 1000); - Meta_GT_Proxy.addFluid("creosote", "Creosote Oil", Materials.Creosote, 1, 295, GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Creosote, 1L), ItemUtils.getEmptyCell(), 1000); - Meta_GT_Proxy.addFluid("seedoil", "Seed Oil", Materials.SeedOil, 1, 295, GT_OreDictUnificator.get(OrePrefixes.cell, Materials.SeedOil, 1L), ItemUtils.getEmptyCell(), 1000); - Meta_GT_Proxy.addFluid("fishoil", "Fish Oil", Materials.FishOil, 1, 295, GT_OreDictUnificator.get(OrePrefixes.cell, Materials.FishOil, 1L), ItemUtils.getEmptyCell(), 1000); - Meta_GT_Proxy.addFluid("oil", "Oil", Materials.Oil, 1, 295, GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Oil, 1L), ItemUtils.getEmptyCell(), 1000); - Meta_GT_Proxy.addFluid("fuel", "Diesel", Materials.Fuel, 1, 295, GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Fuel, 1L), ItemUtils.getEmptyCell(), 1000); - Meta_GT_Proxy.addFluid("for.honey", "Honey", Materials.Honey, 1, 295, GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Honey, 1L), ItemUtils.getEmptyCell(), 1000); - Meta_GT_Proxy.addFluid("biomass", "Biomass", Materials.Biomass, 1, 295, GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Biomass, 1L), ItemUtils.getEmptyCell(), 1000); - Meta_GT_Proxy.addFluid("bioethanol", "Bio Ethanol", Materials.Ethanol, 1, 295, GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Ethanol, 1L), ItemUtils.getEmptyCell(), 1000); - Meta_GT_Proxy.addFluid("sulfuricacid", "Sulfuric Acid", Materials.SulfuricAcid, 1, 295, GT_OreDictUnificator.get(OrePrefixes.cell, Materials.SulfuricAcid, 1L), ItemUtils.getEmptyCell(), 1000); - Meta_GT_Proxy.addFluid("milk", "Milk", Materials.Milk, 1, 290, GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Milk, 1L), ItemUtils.getEmptyCell(), 1000); - Meta_GT_Proxy.addFluid("mcguffium", "Mc Guffium 239", Materials.McGuffium239, 1, 295, GT_OreDictUnificator.get(OrePrefixes.cell, Materials.McGuffium239, 1L), ItemUtils.getEmptyCell(), 1000); - Meta_GT_Proxy.addFluid("glue", "Glue", Materials.Glue, 1, 295, GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Glue, 1L), ItemUtils.getEmptyCell(), 1000); - */ + /* + * Meta_GT_Proxy.addFluid("lubricant", "Lubricant", Materials.Lubricant, 1, 295, + * GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Lubricant, 1L), ItemUtils.getEmptyCell(), 1000); + * Meta_GT_Proxy.addFluid("creosote", "Creosote Oil", Materials.Creosote, 1, 295, + * GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Creosote, 1L), ItemUtils.getEmptyCell(), 1000); + * Meta_GT_Proxy.addFluid("seedoil", "Seed Oil", Materials.SeedOil, 1, 295, + * GT_OreDictUnificator.get(OrePrefixes.cell, Materials.SeedOil, 1L), ItemUtils.getEmptyCell(), 1000); + * Meta_GT_Proxy.addFluid("fishoil", "Fish Oil", Materials.FishOil, 1, 295, + * GT_OreDictUnificator.get(OrePrefixes.cell, Materials.FishOil, 1L), ItemUtils.getEmptyCell(), 1000); + * Meta_GT_Proxy.addFluid("oil", "Oil", Materials.Oil, 1, 295, GT_OreDictUnificator.get(OrePrefixes.cell, + * Materials.Oil, 1L), ItemUtils.getEmptyCell(), 1000); Meta_GT_Proxy.addFluid("fuel", "Diesel", Materials.Fuel, + * 1, 295, GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Fuel, 1L), ItemUtils.getEmptyCell(), 1000); + * Meta_GT_Proxy.addFluid("for.honey", "Honey", Materials.Honey, 1, 295, + * GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Honey, 1L), ItemUtils.getEmptyCell(), 1000); + * Meta_GT_Proxy.addFluid("biomass", "Biomass", Materials.Biomass, 1, 295, + * GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Biomass, 1L), ItemUtils.getEmptyCell(), 1000); + * Meta_GT_Proxy.addFluid("bioethanol", "Bio Ethanol", Materials.Ethanol, 1, 295, + * GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Ethanol, 1L), ItemUtils.getEmptyCell(), 1000); + * Meta_GT_Proxy.addFluid("sulfuricacid", "Sulfuric Acid", Materials.SulfuricAcid, 1, 295, + * GT_OreDictUnificator.get(OrePrefixes.cell, Materials.SulfuricAcid, 1L), ItemUtils.getEmptyCell(), 1000); + * Meta_GT_Proxy.addFluid("milk", "Milk", Materials.Milk, 1, 290, GT_OreDictUnificator.get(OrePrefixes.cell, + * Materials.Milk, 1L), ItemUtils.getEmptyCell(), 1000); Meta_GT_Proxy.addFluid("mcguffium", "Mc Guffium 239", + * Materials.McGuffium239, 1, 295, GT_OreDictUnificator.get(OrePrefixes.cell, Materials.McGuffium239, 1L), + * ItemUtils.getEmptyCell(), 1000); Meta_GT_Proxy.addFluid("glue", "Glue", Materials.Glue, 1, 295, + * GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Glue, 1L), ItemUtils.getEmptyCell(), 1000); + */ if (!LoadedMods.ThermalFoundation) { @@ -90,7 +103,10 @@ public class GregtechFluidHandler { generateIC2FluidCell("HydrofluoricAcid"); FluidUtils.generateFluidNoPrefix( - "SulfurDioxide", "High Quality Sulfur Dioxide", 263, GT_Materials.SulfurDioxide.mRGBa); + "SulfurDioxide", + "High Quality Sulfur Dioxide", + 263, + GT_Materials.SulfurDioxide.mRGBa); FluidUtils.addGtFluid( "sulfurousAcid", diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/CasingTextureHandler.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/CasingTextureHandler.java index 467602ce04..ef2d25cf3e 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/CasingTextureHandler.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/CasingTextureHandler.java @@ -1,10 +1,11 @@ package gtPlusPlus.xmod.gregtech.common.blocks.textures; -import gregtech.api.enums.Textures; -import gtPlusPlus.xmod.gregtech.common.blocks.GregtechMetaCasingBlocks; import net.minecraft.util.IIcon; import net.minecraft.world.IBlockAccess; +import gregtech.api.enums.Textures; +import gtPlusPlus.xmod.gregtech.common.blocks.GregtechMetaCasingBlocks; + public class CasingTextureHandler { // private static final TexturesGregtech59 gregtech59 = new TexturesGregtech59(); @@ -14,46 +15,46 @@ public class CasingTextureHandler { public static IIcon getIcon(final int aSide, final int aMeta) { // Texture ID's. case 0 == ID[57] if ((aMeta >= 0) && (aMeta < 16)) { switch (aMeta) { - // Centrifuge + // Centrifuge case 0: return TexturesGtBlock.Casing_Material_Centrifuge.getIcon(); - // Coke Oven Frame + // Coke Oven Frame case 1: return TexturesGtBlock.Casing_Material_Tantalloy61.getIcon(); - // Coke Oven Casing Tier 1 + // Coke Oven Casing Tier 1 case 2: return Textures.BlockIcons.MACHINE_CASING_FIREBOX_BRONZE.getIcon(); - // Coke Oven Casing Tier 2 + // Coke Oven Casing Tier 2 case 3: return Textures.BlockIcons.MACHINE_CASING_FIREBOX_STEEL.getIcon(); - // Material Press Casings + // Material Press Casings case 4: return Textures.BlockIcons.MACHINE_CASING_STABLE_TITANIUM.getIcon(); - // Electrolyzer Casings + // Electrolyzer Casings case 5: return TexturesGtBlock.Casing_Material_Potin.getIcon(); - // Broken Blue Fusion Casings + // Broken Blue Fusion Casings case 6: return TexturesGtBlock.Casing_Material_MaragingSteel.getIcon(); - // Maceration Stack Casings + // Maceration Stack Casings case 7: return TexturesGtBlock.Casing_Material_Tumbaga.getIcon(); - // Broken Pink Fusion Casings + // Broken Pink Fusion Casings case 8: return TexturesGtBlock.TEXTURE_ORGANIC_PANEL_A_GLOWING.getIcon(); - // Matter Fabricator Casings + // Matter Fabricator Casings case 9: return TexturesGtBlock.TEXTURE_METAL_PANEL_F.getIcon(); - // Iron Blast Fuance Textures + // Iron Blast Fuance Textures case 10: return TexturesGtBlock.Casing_Machine_Simple_Top.getIcon(); - // Multitank Exterior Casing + // Multitank Exterior Casing case 11: return TexturesGtBlock.Casing_Material_Grisium.getIcon(); - // Reactor Casing I + // Reactor Casing I case 12: return TexturesGtBlock.Casing_Material_Stellite.getIcon(); - // Reactor Casing II + // Reactor Casing II case 13: return TexturesGtBlock.Casing_Material_Zeron100.getIcon(); case 14: @@ -68,17 +69,13 @@ public class CasingTextureHandler { return Textures.BlockIcons.MACHINE_CASING_GEARBOX_TUNGSTENSTEEL.getIcon(); } - public static IIcon handleCasingsGT( - final IBlockAccess aWorld, - final int xCoord, - final int yCoord, - final int zCoord, - final int aSide, - final GregtechMetaCasingBlocks thisBlock) { - /*if (CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK){ - return gregtech59.handleCasingsGT59(aWorld, xCoord, yCoord, zCoord, aSide, thisBlock); - } - return gregtech58.handleCasingsGT58(aWorld, xCoord, yCoord, zCoord, aSide, thisBlock);*/ + public static IIcon handleCasingsGT(final IBlockAccess aWorld, final int xCoord, final int yCoord, final int zCoord, + final int aSide, final GregtechMetaCasingBlocks thisBlock) { + /* + * if (CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK){ return gregtech59.handleCasingsGT59(aWorld, xCoord, yCoord, + * zCoord, aSide, thisBlock); } return gregtech58.handleCasingsGT58(aWorld, xCoord, yCoord, zCoord, aSide, + * thisBlock); + */ return gregtechX.handleCasingsGT(aWorld, xCoord, yCoord, zCoord, aSide, thisBlock); } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/CasingTextureHandler2.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/CasingTextureHandler2.java index 20519c0bb1..1d0f5e0699 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/CasingTextureHandler2.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/CasingTextureHandler2.java @@ -1,8 +1,9 @@ package gtPlusPlus.xmod.gregtech.common.blocks.textures; -import gregtech.api.enums.Textures; import net.minecraft.util.IIcon; +import gregtech.api.enums.Textures; + public class CasingTextureHandler2 { public static IIcon getIcon(final int aSide, final int aMeta) { // Texture ID's. case 0 == ID[57] diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/CasingTextureHandler3.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/CasingTextureHandler3.java index da2a09c7d2..c3d2e90c12 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/CasingTextureHandler3.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/CasingTextureHandler3.java @@ -1,8 +1,9 @@ package gtPlusPlus.xmod.gregtech.common.blocks.textures; -import gtPlusPlus.xmod.gregtech.common.blocks.GregtechMetaCasingBlocks3; import net.minecraft.util.IIcon; +import gtPlusPlus.xmod.gregtech.common.blocks.GregtechMetaCasingBlocks3; + public class CasingTextureHandler3 { public static IIcon getIcon(final int aSide, final int aMeta) { // Texture ID's. case 0 == ID[57] diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesCentrifugeMultiblock.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesCentrifugeMultiblock.java index 2eef9d37f0..129dbd13cc 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesCentrifugeMultiblock.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesCentrifugeMultiblock.java @@ -1,13 +1,14 @@ package gtPlusPlus.xmod.gregtech.common.blocks.textures; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.IIcon; +import net.minecraft.world.IBlockAccess; + import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gtPlusPlus.xmod.gregtech.common.blocks.GregtechMetaCasingBlocks; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock.CustomIcon; import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing.GregtechMetaTileEntity_IndustrialCentrifuge; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.IIcon; -import net.minecraft.world.IBlockAccess; public class TexturesCentrifugeMultiblock { @@ -49,37 +50,15 @@ public class TexturesCentrifugeMultiblock { private static CustomIcon frontFace_8 = (GT8_9); private static CustomIcon frontFaceActive_8 = (GT8_9_Active); - CustomIcon[] CENTRIFUGE = new CustomIcon[] { - frontFace_0, - frontFace_1, - frontFace_2, - frontFace_3, - frontFace_4, - frontFace_5, - frontFace_6, - frontFace_7, - frontFace_8 - }; + CustomIcon[] CENTRIFUGE = new CustomIcon[] { frontFace_0, frontFace_1, frontFace_2, frontFace_3, frontFace_4, + frontFace_5, frontFace_6, frontFace_7, frontFace_8 }; - CustomIcon[] CENTRIFUGE_ACTIVE = new CustomIcon[] { - frontFaceActive_0, - frontFaceActive_1, - frontFaceActive_2, - frontFaceActive_3, - frontFaceActive_4, - frontFaceActive_5, - frontFaceActive_6, - frontFaceActive_7, - frontFaceActive_8 - }; + CustomIcon[] CENTRIFUGE_ACTIVE = new CustomIcon[] { frontFaceActive_0, frontFaceActive_1, frontFaceActive_2, + frontFaceActive_3, frontFaceActive_4, frontFaceActive_5, frontFaceActive_6, frontFaceActive_7, + frontFaceActive_8 }; - public IIcon handleCasingsGT( - final IBlockAccess aWorld, - final int xCoord, - final int yCoord, - final int zCoord, - final int aSide, - final GregtechMetaCasingBlocks thisBlock) { + public IIcon handleCasingsGT(final IBlockAccess aWorld, final int xCoord, final int yCoord, final int zCoord, + final int aSide, final GregtechMetaCasingBlocks thisBlock) { return this.handleCasingsGT58(aWorld, xCoord, yCoord, zCoord, aSide, thisBlock); } @@ -88,17 +67,13 @@ public class TexturesCentrifugeMultiblock { if (!(tTileEntity instanceof IGregTechTileEntity)) return 0; IGregTechTileEntity tTile = (IGregTechTileEntity) tTileEntity; if (tTile.getMetaTileEntity() instanceof GregtechMetaTileEntity_IndustrialCentrifuge - && tTile.getFrontFacing() == aSide) return tTile.isActive() ? 1 : 2; + && tTile.getFrontFacing() == aSide) + return tTile.isActive() ? 1 : 2; return 0; } - public IIcon handleCasingsGT58( - final IBlockAccess aWorld, - final int xCoord, - final int yCoord, - final int zCoord, - final int aSide, - final GregtechMetaCasingBlocks thisBlock) { + public IIcon handleCasingsGT58(final IBlockAccess aWorld, final int xCoord, final int yCoord, final int zCoord, + final int aSide, final GregtechMetaCasingBlocks thisBlock) { final int tMeta = aWorld.getBlockMetadata(xCoord, yCoord, zCoord); if (tMeta != 0) { return CasingTextureHandler.getIcon(aSide, tMeta); @@ -110,9 +85,8 @@ public class TexturesCentrifugeMultiblock { for (int j = -1; j < 2; j++) { if (i == 0 && j == 0) continue; if (isCentrifugeControllerWithSide(aWorld, xCoord + j, yCoord, zCoord + i, aSide) != 0) { - IMetaTileEntity tMetaTileEntity = ((IGregTechTileEntity) - aWorld.getTileEntity(xCoord + j, yCoord, zCoord + i)) - .getMetaTileEntity(); + IMetaTileEntity tMetaTileEntity = ((IGregTechTileEntity) aWorld + .getTileEntity(xCoord + j, yCoord, zCoord + i)).getMetaTileEntity(); return getIconByIndex(tMetaTileEntity, 4 - i * 3 - j); } } @@ -123,9 +97,8 @@ public class TexturesCentrifugeMultiblock { for (int j = -1; j < 2; j++) { if (i == 0 && j == 0) continue; if (isCentrifugeControllerWithSide(aWorld, xCoord + j, yCoord + i, zCoord, aSide) != 0) { - IMetaTileEntity tMetaTileEntity = ((IGregTechTileEntity) - aWorld.getTileEntity(xCoord + j, yCoord + i, zCoord)) - .getMetaTileEntity(); + IMetaTileEntity tMetaTileEntity = ((IGregTechTileEntity) aWorld + .getTileEntity(xCoord + j, yCoord + i, zCoord)).getMetaTileEntity(); return getIconByIndex(tMetaTileEntity, 4 + i * 3 - j * tInvertLeftRightMod); } } @@ -136,9 +109,8 @@ public class TexturesCentrifugeMultiblock { for (int j = -1; j < 2; j++) { if (i == 0 && j == 0) continue; if (isCentrifugeControllerWithSide(aWorld, xCoord, yCoord + i, zCoord + j, aSide) != 0) { - IMetaTileEntity tMetaTileEntity = ((IGregTechTileEntity) - aWorld.getTileEntity(xCoord, yCoord + i, zCoord + j)) - .getMetaTileEntity(); + IMetaTileEntity tMetaTileEntity = ((IGregTechTileEntity) aWorld + .getTileEntity(xCoord, yCoord + i, zCoord + j)).getMetaTileEntity(); return getIconByIndex(tMetaTileEntity, 4 + i * 3 + j * tInvertLeftRightMod); } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGregtech58.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGregtech58.java index 2298e0731e..d8c84f1886 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGregtech58.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGregtech58.java @@ -1,42 +1,43 @@ package gtPlusPlus.xmod.gregtech.common.blocks.textures; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.IIcon; +import net.minecraft.world.IBlockAccess; + import gregtech.api.enums.Textures; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gtPlusPlus.xmod.gregtech.common.blocks.GregtechMetaCasingBlocks; import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing.GregtechMetaTileEntity_IndustrialCentrifuge; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.IIcon; -import net.minecraft.world.IBlockAccess; public class TexturesGregtech58 { - private static Textures.BlockIcons.CustomIcon GT8_1_Active = - new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE_ACTIVE1"); + private static Textures.BlockIcons.CustomIcon GT8_1_Active = new Textures.BlockIcons.CustomIcon( + "iconsets/LARGETURBINE_ACTIVE1"); private static Textures.BlockIcons.CustomIcon GT8_1 = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE1"); - private static Textures.BlockIcons.CustomIcon GT8_2_Active = - new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE_ACTIVE2"); + private static Textures.BlockIcons.CustomIcon GT8_2_Active = new Textures.BlockIcons.CustomIcon( + "iconsets/LARGETURBINE_ACTIVE2"); private static Textures.BlockIcons.CustomIcon GT8_2 = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE2"); - private static Textures.BlockIcons.CustomIcon GT8_3_Active = - new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE_ACTIVE3"); + private static Textures.BlockIcons.CustomIcon GT8_3_Active = new Textures.BlockIcons.CustomIcon( + "iconsets/LARGETURBINE_ACTIVE3"); private static Textures.BlockIcons.CustomIcon GT8_3 = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE3"); - private static Textures.BlockIcons.CustomIcon GT8_4_Active = - new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE_ACTIVE4"); + private static Textures.BlockIcons.CustomIcon GT8_4_Active = new Textures.BlockIcons.CustomIcon( + "iconsets/LARGETURBINE_ACTIVE4"); private static Textures.BlockIcons.CustomIcon GT8_4 = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE4"); - private static Textures.BlockIcons.CustomIcon GT8_5_Active = - new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE_ACTIVE5"); + private static Textures.BlockIcons.CustomIcon GT8_5_Active = new Textures.BlockIcons.CustomIcon( + "iconsets/LARGETURBINE_ACTIVE5"); private static Textures.BlockIcons.CustomIcon GT8_5 = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE5"); - private static Textures.BlockIcons.CustomIcon GT8_6_Active = - new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE_ACTIVE6"); + private static Textures.BlockIcons.CustomIcon GT8_6_Active = new Textures.BlockIcons.CustomIcon( + "iconsets/LARGETURBINE_ACTIVE6"); private static Textures.BlockIcons.CustomIcon GT8_6 = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE6"); - private static Textures.BlockIcons.CustomIcon GT8_7_Active = - new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE_ACTIVE7"); + private static Textures.BlockIcons.CustomIcon GT8_7_Active = new Textures.BlockIcons.CustomIcon( + "iconsets/LARGETURBINE_ACTIVE7"); private static Textures.BlockIcons.CustomIcon GT8_7 = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE7"); - private static Textures.BlockIcons.CustomIcon GT8_8_Active = - new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE_ACTIVE8"); + private static Textures.BlockIcons.CustomIcon GT8_8_Active = new Textures.BlockIcons.CustomIcon( + "iconsets/LARGETURBINE_ACTIVE8"); private static Textures.BlockIcons.CustomIcon GT8_8 = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE8"); - private static Textures.BlockIcons.CustomIcon GT8_9_Active = - new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE_ACTIVE9"); + private static Textures.BlockIcons.CustomIcon GT8_9_Active = new Textures.BlockIcons.CustomIcon( + "iconsets/LARGETURBINE_ACTIVE9"); private static Textures.BlockIcons.CustomIcon GT8_9 = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE9"); private static Textures.BlockIcons.CustomIcon frontFace_0 = (GT8_1); @@ -58,47 +59,20 @@ public class TexturesGregtech58 { private static Textures.BlockIcons.CustomIcon frontFace_8 = (GT8_9); private static Textures.BlockIcons.CustomIcon frontFaceActive_8 = (GT8_9_Active); - Textures.BlockIcons.CustomIcon[] TURBINE = new Textures.BlockIcons.CustomIcon[] { - frontFace_0, - frontFace_1, - frontFace_2, - frontFace_3, - frontFace_4, - frontFace_5, - frontFace_6, - frontFace_7, - frontFace_8 - }; + Textures.BlockIcons.CustomIcon[] TURBINE = new Textures.BlockIcons.CustomIcon[] { frontFace_0, frontFace_1, + frontFace_2, frontFace_3, frontFace_4, frontFace_5, frontFace_6, frontFace_7, frontFace_8 }; - Textures.BlockIcons.CustomIcon[] TURBINE_ACTIVE = new Textures.BlockIcons.CustomIcon[] { - frontFaceActive_0, - frontFaceActive_1, - frontFaceActive_2, - frontFaceActive_3, - frontFaceActive_4, - frontFaceActive_5, - frontFaceActive_6, - frontFaceActive_7, - frontFaceActive_8 - }; + Textures.BlockIcons.CustomIcon[] TURBINE_ACTIVE = new Textures.BlockIcons.CustomIcon[] { frontFaceActive_0, + frontFaceActive_1, frontFaceActive_2, frontFaceActive_3, frontFaceActive_4, frontFaceActive_5, + frontFaceActive_6, frontFaceActive_7, frontFaceActive_8 }; - public IIcon handleCasingsGT( - final IBlockAccess aWorld, - final int xCoord, - final int yCoord, - final int zCoord, - final int aSide, - final GregtechMetaCasingBlocks thisBlock) { + public IIcon handleCasingsGT(final IBlockAccess aWorld, final int xCoord, final int yCoord, final int zCoord, + final int aSide, final GregtechMetaCasingBlocks thisBlock) { return this.handleCasingsGT58(aWorld, xCoord, yCoord, zCoord, aSide, thisBlock); } - public IIcon handleCasingsGT58( - final IBlockAccess aWorld, - final int xCoord, - final int yCoord, - final int zCoord, - final int aSide, - final GregtechMetaCasingBlocks thisBlock) { + public IIcon handleCasingsGT58(final IBlockAccess aWorld, final int xCoord, final int yCoord, final int zCoord, + final int aSide, final GregtechMetaCasingBlocks thisBlock) { final int tMeta = aWorld.getBlockMetadata(xCoord, yCoord, zCoord); if (((tMeta != 6) && (tMeta != 8) && (tMeta != 0))) { return CasingTextureHandler.getIcon(aSide, tMeta); @@ -275,19 +249,18 @@ public class TexturesGregtech58 { return Textures.BlockIcons.MACHINE_CASING_SOLID_STEEL.getIcon(); } final boolean[] tConnectedSides = { - (aWorld.getBlock(xCoord, yCoord - 1, zCoord) == thisBlock) - && (aWorld.getBlockMetadata(xCoord, yCoord - 1, zCoord) == tMeta), - (aWorld.getBlock(xCoord, yCoord + 1, zCoord) == thisBlock) - && (aWorld.getBlockMetadata(xCoord, yCoord + 1, zCoord) == tMeta), - (aWorld.getBlock(xCoord + 1, yCoord, zCoord) == thisBlock) - && (aWorld.getBlockMetadata(xCoord + 1, yCoord, zCoord) == tMeta), - (aWorld.getBlock(xCoord, yCoord, zCoord + 1) == thisBlock) - && (aWorld.getBlockMetadata(xCoord, yCoord, zCoord + 1) == tMeta), - (aWorld.getBlock(xCoord - 1, yCoord, zCoord) == thisBlock) - && (aWorld.getBlockMetadata(xCoord - 1, yCoord, zCoord) == tMeta), - (aWorld.getBlock(xCoord, yCoord, zCoord - 1) == thisBlock) - && (aWorld.getBlockMetadata(xCoord, yCoord, zCoord - 1) == tMeta) - }; + (aWorld.getBlock(xCoord, yCoord - 1, zCoord) == thisBlock) + && (aWorld.getBlockMetadata(xCoord, yCoord - 1, zCoord) == tMeta), + (aWorld.getBlock(xCoord, yCoord + 1, zCoord) == thisBlock) + && (aWorld.getBlockMetadata(xCoord, yCoord + 1, zCoord) == tMeta), + (aWorld.getBlock(xCoord + 1, yCoord, zCoord) == thisBlock) + && (aWorld.getBlockMetadata(xCoord + 1, yCoord, zCoord) == tMeta), + (aWorld.getBlock(xCoord, yCoord, zCoord + 1) == thisBlock) + && (aWorld.getBlockMetadata(xCoord, yCoord, zCoord + 1) == tMeta), + (aWorld.getBlock(xCoord - 1, yCoord, zCoord) == thisBlock) + && (aWorld.getBlockMetadata(xCoord - 1, yCoord, zCoord) == tMeta), + (aWorld.getBlock(xCoord, yCoord, zCoord - 1) == thisBlock) + && (aWorld.getBlockMetadata(xCoord, yCoord, zCoord - 1) == tMeta) }; switch (aSide) { case 0: if (tConnectedSides[0]) { diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGregtech59.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGregtech59.java index 990db20285..45de7da05f 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGregtech59.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGregtech59.java @@ -1,52 +1,53 @@ package gtPlusPlus.xmod.gregtech.common.blocks.textures; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.IIcon; +import net.minecraft.world.IBlockAccess; + import gregtech.api.enums.Textures; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gtPlusPlus.xmod.gregtech.common.blocks.GregtechMetaCasingBlocks; import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing.GregtechMetaTileEntity_IndustrialCentrifuge; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.IIcon; -import net.minecraft.world.IBlockAccess; public class TexturesGregtech59 { - private static Textures.BlockIcons.CustomIcon GT8_1_Active = - new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE_ST_ACTIVE1"); - private static Textures.BlockIcons.CustomIcon GT8_1 = - new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE_ST1"); - private static Textures.BlockIcons.CustomIcon GT8_2_Active = - new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE_ST_ACTIVE2"); - private static Textures.BlockIcons.CustomIcon GT8_2 = - new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE_ST2"); - private static Textures.BlockIcons.CustomIcon GT8_3_Active = - new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE_ST_ACTIVE3"); - private static Textures.BlockIcons.CustomIcon GT8_3 = - new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE_ST3"); - private static Textures.BlockIcons.CustomIcon GT8_4_Active = - new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE_ST_ACTIVE4"); - private static Textures.BlockIcons.CustomIcon GT8_4 = - new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE_ST4"); - private static Textures.BlockIcons.CustomIcon GT8_5_Active = - new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE_ST_ACTIVE5"); - private static Textures.BlockIcons.CustomIcon GT8_5 = - new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE_ST5"); - private static Textures.BlockIcons.CustomIcon GT8_6_Active = - new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE_ST_ACTIVE6"); - private static Textures.BlockIcons.CustomIcon GT8_6 = - new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE_ST6"); - private static Textures.BlockIcons.CustomIcon GT8_7_Active = - new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE_ST_ACTIVE7"); - private static Textures.BlockIcons.CustomIcon GT8_7 = - new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE_ST7"); - private static Textures.BlockIcons.CustomIcon GT8_8_Active = - new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE_ST_ACTIVE8"); - private static Textures.BlockIcons.CustomIcon GT8_8 = - new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE_ST8"); - private static Textures.BlockIcons.CustomIcon GT8_9_Active = - new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE_ST_ACTIVE9"); - private static Textures.BlockIcons.CustomIcon GT8_9 = - new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE_ST9"); + private static Textures.BlockIcons.CustomIcon GT8_1_Active = new Textures.BlockIcons.CustomIcon( + "iconsets/LARGETURBINE_ST_ACTIVE1"); + private static Textures.BlockIcons.CustomIcon GT8_1 = new Textures.BlockIcons.CustomIcon( + "iconsets/LARGETURBINE_ST1"); + private static Textures.BlockIcons.CustomIcon GT8_2_Active = new Textures.BlockIcons.CustomIcon( + "iconsets/LARGETURBINE_ST_ACTIVE2"); + private static Textures.BlockIcons.CustomIcon GT8_2 = new Textures.BlockIcons.CustomIcon( + "iconsets/LARGETURBINE_ST2"); + private static Textures.BlockIcons.CustomIcon GT8_3_Active = new Textures.BlockIcons.CustomIcon( + "iconsets/LARGETURBINE_ST_ACTIVE3"); + private static Textures.BlockIcons.CustomIcon GT8_3 = new Textures.BlockIcons.CustomIcon( + "iconsets/LARGETURBINE_ST3"); + private static Textures.BlockIcons.CustomIcon GT8_4_Active = new Textures.BlockIcons.CustomIcon( + "iconsets/LARGETURBINE_ST_ACTIVE4"); + private static Textures.BlockIcons.CustomIcon GT8_4 = new Textures.BlockIcons.CustomIcon( + "iconsets/LARGETURBINE_ST4"); + private static Textures.BlockIcons.CustomIcon GT8_5_Active = new Textures.BlockIcons.CustomIcon( + "iconsets/LARGETURBINE_ST_ACTIVE5"); + private static Textures.BlockIcons.CustomIcon GT8_5 = new Textures.BlockIcons.CustomIcon( + "iconsets/LARGETURBINE_ST5"); + private static Textures.BlockIcons.CustomIcon GT8_6_Active = new Textures.BlockIcons.CustomIcon( + "iconsets/LARGETURBINE_ST_ACTIVE6"); + private static Textures.BlockIcons.CustomIcon GT8_6 = new Textures.BlockIcons.CustomIcon( + "iconsets/LARGETURBINE_ST6"); + private static Textures.BlockIcons.CustomIcon GT8_7_Active = new Textures.BlockIcons.CustomIcon( + "iconsets/LARGETURBINE_ST_ACTIVE7"); + private static Textures.BlockIcons.CustomIcon GT8_7 = new Textures.BlockIcons.CustomIcon( + "iconsets/LARGETURBINE_ST7"); + private static Textures.BlockIcons.CustomIcon GT8_8_Active = new Textures.BlockIcons.CustomIcon( + "iconsets/LARGETURBINE_ST_ACTIVE8"); + private static Textures.BlockIcons.CustomIcon GT8_8 = new Textures.BlockIcons.CustomIcon( + "iconsets/LARGETURBINE_ST8"); + private static Textures.BlockIcons.CustomIcon GT8_9_Active = new Textures.BlockIcons.CustomIcon( + "iconsets/LARGETURBINE_ST_ACTIVE9"); + private static Textures.BlockIcons.CustomIcon GT8_9 = new Textures.BlockIcons.CustomIcon( + "iconsets/LARGETURBINE_ST9"); private static Textures.BlockIcons.CustomIcon frontFace_0 = (GT8_1); private static Textures.BlockIcons.CustomIcon frontFaceActive_0 = (GT8_1_Active); @@ -67,47 +68,20 @@ public class TexturesGregtech59 { private static Textures.BlockIcons.CustomIcon frontFace_8 = (GT8_9); private static Textures.BlockIcons.CustomIcon frontFaceActive_8 = (GT8_9_Active); - Textures.BlockIcons.CustomIcon[] TURBINE = new Textures.BlockIcons.CustomIcon[] { - frontFace_0, - frontFace_1, - frontFace_2, - frontFace_3, - frontFace_4, - frontFace_5, - frontFace_6, - frontFace_7, - frontFace_8 - }; + Textures.BlockIcons.CustomIcon[] TURBINE = new Textures.BlockIcons.CustomIcon[] { frontFace_0, frontFace_1, + frontFace_2, frontFace_3, frontFace_4, frontFace_5, frontFace_6, frontFace_7, frontFace_8 }; - Textures.BlockIcons.CustomIcon[] TURBINE_ACTIVE = new Textures.BlockIcons.CustomIcon[] { - frontFaceActive_0, - frontFaceActive_1, - frontFaceActive_2, - frontFaceActive_3, - frontFaceActive_4, - frontFaceActive_5, - frontFaceActive_6, - frontFaceActive_7, - frontFaceActive_8 - }; + Textures.BlockIcons.CustomIcon[] TURBINE_ACTIVE = new Textures.BlockIcons.CustomIcon[] { frontFaceActive_0, + frontFaceActive_1, frontFaceActive_2, frontFaceActive_3, frontFaceActive_4, frontFaceActive_5, + frontFaceActive_6, frontFaceActive_7, frontFaceActive_8 }; - public IIcon handleCasingsGT( - final IBlockAccess aWorld, - final int xCoord, - final int yCoord, - final int zCoord, - final int aSide, - final GregtechMetaCasingBlocks thisBlock) { + public IIcon handleCasingsGT(final IBlockAccess aWorld, final int xCoord, final int yCoord, final int zCoord, + final int aSide, final GregtechMetaCasingBlocks thisBlock) { return this.handleCasingsGT59(aWorld, xCoord, yCoord, zCoord, aSide, thisBlock); } - public IIcon handleCasingsGT59( - final IBlockAccess aWorld, - final int xCoord, - final int yCoord, - final int zCoord, - final int aSide, - final GregtechMetaCasingBlocks thisBlock) { + public IIcon handleCasingsGT59(final IBlockAccess aWorld, final int xCoord, final int yCoord, final int zCoord, + final int aSide, final GregtechMetaCasingBlocks thisBlock) { final int tMeta = aWorld.getBlockMetadata(xCoord, yCoord, zCoord); if (((tMeta != 6) && (tMeta != 8) && (tMeta != 0))) { return CasingTextureHandler.getIcon(aSide, tMeta); @@ -284,19 +258,18 @@ public class TexturesGregtech59 { return Textures.BlockIcons.MACHINE_CASING_SOLID_STEEL.getIcon(); } final boolean[] tConnectedSides = { - (aWorld.getBlock(xCoord, yCoord - 1, zCoord) == thisBlock) - && (aWorld.getBlockMetadata(xCoord, yCoord - 1, zCoord) == tMeta), - (aWorld.getBlock(xCoord, yCoord + 1, zCoord) == thisBlock) - && (aWorld.getBlockMetadata(xCoord, yCoord + 1, zCoord) == tMeta), - (aWorld.getBlock(xCoord + 1, yCoord, zCoord) == thisBlock) - && (aWorld.getBlockMetadata(xCoord + 1, yCoord, zCoord) == tMeta), - (aWorld.getBlock(xCoord, yCoord, zCoord + 1) == thisBlock) - && (aWorld.getBlockMetadata(xCoord, yCoord, zCoord + 1) == tMeta), - (aWorld.getBlock(xCoord - 1, yCoord, zCoord) == thisBlock) - && (aWorld.getBlockMetadata(xCoord - 1, yCoord, zCoord) == tMeta), - (aWorld.getBlock(xCoord, yCoord, zCoord - 1) == thisBlock) - && (aWorld.getBlockMetadata(xCoord, yCoord, zCoord - 1) == tMeta) - }; + (aWorld.getBlock(xCoord, yCoord - 1, zCoord) == thisBlock) + && (aWorld.getBlockMetadata(xCoord, yCoord - 1, zCoord) == tMeta), + (aWorld.getBlock(xCoord, yCoord + 1, zCoord) == thisBlock) + && (aWorld.getBlockMetadata(xCoord, yCoord + 1, zCoord) == tMeta), + (aWorld.getBlock(xCoord + 1, yCoord, zCoord) == thisBlock) + && (aWorld.getBlockMetadata(xCoord + 1, yCoord, zCoord) == tMeta), + (aWorld.getBlock(xCoord, yCoord, zCoord + 1) == thisBlock) + && (aWorld.getBlockMetadata(xCoord, yCoord, zCoord + 1) == tMeta), + (aWorld.getBlock(xCoord - 1, yCoord, zCoord) == thisBlock) + && (aWorld.getBlockMetadata(xCoord - 1, yCoord, zCoord) == tMeta), + (aWorld.getBlock(xCoord, yCoord, zCoord - 1) == thisBlock) + && (aWorld.getBlockMetadata(xCoord, yCoord, zCoord - 1) == tMeta) }; switch (aSide) { case 0: if (tConnectedSides[0]) { diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGrinderMultiblock.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGrinderMultiblock.java index e2d304572a..9e6c66fd93 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGrinderMultiblock.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGrinderMultiblock.java @@ -1,13 +1,14 @@ package gtPlusPlus.xmod.gregtech.common.blocks.textures; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.IIcon; +import net.minecraft.world.IBlockAccess; + import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gtPlusPlus.xmod.gregtech.common.blocks.GregtechMetaCasingBlocks5; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock.CustomIcon; import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing.GregtechMetaTileEntity_IsaMill; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.IIcon; -import net.minecraft.world.IBlockAccess; public class TexturesGrinderMultiblock { @@ -49,29 +50,12 @@ public class TexturesGrinderMultiblock { private static CustomIcon frontFace_8 = (GT8_9); private static CustomIcon frontFaceActive_8 = (GT8_9_Active); - CustomIcon[] GRINDER = new CustomIcon[] { - frontFace_0, - frontFace_1, - frontFace_2, - frontFace_3, - frontFace_4, - frontFace_5, - frontFace_6, - frontFace_7, - frontFace_8 - }; + CustomIcon[] GRINDER = new CustomIcon[] { frontFace_0, frontFace_1, frontFace_2, frontFace_3, frontFace_4, + frontFace_5, frontFace_6, frontFace_7, frontFace_8 }; - CustomIcon[] GRINDER_ACTIVE = new CustomIcon[] { - frontFaceActive_0, - frontFaceActive_1, - frontFaceActive_2, - frontFaceActive_3, - frontFaceActive_4, - frontFaceActive_5, - frontFaceActive_6, - frontFaceActive_7, - frontFaceActive_8 - }; + CustomIcon[] GRINDER_ACTIVE = new CustomIcon[] { frontFaceActive_0, frontFaceActive_1, frontFaceActive_2, + frontFaceActive_3, frontFaceActive_4, frontFaceActive_5, frontFaceActive_6, frontFaceActive_7, + frontFaceActive_8 }; private static int isIsaControllerWithSide(IBlockAccess aWorld, int aX, int aY, int aZ, int aSide) { TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); @@ -82,13 +66,8 @@ public class TexturesGrinderMultiblock { return 0; } - public IIcon handleCasingsGT( - final IBlockAccess aWorld, - final int xCoord, - final int yCoord, - final int zCoord, - final int aSide, - final GregtechMetaCasingBlocks5 ii) { + public IIcon handleCasingsGT(final IBlockAccess aWorld, final int xCoord, final int yCoord, final int zCoord, + final int aSide, final GregtechMetaCasingBlocks5 ii) { final int tMeta = aWorld.getBlockMetadata(xCoord, yCoord, zCoord); if (tMeta != 1) { return GregtechMetaCasingBlocks5.getStaticIcon(aSide, tMeta); @@ -100,9 +79,8 @@ public class TexturesGrinderMultiblock { for (int j = -1; j < 2; j++) { if (i == 0 && j == 0) continue; if (isIsaControllerWithSide(aWorld, xCoord + j, yCoord, zCoord + i, aSide) != 0) { - IMetaTileEntity tMetaTileEntity = ((IGregTechTileEntity) - aWorld.getTileEntity(xCoord + j, yCoord, zCoord + i)) - .getMetaTileEntity(); + IMetaTileEntity tMetaTileEntity = ((IGregTechTileEntity) aWorld + .getTileEntity(xCoord + j, yCoord, zCoord + i)).getMetaTileEntity(); return getIconByIndex(tMetaTileEntity, 4 - i * 3 - j); } } @@ -113,9 +91,8 @@ public class TexturesGrinderMultiblock { for (int j = -1; j < 2; j++) { if (i == 0 && j == 0) continue; if (isIsaControllerWithSide(aWorld, xCoord + j, yCoord + i, zCoord, aSide) != 0) { - IMetaTileEntity tMetaTileEntity = ((IGregTechTileEntity) - aWorld.getTileEntity(xCoord + j, yCoord + i, zCoord)) - .getMetaTileEntity(); + IMetaTileEntity tMetaTileEntity = ((IGregTechTileEntity) aWorld + .getTileEntity(xCoord + j, yCoord + i, zCoord)).getMetaTileEntity(); return getIconByIndex(tMetaTileEntity, 4 + i * 3 - j * tInvertLeftRightMod); } } @@ -126,9 +103,8 @@ public class TexturesGrinderMultiblock { for (int j = -1; j < 2; j++) { if (i == 0 && j == 0) continue; if (isIsaControllerWithSide(aWorld, xCoord, yCoord + i, zCoord + j, aSide) != 0) { - IMetaTileEntity tMetaTileEntity = ((IGregTechTileEntity) - aWorld.getTileEntity(xCoord, yCoord + i, zCoord + j)) - .getMetaTileEntity(); + IMetaTileEntity tMetaTileEntity = ((IGregTechTileEntity) aWorld + .getTileEntity(xCoord, yCoord + i, zCoord + j)).getMetaTileEntity(); return getIconByIndex(tMetaTileEntity, 4 + i * 3 + j * tInvertLeftRightMod); } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtBlock.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtBlock.java index 9ee32bcaa6..aede466688 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtBlock.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtBlock.java @@ -1,5 +1,9 @@ package gtPlusPlus.xmod.gregtech.common.blocks.textures; +import net.minecraft.client.renderer.texture.TextureMap; +import net.minecraft.util.IIcon; +import net.minecraft.util.ResourceLocation; + import gregtech.api.GregTech_API; import gregtech.api.interfaces.IIconContainer; import gregtech.api.interfaces.ITexture; @@ -7,9 +11,6 @@ import gregtech.api.objects.GT_RenderedTexture; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.api.objects.data.AutoMap; import gtPlusPlus.core.lib.CORE; -import net.minecraft.client.renderer.texture.TextureMap; -import net.minecraft.util.IIcon; -import net.minecraft.util.ResourceLocation; public class TexturesGtBlock { @@ -17,8 +18,7 @@ public class TexturesGtBlock { private static AutoMap<Runnable> mCustomiconMap = new AutoMap<Runnable>(); - static { - } + static {} // public static ITexture[] CASING_BLOCKS_GTPP = new ITexture[256]; @@ -27,6 +27,7 @@ public class TexturesGtBlock { */ public static class CustomIcon implements IIconContainer, Runnable { + protected IIcon mIcon; protected String mIconName; protected String mModID; @@ -56,8 +57,7 @@ public class TexturesGtBlock { @Override public void run() { this.mIcon = GregTech_API.sBlockIcons.registerIcon(this.mModID + ":" + this.mIconName); - Logger.WARNING( - "FIND ME _ Processing texture: " + this.getTextureFile().getResourcePath()); + Logger.WARNING("FIND ME _ Processing texture: " + this.getTextureFile().getResourcePath()); } @Override @@ -67,6 +67,7 @@ public class TexturesGtBlock { } public static class VanillaIcon implements IIconContainer, Runnable { + protected IIcon mIcon; protected String mIconName; @@ -103,9 +104,8 @@ public class TexturesGtBlock { } /* - * Add Some Custom Textures below. - * I am not sure whether or not I need to declare them as such, but better to be safe than sorry. - * Right? + * Add Some Custom Textures below. I am not sure whether or not I need to declare them as such, but better to be + * safe than sorry. Right? */ // Vanilla Textures @@ -117,15 +117,15 @@ public class TexturesGtBlock { // Energy overlays public static final CustomIcon OVERLAY_ENERGY_OUT_BUFFER = new CustomIcon("iconsets/OVERLAY_ENERGY_OUT_BUFFER"); - public static final CustomIcon OVERLAY_ENERGY_OUT_MULTI_BUFFER = - new CustomIcon("iconsets/OVERLAY_ENERGY_OUT_MULTI_BUFFER"); + public static final CustomIcon OVERLAY_ENERGY_OUT_MULTI_BUFFER = new CustomIcon( + "iconsets/OVERLAY_ENERGY_OUT_MULTI_BUFFER"); // Wooden Shelf and Compartment Overlays public static final CustomIcon OVERLAY_WOODEN_SHELF_FRONT = new CustomIcon("TileEntities/Compartment/wood_shelf"); - public static final CustomIcon OVERLAY_WOODEN_SHELF_CANS_FRONT = - new CustomIcon("TileEntities/Compartment/wood_shelf_cans"); - public static final CustomIcon OVERLAY_WOODEN_SHELF_PAPER_FRONT = - new CustomIcon("TileEntities/Compartment/wood_shelf_paper"); + public static final CustomIcon OVERLAY_WOODEN_SHELF_CANS_FRONT = new CustomIcon( + "TileEntities/Compartment/wood_shelf_cans"); + public static final CustomIcon OVERLAY_WOODEN_SHELF_PAPER_FRONT = new CustomIcon( + "TileEntities/Compartment/wood_shelf_paper"); public static final CustomIcon OVERLAY_CABINET_1 = new CustomIcon("TileEntities/Compartment/0"); public static final CustomIcon OVERLAY_CABINET_2 = new CustomIcon("TileEntities/Compartment/1"); public static final CustomIcon OVERLAY_CABINET_3 = new CustomIcon("TileEntities/Compartment/2"); @@ -160,19 +160,19 @@ public class TexturesGtBlock { public static final CustomIcon OVERLAY_COMPARTMENT_16 = new CustomIcon("TileEntities/Compartment/31"); // Controllers - private static final CustomIcon Internal_Casing_Fusion_Simple_Front = - new CustomIcon("TileEntities/MACHINE_CASING_FUSION_FRONT"); + private static final CustomIcon Internal_Casing_Fusion_Simple_Front = new CustomIcon( + "TileEntities/MACHINE_CASING_FUSION_FRONT"); public static final CustomIcon Casing_Fusion_Simple_Front = Internal_Casing_Fusion_Simple_Front; - private static final CustomIcon Internal_Casing_Fusion_Simple_Front_Active = - new CustomIcon("TileEntities/MACHINE_CASING_FUSION_FRONT_ACTIVE"); + private static final CustomIcon Internal_Casing_Fusion_Simple_Front_Active = new CustomIcon( + "TileEntities/MACHINE_CASING_FUSION_FRONT_ACTIVE"); public static final CustomIcon Casing_Fusion_Simple_Front_Active = Internal_Casing_Fusion_Simple_Front_Active; // Machine Casings // Simple private static final CustomIcon Internal_Casing_Machine_Simple_Top = new CustomIcon("TileEntities/machine_top"); public static final CustomIcon Casing_Machine_Simple_Top = Internal_Casing_Machine_Simple_Top; - private static final CustomIcon Internal_Casing_Machine_Simple_Bottom = - new CustomIcon("TileEntities/machine_bottom"); + private static final CustomIcon Internal_Casing_Machine_Simple_Bottom = new CustomIcon( + "TileEntities/machine_bottom"); public static final CustomIcon Casing_Machine_Simple_Bottom = Internal_Casing_Machine_Simple_Bottom; // Advanced and Ultra private static final CustomIcon Internal_Casing_Machine_Advanced = new CustomIcon("TileEntities/high_adv_machine"); @@ -180,90 +180,90 @@ public class TexturesGtBlock { private static final CustomIcon Internal_Casing_Machine_Ultra = new CustomIcon("TileEntities/adv_machine_lesu"); public static final CustomIcon Casing_Machine_Ultra = Internal_Casing_Machine_Ultra; // Dimensional - Non Overlay - private static final CustomIcon Internal_Casing_Machine_Dimensional = - new CustomIcon("TileEntities/adv_machine_dimensional"); + private static final CustomIcon Internal_Casing_Machine_Dimensional = new CustomIcon( + "TileEntities/adv_machine_dimensional"); public static final CustomIcon Casing_Machine_Dimensional = Internal_Casing_Machine_Dimensional; - private static final CustomIcon Internal_Casing_Machine_Dimensional_Adv = - new CustomIcon("TileEntities/high_adv_machine_dimensional"); + private static final CustomIcon Internal_Casing_Machine_Dimensional_Adv = new CustomIcon( + "TileEntities/high_adv_machine_dimensional"); public static final CustomIcon Casing_Machine_Dimensional_Adv = Internal_Casing_Machine_Dimensional_Adv; // Material Casings - private static final CustomIcon Internal_Casing_Tantalloy61 = - new CustomIcon("TileEntities/MACHINE_CASING_STABLE_TANTALLOY61"); + private static final CustomIcon Internal_Casing_Tantalloy61 = new CustomIcon( + "TileEntities/MACHINE_CASING_STABLE_TANTALLOY61"); public static final CustomIcon Casing_Material_Tantalloy61 = Internal_Casing_Tantalloy61; - private static final CustomIcon Internal_Casing_MaragingSteel = - new CustomIcon("TileEntities/MACHINE_CASING_STABLE_MARAGINGSTEEL"); + private static final CustomIcon Internal_Casing_MaragingSteel = new CustomIcon( + "TileEntities/MACHINE_CASING_STABLE_MARAGINGSTEEL"); public static final CustomIcon Casing_Material_MaragingSteel = Internal_Casing_MaragingSteel; - private static final CustomIcon Internal_Casing_Stellite = - new CustomIcon("TileEntities/MACHINE_CASING_STABLE_STELLITE"); + private static final CustomIcon Internal_Casing_Stellite = new CustomIcon( + "TileEntities/MACHINE_CASING_STABLE_STELLITE"); public static final CustomIcon Casing_Material_Stellite = Internal_Casing_Stellite; - private static final CustomIcon Internal_Casing_Talonite = - new CustomIcon("TileEntities/MACHINE_CASING_STABLE_TALONITE"); + private static final CustomIcon Internal_Casing_Talonite = new CustomIcon( + "TileEntities/MACHINE_CASING_STABLE_TALONITE"); public static final CustomIcon Casing_Material_Talonite = Internal_Casing_Talonite; private static final CustomIcon Internal_Turbine_SC_Casing = new TexturesGtBlock.CustomIcon("iconsets/SC_TURBINE"); public static final CustomIcon Turbine_SC_Material_Casing = Internal_Turbine_SC_Casing; - private static final CustomIcon Internal_Casing_Tumbaga = - new CustomIcon("TileEntities/MACHINE_CASING_STABLE_TUMBAGA"); + private static final CustomIcon Internal_Casing_Tumbaga = new CustomIcon( + "TileEntities/MACHINE_CASING_STABLE_TUMBAGA"); public static final CustomIcon Casing_Material_Tumbaga = Internal_Casing_Tumbaga; - private static final CustomIcon Internal_Casing_Zeron100 = - new CustomIcon("TileEntities/MACHINE_CASING_STABLE_ZERON100"); + private static final CustomIcon Internal_Casing_Zeron100 = new CustomIcon( + "TileEntities/MACHINE_CASING_STABLE_ZERON100"); public static final CustomIcon Casing_Material_Zeron100 = Internal_Casing_Zeron100; private static final CustomIcon Internal_Casing_Potin = new CustomIcon("TileEntities/MACHINE_CASING_STABLE_POTIN"); public static final CustomIcon Casing_Material_Potin = Internal_Casing_Potin; - private static final CustomIcon Internal_Casing_Grisium = - new CustomIcon("TileEntities/MACHINE_CASING_STABLE_GRISIUM"); + private static final CustomIcon Internal_Casing_Grisium = new CustomIcon( + "TileEntities/MACHINE_CASING_STABLE_GRISIUM"); public static final CustomIcon Casing_Material_Grisium = Internal_Casing_Grisium; - private static final CustomIcon Internal_Casing_RedSteel = - new CustomIcon("TileEntities/MACHINE_CASING_STABLE_RED_STEEL"); + private static final CustomIcon Internal_Casing_RedSteel = new CustomIcon( + "TileEntities/MACHINE_CASING_STABLE_RED_STEEL"); public static final CustomIcon Casing_Material_RedSteel = Internal_Casing_RedSteel; - private static final CustomIcon Internal_Casing_Incoloy020 = - new CustomIcon("TileEntities/MACHINE_CASING_STABLE_INCOLOY_020"); + private static final CustomIcon Internal_Casing_Incoloy020 = new CustomIcon( + "TileEntities/MACHINE_CASING_STABLE_INCOLOY_020"); public static final CustomIcon Casing_Material_Incoloy020 = Internal_Casing_Incoloy020; - private static final CustomIcon Internal_Casing_IncoloyDS = - new CustomIcon("TileEntities/MACHINE_CASING_STABLE_INCOLOY_DS"); + private static final CustomIcon Internal_Casing_IncoloyDS = new CustomIcon( + "TileEntities/MACHINE_CASING_STABLE_INCOLOY_DS"); public static final CustomIcon Casing_Material_IncoloyDS = Internal_Casing_IncoloyDS; - private static final CustomIcon Internal_Casing_IncoloyMA956 = - new CustomIcon("TileEntities/MACHINE_CASING_STABLE_INCOLOY_MA956"); + private static final CustomIcon Internal_Casing_IncoloyMA956 = new CustomIcon( + "TileEntities/MACHINE_CASING_STABLE_INCOLOY_MA956"); public static final CustomIcon Casing_Material_IncoloyMA956 = Internal_Casing_IncoloyMA956; - private static final CustomIcon Internal_Casing_ZirconiumCarbide = - new CustomIcon("TileEntities/MACHINE_CASING_STABLE_ZIRCONIUM_CARBIDE"); + private static final CustomIcon Internal_Casing_ZirconiumCarbide = new CustomIcon( + "TileEntities/MACHINE_CASING_STABLE_ZIRCONIUM_CARBIDE"); public static final CustomIcon Casing_Material_ZirconiumCarbide = Internal_Casing_ZirconiumCarbide; - private static final CustomIcon Internal_Casing_HastelloyX = - new CustomIcon("TileEntities/MACHINE_CASING_STABLE_HASTELLOY_X"); + private static final CustomIcon Internal_Casing_HastelloyX = new CustomIcon( + "TileEntities/MACHINE_CASING_STABLE_HASTELLOY_X"); public static final CustomIcon Casing_Material_HastelloyX = Internal_Casing_HastelloyX; - private static final CustomIcon Internal_Casing_HastelloyN = - new CustomIcon("TileEntities/MACHINE_CASING_STABLE_HASTELLOY_N"); + private static final CustomIcon Internal_Casing_HastelloyN = new CustomIcon( + "TileEntities/MACHINE_CASING_STABLE_HASTELLOY_N"); public static final CustomIcon Casing_Material_HastelloyN = Internal_Casing_HastelloyN; - private static final CustomIcon Internal_Casing_Fluid_IncoloyDS = - new CustomIcon("TileEntities/MACHINE_CASING_FLUID_INCOLOY_DS"); + private static final CustomIcon Internal_Casing_Fluid_IncoloyDS = new CustomIcon( + "TileEntities/MACHINE_CASING_FLUID_INCOLOY_DS"); public static final CustomIcon Casing_Material_Fluid_IncoloyDS = Internal_Casing_Fluid_IncoloyDS; private static final CustomIcon Internal_Casing_Laurenium = new CustomIcon("TileEntities/MACHINE_CASING_LAURENIUM"); public static final CustomIcon Casing_Material_Laurenium = Internal_Casing_Laurenium; // Trinium Alloys - public static final CustomIcon Casing_Trinium_Titanium = - new CustomIcon("TileEntities/MACHINE_CASING_STABLE_TRINIUM_TITANIUM"); - public static final CustomIcon Casing_Trinium_Naquadah = - new CustomIcon("TileEntities/MACHINE_CASING_STABLE_TRINIUM_NAQUADAH"); - public static final CustomIcon Casing_Trinium_Naquadah_Vent = - new CustomIcon("TileEntities/MACHINE_CASING_STABLE_TRINIUM_NAQUADAH_VENT"); - public static final CustomIcon Casing_Trinium_Naquadah_Carbon = - new CustomIcon("TileEntities/MACHINE_CASING_STABLE_TRINIUM_NAQUADAH_CARBON"); + public static final CustomIcon Casing_Trinium_Titanium = new CustomIcon( + "TileEntities/MACHINE_CASING_STABLE_TRINIUM_TITANIUM"); + public static final CustomIcon Casing_Trinium_Naquadah = new CustomIcon( + "TileEntities/MACHINE_CASING_STABLE_TRINIUM_NAQUADAH"); + public static final CustomIcon Casing_Trinium_Naquadah_Vent = new CustomIcon( + "TileEntities/MACHINE_CASING_STABLE_TRINIUM_NAQUADAH_VENT"); + public static final CustomIcon Casing_Trinium_Naquadah_Carbon = new CustomIcon( + "TileEntities/MACHINE_CASING_STABLE_TRINIUM_NAQUADAH_CARBON"); // Material Machine/Firebox Casings - private static final CustomIcon Internal_Casing_Staballoy_Firebox = - new CustomIcon("TileEntities/MACHINE_CASING_FIREBOX_STABALLOY"); + private static final CustomIcon Internal_Casing_Staballoy_Firebox = new CustomIcon( + "TileEntities/MACHINE_CASING_FIREBOX_STABALLOY"); public static final CustomIcon Casing_Staballoy_Firebox = Internal_Casing_Staballoy_Firebox; // Misc Casings - private static final CustomIcon Internal_Casing_Machine_Redstone_Off = - new CustomIcon("TileEntities/cover_redstone_conductor"); + private static final CustomIcon Internal_Casing_Machine_Redstone_Off = new CustomIcon( + "TileEntities/cover_redstone_conductor"); public static final CustomIcon Casing_Machine_Redstone_Off = Internal_Casing_Machine_Redstone_Off; - private static final CustomIcon Internal_Casing_Machine_Redstone_On = - new CustomIcon("TileEntities/cover_redstone_emitter"); + private static final CustomIcon Internal_Casing_Machine_Redstone_On = new CustomIcon( + "TileEntities/cover_redstone_emitter"); public static final CustomIcon Casing_Machine_Redstone_On = Internal_Casing_Machine_Redstone_On; // Redox Cells @@ -287,8 +287,8 @@ public class TexturesGtBlock { public static final CustomIcon Casing_Modulator_4 = new CustomIcon("special/block_8"); // Centrifuge Casing - private static final CustomIcon Internal_Casing_Centrifuge = - new CustomIcon("TileEntities/MACHINE_CASING_CENTRIFUGE"); + private static final CustomIcon Internal_Casing_Centrifuge = new CustomIcon( + "TileEntities/MACHINE_CASING_CENTRIFUGE"); public static final CustomIcon Casing_Material_Centrifuge = Internal_Casing_Centrifuge; // Quantum Force Transformer Casing @@ -311,8 +311,8 @@ public class TexturesGtBlock { // MACHINE_CASING_FARM_MANAGER_STRUCTURAL // Farm Manager Casings - private static final CustomIcon Internal_Casing_Machine_Farm_Manager = - new CustomIcon("TileEntities/MACHINE_CASING_FARM_MANAGER_STRUCTURAL"); + private static final CustomIcon Internal_Casing_Machine_Farm_Manager = new CustomIcon( + "TileEntities/MACHINE_CASING_FARM_MANAGER_STRUCTURAL"); public static final CustomIcon Casing_Machine_Farm_Manager = Internal_Casing_Machine_Farm_Manager; // Acacia_Log private static final CustomIcon Internal_Casing_Machine_Acacia_Log = new CustomIcon("TileEntities/log_acacia_top"); @@ -324,8 +324,8 @@ public class TexturesGtBlock { // Structural Blocks private static final CustomIcon Internal_Casing_Machine_Metal_Grate_A = new CustomIcon("chrono/MetalGrate"); public static final CustomIcon Casing_Machine_Metal_Grate_A = Internal_Casing_Machine_Metal_Grate_A; - private static final CustomIcon Internal_Casing_Machine_Metal_Grate_A_Solid = - new CustomIcon("chrono/MetalGrateA_Solid"); + private static final CustomIcon Internal_Casing_Machine_Metal_Grate_A_Solid = new CustomIcon( + "chrono/MetalGrateA_Solid"); public static final CustomIcon Casing_Machine_Metal_Grate_A_Solid = Internal_Casing_Machine_Metal_Grate_A_Solid; private static final CustomIcon Internal_Casing_Machine_Metal_Grate_B = new CustomIcon("chrono/MetalGrate2"); public static final CustomIcon Casing_Machine_Metal_Grate_B = Internal_Casing_Machine_Metal_Grate_B; @@ -361,59 +361,59 @@ public class TexturesGtBlock { public static final CustomIcon Overlay_Machine_Cyber_B = Internal_Overlay_Machine_Cyber_B; public static final CustomIcon TEXTURE_CASING_AMAZON = new CustomIcon("TileEntities/CASING_AMAZON"); - public static final CustomIcon TEXTURE_CASING_ADVANCED_CRYOGENIC = - new CustomIcon("TileEntities/MACHINE_CASING_ADVANCED_CRYOGENIC"); - public static final CustomIcon TEXTURE_CASING_ADVANCED_VOLCNUS = - new CustomIcon("TileEntities/MACHINE_CASING_ADVANCED_VOLCANUS"); + public static final CustomIcon TEXTURE_CASING_ADVANCED_CRYOGENIC = new CustomIcon( + "TileEntities/MACHINE_CASING_ADVANCED_CRYOGENIC"); + public static final CustomIcon TEXTURE_CASING_ADVANCED_VOLCNUS = new CustomIcon( + "TileEntities/MACHINE_CASING_ADVANCED_VOLCANUS"); public static final CustomIcon TEXTURE_CASING_ROCKETDYNE = new CustomIcon("TileEntities/MACHINE_CASING_ROCKETDYNE"); - public static final CustomIcon TEXTURE_CASING_GRINDING_MILL = - new CustomIcon("TileEntities/MACHINE_CASING_GRINDING_FACTORY"); + public static final CustomIcon TEXTURE_CASING_GRINDING_MILL = new CustomIcon( + "TileEntities/MACHINE_CASING_GRINDING_FACTORY"); public static final CustomIcon TEXTURE_CASING_FLOTATION = new CustomIcon("TileEntities/MACHINE_CASING_FLOTATION"); // Custom Pipes public static final CustomIcon TEXTURE_PIPE_GRINDING_MILL = new CustomIcon("TileEntities/MACHINE_CASING_PIPE_T1"); public static final CustomIcon TEXTURE_PIPE_GENERIC = new CustomIcon("iconsets/MACHINE_CASING_PIPE_GENERIC"); - public static final CustomIcon TEXTURE_PIPE_T1_BABBIT_ALLOY = - new CustomIcon("iconsets/MACHINE_CASING_PIPE_BABBIT_ALLOY"); - public static final CustomIcon TEXTURE_PIPE_T2_INCONEL_690 = - new CustomIcon("iconsets/MACHINE_CASING_PIPE_INCONEL_690"); + public static final CustomIcon TEXTURE_PIPE_T1_BABBIT_ALLOY = new CustomIcon( + "iconsets/MACHINE_CASING_PIPE_BABBIT_ALLOY"); + public static final CustomIcon TEXTURE_PIPE_T2_INCONEL_690 = new CustomIcon( + "iconsets/MACHINE_CASING_PIPE_INCONEL_690"); public static final CustomIcon TEXTURE_PIPE_T3_STELLITE = new CustomIcon("iconsets/MACHINE_CASING_PIPE_STELLITE"); - public static final CustomIcon TEXTURE_PIPE_T4_NITINOL_60 = - new CustomIcon("iconsets/MACHINE_CASING_PIPE_NITINOL_60"); + public static final CustomIcon TEXTURE_PIPE_T4_NITINOL_60 = new CustomIcon( + "iconsets/MACHINE_CASING_PIPE_NITINOL_60"); public static final CustomIcon TEXTURE_PIPE_T5_LAFIUM = new CustomIcon("iconsets/MACHINE_CASING_PIPE_LAFIUM"); public static final CustomIcon TEXTURE_PIPE_T6_CINOBITE = new CustomIcon("iconsets/MACHINE_CASING_PIPE_CINOBITE"); - public static final CustomIcon TEXTURE_PIPE_T7_TITANSTEEL = - new CustomIcon("iconsets/MACHINE_CASING_PIPE_TITANSTEEL"); + public static final CustomIcon TEXTURE_PIPE_T7_TITANSTEEL = new CustomIcon( + "iconsets/MACHINE_CASING_PIPE_TITANSTEEL"); public static final CustomIcon TEXTURE_PIPE_T8_ABYSSAL = new CustomIcon("iconsets/MACHINE_CASING_PIPE_ABYSSAL"); // Custom Gearboxes - public static final CustomIcon TEXTURE_GEARBOX_GRINDING_MILL = - new CustomIcon("TileEntities/MACHINE_CASING_GEARBOX_T1"); + public static final CustomIcon TEXTURE_GEARBOX_GRINDING_MILL = new CustomIcon( + "TileEntities/MACHINE_CASING_GEARBOX_T1"); public static final CustomIcon TEXTURE_GEARBOX_GENERIC = new CustomIcon("iconsets/MACHINE_CASING_GEARBOX_GENERIC"); - public static final CustomIcon TEXTURE_GEARBOX_T1_EGLIN_STEEL = - new CustomIcon("iconsets/MACHINE_CASING_GEARBOX_EGLIN_STEEL"); - public static final CustomIcon TEXTURE_GEARBOX_T2_INCONEL_792 = - new CustomIcon("iconsets/MACHINE_CASING_GEARBOX_INCONEL_792"); - public static final CustomIcon TEXTURE_GEARBOX_T3_INCOLOY_MA956 = - new CustomIcon("iconsets/MACHINE_CASING_GEARBOX_INCOLOY_MA956"); - public static final CustomIcon TEXTURE_GEARBOX_T4_NITINOL_60 = - new CustomIcon("iconsets/MACHINE_CASING_GEARBOX_NITINOL_60"); - public static final CustomIcon TEXTURE_GEARBOX_T5_ZERON_100 = - new CustomIcon("iconsets/MACHINE_CASING_GEARBOX_ZERON_100"); - public static final CustomIcon TEXTURE_GEARBOX_T6_PIKYONIUM = - new CustomIcon("iconsets/MACHINE_CASING_GEARBOX_PIKYONIUM"); - public static final CustomIcon TEXTURE_GEARBOX_T7_TITANSTEEL = - new CustomIcon("iconsets/MACHINE_CASING_GEARBOX_TITANSTEEL"); - public static final CustomIcon TEXTURE_GEARBOX_T8_ABYSSAL = - new CustomIcon("iconsets/MACHINE_CASING_GEARBOX_ABYSSAL"); + public static final CustomIcon TEXTURE_GEARBOX_T1_EGLIN_STEEL = new CustomIcon( + "iconsets/MACHINE_CASING_GEARBOX_EGLIN_STEEL"); + public static final CustomIcon TEXTURE_GEARBOX_T2_INCONEL_792 = new CustomIcon( + "iconsets/MACHINE_CASING_GEARBOX_INCONEL_792"); + public static final CustomIcon TEXTURE_GEARBOX_T3_INCOLOY_MA956 = new CustomIcon( + "iconsets/MACHINE_CASING_GEARBOX_INCOLOY_MA956"); + public static final CustomIcon TEXTURE_GEARBOX_T4_NITINOL_60 = new CustomIcon( + "iconsets/MACHINE_CASING_GEARBOX_NITINOL_60"); + public static final CustomIcon TEXTURE_GEARBOX_T5_ZERON_100 = new CustomIcon( + "iconsets/MACHINE_CASING_GEARBOX_ZERON_100"); + public static final CustomIcon TEXTURE_GEARBOX_T6_PIKYONIUM = new CustomIcon( + "iconsets/MACHINE_CASING_GEARBOX_PIKYONIUM"); + public static final CustomIcon TEXTURE_GEARBOX_T7_TITANSTEEL = new CustomIcon( + "iconsets/MACHINE_CASING_GEARBOX_TITANSTEEL"); + public static final CustomIcon TEXTURE_GEARBOX_T8_ABYSSAL = new CustomIcon( + "iconsets/MACHINE_CASING_GEARBOX_ABYSSAL"); public static final CustomIcon TEXTURE_CASING_FUSION_COIL_II = new CustomIcon("iconsets/MACHINE_CASING_FUSION_3"); - public static final CustomIcon TEXTURE_CASING_FUSION_COIL_II_INNER = - new CustomIcon("iconsets/MACHINE_CASING_FUSION_COIL_II"); - public static final CustomIcon TEXTURE_CASING_FUSION_CASING_ULTRA = - new CustomIcon("iconsets/MACHINE_CASING_FUSION_GLASS_ULTRA"); + public static final CustomIcon TEXTURE_CASING_FUSION_COIL_II_INNER = new CustomIcon( + "iconsets/MACHINE_CASING_FUSION_COIL_II"); + public static final CustomIcon TEXTURE_CASING_FUSION_CASING_ULTRA = new CustomIcon( + "iconsets/MACHINE_CASING_FUSION_GLASS_ULTRA"); // public static final CustomIcon TEXTURE_CASING_FUSION_COIL_II_1 = new CustomIcon("iconsets/FUSIONIII_1"); public static final CustomIcon TEXTURE_CASING_FUSION_COIL_II_2 = new CustomIcon("iconsets/FUSIONIII_2"); @@ -430,133 +430,129 @@ public class TexturesGtBlock { // Overlays // Fan Textures - private static final CustomIcon Internal_Overlay_Machine_Vent = - new CustomIcon("TileEntities/machine_top_vent_rotating"); + private static final CustomIcon Internal_Overlay_Machine_Vent = new CustomIcon( + "TileEntities/machine_top_vent_rotating"); public static final CustomIcon Overlay_Machine_Vent = Internal_Overlay_Machine_Vent; - private static final CustomIcon Internal_Overlay_Machine_Vent_Fast = - new CustomIcon("TileEntities/machine_top_vent_rotating_fast"); + private static final CustomIcon Internal_Overlay_Machine_Vent_Fast = new CustomIcon( + "TileEntities/machine_top_vent_rotating_fast"); public static final CustomIcon Overlay_Machine_Vent_Fast = Internal_Overlay_Machine_Vent_Fast; - private static final CustomIcon Internal_Overlay_Machine_Vent_Adv = - new CustomIcon("TileEntities/adv_machine_vent_rotating"); + private static final CustomIcon Internal_Overlay_Machine_Vent_Adv = new CustomIcon( + "TileEntities/adv_machine_vent_rotating"); public static final CustomIcon Overlay_Machine_Vent_Adv = Internal_Overlay_Machine_Vent_Adv; - private static final CustomIcon Internal_Overlay_Machine_Turbine_Active = - new CustomIcon("TileEntities/STEAM_TURBINE_SIDE_ACTIVE"); + private static final CustomIcon Internal_Overlay_Machine_Turbine_Active = new CustomIcon( + "TileEntities/STEAM_TURBINE_SIDE_ACTIVE"); public static final CustomIcon Overlay_Machine_Turbine_Active = Internal_Overlay_Machine_Turbine_Active; // Grate Texture public static final CustomIcon OVERLAY_GRATE_A = new CustomIcon("metro/OVERLAY_GRATE_A"); // Speaker Texture private static final CustomIcon Internal_Overlay_Machine_Sound = new CustomIcon("TileEntities/audio_out"); public static final CustomIcon Overlay_Machine_Sound = Internal_Overlay_Machine_Sound; - private static final CustomIcon Internal_Overlay_Machine_Sound_Active = - new CustomIcon("TileEntities/audio_out_active"); + private static final CustomIcon Internal_Overlay_Machine_Sound_Active = new CustomIcon( + "TileEntities/audio_out_active"); public static final CustomIcon Overlay_Machine_Sound_Active = Internal_Overlay_Machine_Sound_Active; // Diesel Engines - private static final CustomIcon Internal_Overlay_Machine_Diesel_Vertical = - new CustomIcon("TileEntities/machine_top_dieselmotor"); + private static final CustomIcon Internal_Overlay_Machine_Diesel_Vertical = new CustomIcon( + "TileEntities/machine_top_dieselmotor"); public static final CustomIcon Overlay_Machine_Diesel_Vertical = Internal_Overlay_Machine_Diesel_Vertical; - private static final CustomIcon Internal_Overlay_Machine_Diesel_Horizontal = - new CustomIcon("TileEntities/machine_top_dieselmotor2"); + private static final CustomIcon Internal_Overlay_Machine_Diesel_Horizontal = new CustomIcon( + "TileEntities/machine_top_dieselmotor2"); public static final CustomIcon Overlay_Machine_Diesel_Horizontal = Internal_Overlay_Machine_Diesel_Horizontal; - private static final CustomIcon Internal_Overlay_Machine_Diesel_Vertical_Active = - new CustomIcon("TileEntities/machine_top_dieselmotor_active"); - public static final CustomIcon Overlay_Machine_Diesel_Vertical_Active = - Internal_Overlay_Machine_Diesel_Vertical_Active; - private static final CustomIcon Internal_Overlay_Machine_Diesel_Horizontal_Active = - new CustomIcon("TileEntities/machine_top_dieselmotor2_active"); - public static final CustomIcon Overlay_Machine_Diesel_Horizontal_Active = - Internal_Overlay_Machine_Diesel_Horizontal_Active; + private static final CustomIcon Internal_Overlay_Machine_Diesel_Vertical_Active = new CustomIcon( + "TileEntities/machine_top_dieselmotor_active"); + public static final CustomIcon Overlay_Machine_Diesel_Vertical_Active = Internal_Overlay_Machine_Diesel_Vertical_Active; + private static final CustomIcon Internal_Overlay_Machine_Diesel_Horizontal_Active = new CustomIcon( + "TileEntities/machine_top_dieselmotor2_active"); + public static final CustomIcon Overlay_Machine_Diesel_Horizontal_Active = Internal_Overlay_Machine_Diesel_Horizontal_Active; // Computer Screens - private static final CustomIcon Internal_Casing_Machine_Screen_1 = - new CustomIcon("TileEntities/adv_machine_screen_random1"); + private static final CustomIcon Internal_Casing_Machine_Screen_1 = new CustomIcon( + "TileEntities/adv_machine_screen_random1"); public static final CustomIcon Casing_Machine_Screen_1 = Internal_Casing_Machine_Screen_1; - private static final CustomIcon Internal_Casing_Machine_Screen_2 = - new CustomIcon("TileEntities/adv_machine_screen_random2"); + private static final CustomIcon Internal_Casing_Machine_Screen_2 = new CustomIcon( + "TileEntities/adv_machine_screen_random2"); public static final CustomIcon Casing_Machine_Screen_2 = Internal_Casing_Machine_Screen_2; - private static final CustomIcon Internal_Casing_Machine_Screen_3 = - new CustomIcon("TileEntities/adv_machine_screen_random3"); + private static final CustomIcon Internal_Casing_Machine_Screen_3 = new CustomIcon( + "TileEntities/adv_machine_screen_random3"); public static final CustomIcon Casing_Machine_Screen_3 = Internal_Casing_Machine_Screen_3; - private static final CustomIcon Internal_Casing_Machine_Screen_Frequency = - new CustomIcon("TileEntities/adv_machine_screen_frequency"); + private static final CustomIcon Internal_Casing_Machine_Screen_Frequency = new CustomIcon( + "TileEntities/adv_machine_screen_frequency"); public static final CustomIcon Casing_Machine_Screen_Frequency = Internal_Casing_Machine_Screen_Frequency; - private static final CustomIcon Internal_Overlay_Machine_Screen_Logo = - new CustomIcon("TileEntities/adv_machine_screen_logo"); + private static final CustomIcon Internal_Overlay_Machine_Screen_Logo = new CustomIcon( + "TileEntities/adv_machine_screen_logo"); public static final CustomIcon Overlay_Machine_Screen_Logo = Internal_Overlay_Machine_Screen_Logo; private static final CustomIcon Internal_Overlay_Machine_Cyber_Interface = new CustomIcon("chrono/Overlay_Cyber"); public static final CustomIcon Overlay_Machine_Cyber_Interface = Internal_Overlay_Machine_Cyber_Interface; // Machine Controller Overlays - private static final CustomIcon Internal_Overlay_Machine_Controller_Default = - new CustomIcon("iconsets/OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_ANIMATED"); + private static final CustomIcon Internal_Overlay_Machine_Controller_Default = new CustomIcon( + "iconsets/OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_ANIMATED"); public static final CustomIcon Overlay_Machine_Controller_Default = Internal_Overlay_Machine_Controller_Default; - private static final CustomIcon Internal_Overlay_Machine_Controller_Default_Active = - new CustomIcon("iconsets/OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_ANIMATED_ACTIVE"); - public static final CustomIcon Overlay_Machine_Controller_Default_Active = - Internal_Overlay_Machine_Controller_Default_Active; + private static final CustomIcon Internal_Overlay_Machine_Controller_Default_Active = new CustomIcon( + "iconsets/OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_ANIMATED_ACTIVE"); + public static final CustomIcon Overlay_Machine_Controller_Default_Active = Internal_Overlay_Machine_Controller_Default_Active; - private static final CustomIcon Internal_Overlay_Machine_Controller_Advanced = - new CustomIcon("iconsets/OVERLAY_FRONT_ADVANCED_MULTIBLOCK_ANIMATED"); + private static final CustomIcon Internal_Overlay_Machine_Controller_Advanced = new CustomIcon( + "iconsets/OVERLAY_FRONT_ADVANCED_MULTIBLOCK_ANIMATED"); public static final CustomIcon Overlay_Machine_Controller_Advanced = Internal_Overlay_Machine_Controller_Advanced; - private static final CustomIcon Internal_Overlay_Machine_Controller_Advanced_Active = - new CustomIcon("iconsets/OVERLAY_FRONT_ADVANCED_MULTIBLOCK_ANIMATED_ACTIVE"); - public static final CustomIcon Overlay_Machine_Controller_Advanced_Active = - Internal_Overlay_Machine_Controller_Advanced_Active; + private static final CustomIcon Internal_Overlay_Machine_Controller_Advanced_Active = new CustomIcon( + "iconsets/OVERLAY_FRONT_ADVANCED_MULTIBLOCK_ANIMATED_ACTIVE"); + public static final CustomIcon Overlay_Machine_Controller_Advanced_Active = Internal_Overlay_Machine_Controller_Advanced_Active; // Fluid Reactor Overlays - public static final CustomIcon Overlay_FluidReactor_Front = - new CustomIcon("TileEntities/FluidReactor/OVERLAY_FRONT"); + public static final CustomIcon Overlay_FluidReactor_Front = new CustomIcon( + "TileEntities/FluidReactor/OVERLAY_FRONT"); public static final CustomIcon Overlay_FluidReactor_Side = new CustomIcon("TileEntities/FluidReactor/OVERLAY_SIDE"); public static final CustomIcon Overlay_FluidReactor_Top = new CustomIcon("TileEntities/FluidReactor/OVERLAY_TOP"); - public static final CustomIcon Overlay_FluidReactor_Front_Active = - new CustomIcon("TileEntities/FluidReactor/OVERLAY_FRONT_ACTIVE"); - public static final CustomIcon Overlay_FluidReactor_Side_Active = - new CustomIcon("TileEntities/FluidReactor/OVERLAY_SIDE_ACTIVE"); - public static final CustomIcon Overlay_FluidReactor_Top_Active = - new CustomIcon("TileEntities/FluidReactor/OVERLAY_TOP_ACTIVE"); + public static final CustomIcon Overlay_FluidReactor_Front_Active = new CustomIcon( + "TileEntities/FluidReactor/OVERLAY_FRONT_ACTIVE"); + public static final CustomIcon Overlay_FluidReactor_Side_Active = new CustomIcon( + "TileEntities/FluidReactor/OVERLAY_SIDE_ACTIVE"); + public static final CustomIcon Overlay_FluidReactor_Top_Active = new CustomIcon( + "TileEntities/FluidReactor/OVERLAY_TOP_ACTIVE"); // Crafting Overlays public static final CustomIcon Overlay_Crafting_Bronze = new CustomIcon("TileEntities/bronze_top_crafting"); public static final CustomIcon Overlay_Crafting_Steel = new CustomIcon("TileEntities/cover_crafting"); - public static final CustomIcon Casing_Workbench_Crafting_Overlay = - new CustomIcon("TileEntities/gt4/bronze_top_crafting"); + public static final CustomIcon Casing_Workbench_Crafting_Overlay = new CustomIcon( + "TileEntities/gt4/bronze_top_crafting"); public static final CustomIcon Casing_Workbench_Top = new CustomIcon("TileEntities/gt4/bronze_top"); public static final CustomIcon Casing_Workbench_Side = new CustomIcon("TileEntities/gt4/bronze_side"); public static final CustomIcon Casing_Workbench_Bottom = new CustomIcon("TileEntities/gt4/bronze_bottom"); - public static final CustomIcon Casing_Adv_Workbench_Crafting_Overlay = - new CustomIcon("TileEntities/gt4/machine_top_crafting"); + public static final CustomIcon Casing_Adv_Workbench_Crafting_Overlay = new CustomIcon( + "TileEntities/gt4/machine_top_crafting"); public static final CustomIcon Casing_Adv_Workbench_Top = new CustomIcon("TileEntities/gt4/machine_top"); public static final CustomIcon Casing_Adv_Workbench_Side = new CustomIcon("TileEntities/gt4/machine_side"); public static final CustomIcon Casing_Adv_Workbench_Bottom = new CustomIcon("TileEntities/gt4/machine_bottom"); - public static final CustomIcon Casing_Redstone_Top_Off = - new CustomIcon("TileEntities/gt4/redstone/machine_top_redstone_off"); - public static final CustomIcon Casing_Redstone_Top_Main_Off = - new CustomIcon("TileEntities/gt4/redstone/machine_top_redstone_main_off"); - public static final CustomIcon Casing_Redstone_Top_On = - new CustomIcon("TileEntities/gt4/redstone/machine_top_redstone_on"); - public static final CustomIcon Casing_Redstone_Top_Main_On = - new CustomIcon("TileEntities/gt4/redstone/machine_top_redstone_main_on"); - - public static final CustomIcon Casing_Redstone_Side_Off = - new CustomIcon("TileEntities/gt4/redstone/machine_side_redstone_off"); - public static final CustomIcon Casing_Redstone_Side_Main_Off = - new CustomIcon("TileEntities/gt4/redstone/machine_side_redstone_main_off"); - public static final CustomIcon Casing_Redstone_Side_On = - new CustomIcon("TileEntities/gt4/redstone/machine_side_redstone_on"); - public static final CustomIcon Casing_Redstone_Side_Main_On = - new CustomIcon("TileEntities/gt4/redstone/machine_side_redstone_main_on"); - - public static final CustomIcon Casing_Redstone_Bottom_Off = - new CustomIcon("TileEntities/gt4/redstone/machine_bottom_redstone_off"); - public static final CustomIcon Casing_Redstone_Bottom_Main_Off = - new CustomIcon("TileEntities/gt4/redstone/machine_bottom_redstone_main_off"); - public static final CustomIcon Casing_Redstone_Bottom_On = - new CustomIcon("TileEntities/gt4/redstone/machine_bottom_redstone_on"); - public static final CustomIcon Casing_Redstone_Bottom_Main_On = - new CustomIcon("TileEntities/gt4/redstone/machine_bottom_redstone_main_on"); - - public static final CustomIcon Casing_Electric_Auto_Workbench_Side = - new CustomIcon("TileEntities/gt4/OVERLAY_SIDE_CABINET"); + public static final CustomIcon Casing_Redstone_Top_Off = new CustomIcon( + "TileEntities/gt4/redstone/machine_top_redstone_off"); + public static final CustomIcon Casing_Redstone_Top_Main_Off = new CustomIcon( + "TileEntities/gt4/redstone/machine_top_redstone_main_off"); + public static final CustomIcon Casing_Redstone_Top_On = new CustomIcon( + "TileEntities/gt4/redstone/machine_top_redstone_on"); + public static final CustomIcon Casing_Redstone_Top_Main_On = new CustomIcon( + "TileEntities/gt4/redstone/machine_top_redstone_main_on"); + + public static final CustomIcon Casing_Redstone_Side_Off = new CustomIcon( + "TileEntities/gt4/redstone/machine_side_redstone_off"); + public static final CustomIcon Casing_Redstone_Side_Main_Off = new CustomIcon( + "TileEntities/gt4/redstone/machine_side_redstone_main_off"); + public static final CustomIcon Casing_Redstone_Side_On = new CustomIcon( + "TileEntities/gt4/redstone/machine_side_redstone_on"); + public static final CustomIcon Casing_Redstone_Side_Main_On = new CustomIcon( + "TileEntities/gt4/redstone/machine_side_redstone_main_on"); + + public static final CustomIcon Casing_Redstone_Bottom_Off = new CustomIcon( + "TileEntities/gt4/redstone/machine_bottom_redstone_off"); + public static final CustomIcon Casing_Redstone_Bottom_Main_Off = new CustomIcon( + "TileEntities/gt4/redstone/machine_bottom_redstone_main_off"); + public static final CustomIcon Casing_Redstone_Bottom_On = new CustomIcon( + "TileEntities/gt4/redstone/machine_bottom_redstone_on"); + public static final CustomIcon Casing_Redstone_Bottom_Main_On = new CustomIcon( + "TileEntities/gt4/redstone/machine_bottom_redstone_main_on"); + + public static final CustomIcon Casing_Electric_Auto_Workbench_Side = new CustomIcon( + "TileEntities/gt4/OVERLAY_SIDE_CABINET"); public static final CustomIcon Casing_Computer_Cube = new CustomIcon("TileEntities/gt4/computer"); public static final CustomIcon Casing_CropHarvester_Cutter = new CustomIcon("TileEntities/gt4/OVERLAY_CROP"); @@ -569,18 +565,18 @@ public class TexturesGtBlock { public static final CustomIcon Casing_InventoryManagaer_Yellow = new CustomIcon("TileEntities/gt4/OVERLAY_YELLOW"); public static final CustomIcon Casing_InventoryManagaer_Blue = new CustomIcon("TileEntities/gt4/OVERLAY_BLUE"); - public static final CustomIcon Casing_InventoryManagaer_Cyan_Redstone = - new CustomIcon("TileEntities/gt4/OVERLAY_CYAN_REDSTONE"); - public static final CustomIcon Casing_InventoryManagaer_Green_Redstone = - new CustomIcon("TileEntities/gt4/OVERLAY_GREEN_REDSTONE"); - public static final CustomIcon Casing_InventoryManagaer_Purple_Redstone = - new CustomIcon("TileEntities/gt4/OVERLAY_PURPLE_REDSTONE"); - public static final CustomIcon Casing_InventoryManagaer_Red_Redstone = - new CustomIcon("TileEntities/gt4/OVERLAY_RED_REDSTONE"); - public static final CustomIcon Casing_InventoryManagaer_Yellow_Redstone = - new CustomIcon("TileEntities/gt4/OVERLAY_YELLOW_REDSTONE"); - public static final CustomIcon Casing_InventoryManagaer_Blue_Redstone = - new CustomIcon("TileEntities/gt4/OVERLAY_BLUE_REDSTONE"); + public static final CustomIcon Casing_InventoryManagaer_Cyan_Redstone = new CustomIcon( + "TileEntities/gt4/OVERLAY_CYAN_REDSTONE"); + public static final CustomIcon Casing_InventoryManagaer_Green_Redstone = new CustomIcon( + "TileEntities/gt4/OVERLAY_GREEN_REDSTONE"); + public static final CustomIcon Casing_InventoryManagaer_Purple_Redstone = new CustomIcon( + "TileEntities/gt4/OVERLAY_PURPLE_REDSTONE"); + public static final CustomIcon Casing_InventoryManagaer_Red_Redstone = new CustomIcon( + "TileEntities/gt4/OVERLAY_RED_REDSTONE"); + public static final CustomIcon Casing_InventoryManagaer_Yellow_Redstone = new CustomIcon( + "TileEntities/gt4/OVERLAY_YELLOW_REDSTONE"); + public static final CustomIcon Casing_InventoryManagaer_Blue_Redstone = new CustomIcon( + "TileEntities/gt4/OVERLAY_BLUE_REDSTONE"); private static final CustomIcon Casing_Test_1 = new CustomIcon("number/1"); private static final CustomIcon Casing_Test_2 = new CustomIcon("number/2"); @@ -599,12 +595,9 @@ public class TexturesGtBlock { private static final CustomIcon Casing_Test_15 = new CustomIcon("number/15"); private static final CustomIcon Casing_Test_16 = new CustomIcon("number/16"); - public static final CustomIcon[] TEST_NUMBER = new CustomIcon[] { - Casing_Test_1, Casing_Test_2, Casing_Test_3, Casing_Test_4, - Casing_Test_5, Casing_Test_6, Casing_Test_7, Casing_Test_8, - Casing_Test_9, Casing_Test_10, Casing_Test_11, Casing_Test_12, - Casing_Test_13, Casing_Test_14, Casing_Test_15, Casing_Test_16 - }; + public static final CustomIcon[] TEST_NUMBER = new CustomIcon[] { Casing_Test_1, Casing_Test_2, Casing_Test_3, + Casing_Test_4, Casing_Test_5, Casing_Test_6, Casing_Test_7, Casing_Test_8, Casing_Test_9, Casing_Test_10, + Casing_Test_11, Casing_Test_12, Casing_Test_13, Casing_Test_14, Casing_Test_15, Casing_Test_16 }; // Covers private static final CustomIcon Internal_Overlay_Overflow_Valve = new CustomIcon("iconsets/OVERLAY_OVERFLOW_VALVE"); @@ -621,12 +614,12 @@ public class TexturesGtBlock { private static final CustomIcon Internal_Overlay_Hatch_Muffler_Adv = new CustomIcon("iconsets/OVERLAY_MUFFLER_ADV"); public static final CustomIcon Overlay_Hatch_Muffler_Adv = Internal_Overlay_Hatch_Muffler_Adv; // Control Core Bus - private static final CustomIcon Internal_Overlay_Hatch_Control_Core = - new CustomIcon("iconsets/OVERLAY_CONTROL_CORE_BUS"); + private static final CustomIcon Internal_Overlay_Hatch_Control_Core = new CustomIcon( + "iconsets/OVERLAY_CONTROL_CORE_BUS"); public static final CustomIcon Overlay_Hatch_Control_Core = Internal_Overlay_Hatch_Control_Core; // Milling Ball Bus - private static final CustomIcon Internal_Overlay_Bus_Milling_Balls = - new CustomIcon("iconsets/OVERLAY_MILLING_BALL_BUS"); + private static final CustomIcon Internal_Overlay_Bus_Milling_Balls = new CustomIcon( + "iconsets/OVERLAY_MILLING_BALL_BUS"); public static final CustomIcon Overlay_Bus_Milling_Balls = Internal_Overlay_Bus_Milling_Balls; // Catalyst Bus private static final CustomIcon Internal_Overlay_Bus_Catalyst = new CustomIcon("iconsets/OVERLAY_CATALYSTS"); @@ -651,24 +644,24 @@ public class TexturesGtBlock { public static final CustomIcon Overlay_Hatch_RTG_On = Internal_Overlay_Hatch_RTG_On; // Dimensional - private static final CustomIcon Internal_Overlay_Machine_Dimensional_Blue = - new CustomIcon("TileEntities/adv_machine_dimensional_cover_blue"); + private static final CustomIcon Internal_Overlay_Machine_Dimensional_Blue = new CustomIcon( + "TileEntities/adv_machine_dimensional_cover_blue"); public static final CustomIcon Overlay_Machine_Dimensional_Blue = Internal_Overlay_Machine_Dimensional_Blue; - private static final CustomIcon Internal_Overlay_Machine_Dimensional_Orange = - new CustomIcon("TileEntities/adv_machine_dimensional_cover_orange"); + private static final CustomIcon Internal_Overlay_Machine_Dimensional_Orange = new CustomIcon( + "TileEntities/adv_machine_dimensional_cover_orange"); public static final CustomIcon Overlay_Machine_Dimensional_Orange = Internal_Overlay_Machine_Dimensional_Orange; // Icons private static final CustomIcon Internal_Overlay_MatterFab = new CustomIcon("TileEntities/adv_machine_matterfab"); public static final CustomIcon Overlay_MatterFab = Internal_Overlay_MatterFab; - private static final CustomIcon Internal_Overlay_MatterFab_Active = - new CustomIcon("TileEntities/adv_machine_matterfab_active"); + private static final CustomIcon Internal_Overlay_MatterFab_Active = new CustomIcon( + "TileEntities/adv_machine_matterfab_active"); public static final CustomIcon Overlay_MatterFab_Active = Internal_Overlay_MatterFab_Active; - private static final CustomIcon Internal_Overlay_MatterFab_Animated = - new CustomIcon("TileEntities/adv_machine_matterfab_animated"); + private static final CustomIcon Internal_Overlay_MatterFab_Animated = new CustomIcon( + "TileEntities/adv_machine_matterfab_animated"); public static final CustomIcon Overlay_MatterFab_Animated = Internal_Overlay_MatterFab_Animated; - private static final CustomIcon Internal_Overlay_MatterFab_Active_Animated = - new CustomIcon("TileEntities/adv_machine_matterfab_active_animated"); + private static final CustomIcon Internal_Overlay_MatterFab_Active_Animated = new CustomIcon( + "TileEntities/adv_machine_matterfab_active_animated"); public static final CustomIcon Overlay_MatterFab_Active_Animated = Internal_Overlay_MatterFab_Active_Animated; private static final CustomIcon Internal_Overlay_Oil = new CustomIcon("TileEntities/adv_machine_oil"); @@ -705,8 +698,8 @@ public class TexturesGtBlock { public static final CustomIcon TEXTURE_MAGIC_PANEL_B = new CustomIcon("metro/TEXTURE_MAGIC_B"); public static final CustomIcon TEXTURE_ORGANIC_PANEL_A = new CustomIcon("metro/TEXTURE_ORGANIC_PANEL_A"); - public static final CustomIcon TEXTURE_ORGANIC_PANEL_A_GLOWING = - new CustomIcon("metro/TEXTURE_ORGANIC_PANEL_A_GLOWING"); + public static final CustomIcon TEXTURE_ORGANIC_PANEL_A_GLOWING = new CustomIcon( + "metro/TEXTURE_ORGANIC_PANEL_A_GLOWING"); public static final CustomIcon TEXTURE_STONE_BIRD_A = new CustomIcon("metro/TEXTURE_STONE_BIRD_A"); public static final CustomIcon TEXTURE_STONE_BIRD_A_LEFT = new CustomIcon("metro/TEXTURE_STONE_BIRD_A_LEFT"); @@ -751,122 +744,111 @@ public class TexturesGtBlock { public static final CustomIcon TEXTURE_TECH_PANEL_H = new CustomIcon("metro/TEXTURE_TECH_PANEL_H"); public static final CustomIcon TEXTURE_TECH_PANEL_I = new CustomIcon("metro/TEXTURE_TECH_PANEL_I"); - public static final CustomIcon TEXTURE_TECH_PANEL_RADIOACTIVE = - new CustomIcon("TileEntities/DecayablesChest_bottom"); - public static final CustomIcon TEXTURE_TECH_PANEL_RADIOACTIVE_ALT = - new CustomIcon("TileEntities/DecayablesChest_top"); + public static final CustomIcon TEXTURE_TECH_PANEL_RADIOACTIVE = new CustomIcon( + "TileEntities/DecayablesChest_bottom"); + public static final CustomIcon TEXTURE_TECH_PANEL_RADIOACTIVE_ALT = new CustomIcon( + "TileEntities/DecayablesChest_top"); // LFTR Single blocks - public static final CustomIcon OVERLAY_REACTOR_COLDTRAP_FRONT = - new CustomIcon("TileEntities/ReactorColdTrap/OVERLAY_FRONT"); - public static final CustomIcon OVERLAY_REACTOR_COLDTRAP_FRONT_ACTIVE = - new CustomIcon("TileEntities/ReactorColdTrap/OVERLAY_FRONT_ACTIVE"); - public static final CustomIcon OVERLAY_REACTOR_COLDTRAP_SIDE = - new CustomIcon("TileEntities/ReactorColdTrap/OVERLAY_SIDE"); - public static final CustomIcon OVERLAY_REACTOR_COLDTRAP_SIDE_ACTIVE = - new CustomIcon("TileEntities/ReactorColdTrap/OVERLAY_SIDE_ACTIVE"); - public static final CustomIcon OVERLAY_REACTOR_COLDTRAP_TOP = - new CustomIcon("TileEntities/ReactorColdTrap/OVERLAY_TOP"); - public static final CustomIcon OVERLAY_REACTOR_COLDTRAP_TOP_ACTIVE = - new CustomIcon("TileEntities/ReactorColdTrap/OVERLAY_TOP_ACTIVE"); - - public static final CustomIcon OVERLAY_REACTOR_PROCESSINGUNIT_FRONT = - new CustomIcon("TileEntities/ReactorProcessingUnit/OVERLAY_FRONT"); - public static final CustomIcon OVERLAY_REACTOR_PROCESSINGUNIT_FRONT_ACTIVE = - new CustomIcon("TileEntities/ReactorProcessingUnit/OVERLAY_FRONT_ACTIVE"); - public static final CustomIcon OVERLAY_REACTOR_PROCESSINGUNIT_SIDE = - new CustomIcon("TileEntities/ReactorProcessingUnit/OVERLAY_SIDE"); - public static final CustomIcon OVERLAY_REACTOR_PROCESSINGUNIT_SIDE_ACTIVE = - new CustomIcon("TileEntities/ReactorProcessingUnit/OVERLAY_SIDE_ACTIVE"); - public static final CustomIcon OVERLAY_REACTOR_PROCESSINGUNIT_TOP = - new CustomIcon("TileEntities/ReactorProcessingUnit/OVERLAY_TOP"); - public static final CustomIcon OVERLAY_REACTOR_PROCESSINGUNIT_TOP_ACTIVE = - new CustomIcon("TileEntities/ReactorProcessingUnit/OVERLAY_TOP_ACTIVE"); + public static final CustomIcon OVERLAY_REACTOR_COLDTRAP_FRONT = new CustomIcon( + "TileEntities/ReactorColdTrap/OVERLAY_FRONT"); + public static final CustomIcon OVERLAY_REACTOR_COLDTRAP_FRONT_ACTIVE = new CustomIcon( + "TileEntities/ReactorColdTrap/OVERLAY_FRONT_ACTIVE"); + public static final CustomIcon OVERLAY_REACTOR_COLDTRAP_SIDE = new CustomIcon( + "TileEntities/ReactorColdTrap/OVERLAY_SIDE"); + public static final CustomIcon OVERLAY_REACTOR_COLDTRAP_SIDE_ACTIVE = new CustomIcon( + "TileEntities/ReactorColdTrap/OVERLAY_SIDE_ACTIVE"); + public static final CustomIcon OVERLAY_REACTOR_COLDTRAP_TOP = new CustomIcon( + "TileEntities/ReactorColdTrap/OVERLAY_TOP"); + public static final CustomIcon OVERLAY_REACTOR_COLDTRAP_TOP_ACTIVE = new CustomIcon( + "TileEntities/ReactorColdTrap/OVERLAY_TOP_ACTIVE"); + + public static final CustomIcon OVERLAY_REACTOR_PROCESSINGUNIT_FRONT = new CustomIcon( + "TileEntities/ReactorProcessingUnit/OVERLAY_FRONT"); + public static final CustomIcon OVERLAY_REACTOR_PROCESSINGUNIT_FRONT_ACTIVE = new CustomIcon( + "TileEntities/ReactorProcessingUnit/OVERLAY_FRONT_ACTIVE"); + public static final CustomIcon OVERLAY_REACTOR_PROCESSINGUNIT_SIDE = new CustomIcon( + "TileEntities/ReactorProcessingUnit/OVERLAY_SIDE"); + public static final CustomIcon OVERLAY_REACTOR_PROCESSINGUNIT_SIDE_ACTIVE = new CustomIcon( + "TileEntities/ReactorProcessingUnit/OVERLAY_SIDE_ACTIVE"); + public static final CustomIcon OVERLAY_REACTOR_PROCESSINGUNIT_TOP = new CustomIcon( + "TileEntities/ReactorProcessingUnit/OVERLAY_TOP"); + public static final CustomIcon OVERLAY_REACTOR_PROCESSINGUNIT_TOP_ACTIVE = new CustomIcon( + "TileEntities/ReactorProcessingUnit/OVERLAY_TOP_ACTIVE"); // Overlay Arrays public static ITexture[] OVERLAYS_ENERGY_OUT_BUFFER = new ITexture[] { - new GT_RenderedTexture((IIconContainer) OVERLAY_ENERGY_OUT_BUFFER, new short[] {220, 220, 220, 0}), - new GT_RenderedTexture((IIconContainer) OVERLAY_ENERGY_OUT_BUFFER, new short[] {220, 220, 220, 0}), - new GT_RenderedTexture((IIconContainer) OVERLAY_ENERGY_OUT_BUFFER, new short[] {255, 100, 0, 0}), - new GT_RenderedTexture((IIconContainer) OVERLAY_ENERGY_OUT_BUFFER, new short[] {255, 255, 30, 0}), - new GT_RenderedTexture((IIconContainer) OVERLAY_ENERGY_OUT_BUFFER, new short[] {128, 128, 128, 0}), - new GT_RenderedTexture((IIconContainer) OVERLAY_ENERGY_OUT_BUFFER, new short[] {240, 240, 245, 0}), - new GT_RenderedTexture((IIconContainer) OVERLAY_ENERGY_OUT_BUFFER, new short[] {240, 240, 245, 0}), - new GT_RenderedTexture((IIconContainer) OVERLAY_ENERGY_OUT_BUFFER, new short[] {240, 240, 245, 0}), - new GT_RenderedTexture((IIconContainer) OVERLAY_ENERGY_OUT_BUFFER, new short[] {240, 240, 245, 0}), - new GT_RenderedTexture((IIconContainer) OVERLAY_ENERGY_OUT_BUFFER, new short[] {240, 240, 245, 0}) - }; + new GT_RenderedTexture((IIconContainer) OVERLAY_ENERGY_OUT_BUFFER, new short[] { 220, 220, 220, 0 }), + new GT_RenderedTexture((IIconContainer) OVERLAY_ENERGY_OUT_BUFFER, new short[] { 220, 220, 220, 0 }), + new GT_RenderedTexture((IIconContainer) OVERLAY_ENERGY_OUT_BUFFER, new short[] { 255, 100, 0, 0 }), + new GT_RenderedTexture((IIconContainer) OVERLAY_ENERGY_OUT_BUFFER, new short[] { 255, 255, 30, 0 }), + new GT_RenderedTexture((IIconContainer) OVERLAY_ENERGY_OUT_BUFFER, new short[] { 128, 128, 128, 0 }), + new GT_RenderedTexture((IIconContainer) OVERLAY_ENERGY_OUT_BUFFER, new short[] { 240, 240, 245, 0 }), + new GT_RenderedTexture((IIconContainer) OVERLAY_ENERGY_OUT_BUFFER, new short[] { 240, 240, 245, 0 }), + new GT_RenderedTexture((IIconContainer) OVERLAY_ENERGY_OUT_BUFFER, new short[] { 240, 240, 245, 0 }), + new GT_RenderedTexture((IIconContainer) OVERLAY_ENERGY_OUT_BUFFER, new short[] { 240, 240, 245, 0 }), + new GT_RenderedTexture((IIconContainer) OVERLAY_ENERGY_OUT_BUFFER, new short[] { 240, 240, 245, 0 }) }; public static ITexture[] OVERLAYS_ENERGY_OUT_MULTI_BUFFER = new ITexture[] { - new GT_RenderedTexture((IIconContainer) OVERLAY_ENERGY_OUT_MULTI_BUFFER, new short[] {220, 220, 220, 0}), - new GT_RenderedTexture((IIconContainer) OVERLAY_ENERGY_OUT_MULTI_BUFFER, new short[] {220, 220, 220, 0}), - new GT_RenderedTexture((IIconContainer) OVERLAY_ENERGY_OUT_MULTI_BUFFER, new short[] {255, 100, 0, 0}), - new GT_RenderedTexture((IIconContainer) OVERLAY_ENERGY_OUT_MULTI_BUFFER, new short[] {255, 255, 30, 0}), - new GT_RenderedTexture((IIconContainer) OVERLAY_ENERGY_OUT_MULTI_BUFFER, new short[] {128, 128, 128, 0}), - new GT_RenderedTexture((IIconContainer) OVERLAY_ENERGY_OUT_MULTI_BUFFER, new short[] {240, 240, 245, 0}), - new GT_RenderedTexture((IIconContainer) OVERLAY_ENERGY_OUT_MULTI_BUFFER, new short[] {240, 240, 245, 0}), - new GT_RenderedTexture((IIconContainer) OVERLAY_ENERGY_OUT_MULTI_BUFFER, new short[] {240, 240, 245, 0}), - new GT_RenderedTexture((IIconContainer) OVERLAY_ENERGY_OUT_MULTI_BUFFER, new short[] {240, 240, 245, 0}), - new GT_RenderedTexture((IIconContainer) OVERLAY_ENERGY_OUT_MULTI_BUFFER, new short[] {240, 240, 245, 0}) - }; + new GT_RenderedTexture((IIconContainer) OVERLAY_ENERGY_OUT_MULTI_BUFFER, new short[] { 220, 220, 220, 0 }), + new GT_RenderedTexture((IIconContainer) OVERLAY_ENERGY_OUT_MULTI_BUFFER, new short[] { 220, 220, 220, 0 }), + new GT_RenderedTexture((IIconContainer) OVERLAY_ENERGY_OUT_MULTI_BUFFER, new short[] { 255, 100, 0, 0 }), + new GT_RenderedTexture((IIconContainer) OVERLAY_ENERGY_OUT_MULTI_BUFFER, new short[] { 255, 255, 30, 0 }), + new GT_RenderedTexture((IIconContainer) OVERLAY_ENERGY_OUT_MULTI_BUFFER, new short[] { 128, 128, 128, 0 }), + new GT_RenderedTexture((IIconContainer) OVERLAY_ENERGY_OUT_MULTI_BUFFER, new short[] { 240, 240, 245, 0 }), + new GT_RenderedTexture((IIconContainer) OVERLAY_ENERGY_OUT_MULTI_BUFFER, new short[] { 240, 240, 245, 0 }), + new GT_RenderedTexture((IIconContainer) OVERLAY_ENERGY_OUT_MULTI_BUFFER, new short[] { 240, 240, 245, 0 }), + new GT_RenderedTexture((IIconContainer) OVERLAY_ENERGY_OUT_MULTI_BUFFER, new short[] { 240, 240, 245, 0 }), + new GT_RenderedTexture( + (IIconContainer) OVERLAY_ENERGY_OUT_MULTI_BUFFER, + new short[] { 240, 240, 245, 0 }) }; public static ITexture[] OVERLAYS_CABINET_FRONT = new ITexture[] { - new GT_RenderedTexture((IIconContainer) OVERLAY_CABINET_1, new short[] {255, 255, 255, 0}), - new GT_RenderedTexture((IIconContainer) OVERLAY_CABINET_2, new short[] {255, 255, 255, 0}), - new GT_RenderedTexture((IIconContainer) OVERLAY_CABINET_3, new short[] {255, 255, 255, 0}), - new GT_RenderedTexture((IIconContainer) OVERLAY_CABINET_4, new short[] {255, 255, 255, 0}), - new GT_RenderedTexture((IIconContainer) OVERLAY_CABINET_5, new short[] {255, 255, 255, 0}), - new GT_RenderedTexture((IIconContainer) OVERLAY_CABINET_6, new short[] {255, 255, 255, 0}), - new GT_RenderedTexture((IIconContainer) OVERLAY_CABINET_7, new short[] {255, 255, 255, 0}), - new GT_RenderedTexture((IIconContainer) OVERLAY_CABINET_8, new short[] {255, 255, 255, 0}), - new GT_RenderedTexture((IIconContainer) OVERLAY_CABINET_9, new short[] {255, 255, 255, 0}), - new GT_RenderedTexture((IIconContainer) OVERLAY_CABINET_10, new short[] {255, 255, 255, 0}), - new GT_RenderedTexture((IIconContainer) OVERLAY_CABINET_11, new short[] {255, 255, 255, 0}), - new GT_RenderedTexture((IIconContainer) OVERLAY_CABINET_12, new short[] {255, 255, 255, 0}), - new GT_RenderedTexture((IIconContainer) OVERLAY_CABINET_13, new short[] {255, 255, 255, 0}), - new GT_RenderedTexture((IIconContainer) OVERLAY_CABINET_14, new short[] {255, 255, 255, 0}), - new GT_RenderedTexture((IIconContainer) OVERLAY_CABINET_15, new short[] {255, 255, 255, 0}), - new GT_RenderedTexture((IIconContainer) OVERLAY_CABINET_16, new short[] {255, 255, 255, 0}), - }; + new GT_RenderedTexture((IIconContainer) OVERLAY_CABINET_1, new short[] { 255, 255, 255, 0 }), + new GT_RenderedTexture((IIconContainer) OVERLAY_CABINET_2, new short[] { 255, 255, 255, 0 }), + new GT_RenderedTexture((IIconContainer) OVERLAY_CABINET_3, new short[] { 255, 255, 255, 0 }), + new GT_RenderedTexture((IIconContainer) OVERLAY_CABINET_4, new short[] { 255, 255, 255, 0 }), + new GT_RenderedTexture((IIconContainer) OVERLAY_CABINET_5, new short[] { 255, 255, 255, 0 }), + new GT_RenderedTexture((IIconContainer) OVERLAY_CABINET_6, new short[] { 255, 255, 255, 0 }), + new GT_RenderedTexture((IIconContainer) OVERLAY_CABINET_7, new short[] { 255, 255, 255, 0 }), + new GT_RenderedTexture((IIconContainer) OVERLAY_CABINET_8, new short[] { 255, 255, 255, 0 }), + new GT_RenderedTexture((IIconContainer) OVERLAY_CABINET_9, new short[] { 255, 255, 255, 0 }), + new GT_RenderedTexture((IIconContainer) OVERLAY_CABINET_10, new short[] { 255, 255, 255, 0 }), + new GT_RenderedTexture((IIconContainer) OVERLAY_CABINET_11, new short[] { 255, 255, 255, 0 }), + new GT_RenderedTexture((IIconContainer) OVERLAY_CABINET_12, new short[] { 255, 255, 255, 0 }), + new GT_RenderedTexture((IIconContainer) OVERLAY_CABINET_13, new short[] { 255, 255, 255, 0 }), + new GT_RenderedTexture((IIconContainer) OVERLAY_CABINET_14, new short[] { 255, 255, 255, 0 }), + new GT_RenderedTexture((IIconContainer) OVERLAY_CABINET_15, new short[] { 255, 255, 255, 0 }), + new GT_RenderedTexture((IIconContainer) OVERLAY_CABINET_16, new short[] { 255, 255, 255, 0 }), }; public static ITexture[] OVERLAYS_COMPARTMENT_FRONT = new ITexture[] { - new GT_RenderedTexture((IIconContainer) OVERLAY_COMPARTMENT_1, new short[] {255, 255, 255, 0}), - new GT_RenderedTexture((IIconContainer) OVERLAY_COMPARTMENT_2, new short[] {255, 255, 255, 0}), - new GT_RenderedTexture((IIconContainer) OVERLAY_COMPARTMENT_3, new short[] {255, 255, 255, 0}), - new GT_RenderedTexture((IIconContainer) OVERLAY_COMPARTMENT_4, new short[] {255, 255, 255, 0}), - new GT_RenderedTexture((IIconContainer) OVERLAY_COMPARTMENT_5, new short[] {255, 255, 255, 0}), - new GT_RenderedTexture((IIconContainer) OVERLAY_COMPARTMENT_6, new short[] {255, 255, 255, 0}), - new GT_RenderedTexture((IIconContainer) OVERLAY_COMPARTMENT_7, new short[] {255, 255, 255, 0}), - new GT_RenderedTexture((IIconContainer) OVERLAY_COMPARTMENT_8, new short[] {255, 255, 255, 0}), - new GT_RenderedTexture((IIconContainer) OVERLAY_COMPARTMENT_9, new short[] {255, 255, 255, 0}), - new GT_RenderedTexture((IIconContainer) OVERLAY_COMPARTMENT_10, new short[] {255, 255, 255, 0}), - new GT_RenderedTexture((IIconContainer) OVERLAY_COMPARTMENT_11, new short[] {255, 255, 255, 0}), - new GT_RenderedTexture((IIconContainer) OVERLAY_COMPARTMENT_12, new short[] {255, 255, 255, 0}), - new GT_RenderedTexture((IIconContainer) OVERLAY_COMPARTMENT_13, new short[] {255, 255, 255, 0}), - new GT_RenderedTexture((IIconContainer) OVERLAY_COMPARTMENT_14, new short[] {255, 255, 255, 0}), - new GT_RenderedTexture((IIconContainer) OVERLAY_COMPARTMENT_15, new short[] {255, 255, 255, 0}), - new GT_RenderedTexture((IIconContainer) OVERLAY_COMPARTMENT_16, new short[] {255, 255, 255, 0}), - }; - - public static IIconContainer[] CONNECTED_FUSION_HULLS = new IIconContainer[] { - TEXTURE_CASING_FUSION_COIL_II_1, TEXTURE_CASING_FUSION_COIL_II_2, TEXTURE_CASING_FUSION_COIL_II_3, - TEXTURE_CASING_FUSION_COIL_II_4, TEXTURE_CASING_FUSION_COIL_II_5, TEXTURE_CASING_FUSION_COIL_II_6, - TEXTURE_CASING_FUSION_COIL_II_7, TEXTURE_CASING_FUSION_COIL_II_8, TEXTURE_CASING_FUSION_COIL_II_9, - TEXTURE_CASING_FUSION_COIL_II_10, TEXTURE_CASING_FUSION_COIL_II_11, TEXTURE_CASING_FUSION_COIL_II_12 - }; - - public static IIconContainer[] TIERED_MACHINE_HULLS = new IIconContainer[] { - TEXTURE_CASING_TIERED_ULV, - TEXTURE_CASING_TIERED_LV, - TEXTURE_CASING_TIERED_MV, - TEXTURE_CASING_TIERED_HV, - TEXTURE_CASING_TIERED_EV, - TEXTURE_CASING_TIERED_IV, - TEXTURE_CASING_TIERED_LuV, - TEXTURE_CASING_TIERED_ZPM, - TEXTURE_CASING_TIERED_UV, - TEXTURE_CASING_TIERED_MAX - }; + new GT_RenderedTexture((IIconContainer) OVERLAY_COMPARTMENT_1, new short[] { 255, 255, 255, 0 }), + new GT_RenderedTexture((IIconContainer) OVERLAY_COMPARTMENT_2, new short[] { 255, 255, 255, 0 }), + new GT_RenderedTexture((IIconContainer) OVERLAY_COMPARTMENT_3, new short[] { 255, 255, 255, 0 }), + new GT_RenderedTexture((IIconContainer) OVERLAY_COMPARTMENT_4, new short[] { 255, 255, 255, 0 }), + new GT_RenderedTexture((IIconContainer) OVERLAY_COMPARTMENT_5, new short[] { 255, 255, 255, 0 }), + new GT_RenderedTexture((IIconContainer) OVERLAY_COMPARTMENT_6, new short[] { 255, 255, 255, 0 }), + new GT_RenderedTexture((IIconContainer) OVERLAY_COMPARTMENT_7, new short[] { 255, 255, 255, 0 }), + new GT_RenderedTexture((IIconContainer) OVERLAY_COMPARTMENT_8, new short[] { 255, 255, 255, 0 }), + new GT_RenderedTexture((IIconContainer) OVERLAY_COMPARTMENT_9, new short[] { 255, 255, 255, 0 }), + new GT_RenderedTexture((IIconContainer) OVERLAY_COMPARTMENT_10, new short[] { 255, 255, 255, 0 }), + new GT_RenderedTexture((IIconContainer) OVERLAY_COMPARTMENT_11, new short[] { 255, 255, 255, 0 }), + new GT_RenderedTexture((IIconContainer) OVERLAY_COMPARTMENT_12, new short[] { 255, 255, 255, 0 }), + new GT_RenderedTexture((IIconContainer) OVERLAY_COMPARTMENT_13, new short[] { 255, 255, 255, 0 }), + new GT_RenderedTexture((IIconContainer) OVERLAY_COMPARTMENT_14, new short[] { 255, 255, 255, 0 }), + new GT_RenderedTexture((IIconContainer) OVERLAY_COMPARTMENT_15, new short[] { 255, 255, 255, 0 }), + new GT_RenderedTexture((IIconContainer) OVERLAY_COMPARTMENT_16, new short[] { 255, 255, 255, 0 }), }; + + public static IIconContainer[] CONNECTED_FUSION_HULLS = new IIconContainer[] { TEXTURE_CASING_FUSION_COIL_II_1, + TEXTURE_CASING_FUSION_COIL_II_2, TEXTURE_CASING_FUSION_COIL_II_3, TEXTURE_CASING_FUSION_COIL_II_4, + TEXTURE_CASING_FUSION_COIL_II_5, TEXTURE_CASING_FUSION_COIL_II_6, TEXTURE_CASING_FUSION_COIL_II_7, + TEXTURE_CASING_FUSION_COIL_II_8, TEXTURE_CASING_FUSION_COIL_II_9, TEXTURE_CASING_FUSION_COIL_II_10, + TEXTURE_CASING_FUSION_COIL_II_11, TEXTURE_CASING_FUSION_COIL_II_12 }; + + public static IIconContainer[] TIERED_MACHINE_HULLS = new IIconContainer[] { TEXTURE_CASING_TIERED_ULV, + TEXTURE_CASING_TIERED_LV, TEXTURE_CASING_TIERED_MV, TEXTURE_CASING_TIERED_HV, TEXTURE_CASING_TIERED_EV, + TEXTURE_CASING_TIERED_IV, TEXTURE_CASING_TIERED_LuV, TEXTURE_CASING_TIERED_ZPM, TEXTURE_CASING_TIERED_UV, + TEXTURE_CASING_TIERED_MAX }; public static Object Casing_Material_Turbine; } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtCutomCovers.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtCutomCovers.java index bb09531d10..03afcfaa27 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtCutomCovers.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtCutomCovers.java @@ -16,18 +16,21 @@ public class TexturesGtCutomCovers { private static void generateZTones() { // ZTONES - String[] aZtoneCoverTextureNames = new String[] {"agon", "iszm", "korp", "jelt", "bitt"}; + String[] aZtoneCoverTextureNames = new String[] { "agon", "iszm", "korp", "jelt", "bitt" }; int aArrayIndex = 0; - CustomIcon[][] aArrays = new CustomIcon[][] { - TEXTURE_ZTONES_AGON, TEXTURE_ZTONES_ISZM, TEXTURE_ZTONES_KORP, TEXTURE_ZTONES_JELT, TEXTURE_ZTONES_BITT - }; + CustomIcon[][] aArrays = new CustomIcon[][] { TEXTURE_ZTONES_AGON, TEXTURE_ZTONES_ISZM, TEXTURE_ZTONES_KORP, + TEXTURE_ZTONES_JELT, TEXTURE_ZTONES_BITT }; for (CustomIcon[] t : aArrays) { for (int s = 0; s < 16; s++) { t[s] = new CustomIcon( "Ztones", - "sets/" + aZtoneCoverTextureNames[aArrayIndex] + "/" + aZtoneCoverTextureNames[aArrayIndex] - + "_ (" + s + ")"); + "sets/" + aZtoneCoverTextureNames[aArrayIndex] + + "/" + + aZtoneCoverTextureNames[aArrayIndex] + + "_ (" + + s + + ")"); } aArrayIndex++; } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtTools.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtTools.java index b068d12d26..8f9f57110e 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtTools.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtTools.java @@ -1,12 +1,13 @@ package gtPlusPlus.xmod.gregtech.common.blocks.textures; +import net.minecraft.client.renderer.texture.TextureMap; +import net.minecraft.util.IIcon; +import net.minecraft.util.ResourceLocation; + import gregtech.api.GregTech_API; import gregtech.api.interfaces.IIconContainer; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.lib.CORE; -import net.minecraft.client.renderer.texture.TextureMap; -import net.minecraft.util.IIcon; -import net.minecraft.util.ResourceLocation; public final class TexturesGtTools { @@ -17,6 +18,7 @@ public final class TexturesGtTools { public static final CustomIcon ELECTRIC_BUTCHER_KNIFE = new CustomIcon("iconsets/ELECTRIC_BUTCHER_KNIFE"); public static final class CustomIcon implements IIconContainer, Runnable { + protected IIcon mIcon, mOverlay; protected final String mIconName; diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/turbine/LargeTurbineTextureHandler.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/turbine/LargeTurbineTextureHandler.java index b136ad496a..a56acd41c7 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/turbine/LargeTurbineTextureHandler.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/turbine/LargeTurbineTextureHandler.java @@ -74,155 +74,82 @@ import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_TU_ACTIVE8; import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_TU_ACTIVE9; import static gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock.*; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.IIcon; +import net.minecraft.world.IBlockAccess; + import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Turbine; import gtPlusPlus.xmod.gregtech.common.blocks.GregtechMetaSpecialMultiCasings; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.IIcon; -import net.minecraft.world.IBlockAccess; public class LargeTurbineTextureHandler { /** * LP Turbines */ - public static IIcon[] OVERLAY_LP_TURBINE = new IIcon[] { - LARGETURBINE_ST1.getIcon(), - LARGETURBINE_ST2.getIcon(), - LARGETURBINE_ST3.getIcon(), - LARGETURBINE_ST4.getIcon(), - LARGETURBINE_ST5.getIcon(), - LARGETURBINE_ST6.getIcon(), - LARGETURBINE_ST7.getIcon(), - LARGETURBINE_ST8.getIcon(), - LARGETURBINE_ST9.getIcon(), - }; + public static IIcon[] OVERLAY_LP_TURBINE = new IIcon[] { LARGETURBINE_ST1.getIcon(), LARGETURBINE_ST2.getIcon(), + LARGETURBINE_ST3.getIcon(), LARGETURBINE_ST4.getIcon(), LARGETURBINE_ST5.getIcon(), + LARGETURBINE_ST6.getIcon(), LARGETURBINE_ST7.getIcon(), LARGETURBINE_ST8.getIcon(), + LARGETURBINE_ST9.getIcon(), }; - public static IIcon[] OVERLAY_LP_TURBINE_ACTIVE = new IIcon[] { - LARGETURBINE_ST_ACTIVE1.getIcon(), - LARGETURBINE_ST_ACTIVE2.getIcon(), - LARGETURBINE_ST_ACTIVE3.getIcon(), - LARGETURBINE_ST_ACTIVE4.getIcon(), - LARGETURBINE_ST_ACTIVE5.getIcon(), - LARGETURBINE_ST_ACTIVE6.getIcon(), - LARGETURBINE_ST_ACTIVE7.getIcon(), - LARGETURBINE_ST_ACTIVE8.getIcon(), - LARGETURBINE_ST_ACTIVE9.getIcon(), - }; + public static IIcon[] OVERLAY_LP_TURBINE_ACTIVE = new IIcon[] { LARGETURBINE_ST_ACTIVE1.getIcon(), + LARGETURBINE_ST_ACTIVE2.getIcon(), LARGETURBINE_ST_ACTIVE3.getIcon(), LARGETURBINE_ST_ACTIVE4.getIcon(), + LARGETURBINE_ST_ACTIVE5.getIcon(), LARGETURBINE_ST_ACTIVE6.getIcon(), LARGETURBINE_ST_ACTIVE7.getIcon(), + LARGETURBINE_ST_ACTIVE8.getIcon(), LARGETURBINE_ST_ACTIVE9.getIcon(), }; /** * HP Turbines */ - public static IIcon[] OVERLAY_HP_TURBINE = new IIcon[] { - LARGETURBINE_TI1.getIcon(), - LARGETURBINE_TI2.getIcon(), - LARGETURBINE_TI3.getIcon(), - LARGETURBINE_TI4.getIcon(), - LARGETURBINE_TI5.getIcon(), - LARGETURBINE_TI6.getIcon(), - LARGETURBINE_TI7.getIcon(), - LARGETURBINE_TI8.getIcon(), - LARGETURBINE_TI9.getIcon(), - }; + public static IIcon[] OVERLAY_HP_TURBINE = new IIcon[] { LARGETURBINE_TI1.getIcon(), LARGETURBINE_TI2.getIcon(), + LARGETURBINE_TI3.getIcon(), LARGETURBINE_TI4.getIcon(), LARGETURBINE_TI5.getIcon(), + LARGETURBINE_TI6.getIcon(), LARGETURBINE_TI7.getIcon(), LARGETURBINE_TI8.getIcon(), + LARGETURBINE_TI9.getIcon(), }; - public static IIcon[] OVERLAY_HP_TURBINE_ACTIVE = new IIcon[] { - LARGETURBINE_TI_ACTIVE1.getIcon(), - LARGETURBINE_TI_ACTIVE2.getIcon(), - LARGETURBINE_TI_ACTIVE3.getIcon(), - LARGETURBINE_TI_ACTIVE4.getIcon(), - LARGETURBINE_TI_ACTIVE5.getIcon(), - LARGETURBINE_TI_ACTIVE6.getIcon(), - LARGETURBINE_TI_ACTIVE7.getIcon(), - LARGETURBINE_TI_ACTIVE8.getIcon(), - LARGETURBINE_TI_ACTIVE9.getIcon(), - }; + public static IIcon[] OVERLAY_HP_TURBINE_ACTIVE = new IIcon[] { LARGETURBINE_TI_ACTIVE1.getIcon(), + LARGETURBINE_TI_ACTIVE2.getIcon(), LARGETURBINE_TI_ACTIVE3.getIcon(), LARGETURBINE_TI_ACTIVE4.getIcon(), + LARGETURBINE_TI_ACTIVE5.getIcon(), LARGETURBINE_TI_ACTIVE6.getIcon(), LARGETURBINE_TI_ACTIVE7.getIcon(), + LARGETURBINE_TI_ACTIVE8.getIcon(), LARGETURBINE_TI_ACTIVE9.getIcon(), }; /** * Gas Turbines */ - public static IIcon[] OVERLAY_GAS_TURBINE = new IIcon[] { - LARGETURBINE_SS1.getIcon(), - LARGETURBINE_SS2.getIcon(), - LARGETURBINE_SS3.getIcon(), - LARGETURBINE_SS4.getIcon(), - LARGETURBINE_SS5.getIcon(), - LARGETURBINE_SS6.getIcon(), - LARGETURBINE_SS7.getIcon(), - LARGETURBINE_SS8.getIcon(), - LARGETURBINE_SS9.getIcon(), - }; + public static IIcon[] OVERLAY_GAS_TURBINE = new IIcon[] { LARGETURBINE_SS1.getIcon(), LARGETURBINE_SS2.getIcon(), + LARGETURBINE_SS3.getIcon(), LARGETURBINE_SS4.getIcon(), LARGETURBINE_SS5.getIcon(), + LARGETURBINE_SS6.getIcon(), LARGETURBINE_SS7.getIcon(), LARGETURBINE_SS8.getIcon(), + LARGETURBINE_SS9.getIcon(), }; - public static IIcon[] OVERLAY_GAS_TURBINE_ACTIVE = new IIcon[] { - LARGETURBINE_SS_ACTIVE1.getIcon(), - LARGETURBINE_SS_ACTIVE2.getIcon(), - LARGETURBINE_SS_ACTIVE3.getIcon(), - LARGETURBINE_SS_ACTIVE4.getIcon(), - LARGETURBINE_SS_ACTIVE5.getIcon(), - LARGETURBINE_SS_ACTIVE6.getIcon(), - LARGETURBINE_SS_ACTIVE7.getIcon(), - LARGETURBINE_SS_ACTIVE8.getIcon(), - LARGETURBINE_SS_ACTIVE9.getIcon(), - }; + public static IIcon[] OVERLAY_GAS_TURBINE_ACTIVE = new IIcon[] { LARGETURBINE_SS_ACTIVE1.getIcon(), + LARGETURBINE_SS_ACTIVE2.getIcon(), LARGETURBINE_SS_ACTIVE3.getIcon(), LARGETURBINE_SS_ACTIVE4.getIcon(), + LARGETURBINE_SS_ACTIVE5.getIcon(), LARGETURBINE_SS_ACTIVE6.getIcon(), LARGETURBINE_SS_ACTIVE7.getIcon(), + LARGETURBINE_SS_ACTIVE8.getIcon(), LARGETURBINE_SS_ACTIVE9.getIcon(), }; /** * Plasma Turbines */ - public static IIcon[] OVERLAY_PLASMA_TURBINE = new IIcon[] { - LARGETURBINE_TU1.getIcon(), - LARGETURBINE_TU2.getIcon(), - LARGETURBINE_TU3.getIcon(), - LARGETURBINE_TU4.getIcon(), - LARGETURBINE_TU5.getIcon(), - LARGETURBINE_TU6.getIcon(), - LARGETURBINE_TU7.getIcon(), - LARGETURBINE_TU8.getIcon(), - LARGETURBINE_TU9.getIcon(), - }; + public static IIcon[] OVERLAY_PLASMA_TURBINE = new IIcon[] { LARGETURBINE_TU1.getIcon(), LARGETURBINE_TU2.getIcon(), + LARGETURBINE_TU3.getIcon(), LARGETURBINE_TU4.getIcon(), LARGETURBINE_TU5.getIcon(), + LARGETURBINE_TU6.getIcon(), LARGETURBINE_TU7.getIcon(), LARGETURBINE_TU8.getIcon(), + LARGETURBINE_TU9.getIcon(), }; - public static IIcon[] OVERLAY_PLASMA_TURBINE_ACTIVE = new IIcon[] { - LARGETURBINE_TU_ACTIVE1.getIcon(), - LARGETURBINE_TU_ACTIVE2.getIcon(), - LARGETURBINE_TU_ACTIVE3.getIcon(), - LARGETURBINE_TU_ACTIVE4.getIcon(), - LARGETURBINE_TU_ACTIVE5.getIcon(), - LARGETURBINE_TU_ACTIVE6.getIcon(), - LARGETURBINE_TU_ACTIVE7.getIcon(), - LARGETURBINE_TU_ACTIVE8.getIcon(), - LARGETURBINE_TU_ACTIVE9.getIcon(), - }; + public static IIcon[] OVERLAY_PLASMA_TURBINE_ACTIVE = new IIcon[] { LARGETURBINE_TU_ACTIVE1.getIcon(), + LARGETURBINE_TU_ACTIVE2.getIcon(), LARGETURBINE_TU_ACTIVE3.getIcon(), LARGETURBINE_TU_ACTIVE4.getIcon(), + LARGETURBINE_TU_ACTIVE5.getIcon(), LARGETURBINE_TU_ACTIVE6.getIcon(), LARGETURBINE_TU_ACTIVE7.getIcon(), + LARGETURBINE_TU_ACTIVE8.getIcon(), LARGETURBINE_TU_ACTIVE9.getIcon(), }; - public static IIcon[] OVERLAY_SC_TURBINE = new IIcon[] { - OVERLAY_SC_TURBINE1.getIcon(), - OVERLAY_SC_TURBINE2.getIcon(), - OVERLAY_SC_TURBINE3.getIcon(), - OVERLAY_SC_TURBINE4.getIcon(), - OVERLAY_SC_TURBINE5.getIcon(), - OVERLAY_SC_TURBINE6.getIcon(), - OVERLAY_SC_TURBINE7.getIcon(), - OVERLAY_SC_TURBINE8.getIcon(), - OVERLAY_SC_TURBINE9.getIcon(), - }; + public static IIcon[] OVERLAY_SC_TURBINE = new IIcon[] { OVERLAY_SC_TURBINE1.getIcon(), + OVERLAY_SC_TURBINE2.getIcon(), OVERLAY_SC_TURBINE3.getIcon(), OVERLAY_SC_TURBINE4.getIcon(), + OVERLAY_SC_TURBINE5.getIcon(), OVERLAY_SC_TURBINE6.getIcon(), OVERLAY_SC_TURBINE7.getIcon(), + OVERLAY_SC_TURBINE8.getIcon(), OVERLAY_SC_TURBINE9.getIcon(), }; - public static IIcon[] OVERLAY_SC_TURBINE_ACTIVE = new IIcon[] { - OVERLAY_SC_TURBINE1_ACTIVE.getIcon(), - OVERLAY_SC_TURBINE2_ACTIVE.getIcon(), - OVERLAY_SC_TURBINE3_ACTIVE.getIcon(), - OVERLAY_SC_TURBINE4_ACTIVE.getIcon(), - OVERLAY_SC_TURBINE5_ACTIVE.getIcon(), - OVERLAY_SC_TURBINE6_ACTIVE.getIcon(), - OVERLAY_SC_TURBINE7_ACTIVE.getIcon(), - OVERLAY_SC_TURBINE8_ACTIVE.getIcon(), - OVERLAY_SC_TURBINE9_ACTIVE.getIcon(), - }; + public static IIcon[] OVERLAY_SC_TURBINE_ACTIVE = new IIcon[] { OVERLAY_SC_TURBINE1_ACTIVE.getIcon(), + OVERLAY_SC_TURBINE2_ACTIVE.getIcon(), OVERLAY_SC_TURBINE3_ACTIVE.getIcon(), + OVERLAY_SC_TURBINE4_ACTIVE.getIcon(), OVERLAY_SC_TURBINE5_ACTIVE.getIcon(), + OVERLAY_SC_TURBINE6_ACTIVE.getIcon(), OVERLAY_SC_TURBINE7_ACTIVE.getIcon(), + OVERLAY_SC_TURBINE8_ACTIVE.getIcon(), OVERLAY_SC_TURBINE9_ACTIVE.getIcon(), }; - public static IIcon handleCasingsGT( - final IBlockAccess aWorld, - final int xCoord, - final int yCoord, - final int zCoord, - final int aSide, - final GregtechMetaSpecialMultiCasings i) { + public static IIcon handleCasingsGT(final IBlockAccess aWorld, final int xCoord, final int yCoord, final int zCoord, + final int aSide, final GregtechMetaSpecialMultiCasings i) { final int tMeta = aWorld.getBlockMetadata(xCoord, yCoord, zCoord); // 0 shaft @@ -436,9 +363,7 @@ public class LargeTurbineTextureHandler { if (aTile != null) { final IMetaTileEntity aMetaTileEntity = aTile.getMetaTileEntity(); if (aMetaTileEntity != null && aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Turbine) { - aVal = ((GT_MetaTileEntity_Hatch_Turbine) aMetaTileEntity) - .getBaseMetaTileEntity() - .isActive(); + aVal = ((GT_MetaTileEntity_Hatch_Turbine) aMetaTileEntity).getBaseMetaTileEntity().isActive(); // Logger.INFO("Returning "+aVal+" as Rotor Assembly controller status"); } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/computer/GT_ComputerCube_Setup.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/computer/GT_ComputerCube_Setup.java index 4c6dee9c2f..a3cf7e8219 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/computer/GT_ComputerCube_Setup.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/computer/GT_ComputerCube_Setup.java @@ -2,6 +2,10 @@ package gtPlusPlus.xmod.gregtech.common.computer; import static gtPlusPlus.xmod.gregtech.common.tileentities.misc.GT_TileEntity_ComputerCube.sReactorList; +import java.util.ArrayList; + +import net.minecraft.item.ItemStack; + import Ic2ExpReactorPlanner.ComponentFactory; import gregtech.api.enums.ItemList; import gregtech.api.objects.GT_ItemStack; @@ -12,40 +16,25 @@ import gtPlusPlus.core.lib.LoadedMods; import gtPlusPlus.core.util.minecraft.ItemUtils; import gtPlusPlus.xmod.bartworks.BW_Utils; import gtPlusPlus.xmod.goodgenerator.GG_Utils; -import java.util.ArrayList; -import net.minecraft.item.ItemStack; public class GT_ComputerCube_Setup { public static void init() { - Logger.INFO("[Reactor Simulator] Added " + ComponentFactory.getComponentCount() - + " components to ComponentFactory."); + Logger.INFO( + "[Reactor Simulator] Added " + ComponentFactory.getComponentCount() + + " components to ComponentFactory."); if (sReactorList == null) { sReactorList = new ArrayList<GT_ItemStack>(); - String[] aIc2Items = new String[] { - "reactorUraniumSimple", - "reactorUraniumDual", - "reactorUraniumQuad", /*"reactorIsotopeCell",*/ - "reactorReflector", - "reactorReflectorThick", - "reactorCoolantSimple", - "reactorCoolantTriple", - "reactorCoolantSix", - "reactorCondensator", - "reactorCondensatorLap", - "reactorPlating", - "reactorPlatingHeat", - "reactorPlatingExplosive", - "reactorVent", - "reactorVentCore", - "reactorVentGold", - "reactorVentSpread", - "reactorVentDiamond", - "reactorHeatSwitch", - "reactorHeatSwitchCore", - "reactorHeatSwitchSpread", - "reactorHeatSwitchDiamond", /*"reactorHeatpack",*/ + String[] aIc2Items = new String[] { "reactorUraniumSimple", "reactorUraniumDual", "reactorUraniumQuad", /* + * "reactorIsotopeCell", + */ + "reactorReflector", "reactorReflectorThick", "reactorCoolantSimple", "reactorCoolantTriple", + "reactorCoolantSix", "reactorCondensator", "reactorCondensatorLap", "reactorPlating", + "reactorPlatingHeat", "reactorPlatingExplosive", "reactorVent", "reactorVentCore", + "reactorVentGold", "reactorVentSpread", "reactorVentDiamond", "reactorHeatSwitch", + "reactorHeatSwitchCore", "reactorHeatSwitchSpread", + "reactorHeatSwitchDiamond", /* "reactorHeatpack", */ }; for (String aItem : aIc2Items) { @@ -58,31 +47,14 @@ public class GT_ComputerCube_Setup { } } - ItemList[] aGtItems = new ItemList[] { - ItemList.Neutron_Reflector, - ItemList.Moxcell_1, - ItemList.Moxcell_2, - ItemList.Moxcell_4, /*ItemList.Uraniumcell_1, ItemList.Uraniumcell_2, ItemList.Uraniumcell_4,*/ - ItemList.NaquadahCell_1, - ItemList.NaquadahCell_2, - ItemList.NaquadahCell_4, - ItemList.ThoriumCell_1, - ItemList.ThoriumCell_2, - ItemList.ThoriumCell_4, - ItemList.MNqCell_1, - ItemList.MNqCell_2, - ItemList.MNqCell_4, - ItemList.Reactor_Coolant_He_1, - ItemList.Reactor_Coolant_He_3, - ItemList.Reactor_Coolant_He_6, - ItemList.Reactor_Coolant_NaK_1, - ItemList.Reactor_Coolant_NaK_3, - ItemList.Reactor_Coolant_NaK_6, - ItemList.Reactor_Coolant_Sp_1, - ItemList.Reactor_Coolant_Sp_2, - ItemList.Reactor_Coolant_Sp_3, - ItemList.Reactor_Coolant_Sp_6 - }; + ItemList[] aGtItems = new ItemList[] { ItemList.Neutron_Reflector, ItemList.Moxcell_1, ItemList.Moxcell_2, + ItemList.Moxcell_4, /* ItemList.Uraniumcell_1, ItemList.Uraniumcell_2, ItemList.Uraniumcell_4, */ + ItemList.NaquadahCell_1, ItemList.NaquadahCell_2, ItemList.NaquadahCell_4, ItemList.ThoriumCell_1, + ItemList.ThoriumCell_2, ItemList.ThoriumCell_4, ItemList.MNqCell_1, ItemList.MNqCell_2, + ItemList.MNqCell_4, ItemList.Reactor_Coolant_He_1, ItemList.Reactor_Coolant_He_3, + ItemList.Reactor_Coolant_He_6, ItemList.Reactor_Coolant_NaK_1, ItemList.Reactor_Coolant_NaK_3, + ItemList.Reactor_Coolant_NaK_6, ItemList.Reactor_Coolant_Sp_1, ItemList.Reactor_Coolant_Sp_2, + ItemList.Reactor_Coolant_Sp_3, ItemList.Reactor_Coolant_Sp_6 }; for (ItemList aItem : aGtItems) { sReactorList.add(new GT_ItemStack(aItem.get(1))); diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/computer/GT_Computercube_Description.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/computer/GT_Computercube_Description.java index 18ae44ab79..2e7a7c7ffb 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/computer/GT_Computercube_Description.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/computer/GT_Computercube_Description.java @@ -1,15 +1,18 @@ package gtPlusPlus.xmod.gregtech.common.computer; +import java.util.ArrayList; + +import net.minecraft.item.ItemStack; + import gregtech.api.enums.ItemList; import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_Utility; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.util.minecraft.FluidUtils; import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; -import java.util.ArrayList; -import net.minecraft.item.ItemStack; public class GT_Computercube_Description { + public static ArrayList<GT_Computercube_Description> sDescriptions = new ArrayList<GT_Computercube_Description>(); public String[] mDescription; @@ -25,510 +28,267 @@ public class GT_Computercube_Description { public static void addStandardDescriptions() { Logger.INFO("Adding Default Description Set of the Computer Cube"); new GT_Computercube_Description( - new String[] { - "Lightning Rod", - "Also known as the Bane of", - "Alblaka. The Lightning Rod", - "enables you to gain Energy", - "from Lightning! To set it up", - "you just need the Block", - "itself, 4 HV-Transformers", - "and a crapton of Ironfences,", - "which you then place on top", - "of it. After that you have to", - "wait for a Thunderstorm and", - "when you are lucky you get", - "2.5 MFSU of Energy out of", - "it. If a Rod is high enough", - "then Rain is also enough to", - "get stroke, but with less", - "probability ofcourse." - }, - new ItemStack[] { - GT_ModHandler.getIC2Item("ironFence", 1), - GT_ModHandler.getIC2Item("ironFence", 1), - GT_ModHandler.getIC2Item("ironFence", 1), - GT_ModHandler.getIC2Item("ironFence", 1), - ItemList.Machine_IV_LightningRod.get(1), - null, - null, - null, - null, - null, - null, - null, - null, - null - }); + new String[] { "Lightning Rod", "Also known as the Bane of", "Alblaka. The Lightning Rod", + "enables you to gain Energy", "from Lightning! To set it up", "you just need the Block", + "itself, 4 HV-Transformers", "and a crapton of Ironfences,", "which you then place on top", + "of it. After that you have to", "wait for a Thunderstorm and", "when you are lucky you get", + "2.5 MFSU of Energy out of", "it. If a Rod is high enough", "then Rain is also enough to", + "get stroke, but with less", "probability ofcourse." }, + new ItemStack[] { GT_ModHandler.getIC2Item("ironFence", 1), GT_ModHandler.getIC2Item("ironFence", 1), + GT_ModHandler.getIC2Item("ironFence", 1), GT_ModHandler.getIC2Item("ironFence", 1), + ItemList.Machine_IV_LightningRod.get(1), null, null, null, null, null, null, null, null, + null }); new GT_Computercube_Description( - new String[] { - "Quantum Chest", - "You want to store tons of", - "Materials into your Chests", - "but you hate the Item limit", - "of them? Not anymore! The", - "Quantum Chest is able to", - "store an INFINITE* amount", - "of one single Item type per", - "Chest.", - "This Chest stores your Items", - "like Data and ever has a", - "Stack of the Item ready for", - "extraction. It is compatible", - "with any Item that doesnt", - "have a NBT-Tag. You ask what", - "NBT is? I know it, thats enough.", - "Up to 2147483391*" - }, - new ItemStack[] { - ItemList.Quantum_Chest_IV.get(1), - ItemList.Quantum_Chest_EV.get(1), - ItemList.Quantum_Chest_HV.get(1), - ItemList.Quantum_Chest_MV.get(1), - ItemList.Quantum_Chest_LV.get(1), - null, - null, - null, - null, - null, - null, - null, - null, - null - }); + new String[] { "Quantum Chest", "You want to store tons of", "Materials into your Chests", + "but you hate the Item limit", "of them? Not anymore! The", "Quantum Chest is able to", + "store an INFINITE* amount", "of one single Item type per", "Chest.", + "This Chest stores your Items", "like Data and ever has a", "Stack of the Item ready for", + "extraction. It is compatible", "with any Item that doesnt", "have a NBT-Tag. You ask what", + "NBT is? I know it, thats enough.", "Up to 2147483391*" }, + new ItemStack[] { ItemList.Quantum_Chest_IV.get(1), ItemList.Quantum_Chest_EV.get(1), + ItemList.Quantum_Chest_HV.get(1), ItemList.Quantum_Chest_MV.get(1), + ItemList.Quantum_Chest_LV.get(1), null, null, null, null, null, null, null, null, null }); new GT_Computercube_Description( - new String[] { - "Quantum Tank", - "You want to store tons of", - "Fluids into your Tanks", - "but you hate the capacity", - "of them? Not anymore! The", - "Quantum Tank is able to", - "store an INFINITE* amount", - "of one single Fluid type per", - "Tank.", - "This Tank stores your Fluids", - "like Data and ever has a", - "Stack of the Fluid ready for", - "extraction. It is compatible", - "with any Fluid. ", - "You ask what", - "NBT is? I know it, thats enough.", - "* = 2147483391" - }, - new ItemStack[] { - ItemList.Quantum_Tank_IV.get(1), - ItemList.Quantum_Tank_EV.get(1), - ItemList.Quantum_Tank_HV.get(1), - ItemList.Quantum_Tank_MV.get(1), - ItemList.Quantum_Tank_LV.get(1), - null, - null, - null, - null, - null, - null, - null, - null, - null - }); + new String[] { "Quantum Tank", "You want to store tons of", "Fluids into your Tanks", + "but you hate the capacity", "of them? Not anymore! The", "Quantum Tank is able to", + "store an INFINITE* amount", "of one single Fluid type per", "Tank.", + "This Tank stores your Fluids", "like Data and ever has a", "Stack of the Fluid ready for", + "extraction. It is compatible", "with any Fluid. ", "You ask what", + "NBT is? I know it, thats enough.", "* = 2147483391" }, + new ItemStack[] { ItemList.Quantum_Tank_IV.get(1), ItemList.Quantum_Tank_EV.get(1), + ItemList.Quantum_Tank_HV.get(1), ItemList.Quantum_Tank_MV.get(1), + ItemList.Quantum_Tank_LV.get(1), null, null, null, null, null, null, null, null, null }); new GT_Computercube_Description( - new String[] { - "Computer Cube", - "The Device you are", - "currently using. This Computer", - "is running the G.L.A.D.-OS,", - "which is containing many", - "usefull Apps:", - "- Reactor Planner", - "- Seedbag Scanner", - "- Recipelists for GT-Devices", - "- ", - "- ", - "- ", - "- ", - "- ", - "And the Description List you", - "are currently reading.", - "~This Device has private Access~" - }, - new ItemStack[] { - null, - null, - null, - null, - GregtechItemList.Gregtech_Computer_Cube_Machine.get(1), - null, - null, - null, - null, - null, - null, - null, - null, - null - }); - /* new GT_Computercube_Description(new String[] { - "UUM-Assembler", "It's like an automatic", "Crafting Table just for UUM", "It can store 20 UUM-Recipes", "and produces those on demand", "It costs 512EU per used piece", "of Universal-Usable-Matter(TM).", "The integrated Quantum Chest", "allows it to store all your", "UUM inside it.", - "Top and Bottom are for Input,", "while the Output is on the", "Sides. The Output is designed,", "to work with RP-Managers, so", "build it into your recursive", "Autocraftingsystem.", "" }, new ItemStack[] { - null, null, null, GT_ModHandler.getIC2Item("matter", 1), new ItemStack(GregTech_API.sBlockList[1], 1, 5), null, null, null, null, null, - null, null, null, null }); - new GT_Computercube_Description(new String[] { - "Sonictron", "You like Music? Then the", "Sonictron 9001 is your best", "choice! You can compose Alarms,", "Doorbell Sounds or boring", "Elevator Music, with the 64 Slots", "inside it. Just leftclick them", "to switch the Sound, rightclick", "them to switch the modulation", "and shiftclick to remove it.", - "Then apply Redstone to play", "With the mobile Version you can", "play sounds everywhere, after", "you copied them from a normal", "Sonictron via rightclicking", "Sneakrightclicking pastes", "Emits Redstone when finished." }, new ItemStack[] { - null, null, null, GregTech_API.getGregTechItem(32, 1, 0), new ItemStack(GregTech_API.sBlockList[1], 1, 6), null, null, null, null, null, - null, null, null, null }); - new GT_Computercube_Description(new String[] { - "L.E.S.U.", "The unlaggiest Multiblock ever!", "One Controllerblock, and as many", "'stupid' Storageblocks as you want.", "To use it, place one Controller", "and then place the LESU-Storages", "adjacent to it or other placed", "LESU-Storages. The Tier (max EU/t)", "of it depends on the amount of", "adjacent Storages. The", - "Storageblocks are NOT TileEntities,", "what means that they cause as much", "Lag as a random Dirtblock. And the", "Controller Block only checks ONCE", "for the Storages, so no", "Blockiterationlag, AT. ALL. Anyone,", "who says that they lag gets murdered!" }, new ItemStack[] { - null, null, null, new ItemStack(GregTech_API.sBlockList[0], 1, 6), new ItemStack(GregTech_API.sBlockList[1], 1, 7), null, null, null, null, null, - null, null, null, null }); - new GT_Computercube_Description(new String[] { - "I.D.S.U.", "The Interdimensional Storage Unit", "is a Device, which is like a", "wireless, crossdimensional and", "enderchestlike EU-Storage Block", "", "Every Player has one Network of", "these. The ID is determined by", "the Hashcode of the Name from the", "first Player, who opens it's GUI", - "", "It stores up to 1 Billion EU", "and emits EV. But you need at", "least two of them for Energy", "Transfer", "", "" }, new ItemStack[] { - null, null, null, null, new ItemStack(GregTech_API.sBlockList[1], 1, 8), null, null, null, null, null, - null, null, null, null }); - new GT_Computercube_Description(new String[] { - "A.E.S.U.", "The Adjustable Energy Storage Unit", "is like 10 MFSU and has an", "adjustable Output between 0 and", "2048EU/t. You could use it as a", "Transformer. It is Tier-IV, so", "it's basically needed to charge", "Energy Orbs and Lapotron Packs", "", "Not much else to say about it.", - "", "", "", "", "", "", "" }, new ItemStack[] { - null, null, null, null, new ItemStack(GregTech_API.sBlockList[1], 1, 9), null, null, null, null, null, - null, null, null, null }); - new GT_Computercube_Description(new String[] { - "Charge-O-Mat", "An automatable Charging Bench", "It puts (de-)charged Tools into", "the right Outputslots, which are", "accessible on the Sides of it.", "", "The Energy Orb inside stores enough", "to charge your QSuit almost instantly", "", "This is a Tier-V Charging Station", - "even when the Max-IN/OUT is only", "2048EU/t. It also charges your Armor", "when you are standing close to it.", "", "If you apply Redstone, then it", "decharges instead.", "" }, new ItemStack[] { - null, null, null, null, new ItemStack(GregTech_API.sBlockList[1], 1, 10), null, null, null, null, null, - null, null, null, null }); - new GT_Computercube_Description(new String[] { - "Centrifuge", "This is a Machine to seperate", "Isotopes.", "", "It has a maximum Consumption Rate", "of 5EU/t, and its Maxinput is", "32EU/t. The time it needs depends", "on the Recipe you use.", "", "It needs Tin Cells for some Recipes,", - "which you put in the Top Left Slot", "", "Top = Input", "Bottom = Tin Cells", "Side = Output", "", "You can pipe Lava into this Device" }, new ItemStack[] { - null, null, null, null, new ItemStack(GregTech_API.sBlockList[1], 1, 11), null, null, null, null, null, - null, null, null, null }); - new GT_Computercube_Description(new String[] { - "Electrolyzer", "This is a Machine to seperate", "Molecules and electrolyze", "Watercells.", "", "It has a maximum Consumption Rate", "of 128EU/t, and its Maxinput is", "128EU/t. The time it needs depends", "on the Recipe you use.", "", - "It needs Tin Cells for some Recipes,", "which you put in the Bottom Left Slot", "", "Top = Input", "Bottom = Tin Cells", "Side = Output", "" }, new ItemStack[] { - null, null, null, null, new ItemStack(GregTech_API.sBlockList[1], 1, 25), null, null, null, null, null, - null, null, null, null }); - new GT_Computercube_Description(new String[] { - "Grinder", "This Machines purpose is to", "macerate and grind Ores.", "It can ONLY grind Ores, don't", "try regular Macerator Recipes.", "It has a fixed Consumption Rate", "of 128EU/t, and its Maxinput is", "128EU/t. The time it needs is", "5 seconds per Ore Block", "It needs Water for most Recipes,", - "which you put in the Bottom Left Slot", "Top = Input", "Bottom = Water", "Side = Output", "Its a lagfree Multiblock Structure,", "so you need a special Machine Casing", "for this Device. (see GUI)" }, new ItemStack[] { - null, new ItemStack(Block.field_71943_B, 1), new ItemStack(GregTech_API.sBlockList[0], 1, 14), new ItemStack(GregTech_API.sBlockList[0], 1, 13), new ItemStack(GregTech_API.sBlockList[1], 1, 28), null, null, null, null, null, - null, null, null, null });*/ + new String[] { "Computer Cube", "The Device you are", "currently using. This Computer", + "is running the G.L.A.D.-OS,", "which is containing many", "usefull Apps:", "- Reactor Planner", + "- Seedbag Scanner", "- Recipelists for GT-Devices", "- ", "- ", "- ", "- ", "- ", + "And the Description List you", "are currently reading.", "~This Device has private Access~" }, + new ItemStack[] { null, null, null, null, GregtechItemList.Gregtech_Computer_Cube_Machine.get(1), null, + null, null, null, null, null, null, null, null }); + /* + * new GT_Computercube_Description(new String[] { "UUM-Assembler", "It's like an automatic", + * "Crafting Table just for UUM", "It can store 20 UUM-Recipes", "and produces those on demand", + * "It costs 512EU per used piece", "of Universal-Usable-Matter(TM).", "The integrated Quantum Chest", + * "allows it to store all your", "UUM inside it.", "Top and Bottom are for Input,", + * "while the Output is on the", "Sides. The Output is designed,", "to work with RP-Managers, so", + * "build it into your recursive", "Autocraftingsystem.", "" }, new ItemStack[] { null, null, null, + * GT_ModHandler.getIC2Item("matter", 1), new ItemStack(GregTech_API.sBlockList[1], 1, 5), null, null, null, + * null, null, null, null, null, null }); new GT_Computercube_Description(new String[] { "Sonictron", + * "You like Music? Then the", "Sonictron 9001 is your best", "choice! You can compose Alarms,", + * "Doorbell Sounds or boring", "Elevator Music, with the 64 Slots", "inside it. Just leftclick them", + * "to switch the Sound, rightclick", "them to switch the modulation", "and shiftclick to remove it.", + * "Then apply Redstone to play", "With the mobile Version you can", "play sounds everywhere, after", + * "you copied them from a normal", "Sonictron via rightclicking", "Sneakrightclicking pastes", + * "Emits Redstone when finished." }, new ItemStack[] { null, null, null, GregTech_API.getGregTechItem(32, 1, + * 0), new ItemStack(GregTech_API.sBlockList[1], 1, 6), null, null, null, null, null, null, null, null, null }); + * new GT_Computercube_Description(new String[] { "L.E.S.U.", "The unlaggiest Multiblock ever!", + * "One Controllerblock, and as many", "'stupid' Storageblocks as you want.", "To use it, place one Controller", + * "and then place the LESU-Storages", "adjacent to it or other placed", "LESU-Storages. The Tier (max EU/t)", + * "of it depends on the amount of", "adjacent Storages. The", "Storageblocks are NOT TileEntities,", + * "what means that they cause as much", "Lag as a random Dirtblock. And the", + * "Controller Block only checks ONCE", "for the Storages, so no", "Blockiterationlag, AT. ALL. Anyone,", + * "who says that they lag gets murdered!" }, new ItemStack[] { null, null, null, new + * ItemStack(GregTech_API.sBlockList[0], 1, 6), new ItemStack(GregTech_API.sBlockList[1], 1, 7), null, null, + * null, null, null, null, null, null, null }); new GT_Computercube_Description(new String[] { "I.D.S.U.", + * "The Interdimensional Storage Unit", "is a Device, which is like a", "wireless, crossdimensional and", + * "enderchestlike EU-Storage Block", "", "Every Player has one Network of", "these. The ID is determined by", + * "the Hashcode of the Name from the", "first Player, who opens it's GUI", "", "It stores up to 1 Billion EU", + * "and emits EV. But you need at", "least two of them for Energy", "Transfer", "", "" }, new ItemStack[] { + * null, null, null, null, new ItemStack(GregTech_API.sBlockList[1], 1, 8), null, null, null, null, null, null, + * null, null, null }); new GT_Computercube_Description(new String[] { "A.E.S.U.", + * "The Adjustable Energy Storage Unit", "is like 10 MFSU and has an", "adjustable Output between 0 and", + * "2048EU/t. You could use it as a", "Transformer. It is Tier-IV, so", "it's basically needed to charge", + * "Energy Orbs and Lapotron Packs", "", "Not much else to say about it.", "", "", "", "", "", "", "" }, new + * ItemStack[] { null, null, null, null, new ItemStack(GregTech_API.sBlockList[1], 1, 9), null, null, null, + * null, null, null, null, null, null }); new GT_Computercube_Description(new String[] { "Charge-O-Mat", + * "An automatable Charging Bench", "It puts (de-)charged Tools into", "the right Outputslots, which are", + * "accessible on the Sides of it.", "", "The Energy Orb inside stores enough", + * "to charge your QSuit almost instantly", "", "This is a Tier-V Charging Station", + * "even when the Max-IN/OUT is only", "2048EU/t. It also charges your Armor", + * "when you are standing close to it.", "", "If you apply Redstone, then it", "decharges instead.", "" }, new + * ItemStack[] { null, null, null, null, new ItemStack(GregTech_API.sBlockList[1], 1, 10), null, null, null, + * null, null, null, null, null, null }); new GT_Computercube_Description(new String[] { "Centrifuge", + * "This is a Machine to seperate", "Isotopes.", "", "It has a maximum Consumption Rate", + * "of 5EU/t, and its Maxinput is", "32EU/t. The time it needs depends", "on the Recipe you use.", "", + * "It needs Tin Cells for some Recipes,", "which you put in the Top Left Slot", "", "Top = Input", + * "Bottom = Tin Cells", "Side = Output", "", "You can pipe Lava into this Device" }, new ItemStack[] { null, + * null, null, null, new ItemStack(GregTech_API.sBlockList[1], 1, 11), null, null, null, null, null, null, null, + * null, null }); new GT_Computercube_Description(new String[] { "Electrolyzer", + * "This is a Machine to seperate", "Molecules and electrolyze", "Watercells.", "", + * "It has a maximum Consumption Rate", "of 128EU/t, and its Maxinput is", "128EU/t. The time it needs depends", + * "on the Recipe you use.", "", "It needs Tin Cells for some Recipes,", + * "which you put in the Bottom Left Slot", "", "Top = Input", "Bottom = Tin Cells", "Side = Output", "" }, new + * ItemStack[] { null, null, null, null, new ItemStack(GregTech_API.sBlockList[1], 1, 25), null, null, null, + * null, null, null, null, null, null }); new GT_Computercube_Description(new String[] { "Grinder", + * "This Machines purpose is to", "macerate and grind Ores.", "It can ONLY grind Ores, don't", + * "try regular Macerator Recipes.", "It has a fixed Consumption Rate", "of 128EU/t, and its Maxinput is", + * "128EU/t. The time it needs is", "5 seconds per Ore Block", "It needs Water for most Recipes,", + * "which you put in the Bottom Left Slot", "Top = Input", "Bottom = Water", "Side = Output", + * "Its a lagfree Multiblock Structure,", "so you need a special Machine Casing", "for this Device. (see GUI)" + * }, new ItemStack[] { null, new ItemStack(Block.field_71943_B, 1), new ItemStack(GregTech_API.sBlockList[0], + * 1, 14), new ItemStack(GregTech_API.sBlockList[0], 1, 13), new ItemStack(GregTech_API.sBlockList[1], 1, 28), + * null, null, null, null, null, null, null, null, null }); + */ new GT_Computercube_Description( - new String[] { - "Electric Blast Furnace", - "You may know the Blast Furnace", - "of Railcraft. This one works", - "similar, as it can also produce", - "Steel out of Iron and Coal.", - "", - "Its heat Capacity depends on the", - "used Machine Casings for building", - "it. The better they are, the more", - "Heat it can achieve.", - "", - "Top = Input 1", - "Bottom = Input 2", - "Side = Output", - "Its a lagfree Multiblock Structure,", - "so you need a special Machine Casing", - "for this Device. (see GUI)" - }, - new ItemStack[] { - null, - null, - null, - ItemList.Casing_HeatProof.get(1), - ItemList.Machine_Multi_BlastFurnace.get(1), - ItemList.Casing_Coil_Cupronickel.get(1), - ItemList.Casing_Coil_Kanthal.get(1), - ItemList.Casing_Coil_Nichrome.get(1), - ItemList.Casing_Coil_TungstenSteel.get(1), - ItemList.Casing_Coil_HSSG.get(1), - ItemList.Casing_Coil_HSSS.get(1), - ItemList.Casing_Coil_Naquadah.get(1), - ItemList.Casing_Coil_NaquadahAlloy.get(1), - null - }); - /* new GT_Computercube_Description(new String[] { - "Sawmill", "This Device turns your Logs", "into more Planks, than a normal", "Steve can produce with his Hands.", "", "Its byproduct, Wood Pulp, can be", "compressed into special Planks,", "which are burning like Charcoal.", "", "It needs Water for most Recipes,", - "which you put in the Bottom Left Slot", "Top = Input", "Water Sides = Water", "Saw Side = Output", "Its a lagfree Multiblock Structure,", "so you need a special Machine Casing", "for this Device. (see GUI)" }, new ItemStack[] { - null, null, GT_MetaItem_Material.instance.getStack(15, 1), GT_MetaItem_Dust.instance.getStack(15, 1), new ItemStack(GregTech_API.sBlockList[1], 1, 32), null, null, null, null, null, - null, null, null, null });*/ + new String[] { "Electric Blast Furnace", "You may know the Blast Furnace", + "of Railcraft. This one works", "similar, as it can also produce", + "Steel out of Iron and Coal.", "", "Its heat Capacity depends on the", + "used Machine Casings for building", "it. The better they are, the more", + "Heat it can achieve.", "", "Top = Input 1", "Bottom = Input 2", "Side = Output", + "Its a lagfree Multiblock Structure,", "so you need a special Machine Casing", + "for this Device. (see GUI)" }, + new ItemStack[] { null, null, null, ItemList.Casing_HeatProof.get(1), + ItemList.Machine_Multi_BlastFurnace.get(1), ItemList.Casing_Coil_Cupronickel.get(1), + ItemList.Casing_Coil_Kanthal.get(1), ItemList.Casing_Coil_Nichrome.get(1), + ItemList.Casing_Coil_TungstenSteel.get(1), ItemList.Casing_Coil_HSSG.get(1), + ItemList.Casing_Coil_HSSS.get(1), ItemList.Casing_Coil_Naquadah.get(1), + ItemList.Casing_Coil_NaquadahAlloy.get(1), null }); + /* + * new GT_Computercube_Description(new String[] { "Sawmill", "This Device turns your Logs", + * "into more Planks, than a normal", "Steve can produce with his Hands.", "", + * "Its byproduct, Wood Pulp, can be", "compressed into special Planks,", "which are burning like Charcoal.", + * "", "It needs Water for most Recipes,", "which you put in the Bottom Left Slot", "Top = Input", + * "Water Sides = Water", "Saw Side = Output", "Its a lagfree Multiblock Structure,", + * "so you need a special Machine Casing", "for this Device. (see GUI)" }, new ItemStack[] { null, null, + * GT_MetaItem_Material.instance.getStack(15, 1), GT_MetaItem_Dust.instance.getStack(15, 1), new + * ItemStack(GregTech_API.sBlockList[1], 1, 32), null, null, null, null, null, null, null, null, null }); + */ new GT_Computercube_Description( - new String[] { - "Implosion Compressor", - "You need to turn Dusts back", - "into Gems? Or do you just want", - "to make Iridium Plates?", - "With a bit ITNT you can achieve", - "that in this Device!", - "", - "We strongly recommend to use", - "Flint Dust instead of Flints", - "for making the ITNT.", - "", - "Top = Input", - "Explosion Sides = Output", - "ITNT Side = ITNT Input", - "Its a lagfree Multiblock Structure,", - "so you need a special Machine Casing", - "for this Device. (see GUI)" - }, - new ItemStack[] { - null, - null, - null, - GT_ModHandler.getIC2Item("industrialTnt", 1, new ItemStack(net.minecraft.init.Blocks.tnt, 1)), - ItemList.Machine_Multi_ImplosionCompressor.get(1), - null, - null, - null, - null, - null, - null, - null, - null, - null - }); - /* new GT_Computercube_Description(new String[] { - "Superconductor", "Expensive, but superconducting", "nearly infinite EU/p and it has", "no Cableloss!", "Do not confuse this with the", "Superconductor Item!", "", "Supercondensator", "This is a special kind of Transformer", "It allows you to convert anything down", - "to 8192 EU/t, what is like a normal HVT.", "But if you apply Redstone to it then it", "outputs friggin 1000000EU/t!!!", "", "You also need it for the Fusion Reactor.", "Some Machines will require that high", "Voltage in a short period of time." }, new ItemStack[] { - null, null, GregTech_API.getGregTechItem(3, 1, 2), new ItemStack(GregTech_API.sBlockList[1], 1, 12), new ItemStack(GregTech_API.sBlockList[1], 1, 15), null, null, null, null, null, - null, null, null, null }); - new GT_Computercube_Description(new String[] { - "Player Detector", "This nice little Device is able", "to detect Players in a Range of", "16-Spherical Meters and a", "EU-Consumption of 2.5EU/t.", "", "It can be switched to 3 Diffrent", "Modes, to detect YOURSELF, OTHERS", "and ALL Players by Rightclicking it.", "", - "It doesnt detect regular Mobs.", "", "", "", "", "", "~This Device has private Access~" }, new ItemStack[] { - null, null, null, null, new ItemStack(GregTech_API.sBlockList[1], 1, 13), null, null, null, null, null, - null, null, null, null });*/ + new String[] { "Implosion Compressor", "You need to turn Dusts back", "into Gems? Or do you just want", + "to make Iridium Plates?", "With a bit ITNT you can achieve", "that in this Device!", "", + "We strongly recommend to use", "Flint Dust instead of Flints", "for making the ITNT.", "", + "Top = Input", "Explosion Sides = Output", "ITNT Side = ITNT Input", + "Its a lagfree Multiblock Structure,", "so you need a special Machine Casing", + "for this Device. (see GUI)" }, + new ItemStack[] { null, null, null, + GT_ModHandler.getIC2Item("industrialTnt", 1, new ItemStack(net.minecraft.init.Blocks.tnt, 1)), + ItemList.Machine_Multi_ImplosionCompressor.get(1), null, null, null, null, null, null, null, + null, null }); + /* + * new GT_Computercube_Description(new String[] { "Superconductor", "Expensive, but superconducting", + * "nearly infinite EU/p and it has", "no Cableloss!", "Do not confuse this with the", "Superconductor Item!", + * "", "Supercondensator", "This is a special kind of Transformer", "It allows you to convert anything down", + * "to 8192 EU/t, what is like a normal HVT.", "But if you apply Redstone to it then it", + * "outputs friggin 1000000EU/t!!!", "", "You also need it for the Fusion Reactor.", + * "Some Machines will require that high", "Voltage in a short period of time." }, new ItemStack[] { null, null, + * GregTech_API.getGregTechItem(3, 1, 2), new ItemStack(GregTech_API.sBlockList[1], 1, 12), new + * ItemStack(GregTech_API.sBlockList[1], 1, 15), null, null, null, null, null, null, null, null, null }); new + * GT_Computercube_Description(new String[] { "Player Detector", "This nice little Device is able", + * "to detect Players in a Range of", "16-Spherical Meters and a", "EU-Consumption of 2.5EU/t.", "", + * "It can be switched to 3 Diffrent", "Modes, to detect YOURSELF, OTHERS", + * "and ALL Players by Rightclicking it.", "", "It doesnt detect regular Mobs.", "", "", "", "", "", + * "~This Device has private Access~" }, new ItemStack[] { null, null, null, null, new + * ItemStack(GregTech_API.sBlockList[1], 1, 13), null, null, null, null, null, null, null, null, null }); + */ new GT_Computercube_Description( - new String[] { - "Matter Fabricator", - "The Matter Fabricator is nothing", - "else than a Mass Fabricator, which", - "can ONLY run on Scrap and other", - "Amplifiers.", - "", - "With the Default Config it is 100", - "times more expensive than normal.", - "Of course you can set the Config", - "to 166666, to get your normal", - "Massfabricationrate back, or you", - "could make Mass Fabrication even", - "cheaper, if you really want to", - "make Mass Fabrication that easy", - "", - "", - "" - }, - new ItemStack[] { - null, - null, - null, - GT_Utility.getFluidDisplayStack(FluidUtils.getUUM(1), false), - ItemList.Machine_LV_Massfab.get(1), - null, - null, - null, - null, - null, - null, - null, - null, - null - }); + new String[] { "Matter Fabricator", "The Matter Fabricator is nothing", + "else than a Mass Fabricator, which", "can ONLY run on Scrap and other", "Amplifiers.", "", + "With the Default Config it is 100", "times more expensive than normal.", + "Of course you can set the Config", "to 166666, to get your normal", + "Massfabricationrate back, or you", "could make Mass Fabrication even", + "cheaper, if you really want to", "make Mass Fabrication that easy", "", "", "" }, + new ItemStack[] { null, null, null, GT_Utility.getFluidDisplayStack(FluidUtils.getUUM(1), false), + ItemList.Machine_LV_Massfab.get(1), null, null, null, null, null, null, null, null, null }); new GT_Computercube_Description( - new String[] { - "Electric Autocrafting Tables", - "These are Crafting Tables for the", - "common need of autocrafting in", - "Factories. One Craft needs 5000EU to", - "be performed, so you have actually to", - "lay Wires to it. This Table is", - "unique as its also able, to give you", - "the used Capsulecellcontainers, made", - "by Industrial Corp, back.", - "You may use that behaviour to", - "craft anything releated to chemics,", - "like the 2xKNO3-Recipe for Saltpeter.", - "The 5 Modes are the following:", - "1. Craft Recipe, 2. All 5 Modes", - "3. Craft all as single Items", - "4. 2x2-Grid and 5. a 3x3-Grid.", - "It accepts only 32EU/p as Input." - }, - new ItemStack[] { - null, - null, - null, - null, - GregtechItemList.GT4_Electric_Auto_Workbench_LV.get(1), - null, - null, - null, - null, - null, - null, - null, - null, - null - }); - /* new GT_Computercube_Description(new String[] { - "Automation with GregTech", "Translocators and Buffers are the", "newest Way to automate your Machines.", "Screw Buildcraft, these EU-wasting", "Devices are much more awesome.", "They output 32EU/t to their directed", "IN- and OUT-puts, making them usefull", "for things, like saving wires.", "Translocators are taking Stuff from", "the Block at their green Inputfacing", - "and putting it into the Block at the", "red Outputfacing. Buffers do the same,", "but the grab Items from their own", "Inventory, what makes them usefull", "as Pipe-replacement.", "Buffers also have Redstone Intelligence,", "which you can configure in their GUI." }, new ItemStack[] { - null, null, new ItemStack(GregTech_API.sBlockList[1], 1, 19), new ItemStack(GregTech_API.sBlockList[1], 1, 18), new ItemStack(GregTech_API.sBlockList[1], 1, 17), null, null, null, null, null, - null, null, null, null }); - new GT_Computercube_Description(new String[] { - "Silver Ore", "It's rarity is similar to Gold", "Silver can be used, to make", "Circuits cheaper, or you can use", "it for Redpowerstuff.", "", "", "", "", "", - "", "", "", "", "", "", "" }, new ItemStack[] { - null, null, GT_OreDictUnificator.get("dustSilver", 1), GregTech_API.getGregTechItem(0, 1, 17), new ItemStack(GregTech_API.sBlockList[2], 1, 1), null, null, null, null, null, - null, null, null, null }); - new GT_Computercube_Description(new String[] { - "Sapphires and Rubys", "These spawn exactly like Emeralds.", "But Rubies are found in Deserts,", "while Sapphires can be found in", "Oceans.", "", "They currently make only a cheaper", "Recipe for Energycrystals and", "Lapotroncrystals, but they are", "Redpower Compatible.", - "", "They also sometimes drop random", "other Gems, like Garnet for Ruby", "or green Sapphire for Sapphire", "in addition.", "", "" }, new ItemStack[] { - null, GregTech_API.getGregTechItem(0, 1, 32), new ItemStack(GregTech_API.sBlockList[2], 1, 3), GregTech_API.getGregTechItem(0, 1, 33), new ItemStack(GregTech_API.sBlockList[2], 1, 4), null, null, null, null, null, - null, null, null, null }); - new GT_Computercube_Description(new String[] { - "Bauxite Ore", "The Stuff out of which you can", "produce Aluminium and also", "Titanium.", "You find this Ore in Plains and", "Forests.", "", "If you think Aluminium is useless", "then note, that mobs NEVER spawn", "ontop of an Aluminium Block", - "(Same applies also for Silver-,", "Gem- and Iridium Blocks)", "Production Chain:", "macerating Bauxite Ore", "electrolyzing 24 Bauxite Dust", "smelting Aluminium Dust in a", "Blast Furnace" }, new ItemStack[] { - new ItemStack(GregTech_API.sBlockList[0], 1, 7), GregTech_API.getGregTechItem(0, 1, 18), GregTech_API.getGregTechItem(1, 1, 18), GregTech_API.getGregTechItem(1, 1, 17), new ItemStack(GregTech_API.sBlockList[2], 1, 5), null, null, null, null, null, - null, null, null, null }); - new GT_Computercube_Description(new String[] { - "Titanium", "Produced by centrifuging Bauxitedust", "as a byproduct, this Material can make", "anything much more resistant against", "damage, like Explosions.", "Blocks made of Titaniumingots have a", "large Blastresistance", "", "It can also be used to craft tons of", "mixed Metal Ingots", - "", "", "", "", "", "", "" }, new ItemStack[] { - new ItemStack(GregTech_API.sBlockList[0], 1, 8), GregTech_API.getGregTechItem(0, 1, 19), GregTech_API.getGregTechItem(1, 1, 19), GregTech_API.getGregTechItem(1, 1, 17), new ItemStack(GregTech_API.sBlockList[2], 1, 5), null, null, null, null, null, - null, null, null, null }); - new GT_Computercube_Description(new String[] { - "Iridium Ore", "You can find it only when you", "stripmine very large Areas with", "Quarries and such. There is only", "one in every 5th-10th Chunk.", "It's even more rare in Oceans!", "", "Some people disable the UUM-Recipe", "for Iridium, for making getting it", "an Achievement.", - "", "However Iridium Ore contains traces", "of Platinum, so it's best to use the", "Industrial Grinder for this Ore.", "", "", "" }, new ItemStack[] { - null, null, GT_OreDictUnificator.get("plateAlloyIridium", 1), GT_ModHandler.getIC2Item("iridiumOre", 1), new ItemStack(GregTech_API.sBlockList[2], 1, 2), null, null, null, null, null, - null, null, null, null }); - new GT_Computercube_Description(new String[] { - "Helium Coolant Cell", "These are just cheaper, than the", "Water based Coolant Cells, and can", "also hold six times more Heat.", "", "Helium Cells can also be used for", "making Luminators and Mininglasers", "", "", "", - "", "", "", "", "", "", "" }, new ItemStack[] { - GregTech_API.getGregTechItem(2, 1, 6), GregTech_API.getGregTechItem(2, 1, 3), GregTech_API.getGregTechItem(34, 1, 0), GregTech_API.getGregTechItem(35, 1, 0), GregTech_API.getGregTechItem(36, 1, 0), null, null, null, null, null, - null, null, null, null }); - new GT_Computercube_Description(new String[] { - "Destructopack", "Open its GUI via rightclick and", "dump all the useless Stuff from", "your Inventory into it, instead of", "littering Items into the World.", "", "", "", "", "", - "", "", "", "", "", "", "" }, new ItemStack[] { - null, null, null, null, GregTech_API.getGregTechItem(33, 1, 0), null, null, null, null, null, - null, null, null, null });*/ + new String[] { "Electric Autocrafting Tables", "These are Crafting Tables for the", + "common need of autocrafting in", "Factories. One Craft needs 5000EU to", + "be performed, so you have actually to", "lay Wires to it. This Table is", + "unique as its also able, to give you", "the used Capsulecellcontainers, made", + "by Industrial Corp, back.", "You may use that behaviour to", + "craft anything releated to chemics,", "like the 2xKNO3-Recipe for Saltpeter.", + "The 5 Modes are the following:", "1. Craft Recipe, 2. All 5 Modes", + "3. Craft all as single Items", "4. 2x2-Grid and 5. a 3x3-Grid.", + "It accepts only 32EU/p as Input." }, + new ItemStack[] { null, null, null, null, GregtechItemList.GT4_Electric_Auto_Workbench_LV.get(1), null, + null, null, null, null, null, null, null, null }); + /* + * new GT_Computercube_Description(new String[] { "Automation with GregTech", + * "Translocators and Buffers are the", "newest Way to automate your Machines.", + * "Screw Buildcraft, these EU-wasting", "Devices are much more awesome.", + * "They output 32EU/t to their directed", "IN- and OUT-puts, making them usefull", + * "for things, like saving wires.", "Translocators are taking Stuff from", + * "the Block at their green Inputfacing", "and putting it into the Block at the", + * "red Outputfacing. Buffers do the same,", "but the grab Items from their own", + * "Inventory, what makes them usefull", "as Pipe-replacement.", "Buffers also have Redstone Intelligence,", + * "which you can configure in their GUI." }, new ItemStack[] { null, null, new + * ItemStack(GregTech_API.sBlockList[1], 1, 19), new ItemStack(GregTech_API.sBlockList[1], 1, 18), new + * ItemStack(GregTech_API.sBlockList[1], 1, 17), null, null, null, null, null, null, null, null, null }); new + * GT_Computercube_Description(new String[] { "Silver Ore", "It's rarity is similar to Gold", + * "Silver can be used, to make", "Circuits cheaper, or you can use", "it for Redpowerstuff.", "", "", "", "", + * "", "", "", "", "", "", "", "" }, new ItemStack[] { null, null, GT_OreDictUnificator.get("dustSilver", 1), + * GregTech_API.getGregTechItem(0, 1, 17), new ItemStack(GregTech_API.sBlockList[2], 1, 1), null, null, null, + * null, null, null, null, null, null }); new GT_Computercube_Description(new String[] { "Sapphires and Rubys", + * "These spawn exactly like Emeralds.", "But Rubies are found in Deserts,", "while Sapphires can be found in", + * "Oceans.", "", "They currently make only a cheaper", "Recipe for Energycrystals and", + * "Lapotroncrystals, but they are", "Redpower Compatible.", "", "They also sometimes drop random", + * "other Gems, like Garnet for Ruby", "or green Sapphire for Sapphire", "in addition.", "", "" }, new + * ItemStack[] { null, GregTech_API.getGregTechItem(0, 1, 32), new ItemStack(GregTech_API.sBlockList[2], 1, 3), + * GregTech_API.getGregTechItem(0, 1, 33), new ItemStack(GregTech_API.sBlockList[2], 1, 4), null, null, null, + * null, null, null, null, null, null }); new GT_Computercube_Description(new String[] { "Bauxite Ore", + * "The Stuff out of which you can", "produce Aluminium and also", "Titanium.", + * "You find this Ore in Plains and", "Forests.", "", "If you think Aluminium is useless", + * "then note, that mobs NEVER spawn", "ontop of an Aluminium Block", "(Same applies also for Silver-,", + * "Gem- and Iridium Blocks)", "Production Chain:", "macerating Bauxite Ore", "electrolyzing 24 Bauxite Dust", + * "smelting Aluminium Dust in a", "Blast Furnace" }, new ItemStack[] { new + * ItemStack(GregTech_API.sBlockList[0], 1, 7), GregTech_API.getGregTechItem(0, 1, 18), + * GregTech_API.getGregTechItem(1, 1, 18), GregTech_API.getGregTechItem(1, 1, 17), new + * ItemStack(GregTech_API.sBlockList[2], 1, 5), null, null, null, null, null, null, null, null, null }); new + * GT_Computercube_Description(new String[] { "Titanium", "Produced by centrifuging Bauxitedust", + * "as a byproduct, this Material can make", "anything much more resistant against", "damage, like Explosions.", + * "Blocks made of Titaniumingots have a", "large Blastresistance", "", "It can also be used to craft tons of", + * "mixed Metal Ingots", "", "", "", "", "", "", "" }, new ItemStack[] { new + * ItemStack(GregTech_API.sBlockList[0], 1, 8), GregTech_API.getGregTechItem(0, 1, 19), + * GregTech_API.getGregTechItem(1, 1, 19), GregTech_API.getGregTechItem(1, 1, 17), new + * ItemStack(GregTech_API.sBlockList[2], 1, 5), null, null, null, null, null, null, null, null, null }); new + * GT_Computercube_Description(new String[] { "Iridium Ore", "You can find it only when you", + * "stripmine very large Areas with", "Quarries and such. There is only", "one in every 5th-10th Chunk.", + * "It's even more rare in Oceans!", "", "Some people disable the UUM-Recipe", + * "for Iridium, for making getting it", "an Achievement.", "", "However Iridium Ore contains traces", + * "of Platinum, so it's best to use the", "Industrial Grinder for this Ore.", "", "", "" }, new ItemStack[] { + * null, null, GT_OreDictUnificator.get("plateAlloyIridium", 1), GT_ModHandler.getIC2Item("iridiumOre", 1), new + * ItemStack(GregTech_API.sBlockList[2], 1, 2), null, null, null, null, null, null, null, null, null }); new + * GT_Computercube_Description(new String[] { "Helium Coolant Cell", "These are just cheaper, than the", + * "Water based Coolant Cells, and can", "also hold six times more Heat.", "", + * "Helium Cells can also be used for", "making Luminators and Mininglasers", "", "", "", "", "", "", "", "", + * "", "" }, new ItemStack[] { GregTech_API.getGregTechItem(2, 1, 6), GregTech_API.getGregTechItem(2, 1, 3), + * GregTech_API.getGregTechItem(34, 1, 0), GregTech_API.getGregTechItem(35, 1, 0), + * GregTech_API.getGregTechItem(36, 1, 0), null, null, null, null, null, null, null, null, null }); new + * GT_Computercube_Description(new String[] { "Destructopack", "Open its GUI via rightclick and", + * "dump all the useless Stuff from", "your Inventory into it, instead of", "littering Items into the World.", + * "", "", "", "", "", "", "", "", "", "", "", "" }, new ItemStack[] { null, null, null, null, + * GregTech_API.getGregTechItem(33, 1, 0), null, null, null, null, null, null, null, null, null }); + */ new GT_Computercube_Description( - new String[] { - "Data Orbs", - "They store Data.", - "", - "Rightclick on a Computer Cube, to", - "extract a Reactorplan", - "", - "Sneak-Rightclick on it, to insert", - "a Reactorplan", - "", - "Works also with Sonictrons", - "", - "", - "", - "", - "", - "", - "" - }, - new ItemStack[] { - null, - null, - null, - null, - ItemList.Tool_DataOrb.get(1), - null, - null, - null, - null, - null, - null, - null, - null, - null - }); + new String[] { "Data Orbs", "They store Data.", "", "Rightclick on a Computer Cube, to", + "extract a Reactorplan", "", "Sneak-Rightclick on it, to insert", "a Reactorplan", "", + "Works also with Sonictrons", "", "", "", "", "", "", "" }, + new ItemStack[] { null, null, null, null, ItemList.Tool_DataOrb.get(1), null, null, null, null, null, + null, null, null, null }); new GT_Computercube_Description( - new String[] { - "Energy Orbs", - "100 Million EU in one Orb!", - "", - "This is a Tier-IV-Energystorage", - "So a MFSU is not enough for it!", - "", - "Use it to create a Lapotron Pack,", - "which is like an ultimate Lap Pack!", - "", - "", - "", - "", - "", - "", - "", - "", - "" - }, - new ItemStack[] { - null, - null, - null, - null, - ItemList.Energy_LapotronicOrb.get(1), - null, - null, - null, - null, - null, - null, - null, - null, - null - }); + new String[] { "Energy Orbs", "100 Million EU in one Orb!", "", "This is a Tier-IV-Energystorage", + "So a MFSU is not enough for it!", "", "Use it to create a Lapotron Pack,", + "which is like an ultimate Lap Pack!", "", "", "", "", "", "", "", "", "" }, + new ItemStack[] { null, null, null, null, ItemList.Energy_LapotronicOrb.get(1), null, null, null, null, + null, null, null, null, null }); new GT_Computercube_Description( - new String[] { - "Iridium Neutron Reflector", - "It's used for Fusion Reactor Coils,", - "and works like a normal one", - "inside a Reactor, but it's also", - "INDESTRUCTIBLE*.", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "* = for weardown" - }, - new ItemStack[] { - null, - null, - null, - null, - ItemList.Neutron_Reflector.get(1), - null, - null, - null, - null, - null, - null, - null, - null, - null - }); - /*new GT_Computercube_Description(new String[] { - "Rock Cutter", "You want to get whole Blocks, but", "your Drill is not enchantable?", "The Rock Cutter has an awesome", "SilkTouch-III-Function!", "", "It works like a Drill, but you", "get the whole Block instead of", "'macerated' Ores!", "", - "Put those Blocks into a Macerator", "and double your Diamond Income!", "", "Or better. Use the Industrial", "Grinder to get even more", "Resources!", "" }, new ItemStack[] { - null, null, null, null, GregTech_API.getGregTechItem(46, 1, 0), null, null, null, null, null, - null, null, null, null }); - new GT_Computercube_Description(new String[] { - "Tesla Staff", "This completly untested PvP-Weapon", "destroys electric Armor in one hit", "", "The Energy Orb inside it must be", "fully charged to let this work.", "", "We are not responsible for any", "Electrocution Damage to yourself,", "while using it.", - "", "We also dont even know, if this", "Weapon has any effect AT ALL.", "", "", "", "" }, new ItemStack[] { - null, null, null, null, GregTech_API.getGregTechItem(47, 1, 0), null, null, null, null, null, - null, null, null, null });*/ + new String[] { "Iridium Neutron Reflector", "It's used for Fusion Reactor Coils,", + "and works like a normal one", "inside a Reactor, but it's also", "INDESTRUCTIBLE*.", "", "", + "", "", "", "", "", "", "", "", "", "* = for weardown" }, + new ItemStack[] { null, null, null, null, ItemList.Neutron_Reflector.get(1), null, null, null, null, + null, null, null, null, null }); + /* + * new GT_Computercube_Description(new String[] { "Rock Cutter", "You want to get whole Blocks, but", + * "your Drill is not enchantable?", "The Rock Cutter has an awesome", "SilkTouch-III-Function!", "", + * "It works like a Drill, but you", "get the whole Block instead of", "'macerated' Ores!", "", + * "Put those Blocks into a Macerator", "and double your Diamond Income!", "", "Or better. Use the Industrial", + * "Grinder to get even more", "Resources!", "" }, new ItemStack[] { null, null, null, null, + * GregTech_API.getGregTechItem(46, 1, 0), null, null, null, null, null, null, null, null, null }); new + * GT_Computercube_Description(new String[] { "Tesla Staff", "This completly untested PvP-Weapon", + * "destroys electric Armor in one hit", "", "The Energy Orb inside it must be", + * "fully charged to let this work.", "", "We are not responsible for any", "Electrocution Damage to yourself,", + * "while using it.", "", "We also dont even know, if this", "Weapon has any effect AT ALL.", "", "", "", "" }, + * new ItemStack[] { null, null, null, null, GregTech_API.getGregTechItem(47, 1, 0), null, null, null, null, + * null, null, null, null, null }); + */ } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/computer/GT_Computercube_Simulator.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/computer/GT_Computercube_Simulator.java index fc57930dda..31f378066f 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/computer/GT_Computercube_Simulator.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/computer/GT_Computercube_Simulator.java @@ -1,5 +1,8 @@ package gtPlusPlus.xmod.gregtech.common.computer; +import java.util.ArrayList; +import java.util.HashMap; + import Ic2ExpReactorPlanner.AutomationSimulator; import Ic2ExpReactorPlanner.Reactor; import Ic2ExpReactorPlanner.SimulationData; @@ -9,13 +12,10 @@ import gtPlusPlus.api.objects.Logger; import gtPlusPlus.api.objects.data.Pair; import gtPlusPlus.core.util.minecraft.ItemUtils; import gtPlusPlus.xmod.gregtech.common.tileentities.misc.GT_TileEntity_ComputerCube; -import java.util.ArrayList; -import java.util.HashMap; public class GT_Computercube_Simulator { - private static final HashMap<Integer, Pair<Integer, Integer>> sSlotPositions = - new HashMap<Integer, Pair<Integer, Integer>>(); + private static final HashMap<Integer, Pair<Integer, Integer>> sSlotPositions = new HashMap<Integer, Pair<Integer, Integer>>(); static { int aSlot = 4; @@ -48,14 +48,13 @@ public class GT_Computercube_Simulator { public void slotClick(int aSlot, GT_ItemStack aStack) { - /*if (selection != null) { - componentToPlace = ComponentFactory.createComponent(selection.getActionCommand()); - if (componentToPlace != null) { - componentToPlace.setInitialHeat(((Number)componentHeatSpinner.getValue()).intValue()); - componentToPlace.setAutomationThreshold(((Number)placingThresholdSpinner.getValue()).intValue()); - componentToPlace.setReactorPause(((Number)placingReactorPauseSpinner.getValue()).intValue()); - } - }*/ + /* + * if (selection != null) { componentToPlace = ComponentFactory.createComponent(selection.getActionCommand()); + * if (componentToPlace != null) { + * componentToPlace.setInitialHeat(((Number)componentHeatSpinner.getValue()).intValue()); + * componentToPlace.setAutomationThreshold(((Number)placingThresholdSpinner.getValue()).intValue()); + * componentToPlace.setReactorPause(((Number)placingReactorPauseSpinner.getValue()).intValue()); } } + */ if (aSlot >= 4 && aSlot < 58) { Pair<Integer, Integer> aSpot = sSlotPositions.get(aSlot); ReactorItem aItem; @@ -63,10 +62,14 @@ public class GT_Computercube_Simulator { aItem = null; } else { - Logger.INFO("Using lookup key: " + ItemUtils.getModId(aStack.toStack()) + "." - + aStack.mItem.getUnlocalizedName() + "." + aStack.mMetaData); - aItem = ReactorItem.sComponentMap.get(ItemUtils.getModId(aStack.toStack()) + "." - + aStack.mItem.getUnlocalizedName() + "." + aStack.mMetaData); + Logger.INFO( + "Using lookup key: " + ItemUtils.getModId( + aStack.toStack()) + "." + aStack.mItem.getUnlocalizedName() + "." + aStack.mMetaData); + aItem = ReactorItem.sComponentMap.get( + ItemUtils.getModId(aStack.toStack()) + "." + + aStack.mItem.getUnlocalizedName() + + "." + + aStack.mMetaData); } int aRow = aSpot.getKey(); int aColumn = aSpot.getValue(); @@ -86,9 +89,9 @@ public class GT_Computercube_Simulator { } public void simulate() { - /*if (Utils.isClient()) { - return; - }*/ + /* + * if (Utils.isClient()) { return; } + */ if (simulator != null && simulator.isRunning()) { Logger.INFO("Simulator Running, Stopping."); simulator.cancel(); @@ -129,22 +132,21 @@ public class GT_Computercube_Simulator { private void clearGrid() { reactor.clearGrid(); - /*for (int i = 0; i < reactorButtons.length; i++) { - for (int j = 0; j < reactorButtons[i].length; j++) { - reactorButtons[i][j].setIcon(null); - reactorButtons[i][j].setToolTipText(null); - reactorButtonPanels[i][j].setBackground(Color.LIGHT_GRAY); - } - }*/ + /* + * for (int i = 0; i < reactorButtons.length; i++) { for (int j = 0; j < reactorButtons[i].length; j++) { + * reactorButtons[i][j].setIcon(null); reactorButtons[i][j].setToolTipText(null); + * reactorButtonPanels[i][j].setBackground(Color.LIGHT_GRAY); } } + */ output.clear(); - /*materialsArea.setText(reactor.getMaterials().toString()); - componentListArea.setText(reactor.getComponentList().toString()); - maxHeatLabel.setText(formatI18n("UI.MaxHeatSpecific", reactor.getMaxHeat())); - heatSpinnerModel.setMaximum(reactor.getMaxHeat() - 1); - heatSpinnerModel.setValue(Math.min(((Number) heatSpinnerModel.getValue()).intValue(), reactor.getMaxHeat() - 1)); - temperatureEffectsLabel.setText(formatI18n("UI.TemperatureEffectsSpecific", (int)(reactor.getMaxHeat() * 0.4), (int)(reactor.getMaxHeat() * 0.5), (int)(reactor.getMaxHeat() * 0.7), (int)(reactor.getMaxHeat() * 0.85), (int)(reactor.getMaxHeat() * 1.0))); - lockCode = true; - codeField.setText(null); - lockCode = false;*/ + /* + * materialsArea.setText(reactor.getMaterials().toString()); + * componentListArea.setText(reactor.getComponentList().toString()); + * maxHeatLabel.setText(formatI18n("UI.MaxHeatSpecific", reactor.getMaxHeat())); + * heatSpinnerModel.setMaximum(reactor.getMaxHeat() - 1); heatSpinnerModel.setValue(Math.min(((Number) + * heatSpinnerModel.getValue()).intValue(), reactor.getMaxHeat() - 1)); + * temperatureEffectsLabel.setText(formatI18n("UI.TemperatureEffectsSpecific", (int)(reactor.getMaxHeat() * + * 0.4), (int)(reactor.getMaxHeat() * 0.5), (int)(reactor.getMaxHeat() * 0.7), (int)(reactor.getMaxHeat() * + * 0.85), (int)(reactor.getMaxHeat() * 1.0))); lockCode = true; codeField.setText(null); lockCode = false; + */ } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/covers/CoverManager.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/covers/CoverManager.java index 9e507048ed..9a5cf5f64c 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/covers/CoverManager.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/covers/CoverManager.java @@ -34,113 +34,69 @@ public class CoverManager { Cover_Gt_Machine_Casing = new MetaItemCoverCasings(); if (Loader.isModLoaded("Ztones")) { - String[] aZtoneCoverTextureNames = new String[] {"agon", "iszm", "korp", "jelt", "bitt"}; - MetaCustomCoverItem[] aZtoneCoverItems = - new MetaCustomCoverItem[] {Cover_Agon, Cover_Iszm, Cover_Korp, Cover_Jelt, Cover_Bitt}; - CustomIcon[][] aArrays = new CustomIcon[][] { - TEXTURE_ZTONES_AGON, TEXTURE_ZTONES_ISZM, TEXTURE_ZTONES_KORP, TEXTURE_ZTONES_JELT, TEXTURE_ZTONES_BITT - }; - short[][][] aRGB = - new short[][][] {ZTONES.RGB_AGON, ZTONES.RGB_ISZM, ZTONES.RGB_KORP, ZTONES.RGB_JELT, ZTONES.RGB_BITT - }; + String[] aZtoneCoverTextureNames = new String[] { "agon", "iszm", "korp", "jelt", "bitt" }; + MetaCustomCoverItem[] aZtoneCoverItems = new MetaCustomCoverItem[] { Cover_Agon, Cover_Iszm, Cover_Korp, + Cover_Jelt, Cover_Bitt }; + CustomIcon[][] aArrays = new CustomIcon[][] { TEXTURE_ZTONES_AGON, TEXTURE_ZTONES_ISZM, TEXTURE_ZTONES_KORP, + TEXTURE_ZTONES_JELT, TEXTURE_ZTONES_BITT }; + short[][][] aRGB = new short[][][] { ZTONES.RGB_AGON, ZTONES.RGB_ISZM, ZTONES.RGB_KORP, ZTONES.RGB_JELT, + ZTONES.RGB_BITT }; for (int y = 0; y < aZtoneCoverTextureNames.length; y++) { - aZtoneCoverItems[y] = - new MetaCustomCoverItem("Ztones", 16, aZtoneCoverTextureNames[y], aArrays[y], aRGB[y]); + aZtoneCoverItems[y] = new MetaCustomCoverItem( + "Ztones", + 16, + aZtoneCoverTextureNames[y], + aArrays[y], + aRGB[y]); } } } static final class ZTONES { - private static final short[][] RGB_AGON = new short[][] { - VanillaColours.DYE_WHITE.getAsShort(), - VanillaColours.DYE_YELLOW.getAsShort(), - VanillaColours.DYE_LIME.getAsShort(), - VanillaColours.DYE_GREEN.getAsShort(), - VanillaColours.DYE_CYAN.getAsShort(), - VanillaColours.DYE_LIGHT_BLUE.getAsShort(), - VanillaColours.DYE_DARK_BLUE.getAsShort(), - VanillaColours.DYE_DARK_PURPLE.getAsShort(), - VanillaColours.DYE_LIGHT_PURPLE.getAsShort(), - VanillaColours.DYE_PINK.getAsShort(), - VanillaColours.DYE_RED.getAsShort(), - VanillaColours.DYE_ORANGE.getAsShort(), - VanillaColours.DYE_BROWN.getAsShort(), - VanillaColours.DYE_BLACK.getAsShort(), - VanillaColours.DYE_DARK_GRAY.getAsShort(), - VanillaColours.DYE_LIGHT_GRAY.getAsShort(), - }; - private static final short[][] RGB_ISZM = new short[][] { - VanillaColours.DYE_LIGHT_GRAY.getAsShort(), - VanillaColours.DYE_WHITE.getAsShort(), - VanillaColours.DYE_DARK_GRAY.getAsShort(), - VanillaColours.DYE_DARK_BLUE.getAsShort(), - VanillaColours.DYE_YELLOW.getAsShort(), - VanillaColours.DYE_DARK_BLUE.getAsShort(), - VanillaColours.DYE_RED.getAsShort(), - VanillaColours.DYE_ORANGE.getAsShort(), - VanillaColours.DYE_CYAN.getAsShort(), - VanillaColours.DYE_YELLOW.getAsShort(), - VanillaColours.DYE_RED.getAsShort(), - VanillaColours.DYE_CYAN.getAsShort(), - VanillaColours.DYE_GREEN.getAsShort(), - VanillaColours.DYE_ORANGE.getAsShort(), - VanillaColours.DYE_LIGHT_BLUE.getAsShort(), - VanillaColours.DYE_DARK_PURPLE.getAsShort(), - }; - private static final short[][] RGB_KORP = new short[][] { - new short[] {125, 125, 125}, - VanillaColours.DYE_DARK_GRAY.getAsShort(), - VanillaColours.DYE_DARK_GRAY.getAsShort(), - VanillaColours.DYE_DARK_GRAY.getAsShort(), - VanillaColours.DYE_DARK_GRAY.getAsShort(), - VanillaColours.DYE_DARK_GRAY.getAsShort(), - VanillaColours.DYE_DARK_GRAY.getAsShort(), - VanillaColours.DYE_DARK_GRAY.getAsShort(), - VanillaColours.DYE_DARK_GRAY.getAsShort(), - VanillaColours.DYE_DARK_GRAY.getAsShort(), - VanillaColours.DYE_DARK_GRAY.getAsShort(), - VanillaColours.DYE_DARK_GRAY.getAsShort(), - new short[] {22, 156, 156}, - new short[] {22, 156, 156}, - VanillaColours.DYE_DARK_GRAY.getAsShort(), - VanillaColours.DYE_DARK_GRAY.getAsShort(), - }; - private static final short[][] RGB_JELT = new short[][] { - VanillaColours.DYE_ORANGE.getAsShort(), - VanillaColours.DYE_ORANGE.getAsShort(), - VanillaColours.DYE_ORANGE.getAsShort(), - VanillaColours.DYE_ORANGE.getAsShort(), - VanillaColours.DYE_ORANGE.getAsShort(), - VanillaColours.DYE_ORANGE.getAsShort(), - VanillaColours.DYE_ORANGE.getAsShort(), - VanillaColours.DYE_ORANGE.getAsShort(), - VanillaColours.DYE_ORANGE.getAsShort(), - VanillaColours.DYE_ORANGE.getAsShort(), - VanillaColours.DYE_ORANGE.getAsShort(), - VanillaColours.DYE_ORANGE.getAsShort(), - VanillaColours.DYE_ORANGE.getAsShort(), - VanillaColours.DYE_ORANGE.getAsShort(), - VanillaColours.DYE_ORANGE.getAsShort(), - VanillaColours.DYE_ORANGE.getAsShort(), - }; - private static final short[][] RGB_BITT = new short[][] { - VanillaColours.DYE_BLACK.getAsShort(), - VanillaColours.DYE_WHITE.getAsShort(), - VanillaColours.DYE_YELLOW.getAsShort(), - VanillaColours.DYE_LIME.getAsShort(), - VanillaColours.DYE_GREEN.getAsShort(), - VanillaColours.DYE_CYAN.getAsShort(), - VanillaColours.DYE_LIGHT_BLUE.getAsShort(), - VanillaColours.DYE_LIGHT_BLUE.getAsShort(), - VanillaColours.DYE_DARK_BLUE.getAsShort(), - VanillaColours.DYE_DARK_PURPLE.getAsShort(), - VanillaColours.DYE_LIGHT_PURPLE.getAsShort(), - VanillaColours.DYE_PINK.getAsShort(), - VanillaColours.DYE_RED.getAsShort(), - VanillaColours.DYE_RED.getAsShort(), - VanillaColours.DYE_ORANGE.getAsShort(), - VanillaColours.DYE_BROWN.getAsShort(), - }; + private static final short[][] RGB_AGON = new short[][] { VanillaColours.DYE_WHITE.getAsShort(), + VanillaColours.DYE_YELLOW.getAsShort(), VanillaColours.DYE_LIME.getAsShort(), + VanillaColours.DYE_GREEN.getAsShort(), VanillaColours.DYE_CYAN.getAsShort(), + VanillaColours.DYE_LIGHT_BLUE.getAsShort(), VanillaColours.DYE_DARK_BLUE.getAsShort(), + VanillaColours.DYE_DARK_PURPLE.getAsShort(), VanillaColours.DYE_LIGHT_PURPLE.getAsShort(), + VanillaColours.DYE_PINK.getAsShort(), VanillaColours.DYE_RED.getAsShort(), + VanillaColours.DYE_ORANGE.getAsShort(), VanillaColours.DYE_BROWN.getAsShort(), + VanillaColours.DYE_BLACK.getAsShort(), VanillaColours.DYE_DARK_GRAY.getAsShort(), + VanillaColours.DYE_LIGHT_GRAY.getAsShort(), }; + private static final short[][] RGB_ISZM = new short[][] { VanillaColours.DYE_LIGHT_GRAY.getAsShort(), + VanillaColours.DYE_WHITE.getAsShort(), VanillaColours.DYE_DARK_GRAY.getAsShort(), + VanillaColours.DYE_DARK_BLUE.getAsShort(), VanillaColours.DYE_YELLOW.getAsShort(), + VanillaColours.DYE_DARK_BLUE.getAsShort(), VanillaColours.DYE_RED.getAsShort(), + VanillaColours.DYE_ORANGE.getAsShort(), VanillaColours.DYE_CYAN.getAsShort(), + VanillaColours.DYE_YELLOW.getAsShort(), VanillaColours.DYE_RED.getAsShort(), + VanillaColours.DYE_CYAN.getAsShort(), VanillaColours.DYE_GREEN.getAsShort(), + VanillaColours.DYE_ORANGE.getAsShort(), VanillaColours.DYE_LIGHT_BLUE.getAsShort(), + VanillaColours.DYE_DARK_PURPLE.getAsShort(), }; + private static final short[][] RGB_KORP = new short[][] { new short[] { 125, 125, 125 }, + VanillaColours.DYE_DARK_GRAY.getAsShort(), VanillaColours.DYE_DARK_GRAY.getAsShort(), + VanillaColours.DYE_DARK_GRAY.getAsShort(), VanillaColours.DYE_DARK_GRAY.getAsShort(), + VanillaColours.DYE_DARK_GRAY.getAsShort(), VanillaColours.DYE_DARK_GRAY.getAsShort(), + VanillaColours.DYE_DARK_GRAY.getAsShort(), VanillaColours.DYE_DARK_GRAY.getAsShort(), + VanillaColours.DYE_DARK_GRAY.getAsShort(), VanillaColours.DYE_DARK_GRAY.getAsShort(), + VanillaColours.DYE_DARK_GRAY.getAsShort(), new short[] { 22, 156, 156 }, new short[] { 22, 156, 156 }, + VanillaColours.DYE_DARK_GRAY.getAsShort(), VanillaColours.DYE_DARK_GRAY.getAsShort(), }; + private static final short[][] RGB_JELT = new short[][] { VanillaColours.DYE_ORANGE.getAsShort(), + VanillaColours.DYE_ORANGE.getAsShort(), VanillaColours.DYE_ORANGE.getAsShort(), + VanillaColours.DYE_ORANGE.getAsShort(), VanillaColours.DYE_ORANGE.getAsShort(), + VanillaColours.DYE_ORANGE.getAsShort(), VanillaColours.DYE_ORANGE.getAsShort(), + VanillaColours.DYE_ORANGE.getAsShort(), VanillaColours.DYE_ORANGE.getAsShort(), + VanillaColours.DYE_ORANGE.getAsShort(), VanillaColours.DYE_ORANGE.getAsShort(), + VanillaColours.DYE_ORANGE.getAsShort(), VanillaColours.DYE_ORANGE.getAsShort(), + VanillaColours.DYE_ORANGE.getAsShort(), VanillaColours.DYE_ORANGE.getAsShort(), + VanillaColours.DYE_ORANGE.getAsShort(), }; + private static final short[][] RGB_BITT = new short[][] { VanillaColours.DYE_BLACK.getAsShort(), + VanillaColours.DYE_WHITE.getAsShort(), VanillaColours.DYE_YELLOW.getAsShort(), + VanillaColours.DYE_LIME.getAsShort(), VanillaColours.DYE_GREEN.getAsShort(), + VanillaColours.DYE_CYAN.getAsShort(), VanillaColours.DYE_LIGHT_BLUE.getAsShort(), + VanillaColours.DYE_LIGHT_BLUE.getAsShort(), VanillaColours.DYE_DARK_BLUE.getAsShort(), + VanillaColours.DYE_DARK_PURPLE.getAsShort(), VanillaColours.DYE_LIGHT_PURPLE.getAsShort(), + VanillaColours.DYE_PINK.getAsShort(), VanillaColours.DYE_RED.getAsShort(), + VanillaColours.DYE_RED.getAsShort(), VanillaColours.DYE_ORANGE.getAsShort(), + VanillaColours.DYE_BROWN.getAsShort(), }; } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/covers/GTPP_Cover_Overflow.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/covers/GTPP_Cover_Overflow.java index 4e2f758d61..fc7c2e83d8 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/covers/GTPP_Cover_Overflow.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/covers/GTPP_Cover_Overflow.java @@ -1,10 +1,19 @@ package gtPlusPlus.xmod.gregtech.common.covers; +import java.util.concurrent.atomic.AtomicBoolean; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.fluids.IFluidHandler; + import com.gtnewhorizons.modularui.api.drawable.Text; import com.gtnewhorizons.modularui.api.math.MathExpression; import com.gtnewhorizons.modularui.api.screen.ModularWindow; import com.gtnewhorizons.modularui.common.widget.TextWidget; import com.gtnewhorizons.modularui.common.widget.textfield.BaseTextFieldWidget; + import gregtech.api.gui.modularui.GT_CoverUIBuildContext; import gregtech.api.interfaces.tileentity.ICoverable; import gregtech.api.util.GT_CoverBehavior; @@ -13,12 +22,6 @@ import gregtech.api.util.ISerializableObject; import gregtech.common.gui.modularui.widget.CoverDataControllerWidget; import gregtech.common.gui.modularui.widget.CoverDataFollower_TextFieldWidget; import gtPlusPlus.core.util.minecraft.LangUtils; -import java.util.concurrent.atomic.AtomicBoolean; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraftforge.common.util.ForgeDirection; -import net.minecraftforge.fluids.Fluid; -import net.minecraftforge.fluids.FluidStack; -import net.minecraftforge.fluids.IFluidHandler; public class GTPP_Cover_Overflow extends GT_CoverBehavior { @@ -32,8 +35,8 @@ public class GTPP_Cover_Overflow extends GT_CoverBehavior { this.mMaxTransferRate = aTransferRate * 1000; } - public int doCoverThings( - byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) { + public int doCoverThings(byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity, + long aTimer) { if (aCoverVariable == 0) { return aCoverVariable; } @@ -68,15 +71,8 @@ public class GTPP_Cover_Overflow extends GT_CoverBehavior { return aCoverVariable; } - public int onCoverScrewdriverclick( - byte aSide, - int aCoverID, - int aCoverVariable, - ICoverable aTileEntity, - EntityPlayer aPlayer, - float aX, - float aY, - float aZ) { + public int onCoverScrewdriverclick(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, + EntityPlayer aPlayer, float aX, float aY, float aZ) { if (GT_Utility.getClickedFacingCoords(aSide, aX, aY, aZ)[0] >= 0.5F) { aCoverVariable += (mMaxTransferRate * (aPlayer.isSneaking() ? 0.1f : 0.01f)); } else { @@ -89,19 +85,13 @@ public class GTPP_Cover_Overflow extends GT_CoverBehavior { aCoverVariable = mMaxTransferRate; } GT_Utility.sendChatToPlayer( - aPlayer, LangUtils.trans("322", "Overflow point: ") + aCoverVariable + trans("323", "L")); + aPlayer, + LangUtils.trans("322", "Overflow point: ") + aCoverVariable + trans("323", "L")); return aCoverVariable; } - public boolean onCoverRightclick( - byte aSide, - int aCoverID, - int aCoverVariable, - ICoverable aTileEntity, - EntityPlayer aPlayer, - float aX, - float aY, - float aZ) { + public boolean onCoverRightclick(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, + EntityPlayer aPlayer, float aX, float aY, float aZ) { boolean aShift = aPlayer.isSneaking(); int aAmount = aShift ? 128 : 8; if (GT_Utility.getClickedFacingCoords(aSide, aX, aY, aZ)[0] >= 0.5F) { @@ -116,7 +106,8 @@ public class GTPP_Cover_Overflow extends GT_CoverBehavior { aCoverVariable = mMaxTransferRate; } GT_Utility.sendChatToPlayer( - aPlayer, LangUtils.trans("322", "Overflow point: ") + aCoverVariable + trans("323", "L")); + aPlayer, + LangUtils.trans("322", "Overflow point: ") + aCoverVariable + trans("323", "L")); aTileEntity.setCoverDataAtSide(aSide, aCoverVariable); return true; } @@ -194,40 +185,42 @@ public class GTPP_Cover_Overflow extends GT_CoverBehavior { protected void addUIWidgets(ModularWindow.Builder builder) { AtomicBoolean warn = new AtomicBoolean(false); - builder.widget(new CoverDataControllerWidget<>( - this::getCoverData, this::setCoverData, GTPP_Cover_Overflow.this) + builder.widget( + new CoverDataControllerWidget<>(this::getCoverData, this::setCoverData, GTPP_Cover_Overflow.this) .addFollower( new CoverDataFollower_TextFieldWidget<>(), coverData -> String.valueOf(convert(coverData)), (coverData, state) -> new ISerializableObject.LegacyCoverData( (int) MathExpression.parseMathExpression(state)), - widget -> widget.setOnScrollNumbersLong(1, 5, 50) - .setNumbersLong(val -> { - warn.set(false); - if (val > mMaxTransferRate) { - val = (long) mMaxTransferRate; - warn.set(true); - } else if (val < 0) { - val = 0L; - } - return val; - }) - .setPattern(BaseTextFieldWidget.NATURAL_NUMS) - .setFocusOnGuiOpen(true) + widget -> widget.setOnScrollNumbersLong(1, 5, 50).setNumbersLong(val -> { + warn.set(false); + if (val > mMaxTransferRate) { + val = (long) mMaxTransferRate; + warn.set(true); + } else if (val < 0) { + val = 0L; + } + return val; + }).setPattern(BaseTextFieldWidget.NATURAL_NUMS).setFocusOnGuiOpen(true) .setPos(startX + spaceX * 0, startY + spaceY * 0 + 8) .setSize(spaceX * 4 - 3, 12))) - .widget(new TextWidget(GT_Utility.trans("323", "L")) - .setDefaultColor(COLOR_TEXT_GRAY.get()) - .setPos(startX + spaceX * 4, 4 + startY + spaceY * 0 + 8)) - .widget(TextWidget.dynamicText(() -> new Text((warn.get() - ? GT_Utility.trans("325", "Max") - : GT_Utility.trans("324", "Now")) - + ": " + convert(getCoverData()) - + "/" + mMaxTransferRate + " " - + GT_Utility.trans("323", "L")) - .color(warn.get() ? COLOR_TEXT_WARN.get() : COLOR_TEXT_GRAY.get())) - .setSynced(false) - .setPos(startX + spaceX * 0, 4 + startY + spaceY * 1 + 6)); + .widget( + new TextWidget(GT_Utility.trans("323", "L")).setDefaultColor(COLOR_TEXT_GRAY.get()) + .setPos(startX + spaceX * 4, 4 + startY + spaceY * 0 + 8)) + .widget( + TextWidget + .dynamicText( + () -> new Text( + (warn.get() ? GT_Utility.trans("325", "Max") + : GT_Utility.trans("324", "Now")) + ": " + + convert(getCoverData()) + + "/" + + mMaxTransferRate + + " " + + GT_Utility.trans("323", "L")).color( + warn.get() ? COLOR_TEXT_WARN.get() + : COLOR_TEXT_GRAY.get())) + .setSynced(false).setPos(startX + spaceX * 0, 4 + startY + spaceY * 1 + 6)); } } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/covers/GTPP_Cover_Overflow_Item.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/covers/GTPP_Cover_Overflow_Item.java index 46a6e9d600..27cd5be67e 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/covers/GTPP_Cover_Overflow_Item.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/covers/GTPP_Cover_Overflow_Item.java @@ -1,5 +1,12 @@ package gtPlusPlus.xmod.gregtech.common.covers; +import java.lang.reflect.Field; +import java.util.HashMap; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.Fluid; + import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.ICoverable; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; @@ -8,11 +15,6 @@ import gregtech.api.util.GT_Utility; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.util.minecraft.LangUtils; import gtPlusPlus.core.util.reflect.ReflectionUtils; -import java.lang.reflect.Field; -import java.util.HashMap; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraftforge.fluids.Fluid; public class GTPP_Cover_Overflow_Item extends GT_CoverBehavior { @@ -27,11 +29,11 @@ public class GTPP_Cover_Overflow_Item extends GT_CoverBehavior { static { sQuantumChest = ReflectionUtils.getClass("gregtech.common.tileentities.storage.GT_MetaTileEntity_QuantumChest"); - sSuperChestGTPP = ReflectionUtils.getClass( - "gtPlusPlus.xmod.gregtech.common.tileentities.storage.GT_MetaTileEntity_TieredChest"); + sSuperChestGTPP = ReflectionUtils + .getClass("gtPlusPlus.xmod.gregtech.common.tileentities.storage.GT_MetaTileEntity_TieredChest"); if (CORE.GTNH) { - sSuperChestGTNH = - ReflectionUtils.getClass("gregtech.common.tileentities.storage.GT_MetaTileEntity_SuperChest"); + sSuperChestGTNH = ReflectionUtils + .getClass("gregtech.common.tileentities.storage.GT_MetaTileEntity_SuperChest"); } else { sSuperChestGTNH = null; } @@ -54,15 +56,15 @@ public class GTPP_Cover_Overflow_Item extends GT_CoverBehavior { this.mMaxItemCapacity = aCapacity * 1000; } - public int doCoverThings( - byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) { + public int doCoverThings(byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity, + long aTimer) { if (aCoverVariable == 0) { return aCoverVariable; } // Get the IGTTile - IGregTechTileEntity aGtTileEntity = aTileEntity.getIGregTechTileEntity( - aTileEntity.getXCoord(), aTileEntity.getYCoord(), aTileEntity.getZCoord()); + IGregTechTileEntity aGtTileEntity = aTileEntity + .getIGregTechTileEntity(aTileEntity.getXCoord(), aTileEntity.getYCoord(), aTileEntity.getZCoord()); if (aGtTileEntity == null) { return aCoverVariable; } @@ -101,15 +103,8 @@ public class GTPP_Cover_Overflow_Item extends GT_CoverBehavior { return true; } - public int onCoverScrewdriverclick( - byte aSide, - int aCoverID, - int aCoverVariable, - ICoverable aTileEntity, - EntityPlayer aPlayer, - float aX, - float aY, - float aZ) { + public int onCoverScrewdriverclick(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, + EntityPlayer aPlayer, float aX, float aY, float aZ) { if (GT_Utility.getClickedFacingCoords(aSide, aX, aY, aZ)[0] >= 0.5F) { aCoverVariable += (mMaxItemCapacity * (aPlayer.isSneaking() ? 0.1f : 0.01f)); } else { @@ -122,19 +117,13 @@ public class GTPP_Cover_Overflow_Item extends GT_CoverBehavior { aCoverVariable = mMaxItemCapacity; } GT_Utility.sendChatToPlayer( - aPlayer, LangUtils.trans("322", "Overflow point: ") + aCoverVariable + trans("323", "L")); + aPlayer, + LangUtils.trans("322", "Overflow point: ") + aCoverVariable + trans("323", "L")); return aCoverVariable; } - public boolean onCoverRightclick( - byte aSide, - int aCoverID, - int aCoverVariable, - ICoverable aTileEntity, - EntityPlayer aPlayer, - float aX, - float aY, - float aZ) { + public boolean onCoverRightclick(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, + EntityPlayer aPlayer, float aX, float aY, float aZ) { boolean aShift = aPlayer.isSneaking(); int aAmount = aShift ? 128 : 8; if (GT_Utility.getClickedFacingCoords(aSide, aX, aY, aZ)[0] >= 0.5F) { @@ -149,7 +138,8 @@ public class GTPP_Cover_Overflow_Item extends GT_CoverBehavior { aCoverVariable = mMaxItemCapacity; } GT_Utility.sendChatToPlayer( - aPlayer, LangUtils.trans("322", "Overflow point: ") + aCoverVariable + trans("323", "L")); + aPlayer, + LangUtils.trans("322", "Overflow point: ") + aCoverVariable + trans("323", "L")); aTileEntity.setCoverDataAtSide(aSide, aCoverVariable); return true; } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/covers/GTPP_Cover_ToggleVisual.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/covers/GTPP_Cover_ToggleVisual.java index b8b130e987..eccbf78c8a 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/covers/GTPP_Cover_ToggleVisual.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/covers/GTPP_Cover_ToggleVisual.java @@ -1,5 +1,14 @@ package gtPlusPlus.xmod.gregtech.common.covers; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.fluids.Fluid; + import gregtech.api.interfaces.tileentity.ICoverable; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.util.GT_CoverBehavior; @@ -8,13 +17,6 @@ import gtPlusPlus.api.objects.minecraft.BlockPos; import gtPlusPlus.api.objects.random.XSTR; import gtPlusPlus.core.util.minecraft.LangUtils; import gtPlusPlus.core.util.minecraft.PlayerUtils; -import java.util.Map; -import java.util.concurrent.ConcurrentHashMap; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraftforge.common.util.ForgeDirection; -import net.minecraftforge.fluids.Fluid; public class GTPP_Cover_ToggleVisual extends GT_CoverBehavior { @@ -30,35 +32,20 @@ public class GTPP_Cover_ToggleVisual extends GT_CoverBehavior { ForgeDirection aDir = ForgeDirection.getOrientation(aSide); String s = aEntity.getInventoryName() + "." + aPos.getUniqueIdentifier() + aDir.name(); return s; - } catch (Throwable t) { - } + } catch (Throwable t) {} XSTR x = new XSTR(); return "ERROR." + x.getSeed() + x.hashCode() + x.nextDouble() + ".ID"; } - public boolean onCoverRightclick( - byte aSide, - int aCoverID, - int aCoverVariable, - ICoverable aTileEntity, - EntityPlayer aPlayer, - float aX, - float aY, - float aZ) { - PlayerUtils.messagePlayer( - aPlayer, LangUtils.trans("756", "Connectable: ") + getConnectionState(aCoverVariable)); + public boolean onCoverRightclick(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, + EntityPlayer aPlayer, float aX, float aY, float aZ) { + PlayerUtils + .messagePlayer(aPlayer, LangUtils.trans("756", "Connectable: ") + getConnectionState(aCoverVariable)); return super.onCoverRightclick(aSide, aCoverID, aCoverVariable, aTileEntity, aPlayer, aX, aY, aZ); } - public int onCoverScrewdriverclick( - byte aSide, - int aCoverID, - int aCoverVariable, - ICoverable aTileEntity, - EntityPlayer aPlayer, - float aX, - float aY, - float aZ) { + public int onCoverScrewdriverclick(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, + EntityPlayer aPlayer, float aX, float aY, float aZ) { return super.onCoverScrewdriverclick(aSide, aCoverID, aCoverVariable, aTileEntity, aPlayer, aX, aY, aZ); } @@ -95,8 +82,8 @@ public class GTPP_Cover_ToggleVisual extends GT_CoverBehavior { } @Override - public int doCoverThings( - byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) { + public int doCoverThings(byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity, + long aTimer) { try { String aKey = generateUniqueKey(aSide, aTileEntity); Integer b = sConnectionStateForEntityMap.get(aKey); @@ -131,8 +118,8 @@ public class GTPP_Cover_ToggleVisual extends GT_CoverBehavior { } @Override - public byte getRedstoneInput( - byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity) { + public byte getRedstoneInput(byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, + ICoverable aTileEntity) { if (!getConnectionState(aCoverVariable)) { return 0; } @@ -153,8 +140,8 @@ public class GTPP_Cover_ToggleVisual extends GT_CoverBehavior { } @Override - public boolean onCoverRemoval( - byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, boolean aForced) { + public boolean onCoverRemoval(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, + boolean aForced) { String aKey = generateUniqueKey(aSide, aTileEntity); sConnectionStateForEntityMap.remove(aKey); // Logger.INFO("Unmapping key "+aKey+"."); diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/helpers/ChargingHelper.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/helpers/ChargingHelper.java index a55cae39ea..ac30942a5f 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/helpers/ChargingHelper.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/helpers/ChargingHelper.java @@ -2,6 +2,15 @@ package gtPlusPlus.xmod.gregtech.common.helpers; import static gregtech.api.GregTech_API.mEUtoRF; +import java.util.HashMap; +import java.util.Map; +import java.util.UUID; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.item.ItemStack; +import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent; + import cofh.api.energy.IEnergyContainerItem; import cpw.mods.fml.common.eventhandler.EventPriority; import cpw.mods.fml.common.eventhandler.SubscribeEvent; @@ -21,20 +30,11 @@ import gtPlusPlus.core.util.reflect.ReflectionUtils; import gtPlusPlus.xmod.gregtech.common.tileentities.machines.basic.GregtechMetaWirelessCharger; import ic2.api.item.ElectricItem; import ic2.api.item.IElectricItem; -import java.util.HashMap; -import java.util.Map; -import java.util.UUID; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.item.ItemStack; -import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent; public class ChargingHelper { - private static Map<String, Pair<GregtechMetaWirelessCharger, Byte>> mValidPlayers = - new HashMap<String, Pair<GregtechMetaWirelessCharger, Byte>>(); - protected static Map<BlockPos, GregtechMetaWirelessCharger> mChargerMap = - new HashMap<BlockPos, GregtechMetaWirelessCharger>(); + private static Map<String, Pair<GregtechMetaWirelessCharger, Byte>> mValidPlayers = new HashMap<String, Pair<GregtechMetaWirelessCharger, Byte>>(); + protected static Map<BlockPos, GregtechMetaWirelessCharger> mChargerMap = new HashMap<BlockPos, GregtechMetaWirelessCharger>(); private int mTickTimer = 0; private final int mTickMultiplier = 20; @@ -66,9 +66,8 @@ public class ChargingHelper { for (GregtechMetaWirelessCharger mEntityTemp : mChargerMap.values()) { if (mEntityTemp != null) { if (mEntityTemp.getBaseMetaTileEntity() == null - || !mEntityTemp - .getBaseMetaTileEntity() - .isAllowedToWork()) continue; + || !mEntityTemp.getBaseMetaTileEntity().isAllowedToWork()) + continue; if (mPlayerMan.getEntityWorld().provider.dimensionId == mEntityTemp.getDimensionID()) { mVoltage = mEntityTemp.maxEUInput(); @@ -85,32 +84,48 @@ public class ChargingHelper { if (!LR.isEmpty() && LR.containsKey(mPlayerMan.getDisplayName())) { mCurrentEu = chargeItems( - mEntityTemp, mArmourContents, mPlayerMan); + mEntityTemp, + mArmourContents, + mPlayerMan); mCurrentEu = chargeItems( - mEntityTemp, mInventoryContents, mPlayerMan); + mEntityTemp, + mInventoryContents, + mPlayerMan); } } else if (mEntityTemp.getMode() == 1) { if (!LO.isEmpty() && LO.containsKey(mPlayerMan.getDisplayName())) { mCurrentEu = chargeItems( - mEntityTemp, mArmourContents, mPlayerMan); + mEntityTemp, + mArmourContents, + mPlayerMan); mCurrentEu = chargeItems( - mEntityTemp, mInventoryContents, mPlayerMan); + mEntityTemp, + mInventoryContents, + mPlayerMan); } } else { if (!LR.isEmpty() && LR.containsKey(mPlayerMan.getDisplayName())) { mCurrentEu = chargeItems( - mEntityTemp, mArmourContents, mPlayerMan); + mEntityTemp, + mArmourContents, + mPlayerMan); mCurrentEu = chargeItems( - mEntityTemp, mInventoryContents, mPlayerMan); + mEntityTemp, + mInventoryContents, + mPlayerMan); } if (!LO.isEmpty() && LO.containsKey(mPlayerMan.getDisplayName())) { mCurrentEu = chargeItems( - mEntityTemp, mArmourContents, mPlayerMan); + mEntityTemp, + mArmourContents, + mPlayerMan); mCurrentEu = chargeItems( - mEntityTemp, mInventoryContents, mPlayerMan); + mEntityTemp, + mInventoryContents, + mPlayerMan); } } @@ -125,13 +140,14 @@ public class ChargingHelper { mMaxDistance = (4 * GT_Values.V[mEntityTemp.getTier()] / 2); } double mDistance = calculateDistance(mEntityTemp, mPlayerMan); - long mVoltageCost = MathUtils.findPercentageOfInt( - mMaxDistance, (float) mDistance); + long mVoltageCost = MathUtils + .findPercentageOfInt(mMaxDistance, (float) mDistance); if (mVoltageCost > 0) { if (mVoltageCost > mEntityTemp.maxEUInput()) { - mEntityTemp.setEUVar((mEntityTemp.getEUVar() - - mEntityTemp.maxEUInput())); + mEntityTemp.setEUVar( + (mEntityTemp.getEUVar() + - mEntityTemp.maxEUInput())); } else { mEntityTemp.setEUVar( (mEntityTemp.getEUVar() - mVoltageCost)); @@ -202,8 +218,9 @@ public class ChargingHelper { return false; } else { Logger.WARNING("key not found, adding"); - Pair<GregtechMetaWirelessCharger, Byte> mEntry = - new Pair<GregtechMetaWirelessCharger, Byte>(mEntity, (byte) mEntity.getMode()); + Pair<GregtechMetaWirelessCharger, Byte> mEntry = new Pair<GregtechMetaWirelessCharger, Byte>( + mEntity, + (byte) mEntity.getMode()); if (mValidPlayers.put(mPlayer.getDisplayName(), mEntry) == null) { Logger.WARNING("Added a Player to the Tick Map."); return true; @@ -221,8 +238,9 @@ public class ChargingHelper { Logger.WARNING("trying to remove player from map"); if (mValidPlayers.containsKey(mPlayer.getDisplayName())) { Logger.WARNING("key found, removing"); - Pair<GregtechMetaWirelessCharger, Byte> mEntry = - new Pair<GregtechMetaWirelessCharger, Byte>(mEntity, (byte) mEntity.getMode()); + Pair<GregtechMetaWirelessCharger, Byte> mEntry = new Pair<GregtechMetaWirelessCharger, Byte>( + mEntity, + (byte) mEntity.getMode()); if (mValidPlayers.remove(mPlayer, mEntry)) { Logger.WARNING("Removed a Player to the Tick Map."); return true; @@ -241,7 +259,8 @@ public class ChargingHelper { return 0; } return mEntityTemp.getDistanceBetweenTwoPositions( - mEntityTemp.getTileEntityPosition(), mEntityTemp.getPositionOfEntity(mPlayerMan)); + mEntityTemp.getTileEntityPosition(), + mEntityTemp.getPositionOfEntity(mPlayerMan)); } public long chargeItems(GregtechMetaWirelessCharger mEntity, ItemStack[] mItems, EntityPlayer mPlayer) { @@ -305,10 +324,7 @@ public class ChargingHelper { || mTemp.getItem() instanceof GT_MetaGenerated_Item_02 || ReflectionUtils.getClass("gregtech.common.items.GT_MetaGenerated_Item_03") .isInstance(mTemp.getItem()) - || mTemp.getItem() - .getClass() - .getName() - .toLowerCase() + || mTemp.getItem().getClass().getName().toLowerCase() .equals(("gregtech.common.items.GT_MetaGenerated_Tool_01").toLowerCase())) { if (!NBTUtils.hasKey(mTemp, "GT.ItemCharge")) { if (!mTemp.getDisplayName().toLowerCase().contains("battery")) { @@ -341,13 +357,14 @@ public class ChargingHelper { mMulti = 20; } else if ((mitemCurrentCharge + (mVoltageIncrease * 10)) <= (mItemMaxCharge - (mVoltageIncrease * 10))) { - mMulti = 10; - } else if ((mitemCurrentCharge + (mVoltageIncrease * 5)) - <= (mItemMaxCharge - (mVoltageIncrease * 5))) { - mMulti = 5; - } else { - mMulti = 1; - } + mMulti = 10; + } else + if ((mitemCurrentCharge + (mVoltageIncrease * 5)) + <= (mItemMaxCharge - (mVoltageIncrease * 5))) { + mMulti = 5; + } else { + mMulti = 1; + } Logger.WARNING("5"); int mMultiVoltage = (int) (mMulti * mVoltageIncrease); @@ -359,9 +376,8 @@ public class ChargingHelper { > 0) { Logger.WARNING("6.5 - " + g + " - " + mMulti); for (int i = 0; i < mMulti; i++) { - if (ElectricItem.manager.charge( - mTemp, mVoltageIncrease, Integer.MAX_VALUE, false, false) - > 0) { + if (ElectricItem.manager + .charge(mTemp, mVoltageIncrease, Integer.MAX_VALUE, false, false) > 0) { continue; } } @@ -370,11 +386,22 @@ public class ChargingHelper { Logger.WARNING("7"); mEntity.setEUVar(mEuStored - (mVoltage * mMulti)); mEuStored = mEntity.getEUVar(); - Logger.WARNING("Charged " + mTemp.getDisplayName() + " | Slot: " + mItemSlot - + " | EU Multiplier: " + mMulti + " | EU/t input: " + mVoltageIncrease - + " | EU/t consumed by Tile: " + mVoltage + " | Item Max Charge: " + mItemMaxCharge - + " | Item Start Charge: " + mitemCurrentCharge + " | Item New Charge" - + ElectricItem.manager.getCharge(mTemp)); + Logger.WARNING( + "Charged " + mTemp.getDisplayName() + + " | Slot: " + + mItemSlot + + " | EU Multiplier: " + + mMulti + + " | EU/t input: " + + mVoltageIncrease + + " | EU/t consumed by Tile: " + + mVoltage + + " | Item Max Charge: " + + mItemMaxCharge + + " | Item Start Charge: " + + mitemCurrentCharge + + " | Item New Charge" + + ElectricItem.manager.getCharge(mTemp)); mChargedItems++; } } @@ -391,11 +418,22 @@ public class ChargingHelper { Logger.WARNING("9"); mEntity.setEUVar(mEntity.getEUVar() - (xDif)); mEuStored = mEntity.getEUVar(); - Logger.WARNING("Charged " + mTemp.getDisplayName() + " | Slot: " + mItemSlot - + " | EU Multiplier: " + mMulti + " | EU/t input: " + mVoltageIncrease - + " | EU/t consumed by Tile: " + mVoltage + " | Item Max Charge: " - + mItemMaxCharge + " | Item Start Charge: " + mitemCurrentCharge - + " | Item New Charge" + ElectricItem.manager.getCharge(mTemp)); + Logger.WARNING( + "Charged " + mTemp.getDisplayName() + + " | Slot: " + + mItemSlot + + " | EU Multiplier: " + + mMulti + + " | EU/t input: " + + mVoltageIncrease + + " | EU/t consumed by Tile: " + + mVoltage + + " | Item Max Charge: " + + mItemMaxCharge + + " | Item Start Charge: " + + mitemCurrentCharge + + " | Item New Charge" + + ElectricItem.manager.getCharge(mTemp)); mChargedItems++; } } @@ -408,7 +446,9 @@ public class ChargingHelper { rfItem.getMaxEnergyStored(mTemp) - rfItem.getEnergyStored(mTemp), mEntity.getEUVar() * mEUtoRF / 100L); chargedPower = rfItem.receiveEnergy( - mTemp, chargedPower > Integer.MAX_VALUE ? Integer.MAX_VALUE : (int) chargedPower, false); + mTemp, + chargedPower > Integer.MAX_VALUE ? Integer.MAX_VALUE : (int) chargedPower, + false); chargedPower = chargedPower * 100L / mEUtoRF; mEntity.setEUVar(Math.max(mEntity.getEUVar() - chargedPower, 0)); mChargedItems++; diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/helpers/CraftingHelper.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/helpers/CraftingHelper.java index bb81c349a0..0d85d6299f 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/helpers/CraftingHelper.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/helpers/CraftingHelper.java @@ -1,12 +1,13 @@ package gtPlusPlus.xmod.gregtech.common.helpers; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.world.World; + import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.xmod.gregtech.common.helpers.autocrafter.AC_Helper_Container; import gtPlusPlus.xmod.gregtech.common.helpers.autocrafter.AC_Helper_Utils; import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production.GT4Entity_AutoCrafter; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.world.World; public class CraftingHelper { diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/helpers/FlotationRecipeHandler.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/helpers/FlotationRecipeHandler.java index bb8dac49d7..58a4aba71c 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/helpers/FlotationRecipeHandler.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/helpers/FlotationRecipeHandler.java @@ -1,13 +1,15 @@ package gtPlusPlus.xmod.gregtech.common.helpers; +import java.util.HashMap; + +import net.minecraft.item.ItemStack; +import net.minecraftforge.oredict.OreDictionary; + import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import gtPlusPlus.core.material.Material; import gtPlusPlus.core.util.sys.Log; import gtPlusPlus.xmod.gregtech.api.enums.CustomOrePrefix; -import java.util.HashMap; -import net.minecraft.item.ItemStack; -import net.minecraftforge.oredict.OreDictionary; public class FlotationRecipeHandler { diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/helpers/GT_MethodHelper.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/helpers/GT_MethodHelper.java index 0b60e057f4..0c0baf4723 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/helpers/GT_MethodHelper.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/helpers/GT_MethodHelper.java @@ -1,16 +1,18 @@ package gtPlusPlus.xmod.gregtech.common.helpers; -import gregtech.api.enums.Textures.BlockIcons; -import gregtech.api.interfaces.ITexture; -import gregtech.api.metatileentity.BaseMetaTileEntity; -import gregtech.api.metatileentity.MetaTileEntity; -import gtPlusPlus.core.util.reflect.ReflectionUtils; import java.lang.reflect.Field; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; + import net.minecraft.block.Block; import net.minecraft.tileentity.TileEntity; +import gregtech.api.enums.Textures.BlockIcons; +import gregtech.api.interfaces.ITexture; +import gregtech.api.metatileentity.BaseMetaTileEntity; +import gregtech.api.metatileentity.MetaTileEntity; +import gtPlusPlus.core.util.reflect.ReflectionUtils; + public class GT_MethodHelper { private static final Method mGetTexture; @@ -46,28 +48,25 @@ public class GT_MethodHelper { Field aColor = ReflectionUtils.getField(BaseMetaTileEntity.class, "mColor"); Field aActive = ReflectionUtils.getField(BaseMetaTileEntity.class, "mActive"); Field aMetaTile = ReflectionUtils.getField(BaseMetaTileEntity.class, "mMetaTileEntity"); - Method aHasValidTile = ReflectionUtils.getMethod( - BaseMetaTileEntity.class, "hasValidMetaTileEntity", new Class[] {}); + Method aHasValidTile = ReflectionUtils + .getMethod(BaseMetaTileEntity.class, "hasValidMetaTileEntity", new Class[] {}); boolean hasValidTileObj = (boolean) aHasValidTile.invoke(aTile, new Object[] {}); boolean aActiveObj = aActive.getBoolean(aTile); byte aFacingObj = aFacing.getByte(aTile); - byte aColorObj = aColor.getByte(aTile); - ; + byte aColorObj = aColor.getByte(aTile);; MetaTileEntity aMetaTileObj = (MetaTileEntity) aMetaTile.get(aTile); if (rIcon != null) { - return new ITexture[] {rIcon}; + return new ITexture[] { rIcon }; } else { - return hasValidTileObj - ? aMetaTileObj.getTexture( - aTile, - aSide, - aFacingObj, - (byte) (aColorObj - 1), - aActiveObj, - aTile.getOutputRedstoneSignal(aSide) > 0) - : BlockIcons.ERROR_RENDERING; + return hasValidTileObj ? aMetaTileObj.getTexture( + aTile, + aSide, + aFacingObj, + (byte) (aColorObj - 1), + aActiveObj, + aTile.getOutputRedstoneSignal(aSide) > 0) : BlockIcons.ERROR_RENDERING; } } catch (Throwable t) { t.printStackTrace(); diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/helpers/MachineUpdateHandler.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/helpers/MachineUpdateHandler.java index 8263243474..2710f5dc78 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/helpers/MachineUpdateHandler.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/helpers/MachineUpdateHandler.java @@ -1,11 +1,13 @@ package gtPlusPlus.xmod.gregtech.common.helpers; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import gregtech.api.GregTech_API; import java.util.HashMap; + import net.minecraft.block.Block; import net.minecraftforge.event.world.BlockEvent; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import gregtech.api.GregTech_API; + public class MachineUpdateHandler { private static final HashMap<String, Block> mBlockCache = new HashMap<String, Block>(); diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/helpers/TreeFarmHelper.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/helpers/TreeFarmHelper.java index d054e5da3b..7ce06c7974 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/helpers/TreeFarmHelper.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/helpers/TreeFarmHelper.java @@ -2,7 +2,37 @@ package gtPlusPlus.xmod.gregtech.common.helpers; import static gtPlusPlus.core.lib.CORE.ConfigSwitches.enableTreeFarmerParticles; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Iterator; +import java.util.Map; +import java.util.Queue; +import java.util.Set; +import java.util.Stack; +import java.util.concurrent.ConcurrentHashMap; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockAir; +import net.minecraft.block.IGrowable; +import net.minecraft.block.material.Material; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.network.play.server.S23PacketBlockChange; +import net.minecraft.server.MinecraftServer; +import net.minecraft.world.ChunkPosition; +import net.minecraft.world.World; +import net.minecraftforge.common.ForgeHooks; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.event.entity.player.BonemealEvent; +import net.minecraftforge.event.world.BlockEvent; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.oredict.OreDictionary; + import com.google.common.collect.Lists; + import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.common.Optional; import cpw.mods.fml.common.eventhandler.Event.Result; @@ -30,33 +60,6 @@ import gtPlusPlus.core.util.minecraft.ItemUtils; import gtPlusPlus.core.util.minecraft.particles.BlockBreakParticles; import gtPlusPlus.core.util.reflect.ReflectionUtils; import gtPlusPlus.xmod.gregtech.common.items.MetaGeneratedGregtechItems; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashSet; -import java.util.Iterator; -import java.util.Map; -import java.util.Queue; -import java.util.Set; -import java.util.Stack; -import java.util.concurrent.ConcurrentHashMap; -import net.minecraft.block.Block; -import net.minecraft.block.BlockAir; -import net.minecraft.block.IGrowable; -import net.minecraft.block.material.Material; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; -import net.minecraft.network.play.server.S23PacketBlockChange; -import net.minecraft.server.MinecraftServer; -import net.minecraft.world.ChunkPosition; -import net.minecraft.world.World; -import net.minecraftforge.common.ForgeHooks; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.event.entity.player.BonemealEvent; -import net.minecraftforge.event.world.BlockEvent; -import net.minecraftforge.fluids.FluidStack; -import net.minecraftforge.oredict.OreDictionary; public class TreeFarmHelper { @@ -83,23 +86,23 @@ public class TreeFarmHelper { } public static ITexture[] getFront(final byte aColor) { - return new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[2][aColor + 1]}; + return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[2][aColor + 1] }; } public static ITexture[] getBack(final byte aColor) { - return new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[2][aColor + 1]}; + return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[2][aColor + 1] }; } public static ITexture[] getBottom(final byte aColor) { - return new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[2][aColor + 1]}; + return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[2][aColor + 1] }; } public static ITexture[] getTop(final byte aColor) { - return new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[2][aColor + 1]}; + return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[2][aColor + 1] }; } public static ITexture[] getSides(final byte aColor) { - return new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[2][aColor + 1]}; + return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[2][aColor + 1] }; } public static ITexture[] getFrontActive(final byte aColor) { @@ -122,13 +125,8 @@ public class TreeFarmHelper { return getSides(aColor); } - public static boolean applyBonemeal( - final EntityPlayer player, - final World world, - final int intX, - final int intY, - final int intZ, - final short multiplier) { + public static boolean applyBonemeal(final EntityPlayer player, final World world, final int intX, final int intY, + final int intZ, final short multiplier) { final Block block = world.getBlock(intX, intY, intZ); int roll; @@ -183,14 +181,10 @@ public class TreeFarmHelper { public static boolean cleanUp(final IGregTechTileEntity aBaseMetaTileEntity) { Logger.MACHINE_INFO("called cleanUp()"); int cleanedUp = 0; - final int xDir = - net.minecraftforge.common.util.ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()) - .offsetX - * 11; - final int zDir = - net.minecraftforge.common.util.ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()) - .offsetZ - * 11; + final int xDir = net.minecraftforge.common.util.ForgeDirection + .getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX * 11; + final int zDir = net.minecraftforge.common.util.ForgeDirection + .getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ * 11; for (int h = 1; h < 175; h++) { for (int i = -11; i <= 11; i++) { @@ -198,12 +192,10 @@ public class TreeFarmHelper { final Block testBlock = aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j); - if ((((i == -8) || (i == 8)) - || ((i == -9) || (i == 9)) - || ((i == -10) || (i == 10)) - || ((i == -11) || (i == 11))) - && (((j == -8) || (j == 8)) - || ((j == -9) || (j == 9)) + if ((((i == -8) || (i == 8)) || ((i == -9) || (i == 9)) + || ((i == -10) || (i == 10)) + || ((i == -11) || (i == 11))) + && (((j == -8) || (j == 8)) || ((j == -9) || (j == 9)) || ((j == -10) || (j == 10)) || ((j == -11) || (j == 11)))) { @@ -211,34 +203,54 @@ public class TreeFarmHelper { || !testBlock.getUnlocalizedName().toLowerCase().contains("pumpkin")) { // Logger.WARNING("5:"+testBlock.getUnlocalizedName()); } else { - aBaseMetaTileEntity - .getWorld() - .setBlock( - aBaseMetaTileEntity.getXCoord() + xDir + i, - aBaseMetaTileEntity.getYCoord() + h, - aBaseMetaTileEntity.getZCoord() + zDir + j, - Blocks.bookshelf); + aBaseMetaTileEntity.getWorld().setBlock( + aBaseMetaTileEntity.getXCoord() + xDir + i, + aBaseMetaTileEntity.getYCoord() + h, + aBaseMetaTileEntity.getZCoord() + zDir + j, + Blocks.bookshelf); } } // If not in the middle - don't know how else to check this one without lots of != - if ((i != 7) && (i != -7) && (j != 7) && (j != -7) && (i != 6) && (i != -6) && (j != 6) && (j != -6) - && (i != 5) && (i != -5) && (j != 5) && (j != -5) && (i != 4) && (i != -4) && (j != 4) - && (j != -4) && (i != 3) && (i != -3) && (j != 3) && (j != -3) && (i != 2) && (i != -2) - && (j != 2) && (j != -2) && (i != 1) && (i != -1) && (j != 1) && (j != -1) && (i != 0) + if ((i != 7) && (i != -7) + && (j != 7) + && (j != -7) + && (i != 6) + && (i != -6) + && (j != 6) + && (j != -6) + && (i != 5) + && (i != -5) + && (j != 5) + && (j != -5) + && (i != 4) + && (i != -4) + && (j != 4) + && (j != -4) + && (i != 3) + && (i != -3) + && (j != 3) + && (j != -3) + && (i != 2) + && (i != -2) + && (j != 2) + && (j != -2) + && (i != 1) + && (i != -1) + && (j != 1) + && (j != -1) + && (i != 0) && (j != 0)) { if (!testBlock.getUnlocalizedName().toLowerCase().contains("air") || !testBlock.getUnlocalizedName().toLowerCase().contains("pumpkin")) { // Logger.WARNING("0:"+testBlock.getUnlocalizedName()); } else { - aBaseMetaTileEntity - .getWorld() - .setBlock( - aBaseMetaTileEntity.getXCoord() + xDir + i, - aBaseMetaTileEntity.getYCoord() + h, - aBaseMetaTileEntity.getZCoord() + zDir + j, - Blocks.melon_block); + aBaseMetaTileEntity.getWorld().setBlock( + aBaseMetaTileEntity.getXCoord() + xDir + i, + aBaseMetaTileEntity.getYCoord() + h, + aBaseMetaTileEntity.getZCoord() + zDir + j, + Blocks.melon_block); } if (isLeaves(testBlock) || isWoodLog(testBlock)) { @@ -295,8 +307,7 @@ public class TreeFarmHelper { if (aDmg >= 32120 && aDmg <= 32128) { return ToolType.Unbreakable; } - Logger.INFO( - "bad Tool in Slot 2 | " + aStack.getUnlocalizedName().toLowerCase() + " | " + aDmg); + Logger.INFO("bad Tool in Slot 2 | " + aStack.getUnlocalizedName().toLowerCase() + " | " + aDmg); return null; } @@ -372,9 +383,8 @@ public class TreeFarmHelper { } return (OrePrefixes.log.contains(new ItemStack(log, 1)) && ((tTool != null) && (tTool.equals("axe")))) - || (log.getMaterial() != Material.wood) - ? false - : (OrePrefixes.fence.contains(new ItemStack(log, 1)) ? false : true); + || (log.getMaterial() != Material.wood) ? false + : (OrePrefixes.fence.contains(new ItemStack(log, 1)) ? false : true); } public static boolean isLeaves(final Block log) { @@ -390,8 +400,7 @@ public class TreeFarmHelper { if (log.getLocalizedName().toLowerCase().contains("leaves")) { return true; } - return OrePrefixes.leaves.contains(new ItemStack(log, 1)) - || log.getMaterial() == Material.leaves + return OrePrefixes.leaves.contains(new ItemStack(log, 1)) || log.getMaterial() == Material.leaves || OrePrefixes.treeLeaves.contains(new ItemStack(log, 1)) || log.getMaterial() == Material.vine || OrePrefixes.mushroom.contains(new ItemStack(log, 1)) @@ -412,18 +421,14 @@ public class TreeFarmHelper { } public static boolean isDirtBlock(final Block dirt) { - return (dirt == Blocks.dirt - ? true + return (dirt == Blocks.dirt ? true : (dirt == Blocks.grass ? true : (getHumus() == null ? false : (dirt == blockHumus ? true : false)))); } public static boolean isFenceBlock(final Block fence) { - return (fence == Blocks.fence - ? true - : (fence == Blocks.fence_gate - ? true - : (fence == Blocks.nether_brick_fence - ? true + return (fence == Blocks.fence ? true + : (fence == Blocks.fence_gate ? true + : (fence == Blocks.nether_brick_fence ? true : (OrePrefixes.fence.contains(new ItemStack(fence, 1)) ? true : false)))); } @@ -438,19 +443,16 @@ public class TreeFarmHelper { return (air == Blocks.air ? true : (air instanceof BlockAir ? true : false)); } - /*public static boolean isSaplingBlock(Block sapling){ - return (sapling == Blocks.sapling ? true : (sapling == Blocks.)) - }*/ + /* + * public static boolean isSaplingBlock(Block sapling){ return (sapling == Blocks.sapling ? true : (sapling == + * Blocks.)) } + */ public static BlockPos checkForLogsInGrowArea(final IGregTechTileEntity aBaseMetaTileEntity) { - final int xDir = - net.minecraftforge.common.util.ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()) - .offsetX - * 7; - final int zDir = - net.minecraftforge.common.util.ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()) - .offsetZ - * 7; + final int xDir = net.minecraftforge.common.util.ForgeDirection + .getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX * 7; + final int zDir = net.minecraftforge.common.util.ForgeDirection + .getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ * 7; for (int i = -7; i <= 7; i++) { for (int j = -7; j <= 7; j++) { for (int h = 0; h <= 1; h++) { @@ -731,8 +733,8 @@ public class TreeFarmHelper { final Block block = mWorld.getBlock(h.xPos, h.yPos, h.zPos); if (block != null) { final int dropMeta = mWorld.getBlockMetadata(h.xPos, h.yPos, h.zPos); - final ArrayList<ItemStack> blockDrops = - block.getDrops(mWorld, h.xPos, h.yPos, h.zPos, dropMeta, 0); + final ArrayList<ItemStack> blockDrops = block + .getDrops(mWorld, h.xPos, h.yPos, h.zPos, dropMeta, 0); final ItemStack[] drops = ItemUtils.getBlockDrops(blockDrops); mDrops.put(drops); // Remove drop that was added to the bus. @@ -804,13 +806,12 @@ public class TreeFarmHelper { if (wood == null) { return false; } - if (wood.isWood(world, x, y, z) || wood.getMaterial() == Material.sponge) - if (detectTree(world, x, y, z)) { - TreeChopTask chopper = new TreeChopTask(new ChunkPosition(x, y, z), checkFakePlayer(world), 128); - FMLCommonHandler.instance().bus().register(chopper); - // custom block breaking code, don't call vanilla code - return true; - } + if (wood.isWood(world, x, y, z) || wood.getMaterial() == Material.sponge) if (detectTree(world, x, y, z)) { + TreeChopTask chopper = new TreeChopTask(new ChunkPosition(x, y, z), checkFakePlayer(world), 128); + FMLCommonHandler.instance().bus().register(chopper); + // custom block breaking code, don't call vanilla code + return true; + } // return onBlockStartBreak(stack, x, y, z, player); return false; } @@ -852,8 +853,7 @@ public class TreeFarmHelper { for (int offX = 0; offX < d; offX++) { for (int offY = 0; offY < d; offY++) { for (int offZ = 0; offZ < d; offZ++) { - int xPos = pos.chunkPosX - 1 + offX, - yPos = pos.chunkPosY - 1 + offY, + int xPos = pos.chunkPosX - 1 + offX, yPos = pos.chunkPosY - 1 + offY, zPos = pos.chunkPosZ - 1 + offZ; Block leaf = world.getBlock(xPos, yPos, zPos); if (leaf != null && leaf.isLeaves(world, xPos, yPos, zPos)) { @@ -912,7 +912,7 @@ public class TreeFarmHelper { ChunkPosition pos; while (left > 0) { // completely done or can't do our job anymore?! - if (blocks.isEmpty() /* || tags.getBoolean("Broken")*/) { + if (blocks.isEmpty() /* || tags.getBoolean("Broken") */) { finish(); return; } @@ -956,8 +956,8 @@ public class TreeFarmHelper { } } - public static void breakExtraBlock( - World world, int x, int y, int z, int sidehit, EntityPlayer playerEntity, int refX, int refY, int refZ) { + public static void breakExtraBlock(World world, int x, int y, int z, int sidehit, EntityPlayer playerEntity, + int refX, int refY, int refZ) { // prevent calling that stuff for air blocks, could lead to unexpected behaviour since it fires events if (world.isAirBlock(x, y, z)) return; @@ -981,8 +981,8 @@ public class TreeFarmHelper { if (!ForgeHooks.canHarvestBlock(block, player, meta) || refStrength / strength > 10f) return; // send the blockbreak event - BlockEvent.BreakEvent event = - ForgeHooks.onBlockBreakEvent(world, player.theItemInWorldManager.getGameType(), player, x, y, z); + BlockEvent.BreakEvent event = ForgeHooks + .onBlockBreakEvent(world, player.theItemInWorldManager.getGameType(), player, x, y, z); if (event.isCanceled()) return; if (player.capabilities.isCreativeMode) { @@ -1007,8 +1007,8 @@ public class TreeFarmHelper { // ItemInWorldManager.removeBlock block.onBlockHarvested(world, x, y, z, meta, player); - if (block.removedByPlayer( - world, player, x, y, z, true)) // boolean is if block can be harvested, checked above + if (block.removedByPlayer(world, player, x, y, z, true)) // boolean is if block can be harvested, checked + // above { block.onBlockDestroyedByPlayer(world, x, y, z, meta); block.harvestBlock(world, player, x, y, z, meta); diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/helpers/VolumetricFlaskHelper.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/helpers/VolumetricFlaskHelper.java index 72d6111b8a..52aeb864dd 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/helpers/VolumetricFlaskHelper.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/helpers/VolumetricFlaskHelper.java @@ -1,17 +1,19 @@ package gtPlusPlus.xmod.gregtech.common.helpers; -import gtPlusPlus.core.lib.CORE; -import gtPlusPlus.core.util.minecraft.ItemUtils; -import gtPlusPlus.core.util.reflect.ReflectionUtils; -import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; -import gtPlusPlus.xmod.gregtech.common.Meta_GT_Proxy; import java.lang.reflect.Constructor; import java.lang.reflect.Method; + import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraftforge.fluids.FluidStack; +import gtPlusPlus.core.lib.CORE; +import gtPlusPlus.core.util.minecraft.ItemUtils; +import gtPlusPlus.core.util.reflect.ReflectionUtils; +import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; +import gtPlusPlus.xmod.gregtech.common.Meta_GT_Proxy; + public class VolumetricFlaskHelper { private static final Class sClassVolumetricFlask; @@ -89,8 +91,8 @@ public class VolumetricFlaskHelper { if (aStack != null && sMethodGetFlaskMaxCapacity != null) { Item aItem = aStack.getItem(); if (sClassVolumetricFlask.isInstance(aItem)) { - int aMaxCapacity = - (int) ReflectionUtils.invokeNonBool(aItem, sMethodGetFlaskMaxCapacity, new Object[] {}); + int aMaxCapacity = (int) ReflectionUtils + .invokeNonBool(aItem, sMethodGetFlaskMaxCapacity, new Object[] {}); return aMaxCapacity; } } @@ -168,11 +170,11 @@ public class VolumetricFlaskHelper { } public static Item generateNewFlask(String unlocalized, String english, int maxCapacity) { - Constructor aFlask = ReflectionUtils.getConstructor( - sClassVolumetricFlask, new Class[] {String.class, String.class, int.class}); + Constructor aFlask = ReflectionUtils + .getConstructor(sClassVolumetricFlask, new Class[] { String.class, String.class, int.class }); if (aFlask != null) { - Object aInstance = ReflectionUtils.createNewInstanceFromConstructor( - aFlask, new Object[] {unlocalized, english, maxCapacity}); + Object aInstance = ReflectionUtils + .createNewInstanceFromConstructor(aFlask, new Object[] { unlocalized, english, maxCapacity }); if (aInstance != null && aInstance instanceof Item) { Item aNewFlaskItem = (Item) aInstance; return aNewFlaskItem; diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/helpers/autocrafter/AC_Helper_Container.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/helpers/autocrafter/AC_Helper_Container.java index 165941b1d2..f31337228b 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/helpers/autocrafter/AC_Helper_Container.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/helpers/autocrafter/AC_Helper_Container.java @@ -1,6 +1,5 @@ package gtPlusPlus.xmod.gregtech.common.helpers.autocrafter; -import gtPlusPlus.api.objects.Logger; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.inventory.*; @@ -8,7 +7,10 @@ import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.CraftingManager; import net.minecraft.world.World; +import gtPlusPlus.api.objects.Logger; + public class AC_Helper_Container extends Container { + /** The crafting matrix inventory (3x3). */ public InventoryCrafting craftMatrix = new InventoryCrafting(this, 3, 3); @@ -62,7 +64,8 @@ public class AC_Helper_Container extends Container { @Override public void onCraftMatrixChanged(IInventory p_75130_1_) { this.craftResult.setInventorySlotContents( - 0, CraftingManager.getInstance().findMatchingRecipe(this.craftMatrix, this.worldObj)); + 0, + CraftingManager.getInstance().findMatchingRecipe(this.craftMatrix, this.worldObj)); Logger.INFO("Crafted " + this.craftResult.getStackInSlot(0)); } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/helpers/autocrafter/AC_Helper_Utils.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/helpers/autocrafter/AC_Helper_Utils.java index 6b8452eeed..6a2175f151 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/helpers/autocrafter/AC_Helper_Utils.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/helpers/autocrafter/AC_Helper_Utils.java @@ -1,15 +1,15 @@ package gtPlusPlus.xmod.gregtech.common.helpers.autocrafter; -import gtPlusPlus.api.objects.Logger; -import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production.GT4Entity_AutoCrafter; import java.util.*; import java.util.Map.Entry; +import gtPlusPlus.api.objects.Logger; +import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production.GT4Entity_AutoCrafter; + public class AC_Helper_Utils { // AC maps - public static final Map<Integer, GT4Entity_AutoCrafter> sAutocrafterMap = - new HashMap<Integer, GT4Entity_AutoCrafter>(); + public static final Map<Integer, GT4Entity_AutoCrafter> sAutocrafterMap = new HashMap<Integer, GT4Entity_AutoCrafter>(); // Add Crafter public static final int addCrafter(GT4Entity_AutoCrafter AC) { diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/helpers/tesseract/TesseractHelper.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/helpers/tesseract/TesseractHelper.java index f4eb274179..e490c3dd81 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/helpers/tesseract/TesseractHelper.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/helpers/tesseract/TesseractHelper.java @@ -2,13 +2,15 @@ package gtPlusPlus.xmod.gregtech.common.helpers.tesseract; import static gtPlusPlus.core.lib.CORE.*; -import gtPlusPlus.api.objects.Logger; -import gtPlusPlus.xmod.gregtech.common.tileentities.automation.GT_MetaTileEntity_TesseractGenerator; -import gtPlusPlus.xmod.gregtech.common.tileentities.automation.GT_MetaTileEntity_TesseractTerminal; import java.util.*; import java.util.Map.Entry; + import net.minecraft.entity.player.EntityPlayer; +import gtPlusPlus.api.objects.Logger; +import gtPlusPlus.xmod.gregtech.common.tileentities.automation.GT_MetaTileEntity_TesseractGenerator; +import gtPlusPlus.xmod.gregtech.common.tileentities.automation.GT_MetaTileEntity_TesseractTerminal; + public class TesseractHelper { /** @@ -19,8 +21,8 @@ public class TesseractHelper { */ // Checks if a Generator is owned by a player. - public static final boolean isGeneratorOwnedByPlayer( - EntityPlayer player, GT_MetaTileEntity_TesseractGenerator generator) { + public static final boolean isGeneratorOwnedByPlayer(EntityPlayer player, + GT_MetaTileEntity_TesseractGenerator generator) { if (player == null) { Logger.WARNING("Failed. [isGeneratorOwnedByPlayer]"); return false; @@ -46,26 +48,25 @@ public class TesseractHelper { } // Saves A Generator to the Players UUID map along with the Freq. - public static final boolean setGeneratorOwnershipByPlayer( - EntityPlayer player, int freq, GT_MetaTileEntity_TesseractGenerator generator) { + public static final boolean setGeneratorOwnershipByPlayer(EntityPlayer player, int freq, + GT_MetaTileEntity_TesseractGenerator generator) { if (player == null) { return false; } UUID playerIdentifier = player.getUniqueID(); Logger.WARNING("Setting Generator on " + freq + " for " + player.getDisplayName() + "."); if (playerIdentifier != null) { - Map<Integer, GT_MetaTileEntity_TesseractGenerator> playerOwned = - sTesseractGeneratorOwnershipMap.get(playerIdentifier); + Map<Integer, GT_MetaTileEntity_TesseractGenerator> playerOwned = sTesseractGeneratorOwnershipMap + .get(playerIdentifier); if (playerOwned == null || playerOwned.isEmpty()) { - Map<Integer, GT_MetaTileEntity_TesseractGenerator> newOwnershipMap = - new HashMap<Integer, GT_MetaTileEntity_TesseractGenerator>(); + Map<Integer, GT_MetaTileEntity_TesseractGenerator> newOwnershipMap = new HashMap<Integer, GT_MetaTileEntity_TesseractGenerator>(); newOwnershipMap.put(freq, generator); sTesseractGeneratorOwnershipMap.put(playerIdentifier, newOwnershipMap); Logger.WARNING("Success! [Empty Map]"); return true; } else if (sTesseractGeneratorOwnershipMap.containsKey(playerIdentifier)) { - Map<Integer, GT_MetaTileEntity_TesseractGenerator> ownershipMap = - sTesseractGeneratorOwnershipMap.get(playerIdentifier); + Map<Integer, GT_MetaTileEntity_TesseractGenerator> ownershipMap = sTesseractGeneratorOwnershipMap + .get(playerIdentifier); if (!ownershipMap.containsKey(freq)) { ownershipMap.put(freq, generator); } @@ -127,8 +128,8 @@ public class TesseractHelper { */ // Checks if a Terminal is owned by a player. - public static final boolean isTerminalOwnedByPlayer( - EntityPlayer player, GT_MetaTileEntity_TesseractTerminal generator) { + public static final boolean isTerminalOwnedByPlayer(EntityPlayer player, + GT_MetaTileEntity_TesseractTerminal generator) { if (player == null) { return false; } @@ -148,26 +149,25 @@ public class TesseractHelper { } // Saves A Terminal to the Players UUID map along with the Freq. - public static final boolean setTerminalOwnershipByPlayer( - EntityPlayer player, int freq, GT_MetaTileEntity_TesseractTerminal generator) { + public static final boolean setTerminalOwnershipByPlayer(EntityPlayer player, int freq, + GT_MetaTileEntity_TesseractTerminal generator) { if (player == null) { return false; } UUID playerIdentifier = player.getUniqueID(); if (playerIdentifier != null) { Logger.WARNING("Setting Terminal on " + freq + " for " + player.getDisplayName() + "."); - Map<Integer, GT_MetaTileEntity_TesseractTerminal> playerOwned = - sTesseractTerminalOwnershipMap.get(playerIdentifier); + Map<Integer, GT_MetaTileEntity_TesseractTerminal> playerOwned = sTesseractTerminalOwnershipMap + .get(playerIdentifier); if (playerOwned == null || playerOwned.isEmpty()) { - Map<Integer, GT_MetaTileEntity_TesseractTerminal> newOwnershipMap = - new HashMap<Integer, GT_MetaTileEntity_TesseractTerminal>(); + Map<Integer, GT_MetaTileEntity_TesseractTerminal> newOwnershipMap = new HashMap<Integer, GT_MetaTileEntity_TesseractTerminal>(); newOwnershipMap.put(freq, generator); sTesseractTerminalOwnershipMap.put(playerIdentifier, newOwnershipMap); Logger.WARNING("Success! [Empty Map]"); return true; } else if (sTesseractTerminalOwnershipMap.containsKey(playerIdentifier)) { - Map<Integer, GT_MetaTileEntity_TesseractTerminal> ownershipMap = - sTesseractTerminalOwnershipMap.get(playerIdentifier); + Map<Integer, GT_MetaTileEntity_TesseractTerminal> ownershipMap = sTesseractTerminalOwnershipMap + .get(playerIdentifier); if (!ownershipMap.containsKey(freq)) { ownershipMap.put(freq, generator); } @@ -225,8 +225,8 @@ public class TesseractHelper { EntityPlayer player) { UUID playerIdentifier = player.getUniqueID(); if (!sTesseractGeneratorOwnershipMap.isEmpty() && playerIdentifier != null) { - Set<Entry<UUID, Map<Integer, GT_MetaTileEntity_TesseractGenerator>>> players = - sTesseractGeneratorOwnershipMap.entrySet(); + Set<Entry<UUID, Map<Integer, GT_MetaTileEntity_TesseractGenerator>>> players = sTesseractGeneratorOwnershipMap + .entrySet(); Iterator<Entry<UUID, Map<Integer, GT_MetaTileEntity_TesseractGenerator>>> i = players.iterator(); while (i.hasNext()) { Entry<UUID, Map<Integer, GT_MetaTileEntity_TesseractGenerator>> current = i.next(); @@ -242,8 +242,8 @@ public class TesseractHelper { EntityPlayer player) { UUID playerIdentifier = player.getUniqueID(); if (!sTesseractTerminalOwnershipMap.isEmpty() && playerIdentifier != null) { - Set<Entry<UUID, Map<Integer, GT_MetaTileEntity_TesseractTerminal>>> players = - sTesseractTerminalOwnershipMap.entrySet(); + Set<Entry<UUID, Map<Integer, GT_MetaTileEntity_TesseractTerminal>>> players = sTesseractTerminalOwnershipMap + .entrySet(); Iterator<Entry<UUID, Map<Integer, GT_MetaTileEntity_TesseractTerminal>>> i = players.iterator(); while (i.hasNext()) { Entry<UUID, Map<Integer, GT_MetaTileEntity_TesseractTerminal>> current = i.next(); diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/helpers/treefarm/TreeGenerator.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/helpers/treefarm/TreeGenerator.java index 1e45b7c60b..b9ba13fa3f 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/helpers/treefarm/TreeGenerator.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/helpers/treefarm/TreeGenerator.java @@ -1,12 +1,7 @@ package gtPlusPlus.xmod.gregtech.common.helpers.treefarm; -import gtPlusPlus.api.objects.Logger; -import gtPlusPlus.api.objects.data.AutoMap; -import gtPlusPlus.api.objects.minecraft.FakeBlockPos; -import gtPlusPlus.api.objects.minecraft.FakeWorld; -import gtPlusPlus.core.lib.CORE; -import gtPlusPlus.core.util.math.MathUtils; import java.util.Random; + import net.minecraft.block.Block; import net.minecraft.block.BlockSapling; import net.minecraft.block.material.Material; @@ -17,6 +12,13 @@ import net.minecraft.world.World; import net.minecraft.world.gen.feature.WorldGenAbstractTree; import net.minecraftforge.common.util.ForgeDirection; +import gtPlusPlus.api.objects.Logger; +import gtPlusPlus.api.objects.data.AutoMap; +import gtPlusPlus.api.objects.minecraft.FakeBlockPos; +import gtPlusPlus.api.objects.minecraft.FakeWorld; +import gtPlusPlus.core.lib.CORE; +import gtPlusPlus.core.util.math.MathUtils; + public class TreeGenerator { private static final FakeTreeInFakeWorldGenerator mTreeData; @@ -43,6 +45,7 @@ public class TreeGenerator { } public static class FakeTreeInFakeWorldGenerator extends WorldGenAbstractTree { + /** The minimum height of a generated tree. */ private final int minTreeHeight; /** True if this tree should grow Vines. */ @@ -64,8 +67,8 @@ public class TreeGenerator { this(4, 0, 0, false, 5000); } - public FakeTreeInFakeWorldGenerator( - int aMinHeight, int aWoodMeta, int aLeafMeta, boolean aVines, int aTreeCount) { + public FakeTreeInFakeWorldGenerator(int aMinHeight, int aWoodMeta, int aLeafMeta, boolean aVines, + int aTreeCount) { super(false); this.minTreeHeight = aMinHeight; this.metaWood = aWoodMeta; @@ -93,8 +96,7 @@ public class TreeGenerator { @Override protected boolean func_150523_a(Block p_150523_1_) { - return p_150523_1_.getMaterial() == Material.air - || p_150523_1_.getMaterial() == Material.leaves + return p_150523_1_.getMaterial() == Material.air || p_150523_1_.getMaterial() == Material.leaves || p_150523_1_ == Blocks.grass || p_150523_1_ == Blocks.dirt || p_150523_1_ == Blocks.log @@ -107,8 +109,7 @@ public class TreeGenerator { protected boolean isReplaceable(World world, int x, int y, int z) { FakeWorld aWorld = getWorld(); Block block = aWorld.getBlock(x, y, z); - return block.isAir(null, x, y, z) - || block.isLeaves(null, x, y, z) + return block.isAir(null, x, y, z) || block.isLeaves(null, x, y, z) || block.isWood(null, x, y, z) || func_150523_a(block); } @@ -201,12 +202,17 @@ public class TreeGenerator { FakeBlockPos aBlockToGrowPlantOn = aWorld.getBlockAtCoords(aWorldX, aWorldY - 1, aWorldZ); boolean isSoil = block2.canSustainPlant( - aWorld, aWorldX, aWorldY - 1, aWorldZ, ForgeDirection.UP, (BlockSapling) Blocks.sapling); + aWorld, + aWorldX, + aWorldY - 1, + aWorldZ, + ForgeDirection.UP, + (BlockSapling) Blocks.sapling); if ( - /*isSoil &&*/ aWorldY < 256 - l - 1) { + /* isSoil && */ aWorldY < 256 - l - 1) { Logger.WARNING("Stepping through generateTree [4]"); - aBlockToGrowPlantOn.onPlantGrow( - aWorld, aWorldX, aWorldY - 1, aWorldZ, aWorldX, aWorldY, aWorldZ); + aBlockToGrowPlantOn + .onPlantGrow(aWorld, aWorldX, aWorldY - 1, aWorldZ, aWorldX, aWorldY, aWorldZ); b0 = 3; byte b1 = 0; int l1; @@ -224,14 +230,18 @@ public class TreeGenerator { for (int k2 = aWorldZ - l1; k2 <= aWorldZ + l1; ++k2) { int l2 = k2 - aWorldZ; - if (Math.abs(j2) != l1 - || Math.abs(l2) != l1 + if (Math.abs(j2) != l1 || Math.abs(l2) != l1 || CORE.RANDOM.nextInt(2) != 0 && i3 != 0) { Block block1 = aWorld.getBlock(i2, k1, k2); if (block1.isAir(null, i2, k1, k2) || block1.isLeaves(null, i2, k1, k2)) { this.setBlockAndNotifyAdequately( - aWorld, i2, k1, k2, Blocks.leaves, this.metaLeaves); + aWorld, + i2, + k1, + k2, + Blocks.leaves, + this.metaLeaves); } } } @@ -245,31 +255,56 @@ public class TreeGenerator { if (block.isAir(null, aWorldX, aWorldY + k1, aWorldZ) || block.isLeaves(null, aWorldX, aWorldY + k1, aWorldZ)) { this.setBlockAndNotifyAdequately( - aWorld, aWorldX, aWorldY + k1, aWorldZ, Blocks.log, this.metaWood); + aWorld, + aWorldX, + aWorldY + k1, + aWorldZ, + Blocks.log, + this.metaWood); if (this.vinesGrow && k1 > 0) { if (CORE.RANDOM.nextInt(3) > 0 && aWorld.isAirBlock(aWorldX - 1, aWorldY + k1, aWorldZ)) { this.setBlockAndNotifyAdequately( - aWorld, aWorldX - 1, aWorldY + k1, aWorldZ, Blocks.vine, 8); + aWorld, + aWorldX - 1, + aWorldY + k1, + aWorldZ, + Blocks.vine, + 8); } if (CORE.RANDOM.nextInt(3) > 0 && aWorld.isAirBlock(aWorldX + 1, aWorldY + k1, aWorldZ)) { this.setBlockAndNotifyAdequately( - aWorld, aWorldX + 1, aWorldY + k1, aWorldZ, Blocks.vine, 2); + aWorld, + aWorldX + 1, + aWorldY + k1, + aWorldZ, + Blocks.vine, + 2); } if (CORE.RANDOM.nextInt(3) > 0 && aWorld.isAirBlock(aWorldX, aWorldY + k1, aWorldZ - 1)) { this.setBlockAndNotifyAdequately( - aWorld, aWorldX, aWorldY + k1, aWorldZ - 1, Blocks.vine, 1); + aWorld, + aWorldX, + aWorldY + k1, + aWorldZ - 1, + Blocks.vine, + 1); } if (CORE.RANDOM.nextInt(3) > 0 && aWorld.isAirBlock(aWorldX, aWorldY + k1, aWorldZ + 1)) { this.setBlockAndNotifyAdequately( - aWorld, aWorldX, aWorldY + k1, aWorldZ + 1, Blocks.vine, 4); + aWorld, + aWorldX, + aWorldY + k1, + aWorldZ + 1, + Blocks.vine, + 4); } } } @@ -286,26 +321,22 @@ public class TreeGenerator { for (j2 = aWorldZ - l1; j2 <= aWorldZ + l1; ++j2) { if (aWorld.getBlock(i2, k1, j2).isLeaves(null, i2, k1, j2)) { if (CORE.RANDOM.nextInt(4) == 0 - && aWorld.getBlock(i2 - 1, k1, j2) - .isAir(null, i2 - 1, k1, j2)) { + && aWorld.getBlock(i2 - 1, k1, j2).isAir(null, i2 - 1, k1, j2)) { this.growVines(aWorld, i2 - 1, k1, j2, 8); } if (CORE.RANDOM.nextInt(4) == 0 - && aWorld.getBlock(i2 + 1, k1, j2) - .isAir(null, i2 + 1, k1, j2)) { + && aWorld.getBlock(i2 + 1, k1, j2).isAir(null, i2 + 1, k1, j2)) { this.growVines(aWorld, i2 + 1, k1, j2, 2); } if (CORE.RANDOM.nextInt(4) == 0 - && aWorld.getBlock(i2, k1, j2 - 1) - .isAir(null, i2, k1, j2 - 1)) { + && aWorld.getBlock(i2, k1, j2 - 1).isAir(null, i2, k1, j2 - 1)) { this.growVines(aWorld, i2, k1, j2 - 1, 1); } if (CORE.RANDOM.nextInt(4) == 0 - && aWorld.getBlock(i2, k1, j2 + 1) - .isAir(null, i2, k1, j2 + 1)) { + && aWorld.getBlock(i2, k1, j2 + 1).isAir(null, i2, k1, j2 + 1)) { this.growVines(aWorld, i2, k1, j2 + 1, 4); } } @@ -361,8 +392,16 @@ public class TreeGenerator { protected void setBlockAndNotifyAdequately(FakeWorld aWorld, int aX, int aY, int aZ, Block aBlock, int aMeta) { if (aBlock != null && (aMeta >= 0 && aMeta <= Short.MAX_VALUE)) { - Logger.WARNING("Setting block " + aX + ", " + aY + ", " + aZ + " | " + aBlock.getLocalizedName() + " | " - + aMeta); + Logger.WARNING( + "Setting block " + aX + + ", " + + aY + + ", " + + aZ + + " | " + + aBlock.getLocalizedName() + + " | " + + aMeta); aWorld.setBlockAtCoords(aX, aY, aZ, aBlock, aMeta); // aOutputsFromGenerator.put(ItemUtils.simpleMetaStack(aBlock, aMeta, 1)); } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/items/MetaCustomCoverItem.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/items/MetaCustomCoverItem.java index 7012f6d0f7..4fe1fda076 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/items/MetaCustomCoverItem.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/items/MetaCustomCoverItem.java @@ -1,5 +1,18 @@ package gtPlusPlus.xmod.gregtech.common.items; +import java.util.List; + +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.IIcon; +import net.minecraft.world.World; + +import org.apache.commons.lang3.StringUtils; + import cpw.mods.fml.common.registry.GameRegistry; import gregtech.api.GregTech_API; import gregtech.api.interfaces.IIconContainer; @@ -13,16 +26,6 @@ import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.minecraft.ItemUtils; import gtPlusPlus.core.util.sys.KeyboardUtils; import gtPlusPlus.xmod.gregtech.common.covers.GTPP_Cover_ToggleVisual; -import java.util.List; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.IIcon; -import net.minecraft.world.World; -import org.apache.commons.lang3.StringUtils; public class MetaCustomCoverItem extends Item { @@ -32,8 +35,8 @@ public class MetaCustomCoverItem extends Item { protected final IIconContainer[] mTextures; private final short[][] mRGB; - public MetaCustomCoverItem( - String aModId, int aTextureCount, String aTextureSetName, IIconContainer[] aTextures, short[][] aRGB) { + public MetaCustomCoverItem(String aModId, int aTextureCount, String aTextureSetName, IIconContainer[] aTextures, + short[][] aRGB) { super(); icons = new IIcon[aTextureCount]; mModID = aModId; @@ -48,8 +51,13 @@ public class MetaCustomCoverItem extends Item { this.setMaxStackSize(1); GameRegistry.registerItem(this, unlocalizedName); registerCover(); - Logger.INFO("[Covers] Generated Custom covers for " + mModID + " using " + aTextureCount + " textures from " - + mTextureSetName + "."); + Logger.INFO( + "[Covers] Generated Custom covers for " + mModID + + " using " + + aTextureCount + + " textures from " + + mTextureSetName + + "."); } public boolean hide() { @@ -65,17 +73,15 @@ public class MetaCustomCoverItem extends Item { } GregTech_API.registerCover( thisStack, - new GT_MultiTexture(new ITexture[] {new GT_RenderedTexture(mTextures[i])}), + new GT_MultiTexture(new ITexture[] { new GT_RenderedTexture(mTextures[i]) }), new GTPP_Cover_ToggleVisual()); } } /* - * @Override public void registerIcons(IIconRegister reg) { for (int i = 0; i < - * icons.length; i++) { this.icons[i] = mTextures[i].getIcon(); } } - * - * @Override public IIcon getIconFromDamage(int meta) { return this.icons[meta]; - * } + * @Override public void registerIcons(IIconRegister reg) { for (int i = 0; i < icons.length; i++) { this.icons[i] = + * mTextures[i].getIcon(); } } + * @Override public IIcon getIconFromDamage(int meta) { return this.icons[meta]; } */ @Override @@ -92,8 +98,7 @@ public class MetaCustomCoverItem extends Item { @Override public String getItemStackDisplayName(final ItemStack tItem) { - return StringUtils.capitalize(mTextureSetName) + " (" + tItem.getItemDamage() - + ")"; // super.getItemStackDisplayName(tItem); + return StringUtils.capitalize(mTextureSetName) + " (" + tItem.getItemDamage() + ")"; // super.getItemStackDisplayName(tItem); } private static boolean createNBT(ItemStack rStack) { diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/items/MetaGeneratedGregtechItems.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/items/MetaGeneratedGregtechItems.java index 9ff348ddcc..4ccec0bb93 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/items/MetaGeneratedGregtechItems.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/items/MetaGeneratedGregtechItems.java @@ -2,6 +2,8 @@ package gtPlusPlus.xmod.gregtech.common.items; import static gtPlusPlus.core.util.Utils.getTcAspectStack; +import net.minecraft.item.EnumAction; + import gregtech.api.GregTech_API; import gregtech.api.enums.GT_Values; import gregtech.api.enums.Materials; @@ -35,7 +37,6 @@ import gtPlusPlus.xmod.gregtech.api.items.Gregtech_MetaItem_X32; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; import gtPlusPlus.xmod.gregtech.common.covers.GTPP_Cover_Overflow; import gtPlusPlus.xmod.gregtech.common.covers.GTPP_Cover_ToggleVisual; -import net.minecraft.item.EnumAction; public class MetaGeneratedGregtechItems extends Gregtech_MetaItem_X32 { @@ -46,7 +47,7 @@ public class MetaGeneratedGregtechItems extends Gregtech_MetaItem_X32 { } public MetaGeneratedGregtechItems() { - super("MU-metaitem.01", new OrePrefixes[] {null}); + super("MU-metaitem.01", new OrePrefixes[] { null }); } public void generateMetaItems() { @@ -59,60 +60,60 @@ public class MetaGeneratedGregtechItems extends Gregtech_MetaItem_X32 { Logger.INFO( "Gregtech 5.09 not found, using fallback components. (I like how I have to add compat to something I added first and had stolen.)"); GregtechItemList.Electric_Pump_LuV.set( - this.addItem(tLastID = 0, "Electric Pump (LuV)", "163920 L/sec (as Cover)", new Object[] { - getTcAspectStack(TC_Aspects.ELECTRUM, 1L), - getTcAspectStack(TC_Aspects.MACHINA, 1L), - getTcAspectStack(TC_Aspects.ITER, 1L), - getTcAspectStack(TC_Aspects.AQUA, 1L) - })); + this.addItem( + tLastID = 0, + "Electric Pump (LuV)", + "163920 L/sec (as Cover)", + new Object[] { getTcAspectStack(TC_Aspects.ELECTRUM, 1L), + getTcAspectStack(TC_Aspects.MACHINA, 1L), getTcAspectStack(TC_Aspects.ITER, 1L), + getTcAspectStack(TC_Aspects.AQUA, 1L) })); GregtechItemList.Electric_Pump_ZPM.set( - this.addItem(tLastID = 1, "Electric Pump (ZPM)", "655680 L/sec (as Cover)", new Object[] { - getTcAspectStack(TC_Aspects.ELECTRUM, 2L), - getTcAspectStack(TC_Aspects.MACHINA, 2L), - getTcAspectStack(TC_Aspects.ITER, 2L), - getTcAspectStack(TC_Aspects.AQUA, 2L) - })); + this.addItem( + tLastID = 1, + "Electric Pump (ZPM)", + "655680 L/sec (as Cover)", + new Object[] { getTcAspectStack(TC_Aspects.ELECTRUM, 2L), + getTcAspectStack(TC_Aspects.MACHINA, 2L), getTcAspectStack(TC_Aspects.ITER, 2L), + getTcAspectStack(TC_Aspects.AQUA, 2L) })); GregtechItemList.Electric_Pump_UV.set( - this.addItem(tLastID = 2, "Electric Pump (UV)", "2622720 L/sec (as Cover)", new Object[] { - getTcAspectStack(TC_Aspects.ELECTRUM, 4L), - getTcAspectStack(TC_Aspects.MACHINA, 4L), - getTcAspectStack(TC_Aspects.ITER, 4L), - getTcAspectStack(TC_Aspects.AQUA, 4L) - })); + this.addItem( + tLastID = 2, + "Electric Pump (UV)", + "2622720 L/sec (as Cover)", + new Object[] { getTcAspectStack(TC_Aspects.ELECTRUM, 4L), + getTcAspectStack(TC_Aspects.MACHINA, 4L), getTcAspectStack(TC_Aspects.ITER, 4L), + getTcAspectStack(TC_Aspects.AQUA, 4L) })); GregtechItemList.Electric_Pump_MAX.set( - this.addItem(tLastID = 3, "Electric Pump (MAX)", "10490880 L/sec (as Cover)", new Object[] { - getTcAspectStack(TC_Aspects.ELECTRUM, 8L), - getTcAspectStack(TC_Aspects.MACHINA, 8L), - getTcAspectStack(TC_Aspects.ITER, 8L), - getTcAspectStack(TC_Aspects.AQUA, 8L) - })); + this.addItem( + tLastID = 3, + "Electric Pump (MAX)", + "10490880 L/sec (as Cover)", + new Object[] { getTcAspectStack(TC_Aspects.ELECTRUM, 8L), + getTcAspectStack(TC_Aspects.MACHINA, 8L), getTcAspectStack(TC_Aspects.ITER, 8L), + getTcAspectStack(TC_Aspects.AQUA, 8L) })); GregTech_API.registerCover( GregtechItemList.Electric_Pump_LuV.get(1L), - new GT_MultiTexture(new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[5][0], - new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PUMP) - }), + new GT_MultiTexture( + new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[5][0], + new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PUMP) }), new GT_Cover_Pump(8196)); GregTech_API.registerCover( GregtechItemList.Electric_Pump_ZPM.get(1L), - new GT_MultiTexture(new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[6][0], - new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PUMP) - }), + new GT_MultiTexture( + new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[6][0], + new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PUMP) }), new GT_Cover_Pump(32768)); GregTech_API.registerCover( GregtechItemList.Electric_Pump_UV.get(1L), - new GT_MultiTexture(new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[7][0], - new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PUMP) - }), + new GT_MultiTexture( + new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[7][0], + new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PUMP) }), new GT_Cover_Pump(131072)); GregTech_API.registerCover( GregtechItemList.Electric_Pump_MAX.get(1L), - new GT_MultiTexture(new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[8][0], - new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PUMP) - }), + new GT_MultiTexture( + new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[8][0], + new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PUMP) }), new GT_Cover_Pump(524288)); // GT_ModHandler.addCraftingRecipe(GregtechItemList.Electric_Pump_LuV.get(1L), // //GT_ModHandler.RecipeBits.DISMANTLEABLE | //GT_ModHandler.RecipeBits.NOT_REMOVABLE | @@ -146,26 +147,38 @@ public class MetaGeneratedGregtechItems extends Gregtech_MetaItem_X32 { // OrePrefixes.cableGt01.get(Materials.Aluminium), Character.valueOf('P'), // OrePrefixes.pipeMedium.get(Materials.Titanium)}); tLastID = 4; - GregtechItemList.Electric_Motor_LuV.set(this.addItem(tLastID = 4, "Electric Motor (LuV)", "", new Object[] { - getTcAspectStack(TC_Aspects.ELECTRUM, 1L), - getTcAspectStack(TC_Aspects.MACHINA, 1L), - getTcAspectStack(TC_Aspects.MOTUS, 1L) - })); - GregtechItemList.Electric_Motor_ZPM.set(this.addItem(tLastID = 5, "Electric Motor (ZPM)", "", new Object[] { - getTcAspectStack(TC_Aspects.ELECTRUM, 2L), - getTcAspectStack(TC_Aspects.MACHINA, 2L), - getTcAspectStack(TC_Aspects.MOTUS, 2L) - })); - GregtechItemList.Electric_Motor_UV.set(this.addItem(tLastID = 6, "Electric Motor (UV)", "", new Object[] { - getTcAspectStack(TC_Aspects.ELECTRUM, 4L), - getTcAspectStack(TC_Aspects.MACHINA, 4L), - getTcAspectStack(TC_Aspects.MOTUS, 4L) - })); - GregtechItemList.Electric_Motor_MAX.set(this.addItem(tLastID = 7, "Electric Motor (MAX)", "", new Object[] { - getTcAspectStack(TC_Aspects.ELECTRUM, 8L), - getTcAspectStack(TC_Aspects.MACHINA, 8L), - getTcAspectStack(TC_Aspects.MOTUS, 8L) - })); + GregtechItemList.Electric_Motor_LuV.set( + this.addItem( + tLastID = 4, + "Electric Motor (LuV)", + "", + new Object[] { getTcAspectStack(TC_Aspects.ELECTRUM, 1L), + getTcAspectStack(TC_Aspects.MACHINA, 1L), + getTcAspectStack(TC_Aspects.MOTUS, 1L) })); + GregtechItemList.Electric_Motor_ZPM.set( + this.addItem( + tLastID = 5, + "Electric Motor (ZPM)", + "", + new Object[] { getTcAspectStack(TC_Aspects.ELECTRUM, 2L), + getTcAspectStack(TC_Aspects.MACHINA, 2L), + getTcAspectStack(TC_Aspects.MOTUS, 2L) })); + GregtechItemList.Electric_Motor_UV.set( + this.addItem( + tLastID = 6, + "Electric Motor (UV)", + "", + new Object[] { getTcAspectStack(TC_Aspects.ELECTRUM, 4L), + getTcAspectStack(TC_Aspects.MACHINA, 4L), + getTcAspectStack(TC_Aspects.MOTUS, 4L) })); + GregtechItemList.Electric_Motor_MAX.set( + this.addItem( + tLastID = 7, + "Electric Motor (MAX)", + "", + new Object[] { getTcAspectStack(TC_Aspects.ELECTRUM, 8L), + getTcAspectStack(TC_Aspects.MACHINA, 8L), + getTcAspectStack(TC_Aspects.MOTUS, 8L) })); // GT_ModHandler.addCraftingRecipe(GregtechItemList.Electric_Motor_LuV.get(1L), // //GT_ModHandler.RecipeBits.DISMANTLEABLE | //GT_ModHandler.RecipeBits.NOT_REMOVABLE | // //GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"CWR", "WIW", "RWC", Character.valueOf('I'), @@ -196,30 +209,34 @@ public class MetaGeneratedGregtechItems extends Gregtech_MetaItem_X32 { // OrePrefixes.cableGt01.get(Materials.Nichrome)}); tLastID = 8; - GregtechItemList.Conveyor_Module_LuV.set(this.addItem( - tLastID = 8, "Conveyor Module (LuV)", "1 Stack every 20 secs (as Cover)", new Object[] { - getTcAspectStack(TC_Aspects.ELECTRUM, 1L), - getTcAspectStack(TC_Aspects.MACHINA, 1L), - getTcAspectStack(TC_Aspects.ITER, 1L) - })); + GregtechItemList.Conveyor_Module_LuV.set( + this.addItem( + tLastID = 8, + "Conveyor Module (LuV)", + "1 Stack every 20 secs (as Cover)", + new Object[] { getTcAspectStack(TC_Aspects.ELECTRUM, 1L), + getTcAspectStack(TC_Aspects.MACHINA, 1L), getTcAspectStack(TC_Aspects.ITER, 1L) })); GregtechItemList.Conveyor_Module_ZPM.set( - this.addItem(tLastID = 9, "Conveyor Module (ZPM)", "1 Stack every 5 secs (as Cover)", new Object[] { - getTcAspectStack(TC_Aspects.ELECTRUM, 2L), - getTcAspectStack(TC_Aspects.MACHINA, 2L), - getTcAspectStack(TC_Aspects.ITER, 2L) - })); + this.addItem( + tLastID = 9, + "Conveyor Module (ZPM)", + "1 Stack every 5 secs (as Cover)", + new Object[] { getTcAspectStack(TC_Aspects.ELECTRUM, 2L), + getTcAspectStack(TC_Aspects.MACHINA, 2L), getTcAspectStack(TC_Aspects.ITER, 2L) })); GregtechItemList.Conveyor_Module_UV.set( - this.addItem(tLastID = 10, "Conveyor Module (UV)", "1 Stack every 1 sec (as Cover)", new Object[] { - getTcAspectStack(TC_Aspects.ELECTRUM, 4L), - getTcAspectStack(TC_Aspects.MACHINA, 4L), - getTcAspectStack(TC_Aspects.ITER, 4L) - })); - GregtechItemList.Conveyor_Module_MAX.set(this.addItem( - tLastID = 11, "Conveyor Module (MAX)", "1 Stack every 1/5 sec (as Cover)", new Object[] { - getTcAspectStack(TC_Aspects.ELECTRUM, 8L), - getTcAspectStack(TC_Aspects.MACHINA, 8L), - getTcAspectStack(TC_Aspects.ITER, 8L) - })); + this.addItem( + tLastID = 10, + "Conveyor Module (UV)", + "1 Stack every 1 sec (as Cover)", + new Object[] { getTcAspectStack(TC_Aspects.ELECTRUM, 4L), + getTcAspectStack(TC_Aspects.MACHINA, 4L), getTcAspectStack(TC_Aspects.ITER, 4L) })); + GregtechItemList.Conveyor_Module_MAX.set( + this.addItem( + tLastID = 11, + "Conveyor Module (MAX)", + "1 Stack every 1/5 sec (as Cover)", + new Object[] { getTcAspectStack(TC_Aspects.ELECTRUM, 8L), + getTcAspectStack(TC_Aspects.MACHINA, 8L), getTcAspectStack(TC_Aspects.ITER, 8L) })); // GT_ModHandler.addCraftingRecipe(GregtechItemList.Conveyor_Module_LuV.get(1L), // //GT_ModHandler.RecipeBits.DISMANTLEABLE | //GT_ModHandler.RecipeBits.NOT_REMOVABLE | // //GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"RRR", "MCM", "RRR", Character.valueOf('M'), @@ -244,57 +261,61 @@ public class MetaGeneratedGregtechItems extends Gregtech_MetaItem_X32 { // OrePrefixes.plate.get(Materials.Rubber)}); GregTech_API.registerCover( GregtechItemList.Conveyor_Module_LuV.get(1L), - new GT_MultiTexture(new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[1][0], - new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_CONVEYOR) - }), + new GT_MultiTexture( + new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[1][0], + new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_CONVEYOR) }), new GT_Cover_Conveyor(400)); GregTech_API.registerCover( GregtechItemList.Conveyor_Module_ZPM.get(1L), - new GT_MultiTexture(new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[2][0], - new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_CONVEYOR) - }), + new GT_MultiTexture( + new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[2][0], + new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_CONVEYOR) }), new GT_Cover_Conveyor(100)); GregTech_API.registerCover( GregtechItemList.Conveyor_Module_UV.get(1L), - new GT_MultiTexture(new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[3][0], - new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_CONVEYOR) - }), + new GT_MultiTexture( + new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[3][0], + new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_CONVEYOR) }), new GT_Cover_Conveyor(20)); GregTech_API.registerCover( GregtechItemList.Conveyor_Module_MAX.get(1L), - new GT_MultiTexture(new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[4][0], - new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_CONVEYOR) - }), + new GT_MultiTexture( + new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[4][0], + new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_CONVEYOR) }), new GT_Cover_Conveyor(4)); tLastID = 12; GregtechItemList.Electric_Piston_LuV.set( - this.addItem(tLastID = 12, "Electric Piston (LuV)", "", new Object[] { - getTcAspectStack(TC_Aspects.ELECTRUM, 1L), - getTcAspectStack(TC_Aspects.MACHINA, 2L), - getTcAspectStack(TC_Aspects.MOTUS, 1L) - })); + this.addItem( + tLastID = 12, + "Electric Piston (LuV)", + "", + new Object[] { getTcAspectStack(TC_Aspects.ELECTRUM, 1L), + getTcAspectStack(TC_Aspects.MACHINA, 2L), + getTcAspectStack(TC_Aspects.MOTUS, 1L) })); GregtechItemList.Electric_Piston_ZPM.set( - this.addItem(tLastID = 13, "Electric Piston (ZPM)", "", new Object[] { - getTcAspectStack(TC_Aspects.ELECTRUM, 2L), - getTcAspectStack(TC_Aspects.MACHINA, 4L), - getTcAspectStack(TC_Aspects.MOTUS, 2L) - })); + this.addItem( + tLastID = 13, + "Electric Piston (ZPM)", + "", + new Object[] { getTcAspectStack(TC_Aspects.ELECTRUM, 2L), + getTcAspectStack(TC_Aspects.MACHINA, 4L), + getTcAspectStack(TC_Aspects.MOTUS, 2L) })); GregtechItemList.Electric_Piston_UV.set( - this.addItem(tLastID = 14, "Electric Piston (UV)", "", new Object[] { - getTcAspectStack(TC_Aspects.ELECTRUM, 4L), - getTcAspectStack(TC_Aspects.MACHINA, 8L), - getTcAspectStack(TC_Aspects.MOTUS, 4L) - })); + this.addItem( + tLastID = 14, + "Electric Piston (UV)", + "", + new Object[] { getTcAspectStack(TC_Aspects.ELECTRUM, 4L), + getTcAspectStack(TC_Aspects.MACHINA, 8L), + getTcAspectStack(TC_Aspects.MOTUS, 4L) })); GregtechItemList.Electric_Piston_MAX.set( - this.addItem(tLastID = 15, "Electric Piston (MAX)", "", new Object[] { - getTcAspectStack(TC_Aspects.ELECTRUM, 8L), - getTcAspectStack(TC_Aspects.MACHINA, 16L), - getTcAspectStack(TC_Aspects.MOTUS, 8L) - })); + this.addItem( + tLastID = 15, + "Electric Piston (MAX)", + "", + new Object[] { getTcAspectStack(TC_Aspects.ELECTRUM, 8L), + getTcAspectStack(TC_Aspects.MACHINA, 16L), + getTcAspectStack(TC_Aspects.MOTUS, 8L) })); // GT_ModHandler.addCraftingRecipe(GregtechItemList.Electric_Piston_LuV.get(1L), // //GT_ModHandler.RecipeBits.DISMANTLEABLE | //GT_ModHandler.RecipeBits.NOT_REMOVABLE | // //GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"PPP", "CSS", "CMG", Character.valueOf('P'), @@ -325,34 +346,38 @@ public class MetaGeneratedGregtechItems extends Gregtech_MetaItem_X32 { // GregtechItemList.Electric_Motor_MAX, Character.valueOf('C'), // OrePrefixes.cableGt01.get(Materials.Aluminium)}); tLastID = 16; - GregtechItemList.Robot_Arm_LuV.set(this.addItem( - tLastID = 16, "Robot Arm (LuV)", "Inserts into specific Slots (as Cover)", new Object[] { - getTcAspectStack(TC_Aspects.ELECTRUM, 1L), - getTcAspectStack(TC_Aspects.MACHINA, 2L), - getTcAspectStack(TC_Aspects.MOTUS, 1L), - Utils.getTcAspectStack("COGNITIO", 1L) - })); - GregtechItemList.Robot_Arm_ZPM.set(this.addItem( - tLastID = 17, "Robot Arm (ZPM)", "Inserts into specific Slots (as Cover)", new Object[] { - getTcAspectStack(TC_Aspects.ELECTRUM, 2L), - getTcAspectStack(TC_Aspects.MACHINA, 4L), - getTcAspectStack(TC_Aspects.MOTUS, 2L), - getTcAspectStack("COGNITIO", 2L) - })); - GregtechItemList.Robot_Arm_UV.set(this.addItem( - tLastID = 18, "Robot Arm (UV)", "Inserts into specific Slots (as Cover)", new Object[] { - getTcAspectStack(TC_Aspects.ELECTRUM, 4L), - getTcAspectStack(TC_Aspects.MACHINA, 8L), - getTcAspectStack(TC_Aspects.MOTUS, 4L), - getTcAspectStack("COGNITIO", 4L) - })); - GregtechItemList.Robot_Arm_MAX.set(this.addItem( - tLastID = 19, "Robot Arm (MAX)", "Inserts into specific Slots (as Cover)", new Object[] { - getTcAspectStack(TC_Aspects.ELECTRUM, 8L), - getTcAspectStack(TC_Aspects.MACHINA, 16L), - getTcAspectStack(TC_Aspects.MOTUS, 8L), - getTcAspectStack("COGNITIO", 8L) - })); + GregtechItemList.Robot_Arm_LuV.set( + this.addItem( + tLastID = 16, + "Robot Arm (LuV)", + "Inserts into specific Slots (as Cover)", + new Object[] { getTcAspectStack(TC_Aspects.ELECTRUM, 1L), + getTcAspectStack(TC_Aspects.MACHINA, 2L), getTcAspectStack(TC_Aspects.MOTUS, 1L), + Utils.getTcAspectStack("COGNITIO", 1L) })); + GregtechItemList.Robot_Arm_ZPM.set( + this.addItem( + tLastID = 17, + "Robot Arm (ZPM)", + "Inserts into specific Slots (as Cover)", + new Object[] { getTcAspectStack(TC_Aspects.ELECTRUM, 2L), + getTcAspectStack(TC_Aspects.MACHINA, 4L), getTcAspectStack(TC_Aspects.MOTUS, 2L), + getTcAspectStack("COGNITIO", 2L) })); + GregtechItemList.Robot_Arm_UV.set( + this.addItem( + tLastID = 18, + "Robot Arm (UV)", + "Inserts into specific Slots (as Cover)", + new Object[] { getTcAspectStack(TC_Aspects.ELECTRUM, 4L), + getTcAspectStack(TC_Aspects.MACHINA, 8L), getTcAspectStack(TC_Aspects.MOTUS, 4L), + getTcAspectStack("COGNITIO", 4L) })); + GregtechItemList.Robot_Arm_MAX.set( + this.addItem( + tLastID = 19, + "Robot Arm (MAX)", + "Inserts into specific Slots (as Cover)", + new Object[] { getTcAspectStack(TC_Aspects.ELECTRUM, 8L), + getTcAspectStack(TC_Aspects.MACHINA, 16L), getTcAspectStack(TC_Aspects.MOTUS, 8L), + getTcAspectStack("COGNITIO", 8L) })); // GT_ModHandler.addCraftingRecipe(GregtechItemList.Robot_Arm_LuV.get(1L), // //GT_ModHandler.RecipeBits.DISMANTLEABLE | //GT_ModHandler.RecipeBits.NOT_REMOVABLE | // //GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"CCC", "MSM", "PES", Character.valueOf('S'), @@ -383,57 +408,61 @@ public class MetaGeneratedGregtechItems extends Gregtech_MetaItem_X32 { // OrePrefixes.cableGt01.get(Materials.Aluminium)}); GregTech_API.registerCover( GregtechItemList.Robot_Arm_LuV.get(1L), - new GT_MultiTexture(new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[1][0], - new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_ARM) - }), + new GT_MultiTexture( + new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[1][0], + new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_ARM) }), new GT_Cover_Arm(400)); GregTech_API.registerCover( GregtechItemList.Robot_Arm_ZPM.get(1L), - new GT_MultiTexture(new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[2][0], - new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_ARM) - }), + new GT_MultiTexture( + new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[2][0], + new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_ARM) }), new GT_Cover_Arm(100)); GregTech_API.registerCover( GregtechItemList.Robot_Arm_UV.get(1L), - new GT_MultiTexture(new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[3][0], - new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_ARM) - }), + new GT_MultiTexture( + new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[3][0], + new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_ARM) }), new GT_Cover_Arm(20)); GregTech_API.registerCover( GregtechItemList.Robot_Arm_MAX.get(1L), - new GT_MultiTexture(new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[4][0], - new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_ARM) - }), + new GT_MultiTexture( + new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[4][0], + new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_ARM) }), new GT_Cover_Arm(4)); tLastID = 20; GregtechItemList.Field_Generator_LuV.set( - this.addItem(tLastID = 20, "Field Generator (LuV)", "", new Object[] { - getTcAspectStack(TC_Aspects.ELECTRUM, 2L), - getTcAspectStack(TC_Aspects.MACHINA, 1L), - getTcAspectStack(TC_Aspects.TUTAMEN, 1L) - })); + this.addItem( + tLastID = 20, + "Field Generator (LuV)", + "", + new Object[] { getTcAspectStack(TC_Aspects.ELECTRUM, 2L), + getTcAspectStack(TC_Aspects.MACHINA, 1L), + getTcAspectStack(TC_Aspects.TUTAMEN, 1L) })); GregtechItemList.Field_Generator_ZPM.set( - this.addItem(tLastID = 21, "Field Generator (ZPM)", "", new Object[] { - getTcAspectStack(TC_Aspects.ELECTRUM, 4L), - getTcAspectStack(TC_Aspects.MACHINA, 2L), - getTcAspectStack(TC_Aspects.TUTAMEN, 2L) - })); + this.addItem( + tLastID = 21, + "Field Generator (ZPM)", + "", + new Object[] { getTcAspectStack(TC_Aspects.ELECTRUM, 4L), + getTcAspectStack(TC_Aspects.MACHINA, 2L), + getTcAspectStack(TC_Aspects.TUTAMEN, 2L) })); GregtechItemList.Field_Generator_UV.set( - this.addItem(tLastID = 22, "Field Generator (UV)", "", new Object[] { - getTcAspectStack(TC_Aspects.ELECTRUM, 8L), - getTcAspectStack(TC_Aspects.MACHINA, 4L), - getTcAspectStack(TC_Aspects.TUTAMEN, 4L) - })); + this.addItem( + tLastID = 22, + "Field Generator (UV)", + "", + new Object[] { getTcAspectStack(TC_Aspects.ELECTRUM, 8L), + getTcAspectStack(TC_Aspects.MACHINA, 4L), + getTcAspectStack(TC_Aspects.TUTAMEN, 4L) })); GregtechItemList.Field_Generator_MAX.set( - this.addItem(tLastID = 23, "Field Generator (MAX)", "", new Object[] { - getTcAspectStack(TC_Aspects.ELECTRUM, 16L), - getTcAspectStack(TC_Aspects.MACHINA, 8L), - getTcAspectStack(TC_Aspects.TUTAMEN, 8L) - })); + this.addItem( + tLastID = 23, + "Field Generator (MAX)", + "", + new Object[] { getTcAspectStack(TC_Aspects.ELECTRUM, 16L), + getTcAspectStack(TC_Aspects.MACHINA, 8L), + getTcAspectStack(TC_Aspects.TUTAMEN, 8L) })); // GT_ModHandler.addCraftingRecipe(GregtechItemList.Field_Generator_LuV.get(1L), // //GT_ModHandler.RecipeBits.DISMANTLEABLE | //GT_ModHandler.RecipeBits.NOT_REMOVABLE | // //GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"WCW", "CGC", "WCW", Character.valueOf('G'), @@ -458,26 +487,34 @@ public class MetaGeneratedGregtechItems extends Gregtech_MetaItem_X32 { // OrePrefixes.circuit.get(Materials.Elite), Character.valueOf('W'), // OrePrefixes.wireGt08.get(Materials.Osmium)}); tLastID = 24; - GregtechItemList.Emitter_LuV.set(this.addItem(tLastID = 24, "Emitter (LuV)", "", new Object[] { - getTcAspectStack(TC_Aspects.ELECTRUM, 1L), - getTcAspectStack(TC_Aspects.MACHINA, 1L), - getTcAspectStack(TC_Aspects.LUX, 1L) - })); - GregtechItemList.Emitter_ZPM.set(this.addItem(tLastID = 25, "Emitter (ZPM)", "", new Object[] { - getTcAspectStack(TC_Aspects.ELECTRUM, 2L), - getTcAspectStack(TC_Aspects.MACHINA, 2L), - getTcAspectStack(TC_Aspects.LUX, 2L) - })); - GregtechItemList.Emitter_UV.set(this.addItem(tLastID = 26, "Emitter (UV)", "", new Object[] { - getTcAspectStack(TC_Aspects.ELECTRUM, 4L), - getTcAspectStack(TC_Aspects.MACHINA, 4L), - getTcAspectStack(TC_Aspects.LUX, 4L) - })); - GregtechItemList.Emitter_MAX.set(this.addItem(tLastID = 27, "Emitter (MAX)", "", new Object[] { - getTcAspectStack(TC_Aspects.ELECTRUM, 8L), - getTcAspectStack(TC_Aspects.MACHINA, 8L), - getTcAspectStack(TC_Aspects.LUX, 8L) - })); + GregtechItemList.Emitter_LuV.set( + this.addItem( + tLastID = 24, + "Emitter (LuV)", + "", + new Object[] { getTcAspectStack(TC_Aspects.ELECTRUM, 1L), + getTcAspectStack(TC_Aspects.MACHINA, 1L), getTcAspectStack(TC_Aspects.LUX, 1L) })); + GregtechItemList.Emitter_ZPM.set( + this.addItem( + tLastID = 25, + "Emitter (ZPM)", + "", + new Object[] { getTcAspectStack(TC_Aspects.ELECTRUM, 2L), + getTcAspectStack(TC_Aspects.MACHINA, 2L), getTcAspectStack(TC_Aspects.LUX, 2L) })); + GregtechItemList.Emitter_UV.set( + this.addItem( + tLastID = 26, + "Emitter (UV)", + "", + new Object[] { getTcAspectStack(TC_Aspects.ELECTRUM, 4L), + getTcAspectStack(TC_Aspects.MACHINA, 4L), getTcAspectStack(TC_Aspects.LUX, 4L) })); + GregtechItemList.Emitter_MAX.set( + this.addItem( + tLastID = 27, + "Emitter (MAX)", + "", + new Object[] { getTcAspectStack(TC_Aspects.ELECTRUM, 8L), + getTcAspectStack(TC_Aspects.MACHINA, 8L), getTcAspectStack(TC_Aspects.LUX, 8L) })); // GT_ModHandler.addCraftingRecipe(GregtechItemList.Emitter_LuV.get(1L), // //GT_ModHandler.RecipeBits.DISMANTLEABLE | //GT_ModHandler.RecipeBits.NOT_REMOVABLE | // //GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"SSC", "WQS", "CWS", Character.valueOf('Q'), @@ -505,26 +542,38 @@ public class MetaGeneratedGregtechItems extends Gregtech_MetaItem_X32 { // OrePrefixes.circuit.get(Materials.Elite), Character.valueOf('W'), // OrePrefixes.cableGt01.get(Materials.Aluminium)}); tLastID = 28; - GregtechItemList.Sensor_LuV.set(this.addItem(tLastID = 28, "Sensor (LuV)", "", new Object[] { - getTcAspectStack(TC_Aspects.ELECTRUM, 1L), - getTcAspectStack(TC_Aspects.MACHINA, 1L), - getTcAspectStack(TC_Aspects.SENSUS, 1L) - })); - GregtechItemList.Sensor_ZPM.set(this.addItem(tLastID = 29, "Sensor (ZPM)", "", new Object[] { - getTcAspectStack(TC_Aspects.ELECTRUM, 2L), - getTcAspectStack(TC_Aspects.MACHINA, 2L), - getTcAspectStack(TC_Aspects.SENSUS, 2L) - })); - GregtechItemList.Sensor_UV.set(this.addItem(tLastID = 30, "Sensor (UV)", "", new Object[] { - getTcAspectStack(TC_Aspects.ELECTRUM, 4L), - getTcAspectStack(TC_Aspects.MACHINA, 4L), - getTcAspectStack(TC_Aspects.SENSUS, 4L) - })); - GregtechItemList.Sensor_MAX.set(this.addItem(tLastID = 31, "Sensor (MAX)", "", new Object[] { - getTcAspectStack(TC_Aspects.ELECTRUM, 8L), - getTcAspectStack(TC_Aspects.MACHINA, 8L), - getTcAspectStack(TC_Aspects.SENSUS, 8L) - })); + GregtechItemList.Sensor_LuV.set( + this.addItem( + tLastID = 28, + "Sensor (LuV)", + "", + new Object[] { getTcAspectStack(TC_Aspects.ELECTRUM, 1L), + getTcAspectStack(TC_Aspects.MACHINA, 1L), + getTcAspectStack(TC_Aspects.SENSUS, 1L) })); + GregtechItemList.Sensor_ZPM.set( + this.addItem( + tLastID = 29, + "Sensor (ZPM)", + "", + new Object[] { getTcAspectStack(TC_Aspects.ELECTRUM, 2L), + getTcAspectStack(TC_Aspects.MACHINA, 2L), + getTcAspectStack(TC_Aspects.SENSUS, 2L) })); + GregtechItemList.Sensor_UV.set( + this.addItem( + tLastID = 30, + "Sensor (UV)", + "", + new Object[] { getTcAspectStack(TC_Aspects.ELECTRUM, 4L), + getTcAspectStack(TC_Aspects.MACHINA, 4L), + getTcAspectStack(TC_Aspects.SENSUS, 4L) })); + GregtechItemList.Sensor_MAX.set( + this.addItem( + tLastID = 31, + "Sensor (MAX)", + "", + new Object[] { getTcAspectStack(TC_Aspects.ELECTRUM, 8L), + getTcAspectStack(TC_Aspects.MACHINA, 8L), + getTcAspectStack(TC_Aspects.SENSUS, 8L) })); // GT_ModHandler.addCraftingRecipe(GregtechItemList.Sensor_LuV.get(1L), // //GT_ModHandler.RecipeBits.DISMANTLEABLE | //GT_ModHandler.RecipeBits.NOT_REMOVABLE | // //GT_ModHandler.RecipeBits.REVERSIBLE, new Object[]{"P Q", "PS ", "CPP", Character.valueOf('Q'), @@ -562,96 +611,123 @@ public class MetaGeneratedGregtechItems extends Gregtech_MetaItem_X32 { } // Extruder Shape - GregtechItemList.Shape_Extruder_WindmillShaft.set( - this.addItem(tLastID = 40, "Extruder Shape (Shaft)", "Extruder Shape for making Windmill Shafts")); + GregtechItemList.Shape_Extruder_WindmillShaft + .set(this.addItem(tLastID = 40, "Extruder Shape (Shaft)", "Extruder Shape for making Windmill Shafts")); // GTNH Already adds this. if (!CORE.GTNH) { - GregtechItemList.Shape_Extruder_SmallGear.set( - this.addItem(221, "Extruder Shape (Small Gear)", "Extruder Shape for making small gears")); + GregtechItemList.Shape_Extruder_SmallGear + .set(this.addItem(221, "Extruder Shape (Small Gear)", "Extruder Shape for making small gears")); } // Batteries GregtechItemList.Battery_RE_EV_Sodium.set( - this.addItem(tLastID = 50, "Quad Cell Sodium Battery", "Reusable", new Object[] { - getTcAspectStack(TC_Aspects.ELECTRUM, 2L), - getTcAspectStack(TC_Aspects.METALLUM, 2L), - getTcAspectStack(TC_Aspects.POTENTIA, 2L) - })); + this.addItem( + tLastID = 50, + "Quad Cell Sodium Battery", + "Reusable", + new Object[] { getTcAspectStack(TC_Aspects.ELECTRUM, 2L), + getTcAspectStack(TC_Aspects.METALLUM, 2L), + getTcAspectStack(TC_Aspects.POTENTIA, 2L) })); this.setElectricStats(32000 + tLastID, 3200000L, GT_Values.V[4], 4L, -3L, true); GregtechItemList.Battery_RE_EV_Cadmium.set( - this.addItem(tLastID = 52, "Quad Cell Cadmium Battery", "Reusable", new Object[] { - getTcAspectStack(TC_Aspects.ELECTRUM, 1L), - getTcAspectStack(TC_Aspects.METALLUM, 1L), - getTcAspectStack(TC_Aspects.POTENTIA, 1L) - })); + this.addItem( + tLastID = 52, + "Quad Cell Cadmium Battery", + "Reusable", + new Object[] { getTcAspectStack(TC_Aspects.ELECTRUM, 1L), + getTcAspectStack(TC_Aspects.METALLUM, 1L), + getTcAspectStack(TC_Aspects.POTENTIA, 1L) })); this.setElectricStats(32000 + tLastID, 4800000L, GT_Values.V[4], 4L, -3L, true); GregtechItemList.Battery_RE_EV_Lithium.set( - this.addItem(tLastID = 54, "Quad Cell Lithium Battery", "Reusable", new Object[] { - getTcAspectStack(TC_Aspects.ELECTRUM, 3L), - getTcAspectStack(TC_Aspects.METALLUM, 3L), - getTcAspectStack(TC_Aspects.POTENTIA, 3L) - })); + this.addItem( + tLastID = 54, + "Quad Cell Lithium Battery", + "Reusable", + new Object[] { getTcAspectStack(TC_Aspects.ELECTRUM, 3L), + getTcAspectStack(TC_Aspects.METALLUM, 3L), + getTcAspectStack(TC_Aspects.POTENTIA, 3L) })); this.setElectricStats(32000 + tLastID, 6400000L, GT_Values.V[4], 4L, -3L, true); /** * Power Gems */ - GregtechItemList.Battery_Gem_1.set(this.addItem(tLastID = 66, "Proton Cell", "Reusable", new Object[] { - getTcAspectStack(TC_Aspects.ELECTRUM, 8L), - getTcAspectStack(TC_Aspects.METALLUM, 24L), - getTcAspectStack(TC_Aspects.POTENTIA, 16L) - })); + GregtechItemList.Battery_Gem_1.set( + this.addItem( + tLastID = 66, + "Proton Cell", + "Reusable", + new Object[] { getTcAspectStack(TC_Aspects.ELECTRUM, 8L), + getTcAspectStack(TC_Aspects.METALLUM, 24L), + getTcAspectStack(TC_Aspects.POTENTIA, 16L) })); this.setElectricStats(32000 + tLastID, GT_Values.V[6] * 20 * 300 / 4, GT_Values.V[6], 6L, -3L, false); - GregtechItemList.Battery_Gem_2.set(this.addItem(tLastID = 68, "Electron Cell", "Reusable", new Object[] { - getTcAspectStack(TC_Aspects.ELECTRUM, 16L), - getTcAspectStack(TC_Aspects.METALLUM, 32L), - getTcAspectStack(TC_Aspects.POTENTIA, 32L) - })); + GregtechItemList.Battery_Gem_2.set( + this.addItem( + tLastID = 68, + "Electron Cell", + "Reusable", + new Object[] { getTcAspectStack(TC_Aspects.ELECTRUM, 16L), + getTcAspectStack(TC_Aspects.METALLUM, 32L), + getTcAspectStack(TC_Aspects.POTENTIA, 32L) })); this.setElectricStats(32000 + tLastID, GT_Values.V[7] * 20 * 300 / 4, GT_Values.V[7], 7L, -3L, false); - GregtechItemList.Battery_Gem_3.set(this.addItem(tLastID = 70, "Quark Entanglement", "Reusable", new Object[] { - getTcAspectStack(TC_Aspects.ELECTRUM, 32L), - getTcAspectStack(TC_Aspects.METALLUM, 48L), - getTcAspectStack(TC_Aspects.POTENTIA, 64L) - })); + GregtechItemList.Battery_Gem_3.set( + this.addItem( + tLastID = 70, + "Quark Entanglement", + "Reusable", + new Object[] { getTcAspectStack(TC_Aspects.ELECTRUM, 32L), + getTcAspectStack(TC_Aspects.METALLUM, 48L), + getTcAspectStack(TC_Aspects.POTENTIA, 64L) })); this.setElectricStats(32000 + tLastID, GT_Values.V[8] * 20 * 300 / 4, GT_Values.V[8], 8L, -3L, false); // ItemUtils.addItemToOreDictionary(GregtechItemList.Battery_Gem_1.get(1), "batteryFutureBasic"); // ItemUtils.addItemToOreDictionary(GregtechItemList.Battery_Gem_2.get(1), "batteryFutureGood"); // ItemUtils.addItemToOreDictionary(GregtechItemList.Battery_Gem_3.get(1), "batteryFutureAdvanced"); - /*GregtechItemList.Battery_RE_EV_Sodium.set(addItem(tLastID = 50, "Quad Cell Acid Battery", "Reusable", new Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, 1L), getTcAspectStack(TC_Aspects.METALLUM, 1L), getTcAspectStack(TC_Aspects.POTENTIA, 1L)})); - setElectricStats(32000 + tLastID, 5000000L, GT_Values.V[2], 4L, -3L, true); - - GregtechItemList.Battery_RE_EV_Sodium.set(addItem(tLastID = 50, "Quad Cell Mercury Battery", "Reusable", new Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, 1L), getTcAspectStack(TC_Aspects.METALLUM, 1L), getTcAspectStack(TC_Aspects.POTENTIA, 1L)})); - setElectricStats(32000 + tLastID, 5000000L, GT_Values.V[2], 4L, -3L, true);*/ + /* + * GregtechItemList.Battery_RE_EV_Sodium.set(addItem(tLastID = 50, "Quad Cell Acid Battery", "Reusable", new + * Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, 1L), getTcAspectStack(TC_Aspects.METALLUM, 1L), + * getTcAspectStack(TC_Aspects.POTENTIA, 1L)})); setElectricStats(32000 + tLastID, 5000000L, GT_Values.V[2], 4L, + * -3L, true); GregtechItemList.Battery_RE_EV_Sodium.set(addItem(tLastID = 50, "Quad Cell Mercury Battery", + * "Reusable", new Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, 1L), getTcAspectStack(TC_Aspects.METALLUM, + * 1L), getTcAspectStack(TC_Aspects.POTENTIA, 1L)})); setElectricStats(32000 + tLastID, 5000000L, + * GT_Values.V[2], 4L, -3L, true); + */ // RTG Pellet GregtechItemList.Pellet_RTG_PU238.set( - this.addItem(41, StringUtils.superscript("238") + "Pu Pellet", "", new Object[] { - getTcAspectStack(TC_Aspects.RADIO, 4L), - getTcAspectStack(TC_Aspects.POTENTIA, 2L), - getTcAspectStack(TC_Aspects.METALLUM, 2L) - })); + this.addItem( + 41, + StringUtils.superscript("238") + "Pu Pellet", + "", + new Object[] { getTcAspectStack(TC_Aspects.RADIO, 4L), + getTcAspectStack(TC_Aspects.POTENTIA, 2L), + getTcAspectStack(TC_Aspects.METALLUM, 2L) })); GregtechItemList.Pellet_RTG_SR90.set( - this.addItem(42, StringUtils.superscript("90") + "Sr Pellet", "", new Object[] { - getTcAspectStack(TC_Aspects.RADIO, 4L), - getTcAspectStack(TC_Aspects.POTENTIA, 2L), - getTcAspectStack(TC_Aspects.METALLUM, 2L) - })); + this.addItem( + 42, + StringUtils.superscript("90") + "Sr Pellet", + "", + new Object[] { getTcAspectStack(TC_Aspects.RADIO, 4L), + getTcAspectStack(TC_Aspects.POTENTIA, 2L), + getTcAspectStack(TC_Aspects.METALLUM, 2L) })); GregtechItemList.Pellet_RTG_PO210.set( - this.addItem(43, StringUtils.superscript("210") + "Po Pellet", "", new Object[] { - getTcAspectStack(TC_Aspects.RADIO, 4L), - getTcAspectStack(TC_Aspects.POTENTIA, 2L), - getTcAspectStack(TC_Aspects.METALLUM, 2L) - })); + this.addItem( + 43, + StringUtils.superscript("210") + "Po Pellet", + "", + new Object[] { getTcAspectStack(TC_Aspects.RADIO, 4L), + getTcAspectStack(TC_Aspects.POTENTIA, 2L), + getTcAspectStack(TC_Aspects.METALLUM, 2L) })); GregtechItemList.Pellet_RTG_AM241.set( - this.addItem(44, StringUtils.superscript("241") + "Am Pellet", "", new Object[] { - getTcAspectStack(TC_Aspects.RADIO, 4L), - getTcAspectStack(TC_Aspects.POTENTIA, 2L), - getTcAspectStack(TC_Aspects.METALLUM, 2L) - })); + this.addItem( + 44, + StringUtils.superscript("241") + "Am Pellet", + "", + new Object[] { getTcAspectStack(TC_Aspects.RADIO, 4L), + getTcAspectStack(TC_Aspects.POTENTIA, 2L), + getTcAspectStack(TC_Aspects.METALLUM, 2L) })); CORE.RA.addFuelForRTG(GregtechItemList.Pellet_RTG_PU238.get(1), MathUtils.roundToClosestInt(87.7f), 64); CORE.RA.addFuelForRTG(GregtechItemList.Pellet_RTG_SR90.get(1), MathUtils.roundToClosestInt(28.8f), 32); @@ -661,193 +737,207 @@ public class MetaGeneratedGregtechItems extends Gregtech_MetaItem_X32 { // Computer Cube GregtechItemList.Gregtech_Computer_Cube.set( - this.addItem(tLastID = 55, "Gregtech Computer Cube", "Reusable", new Object[] { - getTcAspectStack(TC_Aspects.ELECTRUM, 8L), - getTcAspectStack(TC_Aspects.METALLUM, 8L), - getTcAspectStack(TC_Aspects.POTENTIA, 8L) - })); + this.addItem( + tLastID = 55, + "Gregtech Computer Cube", + "Reusable", + new Object[] { getTcAspectStack(TC_Aspects.ELECTRUM, 8L), + getTcAspectStack(TC_Aspects.METALLUM, 8L), + getTcAspectStack(TC_Aspects.POTENTIA, 8L) })); this.setElectricStats(32000 + tLastID, GT_Values.V[6] * 10 * 60 * 20, GT_Values.V[5], 5L, -3L, true); // FOOOOOOOOOOOOOOD GregtechItemList.Food_Baked_Raisin_Bread.set( - this.addItem(tLastID = 60, "Raisin Bread", "Extra Raisins, Just for ImQ009", new Object[] { - new GT_FoodStat(5, 0.5F, EnumAction.eat, null, false, true, false, new int[0]), - getTcAspectStack(TC_Aspects.CORPUS, 1L), - getTcAspectStack(TC_Aspects.FAMES, 1L), - getTcAspectStack(TC_Aspects.IGNIS, 1L) - })); + this.addItem( + tLastID = 60, + "Raisin Bread", + "Extra Raisins, Just for ImQ009", + new Object[] { new GT_FoodStat(5, 0.5F, EnumAction.eat, null, false, true, false, new int[0]), + getTcAspectStack(TC_Aspects.CORPUS, 1L), getTcAspectStack(TC_Aspects.FAMES, 1L), + getTcAspectStack(TC_Aspects.IGNIS, 1L) })); if (!CORE.GTNH) { - GregtechItemList.Fluid_Cell_144L.set(this.addItem( - tLastID = 61, "144L Invar Fluid Cell", "Holds exactly one dust worth of liquid.", new Object[] { - new ItemData( - Materials.Invar, - (OrePrefixes.plate.mMaterialAmount * 8L) + (4L * OrePrefixes.ring.mMaterialAmount), - new MaterialStack[0]), - getTcAspectStack(TC_Aspects.VACUOS, 2L), - getTcAspectStack(TC_Aspects.AQUA, 1L) - })); + GregtechItemList.Fluid_Cell_144L.set( + this.addItem( + tLastID = 61, + "144L Invar Fluid Cell", + "Holds exactly one dust worth of liquid.", + new Object[] { + new ItemData( + Materials.Invar, + (OrePrefixes.plate.mMaterialAmount * 8L) + + (4L * OrePrefixes.ring.mMaterialAmount), + new MaterialStack[0]), + getTcAspectStack(TC_Aspects.VACUOS, 2L), getTcAspectStack(TC_Aspects.AQUA, 1L) })); this.setFluidContainerStats(32000 + tLastID, 144L, 64L); - GregtechItemList.Fluid_Cell_36L.set(this.addItem( - tLastID = 62, - "36L Brass Fluid Cell", - "Holds exactly one small dust worth of liquid.", - new Object[] { - new ItemData( - Materials.Brass, - (OrePrefixes.plate.mMaterialAmount * 8L) + (4L * OrePrefixes.ring.mMaterialAmount), - new MaterialStack[0]), - getTcAspectStack(TC_Aspects.VACUOS, 2L), - getTcAspectStack(TC_Aspects.AQUA, 1L) - })); + GregtechItemList.Fluid_Cell_36L.set( + this.addItem( + tLastID = 62, + "36L Brass Fluid Cell", + "Holds exactly one small dust worth of liquid.", + new Object[] { + new ItemData( + Materials.Brass, + (OrePrefixes.plate.mMaterialAmount * 8L) + + (4L * OrePrefixes.ring.mMaterialAmount), + new MaterialStack[0]), + getTcAspectStack(TC_Aspects.VACUOS, 2L), getTcAspectStack(TC_Aspects.AQUA, 1L) })); this.setFluidContainerStats(32000 + tLastID, 36L, 64L); - GregtechItemList.Fluid_Cell_16L.set(this.addItem( - tLastID = 63, - "16L Bronze Fluid Cell", - "Holds exactly one tiny dust / nugget worth of liquid.", - new Object[] { - new ItemData( - Materials.Bronze, - (OrePrefixes.plate.mMaterialAmount * 8L) + (4L * OrePrefixes.ring.mMaterialAmount), - new MaterialStack[0]), - getTcAspectStack(TC_Aspects.VACUOS, 2L), - getTcAspectStack(TC_Aspects.AQUA, 1L) - })); + GregtechItemList.Fluid_Cell_16L.set( + this.addItem( + tLastID = 63, + "16L Bronze Fluid Cell", + "Holds exactly one tiny dust / nugget worth of liquid.", + new Object[] { + new ItemData( + Materials.Bronze, + (OrePrefixes.plate.mMaterialAmount * 8L) + + (4L * OrePrefixes.ring.mMaterialAmount), + new MaterialStack[0]), + getTcAspectStack(TC_Aspects.VACUOS, 2L), getTcAspectStack(TC_Aspects.AQUA, 1L) })); this.setFluidContainerStats(32000 + tLastID, 16L, 64L); - GregtechItemList.Fluid_Cell_1L.set(this.addItem( - tLastID = 64, - "1L Wrought Iron Fluid Cell", - "Holds exactly one litre worth of liquid.", - new Object[] { - new ItemData( - Materials.WroughtIron, - (OrePrefixes.plate.mMaterialAmount * 8L) + (4L * OrePrefixes.ring.mMaterialAmount), - new MaterialStack[0]), - getTcAspectStack(TC_Aspects.VACUOS, 2L), - getTcAspectStack(TC_Aspects.AQUA, 1L) - })); + GregtechItemList.Fluid_Cell_1L.set( + this.addItem( + tLastID = 64, + "1L Wrought Iron Fluid Cell", + "Holds exactly one litre worth of liquid.", + new Object[] { + new ItemData( + Materials.WroughtIron, + (OrePrefixes.plate.mMaterialAmount * 8L) + + (4L * OrePrefixes.ring.mMaterialAmount), + new MaterialStack[0]), + getTcAspectStack(TC_Aspects.VACUOS, 2L), getTcAspectStack(TC_Aspects.AQUA, 1L) })); this.setFluidContainerStats(32000 + tLastID, 1L, 64L); } GregtechItemList.Cover_Overflow_ULV.set( - this.addItem(71, "Overflow Valve (ULV)", "Maximum void amount: 8000", new Object[] { - getTcAspectStack(TC_Aspects.ELECTRUM, 1L), - getTcAspectStack(TC_Aspects.MACHINA, 1L), - getTcAspectStack(TC_Aspects.ITER, 1L), - getTcAspectStack(TC_Aspects.AQUA, 1L) - })); + this.addItem( + 71, + "Overflow Valve (ULV)", + "Maximum void amount: 8000", + new Object[] { getTcAspectStack(TC_Aspects.ELECTRUM, 1L), + getTcAspectStack(TC_Aspects.MACHINA, 1L), getTcAspectStack(TC_Aspects.ITER, 1L), + getTcAspectStack(TC_Aspects.AQUA, 1L) })); GregtechItemList.Cover_Overflow_LV.set( - this.addItem(72, "Overflow Valve (LV)", "Maximum void amount: 64000", new Object[] { - getTcAspectStack(TC_Aspects.ELECTRUM, 1L), - getTcAspectStack(TC_Aspects.MACHINA, 1L), - getTcAspectStack(TC_Aspects.ITER, 1L), - getTcAspectStack(TC_Aspects.AQUA, 1L) - })); + this.addItem( + 72, + "Overflow Valve (LV)", + "Maximum void amount: 64000", + new Object[] { getTcAspectStack(TC_Aspects.ELECTRUM, 1L), + getTcAspectStack(TC_Aspects.MACHINA, 1L), getTcAspectStack(TC_Aspects.ITER, 1L), + getTcAspectStack(TC_Aspects.AQUA, 1L) })); GregtechItemList.Cover_Overflow_MV.set( - this.addItem(73, "Overflow Valve (MV)", "Maximum void amount: 512000", new Object[] { - getTcAspectStack(TC_Aspects.ELECTRUM, 1L), - getTcAspectStack(TC_Aspects.MACHINA, 1L), - getTcAspectStack(TC_Aspects.ITER, 1L), - getTcAspectStack(TC_Aspects.AQUA, 1L) - })); + this.addItem( + 73, + "Overflow Valve (MV)", + "Maximum void amount: 512000", + new Object[] { getTcAspectStack(TC_Aspects.ELECTRUM, 1L), + getTcAspectStack(TC_Aspects.MACHINA, 1L), getTcAspectStack(TC_Aspects.ITER, 1L), + getTcAspectStack(TC_Aspects.AQUA, 1L) })); GregtechItemList.Cover_Overflow_HV.set( - this.addItem(74, "Overflow Valve (HV)", "Maximum void amount: 4096000", new Object[] { - getTcAspectStack(TC_Aspects.ELECTRUM, 1L), - getTcAspectStack(TC_Aspects.MACHINA, 1L), - getTcAspectStack(TC_Aspects.ITER, 1L), - getTcAspectStack(TC_Aspects.AQUA, 1L) - })); + this.addItem( + 74, + "Overflow Valve (HV)", + "Maximum void amount: 4096000", + new Object[] { getTcAspectStack(TC_Aspects.ELECTRUM, 1L), + getTcAspectStack(TC_Aspects.MACHINA, 1L), getTcAspectStack(TC_Aspects.ITER, 1L), + getTcAspectStack(TC_Aspects.AQUA, 1L) })); GregtechItemList.Cover_Overflow_EV.set( - this.addItem(75, "Overflow Valve (EV)", "Maximum void amount: 32768000", new Object[] { - getTcAspectStack(TC_Aspects.ELECTRUM, 1L), - getTcAspectStack(TC_Aspects.MACHINA, 1L), - getTcAspectStack(TC_Aspects.ITER, 1L), - getTcAspectStack(TC_Aspects.AQUA, 1L) - })); + this.addItem( + 75, + "Overflow Valve (EV)", + "Maximum void amount: 32768000", + new Object[] { getTcAspectStack(TC_Aspects.ELECTRUM, 1L), + getTcAspectStack(TC_Aspects.MACHINA, 1L), getTcAspectStack(TC_Aspects.ITER, 1L), + getTcAspectStack(TC_Aspects.AQUA, 1L) })); GregtechItemList.Cover_Overflow_IV.set( - this.addItem(76, "Overflow Valve (IV)", "Maximum void amount: 262144000", new Object[] { - getTcAspectStack(TC_Aspects.ELECTRUM, 1L), - getTcAspectStack(TC_Aspects.MACHINA, 1L), - getTcAspectStack(TC_Aspects.ITER, 1L), - getTcAspectStack(TC_Aspects.AQUA, 1L) - })); + this.addItem( + 76, + "Overflow Valve (IV)", + "Maximum void amount: 262144000", + new Object[] { getTcAspectStack(TC_Aspects.ELECTRUM, 1L), + getTcAspectStack(TC_Aspects.MACHINA, 1L), getTcAspectStack(TC_Aspects.ITER, 1L), + getTcAspectStack(TC_Aspects.AQUA, 1L) })); GregTech_API.registerCover( GregtechItemList.Cover_Overflow_ULV.get(1L), - new GT_MultiTexture(new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[4][0], - new GT_RenderedTexture(TexturesGtBlock.Overlay_Overflow_Valve) - }), + new GT_MultiTexture( + new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[4][0], + new GT_RenderedTexture(TexturesGtBlock.Overlay_Overflow_Valve) }), new GTPP_Cover_Overflow(8)); GregTech_API.registerCover( GregtechItemList.Cover_Overflow_LV.get(1L), - new GT_MultiTexture(new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[4][0], - new GT_RenderedTexture(TexturesGtBlock.Overlay_Overflow_Valve) - }), + new GT_MultiTexture( + new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[4][0], + new GT_RenderedTexture(TexturesGtBlock.Overlay_Overflow_Valve) }), new GTPP_Cover_Overflow(64)); GregTech_API.registerCover( GregtechItemList.Cover_Overflow_MV.get(1L), - new GT_MultiTexture(new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[5][0], - new GT_RenderedTexture(TexturesGtBlock.Overlay_Overflow_Valve) - }), + new GT_MultiTexture( + new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[5][0], + new GT_RenderedTexture(TexturesGtBlock.Overlay_Overflow_Valve) }), new GTPP_Cover_Overflow(512)); GregTech_API.registerCover( GregtechItemList.Cover_Overflow_HV.get(1L), - new GT_MultiTexture(new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[5][0], - new GT_RenderedTexture(TexturesGtBlock.Overlay_Overflow_Valve) - }), + new GT_MultiTexture( + new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[5][0], + new GT_RenderedTexture(TexturesGtBlock.Overlay_Overflow_Valve) }), new GTPP_Cover_Overflow(4096)); GregTech_API.registerCover( GregtechItemList.Cover_Overflow_EV.get(1L), - new GT_MultiTexture(new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[8][0], - new GT_RenderedTexture(TexturesGtBlock.Overlay_Overflow_Valve) - }), + new GT_MultiTexture( + new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[8][0], + new GT_RenderedTexture(TexturesGtBlock.Overlay_Overflow_Valve) }), new GTPP_Cover_Overflow(32768)); GregTech_API.registerCover( GregtechItemList.Cover_Overflow_IV.get(1L), - new GT_MultiTexture(new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[8][0], - new GT_RenderedTexture(TexturesGtBlock.Overlay_Overflow_Valve) - }), + new GT_MultiTexture( + new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[8][0], + new GT_RenderedTexture(TexturesGtBlock.Overlay_Overflow_Valve) }), new GTPP_Cover_Overflow(262144)); // Fusion Reactor MK4 Singularity - GregtechItemList.Compressed_Fusion_Reactor.set(this.addItem( - 100, "Hypervisor Matrix (Fusion)", "A memory unit containing an RI (Restricted Intelligence)")); + GregtechItemList.Compressed_Fusion_Reactor.set( + this.addItem( + 100, + "Hypervisor Matrix (Fusion)", + "A memory unit containing an RI (Restricted Intelligence)")); // NanoTubes - GregtechItemList.NanoTube_Base_Substrate.set( - this.addItem(101, "Silicon Base Substrate", "Used in the production of Carbon Nanotubes")); + GregtechItemList.NanoTube_Base_Substrate + .set(this.addItem(101, "Silicon Base Substrate", "Used in the production of Carbon Nanotubes")); GregtechItemList.NanoTube_Finished.set( this.addItem(102, "Carbon Nanotubes", "Multi-walled Zigzag nanotubes, possibly Carbon's final form")); - GregtechItemList.Carbyne_Tube_Finished.set(this.addItem( - 103, - "Linear Acetylenic Carbon (LAC/Carbyne)", - "LAC chains grown inside Multi-walled Carbon Nanotubes, highly stable")); - GregtechItemList.Carbyne_Sheet_Finished.set(this.addItem( - 104, - "Carbyne Composite Panel", - "Nanotubes which contain LAC, arranged side by side and compressed further")); - GregtechItemList.Laser_Lens_Special.set( - this.addItem(105, "Quantum Anomaly", "Probably should shoot it with lasers")); + GregtechItemList.Carbyne_Tube_Finished.set( + this.addItem( + 103, + "Linear Acetylenic Carbon (LAC/Carbyne)", + "LAC chains grown inside Multi-walled Carbon Nanotubes, highly stable")); + GregtechItemList.Carbyne_Sheet_Finished.set( + this.addItem( + 104, + "Carbyne Composite Panel", + "Nanotubes which contain LAC, arranged side by side and compressed further")); + GregtechItemList.Laser_Lens_Special + .set(this.addItem(105, "Quantum Anomaly", "Probably should shoot it with lasers")); GregtechItemList.Battery_Casing_Gem_1.set(this.addItem(106, "Containment Unit I", "Used in crafting")); GregtechItemList.Battery_Casing_Gem_2.set(this.addItem(107, "Containment Unit II", "Used in crafting")); GregtechItemList.Battery_Casing_Gem_3.set(this.addItem(108, "Advanced Containment Unit", "Used in crafting")); GregtechItemList.Battery_Casing_Gem_4.set(this.addItem(109, "Exotic Containment Unit", "Used in crafting")); - GregtechItemList.Battery_Gem_4.set(this.addItem(tLastID = 110, "Graviton Anomaly", "Reusable", new Object[] { - getTcAspectStack(TC_Aspects.ELECTRUM, 64L), - getTcAspectStack(TC_Aspects.METALLUM, 64L), - getTcAspectStack(TC_Aspects.POTENTIA, 64L) - })); + GregtechItemList.Battery_Gem_4.set( + this.addItem( + tLastID = 110, + "Graviton Anomaly", + "Reusable", + new Object[] { getTcAspectStack(TC_Aspects.ELECTRUM, 64L), + getTcAspectStack(TC_Aspects.METALLUM, 64L), + getTcAspectStack(TC_Aspects.POTENTIA, 64L) })); this.setElectricStats(32000 + tLastID, (64000000000L * 16), GT_Values.V[9], 9L, -3L, false); /* @@ -855,8 +945,8 @@ public class MetaGeneratedGregtechItems extends Gregtech_MetaItem_X32 { */ GregtechItemList.Bomb_Cast.set(this.addItem(111, "Bomb Cast", "Used in the production of Bombs")); GregtechItemList.Bomb_Cast_Molten.set(this.addItem(112, "Bomb Cast (Hot)", "Consider cooling this off")); - GregtechItemList.Bomb_Cast_Set.set( - this.addItem(113, "Bomb Cast (Set)", "Break it open for the goodies inside!")); + GregtechItemList.Bomb_Cast_Set + .set(this.addItem(113, "Bomb Cast (Set)", "Break it open for the goodies inside!")); GregtechItemList.Bomb_Cast_Broken.set(this.addItem(114, "Bomb Cast (Broken)", "This is probably just junk")); GregtechItemList.Bomb_Cast_Mold.set(this.addItem(115, "Mold (Bomb Cast)", "Used in the production of Bombs")); @@ -864,255 +954,311 @@ public class MetaGeneratedGregtechItems extends Gregtech_MetaItem_X32 { * High Tier 'Saws' for the tree Farm */ GregtechItemList.Farm_Processor_EV.set( - this.addItem(tLastID = 120, "Farm Processor [EV]", "Reusable", new Object[] { - getTcAspectStack(TC_Aspects.ELECTRUM, 8L), - getTcAspectStack(TC_Aspects.METALLUM, 8L), - getTcAspectStack(TC_Aspects.POTENTIA, 8L) - })); + this.addItem( + tLastID = 120, + "Farm Processor [EV]", + "Reusable", + new Object[] { getTcAspectStack(TC_Aspects.ELECTRUM, 8L), + getTcAspectStack(TC_Aspects.METALLUM, 8L), + getTcAspectStack(TC_Aspects.POTENTIA, 8L) })); this.setElectricStats(32000 + tLastID, GT_Values.V[5] * 10 * 60 * 20, GT_Values.V[4], 4L, -3L, false); GregtechItemList.Farm_Processor_IV.set( - this.addItem(tLastID = 122, "Farm Processor [IV]", "Reusable", new Object[] { - getTcAspectStack(TC_Aspects.ELECTRUM, 8L), - getTcAspectStack(TC_Aspects.METALLUM, 8L), - getTcAspectStack(TC_Aspects.POTENTIA, 8L) - })); + this.addItem( + tLastID = 122, + "Farm Processor [IV]", + "Reusable", + new Object[] { getTcAspectStack(TC_Aspects.ELECTRUM, 8L), + getTcAspectStack(TC_Aspects.METALLUM, 8L), + getTcAspectStack(TC_Aspects.POTENTIA, 8L) })); this.setElectricStats(32000 + tLastID, GT_Values.V[6] * 10 * 60 * 20, GT_Values.V[5], 5L, -3L, false); GregtechItemList.Farm_Processor_LuV.set( - this.addItem(tLastID = 124, "Farm Processor [LuV]", "Reusable", new Object[] { - getTcAspectStack(TC_Aspects.ELECTRUM, 8L), - getTcAspectStack(TC_Aspects.METALLUM, 8L), - getTcAspectStack(TC_Aspects.POTENTIA, 8L) - })); + this.addItem( + tLastID = 124, + "Farm Processor [LuV]", + "Reusable", + new Object[] { getTcAspectStack(TC_Aspects.ELECTRUM, 8L), + getTcAspectStack(TC_Aspects.METALLUM, 8L), + getTcAspectStack(TC_Aspects.POTENTIA, 8L) })); this.setElectricStats(32000 + tLastID, GT_Values.V[7] * 10 * 60 * 20, GT_Values.V[6], 6L, -3L, false); GregtechItemList.Farm_Processor_ZPM.set( - this.addItem(tLastID = 126, "Farm Processor [ZPM]", "Reusable", new Object[] { - getTcAspectStack(TC_Aspects.ELECTRUM, 8L), - getTcAspectStack(TC_Aspects.METALLUM, 8L), - getTcAspectStack(TC_Aspects.POTENTIA, 8L) - })); + this.addItem( + tLastID = 126, + "Farm Processor [ZPM]", + "Reusable", + new Object[] { getTcAspectStack(TC_Aspects.ELECTRUM, 8L), + getTcAspectStack(TC_Aspects.METALLUM, 8L), + getTcAspectStack(TC_Aspects.POTENTIA, 8L) })); this.setElectricStats(32000 + tLastID, GT_Values.V[8] * 10 * 60 * 20, GT_Values.V[7], 7L, -3L, false); GregtechItemList.Farm_Processor_UV.set( - this.addItem(tLastID = 128, "Farm Processor [UV]", "Reusable", new Object[] { - getTcAspectStack(TC_Aspects.ELECTRUM, 8L), - getTcAspectStack(TC_Aspects.METALLUM, 8L), - getTcAspectStack(TC_Aspects.POTENTIA, 8L) - })); + this.addItem( + tLastID = 128, + "Farm Processor [UV]", + "Reusable", + new Object[] { getTcAspectStack(TC_Aspects.ELECTRUM, 8L), + getTcAspectStack(TC_Aspects.METALLUM, 8L), + getTcAspectStack(TC_Aspects.POTENTIA, 8L) })); this.setElectricStats(32000 + tLastID, GT_Values.V[9] * 10 * 60 * 20, GT_Values.V[8], 8L, -3L, false); String aTierName; int aFirstMachineCasingID = 130; - GregtechItemList[] mMachineCasingCovers = new GregtechItemList[] { - GregtechItemList.FakeMachineCasingPlate_ULV, - GregtechItemList.FakeMachineCasingPlate_LV, - GregtechItemList.FakeMachineCasingPlate_MV, - GregtechItemList.FakeMachineCasingPlate_HV, - GregtechItemList.FakeMachineCasingPlate_EV, - GregtechItemList.FakeMachineCasingPlate_IV, - GregtechItemList.FakeMachineCasingPlate_LuV, - GregtechItemList.FakeMachineCasingPlate_ZPM, - GregtechItemList.FakeMachineCasingPlate_UV, - GregtechItemList.FakeMachineCasingPlate_MAX, - }; + GregtechItemList[] mMachineCasingCovers = new GregtechItemList[] { GregtechItemList.FakeMachineCasingPlate_ULV, + GregtechItemList.FakeMachineCasingPlate_LV, GregtechItemList.FakeMachineCasingPlate_MV, + GregtechItemList.FakeMachineCasingPlate_HV, GregtechItemList.FakeMachineCasingPlate_EV, + GregtechItemList.FakeMachineCasingPlate_IV, GregtechItemList.FakeMachineCasingPlate_LuV, + GregtechItemList.FakeMachineCasingPlate_ZPM, GregtechItemList.FakeMachineCasingPlate_UV, + GregtechItemList.FakeMachineCasingPlate_MAX, }; for (int i = 0; i < 10; i++) { if (i == 10) { break; } else { aTierName = GT_Values.VN[i]; - mMachineCasingCovers[i].set(this.addItem( - aFirstMachineCasingID++, - aTierName + " Machine Plate Cover", - "Deprecated - Shapeless Craft to new version", - new Object[] {})); + mMachineCasingCovers[i].set( + this.addItem( + aFirstMachineCasingID++, + aTierName + " Machine Plate Cover", + "Deprecated - Shapeless Craft to new version", + new Object[] {})); GregTech_API.registerCover( mMachineCasingCovers[i].get(1L), - new GT_MultiTexture(new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[i][0]}), + new GT_MultiTexture(new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[i][0] }), new GTPP_Cover_ToggleVisual()); } } - GregtechItemList.Laser_Lens_WoodsGlass.set(this.addItem( - 140, "Wood's Glass Lens", "Allows UV & IF to pass through, blocks visible light spectrums")); + GregtechItemList.Laser_Lens_WoodsGlass.set( + this.addItem( + 140, + "Wood's Glass Lens", + "Allows UV & IF to pass through, blocks visible light spectrums")); int aStartID = 141; - GregtechItemList[] aTransParts = new GregtechItemList[] { - GregtechItemList.TransmissionComponent_ULV, - GregtechItemList.TransmissionComponent_LV, - GregtechItemList.TransmissionComponent_MV, - GregtechItemList.TransmissionComponent_HV, - GregtechItemList.TransmissionComponent_EV, - GregtechItemList.TransmissionComponent_IV, - GregtechItemList.TransmissionComponent_LuV, - GregtechItemList.TransmissionComponent_ZPM, - GregtechItemList.TransmissionComponent_UV, - GregtechItemList.TransmissionComponent_MAX, - }; + GregtechItemList[] aTransParts = new GregtechItemList[] { GregtechItemList.TransmissionComponent_ULV, + GregtechItemList.TransmissionComponent_LV, GregtechItemList.TransmissionComponent_MV, + GregtechItemList.TransmissionComponent_HV, GregtechItemList.TransmissionComponent_EV, + GregtechItemList.TransmissionComponent_IV, GregtechItemList.TransmissionComponent_LuV, + GregtechItemList.TransmissionComponent_ZPM, GregtechItemList.TransmissionComponent_UV, + GregtechItemList.TransmissionComponent_MAX, }; for (int aIndex = 0; aIndex < 10; aIndex++) { aTransParts[aIndex].set( - this.addItem(aStartID++, "Transmission Component (" + GT_Values.VN[aIndex] + ")", "", new Object[] { - getTcAspectStack(TC_Aspects.ELECTRUM, aIndex), - getTcAspectStack(TC_Aspects.MACHINA, aIndex), - getTcAspectStack(TC_Aspects.MAGNETO, aIndex) - })); + this.addItem( + aStartID++, + "Transmission Component (" + GT_Values.VN[aIndex] + ")", + "", + new Object[] { getTcAspectStack(TC_Aspects.ELECTRUM, aIndex), + getTcAspectStack(TC_Aspects.MACHINA, aIndex), + getTcAspectStack(TC_Aspects.MAGNETO, aIndex) })); } // Distillus Chip - GregtechItemList.Distillus_Upgrade_Chip.set( - this.addItem(151, "Upgrade Chip", "Used to upgrade Distillus to Tier 2")); + GregtechItemList.Distillus_Upgrade_Chip + .set(this.addItem(151, "Upgrade Chip", "Used to upgrade Distillus to Tier 2")); - GregtechItemList.Chip_MultiNerf_NoOutputBonus.set( - this.addItem(160, "No-Bonus Chip", "You won't like using this")); - GregtechItemList.Chip_MultiNerf_NoSpeedBonus.set( - this.addItem(161, "No-Bonus Chip", "You won't like using this")); + GregtechItemList.Chip_MultiNerf_NoOutputBonus + .set(this.addItem(160, "No-Bonus Chip", "You won't like using this")); + GregtechItemList.Chip_MultiNerf_NoSpeedBonus + .set(this.addItem(161, "No-Bonus Chip", "You won't like using this")); GregtechItemList.Chip_MultiNerf_NoEuBonus.set(this.addItem(162, "No-Bonus Chip", "You won't like using this")); /* - GregtechItemList.Cover_Overflow_Item_ULV.set(this.addItem(165, "Item Overflow Valve (ULV)", "Maximum void amount: 8000", new Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, 1L), getTcAspectStack(TC_Aspects.MACHINA, 1L), getTcAspectStack(TC_Aspects.ITER, 1L), getTcAspectStack(TC_Aspects.AQUA, 1L)})); - GregtechItemList.Cover_Overflow_Item_LV.set(this.addItem(166, "Item Overflow Valve (LV)", "Maximum void amount: 64000", new Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, 1L), getTcAspectStack(TC_Aspects.MACHINA, 1L), getTcAspectStack(TC_Aspects.ITER, 1L), getTcAspectStack(TC_Aspects.AQUA, 1L)})); - GregtechItemList.Cover_Overflow_Item_MV.set(this.addItem(167, "Item Overflow Valve (MV)", "Maximum void amount: 512000", new Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, 1L), getTcAspectStack(TC_Aspects.MACHINA, 1L), getTcAspectStack(TC_Aspects.ITER, 1L), getTcAspectStack(TC_Aspects.AQUA, 1L)})); - GregtechItemList.Cover_Overflow_Item_HV.set(this.addItem(168, "Item Overflow Valve (HV)", "Maximum void amount: 4096000", new Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, 1L), getTcAspectStack(TC_Aspects.MACHINA, 1L), getTcAspectStack(TC_Aspects.ITER, 1L), getTcAspectStack(TC_Aspects.AQUA, 1L)})); - GregtechItemList.Cover_Overflow_Item_EV.set(this.addItem(169, "Item Overflow Valve (EV)", "Maximum void amount: 32768000", new Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, 1L), getTcAspectStack(TC_Aspects.MACHINA, 1L), getTcAspectStack(TC_Aspects.ITER, 1L), getTcAspectStack(TC_Aspects.AQUA, 1L)})); - GregtechItemList.Cover_Overflow_Item_IV.set(this.addItem(170, "Item Overflow Valve (IV)", "Maximum void amount: 262144000", new Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, 1L), getTcAspectStack(TC_Aspects.MACHINA, 1L), getTcAspectStack(TC_Aspects.ITER, 1L), getTcAspectStack(TC_Aspects.AQUA, 1L)})); - - GregTech_API.registerCover(GregtechItemList.Cover_Overflow_Item_ULV.get(1L), new GT_MultiTexture(new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[4][0], new GT_RenderedTexture(TexturesGtBlock.Overlay_Overflow_Valve)}), new GTPP_Cover_Overflow_Item(8)); - GregTech_API.registerCover(GregtechItemList.Cover_Overflow_Item_LV.get(1L), new GT_MultiTexture(new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[4][0], new GT_RenderedTexture(TexturesGtBlock.Overlay_Overflow_Valve)}), new GTPP_Cover_Overflow_Item(64)); - GregTech_API.registerCover(GregtechItemList.Cover_Overflow_Item_MV.get(1L), new GT_MultiTexture(new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[5][0], new GT_RenderedTexture(TexturesGtBlock.Overlay_Overflow_Valve)}), new GTPP_Cover_Overflow_Item(512)); - GregTech_API.registerCover(GregtechItemList.Cover_Overflow_Item_HV.get(1L), new GT_MultiTexture(new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[5][0], new GT_RenderedTexture(TexturesGtBlock.Overlay_Overflow_Valve)}), new GTPP_Cover_Overflow_Item(4096)); - GregTech_API.registerCover(GregtechItemList.Cover_Overflow_Item_EV.get(1L), new GT_MultiTexture(new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[8][0], new GT_RenderedTexture(TexturesGtBlock.Overlay_Overflow_Valve)}), new GTPP_Cover_Overflow_Item(32768)); - GregTech_API.registerCover(GregtechItemList.Cover_Overflow_Item_IV.get(1L), new GT_MultiTexture(new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[8][0], new GT_RenderedTexture(TexturesGtBlock.Overlay_Overflow_Valve)}), new GTPP_Cover_Overflow_Item(262144)); - */ + * GregtechItemList.Cover_Overflow_Item_ULV.set(this.addItem(165, "Item Overflow Valve (ULV)", + * "Maximum void amount: 8000", new Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, 1L), + * getTcAspectStack(TC_Aspects.MACHINA, 1L), getTcAspectStack(TC_Aspects.ITER, 1L), + * getTcAspectStack(TC_Aspects.AQUA, 1L)})); GregtechItemList.Cover_Overflow_Item_LV.set(this.addItem(166, + * "Item Overflow Valve (LV)", "Maximum void amount: 64000", new Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, + * 1L), getTcAspectStack(TC_Aspects.MACHINA, 1L), getTcAspectStack(TC_Aspects.ITER, 1L), + * getTcAspectStack(TC_Aspects.AQUA, 1L)})); GregtechItemList.Cover_Overflow_Item_MV.set(this.addItem(167, + * "Item Overflow Valve (MV)", "Maximum void amount: 512000", new Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, + * 1L), getTcAspectStack(TC_Aspects.MACHINA, 1L), getTcAspectStack(TC_Aspects.ITER, 1L), + * getTcAspectStack(TC_Aspects.AQUA, 1L)})); GregtechItemList.Cover_Overflow_Item_HV.set(this.addItem(168, + * "Item Overflow Valve (HV)", "Maximum void amount: 4096000", new + * Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, 1L), getTcAspectStack(TC_Aspects.MACHINA, 1L), + * getTcAspectStack(TC_Aspects.ITER, 1L), getTcAspectStack(TC_Aspects.AQUA, 1L)})); + * GregtechItemList.Cover_Overflow_Item_EV.set(this.addItem(169, "Item Overflow Valve (EV)", + * "Maximum void amount: 32768000", new Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, 1L), + * getTcAspectStack(TC_Aspects.MACHINA, 1L), getTcAspectStack(TC_Aspects.ITER, 1L), + * getTcAspectStack(TC_Aspects.AQUA, 1L)})); GregtechItemList.Cover_Overflow_Item_IV.set(this.addItem(170, + * "Item Overflow Valve (IV)", "Maximum void amount: 262144000", new + * Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, 1L), getTcAspectStack(TC_Aspects.MACHINA, 1L), + * getTcAspectStack(TC_Aspects.ITER, 1L), getTcAspectStack(TC_Aspects.AQUA, 1L)})); + * GregTech_API.registerCover(GregtechItemList.Cover_Overflow_Item_ULV.get(1L), new GT_MultiTexture(new + * ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[4][0], new + * GT_RenderedTexture(TexturesGtBlock.Overlay_Overflow_Valve)}), new GTPP_Cover_Overflow_Item(8)); + * GregTech_API.registerCover(GregtechItemList.Cover_Overflow_Item_LV.get(1L), new GT_MultiTexture(new + * ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[4][0], new + * GT_RenderedTexture(TexturesGtBlock.Overlay_Overflow_Valve)}), new GTPP_Cover_Overflow_Item(64)); + * GregTech_API.registerCover(GregtechItemList.Cover_Overflow_Item_MV.get(1L), new GT_MultiTexture(new + * ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[5][0], new + * GT_RenderedTexture(TexturesGtBlock.Overlay_Overflow_Valve)}), new GTPP_Cover_Overflow_Item(512)); + * GregTech_API.registerCover(GregtechItemList.Cover_Overflow_Item_HV.get(1L), new GT_MultiTexture(new + * ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[5][0], new + * GT_RenderedTexture(TexturesGtBlock.Overlay_Overflow_Valve)}), new GTPP_Cover_Overflow_Item(4096)); + * GregTech_API.registerCover(GregtechItemList.Cover_Overflow_Item_EV.get(1L), new GT_MultiTexture(new + * ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[8][0], new + * GT_RenderedTexture(TexturesGtBlock.Overlay_Overflow_Valve)}), new GTPP_Cover_Overflow_Item(32768)); + * GregTech_API.registerCover(GregtechItemList.Cover_Overflow_Item_IV.get(1L), new GT_MultiTexture(new + * ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[8][0], new + * GT_RenderedTexture(TexturesGtBlock.Overlay_Overflow_Valve)}), new GTPP_Cover_Overflow_Item(262144)); + */ } private boolean registerComponents_ULV() { GregtechItemList.Electric_Pump_ULV.set( - this.addItem(32, "Electric Pump (ULV)", "160 L/sec (as Cover)", new Object[] { - getTcAspectStack(TC_Aspects.ELECTRUM, 1L), - getTcAspectStack(TC_Aspects.MACHINA, 1L), - getTcAspectStack(TC_Aspects.ITER, 1L), - getTcAspectStack(TC_Aspects.AQUA, 1L) - })); - GregtechItemList.Electric_Motor_ULV.set(this.addItem(33, "Electric Motor (ULV)", "", new Object[] { - getTcAspectStack(TC_Aspects.ELECTRUM, 1L), - getTcAspectStack(TC_Aspects.MACHINA, 1L), - getTcAspectStack(TC_Aspects.MOTUS, 1L) - })); + this.addItem( + 32, + "Electric Pump (ULV)", + "160 L/sec (as Cover)", + new Object[] { getTcAspectStack(TC_Aspects.ELECTRUM, 1L), + getTcAspectStack(TC_Aspects.MACHINA, 1L), getTcAspectStack(TC_Aspects.ITER, 1L), + getTcAspectStack(TC_Aspects.AQUA, 1L) })); + GregtechItemList.Electric_Motor_ULV.set( + this.addItem( + 33, + "Electric Motor (ULV)", + "", + new Object[] { getTcAspectStack(TC_Aspects.ELECTRUM, 1L), + getTcAspectStack(TC_Aspects.MACHINA, 1L), getTcAspectStack(TC_Aspects.MOTUS, 1L) })); GregtechItemList.Conveyor_Module_ULV.set( - this.addItem(34, "Conveyor Module (ULV)", "1 Stack every 80 secs (as Cover)", new Object[] { - getTcAspectStack(TC_Aspects.ELECTRUM, 1L), - getTcAspectStack(TC_Aspects.MACHINA, 1L), - getTcAspectStack(TC_Aspects.ITER, 1L) - })); - GregtechItemList.Electric_Piston_ULV.set(this.addItem(35, "Electric Piston (ULV)", "", new Object[] { - getTcAspectStack(TC_Aspects.ELECTRUM, 1L), - getTcAspectStack(TC_Aspects.MACHINA, 2L), - getTcAspectStack(TC_Aspects.MOTUS, 1L) - })); + this.addItem( + 34, + "Conveyor Module (ULV)", + "1 Stack every 80 secs (as Cover)", + new Object[] { getTcAspectStack(TC_Aspects.ELECTRUM, 1L), + getTcAspectStack(TC_Aspects.MACHINA, 1L), getTcAspectStack(TC_Aspects.ITER, 1L) })); + GregtechItemList.Electric_Piston_ULV.set( + this.addItem( + 35, + "Electric Piston (ULV)", + "", + new Object[] { getTcAspectStack(TC_Aspects.ELECTRUM, 1L), + getTcAspectStack(TC_Aspects.MACHINA, 2L), getTcAspectStack(TC_Aspects.MOTUS, 1L) })); GregtechItemList.Robot_Arm_ULV.set( - this.addItem(36, "Robot Arm (ULV)", "Inserts into specific Slots (as Cover)", new Object[] { - getTcAspectStack(TC_Aspects.ELECTRUM, 1L), - getTcAspectStack(TC_Aspects.MACHINA, 2L), - getTcAspectStack(TC_Aspects.MOTUS, 1L), - Utils.getTcAspectStack("COGNITIO", 1L) - })); - GregtechItemList.Field_Generator_ULV.set(this.addItem(37, "Field Generator (ULV)", "", new Object[] { - getTcAspectStack(TC_Aspects.ELECTRUM, 2L), - getTcAspectStack(TC_Aspects.MACHINA, 1L), - getTcAspectStack(TC_Aspects.TUTAMEN, 1L) - })); - GregtechItemList.Emitter_ULV.set(this.addItem(38, "Emitter (ULV)", "", new Object[] { - getTcAspectStack(TC_Aspects.ELECTRUM, 1L), - getTcAspectStack(TC_Aspects.MACHINA, 1L), - getTcAspectStack(TC_Aspects.LUX, 1L) - })); - GregtechItemList.Sensor_ULV.set(this.addItem(39, "Sensor (ULV)", "", new Object[] { - getTcAspectStack(TC_Aspects.ELECTRUM, 1L), - getTcAspectStack(TC_Aspects.MACHINA, 1L), - getTcAspectStack(TC_Aspects.SENSUS, 1L) - })); + this.addItem( + 36, + "Robot Arm (ULV)", + "Inserts into specific Slots (as Cover)", + new Object[] { getTcAspectStack(TC_Aspects.ELECTRUM, 1L), + getTcAspectStack(TC_Aspects.MACHINA, 2L), getTcAspectStack(TC_Aspects.MOTUS, 1L), + Utils.getTcAspectStack("COGNITIO", 1L) })); + GregtechItemList.Field_Generator_ULV.set( + this.addItem( + 37, + "Field Generator (ULV)", + "", + new Object[] { getTcAspectStack(TC_Aspects.ELECTRUM, 2L), + getTcAspectStack(TC_Aspects.MACHINA, 1L), getTcAspectStack(TC_Aspects.TUTAMEN, 1L) })); + GregtechItemList.Emitter_ULV.set( + this.addItem( + 38, + "Emitter (ULV)", + "", + new Object[] { getTcAspectStack(TC_Aspects.ELECTRUM, 1L), + getTcAspectStack(TC_Aspects.MACHINA, 1L), getTcAspectStack(TC_Aspects.LUX, 1L) })); + GregtechItemList.Sensor_ULV.set( + this.addItem( + 39, + "Sensor (ULV)", + "", + new Object[] { getTcAspectStack(TC_Aspects.ELECTRUM, 1L), + getTcAspectStack(TC_Aspects.MACHINA, 1L), getTcAspectStack(TC_Aspects.SENSUS, 1L) })); GregTech_API.registerCover( GregtechItemList.Electric_Pump_ULV.get(1L), - new GT_MultiTexture(new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[5][0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PUMP) - }), + new GT_MultiTexture( + new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[5][0], + new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PUMP) }), new GT_Cover_Pump(8)); GregTech_API.registerCover( GregtechItemList.Conveyor_Module_ULV.get(1L), - new GT_MultiTexture(new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[1][0], - new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_CONVEYOR) - }), + new GT_MultiTexture( + new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[1][0], + new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_CONVEYOR) }), new GT_Cover_Conveyor(1600)); GregTech_API.registerCover( GregtechItemList.Robot_Arm_ULV.get(1L), - new GT_MultiTexture(new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[1][0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_ARM) - }), + new GT_MultiTexture( + new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[1][0], + new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_ARM) }), new GT_Cover_Arm(1600)); return true; } private boolean registerComponents_MAX() { - GregtechItemList.Electric_Pump_MAX.set(this.addItem(3, "Electric Pump (MAX)", "", new Object[] { - getTcAspectStack(TC_Aspects.ELECTRUM, 8L), - getTcAspectStack(TC_Aspects.MACHINA, 8L), - getTcAspectStack(TC_Aspects.ITER, 8L), - getTcAspectStack(TC_Aspects.AQUA, 8L) - })); - GregtechItemList.Electric_Motor_MAX.set(this.addItem(7, "Electric Motor (MAX)", "", new Object[] { - getTcAspectStack(TC_Aspects.ELECTRUM, 8L), - getTcAspectStack(TC_Aspects.MACHINA, 8L), - getTcAspectStack(TC_Aspects.MOTUS, 8L) - })); - GregtechItemList.Conveyor_Module_MAX.set(this.addItem(11, "Conveyor Module (MAX)", "", new Object[] { - getTcAspectStack(TC_Aspects.ELECTRUM, 8L), - getTcAspectStack(TC_Aspects.MACHINA, 8L), - getTcAspectStack(TC_Aspects.ITER, 8L) - })); - GregtechItemList.Electric_Piston_MAX.set(this.addItem(15, "Electric Piston (MAX)", "", new Object[] { - getTcAspectStack(TC_Aspects.ELECTRUM, 8L), - getTcAspectStack(TC_Aspects.MACHINA, 16L), - getTcAspectStack(TC_Aspects.MOTUS, 8L) - })); - GregtechItemList.Robot_Arm_MAX.set(this.addItem(19, "Robot Arm (MAX)", "", new Object[] { - getTcAspectStack(TC_Aspects.ELECTRUM, 8L), - getTcAspectStack(TC_Aspects.MACHINA, 16L), - getTcAspectStack(TC_Aspects.MOTUS, 8L), - getTcAspectStack("COGNITIO", 8L) - })); - GregtechItemList.Field_Generator_MAX.set(this.addItem(23, "Field Generator (MAX)", "", new Object[] { - getTcAspectStack(TC_Aspects.ELECTRUM, 16L), - getTcAspectStack(TC_Aspects.MACHINA, 8L), - getTcAspectStack(TC_Aspects.TUTAMEN, 8L) - })); - GregtechItemList.Emitter_MAX.set(this.addItem(27, "Emitter (MAX)", "", new Object[] { - getTcAspectStack(TC_Aspects.ELECTRUM, 8L), - getTcAspectStack(TC_Aspects.MACHINA, 8L), - getTcAspectStack(TC_Aspects.LUX, 8L) - })); - GregtechItemList.Sensor_MAX.set(this.addItem(31, "Sensor (MAX)", "", new Object[] { - getTcAspectStack(TC_Aspects.ELECTRUM, 8L), - getTcAspectStack(TC_Aspects.MACHINA, 8L), - getTcAspectStack(TC_Aspects.SENSUS, 8L) - })); + GregtechItemList.Electric_Pump_MAX.set( + this.addItem( + 3, + "Electric Pump (MAX)", + "", + new Object[] { getTcAspectStack(TC_Aspects.ELECTRUM, 8L), + getTcAspectStack(TC_Aspects.MACHINA, 8L), getTcAspectStack(TC_Aspects.ITER, 8L), + getTcAspectStack(TC_Aspects.AQUA, 8L) })); + GregtechItemList.Electric_Motor_MAX.set( + this.addItem( + 7, + "Electric Motor (MAX)", + "", + new Object[] { getTcAspectStack(TC_Aspects.ELECTRUM, 8L), + getTcAspectStack(TC_Aspects.MACHINA, 8L), getTcAspectStack(TC_Aspects.MOTUS, 8L) })); + GregtechItemList.Conveyor_Module_MAX.set( + this.addItem( + 11, + "Conveyor Module (MAX)", + "", + new Object[] { getTcAspectStack(TC_Aspects.ELECTRUM, 8L), + getTcAspectStack(TC_Aspects.MACHINA, 8L), getTcAspectStack(TC_Aspects.ITER, 8L) })); + GregtechItemList.Electric_Piston_MAX.set( + this.addItem( + 15, + "Electric Piston (MAX)", + "", + new Object[] { getTcAspectStack(TC_Aspects.ELECTRUM, 8L), + getTcAspectStack(TC_Aspects.MACHINA, 16L), getTcAspectStack(TC_Aspects.MOTUS, 8L) })); + GregtechItemList.Robot_Arm_MAX.set( + this.addItem( + 19, + "Robot Arm (MAX)", + "", + new Object[] { getTcAspectStack(TC_Aspects.ELECTRUM, 8L), + getTcAspectStack(TC_Aspects.MACHINA, 16L), getTcAspectStack(TC_Aspects.MOTUS, 8L), + getTcAspectStack("COGNITIO", 8L) })); + GregtechItemList.Field_Generator_MAX.set( + this.addItem( + 23, + "Field Generator (MAX)", + "", + new Object[] { getTcAspectStack(TC_Aspects.ELECTRUM, 16L), + getTcAspectStack(TC_Aspects.MACHINA, 8L), getTcAspectStack(TC_Aspects.TUTAMEN, 8L) })); + GregtechItemList.Emitter_MAX.set( + this.addItem( + 27, + "Emitter (MAX)", + "", + new Object[] { getTcAspectStack(TC_Aspects.ELECTRUM, 8L), + getTcAspectStack(TC_Aspects.MACHINA, 8L), getTcAspectStack(TC_Aspects.LUX, 8L) })); + GregtechItemList.Sensor_MAX.set( + this.addItem( + 31, + "Sensor (MAX)", + "", + new Object[] { getTcAspectStack(TC_Aspects.ELECTRUM, 8L), + getTcAspectStack(TC_Aspects.MACHINA, 8L), getTcAspectStack(TC_Aspects.SENSUS, 8L) })); GregTech_API.registerCover( GregtechItemList.Electric_Pump_MAX.get(1L), - new GT_MultiTexture(new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[8][0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PUMP) - }), + new GT_MultiTexture( + new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[8][0], + new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PUMP) }), new GT_Cover_Pump(524288)); GregTech_API.registerCover( GregtechItemList.Conveyor_Module_MAX.get(1L), - new GT_MultiTexture(new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[4][0], - new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_CONVEYOR) - }), + new GT_MultiTexture( + new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[4][0], + new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_CONVEYOR) }), new GT_Cover_Conveyor(4)); GregTech_API.registerCover( GregtechItemList.Robot_Arm_MAX.get(1L), - new GT_MultiTexture(new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[4][0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_ARM) - }), + new GT_MultiTexture( + new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[4][0], + new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_ARM) }), new GT_Cover_Arm(4)); return true; @@ -1122,69 +1268,93 @@ public class MetaGeneratedGregtechItems extends Gregtech_MetaItem_X32 { // Enable Old Circuits Logger.INFO("[Old Feature - Circuits] Enabling Pre-5.09.28 Circuits and Data Storage."); - GregtechItemList.Old_Circuit_Primitive.set(this.addItem( - 200, "NAND Chip", "A very simple Circuit", new Object[] {OrePrefixes.circuit.get(Materials.Primitive) - })); + GregtechItemList.Old_Circuit_Primitive.set( + this.addItem( + 200, + "NAND Chip", + "A very simple Circuit", + new Object[] { OrePrefixes.circuit.get(Materials.Primitive) })); GregtechItemList.Old_Circuit_Basic.set( - this.addItem(201, "Basic Electronic Circuit", "A basic Circuit", new Object[] { - OrePrefixes.circuit.get(Materials.Basic) - })); - GregtechItemList.Old_Circuit_Good.set(this.addItem( - 202, "Good Electronic Circuit", "A good Circuit", new Object[] {OrePrefixes.circuit.get(Materials.Good) - })); + this.addItem( + 201, + "Basic Electronic Circuit", + "A basic Circuit", + new Object[] { OrePrefixes.circuit.get(Materials.Basic) })); + GregtechItemList.Old_Circuit_Good.set( + this.addItem( + 202, + "Good Electronic Circuit", + "A good Circuit", + new Object[] { OrePrefixes.circuit.get(Materials.Good) })); GregtechItemList.Old_Circuit_Advanced.set( - this.addItem(203, "Advanced Circuit", "An advanced Circuit", new Object[] { - OrePrefixes.circuit.get(Materials.Advanced) - })); + this.addItem( + 203, + "Advanced Circuit", + "An advanced Circuit", + new Object[] { OrePrefixes.circuit.get(Materials.Advanced) })); GregtechItemList.Old_Circuit_Data.set( - this.addItem(204, "Data Storage Circuit", "A Data Storage Chip", new Object[] { - OrePrefixes.circuit.get(Materials.Data) - })); - GregtechItemList.Old_Circuit_Elite.set(this.addItem( - 205, "Data Control Circuit", "A Processor", new Object[] {OrePrefixes.circuit.get(Materials.Elite)})); + this.addItem( + 204, + "Data Storage Circuit", + "A Data Storage Chip", + new Object[] { OrePrefixes.circuit.get(Materials.Data) })); + GregtechItemList.Old_Circuit_Elite.set( + this.addItem( + 205, + "Data Control Circuit", + "A Processor", + new Object[] { OrePrefixes.circuit.get(Materials.Elite) })); GregtechItemList.Old_Circuit_Master.set( - this.addItem(206, "Energy Flow Circuit", "A High Voltage Processor", new Object[] { - OrePrefixes.circuit.get(Materials.Master) - })); + this.addItem( + 206, + "Energy Flow Circuit", + "A High Voltage Processor", + new Object[] { OrePrefixes.circuit.get(Materials.Master) })); GregtechItemList.Old_Tool_DataOrb.set( - this.addItem(207, "Data Orb [GT++]", "A High Capacity Data Storage", new Object[] { - OrePrefixes.circuit.get(Materials.Ultimate), SubTag.NO_UNIFICATION, new Behaviour_DataOrb() - })); + this.addItem( + 207, + "Data Orb [GT++]", + "A High Capacity Data Storage", + new Object[] { OrePrefixes.circuit.get(Materials.Ultimate), SubTag.NO_UNIFICATION, + new Behaviour_DataOrb() })); GregtechItemList.Old_Circuit_Ultimate.set(GregtechItemList.Old_Tool_DataOrb.get(1L)); GT_ModHandler.addShapelessCraftingRecipe( GregtechItemList.Old_Tool_DataOrb.get(1L), GT_ModHandler.RecipeBits.NOT_REMOVABLE, - new Object[] {GregtechItemList.Old_Tool_DataOrb.get(1L)}); + new Object[] { GregtechItemList.Old_Tool_DataOrb.get(1L) }); GregtechItemList.Old_Tool_DataStick.set( - this.addItem(208, "Data Stick [GT++]", "A Low Capacity Data Storage", new Object[] { - OrePrefixes.circuit.get(Materials.Data), SubTag.NO_UNIFICATION, new Behaviour_DataStick() - })); + this.addItem( + 208, + "Data Stick [GT++]", + "A Low Capacity Data Storage", + new Object[] { OrePrefixes.circuit.get(Materials.Data), SubTag.NO_UNIFICATION, + new Behaviour_DataStick() })); GT_ModHandler.addShapelessCraftingRecipe( GregtechItemList.Old_Tool_DataStick.get(1L), GT_ModHandler.RecipeBits.NOT_REMOVABLE, - new Object[] {GregtechItemList.Old_Tool_DataStick.get(1L)}); + new Object[] { GregtechItemList.Old_Tool_DataStick.get(1L) }); GregtechItemList.Old_Circuit_Board_Basic.set(this.addItem(210, "Basic Circuit Board", "A basic Board")); - GregtechItemList.Old_Circuit_Board_Advanced.set( - this.addItem(211, "Advanced Circuit Board", "An advanced Board")); + GregtechItemList.Old_Circuit_Board_Advanced + .set(this.addItem(211, "Advanced Circuit Board", "An advanced Board")); GregtechItemList.Old_Circuit_Board_Elite.set(this.addItem(212, "Processor Board", "A Processor Board")); - GregtechItemList.Old_Circuit_Parts_Crystal_Chip_Elite.set( - this.addItem(213, "Engraved Crystal Chip", "Needed for Circuits")); - GregtechItemList.Old_Circuit_Parts_Crystal_Chip_Master.set( - this.addItem(214, "Engraved Lapotron Chip", "Needed for Circuits")); - GregtechItemList.Old_Circuit_Parts_Advanced.set( - this.addItem(215, "Advanced Circuit Parts", "Advanced Circuit Parts")); - GregtechItemList.Old_Circuit_Parts_Wiring_Basic.set( - this.addItem(216, "Etched Medium Voltage Wiring", "Part of Circuit Boards")); - GregtechItemList.Old_Circuit_Parts_Wiring_Advanced.set( - this.addItem(217, "Etched High Voltage Wiring", "Part of Circuit Boards")); - GregtechItemList.Old_Circuit_Parts_Wiring_Elite.set( - this.addItem(218, "Etched Extreme Voltage Wiring", "Part of Circuit Boards")); + GregtechItemList.Old_Circuit_Parts_Crystal_Chip_Elite + .set(this.addItem(213, "Engraved Crystal Chip", "Needed for Circuits")); + GregtechItemList.Old_Circuit_Parts_Crystal_Chip_Master + .set(this.addItem(214, "Engraved Lapotron Chip", "Needed for Circuits")); + GregtechItemList.Old_Circuit_Parts_Advanced + .set(this.addItem(215, "Advanced Circuit Parts", "Advanced Circuit Parts")); + GregtechItemList.Old_Circuit_Parts_Wiring_Basic + .set(this.addItem(216, "Etched Medium Voltage Wiring", "Part of Circuit Boards")); + GregtechItemList.Old_Circuit_Parts_Wiring_Advanced + .set(this.addItem(217, "Etched High Voltage Wiring", "Part of Circuit Boards")); + GregtechItemList.Old_Circuit_Parts_Wiring_Elite + .set(this.addItem(218, "Etched Extreme Voltage Wiring", "Part of Circuit Boards")); GregtechItemList.Old_Empty_Board_Basic.set(this.addItem(219, "Empty Circuit Board", "A Board Part")); - GregtechItemList.Old_Empty_Board_Elite.set( - this.addItem(220, "Empty Processor Board", "A Processor Board Part")); + GregtechItemList.Old_Empty_Board_Elite + .set(this.addItem(220, "Empty Processor Board", "A Processor Board Part")); return true; } @@ -1192,39 +1362,45 @@ public class MetaGeneratedGregtechItems extends Gregtech_MetaItem_X32 { public boolean registerCustomCircuits() { if (CORE.ConfigSwitches.enableCustomCircuits) { GregtechItemList.Circuit_IV.set( - this.addItem(704, "Symbiotic Circuit (IV)", "A Symbiotic Data Processor", new Object[] { - GregtechOrePrefixes.circuit.get(GT_Materials.Symbiotic) - })); + this.addItem( + 704, + "Symbiotic Circuit (IV)", + "A Symbiotic Data Processor", + new Object[] { GregtechOrePrefixes.circuit.get(GT_Materials.Symbiotic) })); GregtechItemList.Circuit_LuV.set( - this.addItem(705, "Neutronic Circuit (LuV)", "A Neutron Particle Processor", new Object[] { - GregtechOrePrefixes.circuit.get(GT_Materials.Neutronic) - })); + this.addItem( + 705, + "Neutronic Circuit (LuV)", + "A Neutron Particle Processor", + new Object[] { GregtechOrePrefixes.circuit.get(GT_Materials.Neutronic) })); GregtechItemList.Circuit_ZPM.set( - this.addItem(706, "Quantum Circuit (ZPM)", "A Singlularity Processor", new Object[] { - GregtechOrePrefixes.circuit.get(GT_Materials.Quantum) - })); - GregtechItemList.Circuit_Board_IV.set( - this.addItem(710, "IV Circuit Board", "An IV Voltage Rated Circuit Board")); - GregtechItemList.Circuit_Board_LuV.set( - this.addItem(711, "LuV Circuit Board", "An LuV Voltage Rated Circuit Board")); - GregtechItemList.Circuit_Board_ZPM.set( - this.addItem(712, "ZPM Processor Board", "A ZPM Voltage Rated Processor Board")); - GregtechItemList.Circuit_Parts_Crystal_Chip_IV.set( - this.addItem(713, "(IV) Energized Crystal Chip", "Needed for Circuits")); - GregtechItemList.Circuit_Parts_Crystal_Chip_LuV.set( - this.addItem(714, "(LuV) Neutron based Microchip", "Needed for Circuits")); - GregtechItemList.Circuit_Parts_Crystal_Chip_ZPM.set( - this.addItem(715, "(ZPM) Quantum Chip", "Needed for Circuits")); + this.addItem( + 706, + "Quantum Circuit (ZPM)", + "A Singlularity Processor", + new Object[] { GregtechOrePrefixes.circuit.get(GT_Materials.Quantum) })); + GregtechItemList.Circuit_Board_IV + .set(this.addItem(710, "IV Circuit Board", "An IV Voltage Rated Circuit Board")); + GregtechItemList.Circuit_Board_LuV + .set(this.addItem(711, "LuV Circuit Board", "An LuV Voltage Rated Circuit Board")); + GregtechItemList.Circuit_Board_ZPM + .set(this.addItem(712, "ZPM Processor Board", "A ZPM Voltage Rated Processor Board")); + GregtechItemList.Circuit_Parts_Crystal_Chip_IV + .set(this.addItem(713, "(IV) Energized Crystal Chip", "Needed for Circuits")); + GregtechItemList.Circuit_Parts_Crystal_Chip_LuV + .set(this.addItem(714, "(LuV) Neutron based Microchip", "Needed for Circuits")); + GregtechItemList.Circuit_Parts_Crystal_Chip_ZPM + .set(this.addItem(715, "(ZPM) Quantum Chip", "Needed for Circuits")); GregtechItemList.Circuit_Parts_IV.set(this.addItem(716, "(IV) Energized Circuit Parts", "Circuit Parts")); - GregtechItemList.Circuit_Parts_LuV.set( - this.addItem(717, "(LuV) Neutron-based Circuit Parts", "Circuit Parts")); + GregtechItemList.Circuit_Parts_LuV + .set(this.addItem(717, "(LuV) Neutron-based Circuit Parts", "Circuit Parts")); GregtechItemList.Circuit_Parts_ZPM.set(this.addItem(718, "(ZPM) Quantum Circuit Parts", "Circuit Parts")); - GregtechItemList.Circuit_Parts_Wiring_IV.set( - this.addItem(719, "Etched IV Voltage Wiring", "Part of Circuit Boards")); - GregtechItemList.Circuit_Parts_Wiring_LuV.set( - this.addItem(720, "Etched LuV Voltage Wiring", "Part of Circuit Boards")); - GregtechItemList.Circuit_Parts_Wiring_ZPM.set( - this.addItem(721, "Etched ZPM Voltage Wiring", "Part of Circuit Boards")); + GregtechItemList.Circuit_Parts_Wiring_IV + .set(this.addItem(719, "Etched IV Voltage Wiring", "Part of Circuit Boards")); + GregtechItemList.Circuit_Parts_Wiring_LuV + .set(this.addItem(720, "Etched LuV Voltage Wiring", "Part of Circuit Boards")); + GregtechItemList.Circuit_Parts_Wiring_ZPM + .set(this.addItem(721, "Etched ZPM Voltage Wiring", "Part of Circuit Boards")); ItemUtils.addItemToOreDictionary(GregtechItemList.Circuit_IV.get(1), "circuitSuperconductor"); ItemUtils.addItemToOreDictionary(GregtechItemList.Circuit_LuV.get(1), "circuitInfinite"); return true; diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/items/MetaGeneratedGregtechTools.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/items/MetaGeneratedGregtechTools.java index 0e937a9485..e59c71c5bd 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/items/MetaGeneratedGregtechTools.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/items/MetaGeneratedGregtechTools.java @@ -1,5 +1,7 @@ package gtPlusPlus.xmod.gregtech.common.items; +import java.lang.reflect.Field; + import gregtech.api.GregTech_API; import gregtech.api.enums.TC_Aspects; import gregtech.api.enums.ToolDictNames; @@ -13,7 +15,6 @@ import gtPlusPlus.xmod.gregtech.common.tools.TOOL_Gregtech_Choocher; import gtPlusPlus.xmod.gregtech.common.tools.TOOL_Gregtech_ElectricButcherKnife; import gtPlusPlus.xmod.gregtech.common.tools.TOOL_Gregtech_ElectricLighter; import gtPlusPlus.xmod.gregtech.common.tools.TOOL_Gregtech_ElectricSnips; -import java.lang.reflect.Field; public class MetaGeneratedGregtechTools extends GT_MetaGenerated_Tool { @@ -41,14 +42,11 @@ public class MetaGeneratedGregtechTools extends GT_MetaGenerated_Tool { "Skookum Choocher", "Can Really Chooch. Does a Skookum job at Hammering and Wrenching stuff.", new TOOL_Gregtech_Choocher(), - new Object[] { - GregtechToolDictNames.craftingToolSkookumChoocher, - ToolDictNames.craftingToolHardHammer, - ToolDictNames.craftingToolWrench, - new TC_Aspects.TC_AspectStack(TC_Aspects.INSTRUMENTUM, 2L), - new TC_Aspects.TC_AspectStack(TC_Aspects.FABRICO, 2L), - new TC_Aspects.TC_AspectStack(TC_Aspects.ORDO, 2L) - }), + new Object[] { GregtechToolDictNames.craftingToolSkookumChoocher, + ToolDictNames.craftingToolHardHammer, ToolDictNames.craftingToolWrench, + new TC_Aspects.TC_AspectStack(TC_Aspects.INSTRUMENTUM, 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.FABRICO, 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.ORDO, 2L) }), GregTech_API.sWrenchList); // Electric File @@ -57,13 +55,10 @@ public class MetaGeneratedGregtechTools extends GT_MetaGenerated_Tool { "Angle Grinder", "Hand-held electric filing device", new TOOL_Gregtech_AngleGrinder(), - new Object[] { - GregtechToolDictNames.craftingToolAngleGrinder, - ToolDictNames.craftingToolFile, - new TC_Aspects.TC_AspectStack(TC_Aspects.INSTRUMENTUM, 2L), - new TC_Aspects.TC_AspectStack(TC_Aspects.FABRICO, 2L), - new TC_Aspects.TC_AspectStack(TC_Aspects.ORDO, 2L) - }); + new Object[] { GregtechToolDictNames.craftingToolAngleGrinder, ToolDictNames.craftingToolFile, + new TC_Aspects.TC_AspectStack(TC_Aspects.INSTRUMENTUM, 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.FABRICO, 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.ORDO, 2L) }); GT_HashSet<GT_ItemStack> aWireCutterList = new GT_HashSet<GT_ItemStack>(); // Does not exist prior to 5.09.32, use an empty field if we can't find the existing one. @@ -89,23 +84,23 @@ public class MetaGeneratedGregtechTools extends GT_MetaGenerated_Tool { "Automatic Snips", "Hand-held electric wire cutter", new TOOL_Gregtech_ElectricSnips(), - new Object[] { - GregtechToolDictNames.craftingToolElectricSnips, - ToolDictNames.craftingToolWireCutter, - new TC_Aspects.TC_AspectStack(TC_Aspects.INSTRUMENTUM, 4L), - new TC_Aspects.TC_AspectStack(TC_Aspects.FABRICO, 4L), - new TC_Aspects.TC_AspectStack(TC_Aspects.ORDO, 4L) - }), + new Object[] { GregtechToolDictNames.craftingToolElectricSnips, + ToolDictNames.craftingToolWireCutter, + new TC_Aspects.TC_AspectStack(TC_Aspects.INSTRUMENTUM, 4L), + new TC_Aspects.TC_AspectStack(TC_Aspects.FABRICO, 4L), + new TC_Aspects.TC_AspectStack(TC_Aspects.ORDO, 4L) }), aWireCutterList); // Electric Lighter this.addTool( - ELECTRIC_LIGHTER, "Pyromatic 9k", "Electric Fire!", new TOOL_Gregtech_ElectricLighter(), new Object[] { - GregtechToolDictNames.craftingToolElectricLighter, - new TC_Aspects.TC_AspectStack(TC_Aspects.INSTRUMENTUM, 2L), - new TC_Aspects.TC_AspectStack(TC_Aspects.FABRICO, 2L), - new TC_Aspects.TC_AspectStack(TC_Aspects.ORDO, 2L) - }); + ELECTRIC_LIGHTER, + "Pyromatic 9k", + "Electric Fire!", + new TOOL_Gregtech_ElectricLighter(), + new Object[] { GregtechToolDictNames.craftingToolElectricLighter, + new TC_Aspects.TC_AspectStack(TC_Aspects.INSTRUMENTUM, 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.FABRICO, 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.ORDO, 2L) }); // Electric Butcher Knife this.addTool( @@ -113,12 +108,9 @@ public class MetaGeneratedGregtechTools extends GT_MetaGenerated_Tool { "Meat-o-matic", "Electric butcher knife", new TOOL_Gregtech_ElectricButcherKnife(), - new Object[] { - GregtechToolDictNames.craftingToolElectricButcherKnife, - ToolDictNames.craftingToolKnife, - new TC_Aspects.TC_AspectStack(TC_Aspects.INSTRUMENTUM, 1L), - new TC_Aspects.TC_AspectStack(TC_Aspects.FABRICO, 2L), - new TC_Aspects.TC_AspectStack(TC_Aspects.ORDO, 2L) - }); + new Object[] { GregtechToolDictNames.craftingToolElectricButcherKnife, ToolDictNames.craftingToolKnife, + new TC_Aspects.TC_AspectStack(TC_Aspects.INSTRUMENTUM, 1L), + new TC_Aspects.TC_AspectStack(TC_Aspects.FABRICO, 2L), + new TC_Aspects.TC_AspectStack(TC_Aspects.ORDO, 2L) }); } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/items/behaviours/Behaviour_Choocher.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/items/behaviours/Behaviour_Choocher.java index ef72c5edd4..9d27818686 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/items/behaviours/Behaviour_Choocher.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/items/behaviours/Behaviour_Choocher.java @@ -1,5 +1,11 @@ package gtPlusPlus.xmod.gregtech.common.items.behaviours; +import java.util.List; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; + import gregtech.api.items.GT_MetaBase_Item; import gregtech.api.util.GT_LanguageManager; import gregtech.common.items.behaviors.Behaviour_None; @@ -7,39 +13,27 @@ import gregtech.common.items.behaviors.Behaviour_Wrench; import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.minecraft.NBTUtils; import gtPlusPlus.core.util.minecraft.PlayerUtils; -import java.util.List; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; public class Behaviour_Choocher extends Behaviour_None { + private boolean isWrench = true; private final Behaviour_Wrench wrench = new Behaviour_Wrench(150); private final Behaviour_Prospecting_Ex prospecting = new Behaviour_Prospecting_Ex(10, 1250); - private final String mTooltip1 = - GT_LanguageManager.addStringLocalization("gt.behaviour.choochering1", "Current tool mode: "); - private final String mTooltip2 = GT_LanguageManager.addStringLocalization( - "gt.behaviour.choochering2", "Change tool mode using Shift+Rightclick."); - private final String mTooltipH = GT_LanguageManager.addStringLocalization( - "gt.behaviour.prospectingEx", "Usable for Prospecting large areas."); - private final String mTooltipW = - GT_LanguageManager.addStringLocalization("gt.behaviour.wrench", "Rotates Blocks on Rightclick."); + private final String mTooltip1 = GT_LanguageManager + .addStringLocalization("gt.behaviour.choochering1", "Current tool mode: "); + private final String mTooltip2 = GT_LanguageManager + .addStringLocalization("gt.behaviour.choochering2", "Change tool mode using Shift+Rightclick."); + private final String mTooltipH = GT_LanguageManager + .addStringLocalization("gt.behaviour.prospectingEx", "Usable for Prospecting large areas."); + private final String mTooltipW = GT_LanguageManager + .addStringLocalization("gt.behaviour.wrench", "Rotates Blocks on Rightclick."); public Behaviour_Choocher() {} @Override - public boolean onItemUseFirst( - final GT_MetaBase_Item aItem, - final ItemStack aStack, - final EntityPlayer aPlayer, - final World aWorld, - final int aX, - final int aY, - final int aZ, - final int aSide, - final float hitX, - final float hitY, - final float hitZ) { + public boolean onItemUseFirst(final GT_MetaBase_Item aItem, final ItemStack aStack, final EntityPlayer aPlayer, + final World aWorld, final int aX, final int aY, final int aZ, final int aSide, final float hitX, + final float hitY, final float hitZ) { if (aWorld.isRemote) { return false; } @@ -59,18 +53,18 @@ public class Behaviour_Choocher extends Behaviour_None { return true; } else { if (inWrenchMode) { - return this.wrench.onItemUseFirst( - aItem, aStack, aPlayer, aWorld, aSide, aSide, aSide, aSide, hitZ, hitZ, hitZ); + return this.wrench + .onItemUseFirst(aItem, aStack, aPlayer, aWorld, aSide, aSide, aSide, aSide, hitZ, hitZ, hitZ); } else { - return this.prospecting.onItemUseFirst( - aItem, aStack, aPlayer, aWorld, aX, aY, aZ, aSide, hitX, hitY, hitZ); + return this.prospecting + .onItemUseFirst(aItem, aStack, aPlayer, aWorld, aX, aY, aZ, aSide, hitX, hitY, hitZ); } } } @Override - public List<String> getAdditionalToolTips( - final GT_MetaBase_Item aItem, final List<String> aList, final ItemStack aStack) { + public List<String> getAdditionalToolTips(final GT_MetaBase_Item aItem, final List<String> aList, + final ItemStack aStack) { boolean inWrenchMode; if (NBTUtils.hasKey(aStack, "aMode")) { diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/items/behaviours/Behaviour_Electric_Lighter.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/items/behaviours/Behaviour_Electric_Lighter.java index 922c09c1eb..ce393beccb 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/items/behaviours/Behaviour_Electric_Lighter.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/items/behaviours/Behaviour_Electric_Lighter.java @@ -1,5 +1,16 @@ package gtPlusPlus.xmod.gregtech.common.items.behaviours; +import java.util.List; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.monster.EntityCreeper; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; + import codechicken.lib.math.MathHelper; import gregtech.api.GregTech_API; import gregtech.api.items.GT_MetaBase_Item; @@ -15,24 +26,15 @@ import gtPlusPlus.core.util.minecraft.PlayerUtils; import gtPlusPlus.xmod.gregtech.common.helpers.ChargingHelper; import gtPlusPlus.xmod.gregtech.common.items.MetaGeneratedGregtechTools; import ic2.api.item.IElectricItemManager; -import java.util.List; -import net.minecraft.entity.Entity; -import net.minecraft.entity.monster.EntityCreeper; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.world.World; -import net.minecraftforge.common.util.ForgeDirection; public class Behaviour_Electric_Lighter extends Behaviour_None { - private final String mTooltip = - GT_LanguageManager.addStringLocalization("gt.behaviour.lighter.tooltip", "Can light things on Fire"); - private final String mTooltipUses = - GT_LanguageManager.addStringLocalization("gt.behaviour.lighter.uses", "Remaining Uses:"); - private final String mTooltipUnstackable = - GT_LanguageManager.addStringLocalization("gt.behaviour.unstackable", "Not usable when stacked!"); + private final String mTooltip = GT_LanguageManager + .addStringLocalization("gt.behaviour.lighter.tooltip", "Can light things on Fire"); + private final String mTooltipUses = GT_LanguageManager + .addStringLocalization("gt.behaviour.lighter.uses", "Remaining Uses:"); + private final String mTooltipUnstackable = GT_LanguageManager + .addStringLocalization("gt.behaviour.unstackable", "Not usable when stacked!"); public Behaviour_Electric_Lighter() {} @@ -59,18 +61,8 @@ public class Behaviour_Electric_Lighter extends Behaviour_None { } } - public boolean onItemUse( - GT_MetaBase_Item aItem, - ItemStack aStack, - EntityPlayer aPlayer, - World aWorld, - int aX, - int aY, - int aZ, - int aSide, - float hitX, - float hitY, - float hitZ) { + public boolean onItemUse(GT_MetaBase_Item aItem, ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, + int aY, int aZ, int aSide, float hitX, float hitY, float hitZ) { if (!aWorld.isRemote && aStack != null && aStack.stackSize == 1) { if (aPlayer.isSneaking()) { Logger.INFO("Changing Mode"); @@ -88,7 +80,10 @@ public class Behaviour_Electric_Lighter extends Behaviour_None { if (aCurrentMode) { // Shoot Lightning Attack aWorld.playSoundAtEntity( - aPlayer, "random.bow", 0.5F, 0.4F / (CORE.RANDOM.nextFloat() * 0.4F + 0.8F)); + aPlayer, + "random.bow", + 0.5F, + 0.4F / (CORE.RANDOM.nextFloat() * 0.4F + 0.8F)); if (!aWorld.isRemote) { aWorld.spawnEntityInWorld(new EntityLightningAttack(aWorld, aPlayer, hitX, hitY, hitZ)); } @@ -105,7 +100,13 @@ public class Behaviour_Electric_Lighter extends Behaviour_None { if (this.prepare(aStack) || aPlayer.capabilities.isCreativeMode) { Logger.WARNING("Preparing Lighter c"); GT_Utility.sendSoundToPlayers( - aWorld, (String) GregTech_API.sSoundList.get(6), 1.0F, 1.0F, aX, aY, aZ); + aWorld, + (String) GregTech_API.sSoundList.get(6), + 1.0F, + 1.0F, + aX, + aY, + aZ); aWorld.setBlock(aX, aY, aZ, Blocks.fire); rOutput = true; // ItemNBT.setLighterFuel(aStack, tFuelAmount); @@ -119,18 +120,8 @@ public class Behaviour_Electric_Lighter extends Behaviour_None { return false; } - public boolean onItemUseFirst( - GT_MetaBase_Item aItem, - ItemStack aStack, - EntityPlayer aPlayer, - World aWorld, - int aX, - int aY, - int aZ, - int aSide, - float hitX, - float hitY, - float hitZ) { + public boolean onItemUseFirst(GT_MetaBase_Item aItem, ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, + int aY, int aZ, int aSide, float hitX, float hitY, float hitZ) { if (!aWorld.isRemote && aStack != null && aStack.stackSize == 1) { if (aPlayer.isSneaking()) { Logger.INFO("Changing Mode"); @@ -148,7 +139,10 @@ public class Behaviour_Electric_Lighter extends Behaviour_None { if (aCurrentMode) { // Shoot Lightning Attack aWorld.playSoundAtEntity( - aPlayer, "random.bow", 0.5F, 0.4F / (CORE.RANDOM.nextFloat() * 0.4F + 0.8F)); + aPlayer, + "random.bow", + 0.5F, + 0.4F / (CORE.RANDOM.nextFloat() * 0.4F + 0.8F)); if (!aWorld.isRemote) { aWorld.spawnEntityInWorld(new EntityLightningAttack(aWorld, aPlayer, hitX, hitY, hitZ)); } @@ -165,7 +159,13 @@ public class Behaviour_Electric_Lighter extends Behaviour_None { if (this.prepare(aStack) || aPlayer.capabilities.isCreativeMode) { Logger.WARNING("Preparing Lighter c"); GT_Utility.sendSoundToPlayers( - aWorld, (String) GregTech_API.sSoundList.get(6), 1.0F, 1.0F, aX, aY, aZ); + aWorld, + (String) GregTech_API.sSoundList.get(6), + 1.0F, + 1.0F, + aX, + aY, + aZ); aWorld.setBlock(aX, aY, aZ, Blocks.fire); rOutput = true; // ItemNBT.setLighterFuel(aStack, tFuelAmount); diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/items/behaviours/Behaviour_Grinder.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/items/behaviours/Behaviour_Grinder.java index a2106fe679..cb892da129 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/items/behaviours/Behaviour_Grinder.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/items/behaviours/Behaviour_Grinder.java @@ -1,9 +1,7 @@ package gtPlusPlus.xmod.gregtech.common.items.behaviours; -import gregtech.api.enums.SubTag; -import gregtech.api.interfaces.IItemBehaviour; -import gregtech.api.items.GT_MetaBase_Item; import java.util.List; + import net.minecraft.dispenser.IBlockSource; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; @@ -12,6 +10,10 @@ import net.minecraft.entity.projectile.EntityArrow; import net.minecraft.item.ItemStack; import net.minecraft.world.World; +import gregtech.api.enums.SubTag; +import gregtech.api.interfaces.IItemBehaviour; +import gregtech.api.items.GT_MetaBase_Item; + public class Behaviour_Grinder implements IItemBehaviour<GT_MetaBase_Item> { @Override @@ -21,35 +23,15 @@ public class Behaviour_Grinder implements IItemBehaviour<GT_MetaBase_Item> { } @Override - public boolean onItemUse( - GT_MetaBase_Item var1, - ItemStack var2, - EntityPlayer var3, - World var4, - int var5, - int var6, - int var7, - int var8, - float var9, - float var10, - float var11) { + public boolean onItemUse(GT_MetaBase_Item var1, ItemStack var2, EntityPlayer var3, World var4, int var5, int var6, + int var7, int var8, float var9, float var10, float var11) { // TODO Auto-generated method stub return false; } @Override - public boolean onItemUseFirst( - GT_MetaBase_Item var1, - ItemStack var2, - EntityPlayer var3, - World var4, - int var5, - int var6, - int var7, - int var8, - float var9, - float var10, - float var11) { + public boolean onItemUseFirst(GT_MetaBase_Item var1, ItemStack var2, EntityPlayer var3, World var4, int var5, + int var6, int var7, int var8, float var9, float var10, float var11) { // TODO Auto-generated method stub return false; } @@ -97,15 +79,15 @@ public class Behaviour_Grinder implements IItemBehaviour<GT_MetaBase_Item> { } @Override - public EntityArrow getProjectile( - GT_MetaBase_Item var1, SubTag var2, ItemStack var3, World var4, double var5, double var7, double var9) { + public EntityArrow getProjectile(GT_MetaBase_Item var1, SubTag var2, ItemStack var3, World var4, double var5, + double var7, double var9) { // TODO Auto-generated method stub return null; } @Override - public EntityArrow getProjectile( - GT_MetaBase_Item var1, SubTag var2, ItemStack var3, World var4, EntityLivingBase var5, float var6) { + public EntityArrow getProjectile(GT_MetaBase_Item var1, SubTag var2, ItemStack var3, World var4, + EntityLivingBase var5, float var6) { // TODO Auto-generated method stub return null; } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/items/behaviours/Behaviour_Prospecting_Ex.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/items/behaviours/Behaviour_Prospecting_Ex.java index 514e1070ac..307cde3233 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/items/behaviours/Behaviour_Prospecting_Ex.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/items/behaviours/Behaviour_Prospecting_Ex.java @@ -1,5 +1,16 @@ package gtPlusPlus.xmod.gregtech.common.items.behaviours; +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.fluids.IFluidBlock; + import gregtech.api.GregTech_API; import gregtech.api.enums.Materials; import gregtech.api.items.GT_MetaBase_Item; @@ -11,17 +22,9 @@ import gregtech.api.util.GT_Utility; import gregtech.common.blocks.GT_Block_Ores; import gregtech.common.blocks.GT_TileEntity_Ores; import gregtech.common.items.behaviors.Behaviour_Prospecting; -import java.util.Random; -import net.minecraft.block.Block; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.World; -import net.minecraftforge.common.util.ForgeDirection; -import net.minecraftforge.fluids.IFluidBlock; public class Behaviour_Prospecting_Ex extends Behaviour_Prospecting { + private final int mVanillaCosts; private final int mEUCosts; @@ -32,18 +35,9 @@ public class Behaviour_Prospecting_Ex extends Behaviour_Prospecting { } @Override - public boolean onItemUseFirst( - final GT_MetaBase_Item aItem, - final ItemStack aStack, - final EntityPlayer aPlayer, - final World aWorld, - final int aX, - final int aY, - final int aZ, - final int aSide, - final float hitX, - final float hitY, - final float hitZ) { + public boolean onItemUseFirst(final GT_MetaBase_Item aItem, final ItemStack aStack, final EntityPlayer aPlayer, + final World aWorld, final int aX, final int aY, final int aZ, final int aSide, final float hitX, + final float hitY, final float hitZ) { if (aWorld.isRemote) { return false; } @@ -56,9 +50,16 @@ public class Behaviour_Prospecting_Ex extends Behaviour_Prospecting { ItemData tAssotiation = GT_OreDictUnificator.getAssociation(new ItemStack(aBlock, 1, aMeta)); if ((tAssotiation != null) && (tAssotiation.mPrefix.toString().startsWith("ore"))) { GT_Utility.sendChatToPlayer( - aPlayer, "This is " + tAssotiation.mMaterial.mMaterial.mDefaultLocalName + " Ore."); + aPlayer, + "This is " + tAssotiation.mMaterial.mMaterial.mDefaultLocalName + " Ore."); GT_Utility.sendSoundToPlayers( - aWorld, GregTech_API.sSoundList.get(Integer.valueOf(1)), 1.0F, -1.0F, aX, aY, aZ); + aWorld, + GregTech_API.sSoundList.get(Integer.valueOf(1)), + 1.0F, + -1.0F, + aX, + aY, + aZ); return true; } if ((aBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, Blocks.stone)) @@ -69,15 +70,20 @@ public class Behaviour_Prospecting_Ex extends Behaviour_Prospecting { || (aBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, Blocks.grass))) { if (GT_ModHandler.damageOrDechargeItem(aStack, this.mVanillaCosts, this.mEUCosts, aPlayer)) { GT_Utility.sendSoundToPlayers( - aWorld, GregTech_API.sSoundList.get(Integer.valueOf(1)), 1.0F, -1.0F, aX, aY, aZ); + aWorld, + GregTech_API.sSoundList.get(Integer.valueOf(1)), + 1.0F, + -1.0F, + aX, + aY, + aZ); int tX = aX; int tY = aY; int tZ = aZ; int tMetaID = 0; final int tQuality = ((aItem instanceof GT_MetaGenerated_Tool) - ? ((GT_MetaGenerated_Tool) aItem).getHarvestLevel(aStack, "") - : 0) - * 3; + ? ((GT_MetaGenerated_Tool) aItem).getHarvestLevel(aStack, "") + : 0) * 3; int i = 0; for (final int j = 6 + tQuality; i < j; i++) { @@ -90,8 +96,7 @@ public class Behaviour_Prospecting_Ex extends Behaviour_Prospecting { GT_Utility.sendChatToPlayer(aPlayer, "There is Lava behind this Block."); break; } - if ((tBlock == Blocks.water) - || (tBlock == Blocks.flowing_water) + if ((tBlock == Blocks.water) || (tBlock == Blocks.flowing_water) || ((tBlock instanceof IFluidBlock))) { GT_Utility.sendChatToPlayer(aPlayer, "There is a Liquid behind this Block."); break; @@ -118,19 +123,19 @@ public class Behaviour_Prospecting_Ex extends Behaviour_Prospecting { if ((tBlock instanceof GT_Block_Ores)) { final TileEntity tTileEntity = aWorld.getTileEntity(tX, tY, tZ); if ((tTileEntity instanceof GT_TileEntity_Ores)) { - final Materials tMaterial = GregTech_API.sGeneratedMaterials[ - (((GT_TileEntity_Ores) tTileEntity).mMetaData % 1000)]; + final Materials tMaterial = GregTech_API.sGeneratedMaterials[(((GT_TileEntity_Ores) tTileEntity).mMetaData + % 1000)]; if ((tMaterial != null) && (tMaterial != Materials._NULL)) { GT_Utility.sendChatToPlayer( - aPlayer, "Found traces of " + tMaterial.mDefaultLocalName + " Ore."); + aPlayer, + "Found traces of " + tMaterial.mDefaultLocalName + " Ore."); return true; } } } else { tMetaID = aWorld.getBlockMetadata(tX, tY, tZ); tAssotiation = GT_OreDictUnificator.getAssociation(new ItemStack(tBlock, 1, tMetaID)); - if ((tAssotiation != null) - && (tAssotiation.mPrefix.toString().startsWith("ore"))) { + if ((tAssotiation != null) && (tAssotiation.mPrefix.toString().startsWith("ore"))) { GT_Utility.sendChatToPlayer( aPlayer, "Found traces of " + tAssotiation.mMaterial.mMaterial.mDefaultLocalName + " Ore."); diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/items/covers/MetaItemCoverCasings.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/items/covers/MetaItemCoverCasings.java index b1f2309b69..e34ca2b77f 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/items/covers/MetaItemCoverCasings.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/items/covers/MetaItemCoverCasings.java @@ -1,14 +1,15 @@ package gtPlusPlus.xmod.gregtech.common.items.covers; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.IIcon; + import gregtech.api.enums.GT_Values; import gregtech.api.enums.Textures; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.util.math.MathUtils; import gtPlusPlus.xmod.gregtech.common.items.MetaCustomCoverItem; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.item.ItemStack; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.IIcon; public class MetaItemCoverCasings extends MetaCustomCoverItem { @@ -40,8 +41,8 @@ public class MetaItemCoverCasings extends MetaCustomCoverItem { @Override public String getItemStackDisplayName(final ItemStack tItem) { return EnumChatFormatting.LIGHT_PURPLE - + GT_Values.VOLTAGE_NAMES[ - MathUtils.balance(tItem.getItemDamage(), 0, GT_Values.VOLTAGE_NAMES.length - 1)] + + GT_Values.VOLTAGE_NAMES[MathUtils + .balance(tItem.getItemDamage(), 0, GT_Values.VOLTAGE_NAMES.length - 1)] + " Machine Plate Cover"; // super.getItemStackDisplayName(tItem); } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/render/GTPP_CapeRenderer.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/render/GTPP_CapeRenderer.java index 384e264dcb..b8eb41274a 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/render/GTPP_CapeRenderer.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/render/GTPP_CapeRenderer.java @@ -1,21 +1,11 @@ package gtPlusPlus.xmod.gregtech.common.render; -import com.mojang.authlib.GameProfile; -import gregtech.api.util.GT_Utility; -import gtPlusPlus.api.objects.Logger; -import gtPlusPlus.api.objects.data.AutoMap; -import gtPlusPlus.api.objects.data.Pair; -import gtPlusPlus.core.lib.CORE; -import gtPlusPlus.core.lib.CORE.ConfigSwitches; -import gtPlusPlus.core.proxy.ClientProxy; -import gtPlusPlus.core.util.data.AES; -import gtPlusPlus.core.util.data.FileUtils; -import gtPlusPlus.core.util.math.MathUtils; import java.io.*; import java.net.URL; import java.util.Date; import java.util.List; import java.util.UUID; + import net.minecraft.client.entity.AbstractClientPlayer; import net.minecraft.client.model.ModelBiped; import net.minecraft.client.renderer.entity.RenderManager; @@ -25,18 +15,30 @@ import net.minecraft.server.MinecraftServer; import net.minecraft.util.MathHelper; import net.minecraft.util.ResourceLocation; import net.minecraftforge.client.event.RenderPlayerEvent; + import org.apache.commons.io.IOUtils; import org.lwjgl.opengl.GL11; +import com.mojang.authlib.GameProfile; + +import gregtech.api.util.GT_Utility; +import gtPlusPlus.api.objects.Logger; +import gtPlusPlus.api.objects.data.AutoMap; +import gtPlusPlus.api.objects.data.Pair; +import gtPlusPlus.core.lib.CORE; +import gtPlusPlus.core.lib.CORE.ConfigSwitches; +import gtPlusPlus.core.proxy.ClientProxy; +import gtPlusPlus.core.util.data.AES; +import gtPlusPlus.core.util.data.FileUtils; +import gtPlusPlus.core.util.math.MathUtils; + public class GTPP_CapeRenderer extends RenderPlayer { - private static final ResourceLocation[] mCapes = { - new ResourceLocation("miscutils:textures/OrangeHD.png"), - new ResourceLocation("miscutils:textures/FancyCapeHD.png"), - new ResourceLocation("miscutils:textures/TesterCapeHD.png"), - new ResourceLocation("miscutils:textures/PatreonCapeHD.png"), - new ResourceLocation("miscutils:textures/DevCapeHD.png"), - }; + private static final ResourceLocation[] mCapes = { new ResourceLocation("miscutils:textures/OrangeHD.png"), + new ResourceLocation("miscutils:textures/FancyCapeHD.png"), + new ResourceLocation("miscutils:textures/TesterCapeHD.png"), + new ResourceLocation("miscutils:textures/PatreonCapeHD.png"), + new ResourceLocation("miscutils:textures/DevCapeHD.png"), }; private final boolean mInit; @@ -93,8 +95,7 @@ public class GTPP_CapeRenderer extends RenderPlayer { if (!hasResourceChecked) { // Get players UUID - String aPlayerUUID = - aPlayer != null ? aPlayer.getGameProfile().getId().toString() : "BAD"; + String aPlayerUUID = aPlayer != null ? aPlayer.getGameProfile().getId().toString() : "BAD"; // If for whatever reason this fails, we just exit early. if (aPlayerUUID.equals("BAD")) { @@ -173,10 +174,8 @@ public class GTPP_CapeRenderer extends RenderPlayer { } // If player is invisible, don't render. - if (GT_Utility.getFullInvisibility(aPlayer) - || aPlayer.isInvisible() - || GT_Utility.getPotion( - aPlayer, Integer.valueOf(Potion.invisibility.id).intValue())) { + if (GT_Utility.getFullInvisibility(aPlayer) || aPlayer.isInvisible() + || GT_Utility.getPotion(aPlayer, Integer.valueOf(Potion.invisibility.id).intValue())) { aEvent.setCanceled(true); return false; } @@ -185,14 +184,11 @@ public class GTPP_CapeRenderer extends RenderPlayer { bindTexture(tResource); GL11.glPushMatrix(); GL11.glTranslatef(0.0F, 0.0F, 0.125F); - double d0 = aPlayer.field_71091_bM - + (aPlayer.field_71094_bP - aPlayer.field_71091_bM) * aPartialTicks + double d0 = aPlayer.field_71091_bM + (aPlayer.field_71094_bP - aPlayer.field_71091_bM) * aPartialTicks - (aPlayer.prevPosX + (aPlayer.posX - aPlayer.prevPosX) * aPartialTicks); - double d1 = aPlayer.field_71096_bN - + (aPlayer.field_71095_bQ - aPlayer.field_71096_bN) * aPartialTicks + double d1 = aPlayer.field_71096_bN + (aPlayer.field_71095_bQ - aPlayer.field_71096_bN) * aPartialTicks - (aPlayer.prevPosY + (aPlayer.posY - aPlayer.prevPosY) * aPartialTicks); - double d2 = aPlayer.field_71097_bO - + (aPlayer.field_71085_bR - aPlayer.field_71097_bO) * aPartialTicks + double d2 = aPlayer.field_71097_bO + (aPlayer.field_71085_bR - aPlayer.field_71097_bO) * aPartialTicks - (aPlayer.prevPosZ + (aPlayer.posZ - aPlayer.prevPosZ) * aPartialTicks); float f6 = aPlayer.prevRenderYawOffset + (aPlayer.renderYawOffset - aPlayer.prevRenderYawOffset) * aPartialTicks; @@ -211,9 +207,9 @@ public class GTPP_CapeRenderer extends RenderPlayer { f8 = 0.0F; } float f10 = aPlayer.prevCameraYaw + (aPlayer.cameraYaw - aPlayer.prevCameraYaw) * aPartialTicks; - f7 += MathHelper.sin((aPlayer.prevDistanceWalkedModified - + (aPlayer.distanceWalkedModified - aPlayer.prevDistanceWalkedModified) - * aPartialTicks) + f7 += MathHelper.sin( + (aPlayer.prevDistanceWalkedModified + + (aPlayer.distanceWalkedModified - aPlayer.prevDistanceWalkedModified) * aPartialTicks) * 6.0F) * 32.0F * f10; @@ -238,6 +234,7 @@ public class GTPP_CapeRenderer extends RenderPlayer { @Deprecated /** * Should be able to get the username from a UUID + * * @param name - Players Name * @param uuid - Players known UUID * @return - The newest Player name @@ -250,8 +247,7 @@ public class GTPP_CapeRenderer extends RenderPlayer { UUID g = UUID.fromString(uuid); if (g != null) { Logger.WORLD("[Capes++] Mojang/Cache checking for " + name + "."); - GameProfile profile = - MinecraftServer.getServer().func_152358_ax().func_152652_a(g); + GameProfile profile = MinecraftServer.getServer().func_152358_ax().func_152652_a(g); if (profile != null) { Logger.WARNING("[Capes++] Found for UUID check: " + profile.getName() + "."); return profile.getName(); @@ -260,8 +256,7 @@ public class GTPP_CapeRenderer extends RenderPlayer { g = UUID.fromString(uuid.replace("-", "")); if (g != null) { Logger.WORLD("[Capes++] Mojang/Cache checking for " + name + "."); - GameProfile profile = - MinecraftServer.getServer().func_152358_ax().func_152652_a(g); + GameProfile profile = MinecraftServer.getServer().func_152358_ax().func_152652_a(g); if (profile != null) { Logger.WARNING("[Capes++] Found for UUID check 2: " + profile.getName() + "."); return profile.getName(); @@ -273,8 +268,7 @@ public class GTPP_CapeRenderer extends RenderPlayer { if (name != null) { if (name.length() > 0) { Logger.WORLD("[Capes++] Mojang/Cache checking for " + name + "."); - GameProfile profile = - MinecraftServer.getServer().func_152358_ax().func_152655_a(name); + GameProfile profile = MinecraftServer.getServer().func_152358_ax().func_152655_a(name); if (profile != null) { Logger.WARNING("[Capes++] Found for name check: " + profile.getName() + "."); return profile.getName(); @@ -282,8 +276,7 @@ public class GTPP_CapeRenderer extends RenderPlayer { } } Logger.WORLD("[Capes++] Failed UUID check for " + name + "."); - } catch (Throwable t) { - } + } catch (Throwable t) {} return name; } @@ -356,8 +349,7 @@ public class GTPP_CapeRenderer extends RenderPlayer { } private static final boolean isDownloadedCapeListBigger(File aFile) { - double aExistingFileSize = - (doesCapeCacheExistLocally() ? getCapeCache().length() : 0); + double aExistingFileSize = (doesCapeCacheExistLocally() ? getCapeCache().length() : 0); double aNewFileSize = aFile.length(); if (aNewFileSize > aExistingFileSize) { return true; @@ -405,8 +397,8 @@ public class GTPP_CapeRenderer extends RenderPlayer { e.printStackTrace(); } if (tempFile == null) { - tempFile = FileUtils.createFile( - "", "gtpp-" + MathUtils.randInt(Short.MAX_VALUE, (Integer.MAX_VALUE / 2)), "tmp"); + tempFile = FileUtils + .createFile("", "gtpp-" + MathUtils.randInt(Short.MAX_VALUE, (Integer.MAX_VALUE / 2)), "tmp"); } tempFile.deleteOnExit(); return tempFile; @@ -439,36 +431,50 @@ public class GTPP_CapeRenderer extends RenderPlayer { int aCapeTypeID = aCapeTypeID2; Pair<String, String> aFinalString = new Pair<String, String>( "UUID: " + aSplitData[1], - "Username: " - + (aSplitData[2] != null && aSplitData[0].length() > 0 - ? aSplitData[2] - : "Not Specified")); + "Username: " + (aSplitData[2] != null && aSplitData[0].length() > 0 + ? aSplitData[2] + : "Not Specified")); Logger.INFO("Cape Type: " + aCapeTypeID); switch (aCapeTypeID) { case 0: aCapeType1.add(aFinalString); - Logger.INFO("Added user to map " + aCapeTypeID + ", map now holds " - + aCapeType1.size() + " users."); + Logger.INFO( + "Added user to map " + aCapeTypeID + + ", map now holds " + + aCapeType1.size() + + " users."); break; case 1: aCapeType2.add(aFinalString); - Logger.INFO("Added user to map " + aCapeTypeID + ", map now holds " - + aCapeType2.size() + " users."); + Logger.INFO( + "Added user to map " + aCapeTypeID + + ", map now holds " + + aCapeType2.size() + + " users."); break; case 2: aCapeType3.add(aFinalString); - Logger.INFO("Added user to map " + aCapeTypeID + ", map now holds " - + aCapeType3.size() + " users."); + Logger.INFO( + "Added user to map " + aCapeTypeID + + ", map now holds " + + aCapeType3.size() + + " users."); break; case 3: aCapeType4.add(aFinalString); - Logger.INFO("Added user to map " + aCapeTypeID + ", map now holds " - + aCapeType4.size() + " users."); + Logger.INFO( + "Added user to map " + aCapeTypeID + + ", map now holds " + + aCapeType4.size() + + " users."); break; case 4: aCapeType5.add(aFinalString); - Logger.INFO("Added user to map " + aCapeTypeID + ", map now holds " - + aCapeType5.size() + " users."); + Logger.INFO( + "Added user to map " + aCapeTypeID + + ", map now holds " + + aCapeType5.size() + + " users."); break; default: break; @@ -477,8 +483,7 @@ public class GTPP_CapeRenderer extends RenderPlayer { } } } - if (!aCapeType1.isEmpty() - || !aCapeType2.isEmpty() + if (!aCapeType1.isEmpty() || !aCapeType2.isEmpty() || !aCapeType3.isEmpty() || !aCapeType4.isEmpty() || !aCapeType5.isEmpty()) { diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/render/GTPP_FlaskRenderer.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/render/GTPP_FlaskRenderer.java index 1d4e367c4f..6267609aba 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/render/GTPP_FlaskRenderer.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/render/GTPP_FlaskRenderer.java @@ -1,9 +1,5 @@ package gtPlusPlus.xmod.gregtech.common.render; -import cpw.mods.fml.relauncher.SideOnly; -import gregtech.common.items.GT_VolumetricFlask; -import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; -import ic2.core.util.DrawUtil; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.ItemRenderer; import net.minecraft.client.renderer.Tessellator; @@ -13,8 +9,14 @@ import net.minecraft.util.IIcon; import net.minecraftforge.client.IItemRenderer; import net.minecraftforge.client.MinecraftForgeClient; import net.minecraftforge.fluids.FluidStack; + import org.lwjgl.opengl.GL11; +import cpw.mods.fml.relauncher.SideOnly; +import gregtech.common.items.GT_VolumetricFlask; +import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; +import ic2.core.util.DrawUtil; + @SideOnly(cpw.mods.fml.relauncher.Side.CLIENT) public final class GTPP_FlaskRenderer implements net.minecraftforge.client.IItemRenderer { diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/render/GTPP_Render_MachineBlock.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/render/GTPP_Render_MachineBlock.java index 1a5117ac2e..5d7209b203 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/render/GTPP_Render_MachineBlock.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/render/GTPP_Render_MachineBlock.java @@ -1,5 +1,13 @@ package gtPlusPlus.xmod.gregtech.common.render; +import net.minecraft.block.Block; +import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.IBlockAccess; + +import org.lwjgl.opengl.GL11; + import cpw.mods.fml.client.registry.RenderingRegistry; import gregtech.api.GregTech_API; import gregtech.api.interfaces.ITexture; @@ -11,12 +19,6 @@ import gregtech.common.blocks.GT_Block_Machines; import gregtech.common.render.GT_Renderer_Block; import gtPlusPlus.xmod.gregtech.common.blocks.GTPP_Block_Machines; import gtPlusPlus.xmod.gregtech.common.helpers.GT_MethodHelper; -import net.minecraft.block.Block; -import net.minecraft.client.renderer.RenderBlocks; -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.IBlockAccess; -import org.lwjgl.opengl.GL11; public class GTPP_Render_MachineBlock extends GT_Renderer_Block { @@ -28,8 +30,8 @@ public class GTPP_Render_MachineBlock extends GT_Renderer_Block { RenderingRegistry.registerBlockHandler(this); } - private static ITexture[] getTexture( - IMetaTileEntity arg0, int arg1, int arg2, int arg3, boolean arg4, boolean arg5) { + private static ITexture[] getTexture(IMetaTileEntity arg0, int arg1, int arg2, int arg3, boolean arg4, + boolean arg5) { IGregTechTileEntity arg0b = arg0.getBaseMetaTileEntity(); return arg0.getTexture(arg0b, (byte) arg1, (byte) arg2, (byte) arg3, arg4, arg5); } @@ -43,8 +45,8 @@ public class GTPP_Render_MachineBlock extends GT_Renderer_Block { GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); GL11.glTranslatef(-0.5F, -0.5F, -0.5F); if (tMetaTileEntity.getBaseMetaTileEntity() instanceof IPipeRenderedTileEntity) { - float tThickness = - ((IPipeRenderedTileEntity) tMetaTileEntity.getBaseMetaTileEntity()).getThickNess(); + float tThickness = ((IPipeRenderedTileEntity) tMetaTileEntity.getBaseMetaTileEntity()) + .getThickNess(); float sp = (1.0F - tThickness) / 2.0F; aBlock.setBlockBounds(0.0F, sp, sp, 1.0F, sp + tThickness, sp + tThickness); aRenderer.setRenderBoundsFromBlock(aBlock); @@ -202,24 +204,29 @@ public class GTPP_Render_MachineBlock extends GT_Renderer_Block { } } - public static boolean renderStandardBlock( - IBlockAccess aWorld, int aX, int aY, int aZ, Block aBlock, RenderBlocks aRenderer) { + public static boolean renderStandardBlock(IBlockAccess aWorld, int aX, int aY, int aZ, Block aBlock, + RenderBlocks aRenderer) { TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); return tTileEntity instanceof ITexturedTileEntity - ? renderStandardBlock(aWorld, aX, aY, aZ, aBlock, aRenderer, new ITexture[][] { - GT_MethodHelper.getTexture(tTileEntity, aBlock, (byte) 0), - GT_MethodHelper.getTexture(tTileEntity, aBlock, (byte) 1), - GT_MethodHelper.getTexture(tTileEntity, aBlock, (byte) 2), - GT_MethodHelper.getTexture(tTileEntity, aBlock, (byte) 3), - GT_MethodHelper.getTexture(tTileEntity, aBlock, (byte) 4), - GT_MethodHelper.getTexture(tTileEntity, aBlock, (byte) 5) - }) + ? renderStandardBlock( + aWorld, + aX, + aY, + aZ, + aBlock, + aRenderer, + new ITexture[][] { GT_MethodHelper.getTexture(tTileEntity, aBlock, (byte) 0), + GT_MethodHelper.getTexture(tTileEntity, aBlock, (byte) 1), + GT_MethodHelper.getTexture(tTileEntity, aBlock, (byte) 2), + GT_MethodHelper.getTexture(tTileEntity, aBlock, (byte) 3), + GT_MethodHelper.getTexture(tTileEntity, aBlock, (byte) 4), + GT_MethodHelper.getTexture(tTileEntity, aBlock, (byte) 5) }) : false; } - public static boolean renderStandardBlock( - IBlockAccess aWorld, int aX, int aY, int aZ, Block aBlock, RenderBlocks aRenderer, ITexture[][] aTextures) { + public static boolean renderStandardBlock(IBlockAccess aWorld, int aX, int aY, int aZ, Block aBlock, + RenderBlocks aRenderer, ITexture[][] aTextures) { aBlock.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); aRenderer.setRenderBoundsFromBlock(aBlock); renderNegativeYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, aTextures[0], true); @@ -231,14 +238,8 @@ public class GTPP_Render_MachineBlock extends GT_Renderer_Block { return true; } - public static boolean renderPipeBlock( - IBlockAccess aWorld, - int aX, - int aY, - int aZ, - Block aBlock, - IPipeRenderedTileEntity aTileEntity, - RenderBlocks aRenderer) { + public static boolean renderPipeBlock(IBlockAccess aWorld, int aX, int aY, int aZ, Block aBlock, + IPipeRenderedTileEntity aTileEntity, RenderBlocks aRenderer) { byte aConnections = aTileEntity.getConnections(); if ((aConnections & 192) != 0) { return renderStandardBlock(aWorld, aX, aY, aZ, aBlock, aRenderer); @@ -564,22 +565,15 @@ public class GTPP_Render_MachineBlock extends GT_Renderer_Block { } } - public static void renderNegativeYFacing( - IBlockAccess aWorld, - RenderBlocks aRenderer, - Block aBlock, - int aX, - int aY, - int aZ, - ITexture[] aIcon, - boolean aFullBlock) { + public static void renderNegativeYFacing(IBlockAccess aWorld, RenderBlocks aRenderer, Block aBlock, int aX, int aY, + int aZ, ITexture[] aIcon, boolean aFullBlock) { if (aWorld != null) { if (aFullBlock && !aBlock.shouldSideBeRendered(aWorld, aX, aY - 1, aZ, 0)) { return; } - Tessellator.instance.setBrightness( - aBlock.getMixedBrightnessForBlock(aWorld, aX, aFullBlock ? aY - 1 : aY, aZ)); + Tessellator.instance + .setBrightness(aBlock.getMixedBrightnessForBlock(aWorld, aX, aFullBlock ? aY - 1 : aY, aZ)); } if (aIcon != null) { @@ -593,22 +587,15 @@ public class GTPP_Render_MachineBlock extends GT_Renderer_Block { aRenderer.flipTexture = false; } - public static void renderPositiveYFacing( - IBlockAccess aWorld, - RenderBlocks aRenderer, - Block aBlock, - int aX, - int aY, - int aZ, - ITexture[] aIcon, - boolean aFullBlock) { + public static void renderPositiveYFacing(IBlockAccess aWorld, RenderBlocks aRenderer, Block aBlock, int aX, int aY, + int aZ, ITexture[] aIcon, boolean aFullBlock) { if (aWorld != null) { if (aFullBlock && !aBlock.shouldSideBeRendered(aWorld, aX, aY + 1, aZ, 1)) { return; } - Tessellator.instance.setBrightness( - aBlock.getMixedBrightnessForBlock(aWorld, aX, aFullBlock ? aY + 1 : aY, aZ)); + Tessellator.instance + .setBrightness(aBlock.getMixedBrightnessForBlock(aWorld, aX, aFullBlock ? aY + 1 : aY, aZ)); } if (aIcon != null) { @@ -622,22 +609,15 @@ public class GTPP_Render_MachineBlock extends GT_Renderer_Block { aRenderer.flipTexture = false; } - public static void renderNegativeZFacing( - IBlockAccess aWorld, - RenderBlocks aRenderer, - Block aBlock, - int aX, - int aY, - int aZ, - ITexture[] aIcon, - boolean aFullBlock) { + public static void renderNegativeZFacing(IBlockAccess aWorld, RenderBlocks aRenderer, Block aBlock, int aX, int aY, + int aZ, ITexture[] aIcon, boolean aFullBlock) { if (aWorld != null) { if (aFullBlock && !aBlock.shouldSideBeRendered(aWorld, aX, aY, aZ - 1, 2)) { return; } - Tessellator.instance.setBrightness( - aBlock.getMixedBrightnessForBlock(aWorld, aX, aY, aFullBlock ? aZ - 1 : aZ)); + Tessellator.instance + .setBrightness(aBlock.getMixedBrightnessForBlock(aWorld, aX, aY, aFullBlock ? aZ - 1 : aZ)); } aRenderer.flipTexture = !aFullBlock; @@ -652,22 +632,15 @@ public class GTPP_Render_MachineBlock extends GT_Renderer_Block { aRenderer.flipTexture = false; } - public static void renderPositiveZFacing( - IBlockAccess aWorld, - RenderBlocks aRenderer, - Block aBlock, - int aX, - int aY, - int aZ, - ITexture[] aIcon, - boolean aFullBlock) { + public static void renderPositiveZFacing(IBlockAccess aWorld, RenderBlocks aRenderer, Block aBlock, int aX, int aY, + int aZ, ITexture[] aIcon, boolean aFullBlock) { if (aWorld != null) { if (aFullBlock && !aBlock.shouldSideBeRendered(aWorld, aX, aY, aZ + 1, 3)) { return; } - Tessellator.instance.setBrightness( - aBlock.getMixedBrightnessForBlock(aWorld, aX, aY, aFullBlock ? aZ + 1 : aZ)); + Tessellator.instance + .setBrightness(aBlock.getMixedBrightnessForBlock(aWorld, aX, aY, aFullBlock ? aZ + 1 : aZ)); } if (aIcon != null) { @@ -681,22 +654,15 @@ public class GTPP_Render_MachineBlock extends GT_Renderer_Block { aRenderer.flipTexture = false; } - public static void renderNegativeXFacing( - IBlockAccess aWorld, - RenderBlocks aRenderer, - Block aBlock, - int aX, - int aY, - int aZ, - ITexture[] aIcon, - boolean aFullBlock) { + public static void renderNegativeXFacing(IBlockAccess aWorld, RenderBlocks aRenderer, Block aBlock, int aX, int aY, + int aZ, ITexture[] aIcon, boolean aFullBlock) { if (aWorld != null) { if (aFullBlock && !aBlock.shouldSideBeRendered(aWorld, aX - 1, aY, aZ, 4)) { return; } - Tessellator.instance.setBrightness( - aBlock.getMixedBrightnessForBlock(aWorld, aFullBlock ? aX - 1 : aX, aY, aZ)); + Tessellator.instance + .setBrightness(aBlock.getMixedBrightnessForBlock(aWorld, aFullBlock ? aX - 1 : aX, aY, aZ)); } if (aIcon != null) { @@ -710,22 +676,15 @@ public class GTPP_Render_MachineBlock extends GT_Renderer_Block { aRenderer.flipTexture = false; } - public static void renderPositiveXFacing( - IBlockAccess aWorld, - RenderBlocks aRenderer, - Block aBlock, - int aX, - int aY, - int aZ, - ITexture[] aIcon, - boolean aFullBlock) { + public static void renderPositiveXFacing(IBlockAccess aWorld, RenderBlocks aRenderer, Block aBlock, int aX, int aY, + int aZ, ITexture[] aIcon, boolean aFullBlock) { if (aWorld != null) { if (aFullBlock && !aBlock.shouldSideBeRendered(aWorld, aX + 1, aY, aZ, 5)) { return; } - Tessellator.instance.setBrightness( - aBlock.getMixedBrightnessForBlock(aWorld, aFullBlock ? aX + 1 : aX, aY, aZ)); + Tessellator.instance + .setBrightness(aBlock.getMixedBrightnessForBlock(aWorld, aFullBlock ? aX + 1 : aX, aY, aZ)); } aRenderer.flipTexture = !aFullBlock; @@ -743,8 +702,7 @@ public class GTPP_Render_MachineBlock extends GT_Renderer_Block { public void renderInventoryBlock(Block aBlock, int aMeta, int aModelID, RenderBlocks aRenderer) { aMeta += 30400; if (aBlock instanceof GT_Block_Machines || aBlock instanceof GTPP_Block_Machines) { - if (aMeta > 0 - && aMeta < GregTech_API.METATILEENTITIES.length + if (aMeta > 0 && aMeta < GregTech_API.METATILEENTITIES.length && GregTech_API.METATILEENTITIES[aMeta] != null && !GregTech_API.METATILEENTITIES[aMeta].renderInInventory(aBlock, aMeta, aRenderer)) { renderNormalInventoryMetaTileEntity(aBlock, aMeta, aRenderer); @@ -755,21 +713,25 @@ public class GTPP_Render_MachineBlock extends GT_Renderer_Block { GL11.glTranslatef(0.5F, 0.5F, 0.5F); } - public boolean renderWorldBlock( - IBlockAccess aWorld, int aX, int aY, int aZ, Block aBlock, int aModelID, RenderBlocks aRenderer) { + public boolean renderWorldBlock(IBlockAccess aWorld, int aX, int aY, int aZ, Block aBlock, int aModelID, + RenderBlocks aRenderer) { TileEntity aTileEntity = aWorld.getTileEntity(aX, aY, aZ); - return aTileEntity == null - ? false + return aTileEntity == null ? false : (aTileEntity instanceof IGregTechTileEntity - && ((IGregTechTileEntity) aTileEntity).getMetaTileEntity() != null - && ((IGregTechTileEntity) aTileEntity) - .getMetaTileEntity() - .renderInWorld(aWorld, aX, aY, aZ, aBlock, aRenderer) - ? true - : (aTileEntity instanceof IPipeRenderedTileEntity - ? renderPipeBlock( - aWorld, aX, aY, aZ, aBlock, (IPipeRenderedTileEntity) aTileEntity, aRenderer) - : renderStandardBlock(aWorld, aX, aY, aZ, aBlock, aRenderer))); + && ((IGregTechTileEntity) aTileEntity).getMetaTileEntity() != null + && ((IGregTechTileEntity) aTileEntity).getMetaTileEntity() + .renderInWorld(aWorld, aX, aY, aZ, aBlock, aRenderer) + ? true + : (aTileEntity instanceof IPipeRenderedTileEntity + ? renderPipeBlock( + aWorld, + aX, + aY, + aZ, + aBlock, + (IPipeRenderedTileEntity) aTileEntity, + aRenderer) + : renderStandardBlock(aWorld, aX, aY, aZ, aBlock, aRenderer))); } public boolean shouldRender3DInInventory(int aModel) { diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/GT_MetaTileEntity_ElectricAutoWorkbench.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/GT_MetaTileEntity_ElectricAutoWorkbench.java index bf56872d52..f02bf0193e 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/GT_MetaTileEntity_ElectricAutoWorkbench.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/GT_MetaTileEntity_ElectricAutoWorkbench.java @@ -1,11 +1,19 @@ package gtPlusPlus.xmod.gregtech.common.tileentities.automation; +import java.util.ArrayList; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraftforge.oredict.OreDictionary; + import com.gtnewhorizons.modularui.api.screen.ModularWindow; import com.gtnewhorizons.modularui.api.screen.UIBuildContext; import com.gtnewhorizons.modularui.common.widget.CycleButtonWidget; import com.gtnewhorizons.modularui.common.widget.DrawableWidget; import com.gtnewhorizons.modularui.common.widget.SlotGroup; import com.gtnewhorizons.modularui.common.widget.SlotWidget; + import gregtech.api.enums.GT_Values; import gregtech.api.enums.OrePrefixes; import gregtech.api.enums.Textures; @@ -25,11 +33,6 @@ import gregtech.api.util.GT_Utility; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.xmod.gregtech.api.gui.GTPP_UITextures; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; -import java.util.ArrayList; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraftforge.oredict.OreDictionary; public class GT_MetaTileEntity_ElectricAutoWorkbench extends GT_MetaTileEntity_BasicTank implements IAddGregtechLogo { @@ -51,8 +54,8 @@ public class GT_MetaTileEntity_ElectricAutoWorkbench extends GT_MetaTileEntity_B mLocalName = "Auto Workbench (" + GT_Values.VN[aTier] + ")"; } - public GT_MetaTileEntity_ElectricAutoWorkbench( - final String aName, final int aTier, final String aDescription, final ITexture[][][] aTextures) { + public GT_MetaTileEntity_ElectricAutoWorkbench(final String aName, final int aTier, final String aDescription, + final ITexture[][][] aTextures) { super(aName, aTier, 30, aDescription, aTextures); } @@ -193,8 +196,7 @@ public class GT_MetaTileEntity_ElectricAutoWorkbench extends GT_MetaTileEntity_B @Override public boolean allowCoverOnSide(byte aSide, GT_ItemStack aStack) { - return aSide != getBaseMetaTileEntity().getFrontFacing() - && aSide != getBaseMetaTileEntity().getBackFacing(); + return aSide != getBaseMetaTileEntity().getFrontFacing() && aSide != getBaseMetaTileEntity().getBackFacing(); } private void switchMode() { @@ -204,15 +206,13 @@ public class GT_MetaTileEntity_ElectricAutoWorkbench extends GT_MetaTileEntity_B @Override public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { super.onPostTick(aBaseMetaTileEntity, aTick); - if (getBaseMetaTileEntity().isAllowedToWork() - && getBaseMetaTileEntity().isServerSide() + if (getBaseMetaTileEntity().isAllowedToWork() && getBaseMetaTileEntity().isServerSide() && getBaseMetaTileEntity().getUniversalEnergyStored() >= (mMode == 5 || mMode == 6 ? 128 : 2048) && (getBaseMetaTileEntity().hasWorkJustBeenEnabled() || --mTicksUntilNextUpdate < 1)) { mTicksUntilNextUpdate = 32; for (byte i = 19; i < 28; i++) { - if (mInventory[i] != null - && mInventory[i].isItemStackDamageable() + if (mInventory[i] != null && mInventory[i].isItemStackDamageable() && mInventory[i].getItem().hasContainerItem()) { mInventory[i].setItemDamage(OreDictionary.WILDCARD_VALUE); } @@ -223,12 +223,10 @@ public class GT_MetaTileEntity_ElectricAutoWorkbench extends GT_MetaTileEntity_B ItemStack tOutput = GT_Utility.fillFluidContainer(mFluid, mInventory[i], false, true); if (tOutput != null) { for (byte j = 0; j < 9; j++) { - if (mInventory[j] == null - || (GT_Utility.areStacksEqual(tOutput, mInventory[j]) - && mInventory[j].stackSize + tOutput.stackSize - <= tOutput.getMaxStackSize())) { - mFluid.amount -= - GT_Utility.getFluidForFilledItem(tOutput, true).amount * tOutput.stackSize; + if (mInventory[j] == null || (GT_Utility.areStacksEqual(tOutput, mInventory[j]) + && mInventory[j].stackSize + tOutput.stackSize <= tOutput.getMaxStackSize())) { + mFluid.amount -= GT_Utility.getFluidForFilledItem(tOutput, true).amount + * tOutput.stackSize; getBaseMetaTileEntity().decrStackSize(i, 1); if (mInventory[j] == null) { mInventory[j] = tOutput; @@ -287,25 +285,19 @@ public class GT_MetaTileEntity_ElectricAutoWorkbench extends GT_MetaTileEntity_B tTempStack = GT_Utility.copy(mInventory[mCurrentSlot]); tTempStack.stackSize = 1; tRecipe[0] = tTempStack; - if (GT_ModHandler.getAllRecipeOutput( - getBaseMetaTileEntity().getWorld(), tRecipe) - == null) { + if (GT_ModHandler.getAllRecipeOutput(getBaseMetaTileEntity().getWorld(), tRecipe) == null) { tRecipe[1] = tTempStack; tRecipe[3] = tTempStack; tRecipe[4] = tTempStack; } else break; - if (GT_ModHandler.getAllRecipeOutput( - getBaseMetaTileEntity().getWorld(), tRecipe) - == null) { + if (GT_ModHandler.getAllRecipeOutput(getBaseMetaTileEntity().getWorld(), tRecipe) == null) { tRecipe[2] = tTempStack; tRecipe[5] = tTempStack; tRecipe[6] = tTempStack; tRecipe[7] = tTempStack; tRecipe[8] = tTempStack; } else break; - if (GT_ModHandler.getAllRecipeOutput( - getBaseMetaTileEntity().getWorld(), tRecipe) - == null) { + if (GT_ModHandler.getAllRecipeOutput(getBaseMetaTileEntity().getWorld(), tRecipe) == null) { if (mInventory[18] == null) { mInventory[18] = mInventory[mCurrentSlot]; mInventory[mCurrentSlot] = null; @@ -326,9 +318,7 @@ public class GT_MetaTileEntity_ElectricAutoWorkbench extends GT_MetaTileEntity_B tTempStack = GT_Utility.copy(mInventory[mCurrentSlot]); tTempStack.stackSize = 1; tRecipe[0] = tTempStack; - if (GT_ModHandler.getAllRecipeOutput( - getBaseMetaTileEntity().getWorld(), tRecipe) - == null) { + if (GT_ModHandler.getAllRecipeOutput(getBaseMetaTileEntity().getWorld(), tRecipe) == null) { if (mInventory[18] == null) { mInventory[18] = mInventory[mCurrentSlot]; mInventory[mCurrentSlot] = null; @@ -352,9 +342,7 @@ public class GT_MetaTileEntity_ElectricAutoWorkbench extends GT_MetaTileEntity_B tRecipe[1] = tTempStack; tRecipe[3] = tTempStack; tRecipe[4] = tTempStack; - if (GT_ModHandler.getAllRecipeOutput( - getBaseMetaTileEntity().getWorld(), tRecipe) - == null) { + if (GT_ModHandler.getAllRecipeOutput(getBaseMetaTileEntity().getWorld(), tRecipe) == null) { if (mInventory[18] == null) { mInventory[18] = mInventory[mCurrentSlot]; mInventory[mCurrentSlot] = null; @@ -383,9 +371,7 @@ public class GT_MetaTileEntity_ElectricAutoWorkbench extends GT_MetaTileEntity_B tRecipe[6] = tTempStack; tRecipe[7] = tTempStack; tRecipe[8] = tTempStack; - if (GT_ModHandler.getAllRecipeOutput( - getBaseMetaTileEntity().getWorld(), tRecipe) - == null) { + if (GT_ModHandler.getAllRecipeOutput(getBaseMetaTileEntity().getWorld(), tRecipe) == null) { if (mInventory[18] == null) { mInventory[18] = mInventory[mCurrentSlot]; mInventory[mCurrentSlot] = null; @@ -435,8 +421,7 @@ public class GT_MetaTileEntity_ElectricAutoWorkbench extends GT_MetaTileEntity_B tRecipe[1] = tTempStack; tRecipe[3] = tTempStack; tRecipe[4] = tTempStack; - if (GT_ModHandler.getAllRecipeOutput( - getBaseMetaTileEntity().getWorld(), tRecipe) + if (GT_ModHandler.getAllRecipeOutput(getBaseMetaTileEntity().getWorld(), tRecipe) == null) { if (mInventory[18] == null) { mInventory[18] = mInventory[mCurrentSlot]; @@ -457,8 +442,7 @@ public class GT_MetaTileEntity_ElectricAutoWorkbench extends GT_MetaTileEntity_B tRecipe[6] = tTempStack; tRecipe[7] = tTempStack; tRecipe[8] = tTempStack; - if (GT_ModHandler.getAllRecipeOutput( - getBaseMetaTileEntity().getWorld(), tRecipe) + if (GT_ModHandler.getAllRecipeOutput(getBaseMetaTileEntity().getWorld(), tRecipe) == null) { if (mInventory[18] == null) { mInventory[18] = mInventory[mCurrentSlot]; @@ -497,9 +481,7 @@ public class GT_MetaTileEntity_ElectricAutoWorkbench extends GT_MetaTileEntity_B tRecipe[6] = tTempStack; tRecipe[7] = tTempStack; tRecipe[8] = tTempStack; - if (GT_ModHandler.getAllRecipeOutput( - getBaseMetaTileEntity().getWorld(), tRecipe) - == null) { + if (GT_ModHandler.getAllRecipeOutput(getBaseMetaTileEntity().getWorld(), tRecipe) == null) { if (mInventory[18] == null) { mInventory[18] = mInventory[mCurrentSlot]; mInventory[mCurrentSlot] = null; @@ -522,14 +504,12 @@ public class GT_MetaTileEntity_ElectricAutoWorkbench extends GT_MetaTileEntity_B tTempStack = GT_Utility.copy(mInventory[mCurrentSlot]); tTempStack.stackSize = 1; for (int i = mCurrentSlot + 1; i < 18; i++) { - if (mInventory[i] != null - && mInventory[i].getItem() == tTempStack.getItem() + if (mInventory[i] != null && mInventory[i].getItem() == tTempStack.getItem() && mInventory[mCurrentSlot].getItemDamage() + mInventory[i].getItemDamage() > tTempStack.getMaxDamage()) { tRecipe[0] = tTempStack; tRecipe[1] = GT_Utility.copy(mInventory[i]); - if (GT_ModHandler.getAllRecipeOutput( - getBaseMetaTileEntity().getWorld(), tRecipe) + if (GT_ModHandler.getAllRecipeOutput(getBaseMetaTileEntity().getWorld(), tRecipe) == null) { if (mInventory[18] == null) { mInventory[18] = mInventory[mCurrentSlot]; @@ -550,16 +530,10 @@ public class GT_MetaTileEntity_ElectricAutoWorkbench extends GT_MetaTileEntity_B } break; } - for (byte i = 0, j = 0; - i < 18 - && j < 9 - && (j < 2 - || GT_ModHandler.getAllRecipeOutput( - getBaseMetaTileEntity() - .getWorld(), - tRecipe) - == null); - i++) { + for (byte i = 0, j = 0; i < 18 && j < 9 + && (j < 2 || GT_ModHandler + .getAllRecipeOutput(getBaseMetaTileEntity().getWorld(), tRecipe) + == null); i++) { tRecipe[j] = mInventory[(mCurrentSlot + i) % 18]; if (tRecipe[j] != null) { tRecipe[j] = GT_Utility.copy(tRecipe[j]); @@ -573,8 +547,7 @@ public class GT_MetaTileEntity_ElectricAutoWorkbench extends GT_MetaTileEntity_B } if (tOutput == null) - tOutput = GT_ModHandler.getAllRecipeOutput( - getBaseMetaTileEntity().getWorld(), tRecipe); + tOutput = GT_ModHandler.getAllRecipeOutput(getBaseMetaTileEntity().getWorld(), tRecipe); if (tOutput != null || mMode == 0) mInventory[28] = tOutput; @@ -621,9 +594,9 @@ public class GT_MetaTileEntity_ElectricAutoWorkbench extends GT_MetaTileEntity_B } else if (GT_Utility.areStacksEqual(mInventory[k], tStack) && mInventory[k].stackSize + tStack.stackSize <= tStack.getMaxStackSize()) { - mInventory[k].stackSize += tStack.stackSize; - break; - } + mInventory[k].stackSize += tStack.stackSize; + break; + } } } } else { @@ -636,9 +609,9 @@ public class GT_MetaTileEntity_ElectricAutoWorkbench extends GT_MetaTileEntity_B } mInventory[18] = GT_Utility.copy(tOutput); - getBaseMetaTileEntity() - .decreaseStoredEnergyUnits( - mMode == 5 || mMode == 6 || mMode == 7 ? 128 : 2048, true); + getBaseMetaTileEntity().decreaseStoredEnergyUnits( + mMode == 5 || mMode == 6 || mMode == 7 ? 128 : 2048, + true); mTicksUntilNextUpdate = 1; } else { mLastCraftSuccessful = false; @@ -652,7 +625,7 @@ public class GT_MetaTileEntity_ElectricAutoWorkbench extends GT_MetaTileEntity_B if (mInventory[18] == null && mThroughPut < 2) { for (byte i = 0; i < 8; i++) { - for (byte j = i; ++j < 9; ) { + for (byte j = i; ++j < 9;) { if (GT_Utility.areStacksEqual(mInventory[i], mInventory[j]) && mInventory[i].getMaxStackSize() > 8) { mInventory[18] = mInventory[j]; @@ -670,19 +643,17 @@ public class GT_MetaTileEntity_ElectricAutoWorkbench extends GT_MetaTileEntity_B getBaseMetaTileEntity() .decreaseStoredEnergyUnits( GT_Utility.moveOneItemStack( - getBaseMetaTileEntity(), - getBaseMetaTileEntity() - .getIInventoryAtSide(getBaseMetaTileEntity() - .getBackFacing()), - getBaseMetaTileEntity().getBackFacing(), - getBaseMetaTileEntity().getFrontFacing(), - null, - false, - (byte) 64, - (byte) 1, - (byte) 64, - (byte) 1) - * 10, + getBaseMetaTileEntity(), + getBaseMetaTileEntity() + .getIInventoryAtSide(getBaseMetaTileEntity().getBackFacing()), + getBaseMetaTileEntity().getBackFacing(), + getBaseMetaTileEntity().getFrontFacing(), + null, + false, + (byte) 64, + (byte) 1, + (byte) 64, + (byte) 1) * 10, true); } } @@ -746,14 +717,10 @@ public class GT_MetaTileEntity_ElectricAutoWorkbench extends GT_MetaTileEntity_B return mMode == 0 ? aIndex < 9 : aIndex < 18; } - /*@Override - public int getTextureIndex(byte aSide, byte aFacing, boolean aActive, boolean aRedstone) { - if (aSide == aFacing) - return 112; - if (GT_Utility.getOppositeSide(aSide) == aFacing) - return 113; - return 114; - }*/ + /* + * @Override public int getTextureIndex(byte aSide, byte aFacing, boolean aActive, boolean aRedstone) { if (aSide == + * aFacing) return 112; if (GT_Utility.getOppositeSide(aSide) == aFacing) return 113; return 114; } + */ @Override public int getCapacity() { @@ -767,11 +734,9 @@ public class GT_MetaTileEntity_ElectricAutoWorkbench extends GT_MetaTileEntity_B @Override public String[] getDescription() { - return new String[] { - "Automatic Crafting Table Mk III", - // this.mDescription, - CORE.GT_Tooltip - }; + return new String[] { "Automatic Crafting Table Mk III", + // this.mDescription, + CORE.GT_Tooltip }; } @Override @@ -793,13 +758,8 @@ public class GT_MetaTileEntity_ElectricAutoWorkbench extends GT_MetaTileEntity_B } @Override - public ITexture[] getTexture( - final IGregTechTileEntity aBaseMetaTileEntity, - final byte aSide, - final byte aFacing, - final byte aColorIndex, - final boolean aActive, - final boolean aRedstone) { + public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing, + final byte aColorIndex, final boolean aActive, final boolean aRedstone) { if (aSide == aFacing) { return this.mTextures[0][aColorIndex + 1]; } else if (GT_Utility.getOppositeSide(aSide) == aFacing) { @@ -807,41 +767,34 @@ public class GT_MetaTileEntity_ElectricAutoWorkbench extends GT_MetaTileEntity_B } else { return this.mTextures[4][aColorIndex + 1]; } - /*return this.mTextures[(aActive ? 5 : 0) + (aSide == aFacing ? 0 - : aSide == GT_Utility.getOppositeSide(aFacing) ? 1 : aSide == 0 ? 2 : aSide == 1 ? 3 : 4)][aColorIndex + 1];*/ + /* + * return this.mTextures[(aActive ? 5 : 0) + (aSide == aFacing ? 0 : aSide == + * GT_Utility.getOppositeSide(aFacing) ? 1 : aSide == 0 ? 2 : aSide == 1 ? 3 : 4)][aColorIndex + 1]; + */ } public ITexture[] getFront(final byte aColor) { - return new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], - new GT_RenderedTexture(TexturesGtBlock.Casing_Adv_Workbench_Crafting_Overlay) - }; + return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], + new GT_RenderedTexture(TexturesGtBlock.Casing_Adv_Workbench_Crafting_Overlay) }; } public ITexture[] getBack(final byte aColor) { - return new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], new GT_RenderedTexture(BlockIcons.OVERLAY_PIPE) - }; + return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], + new GT_RenderedTexture(BlockIcons.OVERLAY_PIPE) }; } public ITexture[] getBottom(final byte aColor) { - return new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], - }; + return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], }; } public ITexture[] getTop(final byte aColor) { - return new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], - new GT_RenderedTexture(TexturesGtBlock.Casing_Adv_Workbench_Crafting_Overlay) - }; + return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], + new GT_RenderedTexture(TexturesGtBlock.Casing_Adv_Workbench_Crafting_Overlay) }; } public ITexture[] getSides(final byte aColor) { - return new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], - new GT_RenderedTexture(TexturesGtBlock.Casing_Adv_Workbench_Crafting_Overlay) - }; + return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], + new GT_RenderedTexture(TexturesGtBlock.Casing_Adv_Workbench_Crafting_Overlay) }; } @Override @@ -851,78 +804,50 @@ public class GT_MetaTileEntity_ElectricAutoWorkbench extends GT_MetaTileEntity_B @Override public void addGregTechLogo(ModularWindow.Builder builder) { - builder.widget(new DrawableWidget() - .setDrawable(getGUITextureSet().getGregTechLogo()) - .setSize(17, 17) - .setPos(118, 22)); + builder.widget( + new DrawableWidget().setDrawable(getGUITextureSet().getGregTechLogo()).setSize(17, 17).setPos(118, 22)); } @Override public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildContext) { - builder.widget(SlotGroup.ofItemHandler(inventoryHandler, 3) - .endAtSlot(8) - .build() - .setPos(7, 4)) - .widget(SlotGroup.ofItemHandler(inventoryHandler, 9) - .startFromSlot(9) - .endAtSlot(17) - .canInsert(false) - .background(GT_UITextures.SLOT_DARK_GRAY) - .applyForWidget(SlotWidget::disableShiftInsert) - .build() - .setPos(7, 59)) - .widget(new SlotWidget(inventoryHandler, 18) - .setAccess(true, false) - .setBackground(getGUITextureSet().getItemSlot(), GT_UITextures.OVERLAY_SLOT_OUT) - .setPos(151, 40)) - .widget(new DrawableWidget() - .setDrawable(GT_UITextures.PICTURE_SLOTS_HOLO_3BY3) - .setPos(62, 4) - .setSize(54, 54)) - .widget(SlotGroup.ofItemHandler(inventoryHandler, 3) - .startFromSlot(19) - .endAtSlot(27) - .phantom(true) - .background(GT_UITextures.TRANSPARENT) - .build() - .setPos(62, 4)) - .widget(SlotWidget.phantom(inventoryHandler, 28) - .disableInteraction() - .setBackground(getGUITextureSet().getItemSlot(), GTPP_UITextures.OVERLAY_SLOT_ARROW_4) - .setPos(151, 4)); - builder.widget(new CycleButtonWidget() - .setGetter(() -> mThroughPut) - .setSetter(val -> mThroughPut = val) - .setLength(MAX_THROUGHPUT) - .setTextureGetter(i -> GTPP_UITextures.OVERLAY_BUTTON_THROUGHPUT[i]) - .setBackground(GT_UITextures.BUTTON_STANDARD) - .setPos(120, 4) - .setSize(18, 18)); - String[] mModeText = new String[] { - "Normal Crafting Table", "???", "1x1", "2x2", "3x3", "Unifier", "Dust", "???", "Hammer?", "Circle" - }; - CycleButtonWidget modeButton = new CycleButtonWidget() - .setGetter(() -> mMode) - .setSetter(val -> { - mMode = val; - switchMode(); - }) - .setLength(MAX_MODES) - .setTextureGetter(i -> GTPP_UITextures.OVERLAY_BUTTON_MODE[i]); + builder.widget(SlotGroup.ofItemHandler(inventoryHandler, 3).endAtSlot(8).build().setPos(7, 4)) + .widget( + SlotGroup.ofItemHandler(inventoryHandler, 9).startFromSlot(9).endAtSlot(17).canInsert(false) + .background(GT_UITextures.SLOT_DARK_GRAY).applyForWidget(SlotWidget::disableShiftInsert) + .build().setPos(7, 59)) + .widget( + new SlotWidget(inventoryHandler, 18).setAccess(true, false) + .setBackground(getGUITextureSet().getItemSlot(), GT_UITextures.OVERLAY_SLOT_OUT) + .setPos(151, 40)) + .widget( + new DrawableWidget().setDrawable(GT_UITextures.PICTURE_SLOTS_HOLO_3BY3).setPos(62, 4) + .setSize(54, 54)) + .widget( + SlotGroup.ofItemHandler(inventoryHandler, 3).startFromSlot(19).endAtSlot(27).phantom(true) + .background(GT_UITextures.TRANSPARENT).build().setPos(62, 4)) + .widget( + SlotWidget.phantom(inventoryHandler, 28).disableInteraction() + .setBackground(getGUITextureSet().getItemSlot(), GTPP_UITextures.OVERLAY_SLOT_ARROW_4) + .setPos(151, 4)); + builder.widget( + new CycleButtonWidget().setGetter(() -> mThroughPut).setSetter(val -> mThroughPut = val) + .setLength(MAX_THROUGHPUT).setTextureGetter(i -> GTPP_UITextures.OVERLAY_BUTTON_THROUGHPUT[i]) + .setBackground(GT_UITextures.BUTTON_STANDARD).setPos(120, 4).setSize(18, 18)); + String[] mModeText = new String[] { "Normal Crafting Table", "???", "1x1", "2x2", "3x3", "Unifier", "Dust", + "???", "Hammer?", "Circle" }; + CycleButtonWidget modeButton = new CycleButtonWidget().setGetter(() -> mMode).setSetter(val -> { + mMode = val; + switchMode(); + }).setLength(MAX_MODES).setTextureGetter(i -> GTPP_UITextures.OVERLAY_BUTTON_MODE[i]); for (int i = 0; i < MAX_MODES; i++) { modeButton.addTooltip(i, "Mode: " + mModeText[i]); } - builder.widget(modeButton - .setBackground(GT_UITextures.BUTTON_STANDARD) - .setPos(120, 40) - .setSize(18, 18)); - builder.widget(new DrawableWidget() - .setDrawable(GTPP_UITextures.PICTURE_WORKBENCH_CIRCLE) - .setPos(136, 23) + builder.widget(modeButton.setBackground(GT_UITextures.BUTTON_STANDARD).setPos(120, 40).setSize(18, 18)); + builder.widget( + new DrawableWidget().setDrawable(GTPP_UITextures.PICTURE_WORKBENCH_CIRCLE).setPos(136, 23) .setSize(16, 16)) - .widget(new DrawableWidget() - .setDrawable(GTPP_UITextures.PICTURE_ARROW_WHITE_DOWN) - .setPos(155, 23) - .setSize(10, 16)); + .widget( + new DrawableWidget().setDrawable(GTPP_UITextures.PICTURE_ARROW_WHITE_DOWN).setPos(155, 23) + .setSize(10, 16)); } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/GT_MetaTileEntity_ElectricInventoryManager.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/GT_MetaTileEntity_ElectricInventoryManager.java index 1a15c563ef..b7ff49716b 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/GT_MetaTileEntity_ElectricInventoryManager.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/GT_MetaTileEntity_ElectricInventoryManager.java @@ -1,5 +1,13 @@ package gtPlusPlus.xmod.gregtech.common.tileentities.automation; +import java.util.ArrayList; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.IInventory; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraftforge.oredict.OreDictionary; + import com.gtnewhorizons.modularui.api.ModularUITextures; import com.gtnewhorizons.modularui.api.drawable.IDrawable; import com.gtnewhorizons.modularui.api.screen.ModularWindow; @@ -9,6 +17,7 @@ import com.gtnewhorizons.modularui.common.widget.ButtonWidget; import com.gtnewhorizons.modularui.common.widget.DrawableWidget; import com.gtnewhorizons.modularui.common.widget.FakeSyncWidget; import com.gtnewhorizons.modularui.common.widget.SlotWidget; + import gregtech.api.enums.GT_Values; import gregtech.api.enums.Textures; import gregtech.api.gui.modularui.GT_UIInfos; @@ -25,12 +34,6 @@ import gregtech.api.util.GT_Utility; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.xmod.gregtech.api.gui.GTPP_UITextures; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; -import java.util.ArrayList; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.IInventory; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraftforge.oredict.OreDictionary; public class GT_MetaTileEntity_ElectricInventoryManager extends GT_MetaTileEntity_TieredMachineBlock implements IAddGregtechLogo, IAddUIWidgets { @@ -50,8 +53,8 @@ public class GT_MetaTileEntity_ElectricInventoryManager extends GT_MetaTileEntit mLocalName = "Auto Workbench (" + GT_Values.VN[aTier] + ")"; } - public GT_MetaTileEntity_ElectricInventoryManager( - final String aName, final int aTier, final String aDescription, final ITexture[][][] aTextures) { + public GT_MetaTileEntity_ElectricInventoryManager(final String aName, final int aTier, final String aDescription, + final ITexture[][][] aTextures) { super(aName, aTier, 16, aDescription, aTextures); } @@ -154,7 +157,10 @@ public class GT_MetaTileEntity_ElectricInventoryManager extends GT_MetaTileEntit @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new GT_MetaTileEntity_ElectricInventoryManager( - this.mName, this.mTier, this.mDescription, this.mTextures); + this.mName, + this.mTier, + this.mDescription, + this.mTextures); } @Override @@ -240,25 +246,19 @@ public class GT_MetaTileEntity_ElectricInventoryManager extends GT_MetaTileEntit @Override public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { super.onPostTick(aBaseMetaTileEntity, aTick); - if (getBaseMetaTileEntity().isAllowedToWork() - && getBaseMetaTileEntity().isServerSide() + if (getBaseMetaTileEntity().isAllowedToWork() && getBaseMetaTileEntity().isServerSide() && getBaseMetaTileEntity().getUniversalEnergyStored() >= 5000 - && (getBaseMetaTileEntity().hasWorkJustBeenEnabled() - || getBaseMetaTileEntity().getTimer() % 100 == 0 + && (getBaseMetaTileEntity().hasWorkJustBeenEnabled() || getBaseMetaTileEntity().getTimer() % 100 == 0 || mWorkedLastTick || getBaseMetaTileEntity().hasInventoryBeenModified())) { mWorkedLastTick = false; - IInventory[] tTileEntities = new IInventory[] { - getBaseMetaTileEntity().getIInventoryAtSide((byte) 0), - getBaseMetaTileEntity().getIInventoryAtSide((byte) 1), - getBaseMetaTileEntity().getIInventoryAtSide((byte) 2), - getBaseMetaTileEntity().getIInventoryAtSide((byte) 3), - getBaseMetaTileEntity().getIInventoryAtSide((byte) 4), - getBaseMetaTileEntity().getIInventoryAtSide((byte) 5), - null, - null - }; + IInventory[] tTileEntities = new IInventory[] { getBaseMetaTileEntity().getIInventoryAtSide((byte) 0), + getBaseMetaTileEntity().getIInventoryAtSide((byte) 1), + getBaseMetaTileEntity().getIInventoryAtSide((byte) 2), + getBaseMetaTileEntity().getIInventoryAtSide((byte) 3), + getBaseMetaTileEntity().getIInventoryAtSide((byte) 4), + getBaseMetaTileEntity().getIInventoryAtSide((byte) 5), null, null }; int tCost = 0; @@ -270,176 +270,152 @@ public class GT_MetaTileEntity_ElectricInventoryManager extends GT_MetaTileEntit tStack = mInventory[3 + i * 3 + 0]; if (tStack == null) { - if (getSlot1InOut(i)) - tCost += 5 - * GT_Utility.moveOneItemStack( - getBaseMetaTileEntity(), - tTileEntities[getRangeDirection(i)], - getSlot1Direction(i), - getSlot1Direction(i), - null, - false, - (byte) 64, - (byte) 1, - (byte) 64, - (byte) 1); - else - tCost += 5 - * GT_Utility.moveOneItemStack( - tTileEntities[getRangeDirection(i)], - getBaseMetaTileEntity(), - getSlot1Direction(i), - getSlot1Direction(i), - null, - false, - (byte) 64, - (byte) 1, - (byte) 64, - (byte) 1); + if (getSlot1InOut(i)) tCost += 5 * GT_Utility.moveOneItemStack( + getBaseMetaTileEntity(), + tTileEntities[getRangeDirection(i)], + getSlot1Direction(i), + getSlot1Direction(i), + null, + false, + (byte) 64, + (byte) 1, + (byte) 64, + (byte) 1); + else tCost += 5 * GT_Utility.moveOneItemStack( + tTileEntities[getRangeDirection(i)], + getBaseMetaTileEntity(), + getSlot1Direction(i), + getSlot1Direction(i), + null, + false, + (byte) 64, + (byte) 1, + (byte) 64, + (byte) 1); } else { tList.set(0, tStack); - if (getSlot1InOut(i)) - tCost += 5 - * GT_Utility.moveOneItemStack( - getBaseMetaTileEntity(), - tTileEntities[getRangeDirection(i)], - getSlot1Direction(i), - getSlot1Direction(i), - tList, - false, - (byte) tStack.stackSize, - (byte) 1, - (byte) 64, - (byte) 1); - else - tCost += 5 - * GT_Utility.moveOneItemStack( - tTileEntities[getRangeDirection(i)], - getBaseMetaTileEntity(), - getSlot1Direction(i), - getSlot1Direction(i), - tList, - false, - (byte) tStack.stackSize, - (byte) 1, - (byte) 64, - (byte) 1); + if (getSlot1InOut(i)) tCost += 5 * GT_Utility.moveOneItemStack( + getBaseMetaTileEntity(), + tTileEntities[getRangeDirection(i)], + getSlot1Direction(i), + getSlot1Direction(i), + tList, + false, + (byte) tStack.stackSize, + (byte) 1, + (byte) 64, + (byte) 1); + else tCost += 5 * GT_Utility.moveOneItemStack( + tTileEntities[getRangeDirection(i)], + getBaseMetaTileEntity(), + getSlot1Direction(i), + getSlot1Direction(i), + tList, + false, + (byte) tStack.stackSize, + (byte) 1, + (byte) 64, + (byte) 1); } tStack = mInventory[3 + i * 3 + 1]; if (tStack == null) { - if (getSlot2InOut(i)) - tCost += 5 - * GT_Utility.moveOneItemStack( - getBaseMetaTileEntity(), - tTileEntities[getRangeDirection(i)], - getSlot2Direction(i), - getSlot2Direction(i), - null, - false, - (byte) 64, - (byte) 1, - (byte) 64, - (byte) 1); - else - tCost += 5 - * GT_Utility.moveOneItemStack( - tTileEntities[getRangeDirection(i)], - getBaseMetaTileEntity(), - getSlot2Direction(i), - getSlot2Direction(i), - null, - false, - (byte) 64, - (byte) 1, - (byte) 64, - (byte) 1); + if (getSlot2InOut(i)) tCost += 5 * GT_Utility.moveOneItemStack( + getBaseMetaTileEntity(), + tTileEntities[getRangeDirection(i)], + getSlot2Direction(i), + getSlot2Direction(i), + null, + false, + (byte) 64, + (byte) 1, + (byte) 64, + (byte) 1); + else tCost += 5 * GT_Utility.moveOneItemStack( + tTileEntities[getRangeDirection(i)], + getBaseMetaTileEntity(), + getSlot2Direction(i), + getSlot2Direction(i), + null, + false, + (byte) 64, + (byte) 1, + (byte) 64, + (byte) 1); } else { tList.set(0, tStack); - if (getSlot2InOut(i)) - tCost += 5 - * GT_Utility.moveOneItemStack( - getBaseMetaTileEntity(), - tTileEntities[getRangeDirection(i)], - getSlot2Direction(i), - getSlot2Direction(i), - tList, - false, - (byte) tStack.stackSize, - (byte) 1, - (byte) 64, - (byte) 1); - else - tCost += 5 - * GT_Utility.moveOneItemStack( - tTileEntities[getRangeDirection(i)], - getBaseMetaTileEntity(), - getSlot2Direction(i), - getSlot2Direction(i), - tList, - false, - (byte) tStack.stackSize, - (byte) 1, - (byte) 64, - (byte) 1); + if (getSlot2InOut(i)) tCost += 5 * GT_Utility.moveOneItemStack( + getBaseMetaTileEntity(), + tTileEntities[getRangeDirection(i)], + getSlot2Direction(i), + getSlot2Direction(i), + tList, + false, + (byte) tStack.stackSize, + (byte) 1, + (byte) 64, + (byte) 1); + else tCost += 5 * GT_Utility.moveOneItemStack( + tTileEntities[getRangeDirection(i)], + getBaseMetaTileEntity(), + getSlot2Direction(i), + getSlot2Direction(i), + tList, + false, + (byte) tStack.stackSize, + (byte) 1, + (byte) 64, + (byte) 1); } tStack = mInventory[3 + i * 3 + 2]; if (tStack == null) { - if (getSlot3InOut(i)) - tCost += 5 - * GT_Utility.moveOneItemStack( - getBaseMetaTileEntity(), - tTileEntities[getRangeDirection(i)], - getSlot3Direction(i), - getSlot3Direction(i), - null, - false, - (byte) 64, - (byte) 1, - (byte) 64, - (byte) 1); - else - tCost += 5 - * GT_Utility.moveOneItemStack( - tTileEntities[getRangeDirection(i)], - getBaseMetaTileEntity(), - getSlot3Direction(i), - getSlot3Direction(i), - null, - false, - (byte) 64, - (byte) 1, - (byte) 64, - (byte) 1); + if (getSlot3InOut(i)) tCost += 5 * GT_Utility.moveOneItemStack( + getBaseMetaTileEntity(), + tTileEntities[getRangeDirection(i)], + getSlot3Direction(i), + getSlot3Direction(i), + null, + false, + (byte) 64, + (byte) 1, + (byte) 64, + (byte) 1); + else tCost += 5 * GT_Utility.moveOneItemStack( + tTileEntities[getRangeDirection(i)], + getBaseMetaTileEntity(), + getSlot3Direction(i), + getSlot3Direction(i), + null, + false, + (byte) 64, + (byte) 1, + (byte) 64, + (byte) 1); } else { tList.set(0, tStack); - if (getSlot3InOut(i)) - tCost += 5 - * GT_Utility.moveOneItemStack( - getBaseMetaTileEntity(), - tTileEntities[getRangeDirection(i)], - getSlot3Direction(i), - getSlot3Direction(i), - tList, - false, - (byte) tStack.stackSize, - (byte) 1, - (byte) 64, - (byte) 1); - else - tCost += 5 - * GT_Utility.moveOneItemStack( - tTileEntities[getRangeDirection(i)], - getBaseMetaTileEntity(), - getSlot3Direction(i), - getSlot3Direction(i), - tList, - false, - (byte) tStack.stackSize, - (byte) 1, - (byte) 64, - (byte) 1); + if (getSlot3InOut(i)) tCost += 5 * GT_Utility.moveOneItemStack( + getBaseMetaTileEntity(), + tTileEntities[getRangeDirection(i)], + getSlot3Direction(i), + getSlot3Direction(i), + tList, + false, + (byte) tStack.stackSize, + (byte) 1, + (byte) 64, + (byte) 1); + else tCost += 5 * GT_Utility.moveOneItemStack( + tTileEntities[getRangeDirection(i)], + getBaseMetaTileEntity(), + getSlot3Direction(i), + getSlot3Direction(i), + tList, + false, + (byte) tStack.stackSize, + (byte) 1, + (byte) 64, + (byte) 1); } } } @@ -453,21 +429,15 @@ public class GT_MetaTileEntity_ElectricInventoryManager extends GT_MetaTileEntit @Override public String[] getDescription() { - return new String[] {"It's simpler than you think. I promise.", this.mDescription, CORE.GT_Tooltip}; - } - - /*@Override - public int getTextureIndex(byte aSide, byte aFacing, boolean aActive, boolean aRedstone) { - switch (aSide) { - case 0: return 113 + (aRedstone?8:0); - case 1: return 112 + (aRedstone?8:0); - case 2: return 116 + (aRedstone?8:0); - case 3: return 213 + (aRedstone?8:0); - case 4: return 212 + (aRedstone?8:0); - case 5: return 117 + (aRedstone?8:0); - } - return 0; - }*/ + return new String[] { "It's simpler than you think. I promise.", this.mDescription, CORE.GT_Tooltip }; + } + + /* + * @Override public int getTextureIndex(byte aSide, byte aFacing, boolean aActive, boolean aRedstone) { switch + * (aSide) { case 0: return 113 + (aRedstone?8:0); case 1: return 112 + (aRedstone?8:0); case 2: return 116 + + * (aRedstone?8:0); case 3: return 213 + (aRedstone?8:0); case 4: return 212 + (aRedstone?8:0); case 5: return 117 + + * (aRedstone?8:0); } return 0; } + */ @Override public boolean allowCoverOnSide(byte aSide, GT_ItemStack aStack) { @@ -505,98 +475,69 @@ public class GT_MetaTileEntity_ElectricInventoryManager extends GT_MetaTileEntit } @Override - public ITexture[] getTexture( - final IGregTechTileEntity aBaseMetaTileEntity, - final byte aSide, - final byte aFacing, - final byte aColorIndex, - final boolean aActive, - final boolean aRedstone) { + public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing, + final byte aColorIndex, final boolean aActive, final boolean aRedstone) { return this.mTextures[!aRedstone ? aSide : aSide + 6][aColorIndex < 0 ? 0 : aColorIndex]; } public ITexture[] getBottom(final byte aColor) { - return new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], - new GT_RenderedTexture(TexturesGtBlock.Casing_InventoryManagaer_Red) - }; + return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], + new GT_RenderedTexture(TexturesGtBlock.Casing_InventoryManagaer_Red) }; } public ITexture[] getTop(final byte aColor) { - return new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], - new GT_RenderedTexture(TexturesGtBlock.Casing_InventoryManagaer_Green) - }; + return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], + new GT_RenderedTexture(TexturesGtBlock.Casing_InventoryManagaer_Green) }; } public ITexture[] getNegativeZ(final byte aColor) { - return new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], - new GT_RenderedTexture(TexturesGtBlock.Casing_InventoryManagaer_Blue) - }; + return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], + new GT_RenderedTexture(TexturesGtBlock.Casing_InventoryManagaer_Blue) }; } public ITexture[] getPositiveZ(final byte aColor) { - return new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], - new GT_RenderedTexture(TexturesGtBlock.Casing_InventoryManagaer_Cyan) - }; + return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], + new GT_RenderedTexture(TexturesGtBlock.Casing_InventoryManagaer_Cyan) }; } public ITexture[] getNegativeX(final byte aColor) { - return new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], - new GT_RenderedTexture(TexturesGtBlock.Casing_InventoryManagaer_Purple) - }; + return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], + new GT_RenderedTexture(TexturesGtBlock.Casing_InventoryManagaer_Purple) }; } public ITexture[] getPositiveX(final byte aColor) { - return new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], - new GT_RenderedTexture(TexturesGtBlock.Casing_InventoryManagaer_Yellow) - }; + return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], + new GT_RenderedTexture(TexturesGtBlock.Casing_InventoryManagaer_Yellow) }; } public ITexture[] getBottomRedstone(final byte aColor) { - return new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], - new GT_RenderedTexture(TexturesGtBlock.Casing_InventoryManagaer_Red_Redstone) - }; + return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], + new GT_RenderedTexture(TexturesGtBlock.Casing_InventoryManagaer_Red_Redstone) }; } public ITexture[] getTopRedstone(final byte aColor) { - return new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], - new GT_RenderedTexture(TexturesGtBlock.Casing_InventoryManagaer_Green_Redstone) - }; + return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], + new GT_RenderedTexture(TexturesGtBlock.Casing_InventoryManagaer_Green_Redstone) }; } public ITexture[] getNegativeZRedstone(final byte aColor) { - return new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], - new GT_RenderedTexture(TexturesGtBlock.Casing_InventoryManagaer_Blue_Redstone) - }; + return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], + new GT_RenderedTexture(TexturesGtBlock.Casing_InventoryManagaer_Blue_Redstone) }; } public ITexture[] getPositiveZRedstone(final byte aColor) { - return new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], - new GT_RenderedTexture(TexturesGtBlock.Casing_InventoryManagaer_Cyan_Redstone) - }; + return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], + new GT_RenderedTexture(TexturesGtBlock.Casing_InventoryManagaer_Cyan_Redstone) }; } public ITexture[] getNegativeXRedstone(final byte aColor) { - return new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], - new GT_RenderedTexture(TexturesGtBlock.Casing_InventoryManagaer_Purple_Redstone) - }; + return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], + new GT_RenderedTexture(TexturesGtBlock.Casing_InventoryManagaer_Purple_Redstone) }; } public ITexture[] getPositiveXRedstone(final byte aColor) { - return new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], - new GT_RenderedTexture(TexturesGtBlock.Casing_InventoryManagaer_Yellow_Redstone) - }; + return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], + new GT_RenderedTexture(TexturesGtBlock.Casing_InventoryManagaer_Yellow_Redstone) }; } @Override @@ -606,10 +547,8 @@ public class GT_MetaTileEntity_ElectricInventoryManager extends GT_MetaTileEntit @Override public void addGregTechLogo(ModularWindow.Builder builder) { - builder.widget(new DrawableWidget() - .setDrawable(getGUITextureSet().getGregTechLogo()) - .setSize(17, 17) - .setPos(154, 59)); + builder.widget( + new DrawableWidget().setDrawable(getGUITextureSet().getGregTechLogo()).setSize(17, 17).setPos(154, 59)); } // Internal copy of values stored in this tile. Client will use these to render stuff. @@ -621,139 +560,116 @@ public class GT_MetaTileEntity_ElectricInventoryManager extends GT_MetaTileEntit @Override public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildContext) { for (int i = 0; i < 3; i++) { - builder.widget(new SlotWidget(inventoryHandler, i) - .setBackground(getGUITextureSet().getItemSlot(), GTPP_UITextures.OVERLAY_SLOT_CHEST) - .setPos(154, 4 + i * 18)); + builder.widget( + new SlotWidget(inventoryHandler, i) + .setBackground(getGUITextureSet().getItemSlot(), GTPP_UITextures.OVERLAY_SLOT_CHEST) + .setPos(154, 4 + i * 18)); } - int[] slotXPositions = new int[] {4, 60, 79, 135}; + int[] slotXPositions = new int[] { 4, 60, 79, 135 }; for (int i = 0; i < 12; i++) { final int index = i; - builder.widget( - new SlotWidget(new BaseSlot(inventoryHandler, i + 3, true)) { - @Override - protected void phantomClick(ClickData clickData, ItemStack cursorStack) { - super.phantomClick(clickData, cursorStack); - if (clickData.mouseButton != 0 - && cursorStack != null - && getMcSlot().getHasStack()) { - getMcSlot().getStack().setItemDamage(OreDictionary.WILDCARD_VALUE); - } - } - }.setControlsAmount(true) - .disableShiftInsert() - .setBackground(() -> { - if (index % 3 == 0) { - return new IDrawable[] { - GTPP_UITextures.SLOT_INVENTORY_MANAGER[mRangeDirections[index / 3]], - GTPP_UITextures.OVERLAY_SLOT_INVENTORY_MANAGER_COLOR[ - mRangeDirections[index / 3]] - }; - } else if (index % 3 == 1) { - return new IDrawable[] { - GTPP_UITextures.SLOT_INVENTORY_MANAGER[mRangeDirections[index / 3]], - GTPP_UITextures.OVERLAY_SLOT_INVENTORY_MANAGER_ARROW[ - mRangeDirections[index / 3]] - }; - } else { - return new IDrawable[] { - GTPP_UITextures.SLOT_INVENTORY_MANAGER[mRangeDirections[index / 3]] - }; - } - }) - .setPos(slotXPositions[i / 3], 4 + (i % 3) * 18)); + builder.widget(new SlotWidget(new BaseSlot(inventoryHandler, i + 3, true)) { + + @Override + protected void phantomClick(ClickData clickData, ItemStack cursorStack) { + super.phantomClick(clickData, cursorStack); + if (clickData.mouseButton != 0 && cursorStack != null && getMcSlot().getHasStack()) { + getMcSlot().getStack().setItemDamage(OreDictionary.WILDCARD_VALUE); + } + } + }.setControlsAmount(true).disableShiftInsert().setBackground(() -> { + if (index % 3 == 0) { + return new IDrawable[] { GTPP_UITextures.SLOT_INVENTORY_MANAGER[mRangeDirections[index / 3]], + GTPP_UITextures.OVERLAY_SLOT_INVENTORY_MANAGER_COLOR[mRangeDirections[index / 3]] }; + } else if (index % 3 == 1) { + return new IDrawable[] { GTPP_UITextures.SLOT_INVENTORY_MANAGER[mRangeDirections[index / 3]], + GTPP_UITextures.OVERLAY_SLOT_INVENTORY_MANAGER_ARROW[mRangeDirections[index / 3]] }; + } else { + return new IDrawable[] { GTPP_UITextures.SLOT_INVENTORY_MANAGER[mRangeDirections[index / 3]] }; + } + }).setPos(slotXPositions[i / 3], 4 + (i % 3) * 18)); } for (int i = 0; i < 4; i++) { final int index = i; - builder.widget(new ButtonWidget() - .setOnClick((clickData, widget) -> switchRangeEnergy(index)) - .setBackground(() -> new IDrawable[] { - mTargetEnergy[index] ? ModularUITextures.ITEM_SLOT : GT_UITextures.BUTTON_STANDARD, - GT_UITextures.OVERLAY_BUTTON_EMIT_ENERGY - }) - .setPos(slotXPositions[i], 59) - .setSize(18, 18)); + builder.widget( + new ButtonWidget().setOnClick((clickData, widget) -> switchRangeEnergy(index)).setBackground( + () -> new IDrawable[] { + mTargetEnergy[index] ? ModularUITextures.ITEM_SLOT : GT_UITextures.BUTTON_STANDARD, + GT_UITextures.OVERLAY_BUTTON_EMIT_ENERGY }) + .setPos(slotXPositions[i], 59).setSize(18, 18)); } - int[] buttonXPositions = new int[] {23, 41, 98, 116}; + int[] buttonXPositions = new int[] { 23, 41, 98, 116 }; for (int i = 0; i < 12; i++) { final int index = i; - builder.widget(new ButtonWidget() - .setOnClick((clickData, widget) -> { - if (index % 3 == 0) { - if (clickData.mouseButton != 0) { - switchSlot1InOut(index / 3); - } else { - iterateSlot1Direction(index / 3); - } - } else if (index % 3 == 1) { - if (clickData.mouseButton != 0) { - switchSlot2InOut(index / 3); - } else { - iterateSlot2Direction(index / 3); - } - } else { - if (clickData.mouseButton != 0) { - switchSlot3InOut(index / 3); - } else { - iterateSlot3Direction(index / 3); - } - } - }) - .setBackground(() -> new IDrawable[] { - GT_UITextures.BUTTON_STANDARD, - GTPP_UITextures.OVERLAY_BUTTON_DIRECTION[mTargetDirections[index]], - mTargetInOut[index] - ? GTPP_UITextures.OVERLAY_BUTTON_TIP_RED - : GTPP_UITextures.OVERLAY_BUTTON_TIP_GREEN - }) - .setPos(buttonXPositions[i / 3], 4 + (i % 3) * 18) - .setSize(18, 18)); + builder.widget(new ButtonWidget().setOnClick((clickData, widget) -> { + if (index % 3 == 0) { + if (clickData.mouseButton != 0) { + switchSlot1InOut(index / 3); + } else { + iterateSlot1Direction(index / 3); + } + } else if (index % 3 == 1) { + if (clickData.mouseButton != 0) { + switchSlot2InOut(index / 3); + } else { + iterateSlot2Direction(index / 3); + } + } else { + if (clickData.mouseButton != 0) { + switchSlot3InOut(index / 3); + } else { + iterateSlot3Direction(index / 3); + } + } + }).setBackground( + () -> new IDrawable[] { GT_UITextures.BUTTON_STANDARD, + GTPP_UITextures.OVERLAY_BUTTON_DIRECTION[mTargetDirections[index]], + mTargetInOut[index] ? GTPP_UITextures.OVERLAY_BUTTON_TIP_RED + : GTPP_UITextures.OVERLAY_BUTTON_TIP_GREEN }) + .setPos(buttonXPositions[i / 3], 4 + (i % 3) * 18).setSize(18, 18)); } for (int i = 0; i < 4; i++) { final int index = i; - builder.widget(new ButtonWidget() - .setOnClick((clickData, widget) -> iterateRangeDirection(index)) - .setBackground(() -> new IDrawable[] { - GT_UITextures.BUTTON_STANDARD, - GTPP_UITextures.OVERLAY_BUTTON_DIRECTION_GRAY[mRangeDirections[index]] - }) - .setPos(buttonXPositions[i], 59) - .setSize(18, 18)); + builder.widget( + new ButtonWidget().setOnClick((clickData, widget) -> iterateRangeDirection(index)) + .setBackground( + () -> new IDrawable[] { GT_UITextures.BUTTON_STANDARD, + GTPP_UITextures.OVERLAY_BUTTON_DIRECTION_GRAY[mRangeDirections[index]] }) + .setPos(buttonXPositions[i], 59).setSize(18, 18)); } for (int i = 0; i < mTargetDirections.length; i++) { final int index = i; - builder.widget(new FakeSyncWidget.ByteSyncer( - () -> { - if (index % 3 == 0) { - return getSlot1Direction(index / 3); - } else if (index % 3 == 1) { - return getSlot2Direction(index / 3); - } else { - return getSlot3Direction(index / 3); - } - }, - val -> mTargetDirections[index] = val)); + builder.widget(new FakeSyncWidget.ByteSyncer(() -> { + if (index % 3 == 0) { + return getSlot1Direction(index / 3); + } else if (index % 3 == 1) { + return getSlot2Direction(index / 3); + } else { + return getSlot3Direction(index / 3); + } + }, val -> mTargetDirections[index] = val)); } for (int i = 0; i < mRangeDirections.length; i++) { final int index = i; - builder.widget(new FakeSyncWidget.ByteSyncer( - () -> getRangeDirection(index), val -> mRangeDirections[index] = val)); + builder.widget( + new FakeSyncWidget.ByteSyncer( + () -> getRangeDirection(index), + val -> mRangeDirections[index] = val)); } for (int i = 0; i < mTargetInOut.length; i++) { final int index = i; - builder.widget(new FakeSyncWidget.BooleanSyncer( - () -> { - if (index % 3 == 0) { - return getSlot1InOut(index / 3); - } else if (index % 3 == 1) { - return getSlot2InOut(index / 3); - } else { - return getSlot3InOut(index / 3); - } - }, - val -> mTargetInOut[index] = val)); + builder.widget(new FakeSyncWidget.BooleanSyncer(() -> { + if (index % 3 == 0) { + return getSlot1InOut(index / 3); + } else if (index % 3 == 1) { + return getSlot2InOut(index / 3); + } else { + return getSlot3InOut(index / 3); + } + }, val -> mTargetInOut[index] = val)); } for (int i = 0; i < mTargetEnergy.length; i++) { final int index = i; diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/GT_MetaTileEntity_TesseractGenerator.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/GT_MetaTileEntity_TesseractGenerator.java index b990e3c55e..f3c4bf0f18 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/GT_MetaTileEntity_TesseractGenerator.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/GT_MetaTileEntity_TesseractGenerator.java @@ -2,6 +2,19 @@ package gtPlusPlus.xmod.gregtech.common.tileentities.automation; import static gtPlusPlus.core.lib.CORE.*; +import java.util.UUID; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.IInventory; +import net.minecraft.inventory.ISidedInventory; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.fluids.*; + import gregtech.api.enums.Textures; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IDigitalChest; @@ -17,17 +30,6 @@ import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.util.minecraft.PlayerUtils; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; import gtPlusPlus.xmod.gregtech.common.helpers.tesseract.TesseractHelper; -import java.util.UUID; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.IInventory; -import net.minecraft.inventory.ISidedInventory; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.world.World; -import net.minecraftforge.common.util.ForgeDirection; -import net.minecraftforge.fluids.*; public class GT_MetaTileEntity_TesseractGenerator extends GT_MetaTileEntity_BasicTank { @@ -39,13 +41,13 @@ public class GT_MetaTileEntity_TesseractGenerator extends GT_MetaTileEntity_Basi public int mFrequency = 0; public UUID mOwner; - public GT_MetaTileEntity_TesseractGenerator( - final int aID, final String aName, final String aNameRegional, final int aTier) { + public GT_MetaTileEntity_TesseractGenerator(final int aID, final String aName, final String aNameRegional, + final int aTier) { super(aID, aName, aNameRegional, aTier, 3, ""); } - public GT_MetaTileEntity_TesseractGenerator( - final String aName, final int aTier, final String aDescription, final ITexture[][][] aTextures) { + public GT_MetaTileEntity_TesseractGenerator(final String aName, final int aTier, final String aDescription, + final ITexture[][][] aTextures) { super(aName, aTier, 3, aDescription, aTextures); } @@ -137,10 +139,7 @@ public class GT_MetaTileEntity_TesseractGenerator extends GT_MetaTileEntity_Basi @Override public int getProgresstime() { return (TesseractHelper.getGeneratorByFrequency(PlayerUtils.getPlayerOnServerFromUUID(mOwner), this.mFrequency) - == this) - && (this.isWorking >= 20) - ? 999 - : 0; + == this) && (this.isWorking >= 20) ? 999 : 0; } @Override @@ -186,23 +185,15 @@ public class GT_MetaTileEntity_TesseractGenerator extends GT_MetaTileEntity_Basi } @Override - public boolean onRightclick( - final IGregTechTileEntity aBaseMetaTileEntity, - final EntityPlayer aPlayer, - final byte aSide, - final float aX, - final float aY, - final float aZ) { + public boolean onRightclick(final IGregTechTileEntity aBaseMetaTileEntity, final EntityPlayer aPlayer, + final byte aSide, final float aX, final float aY, final float aZ) { if (this.mOwner == null) { if (this.getBaseMetaTileEntity().getOwnerName() != null && !this.getBaseMetaTileEntity().getOwnerName().equals("")) { - if (this.getBaseMetaTileEntity() - .getOwnerName() - .toLowerCase() + if (this.getBaseMetaTileEntity().getOwnerName().toLowerCase() .equals(aPlayer.getDisplayName().toLowerCase())) { - this.mOwner = PlayerUtils.getPlayersUUIDByName( - this.getBaseMetaTileEntity().getOwnerName()); + this.mOwner = PlayerUtils.getPlayersUUIDByName(this.getBaseMetaTileEntity().getOwnerName()); } } } @@ -215,8 +206,7 @@ public class GT_MetaTileEntity_TesseractGenerator extends GT_MetaTileEntity_Basi Logger.WARNING("Freq. -1 | " + this.mFrequency); try { CORE.sTesseractGeneratorOwnershipMap.get(mOwner).remove(this.mFrequency); - } catch (Throwable t) { - } + } catch (Throwable t) {} this.mFrequency -= 1; break; @@ -224,8 +214,7 @@ public class GT_MetaTileEntity_TesseractGenerator extends GT_MetaTileEntity_Basi Logger.WARNING("Freq. +1 | " + this.mFrequency); try { CORE.sTesseractGeneratorOwnershipMap.get(mOwner).remove(this.mFrequency); - } catch (Throwable t) { - } + } catch (Throwable t) {} this.mFrequency += 1; default: // Utils.LOG_WARNING("Did not click the correct place."); @@ -233,7 +222,8 @@ public class GT_MetaTileEntity_TesseractGenerator extends GT_MetaTileEntity_Basi } if (getGeneratorEntity(this.mFrequency) != null && getGeneratorEntity(this.mFrequency) != this) { GT_Utility.sendChatToPlayer( - aPlayer, "Frequency: " + this.mFrequency + EnumChatFormatting.RED + " (Occupied)"); + aPlayer, + "Frequency: " + this.mFrequency + EnumChatFormatting.RED + " (Occupied)"); } else { GT_Utility.sendChatToPlayer(aPlayer, "Frequency: " + this.mFrequency); } @@ -246,8 +236,8 @@ public class GT_MetaTileEntity_TesseractGenerator extends GT_MetaTileEntity_Basi } @Override - public void onScrewdriverRightClick( - final byte aSide, final EntityPlayer aPlayer, final float aX, final float aY, final float aZ) { + public void onScrewdriverRightClick(final byte aSide, final EntityPlayer aPlayer, final float aX, final float aY, + final float aZ) { if (aPlayer.getUniqueID().compareTo(this.mOwner) == 0) { if (aSide == this.getBaseMetaTileEntity().getFrontFacing()) { final float[] tCoords = GT_Utility.getClickedFacingCoords(aSide, aX, aY, aZ); @@ -255,34 +245,31 @@ public class GT_MetaTileEntity_TesseractGenerator extends GT_MetaTileEntity_Basi case 0: try { CORE.sTesseractGeneratorOwnershipMap.get(mOwner).remove(this.mFrequency); - } catch (Throwable t) { - } + } catch (Throwable t) {} this.mFrequency -= 64; break; case 1: try { CORE.sTesseractGeneratorOwnershipMap.get(mOwner).remove(this.mFrequency); - } catch (Throwable t) { - } + } catch (Throwable t) {} this.mFrequency += 64; break; case 2: try { CORE.sTesseractGeneratorOwnershipMap.get(mOwner).remove(this.mFrequency); - } catch (Throwable t) { - } + } catch (Throwable t) {} this.mFrequency -= 512; break; case 3: try { CORE.sTesseractGeneratorOwnershipMap.get(mOwner).remove(this.mFrequency); - } catch (Throwable t) { - } + } catch (Throwable t) {} this.mFrequency += 512; } if (getGeneratorEntity(this.mFrequency) != null && getGeneratorEntity(this.mFrequency) != this) { GT_Utility.sendChatToPlayer( - aPlayer, "Frequency: " + this.mFrequency + EnumChatFormatting.RED + " (Occupied)"); + aPlayer, + "Frequency: " + this.mFrequency + EnumChatFormatting.RED + " (Occupied)"); } else { GT_Utility.sendChatToPlayer(aPlayer, "Frequency: " + this.mFrequency); } @@ -300,18 +287,13 @@ public class GT_MetaTileEntity_TesseractGenerator extends GT_MetaTileEntity_Basi public String[] getInfoData() { final TileEntity tTileEntity = this.getBaseMetaTileEntity() .getTileEntityAtSide(this.getBaseMetaTileEntity().getBackFacing()); - if ((tTileEntity != null) - && (this.getBaseMetaTileEntity().isAllowedToWork()) + if ((tTileEntity != null) && (this.getBaseMetaTileEntity().isAllowedToWork()) && ((tTileEntity instanceof IGregTechDeviceInformation)) && (((IGregTechDeviceInformation) tTileEntity).isGivingInformation())) { return ((IGregTechDeviceInformation) tTileEntity).getInfoData(); } - return new String[] { - "Tesseract Generator", - "Freqency:", - "" + this.mFrequency, - (getGeneratorEntity() == this) && (this.isWorking >= 20) ? "Active" : "Inactive" - }; + return new String[] { "Tesseract Generator", "Freqency:", "" + this.mFrequency, + (getGeneratorEntity() == this) && (this.isWorking >= 20) ? "Active" : "Inactive" }; } @Override @@ -322,8 +304,7 @@ public class GT_MetaTileEntity_TesseractGenerator extends GT_MetaTileEntity_Basi public boolean isSendingInformation() { final TileEntity tTileEntity = this.getBaseMetaTileEntity() .getTileEntityAtSide(this.getBaseMetaTileEntity().getBackFacing()); - if ((tTileEntity != null) - && (this.getBaseMetaTileEntity().isAllowedToWork()) + if ((tTileEntity != null) && (this.getBaseMetaTileEntity().isAllowedToWork()) && ((tTileEntity instanceof IGregTechDeviceInformation))) { return ((IGregTechDeviceInformation) tTileEntity).isGivingInformation(); } @@ -334,8 +315,7 @@ public class GT_MetaTileEntity_TesseractGenerator extends GT_MetaTileEntity_Basi public boolean isDigitalChest() { final TileEntity tTileEntity = this.getBaseMetaTileEntity() .getTileEntityAtSide(this.getBaseMetaTileEntity().getBackFacing()); - if ((tTileEntity != null) - && (this.getBaseMetaTileEntity().isAllowedToWork()) + if ((tTileEntity != null) && (this.getBaseMetaTileEntity().isAllowedToWork()) && ((tTileEntity instanceof IDigitalChest))) { return ((IDigitalChest) tTileEntity).isDigitalChest(); } @@ -346,8 +326,7 @@ public class GT_MetaTileEntity_TesseractGenerator extends GT_MetaTileEntity_Basi public ItemStack[] getStoredItemData() { final TileEntity tTileEntity = this.getBaseMetaTileEntity() .getTileEntityAtSide(this.getBaseMetaTileEntity().getBackFacing()); - if ((tTileEntity != null) - && (this.getBaseMetaTileEntity().isAllowedToWork()) + if ((tTileEntity != null) && (this.getBaseMetaTileEntity().isAllowedToWork()) && ((tTileEntity instanceof IDigitalChest))) { return ((IDigitalChest) tTileEntity).getStoredItemData(); } @@ -358,8 +337,7 @@ public class GT_MetaTileEntity_TesseractGenerator extends GT_MetaTileEntity_Basi public void setItemCount(final int aCount) { final TileEntity tTileEntity = this.getBaseMetaTileEntity() .getTileEntityAtSide(this.getBaseMetaTileEntity().getBackFacing()); - if ((tTileEntity != null) - && (this.getBaseMetaTileEntity().isAllowedToWork()) + if ((tTileEntity != null) && (this.getBaseMetaTileEntity().isAllowedToWork()) && ((tTileEntity instanceof IDigitalChest))) { ((IDigitalChest) tTileEntity).setItemCount(aCount); } @@ -369,8 +347,7 @@ public class GT_MetaTileEntity_TesseractGenerator extends GT_MetaTileEntity_Basi public int getMaxItemCount() { final TileEntity tTileEntity = this.getBaseMetaTileEntity() .getTileEntityAtSide(this.getBaseMetaTileEntity().getBackFacing()); - if ((tTileEntity != null) - && (this.getBaseMetaTileEntity().isAllowedToWork()) + if ((tTileEntity != null) && (this.getBaseMetaTileEntity().isAllowedToWork()) && ((tTileEntity instanceof IDigitalChest))) { return ((IDigitalChest) tTileEntity).getMaxItemCount(); } @@ -554,8 +531,7 @@ public class GT_MetaTileEntity_TesseractGenerator extends GT_MetaTileEntity_Basi if (!this.getBaseMetaTileEntity().isAllowedToWork()) { return false; } - int J = (aTerminal.getBaseMetaTileEntity().getWorld() - == this.getBaseMetaTileEntity().getWorld() + int J = (aTerminal.getBaseMetaTileEntity().getWorld() == this.getBaseMetaTileEntity().getWorld() ? TESSERACT_ENERGY_COST : TESSERACT_ENERGY_COST_DIMENSIONAL); @@ -569,11 +545,9 @@ public class GT_MetaTileEntity_TesseractGenerator extends GT_MetaTileEntity_Basi } public boolean isValidTesseractGenerator(final String aOwnerName, final boolean aWorkIrrelevant) { - return (this.getBaseMetaTileEntity() != null) - && (!this.getBaseMetaTileEntity().isInvalidTileEntity()) + return (this.getBaseMetaTileEntity() != null) && (!this.getBaseMetaTileEntity().isInvalidTileEntity()) && (this.getBaseMetaTileEntity().isAllowedToWork()) - && ((aOwnerName == null) - || (this.getBaseMetaTileEntity().getOwnerName().equals(aOwnerName))) + && ((aOwnerName == null) || (this.getBaseMetaTileEntity().getOwnerName().equals(aOwnerName))) && ((aWorkIrrelevant) || (this.isWorking >= 20)); } @@ -592,8 +566,7 @@ public class GT_MetaTileEntity_TesseractGenerator extends GT_MetaTileEntity_Basi if (PlayerUtils.getPlayersUUIDByName(this.getBaseMetaTileEntity().getOwnerName()) != null) { if (this.mOwner == null) { Logger.WARNING("Setting Generators Owner. 1"); - this.mOwner = PlayerUtils.getPlayersUUIDByName( - this.getBaseMetaTileEntity().getOwnerName()); + this.mOwner = PlayerUtils.getPlayersUUIDByName(this.getBaseMetaTileEntity().getOwnerName()); } } @@ -617,7 +590,9 @@ public class GT_MetaTileEntity_TesseractGenerator extends GT_MetaTileEntity_Basi .isValidTesseractGenerator(null, true))) { // Utils.LOG_WARNING("storing TE I think to mFreq map?"); TesseractHelper.setGeneratorOwnershipByPlayer( - PlayerUtils.getPlayerOnServerFromUUID(mOwner), this.mFrequency, this); + PlayerUtils.getPlayerOnServerFromUUID(mOwner), + this.mFrequency, + this); } } else { if (getGeneratorEntity(Integer.valueOf(this.mFrequency)) == this) { @@ -646,25 +621,22 @@ public class GT_MetaTileEntity_TesseractGenerator extends GT_MetaTileEntity_Basi @Override public String[] getDescription() { - return new String[] { - this.mDescription, - "Generates a Tesseract for the attached Inventory", - "Connect with pipes to insert items", - "Consumes " + TESSERACT_ENERGY_COST + "EU/t for same dimension transfers", - "Consumes " + TESSERACT_ENERGY_COST_DIMENSIONAL + "EU/t for cross dimensional transfers", - CORE.GT_Tooltip - }; + return new String[] { this.mDescription, "Generates a Tesseract for the attached Inventory", + "Connect with pipes to insert items", + "Consumes " + TESSERACT_ENERGY_COST + "EU/t for same dimension transfers", + "Consumes " + TESSERACT_ENERGY_COST_DIMENSIONAL + "EU/t for cross dimensional transfers", + CORE.GT_Tooltip }; } @Override - public boolean allowPullStack( - final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, final ItemStack aStack) { + public boolean allowPullStack(final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, + final ItemStack aStack) { return false; } @Override - public boolean allowPutStack( - final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, final ItemStack aStack) { + public boolean allowPutStack(final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, + final ItemStack aStack) { return false; } @@ -674,22 +646,13 @@ public class GT_MetaTileEntity_TesseractGenerator extends GT_MetaTileEntity_Basi } @Override - public ITexture[] getTexture( - final IGregTechTileEntity aBaseMetaTileEntity, - final byte aSide, - final byte aFacing, - final byte aColorIndex, - final boolean aActive, - final boolean aRedstone) { + public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing, + final byte aColorIndex, final boolean aActive, final boolean aRedstone) { return aSide == aFacing - ? new ITexture[] { - new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Dimensional), - new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Screen_Frequency) - } - : new ITexture[] { - new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Dimensional), - new GT_RenderedTexture(Textures.BlockIcons.VOID) - }; + ? new ITexture[] { new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Dimensional), + new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Screen_Frequency) } + : new ITexture[] { new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Dimensional), + new GT_RenderedTexture(Textures.BlockIcons.VOID) }; } // To-Do? @@ -724,8 +687,8 @@ public class GT_MetaTileEntity_TesseractGenerator extends GT_MetaTileEntity_Basi } private GT_MetaTileEntity_TesseractGenerator getGeneratorEntity() { - GT_MetaTileEntity_TesseractGenerator thisGenerator = - TesseractHelper.getGeneratorByFrequency(PlayerUtils.getPlayerOnServerFromUUID(mOwner), this.mFrequency); + GT_MetaTileEntity_TesseractGenerator thisGenerator = TesseractHelper + .getGeneratorByFrequency(PlayerUtils.getPlayerOnServerFromUUID(mOwner), this.mFrequency); if (thisGenerator != null) { return thisGenerator; } @@ -733,8 +696,8 @@ public class GT_MetaTileEntity_TesseractGenerator extends GT_MetaTileEntity_Basi } private GT_MetaTileEntity_TesseractGenerator getGeneratorEntity(int frequency) { - GT_MetaTileEntity_TesseractGenerator thisGenerator = - TesseractHelper.getGeneratorByFrequency(PlayerUtils.getPlayerOnServerFromUUID(mOwner), frequency); + GT_MetaTileEntity_TesseractGenerator thisGenerator = TesseractHelper + .getGeneratorByFrequency(PlayerUtils.getPlayerOnServerFromUUID(mOwner), frequency); if (thisGenerator != null) { return thisGenerator; } @@ -745,8 +708,7 @@ public class GT_MetaTileEntity_TesseractGenerator extends GT_MetaTileEntity_Basi public void onCreated(ItemStack aStack, World aWorld, EntityPlayer aPlayer) { if (this.getBaseMetaTileEntity().getOwnerName() != null && !this.getBaseMetaTileEntity().getOwnerName().equals("")) { - this.mOwner = PlayerUtils.getPlayersUUIDByName( - this.getBaseMetaTileEntity().getOwnerName()); + this.mOwner = PlayerUtils.getPlayersUUIDByName(this.getBaseMetaTileEntity().getOwnerName()); Logger.WARNING("Setting Generators Owner. 2"); } super.onCreated(aStack, aWorld, aPlayer); @@ -756,8 +718,7 @@ public class GT_MetaTileEntity_TesseractGenerator extends GT_MetaTileEntity_Basi public void onRemoval() { try { CORE.sTesseractGeneratorOwnershipMap.get(mOwner).remove(this.mFrequency); - } catch (Throwable t) { - } + } catch (Throwable t) {} super.onRemoval(); } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/GT_MetaTileEntity_TesseractTerminal.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/GT_MetaTileEntity_TesseractTerminal.java index 5d2a9ae009..cfcdc5f6f9 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/GT_MetaTileEntity_TesseractTerminal.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/GT_MetaTileEntity_TesseractTerminal.java @@ -1,5 +1,17 @@ package gtPlusPlus.xmod.gregtech.common.tileentities.automation; +import java.util.UUID; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.fluids.FluidTankInfo; + import gregtech.api.enums.Textures; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; @@ -12,18 +24,9 @@ import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.util.minecraft.PlayerUtils; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; import gtPlusPlus.xmod.gregtech.common.helpers.tesseract.TesseractHelper; -import java.util.UUID; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.world.World; -import net.minecraftforge.common.util.ForgeDirection; -import net.minecraftforge.fluids.Fluid; -import net.minecraftforge.fluids.FluidStack; -import net.minecraftforge.fluids.FluidTankInfo; public class GT_MetaTileEntity_TesseractTerminal extends GT_MetaTileEntity_BasicTank { + public int mFrequency = 0; public UUID mOwner; public boolean mDidWork = false; @@ -31,13 +34,13 @@ public class GT_MetaTileEntity_TesseractTerminal extends GT_MetaTileEntity_Basic private static int TESSERACT_ENERGY_COST = 128; private static int TESSERACT_ENERGY_COST_DIMENSIONAL = 512; - public GT_MetaTileEntity_TesseractTerminal( - final int aID, final String aName, final String aNameRegional, final int aTier) { + public GT_MetaTileEntity_TesseractTerminal(final int aID, final String aName, final String aNameRegional, + final int aTier) { super(aID, aName, aNameRegional, aTier, 3, ""); } - public GT_MetaTileEntity_TesseractTerminal( - final String aName, final int aTier, final String aDescription, final ITexture[][][] aTextures) { + public GT_MetaTileEntity_TesseractTerminal(final String aName, final int aTier, final String aDescription, + final ITexture[][][] aTextures) { super(aName, aTier, 3, aDescription, aTextures); } @@ -141,23 +144,15 @@ public class GT_MetaTileEntity_TesseractTerminal extends GT_MetaTileEntity_Basic } @Override - public boolean onRightclick( - final IGregTechTileEntity aBaseMetaTileEntity, - final EntityPlayer aPlayer, - final byte aSide, - final float aX, - final float aY, - final float aZ) { + public boolean onRightclick(final IGregTechTileEntity aBaseMetaTileEntity, final EntityPlayer aPlayer, + final byte aSide, final float aX, final float aY, final float aZ) { if (this.mOwner == null) { if (this.getBaseMetaTileEntity().getOwnerName() != null && !this.getBaseMetaTileEntity().getOwnerName().equals("")) { - if (this.getBaseMetaTileEntity() - .getOwnerName() - .toLowerCase() + if (this.getBaseMetaTileEntity().getOwnerName().toLowerCase() .equals(aPlayer.getDisplayName().toLowerCase())) { - this.mOwner = PlayerUtils.getPlayersUUIDByName( - this.getBaseMetaTileEntity().getOwnerName()); + this.mOwner = PlayerUtils.getPlayersUUIDByName(this.getBaseMetaTileEntity().getOwnerName()); } } } @@ -170,33 +165,27 @@ public class GT_MetaTileEntity_TesseractTerminal extends GT_MetaTileEntity_Basic // Utils.LOG_WARNING("Freq. -1 | " + this.mFrequency); try { CORE.sTesseractTerminalOwnershipMap.get(mOwner).remove(this.mFrequency); - } catch (Throwable t) { - } + } catch (Throwable t) {} this.mFrequency -= 1; break; case 1: // Utils.LOG_WARNING("Freq. +1 | " + this.mFrequency); try { CORE.sTesseractTerminalOwnershipMap.get(mOwner).remove(this.mFrequency); - } catch (Throwable t) { - } + } catch (Throwable t) {} this.mFrequency += 1; default: // Utils.LOG_WARNING("Did not click the correct place."); try { CORE.sTesseractTerminalOwnershipMap.get(mOwner).remove(this.mFrequency); - } catch (Throwable t) { - } + } catch (Throwable t) {} break; } PlayerUtils.messagePlayer(aPlayer, "Frequency: " + this.mFrequency); if (this.getTesseract(this.mFrequency, false) != null) { PlayerUtils.messagePlayer( aPlayer, - new StringBuilder() - .append(EnumChatFormatting.GREEN) - .append(" (Connected)") - .toString()); + new StringBuilder().append(EnumChatFormatting.GREEN).append(" (Connected)").toString()); } } } else if (aPlayer.getUniqueID().compareTo(this.mOwner) != 0) { @@ -206,8 +195,8 @@ public class GT_MetaTileEntity_TesseractTerminal extends GT_MetaTileEntity_Basic } @Override - public void onScrewdriverRightClick( - final byte aSide, final EntityPlayer aPlayer, final float aX, final float aY, final float aZ) { + public void onScrewdriverRightClick(final byte aSide, final EntityPlayer aPlayer, final float aX, final float aY, + final float aZ) { if (aPlayer.getUniqueID().compareTo(this.mOwner) == 0) { if (aSide == this.getBaseMetaTileEntity().getFrontFacing()) { final float[] tCoords = GT_Utility.getClickedFacingCoords(aSide, aX, aY, aZ); @@ -215,39 +204,32 @@ public class GT_MetaTileEntity_TesseractTerminal extends GT_MetaTileEntity_Basic case 0: try { CORE.sTesseractTerminalOwnershipMap.get(mOwner).remove(this.mFrequency); - } catch (Throwable t) { - } + } catch (Throwable t) {} this.mFrequency -= 64; break; case 1: try { CORE.sTesseractTerminalOwnershipMap.get(mOwner).remove(this.mFrequency); - } catch (Throwable t) { - } + } catch (Throwable t) {} this.mFrequency += 64; break; case 2: try { CORE.sTesseractTerminalOwnershipMap.get(mOwner).remove(this.mFrequency); - } catch (Throwable t) { - } + } catch (Throwable t) {} this.mFrequency -= 512; break; case 3: try { CORE.sTesseractTerminalOwnershipMap.get(mOwner).remove(this.mFrequency); - } catch (Throwable t) { - } + } catch (Throwable t) {} this.mFrequency += 512; } GT_Utility.sendChatToPlayer( aPlayer, "Frequency: " + this.mFrequency - + (this.getTesseract(this.mFrequency, false) == null - ? "" - : new StringBuilder() - .append(EnumChatFormatting.GREEN) - .append(" (Connected)") + + (this.getTesseract(this.mFrequency, false) == null ? "" + : new StringBuilder().append(EnumChatFormatting.GREEN).append(" (Connected)") .toString())); } } else if (aPlayer.getUniqueID().compareTo(this.mOwner) != 0) { @@ -260,8 +242,8 @@ public class GT_MetaTileEntity_TesseractTerminal extends GT_MetaTileEntity_Basic } public GT_MetaTileEntity_TesseractGenerator getTesseract(final int aFrequency, final boolean aWorkIrrelevant) { - final GT_MetaTileEntity_TesseractGenerator rTesseract = - TesseractHelper.getGeneratorByFrequency(PlayerUtils.getPlayerOnServerFromUUID(mOwner), aFrequency); + final GT_MetaTileEntity_TesseractGenerator rTesseract = TesseractHelper + .getGeneratorByFrequency(PlayerUtils.getPlayerOnServerFromUUID(mOwner), aFrequency); if (rTesseract == null) { return null; } @@ -270,15 +252,16 @@ public class GT_MetaTileEntity_TesseractTerminal extends GT_MetaTileEntity_Basic } if (rTesseract.mFrequency != aFrequency) { TesseractHelper.setTerminalOwnershipByPlayer( - PlayerUtils.getPlayerOnServerFromUUID(mOwner), Integer.valueOf(aFrequency), null); + PlayerUtils.getPlayerOnServerFromUUID(mOwner), + Integer.valueOf(aFrequency), + null); return null; } if (!rTesseract.isValidTesseractGenerator(this.getBaseMetaTileEntity().getOwnerName(), aWorkIrrelevant)) { return null; } if ((!sInterDimensionalTesseractAllowed) - && (rTesseract.getBaseMetaTileEntity().getWorld() - != this.getBaseMetaTileEntity().getWorld())) { + && (rTesseract.getBaseMetaTileEntity().getWorld() != this.getBaseMetaTileEntity().getWorld())) { return null; } return rTesseract; @@ -287,17 +270,12 @@ public class GT_MetaTileEntity_TesseractTerminal extends GT_MetaTileEntity_Basic @Override public String[] getInfoData() { final GT_MetaTileEntity_TesseractGenerator tTileEntity = this.getTesseract(this.mFrequency, false); - if ((tTileEntity != null) - && (this.getBaseMetaTileEntity().isAllowedToWork()) + if ((tTileEntity != null) && (this.getBaseMetaTileEntity().isAllowedToWork()) && (tTileEntity.isSendingInformation())) { return tTileEntity.getInfoData(); } - return new String[] { - "Tesseract Generator", - "Freqency:", - "" + this.mFrequency, - this.getTesseract(this.mFrequency, false) != null ? "Active" : "Inactive" - }; + return new String[] { "Tesseract Generator", "Freqency:", "" + this.mFrequency, + this.getTesseract(this.mFrequency, false) != null ? "Active" : "Inactive" }; } @Override @@ -487,13 +465,11 @@ public class GT_MetaTileEntity_TesseractTerminal extends GT_MetaTileEntity_Basic @Override public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { - if ((this.getBaseMetaTileEntity().isServerSide()) - && (this.getBaseMetaTileEntity().isAllowedToWork())) { + if ((this.getBaseMetaTileEntity().isServerSide()) && (this.getBaseMetaTileEntity().isAllowedToWork())) { // Set owner if (PlayerUtils.getPlayersUUIDByName(this.getBaseMetaTileEntity().getOwnerName()) != null) { if (this.mOwner == null) { - this.mOwner = PlayerUtils.getPlayersUUIDByName( - this.getBaseMetaTileEntity().getOwnerName()); + this.mOwner = PlayerUtils.getPlayersUUIDByName(this.getBaseMetaTileEntity().getOwnerName()); } } final GT_MetaTileEntity_TesseractGenerator tTileEntity = this.getTesseract(this.mFrequency, true); @@ -513,26 +489,22 @@ public class GT_MetaTileEntity_TesseractTerminal extends GT_MetaTileEntity_Basic @Override public String[] getDescription() { - return new String[] { - this.mDescription, - "Accesses Tesseract Generators remotely", - "Connect with pipes to extract items or fluids", - "Outputs from the back face", - "Consumes " + TESSERACT_ENERGY_COST + "EU/t for same dimension transfers", - "Consumes " + TESSERACT_ENERGY_COST_DIMENSIONAL + "EU/t for cross dimensional transfers", - CORE.GT_Tooltip - }; + return new String[] { this.mDescription, "Accesses Tesseract Generators remotely", + "Connect with pipes to extract items or fluids", "Outputs from the back face", + "Consumes " + TESSERACT_ENERGY_COST + "EU/t for same dimension transfers", + "Consumes " + TESSERACT_ENERGY_COST_DIMENSIONAL + "EU/t for cross dimensional transfers", + CORE.GT_Tooltip }; } @Override - public boolean allowPullStack( - final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, final ItemStack aStack) { + public boolean allowPullStack(final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, + final ItemStack aStack) { return false; } @Override - public boolean allowPutStack( - final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, final ItemStack aStack) { + public boolean allowPutStack(final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, + final ItemStack aStack) { return false; } @@ -542,22 +514,13 @@ public class GT_MetaTileEntity_TesseractTerminal extends GT_MetaTileEntity_Basic } @Override - public ITexture[] getTexture( - final IGregTechTileEntity aBaseMetaTileEntity, - final byte aSide, - final byte aFacing, - final byte aColorIndex, - final boolean aActive, - final boolean aRedstone) { + public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing, + final byte aColorIndex, final boolean aActive, final boolean aRedstone) { return aSide == aFacing - ? new ITexture[] { - new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Dimensional), - new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Screen_Frequency) - } - : new ITexture[] { - new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Dimensional), - new GT_RenderedTexture(Textures.BlockIcons.VOID) - }; + ? new ITexture[] { new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Dimensional), + new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Screen_Frequency) } + : new ITexture[] { new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Dimensional), + new GT_RenderedTexture(Textures.BlockIcons.VOID) }; } // To-Do? @@ -595,8 +558,7 @@ public class GT_MetaTileEntity_TesseractTerminal extends GT_MetaTileEntity_Basic public void onCreated(ItemStack aStack, World aWorld, EntityPlayer aPlayer) { if (this.getBaseMetaTileEntity().getOwnerName() != null && !this.getBaseMetaTileEntity().getOwnerName().equals("")) { - this.mOwner = PlayerUtils.getPlayersUUIDByName( - this.getBaseMetaTileEntity().getOwnerName()); + this.mOwner = PlayerUtils.getPlayersUUIDByName(this.getBaseMetaTileEntity().getOwnerName()); } super.onCreated(aStack, aWorld, aPlayer); } @@ -605,8 +567,7 @@ public class GT_MetaTileEntity_TesseractTerminal extends GT_MetaTileEntity_Basic public void onRemoval() { try { CORE.sTesseractTerminalOwnershipMap.get(mOwner).remove(this.mFrequency); - } catch (Throwable t) { - } + } catch (Throwable t) {} super.onRemoval(); } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_Boiler_Base.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_Boiler_Base.java index 277fc8d873..ed71bcabe7 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_Boiler_Base.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_Boiler_Base.java @@ -1,7 +1,13 @@ package gtPlusPlus.xmod.gregtech.common.tileentities.generators; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntityFurnace; +import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.fluids.FluidTankInfo; + import com.gtnewhorizons.modularui.api.drawable.IDrawable; import com.gtnewhorizons.modularui.api.drawable.UITexture; + import cpw.mods.fml.common.registry.GameRegistry; import gregtech.api.enums.Materials; import gregtech.api.enums.OrePrefixes; @@ -18,10 +24,6 @@ import gregtech.api.util.GT_Utility; import gregtech.common.tileentities.boilers.GT_MetaTileEntity_Boiler; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.xmod.gregtech.api.gui.GTPP_UITextures; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntityFurnace; -import net.minecraftforge.common.util.ForgeDirection; -import net.minecraftforge.fluids.FluidTankInfo; public class GT_MetaTileEntity_Boiler_Base extends GT_MetaTileEntity_Boiler { @@ -46,14 +48,10 @@ public class GT_MetaTileEntity_Boiler_Base extends GT_MetaTileEntity_Boiler { @Override public String[] getDescription() { - return new String[] { - this.mDescription, - "Produces " + getPollution() + " pollution/sec", - "Consumes fuel only when temperature is less than 100C", - "Fuel with burn time greater than 500 is more efficient.", - "Doesn't explode if there's no water", - CORE.GT_Tooltip - }; + return new String[] { this.mDescription, "Produces " + getPollution() + " pollution/sec", + "Consumes fuel only when temperature is less than 100C", + "Fuel with burn time greater than 500 is more efficient.", "Doesn't explode if there's no water", + CORE.GT_Tooltip }; } public ITexture getOverlayIcon() { @@ -91,25 +89,15 @@ public class GT_MetaTileEntity_Boiler_Base extends GT_MetaTileEntity_Boiler { } @Override - public ITexture[] getTexture( - final IGregTechTileEntity aBaseMetaTileEntity, - final byte aSide, - final byte aFacing, - final byte aColorIndex, - final boolean aActive, - final boolean aRedstone) { - return this.mTextures[ - (aActive ? 5 : 0) - + (aSide == aFacing - ? 0 - : aSide == GT_Utility.getOppositeSide(aFacing) - ? 1 - : aSide == 0 ? 2 : aSide == 1 ? 3 : 4)][ - aColorIndex + 1]; + public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing, + final byte aColorIndex, final boolean aActive, final boolean aRedstone) { + return this.mTextures[(aActive ? 5 : 0) + (aSide == aFacing ? 0 + : aSide == GT_Utility.getOppositeSide(aFacing) ? 1 : aSide == 0 ? 2 : aSide == 1 ? 3 : 4)][aColorIndex + + 1]; } public ITexture[] getFront(final byte aColor) { - return new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[this.tier][aColor + 1], this.getCasingTexture()}; + return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.tier][aColor + 1], this.getCasingTexture() }; } public ITexture[] getBack(final byte aColor) { @@ -125,7 +113,7 @@ public class GT_MetaTileEntity_Boiler_Base extends GT_MetaTileEntity_Boiler { } public ITexture[] getSides(final byte aColor) { - return new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[this.tier][aColor + 1], this.getCasingTexture()}; + return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.tier][aColor + 1], this.getCasingTexture() }; } public ITexture[] getFrontActive(final byte aColor) { @@ -233,9 +221,8 @@ public class GT_MetaTileEntity_Boiler_Base extends GT_MetaTileEntity_Boiler { // Since this type of machine can have different water and steam capacities, we need to override getTankInfo() to // support returning those different capacities. public FluidTankInfo[] getTankInfo(ForgeDirection aSide) { - return new FluidTankInfo[] { - new FluidTankInfo(this.mFluid, getCapacity()), new FluidTankInfo(this.mSteam, getSteamCapacity()) - }; + return new FluidTankInfo[] { new FluidTankInfo(this.mFluid, getCapacity()), + new FluidTankInfo(this.mSteam, getSteamCapacity()) }; } @Override @@ -306,12 +293,12 @@ public class GT_MetaTileEntity_Boiler_Base extends GT_MetaTileEntity_Boiler { @Override protected IDrawable[] getFuelSlotBackground() { - return new IDrawable[] {getGUITextureSet().getItemSlot(), GTPP_UITextures.OVERLAY_SLOT_COAL}; + return new IDrawable[] { getGUITextureSet().getItemSlot(), GTPP_UITextures.OVERLAY_SLOT_COAL }; } @Override protected IDrawable[] getAshSlotBackground() { - return new IDrawable[] {getGUITextureSet().getItemSlot(), GT_UITextures.OVERLAY_SLOT_DUST}; + return new IDrawable[] { getGUITextureSet().getItemSlot(), GT_UITextures.OVERLAY_SLOT_DUST }; } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_Boiler_HV.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_Boiler_HV.java index 867623f692..d2a924009f 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_Boiler_HV.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_Boiler_HV.java @@ -29,27 +29,20 @@ public class GT_MetaTileEntity_Boiler_HV extends GT_MetaTileEntity_Boiler_Base { @Override public ITexture[] getFront(final byte aColor) { - return new ITexture[] { - super.getFront(aColor)[0], this.getCasingTexture(), new GT_RenderedTexture(Textures.BlockIcons.BOILER_FRONT) - }; + return new ITexture[] { super.getFront(aColor)[0], this.getCasingTexture(), + new GT_RenderedTexture(Textures.BlockIcons.BOILER_FRONT) }; } @Override public ITexture[] getTop(final byte aColor) { - return new ITexture[] { - super.getTop(aColor)[0], - this.getCasingTexture(), - new GT_RenderedTexture(TexturesGtBlock.Casing_Material_Talonite) - }; + return new ITexture[] { super.getTop(aColor)[0], this.getCasingTexture(), + new GT_RenderedTexture(TexturesGtBlock.Casing_Material_Talonite) }; } @Override public ITexture[] getFrontActive(final byte aColor) { - return new ITexture[] { - super.getFrontActive(aColor)[0], - this.getCasingTexture(), - new GT_RenderedTexture(Textures.BlockIcons.BOILER_FRONT_ACTIVE) - }; + return new ITexture[] { super.getFrontActive(aColor)[0], this.getCasingTexture(), + new GT_RenderedTexture(Textures.BlockIcons.BOILER_FRONT_ACTIVE) }; } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_Boiler_LV.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_Boiler_LV.java index 6aeedaa6f3..98dd73a13c 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_Boiler_LV.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_Boiler_LV.java @@ -29,27 +29,20 @@ public class GT_MetaTileEntity_Boiler_LV extends GT_MetaTileEntity_Boiler_Base { @Override public ITexture[] getFront(final byte aColor) { - return new ITexture[] { - super.getFront(aColor)[0], this.getCasingTexture(), new GT_RenderedTexture(Textures.BlockIcons.BOILER_FRONT) - }; + return new ITexture[] { super.getFront(aColor)[0], this.getCasingTexture(), + new GT_RenderedTexture(Textures.BlockIcons.BOILER_FRONT) }; } @Override public ITexture[] getTop(final byte aColor) { - return new ITexture[] { - super.getTop(aColor)[0], - this.getCasingTexture(), - new GT_RenderedTexture(TexturesGtBlock.Casing_Material_Potin) - }; + return new ITexture[] { super.getTop(aColor)[0], this.getCasingTexture(), + new GT_RenderedTexture(TexturesGtBlock.Casing_Material_Potin) }; } @Override public ITexture[] getFrontActive(final byte aColor) { - return new ITexture[] { - super.getFrontActive(aColor)[0], - this.getCasingTexture(), - new GT_RenderedTexture(Textures.BlockIcons.BOILER_FRONT_ACTIVE) - }; + return new ITexture[] { super.getFrontActive(aColor)[0], this.getCasingTexture(), + new GT_RenderedTexture(Textures.BlockIcons.BOILER_FRONT_ACTIVE) }; } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_Boiler_MV.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_Boiler_MV.java index 9f329f92da..cb2a5fbbd8 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_Boiler_MV.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_Boiler_MV.java @@ -29,27 +29,20 @@ public class GT_MetaTileEntity_Boiler_MV extends GT_MetaTileEntity_Boiler_Base { @Override public ITexture[] getFront(final byte aColor) { - return new ITexture[] { - super.getFront(aColor)[0], this.getCasingTexture(), new GT_RenderedTexture(Textures.BlockIcons.BOILER_FRONT) - }; + return new ITexture[] { super.getFront(aColor)[0], this.getCasingTexture(), + new GT_RenderedTexture(Textures.BlockIcons.BOILER_FRONT) }; } @Override public ITexture[] getTop(final byte aColor) { - return new ITexture[] { - super.getTop(aColor)[0], - this.getCasingTexture(), - new GT_RenderedTexture(TexturesGtBlock.Casing_Material_Tumbaga) - }; + return new ITexture[] { super.getTop(aColor)[0], this.getCasingTexture(), + new GT_RenderedTexture(TexturesGtBlock.Casing_Material_Tumbaga) }; } @Override public ITexture[] getFrontActive(final byte aColor) { - return new ITexture[] { - super.getFrontActive(aColor)[0], - this.getCasingTexture(), - new GT_RenderedTexture(Textures.BlockIcons.BOILER_FRONT_ACTIVE) - }; + return new ITexture[] { super.getFrontActive(aColor)[0], this.getCasingTexture(), + new GT_RenderedTexture(Textures.BlockIcons.BOILER_FRONT_ACTIVE) }; } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_Boiler_Solar.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_Boiler_Solar.java index 888cb6a195..00ce747e4f 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_Boiler_Solar.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_Boiler_Solar.java @@ -1,5 +1,10 @@ package gtPlusPlus.xmod.gregtech.common.tileentities.generators; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.fluids.IFluidHandler; + import gregtech.api.enums.Dyes; import gregtech.api.enums.Textures; import gregtech.api.interfaces.ITexture; @@ -9,66 +14,55 @@ import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.util.GT_ModHandler; import gregtech.common.tileentities.boilers.GT_MetaTileEntity_Boiler; import gtPlusPlus.core.lib.CORE; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraftforge.common.util.ForgeDirection; -import net.minecraftforge.fluids.FluidStack; -import net.minecraftforge.fluids.IFluidHandler; public class GT_MetaTileEntity_Boiler_Solar extends GT_MetaTileEntity_Boiler { + public GT_MetaTileEntity_Boiler_Solar(final int aID, final String aName, final String aNameRegional) { super(aID, aName, aNameRegional, "Steam Power by the Sun"); } - public GT_MetaTileEntity_Boiler_Solar( - final String aName, final int aTier, final String aDescription, final ITexture[][][] aTextures) { + public GT_MetaTileEntity_Boiler_Solar(final String aName, final int aTier, final String aDescription, + final ITexture[][][] aTextures) { super(aName, aTier, aDescription, aTextures); } @Override public String[] getDescription() { - return new String[] { - this.mDescription, "Produces " + (this.getPollution() * 20) + " pollution/sec", CORE.GT_Tooltip - }; + return new String[] { this.mDescription, "Produces " + (this.getPollution() * 20) + " pollution/sec", + CORE.GT_Tooltip }; } @Override public ITexture[][][] getTextureSet(final ITexture[] aTextures) { final ITexture[][][] rTextures = new ITexture[4][17][]; for (byte i = -1; i < 16; i = (byte) (i + 1)) { - final ITexture[] tmp0 = { - new GT_RenderedTexture( - Textures.BlockIcons.MACHINE_BRONZEBRICKS_BOTTOM, Dyes.getModulation(i, Dyes._NULL.mRGBa)) - }; + final ITexture[] tmp0 = { new GT_RenderedTexture( + Textures.BlockIcons.MACHINE_BRONZEBRICKS_BOTTOM, + Dyes.getModulation(i, Dyes._NULL.mRGBa)) }; rTextures[0][(i + 1)] = tmp0; final ITexture[] tmp1 = { - new GT_RenderedTexture( - Textures.BlockIcons.MACHINE_BRONZEBRICKS_TOP, Dyes.getModulation(i, Dyes._NULL.mRGBa)), - new GT_RenderedTexture(Textures.BlockIcons.BOILER_SOLAR) - }; + new GT_RenderedTexture( + Textures.BlockIcons.MACHINE_BRONZEBRICKS_TOP, + Dyes.getModulation(i, Dyes._NULL.mRGBa)), + new GT_RenderedTexture(Textures.BlockIcons.BOILER_SOLAR) }; rTextures[1][(i + 1)] = tmp1; - final ITexture[] tmp2 = { - new GT_RenderedTexture( - Textures.BlockIcons.MACHINE_BRONZEBRICKS_SIDE, Dyes.getModulation(i, Dyes._NULL.mRGBa)) - }; + final ITexture[] tmp2 = { new GT_RenderedTexture( + Textures.BlockIcons.MACHINE_BRONZEBRICKS_SIDE, + Dyes.getModulation(i, Dyes._NULL.mRGBa)) }; rTextures[2][(i + 1)] = tmp2; final ITexture[] tmp3 = { - new GT_RenderedTexture( - Textures.BlockIcons.MACHINE_BRONZEBRICKS_SIDE, Dyes.getModulation(i, Dyes._NULL.mRGBa)), - new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE) - }; + new GT_RenderedTexture( + Textures.BlockIcons.MACHINE_BRONZEBRICKS_SIDE, + Dyes.getModulation(i, Dyes._NULL.mRGBa)), + new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE) }; rTextures[3][(i + 1)] = tmp3; } return rTextures; } @Override - public ITexture[] getTexture( - final IGregTechTileEntity aBaseMetaTileEntity, - final byte aSide, - final byte aFacing, - final byte aColorIndex, - final boolean aActive, - final boolean aRedstone) { + public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing, + final byte aColorIndex, final boolean aActive, final boolean aRedstone) { return this.mTextures[aSide >= 2 ? ((byte) (aSide != aFacing ? 2 : 3)) : aSide][aColorIndex + 1]; } @@ -111,11 +105,11 @@ public class GT_MetaTileEntity_Boiler_Solar extends GT_MetaTileEntity_Boiler { final byte i = aBaseMetaTileEntity.getFrontFacing(); final IFluidHandler tTileEntity = aBaseMetaTileEntity.getITankContainerAtSide(i); if (tTileEntity != null) { - final FluidStack tDrained = aBaseMetaTileEntity.drain( - ForgeDirection.getOrientation(i), Math.max(1, this.mSteam.amount / 2), false); + final FluidStack tDrained = aBaseMetaTileEntity + .drain(ForgeDirection.getOrientation(i), Math.max(1, this.mSteam.amount / 2), false); if (tDrained != null) { - final int tFilledAmount = tTileEntity.fill( - ForgeDirection.getOrientation(i).getOpposite(), tDrained, false); + final int tFilledAmount = tTileEntity + .fill(ForgeDirection.getOrientation(i).getOpposite(), tDrained, false); if (tFilledAmount > 0) { tTileEntity.fill( ForgeDirection.getOrientation(i).getOpposite(), @@ -156,16 +150,14 @@ public class GT_MetaTileEntity_Boiler_Solar extends GT_MetaTileEntity_Boiler { this.sendSound((byte) 1); this.mSteam.amount = 12000; } - if ((this.mProcessingEnergy <= 0) - && (aBaseMetaTileEntity.isAllowedToWork()) + if ((this.mProcessingEnergy <= 0) && (aBaseMetaTileEntity.isAllowedToWork()) && ((aTick % 256L) == 0L) && (!aBaseMetaTileEntity.getWorld().isThundering())) { - final boolean bRain = - aBaseMetaTileEntity.getWorld().isRaining() && (aBaseMetaTileEntity.getBiome().rainfall > 0.0F); + final boolean bRain = aBaseMetaTileEntity.getWorld().isRaining() + && (aBaseMetaTileEntity.getBiome().rainfall > 0.0F); this.mProcessingEnergy += (bRain && (aBaseMetaTileEntity.getWorld().skylightSubtracted >= 4)) - || !aBaseMetaTileEntity.getSkyAtSide((byte) 1) - ? 0 - : !bRain && aBaseMetaTileEntity.getWorld().isDaytime() ? 8 : 1; + || !aBaseMetaTileEntity.getSkyAtSide((byte) 1) ? 0 + : !bRain && aBaseMetaTileEntity.getWorld().isDaytime() ? 8 : 1; } if ((this.mTemperature < 500) && (this.mProcessingEnergy > 0) && ((aTick % 12L) == 0L)) { this.mProcessingEnergy -= 1; diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_RfConvertor.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_RfConvertor.java index e077d5ef90..9b0548d95a 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_RfConvertor.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_RfConvertor.java @@ -2,6 +2,13 @@ package gtPlusPlus.xmod.gregtech.common.tileentities.generators; import static gregtech.api.enums.GT_Values.V; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.EnumChatFormatting; +import net.minecraftforge.common.util.ForgeDirection; + import cofh.api.energy.IEnergyProvider; import cofh.api.energy.IEnergyReceiver; import cofh.api.energy.IEnergyStorage; @@ -22,48 +29,30 @@ import gtPlusPlus.core.util.math.MathUtils; import gtPlusPlus.core.util.minecraft.PlayerUtils; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; import gtPlusPlus.xmod.gregtech.common.tileentities.storage.GregtechMetaEnergyBuffer; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.EnumChatFormatting; -import net.minecraftforge.common.util.ForgeDirection; /** * NEVER INCLUDE THIS FILE IN YOUR MOD!!! * - * This is the main construct for my Basic Machines such as the Automatic Extractor - * Extend this class to make a simple Machine + * This is the main construct for my Basic Machines such as the Automatic Extractor Extend this class to make a simple + * Machine */ public class GT_MetaTileEntity_RfConvertor extends GregtechMetaEnergyBuffer implements IEnergyReceiver { - public GT_MetaTileEntity_RfConvertor( - final String aName, - final int aTier, - final String aDescription, - final ITexture[][][] aTextures, - final int aSlotCount) { + public GT_MetaTileEntity_RfConvertor(final String aName, final int aTier, final String aDescription, + final ITexture[][][] aTextures, final int aSlotCount) { super(aName, aTier, aDescription, aTextures, aSlotCount); } - public GT_MetaTileEntity_RfConvertor( - final int aID, - final String aName, - final String aNameRegional, - final int aTier, - final String aDescription, - final int aSlotCount) { + public GT_MetaTileEntity_RfConvertor(final int aID, final String aName, final String aNameRegional, final int aTier, + final String aDescription, final int aSlotCount) { super(aID, aName, aNameRegional, aTier, aDescription, aSlotCount); } @Override public String[] getDescription() { - return new String[] { - "Use Screwdriver to change voltage", - "Hold Shift while using Screwdriver to change amperage", - EnumChatFormatting.DARK_AQUA + "Variable Output Voltage", - CORE.GT_Tooltip - }; + return new String[] { "Use Screwdriver to change voltage", + "Hold Shift while using Screwdriver to change amperage", + EnumChatFormatting.DARK_AQUA + "Variable Output Voltage", CORE.GT_Tooltip }; } @Override @@ -71,37 +60,36 @@ public class GT_MetaTileEntity_RfConvertor extends GregtechMetaEnergyBuffer impl ITexture[][][] rTextures = new ITexture[12][17][]; GT_RenderedTexture aTex = new GT_RenderedTexture(TexturesGtBlock.Casing_Material_ZirconiumCarbide); for (byte i = -1; i < 16; i++) { - rTextures[0][i + 1] = new ITexture[] {aTex, Textures.BlockIcons.OVERLAYS_ENERGY_OUT[mTier]}; - rTextures[1][i + 1] = new ITexture[] {aTex, Textures.BlockIcons.OVERLAYS_ENERGY_OUT[mTier]}; - rTextures[2][i + 1] = new ITexture[] {aTex, Textures.BlockIcons.OVERLAYS_ENERGY_OUT[mTier]}; - rTextures[3][i + 1] = new ITexture[] {aTex, Textures.BlockIcons.OVERLAYS_ENERGY_IN_MULTI[mTier]}; - rTextures[4][i + 1] = new ITexture[] {aTex, Textures.BlockIcons.OVERLAYS_ENERGY_IN_MULTI[mTier]}; - rTextures[5][i + 1] = new ITexture[] {aTex, Textures.BlockIcons.OVERLAYS_ENERGY_IN_MULTI[mTier]}; - rTextures[6][i + 1] = new ITexture[] {aTex, Textures.BlockIcons.OVERLAYS_ENERGY_IN[mTier]}; - rTextures[7][i + 1] = new ITexture[] {aTex, Textures.BlockIcons.OVERLAYS_ENERGY_IN[mTier]}; - rTextures[8][i + 1] = new ITexture[] {aTex, Textures.BlockIcons.OVERLAYS_ENERGY_IN[mTier]}; - rTextures[9][i + 1] = new ITexture[] {aTex, Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[mTier]}; - rTextures[10][i + 1] = new ITexture[] {aTex, Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[mTier]}; - rTextures[11][i + 1] = new ITexture[] {aTex, Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[mTier]}; + rTextures[0][i + 1] = new ITexture[] { aTex, Textures.BlockIcons.OVERLAYS_ENERGY_OUT[mTier] }; + rTextures[1][i + 1] = new ITexture[] { aTex, Textures.BlockIcons.OVERLAYS_ENERGY_OUT[mTier] }; + rTextures[2][i + 1] = new ITexture[] { aTex, Textures.BlockIcons.OVERLAYS_ENERGY_OUT[mTier] }; + rTextures[3][i + 1] = new ITexture[] { aTex, Textures.BlockIcons.OVERLAYS_ENERGY_IN_MULTI[mTier] }; + rTextures[4][i + 1] = new ITexture[] { aTex, Textures.BlockIcons.OVERLAYS_ENERGY_IN_MULTI[mTier] }; + rTextures[5][i + 1] = new ITexture[] { aTex, Textures.BlockIcons.OVERLAYS_ENERGY_IN_MULTI[mTier] }; + rTextures[6][i + 1] = new ITexture[] { aTex, Textures.BlockIcons.OVERLAYS_ENERGY_IN[mTier] }; + rTextures[7][i + 1] = new ITexture[] { aTex, Textures.BlockIcons.OVERLAYS_ENERGY_IN[mTier] }; + rTextures[8][i + 1] = new ITexture[] { aTex, Textures.BlockIcons.OVERLAYS_ENERGY_IN[mTier] }; + rTextures[9][i + 1] = new ITexture[] { aTex, Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[mTier] }; + rTextures[10][i + 1] = new ITexture[] { aTex, Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[mTier] }; + rTextures[11][i + 1] = new ITexture[] { aTex, Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[mTier] }; } return rTextures; } @Override - public ITexture[] getTexture( - IGregTechTileEntity aBaseMetaTileEntity, - byte aSide, - byte aFacing, - byte aColorIndex, - boolean aActive, - boolean aRedstone) { + public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, + boolean aActive, boolean aRedstone) { return mTextures[Math.min(2, aSide) + (aSide == aFacing ? 3 : 0) + (aActive ? 0 : 6)][aColorIndex + 1]; } @Override public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) { return new GT_MetaTileEntity_RfConvertor( - this.mName, this.mTier, this.mDescription, this.mTextures, this.mInventory.length); + this.mName, + this.mTier, + this.mDescription, + this.mTextures, + this.mInventory.length); } @Override @@ -161,9 +149,8 @@ public class GT_MetaTileEntity_RfConvertor extends GregtechMetaEnergyBuffer impl aBaseMetaTileEntity.setActive(true); } if (this.getEUVar() < this.maxEUStore()) { - for (byte i = 0; - i < 6 && aBaseMetaTileEntity.getStoredEU() < aBaseMetaTileEntity.getEUCapacity(); - i++) { + for (byte i = 0; i < 6 + && aBaseMetaTileEntity.getStoredEU() < aBaseMetaTileEntity.getEUCapacity(); i++) { if (isInputFacing(i)) { receiveEnergy(ForgeDirection.getOrientation(i), Integer.MAX_VALUE, false); } @@ -174,21 +161,21 @@ public class GT_MetaTileEntity_RfConvertor extends GregtechMetaEnergyBuffer impl } @Override - public boolean allowPullStack( - final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, final ItemStack aStack) { + public boolean allowPullStack(final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, + final ItemStack aStack) { return false; } @Override - public boolean allowPutStack( - final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, final ItemStack aStack) { + public boolean allowPutStack(final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, + final ItemStack aStack) { return false; } @Override public String[] getInfoData() { String[] infoData = super.getInfoData(); - return new String[] {infoData[0], "Converts RF -> GTEU | Tier: " + this.mTier, infoData[1], infoData[2]}; + return new String[] { infoData[0], "Converts RF -> GTEU | Tier: " + this.mTier, infoData[1], infoData[2] }; } @Override @@ -248,8 +235,7 @@ public class GT_MetaTileEntity_RfConvertor extends GregtechMetaEnergyBuffer impl return 0; } - Logger.WARNING("Someone is trying to inject RF from " + from + ". Type:" - + tTileEntity.getClass().getName()); + Logger.WARNING("Someone is trying to inject RF from " + from + ". Type:" + tTileEntity.getClass().getName()); // Calculate maximum RF we need to consume int aInputRF = MathUtils.safeInt(this.maxEUOutput() * GregTech_API.mEUtoRF / 100); @@ -272,57 +258,55 @@ public class GT_MetaTileEntity_RfConvertor extends GregtechMetaEnergyBuffer impl long tEU = 0; byte aSide = (byte) from.ordinal(); Logger.WARNING("Free: " + aRemainingSpace + "EU"); - if (tTileEntity instanceof IEnergyProvider - && ((IEnergyProvider) tTileEntity) - .extractEnergy( - ForgeDirection.getOrientation(GT_Utility.getOppositeSide(aSide)), - 1, - true) - == 1) { - tEU = (long) ((IEnergyProvider) tTileEntity) - .extractEnergy( - ForgeDirection.getOrientation(GT_Utility.getOppositeSide(aSide)), - (int) maxEUOutput() * 100 / GregTech_API.mRFtoEU, - false); + if (tTileEntity instanceof IEnergyProvider && ((IEnergyProvider) tTileEntity) + .extractEnergy(ForgeDirection.getOrientation(GT_Utility.getOppositeSide(aSide)), 1, true) + == 1) { + tEU = (long) ((IEnergyProvider) tTileEntity).extractEnergy( + ForgeDirection.getOrientation(GT_Utility.getOppositeSide(aSide)), + (int) maxEUOutput() * 100 / GregTech_API.mRFtoEU, + false); Logger.WARNING("Drained from IEnergyProvider Tile: " + (tEU * 100 / GregTech_API.mRFtoEU) + ""); tEU = tEU * GregTech_API.mRFtoEU / 100; } else if (tTileEntity instanceof IEnergyStorage && ((IEnergyStorage) tTileEntity).extractEnergy(1, true) == 1) { - tEU = (long) ((IEnergyStorage) tTileEntity) - .extractEnergy((int) maxEUOutput() * 100 / GregTech_API.mRFtoEU, false); - Logger.WARNING("Drained from IEnergyStorage Tile: " + (tEU * 100 / GregTech_API.mRFtoEU) + ""); - tEU = tEU * GregTech_API.mRFtoEU / 100; - } else if (GregTech_API.meIOLoaded - && tTileEntity instanceof IPowerContainer - && ((IPowerContainer) tTileEntity).getEnergyStored() > 0) { - int storedRF = ((IPowerContainer) tTileEntity).getEnergyStored(); - int extractRF = (int) maxEUOutput() * 100 / GregTech_API.mRFtoEU; - tEU = 0; - if (tTileEntity instanceof TileCapBank) { - ICapBankNetwork network = ((TileCapBank) tTileEntity).getNetwork(); - if (network != null && network.getEnergyStoredL() > 0) { - tEU = Math.min( - (Math.min( - Math.min(network.getEnergyStoredL(), storedRF - extractRF), - network.getMaxOutput())) - * GregTech_API.mRFtoEU - / 100, - maxEUOutput()); - Logger.WARNING("Drained from EIO CapBank Tile: " + (tEU * 100 / GregTech_API.mRFtoEU) + ""); - network.addEnergy((int) -(tEU * 100 / GregTech_API.mRFtoEU)); - } - } else { - if (storedRF > extractRF) { - ((IPowerContainer) tTileEntity).setEnergyStored(storedRF - extractRF); - tEU = maxEUOutput(); - Logger.WARNING("Drained from EIO Tile: " + (tEU * 100 / GregTech_API.mRFtoEU) + ""); - } else { - ((IPowerContainer) tTileEntity).setEnergyStored(0); - tEU = storedRF * GregTech_API.mRFtoEU / 100; - Logger.WARNING("Drained from EIO Tile: " + (tEU * 100 / GregTech_API.mRFtoEU) + ""); - } - } - } + tEU = (long) ((IEnergyStorage) tTileEntity) + .extractEnergy((int) maxEUOutput() * 100 / GregTech_API.mRFtoEU, false); + Logger.WARNING( + "Drained from IEnergyStorage Tile: " + (tEU * 100 / GregTech_API.mRFtoEU) + ""); + tEU = tEU * GregTech_API.mRFtoEU / 100; + } else + if (GregTech_API.meIOLoaded && tTileEntity instanceof IPowerContainer + && ((IPowerContainer) tTileEntity).getEnergyStored() > 0) { + int storedRF = ((IPowerContainer) tTileEntity).getEnergyStored(); + int extractRF = (int) maxEUOutput() * 100 / GregTech_API.mRFtoEU; + tEU = 0; + if (tTileEntity instanceof TileCapBank) { + ICapBankNetwork network = ((TileCapBank) tTileEntity).getNetwork(); + if (network != null && network.getEnergyStoredL() > 0) { + tEU = Math.min( + (Math.min( + Math.min(network.getEnergyStoredL(), storedRF - extractRF), + network.getMaxOutput())) * GregTech_API.mRFtoEU / 100, + maxEUOutput()); + Logger.WARNING( + "Drained from EIO CapBank Tile: " + (tEU * 100 / GregTech_API.mRFtoEU) + + ""); + network.addEnergy((int) -(tEU * 100 / GregTech_API.mRFtoEU)); + } + } else { + if (storedRF > extractRF) { + ((IPowerContainer) tTileEntity).setEnergyStored(storedRF - extractRF); + tEU = maxEUOutput(); + Logger.WARNING( + "Drained from EIO Tile: " + (tEU * 100 / GregTech_API.mRFtoEU) + ""); + } else { + ((IPowerContainer) tTileEntity).setEnergyStored(0); + tEU = storedRF * GregTech_API.mRFtoEU / 100; + Logger.WARNING( + "Drained from EIO Tile: " + (tEU * 100 / GregTech_API.mRFtoEU) + ""); + } + } + } Logger.WARNING("EU to inject: " + tEU + "EU"); if (!simulate) { aVal = this.getBaseMetaTileEntity().increaseStoredEnergyUnits(tEU, true); diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_SemiFluidGenerator.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_SemiFluidGenerator.java index 7d9ecebf2c..502cdd2d7e 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_SemiFluidGenerator.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_SemiFluidGenerator.java @@ -1,5 +1,7 @@ package gtPlusPlus.xmod.gregtech.common.tileentities.generators; +import net.minecraft.item.ItemStack; + import cpw.mods.fml.common.registry.GameRegistry; import gregtech.api.GregTech_API; import gregtech.api.enums.ConfigCategories; @@ -17,24 +19,23 @@ import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.lib.CORE; -import net.minecraft.item.ItemStack; public class GT_MetaTileEntity_SemiFluidGenerator extends GT_MetaTileEntity_BasicGenerator { public int mEfficiency; - /*public GT_MetaTileEntity_SemiFluidGenerator(int aID, String aName, String aNameRegional, int aTier) { - super(aID, aName, aNameRegional, aTier); - onConfigLoad(); - }*/ + /* + * public GT_MetaTileEntity_SemiFluidGenerator(int aID, String aName, String aNameRegional, int aTier) { super(aID, + * aName, aNameRegional, aTier); onConfigLoad(); } + */ public GT_MetaTileEntity_SemiFluidGenerator(int aID, String aName, String aNameRegional, int aTier) { super(aID, aName, aNameRegional, aTier, "Requires semi-fluid Fuel", new ITexture[0]); onConfigLoad(); } - public GT_MetaTileEntity_SemiFluidGenerator( - String aName, int aTier, String aDescription, ITexture[][][] aTextures) { + public GT_MetaTileEntity_SemiFluidGenerator(String aName, int aTier, String aDescription, + ITexture[][][] aTextures) { super(aName, aTier, aDescription, aTextures); onConfigLoad(); } @@ -69,12 +70,8 @@ public class GT_MetaTileEntity_SemiFluidGenerator extends GT_MetaTileEntity_Basi @Override public String[] getDescription() { - return new String[] { - this.mDescription, - "Produces " + (this.getPollution()) + " pollution/sec", - "Fuel Efficiency: " + this.getEfficiency() + "%", - CORE.GT_Tooltip - }; + return new String[] { this.mDescription, "Produces " + (this.getPollution()) + " pollution/sec", + "Fuel Efficiency: " + this.getEfficiency() + "%", CORE.GT_Tooltip }; } @Override @@ -111,75 +108,63 @@ public class GT_MetaTileEntity_SemiFluidGenerator extends GT_MetaTileEntity_Basi @Override public ITexture[] getFront(byte aColor) { - return new ITexture[] { - super.getFront(aColor)[0], - new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_FRONT), - Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier] - }; + return new ITexture[] { super.getFront(aColor)[0], + new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_FRONT), + Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier] }; } @Override public ITexture[] getBack(byte aColor) { - return new ITexture[] { - super.getBack(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_TOP) - }; + return new ITexture[] { super.getBack(aColor)[0], + new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_TOP) }; } @Override public ITexture[] getBottom(byte aColor) { - return new ITexture[] { - super.getBottom(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_BOTTOM) - }; + return new ITexture[] { super.getBottom(aColor)[0], + new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_BOTTOM) }; } @Override public ITexture[] getTop(byte aColor) { - return new ITexture[] { - super.getTop(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_SIDE) - }; + return new ITexture[] { super.getTop(aColor)[0], + new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_SIDE) }; } @Override public ITexture[] getSides(byte aColor) { - return new ITexture[] { - super.getSides(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_TOP) - }; + return new ITexture[] { super.getSides(aColor)[0], + new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_TOP) }; } @Override public ITexture[] getFrontActive(byte aColor) { - return new ITexture[] { - super.getFrontActive(aColor)[0], - new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_FRONT_ACTIVE), - Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier] - }; + return new ITexture[] { super.getFrontActive(aColor)[0], + new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_FRONT_ACTIVE), + Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier] }; } @Override public ITexture[] getBackActive(byte aColor) { - return new ITexture[] { - super.getBackActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_TOP_ACTIVE) - }; + return new ITexture[] { super.getBackActive(aColor)[0], + new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_TOP_ACTIVE) }; } @Override public ITexture[] getBottomActive(byte aColor) { - return new ITexture[] { - super.getBottomActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_BOTTOM_ACTIVE) - }; + return new ITexture[] { super.getBottomActive(aColor)[0], + new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_BOTTOM_ACTIVE) }; } @Override public ITexture[] getTopActive(byte aColor) { - return new ITexture[] { - super.getTopActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_SIDE_ACTIVE) - }; + return new ITexture[] { super.getTopActive(aColor)[0], + new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_SIDE_ACTIVE) }; } @Override public ITexture[] getSidesActive(byte aColor) { - return new ITexture[] { - super.getSidesActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_TOP_ACTIVE) - }; + return new ITexture[] { super.getSidesActive(aColor)[0], + new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_TOP_ACTIVE) }; } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntityDoubleFuelGeneratorBase.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntityDoubleFuelGeneratorBase.java index 2897f621d6..cee2bbff15 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntityDoubleFuelGeneratorBase.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntityDoubleFuelGeneratorBase.java @@ -1,5 +1,7 @@ package gtPlusPlus.xmod.gregtech.common.tileentities.generators; +import net.minecraft.item.ItemStack; + import cpw.mods.fml.common.registry.GameRegistry; import gregtech.api.GregTech_API; import gregtech.api.enums.ConfigCategories; @@ -14,14 +16,13 @@ import gregtech.api.util.GT_Recipe; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.generators.GregtechRocketFuelGeneratorBase; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; -import net.minecraft.item.ItemStack; public class GregtechMetaTileEntityDoubleFuelGeneratorBase extends GregtechRocketFuelGeneratorBase { public int mEfficiency; - public GregtechMetaTileEntityDoubleFuelGeneratorBase( - final int aID, final String aName, final String aNameRegional, final int aTier) { + public GregtechMetaTileEntityDoubleFuelGeneratorBase(final int aID, final String aName, final String aNameRegional, + final int aTier) { super( aID, aName, @@ -32,20 +33,16 @@ public class GregtechMetaTileEntityDoubleFuelGeneratorBase extends GregtechRocke this.onConfigLoad(); } - public GregtechMetaTileEntityDoubleFuelGeneratorBase( - final String aName, final int aTier, final String aDescription, final ITexture[][][] aTextures) { + public GregtechMetaTileEntityDoubleFuelGeneratorBase(final String aName, final int aTier, final String aDescription, + final ITexture[][][] aTextures) { super(aName, aTier, aDescription, aTextures); this.onConfigLoad(); } @Override public String[] getDescription() { - return new String[] { - this.mDescription, - "Generates power at " + this.getEfficiency() + "% Efficiency per tick", - "Output Voltage: " + this.getOutputTier() + " EU/t", - CORE.GT_Tooltip - }; + return new String[] { this.mDescription, "Generates power at " + this.getEfficiency() + "% Efficiency per tick", + "Output Voltage: " + this.getOutputTier() + " EU/t", CORE.GT_Tooltip }; } @Override @@ -56,7 +53,10 @@ public class GregtechMetaTileEntityDoubleFuelGeneratorBase extends GregtechRocke @Override public MetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) { return new GregtechMetaTileEntityDoubleFuelGeneratorBase( - this.mName, this.mTier, this.mDescription, this.mTextures); + this.mName, + this.mTier, + this.mDescription, + this.mTextures); } @Override @@ -71,7 +71,9 @@ public class GregtechMetaTileEntityDoubleFuelGeneratorBase extends GregtechRocke public void onConfigLoad() { this.mEfficiency = GregTech_API.sMachineFile.get( - ConfigCategories.machineconfig, "RocketEngine.efficiency.tier." + this.mTier, (100 - (this.mTier * 8))); + ConfigCategories.machineconfig, + "RocketEngine.efficiency.tier." + this.mTier, + (100 - (this.mTier * 8))); } @Override @@ -98,89 +100,67 @@ public class GregtechMetaTileEntityDoubleFuelGeneratorBase extends GregtechRocke return new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Ultra); } - // return new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Top); + // return new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Top); } @Override public ITexture[] getFront(final byte aColor) { - return new ITexture[] { - super.getFront(aColor)[0], - this.getCasingTexture(), - Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[this.mTier] - }; + return new ITexture[] { super.getFront(aColor)[0], this.getCasingTexture(), + Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[this.mTier] }; } @Override public ITexture[] getBack(final byte aColor) { - return new ITexture[] { - super.getBack(aColor)[0], - this.getCasingTexture(), - new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Vent) - }; + return new ITexture[] { super.getBack(aColor)[0], this.getCasingTexture(), + new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Vent) }; } @Override public ITexture[] getBottom(final byte aColor) { - return new ITexture[] { - super.getBottom(aColor)[0], new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom) - }; + return new ITexture[] { super.getBottom(aColor)[0], + new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom) }; } @Override public ITexture[] getTop(final byte aColor) { - return new ITexture[] { - super.getTop(aColor)[0], new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Redstone_Off) - }; + return new ITexture[] { super.getTop(aColor)[0], + new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Redstone_Off) }; } @Override public ITexture[] getSides(final byte aColor) { - return new ITexture[] { - super.getSides(aColor)[0], - this.getCasingTexture(), - new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Diesel_Horizontal) - }; + return new ITexture[] { super.getSides(aColor)[0], this.getCasingTexture(), + new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Diesel_Horizontal) }; } @Override public ITexture[] getFrontActive(final byte aColor) { - return new ITexture[] { - super.getFrontActive(aColor)[0], - this.getCasingTexture(), - Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[this.mTier] - }; + return new ITexture[] { super.getFrontActive(aColor)[0], this.getCasingTexture(), + Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[this.mTier] }; } @Override public ITexture[] getBackActive(final byte aColor) { - return new ITexture[] { - super.getBackActive(aColor)[0], - this.getCasingTexture(), - new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Vent_Fast) - }; + return new ITexture[] { super.getBackActive(aColor)[0], this.getCasingTexture(), + new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Vent_Fast) }; } @Override public ITexture[] getBottomActive(final byte aColor) { - return new ITexture[] { - super.getBottomActive(aColor)[0], new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom) - }; + return new ITexture[] { super.getBottomActive(aColor)[0], + new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom) }; } @Override public ITexture[] getTopActive(final byte aColor) { - return new ITexture[] { - super.getTopActive(aColor)[0], new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Redstone_On) - }; + return new ITexture[] { super.getTopActive(aColor)[0], + new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Redstone_On) }; } @Override public ITexture[] getSidesActive(final byte aColor) { - return new ITexture[] { - super.getSidesActive(aColor)[0], - this.getCasingTexture(), - new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Diesel_Horizontal_Active) - }; + return new ITexture[] { super.getSidesActive(aColor)[0], this.getCasingTexture(), + new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Diesel_Horizontal_Active) }; } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntityGeothermalGenerator.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntityGeothermalGenerator.java index 520f960ec9..e116379aef 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntityGeothermalGenerator.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntityGeothermalGenerator.java @@ -1,5 +1,8 @@ package gtPlusPlus.xmod.gregtech.common.tileentities.generators; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; + import cpw.mods.fml.common.registry.GameRegistry; import gregtech.api.GregTech_API; import gregtech.api.enums.ConfigCategories; @@ -15,21 +18,19 @@ import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_Recipe.GT_Recipe_Map; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; public class GregtechMetaTileEntityGeothermalGenerator extends GT_MetaTileEntity_BasicGenerator { public int mEfficiency; - public GregtechMetaTileEntityGeothermalGenerator( - final int aID, final String aName, final String aNameRegional, final int aTier) { + public GregtechMetaTileEntityGeothermalGenerator(final int aID, final String aName, final String aNameRegional, + final int aTier) { super(aID, aName, aNameRegional, aTier, "Requires Pahoehoe Lava or Normal Lava as Fuel", new ITexture[0]); this.onConfigLoad(); } - public GregtechMetaTileEntityGeothermalGenerator( - final String aName, final int aTier, final String aDescription, final ITexture[][][] aTextures) { + public GregtechMetaTileEntityGeothermalGenerator(final String aName, final int aTier, final String aDescription, + final ITexture[][][] aTextures) { super(aName, aTier, aDescription, aTextures); this.onConfigLoad(); } @@ -37,12 +38,8 @@ public class GregtechMetaTileEntityGeothermalGenerator extends GT_MetaTileEntity @Override public String[] getDescription() { String aPollution = "Causes " + this.getPollution() + " Pollution per second"; - return new String[] { - this.mDescription, - "Generates power at " + this.getEfficiency() + "% Efficiency per tick", - aPollution, - CORE.GT_Tooltip - }; + return new String[] { this.mDescription, "Generates power at " + this.getEfficiency() + "% Efficiency per tick", + aPollution, CORE.GT_Tooltip }; } @Override @@ -90,83 +87,68 @@ public class GregtechMetaTileEntityGeothermalGenerator extends GT_MetaTileEntity @Override public ITexture[] getFront(final byte aColor) { - return new ITexture[] { - super.getFront(aColor)[0], - new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_SIDE), - Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[this.mTier] - }; + return new ITexture[] { super.getFront(aColor)[0], + new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_SIDE), + Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[this.mTier] }; } @Override public ITexture[] getBack(final byte aColor) { - return new ITexture[] { - super.getBack(aColor)[0], - new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_BACK), - new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Diesel_Vertical) - }; + return new ITexture[] { super.getBack(aColor)[0], + new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_BACK), + new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Diesel_Vertical) }; } @Override public ITexture[] getBottom(final byte aColor) { - return new ITexture[] { - super.getBottom(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_BOTTOM) - }; + return new ITexture[] { super.getBottom(aColor)[0], + new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_BOTTOM) }; } @Override public ITexture[] getTop(final byte aColor) { - return new ITexture[] { - super.getTop(aColor)[0], - new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_SIDE), - new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_ROCK_BREAKER) - }; + return new ITexture[] { super.getTop(aColor)[0], + new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_SIDE), + new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_ROCK_BREAKER) }; } @Override public ITexture[] getSides(final byte aColor) { - return new ITexture[] {super.getSides(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.BOILER_LAVA_FRONT) - }; + return new ITexture[] { super.getSides(aColor)[0], + new GT_RenderedTexture(Textures.BlockIcons.BOILER_LAVA_FRONT) }; } @Override public ITexture[] getFrontActive(final byte aColor) { - return new ITexture[] { - super.getFrontActive(aColor)[0], - new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_SIDE_ACTIVE), - Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[this.mTier] - }; + return new ITexture[] { super.getFrontActive(aColor)[0], + new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_SIDE_ACTIVE), + Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[this.mTier] }; } @Override public ITexture[] getBackActive(final byte aColor) { - return new ITexture[] { - super.getBackActive(aColor)[0], - new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_BACK_ACTIVE), - new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Diesel_Vertical_Active) - }; + return new ITexture[] { super.getBackActive(aColor)[0], + new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_BACK_ACTIVE), + new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Diesel_Vertical_Active) }; } @Override public ITexture[] getBottomActive(final byte aColor) { - return new ITexture[] { - super.getBottomActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_BOTTOM_ACTIVE) - }; + return new ITexture[] { super.getBottomActive(aColor)[0], + new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_BOTTOM_ACTIVE) }; } @Override public ITexture[] getTopActive(final byte aColor) { - return new ITexture[] { - super.getTopActive(aColor)[0], - new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_SIDE), - new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_ROCK_BREAKER_ACTIVE) - }; + return new ITexture[] { super.getTopActive(aColor)[0], + new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_SIDE), + new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_ROCK_BREAKER_ACTIVE) }; } @Override public ITexture[] getSidesActive(final byte aColor) { - return new ITexture[] { - super.getSidesActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.BOILER_LAVA_FRONT_ACTIVE) - }; + return new ITexture[] { super.getSidesActive(aColor)[0], + new GT_RenderedTexture(Textures.BlockIcons.BOILER_LAVA_FRONT_ACTIVE) }; } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntityRocketFuelGenerator.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntityRocketFuelGenerator.java index b6c2f27ce6..734f2a8919 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntityRocketFuelGenerator.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntityRocketFuelGenerator.java @@ -1,5 +1,7 @@ package gtPlusPlus.xmod.gregtech.common.tileentities.generators; +import net.minecraft.item.ItemStack; + import cpw.mods.fml.common.registry.GameRegistry; import gregtech.api.GregTech_API; import gregtech.api.enums.ConfigCategories; @@ -14,20 +16,19 @@ import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_Recipe; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.generators.GregtechRocketFuelGeneratorBase; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; -import net.minecraft.item.ItemStack; public class GregtechMetaTileEntityRocketFuelGenerator extends GregtechRocketFuelGeneratorBase { public int mEfficiency; - public GregtechMetaTileEntityRocketFuelGenerator( - final int aID, final String aName, final String aNameRegional, final int aTier) { + public GregtechMetaTileEntityRocketFuelGenerator(final int aID, final String aName, final String aNameRegional, + final int aTier) { super(aID, aName, aNameRegional, aTier, "Requires GT++ Rocket Fuels", new ITexture[0]); this.onConfigLoad(); } - public GregtechMetaTileEntityRocketFuelGenerator( - final String aName, final int aTier, final String aDescription, final ITexture[][][] aTextures) { + public GregtechMetaTileEntityRocketFuelGenerator(final String aName, final int aTier, final String aDescription, + final ITexture[][][] aTextures) { super(aName, aTier, aDescription, aTextures); this.onConfigLoad(); } @@ -85,88 +86,66 @@ public class GregtechMetaTileEntityRocketFuelGenerator extends GregtechRocketFue return new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Ultra); } - // return new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Top); + // return new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Top); } @Override public ITexture[] getFront(final byte aColor) { - return new ITexture[] { - super.getFront(aColor)[0], - this.getCasingTexture(), - Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[this.mTier] - }; + return new ITexture[] { super.getFront(aColor)[0], this.getCasingTexture(), + Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[this.mTier] }; } @Override public ITexture[] getBack(final byte aColor) { - return new ITexture[] { - super.getBack(aColor)[0], - this.getCasingTexture(), - new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Vent) - }; + return new ITexture[] { super.getBack(aColor)[0], this.getCasingTexture(), + new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Vent) }; } @Override public ITexture[] getBottom(final byte aColor) { - return new ITexture[] { - super.getBottom(aColor)[0], new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom) - }; + return new ITexture[] { super.getBottom(aColor)[0], + new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom) }; } @Override public ITexture[] getTop(final byte aColor) { - return new ITexture[] { - super.getTop(aColor)[0], new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Redstone_Off) - }; + return new ITexture[] { super.getTop(aColor)[0], + new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Redstone_Off) }; } @Override public ITexture[] getSides(final byte aColor) { - return new ITexture[] { - super.getSides(aColor)[0], - this.getCasingTexture(), - new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Diesel_Horizontal) - }; + return new ITexture[] { super.getSides(aColor)[0], this.getCasingTexture(), + new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Diesel_Horizontal) }; } @Override public ITexture[] getFrontActive(final byte aColor) { - return new ITexture[] { - super.getFrontActive(aColor)[0], - this.getCasingTexture(), - Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[this.mTier] - }; + return new ITexture[] { super.getFrontActive(aColor)[0], this.getCasingTexture(), + Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[this.mTier] }; } @Override public ITexture[] getBackActive(final byte aColor) { - return new ITexture[] { - super.getBackActive(aColor)[0], - this.getCasingTexture(), - new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Vent_Fast) - }; + return new ITexture[] { super.getBackActive(aColor)[0], this.getCasingTexture(), + new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Vent_Fast) }; } @Override public ITexture[] getBottomActive(final byte aColor) { - return new ITexture[] { - super.getBottomActive(aColor)[0], new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom) - }; + return new ITexture[] { super.getBottomActive(aColor)[0], + new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom) }; } @Override public ITexture[] getTopActive(final byte aColor) { - return new ITexture[] { - super.getTopActive(aColor)[0], new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Redstone_On) - }; + return new ITexture[] { super.getTopActive(aColor)[0], + new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Redstone_On) }; } @Override public ITexture[] getSidesActive(final byte aColor) { - return new ITexture[] { - super.getSidesActive(aColor)[0], - this.getCasingTexture(), - new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Diesel_Horizontal_Active) - }; + return new ITexture[] { super.getSidesActive(aColor)[0], this.getCasingTexture(), + new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Diesel_Horizontal_Active) }; } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntitySolarGenerator.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntitySolarGenerator.java index 73c8f0adab..7471a0edcc 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntitySolarGenerator.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntitySolarGenerator.java @@ -5,6 +5,7 @@ import static gregtech.api.enums.GT_Values.V; import com.gtnewhorizons.modularui.api.screen.ModularWindow; import com.gtnewhorizons.modularui.api.screen.UIBuildContext; import com.gtnewhorizons.modularui.common.widget.ProgressBar; + import gregtech.api.GregTech_API; import gregtech.api.enums.ConfigCategories; import gregtech.api.enums.SteamVariant; @@ -21,26 +22,22 @@ import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.generato public class GregtechMetaTileEntitySolarGenerator extends GregtechMetaSolarGenerator { - public GregtechMetaTileEntitySolarGenerator( - final int aID, final String aName, final String aNameRegional, final int aTier) { + public GregtechMetaTileEntitySolarGenerator(final int aID, final String aName, final String aNameRegional, + final int aTier) { super(aID, aName, aNameRegional, aTier, "Feasts on the power of the Sun!", new ITexture[0]); this.onConfigLoad(); } - public GregtechMetaTileEntitySolarGenerator( - final String aName, final int aTier, final String aDescription, final ITexture[][][] aTextures) { + public GregtechMetaTileEntitySolarGenerator(final String aName, final int aTier, final String aDescription, + final ITexture[][][] aTextures) { super(aName, aTier, aDescription, aTextures); this.onConfigLoad(); } @Override public String[] getDescription() { - return new String[] { - this.mDescription, - "Generates power at " + this.getEfficiency() + "% Efficiency per tick", - "Output Voltage: " + this.getOutputTier() + " EU/t", - CORE.GT_Tooltip - }; + return new String[] { this.mDescription, "Generates power at " + this.getEfficiency() + "% Efficiency per tick", + "Output Voltage: " + this.getOutputTier() + " EU/t", CORE.GT_Tooltip }; } @Override @@ -55,13 +52,14 @@ public class GregtechMetaTileEntitySolarGenerator extends GregtechMetaSolarGener public void onConfigLoad() { this.mEfficiency = GregTech_API.sMachineFile.get( - ConfigCategories.machineconfig, "SunAbsorber.efficiency.tier." + this.mTier, 100 - (this.mTier * 10)); + ConfigCategories.machineconfig, + "SunAbsorber.efficiency.tier." + this.mTier, + 100 - (this.mTier * 10)); } @Override public void onPostTick(final IGregTechTileEntity aBaseMetaTileEntity, final long aTick) { - if (aBaseMetaTileEntity.isServerSide() - && aBaseMetaTileEntity.isAllowedToWork() + if (aBaseMetaTileEntity.isServerSide() && aBaseMetaTileEntity.isAllowedToWork() && (aBaseMetaTileEntity.getUniversalEnergyStored() < (this.maxEUOutput() + aBaseMetaTileEntity.getEUCapacity()))) { @@ -78,12 +76,12 @@ public class GregtechMetaTileEntitySolarGenerator extends GregtechMetaSolarGener if ((aTick % 10L) == 0L) { - Logger.WARNING("getUniversalEnergyStored: " + aBaseMetaTileEntity.getUniversalEnergyStored() - + " maxEUOutput * 20 + getMinimumStoredEU: " - + ((this.maxEUOutput() * 20) + this.getMinimumStoredEU())); + Logger.WARNING( + "getUniversalEnergyStored: " + aBaseMetaTileEntity.getUniversalEnergyStored() + + " maxEUOutput * 20 + getMinimumStoredEU: " + + ((this.maxEUOutput() * 20) + this.getMinimumStoredEU())); - if ((this.mSolarCharge > 100) - && (aBaseMetaTileEntity.isAllowedToWork()) + if ((this.mSolarCharge > 100) && (aBaseMetaTileEntity.isAllowedToWork()) && (!aBaseMetaTileEntity.getWorld().isThundering()) && (aBaseMetaTileEntity.getUniversalEnergyStored() < (this.maxEUStore() - this.getMinimumStoredEU()))) { @@ -97,23 +95,21 @@ public class GregtechMetaTileEntitySolarGenerator extends GregtechMetaSolarGener this.mSolarCharge += 1; } - if ((this.mProcessingEnergy <= 0) - && (aBaseMetaTileEntity.isAllowedToWork()) + if ((this.mProcessingEnergy <= 0) && (aBaseMetaTileEntity.isAllowedToWork()) && ((aTick % 64L) == 0L) && (!aBaseMetaTileEntity.getWorld().isThundering())) { Logger.WARNING("Adding Processing Energy. Currently " + this.mProcessingEnergy); - final boolean bRain = - aBaseMetaTileEntity.getWorld().isRaining() && (aBaseMetaTileEntity.getBiome().rainfall > 0.0F); + final boolean bRain = aBaseMetaTileEntity.getWorld().isRaining() + && (aBaseMetaTileEntity.getBiome().rainfall > 0.0F); this.mProcessingEnergy += (bRain && (aBaseMetaTileEntity.getWorld().skylightSubtracted >= 4)) - || !aBaseMetaTileEntity.getSkyAtSide((byte) 1) - ? 0 - : !bRain && aBaseMetaTileEntity.getWorld().isDaytime() ? 8 : 1; + || !aBaseMetaTileEntity.getSkyAtSide((byte) 1) ? 0 + : !bRain && aBaseMetaTileEntity.getWorld().isDaytime() ? 8 : 1; } if (aBaseMetaTileEntity.isServerSide()) { // Utils.LOG_WARNING("6."); - aBaseMetaTileEntity.setActive(aBaseMetaTileEntity.isAllowedToWork() - && (aBaseMetaTileEntity.getUniversalEnergyStored() + aBaseMetaTileEntity.setActive( + aBaseMetaTileEntity.isAllowedToWork() && (aBaseMetaTileEntity.getUniversalEnergyStored() >= (this.maxEUOutput() + this.getMinimumStoredEU()))); } } @@ -132,87 +128,75 @@ public class GregtechMetaTileEntitySolarGenerator extends GregtechMetaSolarGener return Math.max(this.getEUVar(), (V[this.mTier] * 16000) + this.getMinimumStoredEU()); } - ITexture SolarArray[] = { - new GT_RenderedTexture(Textures.BlockIcons.SOLARPANEL_8V), - new GT_RenderedTexture(Textures.BlockIcons.SOLARPANEL_LV), - new GT_RenderedTexture(Textures.BlockIcons.SOLARPANEL_MV), - new GT_RenderedTexture(Textures.BlockIcons.SOLARPANEL_HV), - new GT_RenderedTexture(Textures.BlockIcons.SOLARPANEL_EV), - new GT_RenderedTexture(Textures.BlockIcons.SOLARPANEL_IV), - new GT_RenderedTexture(Textures.BlockIcons.SOLARPANEL_LuV), - new GT_RenderedTexture(Textures.BlockIcons.SOLARPANEL_ZPM), - new GT_RenderedTexture(Textures.BlockIcons.SOLARPANEL_UV), - new GT_RenderedTexture(Textures.BlockIcons.SOLARPANEL) - }; + ITexture SolarArray[] = { new GT_RenderedTexture(Textures.BlockIcons.SOLARPANEL_8V), + new GT_RenderedTexture(Textures.BlockIcons.SOLARPANEL_LV), + new GT_RenderedTexture(Textures.BlockIcons.SOLARPANEL_MV), + new GT_RenderedTexture(Textures.BlockIcons.SOLARPANEL_HV), + new GT_RenderedTexture(Textures.BlockIcons.SOLARPANEL_EV), + new GT_RenderedTexture(Textures.BlockIcons.SOLARPANEL_IV), + new GT_RenderedTexture(Textures.BlockIcons.SOLARPANEL_LuV), + new GT_RenderedTexture(Textures.BlockIcons.SOLARPANEL_ZPM), + new GT_RenderedTexture(Textures.BlockIcons.SOLARPANEL_UV), + new GT_RenderedTexture(Textures.BlockIcons.SOLARPANEL) }; @Override public ITexture[] getFront(final byte aColor) { - return new ITexture[] { - super.getFront(aColor)[0], - new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC_FRONT), - Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[this.mTier] - }; + return new ITexture[] { super.getFront(aColor)[0], + new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC_FRONT), + Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[this.mTier] }; } @Override public ITexture[] getBack(final byte aColor) { - return new ITexture[] { - super.getBack(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC) - }; + return new ITexture[] { super.getBack(aColor)[0], + new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC) }; } @Override public ITexture[] getBottom(final byte aColor) { - return new ITexture[] { - super.getBottom(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC) - }; + return new ITexture[] { super.getBottom(aColor)[0], + new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC) }; } @Override public ITexture[] getTop(final byte aColor) { - return new ITexture[] {super.getTop(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.SOLARPANEL)}; + return new ITexture[] { super.getTop(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.SOLARPANEL) }; } @Override public ITexture[] getSides(final byte aColor) { - return new ITexture[] { - super.getSides(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC) - }; + return new ITexture[] { super.getSides(aColor)[0], + new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC) }; } @Override public ITexture[] getFrontActive(final byte aColor) { - return new ITexture[] { - super.getFrontActive(aColor)[0], - new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC_FRONT_ACTIVE), - Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier] - }; + return new ITexture[] { super.getFrontActive(aColor)[0], + new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC_FRONT_ACTIVE), + Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier] }; } @Override public ITexture[] getBackActive(final byte aColor) { - return new ITexture[] { - super.getBackActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC_ACTIVE) - }; + return new ITexture[] { super.getBackActive(aColor)[0], + new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC_ACTIVE) }; } @Override public ITexture[] getBottomActive(final byte aColor) { - return new ITexture[] { - super.getBottomActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC_ACTIVE) - }; + return new ITexture[] { super.getBottomActive(aColor)[0], + new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC_ACTIVE) }; } @Override public ITexture[] getTopActive(final byte aColor) { - return new ITexture[] {super.getTopActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.SOLARPANEL)}; + return new ITexture[] { super.getTopActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.SOLARPANEL) }; } @Override public ITexture[] getSidesActive(final byte aColor) { - return new ITexture[] { - super.getSidesActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC_ACTIVE) - }; + return new ITexture[] { super.getSidesActive(aColor)[0], + new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC_ACTIVE) }; } @Override @@ -227,45 +211,36 @@ public class GregtechMetaTileEntitySolarGenerator extends GregtechMetaSolarGener @Override public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildContext) { - builder.widget(new ProgressBar() - .setProgress(() -> (float) mProcessingEnergy / 1000) + builder.widget( + new ProgressBar().setProgress(() -> (float) mProcessingEnergy / 1000) .setTexture( GT_UITextures.PROGRESSBAR_BOILER_EMPTY_STEAM.get(getSteamVariant()), GT_UITextures.PROGRESSBAR_BOILER_STEAM, 10) - .setDirection(ProgressBar.Direction.UP) - .setPos(70, 25) - .setSize(10, 54)) - .widget(new ProgressBar() - .setProgress(() -> (float) getBaseMetaTileEntity().getStoredEU()) - .setTexture( - GT_UITextures.PROGRESSBAR_BOILER_EMPTY_STEAM.get(getSteamVariant()), - GT_UITextures.PROGRESSBAR_BOILER_WATER, - 10) - .setDirection(ProgressBar.Direction.UP) - .setPos(83, 25) - .setSize(10, 54)) - .widget(new ProgressBar() - .setProgress(() -> (float) mSolarCharge / maxProgresstime()) - .setTexture( - GT_UITextures.PROGRESSBAR_BOILER_EMPTY_STEAM.get(getSteamVariant()), - GT_UITextures.PROGRESSBAR_BOILER_HEAT, - 10) - .setDirection(ProgressBar.Direction.UP) - .setPos(96, 25) - .setSize(10, 54)) - .widget(new ProgressBar() - .setProgress(() -> (float) mProcessingEnergy / 1000) - .setTexture(GT_UITextures.PROGRESSBAR_FUEL_STEAM.get(getSteamVariant()), 14) - .setDirection(ProgressBar.Direction.UP) - .setPos(116, 45) - .setSize(14, 14)); + .setDirection(ProgressBar.Direction.UP).setPos(70, 25).setSize(10, 54)) + .widget( + new ProgressBar().setProgress(() -> (float) getBaseMetaTileEntity().getStoredEU()) + .setTexture( + GT_UITextures.PROGRESSBAR_BOILER_EMPTY_STEAM.get(getSteamVariant()), + GT_UITextures.PROGRESSBAR_BOILER_WATER, + 10) + .setDirection(ProgressBar.Direction.UP).setPos(83, 25).setSize(10, 54)) + .widget( + new ProgressBar().setProgress(() -> (float) mSolarCharge / maxProgresstime()) + .setTexture( + GT_UITextures.PROGRESSBAR_BOILER_EMPTY_STEAM.get(getSteamVariant()), + GT_UITextures.PROGRESSBAR_BOILER_HEAT, + 10) + .setDirection(ProgressBar.Direction.UP).setPos(96, 25).setSize(10, 54)) + .widget( + new ProgressBar().setProgress(() -> (float) mProcessingEnergy / 1000) + .setTexture(GT_UITextures.PROGRESSBAR_FUEL_STEAM.get(getSteamVariant()), 14) + .setDirection(ProgressBar.Direction.UP).setPos(116, 45).setSize(14, 14)); } @Override public GUITextureSet getGUITextureSet() { - return new GUITextureSet() - .setMainBackground(GT_UITextures.BACKGROUND_STEAM.get(getSteamVariant())) + return new GUITextureSet().setMainBackground(GT_UITextures.BACKGROUND_STEAM.get(getSteamVariant())) .setItemSlot(GT_UITextures.SLOT_ITEM_STEAM.get(getSteamVariant())) .setCoverTab( GT_UITextures.TAB_COVER_STEAM_NORMAL.get(getSteamVariant()), diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntity_RTG.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntity_RTG.java index 5e8907073f..f32f9a8a76 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntity_RTG.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntity_RTG.java @@ -1,5 +1,11 @@ package gtPlusPlus.xmod.gregtech.common.tileentities.generators; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraftforge.fluids.FluidStack; + import gregtech.api.enums.Textures; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; @@ -15,13 +21,9 @@ import gtPlusPlus.core.util.math.MathUtils; import gtPlusPlus.core.util.minecraft.gregtech.PollutionUtils; import gtPlusPlus.core.util.reflect.ReflectionUtils; import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.nbt.NBTTagList; -import net.minecraftforge.fluids.FluidStack; public class GregtechMetaTileEntity_RTG extends GT_MetaTileEntity_BasicGenerator { + public int mEfficiency; private int mDays; private long mTicksToBurnFor; @@ -96,9 +98,12 @@ public class GregtechMetaTileEntity_RTG extends GT_MetaTileEntity_BasicGenerator final NBTTagCompound data = list.getCompoundTagAt(0); ItemStack lastUsedFuel = ItemStack.loadItemStackFromNBT(data); if (lastUsedFuel != null) { - this.mCurrentRecipe = getRecipes() - .findRecipe( - getBaseMetaTileEntity(), false, 9223372036854775807L, null, new ItemStack[] {lastUsedFuel}); + this.mCurrentRecipe = getRecipes().findRecipe( + getBaseMetaTileEntity(), + false, + 9223372036854775807L, + null, + new ItemStack[] { lastUsedFuel }); } } @@ -121,8 +126,9 @@ public class GregtechMetaTileEntity_RTG extends GT_MetaTileEntity_BasicGenerator } else { if (this.mInventory[getStackDisplaySlot()] == null) this.mInventory[getStackDisplaySlot()] = new ItemStack(Blocks.fire, 1); - this.mInventory[getStackDisplaySlot()].setStackDisplayName("Generating: " - + (aBaseMetaTileEntity.getUniversalEnergyStored() - getMinimumStoredEU()) + " EU"); + this.mInventory[getStackDisplaySlot()].setStackDisplayName( + "Generating: " + (aBaseMetaTileEntity.getUniversalEnergyStored() - getMinimumStoredEU()) + + " EU"); } } else { int tFuelValue = getFuelValue(this.mFluid); @@ -154,25 +160,22 @@ public class GregtechMetaTileEntity_RTG extends GT_MetaTileEntity_BasicGenerator } if ((tProducedEU > 0L) && (getPollution() > 0)) { PollutionUtils.addPollution( - aBaseMetaTileEntity, (int) (tProducedEU * getPollution() / 500 * this.mTier + 1L)); + aBaseMetaTileEntity, + (int) (tProducedEU * getPollution() / 500 * this.mTier + 1L)); } } - if (aBaseMetaTileEntity.isServerSide()) - aBaseMetaTileEntity.setActive((aBaseMetaTileEntity.isAllowedToWork()) - && (aBaseMetaTileEntity.getUniversalEnergyStored() >= maxEUOutput() + getMinimumStoredEU())); + if (aBaseMetaTileEntity.isServerSide()) aBaseMetaTileEntity.setActive( + (aBaseMetaTileEntity.isAllowedToWork()) + && (aBaseMetaTileEntity.getUniversalEnergyStored() >= maxEUOutput() + getMinimumStoredEU())); } @Override public String[] getDescription() { - return new String[] { - this.mDescription, - "Fuel is measured in minecraft days (Check with Scanner)", - "RTG changes output voltage depending on fuel", - "Generates power at " + this.getEfficiency() + "% Efficiency per tick", - "Output Voltage: " + this.getOutputTier() + " EU/t", - CORE.GT_Tooltip - }; + return new String[] { this.mDescription, "Fuel is measured in minecraft days (Check with Scanner)", + "RTG changes output voltage depending on fuel", + "Generates power at " + this.getEfficiency() + "% Efficiency per tick", + "Output Voltage: " + this.getOutputTier() + " EU/t", CORE.GT_Tooltip }; } public GregtechMetaTileEntity_RTG(int aID, String aName, String aNameRegional, int aTier) { @@ -199,8 +202,7 @@ public class GregtechMetaTileEntity_RTG extends GT_MetaTileEntity_BasicGenerator @Override public boolean isOutputFacing(byte aSide) { - return ((aSide > 1) - && (aSide != getBaseMetaTileEntity().getFrontFacing()) + return ((aSide > 1) && (aSide != getBaseMetaTileEntity().getFrontFacing()) && (aSide != getBaseMetaTileEntity().getBackFacing())); } @@ -226,86 +228,68 @@ public class GregtechMetaTileEntity_RTG extends GT_MetaTileEntity_BasicGenerator @Override public ITexture[] getFront(byte aColor) { - return new ITexture[] { - super.getFront(aColor)[0], - new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_SOLID_TOP), - new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_MASSFAB) - }; + return new ITexture[] { super.getFront(aColor)[0], + new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_SOLID_TOP), + new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_MASSFAB) }; } @Override public ITexture[] getBack(byte aColor) { - return new ITexture[] { - super.getBack(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_SOLID_TOP) - }; + return new ITexture[] { super.getBack(aColor)[0], + new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_SOLID_TOP) }; } @Override public ITexture[] getBottom(byte aColor) { - return new ITexture[] { - super.getBottom(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_SOLID_TOP) - }; + return new ITexture[] { super.getBottom(aColor)[0], + new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_SOLID_TOP) }; } @Override public ITexture[] getTop(byte aColor) { - return new ITexture[] { - super.getTop(aColor)[0], - new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_SOLID_TOP), - new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_FLUID_SIDE) - }; + return new ITexture[] { super.getTop(aColor)[0], + new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_SOLID_TOP), + new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_FLUID_SIDE) }; } @Override public ITexture[] getSides(byte aColor) { - return new ITexture[] { - gregtech.api.enums.Textures.BlockIcons.MACHINE_CASINGS[this.mTier][(0)], - new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_SOLID_TOP_ACTIVE), - gregtech.api.enums.Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[getTier()] - }; + return new ITexture[] { gregtech.api.enums.Textures.BlockIcons.MACHINE_CASINGS[this.mTier][(0)], + new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_SOLID_TOP_ACTIVE), + gregtech.api.enums.Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[getTier()] }; } @Override public ITexture[] getFrontActive(byte aColor) { - return new ITexture[] { - super.getFrontActive(aColor)[0], - new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_SOLID_TOP_ACTIVE), - new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_MASSFAB_ACTIVE) - }; + return new ITexture[] { super.getFrontActive(aColor)[0], + new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_SOLID_TOP_ACTIVE), + new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_MASSFAB_ACTIVE) }; } @Override public ITexture[] getBackActive(byte aColor) { - return new ITexture[] { - super.getBackActive(aColor)[0], - new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_SOLID_TOP_ACTIVE) - }; + return new ITexture[] { super.getBackActive(aColor)[0], + new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_SOLID_TOP_ACTIVE) }; } @Override public ITexture[] getBottomActive(byte aColor) { - return new ITexture[] { - super.getBottomActive(aColor)[0], - new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_SOLID_TOP_ACTIVE) - }; + return new ITexture[] { super.getBottomActive(aColor)[0], + new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_SOLID_TOP_ACTIVE) }; } @Override public ITexture[] getTopActive(byte aColor) { - return new ITexture[] { - super.getTopActive(aColor)[0], - new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_SOLID_TOP_ACTIVE), - new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_FLUID_SIDE_ACTIVE) - }; + return new ITexture[] { super.getTopActive(aColor)[0], + new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_SOLID_TOP_ACTIVE), + new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_FLUID_SIDE_ACTIVE) }; } @Override public ITexture[] getSidesActive(byte aColor) { - return new ITexture[] { - gregtech.api.enums.Textures.BlockIcons.MACHINE_CASINGS[this.mTier][(0)], - new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_SOLID_TOP_ACTIVE), - gregtech.api.enums.Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[getTier()] - }; + return new ITexture[] { gregtech.api.enums.Textures.BlockIcons.MACHINE_CASINGS[this.mTier][(0)], + new GT_RenderedTexture(Textures.BlockIcons.NAQUADAH_REACTOR_SOLID_TOP_ACTIVE), + gregtech.api.enums.Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[getTier()] }; } public int getPollution() { @@ -316,7 +300,7 @@ public class GregtechMetaTileEntity_RTG extends GT_MetaTileEntity_BasicGenerator public int getFuelValue(ItemStack aStack) { if ((GT_Utility.isStackInvalid(aStack)) || (getRecipes() == null)) return 0; GT_Recipe tFuel = getRecipes() - .findRecipe(getBaseMetaTileEntity(), false, 9223372036854775807L, null, new ItemStack[] {aStack}); + .findRecipe(getBaseMetaTileEntity(), false, 9223372036854775807L, null, new ItemStack[] { aStack }); if (tFuel != null) { this.mCurrentRecipe = tFuel; int voltage = tFuel.mEUt; @@ -384,16 +368,13 @@ public class GregtechMetaTileEntity_RTG extends GT_MetaTileEntity_BasicGenerator @Override public String[] getInfoData() { - return new String[] { - "RTG - Running at tier " + this.mTier, - "Active: " + this.getBaseMetaTileEntity().isActive(), - "Current Output: " + this.mVoltage + " EU/t", - "Days of Fuel remaining: " + (mTicksToBurnFor / 20 / 60 / 20), - "Hours of Fuel remaining: " + (mTicksToBurnFor / 20 / 60 / 60), - "Ticks of " + this.mVoltage + "v remaining: " + (mTicksToBurnFor), - "Current Recipe input: " + this.mCurrentRecipe != null - ? this.mCurrentRecipe.mInputs[0].getDisplayName() + " x1" - : "NUll" - }; + return new String[] { "RTG - Running at tier " + this.mTier, + "Active: " + this.getBaseMetaTileEntity().isActive(), "Current Output: " + this.mVoltage + " EU/t", + "Days of Fuel remaining: " + (mTicksToBurnFor / 20 / 60 / 20), + "Hours of Fuel remaining: " + (mTicksToBurnFor / 20 / 60 / 60), + "Ticks of " + this.mVoltage + "v remaining: " + (mTicksToBurnFor), + "Current Recipe input: " + this.mCurrentRecipe != null + ? this.mCurrentRecipe.mInputs[0].getDisplayName() + " x1" + : "NUll" }; } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/ULV/GT_MetaTileEntity_ULV_CombustionGenerator.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/ULV/GT_MetaTileEntity_ULV_CombustionGenerator.java index 3398ad0fc6..70bf88ec77 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/ULV/GT_MetaTileEntity_ULV_CombustionGenerator.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/ULV/GT_MetaTileEntity_ULV_CombustionGenerator.java @@ -11,23 +11,20 @@ import gregtech.common.tileentities.generators.GT_MetaTileEntity_DieselGenerator import gtPlusPlus.core.lib.CORE; public class GT_MetaTileEntity_ULV_CombustionGenerator extends GT_MetaTileEntity_DieselGenerator { + public GT_MetaTileEntity_ULV_CombustionGenerator(int aID, String aName, String aNameRegional, int aTier) { super(aID, aName, aNameRegional, aTier); } - public GT_MetaTileEntity_ULV_CombustionGenerator( - String aName, int aTier, String aDescription, ITexture[][][] aTextures) { + public GT_MetaTileEntity_ULV_CombustionGenerator(String aName, int aTier, String aDescription, + ITexture[][][] aTextures) { super(aName, aTier, aDescription, aTextures); } @Override public String[] getDescription() { - return new String[] { - this.mDescription, - "Produces " + (this.getPollution() * 20) + " pollution/sec", - "Fuel Efficiency: " + this.getEfficiency() + "%", - CORE.GT_Tooltip - }; + return new String[] { this.mDescription, "Produces " + (this.getPollution() * 20) + " pollution/sec", + "Fuel Efficiency: " + this.getEfficiency() + "%", CORE.GT_Tooltip }; } @Override @@ -47,7 +44,7 @@ public class GT_MetaTileEntity_ULV_CombustionGenerator extends GT_MetaTileEntity @Override public void onConfigLoad() { - this.mEfficiency = GregTech_API.sMachineFile.get( - ConfigCategories.machineconfig, "DieselGenerator.efficiency.tier." + this.mTier, 95); + this.mEfficiency = GregTech_API.sMachineFile + .get(ConfigCategories.machineconfig, "DieselGenerator.efficiency.tier." + this.mTier, 95); } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/ULV/GT_MetaTileEntity_ULV_GasTurbine.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/ULV/GT_MetaTileEntity_ULV_GasTurbine.java index b8f8004dad..c4d3340ac0 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/ULV/GT_MetaTileEntity_ULV_GasTurbine.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/ULV/GT_MetaTileEntity_ULV_GasTurbine.java @@ -14,6 +14,7 @@ import gtPlusPlus.core.lib.CORE; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; public class GT_MetaTileEntity_ULV_GasTurbine extends GT_MetaTileEntity_GasTurbine { + public GT_MetaTileEntity_ULV_GasTurbine(int aID, String aName, String aNameRegional, int aTier) { super(aID, aName, aNameRegional, aTier); } @@ -24,12 +25,8 @@ public class GT_MetaTileEntity_ULV_GasTurbine extends GT_MetaTileEntity_GasTurbi @Override public String[] getDescription() { - return new String[] { - this.mDescription, - "Produces " + (this.getPollution() * 20) + " pollution/sec", - "Fuel Efficiency: " + this.getEfficiency() + "%", - CORE.GT_Tooltip - }; + return new String[] { this.mDescription, "Produces " + (this.getPollution() * 20) + " pollution/sec", + "Fuel Efficiency: " + this.getEfficiency() + "%", CORE.GT_Tooltip }; } @Override @@ -48,15 +45,13 @@ public class GT_MetaTileEntity_ULV_GasTurbine extends GT_MetaTileEntity_GasTurbi @Override public void onConfigLoad() { - this.mEfficiency = GregTech_API.sMachineFile.get( - ConfigCategories.machineconfig, "GasTurbine.efficiency.tier." + this.mTier, 95); + this.mEfficiency = GregTech_API.sMachineFile + .get(ConfigCategories.machineconfig, "GasTurbine.efficiency.tier." + this.mTier, 95); } @Override public ITexture[] getSidesActive(final byte aColor) { - return new ITexture[] { - super.getSidesActive(aColor)[0], - new GT_RenderedTexture((IIconContainer) TexturesGtBlock.Overlay_Machine_Turbine_Active) - }; + return new ITexture[] { super.getSidesActive(aColor)[0], + new GT_RenderedTexture((IIconContainer) TexturesGtBlock.Overlay_Machine_Turbine_Active) }; } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/ULV/GT_MetaTileEntity_ULV_SteamTurbine.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/ULV/GT_MetaTileEntity_ULV_SteamTurbine.java index 09e3e3201c..a07e69e00c 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/ULV/GT_MetaTileEntity_ULV_SteamTurbine.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/ULV/GT_MetaTileEntity_ULV_SteamTurbine.java @@ -14,6 +14,7 @@ import gtPlusPlus.core.lib.CORE; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; public class GT_MetaTileEntity_ULV_SteamTurbine extends GT_MetaTileEntity_SteamTurbine { + public GT_MetaTileEntity_ULV_SteamTurbine(int aID, String aName, String aNameRegional, int aTier) { super(aID, aName, aNameRegional, aTier); } @@ -24,12 +25,8 @@ public class GT_MetaTileEntity_ULV_SteamTurbine extends GT_MetaTileEntity_SteamT @Override public String[] getDescription() { - return new String[] { - this.mDescription, - "Produces " + (this.getPollution() * 20) + " pollution/sec", - "Fuel Efficiency: " + this.getEfficiency() + "%", - CORE.GT_Tooltip - }; + return new String[] { this.mDescription, "Produces " + (this.getPollution() * 20) + " pollution/sec", + "Fuel Efficiency: " + this.getEfficiency() + "%", CORE.GT_Tooltip }; } @Override @@ -48,15 +45,13 @@ public class GT_MetaTileEntity_ULV_SteamTurbine extends GT_MetaTileEntity_SteamT @Override public void onConfigLoad() { - this.mEfficiency = GregTech_API.sMachineFile.get( - ConfigCategories.machineconfig, "SteamTurbine.efficiency.tier." + this.mTier, 6 + 1); + this.mEfficiency = GregTech_API.sMachineFile + .get(ConfigCategories.machineconfig, "SteamTurbine.efficiency.tier." + this.mTier, 6 + 1); } @Override public ITexture[] getSidesActive(final byte aColor) { - return new ITexture[] { - super.getSidesActive(aColor)[0], - new GT_RenderedTexture((IIconContainer) TexturesGtBlock.Overlay_Machine_Turbine_Active) - }; + return new ITexture[] { super.getSidesActive(aColor)[0], + new GT_RenderedTexture((IIconContainer) TexturesGtBlock.Overlay_Machine_Turbine_Active) }; } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/creative/GregtechMetaCreativeEnergyBuffer.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/creative/GregtechMetaCreativeEnergyBuffer.java index d99ff30b20..42fda63282 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/creative/GregtechMetaCreativeEnergyBuffer.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/creative/GregtechMetaCreativeEnergyBuffer.java @@ -2,7 +2,14 @@ package gtPlusPlus.xmod.gregtech.common.tileentities.generators.creative; import static gregtech.api.enums.GT_Values.V; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.world.World; + import com.gtnewhorizon.gtnhlib.reflect.Fields; + import gregtech.api.enums.GT_Values; import gregtech.api.enums.Textures; import gregtech.api.interfaces.ITexture; @@ -18,51 +25,33 @@ import gtPlusPlus.core.util.sys.KeyboardUtils; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock.CustomIcon; import gtPlusPlus.xmod.gregtech.common.tileentities.storage.GregtechMetaEnergyBuffer; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.world.World; /** * NEVER INCLUDE THIS FILE IN YOUR MOD!!! * - * This is the main construct for my Basic Machines such as the Automatic - * Extractor Extend this class to make a simple Machine + * This is the main construct for my Basic Machines such as the Automatic Extractor Extend this class to make a simple + * Machine */ public class GregtechMetaCreativeEnergyBuffer extends GregtechMetaEnergyBuffer { private int mVoltageTier = 3; - public GregtechMetaCreativeEnergyBuffer( - final String aName, - final int aTier, - final String aDescription, - final ITexture[][][] aTextures, - final int aSlotCount) { + public GregtechMetaCreativeEnergyBuffer(final String aName, final int aTier, final String aDescription, + final ITexture[][][] aTextures, final int aSlotCount) { super(aName, aTier, aDescription, aTextures, aSlotCount); // TODO Auto-generated constructor stub } - public GregtechMetaCreativeEnergyBuffer( - final int aID, - final String aName, - final String aNameRegional, - final int aTier, - final String aDescription, - final int aSlotCount) { + public GregtechMetaCreativeEnergyBuffer(final int aID, final String aName, final String aNameRegional, + final int aTier, final String aDescription, final int aSlotCount) { super(aID, aName, aNameRegional, aTier, aDescription, aSlotCount); } @Override public String[] getDescription() { - return new String[] { - this.mDescription, - "Use Screwdriver to change voltage", - "Hold Shift while using Screwdriver to change amperage", - EnumChatFormatting.GREEN + "CREATIVE MACHINE", - CORE.GT_Tooltip - }; + return new String[] { this.mDescription, "Use Screwdriver to change voltage", + "Hold Shift while using Screwdriver to change amperage", EnumChatFormatting.GREEN + "CREATIVE MACHINE", + CORE.GT_Tooltip }; } /* @@ -77,25 +66,17 @@ public class GregtechMetaCreativeEnergyBuffer extends GregtechMetaEnergyBuffer { final ITexture[][][] rTextures = new ITexture[2][17][]; k = j ? g : h; for (byte i = -1; i < 16; i++) { - rTextures[0][i + 1] = new ITexture[] {new GT_RenderedTexture(k)}; - rTextures[1][i + 1] = new ITexture[] { - new GT_RenderedTexture(k), - this.mInventory.length > 4 - ? Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[this.mVoltageTier] - : Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mVoltageTier] - }; + rTextures[0][i + 1] = new ITexture[] { new GT_RenderedTexture(k) }; + rTextures[1][i + 1] = new ITexture[] { new GT_RenderedTexture(k), + this.mInventory.length > 4 ? Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[this.mVoltageTier] + : Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mVoltageTier] }; } return rTextures; } @Override - public ITexture[] getTexture( - final IGregTechTileEntity aBaseMetaTileEntity, - final byte aSide, - final byte aFacing, - final byte aColorIndex, - final boolean aActive, - final boolean aRedstone) { + public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing, + final byte aColorIndex, final boolean aActive, final boolean aRedstone) { return this.mTextures[aSide == aFacing ? 1 : 0][aColorIndex + 1]; } @@ -106,15 +87,19 @@ public class GregtechMetaCreativeEnergyBuffer extends GregtechMetaEnergyBuffer { final double roundOff = Math.round(c * 100.00) / 100.00; PlayerUtils.messagePlayer( playerIn, - "Energy: " + GT_Utility.formatNumbers(tempStorage) + " EU at " + V[this.mVoltageTier] + "v (" + roundOff - + "%)"); + "Energy: " + GT_Utility + .formatNumbers(tempStorage) + " EU at " + V[this.mVoltageTier] + "v (" + roundOff + "%)"); PlayerUtils.messagePlayer(playerIn, "Amperage: " + GT_Utility.formatNumbers(maxAmperesOut()) + "A"); } @Override public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) { return new GregtechMetaCreativeEnergyBuffer( - this.mName, this.mTier, this.mDescription, this.mTextures, this.mInventory.length); + this.mName, + this.mTier, + this.mDescription, + this.mTextures, + this.mInventory.length); } @Override @@ -170,23 +155,22 @@ public class GregtechMetaCreativeEnergyBuffer extends GregtechMetaEnergyBuffer { } @Override - public boolean allowPullStack( - final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, final ItemStack aStack) { + public boolean allowPullStack(final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, + final ItemStack aStack) { return false; } @Override - public boolean allowPutStack( - final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, final ItemStack aStack) { + public boolean allowPutStack(final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, + final ItemStack aStack) { return false; } @Override public String[] getInfoData() { String[] infoData = super.getInfoData(); - return new String[] { - infoData[0], "THIS IS A CREATIVE ITEM - FOR TESTING | Tier: " + this.mVoltageTier, infoData[1], infoData[2] - }; + return new String[] { infoData[0], "THIS IS A CREATIVE ITEM - FOR TESTING | Tier: " + this.mVoltageTier, + infoData[1], infoData[2] }; } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_CropHarvestor.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_CropHarvestor.java index c65c7be917..c9d575cab1 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_CropHarvestor.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_CropHarvestor.java @@ -1,5 +1,13 @@ package gtPlusPlus.xmod.gregtech.common.tileentities.machines.basic; +import java.util.*; +import java.util.Map.Entry; + +import net.minecraft.entity.player.*; +import net.minecraft.item.*; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; + import com.gtnewhorizon.gtnhlib.util.map.ItemStackMap; import com.gtnewhorizons.modularui.api.screen.ModularWindow; import com.gtnewhorizons.modularui.api.screen.UIBuildContext; @@ -7,6 +15,7 @@ import com.gtnewhorizons.modularui.common.widget.CycleButtonWidget; import com.gtnewhorizons.modularui.common.widget.FakeSyncWidget; import com.gtnewhorizons.modularui.common.widget.ProgressBar; import com.gtnewhorizons.modularui.common.widget.SlotGroup; + import gregtech.api.enums.*; import gregtech.api.gui.modularui.GT_UIInfos; import gregtech.api.gui.modularui.GT_UITextures; @@ -24,12 +33,6 @@ import gtPlusPlus.xmod.gregtech.api.gui.GTPP_UITextures; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; import ic2.api.crops.*; import ic2.core.item.DamageHandler; -import java.util.*; -import java.util.Map.Entry; -import net.minecraft.entity.player.*; -import net.minecraft.item.*; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.tileentity.TileEntity; public class GT_MetaTileEntity_CropHarvestor extends GT_MetaTileEntity_BasicTank { @@ -51,8 +54,8 @@ public class GT_MetaTileEntity_CropHarvestor extends GT_MetaTileEntity_BasicTank aDescription); } - public GT_MetaTileEntity_CropHarvestor( - final String aName, final int aTier, final String aDescription, final ITexture[][][] aTextures) { + public GT_MetaTileEntity_CropHarvestor(final String aName, final int aTier, final String aDescription, + final ITexture[][][] aTextures) { super(aName, aTier, 21, aDescription, aTextures); } @@ -185,9 +188,9 @@ public class GT_MetaTileEntity_CropHarvestor extends GT_MetaTileEntity_BasicTank @Override public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { super.onPostTick(aBaseMetaTileEntity, aTick); - if (!getBaseMetaTileEntity().isServerSide() - || !getBaseMetaTileEntity().isAllowedToWork() - || (!getBaseMetaTileEntity().hasWorkJustBeenEnabled() && aTick % 100 != 0)) return; + if (!getBaseMetaTileEntity().isServerSide() || !getBaseMetaTileEntity().isAllowedToWork() + || (!getBaseMetaTileEntity().hasWorkJustBeenEnabled() && aTick % 100 != 0)) + return; if (this.getBaseMetaTileEntity().getUniversalEnergyStored() < getMinimumStoredEU()) return; @@ -328,8 +331,7 @@ public class GT_MetaTileEntity_CropHarvestor extends GT_MetaTileEntity_BasicTank if (!this.mModeAlternative) { return; } - if (hasFertilizer() - && consumeFertilizer(true) + if (hasFertilizer() && consumeFertilizer(true) && this.getBaseMetaTileEntity().getUniversalEnergyStored() >= getMinimumStoredEU() && getBaseMetaTileEntity().decreaseStoredEnergyUnits(powerUsageSecondary(), true) && applyFertilizer(aCrop)) { @@ -337,14 +339,12 @@ public class GT_MetaTileEntity_CropHarvestor extends GT_MetaTileEntity_BasicTank // Logger.INFO("Consumed Fert."); } } - if (this.getFluidAmount() > 0 - && this.getBaseMetaTileEntity().getUniversalEnergyStored() >= getMinimumStoredEU() + if (this.getFluidAmount() > 0 && this.getBaseMetaTileEntity().getUniversalEnergyStored() >= getMinimumStoredEU() && getBaseMetaTileEntity().decreaseStoredEnergyUnits(powerUsageSecondary(), true) && applyHydration(aCrop)) { // Logger.INFO("Consumed Water."); } - if (hasWeedEX() - && consumeWeedEX(true) + if (hasWeedEX() && consumeWeedEX(true) && this.getBaseMetaTileEntity().getUniversalEnergyStored() >= getMinimumStoredEU() && getBaseMetaTileEntity().decreaseStoredEnergyUnits(powerUsageSecondary(), true) && applyWeedEx(aCrop)) { @@ -359,8 +359,7 @@ public class GT_MetaTileEntity_CropHarvestor extends GT_MetaTileEntity_BasicTank aCrop.setWeedExStorage(aCrop.getWeedExStorage() + 50); boolean triggerDecline; triggerDecline = aCrop.getWorld().rand.nextInt(3) == 0; - if (aCrop.getCrop() != null - && aCrop.getCrop().isWeed(aCrop) + if (aCrop.getCrop() != null && aCrop.getCrop().isWeed(aCrop) && aCrop.getWeedExStorage() >= 75 && triggerDecline) { switch (aCrop.getWorld().rand.nextInt(5)) { @@ -445,8 +444,7 @@ public class GT_MetaTileEntity_CropHarvestor extends GT_MetaTileEntity_BasicTank int damageApplied = 0; ItemStack stack = this.mInventory[aSlot]; Item item = stack.getItem(); - if (stack != null - && item.isDamageable() + if (stack != null && item.isDamageable() && (ret == null || stack.getItem() == ret.getItem() && ItemStack.areItemStackTagsEqual(stack, ret))) { if (simulate) { stack = stack.copy(); @@ -500,17 +498,13 @@ public class GT_MetaTileEntity_CropHarvestor extends GT_MetaTileEntity_BasicTank public String[] getDescription() { int aRadius = 10 + getRange(this.mTier); int aSide = (aRadius - 1) / 2; - return new String[] { - this.mDescription, - "Secondary mode can Hydrate/Fertilize/Weed-EX", - "Consumes " + powerUsage() + "eu per harvest", - "Consumes " + powerUsageSecondary() + "eu per secondary operation", - "Can harvest 2 blocks above and below", - "Radius: " + aSide + " each side (" + aRadius + "x3x" + aRadius + ")", - "Has " + (this.mTier * 5) + "% chance for extra drops", - "Holds " + this.getCapacity() + "L of Water", - CORE.GT_Tooltip - }; + return new String[] { this.mDescription, "Secondary mode can Hydrate/Fertilize/Weed-EX", + "Consumes " + powerUsage() + "eu per harvest", + "Consumes " + powerUsageSecondary() + "eu per secondary operation", + "Can harvest 2 blocks above and below", + "Radius: " + aSide + " each side (" + aRadius + "x3x" + aRadius + ")", + "Has " + (this.mTier * 5) + "% chance for extra drops", "Holds " + this.getCapacity() + "L of Water", + CORE.GT_Tooltip }; } @Override @@ -518,47 +512,17 @@ public class GT_MetaTileEntity_CropHarvestor extends GT_MetaTileEntity_BasicTank return true; } - /*@Override - public int getTextureIndex(byte aSide, byte aFacing, boolean aActive, boolean aRedstone) { - if (aSide == aFacing) - return 118+(aRedstone?8:0); - if (GT_Utility.getOppositeSide(aSide) == aFacing) - return 113+(aRedstone?8:0); - - int tIndex = 128+(aRedstone?8:0); - - switch (aFacing) { - case 0: - return tIndex+64; - case 1: - return tIndex+32; - case 2: switch (aSide) { - case 0: return tIndex+32; - case 1: return tIndex+32; - case 4: return tIndex+16; - case 5: return tIndex+48; - } - case 3: switch (aSide) { - case 0: return tIndex+64; - case 1: return tIndex+64; - case 4: return tIndex+48; - case 5: return tIndex+16; - } - case 4: switch (aSide) { - case 0: return tIndex+16; - case 1: return tIndex+16; - case 2: return tIndex+48; - case 3: return tIndex+16; - } - case 5: switch (aSide) { - case 0: return tIndex+48; - case 1: return tIndex+48; - case 2: return tIndex+16; - case 3: return tIndex+48; - } - } - return tIndex; - } */ + /* + * @Override public int getTextureIndex(byte aSide, byte aFacing, boolean aActive, boolean aRedstone) { if (aSide == + * aFacing) return 118+(aRedstone?8:0); if (GT_Utility.getOppositeSide(aSide) == aFacing) return + * 113+(aRedstone?8:0); int tIndex = 128+(aRedstone?8:0); switch (aFacing) { case 0: return tIndex+64; case 1: + * return tIndex+32; case 2: switch (aSide) { case 0: return tIndex+32; case 1: return tIndex+32; case 4: return + * tIndex+16; case 5: return tIndex+48; } case 3: switch (aSide) { case 0: return tIndex+64; case 1: return + * tIndex+64; case 4: return tIndex+48; case 5: return tIndex+16; } case 4: switch (aSide) { case 0: return + * tIndex+16; case 1: return tIndex+16; case 2: return tIndex+48; case 3: return tIndex+16; } case 5: switch (aSide) + * { case 0: return tIndex+48; case 1: return tIndex+48; case 2: return tIndex+16; case 3: return tIndex+48; } } + * return tIndex; } + */ @Override public ITexture[][][] getTextureSet(final ITexture[] aTextures) { @@ -579,56 +543,42 @@ public class GT_MetaTileEntity_CropHarvestor extends GT_MetaTileEntity_BasicTank } @Override - public ITexture[] getTexture( - final IGregTechTileEntity aBaseMetaTileEntity, - final byte aSide, - final byte aFacing, - final byte aColorIndex, - final boolean aActive, - final boolean aRedstone) { + public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing, + final byte aColorIndex, final boolean aActive, final boolean aRedstone) { if (aSide == 0 || aSide == 1) { return this.mTextures[3][aColorIndex + 1]; } else { return this.mTextures[4][aColorIndex + 1]; } - /*return this.mTextures[(aActive ? 5 : 0) + (aSide == aFacing ? 0 - : aSide == GT_Utility.getOppositeSide(aFacing) ? 1 : aSide == 0 ? 2 : aSide == 1 ? 3 : 4)][aColorIndex - + 1];*/ + /* + * return this.mTextures[(aActive ? 5 : 0) + (aSide == aFacing ? 0 : aSide == + * GT_Utility.getOppositeSide(aFacing) ? 1 : aSide == 0 ? 2 : aSide == 1 ? 3 : 4)][aColorIndex + 1]; + */ } public ITexture[] getFront(final byte aColor) { - return new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], - new GT_RenderedTexture(TexturesGtBlock.Casing_CropHarvester_Cutter) - }; + return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], + new GT_RenderedTexture(TexturesGtBlock.Casing_CropHarvester_Cutter) }; } public ITexture[] getBack(final byte aColor) { - return new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], - new GT_RenderedTexture(TexturesGtBlock.Casing_CropHarvester_Cutter) - }; + return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], + new GT_RenderedTexture(TexturesGtBlock.Casing_CropHarvester_Cutter) }; } public ITexture[] getBottom(final byte aColor) { - return new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], - new GT_RenderedTexture(TexturesGtBlock.Casing_CropHarvester_Boxes) - }; + return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], + new GT_RenderedTexture(TexturesGtBlock.Casing_CropHarvester_Boxes) }; } public ITexture[] getTop(final byte aColor) { - return new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], - new GT_RenderedTexture(TexturesGtBlock.Casing_CropHarvester_Boxes) - }; + return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], + new GT_RenderedTexture(TexturesGtBlock.Casing_CropHarvester_Boxes) }; } public ITexture[] getSides(final byte aColor) { - return new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], - new GT_RenderedTexture(TexturesGtBlock.Casing_CropHarvester_Cutter) - }; + return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], + new GT_RenderedTexture(TexturesGtBlock.Casing_CropHarvester_Cutter) }; } @Override @@ -680,47 +630,52 @@ public class GT_MetaTileEntity_CropHarvestor extends GT_MetaTileEntity_BasicTank @Override public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildContext) { - builder.widget(new CycleButtonWidget() - .setToggle(() -> mModeAlternative, val -> mModeAlternative = val) - .setTexture(GTPP_UITextures.OVERLAY_BUTTON_HARVESTER_MODE) - .addTooltip(0, "Enable Hydration/Fertilizing/Weed-EX") - .addTooltip(1, "Disable Hydration/Fertilizing/Weed-EX") - .setBackground(GT_UITextures.BUTTON_STANDARD) - .setPos(47, 63) - .setSize(18, 18)); - builder.widget(SlotGroup.ofItemHandler(inventoryHandler, 2) - .startFromSlot(SLOT_WEEDEX_1) + builder.widget( + new CycleButtonWidget().setToggle(() -> mModeAlternative, val -> mModeAlternative = val) + .setTexture(GTPP_UITextures.OVERLAY_BUTTON_HARVESTER_MODE) + .addTooltip(0, "Enable Hydration/Fertilizing/Weed-EX") + .addTooltip(1, "Disable Hydration/Fertilizing/Weed-EX") + .setBackground(GT_UITextures.BUTTON_STANDARD).setPos(47, 63).setSize(18, 18)); + builder.widget( + SlotGroup + .ofItemHandler(inventoryHandler, 2).startFromSlot( + SLOT_WEEDEX_1) .endAtSlot(SLOT_WEEDEX_2) - .applyForWidget(widget -> widget.setFilter(stack -> stack != null - && stack.getItem().getUnlocalizedName().equals("ic2.itemWeedEx")) - .setBackground(getGUITextureSet().getItemSlot(), GTPP_UITextures.OVERLAY_SLOT_WEED_EX)) - .build() - .setPos(7, 13)) - .widget(SlotGroup.ofItemHandler(inventoryHandler, 2) - .startFromSlot(SLOT_FERT_1) - .endAtSlot(SLOT_FERT_4) - .applyForWidget(widget -> widget.setFilter(stack -> stack != null - && stack.getItem().getUnlocalizedName().equals("ic2.itemFertilizer")) - .setBackground( - getGUITextureSet().getItemSlot(), GTPP_UITextures.OVERLAY_SLOT_FERTILIZER)) - .build() - .setPos(7, 31)) - .widget(SlotGroup.ofItemHandler(inventoryHandler, 6) - .startFromSlot(SLOT_OUTPUT_START) - .endAtSlot(SLOT_OUTPUT_START + 6 * 3) - .canInsert(false) - .build() - .setPos(61, 7)); - builder.widget(new ProgressBar() + .applyForWidget( + widget -> widget.setFilter( + stack -> stack != null + && stack.getItem().getUnlocalizedName().equals("ic2.itemWeedEx")) + .setBackground( + getGUITextureSet().getItemSlot(), + GTPP_UITextures.OVERLAY_SLOT_WEED_EX)) + .build().setPos(7, 13)) + .widget( + SlotGroup + .ofItemHandler(inventoryHandler, 2).startFromSlot(SLOT_FERT_1).endAtSlot( + SLOT_FERT_4) + .applyForWidget( + widget -> widget.setFilter( + stack -> stack != null && stack.getItem().getUnlocalizedName() + .equals("ic2.itemFertilizer")) + .setBackground( + getGUITextureSet().getItemSlot(), + GTPP_UITextures.OVERLAY_SLOT_FERTILIZER)) + .build().setPos(7, 31)) + .widget( + SlotGroup.ofItemHandler(inventoryHandler, 6).startFromSlot(SLOT_OUTPUT_START) + .endAtSlot(SLOT_OUTPUT_START + 6 * 3).canInsert(false).build().setPos(61, 7)); + builder.widget( + new ProgressBar() .setTexture( - GTPP_UITextures.PROGRESSBAR_BOILER_EMPTY, GT_UITextures.PROGRESSBAR_BOILER_WATER, 54) + GTPP_UITextures.PROGRESSBAR_BOILER_EMPTY, + GT_UITextures.PROGRESSBAR_BOILER_WATER, + 54) .setDirection(ProgressBar.Direction.UP) - .setProgress(() -> (float) getFluidAmount() / getCapacity()) - .setSynced(false, false) - .dynamicTooltip(() -> - Collections.singletonList("Water: " + getFluidAmount() + "L / " + getCapacity() + "L")) - .setPos(47, 7) - .setSize(10, 54)) + .setProgress(() -> (float) getFluidAmount() / getCapacity()).setSynced(false, false) + .dynamicTooltip( + () -> Collections + .singletonList("Water: " + getFluidAmount() + "L / " + getCapacity() + "L")) + .setPos(47, 7).setSize(10, 54)) .widget(new FakeSyncWidget.FluidStackSyncer(this::getDrainableStack, this::setDrainableStack)); } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_WorldAccelerator.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_WorldAccelerator.java index 6ba1e373eb..4e5a6e352a 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_WorldAccelerator.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_WorldAccelerator.java @@ -2,20 +2,10 @@ package gtPlusPlus.xmod.gregtech.common.tileentities.machines.basic; import static gregtech.api.enums.GT_Values.V; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import gregtech.api.enums.Textures; -import gregtech.api.enums.Textures.BlockIcons.CustomIcon; -import gregtech.api.interfaces.ITexture; -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gregtech.api.metatileentity.MetaTileEntity; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_TieredMachineBlock; -import gregtech.api.objects.GT_RenderedTexture; -import gtPlusPlus.api.objects.Logger; -import gtPlusPlus.core.util.minecraft.PlayerUtils; import java.util.ArrayList; import java.util.List; import java.util.Random; + import net.minecraft.block.Block; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.player.EntityPlayer; @@ -25,6 +15,18 @@ import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import gregtech.api.enums.Textures; +import gregtech.api.enums.Textures.BlockIcons.CustomIcon; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.MetaTileEntity; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_TieredMachineBlock; +import gregtech.api.objects.GT_RenderedTexture; +import gtPlusPlus.api.objects.Logger; +import gtPlusPlus.core.util.minecraft.PlayerUtils; + public class GT_MetaTileEntity_WorldAccelerator extends GT_MetaTileEntity_TieredMachineBlock { public static String[] BlacklistedTileEntiyClassNames; @@ -35,7 +37,7 @@ public class GT_MetaTileEntity_WorldAccelerator extends GT_MetaTileEntity_Tiered private static CustomIcon _mGTIco_Norm_Active; private static CustomIcon _mGTIco_TE_Idle; private static CustomIcon _mGTIco_TE_Active; - private static int[] mAccelerateStatic = {1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 512, 512, 512, 512, 512, 512}; + private static int[] mAccelerateStatic = { 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 512, 512, 512, 512, 512, 512 }; @Override public void registerIcons(IIconRegister aBlockIconRegister) { @@ -64,18 +66,17 @@ public class GT_MetaTileEntity_WorldAccelerator extends GT_MetaTileEntity_Tiered @Override public String[] getDescription() { return new String[] { - String.format( - "Accelerating things (Radius: %d EU/t: %d Speed Bonus: x%d)", - mTier, getEnergyDemand(mTier, false), mAccelerateStatic[mTier]), - "Use a screwdriver to change mode", - "To accelerate TileEntities, this machine has to be adjacent to it", - "This machine accepts up to 8 Amps", - "Accelerating TileEntities doubles Energy-Demand" - }; + String.format( + "Accelerating things (Radius: %d EU/t: %d Speed Bonus: x%d)", + mTier, + getEnergyDemand(mTier, false), + mAccelerateStatic[mTier]), + "Use a screwdriver to change mode", "To accelerate TileEntities, this machine has to be adjacent to it", + "This machine accepts up to 8 Amps", "Accelerating TileEntities doubles Energy-Demand" }; } - public GT_MetaTileEntity_WorldAccelerator( - String pName, int pTier, int pInvSlotCount, String pDescription, ITexture[][][] pTextures) { + public GT_MetaTileEntity_WorldAccelerator(String pName, int pTier, int pInvSlotCount, String pDescription, + ITexture[][][] pTextures) { super(pName, pTier, pInvSlotCount, pDescription, pTextures); } @@ -90,29 +91,13 @@ public class GT_MetaTileEntity_WorldAccelerator extends GT_MetaTileEntity_Tiered } @Override - public ITexture[] getTexture( - IGregTechTileEntity pBaseMetaTileEntity, - byte pSide, - byte pFacing, - byte pColorIndex, - boolean pActive, - boolean pRedstone) { - if (mMode == 0) - return new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[mTier][pColorIndex + 1], - (pSide < 2) - ? null - : pActive - ? new GT_RenderedTexture(_mGTIco_Norm_Active) - : new GT_RenderedTexture(_mGTIco_Norm_Idle) - }; - else - return new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[mTier][pColorIndex + 1], - (pSide < 2) - ? null - : pActive ? new GT_RenderedTexture(_mGTIco_TE_Active) : new GT_RenderedTexture(_mGTIco_TE_Idle) - }; + public ITexture[] getTexture(IGregTechTileEntity pBaseMetaTileEntity, byte pSide, byte pFacing, byte pColorIndex, + boolean pActive, boolean pRedstone) { + if (mMode == 0) return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][pColorIndex + 1], (pSide < 2) + ? null + : pActive ? new GT_RenderedTexture(_mGTIco_Norm_Active) : new GT_RenderedTexture(_mGTIco_Norm_Idle) }; + else return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][pColorIndex + 1], (pSide < 2) ? null + : pActive ? new GT_RenderedTexture(_mGTIco_TE_Active) : new GT_RenderedTexture(_mGTIco_TE_Idle) }; } @Override @@ -189,7 +174,7 @@ public class GT_MetaTileEntity_WorldAccelerator extends GT_MetaTileEntity_Tiered return 8; } - private static String[] mModeStr = {"Blocks", "TileEntities"}; + private static String[] mModeStr = { "Blocks", "TileEntities" }; @Override public void onScrewdriverRightClick(byte pSide, EntityPlayer pPlayer, float pX, float pY, float pZ) { @@ -259,9 +244,9 @@ public class GT_MetaTileEntity_WorldAccelerator extends GT_MetaTileEntity_Tiered String tSimpleClassName = pTile.getClass().getSimpleName().toLowerCase(); String tCanonicalName = pTile.getClass().getCanonicalName().toLowerCase(); - if (tSimpleClassName.contains("conduit") - || tSimpleClassName.contains("wire") - || tSimpleClassName.contains("cable")) return true; + if (tSimpleClassName.contains("conduit") || tSimpleClassName.contains("wire") + || tSimpleClassName.contains("cable")) + return true; if (tCanonicalName.contains("appeng") || tCanonicalName.contains("gregtech")) // Don't accelerate ANY Gregtech machines! return true; @@ -273,10 +258,9 @@ public class GT_MetaTileEntity_WorldAccelerator extends GT_MetaTileEntity_Tiered } /** - * Accelerate normal blocks. Eats some power and adds randomTicks to every - * block within its working area (Tier-Number = radius) This does only - * affect blocks that implement the "RandomTick" method; Which is mostly - * used for grass growth and plants. + * Accelerate normal blocks. Eats some power and adds randomTicks to every block within its working area + * (Tier-Number = radius) This does only affect blocks that implement the "RandomTick" method; Which is mostly used + * for grass growth and plants. * * @param pBaseMetaTileEntity */ @@ -295,9 +279,8 @@ public class GT_MetaTileEntity_WorldAccelerator extends GT_MetaTileEntity_Tiered int tZ1 = tZ - mTier; int tZ2 = tZ + mTier; - for (int xi = tX1; xi <= tX2; xi++) - for (int yi = tY1; yi <= tY2; yi++) - for (int zi = tZ1; zi <= tZ2; zi++) tryTickBlock(pWorld, xi, yi, zi, rnd); + for (int xi = tX1; xi <= tX2; xi++) for (int yi = tY1; yi <= tY2; yi++) + for (int zi = tZ1; zi <= tZ2; zi++) tryTickBlock(pWorld, xi, yi, zi, rnd); } /** diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaAtmosphericReconditioner.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaAtmosphericReconditioner.java index 19994896e8..2d734b5bf9 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaAtmosphericReconditioner.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaAtmosphericReconditioner.java @@ -2,11 +2,23 @@ package gtPlusPlus.xmod.gregtech.common.tileentities.machines.basic; import static gregtech.api.enums.GT_Values.V; +import java.util.Collections; +import java.util.HashMap; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.world.World; +import net.minecraft.world.chunk.Chunk; + +import org.apache.commons.lang3.ArrayUtils; + import com.gtnewhorizons.modularui.api.screen.ModularWindow; import com.gtnewhorizons.modularui.api.screen.UIBuildContext; import com.gtnewhorizons.modularui.common.widget.DrawableWidget; import com.gtnewhorizons.modularui.common.widget.FakeSyncWidget; import com.gtnewhorizons.modularui.common.widget.SlotWidget; + import gregtech.api.GregTech_API; import gregtech.api.enums.Materials; import gregtech.api.enums.Textures; @@ -32,14 +44,6 @@ import gtPlusPlus.core.util.minecraft.PlayerUtils; import gtPlusPlus.core.util.minecraft.gregtech.PollutionUtils; import gtPlusPlus.xmod.gregtech.api.gui.GTPP_UITextures; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; -import java.util.Collections; -import java.util.HashMap; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.world.World; -import net.minecraft.world.chunk.Chunk; -import org.apache.commons.lang3.ArrayUtils; public class GregtechMetaAtmosphericReconditioner extends GT_MetaTileEntity_BasicMachine { @@ -73,33 +77,38 @@ public class GregtechMetaAtmosphericReconditioner extends GT_MetaTileEntity_Basi 0, "Recycler.png", "", - new ITexture[] { - new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_MASSFAB_ACTIVE), - new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_MASSFAB), - new GT_RenderedTexture(TexturesGtBlock.Overlay_MatterFab_Active), - new GT_RenderedTexture(TexturesGtBlock.Overlay_MatterFab), - new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Vent_Fast), - new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Vent), - new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_MASSFAB_ACTIVE), - new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_MASSFAB) - }); + new ITexture[] { new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_MASSFAB_ACTIVE), + new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_MASSFAB), + new GT_RenderedTexture(TexturesGtBlock.Overlay_MatterFab_Active), + new GT_RenderedTexture(TexturesGtBlock.Overlay_MatterFab), + new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Vent_Fast), + new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Vent), + new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_MASSFAB_ACTIVE), + new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_MASSFAB) }); mPollutionEnabled = PollutionUtils.isPollutionEnabled(); } - public GregtechMetaAtmosphericReconditioner( - String aName, int aTier, String aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName) { + public GregtechMetaAtmosphericReconditioner(String aName, int aTier, String aDescription, ITexture[][][] aTextures, + String aGUIName, String aNEIName) { super(aName, aTier, 2, aDescription, aTextures, 2, 0, aGUIName, aNEIName); mPollutionEnabled = PollutionUtils.isPollutionEnabled(); } - /*public GregtechMetaAtmosphericReconditioner(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName) { - super(aName, aTier, 2, aDescription, aTextures, 2, 0, aGUIName, aNEIName); - }*/ + /* + * public GregtechMetaAtmosphericReconditioner(String aName, int aTier, String[] aDescription, ITexture[][][] + * aTextures, String aGUIName, String aNEIName) { super(aName, aTier, 2, aDescription, aTextures, 2, 0, aGUIName, + * aNEIName); } + */ @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new GregtechMetaAtmosphericReconditioner( - this.mName, this.mTier, this.mDescription, this.mTextures, this.mGUIName, this.mNEIName); + this.mName, + this.mTier, + this.mDescription, + this.mTextures, + this.mGUIName, + this.mNEIName); } @Override @@ -107,26 +116,21 @@ public class GregtechMetaAtmosphericReconditioner extends GT_MetaTileEntity_Basi boolean highTier = this.mTier >= 7; - String[] A = new String[] { - this.mDescription, - highTier ? "Will attempt to remove 1/4 pollution from 8 surrounding chunks" : "", - highTier ? "If these chunks are not loaded, they will be ignored" : "", - "Requires a turbine rotor and an Air Filter [T1/T2] to run.", - "The turbine rotor must be manually inserted/replaced", - "Can be configured with a soldering iron to change modes", - "Low Efficiency: Removes half pollution, Turbine takes 50% dmg", - "High Efficiency: Removes full pollution, Turbine takes 100% dmg", - "Turbine Rotor will not break in LE mode", - "Insert an equal tier Conveyor Module to enable automation" - }; + String[] A = new String[] { this.mDescription, + highTier ? "Will attempt to remove 1/4 pollution from 8 surrounding chunks" : "", + highTier ? "If these chunks are not loaded, they will be ignored" : "", + "Requires a turbine rotor and an Air Filter [T1/T2] to run.", + "The turbine rotor must be manually inserted/replaced", + "Can be configured with a soldering iron to change modes", + "Low Efficiency: Removes half pollution, Turbine takes 50% dmg", + "High Efficiency: Removes full pollution, Turbine takes 100% dmg", + "Turbine Rotor will not break in LE mode", + "Insert an equal tier Conveyor Module to enable automation" }; if (!mPollutionEnabled) { - String[] B = new String[] { - "===============================================", - "Pollution is disabled, scrubbers will now have a bonus use", - "They are now able to remove ALL lingering pollution as GT ignores it", - "and it will linger forever!", - "===============================================", - }; + String[] B = new String[] { "===============================================", + "Pollution is disabled, scrubbers will now have a bonus use", + "They are now able to remove ALL lingering pollution as GT ignores it", + "and it will linger forever!", "===============================================", }; A = ArrayUtils.addAll(A, B); } return A; @@ -233,18 +237,17 @@ public class GregtechMetaAtmosphericReconditioner extends GT_MetaTileEntity_Basi Logger.INFO("Set Active."); aBaseMetaTileEntity.setActive(true); } - } else if (!this.mHasPollution - || mCurrentPollution <= 0 + } else if (!this.mHasPollution || mCurrentPollution <= 0 || stackRotor == null || stackFilter == null || !hasRotor(stackRotor) || !hasAirFilter(stackFilter)) { - if (!this.getBaseMetaTileEntity().isActive()) { - Logger.INFO("Set Inactive."); - aBaseMetaTileEntity.setActive(false); - this.sendSound((byte) -122); - } - } + if (!this.getBaseMetaTileEntity().isActive()) { + Logger.INFO("Set Inactive."); + aBaseMetaTileEntity.setActive(false); + this.sendSound((byte) -122); + } + } // If Active. if (aBaseMetaTileEntity.isActive()) { @@ -291,8 +294,9 @@ public class GregtechMetaAtmosphericReconditioner extends GT_MetaTileEntity_Basi // If no sides are free, how will you process the atmosphere? if (mAirSides > 0) { - reduction += (((Math.max((tTier - 2), 1) * 2) * 50) - * mAirSides); // Was originally *100 + reduction += (((Math.max((tTier - 2), 1) * 2) * 50) * mAirSides); // Was + // originally + // *100 Logger.INFO("mPollutionReduction[1]:" + reduction); // I stole this code @@ -344,26 +348,24 @@ public class GregtechMetaAtmosphericReconditioner extends GT_MetaTileEntity_Basi } } // End of can work block. else { // Disable Machine. - // aBaseMetaTileEntity.setActive(false); + // aBaseMetaTileEntity.setActive(false); } } // End of 1/sec action block. else { - if (hasRotor(stackRotor) - && hasAirFilter(stackFilter) + if (hasRotor(stackRotor) && hasAirFilter(stackFilter) && this.mHasPollution && !isIdle && aBaseMetaTileEntity.isAllowedToWork()) { aBaseMetaTileEntity.setActive(true); - } else if (isIdle - || !this.mHasPollution + } else if (isIdle || !this.mHasPollution || mCurrentPollution <= 0 || stackRotor == null || stackFilter == null || !hasRotor(stackRotor) || !hasAirFilter(stackFilter)) { - aBaseMetaTileEntity.setActive(false); - } + aBaseMetaTileEntity.setActive(false); + } } if (this.getBaseMetaTileEntity().isActive()) { if (MathUtils.randInt(0, 5) <= 2) { @@ -427,14 +429,13 @@ public class GregtechMetaAtmosphericReconditioner extends GT_MetaTileEntity_Basi if (rotorStack.getItem() instanceof ItemBasicScrubberTurbine) { // Logger.INFO("Found Basic Turbine Rotor."); return true; - } else if (rotorStack.getItem() instanceof GT_MetaGenerated_Tool - && rotorStack.getItemDamage() >= 170 + } else if (rotorStack.getItem() instanceof GT_MetaGenerated_Tool && rotorStack.getItemDamage() >= 170 && rotorStack.getItemDamage() <= 179) { - // Logger.INFO("Found Turbine Rotor."); - return true; - } else { - // Logger.INFO("Found: "+rotorStack.getDisplayName()+":"+rotorStack.getItemDamage()); - } + // Logger.INFO("Found Turbine Rotor."); + return true; + } else { + // Logger.INFO("Found: "+rotorStack.getDisplayName()+":"+rotorStack.getItemDamage()); + } } // Logger.INFO("Found No Turbine Rotor."); return false; @@ -482,42 +483,44 @@ public class GregtechMetaAtmosphericReconditioner extends GT_MetaTileEntity_Basi } if (mInventory[SLOT_ROTOR].getItem() instanceof GT_MetaGenerated_Tool_01 - && ((GT_MetaGenerated_Tool) mInventory[SLOT_ROTOR].getItem()) - .getToolStats(mInventory[SLOT_ROTOR]) - .getSpeedMultiplier() - > 0 + && ((GT_MetaGenerated_Tool) mInventory[SLOT_ROTOR].getItem()).getToolStats(mInventory[SLOT_ROTOR]) + .getSpeedMultiplier() > 0 && GT_MetaGenerated_Tool.getPrimaryMaterial(mInventory[SLOT_ROTOR]).mToolSpeed > 0) { - long damageValue = (long) - Math.floor(Math.abs(MathUtils.randFloat(1, 2) - MathUtils.randFloat(1, 3)) * (1 + 3 - 1) + 1); + long damageValue = (long) Math + .floor(Math.abs(MathUtils.randFloat(1, 2) - MathUtils.randFloat(1, 3)) * (1 + 3 - 1) + 1); double fDam = Math.floor( Math.abs(MathUtils.randFloat(1f, 2f) - MathUtils.randFloat(1f, 2f)) * (1f + 2f - 1f) + 1f); damageValue -= fDam; // Logger.INFO("Trying to do "+damageValue+" damage to the rotor. ["+fDam+"]"); - /*Materials M1 = GT_MetaGenerated_Tool.getPrimaryMaterial(this.mInventory[this.SLOT_ROTOR]); - Materials M2 = GT_MetaGenerated_Tool.getSecondaryMaterial(this.mInventory[this.SLOT_ROTOR]); - - Logger.INFO("Trying to do "+damageValue+" damage to the rotor. [2]");*/ + /* + * Materials M1 = GT_MetaGenerated_Tool.getPrimaryMaterial(this.mInventory[this.SLOT_ROTOR]); Materials + * M2 = GT_MetaGenerated_Tool.getSecondaryMaterial(this.mInventory[this.SLOT_ROTOR]); + * Logger.INFO("Trying to do "+damageValue+" damage to the rotor. [2]"); + */ // Damage Rotor // int rotorDurability = this.mInventory[this.SLOT_ROTOR].getItemDamage(); - long rotorDamage = - creativeRotor ? 0 : GT_MetaGenerated_Tool.getToolDamage(this.mInventory[this.SLOT_ROTOR]); - long rotorDurabilityMax = creativeRotor - ? Integer.MAX_VALUE + long rotorDamage = creativeRotor ? 0 + : GT_MetaGenerated_Tool.getToolDamage(this.mInventory[this.SLOT_ROTOR]); + long rotorDurabilityMax = creativeRotor ? Integer.MAX_VALUE : GT_MetaGenerated_Tool.getToolMaxDamage(this.mInventory[this.SLOT_ROTOR]); long rotorDurability = (rotorDurabilityMax - rotorDamage); - Logger.INFO("Rotor Damage: " + rotorDamage + " | Max Durability: " + rotorDurabilityMax + " | " - + " Remaining Durability: " + rotorDurability); + Logger.INFO( + "Rotor Damage: " + rotorDamage + + " | Max Durability: " + + rotorDurabilityMax + + " | " + + " Remaining Durability: " + + rotorDurability); if (rotorDurability >= damageValue) { if (!mSaveRotor) { Logger.INFO("Damaging Rotor."); - if (!creativeRotor) - GT_ModHandler.damageOrDechargeItem( - this.mInventory[this.SLOT_ROTOR], (int) damageValue, 0, null); + if (!creativeRotor) GT_ModHandler + .damageOrDechargeItem(this.mInventory[this.SLOT_ROTOR], (int) damageValue, 0, null); long tempDur = GT_MetaGenerated_Tool.getToolDamage(this.mInventory[this.SLOT_ROTOR]); if (tempDur < rotorDurabilityMax) { @@ -528,9 +531,11 @@ public class GregtechMetaAtmosphericReconditioner extends GT_MetaTileEntity_Basi } else { Logger.INFO("Damaging Rotor."); if (rotorDurability > 1000) { - if (!creativeRotor) - GT_ModHandler.damageOrDechargeItem( - this.mInventory[this.SLOT_ROTOR], (int) damageValue / 2, 0, null); + if (!creativeRotor) GT_ModHandler.damageOrDechargeItem( + this.mInventory[this.SLOT_ROTOR], + (int) damageValue / 2, + 0, + null); long tempDur = GT_MetaGenerated_Tool.getToolDamage(this.mInventory[this.SLOT_ROTOR]); if (tempDur < rotorDurabilityMax) { return true; @@ -586,9 +591,7 @@ public class GregtechMetaAtmosphericReconditioner extends GT_MetaTileEntity_Basi public boolean removePollution(int toRemove) { - if (this == null - || this.getBaseMetaTileEntity() == null - || this.getBaseMetaTileEntity().getWorld() == null) { + if (this == null || this.getBaseMetaTileEntity() == null || this.getBaseMetaTileEntity().getWorld() == null) { return false; } @@ -603,11 +606,9 @@ public class GregtechMetaAtmosphericReconditioner extends GT_MetaTileEntity_Basi int chunksWithRemoval = 0; int totalRemoved = 0; AutoMap<Chunk> aSurrounding = new AutoMap<Chunk>(); - Chunk aThisChunk = this.getBaseMetaTileEntity() - .getWorld() - .getChunkFromBlockCoords( - this.getBaseMetaTileEntity().getXCoord(), - this.getBaseMetaTileEntity().getZCoord()); + Chunk aThisChunk = this.getBaseMetaTileEntity().getWorld().getChunkFromBlockCoords( + this.getBaseMetaTileEntity().getXCoord(), + this.getBaseMetaTileEntity().getZCoord()); int mainChunkX = aThisChunk.xPosition; int mainChunkZ = aThisChunk.zPosition; @@ -645,8 +646,12 @@ public class GregtechMetaAtmosphericReconditioner extends GT_MetaTileEntity_Basi continue; } - Logger.INFO("Trying to remove pollution from chunk " + r.xPosition + ", " + r.zPosition + " | " - + startPollution); + Logger.INFO( + "Trying to remove pollution from chunk " + r.xPosition + + ", " + + r.zPosition + + " | " + + startPollution); int after = 0; boolean isMainChunk = r.isAtLocation(mainChunkX, mainChunkZ); @@ -660,8 +665,14 @@ public class GregtechMetaAtmosphericReconditioner extends GT_MetaTileEntity_Basi if (startPollution - after > 0) { totalRemoved += (startPollution - after); } - Logger.INFO("Removed " + (startPollution - after) + " pollution from chunk " + r.xPosition + ", " - + r.zPosition + " | " + after); + Logger.INFO( + "Removed " + (startPollution - after) + + " pollution from chunk " + + r.xPosition + + ", " + + r.zPosition + + " | " + + after); } return totalRemoved > 0 && chunksWithRemoval > 0; } @@ -741,8 +752,7 @@ public class GregtechMetaAtmosphericReconditioner extends GT_MetaTileEntity_Basi if (aStack.getItem() instanceof ItemBasicScrubberTurbine) { return true; } - if (aStack.getItem() instanceof GT_MetaGenerated_Tool - && aStack.getItemDamage() >= 170 + if (aStack.getItem() instanceof GT_MetaGenerated_Tool && aStack.getItemDamage() >= 170 && aStack.getItemDamage() <= 179) { return true; } @@ -757,8 +767,8 @@ public class GregtechMetaAtmosphericReconditioner extends GT_MetaTileEntity_Basi super.onScrewdriverRightClick(aSide, aPlayer, aX, aY, aZ); } - public boolean onSolderingToolRightClick( - byte aSide, byte aWrenchingSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { + public boolean onSolderingToolRightClick(byte aSide, byte aWrenchingSide, EntityPlayer aPlayer, float aX, float aY, + float aZ) { this.mSaveRotor = Utils.invertBoolean(mSaveRotor); if (mSaveRotor) { PlayerUtils.messagePlayer(aPlayer, "Running in low efficiency mode, rotors will not break."); @@ -781,9 +791,10 @@ public class GregtechMetaAtmosphericReconditioner extends GT_MetaTileEntity_Basi } else if (aIndex == -121 || aIndex == -122) { // GT_Utility.doSoundAtClient((String) GregTech_API.sSoundList.get(Integer.valueOf(108)), 0, 0.5F, aX, aY, // aZ); - } /*else if (aIndex == -122) { - GT_Utility.doSoundAtClient((String) GregTech_API.sSoundList.get(Integer.valueOf(6)), 100, 1.0F, aX, aY, aZ); - }*/ else { + } /* + * else if (aIndex == -122) { GT_Utility.doSoundAtClient((String) + * GregTech_API.sSoundList.get(Integer.valueOf(6)), 100, 1.0F, aX, aY, aZ); } + */ else { super.doSound((byte) 0, aX, aY, aZ); } } @@ -807,8 +818,7 @@ public class GregtechMetaAtmosphericReconditioner extends GT_MetaTileEntity_Basi long tVoltage = maxEUInput(); byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage)); reduction += (((Math.max((tTier - 2), 1) * 2) * 50) * mAirSides); - reduction = (MathUtils.safeInt((long) reduction * this.mBaseEff) / 100000) - * mAirSides + reduction = (MathUtils.safeInt((long) reduction * this.mBaseEff) / 100000) * mAirSides * Math.max((tTier - 2), 1); reduction = MathUtils.safeInt(((long) reduction / 100) * this.mOptimalAirFlow); @@ -857,17 +867,20 @@ public class GregtechMetaAtmosphericReconditioner extends GT_MetaTileEntity_Basi public static ItemStack getTieredTurbine(int aTier) { if (sGregTurbines == null) { sGregTurbines = new ItemStack[3]; - sGregTurbines[0] = GT_MetaGenerated_Tool.sInstances - .get("gt.metatool.01") + sGregTurbines[0] = GT_MetaGenerated_Tool.sInstances.get("gt.metatool.01") .getToolWithStats(GT_MetaGenerated_Tool_01.TURBINE_SMALL, 1, Materials.Iron, Materials.Iron, null); - sGregTurbines[1] = GT_MetaGenerated_Tool.sInstances - .get("gt.metatool.01") - .getToolWithStats( - GT_MetaGenerated_Tool_01.TURBINE_SMALL, 1, Materials.Bronze, Materials.Bronze, null); - sGregTurbines[2] = GT_MetaGenerated_Tool.sInstances - .get("gt.metatool.01") - .getToolWithStats( - GT_MetaGenerated_Tool_01.TURBINE_SMALL, 1, Materials.Steel, Materials.Steel, null); + sGregTurbines[1] = GT_MetaGenerated_Tool.sInstances.get("gt.metatool.01").getToolWithStats( + GT_MetaGenerated_Tool_01.TURBINE_SMALL, + 1, + Materials.Bronze, + Materials.Bronze, + null); + sGregTurbines[2] = GT_MetaGenerated_Tool.sInstances.get("gt.metatool.01").getToolWithStats( + GT_MetaGenerated_Tool_01.TURBINE_SMALL, + 1, + Materials.Steel, + Materials.Steel, + null); } else { return sGregTurbines[aTier]; } @@ -879,9 +892,8 @@ public class GregtechMetaAtmosphericReconditioner extends GT_MetaTileEntity_Basi if (aStackRotor.getItem() instanceof ItemBasicScrubberTurbine) { return getBaseEfficiency(getTieredTurbine(aStackRotor.getItemDamage())); } - return (int) - ((50.0F + (10.0F * ((GT_MetaGenerated_Tool) aStackRotor.getItem()).getToolCombatDamage(aStackRotor))) - * 100); + return (int) ((50.0F + + (10.0F * ((GT_MetaGenerated_Tool) aStackRotor.getItem()).getToolCombatDamage(aStackRotor))) * 100); } public int getOptimalAirFlow(ItemStack aStackRotor) { @@ -890,9 +902,7 @@ public class GregtechMetaAtmosphericReconditioner extends GT_MetaTileEntity_Basi } return (int) Math.max( Float.MIN_NORMAL, - ((GT_MetaGenerated_Tool) aStackRotor.getItem()) - .getToolStats(aStackRotor) - .getSpeedMultiplier() + ((GT_MetaGenerated_Tool) aStackRotor.getItem()).getToolStats(aStackRotor).getSpeedMultiplier() * GT_MetaGenerated_Tool.getPrimaryMaterial(aStackRotor).mToolSpeed * 50); } @@ -904,32 +914,31 @@ public class GregtechMetaAtmosphericReconditioner extends GT_MetaTileEntity_Basi @Override public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildContext) { - builder.widget(new SlotWidget(inventoryHandler, SLOT_ROTOR) - .setFilter(stack -> { - if (stack.getItem() instanceof ItemBasicScrubberTurbine) { - return true; - } - return stack.getItem() instanceof GT_MetaGenerated_Tool - && stack.getItemDamage() >= 170 - && stack.getItemDamage() <= 179; - }) - .setBackground(getGUITextureSet().getItemSlot(), GTPP_UITextures.OVERLAY_SLOT_TURBINE) - .setPos(52, 24)) - .widget(new SlotWidget(inventoryHandler, SLOT_FILTER) - .setFilter(stack -> stack.getItem() instanceof ItemAirFilter) - .setBackground(getGUITextureSet().getItemSlot(), GT_UITextures.OVERLAY_SLOT_RECYCLE) - .setPos(106, 24)) - .widget(new SlotWidget(inventoryHandler, 7) - .setFilter(stack -> GT_Utility.areStacksEqual(stack, mConveyorMap.get(mTier), true)) - .setPos(124, 62)); - builder.widget(new DrawableWidget() - .setDrawable(GT_UITextures.PICTURE_INFORMATION) - .dynamicTooltip(() -> Collections.singletonList("Reduction: " + mPollutionReduction + "/s")) - .attachSyncer( - new FakeSyncWidget.IntegerSyncer(() -> mPollutionReduction, val -> mPollutionReduction = val), - builder, - (widget, val) -> widget.notifyTooltipChange()) - .setPos(163, 5) - .setSize(7, 18)); + builder.widget(new SlotWidget(inventoryHandler, SLOT_ROTOR).setFilter(stack -> { + if (stack.getItem() instanceof ItemBasicScrubberTurbine) { + return true; + } + return stack.getItem() instanceof GT_MetaGenerated_Tool && stack.getItemDamage() >= 170 + && stack.getItemDamage() <= 179; + }).setBackground(getGUITextureSet().getItemSlot(), GTPP_UITextures.OVERLAY_SLOT_TURBINE).setPos(52, 24)) + .widget( + new SlotWidget(inventoryHandler, SLOT_FILTER) + .setFilter(stack -> stack.getItem() instanceof ItemAirFilter) + .setBackground(getGUITextureSet().getItemSlot(), GT_UITextures.OVERLAY_SLOT_RECYCLE) + .setPos(106, 24)) + .widget( + new SlotWidget(inventoryHandler, 7) + .setFilter(stack -> GT_Utility.areStacksEqual(stack, mConveyorMap.get(mTier), true)) + .setPos(124, 62)); + builder.widget( + new DrawableWidget().setDrawable(GT_UITextures.PICTURE_INFORMATION) + .dynamicTooltip(() -> Collections.singletonList("Reduction: " + mPollutionReduction + "/s")) + .attachSyncer( + new FakeSyncWidget.IntegerSyncer( + () -> mPollutionReduction, + val -> mPollutionReduction = val), + builder, + (widget, val) -> widget.notifyTooltipChange()) + .setPos(163, 5).setSize(7, 18)); } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaCondensor.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaCondensor.java index 17edfd0d4d..c69ae51436 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaCondensor.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaCondensor.java @@ -1,10 +1,15 @@ package gtPlusPlus.xmod.gregtech.common.tileentities.machines.basic; +import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.fluids.IFluidHandler; + import com.gtnewhorizons.modularui.api.screen.ModularWindow; import com.gtnewhorizons.modularui.api.screen.UIBuildContext; import com.gtnewhorizons.modularui.common.widget.DrawableWidget; import com.gtnewhorizons.modularui.common.widget.ProgressBar; import com.gtnewhorizons.modularui.common.widget.SlotWidget; + import gregtech.api.enums.Dyes; import gregtech.api.enums.Textures; import gregtech.api.gui.modularui.GT_UITextures; @@ -19,9 +24,6 @@ import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.math.MathUtils; import gtPlusPlus.xmod.gregtech.api.gui.GTPP_UITextures; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.generators.GregtechMetaBoilerBase; -import net.minecraftforge.common.util.ForgeDirection; -import net.minecraftforge.fluids.FluidStack; -import net.minecraftforge.fluids.IFluidHandler; public class GregtechMetaCondensor extends GregtechMetaBoilerBase implements IAddGregtechLogo { @@ -29,49 +31,44 @@ public class GregtechMetaCondensor extends GregtechMetaBoilerBase implements IAd super(aID, aName, aNameRegional, "A Steam condenser - [IC2->Steam]", new ITexture[0]); } - public GregtechMetaCondensor( - final String aName, final int aTier, final String aDescription, final ITexture[][][] aTextures) { + public GregtechMetaCondensor(final String aName, final int aTier, final String aDescription, + final ITexture[][][] aTextures) { super(aName, aTier, aDescription, aTextures); } @Override public String[] getDescription() { - return new String[] { - this.mDescription, - "IC2 Steam + Water = Normal Steam.", - "Requires no power to run, although it's not very fast.", - CORE.GT_Tooltip - }; + return new String[] { this.mDescription, "IC2 Steam + Water = Normal Steam.", + "Requires no power to run, although it's not very fast.", CORE.GT_Tooltip }; } @Override public ITexture[][][] getTextureSet(final ITexture[] aTextures) { final ITexture[][][] rTextures = new ITexture[5][17][]; for (byte i = -1; i < 16; i++) { - rTextures[0][(i + 1)] = new ITexture[] { - new GT_RenderedTexture( - Textures.BlockIcons.MACHINE_CASING_VENT, Dyes.getModulation(i, Dyes.MACHINE_METAL.mRGBa)) - }; + rTextures[0][(i + 1)] = new ITexture[] { new GT_RenderedTexture( + Textures.BlockIcons.MACHINE_CASING_VENT, + Dyes.getModulation(i, Dyes.MACHINE_METAL.mRGBa)) }; rTextures[1][(i + 1)] = new ITexture[] { - new GT_RenderedTexture( - Textures.BlockIcons.MACHINE_CASING_VENT, Dyes.getModulation(i, Dyes.MACHINE_METAL.mRGBa)), - new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE) - }; + new GT_RenderedTexture( + Textures.BlockIcons.MACHINE_CASING_VENT, + Dyes.getModulation(i, Dyes.MACHINE_METAL.mRGBa)), + new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE) }; rTextures[2][(i + 1)] = new ITexture[] { - new GT_RenderedTexture( - Textures.BlockIcons.MACHINE_CASING_VENT, Dyes.getModulation(i, Dyes.MACHINE_METAL.mRGBa)), - new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE) - }; + new GT_RenderedTexture( + Textures.BlockIcons.MACHINE_CASING_VENT, + Dyes.getModulation(i, Dyes.MACHINE_METAL.mRGBa)), + new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE) }; rTextures[3][(i + 1)] = new ITexture[] { - new GT_RenderedTexture( - Textures.BlockIcons.MACHINE_CASING_VENT, Dyes.getModulation(i, Dyes.MACHINE_METAL.mRGBa)), - new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_POTIONBREWER) - }; + new GT_RenderedTexture( + Textures.BlockIcons.MACHINE_CASING_VENT, + Dyes.getModulation(i, Dyes.MACHINE_METAL.mRGBa)), + new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_POTIONBREWER) }; rTextures[4][(i + 1)] = new ITexture[] { - new GT_RenderedTexture( - Textures.BlockIcons.MACHINE_CASING_VENT, Dyes.getModulation(i, Dyes.MACHINE_METAL.mRGBa)), - new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_POTIONBREWER_ACTIVE) - }; + new GT_RenderedTexture( + Textures.BlockIcons.MACHINE_CASING_VENT, + Dyes.getModulation(i, Dyes.MACHINE_METAL.mRGBa)), + new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_POTIONBREWER_ACTIVE) }; } return rTextures; } @@ -102,16 +99,16 @@ public class GregtechMetaCondensor extends GregtechMetaBoilerBase implements IAd if (i != aBaseMetaTileEntity.getFrontFacing()) { final IFluidHandler tTileEntity = aBaseMetaTileEntity.getITankContainerAtSide(i); if (tTileEntity != null) { - final FluidStack tDrained = aBaseMetaTileEntity.drain( - ForgeDirection.getOrientation(i), Math.max(1, this.mSteam.amount / 2), false); + final FluidStack tDrained = aBaseMetaTileEntity + .drain(ForgeDirection.getOrientation(i), Math.max(1, this.mSteam.amount / 2), false); if (tDrained != null) { - final int tFilledAmount = tTileEntity.fill( - ForgeDirection.getOrientation(i).getOpposite(), tDrained, false); + final int tFilledAmount = tTileEntity + .fill(ForgeDirection.getOrientation(i).getOpposite(), tDrained, false); if (tFilledAmount > 0) { tTileEntity.fill( ForgeDirection.getOrientation(i).getOpposite(), - aBaseMetaTileEntity.drain( - ForgeDirection.getOrientation(i), tFilledAmount, true), + aBaseMetaTileEntity + .drain(ForgeDirection.getOrientation(i), tFilledAmount, true), true); } } @@ -144,13 +141,13 @@ public class GregtechMetaCondensor extends GregtechMetaBoilerBase implements IAd this.sendSound((byte) 1); this.mSteam.amount = getSteamCapacity() * 3 / 4; } - /*if ((this.mProcessingEnergy <= 0) && (aBaseMetaTileEntity.isAllowedToWork()) && - (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], OrePrefixes.bucket.get(IC2.getItemFromBlock(p_150898_0_))))) - { - this.mProcessingEnergy += 1000; - aBaseMetaTileEntity.decrStackSize(2, 1); - aBaseMetaTileEntity.addStackToSlot(3, GT_OreDictUnificator.get(OrePrefixes.bucket, Materials.Empty, 1L)); - }*/ + /* + * if ((this.mProcessingEnergy <= 0) && (aBaseMetaTileEntity.isAllowedToWork()) && + * (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[2], + * OrePrefixes.bucket.get(IC2.getItemFromBlock(p_150898_0_))))) { this.mProcessingEnergy += 1000; + * aBaseMetaTileEntity.decrStackSize(2, 1); aBaseMetaTileEntity.addStackToSlot(3, + * GT_OreDictUnificator.get(OrePrefixes.bucket, Materials.Empty, 1L)); } + */ if ((this.mTemperature < 1000) && (this.mProcessingEnergy > 0) && ((aTick % this.RI) == 0L)) { this.mProcessingEnergy -= 40; this.mTemperature += 2; @@ -181,49 +178,49 @@ public class GregtechMetaCondensor extends GregtechMetaBoilerBase implements IAd @Override public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildContext) { - builder.widget(new SlotWidget(inventoryHandler, 0) - .setPos(43, 25) + builder.widget( + new SlotWidget(inventoryHandler, 0).setPos(43, 25) .setBackground(getGUITextureSet().getItemSlot(), GT_UITextures.OVERLAY_SLOT_IN)) - .widget(new SlotWidget(inventoryHandler, 1) - .setPos(43, 61) - .setBackground(getGUITextureSet().getItemSlot(), GT_UITextures.OVERLAY_SLOT_OUT)) - .widget(new SlotWidget(inventoryHandler, 2) - .setPos(115, 61) - .setBackground(getGUITextureSet().getItemSlot(), GTPP_UITextures.OVERLAY_SLOT_COAL)) - .widget(new SlotWidget(inventoryHandler, 3) - .setPos(115, 25) - .setBackground(getGUITextureSet().getItemSlot(), GT_UITextures.OVERLAY_SLOT_DUST)) - .widget(new ProgressBar() - .setProgress(() -> mSteam == null ? 0 : (float) mSteam.amount / getCapacity()) - .setTexture( - GTPP_UITextures.PROGRESSBAR_BOILER_EMPTY, GT_UITextures.PROGRESSBAR_BOILER_STEAM, 10) - .setDirection(ProgressBar.Direction.UP) - .setPos(70, 25) - .setSize(10, 54)) - .widget(new ProgressBar() - .setProgress(() -> mFluid == null ? 0 : (float) mFluid.amount / getCapacity()) - .setTexture( - GTPP_UITextures.PROGRESSBAR_BOILER_EMPTY, GT_UITextures.PROGRESSBAR_BOILER_WATER, 10) - .setDirection(ProgressBar.Direction.UP) - .setPos(83, 25) - .setSize(10, 54)) - .widget(new ProgressBar() - .setProgress(() -> (float) mTemperature / maxProgresstime()) - .setTexture(GTPP_UITextures.PROGRESSBAR_BOILER_EMPTY, GT_UITextures.PROGRESSBAR_BOILER_HEAT, 10) - .setDirection(ProgressBar.Direction.UP) - .setPos(96, 25) - .setSize(10, 54)) - .widget(new ProgressBar() - // cap minimum so that one can easily see there's fuel remaining - .setProgress( - () -> mProcessingEnergy > 0 ? Math.max((float) mProcessingEnergy / 1000, 1f / 5) : 0) - .setTexture(GTPP_UITextures.PROGRESSBAR_FUEL, 14) - .setDirection(ProgressBar.Direction.UP) - .setPos(116, 45) - .setSize(14, 14)) - .widget(new DrawableWidget() - .setDrawable(GTPP_UITextures.OVERLAY_SLOT_CANISTER_DARK) - .setPos(43, 43) - .setSize(18, 18)); + .widget( + new SlotWidget(inventoryHandler, 1).setPos(43, 61) + .setBackground(getGUITextureSet().getItemSlot(), GT_UITextures.OVERLAY_SLOT_OUT)) + .widget( + new SlotWidget(inventoryHandler, 2).setPos(115, 61) + .setBackground(getGUITextureSet().getItemSlot(), GTPP_UITextures.OVERLAY_SLOT_COAL)) + .widget( + new SlotWidget(inventoryHandler, 3).setPos(115, 25) + .setBackground(getGUITextureSet().getItemSlot(), GT_UITextures.OVERLAY_SLOT_DUST)) + .widget( + new ProgressBar().setProgress(() -> mSteam == null ? 0 : (float) mSteam.amount / getCapacity()) + .setTexture( + GTPP_UITextures.PROGRESSBAR_BOILER_EMPTY, + GT_UITextures.PROGRESSBAR_BOILER_STEAM, + 10) + .setDirection(ProgressBar.Direction.UP).setPos(70, 25).setSize(10, 54)) + .widget( + new ProgressBar().setProgress(() -> mFluid == null ? 0 : (float) mFluid.amount / getCapacity()) + .setTexture( + GTPP_UITextures.PROGRESSBAR_BOILER_EMPTY, + GT_UITextures.PROGRESSBAR_BOILER_WATER, + 10) + .setDirection(ProgressBar.Direction.UP).setPos(83, 25).setSize(10, 54)) + .widget( + new ProgressBar().setProgress(() -> (float) mTemperature / maxProgresstime()) + .setTexture( + GTPP_UITextures.PROGRESSBAR_BOILER_EMPTY, + GT_UITextures.PROGRESSBAR_BOILER_HEAT, + 10) + .setDirection(ProgressBar.Direction.UP).setPos(96, 25).setSize(10, 54)) + .widget( + new ProgressBar() + // cap minimum so that one can easily see there's fuel remaining + .setProgress( + () -> mProcessingEnergy > 0 ? Math.max((float) mProcessingEnergy / 1000, 1f / 5) + : 0) + .setTexture(GTPP_UITextures.PROGRESSBAR_FUEL, 14).setDirection(ProgressBar.Direction.UP) + .setPos(116, 45).setSize(14, 14)) + .widget( + new DrawableWidget().setDrawable(GTPP_UITextures.OVERLAY_SLOT_CANISTER_DARK).setPos(43, 43) + .setSize(18, 18)); } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaGarbageCollector.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaGarbageCollector.java index f1e0cc7161..ec20c9c088 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaGarbageCollector.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaGarbageCollector.java @@ -1,5 +1,10 @@ package gtPlusPlus.xmod.gregtech.common.tileentities.machines.basic; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.world.World; + import gregtech.api.enums.Textures; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; @@ -11,10 +16,6 @@ import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.minecraft.PlayerUtils; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMetaTileEntity; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.world.World; public class GregtechMetaGarbageCollector extends GregtechMetaTileEntity { @@ -32,14 +33,9 @@ public class GregtechMetaGarbageCollector extends GregtechMetaTileEntity { @Override public String[] getDescription() { - return new String[] { - this.mDescription, - "Can request the JVM to perform garbage collection", - "Configurable to run once every 5 minute interval (5-180)", - "This Machine has no recipe", - "Admin Tool, Limit one per world if possible", - CORE.GT_Tooltip - }; + return new String[] { this.mDescription, "Can request the JVM to perform garbage collection", + "Configurable to run once every 5 minute interval (5-180)", "This Machine has no recipe", + "Admin Tool, Limit one per world if possible", CORE.GT_Tooltip }; } @Override @@ -61,91 +57,61 @@ public class GregtechMetaGarbageCollector extends GregtechMetaTileEntity { } @Override - public ITexture[] getTexture( - final IGregTechTileEntity aBaseMetaTileEntity, - final byte aSide, - final byte aFacing, - final byte aColorIndex, - final boolean aActive, - final boolean aRedstone) { - return this.mTextures[ - (aActive ? 5 : 0) - + (aSide == aFacing - ? 0 - : aSide == GT_Utility.getOppositeSide(aFacing) - ? 1 - : aSide == 0 ? 2 : aSide == 1 ? 3 : 4)][ - aColorIndex + 1]; + public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing, + final byte aColorIndex, final boolean aActive, final boolean aRedstone) { + return this.mTextures[(aActive ? 5 : 0) + (aSide == aFacing ? 0 + : aSide == GT_Utility.getOppositeSide(aFacing) ? 1 : aSide == 0 ? 2 : aSide == 1 ? 3 : 4)][aColorIndex + + 1]; } public ITexture[] getFront(final byte aColor) { - return new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[this.mTier + 3][aColor + 1], - new GT_RenderedTexture(TexturesGtBlock.Casing_Material_RedSteel) - }; + return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier + 3][aColor + 1], + new GT_RenderedTexture(TexturesGtBlock.Casing_Material_RedSteel) }; } public ITexture[] getBack(final byte aColor) { - return new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[this.mTier + 3][aColor + 1], - new GT_RenderedTexture(TexturesGtBlock.Casing_Material_RedSteel) - }; + return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier + 3][aColor + 1], + new GT_RenderedTexture(TexturesGtBlock.Casing_Material_RedSteel) }; } public ITexture[] getBottom(final byte aColor) { - return new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[this.mTier + 3][aColor + 1], - new GT_RenderedTexture(TexturesGtBlock.Casing_Material_Grisium) - }; + return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier + 3][aColor + 1], + new GT_RenderedTexture(TexturesGtBlock.Casing_Material_Grisium) }; } public ITexture[] getTop(final byte aColor) { - return new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[this.mTier + 3][aColor + 1], - new GT_RenderedTexture(TexturesGtBlock.Casing_Material_Grisium) - }; + return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier + 3][aColor + 1], + new GT_RenderedTexture(TexturesGtBlock.Casing_Material_Grisium) }; } public ITexture[] getSides(final byte aColor) { - return new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[this.mTier + 3][aColor + 1], - new GT_RenderedTexture(TexturesGtBlock.Casing_Redox_3) - }; + return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier + 3][aColor + 1], + new GT_RenderedTexture(TexturesGtBlock.Casing_Redox_3) }; } public ITexture[] getFrontActive(final byte aColor) { - return new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[this.mTier + 3][aColor + 1], - new GT_RenderedTexture(TexturesGtBlock.Casing_Material_RedSteel) - }; + return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier + 3][aColor + 1], + new GT_RenderedTexture(TexturesGtBlock.Casing_Material_RedSteel) }; } public ITexture[] getBackActive(final byte aColor) { - return new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[this.mTier + 3][aColor + 1], - new GT_RenderedTexture(TexturesGtBlock.Casing_Material_RedSteel) - }; + return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier + 3][aColor + 1], + new GT_RenderedTexture(TexturesGtBlock.Casing_Material_RedSteel) }; } public ITexture[] getBottomActive(final byte aColor) { - return new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[this.mTier + 3][aColor + 1], - new GT_RenderedTexture(TexturesGtBlock.Casing_Material_Grisium) - }; + return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier + 3][aColor + 1], + new GT_RenderedTexture(TexturesGtBlock.Casing_Material_Grisium) }; } public ITexture[] getTopActive(final byte aColor) { - return new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[this.mTier + 3][aColor + 1], - new GT_RenderedTexture(TexturesGtBlock.Casing_Material_Grisium) - }; + return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier + 3][aColor + 1], + new GT_RenderedTexture(TexturesGtBlock.Casing_Material_Grisium) }; } public ITexture[] getSidesActive(final byte aColor) { - return new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[this.mTier + 3][aColor + 1], - new GT_RenderedTexture(TexturesGtBlock.Casing_Redox_3) - }; + return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier + 3][aColor + 1], + new GT_RenderedTexture(TexturesGtBlock.Casing_Redox_3) }; } @Override @@ -291,27 +257,26 @@ public class GregtechMetaGarbageCollector extends GregtechMetaTileEntity { private void showPollution(final World worldIn, final EntityPlayer playerIn) { PlayerUtils.messagePlayer( playerIn, - "Running every " + mFrequency + " minutes. Owner: " - + this.getBaseMetaTileEntity().getOwnerName()); + "Running every " + mFrequency + " minutes. Owner: " + this.getBaseMetaTileEntity().getOwnerName()); long aDiff = mLocalTickVar - this.mLastCleanup; PlayerUtils.messagePlayer(playerIn, "Last run: " + Utils.getSecondsFromMillis(aDiff) + " seconds ago."); } @Override - public boolean allowPullStack( - final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, final ItemStack aStack) { + public boolean allowPullStack(final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, + final ItemStack aStack) { return false; } @Override - public boolean allowPutStack( - final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, final ItemStack aStack) { + public boolean allowPutStack(final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, + final ItemStack aStack) { return false; } @Override public String[] getInfoData() { - return new String[] {this.getLocalName()}; + return new String[] { this.getLocalName() }; } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaPollutionCreator.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaPollutionCreator.java index ce04d50fab..cde8d8ca4b 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaPollutionCreator.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaPollutionCreator.java @@ -1,5 +1,10 @@ package gtPlusPlus.xmod.gregtech.common.tileentities.machines.basic; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.world.World; + import gregtech.api.enums.Textures; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; @@ -11,10 +16,6 @@ import gtPlusPlus.core.util.minecraft.PlayerUtils; import gtPlusPlus.core.util.minecraft.gregtech.PollutionUtils; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMetaTileEntity; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.world.World; public class GregtechMetaPollutionCreator extends GregtechMetaTileEntity { @@ -25,28 +26,19 @@ public class GregtechMetaPollutionCreator extends GregtechMetaTileEntity { private int mTickTimer = 0; private int mSecondTimer = 0; - public GregtechMetaPollutionCreator( - final int aID, - final String aName, - final String aNameRegional, - final int aTier, - final String aDescription, - final int aSlotCount) { + public GregtechMetaPollutionCreator(final int aID, final String aName, final String aNameRegional, final int aTier, + final String aDescription, final int aSlotCount) { super(aID, aName, aNameRegional, aTier, aSlotCount, aDescription); } - public GregtechMetaPollutionCreator( - final String aName, - final int aTier, - final String aDescription, - final ITexture[][][] aTextures, - final int aSlotCount) { + public GregtechMetaPollutionCreator(final String aName, final int aTier, final String aDescription, + final ITexture[][][] aTextures, final int aSlotCount) { super(aName, aTier, aSlotCount, aDescription, aTextures); } @Override public String[] getDescription() { - return new String[] {this.mDescription, "A useful debug machine to create pollution.", CORE.GT_Tooltip}; + return new String[] { this.mDescription, "A useful debug machine to create pollution.", CORE.GT_Tooltip }; } @Override @@ -68,91 +60,61 @@ public class GregtechMetaPollutionCreator extends GregtechMetaTileEntity { } @Override - public ITexture[] getTexture( - final IGregTechTileEntity aBaseMetaTileEntity, - final byte aSide, - final byte aFacing, - final byte aColorIndex, - final boolean aActive, - final boolean aRedstone) { - return this.mTextures[ - (aActive ? 5 : 0) - + (aSide == aFacing - ? 0 - : aSide == GT_Utility.getOppositeSide(aFacing) - ? 1 - : aSide == 0 ? 2 : aSide == 1 ? 3 : 4)][ - aColorIndex + 1]; + public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing, + final byte aColorIndex, final boolean aActive, final boolean aRedstone) { + return this.mTextures[(aActive ? 5 : 0) + (aSide == aFacing ? 0 + : aSide == GT_Utility.getOppositeSide(aFacing) ? 1 : aSide == 0 ? 2 : aSide == 1 ? 3 : 4)][aColorIndex + + 1]; } public ITexture[] getFront(final byte aColor) { - return new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[this.mTier + 3][aColor + 1], - new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Screen_2) - }; + return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier + 3][aColor + 1], + new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Screen_2) }; } public ITexture[] getBack(final byte aColor) { - return new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[this.mTier + 3][aColor + 1], - new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom) - }; + return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier + 3][aColor + 1], + new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom) }; } public ITexture[] getBottom(final byte aColor) { - return new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[this.mTier + 3][aColor + 1], - new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom) - }; + return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier + 3][aColor + 1], + new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom) }; } public ITexture[] getTop(final byte aColor) { - return new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[this.mTier + 3][aColor + 1], - new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom) - }; + return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier + 3][aColor + 1], + new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom) }; } public ITexture[] getSides(final byte aColor) { - return new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[this.mTier + 3][aColor + 1], - new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom) - }; + return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier + 3][aColor + 1], + new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom) }; } public ITexture[] getFrontActive(final byte aColor) { - return new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[this.mTier + 3][aColor + 1], - new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Screen_2) - }; + return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier + 3][aColor + 1], + new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Screen_2) }; } public ITexture[] getBackActive(final byte aColor) { - return new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[this.mTier + 3][aColor + 1], - new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom) - }; + return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier + 3][aColor + 1], + new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom) }; } public ITexture[] getBottomActive(final byte aColor) { - return new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[this.mTier + 3][aColor + 1], - new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom) - }; + return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier + 3][aColor + 1], + new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom) }; } public ITexture[] getTopActive(final byte aColor) { - return new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[this.mTier + 3][aColor + 1], - new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom) - }; + return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier + 3][aColor + 1], + new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom) }; } public ITexture[] getSidesActive(final byte aColor) { - return new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[this.mTier + 3][aColor + 1], - new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom) - }; + return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier + 3][aColor + 1], + new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom) }; } @Override @@ -169,7 +131,11 @@ public class GregtechMetaPollutionCreator extends GregtechMetaTileEntity { @Override public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) { return new GregtechMetaPollutionCreator( - this.mName, this.mTier, this.mDescription, this.mTextures, this.mInventory.length); + this.mName, + this.mTier, + this.mDescription, + this.mTextures, + this.mInventory.length); } @Override @@ -303,8 +269,8 @@ public class GregtechMetaPollutionCreator extends GregtechMetaTileEntity { PlayerUtils.messagePlayer(playerIn, "This block is useless, Pollution is disabled."); } else { addPollution(); - PlayerUtils.messagePlayer( - playerIn, "This chunk now contains " + getCurrentChunkPollution() + " pollution."); + PlayerUtils + .messagePlayer(playerIn, "This chunk now contains " + getCurrentChunkPollution() + " pollution."); // PlayerUtils.messagePlayer(playerIn, "Average over last ten minutes: "+getAveragePollutionOverLastTen()+" // pollution."); } @@ -316,14 +282,14 @@ public class GregtechMetaPollutionCreator extends GregtechMetaTileEntity { } @Override - public boolean allowPullStack( - final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, final ItemStack aStack) { + public boolean allowPullStack(final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, + final ItemStack aStack) { return false; } @Override - public boolean allowPutStack( - final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, final ItemStack aStack) { + public boolean allowPutStack(final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, + final ItemStack aStack) { return false; } @@ -337,11 +303,8 @@ public class GregtechMetaPollutionCreator extends GregtechMetaTileEntity { @Override public String[] getInfoData() { - return new String[] { - this.getLocalName(), - "Current Pollution: " + this.mCurrentPollution, - "Average/10 minutes:" + getAveragePollutionOverLastTen() - }; + return new String[] { this.getLocalName(), "Current Pollution: " + this.mCurrentPollution, + "Average/10 minutes:" + getAveragePollutionOverLastTen() }; } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaPollutionDetector.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaPollutionDetector.java index 9ba3db911a..32e45dde15 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaPollutionDetector.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaPollutionDetector.java @@ -1,5 +1,10 @@ package gtPlusPlus.xmod.gregtech.common.tileentities.machines.basic; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.world.World; + import gregtech.api.enums.Textures; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; @@ -12,10 +17,6 @@ import gtPlusPlus.core.util.minecraft.PlayerUtils; import gtPlusPlus.core.util.minecraft.gregtech.PollutionUtils; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMetaTileEntity; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.world.World; public class GregtechMetaPollutionDetector extends GregtechMetaTileEntity { @@ -27,53 +28,30 @@ public class GregtechMetaPollutionDetector extends GregtechMetaTileEntity { private int mSecondTimer = 0; private long mRedstoneLevel = 0; - public GregtechMetaPollutionDetector( - final int aID, - final String aName, - final String aNameRegional, - final int aTier, - final String aDescription, - final int aSlotCount) { + public GregtechMetaPollutionDetector(final int aID, final String aName, final String aNameRegional, final int aTier, + final String aDescription, final int aSlotCount) { super(aID, aName, aNameRegional, aTier, aSlotCount, aDescription); } - public GregtechMetaPollutionDetector( - final String aName, - final int aTier, - final String aDescription, - final ITexture[][][] aTextures, - final int aSlotCount) { + public GregtechMetaPollutionDetector(final String aName, final int aTier, final String aDescription, + final ITexture[][][] aTextures, final int aSlotCount) { super(aName, aTier, aSlotCount, aDescription, aTextures); } @Override public String[] getDescription() { - return new String[] { - this.mDescription, - "Right click to check pollution levels.", - "Configure with screwdriver to set redstone output amount.", - "Does not use power.", - CORE.GT_Tooltip - }; - } - - @Override - public ITexture[] getTexture( - final IGregTechTileEntity aBaseMetaTileEntity, - final byte aSide, - final byte aFacing, - final byte aColorIndex, - final boolean aActive, - final boolean aRedstone) { + return new String[] { this.mDescription, "Right click to check pollution levels.", + "Configure with screwdriver to set redstone output amount.", "Does not use power.", CORE.GT_Tooltip }; + } + + @Override + public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing, + final byte aColorIndex, final boolean aActive, final boolean aRedstone) { return aSide == aFacing - ? new ITexture[] { - new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Dimensional), - new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Screen_Frequency) - } - : new ITexture[] { - new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Dimensional), - new GT_RenderedTexture(Textures.BlockIcons.VOID) - }; + ? new ITexture[] { new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Dimensional), + new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Screen_Frequency) } + : new ITexture[] { new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Dimensional), + new GT_RenderedTexture(Textures.BlockIcons.VOID) }; } @Override @@ -94,85 +72,71 @@ public class GregtechMetaPollutionDetector extends GregtechMetaTileEntity { return rTextures; } - /*@Override - public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing, final byte aColorIndex, final boolean aActive, final boolean aRedstone) { - return this.mTextures[(aActive ? 5 : 0) + (aSide == aFacing ? 0 : aSide == GT_Utility.getOppositeSide(aFacing) ? 1 : aSide == 0 ? 2 : aSide == 1 ? 3 : 4)][aColorIndex + 1]; - }*/ + /* + * @Override public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final + * byte aFacing, final byte aColorIndex, final boolean aActive, final boolean aRedstone) { return + * this.mTextures[(aActive ? 5 : 0) + (aSide == aFacing ? 0 : aSide == GT_Utility.getOppositeSide(aFacing) ? 1 : + * aSide == 0 ? 2 : aSide == 1 ? 3 : 4)][aColorIndex + 1]; } + */ public ITexture[] getFront(final byte aColor) { - return new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], - new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Screen_2) - }; + return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], + new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Screen_2) }; } public ITexture[] getBack(final byte aColor) { - return new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], - new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom) - }; + return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], + new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom) }; } public ITexture[] getBottom(final byte aColor) { - return new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], - new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom) - }; + return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], + new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom) }; } public ITexture[] getTop(final byte aColor) { - return new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], - new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom) - }; + return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], + new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom) }; } public ITexture[] getSides(final byte aColor) { - return new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], - new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom) - }; + return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], + new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom) }; } public ITexture[] getFrontActive(final byte aColor) { - return new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], - new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Screen_2) - }; + return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], + new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Screen_2) }; } public ITexture[] getBackActive(final byte aColor) { - return new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], - new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom) - }; + return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], + new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom) }; } public ITexture[] getBottomActive(final byte aColor) { - return new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], - new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom) - }; + return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], + new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom) }; } public ITexture[] getTopActive(final byte aColor) { - return new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], - new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom) - }; + return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], + new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom) }; } public ITexture[] getSidesActive(final byte aColor) { - return new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], - new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom) - }; + return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], + new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom) }; } @Override public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) { return new GregtechMetaPollutionDetector( - this.mName, this.mTier, this.mDescription, this.mTextures, this.mInventory.length); + this.mName, + this.mTier, + this.mDescription, + this.mTextures, + this.mInventory.length); } @Override @@ -309,14 +273,14 @@ public class GregtechMetaPollutionDetector extends GregtechMetaTileEntity { } @Override - public boolean allowPullStack( - final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, final ItemStack aStack) { + public boolean allowPullStack(final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, + final ItemStack aStack) { return false; } @Override - public boolean allowPutStack( - final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, final ItemStack aStack) { + public boolean allowPutStack(final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, + final ItemStack aStack) { return false; } @@ -330,12 +294,9 @@ public class GregtechMetaPollutionDetector extends GregtechMetaTileEntity { @Override public String[] getInfoData() { - return new String[] { - this.getLocalName(), - "Current Pollution: " + this.mCurrentPollution, - "Average/10 Sec: " + this.mAveragePollution, - "Emit Redstone at pollution level: " + this.mRedstoneLevel - }; + return new String[] { this.getLocalName(), "Current Pollution: " + this.mCurrentPollution, + "Average/10 Sec: " + this.mAveragePollution, + "Emit Redstone at pollution level: " + this.mRedstoneLevel }; } @Override @@ -521,8 +482,8 @@ public class GregtechMetaPollutionDetector extends GregtechMetaTileEntity { } @Override - public boolean onRightclick( - IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer, byte aSide, float aX, float aY, float aZ) { + public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer, byte aSide, float aX, + float aY, float aZ) { return super.onRightclick(aBaseMetaTileEntity, aPlayer, aSide, aX, aY, aZ); } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntityChunkLoader.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntityChunkLoader.java index 4e851b3d6a..92eebb96e7 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntityChunkLoader.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntityChunkLoader.java @@ -3,7 +3,20 @@ package gtPlusPlus.xmod.gregtech.common.tileentities.machines.basic; import static gregtech.api.enums.GT_Values.V; import static net.minecraftforge.common.ForgeChunkManager.getMaxChunkDepthFor; +import java.util.HashSet; +import java.util.Map; +import java.util.Set; +import java.util.UUID; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.world.ChunkCoordIntPair; +import net.minecraftforge.common.ForgeChunkManager; +import net.minecraftforge.common.ForgeChunkManager.Ticket; + import com.google.common.collect.MapMaker; + import gregtech.api.enums.GT_Values; import gregtech.api.enums.Textures; import gregtech.api.interfaces.ITexture; @@ -16,16 +29,6 @@ import gtPlusPlus.GTplusplus; import gtPlusPlus.core.chunkloading.GTPP_ChunkManager; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; -import java.util.HashSet; -import java.util.Map; -import java.util.Set; -import java.util.UUID; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.world.ChunkCoordIntPair; -import net.minecraftforge.common.ForgeChunkManager; -import net.minecraftforge.common.ForgeChunkManager.Ticket; public class GregtechMetaTileEntityChunkLoader extends GT_MetaTileEntity_BasicMachine { @@ -44,8 +47,8 @@ public class GregtechMetaTileEntityChunkLoader extends GT_MetaTileEntity_BasicMa new ITexture[] {}); } - public GregtechMetaTileEntityChunkLoader( - String aName, int aTier, String aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName) { + public GregtechMetaTileEntityChunkLoader(String aName, int aTier, String aDescription, ITexture[][][] aTextures, + String aGUIName, String aNEIName) { super(aName, aTier, 4, aDescription, aTextures, 0, 0, aGUIName, aNEIName); } @@ -84,12 +87,8 @@ public class GregtechMetaTileEntityChunkLoader extends GT_MetaTileEntity_BasicMa @Override public String[] getDescription() { - return new String[] { - "Loads " + getMaxChunksToLoadForTier(this.mTier) + " chunks when powered", - "Consumes 2A", - "Behaves Identically to a Railcraft World Anchor", - CORE.GT_Tooltip - }; + return new String[] { "Loads " + getMaxChunksToLoadForTier(this.mTier) + " chunks when powered", "Consumes 2A", + "Behaves Identically to a Railcraft World Anchor", CORE.GT_Tooltip }; } @Override @@ -111,101 +110,71 @@ public class GregtechMetaTileEntityChunkLoader extends GT_MetaTileEntity_BasicMa } @Override - public ITexture[] getTexture( - final IGregTechTileEntity aBaseMetaTileEntity, - final byte aSide, - final byte aFacing, - final byte aColorIndex, - final boolean aActive, - final boolean aRedstone) { - return this.mTextures[ - (aActive ? 5 : 0) - + (aSide == aFacing - ? 0 - : aSide == GT_Utility.getOppositeSide(aFacing) - ? 1 - : aSide == 0 ? 2 : aSide == 1 ? 3 : 4)][ - aColorIndex + 1]; + public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing, + final byte aColorIndex, final boolean aActive, final boolean aRedstone) { + return this.mTextures[(aActive ? 5 : 0) + (aSide == aFacing ? 0 + : aSide == GT_Utility.getOppositeSide(aFacing) ? 1 : aSide == 0 ? 2 : aSide == 1 ? 3 : 4)][aColorIndex + + 1]; } public ITexture[] getFront(final byte aColor) { - return new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], - new GT_RenderedTexture(TexturesGtBlock.Casing_Material_MaragingSteel), - new GT_RenderedTexture(TexturesGtBlock.TIERED_MACHINE_HULLS[mTier]) - }; + return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], + new GT_RenderedTexture(TexturesGtBlock.Casing_Material_MaragingSteel), + new GT_RenderedTexture(TexturesGtBlock.TIERED_MACHINE_HULLS[mTier]) }; } public ITexture[] getBack(final byte aColor) { - return new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], - new GT_RenderedTexture(TexturesGtBlock.Casing_Material_MaragingSteel), - new GT_RenderedTexture(TexturesGtBlock.TIERED_MACHINE_HULLS[mTier]) - }; + return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], + new GT_RenderedTexture(TexturesGtBlock.Casing_Material_MaragingSteel), + new GT_RenderedTexture(TexturesGtBlock.TIERED_MACHINE_HULLS[mTier]) }; } public ITexture[] getBottom(final byte aColor) { - return new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], - new GT_RenderedTexture(TexturesGtBlock.Casing_Material_MaragingSteel), - new GT_RenderedTexture(TexturesGtBlock.TIERED_MACHINE_HULLS[mTier]) - }; + return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], + new GT_RenderedTexture(TexturesGtBlock.Casing_Material_MaragingSteel), + new GT_RenderedTexture(TexturesGtBlock.TIERED_MACHINE_HULLS[mTier]) }; } public ITexture[] getTop(final byte aColor) { - return new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], - new GT_RenderedTexture(TexturesGtBlock.Casing_Material_MaragingSteel), - new GT_RenderedTexture(TexturesGtBlock.TIERED_MACHINE_HULLS[mTier]) - }; + return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], + new GT_RenderedTexture(TexturesGtBlock.Casing_Material_MaragingSteel), + new GT_RenderedTexture(TexturesGtBlock.TIERED_MACHINE_HULLS[mTier]) }; } public ITexture[] getSides(final byte aColor) { - return new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], - new GT_RenderedTexture(TexturesGtBlock.Casing_Material_MaragingSteel), - new GT_RenderedTexture(TexturesGtBlock.TIERED_MACHINE_HULLS[mTier]) - }; + return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], + new GT_RenderedTexture(TexturesGtBlock.Casing_Material_MaragingSteel), + new GT_RenderedTexture(TexturesGtBlock.TIERED_MACHINE_HULLS[mTier]) }; } public ITexture[] getFrontActive(final byte aColor) { - return new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], - new GT_RenderedTexture(TexturesGtBlock.Casing_Material_MaragingSteel), - new GT_RenderedTexture(TexturesGtBlock.TIERED_MACHINE_HULLS[mTier + 1]) - }; + return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], + new GT_RenderedTexture(TexturesGtBlock.Casing_Material_MaragingSteel), + new GT_RenderedTexture(TexturesGtBlock.TIERED_MACHINE_HULLS[mTier + 1]) }; } public ITexture[] getBackActive(final byte aColor) { - return new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], - new GT_RenderedTexture(TexturesGtBlock.Casing_Material_MaragingSteel), - new GT_RenderedTexture(TexturesGtBlock.TIERED_MACHINE_HULLS[mTier + 1]) - }; + return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], + new GT_RenderedTexture(TexturesGtBlock.Casing_Material_MaragingSteel), + new GT_RenderedTexture(TexturesGtBlock.TIERED_MACHINE_HULLS[mTier + 1]) }; } public ITexture[] getBottomActive(final byte aColor) { - return new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], - new GT_RenderedTexture(TexturesGtBlock.Casing_Material_MaragingSteel), - new GT_RenderedTexture(TexturesGtBlock.TIERED_MACHINE_HULLS[mTier + 1]) - }; + return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], + new GT_RenderedTexture(TexturesGtBlock.Casing_Material_MaragingSteel), + new GT_RenderedTexture(TexturesGtBlock.TIERED_MACHINE_HULLS[mTier + 1]) }; } public ITexture[] getTopActive(final byte aColor) { - return new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], - new GT_RenderedTexture(TexturesGtBlock.Casing_Material_MaragingSteel), - new GT_RenderedTexture(TexturesGtBlock.TIERED_MACHINE_HULLS[mTier + 1]) - }; + return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], + new GT_RenderedTexture(TexturesGtBlock.Casing_Material_MaragingSteel), + new GT_RenderedTexture(TexturesGtBlock.TIERED_MACHINE_HULLS[mTier + 1]) }; } public ITexture[] getSidesActive(final byte aColor) { - return new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], - new GT_RenderedTexture(TexturesGtBlock.Casing_Material_MaragingSteel), - new GT_RenderedTexture(TexturesGtBlock.TIERED_MACHINE_HULLS[mTier + 1]) - }; + return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], + new GT_RenderedTexture(TexturesGtBlock.Casing_Material_MaragingSteel), + new GT_RenderedTexture(TexturesGtBlock.TIERED_MACHINE_HULLS[mTier + 1]) }; } @Override @@ -216,18 +185,23 @@ public class GregtechMetaTileEntityChunkLoader extends GT_MetaTileEntity_BasicMa @Override public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) { return new GregtechMetaTileEntityChunkLoader( - this.mName, this.mTier, this.mDescription, this.mTextures, this.mGUIName, this.mNEIName); + this.mName, + this.mTier, + this.mDescription, + this.mTextures, + this.mGUIName, + this.mNEIName); } @Override - public boolean allowPullStack( - final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, final ItemStack aStack) { + public boolean allowPullStack(final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, + final ItemStack aStack) { return false; } @Override - public boolean allowPutStack( - final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, final ItemStack aStack) { + public boolean allowPutStack(final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, + final ItemStack aStack) { return false; } @@ -266,8 +240,7 @@ public class GregtechMetaTileEntityChunkLoader extends GT_MetaTileEntity_BasicMa super.onPostTick(aBaseMetaTileEntity, aTick); if (aBaseMetaTileEntity.isServerSide()) { - if (aBaseMetaTileEntity.getXCoord() != prevX - || aBaseMetaTileEntity.getYCoord() != prevY + if (aBaseMetaTileEntity.getXCoord() != prevX || aBaseMetaTileEntity.getYCoord() != prevY || aBaseMetaTileEntity.getZCoord() != prevZ) { releaseTicket(); prevX = aBaseMetaTileEntity.getXCoord(); @@ -275,10 +248,8 @@ public class GregtechMetaTileEntityChunkLoader extends GT_MetaTileEntity_BasicMa prevZ = aBaseMetaTileEntity.getZCoord(); } - if (hasActiveTicket() - && (getTicket().world != aBaseMetaTileEntity.getWorld() - || refreshTicket - || !aBaseMetaTileEntity.isAllowedToWork())) { + if (hasActiveTicket() && (getTicket().world != aBaseMetaTileEntity.getWorld() || refreshTicket + || !aBaseMetaTileEntity.isAllowedToWork())) { releaseTicket(); } @@ -409,8 +380,8 @@ public class GregtechMetaTileEntityChunkLoader extends GT_MetaTileEntity_BasicMa } protected Ticket getTicketFromForge() { - return ForgeChunkManager.requestTicket( - GTplusplus.instance, getBaseMetaTileEntity().getWorld(), ForgeChunkManager.Type.NORMAL); + return ForgeChunkManager + .requestTicket(GTplusplus.instance, getBaseMetaTileEntity().getWorld(), ForgeChunkManager.Type.NORMAL); } public boolean hasActiveTicket() { @@ -434,15 +405,9 @@ public class GregtechMetaTileEntityChunkLoader extends GT_MetaTileEntity_BasicMa protected void setTicketData(Ticket chunkTicket) { if (chunkTicket != null) { - chunkTicket - .getModData() - .setInteger("xCoord", getBaseMetaTileEntity().getXCoord()); - chunkTicket - .getModData() - .setInteger("yCoord", getBaseMetaTileEntity().getYCoord()); - chunkTicket - .getModData() - .setInteger("zCoord", getBaseMetaTileEntity().getZCoord()); + chunkTicket.getModData().setInteger("xCoord", getBaseMetaTileEntity().getXCoord()); + chunkTicket.getModData().setInteger("yCoord", getBaseMetaTileEntity().getYCoord()); + chunkTicket.getModData().setInteger("zCoord", getBaseMetaTileEntity().getZCoord()); chunkTicket.setChunkListDepth(getMaxChunksToLoadForTier(mTier)); } } @@ -453,9 +418,7 @@ public class GregtechMetaTileEntityChunkLoader extends GT_MetaTileEntity_BasicMa if (ticket != null) { if (ticket.world == getBaseMetaTileEntity().getWorld()) { for (ChunkCoordIntPair chunk : ticket.getChunkList()) { - if (ForgeChunkManager.getPersistentChunksFor( - getBaseMetaTileEntity().getWorld()) - .keys() + if (ForgeChunkManager.getPersistentChunksFor(getBaseMetaTileEntity().getWorld()).keys() .contains(chunk)) { ForgeChunkManager.unforceChunk(ticket, chunk); } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntityThaumcraftResearcher.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntityThaumcraftResearcher.java index ea2f47ab8e..21dbbe25f4 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntityThaumcraftResearcher.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntityThaumcraftResearcher.java @@ -1,5 +1,9 @@ package gtPlusPlus.xmod.gregtech.common.tileentities.machines.basic; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; + import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; @@ -7,34 +11,22 @@ import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.util.GT_Utility; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMetaTileEntity; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; public class GregtechMetaTileEntityThaumcraftResearcher extends GregtechMetaTileEntity { - public GregtechMetaTileEntityThaumcraftResearcher( - final int aID, - final String aName, - final String aNameRegional, - final int aTier, - final String aDescription, - final int aSlotCount) { + public GregtechMetaTileEntityThaumcraftResearcher(final int aID, final String aName, final String aNameRegional, + final int aTier, final String aDescription, final int aSlotCount) { super(aID, aName, aNameRegional, aTier, aSlotCount, aDescription); } - public GregtechMetaTileEntityThaumcraftResearcher( - final String aName, - final int aTier, - final String aDescription, - final ITexture[][][] aTextures, - final int aSlotCount) { + public GregtechMetaTileEntityThaumcraftResearcher(final String aName, final int aTier, final String aDescription, + final ITexture[][][] aTextures, final int aSlotCount) { super(aName, aTier, aSlotCount, aDescription, aTextures); } @Override public String[] getDescription() { - return new String[] {this.mDescription, "Generates Thaumcraft research notes, because it's magic."}; + return new String[] { this.mDescription, "Generates Thaumcraft research notes, because it's magic." }; } @Override @@ -56,45 +48,34 @@ public class GregtechMetaTileEntityThaumcraftResearcher extends GregtechMetaTile } @Override - public ITexture[] getTexture( - final IGregTechTileEntity aBaseMetaTileEntity, - final byte aSide, - final byte aFacing, - final byte aColorIndex, - final boolean aActive, - final boolean aRedstone) { - return this.mTextures[ - (aActive ? 5 : 0) - + (aSide == aFacing - ? 0 - : aSide == GT_Utility.getOppositeSide(aFacing) - ? 1 - : aSide == 0 ? 2 : aSide == 1 ? 3 : 4)][ - aColorIndex + 1]; + public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing, + final byte aColorIndex, final boolean aActive, final boolean aRedstone) { + return this.mTextures[(aActive ? 5 : 0) + (aSide == aFacing ? 0 + : aSide == GT_Utility.getOppositeSide(aFacing) ? 1 : aSide == 0 ? 2 : aSide == 1 ? 3 : 4)][aColorIndex + + 1]; } public ITexture[] getFront(final byte aColor) { - return new ITexture[] {getSides(aColor)[0], new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Metal_Grate_A) - }; + return new ITexture[] { getSides(aColor)[0], + new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Metal_Grate_A) }; } public ITexture[] getBack(final byte aColor) { - return new ITexture[] {getSides(aColor)[0], new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Metal_Grate_B) - }; + return new ITexture[] { getSides(aColor)[0], + new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Metal_Grate_B) }; } public ITexture[] getBottom(final byte aColor) { - return new ITexture[] {getSides(aColor)[0]}; + return new ITexture[] { getSides(aColor)[0] }; } public ITexture[] getTop(final byte aColor) { - return new ITexture[] { - getSides(aColor)[0], new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Dimensional_Blue) - }; + return new ITexture[] { getSides(aColor)[0], + new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Dimensional_Blue) }; } public ITexture[] getSides(final byte aColor) { - return new ITexture[] {new GT_RenderedTexture(TexturesGtBlock.Casing_Material_RedSteel)}; + return new ITexture[] { new GT_RenderedTexture(TexturesGtBlock.Casing_Material_RedSteel) }; } public ITexture[] getFrontActive(final byte aColor) { @@ -110,9 +91,8 @@ public class GregtechMetaTileEntityThaumcraftResearcher extends GregtechMetaTile } public ITexture[] getTopActive(final byte aColor) { - return new ITexture[] { - getSides(aColor)[0], new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Dimensional_Orange) - }; + return new ITexture[] { getSides(aColor)[0], + new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Dimensional_Orange) }; } public ITexture[] getSidesActive(final byte aColor) { @@ -127,7 +107,11 @@ public class GregtechMetaTileEntityThaumcraftResearcher extends GregtechMetaTile @Override public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) { return new GregtechMetaTileEntityThaumcraftResearcher( - this.mName, this.mTier, this.mDescription, this.mTextures, this.mInventory.length); + this.mName, + this.mTier, + this.mDescription, + this.mTextures, + this.mInventory.length); } @Override @@ -224,22 +208,20 @@ public class GregtechMetaTileEntityThaumcraftResearcher extends GregtechMetaTile } @Override - public boolean allowPullStack( - final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, final ItemStack aStack) { + public boolean allowPullStack(final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, + final ItemStack aStack) { return aSide == this.getBaseMetaTileEntity().getBackFacing(); } @Override - public boolean allowPutStack( - final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, final ItemStack aStack) { + public boolean allowPutStack(final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, + final ItemStack aStack) { return true; } @Override public String[] getInfoData() { - return new String[] { - this.getLocalName(), - }; + return new String[] { this.getLocalName(), }; } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_AutoChisel.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_AutoChisel.java index ea9b161d4e..5952f1f220 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_AutoChisel.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_AutoChisel.java @@ -1,5 +1,11 @@ package gtPlusPlus.xmod.gregtech.common.tileentities.machines.basic; +import java.util.List; + +import net.minecraft.item.ItemStack; + +import team.chisel.carving.Carving; + import com.gtnewhorizons.modularui.api.drawable.IDrawable; import com.gtnewhorizons.modularui.api.math.Pos2d; import com.gtnewhorizons.modularui.api.math.Size; @@ -7,6 +13,7 @@ import com.gtnewhorizons.modularui.api.screen.ModularWindow; import com.gtnewhorizons.modularui.api.screen.UIBuildContext; import com.gtnewhorizons.modularui.common.widget.ProgressBar; import com.gtnewhorizons.modularui.common.widget.SlotWidget; + import gregtech.api.enums.Textures.BlockIcons; import gregtech.api.gui.modularui.GT_UITextures; import gregtech.api.interfaces.ITexture; @@ -18,9 +25,6 @@ import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import gtPlusPlus.core.util.minecraft.ItemUtils; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; -import java.util.List; -import net.minecraft.item.ItemStack; -import team.chisel.carving.Carving; public class GregtechMetaTileEntity_AutoChisel extends GT_MetaTileEntity_BasicMachine { @@ -39,37 +43,37 @@ public class GregtechMetaTileEntity_AutoChisel extends GT_MetaTileEntity_BasicMa 1, "Compressor.png", "", - new ITexture[] { - new GT_RenderedTexture(BlockIcons.OVERLAY_SIDE_MASSFAB_ACTIVE), - new GT_RenderedTexture(BlockIcons.OVERLAY_SIDE_MASSFAB), - new GT_RenderedTexture(BlockIcons.OVERLAY_FRONT_MULTI_SMELTER_ACTIVE), - new GT_RenderedTexture(BlockIcons.OVERLAY_FRONT_MULTI_SMELTER), - new GT_RenderedTexture(TexturesGtBlock.Overlay_MatterFab_Active), - new GT_RenderedTexture(TexturesGtBlock.Overlay_MatterFab), - new GT_RenderedTexture(BlockIcons.OVERLAY_BOTTOM_MASSFAB_ACTIVE), - new GT_RenderedTexture(BlockIcons.OVERLAY_BOTTOM_MASSFAB) - }); - } - - public GregtechMetaTileEntity_AutoChisel( - String aName, int aTier, String aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName) { + new ITexture[] { new GT_RenderedTexture(BlockIcons.OVERLAY_SIDE_MASSFAB_ACTIVE), + new GT_RenderedTexture(BlockIcons.OVERLAY_SIDE_MASSFAB), + new GT_RenderedTexture(BlockIcons.OVERLAY_FRONT_MULTI_SMELTER_ACTIVE), + new GT_RenderedTexture(BlockIcons.OVERLAY_FRONT_MULTI_SMELTER), + new GT_RenderedTexture(TexturesGtBlock.Overlay_MatterFab_Active), + new GT_RenderedTexture(TexturesGtBlock.Overlay_MatterFab), + new GT_RenderedTexture(BlockIcons.OVERLAY_BOTTOM_MASSFAB_ACTIVE), + new GT_RenderedTexture(BlockIcons.OVERLAY_BOTTOM_MASSFAB) }); + } + + public GregtechMetaTileEntity_AutoChisel(String aName, int aTier, String aDescription, ITexture[][][] aTextures, + String aGUIName, String aNEIName) { super(aName, aTier, 1, aDescription, aTextures, 1, 1, aGUIName, aNEIName); } @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new GregtechMetaTileEntity_AutoChisel( - this.mName, this.mTier, this.mDescription, this.mTextures, this.mGUIName, this.mNEIName); + this.mName, + this.mTier, + this.mDescription, + this.mTextures, + this.mGUIName, + this.mNEIName); } @Override public String[] getDescription() { - String[] A = new String[] { - this.mDescription, - "What you want to chisel goes in slot 1", - "What you want to get goes in the special slot (bottom right)", - "If special slot is empty, first chisel result is used" - }; + String[] A = new String[] { this.mDescription, "What you want to chisel goes in slot 1", + "What you want to get goes in the special slot (bottom right)", + "If special slot is empty, first chisel result is used" }; return A; } @@ -99,10 +103,9 @@ public class GregtechMetaTileEntity_AutoChisel extends GT_MetaTileEntity_BasicMa } @Override - protected boolean allowPutStackValidated( - IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { - return hasValidCache(aStack, this.getSpecialSlot(), false) - ? true + protected boolean allowPutStackValidated(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, + ItemStack aStack) { + return hasValidCache(aStack, this.getSpecialSlot(), false) ? true : super.allowPutStackValidated(aBaseMetaTileEntity, aIndex, aSide, aStack) && hasChiselResults(aStack); } @@ -180,12 +183,13 @@ public class GregtechMetaTileEntity_AutoChisel extends GT_MetaTileEntity_BasicMa @Override public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildContext) { super.addUIWidgets(builder, buildContext); - builder.widget(createProgressBar( - GT_UITextures.PROGRESSBAR_COMPRESS, - 20, - ProgressBar.Direction.RIGHT, - new Pos2d(78, 24), - new Size(20, 18))); + builder.widget( + createProgressBar( + GT_UITextures.PROGRESSBAR_COMPRESS, + 20, + ProgressBar.Direction.RIGHT, + new Pos2d(78, 24), + new Size(20, 18))); } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_BasicWasher.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_BasicWasher.java index 268863ffd2..e25db682b3 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_BasicWasher.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_BasicWasher.java @@ -1,5 +1,8 @@ package gtPlusPlus.xmod.gregtech.common.tileentities.machines.basic; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidStack; + import gregtech.api.enums.Textures; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; @@ -9,8 +12,6 @@ import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.util.GTPP_Recipe; import gregtech.api.util.GT_Recipe; import gtPlusPlus.core.lib.CORE; -import net.minecraft.item.ItemStack; -import net.minecraftforge.fluids.FluidStack; public class GregtechMetaTileEntity_BasicWasher extends GT_MetaTileEntity_BasicMachine { @@ -26,36 +27,41 @@ public class GregtechMetaTileEntity_BasicWasher extends GT_MetaTileEntity_BasicM 1, "PotionBrewer.png", "", - new ITexture[] { - new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_POTIONBREWER_ACTIVE), - new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_POTIONBREWER), - new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_POTIONBREWER_ACTIVE), - new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_POTIONBREWER), - new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_ROCK_BREAKER_ACTIVE), - new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_ROCK_BREAKER), - new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_ROCK_BREAKER_ACTIVE), - new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_ROCK_BREAKER) - }); + new ITexture[] { new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_POTIONBREWER_ACTIVE), + new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_POTIONBREWER), + new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_POTIONBREWER_ACTIVE), + new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_POTIONBREWER), + new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_ROCK_BREAKER_ACTIVE), + new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_ROCK_BREAKER), + new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_ROCK_BREAKER_ACTIVE), + new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_ROCK_BREAKER) }); } - public GregtechMetaTileEntity_BasicWasher( - String aName, int aTier, String aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName) { + public GregtechMetaTileEntity_BasicWasher(String aName, int aTier, String aDescription, ITexture[][][] aTextures, + String aGUIName, String aNEIName) { super(aName, aTier, 1, aDescription, aTextures, 1, 1, aGUIName, aNEIName); } - /*public GregtechMetaTileEntity_BasicWasher(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName) { - super(aName, aTier, 1, aDescription, aTextures, 1, 1, aGUIName, aNEIName); - }*/ + /* + * public GregtechMetaTileEntity_BasicWasher(String aName, int aTier, String[] aDescription, ITexture[][][] + * aTextures, String aGUIName, String aNEIName) { super(aName, aTier, 1, aDescription, aTextures, 1, 1, aGUIName, + * aNEIName); } + */ @Override public String[] getDescription() { - return new String[] {this.mDescription, "Grants no byproducts, but it is fast.", CORE.GT_Tooltip}; + return new String[] { this.mDescription, "Grants no byproducts, but it is fast.", CORE.GT_Tooltip }; } @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new GregtechMetaTileEntity_BasicWasher( - this.mName, this.mTier, this.mDescription, this.mTextures, this.mGUIName, this.mNEIName); + this.mName, + this.mTier, + this.mDescription, + this.mTextures, + this.mGUIName, + this.mNEIName); } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_ChemicalReactor.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_ChemicalReactor.java index b8df5ae9ff..26de52f7f4 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_ChemicalReactor.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_ChemicalReactor.java @@ -1,5 +1,16 @@ package gtPlusPlus.xmod.gregtech.common.tileentities.machines.basic; +import java.util.List; + +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.fluids.FluidTankInfo; +import net.minecraftforge.fluids.IFluidHandler; + import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; @@ -11,15 +22,6 @@ import gregtech.api.util.GT_Utility; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.slots.SlotChemicalPlantInput; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; -import java.util.List; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.tileentity.TileEntity; -import net.minecraftforge.common.util.ForgeDirection; -import net.minecraftforge.fluids.Fluid; -import net.minecraftforge.fluids.FluidStack; -import net.minecraftforge.fluids.FluidTankInfo; -import net.minecraftforge.fluids.IFluidHandler; public class GregtechMetaTileEntity_ChemicalReactor extends GT_MetaTileEntity_BasicMachine { @@ -41,37 +43,42 @@ public class GregtechMetaTileEntity_ChemicalReactor extends GT_MetaTileEntity_Ba 4, "ChemicalReactor.png", "", - new ITexture[] { - new GT_RenderedTexture(TexturesGtBlock.Overlay_FluidReactor_Side_Active), - new GT_RenderedTexture(TexturesGtBlock.Overlay_FluidReactor_Side), - new GT_RenderedTexture(TexturesGtBlock.Overlay_FluidReactor_Front_Active), - new GT_RenderedTexture(TexturesGtBlock.Overlay_FluidReactor_Front), - new GT_RenderedTexture(TexturesGtBlock.Overlay_FluidReactor_Top_Active), - new GT_RenderedTexture(TexturesGtBlock.Overlay_FluidReactor_Top), - new GT_RenderedTexture(TexturesGtBlock.Overlay_FluidReactor_Top_Active), - new GT_RenderedTexture(TexturesGtBlock.Overlay_FluidReactor_Top) - }); - } - - public GregtechMetaTileEntity_ChemicalReactor( - String aName, int aTier, String aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName) { + new ITexture[] { new GT_RenderedTexture(TexturesGtBlock.Overlay_FluidReactor_Side_Active), + new GT_RenderedTexture(TexturesGtBlock.Overlay_FluidReactor_Side), + new GT_RenderedTexture(TexturesGtBlock.Overlay_FluidReactor_Front_Active), + new GT_RenderedTexture(TexturesGtBlock.Overlay_FluidReactor_Front), + new GT_RenderedTexture(TexturesGtBlock.Overlay_FluidReactor_Top_Active), + new GT_RenderedTexture(TexturesGtBlock.Overlay_FluidReactor_Top), + new GT_RenderedTexture(TexturesGtBlock.Overlay_FluidReactor_Top_Active), + new GT_RenderedTexture(TexturesGtBlock.Overlay_FluidReactor_Top) }); + } + + public GregtechMetaTileEntity_ChemicalReactor(String aName, int aTier, String aDescription, + ITexture[][][] aTextures, String aGUIName, String aNEIName) { super(aName, aTier, 1, aDescription, aTextures, 1, 1, aGUIName, aNEIName); } - /*public GregtechMetaTileEntity_BasicWasher(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName) { - super(aName, aTier, 1, aDescription, aTextures, 1, 1, aGUIName, aNEIName); - }*/ + /* + * public GregtechMetaTileEntity_BasicWasher(String aName, int aTier, String[] aDescription, ITexture[][][] + * aTextures, String aGUIName, String aNEIName) { super(aName, aTier, 1, aDescription, aTextures, 1, 1, aGUIName, + * aNEIName); } + */ @Override public String[] getDescription() { - return new String[] {this.mDescription, "Because why not?", CORE.GT_Tooltip}; + return new String[] { this.mDescription, "Because why not?", CORE.GT_Tooltip }; } @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { try { GregtechMetaTileEntity_ChemicalReactor y = new GregtechMetaTileEntity_ChemicalReactor( - this.mName, this.mTier, this.mDescription, this.mTextures, this.mGUIName, this.mNEIName); + this.mName, + this.mTier, + this.mDescription, + this.mTextures, + this.mGUIName, + this.mNEIName); return y; } catch (Throwable t) { t.printStackTrace(); @@ -225,12 +232,9 @@ public class GregtechMetaTileEntity_ChemicalReactor extends GT_MetaTileEntity_Ba } else { if (++this.mProgresstime >= this.mMaxProgresstime) { for (i = 0; i < this.mOutputItems.length; ++i) { - for (i = 0; - i < this.mOutputItems.length - && !aBaseMetaTileEntity.addStackToSlot( - this.getOutputSlot() + (i + i) % this.mOutputItems.length, - this.mOutputItems[i]); - ++i) { + for (i = 0; i < this.mOutputItems.length && !aBaseMetaTileEntity.addStackToSlot( + this.getOutputSlot() + (i + i) % this.mOutputItems.length, + this.mOutputItems[i]); ++i) { ; } } @@ -266,8 +270,7 @@ public class GregtechMetaTileEntity_ChemicalReactor extends GT_MetaTileEntity_Ba } boolean tRemovedOutputFluid = false; - if (this.doesAutoOutputFluids() - && this.getDrainableStack() != null + if (this.doesAutoOutputFluids() && this.getDrainableStack() != null && aBaseMetaTileEntity.getFrontFacing() != this.mMainFacing && (tSucceeded || aTick % 20L == 0L)) { IFluidHandler tTank = aBaseMetaTileEntity.getITankContainerAtSide(aBaseMetaTileEntity.getFrontFacing()); @@ -275,7 +278,9 @@ public class GregtechMetaTileEntity_ChemicalReactor extends GT_MetaTileEntity_Ba FluidStack tDrained = this.drain(1000, false); if (tDrained != null) { int tFilledAmount = tTank.fill( - ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()), tDrained, false); + ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()), + tDrained, + false); if (tFilledAmount > 0) { tTank.fill( ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()), @@ -291,19 +296,16 @@ public class GregtechMetaTileEntity_ChemicalReactor extends GT_MetaTileEntity_Ba } int j; - if (this.doesAutoOutput() - && !this.isOutputEmpty() + if (this.doesAutoOutput() && !this.isOutputEmpty() && aBaseMetaTileEntity.getFrontFacing() != this.mMainFacing - && (tSucceeded - || this.mOutputBlocked % 300 == 1 + && (tSucceeded || this.mOutputBlocked % 300 == 1 || aBaseMetaTileEntity.hasInventoryBeenModified() || aTick % 600L == 0L)) { TileEntity tTileEntity2 = aBaseMetaTileEntity.getTileEntityAtSide(aBaseMetaTileEntity.getFrontFacing()); j = 0; - for (byte tCosts = 1; - j < this.mOutputItems.length && tCosts > 0 && aBaseMetaTileEntity.isUniversalEnergyStored(128L); - ++j) { + for (byte tCosts = 1; j < this.mOutputItems.length && tCosts > 0 + && aBaseMetaTileEntity.isUniversalEnergyStored(128L); ++j) { tCosts = GT_Utility.moveOneItemStack( aBaseMetaTileEntity, tTileEntity2, @@ -330,10 +332,8 @@ public class GregtechMetaTileEntity_ChemicalReactor extends GT_MetaTileEntity_Ba } if (this.allowToCheckRecipe()) { - if (this.mMaxProgresstime <= 0 - && aBaseMetaTileEntity.isAllowedToWork() - && (tRemovedOutputFluid - || tSucceeded + if (this.mMaxProgresstime <= 0 && aBaseMetaTileEntity.isAllowedToWork() + && (tRemovedOutputFluid || tSucceeded || aBaseMetaTileEntity.hasInventoryBeenModified() || aTick % 600L == 0L || aBaseMetaTileEntity.hasWorkJustBeenEnabled()) @@ -352,7 +352,7 @@ public class GregtechMetaTileEntity_ChemicalReactor extends GT_MetaTileEntity_Ba } for (i = 0; i < this.mOutputItems.length; ++i) { - this.mOutputItems[i] = GT_Utility.copy(new Object[] {this.mOutputItems[i]}); + this.mOutputItems[i] = GT_Utility.copy(new Object[] { this.mOutputItems[i] }); if (this.mOutputItems[i] != null && this.mOutputItems[i].stackSize > 64) { this.mOutputItems[i].stackSize = 64; } @@ -472,80 +472,20 @@ public class GregtechMetaTileEntity_ChemicalReactor extends GT_MetaTileEntity_Ba public void onPreTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { super.onPreTick(aBaseMetaTileEntity, aTick); - /* if (aBaseMetaTileEntity != null) { - if (!aBaseMetaTileEntity.getWorld().isRemote) { - itemslots : for (int i=3;i<7;i++) { - ItemStack aStack = aBaseMetaTileEntity.getStackInSlot(i); - if (aStack != null) { - if (FluidContainerRegistry.isContainer(aStack)) { - if (this.isItemValidForSlot(i, aStack)) { - // Add Fluid - FluidStack aContainerFluid = FluidContainerRegistry.getFluidForFilledItem(aStack); - if (aContainerFluid != null) { - fluidslots : for (FluidStack u : mInputFluids) { - if (u != null && u.isFluidEqual(aContainerFluid)) { - if (u.amount <= (this.getCapacity() - aContainerFluid.amount)) { - - // Matching, not full, let's fill, then continue - u.amount += aContainerFluid.amount; - - // Update stack size - if (aStack.stackSize > 1) { - aStack.stackSize--; - } - else { - aStack = null; - } - - // Add Output container - // TODO - - continue itemslots; - } - else { - // Too full - break fluidslots; - } - } - else { - if (u == null ) { - - // Empty, let's fill, then continue - u = aContainerFluid.copy(); - - // Update stack size - if (aStack.stackSize > 1) { - aStack.stackSize--; - } - else { - aStack = null; - } - - // Add Output container - // TODO - - continue itemslots; - - } - else { - // Not empty, doesn't match, check next slot. - continue fluidslots; - } - } - } - - - - } - // Eat Input - - // Add Container to Output - } - } - } - } - } - }*/ + /* + * if (aBaseMetaTileEntity != null) { if (!aBaseMetaTileEntity.getWorld().isRemote) { itemslots : for (int + * i=3;i<7;i++) { ItemStack aStack = aBaseMetaTileEntity.getStackInSlot(i); if (aStack != null) { if + * (FluidContainerRegistry.isContainer(aStack)) { if (this.isItemValidForSlot(i, aStack)) { // Add Fluid + * FluidStack aContainerFluid = FluidContainerRegistry.getFluidForFilledItem(aStack); if (aContainerFluid != + * null) { fluidslots : for (FluidStack u : mInputFluids) { if (u != null && u.isFluidEqual(aContainerFluid)) { + * if (u.amount <= (this.getCapacity() - aContainerFluid.amount)) { // Matching, not full, let's fill, then + * continue u.amount += aContainerFluid.amount; // Update stack size if (aStack.stackSize > 1) { + * aStack.stackSize--; } else { aStack = null; } // Add Output container // TODO continue itemslots; } else { // + * Too full break fluidslots; } } else { if (u == null ) { // Empty, let's fill, then continue u = + * aContainerFluid.copy(); // Update stack size if (aStack.stackSize > 1) { aStack.stackSize--; } else { aStack + * = null; } // Add Output container // TODO continue itemslots; } else { // Not empty, doesn't match, check + * next slot. continue fluidslots; } } } } // Eat Input // Add Container to Output } } } } } } + */ } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_CompactFusionReactor.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_CompactFusionReactor.java index 39c6bb53dd..5de366dfa4 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_CompactFusionReactor.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_CompactFusionReactor.java @@ -1,5 +1,15 @@ package gtPlusPlus.xmod.gregtech.common.tileentities.machines.basic; +import java.util.ArrayList; +import java.util.Random; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidStack; + import gregtech.api.GregTech_API; import gregtech.api.enums.GT_Values; import gregtech.api.enums.Textures; @@ -14,14 +24,6 @@ import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.util.math.MathUtils; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GT_MetaTileEntity_DeluxeMachine; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; -import java.util.ArrayList; -import java.util.Random; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraftforge.common.util.ForgeDirection; -import net.minecraftforge.fluids.Fluid; -import net.minecraftforge.fluids.FluidStack; public class GregtechMetaTileEntity_CompactFusionReactor extends GT_MetaTileEntity_DeluxeMachine { @@ -41,27 +43,27 @@ public class GregtechMetaTileEntity_CompactFusionReactor extends GT_MetaTileEnti super(aID, aName, aNameRegional, aTier, 1, "It's like a midget Ra.", 1, 1, "PotionBrewer.png", ""); } - public GregtechMetaTileEntity_CompactFusionReactor( - String aName, int aTier, String aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName) { + public GregtechMetaTileEntity_CompactFusionReactor(String aName, int aTier, String aDescription, + ITexture[][][] aTextures, String aGUIName, String aNEIName) { super(aName, aTier, 1, aDescription, aTextures, 1, 1, aGUIName, aNEIName); } @Override public String[] getDescription() { - return new String[] { - this.mDescription, - "Not Very Fast, but not very big either.", - "Each side pair in/out puts to different slots.", - "Top & Bottom Sides are Outputs.", - "Front & Back are Input Plasma 1.", - "Sides are Input Plasma 2." - }; + return new String[] { this.mDescription, "Not Very Fast, but not very big either.", + "Each side pair in/out puts to different slots.", "Top & Bottom Sides are Outputs.", + "Front & Back are Input Plasma 1.", "Sides are Input Plasma 2." }; } @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new GregtechMetaTileEntity_CompactFusionReactor( - this.mName, this.mTier, this.mDescription, this.mTextures, this.mGUIName, this.mNEIName); + this.mName, + this.mTier, + this.mDescription, + this.mTextures, + this.mGUIName, + this.mNEIName); } public int tier() { @@ -95,21 +97,11 @@ public class GregtechMetaTileEntity_CompactFusionReactor extends GT_MetaTileEnti } @Override - public ITexture[] getTexture( - final IGregTechTileEntity aBaseMetaTileEntity, - final byte aSide, - final byte aFacing, - final byte aColorIndex, - final boolean aActive, - final boolean aRedstone) { - return this.mTextures[ - (aActive ? 5 : 0) - + (aSide == aFacing - ? 0 - : aSide == GT_Utility.getOppositeSide(aFacing) - ? 1 - : aSide == 0 ? 2 : aSide == 1 ? 3 : 4)][ - aColorIndex + 1]; + public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing, + final byte aColorIndex, final boolean aActive, final boolean aRedstone) { + return this.mTextures[(aActive ? 5 : 0) + (aSide == aFacing ? 0 + : aSide == GT_Utility.getOppositeSide(aFacing) ? 1 : aSide == 0 ? 2 : aSide == 1 ? 3 : 4)][aColorIndex + + 1]; } @Override @@ -149,8 +141,10 @@ public class GregtechMetaTileEntity_CompactFusionReactor extends GT_MetaTileEnti this.mCharging = true; this.mCanProcessRecipe = false; if (this.getBaseMetaTileEntity().decreaseStoredEnergyUnits((mFusionPoint / 100), false)) { - Logger.MACHINE_INFO("Recipe Tick 1.3 - Charging Internal storage. " + (mFusionPoint / 100) + "/" - + mFusionPoint); + Logger.MACHINE_INFO( + "Recipe Tick 1.3 - Charging Internal storage. " + (mFusionPoint / 100) + + "/" + + mFusionPoint); mChargeConsumed += (mFusionPoint / 100); } } else { @@ -195,14 +189,13 @@ public class GregtechMetaTileEntity_CompactFusionReactor extends GT_MetaTileEnti } if (tFluidList.size() > 1) { FluidStack[] tFluids = tFluidList.toArray(new FluidStack[tFluidList.size()]); - GT_Recipe tRecipe = getRecipeList() - .findRecipe( - this.getBaseMetaTileEntity(), - this.mLastRecipe, - false, - GT_Values.V[8], - tFluids, - new ItemStack[] {}); + GT_Recipe tRecipe = getRecipeList().findRecipe( + this.getBaseMetaTileEntity(), + this.mLastRecipe, + false, + GT_Values.V[8], + tFluids, + new ItemStack[] {}); if (tRecipe == null) { return false; } @@ -275,43 +268,36 @@ public class GregtechMetaTileEntity_CompactFusionReactor extends GT_MetaTileEnti public void onPreTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { super.onPreTick(aBaseMetaTileEntity, aTick); onRunningTickMulti(); - if ((aBaseMetaTileEntity.isClientSide()) - && (aBaseMetaTileEntity.isActive()) + if ((aBaseMetaTileEntity.isClientSide()) && (aBaseMetaTileEntity.isActive()) && (aBaseMetaTileEntity.getFrontFacing() != 1) && (aBaseMetaTileEntity.getCoverIDAtSide((byte) 1) == 0) && (!aBaseMetaTileEntity.getOpacityAtSide((byte) 1))) { if (MathUtils.randInt(0, 4) == 4) { final Random tRandom = aBaseMetaTileEntity.getWorld().rand; - aBaseMetaTileEntity - .getWorld() - .spawnParticle( - "magicCrit", - (aBaseMetaTileEntity.getXCoord() + 0.8F) - (tRandom.nextFloat() * 0.6F), - aBaseMetaTileEntity.getYCoord() + 0.3f + (tRandom.nextFloat() * 0.2F), - (aBaseMetaTileEntity.getZCoord() + 1.2F) - (tRandom.nextFloat() * 1.6F), - 0.0D, - 0.0D, - 0.0D); - aBaseMetaTileEntity - .getWorld() - .spawnParticle( - "magicCrit", - (aBaseMetaTileEntity.getXCoord() + 0.4F) - (tRandom.nextFloat() * 0.3F), - aBaseMetaTileEntity.getYCoord() + 0.2f + (tRandom.nextFloat() * 0.1F), - (aBaseMetaTileEntity.getZCoord() + 0.8F) - (tRandom.nextFloat() * 0.6F), - 0.0D, - 0.0D, - 0.0D); - aBaseMetaTileEntity - .getWorld() - .spawnParticle( - "magicCrit", - (aBaseMetaTileEntity.getXCoord() + 0.6F) - (tRandom.nextFloat() * 0.9F), - aBaseMetaTileEntity.getYCoord() + 0.4f + (tRandom.nextFloat() * 0.3F), - (aBaseMetaTileEntity.getZCoord() + 1.8F) - (tRandom.nextFloat() * 2.6F), - 0.0D, - 0.0D, - 0.0D); + aBaseMetaTileEntity.getWorld().spawnParticle( + "magicCrit", + (aBaseMetaTileEntity.getXCoord() + 0.8F) - (tRandom.nextFloat() * 0.6F), + aBaseMetaTileEntity.getYCoord() + 0.3f + (tRandom.nextFloat() * 0.2F), + (aBaseMetaTileEntity.getZCoord() + 1.2F) - (tRandom.nextFloat() * 1.6F), + 0.0D, + 0.0D, + 0.0D); + aBaseMetaTileEntity.getWorld().spawnParticle( + "magicCrit", + (aBaseMetaTileEntity.getXCoord() + 0.4F) - (tRandom.nextFloat() * 0.3F), + aBaseMetaTileEntity.getYCoord() + 0.2f + (tRandom.nextFloat() * 0.1F), + (aBaseMetaTileEntity.getZCoord() + 0.8F) - (tRandom.nextFloat() * 0.6F), + 0.0D, + 0.0D, + 0.0D); + aBaseMetaTileEntity.getWorld().spawnParticle( + "magicCrit", + (aBaseMetaTileEntity.getXCoord() + 0.6F) - (tRandom.nextFloat() * 0.9F), + aBaseMetaTileEntity.getYCoord() + 0.4f + (tRandom.nextFloat() * 0.3F), + (aBaseMetaTileEntity.getZCoord() + 1.8F) - (tRandom.nextFloat() * 2.6F), + 0.0D, + 0.0D, + 0.0D); } } } @@ -366,13 +352,9 @@ public class GregtechMetaTileEntity_CompactFusionReactor extends GT_MetaTileEnti } } - return new String[] { - "Fusion Reactor MK " + tier, - "EU Required: " + powerRequired + "EU/t", - "Stored EU: " + this.getEUVar() + " / " + maxEUStore(), - "Plasma Output: " + plasmaOut + "L/t", - "Current Recipe: " + fusionName - }; + return new String[] { "Fusion Reactor MK " + tier, "EU Required: " + powerRequired + "EU/t", + "Stored EU: " + this.getEUVar() + " / " + maxEUStore(), "Plasma Output: " + plasmaOut + "L/t", + "Current Recipe: " + fusionName }; } @Override @@ -381,48 +363,46 @@ public class GregtechMetaTileEntity_CompactFusionReactor extends GT_MetaTileEnti } public ITexture[] getFront(final byte aColor) { - return new ITexture[] {this.getCasingTexture(), new GT_RenderedTexture(TexturesGtBlock.Overlay_MatterFab)}; + return new ITexture[] { this.getCasingTexture(), new GT_RenderedTexture(TexturesGtBlock.Overlay_MatterFab) }; } public ITexture[] getBack(final byte aColor) { - return new ITexture[] {this.getCasingTexture(), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT)}; + return new ITexture[] { this.getCasingTexture(), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT) }; } public ITexture[] getBottom(final byte aColor) { - return new ITexture[] {new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS)}; + return new ITexture[] { new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS) }; } public ITexture[] getTop(final byte aColor) { - return new ITexture[] {new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS)}; + return new ITexture[] { new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS) }; } public ITexture[] getSides(final byte aColor) { - return new ITexture[] { - this.getCasingTexture(), new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Dimensional_Orange) - }; + return new ITexture[] { this.getCasingTexture(), + new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Dimensional_Orange) }; } public ITexture[] getFrontActive(final byte aColor) { - return new ITexture[] {this.getCasingTexture(), new GT_RenderedTexture(TexturesGtBlock.Overlay_MatterFab_Active) - }; + return new ITexture[] { this.getCasingTexture(), + new GT_RenderedTexture(TexturesGtBlock.Overlay_MatterFab_Active) }; } public ITexture[] getBackActive(final byte aColor) { - return new ITexture[] {this.getCasingTexture(), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT)}; + return new ITexture[] { this.getCasingTexture(), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT) }; } public ITexture[] getBottomActive(final byte aColor) { - return new ITexture[] {new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS_YELLOW)}; + return new ITexture[] { new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS_YELLOW) }; } public ITexture[] getTopActive(final byte aColor) { - return new ITexture[] {new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS_YELLOW)}; + return new ITexture[] { new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS_YELLOW) }; } public ITexture[] getSidesActive(final byte aColor) { - return new ITexture[] { - this.getCasingTexture(), new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Dimensional_Blue) - }; + return new ITexture[] { this.getCasingTexture(), + new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Dimensional_Blue) }; } @Override @@ -480,8 +460,7 @@ public class GregtechMetaTileEntity_CompactFusionReactor extends GT_MetaTileEnti } else { // Logger.MACHINE_INFO("8"); this.mEUStore = (int) aBaseMetaTileEntity.getStoredEU(); - if (aTick % 100 == 0 - || aBaseMetaTileEntity.hasWorkJustBeenEnabled() + if (aTick % 100 == 0 || aBaseMetaTileEntity.hasWorkJustBeenEnabled() || aBaseMetaTileEntity.hasInventoryBeenModified()) { Logger.MACHINE_INFO("9"); // turnCasingActive(mMaxProgresstime > 0); @@ -673,8 +652,8 @@ public class GregtechMetaTileEntity_CompactFusionReactor extends GT_MetaTileEnti } @Override - public boolean onRightclick( - IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer, byte aSide, float aX, float aY, float aZ) { + public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer, byte aSide, float aX, + float aY, float aZ) { // TODO Auto-generated method stub return super.onRightclick(aBaseMetaTileEntity, aPlayer, aSide, aX, aY, aZ); } @@ -704,8 +683,8 @@ public class GregtechMetaTileEntity_CompactFusionReactor extends GT_MetaTileEnti public void startSoundLoop(byte aIndex, double aX, double aY, double aZ) { super.startSoundLoop(aIndex, aX, aY, aZ); if (aIndex == 1) { - GT_Utility.doSoundAtClient( - (String) GregTech_API.sSoundList.get(Integer.valueOf(212)), 10, 1.0F, aX, aY, aZ); + GT_Utility + .doSoundAtClient((String) GregTech_API.sSoundList.get(Integer.valueOf(212)), 10, 1.0F, aX, aY, aZ); } } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_PocketFusion.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_PocketFusion.java index 6ac99404ed..51f24f6c5e 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_PocketFusion.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_PocketFusion.java @@ -1,5 +1,15 @@ package gtPlusPlus.xmod.gregtech.common.tileentities.machines.basic; +import java.util.ArrayList; +import java.util.Random; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidStack; + import gregtech.api.GregTech_API; import gregtech.api.enums.GT_Values; import gregtech.api.enums.Textures; @@ -15,14 +25,6 @@ import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.util.math.MathUtils; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GT_MetaTileEntity_DeluxeMachine; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; -import java.util.ArrayList; -import java.util.Random; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraftforge.common.util.ForgeDirection; -import net.minecraftforge.fluids.Fluid; -import net.minecraftforge.fluids.FluidStack; public class GregtechMetaTileEntity_PocketFusion extends GT_MetaTileEntity_DeluxeMachine { @@ -42,28 +44,27 @@ public class GregtechMetaTileEntity_PocketFusion extends GT_MetaTileEntity_Delux super(aID, aName, aNameRegional, aTier, 1, "It's like a midget Ra.", 1, 1, "PotionBrewer.png", ""); } - public GregtechMetaTileEntity_PocketFusion( - String aName, int aTier, String aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName) { + public GregtechMetaTileEntity_PocketFusion(String aName, int aTier, String aDescription, ITexture[][][] aTextures, + String aGUIName, String aNEIName) { super(aName, aTier, 1, aDescription, aTextures, 1, 1, aGUIName, aNEIName); } @Override public String[] getDescription() { - return new String[] { - this.mDescription, - "Not Very Fast, but not very big either.", - "Each side pair in/out puts to different slots.", - "Top & Bottom Sides are Outputs.", - "Front & Back are Input Plasma 1.", - "Sides are Input Plasma 2.", - CORE.GT_Tooltip - }; + return new String[] { this.mDescription, "Not Very Fast, but not very big either.", + "Each side pair in/out puts to different slots.", "Top & Bottom Sides are Outputs.", + "Front & Back are Input Plasma 1.", "Sides are Input Plasma 2.", CORE.GT_Tooltip }; } @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new GregtechMetaTileEntity_PocketFusion( - this.mName, this.mTier, this.mDescription, this.mTextures, this.mGUIName, this.mNEIName); + this.mName, + this.mTier, + this.mDescription, + this.mTextures, + this.mGUIName, + this.mNEIName); } public int tier() { @@ -97,21 +98,11 @@ public class GregtechMetaTileEntity_PocketFusion extends GT_MetaTileEntity_Delux } @Override - public ITexture[] getTexture( - final IGregTechTileEntity aBaseMetaTileEntity, - final byte aSide, - final byte aFacing, - final byte aColorIndex, - final boolean aActive, - final boolean aRedstone) { - return this.mTextures[ - (aActive ? 5 : 0) - + (aSide == aFacing - ? 0 - : aSide == GT_Utility.getOppositeSide(aFacing) - ? 1 - : aSide == 0 ? 2 : aSide == 1 ? 3 : 4)][ - aColorIndex + 1]; + public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing, + final byte aColorIndex, final boolean aActive, final boolean aRedstone) { + return this.mTextures[(aActive ? 5 : 0) + (aSide == aFacing ? 0 + : aSide == GT_Utility.getOppositeSide(aFacing) ? 1 : aSide == 0 ? 2 : aSide == 1 ? 3 : 4)][aColorIndex + + 1]; } @Override @@ -151,8 +142,10 @@ public class GregtechMetaTileEntity_PocketFusion extends GT_MetaTileEntity_Delux this.mCharging = true; this.mCanProcessRecipe = false; if (this.getBaseMetaTileEntity().decreaseStoredEnergyUnits((mFusionPoint / 100), false)) { - Logger.MACHINE_INFO("Recipe Tick 1.3 - Charging Internal storage. " + (mFusionPoint / 100) + "/" - + mFusionPoint); + Logger.MACHINE_INFO( + "Recipe Tick 1.3 - Charging Internal storage. " + (mFusionPoint / 100) + + "/" + + mFusionPoint); mChargeConsumed += (mFusionPoint / 100); } } else { @@ -197,14 +190,13 @@ public class GregtechMetaTileEntity_PocketFusion extends GT_MetaTileEntity_Delux } if (tFluidList.size() > 1) { FluidStack[] tFluids = tFluidList.toArray(new FluidStack[tFluidList.size()]); - GT_Recipe tRecipe = getRecipeList() - .findRecipe( - this.getBaseMetaTileEntity(), - this.mLastRecipe, - false, - GT_Values.V[8], - tFluids, - new ItemStack[] {}); + GT_Recipe tRecipe = getRecipeList().findRecipe( + this.getBaseMetaTileEntity(), + this.mLastRecipe, + false, + GT_Values.V[8], + tFluids, + new ItemStack[] {}); if (tRecipe == null) { return false; @@ -279,43 +271,36 @@ public class GregtechMetaTileEntity_PocketFusion extends GT_MetaTileEntity_Delux public void onPreTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { super.onPreTick(aBaseMetaTileEntity, aTick); onRunningTickMulti(); - if ((aBaseMetaTileEntity.isClientSide()) - && (aBaseMetaTileEntity.isActive()) + if ((aBaseMetaTileEntity.isClientSide()) && (aBaseMetaTileEntity.isActive()) && (aBaseMetaTileEntity.getFrontFacing() != 1) && (aBaseMetaTileEntity.getCoverIDAtSide((byte) 1) == 0) && (!aBaseMetaTileEntity.getOpacityAtSide((byte) 1))) { if (MathUtils.randInt(0, 4) == 4) { final Random tRandom = aBaseMetaTileEntity.getWorld().rand; - aBaseMetaTileEntity - .getWorld() - .spawnParticle( - "magicCrit", - (aBaseMetaTileEntity.getXCoord() + 0.8F) - (tRandom.nextFloat() * 0.6F), - aBaseMetaTileEntity.getYCoord() + 0.3f + (tRandom.nextFloat() * 0.2F), - (aBaseMetaTileEntity.getZCoord() + 1.2F) - (tRandom.nextFloat() * 1.6F), - 0.0D, - 0.0D, - 0.0D); - aBaseMetaTileEntity - .getWorld() - .spawnParticle( - "magicCrit", - (aBaseMetaTileEntity.getXCoord() + 0.4F) - (tRandom.nextFloat() * 0.3F), - aBaseMetaTileEntity.getYCoord() + 0.2f + (tRandom.nextFloat() * 0.1F), - (aBaseMetaTileEntity.getZCoord() + 0.8F) - (tRandom.nextFloat() * 0.6F), - 0.0D, - 0.0D, - 0.0D); - aBaseMetaTileEntity - .getWorld() - .spawnParticle( - "magicCrit", - (aBaseMetaTileEntity.getXCoord() + 0.6F) - (tRandom.nextFloat() * 0.9F), - aBaseMetaTileEntity.getYCoord() + 0.4f + (tRandom.nextFloat() * 0.3F), - (aBaseMetaTileEntity.getZCoord() + 1.8F) - (tRandom.nextFloat() * 2.6F), - 0.0D, - 0.0D, - 0.0D); + aBaseMetaTileEntity.getWorld().spawnParticle( + "magicCrit", + (aBaseMetaTileEntity.getXCoord() + 0.8F) - (tRandom.nextFloat() * 0.6F), + aBaseMetaTileEntity.getYCoord() + 0.3f + (tRandom.nextFloat() * 0.2F), + (aBaseMetaTileEntity.getZCoord() + 1.2F) - (tRandom.nextFloat() * 1.6F), + 0.0D, + 0.0D, + 0.0D); + aBaseMetaTileEntity.getWorld().spawnParticle( + "magicCrit", + (aBaseMetaTileEntity.getXCoord() + 0.4F) - (tRandom.nextFloat() * 0.3F), + aBaseMetaTileEntity.getYCoord() + 0.2f + (tRandom.nextFloat() * 0.1F), + (aBaseMetaTileEntity.getZCoord() + 0.8F) - (tRandom.nextFloat() * 0.6F), + 0.0D, + 0.0D, + 0.0D); + aBaseMetaTileEntity.getWorld().spawnParticle( + "magicCrit", + (aBaseMetaTileEntity.getXCoord() + 0.6F) - (tRandom.nextFloat() * 0.9F), + aBaseMetaTileEntity.getYCoord() + 0.4f + (tRandom.nextFloat() * 0.3F), + (aBaseMetaTileEntity.getZCoord() + 1.8F) - (tRandom.nextFloat() * 2.6F), + 0.0D, + 0.0D, + 0.0D); } } } @@ -370,13 +355,9 @@ public class GregtechMetaTileEntity_PocketFusion extends GT_MetaTileEntity_Delux } } - return new String[] { - "Fusion Reactor MK " + tier, - "EU Required: " + powerRequired + "EU/t", - "Stored EU: " + this.getEUVar() + " / " + maxEUStore(), - "Plasma Output: " + plasmaOut + "L/t", - "Current Recipe: " + fusionName - }; + return new String[] { "Fusion Reactor MK " + tier, "EU Required: " + powerRequired + "EU/t", + "Stored EU: " + this.getEUVar() + " / " + maxEUStore(), "Plasma Output: " + plasmaOut + "L/t", + "Current Recipe: " + fusionName }; } @Override @@ -385,48 +366,46 @@ public class GregtechMetaTileEntity_PocketFusion extends GT_MetaTileEntity_Delux } public ITexture[] getFront(final byte aColor) { - return new ITexture[] {this.getCasingTexture(), new GT_RenderedTexture(TexturesGtBlock.Overlay_MatterFab)}; + return new ITexture[] { this.getCasingTexture(), new GT_RenderedTexture(TexturesGtBlock.Overlay_MatterFab) }; } public ITexture[] getBack(final byte aColor) { - return new ITexture[] {this.getCasingTexture(), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT)}; + return new ITexture[] { this.getCasingTexture(), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT) }; } public ITexture[] getBottom(final byte aColor) { - return new ITexture[] {new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS)}; + return new ITexture[] { new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS) }; } public ITexture[] getTop(final byte aColor) { - return new ITexture[] {new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS)}; + return new ITexture[] { new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS) }; } public ITexture[] getSides(final byte aColor) { - return new ITexture[] { - this.getCasingTexture(), new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Dimensional_Orange) - }; + return new ITexture[] { this.getCasingTexture(), + new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Dimensional_Orange) }; } public ITexture[] getFrontActive(final byte aColor) { - return new ITexture[] {this.getCasingTexture(), new GT_RenderedTexture(TexturesGtBlock.Overlay_MatterFab_Active) - }; + return new ITexture[] { this.getCasingTexture(), + new GT_RenderedTexture(TexturesGtBlock.Overlay_MatterFab_Active) }; } public ITexture[] getBackActive(final byte aColor) { - return new ITexture[] {this.getCasingTexture(), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT)}; + return new ITexture[] { this.getCasingTexture(), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT) }; } public ITexture[] getBottomActive(final byte aColor) { - return new ITexture[] {new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS_YELLOW)}; + return new ITexture[] { new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS_YELLOW) }; } public ITexture[] getTopActive(final byte aColor) { - return new ITexture[] {new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS_YELLOW)}; + return new ITexture[] { new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS_YELLOW) }; } public ITexture[] getSidesActive(final byte aColor) { - return new ITexture[] { - this.getCasingTexture(), new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Dimensional_Blue) - }; + return new ITexture[] { this.getCasingTexture(), + new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Dimensional_Blue) }; } @Override @@ -484,8 +463,7 @@ public class GregtechMetaTileEntity_PocketFusion extends GT_MetaTileEntity_Delux } else { // Logger.MACHINE_INFO("8"); this.mEUStore = (int) aBaseMetaTileEntity.getStoredEU(); - if (aTick % 100 == 0 - || aBaseMetaTileEntity.hasWorkJustBeenEnabled() + if (aTick % 100 == 0 || aBaseMetaTileEntity.hasWorkJustBeenEnabled() || aBaseMetaTileEntity.hasInventoryBeenModified()) { Logger.MACHINE_INFO("9"); // turnCasingActive(mMaxProgresstime > 0); @@ -677,8 +655,8 @@ public class GregtechMetaTileEntity_PocketFusion extends GT_MetaTileEntity_Delux } @Override - public boolean onRightclick( - IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer, byte aSide, float aX, float aY, float aZ) { + public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer, byte aSide, float aX, + float aY, float aZ) { // TODO Auto-generated method stub return super.onRightclick(aBaseMetaTileEntity, aPlayer, aSide, aX, aY, aZ); } @@ -708,8 +686,8 @@ public class GregtechMetaTileEntity_PocketFusion extends GT_MetaTileEntity_Delux public void startSoundLoop(byte aIndex, double aX, double aY, double aZ) { super.startSoundLoop(aIndex, aX, aY, aZ); if (aIndex == 1) { - GT_Utility.doSoundAtClient( - (String) GregTech_API.sSoundList.get(Integer.valueOf(212)), 10, 1.0F, aX, aY, aZ); + GT_Utility + .doSoundAtClient((String) GregTech_API.sSoundList.get(Integer.valueOf(212)), 10, 1.0F, aX, aY, aZ); } } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_ReactorColdTrap.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_ReactorColdTrap.java index f9ecc4be18..96f780c36d 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_ReactorColdTrap.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_ReactorColdTrap.java @@ -1,5 +1,8 @@ package gtPlusPlus.xmod.gregtech.common.tileentities.machines.basic; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidStack; + import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; @@ -9,38 +12,50 @@ import gregtech.api.util.GTPP_Recipe; import gregtech.api.util.GT_Recipe; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; -import net.minecraft.item.ItemStack; -import net.minecraftforge.fluids.FluidStack; public class GregtechMetaTileEntity_ReactorColdTrap extends GT_MetaTileEntity_BasicMachine { public GregtechMetaTileEntity_ReactorColdTrap(int aID, String aName, String aNameRegional, int aTier) { - super(aID, aName, aNameRegional, aTier, 1, "Just like the Arctic", 2, 9, "Dehydrator.png", "", new ITexture[] { - new GT_RenderedTexture(TexturesGtBlock.OVERLAY_REACTOR_COLDTRAP_SIDE_ACTIVE), - new GT_RenderedTexture(TexturesGtBlock.OVERLAY_REACTOR_COLDTRAP_SIDE), - new GT_RenderedTexture(TexturesGtBlock.OVERLAY_REACTOR_COLDTRAP_FRONT_ACTIVE), - new GT_RenderedTexture(TexturesGtBlock.OVERLAY_REACTOR_COLDTRAP_FRONT), - new GT_RenderedTexture(TexturesGtBlock.OVERLAY_REACTOR_COLDTRAP_TOP_ACTIVE), - new GT_RenderedTexture(TexturesGtBlock.OVERLAY_REACTOR_COLDTRAP_TOP), - new GT_RenderedTexture(TexturesGtBlock.OVERLAY_REACTOR_COLDTRAP_TOP_ACTIVE), - new GT_RenderedTexture(TexturesGtBlock.OVERLAY_REACTOR_COLDTRAP_TOP) - }); + super( + aID, + aName, + aNameRegional, + aTier, + 1, + "Just like the Arctic", + 2, + 9, + "Dehydrator.png", + "", + new ITexture[] { new GT_RenderedTexture(TexturesGtBlock.OVERLAY_REACTOR_COLDTRAP_SIDE_ACTIVE), + new GT_RenderedTexture(TexturesGtBlock.OVERLAY_REACTOR_COLDTRAP_SIDE), + new GT_RenderedTexture(TexturesGtBlock.OVERLAY_REACTOR_COLDTRAP_FRONT_ACTIVE), + new GT_RenderedTexture(TexturesGtBlock.OVERLAY_REACTOR_COLDTRAP_FRONT), + new GT_RenderedTexture(TexturesGtBlock.OVERLAY_REACTOR_COLDTRAP_TOP_ACTIVE), + new GT_RenderedTexture(TexturesGtBlock.OVERLAY_REACTOR_COLDTRAP_TOP), + new GT_RenderedTexture(TexturesGtBlock.OVERLAY_REACTOR_COLDTRAP_TOP_ACTIVE), + new GT_RenderedTexture(TexturesGtBlock.OVERLAY_REACTOR_COLDTRAP_TOP) }); } - public GregtechMetaTileEntity_ReactorColdTrap( - String aName, int aTier, String aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName) { + public GregtechMetaTileEntity_ReactorColdTrap(String aName, int aTier, String aDescription, + ITexture[][][] aTextures, String aGUIName, String aNEIName) { super(aName, aTier, 1, aDescription, aTextures, 2, 9, aGUIName, aNEIName); } @Override public String[] getDescription() { - return new String[] {this.mDescription, "Does not require ice cubes", CORE.GT_Tooltip}; + return new String[] { this.mDescription, "Does not require ice cubes", CORE.GT_Tooltip }; } @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new GregtechMetaTileEntity_ReactorColdTrap( - this.mName, this.mTier, this.mDescription, this.mTextures, this.mGUIName, this.mNEIName); + this.mName, + this.mTier, + this.mDescription, + this.mTextures, + this.mGUIName, + this.mNEIName); } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_ReactorProcessingUnit.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_ReactorProcessingUnit.java index 8f8711a7fe..034cebc41c 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_ReactorProcessingUnit.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_ReactorProcessingUnit.java @@ -1,5 +1,8 @@ package gtPlusPlus.xmod.gregtech.common.tileentities.machines.basic; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidStack; + import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; @@ -9,8 +12,6 @@ import gregtech.api.util.GTPP_Recipe; import gregtech.api.util.GT_Recipe; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; -import net.minecraft.item.ItemStack; -import net.minecraftforge.fluids.FluidStack; public class GregtechMetaTileEntity_ReactorProcessingUnit extends GT_MetaTileEntity_BasicMachine { @@ -26,32 +27,35 @@ public class GregtechMetaTileEntity_ReactorProcessingUnit extends GT_MetaTileEnt 9, "Dehydrator.png", "", - new ITexture[] { - new GT_RenderedTexture(TexturesGtBlock.OVERLAY_REACTOR_PROCESSINGUNIT_SIDE_ACTIVE), - new GT_RenderedTexture(TexturesGtBlock.OVERLAY_REACTOR_PROCESSINGUNIT_SIDE), - new GT_RenderedTexture(TexturesGtBlock.OVERLAY_REACTOR_PROCESSINGUNIT_FRONT_ACTIVE), - new GT_RenderedTexture(TexturesGtBlock.OVERLAY_REACTOR_PROCESSINGUNIT_FRONT), - new GT_RenderedTexture(TexturesGtBlock.OVERLAY_REACTOR_PROCESSINGUNIT_TOP_ACTIVE), - new GT_RenderedTexture(TexturesGtBlock.OVERLAY_REACTOR_PROCESSINGUNIT_TOP), - new GT_RenderedTexture(TexturesGtBlock.OVERLAY_REACTOR_PROCESSINGUNIT_TOP_ACTIVE), - new GT_RenderedTexture(TexturesGtBlock.OVERLAY_REACTOR_PROCESSINGUNIT_TOP) - }); + new ITexture[] { new GT_RenderedTexture(TexturesGtBlock.OVERLAY_REACTOR_PROCESSINGUNIT_SIDE_ACTIVE), + new GT_RenderedTexture(TexturesGtBlock.OVERLAY_REACTOR_PROCESSINGUNIT_SIDE), + new GT_RenderedTexture(TexturesGtBlock.OVERLAY_REACTOR_PROCESSINGUNIT_FRONT_ACTIVE), + new GT_RenderedTexture(TexturesGtBlock.OVERLAY_REACTOR_PROCESSINGUNIT_FRONT), + new GT_RenderedTexture(TexturesGtBlock.OVERLAY_REACTOR_PROCESSINGUNIT_TOP_ACTIVE), + new GT_RenderedTexture(TexturesGtBlock.OVERLAY_REACTOR_PROCESSINGUNIT_TOP), + new GT_RenderedTexture(TexturesGtBlock.OVERLAY_REACTOR_PROCESSINGUNIT_TOP_ACTIVE), + new GT_RenderedTexture(TexturesGtBlock.OVERLAY_REACTOR_PROCESSINGUNIT_TOP) }); } - public GregtechMetaTileEntity_ReactorProcessingUnit( - String aName, int aTier, String aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName) { + public GregtechMetaTileEntity_ReactorProcessingUnit(String aName, int aTier, String aDescription, + ITexture[][][] aTextures, String aGUIName, String aNEIName) { super(aName, aTier, 1, aDescription, aTextures, 2, 9, aGUIName, aNEIName); } @Override public String[] getDescription() { - return new String[] {this.mDescription, CORE.GT_Tooltip}; + return new String[] { this.mDescription, CORE.GT_Tooltip }; } @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new GregtechMetaTileEntity_ReactorProcessingUnit( - this.mName, this.mTier, this.mDescription, this.mTextures, this.mGUIName, this.mNEIName); + this.mName, + this.mTier, + this.mDescription, + this.mTextures, + this.mGUIName, + this.mNEIName); } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaWirelessCharger.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaWirelessCharger.java index db74a46f1b..5d4f755408 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaWirelessCharger.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaWirelessCharger.java @@ -1,5 +1,13 @@ package gtPlusPlus.xmod.gregtech.common.tileentities.machines.basic; +import java.util.*; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; + import gregtech.api.enums.GT_Values; import gregtech.api.enums.Textures; import gregtech.api.interfaces.ITexture; @@ -15,12 +23,6 @@ import gtPlusPlus.core.util.minecraft.PlayerUtils; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMetaTileEntity; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; import gtPlusPlus.xmod.gregtech.common.helpers.ChargingHelper; -import java.util.*; -import net.minecraft.entity.Entity; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; public class GregtechMetaWirelessCharger extends GregtechMetaTileEntity { @@ -29,40 +31,26 @@ public class GregtechMetaWirelessCharger extends GregtechMetaTileEntity { public int mMode = 0; public boolean mLocked = true; - public GregtechMetaWirelessCharger( - final int aID, - final String aName, - final String aNameRegional, - final int aTier, - final String aDescription, - final int aSlotCount) { + public GregtechMetaWirelessCharger(final int aID, final String aName, final String aNameRegional, final int aTier, + final String aDescription, final int aSlotCount) { super(aID, aName, aNameRegional, aTier, aSlotCount, aDescription); } - public GregtechMetaWirelessCharger( - final String aName, - final int aTier, - final String aDescription, - final ITexture[][][] aTextures, - final int aSlotCount) { + public GregtechMetaWirelessCharger(final String aName, final int aTier, final String aDescription, + final ITexture[][][] aTextures, final int aSlotCount) { super(aName, aTier, aSlotCount, aDescription, aTextures); } @Override public String[] getDescription() { - return new String[] { - this.mDescription, - "Can be locked to the owner by sneaking with a screwdriver", - "Can also be locked with a lock upgrade", - "", - "3 Modes, Long-Range, Local and Mixed.", - "Long-Range: Can supply 2A of power to a single player up to " + (GT_Values.V[this.mTier] * 4) + "m away.", - "Local: Can supply several Amps to each player within " + this.mTier * 20 + "m.", - "Mixed: Provides both 2A of long range and 1A per player locally.", - "Mixed mode is more conservative of power and as a result only", - "Gets half the distances each singular mode gets.", - CORE.GT_Tooltip - }; + return new String[] { this.mDescription, "Can be locked to the owner by sneaking with a screwdriver", + "Can also be locked with a lock upgrade", "", "3 Modes, Long-Range, Local and Mixed.", + "Long-Range: Can supply 2A of power to a single player up to " + (GT_Values.V[this.mTier] * 4) + + "m away.", + "Local: Can supply several Amps to each player within " + this.mTier * 20 + "m.", + "Mixed: Provides both 2A of long range and 1A per player locally.", + "Mixed mode is more conservative of power and as a result only", + "Gets half the distances each singular mode gets.", CORE.GT_Tooltip }; } public int getTier() { @@ -104,91 +92,61 @@ public class GregtechMetaWirelessCharger extends GregtechMetaTileEntity { } @Override - public ITexture[] getTexture( - final IGregTechTileEntity aBaseMetaTileEntity, - final byte aSide, - final byte aFacing, - final byte aColorIndex, - final boolean aActive, - final boolean aRedstone) { - return this.mTextures[ - (aActive ? 5 : 0) - + (aSide == aFacing - ? 0 - : aSide == GT_Utility.getOppositeSide(aFacing) - ? 1 - : aSide == 0 ? 2 : aSide == 1 ? 3 : 4)][ - aColorIndex + 1]; + public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing, + final byte aColorIndex, final boolean aActive, final boolean aRedstone) { + return this.mTextures[(aActive ? 5 : 0) + (aSide == aFacing ? 0 + : aSide == GT_Utility.getOppositeSide(aFacing) ? 1 : aSide == 0 ? 2 : aSide == 1 ? 3 : 4)][aColorIndex + + 1]; } public ITexture[] getFront(final byte aColor) { - return new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], - new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Screen_2) - }; + return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], + new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Screen_2) }; } public ITexture[] getBack(final byte aColor) { - return new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], - new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom) - }; + return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], + new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom) }; } public ITexture[] getBottom(final byte aColor) { - return new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], - new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom) - }; + return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], + new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom) }; } public ITexture[] getTop(final byte aColor) { - return new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], - new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom) - }; + return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], + new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom) }; } public ITexture[] getSides(final byte aColor) { - return new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], - new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom) - }; + return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], + new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom) }; } public ITexture[] getFrontActive(final byte aColor) { - return new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], - new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Screen_2) - }; + return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], + new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Screen_2) }; } public ITexture[] getBackActive(final byte aColor) { - return new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], - new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom) - }; + return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], + new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom) }; } public ITexture[] getBottomActive(final byte aColor) { - return new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], - new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom) - }; + return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], + new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom) }; } public ITexture[] getTopActive(final byte aColor) { - return new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], - new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom) - }; + return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], + new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom) }; } public ITexture[] getSidesActive(final byte aColor) { - return new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], - new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom) - }; + return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], + new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom) }; } @Override @@ -229,7 +187,11 @@ public class GregtechMetaWirelessCharger extends GregtechMetaTileEntity { @Override public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) { return new GregtechMetaWirelessCharger( - this.mName, this.mTier, this.mDescription, this.mTextures, this.mInventory.length); + this.mName, + this.mTier, + this.mDescription, + this.mTextures, + this.mInventory.length); } @Override @@ -362,20 +324,20 @@ public class GregtechMetaWirelessCharger extends GregtechMetaTileEntity { } @Override - public boolean allowPullStack( - final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, final ItemStack aStack) { + public boolean allowPullStack(final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, + final ItemStack aStack) { return false; } @Override - public boolean allowPutStack( - final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, final ItemStack aStack) { + public boolean allowPutStack(final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, + final ItemStack aStack) { return false; } @Override public String[] getInfoData() { - return new String[] {this.getLocalName()}; + return new String[] { this.getLocalName() }; } @Override @@ -537,8 +499,8 @@ public class GregtechMetaWirelessCharger extends GregtechMetaTileEntity { } } if (this.mMode == 0 || this.mMode == 2) { - int tempRange = (int) - (this.mMode == 0 ? 4 * GT_Values.V[this.mTier] : 2 * GT_Values.V[this.mTier]); + int tempRange = (int) (this.mMode == 0 ? 4 * GT_Values.V[this.mTier] + : 2 * GT_Values.V[this.mTier]); if (getDistanceBetweenTwoPositions(getTileEntityPosition(), getPositionOfEntity(mTemp)) <= tempRange) { if (!mWirelessChargingMap.containsKey(mTemp.getDisplayName())) { @@ -562,24 +524,19 @@ public class GregtechMetaWirelessCharger extends GregtechMetaTileEntity { } } } - /*if (this.mMode == 0 || this.mMode == 2){ - int tempRange = (int) (this.mMode == 0 ? 4*GT_Values.V[this.mTier] : 2*GT_Values.V[this.mTier]); - if (getDistanceBetweenTwoPositions(getTileEntityPosition(), getPositionOfEntity(mTemp)) < tempRange){ - if (!mWirelessChargingMap.containsKey(mTemp)){ - mWirelessChargingMap.put(mTemp, mTemp.getPersistentID()); - PlayerUtils.messagePlayer(mTemp, "You have entered charging range. ["+tempRange+"m]."); - ChargingHelper.addValidPlayer(mTemp, this); - } - } - else { - if (mWirelessChargingMap.containsKey(mTemp)){ - if (mWirelessChargingMap.remove(mTemp) != null){ - PlayerUtils.messagePlayer(mTemp, "You have left charging range. ["+tempRange+"m]."); - ChargingHelper.removeValidPlayer(mTemp, this); - } - } - } - } */ + /* + * if (this.mMode == 0 || this.mMode == 2){ int tempRange = (int) (this.mMode == 0 ? + * 4*GT_Values.V[this.mTier] : 2*GT_Values.V[this.mTier]); if + * (getDistanceBetweenTwoPositions(getTileEntityPosition(), getPositionOfEntity(mTemp)) < + * tempRange){ if (!mWirelessChargingMap.containsKey(mTemp)){ + * mWirelessChargingMap.put(mTemp, mTemp.getPersistentID()); + * PlayerUtils.messagePlayer(mTemp, "You have entered charging range. ["+tempRange+"m]."); + * ChargingHelper.addValidPlayer(mTemp, this); } } else { if + * (mWirelessChargingMap.containsKey(mTemp)){ if (mWirelessChargingMap.remove(mTemp) != + * null){ PlayerUtils.messagePlayer(mTemp, + * "You have left charging range. ["+tempRange+"m]."); + * ChargingHelper.removeValidPlayer(mTemp, this); } } } } + */ } } @@ -607,12 +564,13 @@ public class GregtechMetaWirelessCharger extends GregtechMetaTileEntity { if (objectA == null || objectB == null) { return 0f; } - int[] objectArray1 = new int[] {objectA.xPos, objectA.yPos, objectA.zPos}; - int[] objectArray2 = new int[] {objectB.xPos, objectB.yPos, objectB.zPos}; + int[] objectArray1 = new int[] { objectA.xPos, objectA.yPos, objectA.zPos }; + int[] objectArray2 = new int[] { objectB.xPos, objectB.yPos, objectB.zPos }; - final double distance = Math.sqrt((objectArray2[0] - objectArray1[0]) * (objectArray2[0] - objectArray1[0]) - + (objectArray2[1] - objectArray1[1]) * (objectArray2[1] - objectArray1[1]) - + (objectArray2[2] - objectArray1[2]) * (objectArray2[2] - objectArray1[2])); + final double distance = Math.sqrt( + (objectArray2[0] - objectArray1[0]) * (objectArray2[0] - objectArray1[0]) + + (objectArray2[1] - objectArray1[1]) * (objectArray2[1] - objectArray1[1]) + + (objectArray2[2] - objectArray1[2]) * (objectArray2[2] - objectArray1[2])); return distance; } @@ -636,8 +594,8 @@ public class GregtechMetaWirelessCharger extends GregtechMetaTileEntity { } @Override - public boolean onRightclick( - IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer, byte aSide, float aX, float aY, float aZ) { + public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer, byte aSide, float aX, + float aY, float aZ) { int tempRange; @@ -648,8 +606,8 @@ public class GregtechMetaWirelessCharger extends GregtechMetaTileEntity { } if (this.mMode == 2) { - PlayerUtils.messagePlayer( - aPlayer, "Mixed Mode | Local: " + this.mTier * 10 + "m | Long: " + tempRange + "m"); + PlayerUtils + .messagePlayer(aPlayer, "Mixed Mode | Local: " + this.mTier * 10 + "m | Long: " + tempRange + "m"); PlayerUtils.messagePlayer(aPlayer, "Players with access:"); for (String name : this.getLocalMap().keySet()) { PlayerUtils.messagePlayer(aPlayer, "Local: " + name); diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/misc/GMTE_AmazonPackager.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/misc/GMTE_AmazonPackager.java index bf9e9f3d94..a27509b284 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/misc/GMTE_AmazonPackager.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/misc/GMTE_AmazonPackager.java @@ -6,10 +6,16 @@ import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose import static gregtech.api.enums.GT_HatchElement.*; import static gregtech.api.util.GT_StructureUtility.buildHatchAdder; +import java.util.ArrayList; + +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidStack; + import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable; import com.gtnewhorizon.structurelib.structure.IStructureDefinition; import com.gtnewhorizon.structurelib.structure.ISurvivalBuildEnvironment; import com.gtnewhorizon.structurelib.structure.StructureDefinition; + import gregtech.api.enums.GT_Values; import gregtech.api.enums.ItemList; import gregtech.api.enums.TAE; @@ -27,9 +33,6 @@ import gtPlusPlus.core.block.ModBlocks; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; -import java.util.ArrayList; -import net.minecraft.item.ItemStack; -import net.minecraftforge.fluids.FluidStack; public class GMTE_AmazonPackager extends GregtechMeta_MultiBlockBase<GMTE_AmazonPackager> implements ISurvivalConstructable { @@ -62,18 +65,16 @@ public class GMTE_AmazonPackager extends GregtechMeta_MultiBlockBase<GMTE_Amazon public IStructureDefinition<GMTE_AmazonPackager> getStructureDefinition() { if (STRUCTURE_DEFINITION == null) { STRUCTURE_DEFINITION = StructureDefinition.<GMTE_AmazonPackager>builder() - .addShape(mName, transpose(new String[][] { - {"CCC", "CCC", "CCC"}, - {"C~C", "C-C", "CCC"}, - {"CCC", "CCC", "CCC"}, - })) + .addShape( + mName, + transpose( + new String[][] { { "CCC", "CCC", "CCC" }, { "C~C", "C-C", "CCC" }, + { "CCC", "CCC", "CCC" }, })) .addElement( 'C', buildHatchAdder(GMTE_AmazonPackager.class) .atLeast(InputBus, OutputBus, Maintenance, Energy, Muffler) - .casingIndex(TAE.getIndexFromPage(2, 9)) - .dot(1) - .buildAndChain( + .casingIndex(TAE.getIndexFromPage(2, 9)).dot(1).buildAndChain( onElementPass(x -> ++x.mCasing, ofBlock(ModBlocks.blockCasings3Misc, 9)))) .build(); } @@ -83,26 +84,17 @@ public class GMTE_AmazonPackager extends GregtechMeta_MultiBlockBase<GMTE_Amazon @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType(getMachineType()) - .addInfo("Controller Block for the Amazon Warehouse") + tt.addMachineType(getMachineType()).addInfo("Controller Block for the Amazon Warehouse") .addInfo("This Multiblock is used for EXTREME packaging requirements") .addInfo("Dust Schematics are inserted into the input busses") .addInfo("If inserted into the controller, it is shared across all busses") .addInfo("1x, 2x, 3x & Other Schematics are to be placed into the controller GUI slot") .addInfo("500% faster than using single block machines of the same voltage") - .addInfo("Only uses 75% of the EU/t normally required") - .addInfo("Processes 16 items per voltage tier") - .addPollutionAmount(getPollutionPerSecond(null)) - .addSeparator() - .beginStructureBlock(3, 3, 3, true) - .addController("Front center") - .addCasingInfo("Supply Depot Casings", 10) - .addInputBus("Any casing", 1) - .addOutputBus("Any casing", 1) - .addEnergyHatch("Any casing", 1) - .addMaintenanceHatch("Any casing", 1) - .addMufflerHatch("Any casing", 1) - .toolTipFinisher("GT++"); + .addInfo("Only uses 75% of the EU/t normally required").addInfo("Processes 16 items per voltage tier") + .addPollutionAmount(getPollutionPerSecond(null)).addSeparator().beginStructureBlock(3, 3, 3, true) + .addController("Front center").addCasingInfo("Supply Depot Casings", 10).addInputBus("Any casing", 1) + .addOutputBus("Any casing", 1).addEnergyHatch("Any casing", 1).addMaintenanceHatch("Any casing", 1) + .addMufflerHatch("Any casing", 1).toolTipFinisher("GT++"); return tt; } @@ -177,12 +169,11 @@ public class GMTE_AmazonPackager extends GregtechMeta_MultiBlockBase<GMTE_Amazon } public boolean checkRecipe(ItemStack inputStack, ItemStack schematicStack) { - if (GT_Utility.isStackValid((Object) inputStack) - && GT_Utility.isStackValid((Object) schematicStack) + if (GT_Utility.isStackValid((Object) inputStack) && GT_Utility.isStackValid((Object) schematicStack) && GT_Utility.getContainerItem(inputStack, true) == null) { ItemStack tOutputStack; if (ItemList.Schematic_1by1.isStackEqual((Object) schematicStack) && inputStack.stackSize >= 1) { - tOutputStack = GT_ModHandler.getRecipeOutput(new ItemStack[] {inputStack}); + tOutputStack = GT_ModHandler.getRecipeOutput(new ItemStack[] { inputStack }); if (tOutputStack != null && this.allowPutStack(tOutputStack, schematicStack)) { final ItemStack input = inputStack; --input.stackSize; @@ -195,8 +186,8 @@ public class GMTE_AmazonPackager extends GregtechMeta_MultiBlockBase<GMTE_Amazon } return false; } else if (ItemList.Schematic_2by2.isStackEqual((Object) schematicStack) && inputStack.stackSize >= 4) { - tOutputStack = GT_ModHandler.getRecipeOutput( - new ItemStack[] {inputStack, inputStack, null, inputStack, inputStack}); + tOutputStack = GT_ModHandler + .getRecipeOutput(new ItemStack[] { inputStack, inputStack, null, inputStack, inputStack }); if (tOutputStack != null && this.allowPutStack(tOutputStack, schematicStack)) { final ItemStack input2 = inputStack; input2.stackSize -= 4; @@ -209,17 +200,9 @@ public class GMTE_AmazonPackager extends GregtechMeta_MultiBlockBase<GMTE_Amazon } return false; } else if (ItemList.Schematic_3by3.isStackEqual((Object) schematicStack) && inputStack.stackSize >= 9) { - tOutputStack = GT_ModHandler.getRecipeOutput(new ItemStack[] { - inputStack, - inputStack, - inputStack, - inputStack, - inputStack, - inputStack, - inputStack, - inputStack, - inputStack - }); + tOutputStack = GT_ModHandler.getRecipeOutput( + new ItemStack[] { inputStack, inputStack, inputStack, inputStack, inputStack, inputStack, + inputStack, inputStack, inputStack }); if (tOutputStack != null && this.allowPutStack(tOutputStack, schematicStack)) { final ItemStack input3 = inputStack; input3.stackSize -= 9; @@ -245,30 +228,26 @@ public class GMTE_AmazonPackager extends GregtechMeta_MultiBlockBase<GMTE_Amazon } // Something if (GT_Recipe.GT_Recipe_Map.sBoxinatorRecipes.findRecipe( - (IHasWorldObjectAndCoords) this.getBaseMetaTileEntity(), - true, - GT_Values.V[this.mTier], - (FluidStack[]) null, - new ItemStack[] {GT_Utility.copyAmount(64L, new Object[] {aStack}), schematicStack}) - != null) { + (IHasWorldObjectAndCoords) this.getBaseMetaTileEntity(), + true, + GT_Values.V[this.mTier], + (FluidStack[]) null, + new ItemStack[] { GT_Utility.copyAmount(64L, new Object[] { aStack }), schematicStack }) != null) { return true; } // 1x1 if (ItemList.Schematic_1by1.isStackEqual((Object) schematicStack) - && GT_ModHandler.getRecipeOutput(new ItemStack[] {aStack}) != null) { + && GT_ModHandler.getRecipeOutput(new ItemStack[] { aStack }) != null) { return true; } // 2x2 if (ItemList.Schematic_2by2.isStackEqual((Object) schematicStack) - && GT_ModHandler.getRecipeOutput(new ItemStack[] {aStack, aStack, null, aStack, aStack}) != null) { + && GT_ModHandler.getRecipeOutput(new ItemStack[] { aStack, aStack, null, aStack, aStack }) != null) { return true; } // 3x3 - if (ItemList.Schematic_3by3.isStackEqual((Object) schematicStack) - && GT_ModHandler.getRecipeOutput( - new ItemStack[] {aStack, aStack, aStack, aStack, aStack, aStack, aStack, aStack, aStack - }) - != null) { + if (ItemList.Schematic_3by3.isStackEqual((Object) schematicStack) && GT_ModHandler.getRecipeOutput( + new ItemStack[] { aStack, aStack, aStack, aStack, aStack, aStack, aStack, aStack, aStack }) != null) { return true; } return false; diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/misc/GregtechMTE_TeslaTower.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/misc/GregtechMTE_TeslaTower.java index 1805c3dba4..a5dd84c92d 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/misc/GregtechMTE_TeslaTower.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/misc/GregtechMTE_TeslaTower.java @@ -2,7 +2,23 @@ package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.misc; import static gregtech.api.enums.GT_Values.W; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.UUID; + +import net.minecraft.block.Block; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; + import com.gtnewhorizon.structurelib.structure.IStructureDefinition; + import gregtech.api.GregTech_API; import gregtech.api.enums.TAE; import gregtech.api.interfaces.IIconContainer; @@ -21,19 +37,6 @@ import gtPlusPlus.core.util.minecraft.PlayerUtils; import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.UUID; -import net.minecraft.block.Block; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.item.EntityItem; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.world.World; -import net.minecraftforge.common.util.ForgeDirection; public class GregtechMTE_TeslaTower extends GregtechMeta_MultiBlockBase<GregtechMTE_TeslaTower> { @@ -49,9 +52,7 @@ public class GregtechMTE_TeslaTower extends GregtechMeta_MultiBlockBase<Gregtech protected int mRange; /** - * Machine Mode, - * {@value false} Attacks all entities, - * {@value true} Only attacks players. + * Machine Mode, {@value false} Attacks all entities, {@value true} Only attacks players. */ protected volatile boolean mMode = false; @@ -75,40 +76,28 @@ public class GregtechMTE_TeslaTower extends GregtechMeta_MultiBlockBase<Gregtech return "Weaponized Lighting Rod"; } - /*@Override - public String[] getTooltip() { - String casings = getCasingBlockItem().get(0).getDisplayName(); - return new String[]{ - "Controller Block for the Tesla Defence Tower Mk3200", - "Enemies within "+this.mRange+"m are blasted with a high energy plasma.", - "This uses 5,000,000EU per blast.", - "Can screwdriver to toggle mode between Players and all Entities.", - "Size(WxHxD): 3x7x3", "Controller (Front middle at bottom)", - "3x1x3 Base of " + casings, - "1x3x1 " + casings + " pillar (Center of base)", - "1x3x1 " + MaterialUtils.getMaterialName(getFrameMaterial()) + " Frame Boxes (Each pillar side and on top)", - "1x Maintenance Hatch (One of base casings)", - "1x " + VN[getMinTier()] + "+ Energy Hatch (Any bottom layer casing)"}; - }*/ + /* + * @Override public String[] getTooltip() { String casings = getCasingBlockItem().get(0).getDisplayName(); return + * new String[]{ "Controller Block for the Tesla Defence Tower Mk3200", + * "Enemies within "+this.mRange+"m are blasted with a high energy plasma.", "This uses 5,000,000EU per blast.", + * "Can screwdriver to toggle mode between Players and all Entities.", "Size(WxHxD): 3x7x3", + * "Controller (Front middle at bottom)", "3x1x3 Base of " + casings, "1x3x1 " + casings + + * " pillar (Center of base)", "1x3x1 " + MaterialUtils.getMaterialName(getFrameMaterial()) + + * " Frame Boxes (Each pillar side and on top)", "1x Maintenance Hatch (One of base casings)", "1x " + + * VN[getMinTier()] + "+ Energy Hatch (Any bottom layer casing)"}; } + */ @Override protected final GT_Multiblock_Tooltip_Builder createTooltip() { GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType(getMachineType()) - .addInfo("Controller Block for the Tesla Defence Tower Mk3200") + tt.addMachineType(getMachineType()).addInfo("Controller Block for the Tesla Defence Tower Mk3200") .addInfo("Enemies within " + this.mRange + "m are blasted with a high energy plasma.") .addInfo("This uses 5,000,000EU per blast.") - .addInfo("Can screwdriver to toggle mode between Players and all Entities.") - .addSeparator() - .beginStructureBlock(1, 7, 1, false) - .addController("Top Middle") - .addCasingInfo("Casing", 360) - .addOtherStructurePart("Rotor Assembly", "Any 1 dot hint", 1) - .addInputBus("Any 4 dot hint (min 1)", 4) - .addInputHatch("Any 4 dot hint(min 1)", 4) - .addOutputHatch("Any 4 dot hint(min 1)", 4) - .addEnergyHatch("Any 4 dot hint(min 1)", 4) - .addMaintenanceHatch("Any 4 dot hint(min 1)", 4) + .addInfo("Can screwdriver to toggle mode between Players and all Entities.").addSeparator() + .beginStructureBlock(1, 7, 1, false).addController("Top Middle").addCasingInfo("Casing", 360) + .addOtherStructurePart("Rotor Assembly", "Any 1 dot hint", 1).addInputBus("Any 4 dot hint (min 1)", 4) + .addInputHatch("Any 4 dot hint(min 1)", 4).addOutputHatch("Any 4 dot hint(min 1)", 4) + .addEnergyHatch("Any 4 dot hint(min 1)", 4).addMaintenanceHatch("Any 4 dot hint(min 1)", 4) .toolTipFinisher(CORE.GT_Tooltip_Builder); return tt; } @@ -181,8 +170,7 @@ public class GregtechMTE_TeslaTower extends GregtechMeta_MultiBlockBase<Gregtech if (xOff == 0 && zOff == 0) continue; IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xOff, 0, zOff); - if (!checkCasingBlock(xOff, 0, zOff) - && !addMaintenanceToMachineList(tTileEntity, casingTextureIndex) + if (!checkCasingBlock(xOff, 0, zOff) && !addMaintenanceToMachineList(tTileEntity, casingTextureIndex) && !addEnergyInputToMachineList(tTileEntity, casingTextureIndex)) { Logger.INFO("bad block"); return false; @@ -226,6 +214,7 @@ public class GregtechMTE_TeslaTower extends GregtechMeta_MultiBlockBase<Gregtech Logger.INFO("Looking For Casing."); return checkBlockAndMetaOffset(xOff, yOff, zOff, casingBlock, casingMeta); } + // meta of frame is getTileEntityBaseType; frame should be checked using its drops (possible a high weight // operation) protected boolean checkFrameBlock(int xOff, int yOff, int zOff) { @@ -238,8 +227,10 @@ public class GregtechMTE_TeslaTower extends GregtechMeta_MultiBlockBase<Gregtech } private boolean checkBlockAndMeta(int x, int y, int z, Block block, int meta) { - Logger.INFO("Found: " + getBaseMetaTileEntity().getBlock(x, y, z).getLocalizedName() + " | Meta: " - + getBaseMetaTileEntity().getMetaID(x, y, z)); + Logger.INFO( + "Found: " + getBaseMetaTileEntity().getBlock(x, y, z).getLocalizedName() + + " | Meta: " + + getBaseMetaTileEntity().getMetaID(x, y, z)); Logger.INFO("Expected: " + block.getLocalizedName() + " | Meta: " + meta); return (meta == W || getBaseMetaTileEntity().getMetaID(x, y, z) == meta) && getBaseMetaTileEntity().getBlock(x, y, z) == block; @@ -352,22 +343,17 @@ public class GregtechMTE_TeslaTower extends GregtechMeta_MultiBlockBase<Gregtech if (!this.mMode) { mInRange.put( new Pair<Long, Long>( - ((Entity) r) - .getUniqueID() - .getMostSignificantBits(), - ((Entity) r) - .getUniqueID() + ((Entity) r).getUniqueID().getMostSignificantBits(), + ((Entity) r).getUniqueID() .getLeastSignificantBits()), (Entity) r); } else { if (r instanceof EntityPlayer) { mInRange.put( new Pair<Long, Long>( - ((Entity) r) - .getUniqueID() + ((Entity) r).getUniqueID() .getMostSignificantBits(), - ((Entity) r) - .getUniqueID() + ((Entity) r).getUniqueID() .getLeastSignificantBits()), (Entity) r); } @@ -415,13 +401,19 @@ public class GregtechMTE_TeslaTower extends GregtechMeta_MultiBlockBase<Gregtech // if (world.canLightningStrikeAt(j1, l1+1, k1)){ // if (isEnergyEnough() && world.addWeatherEffect(new // EntityTeslaTowerLightning(world, (double)j1, (double)l1, (double)k1))){ - if (isEnergyEnough() - && world.addWeatherEffect(new EntityTeslaTowerLightning( - world, (double) j1, (double) l1, (double) k1, f, getOwner()))) { + if (isEnergyEnough() && world.addWeatherEffect( + new EntityTeslaTowerLightning( + world, + (double) j1, + (double) l1, + (double) k1, + f, + getOwner()))) { if (f == null || f.isDead || !f.isEntityAlive()) { - this.mInRange.remove(new Pair<Long, Long>( - f.getUniqueID().getMostSignificantBits(), - f.getUniqueID().getLeastSignificantBits())); + this.mInRange.remove( + new Pair<Long, Long>( + f.getUniqueID().getMostSignificantBits(), + f.getUniqueID().getLeastSignificantBits())); } this.setEUVar(this.getEUVar() - 5000000); } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialAlloySmelter.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialAlloySmelter.java index 0dc2303a0e..4f09cdcba0 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialAlloySmelter.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialAlloySmelter.java @@ -7,10 +7,16 @@ import static gregtech.api.enums.GT_HatchElement.*; import static gregtech.api.util.GT_StructureUtility.buildHatchAdder; import static gregtech.api.util.GT_StructureUtility.ofCoil; +import java.util.ArrayList; + +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidStack; + import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable; import com.gtnewhorizon.structurelib.structure.IStructureDefinition; import com.gtnewhorizon.structurelib.structure.ISurvivalBuildEnvironment; import com.gtnewhorizon.structurelib.structure.StructureDefinition; + import gregtech.api.enums.HeatingCoilLevel; import gregtech.api.enums.TAE; import gregtech.api.enums.Textures; @@ -27,13 +33,9 @@ import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.block.ModBlocks; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase; -import java.util.ArrayList; -import net.minecraft.item.ItemStack; -import net.minecraftforge.fluids.FluidStack; -public class GregtechMetaTileEntity_IndustrialAlloySmelter - extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_IndustrialAlloySmelter> - implements ISurvivalConstructable { +public class GregtechMetaTileEntity_IndustrialAlloySmelter extends + GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_IndustrialAlloySmelter> implements ISurvivalConstructable { public static int CASING_TEXTURE_ID; private HeatingCoilLevel mHeatingCapacity; @@ -102,25 +104,16 @@ public class GregtechMetaTileEntity_IndustrialAlloySmelter @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType(getMachineType()) - .addInfo("Controller Block for the Industrial Alloy Smelter") - .addInfo("Gains one parallel per voltage tier") - .addInfo("Gains one multiplier per coil tier") - .addInfo("Parallel = Tier * Coil Tier") - .addInfo("Gains 5% speed bonus per coil tier") - .addPollutionAmount(getPollutionPerSecond(null)) - .addSeparator() - .beginStructureBlock(3, 5, 3, true) - .addController("Bottom center") - .addCasingInfo("Inconel Reinforced Casings", 8) - .addCasingInfo("Integral Encasement V", 8) - .addCasingInfo("Heating Coils", 16) - .addInputBus("Any Inconel Reinforced Casing", 1) - .addOutputBus("Any Inconel Reinforced Casing", 1) + tt.addMachineType(getMachineType()).addInfo("Controller Block for the Industrial Alloy Smelter") + .addInfo("Gains one parallel per voltage tier").addInfo("Gains one multiplier per coil tier") + .addInfo("Parallel = Tier * Coil Tier").addInfo("Gains 5% speed bonus per coil tier") + .addPollutionAmount(getPollutionPerSecond(null)).addSeparator().beginStructureBlock(3, 5, 3, true) + .addController("Bottom center").addCasingInfo("Inconel Reinforced Casings", 8) + .addCasingInfo("Integral Encasement V", 8).addCasingInfo("Heating Coils", 16) + .addInputBus("Any Inconel Reinforced Casing", 1).addOutputBus("Any Inconel Reinforced Casing", 1) .addEnergyHatch("Any Inconel Reinforced Casing", 1) .addMaintenanceHatch("Any Inconel Reinforced Casing", 1) - .addMufflerHatch("Any Inconel Reinforced Casing", 1) - .toolTipFinisher(CORE.GT_Tooltip_Builder); + .addMufflerHatch("Any Inconel Reinforced Casing", 1).toolTipFinisher(CORE.GT_Tooltip_Builder); return tt; } @@ -128,28 +121,24 @@ public class GregtechMetaTileEntity_IndustrialAlloySmelter public IStructureDefinition<GregtechMetaTileEntity_IndustrialAlloySmelter> getStructureDefinition() { if (STRUCTURE_DEFINITION == null) { STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_IndustrialAlloySmelter>builder() - .addShape(mName, transpose(new String[][] { - {"CCC", "CCC", "CCC"}, - {"HHH", "H-H", "HHH"}, - {"VVV", "V-V", "VVV"}, - {"HHH", "H-H", "HHH"}, - {"C~C", "CCC", "CCC"}, - })) + .addShape( + mName, + transpose( + new String[][] { { "CCC", "CCC", "CCC" }, { "HHH", "H-H", "HHH" }, + { "VVV", "V-V", "VVV" }, { "HHH", "H-H", "HHH" }, + { "C~C", "CCC", "CCC" }, })) .addElement( 'C', buildHatchAdder(GregtechMetaTileEntity_IndustrialAlloySmelter.class) .atLeast(InputBus, OutputBus, Maintenance, Energy, Muffler) - .casingIndex(CASING_TEXTURE_ID) - .dot(1) - .buildAndChain( + .casingIndex(CASING_TEXTURE_ID).dot(1).buildAndChain( onElementPass(x -> ++x.mCasing, ofBlock(ModBlocks.blockCasings3Misc, 1)))) .addElement( 'H', ofCoil( GregtechMetaTileEntity_IndustrialAlloySmelter::setCoilLevel, GregtechMetaTileEntity_IndustrialAlloySmelter::getCoilLevel)) - .addElement('V', ofBlock(ModBlocks.blockCasingsTieredGTPP, 4)) - .build(); + .addElement('V', ofBlock(ModBlocks.blockCasingsTieredGTPP, 4)).build(); } return STRUCTURE_DEFINITION; } @@ -170,8 +159,7 @@ public class GregtechMetaTileEntity_IndustrialAlloySmelter mCasing = 0; mLevel = 0; setCoilLevel(HeatingCoilLevel.None); - return checkPiece(mName, 1, 4, 0) - && mCasing >= 8 + return checkPiece(mName, 1, 4, 0) && mCasing >= 8 && getCoilLevel() != HeatingCoilLevel.None && (mLevel = getCoilLevel().getTier() + 1) > 0 && checkHatch(); @@ -210,13 +198,8 @@ public class GregtechMetaTileEntity_IndustrialAlloySmelter } @Override - public boolean checkRecipeGeneric( - ItemStack[] aItemInputs, - FluidStack[] aFluidInputs, - int aMaxParallelRecipes, - long aEUPercent, - int aSpeedBonusPercent, - int aOutputChanceRoll) { + public boolean checkRecipeGeneric(ItemStack[] aItemInputs, FluidStack[] aFluidInputs, int aMaxParallelRecipes, + long aEUPercent, int aSpeedBonusPercent, int aOutputChanceRoll) { // Based on the Processing Array. A bit overkill, but very flexible. // Reset outputs and progress stats @@ -229,14 +212,13 @@ public class GregtechMetaTileEntity_IndustrialAlloySmelter byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage)); long tEnergy = getMaxInputEnergy(); - GT_Recipe tRecipe = this.getRecipeMap() - .findRecipe( - getBaseMetaTileEntity(), - mLastRecipe, - false, - gregtech.api.enums.GT_Values.V[tTier], - aFluidInputs, - aItemInputs); + GT_Recipe tRecipe = this.getRecipeMap().findRecipe( + getBaseMetaTileEntity(), + mLastRecipe, + false, + gregtech.api.enums.GT_Values.V[tTier], + aFluidInputs, + aItemInputs); // Remember last recipe - an optimization for findRecipe() this.mLastRecipe = tRecipe; @@ -246,14 +228,9 @@ public class GregtechMetaTileEntity_IndustrialAlloySmelter return false; } - GT_ParallelHelper helper = new GT_ParallelHelper() - .setRecipe(tRecipe) - .setItemInputs(aItemInputs) - .setFluidInputs(aFluidInputs) - .setAvailableEUt(tEnergy) - .setMaxParallel(aMaxParallelRecipes) - .enableConsumption() - .enableOutputCalculation(); + GT_ParallelHelper helper = new GT_ParallelHelper().setRecipe(tRecipe).setItemInputs(aItemInputs) + .setFluidInputs(aFluidInputs).setAvailableEUt(tEnergy).setMaxParallel(aMaxParallelRecipes) + .enableConsumption().enableOutputCalculation(); if (!mVoidExcess) { helper.enableVoidProtection(this); } @@ -271,19 +248,13 @@ public class GregtechMetaTileEntity_IndustrialAlloySmelter this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000); this.mEfficiencyIncrease = 10000; - GT_OverclockCalculator calculator = new GT_OverclockCalculator() - .setRecipeEUt(tRecipe.mEUt) - .setEUt(tEnergy) - .setDuration(tRecipe.mDuration) - .setEUtDiscount(aEUPercent / 100.0f) + GT_OverclockCalculator calculator = new GT_OverclockCalculator().setRecipeEUt(tRecipe.mEUt).setEUt(tEnergy) + .setDuration(tRecipe.mDuration).setEUtDiscount(aEUPercent / 100.0f) .setSpeedBoost(100.0f / (100.0f + aSpeedBonusPercent)) - .setParallel(Math.min(aMaxParallelRecipes, helper.getCurrentParallel())) - .enableHeatOC() - .setRecipeHeat(0) + .setParallel(Math.min(aMaxParallelRecipes, helper.getCurrentParallel())).enableHeatOC().setRecipeHeat(0) // Need to multiple by 2 because heat OC is done only once every 1800 and this one does it once every // 900 - .setMultiHeat((int) getCoilLevel().getHeat() * 2) - .calculate(); + .setMultiHeat((int) getCoilLevel().getHeat() * 2).calculate(); lEUt = -calculator.getConsumption(); mMaxProgresstime = (int) Math.ceil(calculator.getDuration() * helper.getDurationMultiplier()); diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialArcFurnace.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialArcFurnace.java index 2d9574a315..1fd7beb384 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialArcFurnace.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialArcFurnace.java @@ -5,10 +5,17 @@ import static com.gtnewhorizon.structurelib.structure.StructureUtility.onElement import static gregtech.api.enums.GT_HatchElement.*; import static gregtech.api.util.GT_StructureUtility.buildHatchAdder; +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.EnumChatFormatting; + import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable; import com.gtnewhorizon.structurelib.structure.IStructureDefinition; import com.gtnewhorizon.structurelib.structure.ISurvivalBuildEnvironment; import com.gtnewhorizon.structurelib.structure.StructureDefinition; + import gregtech.api.GregTech_API; import gregtech.api.enums.TAE; import gregtech.api.interfaces.IIconContainer; @@ -23,15 +30,9 @@ import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.minecraft.PlayerUtils; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; -import net.minecraft.block.Block; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.EnumChatFormatting; -public class GregtechMetaTileEntity_IndustrialArcFurnace - extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_IndustrialArcFurnace> - implements ISurvivalConstructable { +public class GregtechMetaTileEntity_IndustrialArcFurnace extends + GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_IndustrialArcFurnace> implements ISurvivalConstructable { // 862 private static final int mCasingTextureID = TAE.getIndexFromPage(3, 3); @@ -62,24 +63,14 @@ public class GregtechMetaTileEntity_IndustrialArcFurnace @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType(getMachineType()) - .addInfo("Controller Block for Industrial Arc Furnace") + tt.addMachineType(getMachineType()).addInfo("Controller Block for Industrial Arc Furnace") .addInfo("250% faster than using single block machines of the same voltage") .addInfo("Processes 8 items per voltage tier * W/L") - .addInfo("Max Size required to process Plasma recipes") - .addPollutionAmount(getPollutionPerSecond(null)) - .addSeparator() - .addController("Top center") - .addStructureInfo("Size: nx3xn [WxHxL] (Hollow)") - .addStructureInfo("n can be 3, 5 or 7") - .addCasingInfo(mCasingName, 10) - .addInputBus("Any Casing", 1) - .addOutputBus("Any Casing", 1) - .addInputHatch("Any Casing", 1) - .addOutputHatch("Any Casing", 1) - .addEnergyHatch("Any Casing", 1) - .addMaintenanceHatch("Any Casing", 1) - .addMufflerHatch("Any Casing", 1) + .addInfo("Max Size required to process Plasma recipes").addPollutionAmount(getPollutionPerSecond(null)) + .addSeparator().addController("Top center").addStructureInfo("Size: nx3xn [WxHxL] (Hollow)") + .addStructureInfo("n can be 3, 5 or 7").addCasingInfo(mCasingName, 10).addInputBus("Any Casing", 1) + .addOutputBus("Any Casing", 1).addInputHatch("Any Casing", 1).addOutputHatch("Any Casing", 1) + .addEnergyHatch("Any Casing", 1).addMaintenanceHatch("Any Casing", 1).addMufflerHatch("Any Casing", 1) .toolTipFinisher(CORE.GT_Tooltip_Builder); return tt; } @@ -87,29 +78,25 @@ public class GregtechMetaTileEntity_IndustrialArcFurnace @Override public IStructureDefinition<GregtechMetaTileEntity_IndustrialArcFurnace> getStructureDefinition() { if (STRUCTURE_DEFINITION == null) { - STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_IndustrialArcFurnace>builder() - .addShape(mName + "3", new String[][] { - {"CCC", "C~C", "CCC"}, - {"CCC", "C-C", "CCC"}, - {"CCC", "CCC", "CCC"}, - }) - .addShape(mName + "5", new String[][] { - {"CCCCC", "CCCCC", "CC~CC", "CCCCC", "CCCCC"}, - {"CCCCC", "C---C", "C---C", "C---C", "CCCCC"}, - {"CCCCC", "CCCCC", "CCCCC", "CCCCC", "CCCCC"}, - }) - .addShape(mName + "7", new String[][] { - {"CCCCCCC", "CCCCCCC", "CCCCCCC", "CCC~CCC", "CCCCCCC", "CCCCCCC", "CCCCCCC"}, - {"CCCCCCC", "C-----C", "C-----C", "C-----C", "C-----C", "C-----C", "CCCCCCC"}, - {"CCCCCCC", "CCCCCCC", "CCCCCCC", "CCCCCCC", "CCCCCCC", "CCCCCCC", "CCCCCCC"}, - }) + STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_IndustrialArcFurnace>builder().addShape( + mName + "3", + new String[][] { { "CCC", "C~C", "CCC" }, { "CCC", "C-C", "CCC" }, { "CCC", "CCC", "CCC" }, }) + .addShape( + mName + "5", + new String[][] { { "CCCCC", "CCCCC", "CC~CC", "CCCCC", "CCCCC" }, + { "CCCCC", "C---C", "C---C", "C---C", "CCCCC" }, + { "CCCCC", "CCCCC", "CCCCC", "CCCCC", "CCCCC" }, }) + .addShape( + mName + "7", + new String[][] { + { "CCCCCCC", "CCCCCCC", "CCCCCCC", "CCC~CCC", "CCCCCCC", "CCCCCCC", "CCCCCCC" }, + { "CCCCCCC", "C-----C", "C-----C", "C-----C", "C-----C", "C-----C", "CCCCCCC" }, + { "CCCCCCC", "CCCCCCC", "CCCCCCC", "CCCCCCC", "CCCCCCC", "CCCCCCC", "CCCCCCC" }, }) .addElement( 'C', buildHatchAdder(GregtechMetaTileEntity_IndustrialArcFurnace.class) .atLeast(InputBus, InputHatch, OutputBus, OutputHatch, Maintenance, Energy, Muffler) - .casingIndex(getCasingTextureIndex()) - .dot(1) - .buildAndChain( + .casingIndex(getCasingTextureIndex()).dot(1).buildAndChain( onElementPass(x -> ++x.mCasing, ofBlock(ModBlocks.blockCasings4Misc, 3)))) .build(); } @@ -148,7 +135,15 @@ public class GregtechMetaTileEntity_IndustrialArcFurnace if (mMachine) return -1; int size = getSizeFromHint(stackSize); return survivialBuildPiece( - mName + size, stackSize, (size - 1) / 2, (size - 1) / 2, 0, elementBudget, env, false, true); + mName + size, + stackSize, + (size - 1) / 2, + (size - 1) / 2, + 0, + elementBudget, + env, + false, + true); } @Override @@ -196,8 +191,7 @@ public class GregtechMetaTileEntity_IndustrialArcFurnace @Override public GT_Recipe.GT_Recipe_Map getRecipeMap() { - return mPlasmaMode - ? GT_Recipe.GT_Recipe_Map.sPlasmaArcFurnaceRecipes + return mPlasmaMode ? GT_Recipe.GT_Recipe_Map.sPlasmaArcFurnaceRecipes : GT_Recipe.GT_Recipe_Map.sArcFurnaceRecipes; } @@ -268,19 +262,34 @@ public class GregtechMetaTileEntity_IndustrialArcFurnace if (mPlasmaMode) { PlayerUtils.messagePlayer( aPlayer, - "[" + EnumChatFormatting.RED + "MODE" + EnumChatFormatting.RESET + "] " - + EnumChatFormatting.LIGHT_PURPLE + "Plasma" + EnumChatFormatting.RESET); + "[" + EnumChatFormatting.RED + + "MODE" + + EnumChatFormatting.RESET + + "] " + + EnumChatFormatting.LIGHT_PURPLE + + "Plasma" + + EnumChatFormatting.RESET); } else { PlayerUtils.messagePlayer( aPlayer, - "[" + EnumChatFormatting.RED + "MODE" + EnumChatFormatting.RESET + "] " - + EnumChatFormatting.YELLOW + "Electric" + EnumChatFormatting.RESET); + "[" + EnumChatFormatting.RED + + "MODE" + + EnumChatFormatting.RESET + + "] " + + EnumChatFormatting.YELLOW + + "Electric" + + EnumChatFormatting.RESET); } } else { PlayerUtils.messagePlayer( aPlayer, - "[" + EnumChatFormatting.RED + "MODE" + EnumChatFormatting.RESET + "] " + EnumChatFormatting.GRAY - + "Cannot change mode, structure not large enough." + EnumChatFormatting.RESET); + "[" + EnumChatFormatting.RED + + "MODE" + + EnumChatFormatting.RESET + + "] " + + EnumChatFormatting.GRAY + + "Cannot change mode, structure not large enough." + + EnumChatFormatting.RESET); } mLastRecipe = null; } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialCentrifuge.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialCentrifuge.java index cf41c87018..b9c7983706 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialCentrifuge.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialCentrifuge.java @@ -6,10 +6,16 @@ import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose import static gregtech.api.enums.GT_HatchElement.*; import static gregtech.api.util.GT_StructureUtility.buildHatchAdder; +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; + import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable; import com.gtnewhorizon.structurelib.structure.IStructureDefinition; import com.gtnewhorizon.structurelib.structure.ISurvivalBuildEnvironment; import com.gtnewhorizon.structurelib.structure.StructureDefinition; + import gregtech.api.enums.TAE; import gregtech.api.interfaces.IIconContainer; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; @@ -24,14 +30,9 @@ import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.util.minecraft.PlayerUtils; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock.CustomIcon; -import net.minecraft.block.Block; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -public class GregtechMetaTileEntity_IndustrialCentrifuge - extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_IndustrialCentrifuge> - implements ISurvivalConstructable { +public class GregtechMetaTileEntity_IndustrialCentrifuge extends + GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_IndustrialCentrifuge> implements ISurvivalConstructable { private boolean mIsAnimated; private static final CustomIcon frontFaceActive = new CustomIcon("iconsets/LARGECENTRIFUGE_ACTIVE5"); @@ -63,24 +64,15 @@ public class GregtechMetaTileEntity_IndustrialCentrifuge @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType(getMachineType()) - .addInfo("Controller Block for the Industrial Centrifuge") + tt.addMachineType(getMachineType()).addInfo("Controller Block for the Industrial Centrifuge") .addInfo("125% faster than using single block machines of the same voltage") - .addInfo("Disable animations with a screwdriver") - .addInfo("Only uses 90% of the EU/t normally required") - .addInfo("Processes six items per voltage tier") - .addPollutionAmount(getPollutionPerSecond(null)) - .addSeparator() - .beginStructureBlock(3, 3, 3, true) - .addController("Front Center") - .addCasingInfo("Centrifuge Casings", 10) - .addInputBus("Any Casing except front", 1) - .addOutputBus("Any Casing except front", 1) - .addInputHatch("Any Casing except front", 1) - .addOutputHatch("Any Casing except front", 1) - .addEnergyHatch("Any Casing except front", 1) - .addMaintenanceHatch("Any Casing except front", 1) - .addMufflerHatch("Any Casing except front", 1) + .addInfo("Disable animations with a screwdriver").addInfo("Only uses 90% of the EU/t normally required") + .addInfo("Processes six items per voltage tier").addPollutionAmount(getPollutionPerSecond(null)) + .addSeparator().beginStructureBlock(3, 3, 3, true).addController("Front Center") + .addCasingInfo("Centrifuge Casings", 10).addInputBus("Any Casing except front", 1) + .addOutputBus("Any Casing except front", 1).addInputHatch("Any Casing except front", 1) + .addOutputHatch("Any Casing except front", 1).addEnergyHatch("Any Casing except front", 1) + .addMaintenanceHatch("Any Casing except front", 1).addMufflerHatch("Any Casing except front", 1) .toolTipFinisher(CORE.GT_Tooltip_Builder); return tt; } @@ -89,18 +81,16 @@ public class GregtechMetaTileEntity_IndustrialCentrifuge public IStructureDefinition<GregtechMetaTileEntity_IndustrialCentrifuge> getStructureDefinition() { if (STRUCTURE_DEFINITION == null) { STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_IndustrialCentrifuge>builder() - .addShape(mName, transpose(new String[][] { - {"CCC", "CCC", "CCC"}, - {"C~C", "C-C", "CCC"}, - {"CCC", "CCC", "CCC"}, - })) + .addShape( + mName, + transpose( + new String[][] { { "CCC", "CCC", "CCC" }, { "C~C", "C-C", "CCC" }, + { "CCC", "CCC", "CCC" }, })) .addElement( 'C', buildHatchAdder(GregtechMetaTileEntity_IndustrialCentrifuge.class) .atLeast(InputBus, OutputBus, Maintenance, Energy, Muffler, InputHatch, OutputHatch) - .casingIndex(getCasingTextureIndex()) - .dot(1) - .buildAndChain( + .casingIndex(getCasingTextureIndex()).dot(1).buildAndChain( onElementPass(x -> ++x.mCasing, ofBlock(ModBlocks.blockCasingsMisc, 0)))) .build(); } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialChisel.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialChisel.java index 4316cf936d..1f9b43873d 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialChisel.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialChisel.java @@ -6,10 +6,20 @@ import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose import static gregtech.api.enums.GT_HatchElement.*; import static gregtech.api.util.GT_StructureUtility.buildHatchAdder; +import java.util.ArrayList; +import java.util.List; + +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidStack; + +import team.chisel.carving.Carving; + import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable; import com.gtnewhorizon.structurelib.structure.IStructureDefinition; import com.gtnewhorizon.structurelib.structure.ISurvivalBuildEnvironment; import com.gtnewhorizon.structurelib.structure.StructureDefinition; + import gregtech.api.interfaces.IIconContainer; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; @@ -24,12 +34,6 @@ import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.util.minecraft.ItemUtils; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; -import java.util.ArrayList; -import java.util.List; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; -import net.minecraftforge.fluids.FluidStack; -import team.chisel.carving.Carving; public class GregtechMetaTileEntity_IndustrialChisel extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_IndustrialChisel> implements ISurvivalConstructable { @@ -60,22 +64,13 @@ public class GregtechMetaTileEntity_IndustrialChisel @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType(getMachineType()) - .addInfo("Factory Grade Auto Chisel") - .addInfo("Target block goes in GUI slot") - .addInfo("If no target provided, firdt chisel result is used") + tt.addMachineType(getMachineType()).addInfo("Factory Grade Auto Chisel") + .addInfo("Target block goes in GUI slot").addInfo("If no target provided, firdt chisel result is used") .addInfo("Speed: +200% | EU Usage: 75% | Parallel: Tier x 16") - .addPollutionAmount(getPollutionPerSecond(null)) - .addSeparator() - .beginStructureBlock(3, 3, 3, true) - .addController("Front center") - .addCasingInfo("Sturdy Printer Casing", 10) - .addInputBus("Any casing", 1) - .addOutputBus("Any casing", 1) - .addEnergyHatch("Any casing", 1) - .addMaintenanceHatch("Any casing", 1) - .addMufflerHatch("Any casing", 1) - .toolTipFinisher(CORE.GT_Tooltip_Builder); + .addPollutionAmount(getPollutionPerSecond(null)).addSeparator().beginStructureBlock(3, 3, 3, true) + .addController("Front center").addCasingInfo("Sturdy Printer Casing", 10).addInputBus("Any casing", 1) + .addOutputBus("Any casing", 1).addEnergyHatch("Any casing", 1).addMaintenanceHatch("Any casing", 1) + .addMufflerHatch("Any casing", 1).toolTipFinisher(CORE.GT_Tooltip_Builder); return tt; } @@ -83,17 +78,15 @@ public class GregtechMetaTileEntity_IndustrialChisel public IStructureDefinition<GregtechMetaTileEntity_IndustrialChisel> getStructureDefinition() { if (STRUCTURE_DEFINITION == null) { STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_IndustrialChisel>builder() - .addShape(mName, transpose(new String[][] { - {"CCC", "CCC", "CCC"}, - {"C~C", "C-C", "CCC"}, - {"CCC", "CCC", "CCC"}, - })) + .addShape( + mName, + transpose( + new String[][] { { "CCC", "CCC", "CCC" }, { "C~C", "C-C", "CCC" }, + { "CCC", "CCC", "CCC" }, })) .addElement( 'C', buildHatchAdder(GregtechMetaTileEntity_IndustrialChisel.class) - .atLeast(InputBus, OutputBus, Maintenance, Energy, Muffler) - .casingIndex(90) - .dot(1) + .atLeast(InputBus, OutputBus, Maintenance, Energy, Muffler).casingIndex(90).dot(1) .buildAndChain( onElementPass(x -> ++x.mCasing, ofBlock(ModBlocks.blockCasings5Misc, 5)))) .build(); @@ -201,18 +194,17 @@ public class GregtechMetaTileEntity_IndustrialChisel if (tIsCached || aInput != null && hasChiselResults(aInput)) { ItemStack tOutput = tIsCached ? mOutputCache.copy() : getChiselOutput(aInput, aTarget); if (tOutput != null) { - if (mCachedRecipe != null - && GT_Utility.areStacksEqual(aInput, mInputCache) + if (mCachedRecipe != null && GT_Utility.areStacksEqual(aInput, mInputCache) && GT_Utility.areStacksEqual(tOutput, mOutputCache)) { return mCachedRecipe; } // We can chisel this GTPP_Recipe aRecipe = new GTPP_Recipe( false, - new ItemStack[] {ItemUtils.getSimpleStack(aInput, 1)}, - new ItemStack[] {ItemUtils.getSimpleStack(tOutput, 1)}, + new ItemStack[] { ItemUtils.getSimpleStack(aInput, 1) }, + new ItemStack[] { ItemUtils.getSimpleStack(tOutput, 1) }, null, - new int[] {10000}, + new int[] { 10000 }, new FluidStack[] {}, new FluidStack[] {}, 20, @@ -256,14 +248,9 @@ public class GregtechMetaTileEntity_IndustrialChisel int aEUPercent = getEuDiscountForParallelism(); int aSpeedBonusPercent = 200; - GT_ParallelHelper helper = new GT_ParallelHelper() - .setRecipe(tRecipe) - .setItemInputs(aItemInputs) - .setFluidInputs(aFluidInputs) - .setAvailableEUt(tEnergy) - .setMaxParallel(aMaxParallelRecipes) - .enableConsumption() - .enableOutputCalculation(); + GT_ParallelHelper helper = new GT_ParallelHelper().setRecipe(tRecipe).setItemInputs(aItemInputs) + .setFluidInputs(aFluidInputs).setAvailableEUt(tEnergy).setMaxParallel(aMaxParallelRecipes) + .enableConsumption().enableOutputCalculation(); if (!mVoidExcess) { helper.enableVoidProtection(this); } @@ -281,14 +268,10 @@ public class GregtechMetaTileEntity_IndustrialChisel this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000); this.mEfficiencyIncrease = 10000; - GT_OverclockCalculator calculator = new GT_OverclockCalculator() - .setRecipeEUt(tRecipe.mEUt) - .setEUt(tEnergy) - .setDuration(tRecipe.mDuration) - .setEUtDiscount(aEUPercent / 100.0f) + GT_OverclockCalculator calculator = new GT_OverclockCalculator().setRecipeEUt(tRecipe.mEUt).setEUt(tEnergy) + .setDuration(tRecipe.mDuration).setEUtDiscount(aEUPercent / 100.0f) .setSpeedBoost(100.0f / (100.0f + aSpeedBonusPercent)) - .setParallel(Math.min(aMaxParallelRecipes, helper.getCurrentParallel())) - .calculate(); + .setParallel(Math.min(aMaxParallelRecipes, helper.getCurrentParallel())).calculate(); lEUt = -calculator.getConsumption(); mMaxProgresstime = (int) Math.ceil(calculator.getDuration() * helper.getDurationMultiplier()); diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialCokeOven.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialCokeOven.java index 95a0024284..922e5f8904 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialCokeOven.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialCokeOven.java @@ -7,10 +7,13 @@ import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose import static gregtech.api.enums.GT_HatchElement.*; import static gregtech.api.util.GT_StructureUtility.buildHatchAdder; +import net.minecraft.item.ItemStack; + import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable; import com.gtnewhorizon.structurelib.structure.IStructureDefinition; import com.gtnewhorizon.structurelib.structure.ISurvivalBuildEnvironment; import com.gtnewhorizon.structurelib.structure.StructureDefinition; + import gregtech.api.GregTech_API; import gregtech.api.enums.TAE; import gregtech.api.interfaces.IIconContainer; @@ -24,11 +27,9 @@ import gtPlusPlus.core.block.ModBlocks; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; -import net.minecraft.item.ItemStack; -public class GregtechMetaTileEntity_IndustrialCokeOven - extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_IndustrialCokeOven> - implements ISurvivalConstructable { +public class GregtechMetaTileEntity_IndustrialCokeOven extends + GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_IndustrialCokeOven> implements ISurvivalConstructable { private int mLevel = 0; private int mCasing; @@ -57,25 +58,16 @@ public class GregtechMetaTileEntity_IndustrialCokeOven @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType(getMachineType()) - .addInfo("Processes Logs and Coal into Charcoal and Coal Coke.") + tt.addMachineType(getMachineType()).addInfo("Processes Logs and Coal into Charcoal and Coal Coke.") .addInfo("Controller Block for the Industrial Coke Oven") .addInfo("Gain 4% energy discount per voltage tier") .addInfo("Process 12x materials with Heat Resistant Casings") - .addInfo("Or 24x materials with Heat Proof Casings") - .addPollutionAmount(getPollutionPerSecond(null)) - .addSeparator() - .beginStructureBlock(3, 3, 3, true) - .addController("Front middle at bottom") + .addInfo("Or 24x materials with Heat Proof Casings").addPollutionAmount(getPollutionPerSecond(null)) + .addSeparator().beginStructureBlock(3, 3, 3, true).addController("Front middle at bottom") .addCasingInfo("Structural Coke Oven Casings", 8) - .addCasingInfo("Heat Resistant/Proof Coke Oven Casings", 8) - .addInputBus("Any Casing", 1) - .addOutputBus("Any Casing", 1) - .addInputHatch("Any Casing", 1) - .addOutputHatch("Any Casing", 1) - .addEnergyHatch("Any Casing", 1) - .addMaintenanceHatch("Any Casing", 1) - .addMufflerHatch("Any Casing", 1) + .addCasingInfo("Heat Resistant/Proof Coke Oven Casings", 8).addInputBus("Any Casing", 1) + .addOutputBus("Any Casing", 1).addInputHatch("Any Casing", 1).addOutputHatch("Any Casing", 1) + .addEnergyHatch("Any Casing", 1).addMaintenanceHatch("Any Casing", 1).addMufflerHatch("Any Casing", 1) .toolTipFinisher(CORE.GT_Tooltip_Builder); return tt; } @@ -84,28 +76,26 @@ public class GregtechMetaTileEntity_IndustrialCokeOven public IStructureDefinition<GregtechMetaTileEntity_IndustrialCokeOven> getStructureDefinition() { if (STRUCTURE_DEFINITION == null) { STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_IndustrialCokeOven>builder() - .addShape(mName, transpose(new String[][] { - {"CCC", "CCC", "CCC"}, - {"HHH", "H-H", "HHH"}, - {"C~C", "CCC", "CCC"}, - })) - .addShape(mName + "1", transpose(new String[][] { - {"CCC", "CCC", "CCC"}, - {"aaa", "a-a", "aaa"}, - {"C~C", "CCC", "CCC"}, - })) - .addShape(mName + "2", transpose(new String[][] { - {"CCC", "CCC", "CCC"}, - {"bbb", "b-b", "bbb"}, - {"C~C", "CCC", "CCC"}, - })) + .addShape( + mName, + transpose( + new String[][] { { "CCC", "CCC", "CCC" }, { "HHH", "H-H", "HHH" }, + { "C~C", "CCC", "CCC" }, })) + .addShape( + mName + "1", + transpose( + new String[][] { { "CCC", "CCC", "CCC" }, { "aaa", "a-a", "aaa" }, + { "C~C", "CCC", "CCC" }, })) + .addShape( + mName + "2", + transpose( + new String[][] { { "CCC", "CCC", "CCC" }, { "bbb", "b-b", "bbb" }, + { "C~C", "CCC", "CCC" }, })) .addElement( 'C', buildHatchAdder(GregtechMetaTileEntity_IndustrialCokeOven.class) .atLeast(InputBus, OutputBus, InputHatch, OutputHatch, Maintenance, Energy, Muffler) - .casingIndex(TAE.GTPP_INDEX(1)) - .dot(1) - .buildAndChain( + .casingIndex(TAE.GTPP_INDEX(1)).dot(1).buildAndChain( onElementPass(x -> ++x.mCasing, ofBlock(ModBlocks.blockCasingsMisc, 1)))) .addElement( 'H', @@ -113,8 +103,7 @@ public class GregtechMetaTileEntity_IndustrialCokeOven onElementPass(x -> ++x.mCasing1, ofBlock(ModBlocks.blockCasingsMisc, 2)), onElementPass(x -> ++x.mCasing2, ofBlock(ModBlocks.blockCasingsMisc, 3)))) .addElement('a', ofBlock(ModBlocks.blockCasingsMisc, 2)) - .addElement('b', ofBlock(ModBlocks.blockCasingsMisc, 3)) - .build(); + .addElement('b', ofBlock(ModBlocks.blockCasingsMisc, 3)).build(); } return STRUCTURE_DEFINITION; } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialCuttingMachine.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialCuttingMachine.java index 9f1ba02076..ec2d7d647a 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialCuttingMachine.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialCuttingMachine.java @@ -6,10 +6,16 @@ import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose import static gregtech.api.enums.GT_HatchElement.*; import static gregtech.api.util.GT_StructureUtility.buildHatchAdder; +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; + import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable; import com.gtnewhorizon.structurelib.structure.IStructureDefinition; import com.gtnewhorizon.structurelib.structure.ISurvivalBuildEnvironment; import com.gtnewhorizon.structurelib.structure.StructureDefinition; + import gregtech.api.enums.TAE; import gregtech.api.interfaces.IIconContainer; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; @@ -23,21 +29,16 @@ import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.minecraft.PlayerUtils; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; -import net.minecraft.block.Block; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -public class GregtechMetaTileEntity_IndustrialCuttingMachine - extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_IndustrialCuttingMachine> - implements ISurvivalConstructable { +public class GregtechMetaTileEntity_IndustrialCuttingMachine extends + GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_IndustrialCuttingMachine> implements ISurvivalConstructable { private boolean mCuttingMode = true; private int mCasing; private static IStructureDefinition<GregtechMetaTileEntity_IndustrialCuttingMachine> STRUCTURE_DEFINITION = null; - public GregtechMetaTileEntity_IndustrialCuttingMachine( - final int aID, final String aName, final String aNameRegional) { + public GregtechMetaTileEntity_IndustrialCuttingMachine(final int aID, final String aName, + final String aNameRegional) { super(aID, aName, aNameRegional); } @@ -58,22 +59,13 @@ public class GregtechMetaTileEntity_IndustrialCuttingMachine @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType(getMachineType()) - .addInfo("Controller Block for the Industrial Cutting Factory") + tt.addMachineType(getMachineType()).addInfo("Controller Block for the Industrial Cutting Factory") .addInfo("200% faster than using single block machines of the same voltage") - .addInfo("Only uses 75% of the EU/t normally required") - .addInfo("Processes four items per voltage tier") - .addPollutionAmount(getPollutionPerSecond(null)) - .addSeparator() - .beginStructureBlock(3, 3, 5, true) - .addController("Front Center") - .addCasingInfo("Cutting Factory Frames", 26) - .addInputBus("Any Casing", 1) - .addOutputBus("Any Casing", 1) - .addInputHatch("Any Casing", 1) - .addEnergyHatch("Any Casing", 1) - .addMaintenanceHatch("Any Casing", 1) - .addMufflerHatch("Any Casing", 1) + .addInfo("Only uses 75% of the EU/t normally required").addInfo("Processes four items per voltage tier") + .addPollutionAmount(getPollutionPerSecond(null)).addSeparator().beginStructureBlock(3, 3, 5, true) + .addController("Front Center").addCasingInfo("Cutting Factory Frames", 26).addInputBus("Any Casing", 1) + .addOutputBus("Any Casing", 1).addInputHatch("Any Casing", 1).addEnergyHatch("Any Casing", 1) + .addMaintenanceHatch("Any Casing", 1).addMufflerHatch("Any Casing", 1) .toolTipFinisher(CORE.GT_Tooltip_Builder); return tt; } @@ -82,18 +74,17 @@ public class GregtechMetaTileEntity_IndustrialCuttingMachine public IStructureDefinition<GregtechMetaTileEntity_IndustrialCuttingMachine> getStructureDefinition() { if (STRUCTURE_DEFINITION == null) { STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_IndustrialCuttingMachine>builder() - .addShape(mName, transpose(new String[][] { - {"CCC", "CCC", "CCC", "CCC", "CCC"}, - {"C~C", "C-C", "C-C", "C-C", "CCC"}, - {"CCC", "CCC", "CCC", "CCC", "CCC"}, - })) + .addShape( + mName, + transpose( + new String[][] { { "CCC", "CCC", "CCC", "CCC", "CCC" }, + { "C~C", "C-C", "C-C", "C-C", "CCC" }, + { "CCC", "CCC", "CCC", "CCC", "CCC" }, })) .addElement( 'C', buildHatchAdder(GregtechMetaTileEntity_IndustrialCuttingMachine.class) .atLeast(InputBus, InputHatch, OutputBus, Maintenance, Energy, Muffler) - .casingIndex(getCasingTextureIndex()) - .dot(1) - .buildAndChain( + .casingIndex(getCasingTextureIndex()).dot(1).buildAndChain( onElementPass(x -> ++x.mCasing, ofBlock(ModBlocks.blockCasings2Misc, 13)))) .build(); } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialDehydrator.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialDehydrator.java index 3fd71a56d2..2bfe9ad75f 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialDehydrator.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialDehydrator.java @@ -7,10 +7,16 @@ import static gregtech.api.enums.GT_HatchElement.*; import static gregtech.api.util.GT_StructureUtility.buildHatchAdder; import static gregtech.api.util.GT_StructureUtility.ofCoil; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraftforge.fluids.FluidStack; + import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable; import com.gtnewhorizon.structurelib.structure.IStructureDefinition; import com.gtnewhorizon.structurelib.structure.ISurvivalBuildEnvironment; import com.gtnewhorizon.structurelib.structure.StructureDefinition; + import gregtech.api.enums.HeatingCoilLevel; import gregtech.api.enums.TAE; import gregtech.api.interfaces.IIconContainer; @@ -28,14 +34,9 @@ import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.minecraft.PlayerUtils; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraftforge.fluids.FluidStack; -public class GregtechMetaTileEntity_IndustrialDehydrator - extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_IndustrialDehydrator> - implements ISurvivalConstructable { +public class GregtechMetaTileEntity_IndustrialDehydrator extends + GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_IndustrialDehydrator> implements ISurvivalConstructable { private static int CASING_TEXTURE_ID; private static String mCasingName = "Vacuum Casing"; @@ -61,26 +62,17 @@ public class GregtechMetaTileEntity_IndustrialDehydrator @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType(getMachineType()) - .addInfo("Factory Grade Vacuum Furnace") + tt.addMachineType(getMachineType()).addInfo("Factory Grade Vacuum Furnace") .addInfo("Can toggle the operation temperature with a Screwdriver") .addInfo("All Dehydrator recipes are Low Temp recipes") .addInfo("Speed: +120% | EU Usage: 50% | Parallel: 4") .addInfo("Each 900K over the min. Heat Capacity grants 5% speedup (multiplicatively)") .addInfo("Each 1800K over the min. Heat Capacity allows for one upgraded overclock") .addInfo("Upgraded overclocks reduce recipe time to 25% and increase EU/t to 400%") - .addPollutionAmount(getPollutionPerSecond(null)) - .addSeparator() - .beginStructureBlock(3, 5, 3, true) - .addController("Bottom Center") - .addCasingInfo(mCasingName, 5) - .addInputBus("Any Casing", 1) - .addOutputBus("Any Casing", 1) - .addInputHatch("Any Casing", 1) - .addOutputHatch("Any Casing", 1) - .addEnergyHatch("Any Casing", 1) - .addMaintenanceHatch("Any Casing", 1) - .addMufflerHatch("Any Casing", 1) + .addPollutionAmount(getPollutionPerSecond(null)).addSeparator().beginStructureBlock(3, 5, 3, true) + .addController("Bottom Center").addCasingInfo(mCasingName, 5).addInputBus("Any Casing", 1) + .addOutputBus("Any Casing", 1).addInputHatch("Any Casing", 1).addOutputHatch("Any Casing", 1) + .addEnergyHatch("Any Casing", 1).addMaintenanceHatch("Any Casing", 1).addMufflerHatch("Any Casing", 1) .toolTipFinisher(CORE.GT_Tooltip_Builder); return tt; } @@ -88,21 +80,16 @@ public class GregtechMetaTileEntity_IndustrialDehydrator @Override public IStructureDefinition<GregtechMetaTileEntity_IndustrialDehydrator> getStructureDefinition() { if (STRUCTURE_DEFINITION == null) { - STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_IndustrialDehydrator>builder() - .addShape(mName, transpose(new String[][] { - {"CCC", "CCC", "CCC"}, - {"HHH", "H-H", "HHH"}, - {"HHH", "H-H", "HHH"}, - {"HHH", "H-H", "HHH"}, - {"C~C", "CCC", "CCC"}, - })) + STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_IndustrialDehydrator>builder().addShape( + mName, + transpose( + new String[][] { { "CCC", "CCC", "CCC" }, { "HHH", "H-H", "HHH" }, { "HHH", "H-H", "HHH" }, + { "HHH", "H-H", "HHH" }, { "C~C", "CCC", "CCC" }, })) .addElement( 'C', buildHatchAdder(GregtechMetaTileEntity_IndustrialDehydrator.class) .atLeast(InputBus, OutputBus, Maintenance, Energy, Muffler, InputHatch, OutputHatch) - .casingIndex(CASING_TEXTURE_ID) - .dot(1) - .buildAndChain( + .casingIndex(CASING_TEXTURE_ID).dot(1).buildAndChain( onElementPass(x -> ++x.mCasing, ofBlock(ModBlocks.blockCasings4Misc, 10)))) .addElement( 'H', @@ -148,8 +135,7 @@ public class GregtechMetaTileEntity_IndustrialDehydrator } public GT_Recipe.GT_Recipe_Map getRecipeMap() { - return mDehydratorMode - ? GTPP_Recipe.GTPP_Recipe_Map.sMultiblockChemicalDehydratorRecipes + return mDehydratorMode ? GTPP_Recipe.GTPP_Recipe_Map.sMultiblockChemicalDehydratorRecipes : GTPP_Recipe.GTPP_Recipe_Map.sVacuumFurnaceRecipes; } @@ -185,13 +171,8 @@ public class GregtechMetaTileEntity_IndustrialDehydrator } @Override - public boolean checkRecipeGeneric( - ItemStack[] aItemInputs, - FluidStack[] aFluidInputs, - int aMaxParallelRecipes, - long aEUPercent, - int aSpeedBonusPercent, - int aOutputChanceRoll) { + public boolean checkRecipeGeneric(ItemStack[] aItemInputs, FluidStack[] aFluidInputs, int aMaxParallelRecipes, + long aEUPercent, int aSpeedBonusPercent, int aOutputChanceRoll) { // Based on the Processing Array. A bit overkill, but very flexible. // Reset outputs and progress stats @@ -204,14 +185,13 @@ public class GregtechMetaTileEntity_IndustrialDehydrator byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage)); long tEnergy = getMaxInputEnergy(); - GT_Recipe tRecipe = this.getRecipeMap() - .findRecipe( - getBaseMetaTileEntity(), - mLastRecipe, - false, - gregtech.api.enums.GT_Values.V[tTier], - aFluidInputs, - aItemInputs); + GT_Recipe tRecipe = this.getRecipeMap().findRecipe( + getBaseMetaTileEntity(), + mLastRecipe, + false, + gregtech.api.enums.GT_Values.V[tTier], + aFluidInputs, + aItemInputs); // Remember last recipe - an optimization for findRecipe() this.mLastRecipe = tRecipe; @@ -220,14 +200,9 @@ public class GregtechMetaTileEntity_IndustrialDehydrator return false; } - GT_ParallelHelper helper = new GT_ParallelHelper() - .setRecipe(tRecipe) - .setItemInputs(aItemInputs) - .setFluidInputs(aFluidInputs) - .setAvailableEUt(tEnergy) - .setMaxParallel(aMaxParallelRecipes) - .enableConsumption() - .enableOutputCalculation(); + GT_ParallelHelper helper = new GT_ParallelHelper().setRecipe(tRecipe).setItemInputs(aItemInputs) + .setFluidInputs(aFluidInputs).setAvailableEUt(tEnergy).setMaxParallel(aMaxParallelRecipes) + .enableConsumption().enableOutputCalculation(); if (!mVoidExcess) { helper.enableVoidProtection(this); } @@ -245,17 +220,11 @@ public class GregtechMetaTileEntity_IndustrialDehydrator this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000); this.mEfficiencyIncrease = 10000; - GT_OverclockCalculator calculator = new GT_OverclockCalculator() - .setRecipeEUt(tRecipe.mEUt) - .setEUt(tEnergy) - .setDuration(tRecipe.mDuration) - .setEUtDiscount(aEUPercent / 100.0f) + GT_OverclockCalculator calculator = new GT_OverclockCalculator().setRecipeEUt(tRecipe.mEUt).setEUt(tEnergy) + .setDuration(tRecipe.mDuration).setEUtDiscount(aEUPercent / 100.0f) .setSpeedBoost(100.0f / (100.0f + aSpeedBonusPercent)) - .setParallel(Math.min(aMaxParallelRecipes, helper.getCurrentParallel())) - .enableHeatOC() - .enableHeatDiscount() - .setRecipeHeat(tRecipe.mSpecialValue) - .setMultiHeat((int) getCoilLevel().getHeat()) + .setParallel(Math.min(aMaxParallelRecipes, helper.getCurrentParallel())).enableHeatOC() + .enableHeatDiscount().setRecipeHeat(tRecipe.mSpecialValue).setMultiHeat((int) getCoilLevel().getHeat()) .calculate(); lEUt = -calculator.getConsumption(); mMaxProgresstime = (int) Math.ceil(calculator.getDuration() * helper.getDurationMultiplier()); diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialElectrolyzer.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialElectrolyzer.java index 00cb08ec32..52ad795a3c 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialElectrolyzer.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialElectrolyzer.java @@ -6,10 +6,13 @@ import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose import static gregtech.api.enums.GT_HatchElement.*; import static gregtech.api.util.GT_StructureUtility.buildHatchAdder; +import net.minecraft.item.ItemStack; + import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable; import com.gtnewhorizon.structurelib.structure.IStructureDefinition; import com.gtnewhorizon.structurelib.structure.ISurvivalBuildEnvironment; import com.gtnewhorizon.structurelib.structure.StructureDefinition; + import gregtech.api.enums.TAE; import gregtech.api.interfaces.IIconContainer; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; @@ -21,17 +24,15 @@ import gtPlusPlus.core.block.ModBlocks; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; -import net.minecraft.item.ItemStack; -public class GregtechMetaTileEntity_IndustrialElectrolyzer - extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_IndustrialElectrolyzer> - implements ISurvivalConstructable { +public class GregtechMetaTileEntity_IndustrialElectrolyzer extends + GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_IndustrialElectrolyzer> implements ISurvivalConstructable { private int mCasing; private static IStructureDefinition<GregtechMetaTileEntity_IndustrialElectrolyzer> STRUCTURE_DEFINITION = null; - public GregtechMetaTileEntity_IndustrialElectrolyzer( - final int aID, final String aName, final String aNameRegional) { + public GregtechMetaTileEntity_IndustrialElectrolyzer(final int aID, final String aName, + final String aNameRegional) { super(aID, aName, aNameRegional); } @@ -52,23 +53,13 @@ public class GregtechMetaTileEntity_IndustrialElectrolyzer @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType(getMachineType()) - .addInfo("Controller Block for the Industrial Electrolyzer") + tt.addMachineType(getMachineType()).addInfo("Controller Block for the Industrial Electrolyzer") .addInfo("180% faster than using single block machines of the same voltage") - .addInfo("Only uses 90% of the EU/t normally required") - .addInfo("Processes two items per voltage tier") - .addPollutionAmount(getPollutionPerSecond(null)) - .addSeparator() - .beginStructureBlock(3, 3, 3, true) - .addController("Front Center") - .addCasingInfo("Electrolyzer Casings", 10) - .addInputBus("Any Casing", 1) - .addOutputBus("Any Casing", 1) - .addInputHatch("Any Casing", 1) - .addOutputHatch("Any Casing", 1) - .addEnergyHatch("Any Casing", 1) - .addMaintenanceHatch("Any Casing", 1) - .addMufflerHatch("Any Casing", 1) + .addInfo("Only uses 90% of the EU/t normally required").addInfo("Processes two items per voltage tier") + .addPollutionAmount(getPollutionPerSecond(null)).addSeparator().beginStructureBlock(3, 3, 3, true) + .addController("Front Center").addCasingInfo("Electrolyzer Casings", 10).addInputBus("Any Casing", 1) + .addOutputBus("Any Casing", 1).addInputHatch("Any Casing", 1).addOutputHatch("Any Casing", 1) + .addEnergyHatch("Any Casing", 1).addMaintenanceHatch("Any Casing", 1).addMufflerHatch("Any Casing", 1) .toolTipFinisher(CORE.GT_Tooltip_Builder); return tt; } @@ -77,18 +68,16 @@ public class GregtechMetaTileEntity_IndustrialElectrolyzer public IStructureDefinition<GregtechMetaTileEntity_IndustrialElectrolyzer> getStructureDefinition() { if (STRUCTURE_DEFINITION == null) { STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_IndustrialElectrolyzer>builder() - .addShape(mName, transpose(new String[][] { - {"CCC", "CCC", "CCC"}, - {"C~C", "C-C", "CCC"}, - {"CCC", "CCC", "CCC"}, - })) + .addShape( + mName, + transpose( + new String[][] { { "CCC", "CCC", "CCC" }, { "C~C", "C-C", "CCC" }, + { "CCC", "CCC", "CCC" }, })) .addElement( 'C', buildHatchAdder(GregtechMetaTileEntity_IndustrialElectrolyzer.class) .atLeast(InputBus, OutputBus, Maintenance, Energy, Muffler, InputHatch, OutputHatch) - .casingIndex(TAE.GTPP_INDEX(5)) - .dot(1) - .buildAndChain( + .casingIndex(TAE.GTPP_INDEX(5)).dot(1).buildAndChain( onElementPass(x -> ++x.mCasing, ofBlock(ModBlocks.blockCasingsMisc, 5)))) .build(); } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialExtruder.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialExtruder.java index 8a14401d20..bdbf4a4aec 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialExtruder.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialExtruder.java @@ -6,10 +6,17 @@ import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose import static gregtech.api.enums.GT_HatchElement.*; import static gregtech.api.util.GT_StructureUtility.buildHatchAdder; +import java.util.ArrayList; + +import net.minecraft.block.Block; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidStack; + import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable; import com.gtnewhorizon.structurelib.structure.IStructureDefinition; import com.gtnewhorizon.structurelib.structure.ISurvivalBuildEnvironment; import com.gtnewhorizon.structurelib.structure.StructureDefinition; + import gregtech.api.GregTech_API; import gregtech.api.enums.TAE; import gregtech.api.interfaces.IIconContainer; @@ -23,14 +30,9 @@ import gtPlusPlus.core.block.ModBlocks; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; -import java.util.ArrayList; -import net.minecraft.block.Block; -import net.minecraft.item.ItemStack; -import net.minecraftforge.fluids.FluidStack; -public class GregtechMetaTileEntity_IndustrialExtruder - extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_IndustrialExtruder> - implements ISurvivalConstructable { +public class GregtechMetaTileEntity_IndustrialExtruder extends + GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_IndustrialExtruder> implements ISurvivalConstructable { private int mCasing; private static IStructureDefinition<GregtechMetaTileEntity_IndustrialExtruder> STRUCTURE_DEFINITION = null; @@ -56,23 +58,16 @@ public class GregtechMetaTileEntity_IndustrialExtruder @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType(getMachineType()) - .addInfo("Controller Block for the Material Extruder") + tt.addMachineType(getMachineType()).addInfo("Controller Block for the Material Extruder") .addInfo("250% faster than using single block machines of the same voltage") .addInfo("Processes four items per voltage tier") .addInfo("Extrusion Shape for recipe goes in the Input Bus") .addInfo("Each Input Bus can have a different shape!") .addInfo("You can use several input buses per multiblock") - .addPollutionAmount(getPollutionPerSecond(null)) - .addSeparator() - .beginStructureBlock(3, 3, 5, true) - .addController("Front Center") - .addCasingInfo("Inconel Reinforced Casings", 14) - .addInputBus("Any Casing", 1) - .addOutputBus("Any Casing", 1) - .addEnergyHatch("Any Casing", 1) - .addMaintenanceHatch("Any Casing", 1) - .addMufflerHatch("Back Center", 2) + .addPollutionAmount(getPollutionPerSecond(null)).addSeparator().beginStructureBlock(3, 3, 5, true) + .addController("Front Center").addCasingInfo("Inconel Reinforced Casings", 14) + .addInputBus("Any Casing", 1).addOutputBus("Any Casing", 1).addEnergyHatch("Any Casing", 1) + .addMaintenanceHatch("Any Casing", 1).addMufflerHatch("Back Center", 2) .toolTipFinisher(CORE.GT_Tooltip_Builder); return tt; } @@ -80,20 +75,19 @@ public class GregtechMetaTileEntity_IndustrialExtruder @Override public IStructureDefinition<GregtechMetaTileEntity_IndustrialExtruder> getStructureDefinition() { if (STRUCTURE_DEFINITION == null) { - STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_IndustrialExtruder>builder() - .addShape(mName, transpose(new String[][] { - {"CCC", "CCC", "CCC", "CCC", "CCC"}, - {"C~C", "C-C", "C-C", "C-C", "CCC"}, - {"CCC", "CCC", "CCC", "CCC", "CCC"}, - })) + STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_IndustrialExtruder>builder().addShape( + mName, + transpose( + new String[][] { { "CCC", "CCC", "CCC", "CCC", "CCC" }, + { "C~C", "C-C", "C-C", "C-C", "CCC" }, { "CCC", "CCC", "CCC", "CCC", "CCC" }, })) .addElement( 'C', buildHatchAdder(GregtechMetaTileEntity_IndustrialExtruder.class) .atLeast(InputBus, OutputBus, Maintenance, Energy, Muffler) - .casingIndex(getCasingTextureIndex()) - .dot(1) - .buildAndChain(onElementPass( - x -> ++x.mCasing, ofBlock(getCasingBlock(), getCasingMeta())))) + .casingIndex(getCasingTextureIndex()).dot(1).buildAndChain( + onElementPass( + x -> ++x.mCasing, + ofBlock(getCasingBlock(), getCasingMeta())))) .build(); } return STRUCTURE_DEFINITION; diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialFluidHeater.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialFluidHeater.java index a4e5b15b61..09acde8bcb 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialFluidHeater.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialFluidHeater.java @@ -6,10 +6,14 @@ import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose import static gregtech.api.enums.GT_HatchElement.*; import static gregtech.api.util.GT_StructureUtility.buildHatchAdder; +import net.minecraft.block.Block; +import net.minecraft.item.ItemStack; + import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable; import com.gtnewhorizon.structurelib.structure.IStructureDefinition; import com.gtnewhorizon.structurelib.structure.ISurvivalBuildEnvironment; import com.gtnewhorizon.structurelib.structure.StructureDefinition; + import gregtech.api.enums.TAE; import gregtech.api.interfaces.IIconContainer; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; @@ -21,12 +25,9 @@ import gtPlusPlus.core.block.ModBlocks; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; -import net.minecraft.block.Block; -import net.minecraft.item.ItemStack; -public class GregtechMetaTileEntity_IndustrialFluidHeater - extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_IndustrialFluidHeater> - implements ISurvivalConstructable { +public class GregtechMetaTileEntity_IndustrialFluidHeater extends + GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_IndustrialFluidHeater> implements ISurvivalConstructable { private int mCasing1; private static IStructureDefinition<GregtechMetaTileEntity_IndustrialFluidHeater> STRUCTURE_DEFINITION = null; @@ -52,25 +53,17 @@ public class GregtechMetaTileEntity_IndustrialFluidHeater @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType(getMachineType()) - .addInfo("Controller Block for the Industrial Fluid Heater") + tt.addMachineType(getMachineType()).addInfo("Controller Block for the Industrial Fluid Heater") .addInfo("120% faster than using single block machines of the same voltage") .addInfo("Only uses 90% of the EU/t normally required") - .addInfo("Processes eight items per voltage tier") - .addPollutionAmount(getPollutionPerSecond(null)) - .addSeparator() - .beginStructureBlock(5, 6, 5, true) - .addController("Front Center") + .addInfo("Processes eight items per voltage tier").addPollutionAmount(getPollutionPerSecond(null)) + .addSeparator().beginStructureBlock(5, 6, 5, true).addController("Front Center") .addCasingInfo("Top/Bottom layer: Multi-use Casings", 34) .addCasingInfo("Middle layers: Thermal Containment Casing", 47) - .addInputBus("Bottom Layer (optional)", 1) - .addInputHatch("Bottom Layer", 1) - .addOutputBus("Top Layer (optional)", 1) - .addOutputHatch("Top Layer", 1) - .addEnergyHatch("Any Multi-use Casing", 1) - .addMaintenanceHatch("Any Multi-use Casing", 1) - .addMufflerHatch("Any Multi-use Casing", 1) - .toolTipFinisher(CORE.GT_Tooltip_Builder); + .addInputBus("Bottom Layer (optional)", 1).addInputHatch("Bottom Layer", 1) + .addOutputBus("Top Layer (optional)", 1).addOutputHatch("Top Layer", 1) + .addEnergyHatch("Any Multi-use Casing", 1).addMaintenanceHatch("Any Multi-use Casing", 1) + .addMufflerHatch("Any Multi-use Casing", 1).toolTipFinisher(CORE.GT_Tooltip_Builder); return tt; } @@ -78,31 +71,32 @@ public class GregtechMetaTileEntity_IndustrialFluidHeater public IStructureDefinition<GregtechMetaTileEntity_IndustrialFluidHeater> getStructureDefinition() { if (STRUCTURE_DEFINITION == null) { STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_IndustrialFluidHeater>builder() - .addShape(mName, transpose(new String[][] { - {" TTT ", "TTTTT", "TTTTT", "TTTTT", " TTT "}, - {" XXX ", "X---X", "X---X", "X---X", " XXX "}, - {" XXX ", "X---X", "X---X", "X---X", " XXX "}, - {" XXX ", "X---X", "X---X", "X---X", " XXX "}, - {" X~X ", "X---X", "X---X", "X---X", " XXX "}, - {" BBB ", "BBBBB", "BBBBB", "BBBBB", " BBB "}, - })) + .addShape( + mName, + transpose( + new String[][] { { " TTT ", "TTTTT", "TTTTT", "TTTTT", " TTT " }, + { " XXX ", "X---X", "X---X", "X---X", " XXX " }, + { " XXX ", "X---X", "X---X", "X---X", " XXX " }, + { " XXX ", "X---X", "X---X", "X---X", " XXX " }, + { " X~X ", "X---X", "X---X", "X---X", " XXX " }, + { " BBB ", "BBBBB", "BBBBB", "BBBBB", " BBB " }, })) .addElement( 'B', buildHatchAdder(GregtechMetaTileEntity_IndustrialFluidHeater.class) .atLeast(InputBus, InputHatch, Maintenance, Energy, Muffler) - .casingIndex(getCasingTextureIndex()) - .dot(1) - .buildAndChain(onElementPass( - x -> ++x.mCasing1, ofBlock(getCasingBlock2(), getCasingMeta2())))) + .casingIndex(getCasingTextureIndex()).dot(1).buildAndChain( + onElementPass( + x -> ++x.mCasing1, + ofBlock(getCasingBlock2(), getCasingMeta2())))) .addElement('X', ofBlock(getCasingBlock1(), getCasingMeta1())) .addElement( 'T', buildHatchAdder(GregtechMetaTileEntity_IndustrialFluidHeater.class) .atLeast(OutputBus, OutputHatch, Maintenance, Energy, Muffler) - .casingIndex(getCasingTextureIndex()) - .dot(1) - .buildAndChain(onElementPass( - x -> ++x.mCasing1, ofBlock(getCasingBlock2(), getCasingMeta2())))) + .casingIndex(getCasingTextureIndex()).dot(1).buildAndChain( + onElementPass( + x -> ++x.mCasing1, + ofBlock(getCasingBlock2(), getCasingMeta2())))) .build(); } return STRUCTURE_DEFINITION; diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialForgeHammer.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialForgeHammer.java index ea3402efb6..476036fc7c 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialForgeHammer.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialForgeHammer.java @@ -7,10 +7,20 @@ import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose import static gregtech.api.enums.GT_HatchElement.*; import static gregtech.api.util.GT_StructureUtility.buildHatchAdder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Map; + +import net.minecraft.block.Block; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidStack; + import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable; import com.gtnewhorizon.structurelib.structure.IStructureDefinition; import com.gtnewhorizon.structurelib.structure.ISurvivalBuildEnvironment; import com.gtnewhorizon.structurelib.structure.StructureDefinition; + import cpw.mods.fml.common.registry.GameRegistry; import gregtech.api.GregTech_API; import gregtech.api.enums.TAE; @@ -26,17 +36,9 @@ import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.lib.LoadedMods; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Map; -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; -import net.minecraftforge.fluids.FluidStack; -public class GregtechMetaTileEntity_IndustrialForgeHammer - extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_IndustrialForgeHammer> - implements ISurvivalConstructable { +public class GregtechMetaTileEntity_IndustrialForgeHammer extends + GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_IndustrialForgeHammer> implements ISurvivalConstructable { private int mCasing; private int mAnvil; @@ -64,11 +66,9 @@ public class GregtechMetaTileEntity_IndustrialForgeHammer @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType(getMachineType()) - .addInfo("Controller Block for the Industrial Forge Hammer") + tt.addMachineType(getMachineType()).addInfo("Controller Block for the Industrial Forge Hammer") .addInfo("Speed: +100% | EU Usage: 100% | Parallel: Tier x Anvil Tier x 8") - .addInfo("T1 - Vanilla Anvil") - .addInfo("Anvil goes in Middle 3x3x3 Structure"); + .addInfo("T1 - Vanilla Anvil").addInfo("Anvil goes in Middle 3x3x3 Structure"); if (LoadedMods.Railcraft) { tt.addInfo("T2 - Steel Anvil"); } @@ -79,17 +79,10 @@ public class GregtechMetaTileEntity_IndustrialForgeHammer tt.addInfo("T3 - Thaumic Anvil"); tt.addInfo("T4 - Void Anvil"); } - tt.addPollutionAmount(getPollutionPerSecond(null)) - .addSeparator() - .beginStructureBlock(3, 3, 3, true) - .addController("Front Center") - .addCasingInfo("Forge Casing", 10) - .addInputBus("Any Casing", 1) - .addOutputBus("Any Casing", 1) - .addEnergyHatch("Any Casing", 1) - .addMaintenanceHatch("Any Casing", 1) - .addMufflerHatch("Any Casing", 1) - .toolTipFinisher(CORE.GT_Tooltip_Builder); + tt.addPollutionAmount(getPollutionPerSecond(null)).addSeparator().beginStructureBlock(3, 3, 3, true) + .addController("Front Center").addCasingInfo("Forge Casing", 10).addInputBus("Any Casing", 1) + .addOutputBus("Any Casing", 1).addEnergyHatch("Any Casing", 1).addMaintenanceHatch("Any Casing", 1) + .addMufflerHatch("Any Casing", 1).toolTipFinisher(CORE.GT_Tooltip_Builder); return tt; } @@ -109,21 +102,18 @@ public class GregtechMetaTileEntity_IndustrialForgeHammer aBlockMap.put(sVoidAnvil, 0); } STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_IndustrialForgeHammer>builder() - .addShape(mName, transpose(new String[][] { - {"CCC", "CCC", "CCC"}, - {"C~C", "CAC", "CCC"}, - {"CCC", "CCC", "CCC"}, - })) + .addShape( + mName, + transpose( + new String[][] { { "CCC", "CCC", "CCC" }, { "C~C", "CAC", "CCC" }, + { "CCC", "CCC", "CCC" }, })) .addElement( 'C', buildHatchAdder(GregtechMetaTileEntity_IndustrialForgeHammer.class) .atLeast(InputBus, OutputBus, Maintenance, Energy, Muffler) - .casingIndex(TAE.getIndexFromPage(1, 11)) - .dot(1) - .buildAndChain( + .casingIndex(TAE.getIndexFromPage(1, 11)).dot(1).buildAndChain( onElementPass(x -> ++x.mCasing, ofBlock(ModBlocks.blockCasings5Misc, 6)))) - .addElement('A', onElementPass(x -> ++x.mAnvil, ofBlocksFlat(aBlockMap, sAnvil, 0))) - .build(); + .addElement('A', onElementPass(x -> ++x.mAnvil, ofBlocksFlat(aBlockMap, sAnvil, 0))).build(); } return STRUCTURE_DEFINITION; } @@ -174,8 +164,7 @@ public class GregtechMetaTileEntity_IndustrialForgeHammer @Override public boolean checkRecipe(final ItemStack aStack) { - Block aAnvil = this.getBaseMetaTileEntity() - .getBlockAtSide(this.getBaseMetaTileEntity().getBackFacing()); + Block aAnvil = this.getBaseMetaTileEntity().getBlockAtSide(this.getBaseMetaTileEntity().getBackFacing()); if (aAnvil != null) { int aAnvilTier = getAnvilTier(aAnvil); if (aAnvilTier > 0) { diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialMacerator.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialMacerator.java index 5aa487344a..c7637a6431 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialMacerator.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialMacerator.java @@ -7,10 +7,16 @@ import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose import static gregtech.api.enums.GT_HatchElement.*; import static gregtech.api.util.GT_StructureUtility.buildHatchAdder; +import java.util.Random; + +import net.minecraft.item.ItemStack; +import net.minecraftforge.common.util.ForgeDirection; + import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable; import com.gtnewhorizon.structurelib.structure.IStructureDefinition; import com.gtnewhorizon.structurelib.structure.ISurvivalBuildEnvironment; import com.gtnewhorizon.structurelib.structure.StructureDefinition; + import gregtech.api.GregTech_API; import gregtech.api.enums.TAE; import gregtech.api.interfaces.IIconContainer; @@ -23,13 +29,9 @@ import gtPlusPlus.core.block.ModBlocks; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; -import java.util.Random; -import net.minecraft.item.ItemStack; -import net.minecraftforge.common.util.ForgeDirection; -public class GregtechMetaTileEntity_IndustrialMacerator - extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_IndustrialMacerator> - implements ISurvivalConstructable { +public class GregtechMetaTileEntity_IndustrialMacerator extends + GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_IndustrialMacerator> implements ISurvivalConstructable { private int mCasing; private int mPerLayer; @@ -56,22 +58,14 @@ public class GregtechMetaTileEntity_IndustrialMacerator @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType(getMachineType()) - .addInfo("Controller Block for the Industrial Maceration Stack") + tt.addMachineType(getMachineType()).addInfo("Controller Block for the Industrial Maceration Stack") .addInfo("60% faster than using single block machines of the same voltage") - .addInfo("Processes 8*tier materials at a time") - .addInfo("ULV = Tier 0, LV = Tier 1, etc.") - .addPollutionAmount(getPollutionPerSecond(null)) - .addSeparator() - .beginStructureBlock(3, 6, 3, true) - .addController("Bottom Center") - .addCasingInfo("Maceration Stack Casings", 26) - .addInputBus("Bottom Casing", 1) - .addEnergyHatch("Bottom Casing", 1) - .addMaintenanceHatch("Bottom Casing", 1) - .addOutputBus("One per layer except bottom layer", 2) - .addMufflerHatch("Any Casing", 2) - .toolTipFinisher(CORE.GT_Tooltip_Builder); + .addInfo("Processes 8*tier materials at a time").addInfo("ULV = Tier 0, LV = Tier 1, etc.") + .addPollutionAmount(getPollutionPerSecond(null)).addSeparator().beginStructureBlock(3, 6, 3, true) + .addController("Bottom Center").addCasingInfo("Maceration Stack Casings", 26) + .addInputBus("Bottom Casing", 1).addEnergyHatch("Bottom Casing", 1) + .addMaintenanceHatch("Bottom Casing", 1).addOutputBus("One per layer except bottom layer", 2) + .addMufflerHatch("Any Casing", 2).toolTipFinisher(CORE.GT_Tooltip_Builder); return tt; } @@ -79,41 +73,29 @@ public class GregtechMetaTileEntity_IndustrialMacerator public IStructureDefinition<GregtechMetaTileEntity_IndustrialMacerator> getStructureDefinition() { if (STRUCTURE_DEFINITION == null) { STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_IndustrialMacerator>builder() - .addShape(mName + "top", transpose(new String[][] { - {"CCC", "CCC", "CCC"}, - })) - .addShape(mName + "mid", transpose(new String[][] { - {"CCC", "C-C", "CCC"}, - })) - .addShape(mName + "bottom", transpose(new String[][] { - {"B~B", "BBB", "BBB"}, - })) + .addShape(mName + "top", transpose(new String[][] { { "CCC", "CCC", "CCC" }, })) + .addShape( + mName + "mid", + transpose(new String[][] { { "CCC", "C-C", "CCC" }, })) + .addShape(mName + "bottom", transpose(new String[][] { { "B~B", "BBB", "BBB" }, })) .addElement( 'C', ofChain( - buildHatchAdder(GregtechMetaTileEntity_IndustrialMacerator.class) - .atLeast(OutputBus) + buildHatchAdder(GregtechMetaTileEntity_IndustrialMacerator.class).atLeast(OutputBus) .shouldReject(t -> t.mPerLayer + 1 == t.mOutputBusses.size()) .disallowOnly(ForgeDirection.UP, ForgeDirection.DOWN) - .casingIndex(TAE.GTPP_INDEX(7)) - .dot(2) - .build(), + .casingIndex(TAE.GTPP_INDEX(7)).dot(2).build(), buildHatchAdder(GregtechMetaTileEntity_IndustrialMacerator.class) .atLeast(Energy, Maintenance, Muffler) .disallowOnly(ForgeDirection.UP, ForgeDirection.DOWN) - .casingIndex(TAE.GTPP_INDEX(7)) - .dot(2) - .build(), + .casingIndex(TAE.GTPP_INDEX(7)).dot(2).build(), onElementPass(x -> ++x.mCasing, ofBlock(ModBlocks.blockCasingsMisc, 7)))) .addElement( 'B', ofChain( buildHatchAdder(GregtechMetaTileEntity_IndustrialMacerator.class) - .atLeast(Energy, Maintenance, InputBus) - .disallowOnly(ForgeDirection.UP) - .casingIndex(TAE.GTPP_INDEX(7)) - .dot(2) - .build(), + .atLeast(Energy, Maintenance, InputBus).disallowOnly(ForgeDirection.UP) + .casingIndex(TAE.GTPP_INDEX(7)).dot(2).build(), onElementPass(x -> ++x.mCasing, ofBlock(ModBlocks.blockCasingsMisc, 7)))) .build(); } @@ -194,22 +176,19 @@ public class GregtechMetaTileEntity_IndustrialMacerator @Override public void onPreTick(final IGregTechTileEntity aBaseMetaTileEntity, final long aTick) { super.onPreTick(aBaseMetaTileEntity, aTick); - if ((aBaseMetaTileEntity.isClientSide()) - && (aBaseMetaTileEntity.isActive()) + if ((aBaseMetaTileEntity.isClientSide()) && (aBaseMetaTileEntity.isActive()) && (aBaseMetaTileEntity.getFrontFacing() != 1) && (aBaseMetaTileEntity.getCoverIDAtSide((byte) 1) == 0) && (!aBaseMetaTileEntity.getOpacityAtSide((byte) 1))) { final Random tRandom = aBaseMetaTileEntity.getWorld().rand; - aBaseMetaTileEntity - .getWorld() - .spawnParticle( - "smoke", - (aBaseMetaTileEntity.getXCoord() + 0.8F) - (tRandom.nextFloat() * 0.6F), - aBaseMetaTileEntity.getYCoord() + 0.3f + (tRandom.nextFloat() * 0.2F), - (aBaseMetaTileEntity.getZCoord() + 1.2F) - (tRandom.nextFloat() * 1.6F), - 0.0D, - 0.0D, - 0.0D); + aBaseMetaTileEntity.getWorld().spawnParticle( + "smoke", + (aBaseMetaTileEntity.getXCoord() + 0.8F) - (tRandom.nextFloat() * 0.6F), + aBaseMetaTileEntity.getYCoord() + 0.3f + (tRandom.nextFloat() * 0.2F), + (aBaseMetaTileEntity.getZCoord() + 1.2F) - (tRandom.nextFloat() * 1.6F), + 0.0D, + 0.0D, + 0.0D); } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialMixer.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialMixer.java index cef60fec54..7730ed73cd 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialMixer.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialMixer.java @@ -6,10 +6,19 @@ import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose import static gregtech.api.enums.GT_HatchElement.*; import static gregtech.api.util.GT_StructureUtility.buildHatchAdder; +import java.util.ArrayList; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.StatCollector; +import net.minecraftforge.fluids.FluidStack; + import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable; import com.gtnewhorizon.structurelib.structure.IStructureDefinition; import com.gtnewhorizon.structurelib.structure.ISurvivalBuildEnvironment; import com.gtnewhorizon.structurelib.structure.StructureDefinition; + import gregtech.api.GregTech_API; import gregtech.api.enums.TAE; import gregtech.api.interfaces.IIconContainer; @@ -23,12 +32,6 @@ import gtPlusPlus.core.block.ModBlocks; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; -import java.util.ArrayList; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.StatCollector; -import net.minecraftforge.fluids.FluidStack; public class GregtechMetaTileEntity_IndustrialMixer extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_IndustrialMixer> implements ISurvivalConstructable { @@ -81,23 +84,13 @@ public class GregtechMetaTileEntity_IndustrialMixer @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType(getMachineType()) - .addInfo("Controller Block for the Industrial Mixer") + tt.addMachineType(getMachineType()).addInfo("Controller Block for the Industrial Mixer") .addInfo("250% faster than using single block machines of the same voltage") - .addInfo("Processes eight recipes per voltage tier") - .addPollutionAmount(getPollutionPerSecond(null)) - .addSeparator() - .beginStructureBlock(3, 4, 3, false) - .addController("Second Layer Center") - .addCasingInfo(mCasingName, 6) - .addCasingInfo(mCasingName2, 2) - .addInputBus("Any Casing", 1) - .addOutputBus("Any Casing", 1) - .addInputHatch("Any Casing", 1) - .addOutputHatch("Any Casing", 1) - .addEnergyHatch("Any Casing", 1) - .addMaintenanceHatch("Any Casing", 1) - .addMufflerHatch("Any Casing", 1) + .addInfo("Processes eight recipes per voltage tier").addPollutionAmount(getPollutionPerSecond(null)) + .addSeparator().beginStructureBlock(3, 4, 3, false).addController("Second Layer Center") + .addCasingInfo(mCasingName, 6).addCasingInfo(mCasingName2, 2).addInputBus("Any Casing", 1) + .addOutputBus("Any Casing", 1).addInputHatch("Any Casing", 1).addOutputHatch("Any Casing", 1) + .addEnergyHatch("Any Casing", 1).addMaintenanceHatch("Any Casing", 1).addMufflerHatch("Any Casing", 1) .toolTipFinisher(CORE.GT_Tooltip_Builder); return tt; } @@ -106,22 +99,18 @@ public class GregtechMetaTileEntity_IndustrialMixer public IStructureDefinition<GregtechMetaTileEntity_IndustrialMixer> getStructureDefinition() { if (STRUCTURE_DEFINITION == null) { STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_IndustrialMixer>builder() - .addShape(mName, transpose(new String[][] { - {"CCC", "CCC", "CCC"}, - {"CCC", "CMC", "CCC"}, - {"C~C", "CMC", "CCC"}, - {"CCC", "CCC", "CCC"}, - })) + .addShape( + mName, + transpose( + new String[][] { { "CCC", "CCC", "CCC" }, { "CCC", "CMC", "CCC" }, + { "C~C", "CMC", "CCC" }, { "CCC", "CCC", "CCC" }, })) .addElement( 'C', buildHatchAdder(GregtechMetaTileEntity_IndustrialMixer.class) .atLeast(InputBus, OutputBus, Maintenance, Energy, Muffler, InputHatch, OutputHatch) - .casingIndex(CASING_TEXTURE_ID) - .dot(1) - .buildAndChain( + .casingIndex(CASING_TEXTURE_ID).dot(1).buildAndChain( onElementPass(x -> ++x.mCasing, ofBlock(ModBlocks.blockCasings3Misc, 2)))) - .addElement('M', ofBlock(GregTech_API.sBlockCasings4, 11)) - .build(); + .addElement('M', ofBlock(GregTech_API.sBlockCasings4, 11)).build(); } return STRUCTURE_DEFINITION; } @@ -236,7 +225,8 @@ public class GregtechMetaTileEntity_IndustrialMixer public void onModeChangeByScrewdriver(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { isBussesSeparate = !isBussesSeparate; GT_Utility.sendChatToPlayer( - aPlayer, StatCollector.translateToLocal("GT5U.machines.separatebus") + " " + isBussesSeparate); + aPlayer, + StatCollector.translateToLocal("GT5U.machines.separatebus") + " " + isBussesSeparate); } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialMolecularTransformer.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialMolecularTransformer.java index 29650598e7..7d9f9274c6 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialMolecularTransformer.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialMolecularTransformer.java @@ -5,11 +5,16 @@ import static com.gtnewhorizon.structurelib.structure.StructureUtility.onElement import static gregtech.api.enums.GT_HatchElement.*; import static gregtech.api.util.GT_StructureUtility.buildHatchAdder; +import net.minecraft.block.Block; +import net.minecraft.item.ItemStack; +import net.minecraftforge.common.util.ForgeDirection; + import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable; import com.gtnewhorizon.structurelib.alignment.enumerable.ExtendedFacing; import com.gtnewhorizon.structurelib.structure.IStructureDefinition; import com.gtnewhorizon.structurelib.structure.ISurvivalBuildEnvironment; import com.gtnewhorizon.structurelib.structure.StructureDefinition; + import gregtech.api.GregTech_API; import gregtech.api.interfaces.IIconContainer; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; @@ -21,9 +26,6 @@ import gtPlusPlus.core.block.ModBlocks; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; -import net.minecraft.block.Block; -import net.minecraft.item.ItemStack; -import net.minecraftforge.common.util.ForgeDirection; public class GregtechMetaTileEntity_IndustrialMolecularTransformer extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_IndustrialMolecularTransformer> @@ -32,8 +34,8 @@ public class GregtechMetaTileEntity_IndustrialMolecularTransformer private static final int CASING_TEXTURE_ID = 48; private int mCasing = 0; - public GregtechMetaTileEntity_IndustrialMolecularTransformer( - final int aID, final String aName, final String aNameRegional) { + public GregtechMetaTileEntity_IndustrialMolecularTransformer(final int aID, final String aName, + final String aNameRegional) { super(aID, aName, aNameRegional); } @@ -54,61 +56,51 @@ public class GregtechMetaTileEntity_IndustrialMolecularTransformer protected GT_Multiblock_Tooltip_Builder createTooltip() { GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType(getMachineType()) - .addInfo("Changes the structure of items to produce new ones") - .addInfo("Maximum 1x of each bus/hatch.") - .addPollutionAmount(getPollutionPerSecond(null)) - .addSeparator() - .beginStructureBlock(7, 7, 7, false) - .addController("Top Center") - .addCasingInfo("Robust Tungstensteel Machine Casing", 40) - .addCasingInfo("Tungstensteel Coils", 16) - .addCasingInfo("Molecular Containment Casing", 52) - .addCasingInfo("High Voltage Current Capacitor", 32) - .addCasingInfo("Particle Containment Casing", 4) - .addCasingInfo("Resonance Chamber I", 5) - .addCasingInfo("Modulator I", 4) - .addInputBus("Any Robust Tungstensteel Machine Casing", 1) + tt.addMachineType(getMachineType()).addInfo("Changes the structure of items to produce new ones") + .addInfo("Maximum 1x of each bus/hatch.").addPollutionAmount(getPollutionPerSecond(null)).addSeparator() + .beginStructureBlock(7, 7, 7, false).addController("Top Center") + .addCasingInfo("Robust Tungstensteel Machine Casing", 40).addCasingInfo("Tungstensteel Coils", 16) + .addCasingInfo("Molecular Containment Casing", 52).addCasingInfo("High Voltage Current Capacitor", 32) + .addCasingInfo("Particle Containment Casing", 4).addCasingInfo("Resonance Chamber I", 5) + .addCasingInfo("Modulator I", 4).addInputBus("Any Robust Tungstensteel Machine Casing", 1) .addOutputBus("Any Robust Tungstensteel Machine Casing", 1) .addEnergyHatch("Any Robust Tungstensteel Machine Casing", 1) .addMaintenanceHatch("Any Robust Tungstensteel Machine Casing", 1) - .addMufflerHatch("Any Robust Tungstensteel Machine Casing", 1) - .toolTipFinisher(CORE.GT_Tooltip_Builder); + .addMufflerHatch("Any Robust Tungstensteel Machine Casing", 1).toolTipFinisher(CORE.GT_Tooltip_Builder); return tt; } private static final String STRUCTURE_PIECE_MAIN = "main"; - private static IStructureDefinition<GregtechMetaTileEntity_IndustrialMolecularTransformer> STRUCTURE_DEFINITION = - null; + private static IStructureDefinition<GregtechMetaTileEntity_IndustrialMolecularTransformer> STRUCTURE_DEFINITION = null; @Override public IStructureDefinition<GregtechMetaTileEntity_IndustrialMolecularTransformer> getStructureDefinition() { if (STRUCTURE_DEFINITION == null) { STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_IndustrialMolecularTransformer>builder() - .addShape(STRUCTURE_PIECE_MAIN, (new String[][] { - {" ", " ", " xxx ", " x~x ", " xxx ", " ", " "}, - {" ", " xxx ", " xyyyx ", " xyzyx ", " xyyyx ", " xxx ", " "}, - {" ", " xxx ", " xyyyx ", " xyzyx ", " xyyyx ", " xxx ", " "}, - {" ", " xxx ", " xyyyx ", " xyzyx ", " xyyyx ", " xxx ", " "}, - {" t ", " ttxtt ", " tyyyt ", "txyzyxt", " tyyyt ", " ttxtt ", " t "}, - {" c ", " ccecc ", " cxfxc ", "cefefec", " cxfxc ", " ccecc ", " c "}, - {" h ", " hhhhh ", " hhhhh ", "hhhhhhh", " hhhhh ", " hhhhh ", " h "}, - })) + .addShape( + STRUCTURE_PIECE_MAIN, + (new String[][] { + { " ", " ", " xxx ", " x~x ", " xxx ", " ", " " }, + { " ", " xxx ", " xyyyx ", " xyzyx ", " xyyyx ", " xxx ", " " }, + { " ", " xxx ", " xyyyx ", " xyzyx ", " xyyyx ", " xxx ", " " }, + { " ", " xxx ", " xyyyx ", " xyzyx ", " xyyyx ", " xxx ", " " }, + { " t ", " ttxtt ", " tyyyt ", "txyzyxt", " tyyyt ", " ttxtt ", " t " }, + { " c ", " ccecc ", " cxfxc ", "cefefec", " cxfxc ", " ccecc ", " c " }, + { " h ", " hhhhh ", " hhhhh ", "hhhhhhh", " hhhhh ", " hhhhh ", " h " }, })) .addElement('x', ofBlock(getCasingBlock(), getCasingMeta())) .addElement('y', ofBlock(getCasingBlock(), getCasingMeta2())) .addElement('z', ofBlock(getCasingBlock(), getCasingMeta3())) - .addElement('e', ofBlock(getCasingBlock2(), 0)) - .addElement('f', ofBlock(getCasingBlock2(), 4)) + .addElement('e', ofBlock(getCasingBlock2(), 0)).addElement('f', ofBlock(getCasingBlock2(), 4)) .addElement('c', ofBlock(getCoilBlock(), 3)) .addElement('t', ofBlock(getCasingBlock3(), getTungstenCasingMeta())) .addElement( 'h', buildHatchAdder(GregtechMetaTileEntity_IndustrialMolecularTransformer.class) .atLeast(InputBus, OutputBus, Maintenance, Energy, Muffler) - .casingIndex(getCasingTextureIndex()) - .dot(1) - .buildAndChain(onElementPass( - x -> ++x.mCasing, ofBlock(getCasingBlock3(), getTungstenCasingMeta())))) + .casingIndex(getCasingTextureIndex()).dot(1).buildAndChain( + onElementPass( + x -> ++x.mCasing, + ofBlock(getCasingBlock3(), getTungstenCasingMeta())))) .build(); } return STRUCTURE_DEFINITION; diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialMultiMachine.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialMultiMachine.java index 8e25769c9c..872c828f05 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialMultiMachine.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialMultiMachine.java @@ -6,10 +6,21 @@ import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose import static gregtech.api.enums.GT_HatchElement.*; import static gregtech.api.util.GT_StructureUtility.buildHatchAdder; +import java.util.ArrayList; +import java.util.Arrays; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.StatCollector; +import net.minecraftforge.fluids.FluidStack; + import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable; import com.gtnewhorizon.structurelib.structure.IStructureDefinition; import com.gtnewhorizon.structurelib.structure.ISurvivalBuildEnvironment; import com.gtnewhorizon.structurelib.structure.StructureDefinition; + import gregtech.api.enums.TAE; import gregtech.api.interfaces.IIconContainer; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; @@ -24,18 +35,9 @@ import gtPlusPlus.core.util.minecraft.ItemUtils; import gtPlusPlus.core.util.minecraft.PlayerUtils; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; -import java.util.ArrayList; -import java.util.Arrays; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.StatCollector; -import net.minecraftforge.fluids.FluidStack; -public class GregtechMetaTileEntity_IndustrialMultiMachine - extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_IndustrialMultiMachine> - implements ISurvivalConstructable { +public class GregtechMetaTileEntity_IndustrialMultiMachine extends + GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_IndustrialMultiMachine> implements ISurvivalConstructable { protected int mInternalMode = 0; protected GT_Recipe[] mLastRecipeExtended = new GT_Recipe[9]; @@ -48,7 +50,7 @@ public class GregtechMetaTileEntity_IndustrialMultiMachine private static final int MODE_LASER = 6; private static final int MODE_AUTOCLAVE = 7; private static final int MODE_FLUIDSOLIDIFY = 8; - private static final int[][] MODE_MAP = new int[][] {{0, 1, 2}, {3, 4, 5}, {6, 7, 8}}; + private static final int[][] MODE_MAP = new int[][] { { 0, 1, 2 }, { 3, 4, 5 }, { 6, 7, 8 } }; public static final String[] aToolTipNames = new String[9]; private int mCasing; private static IStructureDefinition<GregtechMetaTileEntity_IndustrialMultiMachine> STRUCTURE_DEFINITION = null; @@ -63,8 +65,8 @@ public class GregtechMetaTileEntity_IndustrialMultiMachine } } - public GregtechMetaTileEntity_IndustrialMultiMachine( - final int aID, final String aName, final String aNameRegional) { + public GregtechMetaTileEntity_IndustrialMultiMachine(final int aID, final String aName, + final String aNameRegional) { super(aID, aName, aNameRegional); } @@ -90,30 +92,26 @@ public class GregtechMetaTileEntity_IndustrialMultiMachine aBuiltStrings[2] = aToolTipNames[6] + ", " + aToolTipNames[7] + ", " + aToolTipNames[8]; GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType(getMachineType()) - .addInfo("Controller Block for the Industrial Multi-Machine") + tt.addMachineType(getMachineType()).addInfo("Controller Block for the Industrial Multi-Machine") .addInfo("250% faster than using single block machines of the same voltage") - .addInfo("Only uses 80% of the EU/t normally required") - .addInfo("Processes two items per voltage tier") - .addInfo("Machine Type: [A] - " + EnumChatFormatting.YELLOW + aBuiltStrings[0] - + EnumChatFormatting.RESET) - .addInfo("Machine Type: [B] - " + EnumChatFormatting.YELLOW + aBuiltStrings[1] - + EnumChatFormatting.RESET) - .addInfo("Machine Type: [C] - " + EnumChatFormatting.YELLOW + aBuiltStrings[2] - + EnumChatFormatting.RESET) + .addInfo("Only uses 80% of the EU/t normally required").addInfo("Processes two items per voltage tier") + .addInfo( + "Machine Type: [A] - " + EnumChatFormatting.YELLOW + + aBuiltStrings[0] + + EnumChatFormatting.RESET) + .addInfo( + "Machine Type: [B] - " + EnumChatFormatting.YELLOW + + aBuiltStrings[1] + + EnumChatFormatting.RESET) + .addInfo( + "Machine Type: [C] - " + EnumChatFormatting.YELLOW + + aBuiltStrings[2] + + EnumChatFormatting.RESET) .addInfo("Read Multi-Machine Manual for extra information") - .addPollutionAmount(getPollutionPerSecond(null)) - .addSeparator() - .beginStructureBlock(3, 3, 3, true) - .addController("Front Center") - .addCasingInfo("Multi-Use Casings", 6) - .addInputBus("Any Casing", 1) - .addOutputBus("Any Casing", 1) - .addInputHatch("Any Casing", 1) - .addOutputHatch("Any Casing", 1) - .addEnergyHatch("Any Casing", 1) - .addMaintenanceHatch("Any Casing", 1) - .addMufflerHatch("Any Casing", 1) + .addPollutionAmount(getPollutionPerSecond(null)).addSeparator().beginStructureBlock(3, 3, 3, true) + .addController("Front Center").addCasingInfo("Multi-Use Casings", 6).addInputBus("Any Casing", 1) + .addOutputBus("Any Casing", 1).addInputHatch("Any Casing", 1).addOutputHatch("Any Casing", 1) + .addEnergyHatch("Any Casing", 1).addMaintenanceHatch("Any Casing", 1).addMufflerHatch("Any Casing", 1) .toolTipFinisher(CORE.GT_Tooltip_Builder); return tt; } @@ -122,18 +120,16 @@ public class GregtechMetaTileEntity_IndustrialMultiMachine public IStructureDefinition<GregtechMetaTileEntity_IndustrialMultiMachine> getStructureDefinition() { if (STRUCTURE_DEFINITION == null) { STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_IndustrialMultiMachine>builder() - .addShape(mName, transpose(new String[][] { - {"CCC", "CCC", "CCC"}, - {"C~C", "C-C", "CCC"}, - {"CCC", "CCC", "CCC"}, - })) + .addShape( + mName, + transpose( + new String[][] { { "CCC", "CCC", "CCC" }, { "C~C", "C-C", "CCC" }, + { "CCC", "CCC", "CCC" }, })) .addElement( 'C', buildHatchAdder(GregtechMetaTileEntity_IndustrialMultiMachine.class) .atLeast(InputBus, OutputBus, Maintenance, Energy, Muffler, InputHatch, OutputHatch) - .casingIndex(getTextureIndex()) - .dot(1) - .buildAndChain( + .casingIndex(getTextureIndex()).dot(1).buildAndChain( onElementPass(x -> ++x.mCasing, ofBlock(ModBlocks.blockCasings3Misc, 2)))) .build(); } @@ -200,8 +196,8 @@ public class GregtechMetaTileEntity_IndustrialMultiMachine Object[] tempArray = tFluids.toArray(new FluidStack[] {}); FluidStack[] properArray; - properArray = - ((tempArray != null && tempArray.length > 0) ? (FluidStack[]) tempArray : new FluidStack[] {}); + properArray = ((tempArray != null && tempArray.length > 0) ? (FluidStack[]) tempArray + : new FluidStack[] {}); // Logger.MACHINE_INFO("4"); if (checkRecipeGeneric( @@ -210,7 +206,8 @@ public class GregtechMetaTileEntity_IndustrialMultiMachine (2 * GT_Utility.getTier(this.getMaxInputVoltage())), 80, 250, - 10000)) return true; + 10000)) + return true; } return false; @@ -308,13 +305,8 @@ public class GregtechMetaTileEntity_IndustrialMultiMachine } @Override - public boolean checkRecipeGeneric( - ItemStack[] aItemInputs, - FluidStack[] aFluidInputs, - int aMaxParallelRecipes, - long aEUPercent, - int aSpeedBonusPercent, - int aOutputChanceRoll) { + public boolean checkRecipeGeneric(ItemStack[] aItemInputs, FluidStack[] aFluidInputs, int aMaxParallelRecipes, + long aEUPercent, int aSpeedBonusPercent, int aOutputChanceRoll) { // Based on the Processing Array. A bit overkill, but very flexible. @@ -353,14 +345,9 @@ public class GregtechMetaTileEntity_IndustrialMultiMachine return false; } - GT_ParallelHelper helper = new GT_ParallelHelper() - .setRecipe(tRecipe) - .setItemInputs(aItemInputs) - .setFluidInputs(aFluidInputs) - .setAvailableEUt(tEnergy) - .setMaxParallel(aMaxParallelRecipes) - .enableConsumption() - .enableOutputCalculation(); + GT_ParallelHelper helper = new GT_ParallelHelper().setRecipe(tRecipe).setItemInputs(aItemInputs) + .setFluidInputs(aFluidInputs).setAvailableEUt(tEnergy).setMaxParallel(aMaxParallelRecipes) + .enableConsumption().enableOutputCalculation(); if (!mVoidExcess) { helper.enableVoidProtection(this); } @@ -378,14 +365,10 @@ public class GregtechMetaTileEntity_IndustrialMultiMachine this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000); this.mEfficiencyIncrease = 10000; - GT_OverclockCalculator calculator = new GT_OverclockCalculator() - .setRecipeEUt(tRecipe.mEUt) - .setEUt(tEnergy) - .setDuration(tRecipe.mDuration) - .setEUtDiscount(aEUPercent / 100.0f) + GT_OverclockCalculator calculator = new GT_OverclockCalculator().setRecipeEUt(tRecipe.mEUt).setEUt(tEnergy) + .setDuration(tRecipe.mDuration).setEUtDiscount(aEUPercent / 100.0f) .setSpeedBoost(100.0f / (100.0f + aSpeedBonusPercent)) - .setParallel(Math.min(aMaxParallelRecipes, helper.getCurrentParallel())) - .calculate(); + .setParallel(Math.min(aMaxParallelRecipes, helper.getCurrentParallel())).calculate(); lEUt = -calculator.getConsumption(); mMaxProgresstime = (int) Math.ceil(calculator.getDuration() * helper.getDurationMultiplier()); @@ -405,8 +388,8 @@ public class GregtechMetaTileEntity_IndustrialMultiMachine } else { mInternalMode = 0; } - String mModeString = - (mInternalMode == 0 ? "Metal" : mInternalMode == 1 ? "Fluid" : mInternalMode == 2 ? "Misc." : "null"); + String mModeString = (mInternalMode == 0 ? "Metal" + : mInternalMode == 1 ? "Fluid" : mInternalMode == 2 ? "Misc." : "null"); PlayerUtils.messagePlayer(aPlayer, "Multi-Machine is now in " + mModeString + " mode."); mLastRecipe = null; } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialPlatePress.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialPlatePress.java index 86a9c517a0..6c63b25833 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialPlatePress.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialPlatePress.java @@ -6,10 +6,18 @@ import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose import static gregtech.api.enums.GT_HatchElement.*; import static gregtech.api.util.GT_StructureUtility.buildHatchAdder; +import java.util.ArrayList; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraftforge.fluids.FluidStack; + import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable; import com.gtnewhorizon.structurelib.structure.IStructureDefinition; import com.gtnewhorizon.structurelib.structure.ISurvivalBuildEnvironment; import com.gtnewhorizon.structurelib.structure.StructureDefinition; + import gregtech.api.GregTech_API; import gregtech.api.interfaces.IIconContainer; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; @@ -24,15 +32,9 @@ import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.minecraft.PlayerUtils; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; -import java.util.ArrayList; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraftforge.fluids.FluidStack; -public class GregtechMetaTileEntity_IndustrialPlatePress - extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_IndustrialPlatePress> - implements ISurvivalConstructable { +public class GregtechMetaTileEntity_IndustrialPlatePress extends + GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_IndustrialPlatePress> implements ISurvivalConstructable { private boolean mFormingMode = false; private int mCasing; @@ -59,22 +61,14 @@ public class GregtechMetaTileEntity_IndustrialPlatePress @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType(getMachineType()) - .addInfo("Controller Block for Advanced Bending & Forming") + tt.addMachineType(getMachineType()).addInfo("Controller Block for Advanced Bending & Forming") .addInfo("500% faster than using single block machines of the same voltage") - .addInfo("Processes four items per voltage tier") - .addInfo("Circuit for recipe goes in the Input Bus") + .addInfo("Processes four items per voltage tier").addInfo("Circuit for recipe goes in the Input Bus") .addInfo("Each Input Bus can have a different Circuit/Shape!") - .addPollutionAmount(getPollutionPerSecond(null)) - .addSeparator() - .beginStructureBlock(3, 3, 3, true) - .addController("Front Center") - .addCasingInfo("Material Press Machine Casings", 10) - .addInputBus("Any Casing", 1) - .addOutputBus("Any Casing", 1) - .addEnergyHatch("Any Casing", 1) - .addMaintenanceHatch("Any Casing", 1) - .addMufflerHatch("Any Casing", 1) + .addPollutionAmount(getPollutionPerSecond(null)).addSeparator().beginStructureBlock(3, 3, 3, true) + .addController("Front Center").addCasingInfo("Material Press Machine Casings", 10) + .addInputBus("Any Casing", 1).addOutputBus("Any Casing", 1).addEnergyHatch("Any Casing", 1) + .addMaintenanceHatch("Any Casing", 1).addMufflerHatch("Any Casing", 1) .toolTipFinisher(CORE.GT_Tooltip_Builder); return tt; } @@ -83,17 +77,15 @@ public class GregtechMetaTileEntity_IndustrialPlatePress public IStructureDefinition<GregtechMetaTileEntity_IndustrialPlatePress> getStructureDefinition() { if (STRUCTURE_DEFINITION == null) { STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_IndustrialPlatePress>builder() - .addShape(mName, transpose(new String[][] { - {"CCC", "CCC", "CCC"}, - {"C~C", "C-C", "CCC"}, - {"CCC", "CCC", "CCC"}, - })) + .addShape( + mName, + transpose( + new String[][] { { "CCC", "CCC", "CCC" }, { "C~C", "C-C", "CCC" }, + { "CCC", "CCC", "CCC" }, })) .addElement( 'C', buildHatchAdder(GregtechMetaTileEntity_IndustrialPlatePress.class) - .atLeast(InputBus, OutputBus, Maintenance, Energy, Muffler) - .casingIndex(50) - .dot(1) + .atLeast(InputBus, OutputBus, Maintenance, Energy, Muffler).casingIndex(50).dot(1) .buildAndChain( onElementPass(x -> ++x.mCasing, ofBlock(ModBlocks.blockCasingsMisc, 4)))) .build(); @@ -161,7 +153,8 @@ public class GregtechMetaTileEntity_IndustrialPlatePress (4 * GT_Utility.getTier(this.getMaxInputVoltage())), 100, 500, - 10000)) return true; + 10000)) + return true; } return false; } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialSifter.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialSifter.java index 3a7fc25f11..672ac578f7 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialSifter.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialSifter.java @@ -6,10 +6,16 @@ import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose import static gregtech.api.enums.GT_HatchElement.*; import static gregtech.api.util.GT_StructureUtility.buildHatchAdder; +import java.util.Random; + +import net.minecraft.item.ItemStack; +import net.minecraftforge.common.util.ForgeDirection; + import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable; import com.gtnewhorizon.structurelib.structure.IStructureDefinition; import com.gtnewhorizon.structurelib.structure.ISurvivalBuildEnvironment; import com.gtnewhorizon.structurelib.structure.StructureDefinition; + import gregtech.api.enums.TAE; import gregtech.api.interfaces.IIconContainer; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; @@ -21,9 +27,6 @@ import gtPlusPlus.core.block.ModBlocks; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; -import java.util.Random; -import net.minecraft.item.ItemStack; -import net.minecraftforge.common.util.ForgeDirection; public class GregtechMetaTileEntity_IndustrialSifter extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_IndustrialSifter> implements ISurvivalConstructable { @@ -52,25 +55,14 @@ public class GregtechMetaTileEntity_IndustrialSifter @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType(getMachineType()) - .addInfo("Controller Block for the Industrial Sifter") + tt.addMachineType(getMachineType()).addInfo("Controller Block for the Industrial Sifter") .addInfo("400% faster than single-block machines of the same voltage") - .addInfo("Only uses 75% of the EU/t normally required") - .addInfo("Processes four items per voltage tier") - .addPollutionAmount(getPollutionPerSecond(null)) - .addSeparator() - .beginStructureBlock(5, 3, 5, false) - .addController("Bottom Center") - .addCasingInfo("Sieve Grate", 18) - .addCasingInfo("Sieve Casings", 35) - .addInputBus("Any Casing", 1) - .addOutputBus("Any Casing (x4)", 1) - .addInputHatch("Any Casing", 1) - .addOutputHatch("Any Casing", 1) - .addEnergyHatch("Any Casing", 1) - .addMaintenanceHatch("Any Casing", 1) - .addMufflerHatch("Any Casing", 1) - .toolTipFinisher(CORE.GT_Tooltip_Builder); + .addInfo("Only uses 75% of the EU/t normally required").addInfo("Processes four items per voltage tier") + .addPollutionAmount(getPollutionPerSecond(null)).addSeparator().beginStructureBlock(5, 3, 5, false) + .addController("Bottom Center").addCasingInfo("Sieve Grate", 18).addCasingInfo("Sieve Casings", 35) + .addInputBus("Any Casing", 1).addOutputBus("Any Casing (x4)", 1).addInputHatch("Any Casing", 1) + .addOutputHatch("Any Casing", 1).addEnergyHatch("Any Casing", 1).addMaintenanceHatch("Any Casing", 1) + .addMufflerHatch("Any Casing", 1).toolTipFinisher(CORE.GT_Tooltip_Builder); return tt; } @@ -78,21 +70,19 @@ public class GregtechMetaTileEntity_IndustrialSifter public IStructureDefinition<GregtechMetaTileEntity_IndustrialSifter> getStructureDefinition() { if (STRUCTURE_DEFINITION == null) { STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_IndustrialSifter>builder() - .addShape(mName, transpose(new String[][] { - {"CCCCC", "CMMMC", "CMMMC", "CMMMC", "CCCCC"}, - {"CCCCC", "CMMMC", "CMMMC", "CMMMC", "CCCCC"}, - {"CC~CC", "CCCCC", "CCCCC", "CCCCC", "CCCCC"}, - })) + .addShape( + mName, + transpose( + new String[][] { { "CCCCC", "CMMMC", "CMMMC", "CMMMC", "CCCCC" }, + { "CCCCC", "CMMMC", "CMMMC", "CMMMC", "CCCCC" }, + { "CC~CC", "CCCCC", "CCCCC", "CCCCC", "CCCCC" }, })) .addElement( 'C', buildHatchAdder(GregtechMetaTileEntity_IndustrialSifter.class) .atLeast(InputBus, OutputBus, Maintenance, Energy, Muffler, InputHatch, OutputHatch) - .casingIndex(TAE.GTPP_INDEX(21)) - .dot(1) - .buildAndChain( + .casingIndex(TAE.GTPP_INDEX(21)).dot(1).buildAndChain( onElementPass(x -> ++x.mCasing, ofBlock(ModBlocks.blockCasings2Misc, 5)))) - .addElement('M', ofBlock(ModBlocks.blockCasings2Misc, 6)) - .build(); + .addElement('M', ofBlock(ModBlocks.blockCasings2Misc, 6)).build(); } return STRUCTURE_DEFINITION; } @@ -137,8 +127,7 @@ public class GregtechMetaTileEntity_IndustrialSifter @Override public void onPreTick(final IGregTechTileEntity aBaseMetaTileEntity, final long aTick) { super.onPreTick(aBaseMetaTileEntity, aTick); - if ((aBaseMetaTileEntity.isClientSide()) - && (aBaseMetaTileEntity.isActive()) + if ((aBaseMetaTileEntity.isClientSide()) && (aBaseMetaTileEntity.isActive()) && (aBaseMetaTileEntity.getFrontFacing() != 1) && (aBaseMetaTileEntity.getCoverIDAtSide((byte) 1) == 0) && (!aBaseMetaTileEntity.getOpacityAtSide((byte) 1))) { @@ -148,16 +137,14 @@ public class GregtechMetaTileEntity_IndustrialSifter final int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX * 2; final int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ * 2; - aBaseMetaTileEntity - .getWorld() - .spawnParticle( - "smoke", - (aBaseMetaTileEntity.getXCoord() + xDir + 2.1F) - (tRandom.nextFloat() * 3.2F), - aBaseMetaTileEntity.getYCoord() + 2.5f + (tRandom.nextFloat() * 1.2F), - (aBaseMetaTileEntity.getZCoord() + zDir + 2.1F) - (tRandom.nextFloat() * 3.2F), - 0.0, - 0.0, - 0.0); + aBaseMetaTileEntity.getWorld().spawnParticle( + "smoke", + (aBaseMetaTileEntity.getXCoord() + xDir + 2.1F) - (tRandom.nextFloat() * 3.2F), + aBaseMetaTileEntity.getYCoord() + 2.5f + (tRandom.nextFloat() * 1.2F), + (aBaseMetaTileEntity.getZCoord() + zDir + 2.1F) - (tRandom.nextFloat() * 3.2F), + 0.0, + 0.0, + 0.0); } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialSinter.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialSinter.java index 95672d5e48..5ff238a1f8 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialSinter.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialSinter.java @@ -1,239 +1,92 @@ /* -package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing; - - -public class GregtechMetaTileEntity_IndustrialSinter -extends GT_MetaTileEntity_MultiBlockBase { - - - RenderBlocks asdasd = RenderBlocks.getInstance(); - - public GregtechMetaTileEntity_IndustrialSinter(final int aID, final String aName, final String aNameRegional) { - super(aID, aName, aNameRegional); - } - - public GregtechMetaTileEntity_IndustrialSinter(final String aName) { - super(aName); - } - - @Override - public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) { - return new GregtechMetaTileEntity_IndustrialSinter(this.mName); - } - - @Override - public String[] getDescription() { - return new String[]{ - "Controller Block for the Industrial Sinter Furnace", - "Size: 3x5x3 [WxLxH] (Hollow)", "Controller (front centered)", - "2x Input Bus (side centered)", - "2x Output Bus (side centered)", - "1x Energy Hatch (top or bottom centered)", - "1x Maintenance Hatch (back centered)", - "Sinter Furnace Casings for the rest (32 at least!)", - "Causes " + 20 * this.getPollutionPerTick(null) + " Pollution per second", - CORE.GT_Tooltip - }; - } - - @Override - public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing, final byte aColorIndex, final boolean aActive, final boolean aRedstone) { - if (aSide == aFacing) { - return new ITexture[]{Textures.BlockIcons.getCasingTextureForId(TAE.GTPP_INDEX(7)), new GT_RenderedTexture(aActive ? TexturesGtBlock.Overlay_Machine_Controller_Default_Active : TexturesGtBlock.Overlay_Machine_Controller_Default)}; - } - return new ITexture[]{Textures.BlockIcons.getCasingTextureForId(TAE.GTPP_INDEX(7))}; - } - - @Override - public GT_Recipe.GT_Recipe_Map getRecipeMap() { - return GT_Recipe.GT_Recipe_Map.sWiremillRecipes; - } - - @Override - public boolean isCorrectMachinePart(final ItemStack aStack) { - return true; - } - - @Override - public boolean isFacingValid(final byte aFacing) { - return aFacing > 1; - } - - @Override - public boolean checkRecipe(final ItemStack aStack) { - final ArrayList<ItemStack> tInputList = this.getStoredInputs(); - for (final ItemStack tInput : tInputList) { - final long tVoltage = this.getMaxInputVoltage(); - final byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage)); - - final GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sWiremillRecipes.findRecipe(this.getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[tTier], null, new ItemStack[]{tInput}); - if (tRecipe != null) { - if (tRecipe.isRecipeInputEqual(true, null, new ItemStack[]{tInput})) { - this.mEfficiency = (10000 - ((this.getIdealStatus() - this.getRepairStatus()) * 1000)); - this.mEfficiencyIncrease = 10000; - if (tRecipe.mEUt <= 16) { - this.mEUt = (tRecipe.mEUt * (1 << (tTier - 1)) * (1 << (tTier - 1))); - this.mMaxProgresstime = (tRecipe.mDuration / (1 << (tTier - 1))); - } else { - this.mEUt = tRecipe.mEUt; - this.mMaxProgresstime = tRecipe.mDuration; - while (this.mEUt <= gregtech.api.enums.GT_Values.V[(tTier - 1)]) { - this.mEUt *= 4; - this.mMaxProgresstime /= 2; - } - } - if (this.mEUt > 0) { - this.mEUt = (-this.mEUt); - } - this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime); - this.mOutputItems = new ItemStack[]{tRecipe.getOutput(0)}; - this.updateSlots(); - return true; - } - } - } - return false; - } - - @Override - public boolean checkMachine(final IGregTechTileEntity aBaseMetaTileEntity, final ItemStack aStack) { - final int controllerX = aBaseMetaTileEntity.getXCoord(); - final int controllerY = aBaseMetaTileEntity.getYCoord(); - final int controllerZ = aBaseMetaTileEntity.getZCoord(); - - final byte tSide = this.getBaseMetaTileEntity().getBackFacing(); - if ((this.getBaseMetaTileEntity().getAirAtSideAndDistance(this.getBaseMetaTileEntity().getBackFacing(), 1)) && (this.getBaseMetaTileEntity().getAirAtSideAndDistance(this.getBaseMetaTileEntity().getBackFacing(), 2) && (this.getBaseMetaTileEntity().getAirAtSideAndDistance(this.getBaseMetaTileEntity().getBackFacing(), 3)))) { - int tAirCount = 0; - for (byte i = -1; i < 2; i = (byte) (i + 1)) { - for (byte j = -1; j < 2; j = (byte) (j + 1)) { - for (byte k = -1; k < 2; k = (byte) (k + 1)) { - if (this.getBaseMetaTileEntity().getAirOffset(i, j, k)) { - Logger.INFO("Found Air at: "+(controllerX+i)+" "+(controllerY+k)+" "+(controllerZ+k)); - //if (aBaseMetaTileEntity.getWorld().isRemote){ - //asdasd.renderStandardBlock(ModBlocks.MatterFabricatorEffectBlock, (controllerX+i), (controllerY+k), (controllerZ+k)); - //UtilsRendering.drawBlockInWorld((controllerX+i), (controllerY+k), (controllerZ+k), Color.YELLOW_GREEN); - //} - tAirCount++; - } - } - } - } - if (tAirCount != 10) { - Logger.INFO("False. Air != 10. Air == "+tAirCount); - //return false; - } - for (byte i = 2; i < 6; i = (byte) (i + 1)) { - //UtilsRendering.drawBlockInWorld((controllerX+i), (controllerY), (controllerZ), Color.LIME_GREEN); - IGregTechTileEntity tTileEntity; - if ((null != (tTileEntity = this.getBaseMetaTileEntity().getIGregTechTileEntityAtSideAndDistance(i, 2))) && - (tTileEntity.getFrontFacing() == this.getBaseMetaTileEntity().getFrontFacing()) && (tTileEntity.getMetaTileEntity() != null) && - ((tTileEntity.getMetaTileEntity() instanceof GregtechMetaTileEntity_IndustrialSinter))) { - //Utils.LOG_INFO("False 1"); - return false; - } - } - final int tX = this.getBaseMetaTileEntity().getXCoord(); - final int tY = this.getBaseMetaTileEntity().getYCoord(); - final int tZ = this.getBaseMetaTileEntity().getZCoord(); - for (byte i = -1; i < 2; i = (byte) (i + 1)) { - for (byte j = -1; j < 2; j = (byte) (j + 1)) { - if ((i != 0) || (j != 0)) { - for (byte k = 0; k < 5; k = (byte) (k + 1)) { - //UtilsRendering.drawBlockInWorld((controllerX+i), (controllerY+k), (controllerZ+k), Color.ORANGE); - if (((i == 0) || (j == 0)) && ((k == 1) || (k == 2) || (k == 3))) { - //UtilsRendering.drawBlockInWorld((controllerX+i), (controllerY+k), (controllerZ+k), Color.TOMATO); - if ((this.getBaseMetaTileEntity().getBlock(tX + (tSide == 5 ? k : tSide == 4 ? -k : i), tY + j, tZ + (tSide == 2 ? -k : tSide == 3 ? k : i)) == this.getCasingBlock()) && (this.getBaseMetaTileEntity().getMetaID(tX + (tSide == 5 ? k : tSide == 4 ? -k : i), tY + j, tZ + (tSide == 2 ? -k : tSide == 3 ? k : i)) == this.getCasingMeta())) { - } - else if (!this.addToMachineList(this.getBaseMetaTileEntity().getIGregTechTileEntity(tX + (tSide == 5 ? k : tSide == 4 ? -k : i), tY + j, tZ + (tSide == 2 ? -k : tSide == 3 ? k : i))) && (!this.addEnergyInputToMachineList(this.getBaseMetaTileEntity().getIGregTechTileEntity(tX + (tSide == 5 ? k : tSide == 4 ? -k : i), tY + j, tZ + (tSide == 2 ? -k : tSide == 3 ? k : i))))) { - Logger.INFO("False 2"); - return false; - } - } - else if ((this.getBaseMetaTileEntity().getBlock(tX + (tSide == 5 ? k : tSide == 4 ? -k : i), tY + j, tZ + (tSide == 2 ? -k : tSide == 3 ? k : i)) == this.getCasingBlock()) && (this.getBaseMetaTileEntity().getMetaID(tX + (tSide == 5 ? k : tSide == 4 ? -k : i), tY + j, tZ + (tSide == 2 ? -k : tSide == 3 ? k : i)) == this.getCasingMeta())) { - } - else { - Logger.INFO("False 3"); - return false; - } - } - } - } - } - if ((this.mOutputHatches.size() != 0) || (this.mInputHatches.size() != 0)) { - Logger.INFO("Use Busses, Not Hatches for Input/Output."); - return false; - } - if ((this.mInputBusses.size() != 2) || (this.mOutputBusses.size() != 2)) { - Logger.INFO("Incorrect amount of Input & Output busses."); - return false; - } - this.mMaintenanceHatches.clear(); - final IGregTechTileEntity tTileEntity = this.getBaseMetaTileEntity().getIGregTechTileEntityAtSideAndDistance(this.getBaseMetaTileEntity().getBackFacing(), 4); - if ((tTileEntity != null) && (tTileEntity.getMetaTileEntity() != null)) { - if ((tTileEntity.getMetaTileEntity() instanceof GT_MetaTileEntity_Hatch_Maintenance)) { - this.mMaintenanceHatches.add((GT_MetaTileEntity_Hatch_Maintenance) tTileEntity.getMetaTileEntity()); - ((GT_MetaTileEntity_Hatch) tTileEntity.getMetaTileEntity()).mMachineBlock = this.getCasingTextureIndex(); - } else { - Logger.INFO("Maintenance hatch must be in the middle block on the back."); - return false; - } - } - if ((this.mMaintenanceHatches.size() != 1) || (this.mEnergyHatches.size() != 1)) { - Logger.INFO("Incorrect amount of Maintenance or Energy hatches."); - return false; - } - } else { - Logger.INFO("False 5"); - return false; - } - Logger.INFO("True"); - return true; - } - - @Override - public int getMaxEfficiency(final ItemStack aStack) { - return 10000; - } - - @Override - public int getPollutionPerTick(final ItemStack aStack) { - return 0; - } - - @Override - public int getDamageToComponent(final ItemStack aStack) { - return 0; - } - - public int getAmountOfOutputs() { - return 1; - } - - @Override - public boolean explodesOnComponentBreak(final ItemStack aStack) { - return false; - } - - public Block getCasingBlock() { - return ModBlocks.blockCasingsMisc; - } - - - public byte getCasingMeta() { - return 6; - } - - - public byte getCasingTextureIndex() { - return 1; //TODO - } - - private boolean addToMachineList(final IGregTechTileEntity tTileEntity) { - return ((this.addMaintenanceToMachineList(tTileEntity, this.getCasingTextureIndex())) || (this.addInputToMachineList(tTileEntity, this.getCasingTextureIndex())) || (this.addOutputToMachineList(tTileEntity, this.getCasingTextureIndex())) || (this.addMufflerToMachineList(tTileEntity, this.getCasingTextureIndex()))); - } - - private boolean addEnergyInputToMachineList(final IGregTechTileEntity tTileEntity) { - return ((this.addEnergyInputToMachineList(tTileEntity, this.getCasingTextureIndex()))); - } -} -*/ + * package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing; public class + * GregtechMetaTileEntity_IndustrialSinter extends GT_MetaTileEntity_MultiBlockBase { RenderBlocks asdasd = + * RenderBlocks.getInstance(); public GregtechMetaTileEntity_IndustrialSinter(final int aID, final String aName, final + * String aNameRegional) { super(aID, aName, aNameRegional); } public GregtechMetaTileEntity_IndustrialSinter(final + * String aName) { super(aName); } + * @Override public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) { return new + * GregtechMetaTileEntity_IndustrialSinter(this.mName); } + * @Override public String[] getDescription() { return new String[]{ + * "Controller Block for the Industrial Sinter Furnace", "Size: 3x5x3 [WxLxH] (Hollow)", "Controller (front centered)", + * "2x Input Bus (side centered)", "2x Output Bus (side centered)", "1x Energy Hatch (top or bottom centered)", + * "1x Maintenance Hatch (back centered)", "Sinter Furnace Casings for the rest (32 at least!)", "Causes " + 20 * + * this.getPollutionPerTick(null) + " Pollution per second", CORE.GT_Tooltip }; } + * @Override public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte + * aFacing, final byte aColorIndex, final boolean aActive, final boolean aRedstone) { if (aSide == aFacing) { return new + * ITexture[]{Textures.BlockIcons.getCasingTextureForId(TAE.GTPP_INDEX(7)), new GT_RenderedTexture(aActive ? + * TexturesGtBlock.Overlay_Machine_Controller_Default_Active : TexturesGtBlock.Overlay_Machine_Controller_Default)}; } + * return new ITexture[]{Textures.BlockIcons.getCasingTextureForId(TAE.GTPP_INDEX(7))}; } + * @Override public GT_Recipe.GT_Recipe_Map getRecipeMap() { return GT_Recipe.GT_Recipe_Map.sWiremillRecipes; } + * @Override public boolean isCorrectMachinePart(final ItemStack aStack) { return true; } + * @Override public boolean isFacingValid(final byte aFacing) { return aFacing > 1; } + * @Override public boolean checkRecipe(final ItemStack aStack) { final ArrayList<ItemStack> tInputList = + * this.getStoredInputs(); for (final ItemStack tInput : tInputList) { final long tVoltage = this.getMaxInputVoltage(); + * final byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage)); final GT_Recipe tRecipe = + * GT_Recipe.GT_Recipe_Map.sWiremillRecipes.findRecipe(this.getBaseMetaTileEntity(), false, + * gregtech.api.enums.GT_Values.V[tTier], null, new ItemStack[]{tInput}); if (tRecipe != null) { if + * (tRecipe.isRecipeInputEqual(true, null, new ItemStack[]{tInput})) { this.mEfficiency = (10000 - + * ((this.getIdealStatus() - this.getRepairStatus()) * 1000)); this.mEfficiencyIncrease = 10000; if (tRecipe.mEUt <= 16) + * { this.mEUt = (tRecipe.mEUt * (1 << (tTier - 1)) * (1 << (tTier - 1))); this.mMaxProgresstime = (tRecipe.mDuration / + * (1 << (tTier - 1))); } else { this.mEUt = tRecipe.mEUt; this.mMaxProgresstime = tRecipe.mDuration; while (this.mEUt + * <= gregtech.api.enums.GT_Values.V[(tTier - 1)]) { this.mEUt *= 4; this.mMaxProgresstime /= 2; } } if (this.mEUt > 0) + * { this.mEUt = (-this.mEUt); } this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime); this.mOutputItems = new + * ItemStack[]{tRecipe.getOutput(0)}; this.updateSlots(); return true; } } } return false; } + * @Override public boolean checkMachine(final IGregTechTileEntity aBaseMetaTileEntity, final ItemStack aStack) { final + * int controllerX = aBaseMetaTileEntity.getXCoord(); final int controllerY = aBaseMetaTileEntity.getYCoord(); final int + * controllerZ = aBaseMetaTileEntity.getZCoord(); final byte tSide = this.getBaseMetaTileEntity().getBackFacing(); if + * ((this.getBaseMetaTileEntity().getAirAtSideAndDistance(this.getBaseMetaTileEntity().getBackFacing(), 1)) && + * (this.getBaseMetaTileEntity().getAirAtSideAndDistance(this.getBaseMetaTileEntity().getBackFacing(), 2) && + * (this.getBaseMetaTileEntity().getAirAtSideAndDistance(this.getBaseMetaTileEntity().getBackFacing(), 3)))) { int + * tAirCount = 0; for (byte i = -1; i < 2; i = (byte) (i + 1)) { for (byte j = -1; j < 2; j = (byte) (j + 1)) { for + * (byte k = -1; k < 2; k = (byte) (k + 1)) { if (this.getBaseMetaTileEntity().getAirOffset(i, j, k)) { + * Logger.INFO("Found Air at: "+(controllerX+i)+" "+(controllerY+k)+" "+(controllerZ+k)); //if + * (aBaseMetaTileEntity.getWorld().isRemote){ //asdasd.renderStandardBlock(ModBlocks.MatterFabricatorEffectBlock, + * (controllerX+i), (controllerY+k), (controllerZ+k)); //UtilsRendering.drawBlockInWorld((controllerX+i), + * (controllerY+k), (controllerZ+k), Color.YELLOW_GREEN); //} tAirCount++; } } } } if (tAirCount != 10) { + * Logger.INFO("False. Air != 10. Air == "+tAirCount); //return false; } for (byte i = 2; i < 6; i = (byte) (i + 1)) { + * //UtilsRendering.drawBlockInWorld((controllerX+i), (controllerY), (controllerZ), Color.LIME_GREEN); + * IGregTechTileEntity tTileEntity; if ((null != (tTileEntity = + * this.getBaseMetaTileEntity().getIGregTechTileEntityAtSideAndDistance(i, 2))) && (tTileEntity.getFrontFacing() == + * this.getBaseMetaTileEntity().getFrontFacing()) && (tTileEntity.getMetaTileEntity() != null) && + * ((tTileEntity.getMetaTileEntity() instanceof GregtechMetaTileEntity_IndustrialSinter))) { + * //Utils.LOG_INFO("False 1"); return false; } } final int tX = this.getBaseMetaTileEntity().getXCoord(); final int tY + * = this.getBaseMetaTileEntity().getYCoord(); final int tZ = this.getBaseMetaTileEntity().getZCoord(); for (byte i = + * -1; i < 2; i = (byte) (i + 1)) { for (byte j = -1; j < 2; j = (byte) (j + 1)) { if ((i != 0) || (j != 0)) { for (byte + * k = 0; k < 5; k = (byte) (k + 1)) { //UtilsRendering.drawBlockInWorld((controllerX+i), (controllerY+k), + * (controllerZ+k), Color.ORANGE); if (((i == 0) || (j == 0)) && ((k == 1) || (k == 2) || (k == 3))) { + * //UtilsRendering.drawBlockInWorld((controllerX+i), (controllerY+k), (controllerZ+k), Color.TOMATO); if + * ((this.getBaseMetaTileEntity().getBlock(tX + (tSide == 5 ? k : tSide == 4 ? -k : i), tY + j, tZ + (tSide == 2 ? -k : + * tSide == 3 ? k : i)) == this.getCasingBlock()) && (this.getBaseMetaTileEntity().getMetaID(tX + (tSide == 5 ? k : + * tSide == 4 ? -k : i), tY + j, tZ + (tSide == 2 ? -k : tSide == 3 ? k : i)) == this.getCasingMeta())) { } else if + * (!this.addToMachineList(this.getBaseMetaTileEntity().getIGregTechTileEntity(tX + (tSide == 5 ? k : tSide == 4 ? -k : + * i), tY + j, tZ + (tSide == 2 ? -k : tSide == 3 ? k : i))) && + * (!this.addEnergyInputToMachineList(this.getBaseMetaTileEntity().getIGregTechTileEntity(tX + (tSide == 5 ? k : tSide + * == 4 ? -k : i), tY + j, tZ + (tSide == 2 ? -k : tSide == 3 ? k : i))))) { Logger.INFO("False 2"); return false; } } + * else if ((this.getBaseMetaTileEntity().getBlock(tX + (tSide == 5 ? k : tSide == 4 ? -k : i), tY + j, tZ + (tSide == 2 + * ? -k : tSide == 3 ? k : i)) == this.getCasingBlock()) && (this.getBaseMetaTileEntity().getMetaID(tX + (tSide == 5 ? k + * : tSide == 4 ? -k : i), tY + j, tZ + (tSide == 2 ? -k : tSide == 3 ? k : i)) == this.getCasingMeta())) { } else { + * Logger.INFO("False 3"); return false; } } } } } if ((this.mOutputHatches.size() != 0) || (this.mInputHatches.size() + * != 0)) { Logger.INFO("Use Busses, Not Hatches for Input/Output."); return false; } if ((this.mInputBusses.size() != + * 2) || (this.mOutputBusses.size() != 2)) { Logger.INFO("Incorrect amount of Input & Output busses."); return false; } + * this.mMaintenanceHatches.clear(); final IGregTechTileEntity tTileEntity = + * this.getBaseMetaTileEntity().getIGregTechTileEntityAtSideAndDistance(this.getBaseMetaTileEntity().getBackFacing(), + * 4); if ((tTileEntity != null) && (tTileEntity.getMetaTileEntity() != null)) { if ((tTileEntity.getMetaTileEntity() + * instanceof GT_MetaTileEntity_Hatch_Maintenance)) { this.mMaintenanceHatches.add((GT_MetaTileEntity_Hatch_Maintenance) + * tTileEntity.getMetaTileEntity()); ((GT_MetaTileEntity_Hatch) tTileEntity.getMetaTileEntity()).mMachineBlock = + * this.getCasingTextureIndex(); } else { Logger.INFO("Maintenance hatch must be in the middle block on the back."); + * return false; } } if ((this.mMaintenanceHatches.size() != 1) || (this.mEnergyHatches.size() != 1)) { + * Logger.INFO("Incorrect amount of Maintenance or Energy hatches."); return false; } } else { Logger.INFO("False 5"); + * return false; } Logger.INFO("True"); return true; } + * @Override public int getMaxEfficiency(final ItemStack aStack) { return 10000; } + * @Override public int getPollutionPerTick(final ItemStack aStack) { return 0; } + * @Override public int getDamageToComponent(final ItemStack aStack) { return 0; } public int getAmountOfOutputs() { + * return 1; } + * @Override public boolean explodesOnComponentBreak(final ItemStack aStack) { return false; } public Block + * getCasingBlock() { return ModBlocks.blockCasingsMisc; } public byte getCasingMeta() { return 6; } public byte + * getCasingTextureIndex() { return 1; //TODO } private boolean addToMachineList(final IGregTechTileEntity tTileEntity) + * { return ((this.addMaintenanceToMachineList(tTileEntity, this.getCasingTextureIndex())) || + * (this.addInputToMachineList(tTileEntity, this.getCasingTextureIndex())) || (this.addOutputToMachineList(tTileEntity, + * this.getCasingTextureIndex())) || (this.addMufflerToMachineList(tTileEntity, this.getCasingTextureIndex()))); } + * private boolean addEnergyInputToMachineList(final IGregTechTileEntity tTileEntity) { return + * ((this.addEnergyInputToMachineList(tTileEntity, this.getCasingTextureIndex()))); } } + */ diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialThermalCentrifuge.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialThermalCentrifuge.java index 6359679149..35116fbb13 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialThermalCentrifuge.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialThermalCentrifuge.java @@ -7,10 +7,14 @@ import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose import static gregtech.api.enums.GT_HatchElement.*; import static gregtech.api.util.GT_StructureUtility.buildHatchAdder; +import net.minecraft.block.Block; +import net.minecraft.item.ItemStack; + import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable; import com.gtnewhorizon.structurelib.structure.IStructureDefinition; import com.gtnewhorizon.structurelib.structure.ISurvivalBuildEnvironment; import com.gtnewhorizon.structurelib.structure.StructureDefinition; + import gregtech.api.GregTech_API; import gregtech.api.enums.TAE; import gregtech.api.interfaces.IIconContainer; @@ -23,8 +27,6 @@ import gtPlusPlus.core.block.ModBlocks; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; -import net.minecraft.block.Block; -import net.minecraft.item.ItemStack; public class GregtechMetaTileEntity_IndustrialThermalCentrifuge extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_IndustrialThermalCentrifuge> @@ -33,8 +35,8 @@ public class GregtechMetaTileEntity_IndustrialThermalCentrifuge private int mCasing; private static IStructureDefinition<GregtechMetaTileEntity_IndustrialThermalCentrifuge> STRUCTURE_DEFINITION = null; - public GregtechMetaTileEntity_IndustrialThermalCentrifuge( - final int aID, final String aName, final String aNameRegional) { + public GregtechMetaTileEntity_IndustrialThermalCentrifuge(final int aID, final String aName, + final String aNameRegional) { super(aID, aName, aNameRegional); } @@ -55,21 +57,14 @@ public class GregtechMetaTileEntity_IndustrialThermalCentrifuge @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType(getMachineType()) - .addInfo("Controller Block for the Industrial Thermal Centrifuge") + tt.addMachineType(getMachineType()).addInfo("Controller Block for the Industrial Thermal Centrifuge") .addInfo("150% faster than using single block machines of the same voltage") .addInfo("Only uses 80% of the EU/t normally required") - .addInfo("Processes eight items per voltage tier") - .addPollutionAmount(getPollutionPerSecond(null)) - .addSeparator() - .beginStructureBlock(3, 2, 3, false) - .addController("Front Center") - .addCasingInfo("Thermal Processing Casings/Noise Hazard Sign Blocks", 8) - .addInputBus("Bottom Casing", 1) - .addOutputBus("Bottom Casing", 1) - .addEnergyHatch("Bottom Casing", 1) - .addMaintenanceHatch("Bottom Casing", 1) - .addMufflerHatch("Bottom Casing", 1) + .addInfo("Processes eight items per voltage tier").addPollutionAmount(getPollutionPerSecond(null)) + .addSeparator().beginStructureBlock(3, 2, 3, false).addController("Front Center") + .addCasingInfo("Thermal Processing Casings/Noise Hazard Sign Blocks", 8).addInputBus("Bottom Casing", 1) + .addOutputBus("Bottom Casing", 1).addEnergyHatch("Bottom Casing", 1) + .addMaintenanceHatch("Bottom Casing", 1).addMufflerHatch("Bottom Casing", 1) .toolTipFinisher(CORE.GT_Tooltip_Builder); return tt; } @@ -78,18 +73,13 @@ public class GregtechMetaTileEntity_IndustrialThermalCentrifuge public IStructureDefinition<GregtechMetaTileEntity_IndustrialThermalCentrifuge> getStructureDefinition() { if (STRUCTURE_DEFINITION == null) { STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_IndustrialThermalCentrifuge>builder() - .addShape(mName, transpose(new String[][] { - {"X~X", "XXX", "XXX"}, - {"CCC", "CCC", "CCC"}, - })) + .addShape(mName, transpose(new String[][] { { "X~X", "XXX", "XXX" }, { "CCC", "CCC", "CCC" }, })) .addElement( 'C', ofChain( buildHatchAdder(GregtechMetaTileEntity_IndustrialThermalCentrifuge.class) .atLeast(InputBus, OutputBus, Maintenance, Energy, Muffler) - .casingIndex(getCasingTextureIndex()) - .dot(1) - .build(), + .casingIndex(getCasingTextureIndex()).dot(1).build(), onElementPass(x -> ++x.mCasing, ofBlock(ModBlocks.blockCasings2Misc, 0)), onElementPass(x -> ++x.mCasing, ofBlock(GregTech_API.sBlockCasings3, 9)))) .addElement( diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialVacuumFreezer.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialVacuumFreezer.java index ecd1f2403c..c123d449e2 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialVacuumFreezer.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialVacuumFreezer.java @@ -7,10 +7,16 @@ import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose import static gregtech.api.enums.GT_HatchElement.*; import static gregtech.api.util.GT_StructureUtility.buildHatchAdder; +import java.util.ArrayList; + +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidStack; + import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable; import com.gtnewhorizon.structurelib.structure.IStructureDefinition; import com.gtnewhorizon.structurelib.structure.ISurvivalBuildEnvironment; import com.gtnewhorizon.structurelib.structure.StructureDefinition; + import gregtech.api.enums.TAE; import gregtech.api.interfaces.IIconContainer; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; @@ -24,13 +30,9 @@ import gtPlusPlus.core.util.minecraft.FluidUtils; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GT_MetaTileEntity_Hatch_CustomFluidBase; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; -import java.util.ArrayList; -import net.minecraft.item.ItemStack; -import net.minecraftforge.fluids.FluidStack; -public class GregtechMetaTileEntity_IndustrialVacuumFreezer - extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_IndustrialVacuumFreezer> - implements ISurvivalConstructable { +public class GregtechMetaTileEntity_IndustrialVacuumFreezer extends + GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_IndustrialVacuumFreezer> implements ISurvivalConstructable { public static int CASING_TEXTURE_ID; public static String mCryoFuelName = "Gelid Cryotheum"; @@ -42,8 +44,8 @@ public class GregtechMetaTileEntity_IndustrialVacuumFreezer private final ArrayList<GT_MetaTileEntity_Hatch_CustomFluidBase> mCryotheumHatches = new ArrayList<>(); - public GregtechMetaTileEntity_IndustrialVacuumFreezer( - final int aID, final String aName, final String aNameRegional) { + public GregtechMetaTileEntity_IndustrialVacuumFreezer(final int aID, final String aName, + final String aNameRegional) { super(aID, aName, aNameRegional); mFuelStack = FluidUtils.getFluidStack("cryotheum", 1); CASING_TEXTURE_ID = TAE.getIndexFromPage(2, 10); @@ -67,25 +69,15 @@ public class GregtechMetaTileEntity_IndustrialVacuumFreezer @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType(getMachineType()) - .addInfo("Factory Grade Advanced Vacuum Freezer") + tt.addMachineType(getMachineType()).addInfo("Factory Grade Advanced Vacuum Freezer") .addInfo("Speed: +100% | EU Usage: 100% | Parallel: 4") .addInfo("Consumes 1L of " + mCryoFuelName + "/t during operation") .addInfo("Constructed exactly the same as a normal Vacuum Freezer") - .addPollutionAmount(getPollutionPerSecond(null)) - .addSeparator() - .beginStructureBlock(3, 3, 3, true) - .addController("Front Center") - .addCasingInfo(mCasingName, 10) - .addStructureHint(mHatchName, 1) - .addInputBus("Any Casing", 1) - .addOutputBus("Any Casing", 1) - .addInputHatch("Any Casing", 1) - .addOutputHatch("Any Casing", 1) - .addEnergyHatch("Any Casing", 1) - .addMaintenanceHatch("Any Casing", 1) - .addMufflerHatch("Any Casing", 1) - .toolTipFinisher(CORE.GT_Tooltip_Builder); + .addPollutionAmount(getPollutionPerSecond(null)).addSeparator().beginStructureBlock(3, 3, 3, true) + .addController("Front Center").addCasingInfo(mCasingName, 10).addStructureHint(mHatchName, 1) + .addInputBus("Any Casing", 1).addOutputBus("Any Casing", 1).addInputHatch("Any Casing", 1) + .addOutputHatch("Any Casing", 1).addEnergyHatch("Any Casing", 1).addMaintenanceHatch("Any Casing", 1) + .addMufflerHatch("Any Casing", 1).toolTipFinisher(CORE.GT_Tooltip_Builder); return tt; } @@ -93,33 +85,26 @@ public class GregtechMetaTileEntity_IndustrialVacuumFreezer public IStructureDefinition<GregtechMetaTileEntity_IndustrialVacuumFreezer> getStructureDefinition() { if (STRUCTURE_DEFINITION == null) { STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_IndustrialVacuumFreezer>builder() - .addShape(mName, transpose(new String[][] { - {"CCC", "CCC", "CCC"}, - {"C~C", "C-C", "CCC"}, - {"CCC", "CCC", "CCC"}, - })) + .addShape( + mName, + transpose( + new String[][] { { "CCC", "CCC", "CCC" }, { "C~C", "C-C", "CCC" }, + { "CCC", "CCC", "CCC" }, })) .addElement( 'C', ofChain( buildHatchAdder(GregtechMetaTileEntity_IndustrialVacuumFreezer.class) .adder(GregtechMetaTileEntity_IndustrialVacuumFreezer::addCryotheumHatch) - .hatchId(967) - .shouldReject(t -> !t.mCryotheumHatches.isEmpty()) - .casingIndex(CASING_TEXTURE_ID) - .dot(1) - .build(), - buildHatchAdder(GregtechMetaTileEntity_IndustrialVacuumFreezer.class) - .atLeast( - InputBus, - OutputBus, - Maintenance, - Energy, - Muffler, - InputHatch, - OutputHatch) - .casingIndex(CASING_TEXTURE_ID) - .dot(1) - .build(), + .hatchId(967).shouldReject(t -> !t.mCryotheumHatches.isEmpty()) + .casingIndex(CASING_TEXTURE_ID).dot(1).build(), + buildHatchAdder(GregtechMetaTileEntity_IndustrialVacuumFreezer.class).atLeast( + InputBus, + OutputBus, + Maintenance, + Energy, + Muffler, + InputHatch, + OutputHatch).casingIndex(CASING_TEXTURE_ID).dot(1).build(), onElementPass(x -> ++x.mCasing, ofBlock(ModBlocks.blockCasings3Misc, 10)))) .build(); } @@ -226,11 +211,10 @@ public class GregtechMetaTileEntity_IndustrialVacuumFreezer @Override public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { - /*if (this.getBaseMetaTileEntity().isActive()) { - if (!this.depleteInput(mFuelStack.copy())) { - this.getBaseMetaTileEntity().setActive(false); - } - } */ + /* + * if (this.getBaseMetaTileEntity().isActive()) { if (!this.depleteInput(mFuelStack.copy())) { + * this.getBaseMetaTileEntity().setActive(false); } } + */ super.onPostTick(aBaseMetaTileEntity, aTick); if (this.mStartUpCheck < 0) { diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialWashPlant.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialWashPlant.java index f8094e6086..4192515346 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialWashPlant.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialWashPlant.java @@ -4,11 +4,20 @@ import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; import static gregtech.api.enums.GT_HatchElement.*; import static gregtech.api.util.GT_StructureUtility.buildHatchAdder; +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.fluids.FluidStack; + import com.gtnewhorizon.structurelib.alignment.IAlignmentLimits; import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable; import com.gtnewhorizon.structurelib.structure.IStructureDefinition; import com.gtnewhorizon.structurelib.structure.ISurvivalBuildEnvironment; import com.gtnewhorizon.structurelib.structure.StructureDefinition; + import gregtech.api.enums.TAE; import gregtech.api.interfaces.IIconContainer; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; @@ -26,17 +35,9 @@ import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.Gregtech import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; import ic2.core.init.BlocksItems; import ic2.core.init.InternalName; -import net.minecraft.block.Block; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraftforge.common.util.ForgeDirection; -import net.minecraftforge.fluids.FluidStack; -public class GregtechMetaTileEntity_IndustrialWashPlant - extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_IndustrialWashPlant> - implements ISurvivalConstructable { +public class GregtechMetaTileEntity_IndustrialWashPlant extends + GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_IndustrialWashPlant> implements ISurvivalConstructable { private int mMode = 0; private int mCasing; @@ -63,26 +64,16 @@ public class GregtechMetaTileEntity_IndustrialWashPlant @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType(getMachineType()) - .addInfo("Controller Block for the Industrial Wash Plant") + tt.addMachineType(getMachineType()).addInfo("Controller Block for the Industrial Wash Plant") .addInfo("Can be configured with a screwdriver to also do Simple Washer and process Chemical Bathing") .addInfo("400% faster than using single block machines of the same voltage") .addInfo("Processes four item per voltage tier") .addInfo("Always requires an Input Hatch full of water to refill structure") - .addInfo("Need to be filled with water.") - .addInfo("Will automatically fill water from input hatch.") - .addPollutionAmount(getPollutionPerSecond(null)) - .addSeparator() - .beginStructureBlock(5, 3, 7, true) - .addController("Front Center") - .addCasingInfo("Wash Plant Casings", 40) - .addInputBus("Any Casing", 1) - .addOutputBus("Any Casing", 1) - .addInputHatch("Any Casing", 1) - .addOutputHatch("Any Casing", 1) - .addEnergyHatch("Any Casing", 1) - .addMaintenanceHatch("Any Casing", 1) - .addMufflerHatch("Any Casing", 1) + .addInfo("Need to be filled with water.").addInfo("Will automatically fill water from input hatch.") + .addPollutionAmount(getPollutionPerSecond(null)).addSeparator().beginStructureBlock(5, 3, 7, true) + .addController("Front Center").addCasingInfo("Wash Plant Casings", 40).addInputBus("Any Casing", 1) + .addOutputBus("Any Casing", 1).addInputHatch("Any Casing", 1).addOutputHatch("Any Casing", 1) + .addEnergyHatch("Any Casing", 1).addMaintenanceHatch("Any Casing", 1).addMufflerHatch("Any Casing", 1) .toolTipFinisher(CORE.GT_Tooltip_Builder); return tt; } @@ -91,21 +82,23 @@ public class GregtechMetaTileEntity_IndustrialWashPlant public IStructureDefinition<GregtechMetaTileEntity_IndustrialWashPlant> getStructureDefinition() { if (STRUCTURE_DEFINITION == null) { STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_IndustrialWashPlant>builder() - .addShape(mName, transpose(new String[][] { - {"CCCCC", "CwwwC", "CwwwC", "CwwwC", "CwwwC", "CwwwC", "CCCCC"}, - {"CC~CC", "CwwwC", "CwwwC", "CwwwC", "CwwwC", "CwwwC", "CCCCC"}, - {"CCCCC", "CCCCC", "CCCCC", "CCCCC", "CCCCC", "CCCCC", "CCCCC"}, - })) + .addShape( + mName, + transpose( + new String[][] { { "CCCCC", "CwwwC", "CwwwC", "CwwwC", "CwwwC", "CwwwC", "CCCCC" }, + { "CC~CC", "CwwwC", "CwwwC", "CwwwC", "CwwwC", "CwwwC", "CCCCC" }, + { "CCCCC", "CCCCC", "CCCCC", "CCCCC", "CCCCC", "CCCCC", "CCCCC" }, })) .addElement( 'C', buildHatchAdder(GregtechMetaTileEntity_IndustrialWashPlant.class) .atLeast(InputBus, InputHatch, OutputHatch, OutputBus, Maintenance, Energy, Muffler) - .casingIndex(getCasingTextureIndex()) - .dot(1) - .buildAndChain(onElementPass( - x -> ++x.mCasing, ofBlock(getCasingBlock(), getCasingMeta())))) + .casingIndex(getCasingTextureIndex()).dot(1).buildAndChain( + onElementPass( + x -> ++x.mCasing, + ofBlock(getCasingBlock(), getCasingMeta())))) .addElement( - 'w', ofChain(isAir(), ofBlockAnyMeta(Blocks.water), ofBlockAnyMeta(Blocks.flowing_water))) + 'w', + ofChain(isAir(), ofBlockAnyMeta(Blocks.water), ofBlockAnyMeta(Blocks.flowing_water))) .build(); } return STRUCTURE_DEFINITION; @@ -151,8 +144,7 @@ public class GregtechMetaTileEntity_IndustrialWashPlant @Override public GT_Recipe.GT_Recipe_Map getRecipeMap() { - return mMode == 0 - ? GT_Recipe.GT_Recipe_Map.sOreWasherRecipes + return mMode == 0 ? GT_Recipe.GT_Recipe_Map.sOreWasherRecipes : mMode == 1 ? GTPP_Recipe_Map.sSimpleWasherRecipes : GT_Recipe.GT_Recipe_Map.sChemicalBathRecipes; } @@ -237,10 +229,10 @@ public class GregtechMetaTileEntity_IndustrialWashPlant // if (aBaseMetaTileEntity.fac) - final int xDir = - ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX * mCurrentDirectionX; - final int zDir = - ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ * mCurrentDirectionZ; + final int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX + * mCurrentDirectionX; + final int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ + * mCurrentDirectionZ; int tAmount = 0; for (int i = mOffsetX_Lower + 1; i <= mOffsetX_Upper - 1; ++i) { @@ -262,13 +254,11 @@ public class GregtechMetaTileEntity_IndustrialWashPlant if (tBlock == Blocks.water) { fluidUsed = BlocksItems.getFluidBlock(InternalName.fluidDistilledWater); } - aBaseMetaTileEntity - .getWorld() - .setBlock( - aBaseMetaTileEntity.getXCoord() + xDir + i, - aBaseMetaTileEntity.getYCoord() + h, - aBaseMetaTileEntity.getZCoord() + zDir + j, - fluidUsed); + aBaseMetaTileEntity.getWorld().setBlock( + aBaseMetaTileEntity.getXCoord() + xDir + i, + aBaseMetaTileEntity.getYCoord() + h, + aBaseMetaTileEntity.getZCoord() + zDir + j, + fluidUsed); } } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialWireMill.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialWireMill.java index 044cdfc963..89bfff5367 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialWireMill.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialWireMill.java @@ -6,10 +6,21 @@ import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose import static gregtech.api.enums.GT_HatchElement.*; import static gregtech.api.util.GT_StructureUtility.buildHatchAdder; +import java.util.ArrayList; +import java.util.List; + +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.ChatComponentTranslation; +import net.minecraftforge.fluids.FluidStack; + import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable; import com.gtnewhorizon.structurelib.structure.IStructureDefinition; import com.gtnewhorizon.structurelib.structure.ISurvivalBuildEnvironment; import com.gtnewhorizon.structurelib.structure.StructureDefinition; + import gregtech.api.GregTech_API; import gregtech.api.enums.TAE; import gregtech.api.interfaces.IIconContainer; @@ -23,18 +34,9 @@ import gtPlusPlus.core.block.ModBlocks; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; -import java.util.ArrayList; -import java.util.List; -import net.minecraft.block.Block; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.ChatComponentTranslation; -import net.minecraftforge.fluids.FluidStack; -public class GregtechMetaTileEntity_IndustrialWireMill - extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_IndustrialWireMill> - implements ISurvivalConstructable { +public class GregtechMetaTileEntity_IndustrialWireMill extends + GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_IndustrialWireMill> implements ISurvivalConstructable { private int mCasing; private static IStructureDefinition<GregtechMetaTileEntity_IndustrialWireMill> STRUCTURE_DEFINITION = null; @@ -61,42 +63,32 @@ public class GregtechMetaTileEntity_IndustrialWireMill @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType(getMachineType()) - .addInfo("Controller Block for the Industrial Wire Factory") + tt.addMachineType(getMachineType()).addInfo("Controller Block for the Industrial Wire Factory") .addInfo("200% faster than using single block machines of the same voltage") - .addInfo("Only uses 75% of the EU/t normally required") - .addInfo("Processes four items per voltage tier") - .addPollutionAmount(getPollutionPerSecond(null)) - .addSeparator() - .beginStructureBlock(3, 3, 5, true) - .addController("Front Center") - .addCasingInfo("Wire Factory Casings", 20) - .addInputBus("Any Casing", 1) - .addOutputBus("Any Casing", 1) - .addEnergyHatch("Any Casing", 1) - .addMaintenanceHatch("Any Casing", 1) - .addMufflerHatch("Any Casing", 1) - .toolTipFinisher(CORE.GT_Tooltip_Builder); + .addInfo("Only uses 75% of the EU/t normally required").addInfo("Processes four items per voltage tier") + .addPollutionAmount(getPollutionPerSecond(null)).addSeparator().beginStructureBlock(3, 3, 5, true) + .addController("Front Center").addCasingInfo("Wire Factory Casings", 20).addInputBus("Any Casing", 1) + .addOutputBus("Any Casing", 1).addEnergyHatch("Any Casing", 1).addMaintenanceHatch("Any Casing", 1) + .addMufflerHatch("Any Casing", 1).toolTipFinisher(CORE.GT_Tooltip_Builder); return tt; } @Override public IStructureDefinition<GregtechMetaTileEntity_IndustrialWireMill> getStructureDefinition() { if (STRUCTURE_DEFINITION == null) { - STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_IndustrialWireMill>builder() - .addShape(mName, transpose(new String[][] { - {"CCC", "CCC", "CCC", "CCC", "CCC"}, - {"C~C", "C-C", "C-C", "C-C", "CCC"}, - {"CCC", "CCC", "CCC", "CCC", "CCC"}, - })) + STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_IndustrialWireMill>builder().addShape( + mName, + transpose( + new String[][] { { "CCC", "CCC", "CCC", "CCC", "CCC" }, + { "C~C", "C-C", "C-C", "C-C", "CCC" }, { "CCC", "CCC", "CCC", "CCC", "CCC" }, })) .addElement( 'C', buildHatchAdder(GregtechMetaTileEntity_IndustrialWireMill.class) .atLeast(InputBus, OutputBus, Maintenance, Energy, Muffler) - .casingIndex(getCasingTextureIndex()) - .dot(1) - .buildAndChain(onElementPass( - x -> ++x.mCasing, ofBlock(getCasingBlock(), getCasingMeta())))) + .casingIndex(getCasingTextureIndex()).dot(1).buildAndChain( + onElementPass( + x -> ++x.mCasing, + ofBlock(getCasingBlock(), getCasingMeta())))) .build(); } return STRUCTURE_DEFINITION; @@ -150,8 +142,8 @@ public class GregtechMetaTileEntity_IndustrialWireMill } @Override - public boolean checkRecipeGeneric( - int aMaxParallelRecipes, long aEUPercent, int aSpeedBonusPercent, int aOutputChanceRoll) { + public boolean checkRecipeGeneric(int aMaxParallelRecipes, long aEUPercent, int aSpeedBonusPercent, + int aOutputChanceRoll) { if (!isBussesSeparate) return super.checkRecipeGeneric(aMaxParallelRecipes, aEUPercent, aSpeedBonusPercent, aOutputChanceRoll); List<ItemStack> buffer = new ArrayList<>(16); @@ -163,7 +155,12 @@ public class GregtechMetaTileEntity_IndustrialWireMill } ItemStack[] tItemInputs = buffer.toArray(new ItemStack[0]); if (checkRecipeGeneric( - tItemInputs, tFluidInputs, aMaxParallelRecipes, aEUPercent, aSpeedBonusPercent, aOutputChanceRoll)) + tItemInputs, + tFluidInputs, + aMaxParallelRecipes, + aEUPercent, + aSpeedBonusPercent, + aOutputChanceRoll)) return true; buffer.clear(); } @@ -173,8 +170,10 @@ public class GregtechMetaTileEntity_IndustrialWireMill @Override public void onModeChangeByScrewdriver(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { isBussesSeparate = !isBussesSeparate; - aPlayer.addChatMessage(new ChatComponentTranslation( - isBussesSeparate ? "interaction.separateBusses.enabled" : "interaction.separateBusses.disabled")); + aPlayer.addChatMessage( + new ChatComponentTranslation( + isBussesSeparate ? "interaction.separateBusses.enabled" + : "interaction.separateBusses.disabled")); } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IronBlastFurnace.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IronBlastFurnace.java index 03c6f813fc..fc6dfb6482 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IronBlastFurnace.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IronBlastFurnace.java @@ -1,9 +1,17 @@ package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraftforge.common.util.ForgeDirection; + import com.gtnewhorizons.modularui.api.screen.ModularWindow; import com.gtnewhorizons.modularui.api.screen.UIBuildContext; import com.gtnewhorizons.modularui.common.widget.ProgressBar; import com.gtnewhorizons.modularui.common.widget.SlotWidget; + import gregtech.GT_Mod; import gregtech.api.GregTech_API; import gregtech.api.enums.Materials; @@ -22,19 +30,14 @@ import gtPlusPlus.core.block.ModBlocks; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.xmod.gregtech.api.gui.GTPP_UITextures; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.init.Items; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraftforge.common.util.ForgeDirection; public class GregtechMetaTileEntity_IronBlastFurnace extends MetaTileEntity implements IAddUIWidgets { - private static final ITexture[] FACING_SIDE = {new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Top)}; - private static final ITexture[] FACING_FRONT = {new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Redstone_Off) - }; - private static final ITexture[] FACING_ACTIVE = {new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Redstone_On) - }; + + private static final ITexture[] FACING_SIDE = { new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Top) }; + private static final ITexture[] FACING_FRONT = { + new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Redstone_Off) }; + private static final ITexture[] FACING_ACTIVE = { + new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Redstone_On) }; public int mMaxProgresstime = 0; public int mUpdate = 30; public int mProgresstime = 0; @@ -53,37 +56,22 @@ public class GregtechMetaTileEntity_IronBlastFurnace extends MetaTileEntity impl @Override public String[] getDescription() { if (CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK) { - return new String[] { - "Iron is a much better furnace material!", - "Can be Automated", - "Multiblock: 3x3x5 hollow with opening on top", - "Same shape as Bronze/Bricked blast furnace, except one ring of 8 taller.", - "40 Iron Plated Bricks required", - }; + return new String[] { "Iron is a much better furnace material!", "Can be Automated", + "Multiblock: 3x3x5 hollow with opening on top", + "Same shape as Bronze/Bricked blast furnace, except one ring of 8 taller.", + "40 Iron Plated Bricks required", }; } else { - return new String[] { - "Sloooowly, Skip the Bronze age, Get some Steel!", - "Multiblock: 3x3x5 hollow with opening on top", - "40 Iron Plated Bricks required", - "----", - "Even though Iron melts hotter than bronze,", - "this machine is to help players skip looking", - "for tin and copper, which are not as common", - "as Iron is. This machine takes 5x longer than the bronze", - "blast furnace as a result.", - "----", - }; + return new String[] { "Sloooowly, Skip the Bronze age, Get some Steel!", + "Multiblock: 3x3x5 hollow with opening on top", "40 Iron Plated Bricks required", "----", + "Even though Iron melts hotter than bronze,", "this machine is to help players skip looking", + "for tin and copper, which are not as common", + "as Iron is. This machine takes 5x longer than the bronze", "blast furnace as a result.", "----", }; } } @Override - public ITexture[] getTexture( - final IGregTechTileEntity aBaseMetaTileEntity, - final byte aSide, - final byte aFacing, - final byte aColorIndex, - final boolean aActive, - final boolean aRedstone) { + public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing, + final byte aColorIndex, final boolean aActive, final boolean aRedstone) { if (aSide == aFacing) { return aActive ? FACING_ACTIVE : FACING_FRONT; } @@ -199,26 +187,24 @@ public class GregtechMetaTileEntity_IronBlastFurnace extends MetaTileEntity impl } private boolean checkMachine() { - final int xDir = - ForgeDirection.getOrientation(this.getBaseMetaTileEntity().getBackFacing()).offsetX; - final int zDir = - ForgeDirection.getOrientation(this.getBaseMetaTileEntity().getBackFacing()).offsetZ; + final int xDir = ForgeDirection.getOrientation(this.getBaseMetaTileEntity().getBackFacing()).offsetX; + final int zDir = ForgeDirection.getOrientation(this.getBaseMetaTileEntity().getBackFacing()).offsetZ; for (int i = -1; i < 2; i++) { for (int j = -1; j < 4; j++) { // This is height for (int k = -1; k < 2; k++) { if (((xDir + i) != 0) || (j != 0) || ((zDir + k) != 0)) { if ((i != 0) || (j == -1) || (k != 0)) { if ((this.getBaseMetaTileEntity().getBlockOffset(xDir + i, j, zDir + k) - != ModBlocks.blockCasingsMisc) + != ModBlocks.blockCasingsMisc) || (this.getBaseMetaTileEntity().getMetaIDOffset(xDir + i, j, zDir + k) != 10)) { return false; } } else if ((!GT_Utility.arrayContains( - this.getBaseMetaTileEntity().getBlockOffset(xDir + i, j, zDir + k), - new Object[] {Blocks.lava, Blocks.flowing_lava, null})) + this.getBaseMetaTileEntity().getBlockOffset(xDir + i, j, zDir + k), + new Object[] { Blocks.lava, Blocks.flowing_lava, null })) && (!this.getBaseMetaTileEntity().getAirOffset(xDir + i, j, zDir + k))) { - return false; - } + return false; + } } } } @@ -234,16 +220,14 @@ public class GregtechMetaTileEntity_IronBlastFurnace extends MetaTileEntity impl @Override public void onPostTick(final IGregTechTileEntity aBaseMetaTileEntity, final long aTimer) { if ((aBaseMetaTileEntity.isClientSide()) && (aBaseMetaTileEntity.isActive())) { - aBaseMetaTileEntity - .getWorld() - .spawnParticle( - "cloud", - aBaseMetaTileEntity.getOffsetX(aBaseMetaTileEntity.getBackFacing(), 1) + Math.random(), - aBaseMetaTileEntity.getOffsetY(aBaseMetaTileEntity.getBackFacing(), 1), - aBaseMetaTileEntity.getOffsetZ(aBaseMetaTileEntity.getBackFacing(), 1) + Math.random(), - 0.0D, - 0.3D, - 0.0D); + aBaseMetaTileEntity.getWorld().spawnParticle( + "cloud", + aBaseMetaTileEntity.getOffsetX(aBaseMetaTileEntity.getBackFacing(), 1) + Math.random(), + aBaseMetaTileEntity.getOffsetY(aBaseMetaTileEntity.getBackFacing(), 1), + aBaseMetaTileEntity.getOffsetZ(aBaseMetaTileEntity.getBackFacing(), 1) + Math.random(), + 0.0D, + 0.3D, + 0.0D); } if (aBaseMetaTileEntity.isServerSide()) { if (this.mUpdate-- == 0) { @@ -259,12 +243,10 @@ public class GregtechMetaTileEntity_IronBlastFurnace extends MetaTileEntity impl this.mMaxProgresstime = 0; try { GT_Mod.instance.achievements.issueAchievement( - aBaseMetaTileEntity - .getWorld() + aBaseMetaTileEntity.getWorld() .getPlayerEntityByName(aBaseMetaTileEntity.getOwnerName()), "steel"); - } catch (final Exception e) { - } + } catch (final Exception e) {} } } else if (aBaseMetaTileEntity.isAllowedToWork()) { this.checkRecipe(); @@ -276,63 +258,53 @@ public class GregtechMetaTileEntity_IronBlastFurnace extends MetaTileEntity impl aBaseMetaTileEntity.getOffsetX(aBaseMetaTileEntity.getBackFacing(), 1), aBaseMetaTileEntity.getYCoord(), aBaseMetaTileEntity.getOffsetZ(aBaseMetaTileEntity.getBackFacing(), 1))) { - aBaseMetaTileEntity - .getWorld() - .setBlock( - aBaseMetaTileEntity.getOffsetX(aBaseMetaTileEntity.getBackFacing(), 1), - aBaseMetaTileEntity.getYCoord(), - aBaseMetaTileEntity.getOffsetZ(aBaseMetaTileEntity.getBackFacing(), 1), - Blocks.lava, - 1, - 2); + aBaseMetaTileEntity.getWorld().setBlock( + aBaseMetaTileEntity.getOffsetX(aBaseMetaTileEntity.getBackFacing(), 1), + aBaseMetaTileEntity.getYCoord(), + aBaseMetaTileEntity.getOffsetZ(aBaseMetaTileEntity.getBackFacing(), 1), + Blocks.lava, + 1, + 2); this.mUpdate = 1; } if (aBaseMetaTileEntity.getAir( aBaseMetaTileEntity.getOffsetX(aBaseMetaTileEntity.getBackFacing(), 1), aBaseMetaTileEntity.getYCoord() + 1, aBaseMetaTileEntity.getOffsetZ(aBaseMetaTileEntity.getBackFacing(), 1))) { - aBaseMetaTileEntity - .getWorld() - .setBlock( - aBaseMetaTileEntity.getOffsetX(aBaseMetaTileEntity.getBackFacing(), 1), - aBaseMetaTileEntity.getYCoord() + 1, - aBaseMetaTileEntity.getOffsetZ(aBaseMetaTileEntity.getBackFacing(), 1), - Blocks.lava, - 1, - 2); + aBaseMetaTileEntity.getWorld().setBlock( + aBaseMetaTileEntity.getOffsetX(aBaseMetaTileEntity.getBackFacing(), 1), + aBaseMetaTileEntity.getYCoord() + 1, + aBaseMetaTileEntity.getOffsetZ(aBaseMetaTileEntity.getBackFacing(), 1), + Blocks.lava, + 1, + 2); this.mUpdate = 1; } } else { if (aBaseMetaTileEntity.getBlock( - aBaseMetaTileEntity.getOffsetX(aBaseMetaTileEntity.getBackFacing(), 1), - aBaseMetaTileEntity.getYCoord(), - aBaseMetaTileEntity.getOffsetZ(aBaseMetaTileEntity.getBackFacing(), 1)) - == Blocks.lava) { - aBaseMetaTileEntity - .getWorld() - .setBlock( - aBaseMetaTileEntity.getOffsetX(aBaseMetaTileEntity.getBackFacing(), 1), - aBaseMetaTileEntity.getYCoord(), - aBaseMetaTileEntity.getOffsetZ(aBaseMetaTileEntity.getBackFacing(), 1), - Blocks.air, - 0, - 2); + aBaseMetaTileEntity.getOffsetX(aBaseMetaTileEntity.getBackFacing(), 1), + aBaseMetaTileEntity.getYCoord(), + aBaseMetaTileEntity.getOffsetZ(aBaseMetaTileEntity.getBackFacing(), 1)) == Blocks.lava) { + aBaseMetaTileEntity.getWorld().setBlock( + aBaseMetaTileEntity.getOffsetX(aBaseMetaTileEntity.getBackFacing(), 1), + aBaseMetaTileEntity.getYCoord(), + aBaseMetaTileEntity.getOffsetZ(aBaseMetaTileEntity.getBackFacing(), 1), + Blocks.air, + 0, + 2); this.mUpdate = 1; } if (aBaseMetaTileEntity.getBlock( - aBaseMetaTileEntity.getOffsetX(aBaseMetaTileEntity.getBackFacing(), 1), - aBaseMetaTileEntity.getYCoord() + 1, - aBaseMetaTileEntity.getOffsetZ(aBaseMetaTileEntity.getBackFacing(), 1)) - == Blocks.lava) { - aBaseMetaTileEntity - .getWorld() - .setBlock( - aBaseMetaTileEntity.getOffsetX(aBaseMetaTileEntity.getBackFacing(), 1), - aBaseMetaTileEntity.getYCoord() + 1, - aBaseMetaTileEntity.getOffsetZ(aBaseMetaTileEntity.getBackFacing(), 1), - Blocks.air, - 0, - 2); + aBaseMetaTileEntity.getOffsetX(aBaseMetaTileEntity.getBackFacing(), 1), + aBaseMetaTileEntity.getYCoord() + 1, + aBaseMetaTileEntity.getOffsetZ(aBaseMetaTileEntity.getBackFacing(), 1)) == Blocks.lava) { + aBaseMetaTileEntity.getWorld().setBlock( + aBaseMetaTileEntity.getOffsetX(aBaseMetaTileEntity.getBackFacing(), 1), + aBaseMetaTileEntity.getYCoord() + 1, + aBaseMetaTileEntity.getOffsetZ(aBaseMetaTileEntity.getBackFacing(), 1), + Blocks.air, + 0, + 2); this.mUpdate = 1; } } @@ -342,7 +314,7 @@ public class GregtechMetaTileEntity_IronBlastFurnace extends MetaTileEntity impl private void addOutputProducts() { if (this.mOutputItem1 != null) { if (this.mInventory[2] == null) { - this.mInventory[2] = GT_Utility.copy(new Object[] {this.mOutputItem1}); + this.mInventory[2] = GT_Utility.copy(new Object[] { this.mOutputItem1 }); } else if (GT_Utility.areStacksEqual(this.mInventory[2], this.mOutputItem1)) { this.mInventory[2].stackSize = Math.min( this.mOutputItem1.getMaxStackSize(), @@ -351,7 +323,7 @@ public class GregtechMetaTileEntity_IronBlastFurnace extends MetaTileEntity impl } if (this.mOutputItem2 != null) { if (this.mInventory[3] == null) { - this.mInventory[3] = GT_Utility.copy(new Object[] {this.mOutputItem2}); + this.mInventory[3] = GT_Utility.copy(new Object[] { this.mOutputItem2 }); } else if (GT_Utility.areStacksEqual(this.mInventory[3], this.mOutputItem2)) { this.mInventory[3].stackSize = Math.min( this.mOutputItem2.getMaxStackSize(), @@ -361,12 +333,10 @@ public class GregtechMetaTileEntity_IronBlastFurnace extends MetaTileEntity impl } private boolean spaceForOutput(final ItemStack aStack1, final ItemStack aStack2) { - if (((this.mInventory[2] == null) - || (aStack1 == null) - || (((this.mInventory[2].stackSize + aStack1.stackSize) <= this.mInventory[2].getMaxStackSize()) - && (GT_Utility.areStacksEqual(this.mInventory[2], aStack1)))) - && ((this.mInventory[3] == null) - || (aStack2 == null) + if (((this.mInventory[2] == null) || (aStack1 == null) + || (((this.mInventory[2].stackSize + aStack1.stackSize) <= this.mInventory[2].getMaxStackSize()) + && (GT_Utility.areStacksEqual(this.mInventory[2], aStack1)))) + && ((this.mInventory[3] == null) || (aStack2 == null) || (((this.mInventory[3].stackSize + aStack2.stackSize) <= this.mInventory[3].getMaxStackSize()) && (GT_Utility.areStacksEqual(this.mInventory[3], aStack2))))) { return true; @@ -390,12 +360,11 @@ public class GregtechMetaTileEntity_IronBlastFurnace extends MetaTileEntity impl if ((this.mInventory[0] != null) && (this.mInventory[1] != null) && (this.mInventory[0].stackSize >= 1)) { if ((GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[0], "dustIron")) || (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[0], "ingotIron"))) { - if ((this.mInventory[1].getItem() == Items.coal) - && (this.mInventory[1].stackSize >= 4) + if ((this.mInventory[1].getItem() == Items.coal) && (this.mInventory[1].stackSize >= 4) && (this.spaceForOutput( this.mOutputItem1 = GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Steel, 1L), - this.mOutputItem2 = - GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.DarkAsh, 4L)))) { + this.mOutputItem2 = GT_OreDictUnificator + .get(OrePrefixes.dustTiny, Materials.DarkAsh, 4L)))) { this.getBaseMetaTileEntity().decrStackSize(0, 1); this.getBaseMetaTileEntity().decrStackSize(1, 4 * 3); this.mMaxProgresstime = getProperTime(36000); @@ -405,8 +374,8 @@ public class GregtechMetaTileEntity_IronBlastFurnace extends MetaTileEntity impl && (this.mInventory[1].stackSize >= 2) && (this.spaceForOutput( this.mOutputItem1 = GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Steel, 1L), - this.mOutputItem2 = - GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.Ash, 4L)))) { + this.mOutputItem2 = GT_OreDictUnificator + .get(OrePrefixes.dustTiny, Materials.Ash, 4L)))) { this.getBaseMetaTileEntity().decrStackSize(0, 1); this.getBaseMetaTileEntity().decrStackSize(1, 2 * 3); this.mMaxProgresstime = getProperTime(4800); @@ -418,20 +387,19 @@ public class GregtechMetaTileEntity_IronBlastFurnace extends MetaTileEntity impl && (this.mInventory[1].stackSize >= 4) && (this.spaceForOutput( this.mOutputItem1 = GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Steel, 9L), - this.mOutputItem2 = - GT_OreDictUnificator.get(OrePrefixes.dust, Materials.DarkAsh, 4L)))) { + this.mOutputItem2 = GT_OreDictUnificator + .get(OrePrefixes.dust, Materials.DarkAsh, 4L)))) { this.getBaseMetaTileEntity().decrStackSize(0, 9); this.getBaseMetaTileEntity().decrStackSize(1, 4 * 3); this.mMaxProgresstime = getProperTime(64800); return true; } } else if (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[0], "dustSteel")) { - if ((this.mInventory[1].getItem() == Items.coal) - && (this.mInventory[1].stackSize >= 2) + if ((this.mInventory[1].getItem() == Items.coal) && (this.mInventory[1].stackSize >= 2) && (this.spaceForOutput( this.mOutputItem1 = GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Steel, 1L), - this.mOutputItem2 = - GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.DarkAsh, 2L)))) { + this.mOutputItem2 = GT_OreDictUnificator + .get(OrePrefixes.dustTiny, Materials.DarkAsh, 2L)))) { this.getBaseMetaTileEntity().decrStackSize(0, 1); this.getBaseMetaTileEntity().decrStackSize(1, 2 * 3); this.mMaxProgresstime = getProperTime(3600); @@ -441,8 +409,8 @@ public class GregtechMetaTileEntity_IronBlastFurnace extends MetaTileEntity impl && (this.mInventory[1].stackSize >= 1) && (this.spaceForOutput( this.mOutputItem1 = GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Steel, 1L), - this.mOutputItem2 = - GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.Ash, 2L)))) { + this.mOutputItem2 = GT_OreDictUnificator + .get(OrePrefixes.dustTiny, Materials.Ash, 2L)))) { this.getBaseMetaTileEntity().decrStackSize(0, 1); this.getBaseMetaTileEntity().decrStackSize(1, 1 * 3); this.mMaxProgresstime = getProperTime(2400); @@ -454,20 +422,19 @@ public class GregtechMetaTileEntity_IronBlastFurnace extends MetaTileEntity impl && (this.mInventory[1].stackSize >= 2) && (this.spaceForOutput( this.mOutputItem1 = GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Steel, 9L), - this.mOutputItem2 = - GT_OreDictUnificator.get(OrePrefixes.dust, Materials.DarkAsh, 2L)))) { + this.mOutputItem2 = GT_OreDictUnificator + .get(OrePrefixes.dust, Materials.DarkAsh, 2L)))) { this.getBaseMetaTileEntity().decrStackSize(0, 9); this.getBaseMetaTileEntity().decrStackSize(1, 2 * 3); this.mMaxProgresstime = getProperTime(32400); return true; } } else if (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[0], "blockIron")) { - if ((this.mInventory[1].getItem() == Items.coal) - && (this.mInventory[1].stackSize >= 36) + if ((this.mInventory[1].getItem() == Items.coal) && (this.mInventory[1].stackSize >= 36) && (this.spaceForOutput( this.mOutputItem1 = GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Steel, 9L), - this.mOutputItem2 = - GT_OreDictUnificator.get(OrePrefixes.dust, Materials.DarkAsh, 4L)))) { + this.mOutputItem2 = GT_OreDictUnificator + .get(OrePrefixes.dust, Materials.DarkAsh, 4L)))) { this.getBaseMetaTileEntity().decrStackSize(0, 1); this.getBaseMetaTileEntity().decrStackSize(1, 64); this.mMaxProgresstime = getProperTime(64800); @@ -484,12 +451,12 @@ public class GregtechMetaTileEntity_IronBlastFurnace extends MetaTileEntity impl return true; } if (((GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[1], "blockCoal")) - || (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[1], "blockCharcoal"))) + || (GT_OreDictUnificator.isItemStackInstanceOf(this.mInventory[1], "blockCharcoal"))) && (this.mInventory[1].stackSize >= 4) && (this.spaceForOutput( this.mOutputItem1 = GT_OreDictUnificator.get(OrePrefixes.ingot, Materials.Steel, 9L), - this.mOutputItem2 = - GT_OreDictUnificator.get(OrePrefixes.dust, Materials.DarkAsh, 4L)))) { + this.mOutputItem2 = GT_OreDictUnificator + .get(OrePrefixes.dust, Materials.DarkAsh, 4L)))) { this.getBaseMetaTileEntity().decrStackSize(0, 1); this.getBaseMetaTileEntity().decrStackSize(1, 4 * 3); this.mMaxProgresstime = getProperTime(64800); @@ -508,14 +475,14 @@ public class GregtechMetaTileEntity_IronBlastFurnace extends MetaTileEntity impl } @Override - public boolean allowPullStack( - final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, final ItemStack aStack) { + public boolean allowPullStack(final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, + final ItemStack aStack) { return aIndex > 1; } @Override - public boolean allowPutStack( - final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, final ItemStack aStack) { + public boolean allowPutStack(final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, + final ItemStack aStack) { if (aIndex < 2) {} return !GT_Utility.areStacksEqual(aStack, this.mInventory[0]); } @@ -532,24 +499,25 @@ public class GregtechMetaTileEntity_IronBlastFurnace extends MetaTileEntity impl @Override public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildContext) { - builder.widget(new SlotWidget(inventoryHandler, 0) + builder.widget( + new SlotWidget(inventoryHandler, 0) .setBackground(getGUITextureSet().getItemSlot(), GTPP_UITextures.OVERLAY_SLOT_INGOT) .setPos(33, 15)) - .widget(new SlotWidget(inventoryHandler, 1) - .setBackground(getGUITextureSet().getItemSlot(), GT_UITextures.OVERLAY_SLOT_FURNACE) - .setPos(33, 33)) - .widget(new SlotWidget(inventoryHandler, 2) - .setAccess(true, false) - .setBackground(getGUITextureSet().getItemSlot(), GTPP_UITextures.OVERLAY_SLOT_INGOT) - .setPos(85, 24)) - .widget(new SlotWidget(inventoryHandler, 3) - .setAccess(true, false) - .setBackground(getGUITextureSet().getItemSlot(), GT_UITextures.OVERLAY_SLOT_DUST) - .setPos(103, 24)) - .widget(new ProgressBar() - .setTexture(GTPP_UITextures.PROGRESSBAR_ARROW_2, 20) - .setProgress(() -> (float) mProgresstime / mMaxProgresstime) - .setPos(58, 24) - .setSize(20, 18)); + .widget( + new SlotWidget(inventoryHandler, 1) + .setBackground(getGUITextureSet().getItemSlot(), GT_UITextures.OVERLAY_SLOT_FURNACE) + .setPos(33, 33)) + .widget( + new SlotWidget(inventoryHandler, 2).setAccess(true, false) + .setBackground(getGUITextureSet().getItemSlot(), GTPP_UITextures.OVERLAY_SLOT_INGOT) + .setPos(85, 24)) + .widget( + new SlotWidget(inventoryHandler, 3).setAccess(true, false) + .setBackground(getGUITextureSet().getItemSlot(), GT_UITextures.OVERLAY_SLOT_DUST) + .setPos(103, 24)) + .widget( + new ProgressBar().setTexture(GTPP_UITextures.PROGRESSBAR_ARROW_2, 20) + .setProgress(() -> (float) mProgresstime / mMaxProgresstime).setPos(58, 24) + .setSize(20, 18)); } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IsaMill.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IsaMill.java index 21a8333b03..fae3ab5970 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IsaMill.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IsaMill.java @@ -7,10 +7,25 @@ import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose import static gregtech.api.enums.GT_HatchElement.*; import static gregtech.api.util.GT_StructureUtility.buildHatchAdder; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; + +import net.minecraft.block.Block; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.DamageSource; +import net.minecraft.world.World; +import net.minecraft.world.chunk.Chunk; +import net.minecraftforge.fluids.FluidStack; + import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable; import com.gtnewhorizon.structurelib.structure.IStructureDefinition; import com.gtnewhorizon.structurelib.structure.ISurvivalBuildEnvironment; import com.gtnewhorizon.structurelib.structure.StructureDefinition; + import gregtech.api.enums.TAE; import gregtech.api.interfaces.IIconContainer; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; @@ -32,18 +47,6 @@ import gtPlusPlus.core.util.minecraft.PlayerUtils; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.nbthandlers.GT_MetaTileEntity_Hatch_MillingBalls; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock.CustomIcon; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; -import net.minecraft.block.Block; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.DamageSource; -import net.minecraft.world.World; -import net.minecraft.world.chunk.Chunk; -import net.minecraftforge.fluids.FluidStack; public class GregtechMetaTileEntity_IsaMill extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_IsaMill> implements ISurvivalConstructable { @@ -55,8 +58,7 @@ public class GregtechMetaTileEntity_IsaMill extends GregtechMeta_MultiBlockBase< private static final IIconContainer frontFaceActive = new CustomIcon("iconsets/Grinder/GRINDER_ACTIVE5"); private static final IIconContainer frontFace = new CustomIcon("iconsets/Grinder/GRINDER5"); - private final ArrayList<GT_MetaTileEntity_Hatch_MillingBalls> mMillingBallBuses = - new ArrayList<GT_MetaTileEntity_Hatch_MillingBalls>(); + private final ArrayList<GT_MetaTileEntity_Hatch_MillingBalls> mMillingBallBuses = new ArrayList<GT_MetaTileEntity_Hatch_MillingBalls>(); private static final DamageSource mIsaMillDamageSource = new DamageSource("gtpp.grinder").setDamageBypassesArmor(); public GregtechMetaTileEntity_IsaMill(int aID, String aName, String aNameRegional) { @@ -70,36 +72,28 @@ public class GregtechMetaTileEntity_IsaMill extends GregtechMeta_MultiBlockBase< @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType(getMachineType()) - .addInfo("Controller Block for the Large Grinding Machine") - .addInfo("Grind ores.") - .addPollutionAmount(getPollutionPerSecond(null)) - .addSeparator() - .beginStructureBlock(3, 3, 7, false) - .addController("Front Center") + tt.addMachineType(getMachineType()).addInfo("Controller Block for the Large Grinding Machine") + .addInfo("Grind ores.").addPollutionAmount(getPollutionPerSecond(null)).addSeparator() + .beginStructureBlock(3, 3, 7, false).addController("Front Center") .addCasingInfo("IsaMill Exterior Casing", 40) .addOtherStructurePart("IsaMill Gearbox", "5x, Inner Blocks") .addOtherStructurePart("IsaMill Piping", "8x, ring around controller") .addStructureInfo("IsaMill Pipings must not be obstructed in front (only air blocks)") - .addOtherStructurePart("Milling Ball Hatch", "Any Casing") - .addInputBus("Any Casing", 1) - .addOutputBus("Any Casing", 1) - .addEnergyHatch("Any Casing", 1) - .addMaintenanceHatch("Any Casing", 1) - .addMufflerHatch("Any Casing", 1) - .toolTipFinisher(CORE.GT_Tooltip_Builder); + .addOtherStructurePart("Milling Ball Hatch", "Any Casing").addInputBus("Any Casing", 1) + .addOutputBus("Any Casing", 1).addEnergyHatch("Any Casing", 1).addMaintenanceHatch("Any Casing", 1) + .addMufflerHatch("Any Casing", 1).toolTipFinisher(CORE.GT_Tooltip_Builder); return tt; } @Override public IStructureDefinition<GregtechMetaTileEntity_IsaMill> getStructureDefinition() { if (STRUCTURE_DEFINITION == null) { - STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_IsaMill>builder() - .addShape(mName, transpose(new String[][] { - {"DDD", "CCC", "CCC", "CCC", "CCC", "CCC", "CCC"}, - {"D~D", "CGC", "CGC", "CGC", "CGC", "CGC", "CCC"}, - {"DDD", "CCC", "CCC", "CCC", "CCC", "CCC", "CCC"}, - })) + STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_IsaMill>builder().addShape( + mName, + transpose( + new String[][] { { "DDD", "CCC", "CCC", "CCC", "CCC", "CCC", "CCC" }, + { "D~D", "CGC", "CGC", "CGC", "CGC", "CGC", "CCC" }, + { "DDD", "CCC", "CCC", "CCC", "CCC", "CCC", "CCC" }, })) .addElement( 'C', ofChain( @@ -107,25 +101,18 @@ public class GregtechMetaTileEntity_IsaMill extends GregtechMeta_MultiBlockBase< .adder(GregtechMetaTileEntity_IsaMill::addMillingBallsHatch) .hatchClass(GT_MetaTileEntity_Hatch_MillingBalls.class) .shouldReject(t -> !t.mMillingBallBuses.isEmpty()) - .casingIndex(getCasingTextureIndex()) - .dot(1) - .build(), - buildHatchAdder(GregtechMetaTileEntity_IsaMill.class) - .atLeast( - InputBus, - OutputBus, - InputHatch, - OutputHatch, - Maintenance, - Energy, - Muffler) - .casingIndex(getCasingTextureIndex()) - .dot(1) - .build(), + .casingIndex(getCasingTextureIndex()).dot(1).build(), + buildHatchAdder(GregtechMetaTileEntity_IsaMill.class).atLeast( + InputBus, + OutputBus, + InputHatch, + OutputHatch, + Maintenance, + Energy, + Muffler).casingIndex(getCasingTextureIndex()).dot(1).build(), onElementPass(x -> ++x.mCasing, ofBlock(getCasingBlock(), getCasingMeta())))) .addElement('D', ofBlock(getIntakeBlock(), getIntakeMeta())) - .addElement('G', ofBlock(getGearboxBlock(), getGearboxMeta())) - .build(); + .addElement('G', ofBlock(getGearboxBlock(), getGearboxMeta())).build(); } return STRUCTURE_DEFINITION; } @@ -261,7 +248,9 @@ public class GregtechMetaTileEntity_IsaMill extends GregtechMeta_MultiBlockBase< } } else if (aFoundEntity.getHealth() > 0) { EntityUtils.doDamage( - aFoundEntity, mIsaMillDamageSource, Math.max(1, (int) (aFoundEntity.getMaxHealth() / 3))); + aFoundEntity, + mIsaMillDamageSource, + Math.max(1, (int) (aFoundEntity.getMaxHealth() / 3))); if ((aBaseMetaTileEntity.isClientSide()) && (aBaseMetaTileEntity.isActive())) { generateParticles(aFoundEntity); } @@ -269,6 +258,7 @@ public class GregtechMetaTileEntity_IsaMill extends GregtechMeta_MultiBlockBase< } } } + // 20 armor points add 80% damage reduction, more points add more damage reduction private int getPlayerDamageValue(EntityPlayer player, int damage) { int armorValue = player.getTotalArmorValue(); @@ -406,11 +396,8 @@ public class GregtechMetaTileEntity_IsaMill extends GregtechMeta_MultiBlockBase< @Override public String[] getExtraInfoData() { - return new String[] { - "IsaMill Grinding Machine", - "Current Efficiency: " + (mEfficiency / 100) + "%", - getIdealStatus() == getRepairStatus() ? "No Maintainance issues" : "Needs Maintainance" - }; + return new String[] { "IsaMill Grinding Machine", "Current Efficiency: " + (mEfficiency / 100) + "%", + getIdealStatus() == getRepairStatus() ? "No Maintainance issues" : "Needs Maintainance" }; } @Override @@ -434,7 +421,7 @@ public class GregtechMetaTileEntity_IsaMill extends GregtechMeta_MultiBlockBase< } /* - * Milling Ball Handling + * Milling Ball Handling */ @Override @@ -501,14 +488,8 @@ public class GregtechMetaTileEntity_IsaMill extends GregtechMeta_MultiBlockBase< } @Override - public boolean checkRecipeGeneric( - ItemStack[] aItemInputs, - FluidStack[] aFluidInputs, - int aMaxParallelRecipes, - long aEUPercent, - int aSpeedBonusPercent, - int aOutputChanceRoll, - GT_Recipe aRecipe) { + public boolean checkRecipeGeneric(ItemStack[] aItemInputs, FluidStack[] aFluidInputs, int aMaxParallelRecipes, + long aEUPercent, int aSpeedBonusPercent, int aOutputChanceRoll, GT_Recipe aRecipe) { // Based on the Processing Array. A bit overkill, but very flexible. diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_SpargeTower.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_SpargeTower.java index 1934a8e610..9136ac4aae 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_SpargeTower.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_SpargeTower.java @@ -5,11 +5,20 @@ import static gregtech.api.enums.GT_HatchElement.*; import static gregtech.api.util.GT_StructureUtility.buildHatchAdder; import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; +import java.util.ArrayList; +import java.util.List; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.fluids.FluidStack; + import com.gtnewhorizon.structurelib.alignment.IAlignmentLimits; import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable; import com.gtnewhorizon.structurelib.structure.IStructureDefinition; import com.gtnewhorizon.structurelib.structure.ISurvivalBuildEnvironment; import com.gtnewhorizon.structurelib.structure.StructureDefinition; + import gregtech.api.interfaces.IHatchElement; import gregtech.api.interfaces.IIconContainer; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; @@ -24,12 +33,6 @@ import gtPlusPlus.core.util.math.MathUtils; import gtPlusPlus.core.util.minecraft.PlayerUtils; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; -import java.util.ArrayList; -import java.util.List; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraftforge.common.util.ForgeDirection; -import net.minecraftforge.fluids.FluidStack; public class GregtechMetaTileEntity_SpargeTower extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_SpargeTower> implements ISurvivalConstructable { @@ -41,35 +44,28 @@ public class GregtechMetaTileEntity_SpargeTower extends GregtechMeta_MultiBlockB private static final IStructureDefinition<GregtechMetaTileEntity_SpargeTower> STRUCTURE_DEFINITION; static { - IHatchElement<GregtechMetaTileEntity_SpargeTower> layeredOutputHatch = OutputHatch.withCount( - GregtechMetaTileEntity_SpargeTower::getCurrentLayerOutputHatchCount) + IHatchElement<GregtechMetaTileEntity_SpargeTower> layeredOutputHatch = OutputHatch + .withCount(GregtechMetaTileEntity_SpargeTower::getCurrentLayerOutputHatchCount) .withAdder(GregtechMetaTileEntity_SpargeTower::addLayerOutputHatch); STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_SpargeTower>builder() - .addShape(STRUCTURE_PIECE_BASE, transpose(new String[][] { - {"b~b", "bbb", "bbb"}, - })) - .addShape(STRUCTURE_PIECE_LAYER, transpose(new String[][] {{"lll", "lcl", "lll"}})) - .addShape(STRUCTURE_PIECE_LAYER_HINT, transpose(new String[][] {{"lll", "l-l", "lll"}})) - .addShape(STRUCTURE_PIECE_TOP_HINT, transpose(new String[][] {{"lll", "lll", "lll"}})) + .addShape(STRUCTURE_PIECE_BASE, transpose(new String[][] { { "b~b", "bbb", "bbb" }, })) + .addShape(STRUCTURE_PIECE_LAYER, transpose(new String[][] { { "lll", "lcl", "lll" } })) + .addShape(STRUCTURE_PIECE_LAYER_HINT, transpose(new String[][] { { "lll", "l-l", "lll" } })) + .addShape(STRUCTURE_PIECE_TOP_HINT, transpose(new String[][] { { "lll", "lll", "lll" } })) .addElement( 'b', buildHatchAdder(GregtechMetaTileEntity_SpargeTower.class) - .atLeast(Energy, InputHatch, InputBus, Maintenance) - .disallowOnly(ForgeDirection.UP) - .casingIndex(getCasingIndex()) - .dot(1) - .buildAndChain(onElementPass( - GregtechMetaTileEntity_SpargeTower::onCasingFound, - ofBlock(ModBlocks.blockCasings5Misc, 4)))) + .atLeast(Energy, InputHatch, InputBus, Maintenance).disallowOnly(ForgeDirection.UP) + .casingIndex(getCasingIndex()).dot(1).buildAndChain( + onElementPass( + GregtechMetaTileEntity_SpargeTower::onCasingFound, + ofBlock(ModBlocks.blockCasings5Misc, 4)))) .addElement( 'l', ofChain( - buildHatchAdder(GregtechMetaTileEntity_SpargeTower.class) - .atLeast(layeredOutputHatch) + buildHatchAdder(GregtechMetaTileEntity_SpargeTower.class).atLeast(layeredOutputHatch) .disallowOnly(ForgeDirection.UP, ForgeDirection.DOWN) - .casingIndex(getCasingIndex()) - .dot(2) - .build(), + .casingIndex(getCasingIndex()).dot(2).build(), ofHatchAdder( GregtechMetaTileEntity_SpargeTower::addEnergyInputToMachineList, getCasingIndex(), @@ -126,16 +122,12 @@ public class GregtechMetaTileEntity_SpargeTower extends GregtechMeta_MultiBlockB @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType("Gas Sparge Tower") - .addInfo("Controller block for the Sparging Tower") + tt.addMachineType("Gas Sparge Tower").addInfo("Controller block for the Sparging Tower") .addInfo("Fluids are only put out at the correct height") - .addInfo("The correct height equals the slot number in the NEI recipe") - .addSeparator() - .beginStructureBlock(3, 8, 3, true) - .addController("Front bottom") + .addInfo("The correct height equals the slot number in the NEI recipe").addSeparator() + .beginStructureBlock(3, 8, 3, true).addController("Front bottom") .addOtherStructurePart("Sparge Tower Exterior Casing", "45 (minimum)") - .addEnergyHatch("Any casing", 1, 2) - .addMaintenanceHatch("Any casing", 1, 2, 3) + .addEnergyHatch("Any casing", 1, 2).addMaintenanceHatch("Any casing", 1, 2, 3) .addInputHatch("2x Input Hatches (Any bottom layer casing)", 1) .addOutputHatch("6x Output Hatches (At least one per layer except bottom layer)", 2, 3) .toolTipFinisher(CORE.GT_Tooltip_Builder); @@ -198,8 +190,11 @@ public class GregtechMetaTileEntity_SpargeTower extends GregtechMeta_MultiBlockB byte tTier = (byte) Math.max(0, GT_Utility.getTier(tVoltage)); FluidStack[] tFluids = tFluidList.toArray(new FluidStack[0]); if (tFluids.length > 0) { - Logger.INFO("Found " + tFluids.length + " input fluids. Searching " - + GTPP_Recipe_Map.sSpargeTowerRecipes.mRecipeList.size() + " recipes."); + Logger.INFO( + "Found " + tFluids.length + + " input fluids. Searching " + + GTPP_Recipe_Map.sSpargeTowerRecipes.mRecipeList.size() + + " recipes."); GT_Recipe tRecipe = getRecipeMap() .findRecipe(getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[tTier], tFluids); if (tRecipe != null) { @@ -221,8 +216,9 @@ public class GregtechMetaTileEntity_SpargeTower extends GregtechMeta_MultiBlockB int aDevProgress = this.mMaxProgresstime / 10; this.mMaxProgresstime = Math.max(1, aDevProgress); this.mOutputItems = new ItemStack[] {}; - ArrayList<FluidStack> aFluidOutputs = - getByproductsOfSparge(tRecipe.mFluidInputs[0], tRecipe.mFluidInputs[1]); + ArrayList<FluidStack> aFluidOutputs = getByproductsOfSparge( + tRecipe.mFluidInputs[0], + tRecipe.mFluidInputs[1]); this.mOutputFluids = (FluidStack[]) aFluidOutputs.toArray(new FluidStack[0]); updateSlots(); Logger.INFO("Done!"); @@ -238,8 +234,8 @@ public class GregtechMetaTileEntity_SpargeTower extends GregtechMeta_MultiBlockB return false; } - private static ArrayList<FluidStack> getByproductsOfSparge( - final FluidStack aSpargeGas, final FluidStack aSpentFuel) { + private static ArrayList<FluidStack> getByproductsOfSparge(final FluidStack aSpargeGas, + final FluidStack aSpentFuel) { GasSpargingRecipe aSpargeRecipe = GasSpargingRecipeMap.findRecipe(aSpargeGas, aSpentFuel); ArrayList<FluidStack> aOutputGases = new ArrayList<FluidStack>(); if (aSpargeRecipe == null) { @@ -283,14 +279,12 @@ public class GregtechMetaTileEntity_SpargeTower extends GregtechMeta_MultiBlockB } protected int getCurrentLayerOutputHatchCount() { - return mOutputHatchesByLayer.size() < mHeight || mHeight <= 0 - ? 0 + return mOutputHatchesByLayer.size() < mHeight || mHeight <= 0 ? 0 : mOutputHatchesByLayer.get(mHeight - 1).size(); } protected boolean addLayerOutputHatch(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { - if (aTileEntity == null - || aTileEntity.isDead() + if (aTileEntity == null || aTileEntity.isDead() || !(aTileEntity.getMetaTileEntity() instanceof GT_MetaTileEntity_Hatch_Output)) { Logger.INFO("Bad Output Hatch"); return false; @@ -402,12 +396,28 @@ public class GregtechMetaTileEntity_SpargeTower extends GregtechMeta_MultiBlockB for (int i = 1; i < tTotalHeight - 1; i++) { mHeight = i; built = survivialBuildPiece( - STRUCTURE_PIECE_LAYER_HINT, stackSize, 1, i, 0, elementBudget, env, false, true); + STRUCTURE_PIECE_LAYER_HINT, + stackSize, + 1, + i, + 0, + elementBudget, + env, + false, + true); if (built >= 0) return built; } mHeight = tTotalHeight - 1; return survivialBuildPiece( - STRUCTURE_PIECE_TOP_HINT, stackSize, 1, tTotalHeight - 1, 0, elementBudget, env, false, true); + STRUCTURE_PIECE_TOP_HINT, + stackSize, + 1, + tTotalHeight - 1, + 0, + elementBudget, + env, + false, + true); } @Override @@ -429,15 +439,22 @@ public class GregtechMetaTileEntity_SpargeTower extends GregtechMeta_MultiBlockB public boolean onPlungerRightClick(EntityPlayer aPlayer, byte aSide, float aX, float aY, float aZ) { int aLayerIndex = 0; PlayerUtils.messagePlayer( - aPlayer, "Trying to clear " + mOutputHatchesByLayer.size() + " layers of output hatches."); + aPlayer, + "Trying to clear " + mOutputHatchesByLayer.size() + " layers of output hatches."); for (List<GT_MetaTileEntity_Hatch_Output> layer : this.mOutputHatchesByLayer) { int aHatchIndex = 0; for (GT_MetaTileEntity_Hatch_Output hatch : layer) { if (hatch.mFluid != null) { PlayerUtils.messagePlayer( aPlayer, - "Clearing " + hatch.mFluid.amount + "L of " + hatch.mFluid.getLocalizedName() - + " from hatch " + aHatchIndex + " on layer " + aLayerIndex + "."); + "Clearing " + hatch.mFluid.amount + + "L of " + + hatch.mFluid.getLocalizedName() + + " from hatch " + + aHatchIndex + + " on layer " + + aLayerIndex + + "."); hatch.mFluid = null; } aHatchIndex++; diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_AssemblyLine.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_AssemblyLine.java index ff9c20b08d..0aa94b2bbe 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_AssemblyLine.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_AssemblyLine.java @@ -1,6 +1,16 @@ package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing.advanced; +import java.util.ArrayList; + +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.fluids.FluidStack; + import com.gtnewhorizon.structurelib.structure.IStructureDefinition; + import gregtech.api.GregTech_API; import gregtech.api.enums.GT_Values; import gregtech.api.enums.ItemList; @@ -19,19 +29,11 @@ import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.util.minecraft.LangUtils; import gtPlusPlus.core.util.minecraft.PlayerUtils; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase; -import java.util.ArrayList; -import net.minecraft.block.Block; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraftforge.common.util.ForgeDirection; -import net.minecraftforge.fluids.FluidStack; public class GregtechMetaTileEntity_Adv_AssemblyLine extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_Adv_AssemblyLine> { - public ArrayList<GT_MetaTileEntity_Hatch_DataAccess> mDataAccessHatches = - new ArrayList<GT_MetaTileEntity_Hatch_DataAccess>(); + public ArrayList<GT_MetaTileEntity_Hatch_DataAccess> mDataAccessHatches = new ArrayList<GT_MetaTileEntity_Hatch_DataAccess>(); public static String[] mCasingName = new String[5]; private final int CASING_TEXTURE_ID = TAE.getIndexFromPage(0, 13); @@ -59,26 +61,17 @@ public class GregtechMetaTileEntity_Adv_AssemblyLine return new GregtechMetaTileEntity_Adv_AssemblyLine(this.mName); } - /* public String[] getTooltip() { - if (mCasingName[0].toLowerCase().contains(".name")) { - mCasingName[0] = LangUtils.getLocalizedNameOfBlock(getCasing(4), 0); - } - if (mCasingName[1].toLowerCase().contains(".name")) { - mCasingName[1] = LangUtils.getLocalizedNameOfBlock(getCasing(4), 1); - } - if (mCasingName[2].toLowerCase().contains(".name")) { - mCasingName[2] = LangUtils.getLocalizedNameOfBlock(getCasing(4), 2); - } - if (mCasingName[3].toLowerCase().contains(".name")) { - mCasingName[3] = LangUtils.getLocalizedNameOfBlock(getCasing(3), 15); - } - if (mCasingName[4].toLowerCase().contains(".name")) { - mCasingName[4] = LangUtils.getLocalizedNameOfBlock(getCasing(1), 13); - } - return new String[]{ - "Advanced Integrated Assembly Line" - }; - }*/ + /* + * public String[] getTooltip() { if (mCasingName[0].toLowerCase().contains(".name")) { mCasingName[0] = + * LangUtils.getLocalizedNameOfBlock(getCasing(4), 0); } if (mCasingName[1].toLowerCase().contains(".name")) { + * mCasingName[1] = LangUtils.getLocalizedNameOfBlock(getCasing(4), 1); } if + * (mCasingName[2].toLowerCase().contains(".name")) { mCasingName[2] = + * LangUtils.getLocalizedNameOfBlock(getCasing(4), 2); } if (mCasingName[3].toLowerCase().contains(".name")) { + * mCasingName[3] = LangUtils.getLocalizedNameOfBlock(getCasing(3), 15); } if + * (mCasingName[4].toLowerCase().contains(".name")) { mCasingName[4] = + * LangUtils.getLocalizedNameOfBlock(getCasing(1), 13); } return new String[]{ "Advanced Integrated Assembly Line" + * }; } + */ @Override protected final GT_Multiblock_Tooltip_Builder createTooltip() { @@ -133,8 +126,7 @@ public class GregtechMetaTileEntity_Adv_AssemblyLine ItemStack tStack[] = new ItemStack[15]; FluidStack[] tFluids = new FluidStack[4]; boolean findRecipe = false; - nextDS: - for (ItemStack tDataStick : tDataStickList) { + nextDS: for (ItemStack tDataStick : tDataStickList) { NBTTagCompound tTag = tDataStick.getTagCompound(); if (tTag == null) continue; for (int i = 0; i < 15; i++) { @@ -144,8 +136,7 @@ public class GregtechMetaTileEntity_Adv_AssemblyLine continue nextDS; } - ItemStack stackInSlot = - mInputBusses.get(i).getBaseMetaTileEntity().getStackInSlot(0); + ItemStack stackInSlot = mInputBusses.get(i).getBaseMetaTileEntity().getStackInSlot(0); boolean flag = true; if (count > 0) { for (int j = 0; j < count; j++) { @@ -185,8 +176,7 @@ public class GregtechMetaTileEntity_Adv_AssemblyLine continue nextDS; } FluidStack fluidInHatch = mInputHatches.get(i).mFluid; - if (fluidInHatch == null - || !GT_Utility.areFluidsEqual(fluidInHatch, tFluids[i], true) + if (fluidInHatch == null || !GT_Utility.areFluidsEqual(fluidInHatch, tFluids[i], true) || fluidInHatch.amount < tFluids[i].amount) { if (GT_Values.D1) System.out.println(i + " not accepted"); continue nextDS; @@ -196,7 +186,7 @@ public class GregtechMetaTileEntity_Adv_AssemblyLine if (GT_Values.D1) System.out.println("Input accepted, check other values"); if (!tTag.hasKey("output")) continue; - mOutputItems = new ItemStack[] {GT_Utility.loadItem(tTag, "output")}; + mOutputItems = new ItemStack[] { GT_Utility.loadItem(tTag, "output") }; if (mOutputItems[0] == null || !GT_Utility.isStackValid(mOutputItems[0])) continue; if (!tTag.hasKey("time")) continue; @@ -274,10 +264,20 @@ public class GregtechMetaTileEntity_Adv_AssemblyLine // Layer 1 aShieldingCount += checkOuterRing(aBaseMetaTileEntity, getCasing(1), this.META_Shielding, -6, xDir, zDir); - aIntegralCasingCount += - checkIntegralRing(aBaseMetaTileEntity, getCasing(0), this.META_IntegralCasing, -6, xDir, zDir); + aIntegralCasingCount += checkIntegralRing( + aBaseMetaTileEntity, + getCasing(0), + this.META_IntegralCasing, + -6, + xDir, + zDir); aContainmentChamberCount += checkContainmentRing( - aBaseMetaTileEntity, getCasing(4), this.META_ContainmentChamberCasing, -6, xDir, zDir); + aBaseMetaTileEntity, + getCasing(4), + this.META_ContainmentChamberCasing, + -6, + xDir, + zDir); log("Layer 1 is Valid. Moving to Layer 2."); // Layer 2 @@ -286,14 +286,24 @@ public class GregtechMetaTileEntity_Adv_AssemblyLine log("Layer 2 is Valid. Moving to Layer 3."); // Layer 3 - aContainmentCasingCount += - checkOuterRing(aBaseMetaTileEntity, getCasing(3), this.META_ContainmentCasing, -4, xDir, zDir); + aContainmentCasingCount += checkOuterRing( + aBaseMetaTileEntity, + getCasing(3), + this.META_ContainmentCasing, + -4, + xDir, + zDir); aPipeCount += checkPipes(aBaseMetaTileEntity, getCasing(4), this.META_PipeCasing, -4, xDir, zDir); log("Layer 3 is Valid. Moving to Layer 4."); // Layer 4 - aContainmentCasingCount += - checkOuterRing(aBaseMetaTileEntity, getCasing(3), this.META_ContainmentCasing, -3, xDir, zDir); + aContainmentCasingCount += checkOuterRing( + aBaseMetaTileEntity, + getCasing(3), + this.META_ContainmentCasing, + -3, + xDir, + zDir); aPipeCount += checkPipes(aBaseMetaTileEntity, getCasing(4), this.META_PipeCasing, -3, xDir, zDir); log("Layer 4 is Valid. Moving to Layer 5."); @@ -304,10 +314,20 @@ public class GregtechMetaTileEntity_Adv_AssemblyLine // Layer 6 aShieldingCount += checkOuterRing(aBaseMetaTileEntity, getCasing(1), this.META_Shielding, -1, xDir, zDir); - aIntegralCasingCount += - checkIntegralRing(aBaseMetaTileEntity, getCasing(0), this.META_IntegralCasing, -1, xDir, zDir); + aIntegralCasingCount += checkIntegralRing( + aBaseMetaTileEntity, + getCasing(0), + this.META_IntegralCasing, + -1, + xDir, + zDir); aContainmentChamberCount += checkContainmentRing( - aBaseMetaTileEntity, getCasing(4), this.META_ContainmentChamberCasing, -1, xDir, zDir); + aBaseMetaTileEntity, + getCasing(4), + this.META_ContainmentChamberCasing, + -1, + xDir, + zDir); log("Layer 6 is Valid. Moving to Top Layer."); // Top Layer @@ -366,7 +386,8 @@ public class GregtechMetaTileEntity_Adv_AssemblyLine log("Not enough " + LangUtils.getLocalizedNameOfBlock(getCasing(0), 6) + "s, require 48."); if (aOwner != null) { PlayerUtils.messagePlayer( - aOwner, "Not enough " + LangUtils.getLocalizedNameOfBlock(getCasing(0), 6) + "s, require 48."); + aOwner, + "Not enough " + LangUtils.getLocalizedNameOfBlock(getCasing(0), 6) + "s, require 48."); } return false; } @@ -392,8 +413,8 @@ public class GregtechMetaTileEntity_Adv_AssemblyLine return false; } - public int checkEntireLayer( - IGregTechTileEntity aBaseMetaTileEntity, Block aBlock, int aMeta, int aY, int xDir, int zDir) { + public int checkEntireLayer(IGregTechTileEntity aBaseMetaTileEntity, Block aBlock, int aMeta, int aY, int xDir, + int zDir) { int aCasingCount = 0; for (int x = -4; x < 5; x++) { for (int z = -4; z < 5; z++) { @@ -414,10 +435,16 @@ public class GregtechMetaTileEntity_Adv_AssemblyLine if (aCurrentBlock == aBlock && aCurrentMeta == aMeta) { aCasingCount++; } - final IGregTechTileEntity tTileEntity = - aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, aY, zDir + z); + final IGregTechTileEntity tTileEntity = aBaseMetaTileEntity + .getIGregTechTileEntityOffset(xDir + x, aY, zDir + z); if (!isValidBlockForStructure( - tTileEntity, CASING_TEXTURE_ID, true, aCurrentBlock, aCurrentMeta, aBlock, aMeta)) { + tTileEntity, + CASING_TEXTURE_ID, + true, + aCurrentBlock, + aCurrentMeta, + aBlock, + aMeta)) { log("Layer has error. Height: " + aY); // this.getBaseMetaTileEntity().getWorld().setBlock(aOffsetX, aOffsetY, aOffsetZ, aBlock, aMeta, 3); return 0; @@ -427,8 +454,8 @@ public class GregtechMetaTileEntity_Adv_AssemblyLine return aCasingCount; } - public int checkOuterRing( - IGregTechTileEntity aBaseMetaTileEntity, Block aBlock, int aMeta, int aY, int xDir, int zDir) { + public int checkOuterRing(IGregTechTileEntity aBaseMetaTileEntity, Block aBlock, int aMeta, int aY, int xDir, + int zDir) { int aCasingCount = 0; for (int x = -4; x < 5; x++) { for (int z = -4; z < 5; z++) { @@ -455,10 +482,16 @@ public class GregtechMetaTileEntity_Adv_AssemblyLine if (aCurrentBlock == aBlock && aCurrentMeta == aMeta) { aCasingCount++; } - final IGregTechTileEntity tTileEntity = - aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, aY, zDir + z); + final IGregTechTileEntity tTileEntity = aBaseMetaTileEntity + .getIGregTechTileEntityOffset(xDir + x, aY, zDir + z); if (!isValidBlockForStructure( - tTileEntity, CASING_TEXTURE_ID, false, aCurrentBlock, aCurrentMeta, aBlock, aMeta)) { + tTileEntity, + CASING_TEXTURE_ID, + false, + aCurrentBlock, + aCurrentMeta, + aBlock, + aMeta)) { log("Layer has error. Height: " + aY); // this.getBaseMetaTileEntity().getWorld().setBlock(aOffsetX, aOffsetY, aOffsetZ, aBlock, aMeta, 3); return 0; @@ -468,8 +501,8 @@ public class GregtechMetaTileEntity_Adv_AssemblyLine return aCasingCount; } - public int checkIntegralRing( - IGregTechTileEntity aBaseMetaTileEntity, Block aBlock, int aMeta, int aY, int xDir, int zDir) { + public int checkIntegralRing(IGregTechTileEntity aBaseMetaTileEntity, Block aBlock, int aMeta, int aY, int xDir, + int zDir) { int aCasingCount = 0; for (int x = -3; x < 4; x++) { for (int z = -3; z < 4; z++) { @@ -496,10 +529,16 @@ public class GregtechMetaTileEntity_Adv_AssemblyLine if (aCurrentBlock == aBlock && aCurrentMeta == aMeta) { aCasingCount++; } - final IGregTechTileEntity tTileEntity = - aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, aY, zDir + z); + final IGregTechTileEntity tTileEntity = aBaseMetaTileEntity + .getIGregTechTileEntityOffset(xDir + x, aY, zDir + z); if (!isValidBlockForStructure( - tTileEntity, CASING_TEXTURE_ID, false, aCurrentBlock, aCurrentMeta, aBlock, aMeta)) { + tTileEntity, + CASING_TEXTURE_ID, + false, + aCurrentBlock, + aCurrentMeta, + aBlock, + aMeta)) { log("Layer has error. Height: " + aY); // this.getBaseMetaTileEntity().getWorld().setBlock(aOffsetX, aOffsetY, aOffsetZ, aBlock, aMeta, 3); return 0; @@ -509,8 +548,8 @@ public class GregtechMetaTileEntity_Adv_AssemblyLine return aCasingCount; } - public int checkPipes( - IGregTechTileEntity aBaseMetaTileEntity, Block aBlock, int aMeta, int aY, int xDir, int zDir) { + public int checkPipes(IGregTechTileEntity aBaseMetaTileEntity, Block aBlock, int aMeta, int aY, int xDir, + int zDir) { int aCasingCount = 0; for (int x = -1; x < 2; x++) { for (int z = -1; z < 2; z++) { @@ -518,8 +557,7 @@ public class GregtechMetaTileEntity_Adv_AssemblyLine int aOffsetY = this.getBaseMetaTileEntity().getYCoord() + aY; int aOffsetZ = this.getBaseMetaTileEntity().getZCoord() + z; // Skip the corners - if ((x == 1 && z == 1) - || (x == -1 && z == -1) + if ((x == 1 && z == 1) || (x == -1 && z == -1) || (x == 1 && z == -1) || (x == -1 && z == 1) || (x == 0 && z == 0)) { @@ -528,24 +566,29 @@ public class GregtechMetaTileEntity_Adv_AssemblyLine if (aCurrentBlock == aBlock && aCurrentMeta == aMeta) { aCasingCount++; } - final IGregTechTileEntity tTileEntity = - aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, aY, zDir + z); + final IGregTechTileEntity tTileEntity = aBaseMetaTileEntity + .getIGregTechTileEntityOffset(xDir + x, aY, zDir + z); if (!isValidBlockForStructure( - tTileEntity, CASING_TEXTURE_ID, false, aCurrentBlock, aCurrentMeta, aBlock, aMeta)) { + tTileEntity, + CASING_TEXTURE_ID, + false, + aCurrentBlock, + aCurrentMeta, + aBlock, + aMeta)) { log("Pipe has error. Height: " + aY); // this.getBaseMetaTileEntity().getWorld().setBlock(aOffsetX, aOffsetY, aOffsetZ, aBlock, aMeta, // 3); return 0; - } - ; + } ; } } } return aCasingCount; } - public int checkContainmentRing( - IGregTechTileEntity aBaseMetaTileEntity, Block aBlock, int aMeta, int aY, int xDir, int zDir) { + public int checkContainmentRing(IGregTechTileEntity aBaseMetaTileEntity, Block aBlock, int aMeta, int aY, int xDir, + int zDir) { int aCasingCount = 0; for (int x = -2; x < 3; x++) { for (int z = -2; z < 3; z++) { @@ -562,10 +605,16 @@ public class GregtechMetaTileEntity_Adv_AssemblyLine if (aCurrentBlock == aBlock && aCurrentMeta == aMeta) { aCasingCount++; } - final IGregTechTileEntity tTileEntity = - aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, aY, zDir + z); + final IGregTechTileEntity tTileEntity = aBaseMetaTileEntity + .getIGregTechTileEntityOffset(xDir + x, aY, zDir + z); if (!isValidBlockForStructure( - tTileEntity, CASING_TEXTURE_ID, false, aCurrentBlock, aCurrentMeta, aBlock, aMeta)) { + tTileEntity, + CASING_TEXTURE_ID, + false, + aCurrentBlock, + aCurrentMeta, + aBlock, + aMeta)) { log("Layer has error. Height: " + aY); // this.getBaseMetaTileEntity().getWorld().setBlock(aOffsetX, aOffsetY, aOffsetZ, aBlock, aMeta, 3); return 0; diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_DistillationTower.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_DistillationTower.java index 66a72aec86..11c9fa94ae 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_DistillationTower.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_DistillationTower.java @@ -5,11 +5,21 @@ import static gregtech.api.enums.GT_HatchElement.*; import static gregtech.api.util.GT_StructureUtility.buildHatchAdder; import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; +import java.util.ArrayList; +import java.util.List; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.fluids.FluidStack; + import com.gtnewhorizon.structurelib.alignment.IAlignmentLimits; import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable; import com.gtnewhorizon.structurelib.structure.IStructureDefinition; import com.gtnewhorizon.structurelib.structure.ISurvivalBuildEnvironment; import com.gtnewhorizon.structurelib.structure.StructureDefinition; + import gregtech.api.GregTech_API; import gregtech.api.enums.Textures; import gregtech.api.interfaces.IHatchElement; @@ -27,17 +37,9 @@ import gtPlusPlus.core.util.minecraft.ItemUtils; import gtPlusPlus.core.util.minecraft.PlayerUtils; import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase; -import java.util.ArrayList; -import java.util.List; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraftforge.common.util.ForgeDirection; -import net.minecraftforge.fluids.FluidStack; -public class GregtechMetaTileEntity_Adv_DistillationTower - extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_Adv_DistillationTower> - implements ISurvivalConstructable { +public class GregtechMetaTileEntity_Adv_DistillationTower extends + GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_Adv_DistillationTower> implements ISurvivalConstructable { private Mode mMode = Mode.DistillationTower; private boolean mUpgraded = false; @@ -69,30 +71,20 @@ public class GregtechMetaTileEntity_Adv_DistillationTower @Override public IStructureDefinition<GregtechMetaTileEntity_Adv_DistillationTower> getStructureDefinition() { if (STRUCTURE_DEFINITION == null) { - IHatchElement<GregtechMetaTileEntity_Adv_DistillationTower> layeredOutputHatch = OutputHatch.withCount( - GregtechMetaTileEntity_Adv_DistillationTower::getCurrentLayerOutputHatchCount) + IHatchElement<GregtechMetaTileEntity_Adv_DistillationTower> layeredOutputHatch = OutputHatch + .withCount(GregtechMetaTileEntity_Adv_DistillationTower::getCurrentLayerOutputHatchCount) .withAdder(GregtechMetaTileEntity_Adv_DistillationTower::addLayerOutputHatch); STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_Adv_DistillationTower>builder() - .addShape(STRUCTURE_PIECE_BASE, transpose(new String[][] { - {"b~b", "bbb", "bbb"}, - })) - .addShape(STRUCTURE_PIECE_LAYER, transpose(new String[][] { - {"lll", "lcl", "lll"}, - })) - .addShape(STRUCTURE_PIECE_LAYER_HINT, transpose(new String[][] { - {"lll", "l-l", "lll"}, - })) - .addShape(STRUCTURE_PIECE_TOP_HINT, transpose(new String[][] { - {"ttt", "ttt", "ttt"}, - })) + .addShape(STRUCTURE_PIECE_BASE, transpose(new String[][] { { "b~b", "bbb", "bbb" }, })) + .addShape(STRUCTURE_PIECE_LAYER, transpose(new String[][] { { "lll", "lcl", "lll" }, })) + .addShape(STRUCTURE_PIECE_LAYER_HINT, transpose(new String[][] { { "lll", "l-l", "lll" }, })) + .addShape(STRUCTURE_PIECE_TOP_HINT, transpose(new String[][] { { "ttt", "ttt", "ttt" }, })) .addElement( 'b', ofChain( buildHatchAdder(GregtechMetaTileEntity_Adv_DistillationTower.class) .atLeast(Energy, OutputBus, InputHatch, InputBus, Maintenance) - .disallowOnly(ForgeDirection.UP) - .casingIndex(getCasingTextureId()) - .dot(1) + .disallowOnly(ForgeDirection.UP).casingIndex(getCasingTextureId()).dot(1) .build(), ofBlock(GregTech_API.sBlockCasings4, 1))) .addElement( @@ -101,14 +93,11 @@ public class GregtechMetaTileEntity_Adv_DistillationTower buildHatchAdder(GregtechMetaTileEntity_Adv_DistillationTower.class) .atLeast(layeredOutputHatch, Energy, Maintenance) .disallowOnly(ForgeDirection.UP, ForgeDirection.DOWN) - .casingIndex(getCasingTextureId()) - .dot(2) - .build(), + .casingIndex(getCasingTextureId()).dot(2).build(), onElementPass( GregtechMetaTileEntity_Adv_DistillationTower::onTopLayerFound, ofHatchAdder( - GregtechMetaTileEntity_Adv_DistillationTower - ::addMufflerToMachineList, + GregtechMetaTileEntity_Adv_DistillationTower::addMufflerToMachineList, getCasingTextureId(), 3)), ofBlock(GregTech_API.sBlockCasings4, 1))) @@ -118,22 +107,19 @@ public class GregtechMetaTileEntity_Adv_DistillationTower onElementPass( GregtechMetaTileEntity_Adv_DistillationTower::onTopLayerFound, ofHatchAdder( - GregtechMetaTileEntity_Adv_DistillationTower - ::addMufflerToMachineList, + GregtechMetaTileEntity_Adv_DistillationTower::addMufflerToMachineList, getCasingTextureId(), 3)), onElementPass( GregtechMetaTileEntity_Adv_DistillationTower::onTopLayerFound, ofHatchAdder( - GregtechMetaTileEntity_Adv_DistillationTower - ::addOutputToMachineList, + GregtechMetaTileEntity_Adv_DistillationTower::addOutputToMachineList, getCasingTextureId(), 3)), onElementPass( GregtechMetaTileEntity_Adv_DistillationTower::onTopLayerFound, ofHatchAdder( - GregtechMetaTileEntity_Adv_DistillationTower - ::addMaintenanceToMachineList, + GregtechMetaTileEntity_Adv_DistillationTower::addMaintenanceToMachineList, getCasingTextureId(), 3)), onElementPass( @@ -143,10 +129,8 @@ public class GregtechMetaTileEntity_Adv_DistillationTower .addElement( 't', buildHatchAdder(GregtechMetaTileEntity_Adv_DistillationTower.class) - .atLeast(layeredOutputHatch, Muffler) - .disallowOnly(ForgeDirection.DOWN) - .casingIndex(getCasingTextureId()) - .dot(2) + .atLeast(layeredOutputHatch, Muffler).disallowOnly(ForgeDirection.DOWN) + .casingIndex(getCasingTextureId()).dot(2) .buildAndChain(GregTech_API.sBlockCasings4, 1)) .build(); } @@ -154,15 +138,14 @@ public class GregtechMetaTileEntity_Adv_DistillationTower } protected int getCurrentLayerOutputHatchCount() { - return mOutputHatchesByLayer.size() < mHeight || mHeight <= 0 - ? 0 + return mOutputHatchesByLayer.size() < mHeight || mHeight <= 0 ? 0 : mOutputHatchesByLayer.get(mHeight - 1).size(); } protected boolean addLayerOutputHatch(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { - if (aTileEntity == null - || aTileEntity.isDead() - || !(aTileEntity.getMetaTileEntity() instanceof GT_MetaTileEntity_Hatch_Output)) return false; + if (aTileEntity == null || aTileEntity.isDead() + || !(aTileEntity.getMetaTileEntity() instanceof GT_MetaTileEntity_Hatch_Output)) + return false; while (mOutputHatchesByLayer.size() < mHeight) mOutputHatchesByLayer.add(new ArrayList<>()); GT_MetaTileEntity_Hatch_Output tHatch = (GT_MetaTileEntity_Hatch_Output) aTileEntity.getMetaTileEntity(); tHatch.updateTexture(aBaseCasingIndex); @@ -176,25 +159,16 @@ public class GregtechMetaTileEntity_Adv_DistillationTower @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType(getMachineType()) - .addInfo("Controller Block for the Advanced Distillation Tower") - .addInfo("Use 85% less energy in distillery mode") - .addInfo("250%/100% faster in DT/distillery mode") + tt.addMachineType(getMachineType()).addInfo("Controller Block for the Advanced Distillation Tower") + .addInfo("Use 85% less energy in distillery mode").addInfo("250%/100% faster in DT/distillery mode") .addInfo("Right click the controller with screwdriver to change mode.") - .addInfo("Max parallel dictated by tower tier and mode") - .addInfo("DTower Mode: T1=4, T2=12") + .addInfo("Max parallel dictated by tower tier and mode").addInfo("DTower Mode: T1=4, T2=12") .addInfo("Distilery Mode: Tower Tier * (4*InputTier)") - .addInfo("Distilery Mode require a full height tower") - .addPollutionAmount(getPollutionPerSecond(null)) - .addSeparator() - .addCasingInfo("Clean Stainless Steel Machine Casing", 7) - .addInputBus("Bottom Casing", 1) - .addOutputBus("Bottom Casing", 1) - .addInputHatch("Bottom Casing", 1) - .addMaintenanceHatch("Bottom Casing", 1) - .addEnergyHatch("Bottom Casing", 1) - .addOutputHatch("One per layer except bottom", 2) - .addMufflerHatch("Top Casing", 3) + .addInfo("Distilery Mode require a full height tower").addPollutionAmount(getPollutionPerSecond(null)) + .addSeparator().addCasingInfo("Clean Stainless Steel Machine Casing", 7).addInputBus("Bottom Casing", 1) + .addOutputBus("Bottom Casing", 1).addInputHatch("Bottom Casing", 1) + .addMaintenanceHatch("Bottom Casing", 1).addEnergyHatch("Bottom Casing", 1) + .addOutputHatch("One per layer except bottom", 2).addMufflerHatch("Top Casing", 3) .toolTipFinisher(CORE.GT_Tooltip_Builder); return tt; } @@ -218,12 +192,28 @@ public class GregtechMetaTileEntity_Adv_DistillationTower for (int i = 1; i < tTotalHeight - 1; i++) { mHeight = i; built = survivialBuildPiece( - STRUCTURE_PIECE_LAYER_HINT, stackSize, 1, i, 0, elementBudget, env, false, true); + STRUCTURE_PIECE_LAYER_HINT, + stackSize, + 1, + i, + 0, + elementBudget, + env, + false, + true); if (built >= 0) return built; } mHeight = tTotalHeight - 1; return survivialBuildPiece( - STRUCTURE_PIECE_TOP_HINT, stackSize, 1, tTotalHeight - 1, 0, elementBudget, env, false, true); + STRUCTURE_PIECE_TOP_HINT, + stackSize, + 1, + tTotalHeight - 1, + 0, + elementBudget, + env, + false, + true); } @Override @@ -241,8 +231,7 @@ public class GregtechMetaTileEntity_Adv_DistillationTower if (!checkPiece(STRUCTURE_PIECE_LAYER, 1, mHeight, 0)) { return false; } - if (mOutputHatchesByLayer.size() < mHeight - || mOutputHatchesByLayer.get(mHeight - 1).isEmpty()) + if (mOutputHatchesByLayer.size() < mHeight || mOutputHatchesByLayer.get(mHeight - 1).isEmpty()) // layer without output hatch return false; if (mTopLayerFound || !mMufflerHatches.isEmpty()) { @@ -364,7 +353,12 @@ public class GregtechMetaTileEntity_Adv_DistillationTower FluidStack tFluid = hatch.getFluid(); if (tFluid != null) { if (checkRecipeGeneric( - inputs, new FluidStack[] {tFluid}, getMaxParallelRecipes(), 100, 250, 10000)) { + inputs, + new FluidStack[] { tFluid }, + getMaxParallelRecipes(), + 100, + 250, + 10000)) { return true; } } @@ -430,9 +424,10 @@ public class GregtechMetaTileEntity_Adv_DistillationTower } private enum Mode { + DistillationTower(GT_Recipe_Map.sDistillationRecipes), - Distillery(GT_Recipe_Map.sDistilleryRecipes), - ; + Distillery(GT_Recipe_Map.sDistilleryRecipes),; + static final Mode[] VALUES = values(); private final GT_Recipe_Map recipeMap; diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_EBF.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_EBF.java index 5d17b2a922..9a2c679b37 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_EBF.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_EBF.java @@ -8,10 +8,19 @@ import static gregtech.api.enums.GT_HatchElement.*; import static gregtech.api.util.GT_StructureUtility.buildHatchAdder; import static gregtech.api.util.GT_StructureUtility.ofCoil; +import java.util.ArrayList; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.ChatComponentTranslation; +import net.minecraftforge.fluids.FluidStack; + import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable; import com.gtnewhorizon.structurelib.structure.IStructureDefinition; import com.gtnewhorizon.structurelib.structure.ISurvivalBuildEnvironment; import com.gtnewhorizon.structurelib.structure.StructureDefinition; + import gregtech.api.enums.HeatingCoilLevel; import gregtech.api.enums.TAE; import gregtech.api.interfaces.IIconContainer; @@ -28,12 +37,6 @@ import gtPlusPlus.core.lib.CORE; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GT_MetaTileEntity_Hatch_CustomFluidBase; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; -import java.util.ArrayList; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.ChatComponentTranslation; -import net.minecraftforge.fluids.FluidStack; public class GregtechMetaTileEntity_Adv_EBF extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_Adv_EBF> implements ISurvivalConstructable { @@ -71,23 +74,14 @@ public class GregtechMetaTileEntity_Adv_EBF extends GregtechMeta_MultiBlockBase< @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType(getMachineType()) - .addInfo("Factory Grade Advanced Blast Furnace") + tt.addMachineType(getMachineType()).addInfo("Factory Grade Advanced Blast Furnace") .addInfo("Speed: +120% | EU Usage: 90% | Parallel: 8") .addInfo("Consumes 10L of " + mHotFuelName + " per second during operation") - .addInfo("Constructed exactly the same as a normal EBF") - .addPollutionAmount(getPollutionPerSecond(null)) - .addSeparator() - .addController("Bottom center") - .addCasingInfo(mCasingName, 8) - .addInputHatch("Any Casing", 1) - .addInputBus("Any Casing", 1) - .addOutputBus("Any Casing", 1) - .addOutputHatch("Any Casing", 1) - .addStructureHint(mHatchName, 1) - .addEnergyHatch("Any Casing", 1) - .addMufflerHatch("Any Casing", 1) - .addMaintenanceHatch("Any Casing", 1) + .addInfo("Constructed exactly the same as a normal EBF").addPollutionAmount(getPollutionPerSecond(null)) + .addSeparator().addController("Bottom center").addCasingInfo(mCasingName, 8) + .addInputHatch("Any Casing", 1).addInputBus("Any Casing", 1).addOutputBus("Any Casing", 1) + .addOutputHatch("Any Casing", 1).addStructureHint(mHatchName, 1).addEnergyHatch("Any Casing", 1) + .addMufflerHatch("Any Casing", 1).addMaintenanceHatch("Any Casing", 1) .toolTipFinisher(CORE.GT_Tooltip_Builder); return tt; } @@ -95,34 +89,25 @@ public class GregtechMetaTileEntity_Adv_EBF extends GregtechMeta_MultiBlockBase< @Override public IStructureDefinition<GregtechMetaTileEntity_Adv_EBF> getStructureDefinition() { if (STRUCTURE_DEFINITION == null) { - STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_Adv_EBF>builder() - .addShape(mName, transpose(new String[][] { - {"CCC", "CCC", "CCC"}, - {"HHH", "H-H", "HHH"}, - {"HHH", "H-H", "HHH"}, - {"C~C", "CCC", "CCC"}, - })) + STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_Adv_EBF>builder().addShape( + mName, + transpose( + new String[][] { { "CCC", "CCC", "CCC" }, { "HHH", "H-H", "HHH" }, { "HHH", "H-H", "HHH" }, + { "C~C", "CCC", "CCC" }, })) .addElement( 'C', ofChain( buildHatchAdder(GregtechMetaTileEntity_Adv_EBF.class) - .adder(GregtechMetaTileEntity_Adv_EBF::addPyrotheumHatch) - .hatchId(968) - .casingIndex(CASING_TEXTURE_ID) - .dot(1) - .build(), - buildHatchAdder(GregtechMetaTileEntity_Adv_EBF.class) - .atLeast( - InputBus, - OutputBus, - Maintenance, - Energy, - Muffler, - InputHatch, - OutputHatch) - .casingIndex(CASING_TEXTURE_ID) - .dot(1) - .build(), + .adder(GregtechMetaTileEntity_Adv_EBF::addPyrotheumHatch).hatchId(968) + .casingIndex(CASING_TEXTURE_ID).dot(1).build(), + buildHatchAdder(GregtechMetaTileEntity_Adv_EBF.class).atLeast( + InputBus, + OutputBus, + Maintenance, + Energy, + Muffler, + InputHatch, + OutputHatch).casingIndex(CASING_TEXTURE_ID).dot(1).build(), onElementPass(x -> ++x.mCasing, ofBlock(ModBlocks.blockCasings3Misc, 11)))) .addElement( 'H', @@ -260,13 +245,8 @@ public class GregtechMetaTileEntity_Adv_EBF extends GregtechMeta_MultiBlockBase< } @Override - public boolean checkRecipeGeneric( - ItemStack[] aItemInputs, - FluidStack[] aFluidInputs, - int aMaxParallelRecipes, - long aEUPercent, - int aSpeedBonusPercent, - int aOutputChanceRoll) { + public boolean checkRecipeGeneric(ItemStack[] aItemInputs, FluidStack[] aFluidInputs, int aMaxParallelRecipes, + long aEUPercent, int aSpeedBonusPercent, int aOutputChanceRoll) { // Based on the Processing Array. A bit overkill, but very flexible. // Reset outputs and progress stats @@ -279,14 +259,13 @@ public class GregtechMetaTileEntity_Adv_EBF extends GregtechMeta_MultiBlockBase< byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage)); long tEnergy = getMaxInputEnergy(); - GT_Recipe tRecipe = this.getRecipeMap() - .findRecipe( - getBaseMetaTileEntity(), - mLastRecipe, - false, - gregtech.api.enums.GT_Values.V[tTier], - aFluidInputs, - aItemInputs); + GT_Recipe tRecipe = this.getRecipeMap().findRecipe( + getBaseMetaTileEntity(), + mLastRecipe, + false, + gregtech.api.enums.GT_Values.V[tTier], + aFluidInputs, + aItemInputs); // Remember last recipe - an optimization for findRecipe() this.mLastRecipe = tRecipe; @@ -294,14 +273,9 @@ public class GregtechMetaTileEntity_Adv_EBF extends GregtechMeta_MultiBlockBase< return false; } - GT_ParallelHelper helper = new GT_ParallelHelper() - .setRecipe(tRecipe) - .setItemInputs(aItemInputs) - .setFluidInputs(aFluidInputs) - .setAvailableEUt(tEnergy) - .setMaxParallel(aMaxParallelRecipes) - .enableConsumption() - .enableOutputCalculation(); + GT_ParallelHelper helper = new GT_ParallelHelper().setRecipe(tRecipe).setItemInputs(aItemInputs) + .setFluidInputs(aFluidInputs).setAvailableEUt(tEnergy).setMaxParallel(aMaxParallelRecipes) + .enableConsumption().enableOutputCalculation(); if (!mVoidExcess) { helper.enableVoidProtection(this); } @@ -319,17 +293,11 @@ public class GregtechMetaTileEntity_Adv_EBF extends GregtechMeta_MultiBlockBase< this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000); this.mEfficiencyIncrease = 10000; - GT_OverclockCalculator calculator = new GT_OverclockCalculator() - .setRecipeEUt(tRecipe.mEUt) - .setEUt(tEnergy) - .setDuration(tRecipe.mDuration) - .setEUtDiscount(aEUPercent / 100.0f) + GT_OverclockCalculator calculator = new GT_OverclockCalculator().setRecipeEUt(tRecipe.mEUt).setEUt(tEnergy) + .setDuration(tRecipe.mDuration).setEUtDiscount(aEUPercent / 100.0f) .setSpeedBoost(100.0f / (100.0f + aSpeedBonusPercent)) - .setParallel(Math.min(aMaxParallelRecipes, helper.getCurrentParallel())) - .enableHeatOC() - .enableHeatDiscount() - .setRecipeHeat(tRecipe.mSpecialValue) - .setMultiHeat((int) getCoilLevel().getHeat()) + .setParallel(Math.min(aMaxParallelRecipes, helper.getCurrentParallel())).enableHeatOC() + .enableHeatDiscount().setRecipeHeat(tRecipe.mSpecialValue).setMultiHeat((int) getCoilLevel().getHeat()) .calculate(); lEUt = -calculator.getConsumption(); mMaxProgresstime = (int) Math.ceil(calculator.getDuration() * helper.getDurationMultiplier()); @@ -378,8 +346,10 @@ public class GregtechMetaTileEntity_Adv_EBF extends GregtechMeta_MultiBlockBase< @Override public void onModeChangeByScrewdriver(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { isBussesSeparate = !isBussesSeparate; - aPlayer.addChatMessage(new ChatComponentTranslation( - isBussesSeparate ? "interaction.separateBusses.enabled" : "interaction.separateBusses.disabled")); + aPlayer.addChatMessage( + new ChatComponentTranslation( + isBussesSeparate ? "interaction.separateBusses.enabled" + : "interaction.separateBusses.disabled")); } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_Fusion_MK4.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_Fusion_MK4.java index 8df07d8990..da6b43f82a 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_Fusion_MK4.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_Fusion_MK4.java @@ -1,5 +1,9 @@ package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing.advanced; +import java.lang.reflect.Method; + +import net.minecraft.block.Block; + import gregtech.api.enums.Dyes; import gregtech.api.enums.TAE; import gregtech.api.enums.Textures; @@ -19,8 +23,6 @@ import gtPlusPlus.core.block.ModBlocks; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.util.reflect.ReflectionUtils; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; -import java.lang.reflect.Method; -import net.minecraft.block.Block; public class GregtechMetaTileEntity_Adv_Fusion_MK4 extends GT_MetaTileEntity_FusionComputer { @@ -41,18 +43,12 @@ public class GregtechMetaTileEntity_Adv_Fusion_MK4 extends GT_MetaTileEntity_Fus @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType("Fusion Reactor") - .addInfo("HARNESSING THE POWER OF A NEUTRON STAR") - .addSeparator() - .beginStructureBlock(15, 3, 15, false) - .addController("See diagram when placed") - .addCasingInfo("Fusion Machine Casings MK III", 79) - .addStructureInfo("Cover the coils with casing") + tt.addMachineType("Fusion Reactor").addInfo("HARNESSING THE POWER OF A NEUTRON STAR").addSeparator() + .beginStructureBlock(15, 3, 15, false).addController("See diagram when placed") + .addCasingInfo("Fusion Machine Casings MK III", 79).addStructureInfo("Cover the coils with casing") .addOtherStructurePart("Advanced Fusion Coils", "Center part of the ring") - .addEnergyHatch("1-16, Specified casings", 2) - .addInputHatch("2-16, Specified casings", 1) - .addOutputHatch("1-16, Specified casings", 3) - .addStructureInfo("ALL Hatches must be UHV or better") + .addEnergyHatch("1-16, Specified casings", 2).addInputHatch("2-16, Specified casings", 1) + .addOutputHatch("1-16, Specified casings", 3).addStructureInfo("ALL Hatches must be UHV or better") .toolTipFinisher(CORE.GT_Tooltip_Builder); return tt; } @@ -103,46 +99,34 @@ public class GregtechMetaTileEntity_Adv_Fusion_MK4 extends GT_MetaTileEntity_Fus } @Override - public ITexture[] getTexture( - final IGregTechTileEntity aBaseMetaTileEntity, - final byte aSide, - final byte aFacing, - final byte aColorIndex, - final boolean aActive, - final boolean aRedstone) { + public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing, + final byte aColorIndex, final boolean aActive, final boolean aRedstone) { if (aSide == aFacing) { return new ITexture[] { - new GT_RenderedTexture( - Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS, Dyes.getModulation(-1, Dyes._NULL.mRGBa)), - TextureFactory.builder() - .addIcon(this.getIconOverlay()) - .extFacing() - .build() - }; + new GT_RenderedTexture( + Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS, + Dyes.getModulation(-1, Dyes._NULL.mRGBa)), + TextureFactory.builder().addIcon(this.getIconOverlay()).extFacing().build() }; } else if (!aActive) { - return new ITexture[] { - new GT_RenderedTexture( - Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS, Dyes.getModulation(-1, Dyes._NULL.mRGBa)) - }; + return new ITexture[] { new GT_RenderedTexture( + Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS, + Dyes.getModulation(-1, Dyes._NULL.mRGBa)) }; } else { - return new ITexture[] { - new GT_RenderedTexture( - TexturesGtBlock.TEXTURE_CASING_FUSION_CASING_ULTRA, Dyes.getModulation(-1, Dyes._NULL.mRGBa)) - }; + return new ITexture[] { new GT_RenderedTexture( + TexturesGtBlock.TEXTURE_CASING_FUSION_CASING_ULTRA, + Dyes.getModulation(-1, Dyes._NULL.mRGBa)) }; } } @Override public ITexture getTextureOverlay() { return new GT_RenderedTexture( - this.mMaxProgresstime > 0 - ? TexturesGtBlock.Casing_Machine_Screen_3 + this.mMaxProgresstime > 0 ? TexturesGtBlock.Casing_Machine_Screen_3 : TexturesGtBlock.Casing_Machine_Screen_1); } public IIconContainer getIconOverlay() { - return this.mMaxProgresstime > 0 - ? TexturesGtBlock.Casing_Machine_Screen_3 + return this.mMaxProgresstime > 0 ? TexturesGtBlock.Casing_Machine_Screen_3 : TexturesGtBlock.Casing_Machine_Screen_1; } @@ -181,11 +165,7 @@ public class GregtechMetaTileEntity_Adv_Fusion_MK4 extends GT_MetaTileEntity_Fus } } - return new String[] { - "Fusion Reactor MK " + tier, - "EU Required: " + powerRequired + "EU/t", - "Stored EU: " + mEUStore + " / " + maxEUStore(), - "Plasma Output: " + plasmaOut + "L/t" - }; + return new String[] { "Fusion Reactor MK " + tier, "EU Required: " + powerRequired + "EU/t", + "Stored EU: " + mEUStore + " / " + maxEUStore(), "Plasma Output: " + plasmaOut + "L/t" }; } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_HeatExchanger.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_HeatExchanger.java index 00cd8e9c1f..31742df05f 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_HeatExchanger.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_HeatExchanger.java @@ -3,9 +3,18 @@ package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing.a import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; +import net.minecraft.block.Block; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.StatCollector; +import net.minecraftforge.fluids.FluidRegistry; +import net.minecraftforge.fluids.FluidStack; + import com.gtnewhorizon.structurelib.alignment.IAlignmentLimits; import com.gtnewhorizon.structurelib.structure.IStructureDefinition; import com.gtnewhorizon.structurelib.structure.StructureDefinition; + import gregtech.api.GregTech_API; import gregtech.api.enums.TAE; import gregtech.api.interfaces.IIconContainer; @@ -20,13 +29,6 @@ import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.material.ALLOY; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; -import net.minecraft.block.Block; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.StatCollector; -import net.minecraftforge.fluids.FluidRegistry; -import net.minecraftforge.fluids.FluidStack; public class GregtechMetaTileEntity_Adv_HeatExchanger extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_Adv_HeatExchanger> { @@ -34,65 +36,66 @@ public class GregtechMetaTileEntity_Adv_HeatExchanger private static final int CASING_INDEX = TAE.getIndexFromPage(1, 12); private static final String STRUCTURE_PIECE_MAIN = "main"; - private static final IStructureDefinition<GregtechMetaTileEntity_Adv_HeatExchanger> STRUCTURE_DEFINITION = - StructureDefinition.<GregtechMetaTileEntity_Adv_HeatExchanger>builder() - .addShape(STRUCTURE_PIECE_MAIN, transpose(new String[][] { - {" ccc ", "cCCCc", "cCCCc", "cCCCc", " ccc "}, - {" ccc ", "cPPPc", "cPPPc", "cPPPc", " ccc "}, - {" ccc ", "cPPPc", "cPPPc", "cPPPc", " ccc "}, - {" ccc ", "cPPPc", "cPPPc", "cPPPc", " ccc "}, - {" ccc ", "cPPPc", "cPPPc", "cPPPc", " ccc "}, - {" c~c ", "cPPPc", "cPPPc", "cPPPc", " ccc "}, - {" hhh ", "hHHHh", "hHHHh", "hHHHh", " hhh "}, - {" f f ", "f f", " ", "f f", " f f "}, - {" f f ", "f f", " ", "f f", " f f "}, - })) - .addElement('P', ofBlock(GregTech_API.sBlockCasings2, 15)) - .addElement('f', ofBlock(getFrame(), 0)) - .addElement( - 'C', - ofChain( - ofHatchAdder( - GregtechMetaTileEntity_Adv_HeatExchanger::addColdFluidOutputToMachineList, - CASING_INDEX, - 2), - onElementPass( - GregtechMetaTileEntity_Adv_HeatExchanger::onCasingAdded, - ofBlock(ModBlocks.blockSpecialMultiCasings, 14)))) - .addElement( - 'H', - ofChain( - ofHatchAdder( - GregtechMetaTileEntity_Adv_HeatExchanger::addHotFluidInputToMachineList, - CASING_INDEX, - 3), - onElementPass( - GregtechMetaTileEntity_Adv_HeatExchanger::onCasingAdded, - ofBlock(ModBlocks.blockSpecialMultiCasings, 14)))) - .addElement( - 'h', - ofChain( - ofHatchAdder( - GregtechMetaTileEntity_Adv_HeatExchanger::addInputToMachineList, - CASING_INDEX, - 1), - ofHatchAdder( - GregtechMetaTileEntity_Adv_HeatExchanger::addOutputToMachineList, - CASING_INDEX, - 1), - ofHatchAdder( - GregtechMetaTileEntity_Adv_HeatExchanger::addMaintenanceToMachineList, - CASING_INDEX, - 1), - onElementPass( - GregtechMetaTileEntity_Adv_HeatExchanger::onCasingAdded, - ofBlock(ModBlocks.blockSpecialMultiCasings, 14)))) - .addElement( - 'c', - ofChain(onElementPass( + private static final IStructureDefinition<GregtechMetaTileEntity_Adv_HeatExchanger> STRUCTURE_DEFINITION = StructureDefinition + .<GregtechMetaTileEntity_Adv_HeatExchanger>builder() + .addShape( + STRUCTURE_PIECE_MAIN, + transpose( + new String[][] { { " ccc ", "cCCCc", "cCCCc", "cCCCc", " ccc " }, + { " ccc ", "cPPPc", "cPPPc", "cPPPc", " ccc " }, + { " ccc ", "cPPPc", "cPPPc", "cPPPc", " ccc " }, + { " ccc ", "cPPPc", "cPPPc", "cPPPc", " ccc " }, + { " ccc ", "cPPPc", "cPPPc", "cPPPc", " ccc " }, + { " c~c ", "cPPPc", "cPPPc", "cPPPc", " ccc " }, + { " hhh ", "hHHHh", "hHHHh", "hHHHh", " hhh " }, + { " f f ", "f f", " ", "f f", " f f " }, + { " f f ", "f f", " ", "f f", " f f " }, })) + .addElement('P', ofBlock(GregTech_API.sBlockCasings2, 15)).addElement('f', ofBlock(getFrame(), 0)) + .addElement( + 'C', + ofChain( + ofHatchAdder( + GregtechMetaTileEntity_Adv_HeatExchanger::addColdFluidOutputToMachineList, + CASING_INDEX, + 2), + onElementPass( + GregtechMetaTileEntity_Adv_HeatExchanger::onCasingAdded, + ofBlock(ModBlocks.blockSpecialMultiCasings, 14)))) + .addElement( + 'H', + ofChain( + ofHatchAdder( + GregtechMetaTileEntity_Adv_HeatExchanger::addHotFluidInputToMachineList, + CASING_INDEX, + 3), + onElementPass( + GregtechMetaTileEntity_Adv_HeatExchanger::onCasingAdded, + ofBlock(ModBlocks.blockSpecialMultiCasings, 14)))) + .addElement( + 'h', + ofChain( + ofHatchAdder( + GregtechMetaTileEntity_Adv_HeatExchanger::addInputToMachineList, + CASING_INDEX, + 1), + ofHatchAdder( + GregtechMetaTileEntity_Adv_HeatExchanger::addOutputToMachineList, + CASING_INDEX, + 1), + ofHatchAdder( + GregtechMetaTileEntity_Adv_HeatExchanger::addMaintenanceToMachineList, + CASING_INDEX, + 1), + onElementPass( + GregtechMetaTileEntity_Adv_HeatExchanger::onCasingAdded, + ofBlock(ModBlocks.blockSpecialMultiCasings, 14)))) + .addElement( + 'c', + ofChain( + onElementPass( GregtechMetaTileEntity_Adv_HeatExchanger::onCasingAdded, ofBlock(ModBlocks.blockSpecialMultiCasings, 14)))) - .build(); + .build(); public static float penalty_per_config = 0.015f; // penalize 1.5% efficiency per circuitry level (1-25) private GT_MetaTileEntity_Hatch_Input mInputHotFluidHatch; @@ -113,30 +116,23 @@ public class GregtechMetaTileEntity_Adv_HeatExchanger @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { final GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType(getMachineType()) - .addInfo("Controller Block for the XL Heat Exchanger") + tt.addMachineType(getMachineType()).addInfo("Controller Block for the XL Heat Exchanger") .addInfo("More complicated than a Fusion Reactor. Seriously") - .addInfo("But you know this by now, right?") - .addInfo("Works as fast as 16 Large Heat Exchangers") - .addSeparator() - .addInfo("Inputs are Hot Coolant or Lava") + .addInfo("But you know this by now, right?").addInfo("Works as fast as 16 Large Heat Exchangers") + .addSeparator().addInfo("Inputs are Hot Coolant or Lava") .addInfo("Outputs Coolant or Pahoehoe Lava and SH Steam/Steam") .addInfo("Outputs SH Steam if input flow is equal to or above a certain value:") .addInfo("Hot Coolant: 12,800 L/s, maximum 25,600 EU/t, max output 6,400,000 SH Steam/s") .addInfo("Lava: 16,000 L/s, maximum 32,000 EU/t, max output 2,560,000 SH Steam/s") .addInfo("A circuit in the controller lowers the SH Steam threshold and efficiency") - .addInfo("2400 L/s reduction and 1.5% efficiency loss per circuit config over 1") - .addSeparator() - .beginStructureBlock(5, 9, 5, false) - .addController("Front bottom") + .addInfo("2400 L/s reduction and 1.5% efficiency loss per circuit config over 1").addSeparator() + .beginStructureBlock(5, 9, 5, false).addController("Front bottom") .addCasingInfo("Reinforced Heat Exchanger Casing", 90) .addOtherStructurePart("Tungstensteel Pipe Casing", "Center 3x5x3 (45 blocks)") - .addMaintenanceHatch("Any casing", 1) - .addInputHatch("Hot fluid, bottom center", 2) + .addMaintenanceHatch("Any casing", 1).addInputHatch("Hot fluid, bottom center", 2) .addInputHatch("Distilled water, any bottom layer casing", 1) .addOutputHatch("Cold fluid, top center", 3) - .addOutputHatch("Steam/SH Steam, any bottom layer casing", 1) - .toolTipFinisher(CORE.GT_Tooltip_Builder); + .addOutputHatch("Steam/SH Steam, any bottom layer casing", 1).toolTipFinisher(CORE.GT_Tooltip_Builder); return tt; } @@ -217,12 +213,12 @@ public class GregtechMetaTileEntity_Adv_HeatExchanger return false; } - superheated = fluidAmountToConsume - >= superheated_threshold; // set the internal superheated flag if we have enough hot fluid. Used in the + superheated = fluidAmountToConsume >= superheated_threshold; // set the internal superheated flag if we have + // enough hot fluid. Used in the // onRunningTick method. - fluidAmountToConsume = Math.min( - fluidAmountToConsume, - superheated_threshold * 2); // Don't consume too much hot fluid per second, maximum is 2x SH threshold. + fluidAmountToConsume = Math.min(fluidAmountToConsume, superheated_threshold * 2); // Don't consume too much hot + // fluid per second, maximum + // is 2x SH threshold. mInputHotFluidHatch.drain(fluidAmountToConsume, true); this.mMaxProgresstime = 20; this.lEUt = (long) (fluidAmountToConsume * steam_output_multiplier * efficiency); @@ -245,8 +241,8 @@ public class GregtechMetaTileEntity_Adv_HeatExchanger @Override public boolean onRunningTick(ItemStack aStack) { if (this.lEUt > 0) { - int tGeneratedEU = - (int) (this.lEUt * 2L * this.mEfficiency / 10000L); // APPROXIMATELY how much steam to generate. + int tGeneratedEU = (int) (this.lEUt * 2L * this.mEfficiency / 10000L); // APPROXIMATELY how much steam to + // generate. if (tGeneratedEU > 0) { if (superheated) tGeneratedEU /= 2; // We produce half as much superheated steam if necessary @@ -259,8 +255,9 @@ public class GregtechMetaTileEntity_Adv_HeatExchanger if (depleteInput(distilledStack)) // Consume the distilled water { if (superheated) { - addOutput(FluidRegistry.getFluidStack( - "ic2superheatedsteam", tGeneratedEU)); // Generate superheated steam + addOutput(FluidRegistry.getFluidStack("ic2superheatedsteam", tGeneratedEU)); // Generate + // superheated + // steam } else { addOutput(GT_ModHandler.getSteam(tGeneratedEU)); // Generate regular steam } @@ -344,26 +341,43 @@ public class GregtechMetaTileEntity_Adv_HeatExchanger @Override public String[] getExtraInfoData() { return new String[] { - StatCollector.translateToLocal("GT5U.multiblock.Progress") + ": " + EnumChatFormatting.GREEN - + GT_Utility.formatNumbers(mProgresstime / 20) + EnumChatFormatting.RESET + " s / " - + EnumChatFormatting.YELLOW - + GT_Utility.formatNumbers(mMaxProgresstime / 20) + EnumChatFormatting.RESET + " s", - StatCollector.translateToLocal("GT5U.multiblock.usage") + " " - + StatCollector.translateToLocal("GT5U.LHE.steam") + ": " - + (superheated ? EnumChatFormatting.RED : EnumChatFormatting.YELLOW) - + GT_Utility.formatNumbers(superheated ? -2 * lEUt : -lEUt) + EnumChatFormatting.RESET + " EU/t", - StatCollector.translateToLocal("GT5U.multiblock.problems") + ": " + EnumChatFormatting.RED - + (getIdealStatus() - getRepairStatus()) + EnumChatFormatting.RESET + " " - + StatCollector.translateToLocal("GT5U.multiblock.efficiency") - + ": " + EnumChatFormatting.YELLOW - + mEfficiency / 100.0F + EnumChatFormatting.RESET + " %", - StatCollector.translateToLocal("GT5U.LHE.superheated") + ": " - + (superheated ? EnumChatFormatting.RED : EnumChatFormatting.BLUE) + superheated - + EnumChatFormatting.RESET, - StatCollector.translateToLocal("GT5U.LHE.superheated") + " " - + StatCollector.translateToLocal("GT5U.LHE.threshold") + ": " + EnumChatFormatting.GREEN - + GT_Utility.formatNumbers(superheated_threshold) + EnumChatFormatting.RESET - }; + StatCollector.translateToLocal("GT5U.multiblock.Progress") + ": " + + EnumChatFormatting.GREEN + + GT_Utility.formatNumbers(mProgresstime / 20) + + EnumChatFormatting.RESET + + " s / " + + EnumChatFormatting.YELLOW + + GT_Utility.formatNumbers(mMaxProgresstime / 20) + + EnumChatFormatting.RESET + + " s", + StatCollector.translateToLocal("GT5U.multiblock.usage") + " " + + StatCollector.translateToLocal("GT5U.LHE.steam") + + ": " + + (superheated ? EnumChatFormatting.RED : EnumChatFormatting.YELLOW) + + GT_Utility.formatNumbers(superheated ? -2 * lEUt : -lEUt) + + EnumChatFormatting.RESET + + " EU/t", + StatCollector.translateToLocal("GT5U.multiblock.problems") + ": " + + EnumChatFormatting.RED + + (getIdealStatus() - getRepairStatus()) + + EnumChatFormatting.RESET + + " " + + StatCollector.translateToLocal("GT5U.multiblock.efficiency") + + ": " + + EnumChatFormatting.YELLOW + + mEfficiency / 100.0F + + EnumChatFormatting.RESET + + " %", + StatCollector.translateToLocal("GT5U.LHE.superheated") + ": " + + (superheated ? EnumChatFormatting.RED : EnumChatFormatting.BLUE) + + superheated + + EnumChatFormatting.RESET, + StatCollector.translateToLocal("GT5U.LHE.superheated") + " " + + StatCollector.translateToLocal("GT5U.LHE.threshold") + + ": " + + EnumChatFormatting.GREEN + + GT_Utility.formatNumbers(superheated_threshold) + + EnumChatFormatting.RESET }; } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_Implosion.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_Implosion.java index 5f4f0466c1..72d7e010c7 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_Implosion.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_Implosion.java @@ -4,8 +4,11 @@ import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; import static gregtech.api.GregTech_API.sBlockCasings4; import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; +import net.minecraft.item.ItemStack; + import com.gtnewhorizon.structurelib.structure.IStructureDefinition; import com.gtnewhorizon.structurelib.structure.StructureDefinition; + import gregtech.api.GregTech_API; import gregtech.api.interfaces.IIconContainer; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; @@ -15,7 +18,6 @@ import gregtech.api.util.*; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; -import net.minecraft.item.ItemStack; public class GregtechMetaTileEntity_Adv_Implosion extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_Adv_Implosion> { @@ -43,20 +45,13 @@ public class GregtechMetaTileEntity_Adv_Implosion @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType(getMachineType()) - .addInfo("Factory Grade Advanced Implosion Compressor") + tt.addMachineType(getMachineType()).addInfo("Factory Grade Advanced Implosion Compressor") .addInfo("Speed: +100% | EU Usage: 100% | Parallel: ((Tier/2)+1)") .addInfo("Constructed exactly the same as a normal Implosion Compressor") - .addPollutionAmount(getPollutionPerSecond(null)) - .addSeparator() - .beginStructureBlock(3, 3, 3, true) - .addController("Front center") - .addCasingInfo("Robust TungstenSteel Casing", 10) - .addInputBus("Any casing", 1) - .addOutputBus("Any casing", 1) - .addEnergyHatch("Any casing", 1) - .addMaintenanceHatch("Any casing", 1) - .addMufflerHatch("Any casing", 1) + .addPollutionAmount(getPollutionPerSecond(null)).addSeparator().beginStructureBlock(3, 3, 3, true) + .addController("Front center").addCasingInfo("Robust TungstenSteel Casing", 10) + .addInputBus("Any casing", 1).addOutputBus("Any casing", 1).addEnergyHatch("Any casing", 1) + .addMaintenanceHatch("Any casing", 1).addMufflerHatch("Any casing", 1) .toolTipFinisher(CORE.GT_Tooltip_Builder); return tt; } @@ -65,11 +60,11 @@ public class GregtechMetaTileEntity_Adv_Implosion public IStructureDefinition<GregtechMetaTileEntity_Adv_Implosion> getStructureDefinition() { if (STRUCTURE_DEFINITION == null) { STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_Adv_Implosion>builder() - .addShape(mName, transpose(new String[][] { - {"CCC", "CCC", "CCC"}, - {"C~C", "C-C", "CCC"}, - {"CCC", "CCC", "CCC"}, - })) + .addShape( + mName, + transpose( + new String[][] { { "CCC", "CCC", "CCC" }, { "C~C", "C-C", "CCC" }, + { "CCC", "CCC", "CCC" }, })) .addElement( 'C', ofChain( diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/steam/GregtechMetaTileEntity_SteamCompressor.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/steam/GregtechMetaTileEntity_SteamCompressor.java index f3c4e4abdf..04e36e7675 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/steam/GregtechMetaTileEntity_SteamCompressor.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/steam/GregtechMetaTileEntity_SteamCompressor.java @@ -7,10 +7,13 @@ import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose import static gregtech.api.GregTech_API.sBlockCasings1; import static gregtech.api.util.GT_StructureUtility.buildHatchAdder; +import net.minecraft.item.ItemStack; + import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable; import com.gtnewhorizon.structurelib.structure.IStructureDefinition; import com.gtnewhorizon.structurelib.structure.ISurvivalBuildEnvironment; import com.gtnewhorizon.structurelib.structure.StructureDefinition; + import gregtech.api.enums.Textures; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; @@ -19,7 +22,6 @@ import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_Recipe; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_SteamMultiBase; -import net.minecraft.item.ItemStack; public class GregtechMetaTileEntity_SteamCompressor extends GregtechMeta_SteamMultiBase<GregtechMetaTileEntity_SteamCompressor> implements ISurvivalConstructable { @@ -59,42 +61,31 @@ public class GregtechMetaTileEntity_SteamCompressor @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType(getMachineType()) - .addInfo("Controller Block for the Steam Compressor") - .addInfo("Compresses " + getMaxParallelRecipes() + " things at a time") - .addSeparator() - .beginStructureBlock(3, 3, 4, true) - .addController("Front center") - .addCasingInfo(mCasingName, 28) + tt.addMachineType(getMachineType()).addInfo("Controller Block for the Steam Compressor") + .addInfo("Compresses " + getMaxParallelRecipes() + " things at a time").addSeparator() + .beginStructureBlock(3, 3, 4, true).addController("Front center").addCasingInfo(mCasingName, 28) .addOtherStructurePart(TT_steaminputbus, "Any casing", 1) .addOtherStructurePart(TT_steamoutputbus, "Any casing", 1) - .addOtherStructurePart(TT_steamhatch, "Any casing", 1) - .toolTipFinisher(CORE.GT_Tooltip_Builder); + .addOtherStructurePart(TT_steamhatch, "Any casing", 1).toolTipFinisher(CORE.GT_Tooltip_Builder); return tt; } @Override public IStructureDefinition<GregtechMetaTileEntity_SteamCompressor> getStructureDefinition() { if (STRUCTURE_DEFINITION == null) { - STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_SteamCompressor>builder() - .addShape(mName, transpose(new String[][] { - {"CCC", "CCC", "CCC", "CCC"}, - {"C~C", "C-C", "C-C", "CCC"}, - {"CCC", "CCC", "CCC", "CCC"}, - })) + STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_SteamCompressor>builder().addShape( + mName, + transpose( + new String[][] { { "CCC", "CCC", "CCC", "CCC" }, { "C~C", "C-C", "C-C", "CCC" }, + { "CCC", "CCC", "CCC", "CCC" }, })) .addElement( 'C', ofChain( - buildSteamInput(GregtechMetaTileEntity_SteamCompressor.class) - .casingIndex(10) - .dot(1) - .build(), - buildHatchAdder(GregtechMetaTileEntity_SteamCompressor.class) - .atLeast( - SteamHatchElement.InputBus_Steam, SteamHatchElement.OutputBus_Steam) - .casingIndex(10) - .dot(1) + buildSteamInput(GregtechMetaTileEntity_SteamCompressor.class).casingIndex(10).dot(1) .build(), + buildHatchAdder(GregtechMetaTileEntity_SteamCompressor.class).atLeast( + SteamHatchElement.InputBus_Steam, + SteamHatchElement.OutputBus_Steam).casingIndex(10).dot(1).build(), onElementPass(x -> ++x.mCasing, ofBlock(sBlockCasings1, 10)))) .build(); } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/steam/GregtechMetaTileEntity_SteamMacerator.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/steam/GregtechMetaTileEntity_SteamMacerator.java index 1df761097a..710ff3495b 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/steam/GregtechMetaTileEntity_SteamMacerator.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/steam/GregtechMetaTileEntity_SteamMacerator.java @@ -5,10 +5,13 @@ import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock; import static gregtech.api.GregTech_API.sBlockCasings1; import static gregtech.api.util.GT_StructureUtility.buildHatchAdder; +import net.minecraft.item.ItemStack; + import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable; import com.gtnewhorizon.structurelib.structure.IStructureDefinition; import com.gtnewhorizon.structurelib.structure.ISurvivalBuildEnvironment; import com.gtnewhorizon.structurelib.structure.StructureDefinition; + import gregtech.api.enums.ItemList; import gregtech.api.enums.Textures; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; @@ -19,7 +22,6 @@ import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_Recipe; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_SteamMultiBase; -import net.minecraft.item.ItemStack; public class GregtechMetaTileEntity_SteamMacerator extends GregtechMeta_SteamMultiBase<GregtechMetaTileEntity_SteamMacerator> implements ISurvivalConstructable { @@ -62,42 +64,31 @@ public class GregtechMetaTileEntity_SteamMacerator mCasingName = ItemList.Casing_BronzePlatedBricks.get(1).getDisplayName(); } GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType(getMachineType()) - .addInfo("Controller Block for the Steam Macerator") - .addInfo("Macerates " + getMaxParallelRecipes() + " ores at a time") - .addSeparator() - .beginStructureBlock(3, 3, 3, true) - .addController("Front center") - .addCasingInfo(mCasingName, 14) + tt.addMachineType(getMachineType()).addInfo("Controller Block for the Steam Macerator") + .addInfo("Macerates " + getMaxParallelRecipes() + " ores at a time").addSeparator() + .beginStructureBlock(3, 3, 3, true).addController("Front center").addCasingInfo(mCasingName, 14) .addOtherStructurePart(TT_steaminputbus, "Any casing", 1) .addOtherStructurePart(TT_steamoutputbus, "Any casing", 1) - .addOtherStructurePart(TT_steamhatch, "Any casing", 1) - .toolTipFinisher(CORE.GT_Tooltip_Builder); + .addOtherStructurePart(TT_steamhatch, "Any casing", 1).toolTipFinisher(CORE.GT_Tooltip_Builder); return tt; } @Override public IStructureDefinition<GregtechMetaTileEntity_SteamMacerator> getStructureDefinition() { if (STRUCTURE_DEFINITION == null) { - STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_SteamMacerator>builder() - .addShape(mName, transpose(new String[][] { - {"CCC", "CCC", "CCC"}, - {"C~C", "C-C", "CCC"}, - {"CCC", "CCC", "CCC"}, - })) + STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_SteamMacerator>builder().addShape( + mName, + transpose( + new String[][] { { "CCC", "CCC", "CCC" }, { "C~C", "C-C", "CCC" }, + { "CCC", "CCC", "CCC" }, })) .addElement( 'C', ofChain( - buildSteamInput(GregtechMetaTileEntity_SteamMacerator.class) - .casingIndex(10) - .dot(1) - .build(), - buildHatchAdder(GregtechMetaTileEntity_SteamMacerator.class) - .atLeast( - SteamHatchElement.InputBus_Steam, SteamHatchElement.OutputBus_Steam) - .casingIndex(10) - .dot(1) + buildSteamInput(GregtechMetaTileEntity_SteamMacerator.class).casingIndex(10).dot(1) .build(), + buildHatchAdder(GregtechMetaTileEntity_SteamMacerator.class).atLeast( + SteamHatchElement.InputBus_Steam, + SteamHatchElement.OutputBus_Steam).casingIndex(10).dot(1).build(), onElementPass(x -> ++x.mCasing, ofBlock(sBlockCasings1, 10)))) .build(); } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GT4Entity_AutoCrafter.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GT4Entity_AutoCrafter.java index cf69ce12cd..ae51703c00 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GT4Entity_AutoCrafter.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GT4Entity_AutoCrafter.java @@ -6,10 +6,20 @@ import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose import static gregtech.api.enums.GT_HatchElement.*; import static gregtech.api.util.GT_StructureUtility.buildHatchAdder; +import java.lang.reflect.Field; +import java.util.ArrayList; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.EnumChatFormatting; +import net.minecraftforge.fluids.FluidStack; + import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable; import com.gtnewhorizon.structurelib.structure.IStructureDefinition; import com.gtnewhorizon.structurelib.structure.ISurvivalBuildEnvironment; import com.gtnewhorizon.structurelib.structure.StructureDefinition; + import gregtech.api.enums.TAE; import gregtech.api.enums.Textures; import gregtech.api.interfaces.IIconContainer; @@ -29,13 +39,6 @@ import gtPlusPlus.core.util.reflect.ReflectionUtils; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase; import gtPlusPlus.xmod.gregtech.common.helpers.CraftingHelper; import gtPlusPlus.xmod.gregtech.common.helpers.autocrafter.AC_Helper_Utils; -import java.lang.reflect.Field; -import java.util.ArrayList; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.EnumChatFormatting; -import net.minecraftforge.fluids.FluidStack; public class GT4Entity_AutoCrafter extends GregtechMeta_MultiBlockBase<GT4Entity_AutoCrafter> implements ISurvivalConstructable { @@ -50,6 +53,7 @@ public class GT4Entity_AutoCrafter extends GregtechMeta_MultiBlockBase<GT4Entity public CraftingHelper mInventoryCrafter; public static enum MODE { + CRAFTING("CIRCUIT", "ASSEMBLY"), ASSEMBLY("CRAFTING", "DISASSEMBLY"), DISASSEMBLY("ASSEMBLY", "CIRCUIT"), @@ -132,23 +136,14 @@ public class GT4Entity_AutoCrafter extends GregtechMeta_MultiBlockBase<GT4Entity @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType(getMachineType()) - .addInfo("Highly Advanced Autocrafter") + tt.addMachineType(getMachineType()).addInfo("Highly Advanced Autocrafter") .addInfo("Right Click with a Screwdriver to change mode") .addInfo("200% faster than using single block machines of the same voltage") - .addInfo("Processes two items per voltage tier") - .addPollutionAmount(getPollutionPerSecond(null)) - .addSeparator() - .beginStructureBlock(3, 3, 3, true) - .addController("Front Center") - .addCasingInfo("Bulk Production Frame", 10) - .addInputBus("Any Casing", 1) - .addOutputBus("Any Casing", 1) - .addInputHatch("Any Casing", 1) - .addEnergyHatch("Any Casing", 1) - .addMaintenanceHatch("Any Casing", 1) - .addMufflerHatch("Any Casing", 1) - .toolTipFinisher(CORE.GT_Tooltip_Builder); + .addInfo("Processes two items per voltage tier").addPollutionAmount(getPollutionPerSecond(null)) + .addSeparator().beginStructureBlock(3, 3, 3, true).addController("Front Center") + .addCasingInfo("Bulk Production Frame", 10).addInputBus("Any Casing", 1).addOutputBus("Any Casing", 1) + .addInputHatch("Any Casing", 1).addEnergyHatch("Any Casing", 1).addMaintenanceHatch("Any Casing", 1) + .addMufflerHatch("Any Casing", 1).toolTipFinisher(CORE.GT_Tooltip_Builder); return tt; } @@ -171,18 +166,16 @@ public class GT4Entity_AutoCrafter extends GregtechMeta_MultiBlockBase<GT4Entity public IStructureDefinition<GT4Entity_AutoCrafter> getStructureDefinition() { if (STRUCTURE_DEFINITION == null) { STRUCTURE_DEFINITION = StructureDefinition.<GT4Entity_AutoCrafter>builder() - .addShape(mName, transpose(new String[][] { - {"CCC", "CCC", "CCC"}, - {"C~C", "C-C", "CCC"}, - {"CCC", "CCC", "CCC"}, - })) + .addShape( + mName, + transpose( + new String[][] { { "CCC", "CCC", "CCC" }, { "C~C", "C-C", "CCC" }, + { "CCC", "CCC", "CCC" }, })) .addElement( 'C', buildHatchAdder(GT4Entity_AutoCrafter.class) .atLeast(InputBus, OutputBus, InputHatch, Maintenance, Energy, Muffler) - .casingIndex(TAE.getIndexFromPage(0, 10)) - .dot(1) - .buildAndChain( + .casingIndex(TAE.getIndexFromPage(0, 10)).dot(1).buildAndChain( onElementPass(x -> ++x.mCasing, ofBlock(ModBlocks.blockCasings2Misc, 12)))) .build(); } @@ -229,8 +222,7 @@ public class GT4Entity_AutoCrafter extends GregtechMeta_MultiBlockBase<GT4Entity return r; } } - } catch (IllegalArgumentException | IllegalAccessException e) { - } + } catch (IllegalArgumentException | IllegalAccessException e) {} } else if (this.mMachineMode == MODE.DISASSEMBLY || this.mMachineMode == MODE.CRAFTING) { return null; } @@ -249,16 +241,20 @@ public class GT4Entity_AutoCrafter extends GregtechMeta_MultiBlockBase<GT4Entity mMachineMode = mMachineMode.nextMode(); if (mMachineMode == MODE.CRAFTING) { PlayerUtils.messagePlayer( - aPlayer, "Running the Auto-Crafter in mode: " + EnumChatFormatting.AQUA + "AutoCrafting"); + aPlayer, + "Running the Auto-Crafter in mode: " + EnumChatFormatting.AQUA + "AutoCrafting"); } else if (mMachineMode == MODE.ASSEMBLY) { PlayerUtils.messagePlayer( - aPlayer, "Running the Auto-Crafter in mode: " + EnumChatFormatting.GREEN + "Assembly"); + aPlayer, + "Running the Auto-Crafter in mode: " + EnumChatFormatting.GREEN + "Assembly"); } else if (mMachineMode == MODE.DISASSEMBLY) { PlayerUtils.messagePlayer( - aPlayer, "Running the Auto-Crafter in mode: " + EnumChatFormatting.RED + "Disassembly"); + aPlayer, + "Running the Auto-Crafter in mode: " + EnumChatFormatting.RED + "Disassembly"); } else { PlayerUtils.messagePlayer( - aPlayer, "Running the Auto-Crafter in mode: " + EnumChatFormatting.YELLOW + "Circuit Assembly"); + aPlayer, + "Running the Auto-Crafter in mode: " + EnumChatFormatting.YELLOW + "Circuit Assembly"); } } // 5.08 support @@ -287,20 +283,20 @@ public class GT4Entity_AutoCrafter extends GregtechMeta_MultiBlockBase<GT4Entity } } - // @Override - // public boolean checkRecipe(final ItemStack aStack) { + // @Override + // public boolean checkRecipe(final ItemStack aStack) { // - // final long tVoltage = this.getMaxInputVoltage(); - // final byte tTier = this.mTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage)); + // final long tVoltage = this.getMaxInputVoltage(); + // final byte tTier = this.mTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage)); // - // if (mMachineMode == MODE.DISASSEMBLY) { - // return doDisassembly(); - // } else if (mMachineMode == MODE.CRAFTING) { - // return doCrafting(aStack); - // } else { - // return super.checkRecipeGeneric(getMaxParallelRecipes(), 100, 200); - // } - // } + // if (mMachineMode == MODE.DISASSEMBLY) { + // return doDisassembly(); + // } else if (mMachineMode == MODE.CRAFTING) { + // return doCrafting(aStack); + // } else { + // return super.checkRecipeGeneric(getMaxParallelRecipes(), 100, 200); + // } + // } private void setTier() { long tVoltage = getMaxInputVoltage(); @@ -329,12 +325,17 @@ public class GT4Entity_AutoCrafter extends GregtechMeta_MultiBlockBase<GT4Entity Object[] tempArray = tFluids.toArray(new FluidStack[] {}); FluidStack[] properArray; - properArray = - ((tempArray != null && tempArray.length > 0) ? (FluidStack[]) tempArray : new FluidStack[] {}); + properArray = ((tempArray != null && tempArray.length > 0) ? (FluidStack[]) tempArray + : new FluidStack[] {}); // Logger.MACHINE_INFO("4"); if (checkRecipeGeneric( - tBusItems.toArray(new ItemStack[] {}), properArray, getMaxParallelRecipes(), 100, 200, 10000)) + tBusItems.toArray(new ItemStack[] {}), + properArray, + getMaxParallelRecipes(), + 100, + 200, + 10000)) return true; } return false; @@ -441,136 +442,43 @@ public class GT4Entity_AutoCrafter extends GregtechMeta_MultiBlockBase<GT4Entity this.mMaxProgresstime = 0; return false; // do nothing /* - try { - // Set Crafting input hatch - if (!doesCrafterHave9SlotInput()) { - return false; - } - - // Read stored data from encrypted data stick. - ItemStack storedData_Output[] = NBTUtils.readItemsFromNBT(aStack, "Output"); - ItemStack storedData_Input[] = NBTUtils.readItemsFromNBT(aStack); - if (storedData_Output != null && storedData_Input != null) { - ItemStack loadedData[] = new ItemStack[9]; - if (storedData_Input.length >= 1) { - int number = 0; - for (ItemStack a : storedData_Input) { - if (a.getItem() == ModItems.ZZZ_Empty) { - // Utils.LOG_WARNING("Allocating free memory into crafting manager slot - // "+number+"."); - loadedData[number] = null; - } else { - // Utils.LOG_WARNING("Downloading "+a.getDisplayName()+" into crafting manager - // slot "+number+"."); - loadedData[number] = a; - } - number++; - } - } - - // Remove inputs here - ArrayList<ItemStack> mInputArray = new ArrayList<ItemStack>(); - ItemStack allInputs[]; - - for (GT_MetaTileEntity_Hatch_InputBus x : this.mInputBusses) { - if (x.mInventory.length > 0) { - for (ItemStack r : x.mInventory) { - if (r != null) { - mInputArray.add(r); - } - } - } - } - - if (mInputArray.isEmpty()) { - return false; - } else { - List<ItemStack> list = mInputArray; - allInputs = list.toArray(new ItemStack[list.size()]); - - if (allInputs != null && allInputs.length > 0) { - - this.mEUt = 8 * (1 << this.mTier - 1) * (1 << this.mTier - 1); - this.mMaxProgresstime = MathUtils.roundToClosestInt((50 - (5 - * MathUtils.randDouble(((this.mTier - 2) <= 0 ? 1 : (this.mTier - 2)), this.mTier)))); - - Logger.WARNING("MPT: " + mMaxProgresstime + " | " + mEUt); - this.getBaseMetaTileEntity().setActive(true); - - // Setup some vars - int counter = 0; - - ItemStack toUse[] = new ItemStack[9]; - - outerloop: for (ItemStack inputItem : loadedData) { - if (inputItem == null) { - toUse[counter] = null; - continue outerloop; - } - for (ItemStack r : allInputs) { - if (r != null) { - // Utils.LOG_WARNING("Input Bus Inventory Iteration - Found:" - // +r.getDisplayName()+" | "+allInputs.length); - if (GT_Utility.areStacksEqual(r, inputItem)) { - if (this.getBaseMetaTileEntity().isServerSide()) { - toUse[counter] = inputItem; - counter++; - continue outerloop; - } - - } - } - } - counter++; - } - - int mCorrectInputs = 0; - for (ItemStack isValid : toUse) { - if (isValid == null || this.depleteInput(isValid)) { - mCorrectInputs++; - } else { - Logger.WARNING("Input in Slot " + mCorrectInputs + " was not valid."); - } - } - - if (this.mTier > 5) { - this.mMaxProgresstime >>= this.mTier - 5; - } - if (this.mEUt > 0) - this.mEUt = (-this.mEUt); - this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000); - this.mEfficiencyIncrease = 10000; - - if (mCorrectInputs == 9) { - ItemStack mOutputItem = storedData_Output[0]; - NBTUtils.writeItemsToGtCraftingComponents(mOutputItem, loadedData, true); - this.addOutput(mOutputItem); - this.updateSlots(); - return true; - } else { - return false; - } - - } - } - } - } - // End Debug - catch (Throwable t) { - t.printStackTrace(); - this.mMaxProgresstime = 0; - } - - this.mMaxProgresstime = 0; - return false; - */ + * try { // Set Crafting input hatch if (!doesCrafterHave9SlotInput()) { return false; } // Read stored data + * from encrypted data stick. ItemStack storedData_Output[] = NBTUtils.readItemsFromNBT(aStack, "Output"); + * ItemStack storedData_Input[] = NBTUtils.readItemsFromNBT(aStack); if (storedData_Output != null && + * storedData_Input != null) { ItemStack loadedData[] = new ItemStack[9]; if (storedData_Input.length >= 1) { + * int number = 0; for (ItemStack a : storedData_Input) { if (a.getItem() == ModItems.ZZZ_Empty) { // + * Utils.LOG_WARNING("Allocating free memory into crafting manager slot // "+number+"."); loadedData[number] = + * null; } else { // Utils.LOG_WARNING("Downloading "+a.getDisplayName()+" into crafting manager // slot + * "+number+"."); loadedData[number] = a; } number++; } } // Remove inputs here ArrayList<ItemStack> mInputArray + * = new ArrayList<ItemStack>(); ItemStack allInputs[]; for (GT_MetaTileEntity_Hatch_InputBus x : + * this.mInputBusses) { if (x.mInventory.length > 0) { for (ItemStack r : x.mInventory) { if (r != null) { + * mInputArray.add(r); } } } } if (mInputArray.isEmpty()) { return false; } else { List<ItemStack> list = + * mInputArray; allInputs = list.toArray(new ItemStack[list.size()]); if (allInputs != null && allInputs.length + * > 0) { this.mEUt = 8 * (1 << this.mTier - 1) * (1 << this.mTier - 1); this.mMaxProgresstime = + * MathUtils.roundToClosestInt((50 - (5 MathUtils.randDouble(((this.mTier - 2) <= 0 ? 1 : (this.mTier - 2)), + * this.mTier)))); Logger.WARNING("MPT: " + mMaxProgresstime + " | " + mEUt); + * this.getBaseMetaTileEntity().setActive(true); // Setup some vars int counter = 0; ItemStack toUse[] = new + * ItemStack[9]; outerloop: for (ItemStack inputItem : loadedData) { if (inputItem == null) { toUse[counter] = + * null; continue outerloop; } for (ItemStack r : allInputs) { if (r != null) { // + * Utils.LOG_WARNING("Input Bus Inventory Iteration - Found:" // +r.getDisplayName()+" | "+allInputs.length); if + * (GT_Utility.areStacksEqual(r, inputItem)) { if (this.getBaseMetaTileEntity().isServerSide()) { toUse[counter] + * = inputItem; counter++; continue outerloop; } } } } counter++; } int mCorrectInputs = 0; for (ItemStack + * isValid : toUse) { if (isValid == null || this.depleteInput(isValid)) { mCorrectInputs++; } else { + * Logger.WARNING("Input in Slot " + mCorrectInputs + " was not valid."); } } if (this.mTier > 5) { + * this.mMaxProgresstime >>= this.mTier - 5; } if (this.mEUt > 0) this.mEUt = (-this.mEUt); this.mEfficiency = + * (10000 - (getIdealStatus() - getRepairStatus()) * 1000); this.mEfficiencyIncrease = 10000; if (mCorrectInputs + * == 9) { ItemStack mOutputItem = storedData_Output[0]; NBTUtils.writeItemsToGtCraftingComponents(mOutputItem, + * loadedData, true); this.addOutput(mOutputItem); this.updateSlots(); return true; } else { return false; } } } + * } } // End Debug catch (Throwable t) { t.printStackTrace(); this.mMaxProgresstime = 0; } + * this.mMaxProgresstime = 0; return false; + */ } @Override public String[] getExtraInfoData() { final String tRunning = (this.mMaxProgresstime > 0 ? "Auto-Crafter running" : "Auto-Crafter stopped"); - final String tMaintainance = - (this.getIdealStatus() == this.getRepairStatus() ? "No Maintainance issues" : "Needs Maintainance"); + final String tMaintainance = (this.getIdealStatus() == this.getRepairStatus() ? "No Maintainance issues" + : "Needs Maintainance"); String tSpecialText = "" + (60 + 12 * this.mTier) + "% chance to recover disassembled parts."; String tMode; if (mMachineMode == MODE.DISASSEMBLY) { @@ -588,9 +496,8 @@ public class GT4Entity_AutoCrafter extends GregtechMeta_MultiBlockBase<GT4Entity tSpecialText = "Does Auto-Crafter have 9-slot input bus? " + doesCrafterHave9SlotInput(); } - return new String[] { - "Large Scale Auto-Asesembler v1.01c", tRunning, tMaintainance, "Mode: " + tMode, tSpecialText - }; + return new String[] { "Large Scale Auto-Asesembler v1.01c", tRunning, tMaintainance, "Mode: " + tMode, + tSpecialText }; } private String getMode() { diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GT4Entity_ThermalBoiler.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GT4Entity_ThermalBoiler.java index 4ba92f8f7e..b9e709e68c 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GT4Entity_ThermalBoiler.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GT4Entity_ThermalBoiler.java @@ -6,10 +6,17 @@ import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose import static gregtech.api.enums.GT_HatchElement.*; import static gregtech.api.util.GT_StructureUtility.buildHatchAdder; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidRegistry; +import net.minecraftforge.fluids.FluidStack; + import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable; import com.gtnewhorizon.structurelib.structure.IStructureDefinition; import com.gtnewhorizon.structurelib.structure.ISurvivalBuildEnvironment; import com.gtnewhorizon.structurelib.structure.StructureDefinition; + import gregtech.api.enums.ItemList; import gregtech.api.enums.Materials; import gregtech.api.enums.TAE; @@ -25,11 +32,6 @@ import gtPlusPlus.core.material.MISC_MATERIALS; import gtPlusPlus.core.util.minecraft.FluidUtils; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraftforge.fluids.Fluid; -import net.minecraftforge.fluids.FluidRegistry; -import net.minecraftforge.fluids.FluidStack; public class GT4Entity_ThermalBoiler extends GregtechMeta_MultiBlockBase<GT4Entity_ThermalBoiler> implements ISurvivalConstructable { @@ -113,32 +115,32 @@ public class GT4Entity_ThermalBoiler extends GregtechMeta_MultiBlockBase<GT4Enti if ((tRecipe.getOutput(0) != null) && (getBaseMetaTileEntity().getRandomNumber(loot_MAXCHANCE) < tRecipe.getOutputChance(0))) { - this.mOutputItems = new ItemStack[] {GT_Utility.copy(tRecipe.getOutput(0))}; + this.mOutputItems = new ItemStack[] { GT_Utility.copy(tRecipe.getOutput(0)) }; } if ((tRecipe.getOutput(1) != null) && (getBaseMetaTileEntity().getRandomNumber(loot_MAXCHANCE) < tRecipe.getOutputChance(1))) { - this.mOutputItems = new ItemStack[] {GT_Utility.copy(tRecipe.getOutput(1))}; + this.mOutputItems = new ItemStack[] { GT_Utility.copy(tRecipe.getOutput(1)) }; } if ((tRecipe.getOutput(2) != null) && (getBaseMetaTileEntity().getRandomNumber(loot_MAXCHANCE) < tRecipe.getOutputChance(2))) { - this.mOutputItems = new ItemStack[] {GT_Utility.copy(tRecipe.getOutput(2))}; + this.mOutputItems = new ItemStack[] { GT_Utility.copy(tRecipe.getOutput(2)) }; } if ((tRecipe.getOutput(3) != null) && (getBaseMetaTileEntity().getRandomNumber(loot_MAXCHANCE) < tRecipe.getOutputChance(3))) { - this.mOutputItems = new ItemStack[] {GT_Utility.copy(tRecipe.getOutput(3))}; + this.mOutputItems = new ItemStack[] { GT_Utility.copy(tRecipe.getOutput(3)) }; } if ((tRecipe.getOutput(4) != null) && (getBaseMetaTileEntity().getRandomNumber(loot_MAXCHANCE) < tRecipe.getOutputChance(4))) { - this.mOutputItems = new ItemStack[] {GT_Utility.copy(tRecipe.getOutput(4))}; + this.mOutputItems = new ItemStack[] { GT_Utility.copy(tRecipe.getOutput(4)) }; } if ((tRecipe.getOutput(5) != null) && (getBaseMetaTileEntity().getRandomNumber(loot_MAXCHANCE) < tRecipe.getOutputChance(5))) { - this.mOutputItems = new ItemStack[] {GT_Utility.copy(tRecipe.getOutput(5))}; + this.mOutputItems = new ItemStack[] { GT_Utility.copy(tRecipe.getOutput(5)) }; } } // Give Obsidian without Lava Filter @@ -146,7 +148,7 @@ public class GT4Entity_ThermalBoiler extends GregtechMeta_MultiBlockBase<GT4Enti if ((tRecipe.getOutput(6) != null) && (getBaseMetaTileEntity().getRandomNumber(loot_MAXCHANCE) < tRecipe.getOutputChance(6))) { - this.mOutputItems = new ItemStack[] {GT_Utility.copy(tRecipe.getOutput(6))}; + this.mOutputItems = new ItemStack[] { GT_Utility.copy(tRecipe.getOutput(6)) }; } } return true; @@ -234,22 +236,13 @@ public class GT4Entity_ThermalBoiler extends GregtechMeta_MultiBlockBase<GT4Enti @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType(getMachineType()) - .addInfo("Thermal Boiler Controller") - .addInfo("Converts Water & Heat into Steam") - .addInfo("Explodes if water is not supplied") - .addInfo("Consult user manual for more information") - .addPollutionAmount(getPollutionPerSecond(null)) - .addSeparator() - .beginStructureBlock(3, 3, 3, true) - .addController("Front Center") - .addCasingInfo("Thermal Containment Casings", 10) - .addInputBus("Any Casing", 1) - .addOutputBus("Any Casing", 1) - .addInputHatch("Any Casing", 1) - .addOutputHatch("Any Casing", 1) - .addMaintenanceHatch("Any Casing", 1) - .addMufflerHatch("Any Casing", 1) + tt.addMachineType(getMachineType()).addInfo("Thermal Boiler Controller") + .addInfo("Converts Water & Heat into Steam").addInfo("Explodes if water is not supplied") + .addInfo("Consult user manual for more information").addPollutionAmount(getPollutionPerSecond(null)) + .addSeparator().beginStructureBlock(3, 3, 3, true).addController("Front Center") + .addCasingInfo("Thermal Containment Casings", 10).addInputBus("Any Casing", 1) + .addOutputBus("Any Casing", 1).addInputHatch("Any Casing", 1).addOutputHatch("Any Casing", 1) + .addMaintenanceHatch("Any Casing", 1).addMufflerHatch("Any Casing", 1) .toolTipFinisher(CORE.GT_Tooltip_Builder); return tt; } @@ -273,18 +266,16 @@ public class GT4Entity_ThermalBoiler extends GregtechMeta_MultiBlockBase<GT4Enti public IStructureDefinition<GT4Entity_ThermalBoiler> getStructureDefinition() { if (STRUCTURE_DEFINITION == null) { STRUCTURE_DEFINITION = StructureDefinition.<GT4Entity_ThermalBoiler>builder() - .addShape(mName, transpose(new String[][] { - {"CCC", "CCC", "CCC"}, - {"C~C", "C-C", "CCC"}, - {"CCC", "CCC", "CCC"}, - })) + .addShape( + mName, + transpose( + new String[][] { { "CCC", "CCC", "CCC" }, { "C~C", "C-C", "CCC" }, + { "CCC", "CCC", "CCC" }, })) .addElement( 'C', buildHatchAdder(GT4Entity_ThermalBoiler.class) .atLeast(InputBus, OutputBus, InputHatch, OutputHatch, Maintenance, Energy, Muffler) - .casingIndex(TAE.getIndexFromPage(0, 1)) - .dot(1) - .buildAndChain( + .casingIndex(TAE.getIndexFromPage(0, 1)).dot(1).buildAndChain( onElementPass(x -> ++x.mCasing, ofBlock(ModBlocks.blockCasings2Misc, 11)))) .build(); } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_ElementalDuplicator.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_ElementalDuplicator.java index cab78ffef4..4b58683a16 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_ElementalDuplicator.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_ElementalDuplicator.java @@ -7,8 +7,17 @@ import static com.gtnewhorizon.structurelib.structure.StructureUtility.onElement import static gregtech.api.enums.GT_HatchElement.*; import static gregtech.api.util.GT_StructureUtility.buildHatchAdder; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; + +import net.minecraft.block.Block; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidStack; + import com.gtnewhorizon.structurelib.structure.IStructureDefinition; import com.gtnewhorizon.structurelib.structure.StructureDefinition; + import gregtech.api.GregTech_API; import gregtech.api.enums.Element; import gregtech.api.enums.Materials; @@ -30,17 +39,10 @@ import gtPlusPlus.core.lib.CORE; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_ElementalDataOrbHolder; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import net.minecraft.block.Block; -import net.minecraft.item.ItemStack; -import net.minecraftforge.fluids.FluidStack; public class GregtechMTE_ElementalDuplicator extends GregtechMeta_MultiBlockBase<GregtechMTE_ElementalDuplicator> { - private final ArrayList<GT_MetaTileEntity_Hatch_ElementalDataOrbHolder> mReplicatorDataOrbHatches = - new ArrayList<GT_MetaTileEntity_Hatch_ElementalDataOrbHolder>(); + private final ArrayList<GT_MetaTileEntity_Hatch_ElementalDataOrbHolder> mReplicatorDataOrbHatches = new ArrayList<GT_MetaTileEntity_Hatch_ElementalDataOrbHolder>(); private static final int CASING_TEXTURE_ID = TAE.getIndexFromPage(0, 3); private int mCasing = 0; @@ -65,29 +67,17 @@ public class GregtechMTE_ElementalDuplicator extends GregtechMeta_MultiBlockBase protected GT_Multiblock_Tooltip_Builder createTooltip() { GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType(getMachineType()) - .addInfo("Produces Elemental Material from UU Matter") - .addInfo("Speed: +100% | EU Usage: 100% | Parallel: 8 * Tier") - .addInfo("Maximum 1x of each bus/hatch.") - .addInfo("Does not require both Output Hatch & Bus") - .addPollutionAmount(getPollutionPerSecond(null)) - .addSeparator() - .beginStructureBlock(9, 6, 9, true) - .addController("Top Center") - .addCasingInfo("Elemental Confinement Shell", 138) - .addCasingInfo("Matter Fabricator Casing", 24) - .addCasingInfo("Particle Containment Casing", 24) - .addCasingInfo("Matter Generation Coil", 24) - .addCasingInfo("High Voltage Current Capacitor", 20) - .addCasingInfo("Resonance Chamber III", 24) - .addCasingInfo("Modulator III", 16) - .addOtherStructurePart("Data Orb Repository", "1x", 1) - .addInputHatch("Any 1 dot hint", 1) - .addOutputBus("Any 1 dot hint", 1) - .addOutputHatch("Any 1 dot hint", 1) - .addEnergyHatch("Any 1 dot hint", 1) - .addMaintenanceHatch("Any 1 dot hint", 1) - .addMufflerHatch("Any 1 dot hint", 1) + tt.addMachineType(getMachineType()).addInfo("Produces Elemental Material from UU Matter") + .addInfo("Speed: +100% | EU Usage: 100% | Parallel: 8 * Tier").addInfo("Maximum 1x of each bus/hatch.") + .addInfo("Does not require both Output Hatch & Bus").addPollutionAmount(getPollutionPerSecond(null)) + .addSeparator().beginStructureBlock(9, 6, 9, true).addController("Top Center") + .addCasingInfo("Elemental Confinement Shell", 138).addCasingInfo("Matter Fabricator Casing", 24) + .addCasingInfo("Particle Containment Casing", 24).addCasingInfo("Matter Generation Coil", 24) + .addCasingInfo("High Voltage Current Capacitor", 20).addCasingInfo("Resonance Chamber III", 24) + .addCasingInfo("Modulator III", 16).addOtherStructurePart("Data Orb Repository", "1x", 1) + .addInputHatch("Any 1 dot hint", 1).addOutputBus("Any 1 dot hint", 1) + .addOutputHatch("Any 1 dot hint", 1).addEnergyHatch("Any 1 dot hint", 1) + .addMaintenanceHatch("Any 1 dot hint", 1).addMufflerHatch("Any 1 dot hint", 1) .toolTipFinisher(CORE.GT_Tooltip_Builder); return tt; } @@ -112,74 +102,21 @@ public class GregtechMTE_ElementalDuplicator extends GregtechMeta_MultiBlockBase // f = Resonance III // g = Modulator III - .addShape(STRUCTURE_PIECE_MAIN, (new String[][] { - { - " ccc ", - " ccccc ", - " ccccccc ", - "ccchhhccc", - "ccch~hccc", - "ccchhhccc", - " ccccccc ", - " ccccc ", - " ccc " - }, - { - " cac ", - " abfba ", - " abfgfba ", - "cbfgdgfbc", - "afgdddgfa", - "cbfgdgfbc", - " abfgfba ", - " abfba ", - " cac " - }, - { - " cec ", - " e e ", - " e e ", - "c d c", - "e ddd e", - "c d c", - " e e ", - " e e ", - " cec " - }, - { - " cec ", - " e e ", - " e e ", - "c d c", - "e ddd e", - "c d c", - " e e ", - " e e ", - " cec " - }, - { - " cac ", - " abfba ", - " abfgfba ", - "cbfgdgfbc", - "afgdddgfa", - "cbfgdgfbc", - " abfgfba ", - " abfba ", - " cac " - }, - { - " ccc ", - " ccccc ", - " ccccccc ", - "ccchhhccc", - "ccchhhccc", - "ccchhhccc", - " ccccccc ", - " ccccc ", - " ccc " - }, - })) + .addShape( + STRUCTURE_PIECE_MAIN, + (new String[][] { + { " ccc ", " ccccc ", " ccccccc ", "ccchhhccc", "ccch~hccc", "ccchhhccc", + " ccccccc ", " ccccc ", " ccc " }, + { " cac ", " abfba ", " abfgfba ", "cbfgdgfbc", "afgdddgfa", "cbfgdgfbc", + " abfgfba ", " abfba ", " cac " }, + { " cec ", " e e ", " e e ", "c d c", "e ddd e", "c d c", + " e e ", " e e ", " cec " }, + { " cec ", " e e ", " e e ", "c d c", "e ddd e", "c d c", + " e e ", " e e ", " cec " }, + { " cac ", " abfba ", " abfgfba ", "cbfgdgfbc", "afgdddgfa", "cbfgdgfbc", + " abfgfba ", " abfba ", " cac " }, + { " ccc ", " ccccc ", " ccccccc ", "ccchhhccc", "ccchhhccc", "ccchhhccc", + " ccccccc ", " ccccc ", " ccc " }, })) .addElement('a', ofBlock(getCasingBlock4(), getCasingMeta6())) .addElement('b', ofBlock(getCasingBlock4(), getCasingMeta7())) .addElement('d', ofBlock(getCasingBlock2(), getCasingMeta2())) @@ -187,22 +124,26 @@ public class GregtechMTE_ElementalDuplicator extends GregtechMeta_MultiBlockBase .addElement('f', ofBlock(getCasingBlock3(), getCasingMeta4())) .addElement('g', ofBlock(getCasingBlock3(), getCasingMeta5())) .addElement( - 'c', lazy(t -> onElementPass(x -> ++x.mCasing, ofBlock(getCasingBlock(), getCasingMeta())))) + 'c', + lazy(t -> onElementPass(x -> ++x.mCasing, ofBlock(getCasingBlock(), getCasingMeta())))) .addElement( 'h', - lazy(t -> ofChain( - buildHatchAdder(GregtechMTE_ElementalDuplicator.class) - .atLeast(InputHatch, OutputBus, OutputHatch, Maintenance, Muffler, Energy) - .casingIndex(getCasingTextureIndex()) - .dot(1) - .build(), - buildHatchAdder(GregtechMTE_ElementalDuplicator.class) - .hatchClass(GT_MetaTileEntity_Hatch_ElementalDataOrbHolder.class) - .adder(GregtechMTE_ElementalDuplicator::addDataOrbHatch) - .casingIndex(getCasingTextureIndex()) - .dot(1) - .build(), - onElementPass(x -> ++x.mCasing, ofBlock(getCasingBlock(), getCasingMeta()))))) + lazy( + t -> ofChain( + buildHatchAdder(GregtechMTE_ElementalDuplicator.class).atLeast( + InputHatch, + OutputBus, + OutputHatch, + Maintenance, + Muffler, + Energy).casingIndex(getCasingTextureIndex()).dot(1).build(), + buildHatchAdder(GregtechMTE_ElementalDuplicator.class) + .hatchClass(GT_MetaTileEntity_Hatch_ElementalDataOrbHolder.class) + .adder(GregtechMTE_ElementalDuplicator::addDataOrbHatch) + .casingIndex(getCasingTextureIndex()).dot(1).build(), + onElementPass( + x -> ++x.mCasing, + ofBlock(getCasingBlock(), getCasingMeta()))))) .build(); } return STRUCTURE_DEFINITION; @@ -217,8 +158,7 @@ public class GregtechMTE_ElementalDuplicator extends GregtechMeta_MultiBlockBase public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) { mCasing = 0; boolean aDidBuild = checkPiece(STRUCTURE_PIECE_MAIN, 4, 4, 0); - if (this.mInputHatches.size() != 1 - || (this.mOutputBusses.size() != 1 && this.mOutputHatches.size() != 0) + if (this.mInputHatches.size() != 1 || (this.mOutputBusses.size() != 1 && this.mOutputHatches.size() != 0) || this.mEnergyHatches.size() != 1 || this.mReplicatorDataOrbHatches.size() != 1) { return false; @@ -324,14 +264,8 @@ public class GregtechMTE_ElementalDuplicator extends GregtechMeta_MultiBlockBase } @Override - public boolean checkRecipeGeneric( - ItemStack[] aItemInputs, - FluidStack[] aFluidInputs, - int aMaxParallelRecipes, - long aEUPercent, - int aSpeedBonusPercent, - int aOutputChanceRoll, - GT_Recipe aRecipe) { + public boolean checkRecipeGeneric(ItemStack[] aItemInputs, FluidStack[] aFluidInputs, int aMaxParallelRecipes, + long aEUPercent, int aSpeedBonusPercent, int aOutputChanceRoll, GT_Recipe aRecipe) { // Based on the Processing Array. A bit overkill, but very flexible. // Reset outputs and progress stats @@ -346,8 +280,7 @@ public class GregtechMTE_ElementalDuplicator extends GregtechMeta_MultiBlockBase try { ItemStack aDataOrbStack = null; - recipe: - for (GT_Recipe nRecipe : this.getRecipeMap().mRecipeList) { + recipe: for (GT_Recipe nRecipe : this.getRecipeMap().mRecipeList) { // log("Checking Recipe for: "+(nRecipe.mOutputs.length > 0 && nRecipe.mOutputs[0] != null ? // nRecipe.mOutputs[0].getDisplayName() : nRecipe.mFluidOutputs[0].getLocalizedName())); ItemStack aTempStack = getSpecialSlotStack(nRecipe); @@ -455,24 +388,21 @@ public class GregtechMTE_ElementalDuplicator extends GregtechMeta_MultiBlockBase /** * finds a Recipe matching the aFluid and ItemStack Inputs. * - * @param aTileEntity an Object representing the current coordinates of the executing Block/Entity/Whatever. This may be null, especially during Startup. - * @param aRecipe in case this is != null it will try to use this Recipe first when looking things up. - * @param aNotUnificated if this is T the Recipe searcher will unificate the ItemStack Inputs - * @param aDontCheckStackSizes if set to false will only return recipes that can be executed at least once with the provided input - * @param aVoltage Voltage of the Machine or Long.MAX_VALUE if it has no Voltage - * @param aFluids the Fluid Inputs - * @param aSpecialSlot the content of the Special Slot, the regular Manager doesn't do anything with this, but some custom ones do. - * @param aInputs the Item Inputs + * @param aTileEntity an Object representing the current coordinates of the executing + * Block/Entity/Whatever. This may be null, especially during Startup. + * @param aRecipe in case this is != null it will try to use this Recipe first when looking things up. + * @param aNotUnificated if this is T the Recipe searcher will unificate the ItemStack Inputs + * @param aDontCheckStackSizes if set to false will only return recipes that can be executed at least once with the + * provided input + * @param aVoltage Voltage of the Machine or Long.MAX_VALUE if it has no Voltage + * @param aFluids the Fluid Inputs + * @param aSpecialSlot the content of the Special Slot, the regular Manager doesn't do anything with this, + * but some custom ones do. + * @param aInputs the Item Inputs * @return the Recipe it has found or null for no matching Recipe */ - public GT_Recipe findRecipe( - IHasWorldObjectAndCoords aTileEntity, - GT_Recipe aRecipe, - boolean aNotUnificated, - boolean aDontCheckStackSizes, - long aVoltage, - FluidStack[] aFluids, - ItemStack aSpecialSlot, + public GT_Recipe findRecipe(IHasWorldObjectAndCoords aTileEntity, GT_Recipe aRecipe, boolean aNotUnificated, + boolean aDontCheckStackSizes, long aVoltage, FluidStack[] aFluids, ItemStack aSpecialSlot, ItemStack... aInputs) { GT_Recipe_Map mRecipeMap = this.getRecipeMap(); @@ -508,8 +438,7 @@ public class GregtechMTE_ElementalDuplicator extends GregtechMeta_MultiBlockBase // Check the Recipe which has been used last time in order to not have to search for it again, if possible. if (aRecipe != null) { ItemStack aRecipeSpecial = getSpecialSlotStack(aRecipe); - if (!aRecipe.mFakeRecipe - && aRecipe.mCanBeBuffered + if (!aRecipe.mFakeRecipe && aRecipe.mCanBeBuffered && aRecipe.isRecipeInputEqual(false, aDontCheckStackSizes, aFluids, aInputs) && GT_Utility.areStacksEqual(aRecipeSpecial, aSpecialSlot, false) && areDataOrbsEqual(aRecipeSpecial, aSpecialSlot)) { @@ -518,61 +447,51 @@ public class GregtechMTE_ElementalDuplicator extends GregtechMeta_MultiBlockBase } // Now look for the Recipes inside the Item HashMaps, but only when the Recipes usually have Items. - if (mRecipeMap.mUsualInputCount > 0 && aInputs != null) - for (ItemStack tStack : aInputs) - if (tStack != null) { - Collection<GT_Recipe> tRecipes = mRecipeMap.mRecipeItemMap.get(new GT_ItemStack(tStack)); - if (tRecipes != null) { - for (GT_Recipe tRecipe : tRecipes) { - if (!tRecipe.mFakeRecipe - && tRecipe.isRecipeInputEqual(false, aDontCheckStackSizes, aFluids, aInputs)) { - ItemStack aRecipeSpecial = getSpecialSlotStack(tRecipe); - if (GT_Utility.areStacksEqual(aRecipeSpecial, aSpecialSlot, false) - && areDataOrbsEqual(aRecipeSpecial, aSpecialSlot)) { - return tRecipe.mEnabled && aVoltage * mRecipeMap.mAmperage >= tRecipe.mEUt - ? tRecipe - : null; - } - } - tRecipes = mRecipeMap.mRecipeItemMap.get(new GT_ItemStack(tStack, true)); + if (mRecipeMap.mUsualInputCount > 0 && aInputs != null) for (ItemStack tStack : aInputs) if (tStack != null) { + Collection<GT_Recipe> tRecipes = mRecipeMap.mRecipeItemMap.get(new GT_ItemStack(tStack)); + if (tRecipes != null) { + for (GT_Recipe tRecipe : tRecipes) { + if (!tRecipe.mFakeRecipe + && tRecipe.isRecipeInputEqual(false, aDontCheckStackSizes, aFluids, aInputs)) { + ItemStack aRecipeSpecial = getSpecialSlotStack(tRecipe); + if (GT_Utility.areStacksEqual(aRecipeSpecial, aSpecialSlot, false) + && areDataOrbsEqual(aRecipeSpecial, aSpecialSlot)) { + return tRecipe.mEnabled && aVoltage * mRecipeMap.mAmperage >= tRecipe.mEUt ? tRecipe : null; } } - if (tRecipes != null) { - for (GT_Recipe tRecipe : tRecipes) { - if (!tRecipe.mFakeRecipe - && tRecipe.isRecipeInputEqual(false, aDontCheckStackSizes, aFluids, aInputs)) { - ItemStack aRecipeSpecial = getSpecialSlotStack(tRecipe); - if (GT_Utility.areStacksEqual(aRecipeSpecial, aSpecialSlot, false) - && areDataOrbsEqual(aRecipeSpecial, aSpecialSlot)) { - return tRecipe.mEnabled && aVoltage * mRecipeMap.mAmperage >= tRecipe.mEUt - ? tRecipe - : null; - } - } + tRecipes = mRecipeMap.mRecipeItemMap.get(new GT_ItemStack(tStack, true)); + } + } + if (tRecipes != null) { + for (GT_Recipe tRecipe : tRecipes) { + if (!tRecipe.mFakeRecipe + && tRecipe.isRecipeInputEqual(false, aDontCheckStackSizes, aFluids, aInputs)) { + ItemStack aRecipeSpecial = getSpecialSlotStack(tRecipe); + if (GT_Utility.areStacksEqual(aRecipeSpecial, aSpecialSlot, false) + && areDataOrbsEqual(aRecipeSpecial, aSpecialSlot)) { + return tRecipe.mEnabled && aVoltage * mRecipeMap.mAmperage >= tRecipe.mEUt ? tRecipe : null; } } } + } + } // If the minimal Amount of Items for the Recipe is 0, then it could be a Fluid-Only Recipe, so check that Map // too. if (mRecipeMap.mMinimalInputItems == 0 && aFluids != null) - for (FluidStack aFluid : aFluids) - if (aFluid != null) { - Collection<GT_Recipe> tRecipes = mRecipeMap.mRecipeFluidMap.get(aFluid.getFluid()); - if (tRecipes != null) - for (GT_Recipe tRecipe : tRecipes) { - if (!tRecipe.mFakeRecipe - && tRecipe.isRecipeInputEqual(false, aDontCheckStackSizes, aFluids, aInputs)) { - ItemStack aRecipeSpecial = getSpecialSlotStack(tRecipe); - if (GT_Utility.areStacksEqual(aRecipeSpecial, aSpecialSlot, false) - && areDataOrbsEqual(aRecipeSpecial, aSpecialSlot)) { - return tRecipe.mEnabled && aVoltage * mRecipeMap.mAmperage >= tRecipe.mEUt - ? tRecipe - : null; - } - } + for (FluidStack aFluid : aFluids) if (aFluid != null) { + Collection<GT_Recipe> tRecipes = mRecipeMap.mRecipeFluidMap.get(aFluid.getFluid()); + if (tRecipes != null) for (GT_Recipe tRecipe : tRecipes) { + if (!tRecipe.mFakeRecipe + && tRecipe.isRecipeInputEqual(false, aDontCheckStackSizes, aFluids, aInputs)) { + ItemStack aRecipeSpecial = getSpecialSlotStack(tRecipe); + if (GT_Utility.areStacksEqual(aRecipeSpecial, aSpecialSlot, false) + && areDataOrbsEqual(aRecipeSpecial, aSpecialSlot)) { + return tRecipe.mEnabled && aVoltage * mRecipeMap.mAmperage >= tRecipe.mEUt ? tRecipe : null; } + } } + } // And nothing has been found. return null; @@ -591,12 +510,8 @@ public class GregtechMTE_ElementalDuplicator extends GregtechMeta_MultiBlockBase private static boolean areDataOrbsEqual(ItemStack aOrb1, ItemStack aOrb2) { if (aOrb1 != null && aOrb2 != null) { - Materials tMaterial1 = Element.get(Behaviour_DataOrb.getDataName(aOrb1)) - .mLinkedMaterials - .get(0); - Materials tMaterial2 = Element.get(Behaviour_DataOrb.getDataName(aOrb2)) - .mLinkedMaterials - .get(0); + Materials tMaterial1 = Element.get(Behaviour_DataOrb.getDataName(aOrb1)).mLinkedMaterials.get(0); + Materials tMaterial2 = Element.get(Behaviour_DataOrb.getDataName(aOrb2)).mLinkedMaterials.get(0); if (tMaterial1.equals(tMaterial2)) { return true; } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_FastNeutronReactor.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_FastNeutronReactor.java index 69d93ce06d..62552ad7c8 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_FastNeutronReactor.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_FastNeutronReactor.java @@ -1,208 +1,48 @@ /* -package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production; - - -public class GregtechMTE_FastNeutronReactor -extends GregtechMeta_MultiBlockBase -{ - - private int mSuperEfficencyIncrease = 0; - - - public GregtechMTE_FastNeutronReactor(int aID, String aName, String aNameRegional) - { - super(aID, aName, aNameRegional); - } - - public GregtechMTE_FastNeutronReactor(String mName) { - super(mName); - } - - @Override - public String getMachineType() { - return "Reactor"; - } - - @Override - public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) - { - return new GregtechMTE_FastNeutronReactor(this.mName); - } - @Override - public boolean isFacingValid(byte aFacing) - { - return aFacing > 1; - } - - @Override - public boolean isCorrectMachinePart(ItemStack aStack) - { - return true; - } - - @Override - public int getDamageToComponent(ItemStack aStack){ - return 0; - } - - @Override - public boolean checkRecipe(final ItemStack aStack) { - this.mSuperEfficencyIncrease=0; - if (processing_Stage_1()) { - if (processing_Stage_2()) { - if (processing_Stage_3()) { - if (processing_Stage_4()) { - - } - else { - //Stage 4 - } - } - else { - //Stage 3 - } - } - else { - //Stage 2 - } - } - else { - //Stage 1 - } - return false; - } - - @Override - public int getMaxParallelRecipes() { - return 1; - } - - @Override - public int getEuDiscountForParallelism() { - return 0; - } - - public boolean processing_Stage_1() { //Deplete Water, Add More Progress Time - for (GT_MetaTileEntity_Hatch_Input tRecipe : this.mInputHatches) { - if (tRecipe.getFluid() != null){ - FluidStack tFluid = FluidUtils.getFluidStack(tRecipe.getFluid(), 200); - if (tFluid != null) { - if (tFluid == GT_ModHandler.getDistilledWater(1)) { - if (depleteInput(tFluid)) { - this.mMaxProgresstime = Math.max(1, runtimeBoost(8 * 2)); - this.mEUt = getEUt(); - this.mEfficiencyIncrease = (this.mMaxProgresstime * getEfficiencyIncrease()); - return true; - } - } - - } - } - } - this.mMaxProgresstime = 0; - this.mEUt = 0; - return false; - } - public boolean processing_Stage_2() { - return false; - } - public boolean processing_Stage_3() { - return false; - } - public boolean processing_Stage_4() { - return false; - } - - @Override - public boolean onRunningTick(ItemStack aStack) { - if (this.mEUt > 0) { - if(this.mSuperEfficencyIncrease>0){ - this.mEfficiency = Math.min(10000, this.mEfficiency + this.mSuperEfficencyIncrease); - } - int tGeneratedEU = (int) (this.mEUt * 2L * this.mEfficiency / 10000L); - if (tGeneratedEU > 0) { - long amount = (tGeneratedEU + 160) / 160; - if (!depleteInput(GT_ModHandler.getDistilledWater(amount))) { - explodeMultiblock(); - } else { - addOutput(GT_ModHandler.getSteam(tGeneratedEU)); - } - } - return true; - } - return true; - } - - public int getEUt() { - return 0; //Default 400 - } - - public int getEfficiencyIncrease() { - return 0; //Default 12 - } - - int runtimeBoost(int mTime) { - return mTime * 150 / 100; - } - - @Override - public boolean explodesOnComponentBreak(ItemStack aStack) - { - return true; - } - - @Override - public int getMaxEfficiency(ItemStack aStack) - { - return 10000; - } - - @Override - public int getPollutionPerTick(ItemStack aStack) - { - return 0; - } - - public int getAmountOfOutputs() - { - return 1; - } - - @Override - public String[] getTooltip() - { - return new String[]{ - "Fukushima-Daiichi Reactor No. 6", - "------------------------------------------", - "Boiling Water Reactor", - "Harness the power of Nuclear Fission", - "------------------------------------------", - "Consult user manual for more information", - }; - } - - @Override - public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing, final byte aColorIndex, final boolean aActive, final boolean aRedstone) { - if (aSide == aFacing) { - return new ITexture[]{Textures.BlockIcons.getCasingTextureForId(TAE.GTPP_INDEX(1)), - new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE)}; - } - return new ITexture[]{Textures.BlockIcons.getCasingTextureForId(TAE.GTPP_INDEX(1))}; - } - - @Override - public boolean checkMultiblock(IGregTechTileEntity aBaseMetaTileEntity, ItemStack arg1) { - return true; - } - - public boolean damageFilter(){ - return false; - } - - @Override - public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { - super.onPostTick(aBaseMetaTileEntity, aTick); - } - -} -*/ + * package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production; public class + * GregtechMTE_FastNeutronReactor extends GregtechMeta_MultiBlockBase { private int mSuperEfficencyIncrease = 0; public + * GregtechMTE_FastNeutronReactor(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); } + * public GregtechMTE_FastNeutronReactor(String mName) { super(mName); } + * @Override public String getMachineType() { return "Reactor"; } + * @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new + * GregtechMTE_FastNeutronReactor(this.mName); } + * @Override public boolean isFacingValid(byte aFacing) { return aFacing > 1; } + * @Override public boolean isCorrectMachinePart(ItemStack aStack) { return true; } + * @Override public int getDamageToComponent(ItemStack aStack){ return 0; } + * @Override public boolean checkRecipe(final ItemStack aStack) { this.mSuperEfficencyIncrease=0; if + * (processing_Stage_1()) { if (processing_Stage_2()) { if (processing_Stage_3()) { if (processing_Stage_4()) { } else { + * //Stage 4 } } else { //Stage 3 } } else { //Stage 2 } } else { //Stage 1 } return false; } + * @Override public int getMaxParallelRecipes() { return 1; } + * @Override public int getEuDiscountForParallelism() { return 0; } public boolean processing_Stage_1() { //Deplete + * Water, Add More Progress Time for (GT_MetaTileEntity_Hatch_Input tRecipe : this.mInputHatches) { if + * (tRecipe.getFluid() != null){ FluidStack tFluid = FluidUtils.getFluidStack(tRecipe.getFluid(), 200); if (tFluid != + * null) { if (tFluid == GT_ModHandler.getDistilledWater(1)) { if (depleteInput(tFluid)) { this.mMaxProgresstime = + * Math.max(1, runtimeBoost(8 * 2)); this.mEUt = getEUt(); this.mEfficiencyIncrease = (this.mMaxProgresstime * + * getEfficiencyIncrease()); return true; } } } } } this.mMaxProgresstime = 0; this.mEUt = 0; return false; } public + * boolean processing_Stage_2() { return false; } public boolean processing_Stage_3() { return false; } public boolean + * processing_Stage_4() { return false; } + * @Override public boolean onRunningTick(ItemStack aStack) { if (this.mEUt > 0) { if(this.mSuperEfficencyIncrease>0){ + * this.mEfficiency = Math.min(10000, this.mEfficiency + this.mSuperEfficencyIncrease); } int tGeneratedEU = (int) + * (this.mEUt * 2L * this.mEfficiency / 10000L); if (tGeneratedEU > 0) { long amount = (tGeneratedEU + 160) / 160; if + * (!depleteInput(GT_ModHandler.getDistilledWater(amount))) { explodeMultiblock(); } else { + * addOutput(GT_ModHandler.getSteam(tGeneratedEU)); } } return true; } return true; } public int getEUt() { return 0; + * //Default 400 } public int getEfficiencyIncrease() { return 0; //Default 12 } int runtimeBoost(int mTime) { return + * mTime * 150 / 100; } + * @Override public boolean explodesOnComponentBreak(ItemStack aStack) { return true; } + * @Override public int getMaxEfficiency(ItemStack aStack) { return 10000; } + * @Override public int getPollutionPerTick(ItemStack aStack) { return 0; } public int getAmountOfOutputs() { return 1; + * } + * @Override public String[] getTooltip() { return new String[]{ "Fukushima-Daiichi Reactor No. 6", + * "------------------------------------------", "Boiling Water Reactor", "Harness the power of Nuclear Fission", + * "------------------------------------------", "Consult user manual for more information", }; } + * @Override public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte + * aFacing, final byte aColorIndex, final boolean aActive, final boolean aRedstone) { if (aSide == aFacing) { return new + * ITexture[]{Textures.BlockIcons.getCasingTextureForId(TAE.GTPP_INDEX(1)), new GT_RenderedTexture(aActive ? + * Textures.BlockIcons.OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_ACTIVE : + * Textures.BlockIcons.OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE)}; } return new + * ITexture[]{Textures.BlockIcons.getCasingTextureForId(TAE.GTPP_INDEX(1))}; } + * @Override public boolean checkMultiblock(IGregTechTileEntity aBaseMetaTileEntity, ItemStack arg1) { return true; } + * public boolean damageFilter(){ return false; } + * @Override public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { + * super.onPostTick(aBaseMetaTileEntity, aTick); } } + */ diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_FrothFlotationCell.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_FrothFlotationCell.java index b27f3d6b25..96cd2d74e7 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_FrothFlotationCell.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_FrothFlotationCell.java @@ -5,10 +5,18 @@ import static com.gtnewhorizon.structurelib.structure.StructureUtility.onElement import static gregtech.api.enums.GT_HatchElement.*; import static gregtech.api.util.GT_StructureUtility.buildHatchAdder; +import java.util.Objects; + +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraftforge.common.util.Constants; +import net.minecraftforge.fluids.FluidStack; + import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable; import com.gtnewhorizon.structurelib.structure.IStructureDefinition; import com.gtnewhorizon.structurelib.structure.ISurvivalBuildEnvironment; import com.gtnewhorizon.structurelib.structure.StructureDefinition; + import gregtech.api.GregTech_API; import gregtech.api.enums.TAE; import gregtech.api.interfaces.IIconContainer; @@ -24,11 +32,6 @@ import gtPlusPlus.core.material.Material; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; import gtPlusPlus.xmod.gregtech.common.helpers.FlotationRecipeHandler; -import java.util.Objects; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraftforge.common.util.Constants; -import net.minecraftforge.fluids.FluidStack; public class GregtechMTE_FrothFlotationCell extends GregtechMeta_MultiBlockBase<GregtechMTE_FrothFlotationCell> implements ISurvivalConstructable { @@ -57,21 +60,13 @@ public class GregtechMTE_FrothFlotationCell extends GregtechMeta_MultiBlockBase< @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType(getMachineType()) - .addInfo("Process that milled ore!") + tt.addMachineType(getMachineType()).addInfo("Process that milled ore!") .addInfo("You can only ever process one type of material per controller") - .addPollutionAmount(getPollutionPerSecond(null)) - .addSeparator() - .beginStructureBlock(7, 9, 7, true) - .addController("Front Center") - .addCasingInfo("Inconel Reinforced Casing", 68) - .addCasingInfo("Flotation Casing", 52) - .addInputBus("Bottom Casing", 1) - .addInputHatch("Bottom Casing", 1) - .addOutputHatch("Bottom Casing", 1) - .addEnergyHatch("Bottom Casing", 1) - .addMaintenanceHatch("Bottom Casing", 1) - .toolTipFinisher(CORE.GT_Tooltip_Builder); + .addPollutionAmount(getPollutionPerSecond(null)).addSeparator().beginStructureBlock(7, 9, 7, true) + .addController("Front Center").addCasingInfo("Inconel Reinforced Casing", 68) + .addCasingInfo("Flotation Casing", 52).addInputBus("Bottom Casing", 1).addInputHatch("Bottom Casing", 1) + .addOutputHatch("Bottom Casing", 1).addEnergyHatch("Bottom Casing", 1) + .addMaintenanceHatch("Bottom Casing", 1).toolTipFinisher(CORE.GT_Tooltip_Builder); return tt; } @@ -113,29 +108,25 @@ public class GregtechMTE_FrothFlotationCell extends GregtechMeta_MultiBlockBase< @Override public IStructureDefinition<GregtechMTE_FrothFlotationCell> getStructureDefinition() { if (STRUCTURE_DEFINITION == null) { - STRUCTURE_DEFINITION = StructureDefinition.<GregtechMTE_FrothFlotationCell>builder() - .addShape(mName, new String[][] { - {" ", " ", " X ", " X~X ", " X ", " ", " "}, - {" ", " F ", " FFF ", " FF FF ", " FFF ", " F ", " "}, - {" ", " F ", " F F ", " F F ", " F F ", " F ", " "}, - {" ", " F ", " F F ", " F F ", " F F ", " F ", " "}, - {" ", " F ", " F F ", " F F ", " F F ", " F ", " "}, - {" ", " F ", " F F ", " F F ", " F F ", " F ", " "}, - {" ", " F ", " F F ", " F F ", " F F ", " F ", " "}, - {" CCC ", " CCCCC ", "CCCCCCC", "CCCCCCC", "CCCCCCC", " CCCCC ", " CCC "}, - {" CCC ", " CCCCC ", "CCCCCCC", "CCCCCCC", "CCCCCCC", " CCCCC ", " CCC "}, - }) + STRUCTURE_DEFINITION = StructureDefinition.<GregtechMTE_FrothFlotationCell>builder().addShape( + mName, + new String[][] { { " ", " ", " X ", " X~X ", " X ", " ", " " }, + { " ", " F ", " FFF ", " FF FF ", " FFF ", " F ", " " }, + { " ", " F ", " F F ", " F F ", " F F ", " F ", " " }, + { " ", " F ", " F F ", " F F ", " F F ", " F ", " " }, + { " ", " F ", " F F ", " F F ", " F F ", " F ", " " }, + { " ", " F ", " F F ", " F F ", " F F ", " F ", " " }, + { " ", " F ", " F F ", " F F ", " F F ", " F ", " " }, + { " CCC ", " CCCCC ", "CCCCCCC", "CCCCCCC", "CCCCCCC", " CCCCC ", " CCC " }, + { " CCC ", " CCCCC ", "CCCCCCC", "CCCCCCC", "CCCCCCC", " CCCCC ", " CCC " }, }) .addElement( 'C', buildHatchAdder(GregtechMTE_FrothFlotationCell.class) .atLeast(InputBus, InputHatch, OutputHatch, Maintenance, Energy) - .casingIndex(getCasingTextureId()) - .dot(1) - .buildAndChain( + .casingIndex(getCasingTextureId()).dot(1).buildAndChain( onElementPass(x -> ++x.mCasing, ofBlock(ModBlocks.blockCasings3Misc, 1)))) .addElement('F', ofBlock(ModBlocks.blockSpecialMultiCasings, 9)) - .addElement('X', ofBlock(ModBlocks.blockCasings3Misc, 1)) - .build(); + .addElement('X', ofBlock(ModBlocks.blockCasings3Misc, 1)).build(); } return STRUCTURE_DEFINITION; } @@ -198,14 +189,8 @@ public class GregtechMTE_FrothFlotationCell extends GregtechMeta_MultiBlockBase< } @Override - public boolean checkRecipeGeneric( - ItemStack[] aItemInputs, - FluidStack[] aFluidInputs, - int aMaxParallelRecipes, - long aEUPercent, - int aSpeedBonusPercent, - int aOutputChanceRoll, - GT_Recipe aRecipe) { + public boolean checkRecipeGeneric(ItemStack[] aItemInputs, FluidStack[] aFluidInputs, int aMaxParallelRecipes, + long aEUPercent, int aSpeedBonusPercent, int aOutputChanceRoll, GT_Recipe aRecipe) { // Based on the Processing Array. A bit overkill, but very flexible. // Reset outputs and progress stats @@ -233,15 +218,11 @@ public class GregtechMTE_FrothFlotationCell extends GregtechMeta_MultiBlockBase< } /* - * - * Material checks - * Makes sure we can only ever use one type of material in this flotation cell. - * We used to depend on Alk's hash, but it's unreliable and user-hostile - * So we're using unlocalized name of material now. - * + * Material checks Makes sure we can only ever use one type of material in this flotation cell. We used to + * depend on Alk's hash, but it's unreliable and user-hostile So we're using unlocalized name of material now. */ - Material foundMaterial = - FlotationRecipeHandler.getMaterialOfMilledProduct(FlotationRecipeHandler.findMilledStack(tRecipe)); + Material foundMaterial = FlotationRecipeHandler + .getMaterialOfMilledProduct(FlotationRecipeHandler.findMilledStack(tRecipe)); String foundMaterialName = null; if (foundMaterial != null) { foundMaterialName = foundMaterial.getUnlocalizedName(); @@ -303,6 +284,6 @@ public class GregtechMTE_FrothFlotationCell extends GregtechMeta_MultiBlockBase< @Override public String[] getExtraInfoData() { - return new String[] {"Locked material: " + lockedMaterialName}; + return new String[] { "Locked material: " + lockedMaterialName }; } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_LargeNaqReactor.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_LargeNaqReactor.java index 92b3729cc2..92025a337f 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_LargeNaqReactor.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_LargeNaqReactor.java @@ -1,461 +1,164 @@ /* -package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production; - - -public class GregtechMTE_LargeNaqReactor extends GregtechMeta_MultiBlockBase { - - public ArrayList<GT_MetaTileEntity_Hatch_Naquadah> mNaqHatches = new ArrayList<GT_MetaTileEntity_Hatch_Naquadah>(); - public static String[] mCasingName = new String[5]; - public static String mHatchName = "Naquadah Fuel Hatch"; - - private final int CASING_TEXTURE_ID = TAE.getIndexFromPage(0, 13); - private final int META_BaseCasing = 0; //4 - private final int META_ContainmentCasing = 15; //3 - private final int META_Shielding = 13; //1 - private final int META_PipeCasing = 1; //4 - private final int META_IntegralCasing = 6; //0 - private final int META_ContainmentChamberCasing = 2; //4 - - public GregtechMTE_LargeNaqReactor(int aID, String aName, String aNameRegional) { - super(aID, aName, aNameRegional); - mCasingName[0] = LangUtils.getLocalizedNameOfBlock(getCasing(4), 0); - mCasingName[1] = LangUtils.getLocalizedNameOfBlock(getCasing(4), 1); - mCasingName[2] = LangUtils.getLocalizedNameOfBlock(getCasing(4), 2); - mCasingName[3] = LangUtils.getLocalizedNameOfBlock(getCasing(3), 15); - mCasingName[4] = LangUtils.getLocalizedNameOfBlock(getCasing(1), 13); - mHatchName = LangUtils.getLocalizedNameOfBlock(GregTech_API.sBlockMachines, 969); - } - - public GregtechMTE_LargeNaqReactor(String aName) { - super(aName); - } - - public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new GregtechMTE_LargeNaqReactor(this.mName); - } - - public String[] getTooltip() { - if (mCasingName[0].toLowerCase().contains(".name")) { - mCasingName[0] = LangUtils.getLocalizedNameOfBlock(getCasing(4), 0); - } - if (mCasingName[1].toLowerCase().contains(".name")) { - mCasingName[1] = LangUtils.getLocalizedNameOfBlock(getCasing(4), 1); - } - if (mCasingName[2].toLowerCase().contains(".name")) { - mCasingName[2] = LangUtils.getLocalizedNameOfBlock(getCasing(4), 2); - } - if (mCasingName[3].toLowerCase().contains(".name")) { - mCasingName[3] = LangUtils.getLocalizedNameOfBlock(getCasing(3), 15); - } - if (mCasingName[4].toLowerCase().contains(".name")) { - mCasingName[4] = LangUtils.getLocalizedNameOfBlock(getCasing(1), 13); - } - if (mHatchName.toLowerCase().contains(".name")) { - mHatchName = LangUtils.getLocalizedNameOfBlock(GregTech_API.sBlockMachines, 969); - } - return new String[]{ - "Naquadah reacts violently with potassium, ", - "resulting in massive explosions with radioactive potential.", - "Size: 3x4x12, WxHxL", - "Bottom Layer: "+mCasingName[0]+"s, (30x min)", - "Middle Layer: "+mCasingName[2]+"s (10x), with", - " "+mCasingName[3]+"s on either side", - " "+mCasingName[3]+"s also on each end (x26)", - "Middle Layer2: "+mCasingName[1]+" (12x total), with", - " "+mCasingName[4]+"s on either side (x24)", - "Top: Single row of "+mCasingName[0]+" along the middle (x12) ", - "", - "1x " + mHatchName + " (Any bottom layer casing)", - "1x " + "Maintenance Hatch" + " (Any bottom layer side casing)", - "1x " + "Energy Hatch" + " (Any top layer casing)", - - }; - } - - public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, - boolean aActive, boolean aRedstone) { - return aSide == aFacing - ? new ITexture[]{BlockIcons.getCasingTextureForId(TAE.getIndexFromPage(3, 0)), - new GT_RenderedTexture(aActive - ? TexturesGtBlock.Overlay_Machine_Controller_Default_Active - : TexturesGtBlock.Overlay_Machine_Controller_Default)} - : new ITexture[]{BlockIcons.getCasingTextureForId(TAE.getIndexFromPage(3, 0))}; - } - - public GT_Recipe_Map getRecipeMap() { - return null; - } - - public boolean isCorrectMachinePart(ItemStack aStack) { - return true; - } - - public boolean isFacingValid(byte aFacing) { - return aFacing == 1; - } - - public boolean checkRecipe(ItemStack aStack) { - return false; - } - - @Override - public int getMaxParallelRecipes() { - return 1; - } - - @Override - public int getEuDiscountForParallelism() { - return 0; - } - - public void startSoundLoop(byte aIndex, double aX, double aY, double aZ) { - super.startSoundLoop(aIndex, aX, aY, aZ); - if (aIndex == 20) { - GT_Utility.doSoundAtClient((String) GregTech_API.sSoundList.get(Integer.valueOf(212)), 10, 1.0F, aX, aY, - aZ); - } - } - - @Override - public String getSound() { - return (String) GregTech_API.sSoundList.get(Integer.valueOf(212)); - } - - private Block getCasing(int casingID) { - if (casingID == 1) { - return ModBlocks.blockCasingsMisc; - } - else if (casingID == 2) { - return ModBlocks.blockCasings2Misc; - } - else if (casingID == 3) { - return ModBlocks.blockCasings3Misc; - } - else if (casingID == 4) { - return ModBlocks.blockCasings4Misc; - } - else { - return ModBlocks.blockCasingsTieredGTPP; - } - } - - - - //Casing3, Meta 10 - "Grate Machine Casing"); - //Casing2, Meta 0 - "Solid Steel Machine Casing" - //Casing2, Meta 5 - "Assembling Line Casing" - //Casing2, Meta 9 - "Assembler Machine Casing" - //Magic Glass - blockAlloyGlass - - public boolean checkMultiblock(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) { - int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX * 4; - int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ * 4; - - // Counts for all Casing Types - int aBaseCasingCount = 0; - int aContainmentCasingCount = 0; - int aShieldingCount = 0; - int aPipeCount = 0; - int aIntegralCasingCount = 0; - int aContainmentChamberCount = 0; - - // Bottom Layer - aBaseCasingCount += checkEntireLayer(aBaseMetaTileEntity, getCasing(4), META_BaseCasing, -7, xDir, zDir); - log("Bottom Layer is Valid. Moving to Layer 1."); - - // Layer 1 - aShieldingCount += checkOuterRing(aBaseMetaTileEntity, getCasing(1), this.META_Shielding, -6, xDir, zDir); - aIntegralCasingCount += checkIntegralRing(aBaseMetaTileEntity, getCasing(0), this.META_IntegralCasing, -6, xDir, zDir); - aContainmentChamberCount += checkContainmentRing(aBaseMetaTileEntity, getCasing(4), this.META_ContainmentChamberCasing, -6, xDir, zDir); - log("Layer 1 is Valid. Moving to Layer 2."); - - // Layer 2 - aShieldingCount += checkOuterRing(aBaseMetaTileEntity, getCasing(1), this.META_Shielding, -5, xDir, zDir); - aPipeCount += checkPipes(aBaseMetaTileEntity, getCasing(4), this.META_PipeCasing, -5, xDir, zDir); - log("Layer 2 is Valid. Moving to Layer 3."); - - // Layer 3 - aContainmentCasingCount += checkOuterRing(aBaseMetaTileEntity, getCasing(3), this.META_ContainmentCasing, -4, xDir, zDir); - aPipeCount += checkPipes(aBaseMetaTileEntity, getCasing(4), this.META_PipeCasing, -4, xDir, zDir); - log("Layer 3 is Valid. Moving to Layer 4."); - - // Layer 4 - aContainmentCasingCount += checkOuterRing(aBaseMetaTileEntity, getCasing(3), this.META_ContainmentCasing, -3, xDir, zDir); - aPipeCount += checkPipes(aBaseMetaTileEntity, getCasing(4), this.META_PipeCasing, -3, xDir, zDir); - log("Layer 4 is Valid. Moving to Layer 5."); - - // Layer 5 - aShieldingCount += checkOuterRing(aBaseMetaTileEntity, getCasing(1), this.META_Shielding, -2, xDir, zDir); - aPipeCount += checkPipes(aBaseMetaTileEntity, getCasing(4), this.META_PipeCasing, -2, xDir, zDir); - log("Layer 5 is Valid. Moving to Layer 6."); - - // Layer 6 - aShieldingCount += checkOuterRing(aBaseMetaTileEntity, getCasing(1), this.META_Shielding, -1, xDir, zDir); - aIntegralCasingCount += checkIntegralRing(aBaseMetaTileEntity, getCasing(0), this.META_IntegralCasing, -1, xDir, zDir); - aContainmentChamberCount += checkContainmentRing(aBaseMetaTileEntity, getCasing(4), this.META_ContainmentChamberCasing, -1, xDir, zDir); - log("Layer 6 is Valid. Moving to Top Layer."); - - // Top Layer - aBaseCasingCount += checkEntireLayer(aBaseMetaTileEntity, getCasing(4), META_BaseCasing, 0, xDir, zDir); - - log("Found "+aBaseCasingCount+" "+mCasingName[0]+"s"); - log("Found "+aShieldingCount+" "+mCasingName[4]+"s"); - log("Found "+aPipeCount+" "+mCasingName[1]+"s"); - log("Found "+aContainmentCasingCount+" "+mCasingName[3]+"s"); - log("Found "+aIntegralCasingCount+" "+LangUtils.getLocalizedNameOfBlock(getCasing(0), 6)+"s"); - log("Found "+aContainmentChamberCount+" "+mCasingName[2]+"s"); - - // Try mesage player - String aOwnerName = this.getBaseMetaTileEntity().getOwnerName(); - EntityPlayer aOwner = null; - if (aOwnerName != null && aOwnerName.length() > 0) { - aOwner = PlayerUtils.getPlayer(aOwnerName); - } - - if (aShieldingCount != 128) { - log("Not enough "+mCasingName[4]+"s, require 128."); - if (aOwner != null) { - PlayerUtils.messagePlayer(aOwner, "Not enough "+mCasingName[4]+"s, require 128."); - } - return false; - } - if (aPipeCount != 20) { - log("Not enough "+mCasingName[1]+"s, require 20."); - if (aOwner != null) { - PlayerUtils.messagePlayer(aOwner, "Not enough "+mCasingName[1]+"s, require 20."); - } - return false; - } - if (aContainmentCasingCount != 64) { - log("Not enough "+mCasingName[3]+"s, require 64."); - if (aOwner != null) { - PlayerUtils.messagePlayer(aOwner, "Not enough "+mCasingName[3]+"s, require 64."); - } - return false; - } - if (aContainmentChamberCount != 42) { - log("Not enough "+mCasingName[2]+"s, require 42."); - if (aOwner != null) { - PlayerUtils.messagePlayer(aOwner, "Not enough "+mCasingName[2]+"s, require 42."); - } - return false; - } - if (aBaseCasingCount < 140) { - log("Not enough "+mCasingName[0]+"s, require 140 at a minimum."); - if (aOwner != null) { - PlayerUtils.messagePlayer(aOwner, "Not enough "+mCasingName[0]+"s, require 140 at a minimum."); - } - return false; - } - if (aIntegralCasingCount != 48) { - log("Not enough "+LangUtils.getLocalizedNameOfBlock(getCasing(0), 6)+"s, require 48."); - if (aOwner != null) { - PlayerUtils.messagePlayer(aOwner, "Not enough "+LangUtils.getLocalizedNameOfBlock(getCasing(0), 6)+"s, require 48."); - } - return false; - } - log("LNR Formed."); - if (aOwner != null) { - PlayerUtils.messagePlayer(aOwner, "Large Naquadah Reactor has formed successfully."); - } - return true; - } - - public boolean addNaquadahHatchToMachineInput(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { - if (aTileEntity == null) { - return false; - } else { - IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); - if (aMetaTileEntity == null) { - return false; - } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Naquadah) { - this.updateTexture(aMetaTileEntity, aBaseCasingIndex); - return this.mNaqHatches.add((GT_MetaTileEntity_Hatch_Naquadah) aMetaTileEntity); - } else { - return false; - } - } - } - - public int checkEntireLayer(IGregTechTileEntity aBaseMetaTileEntity, Block aBlock, int aMeta, int aY, int xDir, int zDir) { - int aCasingCount = 0; - for (int x = -4; x < 5; x++) { - for (int z = -4; z < 5; z++) { - int aOffsetX = this.getBaseMetaTileEntity().getXCoord() + x; - int aOffsetY = this.getBaseMetaTileEntity().getYCoord() + aY; - int aOffsetZ = this.getBaseMetaTileEntity().getZCoord() + z; - //Skip the corners - if ((x == 4 && z == 4) || (x == -4 && z == -4) || (x == 4 && z == -4) || (x == -4 && z == 4)) { - continue; - } - // Skip controller - if (aY == 0 && x == 0 && z == 0) { - continue; - } - - Block aCurrentBlock = aBaseMetaTileEntity.getBlockOffset(xDir + x, aY, zDir + z); - int aCurrentMeta = (int) aBaseMetaTileEntity.getMetaIDOffset(xDir + x, aY, zDir + z); - if (aCurrentBlock == aBlock && aCurrentMeta == aMeta) { - aCasingCount++; - } - final IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, aY, zDir + z); - if (!isValidBlockForStructure(tTileEntity, CASING_TEXTURE_ID, true, aCurrentBlock, aCurrentMeta, aBlock, aMeta)) { - log("Layer has error. Height: "+aY); - //this.getBaseMetaTileEntity().getWorld().setBlock(aOffsetX, aOffsetY, aOffsetZ, aBlock, aMeta, 3); - return 0; - } - } - } - return aCasingCount; - } - - public int checkOuterRing(IGregTechTileEntity aBaseMetaTileEntity, Block aBlock, int aMeta, int aY, int xDir, int zDir) { - int aCasingCount = 0; - for (int x = -4; x < 5; x++) { - for (int z = -4; z < 5; z++) { - int aOffsetX = this.getBaseMetaTileEntity().getXCoord() + x; - int aOffsetY = this.getBaseMetaTileEntity().getYCoord() + aY; - int aOffsetZ = this.getBaseMetaTileEntity().getZCoord() + z; - //Skip the corners - if ((x == 4 && z == 4) || (x == -4 && z == -4) || (x == 4 && z == -4) || (x == -4 && z == 4)) { - continue; - } - - // If we are on the 5x5 ring, proceed - if ((x > -4 && x < 4 ) && (z > -4 && z < 4)) { - if ((x == 3 && z == 3) || (x == -3 && z == -3) || (x == 3 && z == -3) || (x == -3 && z == 3)) { - //this.getBaseMetaTileEntity().getWorld().setBlock(aOffsetX, aOffsetY, aOffsetZ, aBlock, aMeta, 3); - } - else { - continue; - } - } - - Block aCurrentBlock = aBaseMetaTileEntity.getBlockOffset(xDir + x, aY, zDir + z); - int aCurrentMeta = (int) aBaseMetaTileEntity.getMetaIDOffset(xDir + x, aY, zDir + z); - if (aCurrentBlock == aBlock && aCurrentMeta == aMeta) { - aCasingCount++; - } - final IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, aY, zDir + z); - if (!isValidBlockForStructure(tTileEntity, CASING_TEXTURE_ID, false, aCurrentBlock, aCurrentMeta, aBlock, aMeta)) { - log("Layer has error. Height: "+aY); - //this.getBaseMetaTileEntity().getWorld().setBlock(aOffsetX, aOffsetY, aOffsetZ, aBlock, aMeta, 3); - return 0; - } - } - } - return aCasingCount; - } - public int checkIntegralRing(IGregTechTileEntity aBaseMetaTileEntity, Block aBlock, int aMeta, int aY, int xDir, int zDir) { - int aCasingCount = 0; - for (int x = -3; x < 4; x++) { - for (int z = -3; z < 4; z++) { - int aOffsetX = this.getBaseMetaTileEntity().getXCoord() + x; - int aOffsetY = this.getBaseMetaTileEntity().getYCoord() + aY; - int aOffsetZ = this.getBaseMetaTileEntity().getZCoord() + z; - //Skip the corners - if ((x == 3 && z == 3) || (x == -3 && z == -3) || (x == 3 && z == -3) || (x == -3 && z == 3)) { - continue; - } - - // If we are on the 5x5 ring, proceed - if ((x > -3 && x < 3 ) && (z > -3 && z < 3)) { - if ((x == 2 && z == 2) || (x == -2 && z == -2) || (x == 2 && z == -2) || (x == -2 && z == 2)) { - //this.getBaseMetaTileEntity().getWorld().setBlock(aOffsetX, aOffsetY, aOffsetZ, aBlock, aMeta, 3); - } - else { - continue; - } - } - - Block aCurrentBlock = aBaseMetaTileEntity.getBlockOffset(xDir + x, aY, zDir + z); - int aCurrentMeta = (int) aBaseMetaTileEntity.getMetaIDOffset(xDir + x, aY, zDir + z); - if (aCurrentBlock == aBlock && aCurrentMeta == aMeta) { - aCasingCount++; - } - final IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, aY, zDir + z); - if (!isValidBlockForStructure(tTileEntity, CASING_TEXTURE_ID, false, aCurrentBlock, aCurrentMeta, aBlock, aMeta)) { - log("Layer has error. Height: "+aY); - //this.getBaseMetaTileEntity().getWorld().setBlock(aOffsetX, aOffsetY, aOffsetZ, aBlock, aMeta, 3); - return 0; - } - } - } - return aCasingCount; - } - - public int checkPipes(IGregTechTileEntity aBaseMetaTileEntity, Block aBlock, int aMeta, int aY, int xDir, int zDir) { - int aCasingCount = 0; - for (int x = -1; x < 2; x++) { - for (int z = -1; z < 2; z++) { - int aOffsetX = this.getBaseMetaTileEntity().getXCoord() + x; - int aOffsetY = this.getBaseMetaTileEntity().getYCoord() + aY; - int aOffsetZ = this.getBaseMetaTileEntity().getZCoord() + z; - //Skip the corners - if ((x == 1 && z == 1) || (x == -1 && z == -1) || (x == 1 && z == -1) || (x == -1 && z == 1) || (x == 0 && z == 0)) { - Block aCurrentBlock = aBaseMetaTileEntity.getBlockOffset(xDir + x, aY, zDir + z); - int aCurrentMeta = (int) aBaseMetaTileEntity.getMetaIDOffset(xDir + x, aY, zDir + z); - if (aCurrentBlock == aBlock && aCurrentMeta == aMeta) { - aCasingCount++; - } - final IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, aY, zDir + z); - if (!isValidBlockForStructure(tTileEntity, CASING_TEXTURE_ID, false, aCurrentBlock, aCurrentMeta, aBlock, aMeta)) { - log("Pipe has error. Height: "+aY); - //this.getBaseMetaTileEntity().getWorld().setBlock(aOffsetX, aOffsetY, aOffsetZ, aBlock, aMeta, 3); - return 0; - }; - } - } - } - return aCasingCount; - } - - public int checkContainmentRing(IGregTechTileEntity aBaseMetaTileEntity, Block aBlock, int aMeta, int aY, int xDir, int zDir) { - int aCasingCount = 0; - for (int x = -2; x < 3; x++) { - for (int z = -2; z < 3; z++) { - int aOffsetX = this.getBaseMetaTileEntity().getXCoord() + x; - int aOffsetY = this.getBaseMetaTileEntity().getYCoord() + aY; - int aOffsetZ = this.getBaseMetaTileEntity().getZCoord() + z; - //Skip the corners - if ((x == 2 && z == 2) || (x == -2 && z == -2) || (x == 2 && z == -2) || (x == -2 && z == 2)) { - continue; - } - - Block aCurrentBlock = aBaseMetaTileEntity.getBlockOffset(xDir + x, aY, zDir + z); - int aCurrentMeta = (int) aBaseMetaTileEntity.getMetaIDOffset(xDir + x, aY, zDir + z); - if (aCurrentBlock == aBlock && aCurrentMeta == aMeta) { - aCasingCount++; - } - final IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, aY, zDir + z); - if (!isValidBlockForStructure(tTileEntity, CASING_TEXTURE_ID, false, aCurrentBlock, aCurrentMeta, aBlock, aMeta)) { - log("Layer has error. Height: "+aY); - //this.getBaseMetaTileEntity().getWorld().setBlock(aOffsetX, aOffsetY, aOffsetZ, aBlock, aMeta, 3); - return 0; - } - } - } - return aCasingCount; - } - - public int getMaxEfficiency(ItemStack aStack) { - return 10000; - } - - public int getPollutionPerTick(ItemStack aStack) { - return 133; - } - - public int getDamageToComponent(ItemStack aStack) { - return 0; - } - - public boolean explodesOnComponentBreak(ItemStack aStack) { - return false; - } - - @Override - public String getMachineType() { - return "Reactor"; - } -}*/ + * package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production; public class + * GregtechMTE_LargeNaqReactor extends GregtechMeta_MultiBlockBase { public ArrayList<GT_MetaTileEntity_Hatch_Naquadah> + * mNaqHatches = new ArrayList<GT_MetaTileEntity_Hatch_Naquadah>(); public static String[] mCasingName = new String[5]; + * public static String mHatchName = "Naquadah Fuel Hatch"; private final int CASING_TEXTURE_ID = + * TAE.getIndexFromPage(0, 13); private final int META_BaseCasing = 0; //4 private final int META_ContainmentCasing = + * 15; //3 private final int META_Shielding = 13; //1 private final int META_PipeCasing = 1; //4 private final int + * META_IntegralCasing = 6; //0 private final int META_ContainmentChamberCasing = 2; //4 public + * GregtechMTE_LargeNaqReactor(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); + * mCasingName[0] = LangUtils.getLocalizedNameOfBlock(getCasing(4), 0); mCasingName[1] = + * LangUtils.getLocalizedNameOfBlock(getCasing(4), 1); mCasingName[2] = LangUtils.getLocalizedNameOfBlock(getCasing(4), + * 2); mCasingName[3] = LangUtils.getLocalizedNameOfBlock(getCasing(3), 15); mCasingName[4] = + * LangUtils.getLocalizedNameOfBlock(getCasing(1), 13); mHatchName = + * LangUtils.getLocalizedNameOfBlock(GregTech_API.sBlockMachines, 969); } public GregtechMTE_LargeNaqReactor(String + * aName) { super(aName); } public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new + * GregtechMTE_LargeNaqReactor(this.mName); } public String[] getTooltip() { if + * (mCasingName[0].toLowerCase().contains(".name")) { mCasingName[0] = LangUtils.getLocalizedNameOfBlock(getCasing(4), + * 0); } if (mCasingName[1].toLowerCase().contains(".name")) { mCasingName[1] = + * LangUtils.getLocalizedNameOfBlock(getCasing(4), 1); } if (mCasingName[2].toLowerCase().contains(".name")) { + * mCasingName[2] = LangUtils.getLocalizedNameOfBlock(getCasing(4), 2); } if + * (mCasingName[3].toLowerCase().contains(".name")) { mCasingName[3] = LangUtils.getLocalizedNameOfBlock(getCasing(3), + * 15); } if (mCasingName[4].toLowerCase().contains(".name")) { mCasingName[4] = + * LangUtils.getLocalizedNameOfBlock(getCasing(1), 13); } if (mHatchName.toLowerCase().contains(".name")) { mHatchName = + * LangUtils.getLocalizedNameOfBlock(GregTech_API.sBlockMachines, 969); } return new String[]{ + * "Naquadah reacts violently with potassium, ", "resulting in massive explosions with radioactive potential.", + * "Size: 3x4x12, WxHxL", "Bottom Layer: "+mCasingName[0]+"s, (30x min)", + * "Middle Layer: "+mCasingName[2]+"s (10x), with", " "+mCasingName[3]+"s on either side", + * " "+mCasingName[3]+"s also on each end (x26)", "Middle Layer2: "+mCasingName[1]+" (12x total), with", + * " "+mCasingName[4]+"s on either side (x24)", + * "Top: Single row of "+mCasingName[0]+" along the middle (x12) ", "", "1x " + mHatchName + + * " (Any bottom layer casing)", "1x " + "Maintenance Hatch" + " (Any bottom layer side casing)", "1x " + "Energy Hatch" + * + " (Any top layer casing)", }; } public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, + * byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { return aSide == aFacing ? new + * ITexture[]{BlockIcons.getCasingTextureForId(TAE.getIndexFromPage(3, 0)), new GT_RenderedTexture(aActive ? + * TexturesGtBlock.Overlay_Machine_Controller_Default_Active : TexturesGtBlock.Overlay_Machine_Controller_Default)} : + * new ITexture[]{BlockIcons.getCasingTextureForId(TAE.getIndexFromPage(3, 0))}; } public GT_Recipe_Map getRecipeMap() { + * return null; } public boolean isCorrectMachinePart(ItemStack aStack) { return true; } public boolean + * isFacingValid(byte aFacing) { return aFacing == 1; } public boolean checkRecipe(ItemStack aStack) { return false; } + * @Override public int getMaxParallelRecipes() { return 1; } + * @Override public int getEuDiscountForParallelism() { return 0; } public void startSoundLoop(byte aIndex, double aX, + * double aY, double aZ) { super.startSoundLoop(aIndex, aX, aY, aZ); if (aIndex == 20) { + * GT_Utility.doSoundAtClient((String) GregTech_API.sSoundList.get(Integer.valueOf(212)), 10, 1.0F, aX, aY, aZ); } } + * @Override public String getSound() { return (String) GregTech_API.sSoundList.get(Integer.valueOf(212)); } private + * Block getCasing(int casingID) { if (casingID == 1) { return ModBlocks.blockCasingsMisc; } else if (casingID == 2) { + * return ModBlocks.blockCasings2Misc; } else if (casingID == 3) { return ModBlocks.blockCasings3Misc; } else if + * (casingID == 4) { return ModBlocks.blockCasings4Misc; } else { return ModBlocks.blockCasingsTieredGTPP; } } + * //Casing3, Meta 10 - "Grate Machine Casing"); //Casing2, Meta 0 - "Solid Steel Machine Casing" //Casing2, Meta 5 - + * "Assembling Line Casing" //Casing2, Meta 9 - "Assembler Machine Casing" //Magic Glass - blockAlloyGlass public + * boolean checkMultiblock(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) { int xDir = + * ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX * 4; int zDir = + * ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ * 4; // Counts for all Casing Types int + * aBaseCasingCount = 0; int aContainmentCasingCount = 0; int aShieldingCount = 0; int aPipeCount = 0; int + * aIntegralCasingCount = 0; int aContainmentChamberCount = 0; // Bottom Layer aBaseCasingCount += + * checkEntireLayer(aBaseMetaTileEntity, getCasing(4), META_BaseCasing, -7, xDir, zDir); + * log("Bottom Layer is Valid. Moving to Layer 1."); // Layer 1 aShieldingCount += checkOuterRing(aBaseMetaTileEntity, + * getCasing(1), this.META_Shielding, -6, xDir, zDir); aIntegralCasingCount += checkIntegralRing(aBaseMetaTileEntity, + * getCasing(0), this.META_IntegralCasing, -6, xDir, zDir); aContainmentChamberCount += + * checkContainmentRing(aBaseMetaTileEntity, getCasing(4), this.META_ContainmentChamberCasing, -6, xDir, zDir); + * log("Layer 1 is Valid. Moving to Layer 2."); // Layer 2 aShieldingCount += checkOuterRing(aBaseMetaTileEntity, + * getCasing(1), this.META_Shielding, -5, xDir, zDir); aPipeCount += checkPipes(aBaseMetaTileEntity, getCasing(4), + * this.META_PipeCasing, -5, xDir, zDir); log("Layer 2 is Valid. Moving to Layer 3."); // Layer 3 + * aContainmentCasingCount += checkOuterRing(aBaseMetaTileEntity, getCasing(3), this.META_ContainmentCasing, -4, xDir, + * zDir); aPipeCount += checkPipes(aBaseMetaTileEntity, getCasing(4), this.META_PipeCasing, -4, xDir, zDir); + * log("Layer 3 is Valid. Moving to Layer 4."); // Layer 4 aContainmentCasingCount += + * checkOuterRing(aBaseMetaTileEntity, getCasing(3), this.META_ContainmentCasing, -3, xDir, zDir); aPipeCount += + * checkPipes(aBaseMetaTileEntity, getCasing(4), this.META_PipeCasing, -3, xDir, zDir); + * log("Layer 4 is Valid. Moving to Layer 5."); // Layer 5 aShieldingCount += checkOuterRing(aBaseMetaTileEntity, + * getCasing(1), this.META_Shielding, -2, xDir, zDir); aPipeCount += checkPipes(aBaseMetaTileEntity, getCasing(4), + * this.META_PipeCasing, -2, xDir, zDir); log("Layer 5 is Valid. Moving to Layer 6."); // Layer 6 aShieldingCount += + * checkOuterRing(aBaseMetaTileEntity, getCasing(1), this.META_Shielding, -1, xDir, zDir); aIntegralCasingCount += + * checkIntegralRing(aBaseMetaTileEntity, getCasing(0), this.META_IntegralCasing, -1, xDir, zDir); + * aContainmentChamberCount += checkContainmentRing(aBaseMetaTileEntity, getCasing(4), + * this.META_ContainmentChamberCasing, -1, xDir, zDir); log("Layer 6 is Valid. Moving to Top Layer."); // Top Layer + * aBaseCasingCount += checkEntireLayer(aBaseMetaTileEntity, getCasing(4), META_BaseCasing, 0, xDir, zDir); + * log("Found "+aBaseCasingCount+" "+mCasingName[0]+"s"); log("Found "+aShieldingCount+" "+mCasingName[4]+"s"); + * log("Found "+aPipeCount+" "+mCasingName[1]+"s"); log("Found "+aContainmentCasingCount+" "+mCasingName[3]+"s"); + * log("Found "+aIntegralCasingCount+" "+LangUtils.getLocalizedNameOfBlock(getCasing(0), 6)+"s"); + * log("Found "+aContainmentChamberCount+" "+mCasingName[2]+"s"); // Try mesage player String aOwnerName = + * this.getBaseMetaTileEntity().getOwnerName(); EntityPlayer aOwner = null; if (aOwnerName != null && + * aOwnerName.length() > 0) { aOwner = PlayerUtils.getPlayer(aOwnerName); } if (aShieldingCount != 128) { + * log("Not enough "+mCasingName[4]+"s, require 128."); if (aOwner != null) { PlayerUtils.messagePlayer(aOwner, + * "Not enough "+mCasingName[4]+"s, require 128."); } return false; } if (aPipeCount != 20) { + * log("Not enough "+mCasingName[1]+"s, require 20."); if (aOwner != null) { PlayerUtils.messagePlayer(aOwner, + * "Not enough "+mCasingName[1]+"s, require 20."); } return false; } if (aContainmentCasingCount != 64) { + * log("Not enough "+mCasingName[3]+"s, require 64."); if (aOwner != null) { PlayerUtils.messagePlayer(aOwner, + * "Not enough "+mCasingName[3]+"s, require 64."); } return false; } if (aContainmentChamberCount != 42) { + * log("Not enough "+mCasingName[2]+"s, require 42."); if (aOwner != null) { PlayerUtils.messagePlayer(aOwner, + * "Not enough "+mCasingName[2]+"s, require 42."); } return false; } if (aBaseCasingCount < 140) { + * log("Not enough "+mCasingName[0]+"s, require 140 at a minimum."); if (aOwner != null) { + * PlayerUtils.messagePlayer(aOwner, "Not enough "+mCasingName[0]+"s, require 140 at a minimum."); } return false; } if + * (aIntegralCasingCount != 48) { log("Not enough "+LangUtils.getLocalizedNameOfBlock(getCasing(0), + * 6)+"s, require 48."); if (aOwner != null) { PlayerUtils.messagePlayer(aOwner, + * "Not enough "+LangUtils.getLocalizedNameOfBlock(getCasing(0), 6)+"s, require 48."); } return false; } + * log("LNR Formed."); if (aOwner != null) { PlayerUtils.messagePlayer(aOwner, + * "Large Naquadah Reactor has formed successfully."); } return true; } public boolean + * addNaquadahHatchToMachineInput(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { if (aTileEntity == null) { + * return false; } else { IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); if (aMetaTileEntity == + * null) { return false; } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Naquadah) { + * this.updateTexture(aMetaTileEntity, aBaseCasingIndex); return this.mNaqHatches.add((GT_MetaTileEntity_Hatch_Naquadah) + * aMetaTileEntity); } else { return false; } } } public int checkEntireLayer(IGregTechTileEntity aBaseMetaTileEntity, + * Block aBlock, int aMeta, int aY, int xDir, int zDir) { int aCasingCount = 0; for (int x = -4; x < 5; x++) { for (int + * z = -4; z < 5; z++) { int aOffsetX = this.getBaseMetaTileEntity().getXCoord() + x; int aOffsetY = + * this.getBaseMetaTileEntity().getYCoord() + aY; int aOffsetZ = this.getBaseMetaTileEntity().getZCoord() + z; //Skip + * the corners if ((x == 4 && z == 4) || (x == -4 && z == -4) || (x == 4 && z == -4) || (x == -4 && z == 4)) { continue; + * } // Skip controller if (aY == 0 && x == 0 && z == 0) { continue; } Block aCurrentBlock = + * aBaseMetaTileEntity.getBlockOffset(xDir + x, aY, zDir + z); int aCurrentMeta = (int) + * aBaseMetaTileEntity.getMetaIDOffset(xDir + x, aY, zDir + z); if (aCurrentBlock == aBlock && aCurrentMeta == aMeta) { + * aCasingCount++; } final IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, + * aY, zDir + z); if (!isValidBlockForStructure(tTileEntity, CASING_TEXTURE_ID, true, aCurrentBlock, aCurrentMeta, + * aBlock, aMeta)) { log("Layer has error. Height: "+aY); //this.getBaseMetaTileEntity().getWorld().setBlock(aOffsetX, + * aOffsetY, aOffsetZ, aBlock, aMeta, 3); return 0; } } } return aCasingCount; } public int + * checkOuterRing(IGregTechTileEntity aBaseMetaTileEntity, Block aBlock, int aMeta, int aY, int xDir, int zDir) { int + * aCasingCount = 0; for (int x = -4; x < 5; x++) { for (int z = -4; z < 5; z++) { int aOffsetX = + * this.getBaseMetaTileEntity().getXCoord() + x; int aOffsetY = this.getBaseMetaTileEntity().getYCoord() + aY; int + * aOffsetZ = this.getBaseMetaTileEntity().getZCoord() + z; //Skip the corners if ((x == 4 && z == 4) || (x == -4 && z + * == -4) || (x == 4 && z == -4) || (x == -4 && z == 4)) { continue; } // If we are on the 5x5 ring, proceed if ((x > -4 + * && x < 4 ) && (z > -4 && z < 4)) { if ((x == 3 && z == 3) || (x == -3 && z == -3) || (x == 3 && z == -3) || (x == -3 + * && z == 3)) { //this.getBaseMetaTileEntity().getWorld().setBlock(aOffsetX, aOffsetY, aOffsetZ, aBlock, aMeta, 3); } + * else { continue; } } Block aCurrentBlock = aBaseMetaTileEntity.getBlockOffset(xDir + x, aY, zDir + z); int + * aCurrentMeta = (int) aBaseMetaTileEntity.getMetaIDOffset(xDir + x, aY, zDir + z); if (aCurrentBlock == aBlock && + * aCurrentMeta == aMeta) { aCasingCount++; } final IGregTechTileEntity tTileEntity = + * aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, aY, zDir + z); if (!isValidBlockForStructure(tTileEntity, + * CASING_TEXTURE_ID, false, aCurrentBlock, aCurrentMeta, aBlock, aMeta)) { log("Layer has error. Height: "+aY); + * //this.getBaseMetaTileEntity().getWorld().setBlock(aOffsetX, aOffsetY, aOffsetZ, aBlock, aMeta, 3); return 0; } } } + * return aCasingCount; } public int checkIntegralRing(IGregTechTileEntity aBaseMetaTileEntity, Block aBlock, int aMeta, + * int aY, int xDir, int zDir) { int aCasingCount = 0; for (int x = -3; x < 4; x++) { for (int z = -3; z < 4; z++) { int + * aOffsetX = this.getBaseMetaTileEntity().getXCoord() + x; int aOffsetY = this.getBaseMetaTileEntity().getYCoord() + + * aY; int aOffsetZ = this.getBaseMetaTileEntity().getZCoord() + z; //Skip the corners if ((x == 3 && z == 3) || (x == + * -3 && z == -3) || (x == 3 && z == -3) || (x == -3 && z == 3)) { continue; } // If we are on the 5x5 ring, proceed if + * ((x > -3 && x < 3 ) && (z > -3 && z < 3)) { if ((x == 2 && z == 2) || (x == -2 && z == -2) || (x == 2 && z == -2) || + * (x == -2 && z == 2)) { //this.getBaseMetaTileEntity().getWorld().setBlock(aOffsetX, aOffsetY, aOffsetZ, aBlock, + * aMeta, 3); } else { continue; } } Block aCurrentBlock = aBaseMetaTileEntity.getBlockOffset(xDir + x, aY, zDir + z); + * int aCurrentMeta = (int) aBaseMetaTileEntity.getMetaIDOffset(xDir + x, aY, zDir + z); if (aCurrentBlock == aBlock && + * aCurrentMeta == aMeta) { aCasingCount++; } final IGregTechTileEntity tTileEntity = + * aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, aY, zDir + z); if (!isValidBlockForStructure(tTileEntity, + * CASING_TEXTURE_ID, false, aCurrentBlock, aCurrentMeta, aBlock, aMeta)) { log("Layer has error. Height: "+aY); + * //this.getBaseMetaTileEntity().getWorld().setBlock(aOffsetX, aOffsetY, aOffsetZ, aBlock, aMeta, 3); return 0; } } } + * return aCasingCount; } public int checkPipes(IGregTechTileEntity aBaseMetaTileEntity, Block aBlock, int aMeta, int + * aY, int xDir, int zDir) { int aCasingCount = 0; for (int x = -1; x < 2; x++) { for (int z = -1; z < 2; z++) { int + * aOffsetX = this.getBaseMetaTileEntity().getXCoord() + x; int aOffsetY = this.getBaseMetaTileEntity().getYCoord() + + * aY; int aOffsetZ = this.getBaseMetaTileEntity().getZCoord() + z; //Skip the corners if ((x == 1 && z == 1) || (x == + * -1 && z == -1) || (x == 1 && z == -1) || (x == -1 && z == 1) || (x == 0 && z == 0)) { Block aCurrentBlock = + * aBaseMetaTileEntity.getBlockOffset(xDir + x, aY, zDir + z); int aCurrentMeta = (int) + * aBaseMetaTileEntity.getMetaIDOffset(xDir + x, aY, zDir + z); if (aCurrentBlock == aBlock && aCurrentMeta == aMeta) { + * aCasingCount++; } final IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, + * aY, zDir + z); if (!isValidBlockForStructure(tTileEntity, CASING_TEXTURE_ID, false, aCurrentBlock, aCurrentMeta, + * aBlock, aMeta)) { log("Pipe has error. Height: "+aY); //this.getBaseMetaTileEntity().getWorld().setBlock(aOffsetX, + * aOffsetY, aOffsetZ, aBlock, aMeta, 3); return 0; }; } } } return aCasingCount; } public int + * checkContainmentRing(IGregTechTileEntity aBaseMetaTileEntity, Block aBlock, int aMeta, int aY, int xDir, int zDir) { + * int aCasingCount = 0; for (int x = -2; x < 3; x++) { for (int z = -2; z < 3; z++) { int aOffsetX = + * this.getBaseMetaTileEntity().getXCoord() + x; int aOffsetY = this.getBaseMetaTileEntity().getYCoord() + aY; int + * aOffsetZ = this.getBaseMetaTileEntity().getZCoord() + z; //Skip the corners if ((x == 2 && z == 2) || (x == -2 && z + * == -2) || (x == 2 && z == -2) || (x == -2 && z == 2)) { continue; } Block aCurrentBlock = + * aBaseMetaTileEntity.getBlockOffset(xDir + x, aY, zDir + z); int aCurrentMeta = (int) + * aBaseMetaTileEntity.getMetaIDOffset(xDir + x, aY, zDir + z); if (aCurrentBlock == aBlock && aCurrentMeta == aMeta) { + * aCasingCount++; } final IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, + * aY, zDir + z); if (!isValidBlockForStructure(tTileEntity, CASING_TEXTURE_ID, false, aCurrentBlock, aCurrentMeta, + * aBlock, aMeta)) { log("Layer has error. Height: "+aY); //this.getBaseMetaTileEntity().getWorld().setBlock(aOffsetX, + * aOffsetY, aOffsetZ, aBlock, aMeta, 3); return 0; } } } return aCasingCount; } public int getMaxEfficiency(ItemStack + * aStack) { return 10000; } public int getPollutionPerTick(ItemStack aStack) { return 133; } public int + * getDamageToComponent(ItemStack aStack) { return 0; } public boolean explodesOnComponentBreak(ItemStack aStack) { + * return false; } + * @Override public String getMachineType() { return "Reactor"; } } + */ diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_MiniFusionPlant.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_MiniFusionPlant.java index bdbedbc36e..753cbc9d4f 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_MiniFusionPlant.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_MiniFusionPlant.java @@ -1,351 +1,95 @@ /* -package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production; - - -public class GregtechMTE_MiniFusionPlant extends GregtechMeta_MultiBlockBase { - - public long currentVoltage = GT_Values.V[7]; - public byte currentTier = 8; - - public void upvolt() { - byte f = currentTier; - if ((f+1) > 10) { - f = 8; - } - else { - f++; - } - this.currentTier = f; - updateVoltage(); - } - - public void downvolt() { - byte f = currentTier; - if ((f-1) < 8) { - f = 10; - } - else { - f--; - } - this.currentTier = f; - updateVoltage(); - } - - private long updateVoltage() { - this.currentVoltage = GT_Values.V[this.currentTier-1]; - return currentVoltage; - } - - public GregtechMTE_MiniFusionPlant(String aName) { - super(aName); - } - - public GregtechMTE_MiniFusionPlant(int aID, String aName, String aNameRegional) { - super(aID, aName, aNameRegional); - } - - @Override - public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new GregtechMTE_MiniFusionPlant(this.mName); - } - - @Override - public boolean isCorrectMachinePart(ItemStack aStack) { - return true; - } - - @Override - public int getDamageToComponent(ItemStack aStack) { - return 0; - } - - @Override - public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing, - final byte aColorIndex, final boolean aActive, final boolean aRedstone) { - if (aSide == this.getBaseMetaTileEntity().getBackFacing()) { - return new ITexture[]{Textures.BlockIcons.getCasingTextureForId(TAE.GTPP_INDEX(10)), - Textures.BlockIcons.OVERLAYS_ENERGY_IN_MULTI[(int) this.getInputTier()]}; - } - if (aSide == 1) { - return new ITexture[]{Textures.BlockIcons.getCasingTextureForId(TAE.GTPP_INDEX(10)), - Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[(int) this.getOutputTier()]}; - } - if (aSide == aFacing) { - return new ITexture[]{Textures.BlockIcons.getCasingTextureForId(TAE.GTPP_INDEX(10)), - new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_DISASSEMBLER_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_DISASSEMBLER)}; - } - return new ITexture[]{Textures.BlockIcons.getCasingTextureForId(TAE.GTPP_INDEX(10))}; - } - - - @Override - public GT_Recipe.GT_Recipe_Map getRecipeMap() { - return GTPP_Recipe.GTPP_Recipe_Map.sSlowFusionRecipes; - } - - @Override - public String getMachineType() { - return "Fusion Reactor"; - } - - @Override - public String[] getTooltip() { - return new String[] { - "Small scale fusion", - "16x slower than using Multiblock of the same voltage", - //"Input voltage can be changed within the GUI", - "Place Input/Output Hatches on sides and bottom", - "Power can only be inserted into the back", - //e"Power can only be extracted from the top", - TAG_HIDE_HATCHES - }; - } - - @Override - public int getMaxParallelRecipes() { - return 1; - } - - @Override - public int getEuDiscountForParallelism() { - return 0; - } - - @Override - public boolean checkMultiblock(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) { - int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX; - int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ; - int xDir2 = ForgeDirection.getOrientation(aBaseMetaTileEntity.getFrontFacing()).offsetX; - int zDir2 = ForgeDirection.getOrientation(aBaseMetaTileEntity.getFrontFacing()).offsetZ; - int tAmount = 0; - - ForgeDirection aDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()); - - //Require air in front, I think - if (!aBaseMetaTileEntity.getAirOffset(xDir2, 0, zDir2)) { - Logger.INFO("Did not find air in front"); - return false; - } else { - for (int i = -1; i < 2; ++i) { - for (int j = -1; j < 2; ++j) { - for (int h = -1; h < 2; ++h) { - if (h != 0 || (xDir + i != 0 || zDir + j != 0) && (i != 0 || j != 0)) { - IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, - h, zDir + j); - if (this.addToMachineList(tTileEntity, TAE.GTPP_INDEX(10))) { - tAmount++; - } - } - } - } - } - } - Logger.INFO("Tanks found: "+tAmount); - return tAmount == 3; - } - - @Override - public boolean checkRecipe(ItemStack arg0) { - - - ArrayList tFluidList = this.getStoredFluids(); - int tFluidList_sS = tFluidList.size(); - - for (int tFluids = 0; tFluids < tFluidList_sS - 1; ++tFluids) { - for (int tRecipe = tFluids + 1; tRecipe < tFluidList_sS; ++tRecipe) { - if (GT_Utility.areFluidsEqual((FluidStack) tFluidList.get(tFluids), - (FluidStack) tFluidList.get(tRecipe))) { - if (((FluidStack) tFluidList.get(tFluids)).amount < ((FluidStack) tFluidList.get(tRecipe)).amount) { - tFluidList.remove(tFluids--); - tFluidList_sS = tFluidList.size(); - break; - } - - tFluidList.remove(tRecipe--); - tFluidList_sS = tFluidList.size(); - } - } - } - int aStep = 0; - //Logger.INFO("Step "+aStep++); - if (tFluidList.size() > 1) { - //Logger.INFO("Step "+aStep++); - FluidStack[] arg5 = (FluidStack[]) tFluidList.toArray(new FluidStack[tFluidList.size()]); - GT_Recipe arg6 = getRecipeMap().findRecipe(this.getBaseMetaTileEntity(), this.mLastRecipe, - false, this.getMaxInputVoltage(), arg5, new ItemStack[0]); - if (arg6 == null && !this.mRunningOnLoad || (arg6 != null && this.maxEUStore() < (long) arg6.mSpecialValue)) { - //Logger.INFO("Bad Step "+aStep++); - //this.turnCasingActive(false); - this.mLastRecipe = null; - return false; - } - //Logger.INFO("Step "+aStep++); - - if (this.mRunningOnLoad || (arg6 != null && arg6.isRecipeInputEqual(true, arg5, new ItemStack[0]))) { - //Logger.INFO("Step "+aStep++); - this.mLastRecipe = arg6; - this.mEUt = this.mLastRecipe.mEUt * 1; - this.mMaxProgresstime = this.mLastRecipe.mDuration / 1; - this.mEfficiencyIncrease = 10000; - this.mOutputFluids = this.mLastRecipe.mFluidOutputs; - //this.turnCasingActive(true); - this.mRunningOnLoad = false; - return true; - } - //Logger.INFO("Step "+aStep++); - } - //Logger.INFO("Step "+aStep++); - - return false; - - - - - //return this.checkRecipeGeneric(this.getMaxParallelRecipes(), getEuDiscountForParallelism(), 0); - } - - @Override - public int getMaxEfficiency(ItemStack arg0) { - return 10000; - } - - @Override - public boolean drainEnergyInput(long aEU) { - // Not applicable to this machine - return true; - } - - @Override - public boolean addEnergyOutput(long aEU) { - // Not applicable to this machine - return true; - } - - @Override - public long maxEUStore() { - return this.getMaxInputVoltage() * 256 * 512; - } - - @Override - public long getMinimumStoredEU() { - return 0; - } - - @Override - public String[] getExtraInfoData() { - String mode = EnumChatFormatting.BLUE + "" + currentVoltage + EnumChatFormatting.RESET; - String aOutput = EnumChatFormatting.BLUE + "" + mEUt + EnumChatFormatting.RESET; - String storedEnergyText; - if (this.getEUVar() > maxEUStore()) { - storedEnergyText = EnumChatFormatting.RED + GT_Utility.formatNumbers(this.getEUVar()) + EnumChatFormatting.RESET; - } else { - storedEnergyText = EnumChatFormatting.GREEN + GT_Utility.formatNumbers(this.getEUVar()) + EnumChatFormatting.RESET; - } - - return new String[]{ - "Stored EU: " + storedEnergyText, - "Capacity: " + EnumChatFormatting.YELLOW + GT_Utility.formatNumbers(this.maxEUStore()) + EnumChatFormatting.RESET, - "Voltage: " + mode, - "Output Voltage: " + aOutput - }; - } - - @Override - public void explodeMultiblock() { - super.explodeMultiblock(); - } - - @Override - public void doExplosion(long aExplosionPower) { - super.doExplosion(aExplosionPower); - } - - @Override - public long getMaxInputVoltage() { - return updateVoltage(); - } - - @Override - public long getInputTier() { - return (long) GT_Utility.getTier(maxEUInput()); - } - - @Override - public boolean isElectric() { - return true; - } - - @Override - public boolean isEnetInput() { - return true; - } - - @Override - public boolean isEnetOutput() { - return false; - } - - @Override - public boolean isInputFacing(byte aSide) { - return (aSide == this.getBaseMetaTileEntity().getBackFacing()); - } - - @Override - public boolean isOutputFacing(byte aSide) { - return aSide == 1; - } - - @Override - public long maxAmperesIn() { - return 32; - } - - @Override - public long maxAmperesOut() { - return 1; - } - - @Override - public long maxEUInput() { - return updateVoltage(); - } - - @Override - public long maxEUOutput() { - return mEUt > 0 ? mEUt : 0; - } - - @Override - public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { - super.onPostTick(aBaseMetaTileEntity, aTick); - this.mWrench = true; - this.mScrewdriver = true; - this.mSoftHammer = true; - this.mHardHammer = true; - this.mSolderingTool = true; - this.mCrowbar = true; - } - - @Override - public boolean causeMaintenanceIssue() { - return true; - } - - @Override - public int getControlCoreTier() { - return this.currentTier; - } - - @Override - public int getPollutionPerTick(ItemStack arg0) { - return 0; - } - - @Override - public GT_MetaTileEntity_Hatch_ControlCore getControlCoreBus() { - GT_MetaTileEntity_Hatch_ControlCore x = new GT_MetaTileEntity_Hatch_ControlCore("", 0, "", null); - return (GT_MetaTileEntity_Hatch_ControlCore) x; - } - -} -*/ + * package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production; public class + * GregtechMTE_MiniFusionPlant extends GregtechMeta_MultiBlockBase { public long currentVoltage = GT_Values.V[7]; public + * byte currentTier = 8; public void upvolt() { byte f = currentTier; if ((f+1) > 10) { f = 8; } else { f++; } + * this.currentTier = f; updateVoltage(); } public void downvolt() { byte f = currentTier; if ((f-1) < 8) { f = 10; } + * else { f--; } this.currentTier = f; updateVoltage(); } private long updateVoltage() { this.currentVoltage = + * GT_Values.V[this.currentTier-1]; return currentVoltage; } public GregtechMTE_MiniFusionPlant(String aName) { + * super(aName); } public GregtechMTE_MiniFusionPlant(int aID, String aName, String aNameRegional) { super(aID, aName, + * aNameRegional); } + * @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new + * GregtechMTE_MiniFusionPlant(this.mName); } + * @Override public boolean isCorrectMachinePart(ItemStack aStack) { return true; } + * @Override public int getDamageToComponent(ItemStack aStack) { return 0; } + * @Override public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte + * aFacing, final byte aColorIndex, final boolean aActive, final boolean aRedstone) { if (aSide == + * this.getBaseMetaTileEntity().getBackFacing()) { return new + * ITexture[]{Textures.BlockIcons.getCasingTextureForId(TAE.GTPP_INDEX(10)), + * Textures.BlockIcons.OVERLAYS_ENERGY_IN_MULTI[(int) this.getInputTier()]}; } if (aSide == 1) { return new + * ITexture[]{Textures.BlockIcons.getCasingTextureForId(TAE.GTPP_INDEX(10)), + * Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[(int) this.getOutputTier()]}; } if (aSide == aFacing) { return new + * ITexture[]{Textures.BlockIcons.getCasingTextureForId(TAE.GTPP_INDEX(10)), new GT_RenderedTexture(aActive ? + * Textures.BlockIcons.OVERLAY_FRONT_DISASSEMBLER_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_DISASSEMBLER)}; } return + * new ITexture[]{Textures.BlockIcons.getCasingTextureForId(TAE.GTPP_INDEX(10))}; } + * @Override public GT_Recipe.GT_Recipe_Map getRecipeMap() { return GTPP_Recipe.GTPP_Recipe_Map.sSlowFusionRecipes; } + * @Override public String getMachineType() { return "Fusion Reactor"; } + * @Override public String[] getTooltip() { return new String[] { "Small scale fusion", + * "16x slower than using Multiblock of the same voltage", //"Input voltage can be changed within the GUI", + * "Place Input/Output Hatches on sides and bottom", "Power can only be inserted into the back", + * //e"Power can only be extracted from the top", TAG_HIDE_HATCHES }; } + * @Override public int getMaxParallelRecipes() { return 1; } + * @Override public int getEuDiscountForParallelism() { return 0; } + * @Override public boolean checkMultiblock(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) { int xDir = + * ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX; int zDir = + * ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ; int xDir2 = + * ForgeDirection.getOrientation(aBaseMetaTileEntity.getFrontFacing()).offsetX; int zDir2 = + * ForgeDirection.getOrientation(aBaseMetaTileEntity.getFrontFacing()).offsetZ; int tAmount = 0; ForgeDirection aDir = + * ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()); //Require air in front, I think if + * (!aBaseMetaTileEntity.getAirOffset(xDir2, 0, zDir2)) { Logger.INFO("Did not find air in front"); return false; } else + * { for (int i = -1; i < 2; ++i) { for (int j = -1; j < 2; ++j) { for (int h = -1; h < 2; ++h) { if (h != 0 || (xDir + + * i != 0 || zDir + j != 0) && (i != 0 || j != 0)) { IGregTechTileEntity tTileEntity = + * aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, h, zDir + j); if (this.addToMachineList(tTileEntity, + * TAE.GTPP_INDEX(10))) { tAmount++; } } } } } } Logger.INFO("Tanks found: "+tAmount); return tAmount == 3; } + * @Override public boolean checkRecipe(ItemStack arg0) { ArrayList tFluidList = this.getStoredFluids(); int + * tFluidList_sS = tFluidList.size(); for (int tFluids = 0; tFluids < tFluidList_sS - 1; ++tFluids) { for (int tRecipe = + * tFluids + 1; tRecipe < tFluidList_sS; ++tRecipe) { if (GT_Utility.areFluidsEqual((FluidStack) + * tFluidList.get(tFluids), (FluidStack) tFluidList.get(tRecipe))) { if (((FluidStack) tFluidList.get(tFluids)).amount < + * ((FluidStack) tFluidList.get(tRecipe)).amount) { tFluidList.remove(tFluids--); tFluidList_sS = tFluidList.size(); + * break; } tFluidList.remove(tRecipe--); tFluidList_sS = tFluidList.size(); } } } int aStep = 0; + * //Logger.INFO("Step "+aStep++); if (tFluidList.size() > 1) { //Logger.INFO("Step "+aStep++); FluidStack[] arg5 = + * (FluidStack[]) tFluidList.toArray(new FluidStack[tFluidList.size()]); GT_Recipe arg6 = + * getRecipeMap().findRecipe(this.getBaseMetaTileEntity(), this.mLastRecipe, false, this.getMaxInputVoltage(), arg5, new + * ItemStack[0]); if (arg6 == null && !this.mRunningOnLoad || (arg6 != null && this.maxEUStore() < (long) + * arg6.mSpecialValue)) { //Logger.INFO("Bad Step "+aStep++); //this.turnCasingActive(false); this.mLastRecipe = null; + * return false; } //Logger.INFO("Step "+aStep++); if (this.mRunningOnLoad || (arg6 != null && + * arg6.isRecipeInputEqual(true, arg5, new ItemStack[0]))) { //Logger.INFO("Step "+aStep++); this.mLastRecipe = arg6; + * this.mEUt = this.mLastRecipe.mEUt * 1; this.mMaxProgresstime = this.mLastRecipe.mDuration / 1; + * this.mEfficiencyIncrease = 10000; this.mOutputFluids = this.mLastRecipe.mFluidOutputs; //this.turnCasingActive(true); + * this.mRunningOnLoad = false; return true; } //Logger.INFO("Step "+aStep++); } //Logger.INFO("Step "+aStep++); return + * false; //return this.checkRecipeGeneric(this.getMaxParallelRecipes(), getEuDiscountForParallelism(), 0); } + * @Override public int getMaxEfficiency(ItemStack arg0) { return 10000; } + * @Override public boolean drainEnergyInput(long aEU) { // Not applicable to this machine return true; } + * @Override public boolean addEnergyOutput(long aEU) { // Not applicable to this machine return true; } + * @Override public long maxEUStore() { return this.getMaxInputVoltage() * 256 * 512; } + * @Override public long getMinimumStoredEU() { return 0; } + * @Override public String[] getExtraInfoData() { String mode = EnumChatFormatting.BLUE + "" + currentVoltage + + * EnumChatFormatting.RESET; String aOutput = EnumChatFormatting.BLUE + "" + mEUt + EnumChatFormatting.RESET; String + * storedEnergyText; if (this.getEUVar() > maxEUStore()) { storedEnergyText = EnumChatFormatting.RED + + * GT_Utility.formatNumbers(this.getEUVar()) + EnumChatFormatting.RESET; } else { storedEnergyText = + * EnumChatFormatting.GREEN + GT_Utility.formatNumbers(this.getEUVar()) + EnumChatFormatting.RESET; } return new + * String[]{ "Stored EU: " + storedEnergyText, "Capacity: " + EnumChatFormatting.YELLOW + + * GT_Utility.formatNumbers(this.maxEUStore()) + EnumChatFormatting.RESET, "Voltage: " + mode, "Output Voltage: " + + * aOutput }; } + * @Override public void explodeMultiblock() { super.explodeMultiblock(); } + * @Override public void doExplosion(long aExplosionPower) { super.doExplosion(aExplosionPower); } + * @Override public long getMaxInputVoltage() { return updateVoltage(); } + * @Override public long getInputTier() { return (long) GT_Utility.getTier(maxEUInput()); } + * @Override public boolean isElectric() { return true; } + * @Override public boolean isEnetInput() { return true; } + * @Override public boolean isEnetOutput() { return false; } + * @Override public boolean isInputFacing(byte aSide) { return (aSide == this.getBaseMetaTileEntity().getBackFacing()); + * } + * @Override public boolean isOutputFacing(byte aSide) { return aSide == 1; } + * @Override public long maxAmperesIn() { return 32; } + * @Override public long maxAmperesOut() { return 1; } + * @Override public long maxEUInput() { return updateVoltage(); } + * @Override public long maxEUOutput() { return mEUt > 0 ? mEUt : 0; } + * @Override public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { + * super.onPostTick(aBaseMetaTileEntity, aTick); this.mWrench = true; this.mScrewdriver = true; this.mSoftHammer = true; + * this.mHardHammer = true; this.mSolderingTool = true; this.mCrowbar = true; } + * @Override public boolean causeMaintenanceIssue() { return true; } + * @Override public int getControlCoreTier() { return this.currentTier; } + * @Override public int getPollutionPerTick(ItemStack arg0) { return 0; } + * @Override public GT_MetaTileEntity_Hatch_ControlCore getControlCoreBus() { GT_MetaTileEntity_Hatch_ControlCore x = + * new GT_MetaTileEntity_Hatch_ControlCore("", 0, "", null); return (GT_MetaTileEntity_Hatch_ControlCore) x; } } + */ diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_NuclearReactor.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_NuclearReactor.java index d71e4d7933..42cd033829 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_NuclearReactor.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_NuclearReactor.java @@ -8,10 +8,17 @@ import static gregtech.api.enums.GT_HatchElement.*; import static gregtech.api.util.GT_StructureUtility.buildHatchAdder; import static gregtech.api.util.GT_StructureUtility.filterByMTETier; +import java.util.Collection; + +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraftforge.fluids.FluidStack; + import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable; import com.gtnewhorizon.structurelib.structure.IStructureDefinition; import com.gtnewhorizon.structurelib.structure.ISurvivalBuildEnvironment; import com.gtnewhorizon.structurelib.structure.StructureDefinition; + import gregtech.api.enums.TAE; import gregtech.api.enums.Textures; import gregtech.api.interfaces.ITexture; @@ -32,10 +39,6 @@ import gtPlusPlus.core.material.ELEMENT; import gtPlusPlus.core.material.nuclear.NUCLIDE; import gtPlusPlus.core.util.math.MathUtils; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase; -import java.util.Collection; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraftforge.fluids.FluidStack; public class GregtechMTE_NuclearReactor extends GregtechMeta_MultiBlockBase<GregtechMTE_NuclearReactor> implements ISurvivalConstructable { @@ -71,48 +74,34 @@ public class GregtechMTE_NuclearReactor extends GregtechMeta_MultiBlockBase<Greg @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType(getMachineType()) - .addInfo("Controller Block for the Liquid Fluoride Thorium Reactor.") + tt.addMachineType(getMachineType()).addInfo("Controller Block for the Liquid Fluoride Thorium Reactor.") .addInfo("Produces Heat & Energy from Radioactive Beta Decay.") .addInfo("Input Li2BeF4 and a molten salt as fuel, and match the 4 Dynamo Hatches:") .addInfo("LFTR Fuel 1 (4 IV amps), LFTR Fuel 2 (4 LuV amps), LFTR Fuel 3 (4 ZPM amps)") .addInfo("Outputs U233 every 10 seconds, on average, while the reactor is running") .addInfo("Check NEI to see the other outputs - they differ between fuels") - .addPollutionAmount(getPollutionPerSecond(null)) - .addSeparator() - .beginStructureBlock(7, 4, 7, true) - .addController("Bottom Center") - .addCasingInfo("Hastelloy-N Reactor Casing", 27) - .addCasingInfo("Zeron-100 Reactor Shielding", 26) - .addInputHatch("Top or bottom layer edges", 1) - .addOutputHatch("Top or bottom layer edges", 1) - .addDynamoHatch("Top or bottom layer edges", 1) - .addMaintenanceHatch("Top or bottom layer edges", 1) - .addMufflerHatch("Top 3x3", 2) + .addPollutionAmount(getPollutionPerSecond(null)).addSeparator().beginStructureBlock(7, 4, 7, true) + .addController("Bottom Center").addCasingInfo("Hastelloy-N Reactor Casing", 27) + .addCasingInfo("Zeron-100 Reactor Shielding", 26).addInputHatch("Top or bottom layer edges", 1) + .addOutputHatch("Top or bottom layer edges", 1).addDynamoHatch("Top or bottom layer edges", 1) + .addMaintenanceHatch("Top or bottom layer edges", 1).addMufflerHatch("Top 3x3", 2) .addStructureInfo("All dynamos must be between EV and LuV tier.") .addStructureInfo("All other hatches must be IV+ tier.") .addStructureInfo("3x Output Hatches, 2x Input Hatches, 4x Dynamo Hatches") - .addStructureInfo("2x Maintenance Hatches, 4x Mufflers") - .toolTipFinisher(CORE.GT_Tooltip_Builder); + .addStructureInfo("2x Maintenance Hatches, 4x Mufflers").toolTipFinisher(CORE.GT_Tooltip_Builder); return tt; } @Override public String[] getExtraInfoData() { final String tRunning = (this.mMaxProgresstime > 0 ? "Reactor running" : "Reactor stopped"); - final String tMaintainance = - (this.getIdealStatus() == this.getRepairStatus() ? "No Maintainance issues" : "Needs Maintainance"); + final String tMaintainance = (this.getIdealStatus() == this.getRepairStatus() ? "No Maintainance issues" + : "Needs Maintainance"); - return new String[] { - "Liquid Fluoride Thorium Reactor", - tRunning, - tMaintainance, - "Current Output: " + this.lEUt + " EU/t", - "Fuel Remaining: " + this.mFuelRemaining + " Litres", - "Current Efficiency: " + (this.mEfficiency / 5) + "%", - "Current Efficiency (Raw): " + (this.mEfficiency), - "It requires you to have 100% Efficiency." - }; + return new String[] { "Liquid Fluoride Thorium Reactor", tRunning, tMaintainance, + "Current Output: " + this.lEUt + " EU/t", "Fuel Remaining: " + this.mFuelRemaining + " Litres", + "Current Efficiency: " + (this.mEfficiency / 5) + "%", + "Current Efficiency (Raw): " + (this.mEfficiency), "It requires you to have 100% Efficiency." }; } @Override @@ -121,54 +110,29 @@ public class GregtechMTE_NuclearReactor extends GregtechMeta_MultiBlockBase<Greg } @Override - public ITexture[] getTexture( - final IGregTechTileEntity aBaseMetaTileEntity, - final byte aSide, - final byte aFacing, - final byte aColorIndex, - final boolean aActive, - final boolean aRedstone) { + public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing, + final byte aColorIndex, final boolean aActive, final boolean aRedstone) { boolean aWarmedUp = this.mEfficiency == this.getMaxEfficiency(null); if (!aBaseMetaTileEntity.isActive() || !aWarmedUp) { if (aSide == aFacing) { - if (aActive) - return new ITexture[] { - Textures.BlockIcons.getCasingTextureForId(TAE.GTPP_INDEX(12)), - TextureFactory.builder() - .addIcon(Textures.BlockIcons.OVERLAY_FRONT_REPLICATOR_ACTIVE) - .extFacing() - .build() - }; - return new ITexture[] { - Textures.BlockIcons.getCasingTextureForId(TAE.GTPP_INDEX(12)), - TextureFactory.builder() - .addIcon(Textures.BlockIcons.OVERLAY_FRONT_REPLICATOR) - .extFacing() - .build() - }; + if (aActive) return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(TAE.GTPP_INDEX(12)), + TextureFactory.builder().addIcon(Textures.BlockIcons.OVERLAY_FRONT_REPLICATOR_ACTIVE) + .extFacing().build() }; + return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(TAE.GTPP_INDEX(12)), TextureFactory + .builder().addIcon(Textures.BlockIcons.OVERLAY_FRONT_REPLICATOR).extFacing().build() }; } - return new ITexture[] {Textures.BlockIcons.getCasingTextureForId(TAE.GTPP_INDEX(12))}; + return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(TAE.GTPP_INDEX(12)) }; } else if (aBaseMetaTileEntity.isActive() && aWarmedUp) { if (aSide == aFacing) { - if (aActive) - return new ITexture[] { - Textures.BlockIcons.getCasingTextureForId(TAE.GTPP_INDEX(13)), - TextureFactory.builder() - .addIcon(Textures.BlockIcons.OVERLAY_FRONT_REPLICATOR_ACTIVE) - .extFacing() - .build() - }; - return new ITexture[] { - Textures.BlockIcons.getCasingTextureForId(TAE.GTPP_INDEX(13)), - TextureFactory.builder() - .addIcon(Textures.BlockIcons.OVERLAY_FRONT_REPLICATOR) - .extFacing() - .build() - }; + if (aActive) return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(TAE.GTPP_INDEX(13)), + TextureFactory.builder().addIcon(Textures.BlockIcons.OVERLAY_FRONT_REPLICATOR_ACTIVE) + .extFacing().build() }; + return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(TAE.GTPP_INDEX(13)), TextureFactory + .builder().addIcon(Textures.BlockIcons.OVERLAY_FRONT_REPLICATOR).extFacing().build() }; } - return new ITexture[] {Textures.BlockIcons.getCasingTextureForId(TAE.GTPP_INDEX(13))}; + return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(TAE.GTPP_INDEX(13)) }; } - return new ITexture[] {Textures.BlockIcons.getCasingTextureForId(TAE.GTPP_INDEX(12))}; + return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(TAE.GTPP_INDEX(12)) }; } public final boolean addNuclearReactorEdgeList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { @@ -181,14 +145,16 @@ public class GregtechMTE_NuclearReactor extends GregtechMeta_MultiBlockBase<Greg } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Dynamo && (((GT_MetaTileEntity_Hatch_Dynamo) aMetaTileEntity).mTier >= 4 && ((GT_MetaTileEntity_Hatch_Dynamo) aMetaTileEntity).mTier <= 6)) { - return addToMachineList(aTileEntity, aBaseCasingIndex); - } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input - && ((GT_MetaTileEntity_Hatch_Input) aMetaTileEntity).mTier >= 5) { - return addToMachineList(aTileEntity, aBaseCasingIndex); - } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Output - && ((GT_MetaTileEntity_Hatch_Output) aMetaTileEntity).mTier >= 5) { - return addToMachineList(aTileEntity, aBaseCasingIndex); - } + return addToMachineList(aTileEntity, aBaseCasingIndex); + } else + if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input + && ((GT_MetaTileEntity_Hatch_Input) aMetaTileEntity).mTier >= 5) { + return addToMachineList(aTileEntity, aBaseCasingIndex); + } else + if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Output + && ((GT_MetaTileEntity_Hatch_Output) aMetaTileEntity).mTier >= 5) { + return addToMachineList(aTileEntity, aBaseCasingIndex); + } } return false; } @@ -209,49 +175,37 @@ public class GregtechMTE_NuclearReactor extends GregtechMeta_MultiBlockBase<Greg @Override public IStructureDefinition<GregtechMTE_NuclearReactor> getStructureDefinition() { if (STRUCTURE_DEFINITION == null) { - STRUCTURE_DEFINITION = StructureDefinition.<GregtechMTE_NuclearReactor>builder() - .addShape(mName, transpose(new String[][] { - {"CCCCCCC", "COOOOOC", "COXXXOC", "COXXXOC", "COXXXOC", "COOOOOC", "CCCCCCC"}, - {"GGGGGGG", "G-----G", "G-----G", "G-----G", "G-----G", "G-----G", "GGGGGGG"}, - {"GGGGGGG", "G-----G", "G-----G", "G-----G", "G-----G", "G-----G", "GGGGGGG"}, - {"CCC~CCC", "COOOOOC", "COOOOOC", "COOOOOC", "COOOOOC", "COOOOOC", "CCCCCCC"}, - })) + STRUCTURE_DEFINITION = StructureDefinition.<GregtechMTE_NuclearReactor>builder().addShape( + mName, + transpose( + new String[][] { + { "CCCCCCC", "COOOOOC", "COXXXOC", "COXXXOC", "COXXXOC", "COOOOOC", "CCCCCCC" }, + { "GGGGGGG", "G-----G", "G-----G", "G-----G", "G-----G", "G-----G", "GGGGGGG" }, + { "GGGGGGG", "G-----G", "G-----G", "G-----G", "G-----G", "G-----G", "GGGGGGG" }, + { "CCC~CCC", "COOOOOC", "COOOOOC", "COOOOOC", "COOOOOC", "COOOOOC", "CCCCCCC" }, })) .addElement( 'C', ofChain( - buildHatchAdder(GregtechMTE_NuclearReactor.class) - .atLeast(Maintenance) - .casingIndex(TAE.GTPP_INDEX(12)) - .dot(1) - .build(), - buildHatchAdder(GregtechMTE_NuclearReactor.class) - .atLeast(InputHatch, OutputHatch) + buildHatchAdder(GregtechMTE_NuclearReactor.class).atLeast(Maintenance) + .casingIndex(TAE.GTPP_INDEX(12)).dot(1).build(), + buildHatchAdder(GregtechMTE_NuclearReactor.class).atLeast(InputHatch, OutputHatch) .adder(GregtechMTE_NuclearReactor::addNuclearReactorEdgeList) .hatchItemFilterAnd(t -> filterByMTETier(5, Integer.MAX_VALUE)) - .casingIndex(TAE.GTPP_INDEX(12)) - .dot(1) - .build(), - buildHatchAdder(GregtechMTE_NuclearReactor.class) - .atLeast(Dynamo) + .casingIndex(TAE.GTPP_INDEX(12)).dot(1).build(), + buildHatchAdder(GregtechMTE_NuclearReactor.class).atLeast(Dynamo) .adder(GregtechMTE_NuclearReactor::addNuclearReactorEdgeList) .hatchItemFilterAnd(t -> filterByMTETier(4, 6)) - .casingIndex(TAE.GTPP_INDEX(12)) - .dot(1) - .build(), + .casingIndex(TAE.GTPP_INDEX(12)).dot(1).build(), onElementPass(x -> ++x.mCasing, ofBlock(ModBlocks.blockCasingsMisc, 12)))) .addElement( 'X', - buildHatchAdder(GregtechMTE_NuclearReactor.class) - .atLeast(Muffler) + buildHatchAdder(GregtechMTE_NuclearReactor.class).atLeast(Muffler) .adder(GregtechMTE_NuclearReactor::addNuclearReactorTopList) .hatchItemFilterAnd(t -> filterByMTETier(5, Integer.MAX_VALUE)) - .casingIndex(TAE.GTPP_INDEX(12)) - .dot(1) - .buildAndChain( + .casingIndex(TAE.GTPP_INDEX(12)).dot(1).buildAndChain( onElementPass(x -> ++x.mCasing, ofBlock(ModBlocks.blockCasingsMisc, 12)))) .addElement('O', ofBlock(ModBlocks.blockCasingsMisc, 12)) - .addElement('G', ofBlock(ModBlocks.blockCasingsMisc, 13)) - .build(); + .addElement('G', ofBlock(ModBlocks.blockCasingsMisc, 13)).build(); } return STRUCTURE_DEFINITION; } @@ -271,8 +225,7 @@ public class GregtechMTE_NuclearReactor extends GregtechMeta_MultiBlockBase<Greg public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) { mCasing = 0; if (checkPiece(mName, 3, 3, 0) && mCasing >= 27) { - if (mOutputHatches.size() >= 3 - && mInputHatches.size() >= 2 + if (mOutputHatches.size() >= 3 && mInputHatches.size() >= 2 && mDynamoHatches.size() == 4 && mMufflerHatches.size() == 4 && mMaintenanceHatches.size() == 2) { @@ -291,21 +244,15 @@ public class GregtechMTE_NuclearReactor extends GregtechMeta_MultiBlockBase<Greg // Alk's Life Lessons from Greg. /* - [23:41:15] <GregoriusTechneticies> xdir and zdir are x2 and not x3 - [23:41:26] <GregoriusTechneticies> thats you issue - [23:44:33] <Alkalus> mmm? - [23:44:49] <Alkalus> Should they be x3? - [23:44:50] <GregoriusTechneticies> you just do a x2, what is for a 5x5 multiblock - [23:45:01] <GregoriusTechneticies> x3 is for a 7x7 one - [23:45:06] <Alkalus> I have no idea what that value does, tbh.. - [23:45:15] <GregoriusTechneticies> its the offset - [23:45:23] <Alkalus> Debugging checkMachine has been a pain and I usually trash designs that don't work straight up.. - [23:45:28] <GregoriusTechneticies> it determines the horizontal middle of the multiblock - [23:45:47] <GregoriusTechneticies> which is in your case THREE blocks away from the controller - [23:45:51] <Alkalus> Ahh - [23:45:57] <GregoriusTechneticies> and not 2 - [23:46:06] <Alkalus> Noted, thanks :D - */ + * [23:41:15] <GregoriusTechneticies> xdir and zdir are x2 and not x3 [23:41:26] <GregoriusTechneticies> thats you + * issue [23:44:33] <Alkalus> mmm? [23:44:49] <Alkalus> Should they be x3? [23:44:50] <GregoriusTechneticies> you + * just do a x2, what is for a 5x5 multiblock [23:45:01] <GregoriusTechneticies> x3 is for a 7x7 one [23:45:06] + * <Alkalus> I have no idea what that value does, tbh.. [23:45:15] <GregoriusTechneticies> its the offset [23:45:23] + * <Alkalus> Debugging checkMachine has been a pain and I usually trash designs that don't work straight up.. + * [23:45:28] <GregoriusTechneticies> it determines the horizontal middle of the multiblock [23:45:47] + * <GregoriusTechneticies> which is in your case THREE blocks away from the controller [23:45:51] <Alkalus> Ahh + * [23:45:57] <GregoriusTechneticies> and not 2 [23:46:06] <Alkalus> Noted, thanks :D + */ @Override public boolean isCorrectMachinePart(final ItemStack aStack) { @@ -412,8 +359,8 @@ public class GregtechMTE_NuclearReactor extends GregtechMeta_MultiBlockBase<Greg if (tFluids.length > 0 && tRecipeList != null && tRecipeList.size() > 0) { // Does input hatch have a LFTR fuel? Logger.WARNING("Found more than one input fluid and a list of valid recipes."); // Find a valid recipe - GT_Recipe aFuelProcessing = - this.findRecipe(getBaseMetaTileEntity(), mLastRecipe, true, 0, tFluids, new ItemStack[] {}); + GT_Recipe aFuelProcessing = this + .findRecipe(getBaseMetaTileEntity(), mLastRecipe, true, 0, tFluids, new ItemStack[] {}); if (aFuelProcessing == null) { Logger.WARNING("Did not find valid recipe for given inputs."); return false; diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntityGeneratorArray.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntityGeneratorArray.java index 279ab77b9c..3700b28ea1 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntityGeneratorArray.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntityGeneratorArray.java @@ -7,10 +7,16 @@ import static gregtech.api.enums.GT_HatchElement.*; import static gregtech.api.util.GT_StructureUtility.buildHatchAdder; import static gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase.GTPPHatchElement.TTDynamo; +import java.util.*; + +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidStack; + import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable; import com.gtnewhorizon.structurelib.structure.IStructureDefinition; import com.gtnewhorizon.structurelib.structure.ISurvivalBuildEnvironment; import com.gtnewhorizon.structurelib.structure.StructureDefinition; + import gregtech.api.GregTech_API; import gregtech.api.interfaces.IIconContainer; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; @@ -23,9 +29,6 @@ import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.util.minecraft.gregtech.PollutionUtils; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; -import java.util.*; -import net.minecraft.item.ItemStack; -import net.minecraftforge.fluids.FluidStack; public class GregtechMetaTileEntityGeneratorArray extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntityGeneratorArray> implements ISurvivalConstructable { @@ -54,20 +57,13 @@ public class GregtechMetaTileEntityGeneratorArray @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType(getMachineType()) - .addInfo("Controller Block for the Generator Array") + tt.addMachineType(getMachineType()).addInfo("Controller Block for the Generator Array") .addInfo("Runs supplied generators as if placed in the world") - .addInfo("Place up to 16 Single Block GT Generators into the Controller") - .addSeparator() - .beginStructureBlock(3, 3, 3, true) - .addController("Front center") - .addCasingInfo("Robust Tungstensteel Machine Casings", 10) - .addInputBus("Any casing", 1) - .addOutputBus("Any casing", 1) - .addInputHatch("Any Casing", 1) - .addOutputHatch("Any Casing", 1) - .addDynamoHatch("Any casing", 1) - .addMaintenanceHatch("Any casing", 1) + .addInfo("Place up to 16 Single Block GT Generators into the Controller").addSeparator() + .beginStructureBlock(3, 3, 3, true).addController("Front center") + .addCasingInfo("Robust Tungstensteel Machine Casings", 10).addInputBus("Any casing", 1) + .addOutputBus("Any casing", 1).addInputHatch("Any Casing", 1).addOutputHatch("Any Casing", 1) + .addDynamoHatch("Any casing", 1).addMaintenanceHatch("Any casing", 1) .toolTipFinisher(CORE.GT_Tooltip_Builder); return tt; } @@ -141,16 +137,16 @@ public class GregtechMetaTileEntityGeneratorArray private static final int MODE_NAQUADAH = 9; private static final int MODE_NONE = 100; - private static final int[] ID_STEAM = new int[] {962, 1120, 1121, 1122}; - private static final int[] ID_GAS = new int[] {961, 1115, 1116, 1117}; - private static final int[] ID_DIESEL = new int[] {960, 1110, 1111, 1112}; - private static final int[] ID_SEMIFLUID = new int[] {837, 838, 839}; - private static final int[] ID_GEOTHERMAL = new int[] {830, 831, 832}; - private static final int[] ID_ROCKETFUEL = new int[] {793, 794, 795}; - private static final int[] ID_MAGIC_A = new int[] {1123, 1124, 1125}; - private static final int[] ID_MAGIC_B_DISABLED = new int[] {1127, 1128, 1129, 1130}; - private static final int[] ID_PLASMA = new int[] {1196, 1197, 1198}; - private static final int[] ID_NAQUADAH = new int[] {1190, 1191, 1192}; + private static final int[] ID_STEAM = new int[] { 962, 1120, 1121, 1122 }; + private static final int[] ID_GAS = new int[] { 961, 1115, 1116, 1117 }; + private static final int[] ID_DIESEL = new int[] { 960, 1110, 1111, 1112 }; + private static final int[] ID_SEMIFLUID = new int[] { 837, 838, 839 }; + private static final int[] ID_GEOTHERMAL = new int[] { 830, 831, 832 }; + private static final int[] ID_ROCKETFUEL = new int[] { 793, 794, 795 }; + private static final int[] ID_MAGIC_A = new int[] { 1123, 1124, 1125 }; + private static final int[] ID_MAGIC_B_DISABLED = new int[] { 1127, 1128, 1129, 1130 }; + private static final int[] ID_PLASMA = new int[] { 1196, 1197, 1198 }; + private static final int[] ID_NAQUADAH = new int[] { 1190, 1191, 1192 }; private static final int getModeFromInventorySlot(ItemStack aStack) { @@ -214,82 +210,40 @@ public class GregtechMetaTileEntityGeneratorArray public boolean checkRecipe(ItemStack aStack) { return false; - /** this.resetRecipeMapForAllInputHatches(); - * this.mMode = getModeFromInventorySlot(aStack); - * if (mMode == MODE_NONE) { - * Logger.INFO("Did not find valid generator."); - * return false; - * } - * else { - * Logger.INFO("Changed Mode to "+mMode); - * } - * int aMulti = this.getGUIItemStack() != null ? this.getGUIItemStack().stackSize : 0; - * if (aMulti > 16 || aMulti == 0) { - * return false; - * } + /** + * this.resetRecipeMapForAllInputHatches(); this.mMode = getModeFromInventorySlot(aStack); if (mMode == + * MODE_NONE) { Logger.INFO("Did not find valid generator."); return false; } else { Logger.INFO("Changed Mode + * to "+mMode); } int aMulti = this.getGUIItemStack() != null ? this.getGUIItemStack().stackSize : 0; if (aMulti + * > 16 || aMulti == 0) { return false; } * * * * ArrayList<FluidStack> tFluids = this.getStoredFluids(); * - * Collection<GT_Recipe> tRecipeList = this.getRecipeMap().mRecipeList; - * Logger.INFO("Got Recipe Map"); - * if (tFluids.size() > 0 && tRecipeList != null) { - * Logger.INFO("Found Fuels for Map."); - * Iterator<FluidStack> arg3 = tFluids.iterator(); - * int aCount = 0; - * while (arg3.hasNext()) { - * FluidStack hatchFluid1 = (FluidStack) arg3.next(); - * Logger.INFO("Iterating Fluid Found "+(aCount++)+" | "+hatchFluid1.getLocalizedName()); + * Collection<GT_Recipe> tRecipeList = this.getRecipeMap().mRecipeList; Logger.INFO("Got Recipe Map"); if + * (tFluids.size() > 0 && tRecipeList != null) { Logger.INFO("Found Fuels for Map."); Iterator<FluidStack> arg3 + * = tFluids.iterator(); int aCount = 0; while (arg3.hasNext()) { FluidStack hatchFluid1 = (FluidStack) + * arg3.next(); Logger.INFO("Iterating Fluid Found "+(aCount++)+" | "+hatchFluid1.getLocalizedName()); * Iterator<GT_Recipe> arg5 = tRecipeList.iterator(); * - * int Hatch = 0; - * int totalFuelValue = 0; - * while (arg5.hasNext()) { - * Logger.INFO("Iterating Recipe "+(Hatch++)); - * GT_Recipe aFuel = (GT_Recipe) arg5.next(); - * FluidStack tLiquid; - * boolean addedFuelOnce = false; - * for (int a = 0; a < aMulti; a++) { - * if ((tLiquid = GT_Utility.getFluidForFilledItem(aFuel.getRepresentativeInput(0), true)) != null - * && hatchFluid1.isFluidEqual(tLiquid)) { - * this.fuelConsumption = tLiquid.amount = this.boostEu - * ? 4096 / aFuel.mSpecialValue - * : 2048 / aFuel.mSpecialValue; - * if (this.depleteInput(tLiquid)) { - * Logger.INFO("Depleted Fuel"); - * this.boostEu = this.depleteInput(Materials.Oxygen.getGas(2L)); + * int Hatch = 0; int totalFuelValue = 0; while (arg5.hasNext()) { Logger.INFO("Iterating Recipe "+(Hatch++)); + * GT_Recipe aFuel = (GT_Recipe) arg5.next(); FluidStack tLiquid; boolean addedFuelOnce = false; for (int a = 0; + * a < aMulti; a++) { if ((tLiquid = GT_Utility.getFluidForFilledItem(aFuel.getRepresentativeInput(0), true)) != + * null && hatchFluid1.isFluidEqual(tLiquid)) { this.fuelConsumption = tLiquid.amount = this.boostEu ? 4096 / + * aFuel.mSpecialValue : 2048 / aFuel.mSpecialValue; if (this.depleteInput(tLiquid)) { Logger.INFO("Depleted + * Fuel"); this.boostEu = this.depleteInput(Materials.Oxygen.getGas(2L)); * - * /*if (!tFluids.contains(Materials.Lubricant.getFluid(1L))) { - * Logger.INFO("No Lube."); - * return false; - * }*/ + * /*if (!tFluids.contains(Materials.Lubricant.getFluid(1L))) { Logger.INFO("No Lube."); return false; } + */ /** * if (this.mRuntime % 72 == 0 || this.mRuntime == 0) { - * this.depleteInput(Materials.Lubricant.getFluid(this.boostEu ? 2L : 1L)); - * } - * Logger.INFO("ADDING POWER"); - * this.fuelRemaining = hatchFluid1.amount; - * totalFuelValue++; - * } - * } - * } - * //Do things after consuming Fuel - * if (totalFuelValue == aMulti) { - * this.fuelValue = aFuel.mSpecialValue*aMulti; - * this.mEUt = this.mEfficiency < 2000 ? 0 : aFuel.mSpecialValue*aMulti; - * this.mProgresstime = aMulti; - * this.mMaxProgresstime = aMulti; - * this.mEfficiencyIncrease = 15*aMulti; - * return true; - * } - * } - * } - * } + * this.depleteInput(Materials.Lubricant.getFluid(this.boostEu ? 2L : 1L)); } Logger.INFO("ADDING POWER"); + * this.fuelRemaining = hatchFluid1.amount; totalFuelValue++; } } } //Do things after consuming Fuel if + * (totalFuelValue == aMulti) { this.fuelValue = aFuel.mSpecialValue*aMulti; this.mEUt = this.mEfficiency < 2000 + * ? 0 : aFuel.mSpecialValue*aMulti; this.mProgresstime = aMulti; this.mMaxProgresstime = aMulti; + * this.mEfficiencyIncrease = 15*aMulti; return true; } } } } * - * this.mEUt = 0; - * this.mEfficiency = 0; - * return false; + * this.mEUt = 0; this.mEfficiency = 0; return false; **/ } @@ -303,25 +257,21 @@ public class GregtechMetaTileEntityGeneratorArray public IStructureDefinition<GregtechMetaTileEntityGeneratorArray> getStructureDefinition() { if (STRUCTURE_DEFINITION == null) { STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntityGeneratorArray>builder() - .addShape(mName, transpose(new String[][] { - {"CCC", "CCC", "CCC"}, - {"C~C", "C-C", "CCC"}, - {"CCC", "CCC", "CCC"}, - })) + .addShape( + mName, + transpose( + new String[][] { { "CCC", "CCC", "CCC" }, { "C~C", "C-C", "CCC" }, + { "CCC", "CCC", "CCC" }, })) .addElement( 'C', - buildHatchAdder(GregtechMetaTileEntityGeneratorArray.class) - .atLeast( - InputHatch, - OutputHatch, - InputBus, - OutputBus, - Maintenance, - Dynamo.or(TTDynamo), - Muffler) - .casingIndex(48) - .dot(1) - .buildAndChain( + buildHatchAdder(GregtechMetaTileEntityGeneratorArray.class).atLeast( + InputHatch, + OutputHatch, + InputBus, + OutputBus, + Maintenance, + Dynamo.or(TTDynamo), + Muffler).casingIndex(48).dot(1).buildAndChain( onElementPass(x -> ++x.mCasing, ofBlock(GregTech_API.sBlockCasings4, 0)))) .build(); } @@ -381,7 +331,7 @@ public class GregtechMetaTileEntityGeneratorArray } /** - * Code from single blocks + * Code from single blocks */ public void tryProcessFuelItems(IGregTechTileEntity aBaseMetaTileEntity, ItemStack a) { if (a != null @@ -410,9 +360,8 @@ public class GregtechMetaTileEntityGeneratorArray long tFluidAmountToUse = Math.min( (long) (mFluid.amount / tEmptyContainer), (this.maxEUStore() - aBaseMetaTileEntity.getUniversalEnergyStored()) / (long) tFuelValue); - if (tFluidAmountToUse > 0L - && aBaseMetaTileEntity.increaseStoredEnergyUnits( - tFluidAmountToUse * (long) tFuelValue, true)) { + if (tFluidAmountToUse > 0L && aBaseMetaTileEntity + .increaseStoredEnergyUnits(tFluidAmountToUse * (long) tFuelValue, true)) { PollutionUtils.addPollution(this.getBaseMetaTileEntity(), 10 * this.getPollutionPerTick(null)); mFluid.amount = (int) ((long) mFluid.amount - tFluidAmountToUse * (long) tEmptyContainer); } @@ -423,8 +372,8 @@ public class GregtechMetaTileEntityGeneratorArray } if (aBaseMetaTileEntity.isServerSide()) { - aBaseMetaTileEntity.setActive(aBaseMetaTileEntity.isAllowedToWork() - && aBaseMetaTileEntity.getUniversalEnergyStored() + aBaseMetaTileEntity.setActive( + aBaseMetaTileEntity.isAllowedToWork() && aBaseMetaTileEntity.getUniversalEnergyStored() >= this.maxEUOutput() + this.getMinimumStoredEU()); } } @@ -448,8 +397,7 @@ public class GregtechMetaTileEntityGeneratorArray FluidStack tLiquid; if ((tLiquid = GT_Utility.getFluidForFilledItem(tFuel.getRepresentativeInput(0), true)) != null && aLiquid.isFluidEqual(tLiquid)) { - return (int) ((long) tFuel.mSpecialValue - * (long) this.mEfficiency + return (int) ((long) tFuel.mSpecialValue * (long) this.mEfficiency * (long) this.consumedFluidPerOperation(tLiquid) / 100L); } @@ -464,11 +412,12 @@ public class GregtechMetaTileEntityGeneratorArray public int getFuelValue(ItemStack aStack) { if (!GT_Utility.isStackInvalid(aStack) && this.getRecipeMap() != null) { - GT_Recipe tFuel = this.getRecipeMap() - .findRecipe( - this.getBaseMetaTileEntity(), false, Long.MAX_VALUE, (FluidStack[]) null, new ItemStack[] { - aStack - }); + GT_Recipe tFuel = this.getRecipeMap().findRecipe( + this.getBaseMetaTileEntity(), + false, + Long.MAX_VALUE, + (FluidStack[]) null, + new ItemStack[] { aStack }); return tFuel != null ? (int) ((long) tFuel.mSpecialValue * 1000L * (long) this.mEfficiency / 100L) : 0; } else { return 0; @@ -477,13 +426,13 @@ public class GregtechMetaTileEntityGeneratorArray public ItemStack getEmptyContainer(ItemStack aStack) { if (!GT_Utility.isStackInvalid(aStack) && this.getRecipeMap() != null) { - GT_Recipe tFuel = this.getRecipeMap() - .findRecipe( - this.getBaseMetaTileEntity(), false, Long.MAX_VALUE, (FluidStack[]) null, new ItemStack[] { - aStack - }); - return tFuel != null - ? GT_Utility.copy(new Object[] {tFuel.getOutput(0)}) + GT_Recipe tFuel = this.getRecipeMap().findRecipe( + this.getBaseMetaTileEntity(), + false, + Long.MAX_VALUE, + (FluidStack[]) null, + new ItemStack[] { aStack }); + return tFuel != null ? GT_Utility.copy(new Object[] { tFuel.getOutput(0) }) : GT_Utility.getContainerItem(aStack, true); } else { return null; diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntityTreeFarm.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntityTreeFarm.java index bf3fbe0477..82f9f6b712 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntityTreeFarm.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntityTreeFarm.java @@ -7,10 +7,21 @@ import static gregtech.api.enums.GT_HatchElement.*; import static gregtech.api.util.GT_StructureUtility.buildHatchAdder; import static gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase.GTPPHatchElement.TTEnergy; +import java.util.ArrayList; +import java.util.HashMap; + +import javax.annotation.Nonnull; + +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidStack; + import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable; import com.gtnewhorizon.structurelib.structure.IStructureDefinition; import com.gtnewhorizon.structurelib.structure.ISurvivalBuildEnvironment; import com.gtnewhorizon.structurelib.structure.StructureDefinition; + import forestry.api.arboriculture.EnumTreeChromosome; import forestry.api.arboriculture.ITree; import forestry.api.arboriculture.TreeManager; @@ -38,20 +49,13 @@ import gtPlusPlus.core.util.minecraft.MaterialUtils; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; import gtPlusPlus.xmod.gregtech.common.helpers.TreeFarmHelper; -import java.util.ArrayList; -import java.util.HashMap; -import javax.annotation.Nonnull; -import net.minecraft.init.Blocks; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraftforge.fluids.FluidStack; public class GregtechMetaTileEntityTreeFarm extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntityTreeFarm> implements ISurvivalConstructable { public static int CASING_TEXTURE_ID; public static String mCasingName = "Sterile Farm Casing"; - // public static TreeGenerator mTreeData; + // public static TreeGenerator mTreeData; public static HashMap<String, ItemStack> sLogCache = new HashMap<>(); private static final int TICKS_PER_OPERATION = 100; @@ -87,31 +91,19 @@ public class GregtechMetaTileEntityTreeFarm extends GregtechMeta_MultiBlockBase< @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType(getMachineType()) - .addInfo("Converts EU to Logs") - .addInfo("Eu Usage: 100% | Parallel: 1") - .addInfo("Requires a Saw or Chainsaw in GUI slot") - .addInfo("Output multiplier:") - .addInfo("Saw = 1x") - .addInfo("Buzzsaw = 2x") - .addInfo("Chainsaw = 4x") + tt.addMachineType(getMachineType()).addInfo("Converts EU to Logs").addInfo("Eu Usage: 100% | Parallel: 1") + .addInfo("Requires a Saw or Chainsaw in GUI slot").addInfo("Output multiplier:").addInfo("Saw = 1x") + .addInfo("Buzzsaw = 2x").addInfo("Chainsaw = 4x") .addInfo("Add a sapling in the input bus to select wood type output") .addInfo("Tools can also be fed to the controller via input bus") .addInfo("The working speed is fixed for 5s") .addInfo("Production Formula: (2 * tier^2 - 2 * tier + 5) * 5 * saw boost") .addInfo("When fertilizer is insufficient, sapling production reduced to one-tenth") .addInfo("Forestry saplings can get increased production") - .addPollutionAmount(getPollutionPerSecond(null)) - .addSeparator() - .beginStructureBlock(3, 3, 3, true) - .addController("Front center") - .addCasingInfo("Sterile Farm Casing", 8) - .addInputBus("Any casing", 1) - .addOutputBus("Any casing", 1) - .addEnergyHatch("Any casing", 1) - .addMaintenanceHatch("Any casing", 1) - .addMufflerHatch("Any casing", 1) - .toolTipFinisher(CORE.GT_Tooltip_Builder); + .addPollutionAmount(getPollutionPerSecond(null)).addSeparator().beginStructureBlock(3, 3, 3, true) + .addController("Front center").addCasingInfo("Sterile Farm Casing", 8).addInputBus("Any casing", 1) + .addOutputBus("Any casing", 1).addEnergyHatch("Any casing", 1).addMaintenanceHatch("Any casing", 1) + .addMufflerHatch("Any casing", 1).toolTipFinisher(CORE.GT_Tooltip_Builder); return tt; } @@ -142,6 +134,7 @@ public class GregtechMetaTileEntityTreeFarm extends GregtechMeta_MultiBlockBase< /** * Method used to get the boost based on the ordinal of the saw + * * @param sawType type of the saw * @return an int corresponding to the boost */ @@ -168,8 +161,8 @@ public class GregtechMetaTileEntityTreeFarm extends GregtechMeta_MultiBlockBase< long tVoltage = getMaxInputVoltage(); byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage)); - int aOutputAmount = - ((2 * (tTier * tTier)) - (2 * tTier) + 5) * (TICKS_PER_OPERATION / 20) * getSawBoost(mToolType); + int aOutputAmount = ((2 * (tTier * tTier)) - (2 * tTier) + 5) * (TICKS_PER_OPERATION / 20) + * getSawBoost(mToolType); int aFert = hasLiquidFert(); ItemStack[] toOutput; @@ -178,10 +171,10 @@ public class GregtechMetaTileEntityTreeFarm extends GregtechMeta_MultiBlockBase< aOutputAmount /= 10; } int amplifiedOutputAmount = (int) (aOutputAmount * saplingsModifier); - toOutput = new ItemStack[] {ItemUtils.getSimpleStack(mSapling, amplifiedOutputAmount)}; + toOutput = new ItemStack[] { ItemUtils.getSimpleStack(mSapling, amplifiedOutputAmount) }; } else { // Log int amplifiedOutputAmount = (int) (aOutputAmount * heightModifier * girthModifier); - toOutput = new ItemStack[] {ItemUtils.getSimpleStack(mWood, amplifiedOutputAmount)}; + toOutput = new ItemStack[] { ItemUtils.getSimpleStack(mWood, amplifiedOutputAmount) }; } GT_Recipe tRecipe = new GT_Recipe(null, toOutput, null, null, null, null, 0, 0, 0); @@ -241,25 +234,21 @@ public class GregtechMetaTileEntityTreeFarm extends GregtechMeta_MultiBlockBase< public IStructureDefinition<GregtechMetaTileEntityTreeFarm> getStructureDefinition() { if (STRUCTURE_DEFINITION == null) { STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntityTreeFarm>builder() - .addShape(mName, transpose(new String[][] { - {"CCC", "CCC", "CCC"}, - {"C~C", "C-C", "CCC"}, - {"CCC", "CCC", "CCC"}, - })) + .addShape( + mName, + transpose( + new String[][] { { "CCC", "CCC", "CCC" }, { "C~C", "C-C", "CCC" }, + { "CCC", "CCC", "CCC" }, })) .addElement( 'C', - buildHatchAdder(GregtechMetaTileEntityTreeFarm.class) - .atLeast( - InputHatch, - OutputHatch, - InputBus, - OutputBus, - Maintenance, - Energy.or(TTEnergy), - Muffler) - .casingIndex(CASING_TEXTURE_ID) - .dot(1) - .buildAndChain( + buildHatchAdder(GregtechMetaTileEntityTreeFarm.class).atLeast( + InputHatch, + OutputHatch, + InputBus, + OutputBus, + Maintenance, + Energy.or(TTEnergy), + Muffler).casingIndex(CASING_TEXTURE_ID).dot(1).buildAndChain( onElementPass(x -> ++x.mCasing, ofBlock(ModBlocks.blockCasings2Misc, 15)))) .build(); } @@ -278,8 +267,7 @@ public class GregtechMetaTileEntityTreeFarm extends GregtechMeta_MultiBlockBase< @Override public int getDamageToComponent(final ItemStack aStack) { - return MathUtils.balance( - (int) (75 - ((GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).getMass()))), 5, 120); + return MathUtils.balance((int) (75 - ((GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).getMass()))), 5, 120); } @Override @@ -336,9 +324,7 @@ public class GregtechMetaTileEntityTreeFarm extends GregtechMeta_MultiBlockBase< this.saplingsModifier = Math.max(tree.getGenome().getFertility() * 20, 1); this.girthModifier = tree.getGenome().getGirth(); boolean fireproof = ((IAlleleBoolean) tree.getGenome() - .getChromosomes()[EnumTreeChromosome.FIREPROOF.ordinal()] - .getActiveAllele()) - .getValue(); + .getChromosomes()[EnumTreeChromosome.FIREPROOF.ordinal()].getActiveAllele()).getValue(); aWood = sLogCache.get(tree.getIdent() + (fireproof ? "fireproof" : "")); @@ -355,9 +341,8 @@ public class GregtechMetaTileEntityTreeFarm extends GregtechMeta_MultiBlockBase< public static void loadMapWoodFromSapling() { // galaxySpace - mapSaplingToLog( - "GalaxySpace:barnardaCsapling:1", - GT_ModHandler.getModItem("GalaxySpace", "barnardaClog", 1)); // barnarda c + mapSaplingToLog("GalaxySpace:barnardaCsapling:1", GT_ModHandler.getModItem("GalaxySpace", "barnardaClog", 1)); // barnarda + // c // minecraft mapSaplingToLog("minecraft:sapling:0", new ItemStack(Blocks.log, 1, 0)); // oak @@ -387,48 +372,32 @@ public class GregtechMetaTileEntityTreeFarm extends GregtechMeta_MultiBlockBase< mapSaplingToLog("Natura:Rare Sapling:4", GT_ModHandler.getModItem("Natura", "willow", 1, 0)); // willow // BOP - mapSaplingToLog( - "BiomesOPlenty:colorizedSaplings:0", - GT_ModHandler.getModItem("BiomesOPlenty", "logs1", 1, 0)); // Sacred Oak - mapSaplingToLog( - "BiomesOPlenty:colorizedSaplings:1", - GT_ModHandler.getModItem("BiomesOPlenty", "logs2", 1, 2)); // Mangrove - mapSaplingToLog( - "BiomesOPlenty:colorizedSaplings:2", GT_ModHandler.getModItem("BiomesOPlenty", "logs2", 1, 3)); // Palm - mapSaplingToLog( - "BiomesOPlenty:colorizedSaplings:3", - GT_ModHandler.getModItem("BiomesOPlenty", "logs3", 1, 0)); // Redwood - mapSaplingToLog( - "BiomesOPlenty:colorizedSaplings:4", - GT_ModHandler.getModItem("BiomesOPlenty", "logs3", 1, 1)); // Willow - mapSaplingToLog( - "BiomesOPlenty:colorizedSaplings:5", GT_ModHandler.getModItem("BiomesOPlenty", "logs4", 1, 0)); // Pine - mapSaplingToLog( - "BiomesOPlenty:colorizedSaplings:6", - GT_ModHandler.getModItem("BiomesOPlenty", "logs4", 1, 3)); // Mahogany - mapSaplingToLog( - "BiomesOPlenty:saplings:2", GT_ModHandler.getModItem("BiomesOPlenty", "bamboo", 1, 0)); // Bamboo + mapSaplingToLog("BiomesOPlenty:colorizedSaplings:0", GT_ModHandler.getModItem("BiomesOPlenty", "logs1", 1, 0)); // Sacred + // Oak + mapSaplingToLog("BiomesOPlenty:colorizedSaplings:1", GT_ModHandler.getModItem("BiomesOPlenty", "logs2", 1, 2)); // Mangrove + mapSaplingToLog("BiomesOPlenty:colorizedSaplings:2", GT_ModHandler.getModItem("BiomesOPlenty", "logs2", 1, 3)); // Palm + mapSaplingToLog("BiomesOPlenty:colorizedSaplings:3", GT_ModHandler.getModItem("BiomesOPlenty", "logs3", 1, 0)); // Redwood + mapSaplingToLog("BiomesOPlenty:colorizedSaplings:4", GT_ModHandler.getModItem("BiomesOPlenty", "logs3", 1, 1)); // Willow + mapSaplingToLog("BiomesOPlenty:colorizedSaplings:5", GT_ModHandler.getModItem("BiomesOPlenty", "logs4", 1, 0)); // Pine + mapSaplingToLog("BiomesOPlenty:colorizedSaplings:6", GT_ModHandler.getModItem("BiomesOPlenty", "logs4", 1, 3)); // Mahogany + mapSaplingToLog("BiomesOPlenty:saplings:2", GT_ModHandler.getModItem("BiomesOPlenty", "bamboo", 1, 0)); // Bamboo mapSaplingToLog("BiomesOPlenty:saplings:3", GT_ModHandler.getModItem("BiomesOPlenty", "logs2", 1, 1)); // Magic mapSaplingToLog("BiomesOPlenty:saplings:4", GT_ModHandler.getModItem("BiomesOPlenty", "logs1", 1, 2)); // Dark - mapSaplingToLog( - "BiomesOPlenty:saplings:5", GT_ModHandler.getModItem("BiomesOPlenty", "logs3", 1, 2)); // Dying/Dead + mapSaplingToLog("BiomesOPlenty:saplings:5", GT_ModHandler.getModItem("BiomesOPlenty", "logs3", 1, 2)); // Dying/Dead mapSaplingToLog("BiomesOPlenty:saplings:6", GT_ModHandler.getModItem("BiomesOPlenty", "logs1", 1, 3)); // Fir - mapSaplingToLog( - "BiomesOPlenty:saplings:7", GT_ModHandler.getModItem("BiomesOPlenty", "logs2", 1, 0)); // Ethereal - mapSaplingToLog( - "BiomesOPlenty:saplings:10", GT_ModHandler.getModItem("BiomesOPlenty", "logs1", 1, 1)); // Pink Cherry - mapSaplingToLog( - "BiomesOPlenty:saplings:12", GT_ModHandler.getModItem("BiomesOPlenty", "logs1", 1, 1)); // White Cherry - mapSaplingToLog( - "BiomesOPlenty:saplings:13", GT_ModHandler.getModItem("BiomesOPlenty", "logs4", 1, 1)); // Hellbark - mapSaplingToLog( - "BiomesOPlenty:saplings:14", GT_ModHandler.getModItem("BiomesOPlenty", "logs4", 1, 2)); // Jacaranda - mapSaplingToLog( - "minecraft:yellow_flower:0", - GT_ModHandler.getModItem("BiomesOPlenty", "logs3", 1, 3)); // Giant Flower Stem - mapSaplingToLog( - "minecraft:red_flower:0", - GT_ModHandler.getModItem("BiomesOPlenty", "logs3", 1, 3)); // Giant Flower Stem + mapSaplingToLog("BiomesOPlenty:saplings:7", GT_ModHandler.getModItem("BiomesOPlenty", "logs2", 1, 0)); // Ethereal + mapSaplingToLog("BiomesOPlenty:saplings:10", GT_ModHandler.getModItem("BiomesOPlenty", "logs1", 1, 1)); // Pink + // Cherry + mapSaplingToLog("BiomesOPlenty:saplings:12", GT_ModHandler.getModItem("BiomesOPlenty", "logs1", 1, 1)); // White + // Cherry + mapSaplingToLog("BiomesOPlenty:saplings:13", GT_ModHandler.getModItem("BiomesOPlenty", "logs4", 1, 1)); // Hellbark + mapSaplingToLog("BiomesOPlenty:saplings:14", GT_ModHandler.getModItem("BiomesOPlenty", "logs4", 1, 2)); // Jacaranda + mapSaplingToLog("minecraft:yellow_flower:0", GT_ModHandler.getModItem("BiomesOPlenty", "logs3", 1, 3)); // Giant + // Flower + // Stem + mapSaplingToLog("minecraft:red_flower:0", GT_ModHandler.getModItem("BiomesOPlenty", "logs3", 1, 3)); // Giant + // Flower + // Stem // Witchery mapSaplingToLog("witchery:witchsapling:0", GT_ModHandler.getModItem("witchery", "witchlog", 1, 0)); // Rowan @@ -436,9 +405,9 @@ public class GregtechMetaTileEntityTreeFarm extends GregtechMeta_MultiBlockBase< mapSaplingToLog("witchery:witchsapling:2", GT_ModHandler.getModItem("witchery", "witchlog", 1, 2)); // Hawthorn // TConstruct - mapSaplingToLog( - "TConstruct:slime.sapling:0", - GT_ModHandler.getModItem("TConstruct", "slime.gel", 1)); // green slime blocks + mapSaplingToLog("TConstruct:slime.sapling:0", GT_ModHandler.getModItem("TConstruct", "slime.gel", 1)); // green + // slime + // blocks // TaintedMagic mapSaplingToLog( @@ -457,14 +426,12 @@ public class GregtechMetaTileEntityTreeFarm extends GregtechMeta_MultiBlockBase< mapSaplingToLog( "miscutils:blockRainforestOakSapling:0", GT_ModHandler.getModItem("miscutils", "blockRainforestOakLog", 1)); // rainforest - mapSaplingToLog( - "miscutils:blockPineSapling:0", GT_ModHandler.getModItem("miscutils", "blockPineLogLog", 1)); // pine + mapSaplingToLog("miscutils:blockPineSapling:0", GT_ModHandler.getModItem("miscutils", "blockPineLogLog", 1)); // pine // Harvestcraft mapSaplingToLog("harvestcraft:pampistachioSapling:0", new ItemStack(Blocks.log, 1, 3)); // Pistachio mapSaplingToLog("harvestcraft:pampapayaSapling:0", new ItemStack(Blocks.log, 1, 3)); // Papaya - mapSaplingToLog( - "harvestcraft:pammapleSapling:0", GT_ModHandler.getModItem("harvestcraft", "pamMaple", 1)); // Maple + mapSaplingToLog("harvestcraft:pammapleSapling:0", GT_ModHandler.getModItem("harvestcraft", "pamMaple", 1)); // Maple mapSaplingToLog("harvestcraft:pamappleSapling:0", new ItemStack(Blocks.log, 1, 0)); // Apple mapSaplingToLog("harvestcraft:pamdateSapling:0", new ItemStack(Blocks.log, 1, 3)); // Date mapSaplingToLog("harvestcraft:pamorangeSapling:0", new ItemStack(Blocks.log, 1, 3)); // Orange @@ -542,17 +509,12 @@ public class GregtechMetaTileEntityTreeFarm extends GregtechMeta_MultiBlockBase< // Thaumic Bases mapSaplingToLog("thaumicbases:goldenOakSapling:0", new ItemStack(Blocks.log, 1, 0)); // Golden Oak - mapSaplingToLog( - "thaumicbases:goldenOakSapling:1", - GT_ModHandler.getModItem("thaumicbases", "genLogs", 1, 0)); // Peaceful - mapSaplingToLog( - "thaumicbases:goldenOakSapling:2", GT_ModHandler.getModItem("thaumicbases", "genLogs", 1, 1)); // Nether - mapSaplingToLog( - "thaumicbases:goldenOakSapling:3", GT_ModHandler.getModItem("thaumicbases", "genLogs", 1, 2)); // Ender + mapSaplingToLog("thaumicbases:goldenOakSapling:1", GT_ModHandler.getModItem("thaumicbases", "genLogs", 1, 0)); // Peaceful + mapSaplingToLog("thaumicbases:goldenOakSapling:2", GT_ModHandler.getModItem("thaumicbases", "genLogs", 1, 1)); // Nether + mapSaplingToLog("thaumicbases:goldenOakSapling:3", GT_ModHandler.getModItem("thaumicbases", "genLogs", 1, 2)); // Ender // Forbidden Magic - mapSaplingToLog( - "ForbiddenMagic:TaintSapling:0", GT_ModHandler.getModItem("ForbiddenMagic", "TaintLog", 1)); // Tainted + mapSaplingToLog("ForbiddenMagic:TaintSapling:0", GT_ModHandler.getModItem("ForbiddenMagic", "TaintLog", 1)); // Tainted } @Override @@ -580,20 +542,22 @@ public class GregtechMetaTileEntityTreeFarm extends GregtechMeta_MultiBlockBase< public static boolean addFakeRecipeToNEI(@Nonnull ItemStack aSapling, ItemStack aLog) { int aRecipes = GTPP_Recipe_Map.sTreeSimFakeRecipes.mRecipeList.size(); - Logger.INFO("Adding Tree Growth Simulation for " + aSapling.getDisplayName() + " -> " - + (aLog == null ? "NULL" : aLog.getDisplayName())); - ItemStack[] aOutput = new ItemStack[] {aLog, aSapling}; + Logger.INFO( + "Adding Tree Growth Simulation for " + aSapling.getDisplayName() + + " -> " + + (aLog == null ? "NULL" : aLog.getDisplayName())); + ItemStack[] aOutput = new ItemStack[] { aLog, aSapling }; String aOutputs = ItemUtils.getArrayStackNames(aOutput); Logger.INFO("" + aOutputs); ItemStack inputStack = aSapling.copy(); inputStack.stackSize = 0; GTPP_Recipe_Map.sTreeSimFakeRecipes.addFakeRecipe( false, - new ItemStack[] {inputStack}, + new ItemStack[] { inputStack }, aOutput, null, - new int[] {10000, 1000}, - new FluidStack[] {FluidUtils.getFluidStack(ModItems.fluidFertBasic, 1)}, + new int[] { 10000, 1000 }, + new FluidStack[] { FluidUtils.getFluidStack(ModItems.fluidFertBasic, 1) }, new FluidStack[] {}, 1, sRecipeID++, diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_AlloyBlastSmelter.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_AlloyBlastSmelter.java index 64f04e530d..7903a86868 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_AlloyBlastSmelter.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_AlloyBlastSmelter.java @@ -6,10 +6,21 @@ import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose import static gregtech.api.enums.GT_HatchElement.*; import static gregtech.api.util.GT_StructureUtility.buildHatchAdder; +import java.util.ArrayList; +import java.util.List; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.StatCollector; +import net.minecraftforge.fluids.FluidStack; + import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable; import com.gtnewhorizon.structurelib.structure.IStructureDefinition; import com.gtnewhorizon.structurelib.structure.ISurvivalBuildEnvironment; import com.gtnewhorizon.structurelib.structure.StructureDefinition; + import gregtech.api.GregTech_API; import gregtech.api.enums.TAE; import gregtech.api.interfaces.IIconContainer; @@ -27,18 +38,9 @@ import gtPlusPlus.core.recipe.common.CI; import gtPlusPlus.core.util.minecraft.ItemUtils; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; -import java.util.ArrayList; -import java.util.List; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.StatCollector; -import net.minecraftforge.fluids.FluidStack; -public class GregtechMetaTileEntity_AlloyBlastSmelter - extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_AlloyBlastSmelter> - implements ISurvivalConstructable { +public class GregtechMetaTileEntity_AlloyBlastSmelter extends + GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_AlloyBlastSmelter> implements ISurvivalConstructable { private int mMode = 0; private boolean isUsingControllerCircuit = false; @@ -80,24 +82,15 @@ public class GregtechMetaTileEntity_AlloyBlastSmelter @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType(getMachineType()) - .addInfo("Controller Block for the Alloy Blast Smelter") + tt.addMachineType(getMachineType()).addInfo("Controller Block for the Alloy Blast Smelter") .addInfo("20% Faster than the Electric Blast Furnace") - .addInfo("Allows Complex GT++ alloys to be created") - .addInfo("Accepts only one Energy Hatch") + .addInfo("Allows Complex GT++ alloys to be created").addInfo("Accepts only one Energy Hatch") .addInfo("Circuit for recipe goes in the Input Bus or GUI slot") - .addPollutionAmount(getPollutionPerSecond(null)) - .addSeparator() - .beginStructureBlock(3, 4, 3, true) - .addController("Bottom Center") - .addCasingInfo("Blast Smelter Casings", 5) - .addCasingInfo("Blast Smelter Heat Containment Coils", 16) - .addInputBus("Any Casing", 1) - .addInputHatch("Any Casing", 1) - .addOutputHatch("Any Casing", 1) - .addEnergyHatch("Any Casing", 1) - .addMaintenanceHatch("Any Casing", 1) - .addMufflerHatch("Any Casing", 1) + .addPollutionAmount(getPollutionPerSecond(null)).addSeparator().beginStructureBlock(3, 4, 3, true) + .addController("Bottom Center").addCasingInfo("Blast Smelter Casings", 5) + .addCasingInfo("Blast Smelter Heat Containment Coils", 16).addInputBus("Any Casing", 1) + .addInputHatch("Any Casing", 1).addOutputHatch("Any Casing", 1).addEnergyHatch("Any Casing", 1) + .addMaintenanceHatch("Any Casing", 1).addMufflerHatch("Any Casing", 1) .toolTipFinisher(CORE.GT_Tooltip_Builder); return tt; } @@ -106,22 +99,18 @@ public class GregtechMetaTileEntity_AlloyBlastSmelter public IStructureDefinition<GregtechMetaTileEntity_AlloyBlastSmelter> getStructureDefinition() { if (STRUCTURE_DEFINITION == null) { STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_AlloyBlastSmelter>builder() - .addShape(mName, transpose(new String[][] { - {"CCC", "CCC", "CCC"}, - {"HHH", "H-H", "HHH"}, - {"HHH", "H-H", "HHH"}, - {"C~C", "CCC", "CCC"}, - })) + .addShape( + mName, + transpose( + new String[][] { { "CCC", "CCC", "CCC" }, { "HHH", "H-H", "HHH" }, + { "HHH", "H-H", "HHH" }, { "C~C", "CCC", "CCC" }, })) .addElement( 'C', buildHatchAdder(GregtechMetaTileEntity_AlloyBlastSmelter.class) .atLeast(InputBus, InputHatch, OutputBus, OutputHatch, Maintenance, Energy, Muffler) - .casingIndex(TAE.GTPP_INDEX(15)) - .dot(1) - .buildAndChain( + .casingIndex(TAE.GTPP_INDEX(15)).dot(1).buildAndChain( onElementPass(x -> ++x.mCasing, ofBlock(ModBlocks.blockCasingsMisc, 15)))) - .addElement('H', ofBlock(ModBlocks.blockCasingsMisc, 14)) - .build(); + .addElement('H', ofBlock(ModBlocks.blockCasingsMisc, 14)).build(); } return STRUCTURE_DEFINITION; } @@ -245,7 +234,11 @@ public class GregtechMetaTileEntity_AlloyBlastSmelter } tInputs = tInputList.toArray(new ItemStack[0]); tRecipe = GTPP_Recipe.GTPP_Recipe_Map.sAlloyBlastSmelterRecipes.findRecipe( - this.getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[tTier], tFluids, tInputs); + this.getBaseMetaTileEntity(), + false, + gregtech.api.enums.GT_Values.V[tTier], + tFluids, + tInputs); } // Validity check @@ -277,7 +270,7 @@ public class GregtechMetaTileEntity_AlloyBlastSmelter this.lEUt = (-this.lEUt); } this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime); - this.mOutputFluids = new FluidStack[] {tRecipe.getFluidOutput(0)}; + this.mOutputFluids = new FluidStack[] { tRecipe.getFluidOutput(0) }; List<ItemStack> tOutPutItems = new ArrayList<ItemStack>(); for (ItemStack tOut : tRecipe.mOutputs) { if (ItemUtils.checkForInvalidItems(tOut)) { @@ -299,7 +292,8 @@ public class GregtechMetaTileEntity_AlloyBlastSmelter public void onModeChangeByScrewdriver(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { isBussesSeparate = !isBussesSeparate; GT_Utility.sendChatToPlayer( - aPlayer, StatCollector.translateToLocal("GT5U.machines.separatebus") + " " + isBussesSeparate); + aPlayer, + StatCollector.translateToLocal("GT5U.machines.separatebus") + " " + isBussesSeparate); } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_Cyclotron.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_Cyclotron.java index 52c8919691..2fced531a5 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_Cyclotron.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_Cyclotron.java @@ -6,10 +6,18 @@ import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose import static gregtech.api.enums.GT_HatchElement.*; import static gregtech.api.util.GT_StructureUtility.buildHatchAdder; +import java.util.ArrayList; + +import net.minecraft.block.Block; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraftforge.fluids.FluidStack; + import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable; import com.gtnewhorizon.structurelib.structure.IStructureDefinition; import com.gtnewhorizon.structurelib.structure.ISurvivalBuildEnvironment; import com.gtnewhorizon.structurelib.structure.StructureDefinition; + import gregtech.api.interfaces.IIconContainer; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; @@ -26,11 +34,6 @@ import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.util.math.MathUtils; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; -import java.util.ArrayList; -import net.minecraft.block.Block; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraftforge.fluids.FluidStack; public class GregtechMetaTileEntity_Cyclotron extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_Cyclotron> implements ISurvivalConstructable { @@ -83,70 +86,31 @@ public class GregtechMetaTileEntity_Cyclotron extends GregtechMeta_MultiBlockBas @Override public IStructureDefinition<GregtechMetaTileEntity_Cyclotron> getStructureDefinition() { if (STRUCTURE_DEFINITION == null) { - STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_Cyclotron>builder() - .addShape(mName, transpose(new String[][] { - { - " ", - " hhh ", - " hh hh ", - " h h ", - " h h ", - " h h ", - " h h ", - " h h ", - " h h ", - " h h ", - " h h ", - " h h ", - " hh hh ", - " hhh ", - " ", - }, - { - " hhh ", - " hhccchh ", - " hcchhhcch ", - " hchh hhch ", - " hch hch ", - " hch hch ", - "hch hch", - "hch hch", - "hch hch", - " hch hch ", - " hch hch ", - " hchh hhch ", - " hcch~hcch ", - " hhccchh ", - " hhh ", - }, - { - " ", - " hhh ", - " hh hh ", - " h h ", - " h h ", - " h h ", - " h h ", - " h h ", - " h h ", - " h h ", - " h h ", - " h h ", - " hh hh ", - " hhh ", - " ", - } - })) + STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_Cyclotron>builder().addShape( + mName, + transpose( + new String[][] { + { " ", " hhh ", " hh hh ", " h h ", + " h h ", " h h ", " h h ", " h h ", + " h h ", " h h ", " h h ", " h h ", + " hh hh ", " hhh ", " ", }, + { " hhh ", " hhccchh ", " hcchhhcch ", " hchh hhch ", + " hch hch ", " hch hch ", "hch hch", "hch hch", + "hch hch", " hch hch ", " hch hch ", " hchh hhch ", + " hcch~hcch ", " hhccchh ", " hhh ", }, + { " ", " hhh ", " hh hh ", " h h ", + " h h ", " h h ", " h h ", " h h ", + " h h ", " h h ", " h h ", " h h ", + " hh hh ", " hhh ", " ", } })) .addElement( 'h', buildHatchAdder(GregtechMetaTileEntity_Cyclotron.class) .atLeast(InputBus, OutputBus, Maintenance, Energy, Muffler, InputHatch, OutputHatch) - .casingIndex(44) - .dot(1) - .buildAndChain(onElementPass( - x -> ++x.mCasing, ofBlock(getCasingBlock(), getCasingMeta())))) - .addElement('c', ofBlock(getCyclotronCoil(), getCyclotronCoilMeta())) - .build(); + .casingIndex(44).dot(1).buildAndChain( + onElementPass( + x -> ++x.mCasing, + ofBlock(getCasingBlock(), getCasingMeta())))) + .addElement('c', ofBlock(getCyclotronCoil(), getCyclotronCoilMeta())).build(); } return STRUCTURE_DEFINITION; } @@ -187,29 +151,18 @@ public class GregtechMetaTileEntity_Cyclotron extends GregtechMeta_MultiBlockBas @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType(getMachineType()) - .addInfo("Super Magnetic Speed Shooter") - .addSeparator() + tt.addMachineType(getMachineType()).addInfo("Super Magnetic Speed Shooter").addSeparator() .addInfo("Particles are accelerated over 186 revolutions to 80% light speed") .addInfo("Can produce a continuous beam current of 2.2 mA at 590 MeV") - .addInfo("Which will be extracted from the Isochronous Cyclotron") - .addSeparator() + .addInfo("Which will be extracted from the Isochronous Cyclotron").addSeparator() .addInfo("Consists of the same layout as a Fusion Reactor") .addInfo("Any external casing can be a hatch/bus, unlike Fusion") .addInfo("Cyclotron Machine Casings around Cyclotron Coil Blocks") - .addInfo("All Hatches must be IV or better") - .addPollutionAmount(getPollutionPerSecond(null)) - .addSeparator() - .addCasingInfo("Cyclotron Machine Casings", 40) - .addCasingInfo("Cyclotron Coil", 32) - .addInputBus("Any Casing", 1) - .addOutputBus("Any Casing", 1) - .addInputHatch("Any Casing", 1) - .addOutputHatch("Any Casing", 1) - .addEnergyHatch("Any Casing", 1) - .addMaintenanceHatch("Any Casing", 1) - .addMufflerHatch("Any Casing", 1) - .toolTipFinisher(CORE.GT_Tooltip_Builder); + .addInfo("All Hatches must be IV or better").addPollutionAmount(getPollutionPerSecond(null)) + .addSeparator().addCasingInfo("Cyclotron Machine Casings", 40).addCasingInfo("Cyclotron Coil", 32) + .addInputBus("Any Casing", 1).addOutputBus("Any Casing", 1).addInputHatch("Any Casing", 1) + .addOutputHatch("Any Casing", 1).addEnergyHatch("Any Casing", 1).addMaintenanceHatch("Any Casing", 1) + .addMufflerHatch("Any Casing", 1).toolTipFinisher(CORE.GT_Tooltip_Builder); return tt; } @@ -243,9 +196,9 @@ public class GregtechMetaTileEntity_Cyclotron extends GregtechMeta_MultiBlockBas @Override public boolean checkRecipe(ItemStack aStack) { - /*if (CORE.DEVENV) { - return this.checkRecipeGeneric(); - }*/ + /* + * if (CORE.DEVENV) { return this.checkRecipeGeneric(); } + */ this.fixAllMaintenanceIssue(); // log("Recipe Check."); @@ -257,7 +210,11 @@ public class GregtechMetaTileEntity_Cyclotron extends GregtechMeta_MultiBlockBas byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage)); GT_Recipe tRecipe = GTPP_Recipe.GTPP_Recipe_Map.sCyclotronRecipes.findRecipe( - getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[tTier], tFluidInputs, tItemInputs); + getBaseMetaTileEntity(), + false, + gregtech.api.enums.GT_Values.V[tTier], + tFluidInputs, + tItemInputs); if (tRecipe != null) { if (tRecipe.isRecipeInputEqual(true, tFluidInputs, tItemInputs)) { @@ -293,18 +250,20 @@ public class GregtechMetaTileEntity_Cyclotron extends GregtechMeta_MultiBlockBas if (s.getItem() instanceof IonParticles) { long aCharge = IonParticles.getChargeState(s); if (aCharge == 0) { - IonParticles.setChargeState(s, MathUtils.getRandomFromArray(new int[] { - -5, -5, -4, -4, -4, -3, -3, -3, -3, -3, -2, -2, -2, -2, -2, -2, -2, -1, -1, -1, -1, - -1, -1, -1, -1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 6, 6 - })); + IonParticles.setChargeState( + s, + MathUtils.getRandomFromArray( + new int[] { -5, -5, -4, -4, -4, -3, -3, -3, -3, -3, -2, -2, -2, -2, -2, + -2, -2, -1, -1, -1, -1, -1, -1, -1, -1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, + 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 6, 6 })); } } } } this.mOutputItems = outputs; - this.mOutputFluids = new FluidStack[] {tRecipe.getFluidOutput(0)}; + this.mOutputFluids = new FluidStack[] { tRecipe.getFluidOutput(0) }; this.updateSlots(); return true; } @@ -332,11 +291,13 @@ public class GregtechMetaTileEntity_Cyclotron extends GregtechMeta_MultiBlockBas if (s.getItem() instanceof IonParticles) { long aCharge = IonParticles.getChargeState(s); if (aCharge == 0) { - IonParticles.setChargeState(s, MathUtils.getRandomFromArray(new int[] { - -5, -5, -4, -4, -4, -3, -3, -3, -3, -3, -2, -2, -2, -2, -2, -2, -2, -1, -1, -1, - -1, -1, -1, -1, -1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 6, 6 - })); + IonParticles.setChargeState( + s, + MathUtils.getRandomFromArray( + new int[] { -5, -5, -4, -4, -4, -3, -3, -3, -3, -3, -2, -2, -2, -2, + -2, -2, -2, -1, -1, -1, -1, -1, -1, -1, -1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 6, 6 })); } } } @@ -380,11 +341,8 @@ public class GregtechMetaTileEntity_Cyclotron extends GregtechMeta_MultiBlockBas } } - return new String[] { - "COMET - Compact Cyclotron MK " + tier, - "EU Required: " + powerRequired + "EU/t", - "Stored EU: " + this.getEUVar() + " / " + maxEUStore() - }; + return new String[] { "COMET - Compact Cyclotron MK " + tier, "EU Required: " + powerRequired + "EU/t", + "Stored EU: " + this.getEUVar() + " / " + maxEUStore() }; } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_IndustrialFishingPond.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_IndustrialFishingPond.java index 7422426669..1188cbe278 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_IndustrialFishingPond.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_IndustrialFishingPond.java @@ -7,11 +7,24 @@ import static gregtech.api.enums.GT_HatchElement.*; import static gregtech.api.util.GT_StructureUtility.buildHatchAdder; import static gtPlusPlus.core.util.data.ArrayUtils.removeNulls; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Map; + +import net.minecraft.block.Block; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.WeightedRandomFishable; +import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.fluids.FluidStack; + import com.gtnewhorizon.structurelib.alignment.IAlignmentLimits; import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable; import com.gtnewhorizon.structurelib.structure.IStructureDefinition; import com.gtnewhorizon.structurelib.structure.ISurvivalBuildEnvironment; import com.gtnewhorizon.structurelib.structure.StructureDefinition; + import gregtech.api.enums.TAE; import gregtech.api.enums.Textures; import gregtech.api.interfaces.IIconContainer; @@ -29,20 +42,9 @@ import gtPlusPlus.core.util.reflect.ReflectionUtils; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase; import ic2.core.init.BlocksItems; import ic2.core.init.InternalName; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Map; -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.WeightedRandomFishable; -import net.minecraftforge.common.util.ForgeDirection; -import net.minecraftforge.fluids.FluidStack; -public class GregtechMetaTileEntity_IndustrialFishingPond - extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_IndustrialFishingPond> - implements ISurvivalConstructable { +public class GregtechMetaTileEntity_IndustrialFishingPond extends + GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_IndustrialFishingPond> implements ISurvivalConstructable { private boolean isUsingControllerCircuit = false; private static final Item circuit = CI.getNumberedCircuit(0).getItem(); @@ -75,26 +77,14 @@ public class GregtechMetaTileEntity_IndustrialFishingPond @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType(getMachineType()) - .addInfo("Controller Block for the Fishing Pond") - .addInfo("Can process (Tier + 1) * 2 recipes") - .addInfo("Put a numbered circuit into the input bus.") - .addInfo("Circuit 14 for Fish") - .addInfo("Circuit 15 for Junk") - .addInfo("Circuit 16 for Treasure") - .addInfo("Need to be filled with water.") - .addInfo("Will automatically fill water from input hatch.") - .addPollutionAmount(getPollutionPerSecond(null)) - .addSeparator() - .beginStructureBlock(9, 3, 9, true) - .addController("Front Center") - .addCasingInfo("Aquatic Casings", 64) - .addInputBus("Any Casing", 1) - .addOutputBus("Any Casing", 1) - .addInputHatch("Any Casing", 1) - .addEnergyHatch("Any Casing", 1) - .addMaintenanceHatch("Any Casing", 1) - .addMufflerHatch("Any Casing", 1) + tt.addMachineType(getMachineType()).addInfo("Controller Block for the Fishing Pond") + .addInfo("Can process (Tier + 1) * 2 recipes").addInfo("Put a numbered circuit into the input bus.") + .addInfo("Circuit 14 for Fish").addInfo("Circuit 15 for Junk").addInfo("Circuit 16 for Treasure") + .addInfo("Need to be filled with water.").addInfo("Will automatically fill water from input hatch.") + .addPollutionAmount(getPollutionPerSecond(null)).addSeparator().beginStructureBlock(9, 3, 9, true) + .addController("Front Center").addCasingInfo("Aquatic Casings", 64).addInputBus("Any Casing", 1) + .addOutputBus("Any Casing", 1).addInputHatch("Any Casing", 1).addEnergyHatch("Any Casing", 1) + .addMaintenanceHatch("Any Casing", 1).addMufflerHatch("Any Casing", 1) .toolTipFinisher(CORE.GT_Tooltip_Builder); return tt; } @@ -109,49 +99,24 @@ public class GregtechMetaTileEntity_IndustrialFishingPond public IStructureDefinition<GregtechMetaTileEntity_IndustrialFishingPond> getStructureDefinition() { if (STRUCTURE_DEFINITION == null) { STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_IndustrialFishingPond>builder() - .addShape(mName, transpose(new String[][] { - { - "XXXXXXXXX", - "X X", - "X X", - "X X", - "X X", - "X X", - "X X", - "X X", - "XXXXXXXXX" - }, - { - "XXXX~XXXX", - "X X", - "X X", - "X X", - "X X", - "X X", - "X X", - "X X", - "XXXXXXXXX" - }, - { - "XXXXXXXXX", - "XXXXXXXXX", - "XXXXXXXXX", - "XXXXXXXXX", - "XXXXXXXXX", - "XXXXXXXXX", - "XXXXXXXXX", - "XXXXXXXXX", - "XXXXXXXXX" - }, - })) + .addShape( + mName, + transpose( + new String[][] { + { "XXXXXXXXX", "X X", "X X", "X X", "X X", + "X X", "X X", "X X", "XXXXXXXXX" }, + { "XXXX~XXXX", "X X", "X X", "X X", "X X", + "X X", "X X", "X X", "XXXXXXXXX" }, + { "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", + "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX", "XXXXXXXXX" }, })) .addElement( 'X', buildHatchAdder(GregtechMetaTileEntity_IndustrialFishingPond.class) .atLeast(InputBus, OutputBus, Maintenance, Energy, Muffler, InputHatch) - .casingIndex(getCasingTextureIndex()) - .dot(1) - .buildAndChain(onElementPass( - x -> ++x.mCasing, ofBlock(getCasingBlock(), getCasingMeta())))) + .casingIndex(getCasingTextureIndex()).dot(1).buildAndChain( + onElementPass( + x -> ++x.mCasing, + ofBlock(getCasingBlock(), getCasingMeta())))) .build(); } return STRUCTURE_DEFINITION; @@ -296,10 +261,10 @@ public class GregtechMetaTileEntity_IndustrialFishingPond // if (aBaseMetaTileEntity.fac) - final int xDir = - ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX * mCurrentDirectionX; - final int zDir = - ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ * mCurrentDirectionZ; + final int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX + * mCurrentDirectionX; + final int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ + * mCurrentDirectionZ; int tAmount = 0; for (int i = mOffsetX_Lower + 1; i <= mOffsetX_Upper - 1; ++i) { @@ -315,13 +280,11 @@ public class GregtechMetaTileEntity_IndustrialFishingPond // Utils.LOG_WARNING("Going to try swap an air block for water from inut bus."); stored.amount -= 1000; Block fluidUsed = Blocks.water; - aBaseMetaTileEntity - .getWorld() - .setBlock( - aBaseMetaTileEntity.getXCoord() + xDir + i, - aBaseMetaTileEntity.getYCoord() + h, - aBaseMetaTileEntity.getZCoord() + zDir + j, - fluidUsed); + aBaseMetaTileEntity.getWorld().setBlock( + aBaseMetaTileEntity.getXCoord() + xDir + i, + aBaseMetaTileEntity.getYCoord() + h, + aBaseMetaTileEntity.getZCoord() + zDir + j, + fluidUsed); } } } @@ -346,8 +309,7 @@ public class GregtechMetaTileEntity_IndustrialFishingPond } private boolean isNotStaticWater(Block block, byte meta) { - return block == Blocks.air - || block == Blocks.flowing_water + return block == Blocks.air || block == Blocks.flowing_water || block == BlocksItems.getFluidBlock(InternalName.fluidDistilledWater) || (cofhWater != null && cofhWater.isAssignableFrom(block.getClass()) && meta != 0); } @@ -418,8 +380,7 @@ public class GregtechMetaTileEntity_IndustrialFishingPond } // reflection map - private static Map<WeightedRandomFishable, ItemStack> reflectiveFishMap = - new HashMap<WeightedRandomFishable, ItemStack>(); + private static Map<WeightedRandomFishable, ItemStack> reflectiveFishMap = new HashMap<WeightedRandomFishable, ItemStack>(); private ItemStack reflectiveFish(WeightedRandomFishable y) { if (reflectiveFishMap.containsKey(y)) { @@ -427,13 +388,11 @@ public class GregtechMetaTileEntity_IndustrialFishingPond } ItemStack t; try { - t = (ItemStack) ReflectionUtils.getField(WeightedRandomFishable.class, "field_150711_b") - .get(y); + t = (ItemStack) ReflectionUtils.getField(WeightedRandomFishable.class, "field_150711_b").get(y); ItemStack k = ItemUtils.getSimpleStack(t, 1); reflectiveFishMap.put(y, k); return t; - } catch (IllegalArgumentException | IllegalAccessException e) { - } + } catch (IllegalArgumentException | IllegalAccessException e) {} return null; } @@ -441,39 +400,36 @@ public class GregtechMetaTileEntity_IndustrialFishingPond ItemStack[] mFishOutput = new ItemStack[this.mMax]; if (this.mMode == 14) { for (int k = 0; k < this.mMax; k++) { - if (mFishOutput[k] == null) - for (WeightedRandomFishable g : categoryFish.values()) { - if (MathUtils.randInt(0, (65 - getMaxParallelRecipes())) <= 2) { - ItemStack t = reflectiveFish(g); - if (t != null) { - mFishOutput[k] = ItemUtils.getSimpleStack(t, 1); - } + if (mFishOutput[k] == null) for (WeightedRandomFishable g : categoryFish.values()) { + if (MathUtils.randInt(0, (65 - getMaxParallelRecipes())) <= 2) { + ItemStack t = reflectiveFish(g); + if (t != null) { + mFishOutput[k] = ItemUtils.getSimpleStack(t, 1); } } + } } } else if (this.mMode == 15) { for (int k = 0; k < this.mMax; k++) { - if (mFishOutput[k] == null) - for (WeightedRandomFishable g : categoryJunk.values()) { - if (MathUtils.randInt(0, 100) <= 1) { - ItemStack t = reflectiveFish(g); - if (t != null) { - mFishOutput[k] = ItemUtils.getSimpleStack(t, 1); - } + if (mFishOutput[k] == null) for (WeightedRandomFishable g : categoryJunk.values()) { + if (MathUtils.randInt(0, 100) <= 1) { + ItemStack t = reflectiveFish(g); + if (t != null) { + mFishOutput[k] = ItemUtils.getSimpleStack(t, 1); } } + } } } else if (this.mMode == 16) { for (int k = 0; k < this.mMax; k++) { - if (mFishOutput[k] == null) - for (WeightedRandomFishable g : categoryLoot.values()) { - if (MathUtils.randInt(0, 1000) <= 2) { - ItemStack t = reflectiveFish(g); - if (t != null) { - mFishOutput[k] = ItemUtils.getSimpleStack(t, 1); - } + if (mFishOutput[k] == null) for (WeightedRandomFishable g : categoryLoot.values()) { + if (MathUtils.randInt(0, 1000) <= 2) { + ItemStack t = reflectiveFish(g); + if (t != null) { + mFishOutput[k] = ItemUtils.getSimpleStack(t, 1); } } + } } } else { mFishOutput = null; @@ -482,13 +438,8 @@ public class GregtechMetaTileEntity_IndustrialFishingPond } @Override - public boolean checkRecipeGeneric( - ItemStack[] aItemInputs, - FluidStack[] aFluidInputs, - int aMaxParallelRecipes, - long aEUPercent, - int aSpeedBonusPercent, - int aOutputChanceRoll) { + public boolean checkRecipeGeneric(ItemStack[] aItemInputs, FluidStack[] aFluidInputs, int aMaxParallelRecipes, + long aEUPercent, int aSpeedBonusPercent, int aOutputChanceRoll) { // Control Core to control the Multiblocks behaviour. int aControlCoreTier = getControlCoreTier(); @@ -517,23 +468,26 @@ public class GregtechMetaTileEntity_IndustrialFishingPond getCircuit(aItemInputs); /* - * GT_Recipe tRecipe = this.getRecipeMap().findRecipe( getBaseMetaTileEntity(), - * mLastRecipe, false, gregtech.api.enums.GT_Values.V[tTier], aFluidInputs, - * aItemInputs); + * GT_Recipe tRecipe = this.getRecipeMap().findRecipe( getBaseMetaTileEntity(), mLastRecipe, false, + * gregtech.api.enums.GT_Values.V[tTier], aFluidInputs, aItemInputs); */ ItemStack[] mFishOutput = generateLoot(this.mMode); mFishOutput = removeNulls(mFishOutput); GT_Recipe g = new GTPP_Recipe( - true, new ItemStack[] {}, mFishOutput, null, new int[] {}, aFluidInputs, mOutputFluids, 200, 16, 0); - GT_ParallelHelper helper = new GT_ParallelHelper() - .setRecipe(g) - .setItemInputs(aItemInputs) - .setFluidInputs(aFluidInputs) - .setAvailableEUt(tEnergy) - .setMaxParallel(aMaxParallelRecipes) - .enableConsumption() - .enableOutputCalculation(); + true, + new ItemStack[] {}, + mFishOutput, + null, + new int[] {}, + aFluidInputs, + mOutputFluids, + 200, + 16, + 0); + GT_ParallelHelper helper = new GT_ParallelHelper().setRecipe(g).setItemInputs(aItemInputs) + .setFluidInputs(aFluidInputs).setAvailableEUt(tEnergy).setMaxParallel(aMaxParallelRecipes) + .enableConsumption().enableOutputCalculation(); if (!mVoidExcess) { helper.enableVoidProtection(this); } @@ -551,14 +505,10 @@ public class GregtechMetaTileEntity_IndustrialFishingPond this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000); this.mEfficiencyIncrease = 10000; - GT_OverclockCalculator calculator = new GT_OverclockCalculator() - .setRecipeEUt(g.mEUt) - .setEUt(tEnergy) - .setDuration(g.mDuration) - .setEUtDiscount(aEUPercent / 100.0f) + GT_OverclockCalculator calculator = new GT_OverclockCalculator().setRecipeEUt(g.mEUt).setEUt(tEnergy) + .setDuration(g.mDuration).setEUtDiscount(aEUPercent / 100.0f) .setSpeedBoost(100.0f / (100.0f + aSpeedBonusPercent)) - .setParallel(Math.min(aMaxParallelRecipes, helper.getCurrentParallel())) - .calculate(); + .setParallel(Math.min(aMaxParallelRecipes, helper.getCurrentParallel())).calculate(); lEUt = -calculator.getConsumption(); mMaxProgresstime = (int) Math.ceil(calculator.getDuration() * helper.getDurationMultiplier()); diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_IndustrialRockBreaker.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_IndustrialRockBreaker.java index 99c08bd17b..8c2b1dfc0c 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_IndustrialRockBreaker.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_IndustrialRockBreaker.java @@ -8,10 +8,19 @@ import static gregtech.api.enums.GT_Values.E; import static gregtech.api.enums.GT_Values.RES_PATH_GUI; import static gregtech.api.util.GT_StructureUtility.buildHatchAdder; +import java.util.ArrayList; +import java.util.HashSet; + +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidRegistry; +import net.minecraftforge.fluids.FluidStack; + import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable; import com.gtnewhorizon.structurelib.structure.IStructureDefinition; import com.gtnewhorizon.structurelib.structure.ISurvivalBuildEnvironment; import com.gtnewhorizon.structurelib.structure.StructureDefinition; + import gregtech.api.GregTech_API; import gregtech.api.enums.Materials; import gregtech.api.enums.OrePrefixes; @@ -28,16 +37,9 @@ import gtPlusPlus.core.util.minecraft.FluidUtils; import gtPlusPlus.core.util.minecraft.ItemUtils; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; -import java.util.ArrayList; -import java.util.HashSet; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; -import net.minecraftforge.fluids.FluidRegistry; -import net.minecraftforge.fluids.FluidStack; -public class GregtechMetaTileEntity_IndustrialRockBreaker - extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_IndustrialRockBreaker> - implements ISurvivalConstructable { +public class GregtechMetaTileEntity_IndustrialRockBreaker extends + GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_IndustrialRockBreaker> implements ISurvivalConstructable { private int mCasing; private static IStructureDefinition<GregtechMetaTileEntity_IndustrialRockBreaker> STRUCTURE_DEFINITION = null; @@ -63,24 +65,14 @@ public class GregtechMetaTileEntity_IndustrialRockBreaker @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType(getMachineType()) - .addInfo("Controller Block for the Industrial Rock Breaker") - .addInfo("Speed: +200% | EU Usage: 75% | Parallel: Tier x 8") - .addInfo("Circuit goes in the GUI slot") - .addInfo("1 = cobble, 2 = stone, 3 = obsidian") - .addInfo("Supply Water/Lava") - .addPollutionAmount(getPollutionPerSecond(null)) - .addSeparator() - .beginStructureBlock(3, 4, 3, true) - .addController("Bottom Center") - .addCasingInfo("Thermal Processing Casing", 9) - .addCasingInfo("Thermal Containment Casing", 16) - .addInputBus("Any Casing", 1) - .addInputHatch("Any Casing", 1) - .addOutputBus("Any Casing", 1) - .addEnergyHatch("Any Casing", 1) - .addMaintenanceHatch("Any Casing", 1) - .addMufflerHatch("Any Casing", 1) + tt.addMachineType(getMachineType()).addInfo("Controller Block for the Industrial Rock Breaker") + .addInfo("Speed: +200% | EU Usage: 75% | Parallel: Tier x 8").addInfo("Circuit goes in the GUI slot") + .addInfo("1 = cobble, 2 = stone, 3 = obsidian").addInfo("Supply Water/Lava") + .addPollutionAmount(getPollutionPerSecond(null)).addSeparator().beginStructureBlock(3, 4, 3, true) + .addController("Bottom Center").addCasingInfo("Thermal Processing Casing", 9) + .addCasingInfo("Thermal Containment Casing", 16).addInputBus("Any Casing", 1) + .addInputHatch("Any Casing", 1).addOutputBus("Any Casing", 1).addEnergyHatch("Any Casing", 1) + .addMaintenanceHatch("Any Casing", 1).addMufflerHatch("Any Casing", 1) .toolTipFinisher(CORE.GT_Tooltip_Builder); return tt; } @@ -89,22 +81,18 @@ public class GregtechMetaTileEntity_IndustrialRockBreaker public IStructureDefinition<GregtechMetaTileEntity_IndustrialRockBreaker> getStructureDefinition() { if (STRUCTURE_DEFINITION == null) { STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_IndustrialRockBreaker>builder() - .addShape(mName, transpose(new String[][] { - {"CCC", "CCC", "CCC"}, - {"HHH", "H-H", "HHH"}, - {"HHH", "H-H", "HHH"}, - {"C~C", "CCC", "CCC"}, - })) + .addShape( + mName, + transpose( + new String[][] { { "CCC", "CCC", "CCC" }, { "HHH", "H-H", "HHH" }, + { "HHH", "H-H", "HHH" }, { "C~C", "CCC", "CCC" }, })) .addElement( 'C', buildHatchAdder(GregtechMetaTileEntity_IndustrialRockBreaker.class) .atLeast(InputBus, InputHatch, OutputBus, Maintenance, Energy, Muffler) - .casingIndex(TAE.GTPP_INDEX(16)) - .dot(1) - .buildAndChain( + .casingIndex(TAE.GTPP_INDEX(16)).dot(1).buildAndChain( onElementPass(x -> ++x.mCasing, ofBlock(ModBlocks.blockCasings2Misc, 0)))) - .addElement('H', ofBlock(ModBlocks.blockCasings2Misc, 11)) - .build(); + .addElement('H', ofBlock(ModBlocks.blockCasings2Misc, 11)).build(); } return STRUCTURE_DEFINITION; } @@ -171,7 +159,7 @@ public class GregtechMetaTileEntity_IndustrialRockBreaker if (sRecipe_Cobblestone == null || sRecipe_SmoothStone == null || sRecipe_Redstone == null) { generateRecipes(); } - FluidStack[] aInputFluids = new FluidStack[] {FluidUtils.getWater(1000), FluidUtils.getLava(1000)}; + FluidStack[] aInputFluids = new FluidStack[] { FluidUtils.getWater(1000), FluidUtils.getLava(1000) }; GT_Recipe aTemp = sRecipe_Cobblestone.copy(); aTemp.mFluidInputs = aInputFluids; sFakeRecipeMap.add(aTemp); @@ -203,10 +191,10 @@ public class GregtechMetaTileEntity_IndustrialRockBreaker private static final void generateRecipes() { sRecipe_Cobblestone = new GTPP_Recipe( false, - new ItemStack[] {CI.getNumberedCircuit(1)}, - new ItemStack[] {ItemUtils.getSimpleStack(Blocks.cobblestone)}, + new ItemStack[] { CI.getNumberedCircuit(1) }, + new ItemStack[] { ItemUtils.getSimpleStack(Blocks.cobblestone) }, null, - new int[] {10000}, + new int[] { 10000 }, null, null, 16, @@ -214,10 +202,10 @@ public class GregtechMetaTileEntity_IndustrialRockBreaker 0); sRecipe_SmoothStone = new GTPP_Recipe( false, - new ItemStack[] {CI.getNumberedCircuit(2)}, - new ItemStack[] {ItemUtils.getSimpleStack(Blocks.stone)}, + new ItemStack[] { CI.getNumberedCircuit(2) }, + new ItemStack[] { ItemUtils.getSimpleStack(Blocks.stone) }, null, - new int[] {10000}, + new int[] { 10000 }, null, null, 16, @@ -225,12 +213,11 @@ public class GregtechMetaTileEntity_IndustrialRockBreaker 0); sRecipe_Redstone = new GTPP_Recipe( false, - new ItemStack[] { - CI.getNumberedCircuit(3), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Redstone, 1L) - }, - new ItemStack[] {ItemUtils.getSimpleStack(Blocks.obsidian)}, + new ItemStack[] { CI.getNumberedCircuit(3), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Redstone, 1L) }, + new ItemStack[] { ItemUtils.getSimpleStack(Blocks.obsidian) }, null, - new int[] {10000}, + new int[] { 10000 }, null, null, 128, @@ -256,7 +243,8 @@ public class GregtechMetaTileEntity_IndustrialRockBreaker if (!aItems.isEmpty()) { for (ItemStack aItem : aItems) { if (GT_Utility.areStacksEqual( - aItem, GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Redstone, 1L))) { + aItem, + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Redstone, 1L))) { aHasRedstone = true; break; } @@ -315,14 +303,9 @@ public class GregtechMetaTileEntity_IndustrialRockBreaker int aEUPercent = getEuDiscountForParallelism(); int aSpeedBonusPercent = 200; - GT_ParallelHelper helper = new GT_ParallelHelper() - .setRecipe(tRecipe) - .setItemInputs(aItemInputs) - .setFluidInputs(aFluidInputs) - .setAvailableEUt(tEnergy) - .setMaxParallel(aMaxParallelRecipes) - .enableConsumption() - .enableOutputCalculation(); + GT_ParallelHelper helper = new GT_ParallelHelper().setRecipe(tRecipe).setItemInputs(aItemInputs) + .setFluidInputs(aFluidInputs).setAvailableEUt(tEnergy).setMaxParallel(aMaxParallelRecipes) + .enableConsumption().enableOutputCalculation(); if (!mVoidExcess) { helper.enableVoidProtection(this); } @@ -340,14 +323,10 @@ public class GregtechMetaTileEntity_IndustrialRockBreaker this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000); this.mEfficiencyIncrease = 10000; - GT_OverclockCalculator calculator = new GT_OverclockCalculator() - .setRecipeEUt(tRecipe.mEUt) - .setEUt(tEnergy) - .setDuration(tRecipe.mDuration) - .setEUtDiscount(aEUPercent / 100.0f) + GT_OverclockCalculator calculator = new GT_OverclockCalculator().setRecipeEUt(tRecipe.mEUt).setEUt(tEnergy) + .setDuration(tRecipe.mDuration).setEUtDiscount(aEUPercent / 100.0f) .setSpeedBoost(100.0f / (100.0f + aSpeedBonusPercent)) - .setParallel(Math.min(aMaxParallelRecipes, helper.getCurrentParallel())) - .calculate(); + .setParallel(Math.min(aMaxParallelRecipes, helper.getCurrentParallel())).calculate(); lEUt = -calculator.getConsumption(); mMaxProgresstime = (int) Math.ceil(calculator.getDuration() * helper.getDurationMultiplier()); diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_LargeRocketEngine.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_LargeRocketEngine.java index d5a7316b28..b9658fcd7b 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_LargeRocketEngine.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_LargeRocketEngine.java @@ -8,11 +8,20 @@ import static gregtech.api.util.GT_StructureUtility.buildHatchAdder; import static gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase.GTPPHatchElement.AirIntake; import static gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase.GTPPHatchElement.TTDynamo; +import java.util.ArrayList; + +import net.minecraft.block.Block; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidStack; + import com.google.common.collect.ImmutableMap; import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable; import com.gtnewhorizon.structurelib.structure.IStructureDefinition; import com.gtnewhorizon.structurelib.structure.ISurvivalBuildEnvironment; import com.gtnewhorizon.structurelib.structure.StructureDefinition; + import gregtech.api.enums.GT_Values; import gregtech.api.enums.TAE; import gregtech.api.interfaces.IIconContainer; @@ -32,16 +41,10 @@ import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GT_MetaTileEn import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Muffler_Adv; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; -import java.util.ArrayList; -import net.minecraft.block.Block; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraftforge.fluids.Fluid; -import net.minecraftforge.fluids.FluidStack; -public class GregtechMetaTileEntity_LargeRocketEngine - extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_LargeRocketEngine> - implements ISurvivalConstructable { +public class GregtechMetaTileEntity_LargeRocketEngine extends + GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_LargeRocketEngine> implements ISurvivalConstructable { + protected int fuelConsumption; protected int fuelValue; protected int fuelRemaining; @@ -85,8 +88,7 @@ public class GregtechMetaTileEntity_LargeRocketEngine @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType(getMachineType()) - .addInfo("Controller Block for the Large Rocket Engine") + tt.addMachineType(getMachineType()).addInfo("Controller Block for the Large Rocket Engine") .addInfo("Supply GT++ Rocket Fuels and 1000L of " + mLubricantName + " per hour") .addInfo("Produces as much energy as you put fuel in, with optional boosting") .addInfo("Consumes 2000L/s of air and pollutes 1500 gibbl/s per 16384 eu/t produced") @@ -99,18 +101,12 @@ public class GregtechMetaTileEntity_LargeRocketEngine .addInfo("- 75% of max fuel efficiency at 53k or 159k EU/t output energy") .addInfo("- 50% of max fuel efficiency at 69k or 207k EU/t output energy") .addInfo("- 25% of max fuel efficiency at 98k or 294k EU/t output energy") - .addInfo("formula: x = input of energy (30K^(1/3)/ x^(1/3)) * (80K^(1/3)/ x^(1/3))") - .addSeparator() - .beginStructureBlock(3, 3, 10, false) - .addController("Front Center") - .addCasingInfo(mCasingName, 64) - .addCasingInfo(mGearboxName, 8) - .addStructureHint("Air Intake Hatch", 1) - .addInputBus("Side center line", 1) - .addInputHatch("Side center line", 1) + .addInfo("formula: x = input of energy (30K^(1/3)/ x^(1/3)) * (80K^(1/3)/ x^(1/3))").addSeparator() + .beginStructureBlock(3, 3, 10, false).addController("Front Center").addCasingInfo(mCasingName, 64) + .addCasingInfo(mGearboxName, 8).addStructureHint("Air Intake Hatch", 1) + .addInputBus("Side center line", 1).addInputHatch("Side center line", 1) .addMaintenanceHatch("Any Block Touching Inconel Reinforced Casing", 1) - .addDynamoHatch("Top center line", 2) - .addMufflerHatch("Back Center", 3) + .addDynamoHatch("Top center line", 2).addMufflerHatch("Back Center", 3) .toolTipFinisher(CORE.GT_Tooltip_Builder); return tt; } @@ -119,11 +115,14 @@ public class GregtechMetaTileEntity_LargeRocketEngine public IStructureDefinition<GregtechMetaTileEntity_LargeRocketEngine> getStructureDefinition() { if (this.STRUCTURE_DEFINITION == null) { this.STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_LargeRocketEngine>builder() - .addShape(this.mName, transpose(new String[][] { - {"CTC", "CTC", "CTC", "CTC", "CTC", "CTC", "CTC", "CTC", "CTC", "CTC"}, - {"C~C", "SIS", "SIS", "SIS", "SIS", "SIS", "SIS", "SIS", "SIS", "CMC"}, - {"CCC", "CSC", "CSC", "CSC", "CSC", "CSC", "CSC", "CSC", "CSC", "CCC"}, - })) + .addShape( + this.mName, + transpose( + new String[][] { + { "CTC", "CTC", "CTC", "CTC", "CTC", "CTC", "CTC", "CTC", "CTC", "CTC" }, + { "C~C", "SIS", "SIS", "SIS", "SIS", "SIS", "SIS", "SIS", "SIS", "CMC" }, + { "CCC", "CSC", "CSC", "CSC", "CSC", "CSC", "CSC", "CSC", "CSC", + "CCC" }, })) .addElement('C', ofBlock(getCasingBlock(), getCasingMeta())) .addElement('I', ofBlock(getGearboxBlock(), getGearboxMeta())) // side @@ -131,21 +130,20 @@ public class GregtechMetaTileEntity_LargeRocketEngine 'S', buildHatchAdder(GregtechMetaTileEntity_LargeRocketEngine.class) .atLeast(ImmutableMap.of(AirIntake, 8, InputBus, 1, InputHatch, 3, Maintenance, 1)) - .casingIndex(getCasingTextureIndex()) - .dot(1) - .buildAndChain(onElementPass( - x -> ++x.mCasing, ofBlock(getCasingBlock(), getCasingMeta())))) + .casingIndex(getCasingTextureIndex()).dot(1).buildAndChain( + onElementPass( + x -> ++x.mCasing, + ofBlock(getCasingBlock(), getCasingMeta())))) // top .addElement( 'T', buildHatchAdder(GregtechMetaTileEntity_LargeRocketEngine.class) .atLeast(ImmutableMap.of(AirIntake, 8, Dynamo.or(TTDynamo), 1, Maintenance, 1)) - .casingIndex(getCasingTextureIndex()) - .dot(2) - .buildAndChain(onElementPass( - x -> ++x.mCasing, ofBlock(getCasingBlock(), getCasingMeta())))) - .addElement('M', Muffler.newAny(getCasingTextureIndex(), 3)) - .build(); + .casingIndex(getCasingTextureIndex()).dot(2).buildAndChain( + onElementPass( + x -> ++x.mCasing, + ofBlock(getCasingBlock(), getCasingMeta())))) + .addElement('M', Muffler.newAny(getCasingTextureIndex(), 3)).build(); } return this.STRUCTURE_DEFINITION; } @@ -167,8 +165,7 @@ public class GregtechMetaTileEntity_LargeRocketEngine this.mTecTechDynamoHatches.clear(); this.mAllDynamoHatches.clear(); this.mAirIntakes.clear(); - return checkPiece(this.mName, 1, 1, 0) - && this.mCasing >= 64 - 48 + return checkPiece(this.mName, 1, 1, 0) && this.mCasing >= 64 - 48 && this.mAirIntakes.size() >= 1 && checkHatch(); } @@ -338,6 +335,7 @@ public class GregtechMetaTileEntity_LargeRocketEngine /** * Consumes Fuel if required. Free Fuel Ticks are handled here. + * * @param aFuel * @return */ @@ -387,8 +385,9 @@ public class GregtechMetaTileEntity_LargeRocketEngine public boolean consumeLOH() { int LOHamount = (3 * this.euProduction) / 1000; - return this.depleteInput(FluidUtils.getFluidStack( - RocketFuels.Liquid_Hydrogen, LOHamount)); // (40 * ((long) euProduction / 10000)) + return this.depleteInput(FluidUtils.getFluidStack(RocketFuels.Liquid_Hydrogen, LOHamount)); // (40 * ((long) + // euProduction / + // 10000)) } @Override @@ -421,9 +420,10 @@ public class GregtechMetaTileEntity_LargeRocketEngine } else { /** * Calcualtes overclocked ness using long integers - * @param aEUt - recipe EUt - * @param aDuration - recipe Duration - * @param mAmperage - should be 1 ? + * + * @param aEUt - recipe EUt + * @param aDuration - recipe Duration + * @param mAmperage - should be 1 ? */ // Long time calculation if (aFirstVoltageFound != aVoltage) { @@ -473,8 +473,8 @@ public class GregtechMetaTileEntity_LargeRocketEngine if (this.mRuntime % 20 == 0) { if (this.mMufflerHatches.size() == 1 && this.mMufflerHatches.get(0) instanceof GT_MetaTileEntity_Hatch_Muffler_Adv) { - GT_MetaTileEntity_Hatch_Muffler_Adv tMuffler = - (GT_MetaTileEntity_Hatch_Muffler_Adv) this.mMufflerHatches.get(0); + GT_MetaTileEntity_Hatch_Muffler_Adv tMuffler = (GT_MetaTileEntity_Hatch_Muffler_Adv) this.mMufflerHatches + .get(0); if (!tMuffler.hasValidFilter()) { ArrayList<ItemStack> tInputs = getStoredInputs(); for (ItemStack tItem : tInputs) { @@ -553,18 +553,14 @@ public class GregtechMetaTileEntity_LargeRocketEngine @Override public String[] getExtraInfoData() { - return new String[] { - "Rocket Engine", - "Current Air: " + getAir(), - "Current Pollution: " + getPollutionPerTick(null), - "Time until next fuel consumption: " + this.freeFuelTicks, - "Current Output: " + this.lEUt * this.mEfficiency / 10000 + " EU/t", - "Fuel Consumption: " + (this.fuelConsumption) + "L/s", - "Fuel Value: " + this.fuelValue + " EU/L", - "Fuel Remaining: " + this.fuelRemaining + " Litres", - "Current Efficiency: " + this.mEfficiency / 100 + "%", - (this.getIdealStatus() == this.getRepairStatus()) ? "No Maintainance issues" : "Needs Maintainance" - }; + return new String[] { "Rocket Engine", "Current Air: " + getAir(), + "Current Pollution: " + getPollutionPerTick(null), + "Time until next fuel consumption: " + this.freeFuelTicks, + "Current Output: " + this.lEUt * this.mEfficiency / 10000 + " EU/t", + "Fuel Consumption: " + (this.fuelConsumption) + "L/s", "Fuel Value: " + this.fuelValue + " EU/L", + "Fuel Remaining: " + this.fuelRemaining + " Litres", + "Current Efficiency: " + this.mEfficiency / 100 + "%", + (this.getIdealStatus() == this.getRepairStatus()) ? "No Maintainance issues" : "Needs Maintainance" }; } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_LargeSemifluidGenerator.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_LargeSemifluidGenerator.java index cdeebe7f40..1878cc8484 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_LargeSemifluidGenerator.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_LargeSemifluidGenerator.java @@ -10,10 +10,18 @@ import static gregtech.api.enums.GT_HatchElement.Muffler; import static gregtech.api.util.GT_StructureUtility.buildHatchAdder; import static gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase.GTPPHatchElement.TTDynamo; +import java.util.ArrayList; + +import net.minecraft.block.Block; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraftforge.fluids.FluidStack; + import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable; import com.gtnewhorizon.structurelib.structure.IStructureDefinition; import com.gtnewhorizon.structurelib.structure.ISurvivalBuildEnvironment; import com.gtnewhorizon.structurelib.structure.StructureDefinition; + import gregtech.api.GregTech_API; import gregtech.api.enums.Materials; import gregtech.api.enums.Textures; @@ -29,15 +37,9 @@ import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_Recipe; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase; -import java.util.ArrayList; -import net.minecraft.block.Block; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraftforge.fluids.FluidStack; -public class GregtechMetaTileEntity_LargeSemifluidGenerator - extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_LargeSemifluidGenerator> - implements ISurvivalConstructable { +public class GregtechMetaTileEntity_LargeSemifluidGenerator extends + GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_LargeSemifluidGenerator> implements ISurvivalConstructable { private int mCasing; private static IStructureDefinition<GregtechMetaTileEntity_LargeSemifluidGenerator> STRUCTURE_DEFINITION = null; @@ -58,25 +60,17 @@ public class GregtechMetaTileEntity_LargeSemifluidGenerator @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType(getMachineType()) - .addInfo("Controller Block for the Large Semifluid Generator") + tt.addMachineType(getMachineType()).addInfo("Controller Block for the Large Semifluid Generator") .addInfo("Engine Intake Casings must not be obstructed in front (only air blocks)") .addInfo("Supply Semifluid Fuels and 2000L of Lubricant per hour to run.") .addInfo("Supply 80L of Oxygen per second to boost output (optional).") .addInfo("Default: Produces 2048EU/t at 100% efficiency") .addInfo("Boosted: Produces 6144EU/t at 150% efficiency") - .addPollutionAmount(getPollutionPerSecond(null)) - .addSeparator() - .beginStructureBlock(3, 3, 4, false) - .addController("Front Center") - .addCasingInfo("Stable Titanium Machine Casing", 16) - .addCasingInfo("Steel Gear Box Machine Casing", 2) - .addCasingInfo("Engine Intake Machine Casing", 8) - .addInputHatch("Any Casing", 1) - .addMaintenanceHatch("Any Casing", 1) - .addMufflerHatch("Any Casing", 1) - .addDynamoHatch("Back Center", 2) - .toolTipFinisher(CORE.GT_Tooltip_Builder); + .addPollutionAmount(getPollutionPerSecond(null)).addSeparator().beginStructureBlock(3, 3, 4, false) + .addController("Front Center").addCasingInfo("Stable Titanium Machine Casing", 16) + .addCasingInfo("Steel Gear Box Machine Casing", 2).addCasingInfo("Engine Intake Machine Casing", 8) + .addInputHatch("Any Casing", 1).addMaintenanceHatch("Any Casing", 1).addMufflerHatch("Any Casing", 1) + .addDynamoHatch("Back Center", 2).toolTipFinisher(CORE.GT_Tooltip_Builder); return tt; } @@ -166,23 +160,22 @@ public class GregtechMetaTileEntity_LargeSemifluidGenerator public IStructureDefinition<GregtechMetaTileEntity_LargeSemifluidGenerator> getStructureDefinition() { if (STRUCTURE_DEFINITION == null) { STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_LargeSemifluidGenerator>builder() - .addShape(mName, transpose(new String[][] { - {"III", "CCC", "CCC", "CCC"}, - {"I~I", "CGC", "CGC", "CMC"}, - {"III", "CCC", "CCC", "CCC"}, - })) + .addShape( + mName, + transpose( + new String[][] { { "III", "CCC", "CCC", "CCC" }, { "I~I", "CGC", "CGC", "CMC" }, + { "III", "CCC", "CCC", "CCC" }, })) .addElement( 'C', buildHatchAdder(GregtechMetaTileEntity_LargeSemifluidGenerator.class) - .atLeast(Muffler, InputHatch, Maintenance) - .casingIndex(getCasingTextureIndex()) - .dot(1) - .buildAndChain(onElementPass( - x -> ++x.mCasing, ofBlock(getCasingBlock(), getCasingMeta())))) + .atLeast(Muffler, InputHatch, Maintenance).casingIndex(getCasingTextureIndex()) + .dot(1).buildAndChain( + onElementPass( + x -> ++x.mCasing, + ofBlock(getCasingBlock(), getCasingMeta())))) .addElement('G', ofBlock(getGearboxBlock(), getGearboxMeta())) .addElement('I', ofBlock(getIntakeBlock(), getIntakeMeta())) - .addElement('M', Dynamo.or(TTDynamo).newAny(getCasingTextureIndex(), 2)) - .build(); + .addElement('M', Dynamo.or(TTDynamo).newAny(getCasingTextureIndex(), 2)).build(); } return STRUCTURE_DEFINITION; } @@ -297,15 +290,10 @@ public class GregtechMetaTileEntity_LargeSemifluidGenerator @Override public String[] getExtraInfoData() { - return new String[] { - "Large Semifluid Generator", - "Current Output: " + lEUt * mEfficiency / 10000 + " EU/t", - "Fuel Consumption: " + fuelConsumption + "L/t", - "Fuel Value: " + fuelValue + " EU/L", - "Fuel Remaining: " + fuelRemaining + " Litres", - "Current Efficiency: " + (mEfficiency / 100) + "%", - getIdealStatus() == getRepairStatus() ? "No Maintainance issues" : "Needs Maintainance" - }; + return new String[] { "Large Semifluid Generator", "Current Output: " + lEUt * mEfficiency / 10000 + " EU/t", + "Fuel Consumption: " + fuelConsumption + "L/t", "Fuel Value: " + fuelValue + " EU/L", + "Fuel Remaining: " + fuelRemaining + " Litres", "Current Efficiency: " + (mEfficiency / 100) + "%", + getIdealStatus() == getRepairStatus() ? "No Maintainance issues" : "Needs Maintainance" }; } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_MassFabricator.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_MassFabricator.java index 49d867cb76..b5e8bd21e5 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_MassFabricator.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_MassFabricator.java @@ -6,6 +6,13 @@ import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose import static gregtech.api.enums.GT_HatchElement.*; import static gregtech.api.util.GT_StructureUtility.buildHatchAdder; +import java.util.ArrayList; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraftforge.fluids.FluidStack; + import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable; import com.gtnewhorizon.structurelib.structure.IStructureDefinition; import com.gtnewhorizon.structurelib.structure.ISurvivalBuildEnvironment; @@ -13,6 +20,7 @@ import com.gtnewhorizon.structurelib.structure.StructureDefinition; import com.gtnewhorizons.modularui.common.widget.DynamicPositionedColumn; import com.gtnewhorizons.modularui.common.widget.SlotWidget; import com.gtnewhorizons.modularui.common.widget.TextWidget; + import gregtech.api.enums.ConfigCategories; import gregtech.api.enums.Materials; import gregtech.api.enums.TAE; @@ -28,11 +36,6 @@ import gtPlusPlus.core.util.minecraft.MaterialUtils; import gtPlusPlus.core.util.minecraft.PlayerUtils; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; -import java.util.ArrayList; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraftforge.fluids.FluidStack; public class GregtechMetaTileEntity_MassFabricator extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_MassFabricator> implements ISurvivalConstructable { @@ -91,26 +94,14 @@ public class GregtechMetaTileEntity_MassFabricator @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType(getMachineType()) - .addInfo("Controller Block for the Matter Fabricator") - .addInfo("Speed: +0% | EU Usage: 80%") - .addInfo("Parallel: Scrap = 64 | UU = 8 * Tier") - .addInfo("Produces UU-A, UU-M & Scrap") - .addInfo("Change mode with screwdriver") - .addPollutionAmount(getPollutionPerSecond(null)) - .addSeparator() - .beginStructureBlock(5, 4, 5, true) - .addController("Front Center") - .addCasingInfo(mCasingName3, 9) - .addCasingInfo(mCasingName2, 24) - .addCasingInfo(mCasingName1, 40) - .addInputBus("Any Casing", 1) - .addOutputBus("Any Casing", 1) - .addInputHatch("Any Casing", 1) - .addOutputHatch("Any Casing", 1) - .addEnergyHatch("Any Casing", 1) - .addMaintenanceHatch("Any Casing", 1) - .addMufflerHatch("Any Casing", 1) + tt.addMachineType(getMachineType()).addInfo("Controller Block for the Matter Fabricator") + .addInfo("Speed: +0% | EU Usage: 80%").addInfo("Parallel: Scrap = 64 | UU = 8 * Tier") + .addInfo("Produces UU-A, UU-M & Scrap").addInfo("Change mode with screwdriver") + .addPollutionAmount(getPollutionPerSecond(null)).addSeparator().beginStructureBlock(5, 4, 5, true) + .addController("Front Center").addCasingInfo(mCasingName3, 9).addCasingInfo(mCasingName2, 24) + .addCasingInfo(mCasingName1, 40).addInputBus("Any Casing", 1).addOutputBus("Any Casing", 1) + .addInputHatch("Any Casing", 1).addOutputHatch("Any Casing", 1).addEnergyHatch("Any Casing", 1) + .addMaintenanceHatch("Any Casing", 1).addMufflerHatch("Any Casing", 1) .toolTipFinisher(CORE.GT_Tooltip_Builder); return tt; } @@ -133,8 +124,8 @@ public class GregtechMetaTileEntity_MassFabricator @Override public void onConfigLoad(final GT_Config aConfig) { super.onConfigLoad(aConfig); - sDurationMultiplier = aConfig.get( - ConfigCategories.machineconfig, "Massfabricator.UUM_Duration_Multiplier", sDurationMultiplier); + sDurationMultiplier = aConfig + .get(ConfigCategories.machineconfig, "Massfabricator.UUM_Duration_Multiplier", sDurationMultiplier); sUUAperUUM = aConfig.get(ConfigCategories.machineconfig, "Massfabricator.UUA_per_UUM", sUUAperUUM); sUUASpeedBonus = aConfig.get(ConfigCategories.machineconfig, "Massfabricator.UUA_Speed_Bonus", sUUASpeedBonus); sRequiresUUA = aConfig.get(ConfigCategories.machineconfig, "Massfabricator.UUA_Requirement", sRequiresUUA); @@ -175,23 +166,21 @@ public class GregtechMetaTileEntity_MassFabricator public IStructureDefinition<GregtechMetaTileEntity_MassFabricator> getStructureDefinition() { if (STRUCTURE_DEFINITION == null) { STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_MassFabricator>builder() - .addShape(mName, transpose(new String[][] { - {"CCCCC", "CCCCC", "CCCCC", "CCCCC", "CCCCC"}, - {"CGGGC", "G---G", "G---G", "G---G", "CGGGC"}, - {"CGGGC", "G---G", "G---G", "G---G", "CGGGC"}, - {"CC~CC", "CHHHC", "CHHHC", "CHHHC", "CCCCC"}, - })) + .addShape( + mName, + transpose( + new String[][] { { "CCCCC", "CCCCC", "CCCCC", "CCCCC", "CCCCC" }, + { "CGGGC", "G---G", "G---G", "G---G", "CGGGC" }, + { "CGGGC", "G---G", "G---G", "G---G", "CGGGC" }, + { "CC~CC", "CHHHC", "CHHHC", "CHHHC", "CCCCC" }, })) .addElement( 'C', buildHatchAdder(GregtechMetaTileEntity_MassFabricator.class) .atLeast(InputBus, OutputBus, InputHatch, OutputHatch, Maintenance, Energy, Muffler) - .casingIndex(TAE.GTPP_INDEX(9)) - .dot(1) - .buildAndChain( + .casingIndex(TAE.GTPP_INDEX(9)).dot(1).buildAndChain( onElementPass(x -> ++x.mCasing, ofBlock(ModBlocks.blockCasingsMisc, 9)))) .addElement('H', ofBlock(ModBlocks.blockCasingsMisc, 8)) - .addElement('G', ofBlock(ModBlocks.blockCasings3Misc, 15)) - .build(); + .addElement('G', ofBlock(ModBlocks.blockCasings3Misc, 15)).build(); } return STRUCTURE_DEFINITION; } @@ -243,20 +232,14 @@ public class GregtechMetaTileEntity_MassFabricator */ @Override public GT_Recipe_Map getRecipeMap() { - return this.mMode == MODE_SCRAP - ? GT_Recipe_Map.sRecyclerRecipes + return this.mMode == MODE_SCRAP ? GT_Recipe_Map.sRecyclerRecipes : GTPP_Recipe.GTPP_Recipe_Map.sMatterFab2Recipes; // return Recipe_GT.Gregtech_Recipe_Map.sMatterFab2Recipes; } @Override - public boolean checkRecipeGeneric( - ItemStack[] aItemInputs, - FluidStack[] aFluidInputs, - int aMaxParallelRecipes, - long aEUPercent, - int aSpeedBonusPercent, - int aOutputChanceRoll) { + public boolean checkRecipeGeneric(ItemStack[] aItemInputs, FluidStack[] aFluidInputs, int aMaxParallelRecipes, + long aEUPercent, int aSpeedBonusPercent, int aOutputChanceRoll) { if (this.mMode == MODE_SCRAP) { return checkRecipeScrap( aItemInputs, @@ -276,13 +259,8 @@ public class GregtechMetaTileEntity_MassFabricator } } - public boolean checkRecipeScrap( - ItemStack[] aItemInputs, - FluidStack[] aFluidInputs, - int aMaxParallelRecipes, - int aEUPercent, - int aSpeedBonusPercent, - int aOutputChanceRoll) { + public boolean checkRecipeScrap(ItemStack[] aItemInputs, FluidStack[] aFluidInputs, int aMaxParallelRecipes, + int aEUPercent, int aSpeedBonusPercent, int aOutputChanceRoll) { if (aItemInputs == null || aItemInputs.length <= 0) { return false; @@ -294,24 +272,19 @@ public class GregtechMetaTileEntity_MassFabricator ItemStack aPotentialOutput = GT_ModHandler.getRecyclerOutput(GT_Utility.copyAmount(1, aItemInputs[0]), 0); GT_Recipe tRecipe = new GTPP_Recipe( false, - new ItemStack[] {GT_Utility.copyAmount(1, aItemInputs[0])}, - aPotentialOutput == null ? null : new ItemStack[] {aPotentialOutput}, + new ItemStack[] { GT_Utility.copyAmount(1, aItemInputs[0]) }, + aPotentialOutput == null ? null : new ItemStack[] { aPotentialOutput }, null, - new int[] {2000}, + new int[] { 2000 }, null, null, 40, MaterialUtils.getVoltageForTier(1), 0); - GT_ParallelHelper helper = new GT_ParallelHelper() - .setRecipe(tRecipe) - .setItemInputs(aItemInputs) - .setFluidInputs(aFluidInputs) - .setAvailableEUt(tEnergy) - .setMaxParallel(aMaxParallelRecipes) - .enableConsumption() - .enableOutputCalculation(); + GT_ParallelHelper helper = new GT_ParallelHelper().setRecipe(tRecipe).setItemInputs(aItemInputs) + .setFluidInputs(aFluidInputs).setAvailableEUt(tEnergy).setMaxParallel(aMaxParallelRecipes) + .enableConsumption().enableOutputCalculation(); if (!mVoidExcess) { helper.enableVoidProtection(this); } @@ -326,13 +299,9 @@ public class GregtechMetaTileEntity_MassFabricator return false; } - GT_OverclockCalculator calculator = new GT_OverclockCalculator() - .setRecipeEUt(tRecipe.mEUt) - .setEUt(tEnergy) - .setDuration(tRecipe.mDuration) - .setEUtDiscount(aEUPercent / 100.0f) - .setSpeedBoost(100.0f / (100.0f + aSpeedBonusPercent)) - .setParallel(helper.getCurrentParallel()) + GT_OverclockCalculator calculator = new GT_OverclockCalculator().setRecipeEUt(tRecipe.mEUt).setEUt(tEnergy) + .setDuration(tRecipe.mDuration).setEUtDiscount(aEUPercent / 100.0f) + .setSpeedBoost(100.0f / (100.0f + aSpeedBonusPercent)).setParallel(helper.getCurrentParallel()) .calculate(); lEUt = -calculator.getConsumption(); mMaxProgresstime = (int) Math.ceil(calculator.getDuration() * helper.getDurationMultiplier()); @@ -345,13 +314,8 @@ public class GregtechMetaTileEntity_MassFabricator return true; } - public boolean checkRecipeUU( - ItemStack[] aItemInputs, - FluidStack[] aFluidInputs, - int aMaxParallelRecipes, - int aEUPercent, - int aSpeedBonusPercent, - int aOutputChanceRoll) { + public boolean checkRecipeUU(ItemStack[] aItemInputs, FluidStack[] aFluidInputs, int aMaxParallelRecipes, + int aEUPercent, int aSpeedBonusPercent, int aOutputChanceRoll) { // Based on the Processing Array. A bit overkill, but very flexible. @@ -380,14 +344,9 @@ public class GregtechMetaTileEntity_MassFabricator return false; } - GT_ParallelHelper helper = new GT_ParallelHelper() - .setRecipe(tRecipe) - .setItemInputs(aItemInputs) - .setFluidInputs(aFluidInputs) - .setAvailableEUt(tEnergy) - .setMaxParallel(aMaxParallelRecipes) - .enableConsumption() - .enableOutputCalculation(); + GT_ParallelHelper helper = new GT_ParallelHelper().setRecipe(tRecipe).setItemInputs(aItemInputs) + .setFluidInputs(aFluidInputs).setAvailableEUt(tEnergy).setMaxParallel(aMaxParallelRecipes) + .enableConsumption().enableOutputCalculation(); if (!mVoidExcess) { helper.enableVoidProtection(this); } @@ -405,15 +364,10 @@ public class GregtechMetaTileEntity_MassFabricator this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000); this.mEfficiencyIncrease = 10000; - GT_OverclockCalculator calculator = new GT_OverclockCalculator() - .setRecipeEUt(tRecipe.mEUt) - .setEUt(tEnergy) - .setDuration(tRecipe.mDuration) - .setEUtDiscount(aEUPercent / 100.0f) + GT_OverclockCalculator calculator = new GT_OverclockCalculator().setRecipeEUt(tRecipe.mEUt).setEUt(tEnergy) + .setDuration(tRecipe.mDuration).setEUtDiscount(aEUPercent / 100.0f) .setSpeedBoost(100.0f / (100.0f + aSpeedBonusPercent)) - .setParallel(Math.min(aMaxParallelRecipes, helper.getCurrentParallel())) - .enablePerfectOC() - .calculate(); + .setParallel(Math.min(aMaxParallelRecipes, helper.getCurrentParallel())).enablePerfectOC().calculate(); lEUt = -calculator.getConsumption(); mMaxProgresstime = (int) Math.ceil(calculator.getDuration() * helper.getDurationMultiplier()); @@ -510,25 +464,30 @@ public class GregtechMetaTileEntity_MassFabricator super.drawTexts(screenElements, inventorySlot); screenElements - .widget(TextWidget.dynamicString(() -> "Scrap Made: " + mScrapProduced) - .setDefaultColor(COLOR_TEXT_WHITE.get()) - .setEnabled(widget -> getBaseMetaTileEntity().getErrorDisplayID() == 0 - && getBaseMetaTileEntity().isActive())) - .widget(TextWidget.dynamicString(() -> "Scrap Used: " + mScrapUsed) - .setDefaultColor(COLOR_TEXT_WHITE.get()) - .setEnabled(widget -> getBaseMetaTileEntity().getErrorDisplayID() == 0 - && getBaseMetaTileEntity().isActive())) - .widget(TextWidget.dynamicString(() -> "UUA Made: " + mAmplifierProduced) - .setDefaultColor(COLOR_TEXT_WHITE.get()) - .setEnabled(widget -> getBaseMetaTileEntity().getErrorDisplayID() == 0 - && getBaseMetaTileEntity().isActive())) - .widget(TextWidget.dynamicString(() -> "UUA Used: " + mAmplifierUsed) - .setDefaultColor(COLOR_TEXT_WHITE.get()) - .setEnabled(widget -> getBaseMetaTileEntity().getErrorDisplayID() == 0 - && getBaseMetaTileEntity().isActive())) - .widget(TextWidget.dynamicString(() -> "UUM Made: " + mMatterProduced) - .setDefaultColor(COLOR_TEXT_WHITE.get()) - .setEnabled(widget -> getBaseMetaTileEntity().getErrorDisplayID() == 0 - && getBaseMetaTileEntity().isActive())); + .widget( + TextWidget.dynamicString(() -> "Scrap Made: " + mScrapProduced) + .setDefaultColor(COLOR_TEXT_WHITE.get()).setEnabled( + widget -> getBaseMetaTileEntity().getErrorDisplayID() == 0 + && getBaseMetaTileEntity().isActive())) + .widget( + TextWidget.dynamicString(() -> "Scrap Used: " + mScrapUsed) + .setDefaultColor(COLOR_TEXT_WHITE.get()).setEnabled( + widget -> getBaseMetaTileEntity().getErrorDisplayID() == 0 + && getBaseMetaTileEntity().isActive())) + .widget( + TextWidget.dynamicString(() -> "UUA Made: " + mAmplifierProduced) + .setDefaultColor(COLOR_TEXT_WHITE.get()).setEnabled( + widget -> getBaseMetaTileEntity().getErrorDisplayID() == 0 + && getBaseMetaTileEntity().isActive())) + .widget( + TextWidget.dynamicString(() -> "UUA Used: " + mAmplifierUsed) + .setDefaultColor(COLOR_TEXT_WHITE.get()).setEnabled( + widget -> getBaseMetaTileEntity().getErrorDisplayID() == 0 + && getBaseMetaTileEntity().isActive())) + .widget( + TextWidget.dynamicString(() -> "UUM Made: " + mMatterProduced) + .setDefaultColor(COLOR_TEXT_WHITE.get()).setEnabled( + widget -> getBaseMetaTileEntity().getErrorDisplayID() == 0 + && getBaseMetaTileEntity().isActive())); } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_QuantumForceTransformer.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_QuantumForceTransformer.java index 80edf59fe3..1c76c02b8c 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_QuantumForceTransformer.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_QuantumForceTransformer.java @@ -5,8 +5,29 @@ import static gregtech.api.enums.GT_HatchElement.*; import static gregtech.api.util.GT_OreDictUnificator.getAssociation; import static gregtech.api.util.GT_StructureUtility.buildHatchAdder; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import net.minecraft.block.Block; +import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.IIcon; +import net.minecraft.util.StatCollector; +import net.minecraft.world.IBlockAccess; +import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidStack; + +import org.apache.commons.lang3.tuple.Pair; +import org.lwjgl.opengl.GL11; + import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable; import com.gtnewhorizon.structurelib.structure.*; + import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.GregTech_API; @@ -29,23 +50,6 @@ import gtPlusPlus.core.block.ModBlocks; import gtPlusPlus.core.material.ELEMENT; import gtPlusPlus.core.util.minecraft.ItemUtils; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import net.minecraft.block.Block; -import net.minecraft.client.renderer.RenderBlocks; -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.IIcon; -import net.minecraft.util.StatCollector; -import net.minecraft.world.IBlockAccess; -import net.minecraftforge.fluids.Fluid; -import net.minecraftforge.fluids.FluidStack; -import org.apache.commons.lang3.tuple.Pair; -import org.lwjgl.opengl.GL11; public class GregtechMetaTileEntity_QuantumForceTransformer extends GT_MetaTileEntity_ExtendedPowerMultiBlockBase<GregtechMetaTileEntity_QuantumForceTransformer> @@ -61,412 +65,149 @@ public class GregtechMetaTileEntity_QuantumForceTransformer private static final String MAIN_PIECE = "main"; private GT_MetaTileEntity_Hatch_Input mNeptuniumHatch; private GT_MetaTileEntity_Hatch_Input mFermiumHatch; - private static final IStructureDefinition<GregtechMetaTileEntity_QuantumForceTransformer> STRUCTURE_DEFINITION = - StructureDefinition.<GregtechMetaTileEntity_QuantumForceTransformer>builder() - .addShape(MAIN_PIECE, new String[][] { // A - 142, B - 234, C - 177, D - 96, E - 224, H - 36, M - 21 - { - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " BAB ", - " BBBBABBBB ", - " BAAAAAAAB ", - " BABBABBAB ", - " BA AB ", - " A A ", - " A A ", - " A A " - }, - { - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " BAB ", - " AAABBBAAA ", - " BAAAAAAAAAB ", - " B B ", - " A A ", - " A A ", - " ", - " ", - " " - }, - { - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " BAB ", - " AA AA ", - " AA AA ", - " BAA AAB ", - " B B ", - " A A ", - " A A ", - " ", - " ", - " " - }, - { - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " BAAAB ", - " AA AA ", - " AA AA ", - "BAA AAB", - "B B", - "A A", - "A A", - "A A", - "A A", - "A A" - }, - { - " TTT ", - " EEE ", - " EEE ", - " EEE ", - " DDD ", - " EEE ", - " DDD ", - " EEE ", - " EEE ", - " EEE ", - " DDD ", - " BAEEEAB ", - " AA EEE AA ", - " A EEE A ", - "BA DDD AB", - "B EEE B", - "B DDD B", - " EEE ", - " EEE ", - " EEE ", - " Z~X " - }, - { - " TTTTT ", - " ECCCE ", - " ECCCE ", - " ECCCE ", - " D D ", - " ECCCE ", - " D D ", - " ECCCE ", - " ECCCE ", - " ECCCE ", - " D D ", - " BAECCCEAB ", - " A ECCCE A ", - " A ECCCE A ", - "BA D D AB", - "B ECCCE B", - "B D D B", - "B ECCCE B", - " ECCCE ", - " ECCCE ", - " HHHHH " - }, - { - " TTTTTTT ", - " ECCCCCE ", - " EC CE ", - " EC CE ", - " D D ", - " EC CE ", - " D D ", - " EC CE ", - " EC CE ", - " EC CE ", - " D D ", - " BAEC CEAB ", - " B EC CE B ", - "BB EC CE BB", - "BA D D AB", - "A EC CE A", - "A D D A", - "A EC CE A", - " EC CE ", - " EC CE ", - " HHHHHHH " - }, - { - " TTTTTTT ", - " ECCCCCE ", - " EC CE ", - " EC CE ", - " D D ", - " EC CE ", - " D D ", - " EC CE ", - " EC CE ", - " EC CE ", - " D D ", - " AAEC CEAA ", - " A EC CE A ", - "AB EC CE BA", - "AA D D AA", - "A EC CE A", - "A D D A", - " EC CE ", - " EC CE ", - " EC CE ", - " HHHHHHH " - }, - { - " TTTTTTT ", - " ECCCCCE ", - " EC CE ", - " EC CE ", - " D D ", - " EC CE ", - " D D ", - " EC CE ", - " EC CE ", - " EC CE ", - " D D ", - " BAEC CEAB ", - " B EC CE B ", - "BB EC CE BB", - "BA D D AB", - "A EC CE A", - "A D D A", - "A EC CE A", - " EC CE ", - " EC CE ", - " HHHHHHH " - }, - { - " TTTTT ", - " ECCCE ", - " ECCCE ", - " ECCCE ", - " D D ", - " ECCCE ", - " D D ", - " ECCCE ", - " ECCCE ", - " ECCCE ", - " D D ", - " BAECCCEAB ", - " A ECCCE A ", - " A ECCCE A ", - "BA D D AB", - "B ECCCE B", - "B D D B", - "B ECCCE B", - " ECCCE ", - " ECCCE ", - " HHHHH " - }, - { - " TTT ", - " EEE ", - " EEE ", - " EEE ", - " DDD ", - " EEE ", - " DDD ", - " EEE ", - " EEE ", - " EEE ", - " DDD ", - " BAEEEAB ", - " AA EEE AA ", - " A EEE A ", - "BA DDD AB", - "B EEE B", - "B DDD B", - " EEE ", - " EEE ", - " EEE ", - " HHH " - }, - { - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " BAAAB ", - " AA AA ", - " AA AA ", - "BAA AB", - "B B", - "A A", - "A A", - "A A", - "A A", - "A A" - }, - { - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " BAB ", - " AA AA ", - " AA AA ", - " BA AB ", - " B B ", - " A A ", - " A A ", - " ", - " ", - " " - }, - { - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " BAB ", - " AAABBBAAA ", - " BAAAAAAAAAB ", - " B B ", - " A A ", - " A A ", - " ", - " ", - " " - }, - { - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " BAB ", - " BBBBABBBB ", - " BBBAAABBB ", - " ABBAAABBA ", - " A BA AB A ", - " A A ", - " A A ", - " A A " - }, - }) - .addElement( - 'A', - StructureUtility.ofBlocksTiered( - craftingTierConverter(), - getAllCraftingTiers(), - 0, - GregtechMetaTileEntity_QuantumForceTransformer::setCraftingTier, - GregtechMetaTileEntity_QuantumForceTransformer::getCraftingTier)) - .addElement( - 'B', - StructureUtility.ofBlocksTiered( - focusingTierConverter(), - getAllFocusingTiers(), - 0, - GregtechMetaTileEntity_QuantumForceTransformer::setFocusingTier, - GregtechMetaTileEntity_QuantumForceTransformer::getFocusingTier)) - .addElement('C', ofBlock(ModBlocks.blockCasings4Misc, 4)) - .addElement('D', ofBlock(ModBlocks.blockCasings2Misc, 12)) - .addElement('E', lazy(t -> ofBlock(t.getCasingBlock1(), t.getCasingMeta1()))) - .addElement( - 'H', - buildHatchAdder(GregtechMetaTileEntity_QuantumForceTransformer.class) - .atLeast(InputBus, InputHatch, Maintenance, Energy.or(ExoticEnergy)) - .casingIndex(TAE.getIndexFromPage(0, 10)) - .dot(4) - .buildAndChain( - onElementPass(x -> ++x.mCasing, ofBlock(ModBlocks.blockCasings2Misc, 12)))) - .addElement( - 'T', - buildHatchAdder(GregtechMetaTileEntity_QuantumForceTransformer.class) - .atLeast(OutputBus, OutputHatch, Maintenance) - .casingIndex(TAE.getIndexFromPage(0, 10)) - .dot(5) - .buildAndChain( - onElementPass(x -> ++x.mCasing, ofBlock(ModBlocks.blockCasings2Misc, 12)))) - .addElement( - 'Z', - buildHatchAdder(GregtechMetaTileEntity_QuantumForceTransformer.class) - .hatchClass(GT_MetaTileEntity_Hatch_Input.class) - .adder(GregtechMetaTileEntity_QuantumForceTransformer::addNeptuniumHatch) - .casingIndex(TAE.getIndexFromPage(0, 10)) - .dot(5) - .buildAndChain( - onElementPass(x -> ++x.mCasing, ofBlock(ModBlocks.blockCasings2Misc, 12)))) - .addElement( - 'X', - buildHatchAdder(GregtechMetaTileEntity_QuantumForceTransformer.class) - .hatchClass(GT_MetaTileEntity_Hatch_Input.class) - .adder(GregtechMetaTileEntity_QuantumForceTransformer::addFermiumHatch) - .casingIndex(TAE.getIndexFromPage(0, 10)) - .dot(5) - .buildAndChain( - onElementPass(x -> ++x.mCasing, ofBlock(ModBlocks.blockCasings2Misc, 12)))) - .build(); - - public GregtechMetaTileEntity_QuantumForceTransformer( - final int aID, final String aName, final String aNameRegional) { + private static final IStructureDefinition<GregtechMetaTileEntity_QuantumForceTransformer> STRUCTURE_DEFINITION = StructureDefinition + .<GregtechMetaTileEntity_QuantumForceTransformer>builder().addShape( + MAIN_PIECE, + new String[][] { // A - 142, B - 234, C - 177, D - 96, E - 224, H - 36, M - 21 + { " ", " ", " ", " ", + " ", " ", " ", " ", + " ", " ", " ", " ", + " ", " BAB ", " BBBBABBBB ", " BAAAAAAAB ", + " BABBABBAB ", " BA AB ", " A A ", " A A ", + " A A " }, + { " ", " ", " ", " ", + " ", " ", " ", " ", + " ", " ", " ", " ", + " BAB ", " AAABBBAAA ", " BAAAAAAAAAB ", " B B ", + " A A ", " A A ", " ", " ", + " " }, + { " ", " ", " ", " ", + " ", " ", " ", " ", + " ", " ", " ", " BAB ", + " AA AA ", " AA AA ", " BAA AAB ", " B B ", + " A A ", " A A ", " ", " ", + " " }, + { " ", " ", " ", " ", + " ", " ", " ", " ", + " ", " ", " ", " BAAAB ", + " AA AA ", " AA AA ", "BAA AAB", "B B", + "A A", "A A", "A A", "A A", + "A A" }, + { " TTT ", " EEE ", " EEE ", " EEE ", + " DDD ", " EEE ", " DDD ", " EEE ", + " EEE ", " EEE ", " DDD ", " BAEEEAB ", + " AA EEE AA ", " A EEE A ", "BA DDD AB", "B EEE B", + "B DDD B", " EEE ", " EEE ", " EEE ", + " Z~X " }, + { " TTTTT ", " ECCCE ", " ECCCE ", " ECCCE ", + " D D ", " ECCCE ", " D D ", " ECCCE ", + " ECCCE ", " ECCCE ", " D D ", " BAECCCEAB ", + " A ECCCE A ", " A ECCCE A ", "BA D D AB", "B ECCCE B", + "B D D B", "B ECCCE B", " ECCCE ", " ECCCE ", + " HHHHH " }, + { " TTTTTTT ", " ECCCCCE ", " EC CE ", " EC CE ", + " D D ", " EC CE ", " D D ", " EC CE ", + " EC CE ", " EC CE ", " D D ", " BAEC CEAB ", + " B EC CE B ", "BB EC CE BB", "BA D D AB", "A EC CE A", + "A D D A", "A EC CE A", " EC CE ", " EC CE ", + " HHHHHHH " }, + { " TTTTTTT ", " ECCCCCE ", " EC CE ", " EC CE ", + " D D ", " EC CE ", " D D ", " EC CE ", + " EC CE ", " EC CE ", " D D ", " AAEC CEAA ", + " A EC CE A ", "AB EC CE BA", "AA D D AA", "A EC CE A", + "A D D A", " EC CE ", " EC CE ", " EC CE ", + " HHHHHHH " }, + { " TTTTTTT ", " ECCCCCE ", " EC CE ", " EC CE ", + " D D ", " EC CE ", " D D ", " EC CE ", + " EC CE ", " EC CE ", " D D ", " BAEC CEAB ", + " B EC CE B ", "BB EC CE BB", "BA D D AB", "A EC CE A", + "A D D A", "A EC CE A", " EC CE ", " EC CE ", + " HHHHHHH " }, + { " TTTTT ", " ECCCE ", " ECCCE ", " ECCCE ", + " D D ", " ECCCE ", " D D ", " ECCCE ", + " ECCCE ", " ECCCE ", " D D ", " BAECCCEAB ", + " A ECCCE A ", " A ECCCE A ", "BA D D AB", "B ECCCE B", + "B D D B", "B ECCCE B", " ECCCE ", " ECCCE ", + " HHHHH " }, + { " TTT ", " EEE ", " EEE ", " EEE ", + " DDD ", " EEE ", " DDD ", " EEE ", + " EEE ", " EEE ", " DDD ", " BAEEEAB ", + " AA EEE AA ", " A EEE A ", "BA DDD AB", "B EEE B", + "B DDD B", " EEE ", " EEE ", " EEE ", + " HHH " }, + { " ", " ", " ", " ", + " ", " ", " ", " ", + " ", " ", " ", " BAAAB ", + " AA AA ", " AA AA ", "BAA AB", "B B", + "A A", "A A", "A A", "A A", + "A A" }, + { " ", " ", " ", " ", + " ", " ", " ", " ", + " ", " ", " ", " BAB ", + " AA AA ", " AA AA ", " BA AB ", " B B ", + " A A ", " A A ", " ", " ", + " " }, + { " ", " ", " ", " ", + " ", " ", " ", " ", + " ", " ", " ", " ", + " BAB ", " AAABBBAAA ", " BAAAAAAAAAB ", " B B ", + " A A ", " A A ", " ", " ", + " " }, + { " ", " ", " ", " ", + " ", " ", " ", " ", + " ", " ", " ", " ", + " ", " BAB ", " BBBBABBBB ", " BBBAAABBB ", + " ABBAAABBA ", " A BA AB A ", " A A ", " A A ", + " A A " }, }) + .addElement( + 'A', + StructureUtility.ofBlocksTiered( + craftingTierConverter(), + getAllCraftingTiers(), + 0, + GregtechMetaTileEntity_QuantumForceTransformer::setCraftingTier, + GregtechMetaTileEntity_QuantumForceTransformer::getCraftingTier)) + .addElement( + 'B', + StructureUtility.ofBlocksTiered( + focusingTierConverter(), + getAllFocusingTiers(), + 0, + GregtechMetaTileEntity_QuantumForceTransformer::setFocusingTier, + GregtechMetaTileEntity_QuantumForceTransformer::getFocusingTier)) + .addElement('C', ofBlock(ModBlocks.blockCasings4Misc, 4)) + .addElement('D', ofBlock(ModBlocks.blockCasings2Misc, 12)) + .addElement('E', lazy(t -> ofBlock(t.getCasingBlock1(), t.getCasingMeta1()))) + .addElement( + 'H', + buildHatchAdder(GregtechMetaTileEntity_QuantumForceTransformer.class) + .atLeast(InputBus, InputHatch, Maintenance, Energy.or(ExoticEnergy)) + .casingIndex(TAE.getIndexFromPage(0, 10)).dot(4) + .buildAndChain(onElementPass(x -> ++x.mCasing, ofBlock(ModBlocks.blockCasings2Misc, 12)))) + .addElement( + 'T', + buildHatchAdder(GregtechMetaTileEntity_QuantumForceTransformer.class) + .atLeast(OutputBus, OutputHatch, Maintenance).casingIndex(TAE.getIndexFromPage(0, 10)) + .dot(5) + .buildAndChain(onElementPass(x -> ++x.mCasing, ofBlock(ModBlocks.blockCasings2Misc, 12)))) + .addElement( + 'Z', + buildHatchAdder(GregtechMetaTileEntity_QuantumForceTransformer.class) + .hatchClass(GT_MetaTileEntity_Hatch_Input.class) + .adder(GregtechMetaTileEntity_QuantumForceTransformer::addNeptuniumHatch) + .casingIndex(TAE.getIndexFromPage(0, 10)).dot(5) + .buildAndChain(onElementPass(x -> ++x.mCasing, ofBlock(ModBlocks.blockCasings2Misc, 12)))) + .addElement( + 'X', + buildHatchAdder(GregtechMetaTileEntity_QuantumForceTransformer.class) + .hatchClass(GT_MetaTileEntity_Hatch_Input.class) + .adder(GregtechMetaTileEntity_QuantumForceTransformer::addFermiumHatch) + .casingIndex(TAE.getIndexFromPage(0, 10)).dot(5) + .buildAndChain(onElementPass(x -> ++x.mCasing, ofBlock(ModBlocks.blockCasings2Misc, 12)))) + .build(); + + public GregtechMetaTileEntity_QuantumForceTransformer(final int aID, final String aName, + final String aNameRegional) { super(aID, aName, aNameRegional); } @@ -482,8 +223,7 @@ public class GregtechMetaTileEntity_QuantumForceTransformer @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType("Quantum Force Transformer") - .addInfo("Controller Block for the Quantum Force Transformer") + tt.addMachineType("Quantum Force Transformer").addInfo("Controller Block for the Quantum Force Transformer") .addInfo("Allows Complex chemical lines to be performed instantly in one step") .addInfo("Every recipe requires a catalyst, each catalyst adds 1 parallel and lasts forever") .addInfo("Accepts TecTech Energy and Laser Hatches") @@ -497,25 +237,19 @@ public class GregtechMetaTileEntity_QuantumForceTransformer .addInfo("Casing functions:") .addInfo("Pulse Manipulators: Recipe Tier Allowed (check NEI for the tier of each recipe)") .addInfo("Shielding Cores: Focusing Tier (equal to or higher than recipe tier to allow focus)") - .addPollutionAmount(getPollutionPerSecond(null)) - .addSeparator() - .beginStructureBlock(15, 21, 15, true) - .addController("Bottom Center") - .addCasingInfo("Bulk Production Frame", 80) - .addCasingInfo("Quantum Force Conductor", 177) - .addCasingInfo("Particle Containment Casing", 224) - .addCasingInfo("Neutron Pulse Manipulators", 233) - .addCasingInfo("Neutron Shielding Cores", 142) - .addInputBus("Bottom Layer", 4) - .addInputHatch("Bottom Layer", 4) - .addOutputHatch("Top Layer", 5) - .addOutputBus("Top Layer", 5) - .addEnergyHatch("Bottom Layer", 4) - .addMaintenanceHatch("Bottom Layer", 4) + .addPollutionAmount(getPollutionPerSecond(null)).addSeparator().beginStructureBlock(15, 21, 15, true) + .addController("Bottom Center").addCasingInfo("Bulk Production Frame", 80) + .addCasingInfo("Quantum Force Conductor", 177).addCasingInfo("Particle Containment Casing", 224) + .addCasingInfo("Neutron Pulse Manipulators", 233).addCasingInfo("Neutron Shielding Cores", 142) + .addInputBus("Bottom Layer", 4).addInputHatch("Bottom Layer", 4).addOutputHatch("Top Layer", 5) + .addOutputBus("Top Layer", 5).addEnergyHatch("Bottom Layer", 4).addMaintenanceHatch("Bottom Layer", 4) .addStructureInfo("Neptunium Plasma Hatch: Left side of Controller") - .addStructureInfo("Fermium Plasma Hatch: Right side of Controller") - .toolTipFinisher(GT_Values.AuthorBlueWeabo + EnumChatFormatting.RESET + EnumChatFormatting.GREEN - + " + Steelux" + EnumChatFormatting.RESET + " - [GT++]"); + .addStructureInfo("Fermium Plasma Hatch: Right side of Controller").toolTipFinisher( + GT_Values.AuthorBlueWeabo + EnumChatFormatting.RESET + + EnumChatFormatting.GREEN + + " + Steelux" + + EnumChatFormatting.RESET + + " - [GT++]"); return tt; } @@ -531,8 +265,7 @@ public class GregtechMetaTileEntity_QuantumForceTransformer return false; } - if (mMaintenanceHatches.size() != 1 - || mOutputBusses.size() < 1 + if (mMaintenanceHatches.size() != 1 || mOutputBusses.size() < 1 || mInputBusses.size() < 1 || mInputHatches.size() < 1 || mOutputHatches.size() < 1) { @@ -575,6 +308,7 @@ public class GregtechMetaTileEntity_QuantumForceTransformer public static List<Pair<Block, Integer>> getAllCraftingTiers() { return new ArrayList<Pair<Block, Integer>>() { + { add(Pair.of(ModBlocks.blockCasings5Misc, 7)); add(Pair.of(ModBlocks.blockCasings5Misc, 8)); @@ -586,6 +320,7 @@ public class GregtechMetaTileEntity_QuantumForceTransformer public static List<Pair<Block, Integer>> getAllFocusingTiers() { return new ArrayList<Pair<Block, Integer>>() { + { add(Pair.of(ModBlocks.blockCasings5Misc, 11)); add(Pair.of(ModBlocks.blockCasings5Misc, 12)); @@ -713,11 +448,15 @@ public class GregtechMetaTileEntity_QuantumForceTransformer return false; } - private boolean processRecipe( - ItemStack[] aItemInputs, FluidStack[] aFluidInputs, GT_Recipe.GT_Recipe_Map aRecipeMap, ItemStack aStack) { + private boolean processRecipe(ItemStack[] aItemInputs, FluidStack[] aFluidInputs, + GT_Recipe.GT_Recipe_Map aRecipeMap, ItemStack aStack) { byte tTier = (byte) Math.max(1, GT_Utility.getTier(getAverageInputVoltage())); GT_Recipe tRecipe = aRecipeMap.findRecipe( - getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[tTier], aFluidInputs, aItemInputs); + getBaseMetaTileEntity(), + false, + gregtech.api.enums.GT_Values.V[tTier], + aFluidInputs, + aItemInputs); if (tRecipe != null && tRecipe.mSpecialValue <= getCraftingTier()) { ItemStack aRecipeCatalyst = null; @@ -755,13 +494,9 @@ public class GregtechMetaTileEntity_QuantumForceTransformer doFermium = false; } - GT_ParallelHelper helper = new GT_ParallelHelper() - .setRecipe(tRecipe) - .setItemInputs(aItemInputs) - .setFluidInputs(aFluidInputs) - .setAvailableEUt(getMaxInputAmps() * getAverageInputVoltage()) - .setMaxParallel(mCurrentMaxParallel) - .enableConsumption(); + GT_ParallelHelper helper = new GT_ParallelHelper().setRecipe(tRecipe).setItemInputs(aItemInputs) + .setFluidInputs(aFluidInputs).setAvailableEUt(getMaxInputAmps() * getAverageInputVoltage()) + .setMaxParallel(mCurrentMaxParallel).enableConsumption(); if (mBatchMode) { helper.enableBatchMode(128); @@ -773,13 +508,9 @@ public class GregtechMetaTileEntity_QuantumForceTransformer return false; } - GT_OverclockCalculator calculator = new GT_OverclockCalculator() - .setRecipeEUt(tRecipe.mEUt) - .setEUt(getAverageInputVoltage()) - .setAmperage(getMaxInputAmps()) - .setDuration(tRecipe.mDuration) - .setParallel(Math.min(mMaxParallel, helper.getCurrentParallel())) - .calculate(); + GT_OverclockCalculator calculator = new GT_OverclockCalculator().setRecipeEUt(tRecipe.mEUt) + .setEUt(getAverageInputVoltage()).setAmperage(getMaxInputAmps()).setDuration(tRecipe.mDuration) + .setParallel(Math.min(mMaxParallel, helper.getCurrentParallel())).calculate(); lEUt = -calculator.getConsumption(); mMaxProgresstime = (int) Math.ceil(calculator.getDuration() * helper.getDurationMultiplier()); @@ -793,8 +524,7 @@ public class GregtechMetaTileEntity_QuantumForceTransformer } int[] tChances; - if (aStack == null - || aStack.getItemDamage() == 0 + if (aStack == null || aStack.getItemDamage() == 0 || mNeptuniumHatch.getFluid() == null || !mNeptuniumHatch.getFluid().isFluidEqual(new FluidStack(mNeptunium, 1)) || tRecipe.mSpecialValue > getFocusingTier()) { @@ -828,8 +558,8 @@ public class GregtechMetaTileEntity_QuantumForceTransformer } } else { ItemStack aItem = tRecipe.getOutput(i); - tItemOutputs.add( - GT_Utility.copyAmountUnsafe(aItem.stackSize * mCurrentParallel, aItem)); + tItemOutputs + .add(GT_Utility.copyAmountUnsafe(aItem.stackSize * mCurrentParallel, aItem)); } } else { FluidStack aFluid = tRecipe.getFluidOutput(i - tRecipe.mOutputs.length); @@ -845,8 +575,7 @@ public class GregtechMetaTileEntity_QuantumForceTransformer aItem.stackSize *= mCurrentParallel; tItemOutputs.add(aItem); } else { - FluidStack aFluid = tRecipe.getFluidOutput(i - tRecipe.mOutputs.length) - .copy(); + FluidStack aFluid = tRecipe.getFluidOutput(i - tRecipe.mOutputs.length).copy(); aFluid.amount *= mCurrentParallel; tFluidOutputs.add(aFluid); } @@ -875,8 +604,9 @@ public class GregtechMetaTileEntity_QuantumForceTransformer if (runningTick % 20 == 0) { if (doFermium) { - FluidStack tFluid = - new FluidStack(mFermium, (int) (getFocusingTier() * 4 * Math.sqrt(mCurrentParallel))); + FluidStack tFluid = new FluidStack( + mFermium, + (int) (getFocusingTier() * 4 * Math.sqrt(mCurrentParallel))); FluidStack tLiquid = mFermiumHatch.drain(tFluid.amount, true); if (tLiquid == null || tLiquid.amount < tFluid.amount) { doFermium = false; @@ -886,8 +616,9 @@ public class GregtechMetaTileEntity_QuantumForceTransformer } if (doNeptunium) { - FluidStack tFluid = - new FluidStack(mNeptunium, (int) (getFocusingTier() * 4 * Math.sqrt(mCurrentParallel))); + FluidStack tFluid = new FluidStack( + mNeptunium, + (int) (getFocusingTier() * 4 * Math.sqrt(mCurrentParallel))); FluidStack tLiquid = mNeptuniumHatch.drain(tFluid.amount, true); if (tLiquid == null || tLiquid.amount < tFluid.amount) { doNeptunium = false; @@ -995,8 +726,8 @@ public class GregtechMetaTileEntity_QuantumForceTransformer } @Override - public boolean onWireCutterRightClick( - byte aSide, byte aWrenchingSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { + public boolean onWireCutterRightClick(byte aSide, byte aWrenchingSide, EntityPlayer aPlayer, float aX, float aY, + float aZ) { if (aPlayer.isSneaking()) { mBatchMode = !mBatchMode; if (mBatchMode) { @@ -1008,7 +739,8 @@ public class GregtechMetaTileEntity_QuantumForceTransformer } mSeparateInputBusses = !mSeparateInputBusses; GT_Utility.sendChatToPlayer( - aPlayer, StatCollector.translateToLocal("GT5U.machines.separatebus") + " " + mSeparateInputBusses); + aPlayer, + StatCollector.translateToLocal("GT5U.machines.separatebus") + " " + mSeparateInputBusses); return true; } @@ -1016,7 +748,8 @@ public class GregtechMetaTileEntity_QuantumForceTransformer public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { mFluidMode = !mFluidMode; GT_Utility.sendChatToPlayer( - aPlayer, StatCollector.translateToLocal("miscutils.machines.QFTFluidMode") + " " + mFluidMode); + aPlayer, + StatCollector.translateToLocal("miscutils.machines.QFTFluidMode") + " " + mFluidMode); } public boolean addNeptuniumHatch(IGregTechTileEntity aTileEntity, short aBaseCasingIndex) { @@ -1074,31 +807,15 @@ public class GregtechMetaTileEntity_QuantumForceTransformer } @Override - public ITexture[] getTexture( - IGregTechTileEntity aBaseMetaTileEntity, - byte aSide, - byte aFacing, - byte aColorIndex, - boolean aActive, - boolean aRedstone) { + public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, + boolean aActive, boolean aRedstone) { if (aSide == aFacing) { - if (aActive) - return new ITexture[] { - getCasingTexture(), - TextureFactory.builder() - .addIcon(getActiveOverlay()) - .extFacing() - .build() - }; - return new ITexture[] { - getCasingTexture(), - TextureFactory.builder() - .addIcon(getInactiveOverlay()) - .extFacing() - .build() - }; + if (aActive) return new ITexture[] { getCasingTexture(), + TextureFactory.builder().addIcon(getActiveOverlay()).extFacing().build() }; + return new ITexture[] { getCasingTexture(), + TextureFactory.builder().addIcon(getInactiveOverlay()).extFacing().build() }; } - return new ITexture[] {getCasingTexture()}; + return new ITexture[] { getCasingTexture() }; } private ITexture getCasingTexture() { @@ -1106,8 +823,8 @@ public class GregtechMetaTileEntity_QuantumForceTransformer } @SideOnly(Side.CLIENT) - private void renderForceField( - double x, double y, double z, int side, double minU, double maxU, double minV, double maxV) { + private void renderForceField(double x, double y, double z, int side, double minU, double maxU, double minV, + double maxV) { // spotless:off Tessellator tes = Tessellator.instance; switch (side) { diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_Refinery.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_Refinery.java index b557272c82..6d359f43cc 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_Refinery.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_Refinery.java @@ -8,10 +8,13 @@ import static gregtech.api.enums.GT_HatchElement.*; import static gregtech.api.util.GT_StructureUtility.buildHatchAdder; import static gregtech.api.util.GT_StructureUtility.filterByMTETier; +import net.minecraft.item.ItemStack; + import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable; import com.gtnewhorizon.structurelib.structure.IStructureDefinition; import com.gtnewhorizon.structurelib.structure.ISurvivalBuildEnvironment; import com.gtnewhorizon.structurelib.structure.StructureDefinition; + import gregtech.api.enums.TAE; import gregtech.api.enums.Textures; import gregtech.api.interfaces.IIconContainer; @@ -25,7 +28,6 @@ import gregtech.api.util.GT_Recipe.GT_Recipe_Map; import gtPlusPlus.core.block.ModBlocks; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase; -import net.minecraft.item.ItemStack; public class GregtechMetaTileEntity_Refinery extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_Refinery> implements ISurvivalConstructable { @@ -49,22 +51,13 @@ public class GregtechMetaTileEntity_Refinery extends GregtechMeta_MultiBlockBase @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType(getMachineType()) - .addInfo("Controller Block for the Fission Fuel Processing Unit") - .addPollutionAmount(getPollutionPerSecond(null)) - .addSeparator() - .beginStructureBlock(3, 9, 3, false) - .addController("Bottom Center") - .addCasingInfo("Hastelloy-X Structural Casing", 7) - .addCasingInfo("Incoloy-DS Fluid Containment Block", 5) - .addCasingInfo("Zeron-100 Reactor Shielding", 4) - .addCasingInfo("Hastelloy-N Sealant Blocks", 17) - .addInputHatch("Base platform", 1) - .addOutputHatch("Base platform", 1) - .addOutputBus("Base platform", 1) - .addMufflerHatch("Base platform", 1) - .addMaintenanceHatch("Base platform", 1) - .addEnergyHatch("Base platform", 1) + tt.addMachineType(getMachineType()).addInfo("Controller Block for the Fission Fuel Processing Unit") + .addPollutionAmount(getPollutionPerSecond(null)).addSeparator().beginStructureBlock(3, 9, 3, false) + .addController("Bottom Center").addCasingInfo("Hastelloy-X Structural Casing", 7) + .addCasingInfo("Incoloy-DS Fluid Containment Block", 5).addCasingInfo("Zeron-100 Reactor Shielding", 4) + .addCasingInfo("Hastelloy-N Sealant Blocks", 17).addInputHatch("Base platform", 1) + .addOutputHatch("Base platform", 1).addOutputBus("Base platform", 1).addMufflerHatch("Base platform", 1) + .addMaintenanceHatch("Base platform", 1).addEnergyHatch("Base platform", 1) .addStructureInfo("Muffler's Tier must be IV+") .addStructureInfo("4x Input Hatches, 2x Output Hatches, 1x Output Bus") .addStructureInfo("1x Muffler, 1x Maintenance Hatch, 1x Energy Hatch") @@ -130,37 +123,26 @@ public class GregtechMetaTileEntity_Refinery extends GregtechMeta_MultiBlockBase @Override public IStructureDefinition<GregtechMetaTileEntity_Refinery> getStructureDefinition() { if (STRUCTURE_DEFINITION == null) { - STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_Refinery>builder() - .addShape(mName, transpose(new String[][] { - {" ", " N ", " "}, - {" N ", "NIN", " N "}, - {" N ", "NIN", " N "}, - {" N ", "NIN", " N "}, - {" Z ", "ZIZ", " Z "}, - {" N ", "NIN", " N "}, - {"XXX", "XXX", "XXX"}, - {"X~X", "XXX", "XXX"}, - })) + STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_Refinery>builder().addShape( + mName, + transpose( + new String[][] { { " ", " N ", " " }, { " N ", "NIN", " N " }, { " N ", "NIN", " N " }, + { " N ", "NIN", " N " }, { " Z ", "ZIZ", " Z " }, { " N ", "NIN", " N " }, + { "XXX", "XXX", "XXX" }, { "X~X", "XXX", "XXX" }, })) .addElement( 'X', ofChain( buildHatchAdder(GregtechMetaTileEntity_Refinery.class) .atLeast(Energy, Maintenance, OutputHatch, OutputBus, InputHatch) - .casingIndex(TAE.GTPP_INDEX(18)) - .dot(1) - .build(), - buildHatchAdder(GregtechMetaTileEntity_Refinery.class) - .atLeast(Muffler) + .casingIndex(TAE.GTPP_INDEX(18)).dot(1).build(), + buildHatchAdder(GregtechMetaTileEntity_Refinery.class).atLeast(Muffler) .adder(GregtechMetaTileEntity_Refinery::addMufflerToMachineList) .hatchItemFilterAnd(t -> filterByMTETier(6, Integer.MAX_VALUE)) - .casingIndex(TAE.GTPP_INDEX(18)) - .dot(1) - .build(), + .casingIndex(TAE.GTPP_INDEX(18)).dot(1).build(), onElementPass(x -> ++x.mCasing, ofBlock(ModBlocks.blockCasings2Misc, 2)))) .addElement('I', ofBlock(ModBlocks.blockCasings2Misc, 3)) .addElement('N', ofBlock(ModBlocks.blockCasings2Misc, 1)) - .addElement('Z', ofBlock(ModBlocks.blockCasingsMisc, 13)) - .build(); + .addElement('Z', ofBlock(ModBlocks.blockCasingsMisc, 13)).build(); } return STRUCTURE_DEFINITION; } @@ -180,8 +162,7 @@ public class GregtechMetaTileEntity_Refinery extends GregtechMeta_MultiBlockBase public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) { mCasing = 0; if (checkPiece(mName, 1, 7, 0) && mCasing >= 7) { - if (this.mInputHatches.size() == 4 - && this.mOutputHatches.size() == 2 + if (this.mInputHatches.size() == 4 && this.mOutputHatches.size() == 2 && this.mOutputBusses.size() == 1 && this.mMufflerHatches.size() == 1 && this.mMaintenanceHatches.size() == 1 diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_SolarTower.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_SolarTower.java index 6dedfd0e5d..d09eaf86b0 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_SolarTower.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_SolarTower.java @@ -8,10 +8,21 @@ import static gregtech.api.enums.GT_HatchElement.Maintenance; import static gregtech.api.enums.GT_HatchElement.OutputHatch; import static gregtech.api.util.GT_StructureUtility.buildHatchAdder; +import java.util.ArrayList; + +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.world.World; +import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidStack; + import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable; import com.gtnewhorizon.structurelib.structure.IStructureDefinition; import com.gtnewhorizon.structurelib.structure.ISurvivalBuildEnvironment; import com.gtnewhorizon.structurelib.structure.StructureDefinition; + import gregtech.api.GregTech_API; import gregtech.api.enums.TAE; import gregtech.api.enums.Textures; @@ -29,14 +40,6 @@ import gtPlusPlus.core.util.minecraft.FluidUtils; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; import gtPlusPlus.xmod.gregtech.common.tileentities.misc.TileEntitySolarHeater; -import java.util.ArrayList; -import net.minecraft.block.Block; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.world.World; -import net.minecraftforge.fluids.Fluid; -import net.minecraftforge.fluids.FluidStack; public class GregtechMetaTileEntity_SolarTower extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_SolarTower> implements ISurvivalConstructable { @@ -72,8 +75,7 @@ public class GregtechMetaTileEntity_SolarTower extends GregtechMeta_MultiBlockBa @Override protected final GT_Multiblock_Tooltip_Builder createTooltip() { GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType(getMachineType()) - .addInfo("Contributing Green Energy towards the future") + tt.addMachineType(getMachineType()).addInfo("Contributing Green Energy towards the future") .addInfo("Surround with rings of Solar Reflectors") .addInfo("The Reflectors increase the internal heat value of the Tower (see below for formula)") .addInfo("Each Reflector ring increases tier, the first ring is required for the Tower to work") @@ -89,18 +91,12 @@ public class GregtechMetaTileEntity_SolarTower extends GregtechMeta_MultiBlockBa .addInfo("Heat gain per cycle: numberHeaters * heatEfficiency * (10 + bonus)") .addInfo("Bonus: 1 ring = +1, 2 rings = +2, 3 rings = +4, 4 rings = +8, 5 rings = +16") .addInfo("Total number of reflectors based on how many rings are built:") - .addInfo("1 ring = 36, 2 rings = 88, 3 rings = 156, 4 rings = 240, 5 rings = 340") - .addSeparator() - .beginVariableStructureBlock(15, 31, 28, 28, 15, 31, false) - .addController("Top Middle") - .addCasingInfo("Structural Solar Casing", 229) - .addCasingInfo("Thermally Insulated Casing", 60) - .addCasingInfo("Salt Containment Casing", 66) - .addCasingInfo("Thermal Containment Casing", 60) - .addInputHatch("Any 2 dot hint(min 1)", 2) - .addOutputHatch("Any 2 dot hint(min 1)", 2) - .addMaintenanceHatch("Any 2 dot hint", 2) - .toolTipFinisher(CORE.GT_Tooltip_Builder); + .addInfo("1 ring = 36, 2 rings = 88, 3 rings = 156, 4 rings = 240, 5 rings = 340").addSeparator() + .beginVariableStructureBlock(15, 31, 28, 28, 15, 31, false).addController("Top Middle") + .addCasingInfo("Structural Solar Casing", 229).addCasingInfo("Thermally Insulated Casing", 60) + .addCasingInfo("Salt Containment Casing", 66).addCasingInfo("Thermal Containment Casing", 60) + .addInputHatch("Any 2 dot hint(min 1)", 2).addOutputHatch("Any 2 dot hint(min 1)", 2) + .addMaintenanceHatch("Any 2 dot hint", 2).toolTipFinisher(CORE.GT_Tooltip_Builder); return tt; } @@ -108,300 +104,164 @@ public class GregtechMetaTileEntity_SolarTower extends GregtechMeta_MultiBlockBa private static final String STRUCTURE_PIECE_TOWER = "tower"; private static final String STRUCTURE_PIECE_TOP = "top"; - private static final String[] STRUCTURE_PIECE_SOLAR_HEATER_RING = {"ring1", "ring2", "ring3", "ring4", "ring5"}; + private static final String[] STRUCTURE_PIECE_SOLAR_HEATER_RING = { "ring1", "ring2", "ring3", "ring4", "ring5" }; private static final String SOLAR_HEATER_RING_1 = STRUCTURE_PIECE_SOLAR_HEATER_RING[0]; private static final String SOLAR_HEATER_RING_2 = STRUCTURE_PIECE_SOLAR_HEATER_RING[1]; private static final String SOLAR_HEATER_RING_3 = STRUCTURE_PIECE_SOLAR_HEATER_RING[2]; private static final String SOLAR_HEATER_RING_4 = STRUCTURE_PIECE_SOLAR_HEATER_RING[3]; private static final String SOLAR_HEATER_RING_5 = STRUCTURE_PIECE_SOLAR_HEATER_RING[4]; - private static final ClassValue<IStructureDefinition<GregtechMetaTileEntity_SolarTower>> STRUCTURE_DEFINITION = - new ClassValue<IStructureDefinition<GregtechMetaTileEntity_SolarTower>>() { - @Override - protected IStructureDefinition<GregtechMetaTileEntity_SolarTower> computeValue(Class<?> type) { - return StructureDefinition.<GregtechMetaTileEntity_SolarTower>builder() - - // s = salt - // c = thermal containment - // i = thermal insulated - // t = solar structural - // h = hatch - // g = solar heater - - .addShape(STRUCTURE_PIECE_TOP, (new String[][] { - {" ", " ", " ~ ", " ", " "}, - {" ", " s ", " sss ", " s ", " "}, - {" c ", " ccc ", "ccscc", " ccc ", " c "}, - {" c ", " ccc ", "ccscc", " ccc ", " c "}, - {" c ", " ccc ", "ccscc", " ccc ", " c "}, - {" c ", " ccc ", "ccscc", " ccc ", " c "}, - {" c ", " ccc ", "ccscc", " ccc ", " c "}, - })) - .addShape(STRUCTURE_PIECE_TOWER, (new String[][] { - {" i ", "isi", " i "}, - {" i ", "isi", " i "}, - {" i ", "isi", " i "}, - {" i ", "isi", " i "}, - {" i ", "isi", " i "}, - {" i ", "isi", " i "}, - {" i ", "isi", " i "}, - {" i ", "isi", " i "}, - {" i ", "isi", " i "}, - {" i ", "isi", " i "}, - {" i ", "isi", " i "}, - {" i ", "isi", " i "}, - {" i ", "isi", " i "}, - {" i ", "isi", " i "}, - {" i ", "isi", " i "}, - })) - .addShape(STRUCTURE_PIECE_BASE, (new String[][] { - { - " ", - " ", - " t ", - " ttt ", - " ttstt ", - " ttssstt ", - " ttstt ", - " ttt ", - " t ", - " ", - " " - }, - { - " ", - " ", - " t ", - " ttt ", - " tssst ", - " ttssstt ", - " tssst ", - " ttt ", - " t ", - " ", - " " - }, - { - " ", - " t ", - " ttt ", - " ttttt ", - " ttssstt ", - " tttsssttt ", - " ttssstt ", - " ttttt ", - " ttt ", - " t ", - " " - }, - { - " ", - " t ", - " ttt ", - " ttttt ", - " ttssstt ", - " tttsssttt ", - " ttssstt ", - " ttttt ", - " ttt ", - " t ", - " " - }, - { - " hhh ", - " ttttt ", - " ttttttt ", - " ttttttttt ", - "htttsssttth", - "htttsssttth", - "htttsssttth", - " ttttttttt ", - " ttttttt ", - " ttttt ", - " hhh " - }, - { - " hhh ", - " ttttt ", - " ttttttt ", - " ttttttttt ", - "httttttttth", - "httttttttth", - "httttttttth", - " ttttttttt ", - " ttttttt ", - " ttttt ", - " hhh " - }, - })) - .addShape(SOLAR_HEATER_RING_1, (new String[][] { - { - " ggggg ", - " g g ", - " g g ", - " g g ", - " g g ", - "g g", - "g g", - "g g", - "g g", - "g g", - " g g ", - " g g ", - " g g ", - " g g ", - " ggggg ", - } - })) - .addShape(SOLAR_HEATER_RING_2, (new String[][] { - { - " ggggggggg ", - " g g ", - " g g ", - " g g ", - " g g ", - "g g", - "g g", - "g g", - "g g", - "g g", - "g g", - "g g", - "g g", - "g g", - " g g ", - " g g ", - " g g ", - " g g ", - " ggggggggg ", - } - })) - .addShape(SOLAR_HEATER_RING_3, (new String[][] { - { - " ggggggggggggg ", - " g g ", - " g g ", - " g g ", - " g g ", - "g g", - "g g", - "g g", - "g g", - "g g", - "g g", - "g g", - "g g", - "g g", - "g g", - "g g", - "g g", - "g g", - " g g ", - " g g ", - " g g ", - " g g ", - " ggggggggggggg ", - } - })) - .addShape(SOLAR_HEATER_RING_4, (new String[][] { - { - " ggggggggggggggggg ", - " g g ", - " g g ", - " g g ", - " g g ", - "g g", - "g g", - "g g", - "g g", - "g g", - "g g", - "g g", - "g g", - "g g", - "g g", - "g g", - "g g", - "g g", - "g g", - "g g", - "g g", - "g g", - " g g ", - " g g ", - " g g ", - " g g ", - " ggggggggggggggggg ", - } - })) - .addShape(SOLAR_HEATER_RING_5, (new String[][] { - { - " ggggggggggggggggggggg ", - " g g ", - " g g ", - " g g ", - " g g ", - "g g", - "g g", - "g g", - "g g", - "g g", - "g g", - "g g", - "g g", - "g g", - "g g", - "g g", - "g g", - "g g", - "g g", - "g g", - "g g", - "g g", - "g g", - "g g", - "g g", - "g g", - " g g ", - " g g ", - " g g ", - " g g ", - " ggggggggggggggggggggg ", - } - })) - .addElement('g', lazy(t -> buildHatchAdder(GregtechMetaTileEntity_SolarTower.class) - .hatchClass(TileEntitySolarHeater.class) - .adder(GregtechMetaTileEntity_SolarTower::addSolarHeater) - // Use a positive casing index to make adder builder happy - .casingIndex(1) - .dot(1) - .continueIfSuccess() - .build())) - .addElement( - 't', - lazy(t -> onElementPass( - x -> ++x.mCasing1, ofBlock(t.getCasingBlock(), t.getCasingMeta())))) - .addElement( - 'i', - lazy(t -> onElementPass( - x -> ++x.mCasing2, ofBlock(t.getCasingBlock(), t.getCasingMeta2())))) - .addElement( - 's', - lazy(t -> onElementPass( - x -> ++x.mCasing3, ofBlock(t.getCasingBlock(), t.getCasingMeta3())))) - .addElement( - 'c', - lazy(t -> onElementPass( - x -> ++x.mCasing4, ofBlock(t.getCasingBlock2(), t.getCasingMeta4())))) - .addElement('h', lazy(t -> buildHatchAdder(GregtechMetaTileEntity_SolarTower.class) - .atLeast(InputHatch, OutputHatch, Maintenance) - .casingIndex(t.getCasingTextureIndex()) - .dot(2) - .buildAndChain(onElementPass( - x -> ++x.mCasing1, ofBlock(t.getCasingBlock(), t.getCasingMeta()))))) - .build(); - } - }; + private static final ClassValue<IStructureDefinition<GregtechMetaTileEntity_SolarTower>> STRUCTURE_DEFINITION = new ClassValue<IStructureDefinition<GregtechMetaTileEntity_SolarTower>>() { + + @Override + protected IStructureDefinition<GregtechMetaTileEntity_SolarTower> computeValue(Class<?> type) { + return StructureDefinition.<GregtechMetaTileEntity_SolarTower>builder() + + // s = salt + // c = thermal containment + // i = thermal insulated + // t = solar structural + // h = hatch + // g = solar heater + + .addShape( + STRUCTURE_PIECE_TOP, + (new String[][] { { " ", " ", " ~ ", " ", " " }, + { " ", " s ", " sss ", " s ", " " }, + { " c ", " ccc ", "ccscc", " ccc ", " c " }, + { " c ", " ccc ", "ccscc", " ccc ", " c " }, + { " c ", " ccc ", "ccscc", " ccc ", " c " }, + { " c ", " ccc ", "ccscc", " ccc ", " c " }, + { " c ", " ccc ", "ccscc", " ccc ", " c " }, })) + .addShape( + STRUCTURE_PIECE_TOWER, + (new String[][] { { " i ", "isi", " i " }, { " i ", "isi", " i " }, { " i ", "isi", " i " }, + { " i ", "isi", " i " }, { " i ", "isi", " i " }, { " i ", "isi", " i " }, + { " i ", "isi", " i " }, { " i ", "isi", " i " }, { " i ", "isi", " i " }, + { " i ", "isi", " i " }, { " i ", "isi", " i " }, { " i ", "isi", " i " }, + { " i ", "isi", " i " }, { " i ", "isi", " i " }, { " i ", "isi", " i " }, })) + .addShape( + STRUCTURE_PIECE_BASE, + (new String[][] { + { " ", " ", " t ", " ttt ", " ttstt ", + " ttssstt ", " ttstt ", " ttt ", " t ", " ", + " " }, + { " ", " ", " t ", " ttt ", " tssst ", + " ttssstt ", " tssst ", " ttt ", " t ", " ", + " " }, + { " ", " t ", " ttt ", " ttttt ", " ttssstt ", + " tttsssttt ", " ttssstt ", " ttttt ", " ttt ", " t ", + " " }, + { " ", " t ", " ttt ", " ttttt ", " ttssstt ", + " tttsssttt ", " ttssstt ", " ttttt ", " ttt ", " t ", + " " }, + { " hhh ", " ttttt ", " ttttttt ", " ttttttttt ", "htttsssttth", + "htttsssttth", "htttsssttth", " ttttttttt ", " ttttttt ", " ttttt ", + " hhh " }, + { " hhh ", " ttttt ", " ttttttt ", " ttttttttt ", "httttttttth", + "httttttttth", "httttttttth", " ttttttttt ", " ttttttt ", " ttttt ", + " hhh " }, })) + .addShape( + SOLAR_HEATER_RING_1, + (new String[][] { { " ggggg ", " g g ", " g g ", + " g g ", " g g ", "g g", "g g", + "g g", "g g", "g g", " g g ", + " g g ", " g g ", " g g ", " ggggg ", } })) + .addShape( + SOLAR_HEATER_RING_2, + (new String[][] { { " ggggggggg ", " g g ", " g g ", + " g g ", " g g ", "g g", + "g g", "g g", "g g", + "g g", "g g", "g g", + "g g", "g g", " g g ", + " g g ", " g g ", " g g ", + " ggggggggg ", } })) + .addShape( + SOLAR_HEATER_RING_3, + (new String[][] { { " ggggggggggggg ", " g g ", + " g g ", " g g ", " g g ", + "g g", "g g", "g g", + "g g", "g g", "g g", + "g g", "g g", "g g", + "g g", "g g", "g g", + "g g", " g g ", " g g ", + " g g ", " g g ", + " ggggggggggggg ", } })) + .addShape( + SOLAR_HEATER_RING_4, + (new String[][] { { " ggggggggggggggggg ", " g g ", + " g g ", " g g ", + " g g ", "g g", + "g g", "g g", + "g g", "g g", + "g g", "g g", + "g g", "g g", + "g g", "g g", + "g g", "g g", + "g g", "g g", + "g g", "g g", + " g g ", " g g ", + " g g ", " g g ", + " ggggggggggggggggg ", } })) + .addShape( + SOLAR_HEATER_RING_5, + (new String[][] { { " ggggggggggggggggggggg ", " g g ", + " g g ", " g g ", + " g g ", "g g", + "g g", "g g", + "g g", "g g", + "g g", "g g", + "g g", "g g", + "g g", "g g", + "g g", "g g", + "g g", "g g", + "g g", "g g", + "g g", "g g", + "g g", "g g", + " g g ", " g g ", + " g g ", " g g ", + " ggggggggggggggggggggg ", } })) + .addElement( + 'g', + lazy( + t -> buildHatchAdder(GregtechMetaTileEntity_SolarTower.class) + .hatchClass(TileEntitySolarHeater.class) + .adder(GregtechMetaTileEntity_SolarTower::addSolarHeater) + // Use a positive casing index to make adder builder happy + .casingIndex(1).dot(1).continueIfSuccess().build())) + .addElement( + 't', + lazy(t -> onElementPass(x -> ++x.mCasing1, ofBlock(t.getCasingBlock(), t.getCasingMeta())))) + .addElement( + 'i', + lazy( + t -> onElementPass( + x -> ++x.mCasing2, + ofBlock(t.getCasingBlock(), t.getCasingMeta2())))) + .addElement( + 's', + lazy( + t -> onElementPass( + x -> ++x.mCasing3, + ofBlock(t.getCasingBlock(), t.getCasingMeta3())))) + .addElement( + 'c', + lazy( + t -> onElementPass( + x -> ++x.mCasing4, + ofBlock(t.getCasingBlock2(), t.getCasingMeta4())))) + .addElement( + 'h', + lazy( + t -> buildHatchAdder(GregtechMetaTileEntity_SolarTower.class) + .atLeast(InputHatch, OutputHatch, Maintenance) + .casingIndex(t.getCasingTextureIndex()).dot(2).buildAndChain( + onElementPass( + x -> ++x.mCasing1, + ofBlock(t.getCasingBlock(), t.getCasingMeta()))))) + .build(); + } + }; @Override public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) { @@ -426,27 +286,53 @@ public class GregtechMetaTileEntity_SolarTower extends GregtechMeta_MultiBlockBa boolean aCasingCount4 = mCasing4 == 60; boolean aAllStructure = aStructureTop && aStructureTower && aStructureBase; boolean aAllCasings = aCasingCount1 && aCasingCount2 && aCasingCount3 && aCasingCount4; - if (!aAllCasings - || !aAllStructure + if (!aAllCasings || !aAllStructure || mMaintenanceHatches.size() != 1 || mInputHatches.size() < 1 || mOutputHatches.size() < 1) { - log("Bad Hatches - Solar Heaters: " + mSolarHeaters.size() + ", Maint: " - + mMaintenanceHatches.size() + ", Input Hatches: " - + mInputHatches.size() + ", Output Hatches: " - + mOutputHatches.size() + ", Top: " - + aStructureTop + ", Tower: " - + aStructureTower + ", Base: " - + aStructureBase + ", Casing Count: " - + aCasingCount1 + " | Found: " + mCasing1 + ", Casing Count: " - + aCasingCount2 + " | Found: " + mCasing2 + ", Casing Count: " - + aCasingCount3 + " | Found: " + mCasing3 + ", Casing Count: " - + aCasingCount4 + " | Found: " + mCasing4); + log( + "Bad Hatches - Solar Heaters: " + mSolarHeaters.size() + + ", Maint: " + + mMaintenanceHatches.size() + + ", Input Hatches: " + + mInputHatches.size() + + ", Output Hatches: " + + mOutputHatches.size() + + ", Top: " + + aStructureTop + + ", Tower: " + + aStructureTower + + ", Base: " + + aStructureBase + + ", Casing Count: " + + aCasingCount1 + + " | Found: " + + mCasing1 + + ", Casing Count: " + + aCasingCount2 + + " | Found: " + + mCasing2 + + ", Casing Count: " + + aCasingCount3 + + " | Found: " + + mCasing3 + + ", Casing Count: " + + aCasingCount4 + + " | Found: " + + mCasing4); return false; } - log("Built " + this.getLocalName() + " with " + mCasing1 + " Structural Solar casings, " + mCasing2 - + " Thermally Insulated casings, " + mCasing3 + " Salt Containment casings, " + mCasing4 - + " Thermal Containment casings."); + log( + "Built " + this.getLocalName() + + " with " + + mCasing1 + + " Structural Solar casings, " + + mCasing2 + + " Thermally Insulated casings, " + + mCasing3 + + " Salt Containment casings, " + + mCasing4 + + " Thermal Containment casings."); return aAllCasings && aAllStructure; } @@ -515,31 +401,16 @@ public class GregtechMetaTileEntity_SolarTower extends GregtechMeta_MultiBlockBa } @Override - public ITexture[] getTexture( - final IGregTechTileEntity aBaseMetaTileEntity, - final byte aSide, - final byte aFacing, - final byte aColorIndex, - final boolean aActive, - final boolean aRedstone) { + public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing, + final byte aColorIndex, final boolean aActive, final boolean aRedstone) { if (aSide == 0 || aSide == 1) { - if (aActive) - return new ITexture[] { - Textures.BlockIcons.getCasingTextureForId(TAE.GTPP_INDEX(12)), - TextureFactory.builder() - .addIcon(TexturesGtBlock.Overlay_Machine_Controller_Default_Active) - .extFacing() - .build() - }; - return new ITexture[] { - Textures.BlockIcons.getCasingTextureForId(TAE.GTPP_INDEX(12)), - TextureFactory.builder() - .addIcon(TexturesGtBlock.Overlay_Machine_Controller_Default) - .extFacing() - .build() - }; + if (aActive) return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(TAE.GTPP_INDEX(12)), + TextureFactory.builder().addIcon(TexturesGtBlock.Overlay_Machine_Controller_Default_Active) + .extFacing().build() }; + return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(TAE.GTPP_INDEX(12)), TextureFactory + .builder().addIcon(TexturesGtBlock.Overlay_Machine_Controller_Default).extFacing().build() }; } - return new ITexture[] {Textures.BlockIcons.getCasingTextureForId(TAE.GTPP_INDEX(12))}; + return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(TAE.GTPP_INDEX(12)) }; } @Override @@ -650,8 +521,7 @@ public class GregtechMetaTileEntity_SolarTower extends GregtechMeta_MultiBlockBa this.mEfficiencyIncrease = 100; this.mMaxProgresstime = 200; - if (this.mSolarHeaters.isEmpty() - || this.mSolarHeaters.size() < 340 + if (this.mSolarHeaters.isEmpty() || this.mSolarHeaters.size() < 340 || this.getTotalRuntimeInTicks() % 200 == 0) { getConnectedSolarReflectors(); } @@ -673,12 +543,24 @@ public class GregtechMetaTileEntity_SolarTower extends GregtechMeta_MultiBlockBa if (aHeaters > 0 && w.isDaytime()) { if (w.isRaining() && this.getBaseMetaTileEntity().getBiome().rainfall > 0.0F) { this.mHeatLevel += GT_Utility.safeInt((long) ((aHeaters / 2) * aEfficiency * (10 + aTier))); - log("Added Heat (rain): " + aHeaters / 2 + " * " + aEfficiency + " * " + (10 + aTier) + " = " - + (aHeaters * aEfficiency * (10 + aTier))); + log( + "Added Heat (rain): " + aHeaters / 2 + + " * " + + aEfficiency + + " * " + + (10 + aTier) + + " = " + + (aHeaters * aEfficiency * (10 + aTier))); } else { this.mHeatLevel += GT_Utility.safeInt((long) (aHeaters * aEfficiency * (10 + aTier))); - log("Added Heat: " + aHeaters + " * " + aEfficiency + " * " + (10 + aTier) + " = " - + (aHeaters * aEfficiency * (10 + aTier))); + log( + "Added Heat: " + aHeaters + + " * " + + aEfficiency + + " * " + + (10 + aTier) + + " = " + + (aHeaters * aEfficiency * (10 + aTier))); } } @@ -827,9 +709,8 @@ public class GregtechMetaTileEntity_SolarTower extends GregtechMeta_MultiBlockBa @Override public String[] getExtraInfoData() { - return new String[] { - "Internal Heat Level: " + this.mHeatLevel, "Connected Solar Reflectors: " + this.mSolarHeaters.size() - }; + return new String[] { "Internal Heat Level: " + this.mHeatLevel, + "Connected Solar Reflectors: " + this.mSolarHeaters.size() }; } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/algae/GregtechMTE_AlgaePondBase.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/algae/GregtechMTE_AlgaePondBase.java index 1225fe318d..504f398e25 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/algae/GregtechMTE_AlgaePondBase.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/algae/GregtechMTE_AlgaePondBase.java @@ -9,11 +9,18 @@ import static gregtech.api.enums.GT_HatchElement.InputHatch; import static gregtech.api.enums.GT_HatchElement.OutputBus; import static gregtech.api.util.GT_StructureUtility.buildHatchAdder; +import net.minecraft.block.Block; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.fluids.FluidStack; + import com.gtnewhorizon.structurelib.alignment.IAlignmentLimits; import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable; import com.gtnewhorizon.structurelib.structure.IStructureDefinition; import com.gtnewhorizon.structurelib.structure.ISurvivalBuildEnvironment; import com.gtnewhorizon.structurelib.structure.StructureDefinition; + import gregtech.api.GregTech_API; import gregtech.api.enums.TAE; import gregtech.api.interfaces.IIconContainer; @@ -35,11 +42,6 @@ import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; import gtPlusPlus.xmod.gregtech.loaders.recipe.RecipeLoader_AlgaeFarm; import ic2.core.init.BlocksItems; import ic2.core.init.InternalName; -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; -import net.minecraftforge.common.util.ForgeDirection; -import net.minecraftforge.fluids.FluidStack; public class GregtechMTE_AlgaePondBase extends GregtechMeta_MultiBlockBase<GregtechMTE_AlgaePondBase> implements ISurvivalConstructable { @@ -76,24 +78,16 @@ public class GregtechMTE_AlgaePondBase extends GregtechMeta_MultiBlockBase<Gregt @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType(getMachineType()) - .addInfo("Grows Algae!") - .addInfo("Controller Block for the Algae Farm") + tt.addMachineType(getMachineType()).addInfo("Grows Algae!").addInfo("Controller Block for the Algae Farm") .addInfo("Provide compost to boost production by one tier") .addInfo("Does not require power or maintenance") .addInfo("All Machine Casings must be the same tier, this dictates machine speed.") .addInfo("All Buses/Hatches must, at least, match the tier of the Casings") .addInfo("Fill Input Hatch with Water to fill the inside of the multiblock.") - .addPollutionAmount(getPollutionPerSecond(null)) - .addSeparator() - .beginStructureBlock(9, 3, 9, true) - .addController("Front Center") - .addCasingInfo("Machine Casings", 64) - .addCasingInfo("Sterile Farm Casings", 34) - .addInputBus("Any Casing", 1) - .addOutputBus("Any Casing", 1) - .addInputHatch("Any Casing", 1) - .toolTipFinisher(CORE.GT_Tooltip_Builder); + .addPollutionAmount(getPollutionPerSecond(null)).addSeparator().beginStructureBlock(9, 3, 9, true) + .addController("Front Center").addCasingInfo("Machine Casings", 64) + .addCasingInfo("Sterile Farm Casings", 34).addInputBus("Any Casing", 1).addOutputBus("Any Casing", 1) + .addInputHatch("Any Casing", 1).toolTipFinisher(CORE.GT_Tooltip_Builder); return tt; } @@ -109,49 +103,22 @@ public class GregtechMTE_AlgaePondBase extends GregtechMeta_MultiBlockBase<Gregt public IStructureDefinition<GregtechMTE_AlgaePondBase> getStructureDefinition() { if (STRUCTURE_DEFINITION == null) { STRUCTURE_DEFINITION = StructureDefinition.<GregtechMTE_AlgaePondBase>builder() - .addShape(mName, transpose(new String[][] { - { - "XXXXXXXXX", - "X X", - "X X", - "X X", - "X X", - "X X", - "X X", - "X X", - "XXXXXXXXX" - }, - { - "XXXXXXXXX", - "X X", - "X X", - "X X", - "X X", - "X X", - "X X", - "X X", - "XXXXXXXXX" - }, - { - "CCCC~CCCC", - "CCCCCCCCC", - "CCCCCCCCC", - "CCCCCCCCC", - "CCCCCCCCC", - "CCCCCCCCC", - "CCCCCCCCC", - "CCCCCCCCC", - "CCCCCCCCC" - }, - })) + .addShape( + mName, + transpose( + new String[][] { + { "XXXXXXXXX", "X X", "X X", "X X", "X X", + "X X", "X X", "X X", "XXXXXXXXX" }, + { "XXXXXXXXX", "X X", "X X", "X X", "X X", + "X X", "X X", "X X", "XXXXXXXXX" }, + { "CCCC~CCCC", "CCCCCCCCC", "CCCCCCCCC", "CCCCCCCCC", "CCCCCCCCC", + "CCCCCCCCC", "CCCCCCCCC", "CCCCCCCCC", "CCCCCCCCC" }, })) .addElement( 'C', ofChain( buildHatchAdder(GregtechMTE_AlgaePondBase.class) .atLeast(InputHatch, InputBus, OutputBus) - .casingIndex(TAE.getIndexFromPage(1, 15)) - .dot(1) - .build(), + .casingIndex(TAE.getIndexFromPage(1, 15)).dot(1).build(), onElementPass( x -> ++x.mCasing, addTieredBlock( @@ -159,8 +126,7 @@ public class GregtechMTE_AlgaePondBase extends GregtechMeta_MultiBlockBase<Gregt GregtechMTE_AlgaePondBase::setMeta, GregtechMTE_AlgaePondBase::getMeta, 10)))) - .addElement('X', ofBlock(ModBlocks.blockCasings2Misc, 15)) - .build(); + .addElement('X', ofBlock(ModBlocks.blockCasings2Misc, 15)).build(); } return STRUCTURE_DEFINITION; } @@ -256,10 +222,10 @@ public class GregtechMTE_AlgaePondBase extends GregtechMeta_MultiBlockBase<Gregt // if (aBaseMetaTileEntity.fac) - final int xDir = - ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX * mCurrentDirectionX; - final int zDir = - ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ * mCurrentDirectionZ; + final int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX + * mCurrentDirectionX; + final int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ + * mCurrentDirectionZ; int tAmount = 0; for (int i = mOffsetX_Lower + 1; i <= mOffsetX_Upper - 1; ++i) { @@ -275,13 +241,11 @@ public class GregtechMTE_AlgaePondBase extends GregtechMeta_MultiBlockBase<Gregt // Utils.LOG_WARNING("Going to try swap an air block for water from inut bus."); stored.amount -= 1000; Block fluidUsed = Blocks.water; - aBaseMetaTileEntity - .getWorld() - .setBlock( - aBaseMetaTileEntity.getXCoord() + xDir + i, - aBaseMetaTileEntity.getYCoord() + h, - aBaseMetaTileEntity.getZCoord() + zDir + j, - fluidUsed); + aBaseMetaTileEntity.getWorld().setBlock( + aBaseMetaTileEntity.getXCoord() + xDir + i, + aBaseMetaTileEntity.getYCoord() + h, + aBaseMetaTileEntity.getZCoord() + zDir + j, + fluidUsed); } } } @@ -307,8 +271,7 @@ public class GregtechMTE_AlgaePondBase extends GregtechMeta_MultiBlockBase<Gregt } private boolean isNotStaticWater(Block block, byte meta) { - return block == Blocks.air - || block == Blocks.flowing_water + return block == Blocks.air || block == Blocks.flowing_water || block == BlocksItems.getFluidBlock(InternalName.fluidDistilledWater) || (cofhWater != null && cofhWater.isAssignableFrom(block.getClass()) && meta != 0); } @@ -353,14 +316,8 @@ public class GregtechMTE_AlgaePondBase extends GregtechMeta_MultiBlockBase<Gregt return checkRecipeGeneric(getMaxParallelRecipes(), getEuDiscountForParallelism(), 0); } - public boolean checkRecipeGeneric( - ItemStack[] aItemInputs, - FluidStack[] aFluidInputs, - int aMaxParallelRecipes, - long aEUPercent, - int aSpeedBonusPercent, - int aOutputChanceRoll, - GT_Recipe aRecipe) { + public boolean checkRecipeGeneric(ItemStack[] aItemInputs, FluidStack[] aFluidInputs, int aMaxParallelRecipes, + long aEUPercent, int aSpeedBonusPercent, int aOutputChanceRoll, GT_Recipe aRecipe) { if (this.mLevel < 0) { return false; @@ -384,14 +341,9 @@ public class GregtechMTE_AlgaePondBase extends GregtechMeta_MultiBlockBase<Gregt return false; } - GT_ParallelHelper helper = new GT_ParallelHelper() - .setRecipe(tRecipe) - .setItemInputs(aItemInputs) - .setFluidInputs(aFluidInputs) - .setAvailableEUt(120) - .setMaxParallel(aMaxParallelRecipes) - .enableConsumption() - .enableOutputCalculation(); + GT_ParallelHelper helper = new GT_ParallelHelper().setRecipe(tRecipe).setItemInputs(aItemInputs) + .setFluidInputs(aFluidInputs).setAvailableEUt(120).setMaxParallel(aMaxParallelRecipes) + .enableConsumption().enableOutputCalculation(); if (!mVoidExcess) { helper.enableVoidProtection(this); } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/bedrock/GregtechMetaTileEntity_BedrockMiningPlatform1.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/bedrock/GregtechMetaTileEntity_BedrockMiningPlatform1.java index 875c449f2d..97bd9dbce7 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/bedrock/GregtechMetaTileEntity_BedrockMiningPlatform1.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/bedrock/GregtechMetaTileEntity_BedrockMiningPlatform1.java @@ -1,41 +1,12 @@ /* -package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production.bedrock; - - -public class GregtechMetaTileEntity_BedrockMiningPlatform1 extends GregtechMetaTileEntity_BedrockMiningPlatformBase { - public GregtechMetaTileEntity_BedrockMiningPlatform1(final int aID, final String aName, final String aNameRegional) { - super(aID, aName, aNameRegional); - } - - public GregtechMetaTileEntity_BedrockMiningPlatform1(final String aName) { - super(aName); - } - - public String[] getTooltip() { - return this.getDescriptionInternal("I"); - } - - public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) { - return (IMetaTileEntity) new GregtechMetaTileEntity_BedrockMiningPlatform1(this.mName); - } - - protected Material getFrameMaterial() { - return ALLOY.INCONEL_690; - } - - protected int getCasingTextureIndex() { - return TAE.getIndexFromPage(0, 14); - } - - protected int getRadiusInChunks() { - return 9; - } - - protected int getMinTier() { - return 5; - } - - protected int getBaseProgressTime() { - return (int) (420*(this.mProductionModifier/100)); - } -}*/ + * package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production.bedrock; public class + * GregtechMetaTileEntity_BedrockMiningPlatform1 extends GregtechMetaTileEntity_BedrockMiningPlatformBase { public + * GregtechMetaTileEntity_BedrockMiningPlatform1(final int aID, final String aName, final String aNameRegional) { + * super(aID, aName, aNameRegional); } public GregtechMetaTileEntity_BedrockMiningPlatform1(final String aName) { + * super(aName); } public String[] getTooltip() { return this.getDescriptionInternal("I"); } public IMetaTileEntity + * newMetaEntity(final IGregTechTileEntity aTileEntity) { return (IMetaTileEntity) new + * GregtechMetaTileEntity_BedrockMiningPlatform1(this.mName); } protected Material getFrameMaterial() { return + * ALLOY.INCONEL_690; } protected int getCasingTextureIndex() { return TAE.getIndexFromPage(0, 14); } protected int + * getRadiusInChunks() { return 9; } protected int getMinTier() { return 5; } protected int getBaseProgressTime() { + * return (int) (420*(this.mProductionModifier/100)); } } + */ diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/bedrock/GregtechMetaTileEntity_BedrockMiningPlatform2.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/bedrock/GregtechMetaTileEntity_BedrockMiningPlatform2.java index f67ecfe87f..b4be6eb80f 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/bedrock/GregtechMetaTileEntity_BedrockMiningPlatform2.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/bedrock/GregtechMetaTileEntity_BedrockMiningPlatform2.java @@ -1,41 +1,12 @@ /* -package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production.bedrock; - - -public class GregtechMetaTileEntity_BedrockMiningPlatform2 extends GregtechMetaTileEntity_BedrockMiningPlatformBase { - public GregtechMetaTileEntity_BedrockMiningPlatform2(final int aID, final String aName, final String aNameRegional) { - super(aID, aName, aNameRegional); - } - - public GregtechMetaTileEntity_BedrockMiningPlatform2(final String aName) { - super(aName); - } - - public String[] getTooltip() { - return this.getDescriptionInternal("II"); - } - - public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) { - return (IMetaTileEntity) new GregtechMetaTileEntity_BedrockMiningPlatform2(this.mName); - } - - protected Material getFrameMaterial() { - return ELEMENT.getInstance().AMERICIUM241; - } - - protected int getCasingTextureIndex() { - return 62; - } - - protected int getRadiusInChunks() { - return 9; - } - - protected int getMinTier() { - return 5; - } - - protected int getBaseProgressTime() { - return 480; - } -}*/ + * package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production.bedrock; public class + * GregtechMetaTileEntity_BedrockMiningPlatform2 extends GregtechMetaTileEntity_BedrockMiningPlatformBase { public + * GregtechMetaTileEntity_BedrockMiningPlatform2(final int aID, final String aName, final String aNameRegional) { + * super(aID, aName, aNameRegional); } public GregtechMetaTileEntity_BedrockMiningPlatform2(final String aName) { + * super(aName); } public String[] getTooltip() { return this.getDescriptionInternal("II"); } public IMetaTileEntity + * newMetaEntity(final IGregTechTileEntity aTileEntity) { return (IMetaTileEntity) new + * GregtechMetaTileEntity_BedrockMiningPlatform2(this.mName); } protected Material getFrameMaterial() { return + * ELEMENT.getInstance().AMERICIUM241; } protected int getCasingTextureIndex() { return 62; } protected int + * getRadiusInChunks() { return 9; } protected int getMinTier() { return 5; } protected int getBaseProgressTime() { + * return 480; } } + */ diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/bedrock/GregtechMetaTileEntity_BedrockMiningPlatformBase.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/bedrock/GregtechMetaTileEntity_BedrockMiningPlatformBase.java index f64f0feab7..2c40e6875a 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/bedrock/GregtechMetaTileEntity_BedrockMiningPlatformBase.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/bedrock/GregtechMetaTileEntity_BedrockMiningPlatformBase.java @@ -1,5 +1,10 @@ package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production.bedrock; +import net.minecraft.block.Block; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraftforge.common.util.ForgeDirection; + import gregtech.api.GregTech_API; import gregtech.api.enums.GT_Values; import gregtech.api.enums.Textures; @@ -23,10 +28,6 @@ import gtPlusPlus.core.util.minecraft.MiningUtils; import gtPlusPlus.core.util.minecraft.OreDictUtils; import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase; -import net.minecraft.block.Block; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraftforge.common.util.ForgeDirection; public abstract class GregtechMetaTileEntity_BedrockMiningPlatformBase extends GregtechMeta_MultiBlockBase { @@ -49,8 +50,8 @@ public abstract class GregtechMetaTileEntity_BedrockMiningPlatformBase extends G private int[] xCenter = new int[5]; private int[] zCenter = new int[5]; - public GregtechMetaTileEntity_BedrockMiningPlatformBase( - final int aID, final String aName, final String aNameRegional) { + public GregtechMetaTileEntity_BedrockMiningPlatformBase(final int aID, final String aName, + final String aNameRegional) { super(aID, aName, aNameRegional); this.initFields(); } @@ -203,7 +204,8 @@ public abstract class GregtechMetaTileEntity_BedrockMiningPlatformBase extends G } if (pipes == null) { this.setInventorySlotContents( - 1, GT_Utility.copy(new Object[] {GregtechMetaTileEntity_BedrockMiningPlatformBase.miningPipe})); + 1, + GT_Utility.copy(new Object[] { GregtechMetaTileEntity_BedrockMiningPlatformBase.miningPipe })); pipes = this.getStackInSlot(1); } if (pipes.stackSize == maxPipes) { @@ -221,8 +223,7 @@ public abstract class GregtechMetaTileEntity_BedrockMiningPlatformBase extends G private boolean isHasMiningPipes(final int minCount) { final ItemStack pipe = this.getStackInSlot(1); - return pipe != null - && pipe.stackSize > minCount - 1 + return pipe != null && pipe.stackSize > minCount - 1 && pipe.isItemEqual(GregtechMetaTileEntity_BedrockMiningPlatformBase.miningPipe); } @@ -241,8 +242,8 @@ public abstract class GregtechMetaTileEntity_BedrockMiningPlatformBase extends G for (int j = -1; j < 2; ++j) { for (int h = -1; h < 2; ++h) { if (h != 0 || (xDir + i != 0 || zDir + j != 0) && (i != 0 || j != 0)) { - IGregTechTileEntity tTileEntity = - aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, h, zDir + j); + IGregTechTileEntity tTileEntity = aBaseMetaTileEntity + .getIGregTechTileEntityOffset(xDir + i, h, zDir + j); Block aBlock = aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j); int aMeta = aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j); @@ -258,10 +259,10 @@ public abstract class GregtechMetaTileEntity_BedrockMiningPlatformBase extends G } ++tAmount; - /*if (!isValidBlockForStructure(tTileEntity, 48, true, aBlock, aMeta, sBlockCasings4, 0)) { - Logger.INFO("Bad centrifuge casing"); - return false; - }*/ + /* + * if (!isValidBlockForStructure(tTileEntity, 48, true, aBlock, aMeta, sBlockCasings4, 0)) { + * Logger.INFO("Bad centrifuge casing"); return false; } + */ } } @@ -275,8 +276,7 @@ public abstract class GregtechMetaTileEntity_BedrockMiningPlatformBase extends G this.xDrill = this.getBaseMetaTileEntity().getXCoord(); this.yDrill = this.getBaseMetaTileEntity().getYCoord() - 1; this.zDrill = this.getBaseMetaTileEntity().getZCoord(); - this.back = - ForgeDirection.getOrientation((int) this.getBaseMetaTileEntity().getBackFacing()); + this.back = ForgeDirection.getOrientation((int) this.getBaseMetaTileEntity().getBackFacing()); // Middle this.xCenter[0] = this.xDrill + this.back.offsetX; @@ -332,22 +332,19 @@ public abstract class GregtechMetaTileEntity_BedrockMiningPlatformBase extends G protected String[] getDescriptionInternal(final String tierSuffix) { final String casings = this.getCasingBlockItem().get(0L, new Object[0]).getDisplayName(); return new String[] { - "Controller Block for the Experimental Deep Earth Drilling Platform - MK " - + ((tierSuffix != null) ? tierSuffix : ""), - "Size(WxHxD): 3x7x3, Controller (Front middle bottom)", - "3x1x3 Base of " + casings, - "1x3x1 " + casings + " pillar (Center of base)", - "1x3x1 " + this.getFrameMaterial().getLocalizedName() + " Frame Boxes (Each pillar side and on top)", - "2x Input Hatch (Any bottom layer casing)", - "1x Input Bus for mining pipes (Any bottom layer casing; not necessary)", - "1x Output Bus (Any bottom layer casing)", - "1x Maintenance Hatch (Any bottom layer casing)", - "1x " + GT_Values.VN[this.getMinTier()] + "+ Energy Hatch (Any bottom layer casing)", - "Radius is " + (this.getRadiusInChunks() << 4) + " blocks", - "Every tick, this machine altenates betweem consumption of Pyrotheum & Cryotheum", - "Pyrotheum is used to bore through the Mantle of the world", - "Cryotheum is used to keep the internal components cool", - }; + "Controller Block for the Experimental Deep Earth Drilling Platform - MK " + + ((tierSuffix != null) ? tierSuffix : ""), + "Size(WxHxD): 3x7x3, Controller (Front middle bottom)", "3x1x3 Base of " + casings, + "1x3x1 " + casings + " pillar (Center of base)", + "1x3x1 " + this.getFrameMaterial().getLocalizedName() + " Frame Boxes (Each pillar side and on top)", + "2x Input Hatch (Any bottom layer casing)", + "1x Input Bus for mining pipes (Any bottom layer casing; not necessary)", + "1x Output Bus (Any bottom layer casing)", "1x Maintenance Hatch (Any bottom layer casing)", + "1x " + GT_Values.VN[this.getMinTier()] + "+ Energy Hatch (Any bottom layer casing)", + "Radius is " + (this.getRadiusInChunks() << 4) + " blocks", + "Every tick, this machine altenates betweem consumption of Pyrotheum & Cryotheum", + "Pyrotheum is used to bore through the Mantle of the world", + "Cryotheum is used to keep the internal components cool", }; } static { @@ -469,9 +466,8 @@ public abstract class GregtechMetaTileEntity_BedrockMiningPlatformBase extends G mMixedOreData.put(new Pair<String, Integer>("oreLapis", 40)); mMixedOreData.put(new Pair<String, Integer>("oreRedstone", 40)); - if (LoadedMods.Thaumcraft - || (OreDictUtils.containsValidEntries("oreAmber") - && OreDictUtils.containsValidEntries("oreCinnabar"))) { + if (LoadedMods.Thaumcraft || (OreDictUtils.containsValidEntries("oreAmber") + && OreDictUtils.containsValidEntries("oreCinnabar"))) { mMixedOreData.put(new Pair<String, Integer>("oreAmber", 20)); mMixedOreData.put(new Pair<String, Integer>("oreCinnabar", 20)); } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/chemplant/GregtechMTE_ChemicalPlant.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/chemplant/GregtechMTE_ChemicalPlant.java index cb25aeb155..6c4358219f 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/chemplant/GregtechMTE_ChemicalPlant.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/chemplant/GregtechMTE_ChemicalPlant.java @@ -8,9 +8,23 @@ import static gregtech.api.util.GT_StructureUtility.buildHatchAdder; import static gregtech.api.util.GT_StructureUtility.filterByMTETier; import static gregtech.api.util.GT_StructureUtility.ofCoil; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.stream.Collectors; +import java.util.stream.IntStream; + +import javax.annotation.Nullable; + +import net.minecraft.block.Block; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.world.World; +import net.minecraftforge.fluids.FluidStack; + import com.gtnewhorizon.structurelib.StructureLibAPI; import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable; import com.gtnewhorizon.structurelib.structure.*; + import gregtech.api.GregTech_API; import gregtech.api.enums.HeatingCoilLevel; import gregtech.api.interfaces.IIconContainer; @@ -35,16 +49,6 @@ import gtPlusPlus.core.util.minecraft.ItemUtils; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.nbthandlers.GT_MetaTileEntity_Hatch_Catalysts; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.stream.Collectors; -import java.util.stream.IntStream; -import javax.annotation.Nullable; -import net.minecraft.block.Block; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.world.World; -import net.minecraftforge.fluids.FluidStack; public class GregtechMTE_ChemicalPlant extends GregtechMeta_MultiBlockBase<GregtechMTE_ChemicalPlant> implements ISurvivalConstructable { @@ -61,8 +65,7 @@ public class GregtechMTE_ChemicalPlant extends GregtechMeta_MultiBlockBase<Gregt private int mCasing; private static IStructureDefinition<GregtechMTE_ChemicalPlant> STRUCTURE_DEFINITION = null; - private final ArrayList<GT_MetaTileEntity_Hatch_Catalysts> mCatalystBuses = - new ArrayList<GT_MetaTileEntity_Hatch_Catalysts>(); + private final ArrayList<GT_MetaTileEntity_Hatch_Catalysts> mCatalystBuses = new ArrayList<GT_MetaTileEntity_Hatch_Catalysts>(); private static final HashMap<Integer, Triplet<Block, Integer, Integer>> mTieredBlockRegistry = new HashMap<>(); @@ -75,11 +78,14 @@ public class GregtechMTE_ChemicalPlant extends GregtechMeta_MultiBlockBase<Gregt } public static boolean registerMachineCasingForTier(int aTier, Block aBlock, int aMeta, int aCasingTextureID) { - Triplet<Block, Integer, Integer> aCasingData = - new Triplet<Block, Integer, Integer>(aBlock, aMeta, aCasingTextureID); + Triplet<Block, Integer, Integer> aCasingData = new Triplet<Block, Integer, Integer>( + aBlock, + aMeta, + aCasingTextureID); if (mTieredBlockRegistry.containsKey(aTier)) { - CORE.crash("Tried to register a Machine casing for tier " + aTier - + " to the Chemical Plant, however this tier already contains one."); + CORE.crash( + "Tried to register a Machine casing for tier " + aTier + + " to the Chemical Plant, however this tier already contains one."); } mTieredBlockRegistry.put(aTier, aCasingData); return true; @@ -107,24 +113,15 @@ public class GregtechMTE_ChemicalPlant extends GregtechMeta_MultiBlockBase<Gregt @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType(getMachineType()) - .addInfo("Controller Block for the Chemical Plant") + tt.addMachineType(getMachineType()).addInfo("Controller Block for the Chemical Plant") .addInfo("Heavy Industry, now right at your doorstep!") - .addInfo("Please read the user manual for more information on construction and usage") - .addSeparator() - .addController("Bottom Center") - .addStructureHint("Catalyst Housing", 1) - .addInputBus("Bottom Casing", 1) - .addOutputBus("Bottom Casing", 1) - .addInputHatch("Bottom Casing", 1) - .addOutputHatch("Bottom Casing", 1) - .addEnergyHatch("Bottom Casing", 1) - .addMaintenanceHatch("Bottom Casing", 1) + .addInfo("Please read the user manual for more information on construction and usage").addSeparator() + .addController("Bottom Center").addStructureHint("Catalyst Housing", 1).addInputBus("Bottom Casing", 1) + .addOutputBus("Bottom Casing", 1).addInputHatch("Bottom Casing", 1).addOutputHatch("Bottom Casing", 1) + .addEnergyHatch("Bottom Casing", 1).addMaintenanceHatch("Bottom Casing", 1) .addSubChannelUsage("casing", "metal machine casing") - .addSubChannelUsage("machine", "tier machine casing") - .addSubChannelUsage("coil", "heating coil blocks") - .addSubChannelUsage("pipe", "pipe casing blocks") - .toolTipFinisher(CORE.GT_Tooltip_Builder); + .addSubChannelUsage("machine", "tier machine casing").addSubChannelUsage("coil", "heating coil blocks") + .addSubChannelUsage("pipe", "pipe casing blocks").toolTipFinisher(CORE.GT_Tooltip_Builder); return tt; } @@ -192,42 +189,37 @@ public class GregtechMTE_ChemicalPlant extends GregtechMeta_MultiBlockBase<Gregt if (STRUCTURE_DEFINITION == null) { IStructureElement<GregtechMTE_ChemicalPlant> allCasingsElement = withChannel( "casing", - ofChain(IntStream.range(0, 8) - .mapToObj(GregtechMTE_ChemicalPlant::ofSolidCasing) - .collect(Collectors.toList()))); - STRUCTURE_DEFINITION = StructureDefinition.<GregtechMTE_ChemicalPlant>builder() - .addShape(mName, transpose(new String[][] { - {"XXXXXXX", "XXXXXXX", "XXXXXXX", "XXXXXXX", "XXXXXXX", "XXXXXXX", "XXXXXXX"}, - {"X X", " MMMMM ", " MHHHM ", " MHHHM ", " MHHHM ", " MMMMM ", "X X"}, - {"X X", " ", " PPP ", " PPP ", " PPP ", " ", "X X"}, - {"X X", " ", " HHH ", " HHH ", " HHH ", " ", "X X"}, - {"X X", " ", " PPP ", " PPP ", " PPP ", " ", "X X"}, - {"X X", " MMMMM ", " MHHHM ", " MHHHM ", " MHHHM ", " MMMMM ", "X X"}, - {"CCC~CCC", "CMMMMMC", "CMMMMMC", "CMMMMMC", "CMMMMMC", "CMMMMMC", "CCCCCCC"}, - })) + ofChain( + IntStream.range(0, 8).mapToObj(GregtechMTE_ChemicalPlant::ofSolidCasing) + .collect(Collectors.toList()))); + STRUCTURE_DEFINITION = StructureDefinition.<GregtechMTE_ChemicalPlant>builder().addShape( + mName, + transpose( + new String[][] { + { "XXXXXXX", "XXXXXXX", "XXXXXXX", "XXXXXXX", "XXXXXXX", "XXXXXXX", "XXXXXXX" }, + { "X X", " MMMMM ", " MHHHM ", " MHHHM ", " MHHHM ", " MMMMM ", "X X" }, + { "X X", " ", " PPP ", " PPP ", " PPP ", " ", "X X" }, + { "X X", " ", " HHH ", " HHH ", " HHH ", " ", "X X" }, + { "X X", " ", " PPP ", " PPP ", " PPP ", " ", "X X" }, + { "X X", " MMMMM ", " MHHHM ", " MHHHM ", " MHHHM ", " MMMMM ", "X X" }, + { "CCC~CCC", "CMMMMMC", "CMMMMMC", "CMMMMMC", "CMMMMMC", "CMMMMMC", "CCCCCCC" }, })) .addElement( 'C', ofChain( - buildHatchAdder(GregtechMTE_ChemicalPlant.class) - .atLeast(Maintenance) - .casingIndex(getCasingTextureID()) - .dot(1) - .build(), + buildHatchAdder(GregtechMTE_ChemicalPlant.class).atLeast(Maintenance) + .casingIndex(getCasingTextureID()).dot(1).build(), buildHatchAdder(GregtechMTE_ChemicalPlant.class) .atLeast(InputHatch, OutputHatch, InputBus, OutputBus) .adder(GregtechMTE_ChemicalPlant::addChemicalPlantList) - .hatchItemFilterAnd((t, s) -> filterByMTETier( - Integer.MIN_VALUE, - s.stackSize >= 10 ? Integer.MAX_VALUE : s.stackSize)) - .casingIndex(getCasingTextureID()) - .dot(1) - .build(), + .hatchItemFilterAnd( + (t, s) -> filterByMTETier( + Integer.MIN_VALUE, + s.stackSize >= 10 ? Integer.MAX_VALUE : s.stackSize)) + .casingIndex(getCasingTextureID()).dot(1).build(), buildHatchAdder(GregtechMTE_ChemicalPlant.class) .hatchClass(GT_MetaTileEntity_Hatch_Catalysts.class) .adder(GregtechMTE_ChemicalPlant::addChemicalPlantList) - .casingIndex(getCasingTextureID()) - .dot(1) - .build(), + .casingIndex(getCasingTextureID()).dot(1).build(), allCasingsElement)) .addElement('X', allCasingsElement) .addElement( @@ -263,6 +255,7 @@ public class GregtechMTE_ChemicalPlant extends GregtechMeta_MultiBlockBase<Gregt private static IStructureElement<GregtechMTE_ChemicalPlant> ofSolidCasing(int aIndex) { return new IStructureElement<GregtechMTE_ChemicalPlant>() { + @Override public boolean check(GregtechMTE_ChemicalPlant t, World world, int x, int y, int z) { if (check(aIndex, world, x, y, z)) { @@ -298,8 +291,8 @@ public class GregtechMTE_ChemicalPlant extends GregtechMeta_MultiBlockBase<Gregt } @Override - public boolean placeBlock( - GregtechMTE_ChemicalPlant t, World world, int x, int y, int z, ItemStack trigger) { + public boolean placeBlock(GregtechMTE_ChemicalPlant t, World world, int x, int y, int z, + ItemStack trigger) { return world.setBlock( x, y, @@ -311,28 +304,16 @@ public class GregtechMTE_ChemicalPlant extends GregtechMeta_MultiBlockBase<Gregt @Nullable @Override - public BlocksToPlace getBlocksToPlace( - GregtechMTE_ChemicalPlant gregtechMTE_chemicalPlant, - World world, - int x, - int y, - int z, - ItemStack trigger, - AutoPlaceEnvironment env) { + public BlocksToPlace getBlocksToPlace(GregtechMTE_ChemicalPlant gregtechMTE_chemicalPlant, World world, + int x, int y, int z, ItemStack trigger, AutoPlaceEnvironment env) { return BlocksToPlace.create( mTieredBlockRegistry.get(getIndex(trigger.stackSize)).getValue_1(), mTieredBlockRegistry.get(getIndex(trigger.stackSize)).getValue_2()); } @Override - public PlaceResult survivalPlaceBlock( - GregtechMTE_ChemicalPlant t, - World world, - int x, - int y, - int z, - ItemStack trigger, - AutoPlaceEnvironment env) { + public PlaceResult survivalPlaceBlock(GregtechMTE_ChemicalPlant t, World world, int x, int y, int z, + ItemStack trigger, AutoPlaceEnvironment env) { if (check(getIndex(trigger.stackSize), world, x, y, z)) return PlaceResult.SKIP; return StructureUtility.survivalPlaceBlock( mTieredBlockRegistry.get(getIndex(trigger.stackSize)).getValue_1(), @@ -603,25 +584,24 @@ public class GregtechMTE_ChemicalPlant extends GregtechMeta_MultiBlockBase<Gregt } @Override - public boolean checkRecipeGeneric( - int aMaxParallelRecipes, long aEUPercent, int aSpeedBonusPercent, int aOutputChanceRoll) { + public boolean checkRecipeGeneric(int aMaxParallelRecipes, long aEUPercent, int aSpeedBonusPercent, + int aOutputChanceRoll) { ArrayList<ItemStack> tItems = getStoredInputs(); ArrayList<FluidStack> tFluids = getStoredFluids(); ItemStack[] tItemInputs = tItems.toArray(new ItemStack[tItems.size()]); FluidStack[] tFluidInputs = tFluids.toArray(new FluidStack[tFluids.size()]); return checkRecipeGeneric( - tItemInputs, tFluidInputs, aMaxParallelRecipes, aEUPercent, aSpeedBonusPercent, aOutputChanceRoll); + tItemInputs, + tFluidInputs, + aMaxParallelRecipes, + aEUPercent, + aSpeedBonusPercent, + aOutputChanceRoll); } @Override - public boolean checkRecipeGeneric( - ItemStack[] aItemInputs, - FluidStack[] aFluidInputs, - int aMaxParallelRecipes, - long aEUPercent, - int aSpeedBonusPercent, - int aOutputChanceRoll, - GT_Recipe aRecipe) { + public boolean checkRecipeGeneric(ItemStack[] aItemInputs, FluidStack[] aFluidInputs, int aMaxParallelRecipes, + long aEUPercent, int aSpeedBonusPercent, int aOutputChanceRoll, GT_Recipe aRecipe) { // Based on the Processing Array. A bit overkill, but very flexible. @@ -636,9 +616,13 @@ public class GregtechMTE_ChemicalPlant extends GregtechMeta_MultiBlockBase<Gregt long tEnergy = getMaxInputEnergy(); // GT_Recipe tRecipe = findRecipe(getBaseMetaTileEntity(), mLastRecipe, false, - // gregtech.api.enums.GT_Values.V[tTier], aFluidInputs, aItemInputs); + // gregtech.api.enums.GT_Values.V[tTier], aFluidInputs, aItemInputs); GT_Recipe tRecipe = findRecipe( - mLastRecipe, gregtech.api.enums.GT_Values.V[tTier], getSolidCasingTier(), aItemInputs, aFluidInputs); + mLastRecipe, + gregtech.api.enums.GT_Values.V[tTier], + getSolidCasingTier(), + aItemInputs, + aFluidInputs); if (tRecipe == null) { return false; @@ -682,14 +666,9 @@ public class GregtechMTE_ChemicalPlant extends GregtechMeta_MultiBlockBase<Gregt return false; } - GT_ParallelHelper helper = new GT_ParallelHelper() - .setRecipe(tRecipe) - .setItemInputs(aItemInputs) - .setFluidInputs(aFluidInputs) - .setAvailableEUt(tEnergy) - .setMaxParallel(tMaxParallelCatalyst) - .enableConsumption() - .enableOutputCalculation(); + GT_ParallelHelper helper = new GT_ParallelHelper().setRecipe(tRecipe).setItemInputs(aItemInputs) + .setFluidInputs(aFluidInputs).setAvailableEUt(tEnergy).setMaxParallel(tMaxParallelCatalyst) + .enableConsumption().enableOutputCalculation(); if (!mVoidExcess) { helper.enableVoidProtection(this); } @@ -707,14 +686,10 @@ public class GregtechMTE_ChemicalPlant extends GregtechMeta_MultiBlockBase<Gregt this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000); this.mEfficiencyIncrease = 10000; - GT_OverclockCalculator calculator = new GT_OverclockCalculator() - .setRecipeEUt(tRecipe.mEUt) - .setEUt(tEnergy) - .setDuration(tRecipe.mDuration) - .setEUtDiscount(100.0f / aEUPercent) + GT_OverclockCalculator calculator = new GT_OverclockCalculator().setRecipeEUt(tRecipe.mEUt).setEUt(tEnergy) + .setDuration(tRecipe.mDuration).setEUtDiscount(100.0f / aEUPercent) .setSpeedBoost((100.0f / aSpeedBonusPercent)) - .setParallel(Math.min(aMaxParallelRecipes, helper.getCurrentParallel())) - .calculate(); + .setParallel(Math.min(aMaxParallelRecipes, helper.getCurrentParallel())).calculate(); lEUt = -calculator.getConsumption(); mMaxProgresstime = (int) Math.ceil(calculator.getDuration() * helper.getDurationMultiplier()); @@ -787,12 +762,8 @@ public class GregtechMTE_ChemicalPlant extends GregtechMeta_MultiBlockBase<Gregt } } - public GT_Recipe findRecipe( - final GT_Recipe aRecipe, - final long aVoltage, - final long aSpecialValue, - ItemStack[] aInputs, - final FluidStack[] aFluids) { + public GT_Recipe findRecipe(final GT_Recipe aRecipe, final long aVoltage, final long aSpecialValue, + ItemStack[] aInputs, final FluidStack[] aFluids) { if (!mInitRecipeCache) { initRecipeCaches(); } @@ -820,8 +791,7 @@ public class GregtechMTE_ChemicalPlant extends GregtechMeta_MultiBlockBase<Gregt GT_Recipe aFoundRecipe = null; // Iterate the tiers recipes until we find the one with all inputs matching - master: - for (AutoMap<GT_Recipe> aTieredMap : aMasterMap) { + master: for (AutoMap<GT_Recipe> aTieredMap : aMasterMap) { for (GT_Recipe aRecipeToCheck : aTieredMap) { if (aRecipeToCheck.isRecipeInputEqual(false, aFluids, aInputs)) { log("Found recipe with matching inputs!"); @@ -845,8 +815,8 @@ public class GregtechMTE_ChemicalPlant extends GregtechMeta_MultiBlockBase<Gregt return null; } - private int getCatalysts( - ItemStack[] aItemInputs, ItemStack aRecipeCatalyst, int aMaxParrallel, ArrayList<ItemStack> aOutPut) { + private int getCatalysts(ItemStack[] aItemInputs, ItemStack aRecipeCatalyst, int aMaxParrallel, + ArrayList<ItemStack> aOutPut) { int allowedParallel = 0; for (final ItemStack aInput : aItemInputs) { if (aRecipeCatalyst.isItemEqual(aInput)) { @@ -905,7 +875,7 @@ public class GregtechMTE_ChemicalPlant extends GregtechMeta_MultiBlockBase<Gregt } /* - * Catalyst Handling + * Catalyst Handling */ @Override public ArrayList<ItemStack> getStoredInputs() { diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/mega/GregTechMetaTileEntity_MegaAlloyBlastSmelter.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/mega/GregTechMetaTileEntity_MegaAlloyBlastSmelter.java index 702dc467be..57e4724ecd 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/mega/GregTechMetaTileEntity_MegaAlloyBlastSmelter.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/mega/GregTechMetaTileEntity_MegaAlloyBlastSmelter.java @@ -6,6 +6,15 @@ import static gregtech.api.enums.GT_HatchElement.Energy; import static gregtech.api.enums.GT_HatchElement.Maintenance; import static gregtech.api.util.GT_StructureUtility.*; +import java.util.*; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.StatCollector; +import net.minecraftforge.fluids.FluidStack; + import com.github.bartimaeusnek.bartworks.API.BorosilicateGlass; import com.github.bartimaeusnek.bartworks.util.Pair; import com.github.bartimaeusnek.bartworks.util.RecipeFinderForParallel; @@ -13,6 +22,7 @@ import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructa import com.gtnewhorizon.structurelib.structure.IStructureDefinition; import com.gtnewhorizon.structurelib.structure.ISurvivalBuildEnvironment; import com.gtnewhorizon.structurelib.structure.StructureDefinition; + import gregtech.api.enums.GT_Values; import gregtech.api.enums.HeatingCoilLevel; import gregtech.api.enums.TAE; @@ -25,13 +35,6 @@ import gregtech.api.render.TextureFactory; import gregtech.api.util.*; import gtPlusPlus.core.block.ModBlocks; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; -import java.util.*; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.StatCollector; -import net.minecraftforge.fluids.FluidStack; public class GregTechMetaTileEntity_MegaAlloyBlastSmelter extends GT_MetaTileEntity_ExtendedPowerMultiBlockBase<GregTechMetaTileEntity_MegaAlloyBlastSmelter> @@ -44,283 +47,79 @@ public class GregTechMetaTileEntity_MegaAlloyBlastSmelter private int currentParallels; private boolean hasNormalCoils; - private static final IStructureDefinition<GregTechMetaTileEntity_MegaAlloyBlastSmelter> STRUCTURE_DEFINITION = - StructureDefinition.<GregTechMetaTileEntity_MegaAlloyBlastSmelter>builder() - .addShape("main", new String[][] { - { - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " DDDDD ", - " CCCCC ", - " AEEEA ", - " AE~EA ", - " AEEEA ", - " CCCCC ", - " ZZZZZ " - }, - { - " DDDDD ", - " AAAAA ", - " AAAAA ", - " AAAAA ", - " AAAAA ", - " AAAAA ", - " AAAAA ", - " AAAAA ", - " AAAAA ", - " AAAAA ", - " AAAAA ", - " AAAAA ", - " DDDDD ", - " D D ", - " C C ", - " A A ", - " A A ", - " A A ", - " C C ", - " ZZZZZZZ " - }, - { - " DFFFFFD ", - " ABBBBBA ", - " ABBBBBA ", - " ABBBBBA ", - " ABBBBBA ", - " ABBBBBA ", - " ABBBBBA ", - " ABBBBBA ", - " ABBBBBA ", - " ABBBBBA ", - " ABBBBBA ", - " ABBBBBA ", - " DBBBBBD ", - " D BBBBB D ", - " C BBBBB C ", - " A BBBBB A ", - " A BBBBB A ", - " A BBBBB A ", - " C BBBBB C ", - " ZZZZZZZZZ " - }, - { - " DFFFFFFFD ", - " AB BA ", - " AB BA ", - " AB BA ", - " AB BA ", - " AB BA ", - " AB BA ", - " AB BA ", - " AB BA ", - " AB BA ", - " AB BA ", - " AB BA ", - " DB BD ", - "D B B D", - "C B B C", - "A B B A", - "A B B A", - "A B B A", - "C B B C", - "ZZZZZZZZZZZ" - }, - { - " DFFFFFFFD ", - " AB BA ", - " AB BA ", - " AB BA ", - " AB BA ", - " AB BA ", - " AB BA ", - " AB BA ", - " AB BA ", - " AB BA ", - " AB BA ", - " AB BA ", - " DB BD ", - "D B B D", - "C B B C", - "A B B A", - "A B B A", - "A B B A", - "C B B C", - "ZZZZZZZZZZZ" - }, - { - " DFFFFFFFD ", - " AB BA ", - " AB BA ", - " AB BA ", - " AB BA ", - " AB BA ", - " AB BA ", - " AB BA ", - " AB BA ", - " AB BA ", - " AB BA ", - " AB BA ", - " DB BD ", - "D B B D", - "C B B C", - "A B B A", - "A B B A", - "A B B A", - "C B B C", - "ZZZZZZZZZZZ" - }, - { - " DFFFFFFFD ", - " AB BA ", - " AB BA ", - " AB BA ", - " AB BA ", - " AB BA ", - " AB BA ", - " AB BA ", - " AB BA ", - " AB BA ", - " AB BA ", - " AB BA ", - " DB BD ", - "D B B D", - "C B B C", - "A B B A", - "A B B A", - "A B B A", - "C B B C", - "ZZZZZZZZZZZ" - }, - { - " DFFFFFFFD ", - " AB BA ", - " AB BA ", - " AB BA ", - " AB BA ", - " AB BA ", - " AB BA ", - " AB BA ", - " AB BA ", - " AB BA ", - " AB BA ", - " AB BA ", - " DB BD ", - "D B B D", - "C B B C", - "A B B A", - "A B B A", - "A B B A", - "C B B C", - "ZZZZZZZZZZZ" - }, - { - " DFFFFFD ", - " ABBBBBA ", - " ABBBBBA ", - " ABBBBBA ", - " ABBBBBA ", - " ABBBBBA ", - " ABBBBBA ", - " ABBBBBA ", - " ABBBBBA ", - " ABBBBBA ", - " ABBBBBA ", - " ABBBBBA ", - " DBBBBBD ", - " D BBBBB D ", - " C BBBBB C ", - " A BBBBB A ", - " A BBBBB A ", - " A BBBBB A ", - " C BBBBB C ", - " ZZZZZZZZZ " - }, - { - " DDDDD ", - " AAAAA ", - " AAAAA ", - " AAAAA ", - " AAAAA ", - " AAAAA ", - " AAAAA ", - " AAAAA ", - " AAAAA ", - " AAAAA ", - " AAAAA ", - " AAAAA ", - " DDDDD ", - " D D ", - " C C ", - " A A ", - " A A ", - " A A ", - " C C ", - " ZZZZZZZ " - }, - { - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " ", - " DDDDD ", - " CCCCC ", - " AAAAA ", - " AAAAA ", - " AAAAA ", - " CCCCC ", - " ZZZZZ " - } - }) - .addElement( - 'B', - ofChain( - onElementPass( - te -> te.hasNormalCoils = false, - ofCoil( - GregTechMetaTileEntity_MegaAlloyBlastSmelter::setCoilLevel, - GregTechMetaTileEntity_MegaAlloyBlastSmelter::getCoilLevel)), - onElementPass( - te -> te.hasNormalCoils = true, ofBlock(ModBlocks.blockCasingsMisc, 14)))) - .addElement( - 'Z', - buildHatchAdder(GregTechMetaTileEntity_MegaAlloyBlastSmelter.class) - .atLeast(InputHatch, OutputHatch, InputBus, OutputBus, Energy, ExoticEnergy) - .casingIndex(TAE.GTPP_INDEX(15)) - .dot(1) - .buildAndChain(ofBlock(ModBlocks.blockCasingsMisc, 15))) - .addElement( - 'E', - buildHatchAdder(GregTechMetaTileEntity_MegaAlloyBlastSmelter.class) - .atLeast(Maintenance) - .casingIndex(TAE.GTPP_INDEX(15)) - .dot(2) - .buildAndChain(ofBlock(ModBlocks.blockCasingsMisc, 15))) - .addElement('D', ofBlock(ModBlocks.blockCasingsMisc, 15)) - .addElement('C', ofBlock(ModBlocks.blockCasingsMisc, 14)) - .addElement( - 'A', - BorosilicateGlass.ofBoroGlass((byte) -1, (te, t) -> te.glassTier = t, te -> te.glassTier)) - .addElement('F', Muffler.newAny(TAE.GTPP_INDEX(15), 3)) - .build(); + private static final IStructureDefinition<GregTechMetaTileEntity_MegaAlloyBlastSmelter> STRUCTURE_DEFINITION = StructureDefinition + .<GregTechMetaTileEntity_MegaAlloyBlastSmelter>builder() + .addShape( + "main", + new String[][] { + { " ", " ", " ", " ", " ", " ", + " ", " ", " ", " ", " ", + " ", " ", " DDDDD ", " CCCCC ", " AEEEA ", + " AE~EA ", " AEEEA ", " CCCCC ", " ZZZZZ " }, + { " DDDDD ", " AAAAA ", " AAAAA ", " AAAAA ", " AAAAA ", " AAAAA ", + " AAAAA ", " AAAAA ", " AAAAA ", " AAAAA ", " AAAAA ", + " AAAAA ", " DDDDD ", " D D ", " C C ", " A A ", + " A A ", " A A ", " C C ", " ZZZZZZZ " }, + { " DFFFFFD ", " ABBBBBA ", " ABBBBBA ", " ABBBBBA ", " ABBBBBA ", " ABBBBBA ", + " ABBBBBA ", " ABBBBBA ", " ABBBBBA ", " ABBBBBA ", " ABBBBBA ", + " ABBBBBA ", " DBBBBBD ", " D BBBBB D ", " C BBBBB C ", " A BBBBB A ", + " A BBBBB A ", " A BBBBB A ", " C BBBBB C ", " ZZZZZZZZZ " }, + { " DFFFFFFFD ", " AB BA ", " AB BA ", " AB BA ", " AB BA ", " AB BA ", + " AB BA ", " AB BA ", " AB BA ", " AB BA ", " AB BA ", + " AB BA ", " DB BD ", "D B B D", "C B B C", "A B B A", + "A B B A", "A B B A", "C B B C", "ZZZZZZZZZZZ" }, + { " DFFFFFFFD ", " AB BA ", " AB BA ", " AB BA ", " AB BA ", " AB BA ", + " AB BA ", " AB BA ", " AB BA ", " AB BA ", " AB BA ", + " AB BA ", " DB BD ", "D B B D", "C B B C", "A B B A", + "A B B A", "A B B A", "C B B C", "ZZZZZZZZZZZ" }, + { " DFFFFFFFD ", " AB BA ", " AB BA ", " AB BA ", " AB BA ", " AB BA ", + " AB BA ", " AB BA ", " AB BA ", " AB BA ", " AB BA ", + " AB BA ", " DB BD ", "D B B D", "C B B C", "A B B A", + "A B B A", "A B B A", "C B B C", "ZZZZZZZZZZZ" }, + { " DFFFFFFFD ", " AB BA ", " AB BA ", " AB BA ", " AB BA ", " AB BA ", + " AB BA ", " AB BA ", " AB BA ", " AB BA ", " AB BA ", + " AB BA ", " DB BD ", "D B B D", "C B B C", "A B B A", + "A B B A", "A B B A", "C B B C", "ZZZZZZZZZZZ" }, + { " DFFFFFFFD ", " AB BA ", " AB BA ", " AB BA ", " AB BA ", " AB BA ", + " AB BA ", " AB BA ", " AB BA ", " AB BA ", " AB BA ", + " AB BA ", " DB BD ", "D B B D", "C B B C", "A B B A", + "A B B A", "A B B A", "C B B C", "ZZZZZZZZZZZ" }, + { " DFFFFFD ", " ABBBBBA ", " ABBBBBA ", " ABBBBBA ", " ABBBBBA ", " ABBBBBA ", + " ABBBBBA ", " ABBBBBA ", " ABBBBBA ", " ABBBBBA ", " ABBBBBA ", + " ABBBBBA ", " DBBBBBD ", " D BBBBB D ", " C BBBBB C ", " A BBBBB A ", + " A BBBBB A ", " A BBBBB A ", " C BBBBB C ", " ZZZZZZZZZ " }, + { " DDDDD ", " AAAAA ", " AAAAA ", " AAAAA ", " AAAAA ", " AAAAA ", + " AAAAA ", " AAAAA ", " AAAAA ", " AAAAA ", " AAAAA ", + " AAAAA ", " DDDDD ", " D D ", " C C ", " A A ", + " A A ", " A A ", " C C ", " ZZZZZZZ " }, + { " ", " ", " ", " ", " ", " ", + " ", " ", " ", " ", " ", + " ", " ", " DDDDD ", " CCCCC ", " AAAAA ", + " AAAAA ", " AAAAA ", " CCCCC ", " ZZZZZ " } }) + .addElement( + 'B', + ofChain( + onElementPass( + te -> te.hasNormalCoils = false, + ofCoil( + GregTechMetaTileEntity_MegaAlloyBlastSmelter::setCoilLevel, + GregTechMetaTileEntity_MegaAlloyBlastSmelter::getCoilLevel)), + onElementPass(te -> te.hasNormalCoils = true, ofBlock(ModBlocks.blockCasingsMisc, 14)))) + .addElement( + 'Z', + buildHatchAdder(GregTechMetaTileEntity_MegaAlloyBlastSmelter.class) + .atLeast(InputHatch, OutputHatch, InputBus, OutputBus, Energy, ExoticEnergy) + .casingIndex(TAE.GTPP_INDEX(15)).dot(1) + .buildAndChain(ofBlock(ModBlocks.blockCasingsMisc, 15))) + .addElement( + 'E', + buildHatchAdder(GregTechMetaTileEntity_MegaAlloyBlastSmelter.class).atLeast(Maintenance) + .casingIndex(TAE.GTPP_INDEX(15)).dot(2) + .buildAndChain(ofBlock(ModBlocks.blockCasingsMisc, 15))) + .addElement('D', ofBlock(ModBlocks.blockCasingsMisc, 15)) + .addElement('C', ofBlock(ModBlocks.blockCasingsMisc, 14)) + .addElement('A', BorosilicateGlass.ofBoroGlass((byte) -1, (te, t) -> te.glassTier = t, te -> te.glassTier)) + .addElement('F', Muffler.newAny(TAE.GTPP_INDEX(15), 3)).build(); public GregTechMetaTileEntity_MegaAlloyBlastSmelter(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); @@ -372,18 +171,14 @@ public class GregTechMetaTileEntity_MegaAlloyBlastSmelter currentParallels = RecipeFinderForParallel.handleParallelRecipe(recipe, tFluids, tItems, (int) parallels); if (currentParallels <= 0) return false; - GT_OverclockCalculator calculator = new GT_OverclockCalculator() - .setRecipeEUt(recipe.mEUt) - .setParallel(currentParallels) - .setDuration(recipe.mDuration) - .setEUt(tTotalEU) - .calculate(); + GT_OverclockCalculator calculator = new GT_OverclockCalculator().setRecipeEUt(recipe.mEUt) + .setParallel(currentParallels).setDuration(recipe.mDuration).setEUt(tTotalEU).calculate(); lEUt = calculator.getConsumption(); mMaxProgresstime = calculator.getDuration(); - Pair<ArrayList<FluidStack>, ArrayList<ItemStack>> outputs = - RecipeFinderForParallel.getMultiOutput(recipe, currentParallels); + Pair<ArrayList<FluidStack>, ArrayList<ItemStack>> outputs = RecipeFinderForParallel + .getMultiOutput(recipe, currentParallels); mMaxProgresstime -= coilLevel.getTier() < 0 ? 0 : mMaxProgresstime * getCoilDiscount(coilLevel); @@ -487,28 +282,40 @@ public class GregTechMetaTileEntity_MegaAlloyBlastSmelter @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType("Fluid Alloy Cooker") - .addInfo("Controller block for the Mega Alloy Blast Smelter") - .addInfo("Runs the same recipes as the normal ABS, except with up to " + EnumChatFormatting.BOLD - + EnumChatFormatting.UNDERLINE + MAX_PARALLELS + EnumChatFormatting.RESET - + EnumChatFormatting.GRAY + " parallels.") + tt.addMachineType("Fluid Alloy Cooker").addInfo("Controller block for the Mega Alloy Blast Smelter") + .addInfo( + "Runs the same recipes as the normal ABS, except with up to " + EnumChatFormatting.BOLD + + EnumChatFormatting.UNDERLINE + + MAX_PARALLELS + + EnumChatFormatting.RESET + + EnumChatFormatting.GRAY + + " parallels.") .addInfo("Every coil tier above cupronickel grants a speed bonus, based on this function:") .addInfo("Bonus = TIER / 150, rounded to the nearest thousandth.") - .addInfo(EnumChatFormatting.ITALIC - + "Can also use normal ABS coils in their place instead, if you don't like the bonuses :)" - + EnumChatFormatting.RESET + EnumChatFormatting.GRAY) + .addInfo( + EnumChatFormatting.ITALIC + + "Can also use normal ABS coils in their place instead, if you don't like the bonuses :)" + + EnumChatFormatting.RESET + + EnumChatFormatting.GRAY) .addInfo("The glass limits the tier of the energy hatch. UEV glass unlocks all tiers.") .addInfo("UV glass required for TecTech laser hatches.") - .addInfo(EnumChatFormatting.ITALIC + "\"all it does is make metals hot\"" + EnumChatFormatting.RESET - + EnumChatFormatting.GRAY) + .addInfo( + EnumChatFormatting.ITALIC + "\"all it does is make metals hot\"" + + EnumChatFormatting.RESET + + EnumChatFormatting.GRAY) .beginStructureBlock(11, 20, 11, false) .addStructureInfo("This structure is too complex! See schematic for details.") .addMaintenanceHatch("Around the controller", 2) .addOtherStructurePart( - "Input Bus, Output Bus, Input Hatch, Output Bus, Energy Hatch", "Bottom Casing", 1) - .addMufflerHatch("At least 45", 3) - .toolTipFinisher(EnumChatFormatting.AQUA + "MadMan310 " + EnumChatFormatting.GRAY + "via " - + EnumChatFormatting.RED + "GT++"); + "Input Bus, Output Bus, Input Hatch, Output Bus, Energy Hatch", + "Bottom Casing", + 1) + .addMufflerHatch("At least 45", 3).toolTipFinisher( + EnumChatFormatting.AQUA + "MadMan310 " + + EnumChatFormatting.GRAY + + "via " + + EnumChatFormatting.RED + + "GT++"); return tt; } @@ -526,30 +333,47 @@ public class GregTechMetaTileEntity_MegaAlloyBlastSmelter } } - return new String[] { - "------------ Critical Information ------------", - StatCollector.translateToLocal("GT5U.multiblock.Progress") + ": " + EnumChatFormatting.GREEN - + GT_Utility.formatNumbers(mProgresstime) + EnumChatFormatting.RESET + "t / " - + EnumChatFormatting.YELLOW - + GT_Utility.formatNumbers(mMaxProgresstime) + EnumChatFormatting.RESET + "t", - StatCollector.translateToLocal("GT5U.multiblock.energy") + ": " + EnumChatFormatting.GREEN - + GT_Utility.formatNumbers(storedEnergy) + EnumChatFormatting.RESET + " EU / " - + EnumChatFormatting.YELLOW - + GT_Utility.formatNumbers(maxEnergy) + EnumChatFormatting.RESET + " EU", - StatCollector.translateToLocal("GT5U.multiblock.usage") + ": " + EnumChatFormatting.RED - + GT_Utility.formatNumbers(-lEUt) + EnumChatFormatting.RESET + " EU/t", - StatCollector.translateToLocal("GT5U.multiblock.mei") + ": " + EnumChatFormatting.YELLOW - + GT_Utility.formatNumbers(getAverageInputVoltage()) - + EnumChatFormatting.RESET + " EU/t(*" + EnumChatFormatting.YELLOW - + GT_Utility.formatNumbers(getMaxInputAmps()) - + EnumChatFormatting.RESET + "A) " + StatCollector.translateToLocal("GT5U.machines.tier") - + ": " + EnumChatFormatting.YELLOW - + GT_Values.VN[GT_Utility.getTier(getAverageInputVoltage())] - + EnumChatFormatting.RESET, - "Parallels: " + EnumChatFormatting.BLUE + paras + EnumChatFormatting.RESET, - "Coil Discount: " + EnumChatFormatting.BLUE + discountP + "%" + EnumChatFormatting.RESET, - "-----------------------------------------" - }; + return new String[] { "------------ Critical Information ------------", + StatCollector.translateToLocal("GT5U.multiblock.Progress") + ": " + + EnumChatFormatting.GREEN + + GT_Utility.formatNumbers(mProgresstime) + + EnumChatFormatting.RESET + + "t / " + + EnumChatFormatting.YELLOW + + GT_Utility.formatNumbers(mMaxProgresstime) + + EnumChatFormatting.RESET + + "t", + StatCollector.translateToLocal("GT5U.multiblock.energy") + ": " + + EnumChatFormatting.GREEN + + GT_Utility.formatNumbers(storedEnergy) + + EnumChatFormatting.RESET + + " EU / " + + EnumChatFormatting.YELLOW + + GT_Utility.formatNumbers(maxEnergy) + + EnumChatFormatting.RESET + + " EU", + StatCollector.translateToLocal("GT5U.multiblock.usage") + ": " + + EnumChatFormatting.RED + + GT_Utility.formatNumbers(-lEUt) + + EnumChatFormatting.RESET + + " EU/t", + StatCollector.translateToLocal("GT5U.multiblock.mei") + ": " + + EnumChatFormatting.YELLOW + + GT_Utility.formatNumbers(getAverageInputVoltage()) + + EnumChatFormatting.RESET + + " EU/t(*" + + EnumChatFormatting.YELLOW + + GT_Utility.formatNumbers(getMaxInputAmps()) + + EnumChatFormatting.RESET + + "A) " + + StatCollector.translateToLocal("GT5U.machines.tier") + + ": " + + EnumChatFormatting.YELLOW + + GT_Values.VN[GT_Utility.getTier(getAverageInputVoltage())] + + EnumChatFormatting.RESET, + "Parallels: " + EnumChatFormatting.BLUE + paras + EnumChatFormatting.RESET, + "Coil Discount: " + EnumChatFormatting.BLUE + discountP + "%" + EnumChatFormatting.RESET, + "-----------------------------------------" }; } @Override @@ -558,32 +382,18 @@ public class GregTechMetaTileEntity_MegaAlloyBlastSmelter } @Override - public ITexture[] getTexture( - IGregTechTileEntity aBaseMetaTileEntity, - byte aSide, - byte aFacing, - byte aColorIndex, - boolean aActive, - boolean aRedstone) { + public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, + boolean aActive, boolean aRedstone) { if (aSide == aFacing) { if (aActive) { - return new ITexture[] { - Textures.BlockIcons.getCasingTextureForId(TAE.GTPP_INDEX(15)), - TextureFactory.builder() - .addIcon(TexturesGtBlock.Overlay_Machine_Controller_Advanced_Active) - .extFacing() - .build() - }; + return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(TAE.GTPP_INDEX(15)), + TextureFactory.builder().addIcon(TexturesGtBlock.Overlay_Machine_Controller_Advanced_Active) + .extFacing().build() }; } - return new ITexture[] { - Textures.BlockIcons.getCasingTextureForId(TAE.GTPP_INDEX(15)), - TextureFactory.builder() - .addIcon(TexturesGtBlock.Overlay_Machine_Controller_Advanced) - .extFacing() - .build() - }; + return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(TAE.GTPP_INDEX(15)), TextureFactory + .builder().addIcon(TexturesGtBlock.Overlay_Machine_Controller_Advanced).extFacing().build() }; } - return new ITexture[] {Textures.BlockIcons.getCasingTextureForId(TAE.GTPP_INDEX(15))}; + return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(TAE.GTPP_INDEX(15)) }; } @Override @@ -607,7 +417,8 @@ public class GregTechMetaTileEntity_MegaAlloyBlastSmelter } else { separateBusses = !separateBusses; GT_Utility.sendChatToPlayer( - aPlayer, StatCollector.translateToLocal("GT5U.machines.separatebus") + " " + separateBusses); + aPlayer, + StatCollector.translateToLocal("GT5U.machines.separatebus") + " " + separateBusses); } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GT_MTE_LargeTurbine_Gas.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GT_MTE_LargeTurbine_Gas.java index 31715246fc..3f0d83114e 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GT_MTE_LargeTurbine_Gas.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GT_MTE_LargeTurbine_Gas.java @@ -2,6 +2,12 @@ package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production.t import static gtPlusPlus.core.lib.CORE.RANDOM; +import java.util.ArrayList; + +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraftforge.fluids.FluidStack; + import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; @@ -9,10 +15,6 @@ import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Recipe.GT_Recipe_Map; import gregtech.api.util.GT_Utility; -import java.util.ArrayList; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraftforge.fluids.FluidStack; @SuppressWarnings("deprecation") public class GT_MTE_LargeTurbine_Gas extends GregtechMetaTileEntity_LargerTurbineBase { @@ -67,9 +69,8 @@ public class GT_MTE_LargeTurbine_Gas extends GregtechMetaTileEntity_LargerTurbin int tEU = 0; int actualOptimalFlow = 0; - FluidStack firstFuelType = new FluidStack( - aFluids.get(0), - 0); // Identify a SINGLE type of fluid to process. Doesn't matter which one. Ignore the rest! + FluidStack firstFuelType = new FluidStack(aFluids.get(0), 0); // Identify a SINGLE type of fluid to process. + // Doesn't matter which one. Ignore the rest! int fuelValue = getFuelValue(firstFuelType); // log("Fuel Value of "+aFluids.get(0).getLocalizedName()+" is "+fuelValue+"eu"); if (aOptFlow < fuelValue) { @@ -85,8 +86,9 @@ public class GT_MTE_LargeTurbine_Gas extends GregtechMetaTileEntity_LargerTurbin actualOptimalFlow = GT_Utility.safeInt((long) (aOptFlow * (double) flowMultipliers[1] / fuelValue)); this.realOptFlow = actualOptimalFlow; - int remainingFlow = GT_Utility.safeInt((long) (actualOptimalFlow - * 1.25f)); // Allowed to use up to 125% of optimal flow. Variable required outside of loop for + int remainingFlow = GT_Utility.safeInt((long) (actualOptimalFlow * 1.25f)); // Allowed to use up to 125% of + // optimal flow. Variable + // required outside of loop for // multi-hatch scenarios. int flow = 0; int totalFlow = 0; @@ -94,9 +96,8 @@ public class GT_MTE_LargeTurbine_Gas extends GregtechMetaTileEntity_LargerTurbin storedFluid = 0; for (FluidStack aFluid : aFluids) { if (aFluid.isFluidEqual(firstFuelType)) { - flow = Math.min( - aFluid.amount, - remainingFlow); // try to use up to 125% of optimal flow w/o exceeding remainingFlow + flow = Math.min(aFluid.amount, remainingFlow); // try to use up to 125% of optimal flow w/o + // exceeding remainingFlow depleteInput(new FluidStack(aFluid, flow)); // deplete that amount this.storedFluid += aFluid.amount; remainingFlow -= flow; // track amount we're allowed to continue depleting from hatches diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GT_MTE_LargeTurbine_Plasma.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GT_MTE_LargeTurbine_Plasma.java index b55d61baab..d30f44b737 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GT_MTE_LargeTurbine_Plasma.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GT_MTE_LargeTurbine_Plasma.java @@ -1,5 +1,11 @@ package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production.turbines; +import java.util.ArrayList; + +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidRegistry; +import net.minecraftforge.fluids.FluidStack; + import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; @@ -10,10 +16,6 @@ import gregtech.api.util.GT_Recipe.GT_Recipe_Map; import gregtech.api.util.GT_Utility; import gtPlusPlus.core.util.math.MathUtils; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Turbine; -import java.util.ArrayList; -import net.minecraft.item.ItemStack; -import net.minecraftforge.fluids.FluidRegistry; -import net.minecraftforge.fluids.FluidStack; @SuppressWarnings("deprecation") public class GT_MTE_LargeTurbine_Plasma extends GregtechMetaTileEntity_LargerTurbineBase { @@ -63,21 +65,14 @@ public class GT_MTE_LargeTurbine_Plasma extends GregtechMetaTileEntity_LargerTur } @Override - public boolean checkRecipeGeneric( - ItemStack[] aItemInputs, - FluidStack[] aFluidInputs, - int aMaxParallelRecipes, - long aEUPercent, - int aSpeedBonusPercent, - int aOutputChanceRoll, - GT_Recipe aRecipe) { + public boolean checkRecipeGeneric(ItemStack[] aItemInputs, FluidStack[] aFluidInputs, int aMaxParallelRecipes, + long aEUPercent, int aSpeedBonusPercent, int aOutputChanceRoll, GT_Recipe aRecipe) { try { ArrayList<GT_MetaTileEntity_Hatch_Turbine> aEmptyTurbineRotorHatches = getEmptyTurbineAssemblies(); if (aEmptyTurbineRotorHatches.size() > 0) { log("Found " + aEmptyTurbineRotorHatches.size() + " Assemblies without Turbine."); - hatch: - for (GT_MetaTileEntity_Hatch_Turbine aHatch : aEmptyTurbineRotorHatches) { + hatch: for (GT_MetaTileEntity_Hatch_Turbine aHatch : aEmptyTurbineRotorHatches) { ArrayList<ItemStack> aTurbines = getAllBufferedTurbines(); for (ItemStack aTurbineItem : aTurbines) { if (aTurbineItem == null) { @@ -101,8 +96,7 @@ public class GT_MTE_LargeTurbine_Plasma extends GregtechMetaTileEntity_LargerTur ArrayList<FluidStack> tFluids = getStoredFluids(); if (tFluids.size() > 0) { - if (baseEff == 0 - || optFlow == 0 + if (baseEff == 0 || optFlow == 0 || counter >= 512 || this.getBaseMetaTileEntity().hasWorkJustBeenEnabled() || this.getBaseMetaTileEntity().hasInventoryBeenModified()) { @@ -114,17 +108,18 @@ public class GT_MTE_LargeTurbine_Plasma extends GregtechMetaTileEntity_LargerTur ItemStack aStack = getFullTurbineAssemblies().get(0).getTurbine(); for (int i = 0; i < getSpeedMultiplier(); i++) { if (i == 0) { - aTotalBaseEff += GT_Utility.safeInt((long) - ((5F + ((GT_MetaGenerated_Tool) aStack.getItem()).getToolCombatDamage(aStack)) + aTotalBaseEff += GT_Utility.safeInt( + (long) ((5F + + ((GT_MetaGenerated_Tool) aStack.getItem()).getToolCombatDamage(aStack)) * 1000F)); } - aTotalOptimalFlow += GT_Utility.safeInt((long) Math.max( - Float.MIN_NORMAL, - ((GT_MetaGenerated_Tool) aStack.getItem()) - .getToolStats(aStack) + aTotalOptimalFlow += GT_Utility.safeInt( + (long) Math.max( + Float.MIN_NORMAL, + ((GT_MetaGenerated_Tool) aStack.getItem()).getToolStats(aStack) .getSpeedMultiplier() - * GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mToolSpeed - * 50)); + * GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mToolSpeed + * 50)); if (aTotalOptimalFlow < 0) { log("Int overflow, report to issue tracker"); aTotalOptimalFlow = 100; @@ -154,8 +149,8 @@ public class GT_MTE_LargeTurbine_Plasma extends GregtechMetaTileEntity_LargerTur // This is how much the turbine can actually change during this tick int maxChangeAllowed = Math.max(10, GT_Utility.safeInt((long) Math.abs(difference) / 100)); - if (Math.abs(difference) - > maxChangeAllowed) { // If this difference is too big, use the maximum allowed change + if (Math.abs(difference) > maxChangeAllowed) { // If this difference is too big, use the maximum allowed + // change int change = maxChangeAllowed * (difference > 0 ? 1 : -1); // Make the change positive or negative. this.lEUt += change; // Apply the change } else { @@ -169,7 +164,7 @@ public class GT_MTE_LargeTurbine_Plasma extends GregtechMetaTileEntity_LargerTur } else { this.mMaxProgresstime = 20; this.mEfficiencyIncrease = 10; - // Overvoltage is handled inside the MultiBlockBase when pushing out to dynamos. no need to do it here. + // Overvoltage is handled inside the MultiBlockBase when pushing out to dynamos. no need to do it here. // Play sounds (GT++ addition - GT multiblocks play no sounds) startProcess(); return true; @@ -188,16 +183,16 @@ public class GT_MTE_LargeTurbine_Plasma extends GregtechMetaTileEntity_LargerTur int actualOptimalFlow = 0; - FluidStack firstFuelType = new FluidStack( - aFluids.get(0), - 0); // Identify a SINGLE type of fluid to process. Doesn't matter which one. Ignore the rest! + FluidStack firstFuelType = new FluidStack(aFluids.get(0), 0); // Identify a SINGLE type of fluid to process. + // Doesn't matter which one. Ignore the rest! int fuelValue = getFuelValue(firstFuelType); - actualOptimalFlow = GT_Utility.safeInt( - (long) Math.ceil((double) aOptFlow * (double) flowMultipliers[2] / (double) fuelValue)); + actualOptimalFlow = GT_Utility + .safeInt((long) Math.ceil((double) aOptFlow * (double) flowMultipliers[2] / (double) fuelValue)); this.realOptFlow = actualOptimalFlow; // For scanner info - int remainingFlow = GT_Utility.safeInt((long) (actualOptimalFlow - * 1.25f)); // Allowed to use up to 125% of optimal flow. Variable required outside of loop for + int remainingFlow = GT_Utility.safeInt((long) (actualOptimalFlow * 1.25f)); // Allowed to use up to 125% of + // optimal flow. Variable + // required outside of loop for // multi-hatch scenarios. int flow = 0; int totalFlow = 0; diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GT_MTE_LargeTurbine_SCSteam.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GT_MTE_LargeTurbine_SCSteam.java index c5b4697b1c..ea6753e7d7 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GT_MTE_LargeTurbine_SCSteam.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GT_MTE_LargeTurbine_SCSteam.java @@ -1,5 +1,11 @@ package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production.turbines; +import java.util.ArrayList; + +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidRegistry; +import net.minecraftforge.fluids.FluidStack; + import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; @@ -7,10 +13,6 @@ import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_Utility; import gtPlusPlus.core.util.math.MathUtils; -import java.util.ArrayList; -import net.minecraft.item.ItemStack; -import net.minecraftforge.fluids.FluidRegistry; -import net.minecraftforge.fluids.FluidStack; public class GT_MTE_LargeTurbine_SCSteam extends GregtechMetaTileEntity_LargerTurbineBase { @@ -57,8 +59,8 @@ public class GT_MTE_LargeTurbine_SCSteam extends GregtechMetaTileEntity_LargerTu int tEU = 0; int totalFlow = 0; // Byproducts are based on actual flow int flow = 0; - int remainingFlow = MathUtils.safeInt((long) (aOptFlow - * 1.25f)); // Allowed to use up to 125% of optimal flow. Variable required outside of loop for + int remainingFlow = MathUtils.safeInt((long) (aOptFlow * 1.25f)); // Allowed to use up to 125% of optimal flow. + // Variable required outside of loop for // multi-hatch scenarios. this.realOptFlow = (double) aOptFlow * (double) flowMultipliers[0]; diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GT_MTE_LargeTurbine_SHSteam.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GT_MTE_LargeTurbine_SHSteam.java index d913abf9a8..4974508661 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GT_MTE_LargeTurbine_SHSteam.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GT_MTE_LargeTurbine_SHSteam.java @@ -1,5 +1,12 @@ package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production.turbines; +import java.util.ArrayList; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraftforge.fluids.FluidStack; + import gregtech.GT_Mod; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; @@ -10,11 +17,6 @@ import gregtech.api.util.GT_Utility; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.util.math.MathUtils; import gtPlusPlus.core.util.minecraft.PlayerUtils; -import java.util.ArrayList; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraftforge.fluids.FluidStack; @SuppressWarnings("deprecation") public class GT_MTE_LargeTurbine_SHSteam extends GregtechMetaTileEntity_LargerTurbineBase { @@ -77,8 +79,8 @@ public class GT_MTE_LargeTurbine_SHSteam extends GregtechMetaTileEntity_LargerTu int tEU = 0; int totalFlow = 0; // Byproducts are based on actual flow int flow = 0; - int remainingFlow = MathUtils.safeInt((long) (aOptFlow - * 1.25f)); // Allowed to use up to 125% of optimal flow. Variable required outside of loop for + int remainingFlow = MathUtils.safeInt((long) (aOptFlow * 1.25f)); // Allowed to use up to 125% of optimal flow. + // Variable required outside of loop for // multi-hatch scenarios. this.realOptFlow = (double) aOptFlow * (double) flowMultipliers[0]; @@ -94,20 +96,16 @@ public class GT_MTE_LargeTurbine_SHSteam extends GregtechMetaTileEntity_LargerTu if (!achievement) { try { GT_Mod.achievements.issueAchievement( - this.getBaseMetaTileEntity() - .getWorld() - .getPlayerEntityByName( - this.getBaseMetaTileEntity().getOwnerName()), + this.getBaseMetaTileEntity().getWorld() + .getPlayerEntityByName(this.getBaseMetaTileEntity().getOwnerName()), "efficientsteam"); - } catch (Exception e) { - } + } catch (Exception e) {} achievement = true; } - } else if (fluidName.equals("fluid.steam") - || fluidName.equals("ic2.fluidSteam") + } else if (fluidName.equals("fluid.steam") || fluidName.equals("ic2.fluidSteam") || fluidName.equals("fluid.mfr.steam.still.name")) { - depleteInput(new FluidStack(aFluids.get(i), aFluids.get(i).amount)); - } + depleteInput(new FluidStack(aFluids.get(i), aFluids.get(i).amount)); + } } if (totalFlow <= 0) return 0; tEU = totalFlow; @@ -133,7 +131,8 @@ public class GT_MTE_LargeTurbine_SHSteam extends GregtechMetaTileEntity_LargerTu if (aSide == getBaseMetaTileEntity().getFrontFacing()) { looseFit ^= true; GT_Utility.sendChatToPlayer( - aPlayer, looseFit ? "Fitting is Loose (Higher Flow)" : "Fitting is Tight (Higher Efficiency)"); + aPlayer, + looseFit ? "Fitting is Loose (Higher Flow)" : "Fitting is Tight (Higher Efficiency)"); } if (looseFit) { diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GT_MTE_LargeTurbine_Steam.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GT_MTE_LargeTurbine_Steam.java index cb58c8acc5..88af874326 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GT_MTE_LargeTurbine_Steam.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GT_MTE_LargeTurbine_Steam.java @@ -2,6 +2,13 @@ package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production.t import static gtPlusPlus.core.lib.CORE.RANDOM; +import java.util.ArrayList; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraftforge.fluids.FluidStack; + import gregtech.GT_Mod; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; @@ -11,11 +18,6 @@ import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_Utility; import gtPlusPlus.core.util.math.MathUtils; import gtPlusPlus.core.util.minecraft.PlayerUtils; -import java.util.ArrayList; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraftforge.fluids.FluidStack; @SuppressWarnings("deprecation") public class GT_MTE_LargeTurbine_Steam extends GregtechMetaTileEntity_LargerTurbineBase { @@ -85,18 +87,16 @@ public class GT_MTE_LargeTurbine_Steam extends GregtechMetaTileEntity_LargerTurb int tEU = 0; int totalFlow = 0; // Byproducts are based on actual flow int flow = 0; - int remainingFlow = MathUtils.safeInt((long) (aOptFlow - * 1.25f)); // Allowed to use up to 125% of optimal flow. Variable required outside of loop for + int remainingFlow = MathUtils.safeInt((long) (aOptFlow * 1.25f)); // Allowed to use up to 125% of optimal flow. + // Variable required outside of loop for // multi-hatch scenarios. this.realOptFlow = (double) aOptFlow * (double) flowMultipliers[0]; storedFluid = 0; - for (int i = 0; - i < aFluids.size() && remainingFlow > 0; - i++) { // loop through each hatch; extract inputs and track totals. + for (int i = 0; i < aFluids.size() && remainingFlow > 0; i++) { // loop through each hatch; extract inputs and + // track totals. String fluidName = aFluids.get(i).getFluid().getUnlocalizedName(aFluids.get(i)); - if (fluidName.equals("fluid.steam") - || fluidName.equals("ic2.fluidSteam") + if (fluidName.equals("fluid.steam") || fluidName.equals("ic2.fluidSteam") || fluidName.equals("fluid.mfr.steam.still.name")) { flow = Math.min(aFluids.get(i).amount, remainingFlow); // try to use up w/o exceeding remainingFlow depleteInput(new FluidStack(aFluids.get(i), flow)); // deplete that amount @@ -105,10 +105,8 @@ public class GT_MTE_LargeTurbine_Steam extends GregtechMetaTileEntity_LargerTurb totalFlow += flow; // track total input used if (!achievement) { GT_Mod.achievements.issueAchievement( - this.getBaseMetaTileEntity() - .getWorld() - .getPlayerEntityByName( - this.getBaseMetaTileEntity().getOwnerName()), + this.getBaseMetaTileEntity().getWorld() + .getPlayerEntityByName(this.getBaseMetaTileEntity().getOwnerName()), "muchsteam"); achievement = true; } @@ -141,7 +139,8 @@ public class GT_MTE_LargeTurbine_Steam extends GregtechMetaTileEntity_LargerTurb if (aSide == getBaseMetaTileEntity().getFrontFacing()) { looseFit ^= true; GT_Utility.sendChatToPlayer( - aPlayer, looseFit ? "Fitting: Loose - More Flow" : "Fitting: Tight - More Efficiency"); + aPlayer, + looseFit ? "Fitting: Loose - More Flow" : "Fitting: Tight - More Efficiency"); } if (looseFit) { diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GregtechMetaTileEntity_LargerTurbineBase.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GregtechMetaTileEntity_LargerTurbineBase.java index d6ce8e4bb2..f08fc1c9ea 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GregtechMetaTileEntity_LargerTurbineBase.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GregtechMetaTileEntity_LargerTurbineBase.java @@ -6,10 +6,21 @@ import static gregtech.api.enums.GT_HatchElement.*; import static gregtech.api.util.GT_StructureUtility.buildHatchAdder; import static gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase.GTPPHatchElement.TTDynamo; +import java.util.ArrayList; + +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.StatCollector; +import net.minecraftforge.fluids.FluidStack; + import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable; import com.gtnewhorizon.structurelib.structure.IStructureDefinition; import com.gtnewhorizon.structurelib.structure.ISurvivalBuildEnvironment; import com.gtnewhorizon.structurelib.structure.StructureDefinition; + import gregtech.api.enums.Materials; import gregtech.api.enums.Textures; import gregtech.api.interfaces.ITexture; @@ -34,18 +45,9 @@ import gtPlusPlus.core.util.minecraft.PlayerUtils; import gtPlusPlus.core.util.minecraft.gregtech.PollutionUtils; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Turbine; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase; -import java.util.ArrayList; -import net.minecraft.block.Block; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.StatCollector; -import net.minecraftforge.fluids.FluidStack; -public abstract class GregtechMetaTileEntity_LargerTurbineBase - extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_LargerTurbineBase> - implements ISurvivalConstructable { +public abstract class GregtechMetaTileEntity_LargerTurbineBase extends + GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_LargerTurbineBase> implements ISurvivalConstructable { protected int baseEff = 0; protected long optFlow = 0; @@ -54,13 +56,12 @@ public abstract class GregtechMetaTileEntity_LargerTurbineBase protected int counter = 0; protected boolean mFastMode = false; protected double mufflerReduction = 1; - protected float[] flowMultipliers = new float[] {1, 1, 1}; + protected float[] flowMultipliers = new float[] { 1, 1, 1 }; public ITexture frontFace; public ITexture frontFaceActive; - public ArrayList<GT_MetaTileEntity_Hatch_Turbine> mTurbineRotorHatches = - new ArrayList<GT_MetaTileEntity_Hatch_Turbine>(); + public ArrayList<GT_MetaTileEntity_Hatch_Turbine> mTurbineRotorHatches = new ArrayList<GT_MetaTileEntity_Hatch_Turbine>(); public GregtechMetaTileEntity_LargerTurbineBase(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); @@ -87,23 +88,17 @@ public abstract class GregtechMetaTileEntity_LargerTurbineBase @Override protected final GT_Multiblock_Tooltip_Builder createTooltip() { GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType(getMachineType()) - .addInfo("Controller Block for the XL " + getTurbineType() + " Turbine") + tt.addMachineType(getMachineType()).addInfo("Controller Block for the XL " + getTurbineType() + " Turbine") .addInfo("Runs as fast as 16 Large Turbines of the same type, takes the space of 12") .addInfo("Right-click with screwdriver to enable Fast Mode, to run it even faster") .addInfo("Optimal flow will increase or decrease accordingly on mode switch") .addInfo("Fast Mode increases speed to 48x instead of 16x, with some penalties") .addInfo("Maintenance problems and turbine damage happen 12x as often in Fast Mode") .addInfo("XL Steam Turbines can use Loose Mode with either Slow or Fast Mode") - .addPollutionAmount(getPollutionPerSecond(null)) - .addInfo("Pollution is 3x higher in Fast Mode") - .addSeparator() - .beginStructureBlock(7, 9, 7, false) - .addController("Top Middle") - .addCasingInfo(getCasingName(), 360) - .addCasingInfo("Rotor Shaft", 30) - .addOtherStructurePart("Rotor Assembly", "Any 1 dot hint", 1) - .addInputBus("Any 4 dot hint (min 1)", 4) + .addPollutionAmount(getPollutionPerSecond(null)).addInfo("Pollution is 3x higher in Fast Mode") + .addSeparator().beginStructureBlock(7, 9, 7, false).addController("Top Middle") + .addCasingInfo(getCasingName(), 360).addCasingInfo("Rotor Shaft", 30) + .addOtherStructurePart("Rotor Assembly", "Any 1 dot hint", 1).addInputBus("Any 4 dot hint (min 1)", 4) .addInputHatch("Any 4 dot hint(min 1)", 4); if (requiresOutputHatch()) { tt.addOutputHatch("Any 4 dot hint(min 1)", 4); @@ -117,48 +112,58 @@ public abstract class GregtechMetaTileEntity_LargerTurbineBase } private static final String STRUCTURE_PIECE_MAIN = "main"; - private static final ClassValue<IStructureDefinition<GregtechMetaTileEntity_LargerTurbineBase>> - STRUCTURE_DEFINITION = new ClassValue<IStructureDefinition<GregtechMetaTileEntity_LargerTurbineBase>>() { - @Override - protected IStructureDefinition<GregtechMetaTileEntity_LargerTurbineBase> computeValue(Class<?> type) { - return StructureDefinition.<GregtechMetaTileEntity_LargerTurbineBase>builder() - // c = turbine casing - // s = turbine shaft - // t = turbine housing - // h = dynamo/maint - // m = muffler - .addShape(STRUCTURE_PIECE_MAIN, (new String[][] { - {"ccchccc", "ccccccc", "ccmmmcc", "ccm~mcc", "ccmmmcc", "ccccccc", "ccchccc"}, - {"ctchctc", "cscccsc", "cscccsc", "cscccsc", "cscccsc", "cscccsc", "ctchctc"}, - {"ccchccc", "ccccccc", "ccccccc", "ccccccc", "ccccccc", "ccccccc", "ccchccc"}, - {"ccchccc", "ccccccc", "ccccccc", "ccccccc", "ccccccc", "ccccccc", "ccchccc"}, - {"ctchctc", "cscccsc", "cscccsc", "cscccsc", "cscccsc", "cscccsc", "ctchctc"}, - {"ccchccc", "ccccccc", "ccccccc", "ccccccc", "ccccccc", "ccccccc", "ccchccc"}, - {"ccchccc", "ccccccc", "ccccccc", "ccccccc", "ccccccc", "ccccccc", "ccchccc"}, - {"ctchctc", "cscccsc", "cscccsc", "cscccsc", "cscccsc", "cscccsc", "ctchctc"}, - {"ccchccc", "ccccccc", "ccccccc", "ccccccc", "ccccccc", "ccccccc", "ccchccc"}, - })) - .addElement('c', lazy(t -> ofBlock(t.getCasingBlock(), t.getCasingMeta()))) - .addElement('s', lazy(t -> ofBlock(t.getShaftBlock(), t.getTurbineShaftMeta()))) - .addElement('t', lazy(t -> buildHatchAdder(GregtechMetaTileEntity_LargerTurbineBase.class) - .adder(GregtechMetaTileEntity_LargerTurbineBase::addTurbineHatch) - .hatchClass(GT_MetaTileEntity_Hatch_Turbine.class) - .casingIndex(t.getCasingTextureIndex()) - .dot(1) - .build())) - .addElement('h', lazy(t -> buildHatchAdder(GregtechMetaTileEntity_LargerTurbineBase.class) - .atLeast(InputBus, InputHatch, OutputHatch, Dynamo.or(TTDynamo), Maintenance) - .casingIndex(t.getCasingTextureIndex()) - .dot(4) - .buildAndChain(t.getCasingBlock(), t.getCasingMeta()))) - .addElement('m', lazy(t -> buildHatchAdder(GregtechMetaTileEntity_LargerTurbineBase.class) - .atLeast(Muffler) - .casingIndex(t.getCasingTextureIndex()) - .dot(7) - .buildAndChain(t.getCasingBlock(), t.getCasingMeta()))) - .build(); - } - }; + private static final ClassValue<IStructureDefinition<GregtechMetaTileEntity_LargerTurbineBase>> STRUCTURE_DEFINITION = new ClassValue<IStructureDefinition<GregtechMetaTileEntity_LargerTurbineBase>>() { + + @Override + protected IStructureDefinition<GregtechMetaTileEntity_LargerTurbineBase> computeValue(Class<?> type) { + return StructureDefinition.<GregtechMetaTileEntity_LargerTurbineBase>builder() + // c = turbine casing + // s = turbine shaft + // t = turbine housing + // h = dynamo/maint + // m = muffler + .addShape( + STRUCTURE_PIECE_MAIN, + (new String[][] { + { "ccchccc", "ccccccc", "ccmmmcc", "ccm~mcc", "ccmmmcc", "ccccccc", "ccchccc" }, + { "ctchctc", "cscccsc", "cscccsc", "cscccsc", "cscccsc", "cscccsc", "ctchctc" }, + { "ccchccc", "ccccccc", "ccccccc", "ccccccc", "ccccccc", "ccccccc", "ccchccc" }, + { "ccchccc", "ccccccc", "ccccccc", "ccccccc", "ccccccc", "ccccccc", "ccchccc" }, + { "ctchctc", "cscccsc", "cscccsc", "cscccsc", "cscccsc", "cscccsc", "ctchctc" }, + { "ccchccc", "ccccccc", "ccccccc", "ccccccc", "ccccccc", "ccccccc", "ccchccc" }, + { "ccchccc", "ccccccc", "ccccccc", "ccccccc", "ccccccc", "ccccccc", "ccchccc" }, + { "ctchctc", "cscccsc", "cscccsc", "cscccsc", "cscccsc", "cscccsc", "ctchctc" }, + { "ccchccc", "ccccccc", "ccccccc", "ccccccc", "ccccccc", "ccccccc", "ccchccc" }, })) + .addElement('c', lazy(t -> ofBlock(t.getCasingBlock(), t.getCasingMeta()))) + .addElement('s', lazy(t -> ofBlock(t.getShaftBlock(), t.getTurbineShaftMeta()))) + .addElement( + 't', + lazy( + t -> buildHatchAdder(GregtechMetaTileEntity_LargerTurbineBase.class) + .adder(GregtechMetaTileEntity_LargerTurbineBase::addTurbineHatch) + .hatchClass(GT_MetaTileEntity_Hatch_Turbine.class) + .casingIndex(t.getCasingTextureIndex()).dot(1).build())) + .addElement( + 'h', + lazy( + t -> buildHatchAdder(GregtechMetaTileEntity_LargerTurbineBase.class) + .atLeast( + InputBus, + InputHatch, + OutputHatch, + Dynamo.or(TTDynamo), + Maintenance) + .casingIndex(t.getCasingTextureIndex()).dot(4) + .buildAndChain(t.getCasingBlock(), t.getCasingMeta()))) + .addElement( + 'm', + lazy( + t -> buildHatchAdder(GregtechMetaTileEntity_LargerTurbineBase.class) + .atLeast(Muffler).casingIndex(t.getCasingTextureIndex()).dot(7) + .buildAndChain(t.getCasingBlock(), t.getCasingMeta()))) + .build(); + } + }; @Override public IStructureDefinition<GregtechMetaTileEntity_LargerTurbineBase> getStructureDefinition() { @@ -199,20 +204,26 @@ public abstract class GregtechMetaTileEntity_LargerTurbineBase // we do not check for casing count here. the bare minimal is 372 but we only require 360 boolean aStructure = checkPiece(STRUCTURE_PIECE_MAIN, 3, 3, 0); log("Structure Check: " + aStructure); - if (mTurbineRotorHatches.size() != 12 - || mMaintenanceHatches.size() != 1 + if (mTurbineRotorHatches.size() != 12 || mMaintenanceHatches.size() != 1 || (mDynamoHatches.size() < 1 && mTecTechDynamoHatches.size() < 1) || (requiresMufflers() && mMufflerHatches.size() != 4) || mInputBusses.size() < 1 || mInputHatches.size() < 1 || (requiresOutputHatch() && mOutputHatches.size() < 1)) { - log("Bad Hatches - Turbine Housings: " + mTurbineRotorHatches.size() + ", Maint: " - + mMaintenanceHatches.size() + ", Dynamo: " - + mDynamoHatches.size() + ", Muffler: " - + mMufflerHatches.size() + ", Input Buses: " - + mInputBusses.size() + ", Input Hatches: " - + mInputHatches.size() + ", Output Hatches: " - + mOutputHatches.size()); + log( + "Bad Hatches - Turbine Housings: " + mTurbineRotorHatches.size() + + ", Maint: " + + mMaintenanceHatches.size() + + ", Dynamo: " + + mDynamoHatches.size() + + ", Muffler: " + + mMufflerHatches.size() + + ", Input Buses: " + + mInputBusses.size() + + ", Input Hatches: " + + mInputHatches.size() + + ", Output Hatches: " + + mOutputHatches.size()); return false; } mufflerReduction = getMufflerReduction(); @@ -280,8 +291,7 @@ public abstract class GregtechMetaTileEntity_LargerTurbineBase public abstract int getFuelValue(FluidStack aLiquid); public static boolean isValidTurbine(ItemStack aTurbine) { - return (aTurbine != null - && aTurbine.getItem() instanceof GT_MetaGenerated_Tool + return (aTurbine != null && aTurbine.getItem() instanceof GT_MetaGenerated_Tool && aTurbine.getItemDamage() >= 170 && aTurbine.getItemDamage() <= 176); } @@ -363,8 +373,7 @@ public abstract class GregtechMetaTileEntity_LargerTurbineBase } protected ArrayList<GT_MetaTileEntity_Hatch_Turbine> getEmptyTurbineAssemblies() { - ArrayList<GT_MetaTileEntity_Hatch_Turbine> aEmptyTurbineRotorHatches = - new ArrayList<GT_MetaTileEntity_Hatch_Turbine>(); + ArrayList<GT_MetaTileEntity_Hatch_Turbine> aEmptyTurbineRotorHatches = new ArrayList<GT_MetaTileEntity_Hatch_Turbine>(); // log("Checking "+mTurbineRotorHatches.size()+" Assemblies for empties."); for (GT_MetaTileEntity_Hatch_Turbine aTurbineHatch : this.mTurbineRotorHatches) { if (!aTurbineHatch.hasTurbine()) { @@ -376,8 +385,7 @@ public abstract class GregtechMetaTileEntity_LargerTurbineBase } protected ArrayList<GT_MetaTileEntity_Hatch_Turbine> getFullTurbineAssemblies() { - ArrayList<GT_MetaTileEntity_Hatch_Turbine> aTurbineRotorHatches = - new ArrayList<GT_MetaTileEntity_Hatch_Turbine>(); + ArrayList<GT_MetaTileEntity_Hatch_Turbine> aTurbineRotorHatches = new ArrayList<GT_MetaTileEntity_Hatch_Turbine>(); // log("Checking "+mTurbineRotorHatches.size()+" Assemblies for Turbines."); for (GT_MetaTileEntity_Hatch_Turbine aTurbineHatch : this.mTurbineRotorHatches) { if (aTurbineHatch.hasTurbine()) { @@ -411,25 +419,23 @@ public abstract class GregtechMetaTileEntity_LargerTurbineBase @Override public boolean checkRecipe(final ItemStack aStack) { return checkRecipeGeneric( - new ItemStack[] {}, getStoredFluids().toArray(new FluidStack[] {}), 1, 100, 100, 10000); + new ItemStack[] {}, + getStoredFluids().toArray(new FluidStack[] {}), + 1, + 100, + 100, + 10000); } @Override - public boolean checkRecipeGeneric( - ItemStack[] aItemInputs, - FluidStack[] aFluidInputs, - int aMaxParallelRecipes, - long aEUPercent, - int aSpeedBonusPercent, - int aOutputChanceRoll, - GT_Recipe aRecipe) { + public boolean checkRecipeGeneric(ItemStack[] aItemInputs, FluidStack[] aFluidInputs, int aMaxParallelRecipes, + long aEUPercent, int aSpeedBonusPercent, int aOutputChanceRoll, GT_Recipe aRecipe) { try { ArrayList<GT_MetaTileEntity_Hatch_Turbine> aEmptyTurbineRotorHatches = getEmptyTurbineAssemblies(); if (aEmptyTurbineRotorHatches.size() > 0) { log("Found " + aEmptyTurbineRotorHatches.size() + " Assemblies without Turbine."); - hatch: - for (GT_MetaTileEntity_Hatch_Turbine aHatch : aEmptyTurbineRotorHatches) { + hatch: for (GT_MetaTileEntity_Hatch_Turbine aHatch : aEmptyTurbineRotorHatches) { ArrayList<ItemStack> aTurbines = getAllBufferedTurbines(); for (ItemStack aTurbineItem : aTurbines) { if (aTurbineItem == null) { @@ -453,8 +459,7 @@ public abstract class GregtechMetaTileEntity_LargerTurbineBase ArrayList<FluidStack> tFluids = getStoredFluids(); if (tFluids.size() > 0) { - if (baseEff == 0 - || optFlow == 0 + if (baseEff == 0 || optFlow == 0 || counter >= 512 || this.getBaseMetaTileEntity().hasWorkJustBeenEnabled() || this.getBaseMetaTileEntity().hasInventoryBeenModified()) { @@ -467,18 +472,19 @@ public abstract class GregtechMetaTileEntity_LargerTurbineBase ItemStack aStack = getFullTurbineAssemblies().get(0).getTurbine(); for (int i = 0; i < getSpeedMultiplier(); i++) { if (i == 0) { - aTotalBaseEff += GT_Utility.safeInt((long) - ((5F + ((GT_MetaGenerated_Tool) aStack.getItem()).getToolCombatDamage(aStack)) + aTotalBaseEff += GT_Utility.safeInt( + (long) ((5F + + ((GT_MetaGenerated_Tool) aStack.getItem()).getToolCombatDamage(aStack)) * 1000F)); // log("Bumped base eff to "+aTotalBaseEff); } - aTotalOptimalFlow += GT_Utility.safeInt((long) Math.max( - Float.MIN_NORMAL, - ((GT_MetaGenerated_Tool) aStack.getItem()) - .getToolStats(aStack) + aTotalOptimalFlow += GT_Utility.safeInt( + (long) Math.max( + Float.MIN_NORMAL, + ((GT_MetaGenerated_Tool) aStack.getItem()).getToolStats(aStack) .getSpeedMultiplier() - * GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mToolSpeed - * 50)); + * GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mToolSpeed + * 50)); if (aTotalOptimalFlow < 0) { log("Int overflow, report to issue tracker"); aTotalOptimalFlow = 100; @@ -522,8 +528,8 @@ public abstract class GregtechMetaTileEntity_LargerTurbineBase int maxChangeAllowed = Math.max(10, GT_Utility.safeInt((long) Math.abs(difference) / 100)); // log("Max Change Allowed: "+maxChangeAllowed); - if (Math.abs(difference) - > maxChangeAllowed) { // If this difference is too big, use the maximum allowed change + if (Math.abs(difference) > maxChangeAllowed) { // If this difference is too big, use the maximum allowed + // change int change = maxChangeAllowed * (difference > 0 ? 1 : -1); // Make the change positive or negative. this.lEUt += change; // Apply the change // log("Applied power change."); @@ -540,7 +546,7 @@ public abstract class GregtechMetaTileEntity_LargerTurbineBase } else { this.mMaxProgresstime = 1; this.mEfficiencyIncrease = 10; - // Overvoltage is handled inside the MultiBlockBase when pushing out to dynamos. no need to do it here. + // Overvoltage is handled inside the MultiBlockBase when pushing out to dynamos. no need to do it here. // Play sounds (GT++ addition - GT multiblocks play no sounds) startProcess(); // log("GOOD RETURN - Making: "+this.mEUt+" EU/t"); @@ -625,34 +631,25 @@ public abstract class GregtechMetaTileEntity_LargerTurbineBase int mPollutionReduction = (int) (100 * mufflerReduction); String tRunning = mMaxProgresstime > 0 - ? EnumChatFormatting.GREEN - + StatCollector.translateToLocal("GT5U.turbine.running.true") + ? EnumChatFormatting.GREEN + StatCollector.translateToLocal("GT5U.turbine.running.true") + EnumChatFormatting.RESET - : EnumChatFormatting.RED - + StatCollector.translateToLocal("GT5U.turbine.running.false") + : EnumChatFormatting.RED + StatCollector.translateToLocal("GT5U.turbine.running.false") + EnumChatFormatting.RESET; String tMaintainance = getIdealStatus() == getRepairStatus() - ? EnumChatFormatting.GREEN - + StatCollector.translateToLocal("GT5U.turbine.maintenance.false") + ? EnumChatFormatting.GREEN + StatCollector.translateToLocal("GT5U.turbine.maintenance.false") + EnumChatFormatting.RESET - : EnumChatFormatting.RED - + StatCollector.translateToLocal("GT5U.turbine.maintenance.true") + : EnumChatFormatting.RED + StatCollector.translateToLocal("GT5U.turbine.maintenance.true") + EnumChatFormatting.RESET; int tDura = 0; StringBuilder aTurbineDamage = new StringBuilder(); for (GT_MetaTileEntity_Hatch_Turbine aHatch : this.getFullTurbineAssemblies()) { ItemStack aTurbine = aHatch.getTurbine(); - tDura = MathUtils.safeInt((long) (100.0f - / GT_MetaGenerated_Tool.getToolMaxDamage(aTurbine) - * (GT_MetaGenerated_Tool.getToolDamage(aTurbine)) - + 1)); - aTurbineDamage - .append(EnumChatFormatting.RED) - .append(tDura) - .append(EnumChatFormatting.RESET) - .append("% | "); + tDura = MathUtils.safeInt( + (long) (100.0f / GT_MetaGenerated_Tool.getToolMaxDamage(aTurbine) + * (GT_MetaGenerated_Tool.getToolDamage(aTurbine)) + 1)); + aTurbineDamage.append(EnumChatFormatting.RED).append(tDura).append(EnumChatFormatting.RESET).append("% | "); } long storedEnergy = 0; @@ -667,31 +664,53 @@ public abstract class GregtechMetaTileEntity_LargerTurbineBase boolean aIsSteam = this.getClass().getName().toLowerCase().contains("steam"); String[] ret = new String[] { - // 8 Lines available for information panels - tRunning + ": " + EnumChatFormatting.RED + ((lEUt * mEfficiency) / 10000) + EnumChatFormatting.RESET - + " EU/t", - tMaintainance, - StatCollector.translateToLocal("GT5U.turbine.efficiency") + ": " + EnumChatFormatting.YELLOW - + (mEfficiency / 100F) + EnumChatFormatting.RESET + "%", - StatCollector.translateToLocal("GT5U.multiblock.energy") + ": " + EnumChatFormatting.GREEN - + storedEnergy + EnumChatFormatting.RESET + " EU / " + EnumChatFormatting.YELLOW - + maxEnergy + EnumChatFormatting.RESET + " EU", - StatCollector.translateToLocal("GT5U.turbine.flow") + ": " + EnumChatFormatting.YELLOW - + MathUtils.safeInt((long) realOptFlow) + EnumChatFormatting.RESET + " L/s" - + EnumChatFormatting.YELLOW + " (" - + (isLooseMode() - ? StatCollector.translateToLocal("GT5U.turbine.loose") - : StatCollector.translateToLocal("GT5U.turbine.tight")) - + ")", - StatCollector.translateToLocal("GT5U.turbine.fuel") + ": " + EnumChatFormatting.GOLD + storedFluid - + EnumChatFormatting.RESET + "L", - StatCollector.translateToLocal("GT5U.turbine.dmg") + ": " + aTurbineDamage, - StatCollector.translateToLocal("GT5U.multiblock.pollution") + ": " + EnumChatFormatting.GREEN - + mPollutionReduction + EnumChatFormatting.RESET + " %" - }; - if (!aIsSteam) - ret[4] = StatCollector.translateToLocal("GT5U.turbine.flow") + ": " + EnumChatFormatting.YELLOW - + MathUtils.safeInt((long) realOptFlow) + EnumChatFormatting.RESET + " L/t"; + // 8 Lines available for information panels + tRunning + ": " + + EnumChatFormatting.RED + + ((lEUt * mEfficiency) / 10000) + + EnumChatFormatting.RESET + + " EU/t", + tMaintainance, + StatCollector.translateToLocal("GT5U.turbine.efficiency") + ": " + + EnumChatFormatting.YELLOW + + (mEfficiency / 100F) + + EnumChatFormatting.RESET + + "%", + StatCollector.translateToLocal("GT5U.multiblock.energy") + ": " + + EnumChatFormatting.GREEN + + storedEnergy + + EnumChatFormatting.RESET + + " EU / " + + EnumChatFormatting.YELLOW + + maxEnergy + + EnumChatFormatting.RESET + + " EU", + StatCollector.translateToLocal("GT5U.turbine.flow") + ": " + + EnumChatFormatting.YELLOW + + MathUtils.safeInt((long) realOptFlow) + + EnumChatFormatting.RESET + + " L/s" + + EnumChatFormatting.YELLOW + + " (" + + (isLooseMode() ? StatCollector.translateToLocal("GT5U.turbine.loose") + : StatCollector.translateToLocal("GT5U.turbine.tight")) + + ")", + StatCollector.translateToLocal("GT5U.turbine.fuel") + ": " + + EnumChatFormatting.GOLD + + storedFluid + + EnumChatFormatting.RESET + + "L", + StatCollector.translateToLocal("GT5U.turbine.dmg") + ": " + aTurbineDamage, + StatCollector.translateToLocal("GT5U.multiblock.pollution") + ": " + + EnumChatFormatting.GREEN + + mPollutionReduction + + EnumChatFormatting.RESET + + " %" }; + if (!aIsSteam) ret[4] = StatCollector.translateToLocal("GT5U.turbine.flow") + ": " + + EnumChatFormatting.YELLOW + + MathUtils.safeInt((long) realOptFlow) + + EnumChatFormatting.RESET + + " L/t"; return ret; } @@ -752,19 +771,11 @@ public abstract class GregtechMetaTileEntity_LargerTurbineBase } @Override - public final ITexture[] getTexture( - IGregTechTileEntity aBaseMetaTileEntity, - byte aSide, - byte aFacing, - byte aColorIndex, - boolean aActive, - boolean aRedstone) { - return new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[1][aColorIndex + 1], - aFacing == aSide - ? getFrontFacingTurbineTexture(aActive) - : Textures.BlockIcons.getCasingTextureForId(getCasingTextureIndex()) - }; + public final ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, + byte aColorIndex, boolean aActive, boolean aRedstone) { + return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[1][aColorIndex + 1], + aFacing == aSide ? getFrontFacingTurbineTexture(aActive) + : Textures.BlockIcons.getCasingTextureForId(getCasingTextureIndex()) }; } protected ITexture getFrontFacingTurbineTexture(boolean isActive) { diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/storage/GregtechMetaTileEntity_MultiTank.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/storage/GregtechMetaTileEntity_MultiTank.java index d7e4a45191..be191fcc59 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/storage/GregtechMetaTileEntity_MultiTank.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/storage/GregtechMetaTileEntity_MultiTank.java @@ -1,584 +1,270 @@ /* -package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.storage; - - -public class GregtechMetaTileEntity_MultiTank -extends GregtechMeta_MultiBlockBase { - public GregtechMetaTileEntity_MultiTank(final int aID, final String aName, final String aNameRegional) { - super(aID, aName, aNameRegional); - } - - private short multiblockCasingCount = 0; - private int mInternalSaveClock = 0; - private final short storageMultiplier = 1; - private int maximumFluidStorage = 128000; - private FluidStack internalStorageTank = null; - private final NBTTagCompound internalCraftingComponentsTag = new NBTTagCompound(); - - @Override - public String getMachineType() { - return "Fluid Tank"; - } - - @Override - public String[] getExtraInfoData() { - final ArrayList<GT_MetaTileEntity_Hatch_Energy> mTier = this.mEnergyHatches; - if (!mTier.isEmpty()){ - final int temp = mTier.get(0).mTier; - if (this.internalStorageTank == null) { - return new String[]{ - GT_Values.VOLTAGE_NAMES[temp]+" Large Fluid Tank", - "Stored Fluid: No Fluid", - "Internal | Current: "+Integer.toString(0) + "L", - "Internal | Maximum: "+Integer.toString(this.maximumFluidStorage) + "L"}; - } - return new String[]{ - GT_Values.VOLTAGE_NAMES[temp]+" Large Fluid Tank", - "Stored Fluid: "+this.internalStorageTank.getLocalizedName(), - "Internal | Current: "+Integer.toString(this.internalStorageTank.amount) + "L", - "Internal | Maximum: "+Integer.toString(this.maximumFluidStorage) + "L"}; - } - return new String[]{ - "Voltage Tier not set -" +" Large Fluid Tank", - "Stored Fluid: No Fluid", - "Internal | Current: "+Integer.toString(0) + "L", - "Internal | Maximum: "+Integer.toString(this.maximumFluidStorage) + "L"}; - } - - @Override - public void saveNBTData(final NBTTagCompound aNBT) { - super.saveNBTData(aNBT); - */ -/*final NBTTagCompound gtCraftingComponentsTag = aNBT.getCompoundTag("GT.CraftingComponents"); -if (gtCraftingComponentsTag != null){ - - Utils.LOG_WARNING("Got Crafting Tag"); - - if (this.internalStorageTank != null){ - Utils.LOG_WARNING("mFluid was not null, Saving TileEntity NBT data."); - - gtCraftingComponentsTag.setString("xFluid", this.internalStorageTank.getFluid().getName()); - gtCraftingComponentsTag.setInteger("xAmount", this.internalStorageTank.amount); - gtCraftingComponentsTag.setLong("xAmountMax", this.maximumFluidStorage); - - aNBT.setTag("GT.CraftingComponents", gtCraftingComponentsTag); - } - else { - Utils.LOG_WARNING("mFluid was null, Saving TileEntity NBT data."); - gtCraftingComponentsTag.removeTag("xFluid"); - gtCraftingComponentsTag.removeTag("xAmount"); - gtCraftingComponentsTag.removeTag("xAmountMax"); - gtCraftingComponentsTag.setLong("xAmountMax", this.maximumFluidStorage); - - - aNBT.setTag("GT.CraftingComponents", gtCraftingComponentsTag); - } -}*//* - - } - - @Override - public void loadNBTData(final NBTTagCompound aNBT) { - super.loadNBTData(aNBT); - */ -/*final NBTTagCompound gtCraftingComponentsTag = aNBT.getCompoundTag("GT.CraftingComponents"); -String xFluid = null; -int xAmount = 0; -if (gtCraftingComponentsTag.hasNoTags()){ - if (this.internalStorageTank != null){ - Utils.LOG_WARNING("mFluid was not null, Creating TileEntity NBT data."); - gtCraftingComponentsTag.setInteger("xAmount", this.internalStorageTank.amount); - gtCraftingComponentsTag.setString("xFluid", this.internalStorageTank.getFluid().getName()); - aNBT.setTag("GT.CraftingComponents", gtCraftingComponentsTag); - } -} -else { - - //internalCraftingComponentsTag = gtCraftingComponentsTag.getCompoundTag("backupTag"); - - if (gtCraftingComponentsTag.hasKey("xFluid")){ - Utils.LOG_WARNING("xFluid was not null, Loading TileEntity NBT data."); - xFluid = gtCraftingComponentsTag.getString("xFluid"); - } - if (gtCraftingComponentsTag.hasKey("xAmount")){ - Utils.LOG_WARNING("xAmount was not null, Loading TileEntity NBT data."); - xAmount = gtCraftingComponentsTag.getInteger("xAmount"); - } - if ((xFluid != null) && (xAmount != 0)){ - Utils.LOG_WARNING("Setting Internal Tank, loading "+xAmount+"L of "+xFluid); - this.setInternalTank(xFluid, xAmount); - } -}*//* - - } - - private boolean setInternalTank(final String fluidName, final int amount){ - final FluidStack temp = FluidUtils.getFluidStack(fluidName, amount); - if (temp != null){ - if (this.internalStorageTank == null){ - this.internalStorageTank = temp; - Logger.WARNING(temp.getFluid().getName()+" Amount: "+temp.amount+"L"); - } - else{ - Logger.WARNING("Retained Fluid."); - Logger.WARNING(this.internalStorageTank.getFluid().getName()+" Amxount: "+this.internalStorageTank.amount+"L"); - } - this.markDirty(); - return true; - } - return false; - } - - @Override - public void onLeftclick(final IGregTechTileEntity aBaseMetaTileEntity, final EntityPlayer aPlayer) { - this.tryForceNBTUpdate(); - super.onLeftclick(aBaseMetaTileEntity, aPlayer); - } - - @Override - public boolean onWrenchRightClick(final byte aSide, final byte aWrenchingSide, final EntityPlayer aPlayer, final float aX, final float aY, final float aZ) { - this.tryForceNBTUpdate(); - return super.onWrenchRightClick(aSide, aWrenchingSide, aPlayer, aX, aY, aZ); - } - - @Override - public void onRemoval() { - this.tryForceNBTUpdate(); - super.onRemoval(); - } - - - @Override - public void onPostTick(final IGregTechTileEntity aBaseMetaTileEntity, final long aTick) { - super.onPostTick(aBaseMetaTileEntity, aTick); - - if ((this.internalStorageTank != null) && this.internalStorageTank.amount >= this.maximumFluidStorage){ - if (this.internalStorageTank.amount > this.maximumFluidStorage){ - this.internalStorageTank.amount = this.maximumFluidStorage; - } - this.stopMachine(); - } - - if (this.mInternalSaveClock != 20){ - this.mInternalSaveClock++; - } - else { - this.mInternalSaveClock = 0; - this.tryForceNBTUpdate(); - } - - } - - public GregtechMetaTileEntity_MultiTank(final String aName) { - super(aName); - } - - @Override - public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) { - return new GregtechMetaTileEntity_MultiTank(this.mName); - } - - @Override - public String[] getTooltip() { - return new String[]{ - "Controller Block for the Multitank", - "Size: 3xHx3 (Block behind controller must be air)", - "Structure must be at least 4 blocks tall, maximum 20.", - "Each casing within the structure adds 128000L storage.", - "Multitank Exterior Casings (16 at least!)", - "Controller (front centered)", - "1x Input hatch", - "1x Output hatch", - "1x Energy Hatch", - }; - } - - @Override - public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing, final byte aColorIndex, final boolean aActive, final boolean aRedstone) { - if (aSide == aFacing) { - return new ITexture[]{Textures.BlockIcons.getCasingTextureForId(TAE.GTPP_INDEX(11)), new GT_RenderedTexture(aActive ? TexturesGtBlock.Overlay_Machine_Screen_Logo : TexturesGtBlock.Overlay_Machine_Screen_Logo)}; - } - return new ITexture[]{Textures.BlockIcons.getCasingTextureForId(TAE.GTPP_INDEX(11))}; - } - - @Override - public GT_Recipe.GT_Recipe_Map getRecipeMap() { - return null; - } - - @Override - public boolean isFacingValid(final byte aFacing) { - return aFacing > 1; - } - - @Override - public boolean checkRecipe(final ItemStack aStack) { - - final ArrayList<ItemStack> tInputList = this.getStoredInputs(); - for (int i = 0; i < (tInputList.size() - 1); i++) { - for (int j = i + 1; j < tInputList.size(); j++) { - if (GT_Utility.areStacksEqual(tInputList.get(i), tInputList.get(j))) { - if (tInputList.get(i).stackSize >= tInputList.get(j).stackSize) { - tInputList.remove(j--); - } else { - tInputList.remove(i--); - break; - } - } - } - } - final ItemStack[] tInputs = Arrays.copyOfRange(tInputList.toArray(new ItemStack[tInputList.size()]), 0, 2); - - final ArrayList<FluidStack> tFluidList = this.getStoredFluids(); - for (int i = 0; i < (tFluidList.size() - 1); i++) { - for (int j = i + 1; j < tFluidList.size(); j++) { - if (GT_Utility.areFluidsEqual(tFluidList.get(i), tFluidList.get(j))) { - if (tFluidList.get(i).amount >= tFluidList.get(j).amount) { - tFluidList.remove(j--); - } else { - tFluidList.remove(i--); - break; - } - } - } - } - final FluidStack[] tFluids = Arrays.copyOfRange(tFluidList.toArray(new FluidStack[1]), 0, 1); - - if (tFluids.length >= 2){ - Logger.WARNING("Bad"); - return false; - } - - final ArrayList<Pair<GT_MetaTileEntity_Hatch_Input, Boolean>> rList = new ArrayList<>(); - int slotInputCount = 0; - for (final GT_MetaTileEntity_Hatch_Input tHatch : this.mInputHatches) { - boolean containsFluid = false; - if (isValidMetaTileEntity(tHatch)) { - slotInputCount++; - for (int i=0; i<tHatch.getBaseMetaTileEntity().getSizeInventory(); i++) { - if (tHatch.canTankBeEmptied()){containsFluid=true;} - } - rList.add(new Pair<>(tHatch, containsFluid)); - } - } - if ((tFluids.length <= 0) || (slotInputCount > 1)){ - Logger.WARNING("Bad"); - return false; - } - - Logger.WARNING("Okay - 2"); - if (this.internalStorageTank == null){ - Logger.WARNING("Okay - 3"); - if ((rList.get(0).getKey().mFluid != null) && (rList.get(0).getKey().mFluid.amount > 0)){ - Logger.WARNING("Okay - 4"); - Logger.WARNING("Okay - 1"+" rList.get(0).getKey().mFluid.amount: "+rList.get(0).getKey().mFluid.amount */ -/*+" internalStorageTank:"+internalStorageTank.amount*//* - ); - final FluidStack tempFluidStack = rList.get(0).getKey().mFluid; - final Fluid tempFluid = tempFluidStack.getFluid(); - this.internalStorageTank = FluidUtils.getFluidStack(tempFluid.getName(), tempFluidStack.amount); - rList.get(0).getKey().mFluid.amount = 0; - Logger.WARNING("Okay - 1.1"+" rList.get(0).getKey().mFluid.amount: "+rList.get(0).getKey().mFluid.amount +" internalStorageTank:"+this.internalStorageTank.amount); - return true; - } - Logger.WARNING("No Fluid in hatch."); - return false; - } - else if (this.internalStorageTank.isFluidEqual(rList.get(0).getKey().mFluid)){ - Logger.WARNING("Storing "+rList.get(0).getKey().mFluid.amount+"L"); - Logger.WARNING("Contains "+this.internalStorageTank.amount+"L"); - - - int tempAdd = 0; - tempAdd = rList.get(0).getKey().getFluidAmount(); - rList.get(0).getKey().mFluid = null; - Logger.WARNING("adding "+tempAdd); - this.internalStorageTank.amount = this.internalStorageTank.amount + tempAdd; - Logger.WARNING("Tank now Contains "+this.internalStorageTank.amount+"L of "+this.internalStorageTank.getFluid().getName()+"."); - - - //Utils.LOG_WARNING("Tank"); - return true; - } - else { - final FluidStack superTempFluidStack = rList.get(0).getKey().mFluid; - Logger.WARNING("is input fluid equal to stored fluid? "+(this.internalStorageTank.isFluidEqual(superTempFluidStack))); - if (superTempFluidStack != null) { - Logger.WARNING("Input hatch[0] Contains "+superTempFluidStack.amount+"L of "+superTempFluidStack.getFluid().getName()+"."); - } - Logger.WARNING("Large Multi-Tank Contains "+this.internalStorageTank.amount+"L of "+this.internalStorageTank.getFluid().getName()+"."); - - if (this.internalStorageTank.amount <= 0){ - Logger.WARNING("Internal Tank is empty, sitting idle."); - return false; - } - - if ((this.mOutputHatches.get(0).mFluid == null) || this.mOutputHatches.isEmpty() || (this.mOutputHatches.get(0).mFluid.isFluidEqual(this.internalStorageTank) && (this.mOutputHatches.get(0).mFluid.amount < this.mOutputHatches.get(0).getCapacity()))){ - Logger.WARNING("Okay - 3"); - final int tempCurrentStored = this.internalStorageTank.amount; - int tempResult = 0; - final int tempHatchSize = this.mOutputHatches.get(0).getCapacity(); - final int tempHatchCurrentHolding = this.mOutputHatches.get(0).getFluidAmount(); - final int tempHatchRemainingSpace = tempHatchSize - tempHatchCurrentHolding; - final FluidStack tempOutputFluid = this.internalStorageTank; - if (tempHatchRemainingSpace <= 0){ - return false; - } - Logger.WARNING("Okay - 3.1.x"+" hatchCapacity: "+tempHatchSize +" tempCurrentStored: "+tempCurrentStored+" output hatch holds: "+tempHatchCurrentHolding+" tank has "+tempHatchRemainingSpace+"L of space left."); - - if (tempHatchSize >= tempHatchRemainingSpace){ - Logger.WARNING("Okay - 3.1.1"+" hatchCapacity: "+tempHatchSize +" tempCurrentStored: "+tempCurrentStored+" output hatch holds: "+tempHatchCurrentHolding+" tank has "+tempHatchRemainingSpace+"L of space left."); - - int adder; - if ((tempCurrentStored > 0) && (tempCurrentStored <= tempHatchSize)){ - adder = tempCurrentStored; - if (adder >= tempHatchRemainingSpace){ - adder = tempHatchRemainingSpace; - } - } - else { - adder = 0; - if (tempCurrentStored >= tempHatchRemainingSpace){ - adder = tempHatchRemainingSpace; - } - } - - tempResult = adder; - tempOutputFluid.amount = tempResult; - Logger.WARNING("Okay - 3.1.2"+" result: "+tempResult +" tempCurrentStored: "+tempCurrentStored + " filling output hatch with: "+tempOutputFluid.amount+"L of "+tempOutputFluid.getFluid().getName()); - this.mOutputHatches.get(0).fill(tempOutputFluid, true); - //mOutputHatches.get(0).mFluid.amount = tempResult; - this.internalStorageTank.amount = (tempCurrentStored-adder); - Logger.WARNING("Okay - 3.1.3"+" internalTankStorage: "+this.internalStorageTank.amount +"L | output hatch contains: "+this.mOutputHatches.get(0).mFluid.amount+"L of "+this.mOutputHatches.get(0).mFluid.getFluid().getName()); - */ -/*if (internalStorageTank.amount <= 0) -internalStorageTank = null;*//* - - } - Logger.WARNING("Tank ok."); - return true; - } - } - //this.getBaseMetaTileEntity().(tFluids[0].amount, true); - Logger.WARNING("Tank"); - return false; - } - - @Override - public int getMaxParallelRecipes() { - return 1; - } - - @Override - public int getEuDiscountForParallelism() { - return 0; - } - - @Override - public boolean checkMultiblock(final IGregTechTileEntity aBaseMetaTileEntity, final ItemStack aStack) { - final int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX; - final int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ; - if (!aBaseMetaTileEntity.getAirOffset(xDir, 0, zDir)) { - Logger.WARNING("Must be hollow."); - return false; - } - int tAmount = 0; - for (int i = -1; i < 2; i++) { - for (int j = -1; j < 2; j++) { - for (int h = -1; h < 19; h++) { - if ((h != 0) || ((((xDir + i) != 0) || ((zDir + j) != 0)) && ((i != 0) || (j != 0)))) { - final IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, h, zDir + j); - if ((!this.addMaintenanceToMachineList(tTileEntity, TAE.GTPP_INDEX(11))) && (!this.addInputToMachineList(tTileEntity, TAE.GTPP_INDEX(11))) && (!this.addOutputToMachineList(tTileEntity, TAE.GTPP_INDEX(11))) && (!this.addEnergyInputToMachineList(tTileEntity, TAE.GTPP_INDEX(11)))) { - if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j) != ModBlocks.blockCasingsMisc) { - if (h < 3){ - Logger.WARNING("Casing Expected."); - return false; - } - else if (h >= 3){ - //Utils.LOG_WARNING("Your Multitank can be 20 blocks tall."); - } - } - if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j) != 11) { - if (h < 3){ - Logger.WARNING("Wrong Meta."); - return false; - } - else if (h >= 3){ - //Utils.LOG_WARNING("Your Multitank can be 20 blocks tall."); - } - } - if (h < 3){ - tAmount++; - } - else if (h >= 3){ - if ((aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j) == Blocks.air) || aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j).getUnlocalizedName().contains("residual")){ - Logger.WARNING("Found air"); - } - else { - Logger.WARNING("Layer "+(h+2)+" is complete. Adding "+(64000*9)+"L storage to the tank."); - tAmount++; - } - } - } - } - } - } - } - this.multiblockCasingCount = (short) tAmount; - this.maximumFluidStorage = getMaximumTankStorage(tAmount); - Logger.INFO("Your Multitank can be 20 blocks tall."); - Logger.INFO("Casings Count: "+this.multiblockCasingCount+" Valid Multiblock: "+(tAmount >= 16)+" Tank Storage Capacity:"+this.maximumFluidStorage+"L"); - this.tryForceNBTUpdate(); - return tAmount >= 16; - } - - */ -/*public int countCasings() { - Utils.LOG_INFO("Counting Machine Casings"); - try{ - if (this.getBaseMetaTileEntity().getWorld() == null){ - Utils.LOG_INFO("Tile Entity's world was null for casing count."); - return 0; - } - if (this.getBaseMetaTileEntity() == null){ - Utils.LOG_INFO("Tile Entity was null for casing count."); - return 0; - } - } catch(NullPointerException r){ - Utils.LOG_INFO("Null Pointer Exception caught."); - return 0; - } - int xDir = ForgeDirection.getOrientation(this.getBaseMetaTileEntity().getBackFacing()).offsetX; - int zDir = ForgeDirection.getOrientation(this.getBaseMetaTileEntity().getBackFacing()).offsetZ; - if (!this.getBaseMetaTileEntity().getAirOffset(xDir, 0, zDir)) { - Utils.LOG_INFO("Failed due to air being misplaced."); - Utils.LOG_WARNING("Must be hollow."); - return 0; - } - int tAmount = 0; - Utils.LOG_INFO("Casing Count set to 0."); - for (int i = -1; i < 2; i++) { - for (int j = -1; j < 2; j++) { - for (int h = -1; h < 19; h++) { - if ((h != 0) || (((xDir + i != 0) || (zDir + j != 0)) && ((i != 0) || (j != 0)))) { - IGregTechTileEntity tTileEntity = this.getBaseMetaTileEntity().getIGregTechTileEntityOffset(xDir + i, h, zDir + j); - if ((!addMaintenanceToMachineList(tTileEntity, TAE.GTPP_INDEX(11))) && (!addInputToMachineList(tTileEntity, TAE.GTPP_INDEX(11))) && (!addOutputToMachineList(tTileEntity, TAE.GTPP_INDEX(11))) && (!addEnergyInputToMachineList(tTileEntity, TAE.GTPP_INDEX(11)))) { - if (this.getBaseMetaTileEntity().getBlockOffset(xDir + i, h, zDir + j) != ModBlocks.blockCasingsMisc) { - if (h < 3){ - Utils.LOG_WARNING("Casing Expected."); - return 0; - } - else if (h >= 3){ - //Utils.LOG_WARNING("Your Multitank can be 20 blocks tall."); - } - } - if (this.getBaseMetaTileEntity().getMetaIDOffset(xDir + i, h, zDir + j) != 11) { - if (h < 3){ - Utils.LOG_WARNING("Wrong Meta."); - return 0; - } - else if (h >= 3){ - //Utils.LOG_WARNING("Your Multitank can be 20 blocks tall."); - } - } - if (h < 3){ - tAmount++; - } - else if (h >= 3){ - if (this.getBaseMetaTileEntity().getBlockOffset(xDir + i, h, zDir + j) == Blocks.air || this.getBaseMetaTileEntity().getBlockOffset(xDir + i, h, zDir + j).getUnlocalizedName().contains("residual")){ - Utils.LOG_WARNING("Found air"); - } - else { - Utils.LOG_WARNING("Layer "+(h+2)+" is complete. Adding "+(64000*9)+"L storage to the tank."); - tAmount++; - } - } - } - } - } - } - } - Utils.LOG_INFO("Finished counting."); - multiblockCasingCount = (short) tAmount; - //Utils.LOG_INFO("Your Multitank can be 20 blocks tall."); - Utils.LOG_INFO("Casings Count: "+tAmount+" Valid Multiblock: "+(tAmount >= 16)+" Tank Storage Capacity:"+getMaximumTankStorage(tAmount)+"L"); - return tAmount; -}*//* - - - @Override - public int getMaxEfficiency(final ItemStack aStack) { - return 10000; - } - - @Override - public int getPollutionPerTick(final ItemStack aStack) { - return 5; - } - - @Override - public int getAmountOfOutputs() { - return 1; - } - - @Override - public boolean explodesOnComponentBreak(final ItemStack aStack) { - return false; - } - - private static short getStorageMultiplier(final int casingCount){ - final int tsm = 1*casingCount; - if (tsm <= 0){ - return 1; - } - return (short) tsm; - } - - private static int getMaximumTankStorage(final int casingCount){ - final int multiplier = getStorageMultiplier(casingCount); - final int tempTankStorageMax = 128000*multiplier; - if (tempTankStorageMax <= 0){return 128000;} - return tempTankStorageMax; - } - - private boolean tryForceNBTUpdate(){ - */ + * package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.storage; public class + * GregtechMetaTileEntity_MultiTank extends GregtechMeta_MultiBlockBase { public GregtechMetaTileEntity_MultiTank(final + * int aID, final String aName, final String aNameRegional) { super(aID, aName, aNameRegional); } private short + * multiblockCasingCount = 0; private int mInternalSaveClock = 0; private final short storageMultiplier = 1; private int + * maximumFluidStorage = 128000; private FluidStack internalStorageTank = null; private final NBTTagCompound + * internalCraftingComponentsTag = new NBTTagCompound(); + * @Override public String getMachineType() { return "Fluid Tank"; } + * @Override public String[] getExtraInfoData() { final ArrayList<GT_MetaTileEntity_Hatch_Energy> mTier = + * this.mEnergyHatches; if (!mTier.isEmpty()){ final int temp = mTier.get(0).mTier; if (this.internalStorageTank == + * null) { return new String[]{ GT_Values.VOLTAGE_NAMES[temp]+" Large Fluid Tank", "Stored Fluid: No Fluid", + * "Internal | Current: "+Integer.toString(0) + "L", "Internal | Maximum: "+Integer.toString(this.maximumFluidStorage) + + * "L"}; } return new String[]{ GT_Values.VOLTAGE_NAMES[temp]+" Large Fluid Tank", + * "Stored Fluid: "+this.internalStorageTank.getLocalizedName(), + * "Internal | Current: "+Integer.toString(this.internalStorageTank.amount) + "L", + * "Internal | Maximum: "+Integer.toString(this.maximumFluidStorage) + "L"}; } return new String[]{ + * "Voltage Tier not set -" +" Large Fluid Tank", "Stored Fluid: No Fluid", "Internal | Current: "+Integer.toString(0) + + * "L", "Internal | Maximum: "+Integer.toString(this.maximumFluidStorage) + "L"}; } + * @Override public void saveNBTData(final NBTTagCompound aNBT) { super.saveNBTData(aNBT); + */ /* -//Block is invalid. -if ((this == null) || (this.getBaseMetaTileEntity() == null)){ - Utils.LOG_WARNING("Block was not valid for saving data."); - return false; -} - -//Don't need this to run clientside. -if (!this.getBaseMetaTileEntity().isServerSide()) { - return false; -} - -//Internal Tag was not valid. -try{ - if (this.internalCraftingComponentsTag == null){ - Utils.LOG_WARNING("Internal NBT data tag was null."); - return false; - } -} catch (final NullPointerException x){ - Utils.LOG_WARNING("Caught null NBT."); -} - -//Internal tag was valid. -this.saveNBTData(this.internalCraftingComponentsTag); - - -//Mark block for update -int x,y,z = 0; -x = this.getBaseMetaTileEntity().getXCoord(); -y = this.getBaseMetaTileEntity().getYCoord(); -z = this.getBaseMetaTileEntity().getZCoord(); -this.getBaseMetaTileEntity().getWorld().markBlockForUpdate(x, y, z); - -//Mark block dirty, let chunk know it's data has changed and it must be saved to disk. (Albeit slowly) -this.getBaseMetaTileEntity().markDirty();*//* - - return true; - } - }*/ + * final NBTTagCompound gtCraftingComponentsTag = aNBT.getCompoundTag("GT.CraftingComponents"); if + * (gtCraftingComponentsTag != null){ Utils.LOG_WARNING("Got Crafting Tag"); if (this.internalStorageTank != null){ + * Utils.LOG_WARNING("mFluid was not null, Saving TileEntity NBT data."); gtCraftingComponentsTag.setString("xFluid", + * this.internalStorageTank.getFluid().getName()); gtCraftingComponentsTag.setInteger("xAmount", + * this.internalStorageTank.amount); gtCraftingComponentsTag.setLong("xAmountMax", this.maximumFluidStorage); + * aNBT.setTag("GT.CraftingComponents", gtCraftingComponentsTag); } else { + * Utils.LOG_WARNING("mFluid was null, Saving TileEntity NBT data."); gtCraftingComponentsTag.removeTag("xFluid"); + * gtCraftingComponentsTag.removeTag("xAmount"); gtCraftingComponentsTag.removeTag("xAmountMax"); + * gtCraftingComponentsTag.setLong("xAmountMax", this.maximumFluidStorage); aNBT.setTag("GT.CraftingComponents", + * gtCraftingComponentsTag); } } + *//* + * } + * @Override public void loadNBTData(final NBTTagCompound aNBT) { super.loadNBTData(aNBT); + */ +/* + * final NBTTagCompound gtCraftingComponentsTag = aNBT.getCompoundTag("GT.CraftingComponents"); String xFluid = null; + * int xAmount = 0; if (gtCraftingComponentsTag.hasNoTags()){ if (this.internalStorageTank != null){ + * Utils.LOG_WARNING("mFluid was not null, Creating TileEntity NBT data."); + * gtCraftingComponentsTag.setInteger("xAmount", this.internalStorageTank.amount); + * gtCraftingComponentsTag.setString("xFluid", this.internalStorageTank.getFluid().getName()); + * aNBT.setTag("GT.CraftingComponents", gtCraftingComponentsTag); } } else { //internalCraftingComponentsTag = + * gtCraftingComponentsTag.getCompoundTag("backupTag"); if (gtCraftingComponentsTag.hasKey("xFluid")){ + * Utils.LOG_WARNING("xFluid was not null, Loading TileEntity NBT data."); xFluid = + * gtCraftingComponentsTag.getString("xFluid"); } if (gtCraftingComponentsTag.hasKey("xAmount")){ + * Utils.LOG_WARNING("xAmount was not null, Loading TileEntity NBT data."); xAmount = + * gtCraftingComponentsTag.getInteger("xAmount"); } if ((xFluid != null) && (xAmount != 0)){ + * Utils.LOG_WARNING("Setting Internal Tank, loading "+xAmount+"L of "+xFluid); this.setInternalTank(xFluid, xAmount); } + * } + *//* + * } private boolean setInternalTank(final String fluidName, final int amount){ final FluidStack temp = + * FluidUtils.getFluidStack(fluidName, amount); if (temp != null){ if (this.internalStorageTank == null){ + * this.internalStorageTank = temp; Logger.WARNING(temp.getFluid().getName()+" Amount: "+temp.amount+"L"); } else{ + * Logger.WARNING("Retained Fluid."); + * Logger.WARNING(this.internalStorageTank.getFluid().getName()+" Amxount: "+this.internalStorageTank.amount+"L"); } + * this.markDirty(); return true; } return false; } + * @Override public void onLeftclick(final IGregTechTileEntity aBaseMetaTileEntity, final EntityPlayer aPlayer) { + * this.tryForceNBTUpdate(); super.onLeftclick(aBaseMetaTileEntity, aPlayer); } + * @Override public boolean onWrenchRightClick(final byte aSide, final byte aWrenchingSide, final EntityPlayer + * aPlayer, final float aX, final float aY, final float aZ) { this.tryForceNBTUpdate(); return + * super.onWrenchRightClick(aSide, aWrenchingSide, aPlayer, aX, aY, aZ); } + * @Override public void onRemoval() { this.tryForceNBTUpdate(); super.onRemoval(); } + * @Override public void onPostTick(final IGregTechTileEntity aBaseMetaTileEntity, final long aTick) { + * super.onPostTick(aBaseMetaTileEntity, aTick); if ((this.internalStorageTank != null) && + * this.internalStorageTank.amount >= this.maximumFluidStorage){ if (this.internalStorageTank.amount > + * this.maximumFluidStorage){ this.internalStorageTank.amount = this.maximumFluidStorage; } this.stopMachine(); } if + * (this.mInternalSaveClock != 20){ this.mInternalSaveClock++; } else { this.mInternalSaveClock = 0; + * this.tryForceNBTUpdate(); } } public GregtechMetaTileEntity_MultiTank(final String aName) { super(aName); } + * @Override public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) { return new + * GregtechMetaTileEntity_MultiTank(this.mName); } + * @Override public String[] getTooltip() { return new String[]{ "Controller Block for the Multitank", + * "Size: 3xHx3 (Block behind controller must be air)", "Structure must be at least 4 blocks tall, maximum 20.", + * "Each casing within the structure adds 128000L storage.", "Multitank Exterior Casings (16 at least!)", + * "Controller (front centered)", "1x Input hatch", "1x Output hatch", "1x Energy Hatch", }; } + * @Override public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte + * aFacing, final byte aColorIndex, final boolean aActive, final boolean aRedstone) { if (aSide == aFacing) { return + * new ITexture[]{Textures.BlockIcons.getCasingTextureForId(TAE.GTPP_INDEX(11)), new GT_RenderedTexture(aActive ? + * TexturesGtBlock.Overlay_Machine_Screen_Logo : TexturesGtBlock.Overlay_Machine_Screen_Logo)}; } return new + * ITexture[]{Textures.BlockIcons.getCasingTextureForId(TAE.GTPP_INDEX(11))}; } + * @Override public GT_Recipe.GT_Recipe_Map getRecipeMap() { return null; } + * @Override public boolean isFacingValid(final byte aFacing) { return aFacing > 1; } + * @Override public boolean checkRecipe(final ItemStack aStack) { final ArrayList<ItemStack> tInputList = + * this.getStoredInputs(); for (int i = 0; i < (tInputList.size() - 1); i++) { for (int j = i + 1; j < + * tInputList.size(); j++) { if (GT_Utility.areStacksEqual(tInputList.get(i), tInputList.get(j))) { if + * (tInputList.get(i).stackSize >= tInputList.get(j).stackSize) { tInputList.remove(j--); } else { + * tInputList.remove(i--); break; } } } } final ItemStack[] tInputs = Arrays.copyOfRange(tInputList.toArray(new + * ItemStack[tInputList.size()]), 0, 2); final ArrayList<FluidStack> tFluidList = this.getStoredFluids(); for (int i + * = 0; i < (tFluidList.size() - 1); i++) { for (int j = i + 1; j < tFluidList.size(); j++) { if + * (GT_Utility.areFluidsEqual(tFluidList.get(i), tFluidList.get(j))) { if (tFluidList.get(i).amount >= + * tFluidList.get(j).amount) { tFluidList.remove(j--); } else { tFluidList.remove(i--); break; } } } } final + * FluidStack[] tFluids = Arrays.copyOfRange(tFluidList.toArray(new FluidStack[1]), 0, 1); if (tFluids.length >= 2){ + * Logger.WARNING("Bad"); return false; } final ArrayList<Pair<GT_MetaTileEntity_Hatch_Input, Boolean>> rList = new + * ArrayList<>(); int slotInputCount = 0; for (final GT_MetaTileEntity_Hatch_Input tHatch : this.mInputHatches) { + * boolean containsFluid = false; if (isValidMetaTileEntity(tHatch)) { slotInputCount++; for (int i=0; + * i<tHatch.getBaseMetaTileEntity().getSizeInventory(); i++) { if (tHatch.canTankBeEmptied()){containsFluid=true;} } + * rList.add(new Pair<>(tHatch, containsFluid)); } } if ((tFluids.length <= 0) || (slotInputCount > 1)){ + * Logger.WARNING("Bad"); return false; } Logger.WARNING("Okay - 2"); if (this.internalStorageTank == null){ + * Logger.WARNING("Okay - 3"); if ((rList.get(0).getKey().mFluid != null) && (rList.get(0).getKey().mFluid.amount > + * 0)){ Logger.WARNING("Okay - 4"); + * Logger.WARNING("Okay - 1"+" rList.get(0).getKey().mFluid.amount: "+rList.get(0).getKey().mFluid.amount + */ +/* +" internalStorageTank:"+internalStorageTank.amount *//* + * ); final FluidStack tempFluidStack = + * rList.get(0).getKey().mFluid; final Fluid tempFluid = + * tempFluidStack.getFluid(); this.internalStorageTank = + * FluidUtils.getFluidStack(tempFluid.getName(), + * tempFluidStack.amount); rList.get(0).getKey().mFluid.amount + * = 0; Logger.WARNING("Okay - 1.1" + * +" rList.get(0).getKey().mFluid.amount: "+rList.get(0). + * getKey().mFluid.amount + * +" internalStorageTank:"+this.internalStorageTank.amount); + * return true; } Logger.WARNING("No Fluid in hatch."); return + * false; } else if + * (this.internalStorageTank.isFluidEqual(rList.get(0).getKey() + * .mFluid)){ + * Logger.WARNING("Storing "+rList.get(0).getKey().mFluid. + * amount+"L"); + * Logger.WARNING("Contains "+this.internalStorageTank.amount+ + * "L"); int tempAdd = 0; tempAdd = + * rList.get(0).getKey().getFluidAmount(); + * rList.get(0).getKey().mFluid = null; + * Logger.WARNING("adding "+tempAdd); + * this.internalStorageTank.amount = + * this.internalStorageTank.amount + tempAdd; + * Logger.WARNING("Tank now Contains "+this.internalStorageTank + * .amount+"L of "+this.internalStorageTank.getFluid().getName( + * )+"."); //Utils.LOG_WARNING("Tank"); return true; } else { + * final FluidStack superTempFluidStack = + * rList.get(0).getKey().mFluid; + * Logger.WARNING("is input fluid equal to stored fluid? "+( + * this.internalStorageTank.isFluidEqual(superTempFluidStack))) + * ; if (superTempFluidStack != null) { + * Logger.WARNING("Input hatch[0] Contains " + * +superTempFluidStack.amount+"L of "+superTempFluidStack. + * getFluid().getName()+"."); } + * Logger.WARNING("Large Multi-Tank Contains "+this. + * internalStorageTank.amount+"L of "+this.internalStorageTank. + * getFluid().getName()+"."); if + * (this.internalStorageTank.amount <= 0){ + * Logger.WARNING("Internal Tank is empty, sitting idle."); + * return false; } if ((this.mOutputHatches.get(0).mFluid == + * null) || this.mOutputHatches.isEmpty() || + * (this.mOutputHatches.get(0).mFluid.isFluidEqual(this. + * internalStorageTank) && + * (this.mOutputHatches.get(0).mFluid.amount < + * this.mOutputHatches.get(0).getCapacity()))){ + * Logger.WARNING("Okay - 3"); final int tempCurrentStored = + * this.internalStorageTank.amount; int tempResult = 0; final + * int tempHatchSize = + * this.mOutputHatches.get(0).getCapacity(); final int + * tempHatchCurrentHolding = + * this.mOutputHatches.get(0).getFluidAmount(); final int + * tempHatchRemainingSpace = tempHatchSize - + * tempHatchCurrentHolding; final FluidStack tempOutputFluid = + * this.internalStorageTank; if (tempHatchRemainingSpace <= 0){ + * return false; } + * Logger.WARNING("Okay - 3.1.x"+" hatchCapacity: " + * +tempHatchSize +" tempCurrentStored: " + * +tempCurrentStored+" output hatch holds: " + * +tempHatchCurrentHolding+" tank has " + * +tempHatchRemainingSpace+"L of space left."); if + * (tempHatchSize >= tempHatchRemainingSpace){ + * Logger.WARNING("Okay - 3.1.1"+" hatchCapacity: " + * +tempHatchSize +" tempCurrentStored: " + * +tempCurrentStored+" output hatch holds: " + * +tempHatchCurrentHolding+" tank has " + * +tempHatchRemainingSpace+"L of space left."); int adder; if + * ((tempCurrentStored > 0) && (tempCurrentStored <= + * tempHatchSize)){ adder = tempCurrentStored; if (adder >= + * tempHatchRemainingSpace){ adder = tempHatchRemainingSpace; } + * } else { adder = 0; if (tempCurrentStored >= + * tempHatchRemainingSpace){ adder = tempHatchRemainingSpace; } + * } tempResult = adder; tempOutputFluid.amount = tempResult; + * Logger.WARNING("Okay - 3.1.2"+" result: "+tempResult + * +" tempCurrentStored: "+tempCurrentStored + + * " filling output hatch with: "+tempOutputFluid. + * amount+"L of "+tempOutputFluid.getFluid().getName()); + * this.mOutputHatches.get(0).fill(tempOutputFluid, true); + * //mOutputHatches.get(0).mFluid.amount = tempResult; + * this.internalStorageTank.amount = (tempCurrentStored-adder); + * Logger.WARNING("Okay - 3.1.3"+" internalTankStorage: "+this. + * internalStorageTank.amount + * +"L | output hatch contains: "+this.mOutputHatches.get(0). + * mFluid.amount+"L of "+this.mOutputHatches.get(0).mFluid. + * getFluid().getName()); + */ +/* + * if (internalStorageTank.amount <= 0) internalStorageTank = null; + *//* + * } Logger.WARNING("Tank ok."); return true; } } //this.getBaseMetaTileEntity().(tFluids[0].amount, true); + * Logger.WARNING("Tank"); return false; } + * @Override public int getMaxParallelRecipes() { return 1; } + * @Override public int getEuDiscountForParallelism() { return 0; } + * @Override public boolean checkMultiblock(final IGregTechTileEntity aBaseMetaTileEntity, final ItemStack aStack) { + * final int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX; final int zDir = + * ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ; if + * (!aBaseMetaTileEntity.getAirOffset(xDir, 0, zDir)) { Logger.WARNING("Must be hollow."); return false; } int + * tAmount = 0; for (int i = -1; i < 2; i++) { for (int j = -1; j < 2; j++) { for (int h = -1; h < 19; h++) { if ((h + * != 0) || ((((xDir + i) != 0) || ((zDir + j) != 0)) && ((i != 0) || (j != 0)))) { final IGregTechTileEntity + * tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, h, zDir + j); if + * ((!this.addMaintenanceToMachineList(tTileEntity, TAE.GTPP_INDEX(11))) && (!this.addInputToMachineList(tTileEntity, + * TAE.GTPP_INDEX(11))) && (!this.addOutputToMachineList(tTileEntity, TAE.GTPP_INDEX(11))) && + * (!this.addEnergyInputToMachineList(tTileEntity, TAE.GTPP_INDEX(11)))) { if + * (aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j) != ModBlocks.blockCasingsMisc) { if (h < 3){ + * Logger.WARNING("Casing Expected."); return false; } else if (h >= 3){ + * //Utils.LOG_WARNING("Your Multitank can be 20 blocks tall."); } } if (aBaseMetaTileEntity.getMetaIDOffset(xDir + + * i, h, zDir + j) != 11) { if (h < 3){ Logger.WARNING("Wrong Meta."); return false; } else if (h >= 3){ + * //Utils.LOG_WARNING("Your Multitank can be 20 blocks tall."); } } if (h < 3){ tAmount++; } else if (h >= 3){ if + * ((aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j) == Blocks.air) || + * aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j).getUnlocalizedName().contains("residual")){ + * Logger.WARNING("Found air"); } else { + * Logger.WARNING("Layer "+(h+2)+" is complete. Adding "+(64000*9)+"L storage to the tank."); tAmount++; } } } } } } + * } this.multiblockCasingCount = (short) tAmount; this.maximumFluidStorage = getMaximumTankStorage(tAmount); + * Logger.INFO("Your Multitank can be 20 blocks tall."); + * Logger.INFO("Casings Count: "+this.multiblockCasingCount+" Valid Multiblock: "+(tAmount >= + * 16)+" Tank Storage Capacity:"+this.maximumFluidStorage+"L"); this.tryForceNBTUpdate(); return tAmount >= 16; } + */ +/* + * public int countCasings() { Utils.LOG_INFO("Counting Machine Casings"); try{ if + * (this.getBaseMetaTileEntity().getWorld() == null){ Utils.LOG_INFO("Tile Entity's world was null for casing count."); + * return 0; } if (this.getBaseMetaTileEntity() == null){ Utils.LOG_INFO("Tile Entity was null for casing count."); + * return 0; } } catch(NullPointerException r){ Utils.LOG_INFO("Null Pointer Exception caught."); return 0; } int xDir = + * ForgeDirection.getOrientation(this.getBaseMetaTileEntity().getBackFacing()).offsetX; int zDir = + * ForgeDirection.getOrientation(this.getBaseMetaTileEntity().getBackFacing()).offsetZ; if + * (!this.getBaseMetaTileEntity().getAirOffset(xDir, 0, zDir)) { Utils.LOG_INFO("Failed due to air being misplaced."); + * Utils.LOG_WARNING("Must be hollow."); return 0; } int tAmount = 0; Utils.LOG_INFO("Casing Count set to 0."); for (int + * i = -1; i < 2; i++) { for (int j = -1; j < 2; j++) { for (int h = -1; h < 19; h++) { if ((h != 0) || (((xDir + i != + * 0) || (zDir + j != 0)) && ((i != 0) || (j != 0)))) { IGregTechTileEntity tTileEntity = + * this.getBaseMetaTileEntity().getIGregTechTileEntityOffset(xDir + i, h, zDir + j); if + * ((!addMaintenanceToMachineList(tTileEntity, TAE.GTPP_INDEX(11))) && (!addInputToMachineList(tTileEntity, + * TAE.GTPP_INDEX(11))) && (!addOutputToMachineList(tTileEntity, TAE.GTPP_INDEX(11))) && + * (!addEnergyInputToMachineList(tTileEntity, TAE.GTPP_INDEX(11)))) { if + * (this.getBaseMetaTileEntity().getBlockOffset(xDir + i, h, zDir + j) != ModBlocks.blockCasingsMisc) { if (h < 3){ + * Utils.LOG_WARNING("Casing Expected."); return 0; } else if (h >= 3){ + * //Utils.LOG_WARNING("Your Multitank can be 20 blocks tall."); } } if + * (this.getBaseMetaTileEntity().getMetaIDOffset(xDir + i, h, zDir + j) != 11) { if (h < 3){ + * Utils.LOG_WARNING("Wrong Meta."); return 0; } else if (h >= 3){ + * //Utils.LOG_WARNING("Your Multitank can be 20 blocks tall."); } } if (h < 3){ tAmount++; } else if (h >= 3){ if + * (this.getBaseMetaTileEntity().getBlockOffset(xDir + i, h, zDir + j) == Blocks.air || + * this.getBaseMetaTileEntity().getBlockOffset(xDir + i, h, zDir + j).getUnlocalizedName().contains("residual")){ + * Utils.LOG_WARNING("Found air"); } else { + * Utils.LOG_WARNING("Layer "+(h+2)+" is complete. Adding "+(64000*9)+"L storage to the tank."); tAmount++; } } } } } } + * } Utils.LOG_INFO("Finished counting."); multiblockCasingCount = (short) tAmount; + * //Utils.LOG_INFO("Your Multitank can be 20 blocks tall."); + * Utils.LOG_INFO("Casings Count: "+tAmount+" Valid Multiblock: "+(tAmount >= + * 16)+" Tank Storage Capacity:"+getMaximumTankStorage(tAmount)+"L"); return tAmount; } + *//* + * @Override public int getMaxEfficiency(final ItemStack aStack) { return 10000; } + * @Override public int getPollutionPerTick(final ItemStack aStack) { return 5; } + * @Override public int getAmountOfOutputs() { return 1; } + * @Override public boolean explodesOnComponentBreak(final ItemStack aStack) { return false; } private static short + * getStorageMultiplier(final int casingCount){ final int tsm = 1*casingCount; if (tsm <= 0){ return 1; } return + * (short) tsm; } private static int getMaximumTankStorage(final int casingCount){ final int multiplier = + * getStorageMultiplier(casingCount); final int tempTankStorageMax = 128000*multiplier; if (tempTankStorageMax <= + * 0){return 128000;} return tempTankStorageMax; } private boolean tryForceNBTUpdate(){ + */ +/* + * //Block is invalid. if ((this == null) || (this.getBaseMetaTileEntity() == null)){ + * Utils.LOG_WARNING("Block was not valid for saving data."); return false; } //Don't need this to run clientside. if + * (!this.getBaseMetaTileEntity().isServerSide()) { return false; } //Internal Tag was not valid. try{ if + * (this.internalCraftingComponentsTag == null){ Utils.LOG_WARNING("Internal NBT data tag was null."); return false; } } + * catch (final NullPointerException x){ Utils.LOG_WARNING("Caught null NBT."); } //Internal tag was valid. + * this.saveNBTData(this.internalCraftingComponentsTag); //Mark block for update int x,y,z = 0; x = + * this.getBaseMetaTileEntity().getXCoord(); y = this.getBaseMetaTileEntity().getYCoord(); z = + * this.getBaseMetaTileEntity().getZCoord(); this.getBaseMetaTileEntity().getWorld().markBlockForUpdate(x, y, z); //Mark + * block dirty, let chunk know it's data has changed and it must be saved to disk. (Albeit slowly) + * this.getBaseMetaTileEntity().markDirty(); + *//* + * return true; } } + */ diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/storage/GregtechMetaTileEntity_PowerSubStationController.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/storage/GregtechMetaTileEntity_PowerSubStationController.java index 58579164a1..a4929af626 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/storage/GregtechMetaTileEntity_PowerSubStationController.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/storage/GregtechMetaTileEntity_PowerSubStationController.java @@ -9,6 +9,17 @@ import static gregtech.api.util.GT_StructureUtility.ofHatchAdderOptional; import static gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase.GTPPHatchElement.TTDynamo; import static gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase.GTPPHatchElement.TTEnergy; +import javax.annotation.Nullable; + +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.world.World; +import net.minecraftforge.common.util.Constants.NBT; +import net.minecraftforge.common.util.ForgeDirection; + import com.gtnewhorizon.structurelib.StructureLibAPI; import com.gtnewhorizon.structurelib.alignment.constructable.ChannelDataAccessor; import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable; @@ -23,6 +34,7 @@ import com.gtnewhorizons.modularui.common.widget.ProgressBar; import com.gtnewhorizons.modularui.common.widget.SlotGroup; import com.gtnewhorizons.modularui.common.widget.SlotWidget; import com.gtnewhorizons.modularui.common.widget.TextWidget; + import gregtech.api.enums.GT_Values; import gregtech.api.enums.TAE; import gregtech.api.enums.Textures; @@ -50,15 +62,6 @@ import gtPlusPlus.core.util.minecraft.PlayerUtils; import gtPlusPlus.preloader.asm.AsmConfig; import gtPlusPlus.xmod.gregtech.api.gui.GTPP_UITextures; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase; -import javax.annotation.Nullable; -import net.minecraft.block.Block; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.world.World; -import net.minecraftforge.common.util.Constants.NBT; -import net.minecraftforge.common.util.ForgeDirection; public class GregtechMetaTileEntity_PowerSubStationController extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_PowerSubStationController> @@ -86,8 +89,8 @@ public class GregtechMetaTileEntity_PowerSubStationController private TopState topState = TopState.MayBeTop; private static IStructureDefinition<GregtechMetaTileEntity_PowerSubStationController> STRUCTURE_DEFINITION = null; - public GregtechMetaTileEntity_PowerSubStationController( - final int aID, final String aName, final String aNameRegional) { + public GregtechMetaTileEntity_PowerSubStationController(final int aID, final String aName, + final String aNameRegional) { super(aID, aName, aNameRegional); } @@ -106,48 +109,36 @@ public class GregtechMetaTileEntity_PowerSubStationController tt.addMachineType(getMachineType()) .addInfo("Consumes " + this.ENERGY_TAX + "% of the average voltage of all energy type hatches") .addInfo("Does not require maintenance") - .addInfo("Can be built with variable height between " + (CELL_HEIGHT_MIN + 2) + "-" - + (CELL_HEIGHT_MAX + 2) + "") + .addInfo( + "Can be built with variable height between " + (CELL_HEIGHT_MIN + 2) + + "-" + + (CELL_HEIGHT_MAX + 2) + + "") .addInfo("Hatches can be placed nearly anywhere") .addInfo("HV Energy/Dynamo Hatches are the lowest tier you can use") - .addInfo("Supports voltages >= UHV using MAX tier components.") - .addSeparator() - .addController("Bottom Center") - .addCasingInfo("Sub-Station External Casings", 10) - .addDynamoHatch("Any Casing", 1) - .addEnergyHatch("Any Casing", 1) + .addInfo("Supports voltages >= UHV using MAX tier components.").addSeparator() + .addController("Bottom Center").addCasingInfo("Sub-Station External Casings", 10) + .addDynamoHatch("Any Casing", 1).addEnergyHatch("Any Casing", 1) .addSubChannelUsage("capacitor", "Vanadium Capacitor Cell Tier") - .addSubChannelUsage("height", "Height of structure") - .toolTipFinisher(CORE.GT_Tooltip_Builder); + .addSubChannelUsage("height", "Height of structure").toolTipFinisher(CORE.GT_Tooltip_Builder); return tt; } @Override - public ITexture[] getTexture( - final IGregTechTileEntity aBaseMetaTileEntity, - final byte aSide, - final byte aFacing, - final byte aColorIndex, - final boolean aActive, - final boolean aRedstone) { + public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing, + final byte aColorIndex, final boolean aActive, final boolean aRedstone) { if (aSide == aFacing) { - return new ITexture[] { - Textures.BlockIcons.getCasingTextureForId(TAE.GTPP_INDEX(24)), - new GT_RenderedTexture( - aActive - ? Textures.BlockIcons.OVERLAY_FRONT_DISASSEMBLER_ACTIVE - : Textures.BlockIcons.OVERLAY_FRONT_DISASSEMBLER) - }; + return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(TAE.GTPP_INDEX(24)), + new GT_RenderedTexture( + aActive ? Textures.BlockIcons.OVERLAY_FRONT_DISASSEMBLER_ACTIVE + : Textures.BlockIcons.OVERLAY_FRONT_DISASSEMBLER) }; } if (aSide == this.getBaseMetaTileEntity().getBackFacing()) { - return new ITexture[] { - Textures.BlockIcons.getCasingTextureForId(TAE.GTPP_INDEX(24)), - mIsOutputtingPower - ? Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[(int) this.getOutputTier()] - : Textures.BlockIcons.OVERLAYS_ENERGY_IN_MULTI[(int) this.getInputTier()] - }; + return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(TAE.GTPP_INDEX(24)), + mIsOutputtingPower ? Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[(int) this.getOutputTier()] + : Textures.BlockIcons.OVERLAYS_ENERGY_IN_MULTI[(int) this.getInputTier()] }; } - return new ITexture[] {Textures.BlockIcons.getCasingTextureForId(TAE.GTPP_INDEX(23))}; + return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(TAE.GTPP_INDEX(23)) }; } @Override @@ -232,36 +223,36 @@ public class GregtechMetaTileEntity_PowerSubStationController if (STRUCTURE_DEFINITION == null) { STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_PowerSubStationController>builder() .addShape( - mName + "bottom", transpose(new String[][] {{"BB~BB", "BBBBB", "BBBBB", "BBBBB", "BBBBB"}})) + mName + "bottom", + transpose(new String[][] { { "BB~BB", "BBBBB", "BBBBB", "BBBBB", "BBBBB" } })) + .addShape( + mName + "layer", + transpose(new String[][] { { "CCCCC", "CIIIC", "CIIIC", "CIIIC", "CCCCC" } })) + .addShape( + mName + "mid", + transpose(new String[][] { { "CCCCC", "CHHHC", "CHHHC", "CHHHC", "CCCCC" } })) .addShape( - mName + "layer", transpose(new String[][] {{"CCCCC", "CIIIC", "CIIIC", "CIIIC", "CCCCC"}})) - .addShape(mName + "mid", transpose(new String[][] {{"CCCCC", "CHHHC", "CHHHC", "CHHHC", "CCCCC"}})) - .addShape(mName + "top", transpose(new String[][] {{"TTTTT", "TTTTT", "TTTTT", "TTTTT", "TTTTT"}})) + mName + "top", + transpose(new String[][] { { "TTTTT", "TTTTT", "TTTTT", "TTTTT", "TTTTT" } })) .addElement( 'C', buildHatchAdder(GregtechMetaTileEntity_PowerSubStationController.class) .atLeast(Energy.or(TTEnergy), Dynamo.or(TTDynamo), Maintenance) .disallowOnly(ForgeDirection.UP, ForgeDirection.DOWN) - .casingIndex(TAE.GTPP_INDEX(24)) - .dot(1) - .buildAndChain( + .casingIndex(TAE.GTPP_INDEX(24)).dot(1).buildAndChain( onElementPass(x -> ++x.mCasing, ofBlock(ModBlocks.blockCasings2Misc, 8)))) .addElement( 'B', buildHatchAdder(GregtechMetaTileEntity_PowerSubStationController.class) .atLeast(Energy.or(TTEnergy), Dynamo.or(TTDynamo), Maintenance) - .disallowOnly(ForgeDirection.UP) - .casingIndex(TAE.GTPP_INDEX(24)) - .dot(1) + .disallowOnly(ForgeDirection.UP).casingIndex(TAE.GTPP_INDEX(24)).dot(1) .buildAndChain( onElementPass(x -> ++x.mCasing, ofBlock(ModBlocks.blockCasings2Misc, 8)))) .addElement( 'T', buildHatchAdder(GregtechMetaTileEntity_PowerSubStationController.class) .atLeast(Energy.or(TTEnergy), Dynamo.or(TTDynamo), Maintenance) - .disallowOnly(ForgeDirection.DOWN) - .casingIndex(TAE.GTPP_INDEX(24)) - .dot(1) + .disallowOnly(ForgeDirection.DOWN).casingIndex(TAE.GTPP_INDEX(24)).dot(1) .buildAndChain( onElementPass(x -> ++x.mCasing, ofBlock(ModBlocks.blockCasings2Misc, 8)))) .addElement( @@ -274,8 +265,7 @@ public class GregtechMetaTileEntity_PowerSubStationController onElementPass( x -> x.topState = TopState.Top, ofHatchAdderOptional( - GregtechMetaTileEntity_PowerSubStationController - ::addPowerSubStationList, + GregtechMetaTileEntity_PowerSubStationController::addPowerSubStationList, TAE.GTPP_INDEX(24), 1, ModBlocks.blockCasings2Misc, @@ -291,15 +281,16 @@ public class GregtechMetaTileEntity_PowerSubStationController onElementPass(x -> ++x.cellCount[3], ofCell(7)), onElementPass(x -> ++x.cellCount[4], ofCell(8)), onElementPass( - x -> ++x.cellCount[5], ofCell(9)))))))) - .addElement('H', ofCell(4)) - .build(); + x -> ++x.cellCount[5], + ofCell(9)))))))) + .addElement('H', ofCell(4)).build(); } return STRUCTURE_DEFINITION; } public static <T> IStructureElement<T> ofCell(int aIndex) { return new IStructureElement<T>() { + @Override public boolean check(T t, World world, int x, int y, int z) { Block block = world.getBlock(x, y, z); @@ -338,14 +329,14 @@ public class GregtechMetaTileEntity_PowerSubStationController @Nullable @Override - public BlocksToPlace getBlocksToPlace( - T t, World world, int x, int y, int z, ItemStack trigger, AutoPlaceEnvironment env) { + public BlocksToPlace getBlocksToPlace(T t, World world, int x, int y, int z, ItemStack trigger, + AutoPlaceEnvironment env) { return BlocksToPlace.create(getBlockFromTier(trigger.stackSize), getMetaFromTier(trigger.stackSize)); } @Override - public PlaceResult survivalPlaceBlock( - T t, World world, int x, int y, int z, ItemStack trigger, AutoPlaceEnvironment env) { + public PlaceResult survivalPlaceBlock(T t, World world, int x, int y, int z, ItemStack trigger, + AutoPlaceEnvironment env) { Block block = world.getBlock(x, y, z); int meta = world.getBlockMetadata(x, y, z); int tier = getCellTier(block, meta); @@ -707,41 +698,54 @@ public class GregtechMetaTileEntity_PowerSubStationController String storedEnergyText; if (this.getEUVar() > this.mBatteryCapacity) { - storedEnergyText = - EnumChatFormatting.RED + GT_Utility.formatNumbers(this.getEUVar()) + EnumChatFormatting.RESET; + storedEnergyText = EnumChatFormatting.RED + GT_Utility.formatNumbers(this.getEUVar()) + + EnumChatFormatting.RESET; } else { - storedEnergyText = - EnumChatFormatting.GREEN + GT_Utility.formatNumbers(this.getEUVar()) + EnumChatFormatting.RESET; + storedEnergyText = EnumChatFormatting.GREEN + GT_Utility.formatNumbers(this.getEUVar()) + + EnumChatFormatting.RESET; } int errorCode = this.getBaseMetaTileEntity().getErrorDisplayID(); boolean mMaint = (errorCode != 0); - return new String[] { - "Ergon Energy - District Sub-Station", - "Stored EU: " + storedEnergyText, - "Capacity: " + EnumChatFormatting.YELLOW + GT_Utility.formatNumbers(this.maxEUStore()) - + EnumChatFormatting.RESET, - "Running Costs: " + EnumChatFormatting.RED + GT_Utility.formatNumbers(this.computeEnergyTax()) - + EnumChatFormatting.RESET + " EU/t", - "Controller Mode: " + mode, - "Requires Maintenance: " + (!mMaint ? EnumChatFormatting.GREEN : EnumChatFormatting.RED) + mMaint - + EnumChatFormatting.RESET + " | Code: [" - + (!mMaint ? EnumChatFormatting.GREEN : EnumChatFormatting.RED) + errorCode - + EnumChatFormatting.RESET + "]", - "----------------------", - "Stats for Nerds", - "Average Input: " + EnumChatFormatting.BLUE + GT_Utility.formatNumbers(this.getAverageEuAdded()) - + EnumChatFormatting.RESET + " EU", - "Average Output: " + EnumChatFormatting.GOLD + GT_Utility.formatNumbers(this.getAverageEuConsumed()) - + EnumChatFormatting.RESET + " EU", - "Total Input: " + EnumChatFormatting.BLUE + GT_Utility.formatNumbers(this.mTotalEnergyAdded) - + EnumChatFormatting.RESET + " EU", - "Total Output: " + EnumChatFormatting.GOLD + GT_Utility.formatNumbers(this.mTotalEnergyConsumed) - + EnumChatFormatting.RESET + " EU", - "Total Costs: " + EnumChatFormatting.RED + GT_Utility.formatNumbers(this.mTotalEnergyLost) - + EnumChatFormatting.RESET + " EU", - }; + return new String[] { "Ergon Energy - District Sub-Station", "Stored EU: " + storedEnergyText, + "Capacity: " + EnumChatFormatting.YELLOW + + GT_Utility.formatNumbers(this.maxEUStore()) + + EnumChatFormatting.RESET, + "Running Costs: " + EnumChatFormatting.RED + + GT_Utility.formatNumbers(this.computeEnergyTax()) + + EnumChatFormatting.RESET + + " EU/t", + "Controller Mode: " + mode, + "Requires Maintenance: " + (!mMaint ? EnumChatFormatting.GREEN : EnumChatFormatting.RED) + + mMaint + + EnumChatFormatting.RESET + + " | Code: [" + + (!mMaint ? EnumChatFormatting.GREEN : EnumChatFormatting.RED) + + errorCode + + EnumChatFormatting.RESET + + "]", + "----------------------", "Stats for Nerds", + "Average Input: " + EnumChatFormatting.BLUE + + GT_Utility.formatNumbers(this.getAverageEuAdded()) + + EnumChatFormatting.RESET + + " EU", + "Average Output: " + EnumChatFormatting.GOLD + + GT_Utility.formatNumbers(this.getAverageEuConsumed()) + + EnumChatFormatting.RESET + + " EU", + "Total Input: " + EnumChatFormatting.BLUE + + GT_Utility.formatNumbers(this.mTotalEnergyAdded) + + EnumChatFormatting.RESET + + " EU", + "Total Output: " + EnumChatFormatting.GOLD + + GT_Utility.formatNumbers(this.mTotalEnergyConsumed) + + EnumChatFormatting.RESET + + " EU", + "Total Costs: " + EnumChatFormatting.RED + + GT_Utility.formatNumbers(this.mTotalEnergyLost) + + EnumChatFormatting.RESET + + " EU", }; } @Override @@ -841,79 +845,65 @@ public class GregtechMetaTileEntity_PowerSubStationController @Override public void addGregTechLogo(ModularWindow.Builder builder) { - builder.widget(new DrawableWidget() - .setDrawable(getGUITextureSet().getGregTechLogo()) - .setSize(17, 17) - .setPos(175, 166)); + builder.widget( + new DrawableWidget().setDrawable(getGUITextureSet().getGregTechLogo()).setSize(17, 17) + .setPos(175, 166)); } @Override public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildContext) { - builder.widget(new DrawableWidget() - .setDrawable(GT_UITextures.PICTURE_SCREEN_BLACK) - .setPos(4, 4) - .setSize(149, 149)) + builder.widget( + new DrawableWidget().setDrawable(GT_UITextures.PICTURE_SCREEN_BLACK).setPos(4, 4).setSize(149, 149)) .widget(new SlotWidget(inventoryHandler, 0).setPos(154, 4)) - .widget(new SlotWidget(inventoryHandler, 1) - .setAccess(true, false) - .setPos(154, 22)) - .widget(SlotGroup.ofItemHandler(new PlayerMainInvWrapper(buildContext.getPlayer().inventory), 9) - .endAtSlot(8) - .build() - .setPos(7, 166)) - .widget(TextWidget.dynamicString(() -> getBaseMetaTileEntity().getErrorDisplayID() == 0 - ? getBaseMetaTileEntity().isActive() ? "Running perfectly" : "Turn on with Mallet" - : "") - .setSynced(false) - .setDefaultColor(COLOR_TEXT_WHITE.get()) - .setPos(10, 8)) - .widget(new FakeSyncWidget.BooleanSyncer( - () -> getBaseMetaTileEntity().isActive(), - val -> getBaseMetaTileEntity().setActive(val))) - .widget(new FakeSyncWidget.IntegerSyncer( - () -> getBaseMetaTileEntity().getErrorDisplayID(), - val -> getBaseMetaTileEntity().setErrorDisplayID(val))) - .widget(new TextWidget("In") - .setDefaultColor(COLOR_TEXT_WHITE.get()) - .setPos(178, 10)) - .widget(new TextWidget("Out") - .setDefaultColor(COLOR_TEXT_WHITE.get()) - .setPos(176, 28)) - .widget(TextWidget.dynamicString( - () -> "Avg In: " + GT_Utility.formatNumbers(getAverageEuAdded()) + " EU") - .setDefaultColor(COLOR_TEXT_WHITE.get()) - .setPos(10, 20)) - .widget(TextWidget.dynamicString( - () -> "Avg Out: " + GT_Utility.formatNumbers(getAverageEuConsumed()) + " EU") - .setDefaultColor(COLOR_TEXT_WHITE.get()) - .setPos(10, 30)) - .widget(new DrawableWidget() - .setDrawable(GTPP_UITextures.PICTURE_ENERGY_FRAME) - .setPos(4, 155) - .setSize(149, 7)) - .widget(new ProgressBar() - .setProgress(this::getProgress) - .setTexture(GTPP_UITextures.PROGRESSBAR_PSS_ENERGY, 147) - .setDirection(ProgressBar.Direction.RIGHT) - .setPos(5, 156) - .setSize(147, 5)) - .widget(new TextWidget("Stored:") - .setDefaultColor(COLOR_TEXT_WHITE.get()) - .setPos(10, 132)) + .widget(new SlotWidget(inventoryHandler, 1).setAccess(true, false).setPos(154, 22)) + .widget( + SlotGroup.ofItemHandler(new PlayerMainInvWrapper(buildContext.getPlayer().inventory), 9) + .endAtSlot(8).build().setPos(7, 166)) + .widget( + TextWidget + .dynamicString( + () -> getBaseMetaTileEntity().getErrorDisplayID() == 0 + ? getBaseMetaTileEntity().isActive() ? "Running perfectly" + : "Turn on with Mallet" + : "") + .setSynced(false).setDefaultColor(COLOR_TEXT_WHITE.get()).setPos(10, 8)) + .widget( + new FakeSyncWidget.BooleanSyncer( + () -> getBaseMetaTileEntity().isActive(), + val -> getBaseMetaTileEntity().setActive(val))) + .widget( + new FakeSyncWidget.IntegerSyncer( + () -> getBaseMetaTileEntity().getErrorDisplayID(), + val -> getBaseMetaTileEntity().setErrorDisplayID(val))) + .widget(new TextWidget("In").setDefaultColor(COLOR_TEXT_WHITE.get()).setPos(178, 10)) + .widget(new TextWidget("Out").setDefaultColor(COLOR_TEXT_WHITE.get()).setPos(176, 28)) + .widget( + TextWidget + .dynamicString(() -> "Avg In: " + GT_Utility.formatNumbers(getAverageEuAdded()) + " EU") + .setDefaultColor(COLOR_TEXT_WHITE.get()).setPos(10, 20)) + .widget( + TextWidget + .dynamicString( + () -> "Avg Out: " + GT_Utility.formatNumbers(getAverageEuConsumed()) + " EU") + .setDefaultColor(COLOR_TEXT_WHITE.get()).setPos(10, 30)) + .widget( + new DrawableWidget().setDrawable(GTPP_UITextures.PICTURE_ENERGY_FRAME).setPos(4, 155) + .setSize(149, 7)) + .widget( + new ProgressBar().setProgress(this::getProgress) + .setTexture(GTPP_UITextures.PROGRESSBAR_PSS_ENERGY, 147) + .setDirection(ProgressBar.Direction.RIGHT).setPos(5, 156).setSize(147, 5)) + .widget(new TextWidget("Stored:").setDefaultColor(COLOR_TEXT_WHITE.get()).setPos(10, 132)) .widget(TextWidget.dynamicText(() -> { - int colorScale = (int) (getProgress() * 100 * 2.55); - return new Text(GT_Utility.formatNumbers( - getBaseMetaTileEntity().getStoredEU()) + " EU") - .color(Utils.rgbtoHexValue((255 - colorScale), colorScale, 0)); - }) - .setPos(10, 142)) - .widget(TextWidget.dynamicString(() -> GT_Utility.formatNumbers(getProgress() * 100) + "%") - .setDefaultColor(COLOR_TEXT_WHITE.get()) - .setPos(70, 155)); + int colorScale = (int) (getProgress() * 100 * 2.55); + return new Text(GT_Utility.formatNumbers(getBaseMetaTileEntity().getStoredEU()) + " EU") + .color(Utils.rgbtoHexValue((255 - colorScale), colorScale, 0)); + }).setPos(10, 142)).widget( + TextWidget.dynamicString(() -> GT_Utility.formatNumbers(getProgress() * 100) + "%") + .setDefaultColor(COLOR_TEXT_WHITE.get()).setPos(70, 155)); } private float getProgress() { - return (float) getBaseMetaTileEntity().getStoredEU() - / getBaseMetaTileEntity().getEUCapacity(); + return (float) getBaseMetaTileEntity().getStoredEU() / getBaseMetaTileEntity().getEUCapacity(); } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/misc/GT_TileEntity_ComputerCube.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/misc/GT_TileEntity_ComputerCube.java index 6aec31dc1b..37f5d0ba25 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/misc/GT_TileEntity_ComputerCube.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/misc/GT_TileEntity_ComputerCube.java @@ -3,7 +3,22 @@ package gtPlusPlus.xmod.gregtech.common.tileentities.misc; import static gregtech.api.enums.GT_Values.V; import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Items; +import net.minecraft.inventory.Slot; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.world.World; + import Ic2ExpReactorPlanner.SimulationData; + import com.gtnewhorizons.modularui.api.ModularUITextures; import com.gtnewhorizons.modularui.api.forge.IItemHandlerModifiable; import com.gtnewhorizons.modularui.api.screen.ModularWindow; @@ -15,6 +30,7 @@ import com.gtnewhorizons.modularui.common.widget.FakeSyncWidget; import com.gtnewhorizons.modularui.common.widget.ProgressBar; import com.gtnewhorizons.modularui.common.widget.SlotWidget; import com.gtnewhorizons.modularui.common.widget.TextWidget; + import cpw.mods.fml.common.FMLCommonHandler; import gregtech.api.GregTech_API; import gregtech.api.enums.*; @@ -38,18 +54,6 @@ import gtPlusPlus.xmod.gregtech.api.gui.widget.DataStickSlotWidget; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; import gtPlusPlus.xmod.gregtech.common.computer.GT_Computercube_Description; import gtPlusPlus.xmod.gregtech.common.computer.GT_Computercube_Simulator; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import java.util.stream.Collectors; -import net.minecraft.entity.Entity; -import net.minecraft.entity.item.EntityItem; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.inventory.Slot; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.world.World; public class GT_TileEntity_ComputerCube extends GT_MetaTileEntity_BasicTank implements IAddGregtechLogo { @@ -110,14 +114,8 @@ public class GT_TileEntity_ComputerCube extends GT_MetaTileEntity_BasicTank impl @Override public String[] getDescription() { - return new String[] { - this.mDescription, - "Built in Reactor Planner", - "Built in Scanner", - "Built in Info-Bank", - "Displays Fusion Recipes", - CORE.GT_Tooltip - }; + return new String[] { this.mDescription, "Built in Reactor Planner", "Built in Scanner", "Built in Info-Bank", + "Displays Fusion Recipes", CORE.GT_Tooltip }; } @Override @@ -248,13 +246,13 @@ public class GT_TileEntity_ComputerCube extends GT_MetaTileEntity_BasicTank impl } for (i = 54; i < 58; i++) { if (this.mInventory[i] != null) { - if (!this.getWorld().isRemote) - this.getWorld().spawnEntityInWorld((Entity) new EntityItem( - this.getWorld(), - this.getXCoord() + 0.5D, - this.getYCoord() + 0.5D, - this.getZCoord() + 0.5D, - this.mInventory[i])); + if (!this.getWorld().isRemote) this.getWorld().spawnEntityInWorld( + (Entity) new EntityItem( + this.getWorld(), + this.getXCoord() + 0.5D, + this.getYCoord() + 0.5D, + this.getZCoord() + 0.5D, + this.mInventory[i])); this.mInventory[i] = null; } } @@ -308,22 +306,20 @@ public class GT_TileEntity_ComputerCube extends GT_MetaTileEntity_BasicTank impl if (this.mMode == MODE_ELECTROLYZER) { showElectrolyzerRecipe(0); } - this.getWorld() - .addBlockEvent( - this.getXCoord(), - this.getYCoord(), - this.getZCoord(), - GregTech_API.sBlockMachines, - 10, - this.mMode); - this.getWorld() - .addBlockEvent( - this.getXCoord(), - this.getYCoord(), - this.getZCoord(), - GregTech_API.sBlockMachines, - 11, - this.mMaxHeat); + this.getWorld().addBlockEvent( + this.getXCoord(), + this.getYCoord(), + this.getZCoord(), + GregTech_API.sBlockMachines, + 10, + this.mMode); + this.getWorld().addBlockEvent( + this.getXCoord(), + this.getYCoord(), + this.getZCoord(), + GregTech_API.sBlockMachines, + 11, + this.mMaxHeat); } public void showDescription(int aIndex) { @@ -335,105 +331,104 @@ public class GT_TileEntity_ComputerCube extends GT_MetaTileEntity_BasicTank impl if (((GT_Computercube_Description) GT_Computercube_Description.sDescriptions.get(aIndex)).mStacks[0] == null) { this.mInventory[59] = null; } else { - this.mInventory[59] = ((GT_Computercube_Description) GT_Computercube_Description.sDescriptions.get(aIndex)) - .mStacks[0].copy(); + this.mInventory[59] = ((GT_Computercube_Description) GT_Computercube_Description.sDescriptions + .get(aIndex)).mStacks[0].copy(); } if (((GT_Computercube_Description) GT_Computercube_Description.sDescriptions.get(aIndex)).mStacks[1] == null) { this.mInventory[60] = null; } else { - this.mInventory[60] = ((GT_Computercube_Description) GT_Computercube_Description.sDescriptions.get(aIndex)) - .mStacks[1].copy(); + this.mInventory[60] = ((GT_Computercube_Description) GT_Computercube_Description.sDescriptions + .get(aIndex)).mStacks[1].copy(); } if (((GT_Computercube_Description) GT_Computercube_Description.sDescriptions.get(aIndex)).mStacks[2] == null) { this.mInventory[61] = null; } else { - this.mInventory[61] = ((GT_Computercube_Description) GT_Computercube_Description.sDescriptions.get(aIndex)) - .mStacks[2].copy(); + this.mInventory[61] = ((GT_Computercube_Description) GT_Computercube_Description.sDescriptions + .get(aIndex)).mStacks[2].copy(); } if (((GT_Computercube_Description) GT_Computercube_Description.sDescriptions.get(aIndex)).mStacks[3] == null) { this.mInventory[62] = null; } else { - this.mInventory[62] = ((GT_Computercube_Description) GT_Computercube_Description.sDescriptions.get(aIndex)) - .mStacks[3].copy(); + this.mInventory[62] = ((GT_Computercube_Description) GT_Computercube_Description.sDescriptions + .get(aIndex)).mStacks[3].copy(); } if (((GT_Computercube_Description) GT_Computercube_Description.sDescriptions.get(aIndex)).mStacks[4] == null) { this.mInventory[63] = null; } else { - this.mInventory[63] = ((GT_Computercube_Description) GT_Computercube_Description.sDescriptions.get(aIndex)) - .mStacks[4].copy(); + this.mInventory[63] = ((GT_Computercube_Description) GT_Computercube_Description.sDescriptions + .get(aIndex)).mStacks[4].copy(); } if (((GT_Computercube_Description) GT_Computercube_Description.sDescriptions.get(aIndex)).mStacks[5] == null) { this.mInventory[64] = null; } else { - this.mInventory[64] = ((GT_Computercube_Description) GT_Computercube_Description.sDescriptions.get(aIndex)) - .mStacks[5].copy(); + this.mInventory[64] = ((GT_Computercube_Description) GT_Computercube_Description.sDescriptions + .get(aIndex)).mStacks[5].copy(); this.mExplosionStrength = 100.0F; } if (((GT_Computercube_Description) GT_Computercube_Description.sDescriptions.get(aIndex)).mStacks[6] == null) { this.mInventory[65] = null; } else { - this.mInventory[65] = ((GT_Computercube_Description) GT_Computercube_Description.sDescriptions.get(aIndex)) - .mStacks[6].copy(); + this.mInventory[65] = ((GT_Computercube_Description) GT_Computercube_Description.sDescriptions + .get(aIndex)).mStacks[6].copy(); this.mExplosionStrength = 100.0F; } if (((GT_Computercube_Description) GT_Computercube_Description.sDescriptions.get(aIndex)).mStacks[7] == null) { this.mInventory[66] = null; } else { - this.mInventory[66] = ((GT_Computercube_Description) GT_Computercube_Description.sDescriptions.get(aIndex)) - .mStacks[7].copy(); + this.mInventory[66] = ((GT_Computercube_Description) GT_Computercube_Description.sDescriptions + .get(aIndex)).mStacks[7].copy(); this.mExplosionStrength = 100.0F; } if (((GT_Computercube_Description) GT_Computercube_Description.sDescriptions.get(aIndex)).mStacks[8] == null) { this.mInventory[67] = null; } else { - this.mInventory[67] = ((GT_Computercube_Description) GT_Computercube_Description.sDescriptions.get(aIndex)) - .mStacks[8].copy(); + this.mInventory[67] = ((GT_Computercube_Description) GT_Computercube_Description.sDescriptions + .get(aIndex)).mStacks[8].copy(); this.mExplosionStrength = 100.0F; } if (((GT_Computercube_Description) GT_Computercube_Description.sDescriptions.get(aIndex)).mStacks[9] == null) { this.mInventory[68] = null; } else { - this.mInventory[68] = ((GT_Computercube_Description) GT_Computercube_Description.sDescriptions.get(aIndex)) - .mStacks[9].copy(); + this.mInventory[68] = ((GT_Computercube_Description) GT_Computercube_Description.sDescriptions + .get(aIndex)).mStacks[9].copy(); this.mExplosionStrength = 100.0F; } if (((GT_Computercube_Description) GT_Computercube_Description.sDescriptions.get(aIndex)).mStacks[10] == null) { this.mInventory[69] = null; } else { - this.mInventory[69] = ((GT_Computercube_Description) GT_Computercube_Description.sDescriptions.get(aIndex)) - .mStacks[10].copy(); + this.mInventory[69] = ((GT_Computercube_Description) GT_Computercube_Description.sDescriptions + .get(aIndex)).mStacks[10].copy(); this.mExplosionStrength = 100.0F; } if (((GT_Computercube_Description) GT_Computercube_Description.sDescriptions.get(aIndex)).mStacks[11] == null) { this.mInventory[70] = null; } else { - this.mInventory[70] = ((GT_Computercube_Description) GT_Computercube_Description.sDescriptions.get(aIndex)) - .mStacks[11].copy(); + this.mInventory[70] = ((GT_Computercube_Description) GT_Computercube_Description.sDescriptions + .get(aIndex)).mStacks[11].copy(); this.mExplosionStrength = 100.0F; } if (((GT_Computercube_Description) GT_Computercube_Description.sDescriptions.get(aIndex)).mStacks[12] == null) { this.mInventory[71] = null; } else { - this.mInventory[71] = ((GT_Computercube_Description) GT_Computercube_Description.sDescriptions.get(aIndex)) - .mStacks[12].copy(); + this.mInventory[71] = ((GT_Computercube_Description) GT_Computercube_Description.sDescriptions + .get(aIndex)).mStacks[12].copy(); this.mExplosionStrength = 100.0F; } if (((GT_Computercube_Description) GT_Computercube_Description.sDescriptions.get(aIndex)).mStacks[13] == null) { this.mInventory[72] = null; } else { - this.mInventory[72] = ((GT_Computercube_Description) GT_Computercube_Description.sDescriptions.get(aIndex)) - .mStacks[13].copy(); + this.mInventory[72] = ((GT_Computercube_Description) GT_Computercube_Description.sDescriptions + .get(aIndex)).mStacks[13].copy(); this.mExplosionStrength = 100.0F; } this.mMaxHeat = aIndex; - this.getWorld() - .addBlockEvent( - this.getXCoord(), - this.getYCoord(), - this.getZCoord(), - GregTech_API.sBlockMachines, - 11, - this.mMaxHeat); + this.getWorld().addBlockEvent( + this.getXCoord(), + this.getYCoord(), + this.getZCoord(), + GregTech_API.sBlockMachines, + 11, + this.mMaxHeat); } public void switchDescriptionPageForward() { @@ -448,50 +443,17 @@ public class GT_TileEntity_ComputerCube extends GT_MetaTileEntity_BasicTank impl public void showCentrifugeRecipe(int aIndex) { /* - if (aIndex >= GT_Recipe_Map.sCentrifugeRecipes.mRecipeList.size() || aIndex < 0) - aIndex = 0; - GT_Recipe tRecipe = GT_Recipe_Map.sCentrifugeRecipes.mRecipeList.get(aIndex); - if (tRecipe != null) { - if (tRecipe.mInput1 == null) { - this.mInventory[59] = null; - } - else { - this.mInventory[59] = tRecipe.mInput1.copy(); - } - if (tRecipe.mInput2 == null) { - this.mInventory[60] = null; - } - else { - this.mInventory[60] = tRecipe.mInput2.copy(); - } - if (tRecipe.mOutput1 == null) { - this.mInventory[61] = null; - } - else { - this.mInventory[61] = tRecipe.mOutput1.copy(); - } - if (tRecipe.mOutput2 == null) { - this.mInventory[62] = null; - } - else { - this.mInventory[62] = tRecipe.mOutput2.copy(); - } - if (tRecipe.mOutput3 == null) { - this.mInventory[63] = null; - } - else { - this.mInventory[63] = tRecipe.mOutput3.copy(); - } - if (tRecipe.mOutput4 == null) { - this.mInventory[64] = null; - } - else { - this.mInventory[64] = tRecipe.mOutput4.copy(); - } - this.mEU = tRecipe.mDuration * 5; - this.mMaxHeat = aIndex; - } - this.getWorld().addBlockEvent(this.xCoord, this.yCoord, this.zCoord, (GregTech_API.sBlockList[1]).field_71990_ca, 11, this.mMaxHeat); + * if (aIndex >= GT_Recipe_Map.sCentrifugeRecipes.mRecipeList.size() || aIndex < 0) aIndex = 0; GT_Recipe + * tRecipe = GT_Recipe_Map.sCentrifugeRecipes.mRecipeList.get(aIndex); if (tRecipe != null) { if + * (tRecipe.mInput1 == null) { this.mInventory[59] = null; } else { this.mInventory[59] = + * tRecipe.mInput1.copy(); } if (tRecipe.mInput2 == null) { this.mInventory[60] = null; } else { + * this.mInventory[60] = tRecipe.mInput2.copy(); } if (tRecipe.mOutput1 == null) { this.mInventory[61] = null; } + * else { this.mInventory[61] = tRecipe.mOutput1.copy(); } if (tRecipe.mOutput2 == null) { this.mInventory[62] = + * null; } else { this.mInventory[62] = tRecipe.mOutput2.copy(); } if (tRecipe.mOutput3 == null) { + * this.mInventory[63] = null; } else { this.mInventory[63] = tRecipe.mOutput3.copy(); } if (tRecipe.mOutput4 == + * null) { this.mInventory[64] = null; } else { this.mInventory[64] = tRecipe.mOutput4.copy(); } this.mEU = + * tRecipe.mDuration * 5; this.mMaxHeat = aIndex; } this.getWorld().addBlockEvent(this.xCoord, this.yCoord, + * this.zCoord, (GregTech_API.sBlockList[1]).field_71990_ca, 11, this.mMaxHeat); */ } public void switchCentrifugePageForward() { @@ -506,50 +468,17 @@ public class GT_TileEntity_ComputerCube extends GT_MetaTileEntity_BasicTank impl public void showElectrolyzerRecipe(int aIndex) { /* - if (aIndex >= GT_Recipe_Map.sElectrolyzerRecipes.mRecipeList.size() || aIndex < 0) - aIndex = 0; - GT_Recipe tRecipe = GT_Recipe_Map.sElectrolyzerRecipes.get(aIndex); - if (tRecipe != null) { - if (tRecipe.mInput1 == null) { - this.mInventory[59] = null; - } - else { - this.mInventory[59] = tRecipe.mInput1.copy(); - } - if (tRecipe.mInput2 == null) { - this.mInventory[60] = null; - } - else { - this.mInventory[60] = tRecipe.mInput2.copy(); - } - if (tRecipe.mOutput1 == null) { - this.mInventory[61] = null; - } - else { - this.mInventory[61] = tRecipe.mOutput1.copy(); - } - if (tRecipe.mOutput2 == null) { - this.mInventory[62] = null; - } - else { - this.mInventory[62] = tRecipe.mOutput2.copy(); - } - if (tRecipe.mOutput3 == null) { - this.mInventory[63] = null; - } - else { - this.mInventory[63] = tRecipe.mOutput3.copy(); - } - if (tRecipe.mOutput4 == null) { - this.mInventory[64] = null; - } - else { - this.mInventory[64] = tRecipe.mOutput4.copy(); - } - this.mEU = tRecipe.mDuration * tRecipe.mEUt; - this.mMaxHeat = aIndex; - } - this.getWorld().addBlockEvent(this.xCoord, this.yCoord, this.zCoord, (GregTech_API.sBlockList[1]).field_71990_ca, 11, this.mMaxHeat); + * if (aIndex >= GT_Recipe_Map.sElectrolyzerRecipes.mRecipeList.size() || aIndex < 0) aIndex = 0; GT_Recipe + * tRecipe = GT_Recipe_Map.sElectrolyzerRecipes.get(aIndex); if (tRecipe != null) { if (tRecipe.mInput1 == null) + * { this.mInventory[59] = null; } else { this.mInventory[59] = tRecipe.mInput1.copy(); } if (tRecipe.mInput2 == + * null) { this.mInventory[60] = null; } else { this.mInventory[60] = tRecipe.mInput2.copy(); } if + * (tRecipe.mOutput1 == null) { this.mInventory[61] = null; } else { this.mInventory[61] = + * tRecipe.mOutput1.copy(); } if (tRecipe.mOutput2 == null) { this.mInventory[62] = null; } else { + * this.mInventory[62] = tRecipe.mOutput2.copy(); } if (tRecipe.mOutput3 == null) { this.mInventory[63] = null; + * } else { this.mInventory[63] = tRecipe.mOutput3.copy(); } if (tRecipe.mOutput4 == null) { this.mInventory[64] + * = null; } else { this.mInventory[64] = tRecipe.mOutput4.copy(); } this.mEU = tRecipe.mDuration * + * tRecipe.mEUt; this.mMaxHeat = aIndex; } this.getWorld().addBlockEvent(this.xCoord, this.yCoord, this.zCoord, + * (GregTech_API.sBlockList[1]).field_71990_ca, 11, this.mMaxHeat); */ } public void switchElectrolyzerPageForward() { @@ -599,14 +528,13 @@ public class GT_TileEntity_ComputerCube extends GT_MetaTileEntity_BasicTank impl this.mMaxHeat = aIndex; this.mFusionOutput = tRecipe.mFluidOutputs[0].getLocalizedName(); } - this.getWorld() - .addBlockEvent( - this.getXCoord(), - this.getYCoord(), - this.getZCoord(), - GregTech_API.sBlockMachines, - 11, - this.mMaxHeat); + this.getWorld().addBlockEvent( + this.getXCoord(), + this.getYCoord(), + this.getZCoord(), + GregTech_API.sBlockMachines, + 11, + this.mMaxHeat); } public void switchFusionPageForward() { @@ -699,10 +627,10 @@ public class GT_TileEntity_ComputerCube extends GT_MetaTileEntity_BasicTank impl } if (this.getBaseMetaTileEntity().isServerSide()) { if (this.mMode == MODE_SCANNER) { - /*if (this.mInventory[55] == null) { - this.mInventory[55] = this.mInventory[54]; - this.mInventory[54] = null; - }*/ + /* + * if (this.mInventory[55] == null) { this.mInventory[55] = this.mInventory[54]; this.mInventory[54] = + * null; } + */ if (this.mInventory[57] == null) { this.mInventory[57] = this.mInventory[56]; this.mInventory[56] = null; @@ -711,47 +639,31 @@ public class GT_TileEntity_ComputerCube extends GT_MetaTileEntity_BasicTank impl // 54 - 55 || 56 - 57 // Do scanny bits if (mSeedscanner && this.mMode == MODE_SCANNER) { - /*if (doScan(this.mInventory[55]) == 4) { - if ((this.mInventory[57] != null) && (this.mInventory[57].getUnlocalizedName().equals("gt.metaitem.01.32707"))) { - GT_Mod.instance.achievements.issueAchievement(aBaseMetaTileEntity.getWorld().getPlayerEntityByName(aBaseMetaTileEntity.getOwnerName()), "scanning"); - } - }*/ - /*if (this.mEU > 0) { - if (!this.getBaseMetaTileEntity().decreaseStoredEnergyUnits(this.mEU, false)) { - this.mProgress = 0; - } - }*/ + /* + * if (doScan(this.mInventory[55]) == 4) { if ((this.mInventory[57] != null) && + * (this.mInventory[57].getUnlocalizedName().equals("gt.metaitem.01.32707"))) { + * GT_Mod.instance.achievements.issueAchievement(aBaseMetaTileEntity.getWorld(). + * getPlayerEntityByName(aBaseMetaTileEntity.getOwnerName()), "scanning"); } } + */ + /* + * if (this.mEU > 0) { if (!this.getBaseMetaTileEntity().decreaseStoredEnergyUnits(this.mEU, false)) + * { this.mProgress = 0; } } + */ } - /*if (mSeedscanner && this.mInventory[55] != null && GT_Utility.areStacksEqual(this.mInventory[55], Ic2Items.cropSeed, true) && this.mInventory[55].getTagCompound() != null) { - if (this.mInventory[55].getTagCompound().getByte("scan") < 4) { - if (this.mProgress >= 100) { - this.mInventory[55].getTagCompound().setByte("scan", (byte) 4); - this.mProgress = 0; - } - else if (this.getBaseMetaTileEntity().decreaseStoredEnergyUnits(100, false)) { - this.mProgress++; - } - } - else { - this.mProgress = 0; - if (this.mInventory[56] == null) { - this.mInventory[56] = this.mInventory[55]; - this.mInventory[55] = null; - } - } - } - else { - this.mProgress = 0; - if (this.mInventory[56] == null) { - this.mInventory[56] = this.mInventory[55]; - this.mInventory[55] = null; - } - }*/ + /* + * if (mSeedscanner && this.mInventory[55] != null && GT_Utility.areStacksEqual(this.mInventory[55], + * Ic2Items.cropSeed, true) && this.mInventory[55].getTagCompound() != null) { if + * (this.mInventory[55].getTagCompound().getByte("scan") < 4) { if (this.mProgress >= 100) { + * this.mInventory[55].getTagCompound().setByte("scan", (byte) 4); this.mProgress = 0; } else if + * (this.getBaseMetaTileEntity().decreaseStoredEnergyUnits(100, false)) { this.mProgress++; } } else { + * this.mProgress = 0; if (this.mInventory[56] == null) { this.mInventory[56] = this.mInventory[55]; + * this.mInventory[55] = null; } } } else { this.mProgress = 0; if (this.mInventory[56] == null) { + * this.mInventory[56] = this.mInventory[55]; this.mInventory[55] = null; } } + */ } - if (this.mMode == MODE_REACTOR_PLANNER - && mReactorplanner + if (this.mMode == MODE_REACTOR_PLANNER && mReactorplanner && this.mSimulator != null && this.mSimulator.simulator != null && this.mSimulator.simulatedReactor != null) { @@ -769,22 +681,20 @@ public class GT_TileEntity_ComputerCube extends GT_MetaTileEntity_BasicTank impl } if (aTick % 20L == 0L) { - this.getWorld() - .addBlockEvent( - this.getXCoord(), - this.getYCoord(), - this.getZCoord(), - GregTech_API.sBlockMachines, - 10, - this.mMode); - this.getWorld() - .addBlockEvent( - this.getXCoord(), - this.getYCoord(), - this.getZCoord(), - GregTech_API.sBlockMachines, - 11, - this.mMaxHeat); + this.getWorld().addBlockEvent( + this.getXCoord(), + this.getYCoord(), + this.getZCoord(), + GregTech_API.sBlockMachines, + 10, + this.mMode); + this.getWorld().addBlockEvent( + this.getXCoord(), + this.getYCoord(), + this.getZCoord(), + GregTech_API.sBlockMachines, + 11, + this.mMaxHeat); } } } @@ -792,16 +702,15 @@ public class GT_TileEntity_ComputerCube extends GT_MetaTileEntity_BasicTank impl @Override public void receiveClientEvent(byte aEventID, byte aValue) { super.receiveClientEvent(aEventID, aValue); - if (this.getWorld().isRemote) - switch (aEventID) { - case 10: - this.mNeedsUpdate = true; - this.mMode = aValue; - break; - case 11: - this.mMaxHeat = aValue; - break; - } + if (this.getWorld().isRemote) switch (aEventID) { + case 10: + this.mNeedsUpdate = true; + this.mMode = aValue; + break; + case 11: + this.mMaxHeat = aValue; + break; + } return; } @@ -880,36 +789,29 @@ public class GT_TileEntity_ComputerCube extends GT_MetaTileEntity_BasicTank impl } @Override - public ITexture[] getTexture( - final IGregTechTileEntity aBaseMetaTileEntity, - final byte aSide, - final byte aFacing, - final byte aColorIndex, - final boolean aActive, - final boolean aRedstone) { - return this.mTextures[ - (aSide == aFacing - ? 0 - : aSide == GT_Utility.getOppositeSide(aFacing) ? 1 : aSide == 0 ? 2 : aSide == 1 ? 3 : 4)][ - aColorIndex + 1]; + public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing, + final byte aColorIndex, final boolean aActive, final boolean aRedstone) { + return this.mTextures[(aSide == aFacing ? 0 + : aSide == GT_Utility.getOppositeSide(aFacing) ? 1 : aSide == 0 ? 2 : aSide == 1 ? 3 : 4)][aColorIndex + + 1]; } public ITexture[] getFront(final byte aColor) { - return new ITexture[] {new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Screen_3)}; + return new ITexture[] { new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Screen_3) }; } public ITexture[] getSides(final byte aColor) { - return new ITexture[] {new GT_RenderedTexture(TexturesGtBlock.Casing_Computer_Cube)}; + return new ITexture[] { new GT_RenderedTexture(TexturesGtBlock.Casing_Computer_Cube) }; } - protected static final int DID_NOT_FIND_RECIPE = 0, - FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS = 1, + protected static final int DID_NOT_FIND_RECIPE = 0, FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS = 1, FOUND_AND_SUCCESSFULLY_USED_RECIPE = 2; /** * Calcualtes overclocked ness using long integers - * @param aEUt - recipe EUt - * @param aDuration - recipe Duration + * + * @param aEUt - recipe EUt + * @param aDuration - recipe Duration */ protected void calculateOverclockedNess(int aEUt, int aDuration) { if (mTier == 0) { @@ -935,9 +837,8 @@ public class GT_TileEntity_ComputerCube extends GT_MetaTileEntity_BasicTank impl tempEUt <<= 2; // this actually controls overclocking // xEUt *= 4;//this is effect of everclocking mMaxProgress >>= 1; // this is effect of overclocking - xEUt = mMaxProgress == 0 - ? xEUt >> 1 - : xEUt << 2; // U know, if the time is less than 1 tick make the machine use 2x less power + xEUt = mMaxProgress == 0 ? xEUt >> 1 : xEUt << 2; // U know, if the time is less than 1 tick make the + // machine use 2x less power } if (xEUt > Integer.MAX_VALUE - 1) { mEU = Integer.MAX_VALUE - 1; @@ -991,8 +892,7 @@ public class GT_TileEntity_ComputerCube extends GT_MetaTileEntity_BasicTank impl return 2; } ItemData tData = GT_OreDictUnificator.getAssociation(aStack); - if ((tData != null) - && ((tData.mPrefix == OrePrefixes.dust) || (tData.mPrefix == OrePrefixes.cell)) + if ((tData != null) && ((tData.mPrefix == OrePrefixes.dust) || (tData.mPrefix == OrePrefixes.cell)) && (tData.mMaterial.mMaterial.mElement != null) && (!tData.mMaterial.mMaterial.mElement.mIsIsotope) && (tData.mMaterial.mMaterial != Materials.Magic) @@ -1038,8 +938,11 @@ public class GT_TileEntity_ComputerCube extends GT_MetaTileEntity_BasicTank impl aStack.stackSize -= 1; this.mInventory[57] = GT_Utility.copyAmount(1L, getSpecialSlot()); - this.mInventory[57].setTagCompound(GT_Utility.getNBTContainingShort( - new NBTTagCompound(), "map_id", (short) aStack.getItemDamage())); + this.mInventory[57].setTagCompound( + GT_Utility.getNBTContainingShort( + new NBTTagCompound(), + "map_id", + (short) aStack.getItemDamage())); calculateOverclockedNess(30, 128); // In case recipe is too OP for that machine if (mMaxProgress == Integer.MAX_VALUE - 1 && mEU == Integer.MAX_VALUE - 1) @@ -1134,361 +1037,306 @@ public class GT_TileEntity_ComputerCube extends GT_MetaTileEntity_BasicTank impl break; } - builder.widget(new ButtonWidget() - .setOnClick((clickData, widget) -> { - if (clickData.mouseButton == 0) { - switchModeForward(); - } else if (clickData.mouseButton == 1) { - switchModeBackward(); - } - if (!widget.isClient()) { - GT_UIInfos.openGTTileEntityUI( - getBaseMetaTileEntity(), widget.getContext().getPlayer()); - } - }) - .setBackground(GTPP_UITextures.BUTTON_STANDARD_16x16, GTPP_UITextures.OVERLAY_BUTTON_COMPUTER_MODE) - .setPos(156 + (mMode == 5 ? 50 : 0), 4) - .setSize(16, 16)); + builder.widget(new ButtonWidget().setOnClick((clickData, widget) -> { + if (clickData.mouseButton == 0) { + switchModeForward(); + } else if (clickData.mouseButton == 1) { + switchModeBackward(); + } + if (!widget.isClient()) { + GT_UIInfos.openGTTileEntityUI(getBaseMetaTileEntity(), widget.getContext().getPlayer()); + } + }).setBackground(GTPP_UITextures.BUTTON_STANDARD_16x16, GTPP_UITextures.OVERLAY_BUTTON_COMPUTER_MODE) + .setPos(156 + (mMode == 5 ? 50 : 0), 4).setSize(16, 16)); } private void addPage0(ModularWindow.Builder builder) { - builder.widget(new DrawableWidget() - .setDrawable(GTPP_UITextures.PICTURE_COMPUTER_TOP) - .setPos(32, 4) - .setSize(112, 76)) - .widget(new ProgressBar() - .setProgress(() -> (float) getBaseMetaTileEntity().getStoredEU() - / getBaseMetaTileEntity().getEUCapacity()) - .setTexture(GTPP_UITextures.PROGRESSBAR_COMPUTER_ENERGY, 96) - .setDirection(ProgressBar.Direction.RIGHT) - .setPos(44, 8) - .setSize(96, 5)) - .widget(new TextWidget("Solaris 1.7.10") - .setDefaultColor(Utils.rgbtoHexValue(100, 190, 255)) - .setPos(56, 70)); + builder.widget( + new DrawableWidget().setDrawable(GTPP_UITextures.PICTURE_COMPUTER_TOP).setPos(32, 4).setSize(112, 76)) + .widget( + new ProgressBar() + .setProgress( + () -> (float) getBaseMetaTileEntity().getStoredEU() + / getBaseMetaTileEntity().getEUCapacity()) + .setTexture(GTPP_UITextures.PROGRESSBAR_COMPUTER_ENERGY, 96) + .setDirection(ProgressBar.Direction.RIGHT).setPos(44, 8).setSize(96, 5)) + .widget( + new TextWidget("Solaris 1.7.10").setDefaultColor(Utils.rgbtoHexValue(100, 190, 255)) + .setPos(56, 70)); } private void addPage1(ModularWindow.Builder builder) { - builder.widget(new DrawableWidget() - .setDrawable(GT_UITextures.PICTURE_SCREEN_BLACK) - .setPos(4, 103) - .setSize(150, 59)) - .widget(new DrawableWidget() - .setDrawable(ModularUITextures.ITEM_SLOT) - .setPos(4, 4) - .setSize(146, 98)) - .widget(new DrawableWidget() - .setDrawable(GTPP_UITextures.PICTURE_V202) - .setPos(155, 103) - .setSize(17, 5)) - .widget(new ButtonWidget() - .setOnClick((clickData, widget) -> saveNuclearReactor()) - .setBackground(GTPP_UITextures.BUTTON_STANDARD_16x16, GTPP_UITextures.OVERLAY_BUTTON_SAVE) - .setPos(156, 54) - .setSize(16, 16)) - .widget(new ButtonWidget() - .setOnClick((clickData, widget) -> loadNuclearReactor()) - .setBackground(GTPP_UITextures.BUTTON_STANDARD_16x16, GTPP_UITextures.OVERLAY_BUTTON_LOAD) - .setPos(156, 70) - .setSize(16, 16)) - .widget(new ButtonWidget() - .setOnClick((clickData, widget) -> switchNuclearReactor()) - .setBackground( - GTPP_UITextures.BUTTON_STANDARD_16x16, GTPP_UITextures.OVERLAY_BUTTON_NUCLEAR_SWITCH) - .setPos(156, 86) - .setSize(16, 16)); + builder.widget( + new DrawableWidget().setDrawable(GT_UITextures.PICTURE_SCREEN_BLACK).setPos(4, 103).setSize(150, 59)) + .widget(new DrawableWidget().setDrawable(ModularUITextures.ITEM_SLOT).setPos(4, 4).setSize(146, 98)) + .widget(new DrawableWidget().setDrawable(GTPP_UITextures.PICTURE_V202).setPos(155, 103).setSize(17, 5)) + .widget( + new ButtonWidget().setOnClick((clickData, widget) -> saveNuclearReactor()) + .setBackground( + GTPP_UITextures.BUTTON_STANDARD_16x16, + GTPP_UITextures.OVERLAY_BUTTON_SAVE) + .setPos(156, 54).setSize(16, 16)) + .widget( + new ButtonWidget().setOnClick((clickData, widget) -> loadNuclearReactor()) + .setBackground( + GTPP_UITextures.BUTTON_STANDARD_16x16, + GTPP_UITextures.OVERLAY_BUTTON_LOAD) + .setPos(156, 70).setSize(16, 16)) + .widget( + new ButtonWidget().setOnClick((clickData, widget) -> switchNuclearReactor()) + .setBackground( + GTPP_UITextures.BUTTON_STANDARD_16x16, + GTPP_UITextures.OVERLAY_BUTTON_NUCLEAR_SWITCH) + .setPos(156, 86).setSize(16, 16)); SlotWidget displaySlot = new NuclearSlotWidget(inventoryHandler, 54, null); for (int i = 0; i < 9 * 6; i++) { - builder.widget(new NuclearSlotWidget(inventoryHandler, i, displaySlot.getMcSlot()) - .setBackground(GT_UITextures.TRANSPARENT) - .setPos(5 + (i % 9) * 16, 5 + (i / 9) * 16)); - } - builder.widget(displaySlot - .setBackground(getGUITextureSet().getItemSlot(), GTPP_UITextures.OVERLAY_SLOT_ARROW_4) - .setPos(152, 27)); - builder.widget(new TextWidget("Reactorstats:") - .setDefaultColor(COLOR_TEXT_WHITE.get()) - .setPos(7, 108)) - .widget(TextWidget.dynamicString(() -> GT_Utility.formatNumbers(mEU) + "EU at " + mEUOut + "EU/t") - .setDefaultColor(COLOR_TEXT_WHITE.get()) - .setPos(7, 120)) - .widget(TextWidget.dynamicString(() -> "HEM: " + (mHEM / 10000.0F)) - .setDefaultColor(COLOR_TEXT_WHITE.get()) - .setPos(7, 128)) - .widget(TextWidget.dynamicString(() -> - GT_Utility.formatNumbers(mHeat) + "/" + GT_Utility.formatNumbers(mMaxHeat) + "Heat") - .setDefaultColor(COLOR_TEXT_WHITE.get()) - .setPos(7, 136)) - .widget(TextWidget.dynamicString(() -> "Explosionpower: " + (mExplosionStrength / 100.0F)) - .setDefaultColor(COLOR_TEXT_WHITE.get()) - .setPos(7, 144)) - .widget(TextWidget.dynamicString(() -> "Runtime: " + ((mProgress > 0) ? (mProgress / 20) : 0) + "secs") - .setDefaultColor(COLOR_TEXT_WHITE.get()) - .setPos(7, 152)); + builder.widget( + new NuclearSlotWidget(inventoryHandler, i, displaySlot.getMcSlot()) + .setBackground(GT_UITextures.TRANSPARENT).setPos(5 + (i % 9) * 16, 5 + (i / 9) * 16)); + } + builder.widget( + displaySlot.setBackground(getGUITextureSet().getItemSlot(), GTPP_UITextures.OVERLAY_SLOT_ARROW_4) + .setPos(152, 27)); + builder.widget(new TextWidget("Reactorstats:").setDefaultColor(COLOR_TEXT_WHITE.get()).setPos(7, 108)) + .widget( + TextWidget.dynamicString(() -> GT_Utility.formatNumbers(mEU) + "EU at " + mEUOut + "EU/t") + .setDefaultColor(COLOR_TEXT_WHITE.get()).setPos(7, 120)) + .widget( + TextWidget.dynamicString(() -> "HEM: " + (mHEM / 10000.0F)) + .setDefaultColor(COLOR_TEXT_WHITE.get()).setPos(7, 128)) + .widget( + TextWidget.dynamicString( + () -> GT_Utility.formatNumbers(mHeat) + "/" + + GT_Utility.formatNumbers(mMaxHeat) + + "Heat") + .setDefaultColor(COLOR_TEXT_WHITE.get()).setPos(7, 136)) + .widget( + TextWidget.dynamicString(() -> "Explosionpower: " + (mExplosionStrength / 100.0F)) + .setDefaultColor(COLOR_TEXT_WHITE.get()).setPos(7, 144)) + .widget( + TextWidget.dynamicString(() -> "Runtime: " + ((mProgress > 0) ? (mProgress / 20) : 0) + "secs") + .setDefaultColor(COLOR_TEXT_WHITE.get()).setPos(7, 152)); } private void addPage2(ModularWindow.Builder builder) { - builder.widget(new DrawableWidget() - .setDrawable(GT_UITextures.PICTURE_SCREEN_BLACK) - .setPos(48, 4) - .setSize(81, 67)); + builder.widget( + new DrawableWidget().setDrawable(GT_UITextures.PICTURE_SCREEN_BLACK).setPos(48, 4).setSize(81, 67)); builder.widget(new DataStickSlotWidget(inventoryHandler, 54).setPos(7, 27)) - .widget(new SlotWidget(inventoryHandler, 55) - .setBackground(getGUITextureSet().getItemSlot(), GT_UITextures.OVERLAY_SLOT_MICROSCOPE) - .setPos(25, 27)) - .widget(new SlotWidget(inventoryHandler, 56) - .setAccess(true, false) - .setPos(133, 27)) - .widget(new SlotWidget(inventoryHandler, 57) - .setAccess(true, false) - .setPos(151, 27)); - builder.widget(new TextWidget("Scanner") - .setDefaultColor(COLOR_TEXT_WHITE.get()) - .setEnabled(widget -> mProgress == 0) + .widget( + new SlotWidget(inventoryHandler, 55) + .setBackground(getGUITextureSet().getItemSlot(), GT_UITextures.OVERLAY_SLOT_MICROSCOPE) + .setPos(25, 27)) + .widget(new SlotWidget(inventoryHandler, 56).setAccess(true, false).setPos(133, 27)) + .widget(new SlotWidget(inventoryHandler, 57).setAccess(true, false).setPos(151, 27)); + builder.widget( + new TextWidget("Scanner").setDefaultColor(COLOR_TEXT_WHITE.get()).setEnabled(widget -> mProgress == 0) .setPos(51, 7)) - .widget(new TextWidget("Can be used to") - .setDefaultColor(COLOR_TEXT_WHITE.get()) - .setEnabled(widget -> mProgress == 0) - .setPos(51, 24)) - .widget(new TextWidget("scan things") - .setDefaultColor(COLOR_TEXT_WHITE.get()) - .setEnabled(widget -> mProgress == 0) - .setPos(51, 32)) - .widget(new TextWidget("Currently") - .setDefaultColor(Utils.rgbtoHexValue(200, 20, 20)) - .setEnabled(widget -> mProgress == 0) - .setPos(51, 48)) - .widget(new TextWidget("Disabled") - .setDefaultColor(Utils.rgbtoHexValue(200, 20, 20)) - .setEnabled(widget -> mProgress == 0) - .setPos(51, 56)) - .widget(new TextWidget("Progress:") - .setDefaultColor(COLOR_TEXT_WHITE.get()) - .setEnabled(widget -> mProgress != 0) - .setPos(51, 24)) - .widget(TextWidget.dynamicString(() -> MathUtils.findPercentage( - mProgress, getBaseMetaTileEntity().getMaxProgress()) - + " %") - .setDefaultColor(COLOR_TEXT_WHITE.get()) - .setEnabled(widget -> mProgress != 0) - .setPos(51, 32)) + .widget( + new TextWidget("Can be used to").setDefaultColor(COLOR_TEXT_WHITE.get()) + .setEnabled(widget -> mProgress == 0).setPos(51, 24)) + .widget( + new TextWidget("scan things").setDefaultColor(COLOR_TEXT_WHITE.get()) + .setEnabled(widget -> mProgress == 0).setPos(51, 32)) + .widget( + new TextWidget("Currently").setDefaultColor(Utils.rgbtoHexValue(200, 20, 20)) + .setEnabled(widget -> mProgress == 0).setPos(51, 48)) + .widget( + new TextWidget("Disabled").setDefaultColor(Utils.rgbtoHexValue(200, 20, 20)) + .setEnabled(widget -> mProgress == 0).setPos(51, 56)) + .widget( + new TextWidget("Progress:") + .setDefaultColor(COLOR_TEXT_WHITE.get()).setEnabled( + widget -> mProgress != 0) + .setPos(51, 24)) + .widget( + TextWidget.dynamicString( + () -> MathUtils.findPercentage(mProgress, getBaseMetaTileEntity().getMaxProgress()) + + " %") + .setDefaultColor(COLOR_TEXT_WHITE.get()).setEnabled(widget -> mProgress != 0) + .setPos(51, 32)) .widget(new FakeSyncWidget.IntegerSyncer(() -> mProgress, val -> mProgress = val)); } private void addPage3(ModularWindow.Builder builder) { - builder.widget(new DrawableWidget() - .setDrawable(GT_UITextures.PICTURE_SCREEN_BLACK) - .setPos(4, 4) - .setSize(86, 41)) - .widget(new DrawableWidget() - .setDrawable(GTPP_UITextures.PICTURE_ARROWS_SEPARATE) - .setPos(110, 23) - .setSize(40, 40)) - .widget(new ButtonWidget() - .setOnClick((clickData, widget) -> switchCentrifugePageBackward()) - .setBackground(GTPP_UITextures.BUTTON_STANDARD_16x16, GTPP_UITextures.OVERLAY_BUTTON_ARROW_LEFT) - .setPos(88, 65) - .setSize(16, 16)) - .widget(new ButtonWidget() - .setOnClick((clickData, widget) -> switchCentrifugePageForward()) - .setBackground( - GTPP_UITextures.BUTTON_STANDARD_16x16, GTPP_UITextures.OVERLAY_BUTTON_ARROW_RIGHT) - .setPos(104, 65) - .setSize(16, 16)) - .widget(SlotWidget.phantom(inventoryHandler, 59) - .disableInteraction() - .setBackground(getGUITextureSet().getItemSlot(), GT_UITextures.OVERLAY_SLOT_CENTRIFUGE) - .setPos(121, 34)) - .widget(SlotWidget.phantom(inventoryHandler, 60) - .disableInteraction() - .setBackground(getGUITextureSet().getItemSlot(), GT_UITextures.OVERLAY_SLOT_CANISTER) - .setPos(91, 4)) - .widget(SlotWidget.phantom(inventoryHandler, 61) - .disableInteraction() - .setPos(121, 4)) - .widget(SlotWidget.phantom(inventoryHandler, 62) - .disableInteraction() - .setPos(151, 34)) - .widget(SlotWidget.phantom(inventoryHandler, 63) - .disableInteraction() - .setPos(121, 64)) - .widget(SlotWidget.phantom(inventoryHandler, 64) - .disableInteraction() - .setPos(91, 34)) - .widget(new TextWidget("Centrifuge") - .setDefaultColor(COLOR_TEXT_WHITE.get()) - .setPos(7, 7)) - .widget(TextWidget.dynamicString(() -> - "Recipe: " + (mMaxHeat + 1) + "/" + GT_Recipe_Map.sCentrifugeRecipes.mRecipeList.size()) - .setDefaultColor(COLOR_TEXT_WHITE.get()) - .setPos(7, 23)) - .widget(TextWidget.dynamicString(() -> "EU: " + GT_Utility.formatNumbers(mEU)) - .setDefaultColor(COLOR_TEXT_WHITE.get()) - .setPos(7, 31)); + builder.widget( + new DrawableWidget().setDrawable(GT_UITextures.PICTURE_SCREEN_BLACK).setPos(4, 4).setSize(86, 41)) + .widget( + new DrawableWidget().setDrawable(GTPP_UITextures.PICTURE_ARROWS_SEPARATE).setPos(110, 23) + .setSize(40, 40)) + .widget( + new ButtonWidget().setOnClick((clickData, widget) -> switchCentrifugePageBackward()) + .setBackground( + GTPP_UITextures.BUTTON_STANDARD_16x16, + GTPP_UITextures.OVERLAY_BUTTON_ARROW_LEFT) + .setPos(88, 65).setSize(16, 16)) + .widget( + new ButtonWidget().setOnClick((clickData, widget) -> switchCentrifugePageForward()) + .setBackground( + GTPP_UITextures.BUTTON_STANDARD_16x16, + GTPP_UITextures.OVERLAY_BUTTON_ARROW_RIGHT) + .setPos(104, 65).setSize(16, 16)) + .widget( + SlotWidget.phantom(inventoryHandler, 59).disableInteraction() + .setBackground(getGUITextureSet().getItemSlot(), GT_UITextures.OVERLAY_SLOT_CENTRIFUGE) + .setPos(121, 34)) + .widget( + SlotWidget.phantom(inventoryHandler, 60).disableInteraction() + .setBackground(getGUITextureSet().getItemSlot(), GT_UITextures.OVERLAY_SLOT_CANISTER) + .setPos(91, 4)) + .widget(SlotWidget.phantom(inventoryHandler, 61).disableInteraction().setPos(121, 4)) + .widget(SlotWidget.phantom(inventoryHandler, 62).disableInteraction().setPos(151, 34)) + .widget(SlotWidget.phantom(inventoryHandler, 63).disableInteraction().setPos(121, 64)) + .widget(SlotWidget.phantom(inventoryHandler, 64).disableInteraction().setPos(91, 34)) + .widget(new TextWidget("Centrifuge").setDefaultColor(COLOR_TEXT_WHITE.get()).setPos(7, 7)) + .widget( + TextWidget + .dynamicString( + () -> "Recipe: " + (mMaxHeat + 1) + + "/" + + GT_Recipe_Map.sCentrifugeRecipes.mRecipeList.size()) + .setDefaultColor(COLOR_TEXT_WHITE.get()).setPos(7, 23)) + .widget( + TextWidget.dynamicString(() -> "EU: " + GT_Utility.formatNumbers(mEU)) + .setDefaultColor(COLOR_TEXT_WHITE.get()).setPos(7, 31)); } private void addPage4(ModularWindow.Builder builder) { - builder.widget(new DrawableWidget() - .setDrawable(GT_UITextures.PICTURE_SCREEN_BLACK) - .setPos(4, 4) - .setSize(116, 61)) - .widget(new DrawableWidget() - .setDrawable(GTPP_UITextures.PICTURE_ARROWS_FUSION) - .setPos(121, 23) - .setSize(29, 40)) - .widget(new ButtonWidget() - .setOnClick((clickData, widget) -> switchFusionPageBackward()) - .setBackground(GTPP_UITextures.BUTTON_STANDARD_16x16, GTPP_UITextures.OVERLAY_BUTTON_ARROW_LEFT) - .setPos(88, 65) - .setSize(16, 16)) - .widget(new ButtonWidget() - .setOnClick((clickData, widget) -> switchFusionPageForward()) - .setBackground( - GTPP_UITextures.BUTTON_STANDARD_16x16, GTPP_UITextures.OVERLAY_BUTTON_ARROW_RIGHT) - .setPos(104, 65) - .setSize(16, 16)) - .widget(SlotWidget.phantom(inventoryHandler, 59) - .disableInteraction() - .setPos(121, 4)) - .widget(SlotWidget.phantom(inventoryHandler, 60) - .disableInteraction() - .setPos(121, 64)) - .widget(SlotWidget.phantom(inventoryHandler, 61) - .disableInteraction() - .setPos(151, 34)) - .widget(new TextWidget("Fusionreactor") - .setDefaultColor(COLOR_TEXT_WHITE.get()) - .setPos(7, 7)) - .widget(TextWidget.dynamicString(() -> "Recipe: " + (mMaxHeat + 1) + "/" - + GT_TileEntity_ComputerCube.sFusionReactorRecipes.size()) - .setDefaultColor(COLOR_TEXT_WHITE.get()) - .setPos(7, 15)) - .widget(TextWidget.dynamicString(() -> "Start: " + GT_Utility.formatNumbers(mEU) + "EU") - .setDefaultColor(COLOR_TEXT_WHITE.get()) - .setPos(7, 23)) - .widget(TextWidget.dynamicString(() -> "EU/t: " + GT_Utility.formatNumbers(mEUOut)) - .setDefaultColor(COLOR_TEXT_WHITE.get()) - .setPos(7, 31)) - .widget(TextWidget.dynamicString(() -> GT_Utility.formatNumbers(mHeat) + " Ticks") - .setDefaultColor(COLOR_TEXT_WHITE.get()) - .setPos(7, 39)) - .widget(TextWidget.dynamicString(() -> GT_TileEntity_ComputerCube.sFusionReactorRecipes - .get(mMaxHeat) - .mFluidOutputs[0] - .getLocalizedName()) - .setDefaultColor(COLOR_TEXT_WHITE.get()) - .setPos(7, 55)) - .widget(TextWidget.dynamicString(() -> mEUOut < 0 - ? "IN: " + GT_Utility.formatNumbers(-mEUOut * mHeat) + "EU" - : "OUT: " + GT_Utility.formatNumbers(mEUOut * mHeat) + "EU") - .setDefaultColor(COLOR_TEXT_WHITE.get()) - .setPos(7, 47)); + builder.widget( + new DrawableWidget().setDrawable(GT_UITextures.PICTURE_SCREEN_BLACK).setPos(4, 4).setSize(116, 61)) + .widget( + new DrawableWidget().setDrawable(GTPP_UITextures.PICTURE_ARROWS_FUSION).setPos(121, 23) + .setSize(29, 40)) + .widget( + new ButtonWidget().setOnClick((clickData, widget) -> switchFusionPageBackward()) + .setBackground( + GTPP_UITextures.BUTTON_STANDARD_16x16, + GTPP_UITextures.OVERLAY_BUTTON_ARROW_LEFT) + .setPos(88, 65).setSize(16, 16)) + .widget( + new ButtonWidget().setOnClick((clickData, widget) -> switchFusionPageForward()) + .setBackground( + GTPP_UITextures.BUTTON_STANDARD_16x16, + GTPP_UITextures.OVERLAY_BUTTON_ARROW_RIGHT) + .setPos(104, 65).setSize(16, 16)) + .widget(SlotWidget.phantom(inventoryHandler, 59).disableInteraction().setPos(121, 4)) + .widget(SlotWidget.phantom(inventoryHandler, 60).disableInteraction().setPos(121, 64)) + .widget(SlotWidget.phantom(inventoryHandler, 61).disableInteraction().setPos(151, 34)) + .widget(new TextWidget("Fusionreactor").setDefaultColor(COLOR_TEXT_WHITE.get()).setPos(7, 7)) + .widget( + TextWidget + .dynamicString( + () -> "Recipe: " + (mMaxHeat + 1) + + "/" + + GT_TileEntity_ComputerCube.sFusionReactorRecipes.size()) + .setDefaultColor(COLOR_TEXT_WHITE.get()).setPos(7, 15)) + .widget( + TextWidget.dynamicString(() -> "Start: " + GT_Utility.formatNumbers(mEU) + "EU") + .setDefaultColor(COLOR_TEXT_WHITE.get()).setPos(7, 23)) + .widget( + TextWidget.dynamicString(() -> "EU/t: " + GT_Utility.formatNumbers(mEUOut)) + .setDefaultColor(COLOR_TEXT_WHITE.get()).setPos(7, 31)) + .widget( + TextWidget.dynamicString(() -> GT_Utility.formatNumbers(mHeat) + " Ticks") + .setDefaultColor(COLOR_TEXT_WHITE.get()).setPos(7, 39)) + .widget( + TextWidget.dynamicString( + () -> GT_TileEntity_ComputerCube.sFusionReactorRecipes.get(mMaxHeat).mFluidOutputs[0] + .getLocalizedName()) + .setDefaultColor(COLOR_TEXT_WHITE.get()).setPos(7, 55)) + .widget( + TextWidget + .dynamicString( + () -> mEUOut < 0 ? "IN: " + GT_Utility.formatNumbers(-mEUOut * mHeat) + "EU" + : "OUT: " + GT_Utility.formatNumbers(mEUOut * mHeat) + "EU") + .setDefaultColor(COLOR_TEXT_WHITE.get()).setPos(7, 47)); } private void addPage5(ModularWindow.Builder builder) { - builder.widget(new DrawableWidget() - .setDrawable(GT_UITextures.PICTURE_SCREEN_BLACK) - .setPos(4, 4) - .setSize(200, 141)) - .widget(new DrawableWidget() - .setDrawable(() -> mExplosionStrength != 0 ? GTPP_UITextures.PICTURE_COMPUTER_GRID : null) - .setPos(152, 6) - .setSize(50, 50)) - .widget(new ButtonWidget() - .setOnClick((clickData, widget) -> switchDescriptionPageBackward()) - .setBackground(GTPP_UITextures.BUTTON_STANDARD_16x16, GTPP_UITextures.OVERLAY_BUTTON_ARROW_LEFT) - .setPos(190, 146) - .setSize(16, 16)) - .widget(new ButtonWidget() - .setOnClick((clickData, widget) -> switchDescriptionPageForward()) - .setBackground( - GTPP_UITextures.BUTTON_STANDARD_16x16, GTPP_UITextures.OVERLAY_BUTTON_ARROW_RIGHT) - .setPos(206, 146) - .setSize(16, 16)); + builder.widget( + new DrawableWidget().setDrawable(GT_UITextures.PICTURE_SCREEN_BLACK).setPos(4, 4).setSize(200, 141)) + .widget( + new DrawableWidget() + .setDrawable( + () -> mExplosionStrength != 0 ? GTPP_UITextures.PICTURE_COMPUTER_GRID : null) + .setPos(152, 6).setSize(50, 50)) + .widget( + new ButtonWidget().setOnClick((clickData, widget) -> switchDescriptionPageBackward()) + .setBackground( + GTPP_UITextures.BUTTON_STANDARD_16x16, + GTPP_UITextures.OVERLAY_BUTTON_ARROW_LEFT) + .setPos(190, 146).setSize(16, 16)) + .widget( + new ButtonWidget().setOnClick((clickData, widget) -> switchDescriptionPageForward()) + .setBackground( + GTPP_UITextures.BUTTON_STANDARD_16x16, + GTPP_UITextures.OVERLAY_BUTTON_ARROW_RIGHT) + .setPos(206, 146).setSize(16, 16)); for (int i = 0; i < 5; i++) { - builder.widget(SlotWidget.phantom(inventoryHandler, i + 59) - .disableInteraction() - .setPos(205, 37 + i * 18)); + builder.widget(SlotWidget.phantom(inventoryHandler, i + 59).disableInteraction().setPos(205, 37 + i * 18)); } for (int i = 0; i < 9; i++) { - builder.widget(SlotWidget.phantom(inventoryHandler, i + 64) - .disableInteraction() - .setBackground(GT_UITextures.TRANSPARENT) - .setPos(152 + (i % 3) * 16, 6 + (i / 3) * 16)); + builder.widget( + SlotWidget.phantom(inventoryHandler, i + 64).disableInteraction() + .setBackground(GT_UITextures.TRANSPARENT).setPos(152 + (i % 3) * 16, 6 + (i / 3) * 16)); } int descriptionMaxLines = GT_Computercube_Description.sDescriptions.stream() - .sorted((d1, d2) -> d2.mDescription.length - d1.mDescription.length) - .collect(Collectors.toList()) - .get(0) - .mDescription - .length; + .sorted((d1, d2) -> d2.mDescription.length - d1.mDescription.length).collect(Collectors.toList()) + .get(0).mDescription.length; for (int i = 0; i < descriptionMaxLines; i++) { final int index = i; builder.widget(TextWidget.dynamicString(() -> { - if (mMaxHeat >= 0 && mMaxHeat < GT_Computercube_Description.sDescriptions.size()) { - String[] descriptions = - GT_Computercube_Description.sDescriptions.get(mMaxHeat).mDescription; - if (index < descriptions.length) { - return descriptions[index]; - } - } - return ""; - }) - .setDefaultColor(COLOR_TEXT_WHITE.get()) - .setPos(7, 7 + index * 8)); + if (mMaxHeat >= 0 && mMaxHeat < GT_Computercube_Description.sDescriptions.size()) { + String[] descriptions = GT_Computercube_Description.sDescriptions.get(mMaxHeat).mDescription; + if (index < descriptions.length) { + return descriptions[index]; + } + } + return ""; + }).setDefaultColor(COLOR_TEXT_WHITE.get()).setPos(7, 7 + index * 8)); } } private void addPage6(ModularWindow.Builder builder) { - builder.widget(new DrawableWidget() - .setDrawable(GT_UITextures.PICTURE_SCREEN_BLACK) - .setPos(4, 4) - .setSize(86, 41)) - .widget(new DrawableWidget() - .setDrawable(GTPP_UITextures.PICTURE_ARROWS_SEPARATE) - .setPos(110, 23) - .setSize(40, 40)) - .widget(new ButtonWidget() - .setOnClick((clickData, widget) -> switchElectrolyzerPageBackward()) - .setBackground(GTPP_UITextures.BUTTON_STANDARD_16x16, GTPP_UITextures.OVERLAY_BUTTON_ARROW_LEFT) - .setPos(88, 65) - .setSize(16, 16)) - .widget(new ButtonWidget() - .setOnClick((clickData, widget) -> switchElectrolyzerPageForward()) - .setBackground( - GTPP_UITextures.BUTTON_STANDARD_16x16, GTPP_UITextures.OVERLAY_BUTTON_ARROW_RIGHT) - .setPos(104, 65) - .setSize(16, 16)) - .widget(SlotWidget.phantom(inventoryHandler, 59) - .disableInteraction() - .setBackground(getGUITextureSet().getItemSlot(), GT_UITextures.OVERLAY_SLOT_CHARGER) - .setPos(121, 34)) - .widget(SlotWidget.phantom(inventoryHandler, 60) - .disableInteraction() - .setBackground(getGUITextureSet().getItemSlot(), GT_UITextures.OVERLAY_SLOT_CANISTER) - .setPos(91, 4)) - .widget(SlotWidget.phantom(inventoryHandler, 61) - .disableInteraction() - .setPos(121, 4)) - .widget(SlotWidget.phantom(inventoryHandler, 62) - .disableInteraction() - .setPos(151, 34)) - .widget(SlotWidget.phantom(inventoryHandler, 63) - .disableInteraction() - .setPos(121, 64)) - .widget(SlotWidget.phantom(inventoryHandler, 64) - .disableInteraction() - .setPos(91, 34)) - .widget(new TextWidget("Electrolyzer") - .setDefaultColor(COLOR_TEXT_WHITE.get()) - .setPos(7, 7)) - .widget(TextWidget.dynamicString(() -> "Recipe: " + (mMaxHeat + 1) + "/" - + GT_Recipe_Map.sElectrolyzerRecipes.mRecipeList.size()) - .setDefaultColor(COLOR_TEXT_WHITE.get()) - .setPos(7, 23)) - .widget(TextWidget.dynamicString(() -> "EU: " + GT_Utility.formatNumbers(mEU)) - .setDefaultColor(COLOR_TEXT_WHITE.get()) - .setPos(7, 31)); + builder.widget( + new DrawableWidget().setDrawable(GT_UITextures.PICTURE_SCREEN_BLACK).setPos(4, 4).setSize(86, 41)) + .widget( + new DrawableWidget().setDrawable(GTPP_UITextures.PICTURE_ARROWS_SEPARATE).setPos(110, 23) + .setSize(40, 40)) + .widget( + new ButtonWidget().setOnClick((clickData, widget) -> switchElectrolyzerPageBackward()) + .setBackground( + GTPP_UITextures.BUTTON_STANDARD_16x16, + GTPP_UITextures.OVERLAY_BUTTON_ARROW_LEFT) + .setPos(88, 65).setSize(16, 16)) + .widget( + new ButtonWidget().setOnClick((clickData, widget) -> switchElectrolyzerPageForward()) + .setBackground( + GTPP_UITextures.BUTTON_STANDARD_16x16, + GTPP_UITextures.OVERLAY_BUTTON_ARROW_RIGHT) + .setPos(104, 65).setSize(16, 16)) + .widget( + SlotWidget.phantom(inventoryHandler, 59).disableInteraction() + .setBackground(getGUITextureSet().getItemSlot(), GT_UITextures.OVERLAY_SLOT_CHARGER) + .setPos(121, 34)) + .widget( + SlotWidget.phantom(inventoryHandler, 60).disableInteraction() + .setBackground(getGUITextureSet().getItemSlot(), GT_UITextures.OVERLAY_SLOT_CANISTER) + .setPos(91, 4)) + .widget(SlotWidget.phantom(inventoryHandler, 61).disableInteraction().setPos(121, 4)) + .widget(SlotWidget.phantom(inventoryHandler, 62).disableInteraction().setPos(151, 34)) + .widget(SlotWidget.phantom(inventoryHandler, 63).disableInteraction().setPos(121, 64)) + .widget(SlotWidget.phantom(inventoryHandler, 64).disableInteraction().setPos(91, 34)) + .widget(new TextWidget("Electrolyzer").setDefaultColor(COLOR_TEXT_WHITE.get()).setPos(7, 7)) + .widget( + TextWidget + .dynamicString( + () -> "Recipe: " + (mMaxHeat + 1) + + "/" + + GT_Recipe_Map.sElectrolyzerRecipes.mRecipeList.size()) + .setDefaultColor(COLOR_TEXT_WHITE.get()).setPos(7, 23)) + .widget( + TextWidget.dynamicString(() -> "EU: " + GT_Utility.formatNumbers(mEU)) + .setDefaultColor(COLOR_TEXT_WHITE.get()).setPos(7, 31)); } private class NuclearSlotWidget extends SlotWidget { @@ -1521,10 +1369,7 @@ public class GT_TileEntity_ComputerCube extends GT_MetaTileEntity_BasicTank impl if (tStack == null) { if (displaySlot.getStack() != null && aSlotIndex != 58) { tSlot.putStack(displaySlot.getStack().copy()); - getSimulator() - .slotClick( - aSlotIndex, - new GT_ItemStack(displaySlot.getStack().copy())); + getSimulator().slotClick(aSlotIndex, new GT_ItemStack(displaySlot.getStack().copy())); } else { tSlot.putStack(new ItemStack(GT_TileEntity_ComputerCube.sReactorList.get(0).mItem, 1)); getSimulator().slotClick(aSlotIndex, GT_TileEntity_ComputerCube.sReactorList.get(0)); @@ -1535,9 +1380,11 @@ public class GT_TileEntity_ComputerCube extends GT_MetaTileEntity_BasicTank impl if (GT_TileEntity_ComputerCube.sReactorList.get(i - 1).mItem == tStack.getItem()) { tSlot.putStack(new ItemStack(GT_TileEntity_ComputerCube.sReactorList.get(i).mItem, 1, 0)); getSimulator().slotClick(aSlotIndex, GT_TileEntity_ComputerCube.sReactorList.get(i)); - /*if (tSlot.getStack() != null && tSlot.getStack().getItem() == GT_ModHandler.getIC2Item("reactorIsotopeCell", 1).getItem()) { - tSlot.getStack().setItemDamage(tSlot.getStack().getMaxDamage() - 1); - }*/ + /* + * if (tSlot.getStack() != null && tSlot.getStack().getItem() == + * GT_ModHandler.getIC2Item("reactorIsotopeCell", 1).getItem()) { + * tSlot.getStack().setItemDamage(tSlot.getStack().getMaxDamage() - 1); } + */ return; } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/misc/TileEntitySolarHeater.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/misc/TileEntitySolarHeater.java index 5360ba612a..b690e56107 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/misc/TileEntitySolarHeater.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/misc/TileEntitySolarHeater.java @@ -1,5 +1,9 @@ package gtPlusPlus.xmod.gregtech.common.tileentities.misc; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; + import gregtech.api.enums.Textures; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; @@ -11,9 +15,6 @@ import gregtech.api.util.GT_Utility; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production.GregtechMetaTileEntity_SolarTower; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; public class TileEntitySolarHeater extends GT_MetaTileEntity_TieredMachineBlock { @@ -23,28 +24,19 @@ public class TileEntitySolarHeater extends GT_MetaTileEntity_TieredMachineBlock private int mTX, mTY, mTZ; private Byte mRequiredFacing; - public TileEntitySolarHeater( - final int aID, - final String aName, - final String aNameRegional, - final int aTier, - final String aDescription, - final int aSlotCount) { + public TileEntitySolarHeater(final int aID, final String aName, final String aNameRegional, final int aTier, + final String aDescription, final int aSlotCount) { super(aID, aName, aNameRegional, aTier, aSlotCount, aDescription); } - public TileEntitySolarHeater( - final String aName, - final int aTier, - final String aDescription, - final ITexture[][][] aTextures, - final int aSlotCount) { + public TileEntitySolarHeater(final String aName, final int aTier, final String aDescription, + final ITexture[][][] aTextures, final int aSlotCount) { super(aName, aTier, aSlotCount, aDescription, aTextures); } @Override public String[] getDescription() { - return new String[] {this.mDescription, "Point me at a Solar Tower", CORE.GT_Tooltip}; + return new String[] { this.mDescription, "Point me at a Solar Tower", CORE.GT_Tooltip }; } @Override @@ -66,79 +58,57 @@ public class TileEntitySolarHeater extends GT_MetaTileEntity_TieredMachineBlock } @Override - public ITexture[] getTexture( - final IGregTechTileEntity aBaseMetaTileEntity, - final byte aSide, - final byte aFacing, - final byte aColorIndex, - final boolean aActive, - final boolean aRedstone) { - return this.mTextures[ - (aActive ? 5 : 0) - + (aSide == aFacing - ? 0 - : aSide == GT_Utility.getOppositeSide(aFacing) - ? 1 - : aSide == 0 ? 2 : aSide == 1 ? 3 : 4)][ - aColorIndex + 1]; + public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing, + final byte aColorIndex, final boolean aActive, final boolean aRedstone) { + return this.mTextures[(aActive ? 5 : 0) + (aSide == aFacing ? 0 + : aSide == GT_Utility.getOppositeSide(aFacing) ? 1 : aSide == 0 ? 2 : aSide == 1 ? 3 : 4)][aColorIndex + + 1]; } public ITexture[] getFront(final byte aColor) { - return new ITexture[] { - new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Top), - new GT_RenderedTexture(Textures.BlockIcons.SOLARPANEL_IV) - }; + return new ITexture[] { new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Top), + new GT_RenderedTexture(Textures.BlockIcons.SOLARPANEL_IV) }; } public ITexture[] getBack(final byte aColor) { - return new ITexture[] {new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Top)}; + return new ITexture[] { new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Top) }; } public ITexture[] getBottom(final byte aColor) { - return new ITexture[] {new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom)}; + return new ITexture[] { new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom) }; } public ITexture[] getTop(final byte aColor) { - return new ITexture[] { - new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Top), - new GT_RenderedTexture(Textures.BlockIcons.SOLARPANEL_LuV) - }; + return new ITexture[] { new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Top), + new GT_RenderedTexture(Textures.BlockIcons.SOLARPANEL_LuV) }; } public ITexture[] getSides(final byte aColor) { - return new ITexture[] { - new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Top), - new GT_RenderedTexture(Textures.BlockIcons.SOLARPANEL_IV) - }; + return new ITexture[] { new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Top), + new GT_RenderedTexture(Textures.BlockIcons.SOLARPANEL_IV) }; } public ITexture[] getFrontActive(final byte aColor) { - return new ITexture[] { - new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Top), - new GT_RenderedTexture(Textures.BlockIcons.SOLARPANEL_IV) - }; + return new ITexture[] { new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Top), + new GT_RenderedTexture(Textures.BlockIcons.SOLARPANEL_IV) }; } public ITexture[] getBackActive(final byte aColor) { - return new ITexture[] {new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Top)}; + return new ITexture[] { new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Top) }; } public ITexture[] getBottomActive(final byte aColor) { - return new ITexture[] {new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom)}; + return new ITexture[] { new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Bottom) }; } public ITexture[] getTopActive(final byte aColor) { - return new ITexture[] { - new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Top), - new GT_RenderedTexture(Textures.BlockIcons.SOLARPANEL_LuV) - }; + return new ITexture[] { new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Top), + new GT_RenderedTexture(Textures.BlockIcons.SOLARPANEL_LuV) }; } public ITexture[] getSidesActive(final byte aColor) { - return new ITexture[] { - new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Top), - new GT_RenderedTexture(Textures.BlockIcons.SOLARPANEL_IV) - }; + return new ITexture[] { new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Top), + new GT_RenderedTexture(Textures.BlockIcons.SOLARPANEL_IV) }; } @Override @@ -158,7 +128,7 @@ public class TileEntitySolarHeater extends GT_MetaTileEntity_TieredMachineBlock @Override public String[] getInfoData() { - return new String[] {this.getLocalName(), "Testificate"}; + return new String[] { this.getLocalName(), "Testificate" }; } @Override @@ -247,25 +217,19 @@ public class TileEntitySolarHeater extends GT_MetaTileEntity_TieredMachineBlock @Override public void saveNBTData(NBTTagCompound aNBT) { - /*aNBT.setBoolean("mHasTower", mHasTower); - if (this.mHasTower) { - aNBT.setInteger("mTX", mTX); - aNBT.setInteger("mTY", mTY); - aNBT.setInteger("mTZ", mTZ); - }*/ + /* + * aNBT.setBoolean("mHasTower", mHasTower); if (this.mHasTower) { aNBT.setInteger("mTX", mTX); + * aNBT.setInteger("mTY", mTY); aNBT.setInteger("mTZ", mTZ); } + */ } @Override public void loadNBTData(NBTTagCompound aNBT) { - /*this.mHasTower = aNBT.getBoolean("mHasTower"); - if (this.mHasTower) { - if (aNBT.hasKey("mTX")) - this.mTX = aNBT.getInteger("mTX"); - if (aNBT.hasKey("mTY")) - this.mTY = aNBT.getInteger("mTY"); - if (aNBT.hasKey("mTZ")) - this.mTZ = aNBT.getInteger("mTZ"); - }*/ + /* + * this.mHasTower = aNBT.getBoolean("mHasTower"); if (this.mHasTower) { if (aNBT.hasKey("mTX")) this.mTX = + * aNBT.getInteger("mTX"); if (aNBT.hasKey("mTY")) this.mTY = aNBT.getInteger("mTY"); if (aNBT.hasKey("mTZ")) + * this.mTZ = aNBT.getInteger("mTZ"); } + */ } @Override @@ -298,12 +262,10 @@ public class TileEntitySolarHeater extends GT_MetaTileEntity_TieredMachineBlock } public boolean canSeeSky() { - if (this.getBaseMetaTileEntity() - .getWorld() - .canBlockSeeTheSky( - this.getBaseMetaTileEntity().getXCoord(), - this.getBaseMetaTileEntity().getYCoord() + 1, - this.getBaseMetaTileEntity().getZCoord())) { + if (this.getBaseMetaTileEntity().getWorld().canBlockSeeTheSky( + this.getBaseMetaTileEntity().getXCoord(), + this.getBaseMetaTileEntity().getYCoord() + 1, + this.getBaseMetaTileEntity().getZCoord())) { return true; } return false; diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/redstone/GT_MetaTileEntity_RedstoneBase.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/redstone/GT_MetaTileEntity_RedstoneBase.java index 9846813ba0..f160bc1eba 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/redstone/GT_MetaTileEntity_RedstoneBase.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/redstone/GT_MetaTileEntity_RedstoneBase.java @@ -1,47 +1,36 @@ package gtPlusPlus.xmod.gregtech.common.tileentities.redstone; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; + import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_TieredMachineBlock; import gregtech.api.objects.GT_ItemStack; import gtPlusPlus.core.lib.CORE; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; public abstract class GT_MetaTileEntity_RedstoneBase extends GT_MetaTileEntity_TieredMachineBlock { protected int mOpenerCount; - public GT_MetaTileEntity_RedstoneBase( - int aID, - String aName, - String aNameRegional, - int aTier, - int aInvSlotCount, - String aDescription, - ITexture... aTextures) { + public GT_MetaTileEntity_RedstoneBase(int aID, String aName, String aNameRegional, int aTier, int aInvSlotCount, + String aDescription, ITexture... aTextures) { super(aID, aName, aNameRegional, aTier, aInvSlotCount, aDescription, aTextures); } - public GT_MetaTileEntity_RedstoneBase( - int aID, - String aName, - String aNameRegional, - int aTier, - int aInvSlotCount, - String[] aDescription, - ITexture... aTextures) { + public GT_MetaTileEntity_RedstoneBase(int aID, String aName, String aNameRegional, int aTier, int aInvSlotCount, + String[] aDescription, ITexture... aTextures) { super(aID, aName, aNameRegional, aTier, aInvSlotCount, aDescription, aTextures); } - public GT_MetaTileEntity_RedstoneBase( - String aName, int aTier, int aInvSlotCount, String aDescription, ITexture[][][] aTextures) { + public GT_MetaTileEntity_RedstoneBase(String aName, int aTier, int aInvSlotCount, String aDescription, + ITexture[][][] aTextures) { super(aName, aTier, aInvSlotCount, aDescription, aTextures); } - public GT_MetaTileEntity_RedstoneBase( - String aName, int aTier, int aInvSlotCount, String[] aDescription, ITexture[][][] aTextures) { + public GT_MetaTileEntity_RedstoneBase(String aName, int aTier, int aInvSlotCount, String[] aDescription, + ITexture[][][] aTextures) { super(aName, aTier, aInvSlotCount, aDescription, aTextures); } @@ -117,6 +106,6 @@ public abstract class GT_MetaTileEntity_RedstoneBase extends GT_MetaTileEntity_T @Override public String[] getDescription() { - return new String[] {this.mDescription, CORE.GT_Tooltip}; + return new String[] { this.mDescription, CORE.GT_Tooltip }; } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/redstone/GT_MetaTileEntity_RedstoneButtonPanel.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/redstone/GT_MetaTileEntity_RedstoneButtonPanel.java index 3cf868a998..187fafb4b7 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/redstone/GT_MetaTileEntity_RedstoneButtonPanel.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/redstone/GT_MetaTileEntity_RedstoneButtonPanel.java @@ -1,5 +1,8 @@ package gtPlusPlus.xmod.gregtech.common.tileentities.redstone; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.nbt.NBTTagCompound; + import gregtech.api.enums.Textures; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; @@ -8,8 +11,6 @@ import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.util.GT_Utility; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock.CustomIcon; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.nbt.NBTTagCompound; public class GT_MetaTileEntity_RedstoneButtonPanel extends GT_MetaTileEntity_RedstoneBase { @@ -33,8 +34,8 @@ public class GT_MetaTileEntity_RedstoneButtonPanel extends GT_MetaTileEntity_Red "Right-click with Screwdriver to change Button Design"); } - public GT_MetaTileEntity_RedstoneButtonPanel( - final String aName, String aDescription, final ITexture[][][] aTextures) { + public GT_MetaTileEntity_RedstoneButtonPanel(final String aName, String aDescription, + final ITexture[][][] aTextures) { super(aName, 5, 0, aDescription, aTextures); } @@ -67,8 +68,8 @@ public class GT_MetaTileEntity_RedstoneButtonPanel extends GT_MetaTileEntity_Red } @Override - public boolean onRightclick( - IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer, byte aSide, float aX, float aY, float aZ) { + public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer, byte aSide, float aX, + float aY, float aZ) { if (aSide == getBaseMetaTileEntity().getFrontFacing()) { if (getBaseMetaTileEntity().isServerSide()) { mUpdate = 2; @@ -98,24 +99,24 @@ public class GT_MetaTileEntity_RedstoneButtonPanel extends GT_MetaTileEntity_Red switch (aSide) { case 0: case 1: - mRedstoneStrength = - (byte) (mRedstoneStrength ^ (1 << (((byte) (aX * 2) + 2 * (byte) (aZ * 2))))); + mRedstoneStrength = (byte) (mRedstoneStrength + ^ (1 << (((byte) (aX * 2) + 2 * (byte) (aZ * 2))))); break; case 2: - mRedstoneStrength = (byte) - (mRedstoneStrength ^ (1 << (((byte) (2 - aX * 2) + 2 * (byte) (2 - aY * 2))))); + mRedstoneStrength = (byte) (mRedstoneStrength + ^ (1 << (((byte) (2 - aX * 2) + 2 * (byte) (2 - aY * 2))))); break; case 3: - mRedstoneStrength = (byte) - (mRedstoneStrength ^ (1 << (((byte) (aX * 2) + 2 * (byte) (2 - aY * 2))))); + mRedstoneStrength = (byte) (mRedstoneStrength + ^ (1 << (((byte) (aX * 2) + 2 * (byte) (2 - aY * 2))))); break; case 4: - mRedstoneStrength = (byte) - (mRedstoneStrength ^ (1 << (((byte) (aZ * 2) + 2 * (byte) (2 - aY * 2))))); + mRedstoneStrength = (byte) (mRedstoneStrength + ^ (1 << (((byte) (aZ * 2) + 2 * (byte) (2 - aY * 2))))); break; case 5: - mRedstoneStrength = (byte) - (mRedstoneStrength ^ (1 << (((byte) (2 - aZ * 2) + 2 * (byte) (2 - aY * 2))))); + mRedstoneStrength = (byte) (mRedstoneStrength + ^ (1 << (((byte) (2 - aZ * 2) + 2 * (byte) (2 - aY * 2))))); break; } break; @@ -156,12 +157,12 @@ public class GT_MetaTileEntity_RedstoneButtonPanel extends GT_MetaTileEntity_Red mRedstoneStrength = 0; } for (byte i = 0; i < 6; i++) { - getBaseMetaTileEntity() - .setStrongOutputRedstoneSignal( - i, i == getBaseMetaTileEntity().getFrontFacing() ? (byte) 0 : mRedstoneStrength); - getBaseMetaTileEntity() - .setInternalOutputRedstoneSignal( - i, i == getBaseMetaTileEntity().getFrontFacing() ? (byte) 0 : mRedstoneStrength); + getBaseMetaTileEntity().setStrongOutputRedstoneSignal( + i, + i == getBaseMetaTileEntity().getFrontFacing() ? (byte) 0 : mRedstoneStrength); + getBaseMetaTileEntity().setInternalOutputRedstoneSignal( + i, + i == getBaseMetaTileEntity().getFrontFacing() ? (byte) 0 : mRedstoneStrength); } } } @@ -190,72 +191,48 @@ public class GT_MetaTileEntity_RedstoneButtonPanel extends GT_MetaTileEntity_Red } @Override - public ITexture[] getTexture( - final IGregTechTileEntity aBaseMetaTileEntity, - final byte aSide, - final byte aFacing, - final byte aColorIndex, - final boolean aActive, - final boolean aRedstone) { + public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing, + final byte aColorIndex, final boolean aActive, final boolean aRedstone) { if (aSide == aFacing) { - return new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[mTier][aColorIndex + 1], - new GT_RenderedTexture(sIconList[mType * 16 + mRedstoneStrength]) - }; + return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][aColorIndex + 1], + new GT_RenderedTexture(sIconList[mType * 16 + mRedstoneStrength]) }; } - return this.mTextures[ - (aActive || hasRedstoneSignal() ? 5 : 0) - + (aSide == aFacing - ? 0 - : aSide == GT_Utility.getOppositeSide(aFacing) - ? 1 - : aSide == 0 ? 2 : aSide == 1 ? 3 : 4)][ - aColorIndex + 1]; + return this.mTextures[(aActive || hasRedstoneSignal() ? 5 : 0) + (aSide == aFacing ? 0 + : aSide == GT_Utility.getOppositeSide(aFacing) ? 1 : aSide == 0 ? 2 : aSide == 1 ? 3 : 4)][aColorIndex + + 1]; } public ITexture[] getFront(final byte aColor) { - return new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1]}; + return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1] }; } public ITexture[] getTop(final byte aColor) { - return new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], - new GT_RenderedTexture(TexturesGtBlock.Casing_Redstone_Top_Main_Off) - }; + return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], + new GT_RenderedTexture(TexturesGtBlock.Casing_Redstone_Top_Main_Off) }; } public ITexture[] getTopActive(final byte aColor) { - return new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], - new GT_RenderedTexture(TexturesGtBlock.Casing_Redstone_Top_Main_On) - }; + return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], + new GT_RenderedTexture(TexturesGtBlock.Casing_Redstone_Top_Main_On) }; } public ITexture[] getBottom(final byte aColor) { - return new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], - new GT_RenderedTexture(TexturesGtBlock.Casing_Redstone_Bottom_Main_Off) - }; + return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], + new GT_RenderedTexture(TexturesGtBlock.Casing_Redstone_Bottom_Main_Off) }; } public ITexture[] getBottomActive(final byte aColor) { - return new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], - new GT_RenderedTexture(TexturesGtBlock.Casing_Redstone_Bottom_Main_On) - }; + return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], + new GT_RenderedTexture(TexturesGtBlock.Casing_Redstone_Bottom_Main_On) }; } public ITexture[] getSides(final byte aColor) { - return new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], - new GT_RenderedTexture(TexturesGtBlock.Casing_Redstone_Side_Main_Off) - }; + return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], + new GT_RenderedTexture(TexturesGtBlock.Casing_Redstone_Side_Main_Off) }; } public ITexture[] getSidesActive(final byte aColor) { - return new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], - new GT_RenderedTexture(TexturesGtBlock.Casing_Redstone_Side_Main_On) - }; + return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], + new GT_RenderedTexture(TexturesGtBlock.Casing_Redstone_Side_Main_On) }; } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/redstone/GT_MetaTileEntity_RedstoneCircuitBlock.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/redstone/GT_MetaTileEntity_RedstoneCircuitBlock.java index 64efa84154..15e0dd65cc 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/redstone/GT_MetaTileEntity_RedstoneCircuitBlock.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/redstone/GT_MetaTileEntity_RedstoneCircuitBlock.java @@ -1,5 +1,14 @@ package gtPlusPlus.xmod.gregtech.common.tileentities.redstone; +import java.util.*; + +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraftforge.oredict.OreDictionary; + import com.gtnewhorizons.modularui.api.screen.ModularWindow; import com.gtnewhorizons.modularui.api.screen.UIBuildContext; import com.gtnewhorizons.modularui.common.widget.ButtonWidget; @@ -8,6 +17,7 @@ import com.gtnewhorizons.modularui.common.widget.DrawableWidget; import com.gtnewhorizons.modularui.common.widget.FakeSyncWidget; import com.gtnewhorizons.modularui.common.widget.SlotWidget; import com.gtnewhorizons.modularui.common.widget.TextWidget; + import gregtech.api.GregTech_API; import gregtech.api.enums.GT_Values; import gregtech.api.gui.modularui.GT_UIInfos; @@ -23,26 +33,19 @@ import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.util.*; import gtPlusPlus.xmod.gregtech.api.gui.GTPP_UITextures; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; -import java.util.*; -import net.minecraft.block.Block; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.tileentity.TileEntity; -import net.minecraftforge.oredict.OreDictionary; public class GT_MetaTileEntity_RedstoneCircuitBlock extends GT_MetaTileEntity_RedstoneBase implements IRedstoneCircuitBlock, IAddUIWidgets { - public int mGate = 0, mGateData[] = new int[] {0, 0, 0, 0, 0, 0, 0, 0}; + public int mGate = 0, mGateData[] = new int[] { 0, 0, 0, 0, 0, 0, 0, 0 }; public boolean bOutput = true; public GT_MetaTileEntity_RedstoneCircuitBlock(int aID) { super(aID, "redstone.circuit", "Redstone Circuit Block", 1, 5, "Computes Redstone"); } - public GT_MetaTileEntity_RedstoneCircuitBlock( - final String aName, String aDescription, final ITexture[][][] aTextures) { + public GT_MetaTileEntity_RedstoneCircuitBlock(final String aName, String aDescription, + final ITexture[][][] aTextures) { super(aName, 1, 5, aDescription, aTextures); } @@ -142,7 +145,7 @@ public class GT_MetaTileEntity_RedstoneCircuitBlock extends GT_MetaTileEntity_Re public void loadNBTData(NBTTagCompound aNBT) { mGate = aNBT.getInteger("mGate"); mGateData = aNBT.getIntArray("mGateData"); - if (mGateData.length != 8) mGateData = new int[] {0, 0, 0, 0, 0, 0, 0, 0}; + if (mGateData.length != 8) mGateData = new int[] { 0, 0, 0, 0, 0, 0, 0, 0 }; } public void switchGateForward(boolean aShift) { @@ -209,23 +212,21 @@ public class GT_MetaTileEntity_RedstoneCircuitBlock extends GT_MetaTileEntity_Re resetRedstone(); for (int i = 0; i < mGateData.length; i++) mGateData[i] = 0; GT_CircuitryBehavior tBehaviour = GregTech_API.sCircuitryBehaviors.get(mGate); - if (tBehaviour != null) - try { - tBehaviour.initParameters(mGateData, this); - } catch (Throwable e) { - GT_Log.err.print(e); - } + if (tBehaviour != null) try { + tBehaviour.initParameters(mGateData, this); + } catch (Throwable e) { + GT_Log.err.print(e); + } validateGateData(); } private void validateGateData() { GT_CircuitryBehavior tBehaviour = GregTech_API.sCircuitryBehaviors.get(mGate); - if (tBehaviour != null) - try { - tBehaviour.validateParameters(mGateData, this); - } catch (Throwable e) { - GT_Log.err.print(e); - } + if (tBehaviour != null) try { + tBehaviour.validateParameters(mGateData, this); + } catch (Throwable e) { + GT_Log.err.print(e); + } } @Override @@ -335,21 +336,12 @@ public class GT_MetaTileEntity_RedstoneCircuitBlock extends GT_MetaTileEntity_Re return false; } - /* @Override - public int getTextureIndex(byte aSide, byte aFacing, boolean aActive, boolean aRedstone) { - if (aSide == getOutputFacing()) { - if (aSide == 0) - return aRedstone ? 56 : 54; - if (aSide == 1) - return aRedstone ? 53 : 52; - return aRedstone ? 94 : 93; - } - if (aSide == 0) - return aRedstone ? 60 : 59; - if (aSide == 1) - return aRedstone ? 58 : 57; - return aRedstone ? 62 : 61; - }*/ + /* + * @Override public int getTextureIndex(byte aSide, byte aFacing, boolean aActive, boolean aRedstone) { if (aSide == + * getOutputFacing()) { if (aSide == 0) return aRedstone ? 56 : 54; if (aSide == 1) return aRedstone ? 53 : 52; + * return aRedstone ? 94 : 93; } if (aSide == 0) return aRedstone ? 60 : 59; if (aSide == 1) return aRedstone ? 58 : + * 57; return aRedstone ? 62 : 61; } + */ @Override public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { @@ -430,21 +422,11 @@ public class GT_MetaTileEntity_RedstoneCircuitBlock extends GT_MetaTileEntity_Re } @Override - public ITexture[] getTexture( - final IGregTechTileEntity aBaseMetaTileEntity, - final byte aSide, - final byte aFacing, - final byte aColorIndex, - final boolean aActive, - final boolean aRedstone) { - return this.mTextures[ - (aActive || hasRedstoneSignal() ? 5 : 0) - + (aSide == aFacing - ? 0 - : aSide == GT_Utility.getOppositeSide(aFacing) - ? 1 - : aSide == 0 ? 2 : aSide == 1 ? 3 : 4)][ - aColorIndex + 1]; + public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing, + final byte aColorIndex, final boolean aActive, final boolean aRedstone) { + return this.mTextures[(aActive || hasRedstoneSignal() ? 5 : 0) + (aSide == aFacing ? 0 + : aSide == GT_Utility.getOppositeSide(aFacing) ? 1 : aSide == 0 ? 2 : aSide == 1 ? 3 : 4)][aColorIndex + + 1]; } private GT_RenderedTexture getBase() { @@ -452,43 +434,37 @@ public class GT_MetaTileEntity_RedstoneCircuitBlock extends GT_MetaTileEntity_Re } public ITexture[] getTop(final byte aColor) { - return new ITexture[] {getBase(), new GT_RenderedTexture(TexturesGtBlock.Casing_Redstone_Top_Off)}; + return new ITexture[] { getBase(), new GT_RenderedTexture(TexturesGtBlock.Casing_Redstone_Top_Off) }; } public ITexture[] getTopActive(final byte aColor) { - return new ITexture[] {getBase(), new GT_RenderedTexture(TexturesGtBlock.Casing_Redstone_Top_On)}; + return new ITexture[] { getBase(), new GT_RenderedTexture(TexturesGtBlock.Casing_Redstone_Top_On) }; } public ITexture[] getBack(final byte aColor) { - return new ITexture[] { - getBase(), - new GT_RenderedTexture(TexturesGtBlock.Casing_Redstone_Side_Off), - new GT_RenderedTexture(TexturesGtBlock.Casing_InventoryManagaer_Red) - }; + return new ITexture[] { getBase(), new GT_RenderedTexture(TexturesGtBlock.Casing_Redstone_Side_Off), + new GT_RenderedTexture(TexturesGtBlock.Casing_InventoryManagaer_Red) }; } public ITexture[] getBackActive(final byte aColor) { - return new ITexture[] { - getBase(), - new GT_RenderedTexture(TexturesGtBlock.Casing_Redstone_Side_On), - new GT_RenderedTexture(TexturesGtBlock.Casing_InventoryManagaer_Red_Redstone) - }; + return new ITexture[] { getBase(), new GT_RenderedTexture(TexturesGtBlock.Casing_Redstone_Side_On), + new GT_RenderedTexture(TexturesGtBlock.Casing_InventoryManagaer_Red_Redstone) }; } public ITexture[] getBottom(final byte aColor) { - return new ITexture[] {getBase(), new GT_RenderedTexture(TexturesGtBlock.Casing_Redstone_Bottom_Off)}; + return new ITexture[] { getBase(), new GT_RenderedTexture(TexturesGtBlock.Casing_Redstone_Bottom_Off) }; } public ITexture[] getBottomActive(final byte aColor) { - return new ITexture[] {getBase(), new GT_RenderedTexture(TexturesGtBlock.Casing_Redstone_Bottom_On)}; + return new ITexture[] { getBase(), new GT_RenderedTexture(TexturesGtBlock.Casing_Redstone_Bottom_On) }; } public ITexture[] getSides(final byte aColor) { - return new ITexture[] {getBase(), new GT_RenderedTexture(TexturesGtBlock.Casing_Redstone_Side_Off)}; + return new ITexture[] { getBase(), new GT_RenderedTexture(TexturesGtBlock.Casing_Redstone_Side_Off) }; } public ITexture[] getSidesActive(final byte aColor) { - return new ITexture[] {getBase(), new GT_RenderedTexture(TexturesGtBlock.Casing_Redstone_Side_On)}; + return new ITexture[] { getBase(), new GT_RenderedTexture(TexturesGtBlock.Casing_Redstone_Side_On) }; } @Override @@ -498,61 +474,44 @@ public class GT_MetaTileEntity_RedstoneCircuitBlock extends GT_MetaTileEntity_Re @Override public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildContext) { - builder.widget(new DrawableWidget() - .setDrawable(GTPP_UITextures.PICTURE_REDSTONE_CIRCUIT_SCREEN) - .setPos(43, 5) - .setSize(108, 72)); + builder.widget( + new DrawableWidget().setDrawable(GTPP_UITextures.PICTURE_REDSTONE_CIRCUIT_SCREEN).setPos(43, 5) + .setSize(108, 72)); for (int i = 0; i < 4; i++) { final int index = i; - builder.widget(new ButtonWidget() - .setOnClick((clickData, widget) -> { - ItemStack tStack = widget.getContext() - .getPlayer() - .inventory - .getItemStack(); - if (tStack == null) { - changeGateData( - index, - clickData.mouseButton == 0 - ? clickData.shift ? +128 : +1 - : clickData.shift ? -128 : -1); - } else { - tStack = GT_Utility.copy(tStack); - if (clickData.mouseButton != 0) tStack.setItemDamage(OreDictionary.WILDCARD_VALUE); - stackGateData(index, tStack); - } - }) - .setBackground(GT_UITextures.BUTTON_STANDARD, GTPP_UITextures.OVERLAY_BUTTON_PLUS_MINUS) - .setPos(7, 5 + i * 18) - .setSize(18, 18)) - .widget(SlotWidget.phantom(inventoryHandler, i + 1) - .disableInteraction() - .setPos(25, 5 + i * 18)); + builder.widget(new ButtonWidget().setOnClick((clickData, widget) -> { + ItemStack tStack = widget.getContext().getPlayer().inventory.getItemStack(); + if (tStack == null) { + changeGateData( + index, + clickData.mouseButton == 0 ? clickData.shift ? +128 : +1 : clickData.shift ? -128 : -1); + } else { + tStack = GT_Utility.copy(tStack); + if (clickData.mouseButton != 0) tStack.setItemDamage(OreDictionary.WILDCARD_VALUE); + stackGateData(index, tStack); + } + }).setBackground(GT_UITextures.BUTTON_STANDARD, GTPP_UITextures.OVERLAY_BUTTON_PLUS_MINUS) + .setPos(7, 5 + i * 18).setSize(18, 18)) + .widget(SlotWidget.phantom(inventoryHandler, i + 1).disableInteraction().setPos(25, 5 + i * 18)); } - builder.widget(new CycleButtonWidget() - .setToggle(() -> bOutput, val -> bOutput = val) + builder.widget( + new CycleButtonWidget().setToggle(() -> bOutput, val -> bOutput = val) .setVariableBackground(GT_UITextures.BUTTON_STANDARD_TOGGLE) - .setStaticTexture(GT_UITextures.OVERLAY_BUTTON_EMIT_ENERGY) - .addTooltip("Toggle EU Output") - .setPos(151, 5) - .setSize(18, 18)) - .widget(new CycleButtonWidget() - .setToggle(() -> getBaseMetaTileEntity().isActive(), val -> getBaseMetaTileEntity() - .setActive(val)) - .setVariableBackground(GT_UITextures.BUTTON_STANDARD_TOGGLE) - .setStaticTexture(GTPP_UITextures.OVERLAY_BUTTON_ACTIVE_STATE) - .addTooltip("Toggle Active State") - .setPos(151, 23) - .setSize(18, 18)) - .widget(new ButtonWidget() - .setOnClick((clickData, widget) -> { - if (clickData.mouseButton == 0) switchGateForward(clickData.shift); - else switchGateBackward(clickData.shift); - }) - .setBackground(GT_UITextures.BUTTON_STANDARD, GTPP_UITextures.OVERLAY_BUTTON_CHANGE_MODE) - .addTooltip("Change Redstone Circuit") - .setPos(151, 41) - .setSize(18, 18)); + .setStaticTexture(GT_UITextures.OVERLAY_BUTTON_EMIT_ENERGY).addTooltip("Toggle EU Output") + .setPos(151, 5).setSize(18, 18)) + .widget( + new CycleButtonWidget() + .setToggle( + () -> getBaseMetaTileEntity().isActive(), + val -> getBaseMetaTileEntity().setActive(val)) + .setVariableBackground(GT_UITextures.BUTTON_STANDARD_TOGGLE) + .setStaticTexture(GTPP_UITextures.OVERLAY_BUTTON_ACTIVE_STATE) + .addTooltip("Toggle Active State").setPos(151, 23).setSize(18, 18)) + .widget(new ButtonWidget().setOnClick((clickData, widget) -> { + if (clickData.mouseButton == 0) switchGateForward(clickData.shift); + else switchGateBackward(clickData.shift); + }).setBackground(GT_UITextures.BUTTON_STANDARD, GTPP_UITextures.OVERLAY_BUTTON_CHANGE_MODE) + .addTooltip("Change Redstone Circuit").setPos(151, 41).setSize(18, 18)); builder.widget(new FakeSyncWidget.IntegerSyncer(() -> mGate, val -> mGate = val)); for (int i = 0; i < mGateData.length; i++) { @@ -560,115 +519,82 @@ public class GT_MetaTileEntity_RedstoneCircuitBlock extends GT_MetaTileEntity_Re builder.widget(new FakeSyncWidget.IntegerSyncer(() -> mGateData[index], val -> mGateData[index] = val)); } - builder.widget(new DrawableWidget() - .setDrawable(() -> { - if (getBaseMetaTileEntity().getErrorDisplayID() > 0) { - if ((getBaseMetaTileEntity().getTimer() / 5) % 2 == 0) { - return GTPP_UITextures.PICTURE_ELECTRICITY_ERROR; - } else { - return null; - } - } else { - return GTPP_UITextures.PICTURE_ELECTRICITY_FINE; - } - }) - .setPos(140, 9) - .setSize(7, 7)) - .widget(new FakeSyncWidget.IntegerSyncer( + builder.widget(new DrawableWidget().setDrawable(() -> { + if (getBaseMetaTileEntity().getErrorDisplayID() > 0) { + if ((getBaseMetaTileEntity().getTimer() / 5) % 2 == 0) { + return GTPP_UITextures.PICTURE_ELECTRICITY_ERROR; + } else { + return null; + } + } else { + return GTPP_UITextures.PICTURE_ELECTRICITY_FINE; + } + }).setPos(140, 9).setSize(7, 7)).widget( + new FakeSyncWidget.IntegerSyncer( () -> getBaseMetaTileEntity().getErrorDisplayID(), val -> getBaseMetaTileEntity().setErrorDisplayID(val))); builder.widget(TextWidget.dynamicString(() -> { - GT_CircuitryBehavior tCircuit = GregTech_API.sCircuitryBehaviors.get(mGate); - if (tCircuit != null) return tCircuit.getName(); - return ""; - }) - .setSynced(false) - .setDefaultColor(COLOR_TEXT_WHITE.get()) - .setPos(46, 8)) + GT_CircuitryBehavior tCircuit = GregTech_API.sCircuitryBehaviors.get(mGate); + if (tCircuit != null) return tCircuit.getName(); + return ""; + }).setSynced(false).setDefaultColor(COLOR_TEXT_WHITE.get()).setPos(46, 8)) .widget(TextWidget.dynamicString(() -> { - GT_CircuitryBehavior tCircuit = GregTech_API.sCircuitryBehaviors.get(mGate); - if (tCircuit != null) return tCircuit.getDescription(); - return ""; - }) - .setSynced(false) - .setDefaultColor(COLOR_TEXT_WHITE.get()) - .setPos(46, 19)) + GT_CircuitryBehavior tCircuit = GregTech_API.sCircuitryBehaviors.get(mGate); + if (tCircuit != null) return tCircuit.getDescription(); + return ""; + }).setSynced(false).setDefaultColor(COLOR_TEXT_WHITE.get()).setPos(46, 19)) .widget(TextWidget.dynamicString(() -> { - GT_CircuitryBehavior tCircuit = GregTech_API.sCircuitryBehaviors.get(mGate); - if (tCircuit != null) return tCircuit.getDataDescription(mGateData, 0); - return ""; - }) - .setSynced(false) - .setDefaultColor(COLOR_TEXT_WHITE.get()) - .setPos(46, 33)) + GT_CircuitryBehavior tCircuit = GregTech_API.sCircuitryBehaviors.get(mGate); + if (tCircuit != null) return tCircuit.getDataDescription(mGateData, 0); + return ""; + }).setSynced(false).setDefaultColor(COLOR_TEXT_WHITE.get()).setPos(46, 33)) .widget(TextWidget.dynamicString(() -> { - GT_CircuitryBehavior tCircuit = GregTech_API.sCircuitryBehaviors.get(mGate); - if (tCircuit != null) return tCircuit.getDataDescription(mGateData, 1); - return ""; - }) - .setSynced(false) - .setDefaultColor(COLOR_TEXT_WHITE.get()) - .setPos(46, 44)) + GT_CircuitryBehavior tCircuit = GregTech_API.sCircuitryBehaviors.get(mGate); + if (tCircuit != null) return tCircuit.getDataDescription(mGateData, 1); + return ""; + }).setSynced(false).setDefaultColor(COLOR_TEXT_WHITE.get()).setPos(46, 44)) .widget(TextWidget.dynamicString(() -> { - GT_CircuitryBehavior tCircuit = GregTech_API.sCircuitryBehaviors.get(mGate); - if (tCircuit != null) return tCircuit.getDataDescription(mGateData, 2); - return ""; - }) - .setSynced(false) - .setDefaultColor(COLOR_TEXT_WHITE.get()) - .setPos(46, 55)) + GT_CircuitryBehavior tCircuit = GregTech_API.sCircuitryBehaviors.get(mGate); + if (tCircuit != null) return tCircuit.getDataDescription(mGateData, 2); + return ""; + }).setSynced(false).setDefaultColor(COLOR_TEXT_WHITE.get()).setPos(46, 55)) .widget(TextWidget.dynamicString(() -> { - GT_CircuitryBehavior tCircuit = GregTech_API.sCircuitryBehaviors.get(mGate); - if (tCircuit != null) return tCircuit.getDataDescription(mGateData, 3); - return ""; - }) - .setSynced(false) - .setDefaultColor(COLOR_TEXT_WHITE.get()) - .setPos(46, 66)) + GT_CircuitryBehavior tCircuit = GregTech_API.sCircuitryBehaviors.get(mGate); + if (tCircuit != null) return tCircuit.getDataDescription(mGateData, 3); + return ""; + }).setSynced(false).setDefaultColor(COLOR_TEXT_WHITE.get()).setPos(46, 66)) .widget(TextWidget.dynamicString(() -> { - GT_CircuitryBehavior tCircuit = GregTech_API.sCircuitryBehaviors.get(mGate); - if (tCircuit != null) { - String tString = tCircuit.getDataDisplay(mGateData, 0); - return tString == null ? GT_Utility.parseNumberToString(mGateData[0]) : tString; - } - return ""; - }) - .setSynced(false) - .setDefaultColor(COLOR_TEXT_WHITE.get()) - .setPos(99, 33)) + GT_CircuitryBehavior tCircuit = GregTech_API.sCircuitryBehaviors.get(mGate); + if (tCircuit != null) { + String tString = tCircuit.getDataDisplay(mGateData, 0); + return tString == null ? GT_Utility.parseNumberToString(mGateData[0]) : tString; + } + return ""; + }).setSynced(false).setDefaultColor(COLOR_TEXT_WHITE.get()).setPos(99, 33)) .widget(TextWidget.dynamicString(() -> { - GT_CircuitryBehavior tCircuit = GregTech_API.sCircuitryBehaviors.get(mGate); - if (tCircuit != null) { - String tString = tCircuit.getDataDisplay(mGateData, 1); - return tString == null ? GT_Utility.parseNumberToString(mGateData[1]) : tString; - } - return ""; - }) - .setSynced(false) - .setDefaultColor(COLOR_TEXT_WHITE.get()) - .setPos(99, 44)) + GT_CircuitryBehavior tCircuit = GregTech_API.sCircuitryBehaviors.get(mGate); + if (tCircuit != null) { + String tString = tCircuit.getDataDisplay(mGateData, 1); + return tString == null ? GT_Utility.parseNumberToString(mGateData[1]) : tString; + } + return ""; + }).setSynced(false).setDefaultColor(COLOR_TEXT_WHITE.get()).setPos(99, 44)) .widget(TextWidget.dynamicString(() -> { - GT_CircuitryBehavior tCircuit = GregTech_API.sCircuitryBehaviors.get(mGate); - if (tCircuit != null) { - String tString = tCircuit.getDataDisplay(mGateData, 2); - return tString == null ? GT_Utility.parseNumberToString(mGateData[2]) : tString; - } - return ""; - }) - .setSynced(false) - .setDefaultColor(COLOR_TEXT_WHITE.get()) - .setPos(99, 55)) + GT_CircuitryBehavior tCircuit = GregTech_API.sCircuitryBehaviors.get(mGate); + if (tCircuit != null) { + String tString = tCircuit.getDataDisplay(mGateData, 2); + return tString == null ? GT_Utility.parseNumberToString(mGateData[2]) : tString; + } + return ""; + }).setSynced(false).setDefaultColor(COLOR_TEXT_WHITE.get()).setPos(99, 55)) .widget(TextWidget.dynamicString(() -> { - GT_CircuitryBehavior tCircuit = GregTech_API.sCircuitryBehaviors.get(mGate); - if (tCircuit != null) { - String tString = tCircuit.getDataDisplay(mGateData, 3); - return tString == null ? GT_Utility.parseNumberToString(mGateData[3]) : tString; - } - return ""; - }) - .setSynced(false) - .setDefaultColor(COLOR_TEXT_WHITE.get()) - .setPos(99, 66)); + GT_CircuitryBehavior tCircuit = GregTech_API.sCircuitryBehaviors.get(mGate); + if (tCircuit != null) { + String tString = tCircuit.getDataDisplay(mGateData, 3); + return tString == null ? GT_Utility.parseNumberToString(mGateData[3]) : tString; + } + return ""; + }).setSynced(false).setDefaultColor(COLOR_TEXT_WHITE.get()).setPos(99, 66)); } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/redstone/GT_MetaTileEntity_RedstoneLamp.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/redstone/GT_MetaTileEntity_RedstoneLamp.java index dfb844654b..6413f59508 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/redstone/GT_MetaTileEntity_RedstoneLamp.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/redstone/GT_MetaTileEntity_RedstoneLamp.java @@ -1,12 +1,13 @@ package gtPlusPlus.xmod.gregtech.common.tileentities.redstone; +import net.minecraft.nbt.NBTTagCompound; + import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.objects.GT_RenderedTexture; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock.CustomIcon; -import net.minecraft.nbt.NBTTagCompound; public class GT_MetaTileEntity_RedstoneLamp extends GT_MetaTileEntity_RedstoneBase { @@ -56,21 +57,16 @@ public class GT_MetaTileEntity_RedstoneLamp extends GT_MetaTileEntity_RedstoneBa } @Override - public ITexture[] getTexture( - final IGregTechTileEntity aBaseMetaTileEntity, - final byte aSide, - final byte aFacing, - final byte aColorIndex, - final boolean aActive, - final boolean aRedstone) { + public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing, + final byte aColorIndex, final boolean aActive, final boolean aRedstone) { return this.mTextures[(aActive ? 1 : 0)][aColorIndex + 1]; } public ITexture[] getSides(final byte aColor) { - return new ITexture[] {new GT_RenderedTexture(sIconList[0])}; + return new ITexture[] { new GT_RenderedTexture(sIconList[0]) }; } public ITexture[] getSidesActive(final byte aColor) { - return new ITexture[] {new GT_RenderedTexture(sIconList[1])}; + return new ITexture[] { new GT_RenderedTexture(sIconList[1]) }; } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/redstone/GT_MetaTileEntity_RedstoneStrengthDisplay.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/redstone/GT_MetaTileEntity_RedstoneStrengthDisplay.java index 3b07f8b3ff..286b79ca3b 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/redstone/GT_MetaTileEntity_RedstoneStrengthDisplay.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/redstone/GT_MetaTileEntity_RedstoneStrengthDisplay.java @@ -1,5 +1,8 @@ package gtPlusPlus.xmod.gregtech.common.tileentities.redstone; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.nbt.NBTTagCompound; + import gregtech.api.enums.Textures; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; @@ -8,8 +11,6 @@ import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.util.GT_Utility; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock.CustomIcon; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.nbt.NBTTagCompound; public class GT_MetaTileEntity_RedstoneStrengthDisplay extends GT_MetaTileEntity_RedstoneBase { @@ -26,8 +27,8 @@ public class GT_MetaTileEntity_RedstoneStrengthDisplay extends GT_MetaTileEntity super(aID, aUnlocal, aLocal, 5, 0, aDescription); } - public GT_MetaTileEntity_RedstoneStrengthDisplay( - final String aName, String aDescription, final ITexture[][][] aTextures) { + public GT_MetaTileEntity_RedstoneStrengthDisplay(final String aName, String aDescription, + final ITexture[][][] aTextures) { super(aName, 5, 0, aDescription, aTextures); } @@ -67,24 +68,20 @@ public class GT_MetaTileEntity_RedstoneStrengthDisplay extends GT_MetaTileEntity } } - /*@Override - public int getTextureIndex(byte aSide, byte aFacing, boolean aActive, boolean aRedstone) { - if (aSide == 0) - return aRedstone ? 60 : 59; - if (aSide == 1) - return aRedstone ? 58 : 57; - return aRedstone ? 62 : 61; - }*/ + /* + * @Override public int getTextureIndex(byte aSide, byte aFacing, boolean aActive, boolean aRedstone) { if (aSide == + * 0) return aRedstone ? 60 : 59; if (aSide == 1) return aRedstone ? 58 : 57; return aRedstone ? 62 : 61; } + */ @Override public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { if (aSide == getBaseMetaTileEntity().getFrontFacing()) mType = (byte) ((mType + 1) % 6); } - /*@Override - public IIcon getTextureIcon(byte aSide, byte aFacing, boolean aActive, boolean aRedstone) { - return aSide == aFacing ? sIconList[mType * 16 + mRedstoneStrength] : null; - }*/ + /* + * @Override public IIcon getTextureIcon(byte aSide, byte aFacing, boolean aActive, boolean aRedstone) { return + * aSide == aFacing ? sIconList[mType * 16 + mRedstoneStrength] : null; } + */ @Override public ITexture[][][] getTextureSet(final ITexture[] aTextures) { @@ -105,72 +102,48 @@ public class GT_MetaTileEntity_RedstoneStrengthDisplay extends GT_MetaTileEntity } @Override - public ITexture[] getTexture( - final IGregTechTileEntity aBaseMetaTileEntity, - final byte aSide, - final byte aFacing, - final byte aColorIndex, - final boolean aActive, - final boolean aRedstone) { + public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing, + final byte aColorIndex, final boolean aActive, final boolean aRedstone) { if (aSide == aFacing) { - return new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[mTier][aColorIndex + 1], - new GT_RenderedTexture(sIconList[mType * 16 + mRedstoneStrength]) - }; + return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][aColorIndex + 1], + new GT_RenderedTexture(sIconList[mType * 16 + mRedstoneStrength]) }; } - return this.mTextures[ - (aActive || hasRedstoneSignal() ? 5 : 0) - + (aSide == aFacing - ? 0 - : aSide == GT_Utility.getOppositeSide(aFacing) - ? 1 - : aSide == 0 ? 2 : aSide == 1 ? 3 : 4)][ - aColorIndex + 1]; + return this.mTextures[(aActive || hasRedstoneSignal() ? 5 : 0) + (aSide == aFacing ? 0 + : aSide == GT_Utility.getOppositeSide(aFacing) ? 1 : aSide == 0 ? 2 : aSide == 1 ? 3 : 4)][aColorIndex + + 1]; } public ITexture[] getFront(final byte aColor) { - return new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1]}; + return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1] }; } public ITexture[] getTop(final byte aColor) { - return new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], - new GT_RenderedTexture(TexturesGtBlock.Casing_Redstone_Top_Off) - }; + return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], + new GT_RenderedTexture(TexturesGtBlock.Casing_Redstone_Top_Off) }; } public ITexture[] getTopActive(final byte aColor) { - return new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], - new GT_RenderedTexture(TexturesGtBlock.Casing_Redstone_Top_On) - }; + return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], + new GT_RenderedTexture(TexturesGtBlock.Casing_Redstone_Top_On) }; } public ITexture[] getBottom(final byte aColor) { - return new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], - new GT_RenderedTexture(TexturesGtBlock.Casing_Redstone_Bottom_Off) - }; + return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], + new GT_RenderedTexture(TexturesGtBlock.Casing_Redstone_Bottom_Off) }; } public ITexture[] getBottomActive(final byte aColor) { - return new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], - new GT_RenderedTexture(TexturesGtBlock.Casing_Redstone_Bottom_On) - }; + return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], + new GT_RenderedTexture(TexturesGtBlock.Casing_Redstone_Bottom_On) }; } public ITexture[] getSides(final byte aColor) { - return new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], - new GT_RenderedTexture(TexturesGtBlock.Casing_Redstone_Side_Off) - }; + return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], + new GT_RenderedTexture(TexturesGtBlock.Casing_Redstone_Side_Off) }; } public ITexture[] getSidesActive(final byte aColor) { - return new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], - new GT_RenderedTexture(TexturesGtBlock.Casing_Redstone_Side_On) - }; + return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], + new GT_RenderedTexture(TexturesGtBlock.Casing_Redstone_Side_On) }; } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/redstone/GT_MetaTileEntity_RedstoneStrengthScale.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/redstone/GT_MetaTileEntity_RedstoneStrengthScale.java index 8945f3f7b5..ff65ebfe91 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/redstone/GT_MetaTileEntity_RedstoneStrengthScale.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/redstone/GT_MetaTileEntity_RedstoneStrengthScale.java @@ -1,5 +1,7 @@ package gtPlusPlus.xmod.gregtech.common.tileentities.redstone; +import net.minecraft.entity.player.EntityPlayer; + import gregtech.api.enums.Textures; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; @@ -8,7 +10,6 @@ import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.util.GT_Utility; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock.CustomIcon; -import net.minecraft.entity.player.EntityPlayer; public class GT_MetaTileEntity_RedstoneStrengthScale extends GT_MetaTileEntity_RedstoneStrengthDisplay { @@ -24,8 +25,8 @@ public class GT_MetaTileEntity_RedstoneStrengthScale extends GT_MetaTileEntity_R super(aID, "redstone.display.scale", "Redstone Scale", "Redstone Strength on a Scale"); } - public GT_MetaTileEntity_RedstoneStrengthScale( - final String aName, String aDescription, final ITexture[][][] aTextures) { + public GT_MetaTileEntity_RedstoneStrengthScale(final String aName, String aDescription, + final ITexture[][][] aTextures) { super(aName, aDescription, aTextures); } @@ -40,26 +41,14 @@ public class GT_MetaTileEntity_RedstoneStrengthScale extends GT_MetaTileEntity_R } @Override - public ITexture[] getTexture( - final IGregTechTileEntity aBaseMetaTileEntity, - final byte aSide, - final byte aFacing, - final byte aColorIndex, - final boolean aActive, - final boolean aRedstone) { + public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing, + final byte aColorIndex, final boolean aActive, final boolean aRedstone) { if (aSide == aFacing) { - return new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[mTier][aColorIndex + 1], - new GT_RenderedTexture(sIconList[mType * 16 + mRedstoneStrength]) - }; + return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][aColorIndex + 1], + new GT_RenderedTexture(sIconList[mType * 16 + mRedstoneStrength]) }; } - return this.mTextures[ - (aActive || hasRedstoneSignal() ? 5 : 0) - + (aSide == aFacing - ? 0 - : aSide == GT_Utility.getOppositeSide(aFacing) - ? 1 - : aSide == 0 ? 2 : aSide == 1 ? 3 : 4)][ - aColorIndex + 1]; + return this.mTextures[(aActive || hasRedstoneSignal() ? 5 : 0) + (aSide == aFacing ? 0 + : aSide == GT_Utility.getOppositeSide(aFacing) ? 1 : aSide == 0 ? 2 : aSide == 1 ? 3 : 4)][aColorIndex + + 1]; } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GT_MetaTileEntity_AdvancedCraftingTable.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GT_MetaTileEntity_AdvancedCraftingTable.java index 0b12373236..95363c9bb8 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GT_MetaTileEntity_AdvancedCraftingTable.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GT_MetaTileEntity_AdvancedCraftingTable.java @@ -1,5 +1,16 @@ package gtPlusPlus.xmod.gregtech.common.tileentities.storage; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.network.PacketBuffer; + import com.gtnewhorizons.modularui.api.drawable.IDrawable; import com.gtnewhorizons.modularui.api.screen.ModularWindow; import com.gtnewhorizons.modularui.api.screen.UIBuildContext; @@ -9,6 +20,7 @@ import com.gtnewhorizons.modularui.common.internal.wrapper.BaseSlot; import com.gtnewhorizons.modularui.common.widget.ButtonWidget; import com.gtnewhorizons.modularui.common.widget.SlotGroup; import com.gtnewhorizons.modularui.common.widget.SlotWidget; + import gregtech.api.enums.GT_Values; import gregtech.api.gui.modularui.GT_UIInfos; import gregtech.api.gui.modularui.GT_UITextures; @@ -28,15 +40,6 @@ import gtPlusPlus.core.util.math.MathUtils; import gtPlusPlus.xmod.gregtech.api.gui.GTPP_UITextures; import gtPlusPlus.xmod.gregtech.api.gui.widget.ElectricSlotWidget; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.nbt.NBTTagList; -import net.minecraft.network.PacketBuffer; public class GT_MetaTileEntity_AdvancedCraftingTable extends GT_MetaTileEntity_BasicTank implements IAddGregtechLogo { @@ -44,14 +47,14 @@ public class GT_MetaTileEntity_AdvancedCraftingTable extends GT_MetaTileEntity_B protected String mLocalName; - public GT_MetaTileEntity_AdvancedCraftingTable( - final int aID, final String aName, final String aNameRegional, final int aTier, final String aDescription) { + public GT_MetaTileEntity_AdvancedCraftingTable(final int aID, final String aName, final String aNameRegional, + final int aTier, final String aDescription) { super(aID, aName, aNameRegional, aTier, 35, aDescription); mLocalName = aNameRegional; } - public GT_MetaTileEntity_AdvancedCraftingTable( - final String aName, final int aTier, final String aDescription, final ITexture[][][] aTextures) { + public GT_MetaTileEntity_AdvancedCraftingTable(final String aName, final int aTier, final String aDescription, + final ITexture[][][] aTextures) { super(aName, aTier, 35, aDescription, aTextures); } @@ -172,40 +175,37 @@ public class GT_MetaTileEntity_AdvancedCraftingTable extends GT_MetaTileEntity_B } public void sortIntoTheInputSlots() { - for (byte i = 21; i < 30; i++) - if (mInventory[i] != null) { - if (mInventory[i].stackSize == 0) { - mInventory[i] = null; + for (byte i = 21; i < 30; i++) if (mInventory[i] != null) { + if (mInventory[i].stackSize == 0) { + mInventory[i] = null; + } + if (mInventory[i] != null) for (byte j = 0; j < 16; j++) { + if (GT_Utility.areStacksEqual(mInventory[i], mInventory[j])) { + GT_Utility.moveStackFromSlotAToSlotB( + getBaseMetaTileEntity(), + getBaseMetaTileEntity(), + i, + j, + (byte) 64, + (byte) 1, + (byte) 64, + (byte) 1); } - if (mInventory[i] != null) - for (byte j = 0; j < 16; j++) { - if (GT_Utility.areStacksEqual(mInventory[i], mInventory[j])) { - GT_Utility.moveStackFromSlotAToSlotB( - getBaseMetaTileEntity(), - getBaseMetaTileEntity(), - i, - j, - (byte) 64, - (byte) 1, - (byte) 64, - (byte) 1); - } - } - if (mInventory[i] != null) - for (byte j = 0; j < 16; j++) { - if (mInventory[j] == null) { - GT_Utility.moveStackFromSlotAToSlotB( - getBaseMetaTileEntity(), - getBaseMetaTileEntity(), - i, - j, - (byte) 64, - (byte) 1, - (byte) 64, - (byte) 1); - } - } } + if (mInventory[i] != null) for (byte j = 0; j < 16; j++) { + if (mInventory[j] == null) { + GT_Utility.moveStackFromSlotAToSlotB( + getBaseMetaTileEntity(), + getBaseMetaTileEntity(), + i, + j, + (byte) 64, + (byte) 1, + (byte) 64, + (byte) 1); + } + } + } } private void fillLiquidContainers() { @@ -215,21 +215,19 @@ public class GT_MetaTileEntity_AdvancedCraftingTable extends GT_MetaTileEntity_B if (mInventory[i].stackSize == 1) { mFluid.amount -= GT_Utility.getFluidForFilledItem(tOutput, true).amount * tOutput.stackSize; mInventory[i] = tOutput; - } else - for (byte j = 16; j < 21; j++) { - if (mInventory[j] == null - || (GT_Utility.areStacksEqual(tOutput, mInventory[j]) - && mInventory[j].stackSize + tOutput.stackSize <= tOutput.getMaxStackSize())) { - mFluid.amount -= GT_Utility.getFluidForFilledItem(tOutput, true).amount * tOutput.stackSize; - getBaseMetaTileEntity().decrStackSize(i, 1); - if (mInventory[j] == null) { - mInventory[j] = tOutput; - } else { - mInventory[j].stackSize++; - } - break; + } else for (byte j = 16; j < 21; j++) { + if (mInventory[j] == null || (GT_Utility.areStacksEqual(tOutput, mInventory[j]) + && mInventory[j].stackSize + tOutput.stackSize <= tOutput.getMaxStackSize())) { + mFluid.amount -= GT_Utility.getFluidForFilledItem(tOutput, true).amount * tOutput.stackSize; + getBaseMetaTileEntity().decrStackSize(i, 1); + if (mInventory[j] == null) { + mInventory[j] = tOutput; + } else { + mInventory[j].stackSize++; } + break; } + } if (mFluid != null && mFluid.amount <= 0) mFluid = null; } } @@ -241,17 +239,19 @@ public class GT_MetaTileEntity_AdvancedCraftingTable extends GT_MetaTileEntity_B aStack = mInventory[30]; Logger.INFO("Using Slot 30 supply."); } - if (mInventory[31] == null - || aStack == null + if (mInventory[31] == null || aStack == null || aStack.getItem() == null || aStack.getItemDamage() != 0 || aStack.stackSize != 1 || !(aStack.getItem() instanceof ItemBlueprint)) { try { - Logger.INFO("Could not set Blueprint. Slot 31: " - + (mInventory[31] != null ? mInventory[31].getDisplayName() : "Null") - + ", aStack: " + (aStack != null ? aStack.getDisplayName() : "Null") - + ", Damage: " + (aStack != null ? aStack.getItemDamage() : "Null")); + Logger.INFO( + "Could not set Blueprint. Slot 31: " + + (mInventory[31] != null ? mInventory[31].getDisplayName() : "Null") + + ", aStack: " + + (aStack != null ? aStack.getDisplayName() : "Null") + + ", Damage: " + + (aStack != null ? aStack.getItemDamage() : "Null")); } catch (Throwable t) { t.printStackTrace(); } @@ -281,8 +281,7 @@ public class GT_MetaTileEntity_AdvancedCraftingTable extends GT_MetaTileEntity_B } public ItemStack getCraftingOutput() { - if (mInventory[30] != null - && mInventory[30].getItem() != null + if (mInventory[30] != null && mInventory[30].getItem() != null && mInventory[30].getItemDamage() == 0 && mInventory[30].hasTagCompound() && mInventory[30].getItem() instanceof ItemBlueprint) { @@ -298,12 +297,10 @@ public class GT_MetaTileEntity_AdvancedCraftingTable extends GT_MetaTileEntity_B } } } - mInventory[31] = - GT_ModHandler.getAllRecipeOutput(getBaseMetaTileEntity().getWorld(), new ItemStack[] { - mInventory[21], mInventory[22], mInventory[23], - mInventory[24], mInventory[25], mInventory[26], - mInventory[27], mInventory[28], mInventory[29] - }); + mInventory[31] = GT_ModHandler.getAllRecipeOutput( + getBaseMetaTileEntity().getWorld(), + new ItemStack[] { mInventory[21], mInventory[22], mInventory[23], mInventory[24], mInventory[25], + mInventory[26], mInventory[27], mInventory[28], mInventory[29] }); return mInventory[31]; } @@ -351,41 +348,38 @@ public class GT_MetaTileEntity_AdvancedCraftingTable extends GT_MetaTileEntity_B if (!GT_Utility.areStacksEqual(aHoldStack, mInventory[31])) return aHoldStack; if (aHoldStack.stackSize + mInventory[31].stackSize > aHoldStack.getMaxStackSize()) return aHoldStack; } - for (byte i = 21; i < 30; i++) - if (mInventory[i] != null) { - for (byte j = 0; j <= i; j++) { - if (j < 21 || j == i) { - if (GT_Utility.areStacksOrToolsEqual(mInventory[i], mInventory[j]) - && mInventory[j].stackSize > 0) { - ItemStack tStack = GT_Utility.getContainerItem(mInventory[j], true); - if (tStack == null - || (tStack.isItemStackDamageable() - && tStack.getItemDamage() >= tStack.getMaxDamage())) { - getBaseMetaTileEntity().decrStackSize(j, 1); - } else if (mInventory[j].stackSize == 1) { - mInventory[j] = tStack; - } else { - getBaseMetaTileEntity().decrStackSize(j, 1); - for (byte k = 0; k < 21; k++) { - if (mInventory[k] == null) { - mInventory[k] = tStack; - break; - } else { - if (GT_Utility.areStacksEqual(tStack, mInventory[k])) { - if (tStack.stackSize + mInventory[k].stackSize - <= mInventory[k].getMaxStackSize()) { - mInventory[k].stackSize += tStack.stackSize; - break; - } + for (byte i = 21; i < 30; i++) if (mInventory[i] != null) { + for (byte j = 0; j <= i; j++) { + if (j < 21 || j == i) { + if (GT_Utility.areStacksOrToolsEqual(mInventory[i], mInventory[j]) && mInventory[j].stackSize > 0) { + ItemStack tStack = GT_Utility.getContainerItem(mInventory[j], true); + if (tStack == null || (tStack.isItemStackDamageable() + && tStack.getItemDamage() >= tStack.getMaxDamage())) { + getBaseMetaTileEntity().decrStackSize(j, 1); + } else if (mInventory[j].stackSize == 1) { + mInventory[j] = tStack; + } else { + getBaseMetaTileEntity().decrStackSize(j, 1); + for (byte k = 0; k < 21; k++) { + if (mInventory[k] == null) { + mInventory[k] = tStack; + break; + } else { + if (GT_Utility.areStacksEqual(tStack, mInventory[k])) { + if (tStack.stackSize + mInventory[k].stackSize + <= mInventory[k].getMaxStackSize()) { + mInventory[k].stackSize += tStack.stackSize; + break; } } } } - break; } + break; } } } + } if (aHoldStack == null) { aHoldStack = GT_Utility.copy(mInventory[31]); aHoldStack.onCrafting(getBaseMetaTileEntity().getWorld(), aPlayer, mInventory[31].stackSize); @@ -465,22 +459,16 @@ public class GT_MetaTileEntity_AdvancedCraftingTable extends GT_MetaTileEntity_B } } } - /*if (aTick % 100 == 0) { - for (int i = 0; i < this.mInventory.length; i++) { - ItemStack aSlot = mInventory[i]; - Logger.INFO("Slot "+i+" "+(aSlot != null ? "contains "+aSlot.getDisplayName() : "is empty")); - } - }*/ + /* + * if (aTick % 100 == 0) { for (int i = 0; i < this.mInventory.length; i++) { ItemStack aSlot = mInventory[i]; + * Logger.INFO("Slot "+i+" "+(aSlot != null ? "contains "+aSlot.getDisplayName() : "is empty")); } } + */ } @Override public String[] getDescription() { - return new String[] { - isAdvanced() ? "For the very large Projects" : "For the smaller Projects", - "Hold Shift in GUI to see slot usage", - this.mDescription, - CORE.GT_Tooltip - }; + return new String[] { isAdvanced() ? "For the very large Projects" : "For the smaller Projects", + "Hold Shift in GUI to see slot usage", this.mDescription, CORE.GT_Tooltip }; } @Override @@ -506,67 +494,41 @@ public class GT_MetaTileEntity_AdvancedCraftingTable extends GT_MetaTileEntity_B } @Override - public ITexture[] getTexture( - final IGregTechTileEntity aBaseMetaTileEntity, - final byte aSide, - final byte aFacing, - final byte aColorIndex, - final boolean aActive, - final boolean aRedstone) { - return this.mTextures[ - (aActive ? 5 : 0) - + (aSide == aFacing - ? 0 - : aSide == GT_Utility.getOppositeSide(aFacing) - ? 1 - : aSide == 0 ? 2 : aSide == 1 ? 3 : 4)][ - aColorIndex + 1]; + public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing, + final byte aColorIndex, final boolean aActive, final boolean aRedstone) { + return this.mTextures[(aActive ? 5 : 0) + (aSide == aFacing ? 0 + : aSide == GT_Utility.getOppositeSide(aFacing) ? 1 : aSide == 0 ? 2 : aSide == 1 ? 3 : 4)][aColorIndex + + 1]; } public ITexture[] getFront(final byte aColor) { - return new ITexture[] { - isAdvanced() - ? new GT_RenderedTexture(TexturesGtBlock.Casing_Adv_Workbench_Side) - : new GT_RenderedTexture(TexturesGtBlock.Casing_Workbench_Side) - }; + return new ITexture[] { isAdvanced() ? new GT_RenderedTexture(TexturesGtBlock.Casing_Adv_Workbench_Side) + : new GT_RenderedTexture(TexturesGtBlock.Casing_Workbench_Side) }; } public ITexture[] getBack(final byte aColor) { - return new ITexture[] { - isAdvanced() - ? new GT_RenderedTexture(TexturesGtBlock.Casing_Adv_Workbench_Side) - : new GT_RenderedTexture(TexturesGtBlock.Casing_Workbench_Side) - }; + return new ITexture[] { isAdvanced() ? new GT_RenderedTexture(TexturesGtBlock.Casing_Adv_Workbench_Side) + : new GT_RenderedTexture(TexturesGtBlock.Casing_Workbench_Side) }; } public ITexture[] getBottom(final byte aColor) { - return new ITexture[] { - isAdvanced() - ? new GT_RenderedTexture(TexturesGtBlock.Casing_Adv_Workbench_Bottom) - : new GT_RenderedTexture(TexturesGtBlock.Casing_Workbench_Bottom) - }; + return new ITexture[] { isAdvanced() ? new GT_RenderedTexture(TexturesGtBlock.Casing_Adv_Workbench_Bottom) + : new GT_RenderedTexture(TexturesGtBlock.Casing_Workbench_Bottom) }; } public ITexture[] getTop(final byte aColor) { if (isAdvanced()) { - return new ITexture[] { - new GT_RenderedTexture(TexturesGtBlock.Casing_Adv_Workbench_Top), - new GT_RenderedTexture(TexturesGtBlock.Casing_Adv_Workbench_Crafting_Overlay) - }; + return new ITexture[] { new GT_RenderedTexture(TexturesGtBlock.Casing_Adv_Workbench_Top), + new GT_RenderedTexture(TexturesGtBlock.Casing_Adv_Workbench_Crafting_Overlay) }; } else { - return new ITexture[] { - new GT_RenderedTexture(TexturesGtBlock.Casing_Workbench_Top), - new GT_RenderedTexture(TexturesGtBlock.Casing_Workbench_Crafting_Overlay) - }; + return new ITexture[] { new GT_RenderedTexture(TexturesGtBlock.Casing_Workbench_Top), + new GT_RenderedTexture(TexturesGtBlock.Casing_Workbench_Crafting_Overlay) }; } } public ITexture[] getSides(final byte aColor) { - return new ITexture[] { - isAdvanced() - ? new GT_RenderedTexture(TexturesGtBlock.Casing_Adv_Workbench_Side) - : new GT_RenderedTexture(TexturesGtBlock.Casing_Workbench_Side) - }; + return new ITexture[] { isAdvanced() ? new GT_RenderedTexture(TexturesGtBlock.Casing_Adv_Workbench_Side) + : new GT_RenderedTexture(TexturesGtBlock.Casing_Workbench_Side) }; } @Override @@ -579,139 +541,115 @@ public class GT_MetaTileEntity_AdvancedCraftingTable extends GT_MetaTileEntity_B @Override public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildContext) { - builder.widget(SlotGroup.ofItemHandler(inventoryHandler, 4) - .endAtSlot(15) - .background(getGUITextureSet().getItemSlot()) - .build() - .setPos(7, 7)); + builder.widget( + SlotGroup.ofItemHandler(inventoryHandler, 4).endAtSlot(15).background(getGUITextureSet().getItemSlot()) + .build().setPos(7, 7)); for (int i = 0; i < 5; i++) { builder.widget(createElectricSlot(i + 16).setPos(81 + i * 18, 7)); } - builder.widget(SlotGroup.ofItemHandler(inventoryHandler, 3) - .startFromSlot(21) - .endAtSlot(29) - .background(getGUITextureSet().getItemSlot()) - .applyForWidget(SlotWidget::disableShiftInsert) - .build() - .setPos(81, 27)); - builder.widget(new SlotWidget(inventoryHandler, 33) - .disableShiftInsert() - .addTooltipShift("Extraction Slot") + builder.widget( + SlotGroup.ofItemHandler(inventoryHandler, 3).startFromSlot(21).endAtSlot(29) + .background(getGUITextureSet().getItemSlot()).applyForWidget(SlotWidget::disableShiftInsert) + .build().setPos(81, 27)); + builder.widget( + new SlotWidget(inventoryHandler, 33).disableShiftInsert().addTooltipShift("Extraction Slot") .addTooltipShift("Things can always be pulled from here") - .setBackground(getGUITextureSet().getItemSlot(), getArrowOverlay()) - .setPos(153, 27)) - .widget(new SlotWidget(inventoryHandler, 34) - .disableShiftInsert() - .addTooltipShift("Free Parking") - .setBackground(getGUITextureSet().getItemSlot(), getParkOverlay()) - .setPos(153, 63)); + .setBackground(getGUITextureSet().getItemSlot(), getArrowOverlay()).setPos(153, 27)) + .widget( + new SlotWidget(inventoryHandler, 34).disableShiftInsert().addTooltipShift("Free Parking") + .setBackground(getGUITextureSet().getItemSlot(), getParkOverlay()).setPos(153, 63)); + + builder.widget(new SlotWidget(inventoryHandler, 30) { + + @Override + public ClickResult onClick(int buttonId, boolean doubleClick) { + if (buttonId == 0 && Interactable.hasShiftDown()) { + syncToServer(99, NetworkUtils.EMPTY_PACKET); + return ClickResult.SUCCESS; + } + return super.onClick(buttonId, doubleClick); + } - builder.widget( - new SlotWidget(inventoryHandler, 30) { - @Override - public ClickResult onClick(int buttonId, boolean doubleClick) { - if (buttonId == 0 && Interactable.hasShiftDown()) { - syncToServer(99, NetworkUtils.EMPTY_PACKET); - return ClickResult.SUCCESS; + @Override + public void readOnServer(int id, PacketBuffer buf) throws IOException { + if (id == 99) { + setBluePrint(null); + } else { + super.readOnServer(id, buf); + } + } + }.setFilter(stack -> stack.getItem() instanceof IItemBlueprint).disableShiftInsert() + .addTooltipShift("Blueprint Slot").addTooltipShift("Shift+Lmb Sets to crafting output") + .setBackground(getGUITextureSet().getItemSlot(), getBlueprintOverlay()).setPos(135, 27)); + + builder.widget(new SlotWidget(BaseSlot.phantom(inventoryHandler, 31)) { + + @Override + protected void phantomClick(ClickData clickData, ItemStack cursorStack) { + EntityPlayer aPlayer = getContext().getPlayer(); + ItemStack tStack = getMcSlot().getStack(); + if (tStack == null) return; + if (tStack.stackSize <= 0 && !GT_Utility.areStacksEqual(tStack, aPlayer.inventory.getItemStack())) { + return; + } + ItemStack tStack2, tCraftedStack = getCraftingOutput(); + if (tCraftedStack != null) { + if (clickData.shift) { + for (byte i = 0; i < aPlayer.inventory.mainInventory.length; i++) { + for (byte j = 0; j < tCraftedStack.getMaxStackSize() / tCraftedStack.stackSize + && canDoCraftingOutput(); j++) { + if (!GT_Utility.areStacksEqual(tStack2 = getCraftingOutput(), tCraftedStack) + || tStack.stackSize != tStack2.stackSize) + return; + aPlayer.inventory.mainInventory[i] = consumeMaterials( + aPlayer, + aPlayer.inventory.mainInventory[i]); + } } - return super.onClick(buttonId, doubleClick); - } - - @Override - public void readOnServer(int id, PacketBuffer buf) throws IOException { - if (id == 99) { - setBluePrint(null); + } else { + if (clickData.mouseButton == 0) { + if (canDoCraftingOutput()) aPlayer.inventory + .setItemStack(consumeMaterials(aPlayer, aPlayer.inventory.getItemStack())); } else { - super.readOnServer(id, buf); - } - } - }.setFilter(stack -> stack.getItem() instanceof IItemBlueprint) - .disableShiftInsert() - .addTooltipShift("Blueprint Slot") - .addTooltipShift("Shift+Lmb Sets to crafting output") - .setBackground(getGUITextureSet().getItemSlot(), getBlueprintOverlay()) - .setPos(135, 27)); - - builder.widget( - new SlotWidget(BaseSlot.phantom(inventoryHandler, 31)) { - @Override - protected void phantomClick(ClickData clickData, ItemStack cursorStack) { - EntityPlayer aPlayer = getContext().getPlayer(); - ItemStack tStack = getMcSlot().getStack(); - if (tStack == null) return; - if (tStack.stackSize <= 0 - && !GT_Utility.areStacksEqual(tStack, aPlayer.inventory.getItemStack())) { - return; - } - ItemStack tStack2, tCraftedStack = getCraftingOutput(); - if (tCraftedStack != null) { - if (clickData.shift) { - for (byte i = 0; i < aPlayer.inventory.mainInventory.length; i++) { - for (byte j = 0; - j < tCraftedStack.getMaxStackSize() / tCraftedStack.stackSize - && canDoCraftingOutput(); - j++) { - if (!GT_Utility.areStacksEqual(tStack2 = getCraftingOutput(), tCraftedStack) - || tStack.stackSize != tStack2.stackSize) return; - aPlayer.inventory.mainInventory[i] = - consumeMaterials(aPlayer, aPlayer.inventory.mainInventory[i]); - } - } - } else { - if (clickData.mouseButton == 0) { - if (canDoCraftingOutput()) - aPlayer.inventory.setItemStack( - consumeMaterials(aPlayer, aPlayer.inventory.getItemStack())); - } else { - for (int i = 0; - i < tCraftedStack.getMaxStackSize() / tCraftedStack.stackSize - && canDoCraftingOutput(); - i++) { - if (!GT_Utility.areStacksEqual(tStack2 = getCraftingOutput(), tCraftedStack) - || tStack.stackSize != tStack2.stackSize) return; - aPlayer.inventory.setItemStack( - consumeMaterials(aPlayer, aPlayer.inventory.getItemStack())); - } - } + for (int i = 0; i < tCraftedStack.getMaxStackSize() / tCraftedStack.stackSize + && canDoCraftingOutput(); i++) { + if (!GT_Utility.areStacksEqual(tStack2 = getCraftingOutput(), tCraftedStack) + || tStack.stackSize != tStack2.stackSize) + return; + aPlayer.inventory + .setItemStack(consumeMaterials(aPlayer, aPlayer.inventory.getItemStack())); } } } + } + } - @Override - public boolean handleDragAndDrop(ItemStack draggedStack, int button) { - return false; - } + @Override + public boolean handleDragAndDrop(ItemStack draggedStack, int button) { + return false; + } - @Override - public List<String> getExtraTooltip() { - return Collections.emptyList(); - } - }.setAccess(false, false) - .setHandlePhantomActionClient(true) - .addTooltipShift("Output Slot") - .setBackground(getGUITextureSet().getItemSlot(), getCraftOutputOverlay()) - .setPos(135, 63)); - - builder.widget(new ButtonWidget() - .setOnClick((clickData, widget) -> sortIntoTheInputSlots()) - .addTooltipShift("Flush") + @Override + public List<String> getExtraTooltip() { + return Collections.emptyList(); + } + }.setAccess(false, false).setHandlePhantomActionClient(true).addTooltipShift("Output Slot") + .setBackground(getGUITextureSet().getItemSlot(), getCraftOutputOverlay()).setPos(135, 63)); + + builder.widget( + new ButtonWidget().setOnClick((clickData, widget) -> sortIntoTheInputSlots()).addTooltipShift("Flush") .addTooltipShift("Empty crafting grid back to storage") - .setBackground(getButtonIcon(), getFlushOverlay()) - .setPos(135, 45) - .setSize(18, 18)) - .widget(new ButtonWidget() - .setOnClick((clickData, widget) -> mFlushMode = true) - .addTooltipShift("Automation") - .addTooltipShift("Allows output while") - .addTooltipShift("crafting grid is full") - .setBackground(getButtonIcon(), GTPP_UITextures.OVERLAY_BUTTON_AUTOMATION) - .setPos(153, 45) - .setSize(18, 18)); + .setBackground(getButtonIcon(), getFlushOverlay()).setPos(135, 45).setSize(18, 18)) + .widget( + new ButtonWidget().setOnClick((clickData, widget) -> mFlushMode = true) + .addTooltipShift("Automation").addTooltipShift("Allows output while") + .addTooltipShift("crafting grid is full") + .setBackground(getButtonIcon(), GTPP_UITextures.OVERLAY_BUTTON_AUTOMATION) + .setPos(153, 45).setSize(18, 18)); } protected SlotWidget createElectricSlot(int index) { - return (SlotWidget) new ElectricSlotWidget(inventoryHandler, index) - .setShiftClickPriority(-1) + return (SlotWidget) new ElectricSlotWidget(inventoryHandler, index).setShiftClickPriority(-1) .setBackground(getGUITextureSet().getItemSlot(), GTPP_UITextures.OVERLAY_SLOT_ELECTRIC_TOOL); } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GT_MetaTileEntity_BronzeCraftingTable.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GT_MetaTileEntity_BronzeCraftingTable.java index eae9bb79ba..a28c4d90a3 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GT_MetaTileEntity_BronzeCraftingTable.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GT_MetaTileEntity_BronzeCraftingTable.java @@ -2,6 +2,7 @@ package gtPlusPlus.xmod.gregtech.common.tileentities.storage; import com.gtnewhorizons.modularui.api.drawable.IDrawable; import com.gtnewhorizons.modularui.common.widget.SlotWidget; + import gregtech.api.GregTech_API; import gregtech.api.enums.SteamVariant; import gregtech.api.gui.modularui.GUITextureSet; @@ -13,13 +14,13 @@ import gtPlusPlus.xmod.gregtech.api.gui.GTPP_UITextures; public class GT_MetaTileEntity_BronzeCraftingTable extends GT_MetaTileEntity_AdvancedCraftingTable { - public GT_MetaTileEntity_BronzeCraftingTable( - final int aID, final String aName, final String aNameRegional, final int aTier, final String aDescription) { + public GT_MetaTileEntity_BronzeCraftingTable(final int aID, final String aName, final String aNameRegional, + final int aTier, final String aDescription) { super(aID, aName, aNameRegional, aTier, aDescription); } - public GT_MetaTileEntity_BronzeCraftingTable( - final String aName, final int aTier, final String aDescription, final ITexture[][][] aTextures) { + public GT_MetaTileEntity_BronzeCraftingTable(final String aName, final int aTier, final String aDescription, + final ITexture[][][] aTextures) { super(aName, aTier, aDescription, aTextures); } @@ -76,8 +77,7 @@ public class GT_MetaTileEntity_BronzeCraftingTable extends GT_MetaTileEntity_Adv @Override protected SlotWidget createElectricSlot(int index) { - return (SlotWidget) new SlotWidget(inventoryHandler, index) - .setBackground(getGUITextureSet().getItemSlot()); + return (SlotWidget) new SlotWidget(inventoryHandler, index).setBackground(getGUITextureSet().getItemSlot()); } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GT_MetaTileEntity_ConnectableCrate.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GT_MetaTileEntity_ConnectableCrate.java index 2c29a0a00b..b51eae3131 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GT_MetaTileEntity_ConnectableCrate.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GT_MetaTileEntity_ConnectableCrate.java @@ -1,10 +1,17 @@ package gtPlusPlus.xmod.gregtech.common.tileentities.storage; +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; + import com.gtnewhorizons.modularui.api.screen.ModularWindow; import com.gtnewhorizons.modularui.api.screen.UIBuildContext; import com.gtnewhorizons.modularui.common.widget.DrawableWidget; import com.gtnewhorizons.modularui.common.widget.SlotWidget; import com.gtnewhorizons.modularui.common.widget.TextWidget; + import gregtech.api.GregTech_API; import gregtech.api.enums.Textures.BlockIcons; import gregtech.api.gui.modularui.GT_UIInfos; @@ -22,20 +29,13 @@ import gtPlusPlus.api.objects.minecraft.BlockPos; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.util.data.ArrayUtils; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; -import net.minecraft.block.Block; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.tileentity.TileEntity; public class GT_MetaTileEntity_ConnectableCrate extends GT_MetaTileEntity_TieredMachineBlock implements IAddUIWidgets { - /*sides.put(getUp()); - sides.put(getDown()); - sides.put(getXPos()); - sides.put(getXNeg()); - sides.put(getZPos()); - sides.put(getZNeg());*/ + /* + * sides.put(getUp()); sides.put(getDown()); sides.put(getXPos()); sides.put(getXNeg()); sides.put(getZPos()); + * sides.put(getZNeg()); + */ public int mItemCount = 0; public ItemStack mItemStack = null; @@ -51,7 +51,7 @@ public class GT_MetaTileEntity_ConnectableCrate extends GT_MetaTileEntity_Tiered public static final int SIDE_XNeg = 3; public static final int SIDE_ZPos = 4; public static final int SIDE_ZNeg = 5; - public static final int[] SIDES = new int[] {SIDE_Up, SIDE_Down, SIDE_XPos, SIDE_XNeg, SIDE_ZPos, SIDE_ZNeg}; + public static final int[] SIDES = new int[] { SIDE_Up, SIDE_Down, SIDE_XPos, SIDE_XNeg, SIDE_ZPos, SIDE_ZNeg }; // Neighbour Cache private GT_MetaTileEntity_ConnectableCrate[] mNeighbourCache = new GT_MetaTileEntity_ConnectableCrate[6]; @@ -62,7 +62,7 @@ public class GT_MetaTileEntity_ConnectableCrate extends GT_MetaTileEntity_Tiered // Is Master? protected boolean mIsMaster = false; // Is Connected? - protected boolean mIsConnected[] = new boolean[] {false, false, false, false, false, false}; + protected boolean mIsConnected[] = new boolean[] { false, false, false, false, false, false }; // How many are connected? protected int mConnectedCount = 0; // Map of connected locations @@ -85,7 +85,7 @@ public class GT_MetaTileEntity_ConnectableCrate extends GT_MetaTileEntity_Tiered @Override public String[] getDescription() { - return new String[] {this.mDescription, CORE.GT_Tooltip}; + return new String[] { this.mDescription, CORE.GT_Tooltip }; } public boolean isSimpleMachine() { @@ -187,10 +187,8 @@ public class GT_MetaTileEntity_ConnectableCrate extends GT_MetaTileEntity_Tiered // Other Crate was not a Master, but we are, time to inherit it into our connection hivemind. else { // It would appear this controller has another master, time to query it. - if (e.mMasterCrateLocation != null - && !e.mMasterCrateLocation - .getUniqueIdentifier() - .equalsIgnoreCase(this.mMasterCrateLocation.getUniqueIdentifier())) { + if (e.mMasterCrateLocation != null && !e.mMasterCrateLocation.getUniqueIdentifier() + .equalsIgnoreCase(this.mMasterCrateLocation.getUniqueIdentifier())) { GT_MetaTileEntity_ConnectableCrate gM = getCrateAtBlockPos(e.mMasterCrateLocation); if (gM != null) { // Lets compare controller strengths @@ -207,8 +205,8 @@ public class GT_MetaTileEntity_ConnectableCrate extends GT_MetaTileEntity_Tiered if (!this.mIsConnected[e4]) { this.mIsConnected[e4] = true; } - this.mConnectedCache = - ArrayUtils.mergeTwoMaps(this.mConnectedCache, gM.mConnectedCache); + this.mConnectedCache = ArrayUtils + .mergeTwoMaps(this.mConnectedCache, gM.mConnectedCache); continue; } // We lost, time to submit to a new master crate @@ -221,8 +219,8 @@ public class GT_MetaTileEntity_ConnectableCrate extends GT_MetaTileEntity_Tiered if (!e.mIsConnected[getOppositeSide(e4)]) { e.mIsConnected[getOppositeSide(e4)] = true; } - gM.mConnectedCache = - ArrayUtils.mergeTwoMaps(gM.mConnectedCache, this.mConnectedCache); + gM.mConnectedCache = ArrayUtils + .mergeTwoMaps(gM.mConnectedCache, this.mConnectedCache); // Best wipe our cache of connected blocks then, since they no longer hold // value. mConnectedCache.clear(); @@ -332,14 +330,10 @@ public class GT_MetaTileEntity_ConnectableCrate extends GT_MetaTileEntity_Tiered } private boolean checkSideForDataType(int aType, int aSide) { - BlockPos mPosToCheck = aSide == SIDE_Up - ? mCurrentPos.getUp() - : aSide == SIDE_Down - ? mCurrentPos.getDown() - : aSide == SIDE_XPos - ? mCurrentPos.getXPos() - : aSide == SIDE_XNeg - ? mCurrentPos.getXNeg() + BlockPos mPosToCheck = aSide == SIDE_Up ? mCurrentPos.getUp() + : aSide == SIDE_Down ? mCurrentPos.getDown() + : aSide == SIDE_XPos ? mCurrentPos.getXPos() + : aSide == SIDE_XNeg ? mCurrentPos.getXNeg() : aSide == SIDE_ZPos ? mCurrentPos.getZPos() : mCurrentPos.getZNeg(); GT_MetaTileEntity_ConnectableCrate g = getCrateAtBlockPos(mPosToCheck); if (g != null) { @@ -383,8 +377,7 @@ public class GT_MetaTileEntity_ConnectableCrate extends GT_MetaTileEntity_Tiered } public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTimer) { - if (this.getBaseMetaTileEntity().isServerSide() - && this.getBaseMetaTileEntity().isAllowedToWork()) { + if (this.getBaseMetaTileEntity().isServerSide() && this.getBaseMetaTileEntity().isAllowedToWork()) { if (this.getItemCount() <= 0) { this.mItemStack = null; this.mItemCount = 0; @@ -394,8 +387,7 @@ public class GT_MetaTileEntity_ConnectableCrate extends GT_MetaTileEntity_Tiered this.mItemStack = this.mInventory[0].copy(); } - if (this.mInventory[0] != null - && this.mItemCount < this.getMaxItemCount() + if (this.mInventory[0] != null && this.mItemCount < this.getMaxItemCount() && GT_Utility.areStacksEqual(this.mInventory[0], this.mItemStack)) { this.mItemCount += this.mInventory[0].stackSize; if (this.mItemCount > this.getMaxItemCount()) { @@ -410,14 +402,14 @@ public class GT_MetaTileEntity_ConnectableCrate extends GT_MetaTileEntity_Tiered this.mInventory[1] = this.mItemStack.copy(); this.mInventory[1].stackSize = Math.min(this.mItemStack.getMaxStackSize(), this.mItemCount); this.mItemCount -= this.mInventory[1].stackSize; - } else if (this.mItemCount > 0 - && GT_Utility.areStacksEqual(this.mInventory[1], this.mItemStack) + } else if (this.mItemCount > 0 && GT_Utility.areStacksEqual(this.mInventory[1], this.mItemStack) && this.mInventory[1].getMaxStackSize() > this.mInventory[1].stackSize) { - int tmp = - Math.min(this.mItemCount, this.mInventory[1].getMaxStackSize() - this.mInventory[1].stackSize); - this.mInventory[1].stackSize += tmp; - this.mItemCount -= tmp; - } + int tmp = Math.min( + this.mItemCount, + this.mInventory[1].getMaxStackSize() - this.mInventory[1].stackSize); + this.mInventory[1].stackSize += tmp; + this.mItemCount -= tmp; + } if (this.mItemStack != null) { this.mInventory[2] = this.mItemStack.copy(); @@ -437,8 +429,7 @@ public class GT_MetaTileEntity_ConnectableCrate extends GT_MetaTileEntity_Tiered } public int getProgresstime() { - return this.mItemCount - + (this.mInventory[0] == null ? 0 : this.mInventory[0].stackSize) + return this.mItemCount + (this.mInventory[0] == null ? 0 : this.mInventory[0].stackSize) + (this.mInventory[1] == null ? 0 : this.mInventory[1].stackSize); } @@ -460,20 +451,10 @@ public class GT_MetaTileEntity_ConnectableCrate extends GT_MetaTileEntity_Tiered public String[] getInfoData() { return this.mItemStack == null - ? new String[] { - "Super Storage Chest", - "Stored Items:", - "No Items", - Integer.toString(0), - Integer.toString(this.getMaxItemCount()) - } - : new String[] { - "Super Storage Chest", - "Stored Items:", - this.mItemStack.getDisplayName(), - Integer.toString(this.mItemCount), - Integer.toString(this.getMaxItemCount()) - }; + ? new String[] { "Super Storage Chest", "Stored Items:", "No Items", Integer.toString(0), + Integer.toString(this.getMaxItemCount()) } + : new String[] { "Super Storage Chest", "Stored Items:", this.mItemStack.getDisplayName(), + Integer.toString(this.mItemCount), Integer.toString(this.getMaxItemCount()) }; } public boolean isGivingInformation() { @@ -518,24 +499,15 @@ public class GT_MetaTileEntity_ConnectableCrate extends GT_MetaTileEntity_Tiered } } - public ITexture[] getTexture( - IGregTechTileEntity aBaseMetaTileEntity, - byte aSide, - byte aFacing, - byte aColorIndex, - boolean aActive, - boolean aRedstone) { + public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, + boolean aActive, boolean aRedstone) { return aBaseMetaTileEntity.getFrontFacing() == 0 && aSide == 4 - ? new ITexture[] { - new GT_RenderedTexture(TexturesGtBlock.TEXTURE_CASING_AMAZON), - new GT_RenderedTexture(BlockIcons.OVERLAY_QCHEST) - } + ? new ITexture[] { new GT_RenderedTexture(TexturesGtBlock.TEXTURE_CASING_AMAZON), + new GT_RenderedTexture(BlockIcons.OVERLAY_QCHEST) } : (aSide == aBaseMetaTileEntity.getFrontFacing() - ? new ITexture[] { - new GT_RenderedTexture(TexturesGtBlock.TEXTURE_CASING_AMAZON), - new GT_RenderedTexture(BlockIcons.OVERLAY_QCHEST) - } - : new ITexture[] {new GT_RenderedTexture(TexturesGtBlock.TEXTURE_CASING_AMAZON)}); + ? new ITexture[] { new GT_RenderedTexture(TexturesGtBlock.TEXTURE_CASING_AMAZON), + new GT_RenderedTexture(BlockIcons.OVERLAY_QCHEST) } + : new ITexture[] { new GT_RenderedTexture(TexturesGtBlock.TEXTURE_CASING_AMAZON) }); } public ITexture[][][] getTextureSet(ITexture[] aTextures) { @@ -567,26 +539,21 @@ public class GT_MetaTileEntity_ConnectableCrate extends GT_MetaTileEntity_Tiered @Override public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildContext) { - builder.widget(new DrawableWidget() - .setDrawable(GT_UITextures.PICTURE_SCREEN_BLACK) - .setPos(7, 16) - .setSize(71, 45)) - .widget(new SlotWidget(inventoryHandler, 0) - .setBackground(getGUITextureSet().getItemSlot(), GT_UITextures.OVERLAY_SLOT_IN) - .setPos(79, 16)) - .widget(new SlotWidget(inventoryHandler, 1) - .setAccess(true, false) - .setBackground(getGUITextureSet().getItemSlot(), GT_UITextures.OVERLAY_SLOT_OUT) - .setPos(79, 52)) - .widget(SlotWidget.phantom(inventoryHandler, 2) - .disableInteraction() - .setBackground(GT_UITextures.TRANSPARENT) - .setPos(59, 42)) - .widget(new TextWidget("Item Amount") - .setDefaultColor(COLOR_TEXT_WHITE.get()) - .setPos(10, 20)) - .widget(TextWidget.dynamicString(() -> GT_Utility.parseNumberToString(mItemCount)) - .setDefaultColor(COLOR_TEXT_WHITE.get()) - .setPos(10, 30)); + builder.widget( + new DrawableWidget().setDrawable(GT_UITextures.PICTURE_SCREEN_BLACK).setPos(7, 16).setSize(71, 45)) + .widget( + new SlotWidget(inventoryHandler, 0) + .setBackground(getGUITextureSet().getItemSlot(), GT_UITextures.OVERLAY_SLOT_IN) + .setPos(79, 16)) + .widget( + new SlotWidget(inventoryHandler, 1).setAccess(true, false) + .setBackground(getGUITextureSet().getItemSlot(), GT_UITextures.OVERLAY_SLOT_OUT) + .setPos(79, 52)) + .widget( + SlotWidget.phantom(inventoryHandler, 2).disableInteraction() + .setBackground(GT_UITextures.TRANSPARENT).setPos(59, 42)) + .widget(new TextWidget("Item Amount").setDefaultColor(COLOR_TEXT_WHITE.get()).setPos(10, 20)).widget( + TextWidget.dynamicString(() -> GT_Utility.parseNumberToString(mItemCount)) + .setDefaultColor(COLOR_TEXT_WHITE.get()).setPos(10, 30)); } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GT_MetaTileEntity_TieredChest.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GT_MetaTileEntity_TieredChest.java index eb5541ef82..103e0a159f 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GT_MetaTileEntity_TieredChest.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GT_MetaTileEntity_TieredChest.java @@ -1,10 +1,15 @@ package gtPlusPlus.xmod.gregtech.common.tileentities.storage; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; + import com.gtnewhorizons.modularui.api.screen.ModularWindow; import com.gtnewhorizons.modularui.api.screen.UIBuildContext; import com.gtnewhorizons.modularui.common.widget.DrawableWidget; import com.gtnewhorizons.modularui.common.widget.SlotWidget; import com.gtnewhorizons.modularui.common.widget.TextWidget; + import gregtech.api.enums.Textures.BlockIcons; import gregtech.api.gui.modularui.GT_UIInfos; import gregtech.api.gui.modularui.GT_UITextures; @@ -16,11 +21,9 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_TieredMachi import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.util.GT_Utility; import gtPlusPlus.core.lib.CORE; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; public class GT_MetaTileEntity_TieredChest extends GT_MetaTileEntity_TieredMachineBlock implements IAddUIWidgets { + public int mItemCount = 0; public ItemStack mItemStack = null; private static final double mStorageFactor = (270000.0D / 16); @@ -40,13 +43,14 @@ public class GT_MetaTileEntity_TieredChest extends GT_MetaTileEntity_TieredMachi super(aName, aTier, 3, aDescription, aTextures); } - /*public GT_MetaTileEntity_TieredChest(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) { - super(aName, aTier, 3, aDescription, aTextures); - }*/ + /* + * public GT_MetaTileEntity_TieredChest(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) { + * super(aName, aTier, 3, aDescription, aTextures); } + */ @Override public String[] getDescription() { - return new String[] {this.mDescription, CORE.GT_Tooltip}; + return new String[] { this.mDescription, CORE.GT_Tooltip }; } public boolean isSimpleMachine() { @@ -75,8 +79,7 @@ public class GT_MetaTileEntity_TieredChest extends GT_MetaTileEntity_TieredMachi } public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTimer) { - if (this.getBaseMetaTileEntity().isServerSide() - && this.getBaseMetaTileEntity().isAllowedToWork()) { + if (this.getBaseMetaTileEntity().isServerSide() && this.getBaseMetaTileEntity().isAllowedToWork()) { if (this.getItemCount() <= 0) { this.mItemStack = null; this.mItemCount = 0; @@ -86,8 +89,7 @@ public class GT_MetaTileEntity_TieredChest extends GT_MetaTileEntity_TieredMachi this.mItemStack = this.mInventory[0].copy(); } - if (this.mInventory[0] != null - && this.mItemCount < this.getMaxItemCount() + if (this.mInventory[0] != null && this.mItemCount < this.getMaxItemCount() && GT_Utility.areStacksEqual(this.mInventory[0], this.mItemStack)) { this.mItemCount += this.mInventory[0].stackSize; if (this.mItemCount > this.getMaxItemCount()) { @@ -102,14 +104,14 @@ public class GT_MetaTileEntity_TieredChest extends GT_MetaTileEntity_TieredMachi this.mInventory[1] = this.mItemStack.copy(); this.mInventory[1].stackSize = Math.min(this.mItemStack.getMaxStackSize(), this.mItemCount); this.mItemCount -= this.mInventory[1].stackSize; - } else if (this.mItemCount > 0 - && GT_Utility.areStacksEqual(this.mInventory[1], this.mItemStack) + } else if (this.mItemCount > 0 && GT_Utility.areStacksEqual(this.mInventory[1], this.mItemStack) && this.mInventory[1].getMaxStackSize() > this.mInventory[1].stackSize) { - int tmp = - Math.min(this.mItemCount, this.mInventory[1].getMaxStackSize() - this.mInventory[1].stackSize); - this.mInventory[1].stackSize += tmp; - this.mItemCount -= tmp; - } + int tmp = Math.min( + this.mItemCount, + this.mInventory[1].getMaxStackSize() - this.mInventory[1].stackSize); + this.mInventory[1].stackSize += tmp; + this.mItemCount -= tmp; + } if (this.mItemStack != null) { this.mInventory[2] = this.mItemStack.copy(); @@ -129,8 +131,7 @@ public class GT_MetaTileEntity_TieredChest extends GT_MetaTileEntity_TieredMachi } public int getProgresstime() { - return this.mItemCount - + (this.mInventory[0] == null ? 0 : this.mInventory[0].stackSize) + return this.mItemCount + (this.mInventory[0] == null ? 0 : this.mInventory[0].stackSize) + (this.mInventory[1] == null ? 0 : this.mInventory[1].stackSize); } @@ -152,20 +153,10 @@ public class GT_MetaTileEntity_TieredChest extends GT_MetaTileEntity_TieredMachi public String[] getInfoData() { return this.mItemStack == null - ? new String[] { - "Super Storage Chest", - "Stored Items:", - "No Items", - Integer.toString(0), - Integer.toString(this.getMaxItemCount()) - } - : new String[] { - "Super Storage Chest", - "Stored Items:", - this.mItemStack.getDisplayName(), - Integer.toString(this.mItemCount), - Integer.toString(this.getMaxItemCount()) - }; + ? new String[] { "Super Storage Chest", "Stored Items:", "No Items", Integer.toString(0), + Integer.toString(this.getMaxItemCount()) } + : new String[] { "Super Storage Chest", "Stored Items:", this.mItemStack.getDisplayName(), + Integer.toString(this.mItemCount), Integer.toString(this.getMaxItemCount()) }; } public boolean isGivingInformation() { @@ -189,24 +180,15 @@ public class GT_MetaTileEntity_TieredChest extends GT_MetaTileEntity_TieredMachi } } - public ITexture[] getTexture( - IGregTechTileEntity aBaseMetaTileEntity, - byte aSide, - byte aFacing, - byte aColorIndex, - boolean aActive, - boolean aRedstone) { + public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, + boolean aActive, boolean aRedstone) { return aBaseMetaTileEntity.getFrontFacing() == 0 && aSide == 4 - ? new ITexture[] { - BlockIcons.MACHINE_CASINGS[this.mTier][aColorIndex + 1], - new GT_RenderedTexture(BlockIcons.OVERLAY_QCHEST) - } + ? new ITexture[] { BlockIcons.MACHINE_CASINGS[this.mTier][aColorIndex + 1], + new GT_RenderedTexture(BlockIcons.OVERLAY_QCHEST) } : (aSide == aBaseMetaTileEntity.getFrontFacing() - ? new ITexture[] { - BlockIcons.MACHINE_CASINGS[this.mTier][aColorIndex + 1], - new GT_RenderedTexture(BlockIcons.OVERLAY_QCHEST) - } - : new ITexture[] {BlockIcons.MACHINE_CASINGS[this.mTier][aColorIndex + 1]}); + ? new ITexture[] { BlockIcons.MACHINE_CASINGS[this.mTier][aColorIndex + 1], + new GT_RenderedTexture(BlockIcons.OVERLAY_QCHEST) } + : new ITexture[] { BlockIcons.MACHINE_CASINGS[this.mTier][aColorIndex + 1] }); } public ITexture[][][] getTextureSet(ITexture[] aTextures) { @@ -220,26 +202,21 @@ public class GT_MetaTileEntity_TieredChest extends GT_MetaTileEntity_TieredMachi @Override public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildContext) { - builder.widget(new DrawableWidget() - .setDrawable(GT_UITextures.PICTURE_SCREEN_BLACK) - .setPos(7, 16) - .setSize(71, 45)) - .widget(new SlotWidget(inventoryHandler, 0) - .setBackground(getGUITextureSet().getItemSlot(), GT_UITextures.OVERLAY_SLOT_IN) - .setPos(79, 16)) - .widget(new SlotWidget(inventoryHandler, 1) - .setAccess(true, false) - .setBackground(getGUITextureSet().getItemSlot(), GT_UITextures.OVERLAY_SLOT_OUT) - .setPos(79, 52)) - .widget(SlotWidget.phantom(inventoryHandler, 2) - .disableInteraction() - .setBackground(GT_UITextures.TRANSPARENT) - .setPos(59, 42)) - .widget(new TextWidget("Item Amount") - .setDefaultColor(COLOR_TEXT_WHITE.get()) - .setPos(10, 20)) - .widget(TextWidget.dynamicString(() -> GT_Utility.parseNumberToString(mItemCount)) - .setDefaultColor(COLOR_TEXT_WHITE.get()) - .setPos(10, 30)); + builder.widget( + new DrawableWidget().setDrawable(GT_UITextures.PICTURE_SCREEN_BLACK).setPos(7, 16).setSize(71, 45)) + .widget( + new SlotWidget(inventoryHandler, 0) + .setBackground(getGUITextureSet().getItemSlot(), GT_UITextures.OVERLAY_SLOT_IN) + .setPos(79, 16)) + .widget( + new SlotWidget(inventoryHandler, 1).setAccess(true, false) + .setBackground(getGUITextureSet().getItemSlot(), GT_UITextures.OVERLAY_SLOT_OUT) + .setPos(79, 52)) + .widget( + SlotWidget.phantom(inventoryHandler, 2).disableInteraction() + .setBackground(GT_UITextures.TRANSPARENT).setPos(59, 42)) + .widget(new TextWidget("Item Amount").setDefaultColor(COLOR_TEXT_WHITE.get()).setPos(10, 20)).widget( + TextWidget.dynamicString(() -> GT_Utility.parseNumberToString(mItemCount)) + .setDefaultColor(COLOR_TEXT_WHITE.get()).setPos(10, 30)); } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GT_MetaTileEntity_TieredTank.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GT_MetaTileEntity_TieredTank.java index 3bd7628e79..9366bc4d92 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GT_MetaTileEntity_TieredTank.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GT_MetaTileEntity_TieredTank.java @@ -1,5 +1,8 @@ package gtPlusPlus.xmod.gregtech.common.tileentities.storage; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.nbt.NBTTagCompound; + import gregtech.api.enums.GT_Values; import gregtech.api.enums.Textures; import gregtech.api.gui.modularui.GT_UIInfos; @@ -10,18 +13,16 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicTank; import gregtech.api.objects.GT_RenderedTexture; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.lib.CORE; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.nbt.NBTTagCompound; public class GT_MetaTileEntity_TieredTank extends GT_MetaTileEntity_BasicTank { - public GT_MetaTileEntity_TieredTank( - final int aID, final String aName, final String aNameRegional, final int aTier) { + public GT_MetaTileEntity_TieredTank(final int aID, final String aName, final String aNameRegional, + final int aTier) { super(aID, aName, aNameRegional, aTier, 3, "Stores " + ((int) (Math.pow(2, aTier) * 32000)) + "L of fluid"); } - public GT_MetaTileEntity_TieredTank( - final String aName, final int aTier, final String aDescription, final ITexture[][][] aTextures) { + public GT_MetaTileEntity_TieredTank(final String aName, final int aTier, final String aDescription, + final ITexture[][][] aTextures) { super(aName, aTier, 3, "Stores " + ((int) (Math.pow(2, aTier) * 32000)) + "L of fluid", aTextures); } @@ -32,14 +33,10 @@ public class GT_MetaTileEntity_TieredTank extends GT_MetaTileEntity_BasicTank { String aTankPortableness = "portable"; if (this.mFluid == null) { - aTip = new String[] {this.mDescription, "A " + aTankPortableness + " tank.", CORE.GT_Tooltip}; + aTip = new String[] { this.mDescription, "A " + aTankPortableness + " tank.", CORE.GT_Tooltip }; } else { - aTip = new String[] { - this.mDescription, - "A " + aTankPortableness + " tank.", - "Fluid: " + mFluid.getLocalizedName() + " " + mFluid.amount + "L", - CORE.GT_Tooltip - }; + aTip = new String[] { this.mDescription, "A " + aTankPortableness + " tank.", + "Fluid: " + mFluid.getLocalizedName() + " " + mFluid.amount + "L", CORE.GT_Tooltip }; } return aTip; } @@ -50,22 +47,13 @@ public class GT_MetaTileEntity_TieredTank extends GT_MetaTileEntity_BasicTank { } @Override - public ITexture[] getTexture( - final IGregTechTileEntity aBaseMetaTileEntity, - final byte aSide, - final byte aFacing, - final byte aColorIndex, - final boolean aActive, - final boolean aRedstone) { + public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing, + final byte aColorIndex, final boolean aActive, final boolean aRedstone) { return aSide == 1 - ? new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColorIndex + 1], - new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_POTIONBREWER_ACTIVE) - } - : new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColorIndex + 1], - new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_POTIONBREWER) - }; + ? new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColorIndex + 1], + new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_POTIONBREWER_ACTIVE) } + : new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColorIndex + 1], + new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_POTIONBREWER) }; } @Override @@ -112,21 +100,12 @@ public class GT_MetaTileEntity_TieredTank extends GT_MetaTileEntity_BasicTank { public String[] getInfoData() { if (this.mFluid == null) { - return new String[] { - GT_Values.VOLTAGE_NAMES[this.mTier] + " Fluid Tank", - "Stored Fluid:", - "No Fluid", - Integer.toString(0) + "L", - Integer.toString(this.getCapacity()) + "L" - }; + return new String[] { GT_Values.VOLTAGE_NAMES[this.mTier] + " Fluid Tank", "Stored Fluid:", "No Fluid", + Integer.toString(0) + "L", Integer.toString(this.getCapacity()) + "L" }; } - return new String[] { - GT_Values.VOLTAGE_NAMES[this.mTier] + " Fluid Tank", - "Stored Fluid:", - this.mFluid.getLocalizedName(), - Integer.toString(this.mFluid.amount) + "L", - Integer.toString(this.getCapacity()) + "L" - }; + return new String[] { GT_Values.VOLTAGE_NAMES[this.mTier] + " Fluid Tank", "Stored Fluid:", + this.mFluid.getLocalizedName(), Integer.toString(this.mFluid.amount) + "L", + Integer.toString(this.getCapacity()) + "L" }; } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GregtechMetaEnergyBuffer.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GregtechMetaEnergyBuffer.java index ff63957696..1d0b4dad7e 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GregtechMetaEnergyBuffer.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GregtechMetaEnergyBuffer.java @@ -2,6 +2,11 @@ package gtPlusPlus.xmod.gregtech.common.tileentities.storage; import static gregtech.api.enums.GT_Values.V; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.world.World; + import gregtech.api.enums.Textures; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; @@ -14,43 +19,25 @@ import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.util.minecraft.PlayerUtils; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMetaTileEntity; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.world.World; public class GregtechMetaEnergyBuffer extends GregtechMetaTileEntity { protected byte aCurrentOutputAmperage = 4; - public GregtechMetaEnergyBuffer( - final int aID, - final String aName, - final String aNameRegional, - final int aTier, - final String aDescription, - final int aSlotCount) { + public GregtechMetaEnergyBuffer(final int aID, final String aName, final String aNameRegional, final int aTier, + final String aDescription, final int aSlotCount) { super(aID, aName, aNameRegional, aTier, aSlotCount, aDescription); } - public GregtechMetaEnergyBuffer( - final String aName, - final int aTier, - final String aDescription, - final ITexture[][][] aTextures, - final int aSlotCount) { + public GregtechMetaEnergyBuffer(final String aName, final int aTier, final String aDescription, + final ITexture[][][] aTextures, final int aSlotCount) { super(aName, aTier, aSlotCount, aDescription, aTextures); } @Override public String[] getDescription() { - return new String[] { - this.mDescription, - "Defaults 4A In/Out", - "Change output Amperage with a screwdriver", - "Now Portable!", - CORE.GT_Tooltip - }; + return new String[] { this.mDescription, "Defaults 4A In/Out", "Change output Amperage with a screwdriver", + "Now Portable!", CORE.GT_Tooltip }; } @Override @@ -84,139 +71,99 @@ public class GregtechMetaEnergyBuffer extends GregtechMetaTileEntity { } @Override - public ITexture[] getTexture( - final IGregTechTileEntity aBaseMetaTileEntity, - final byte aSide, - final byte aFacing, - final byte aColorIndex, - final boolean aActive, - final boolean aRedstone) { - return this.mTextures[ - (aActive ? 5 : 0) - + (aSide == aFacing - ? 0 - : aSide == GT_Utility.getOppositeSide(aFacing) - ? 1 - : aSide == 0 ? 2 : aSide == 1 ? 3 : 4)][ - aColorIndex + 1]; + public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing, + final byte aColorIndex, final boolean aActive, final boolean aRedstone) { + return this.mTextures[(aActive ? 5 : 0) + (aSide == aFacing ? 0 + : aSide == GT_Utility.getOppositeSide(aFacing) ? 1 : aSide == 0 ? 2 : aSide == 1 ? 3 : 4)][aColorIndex + + 1]; } public ITexture[] getFront(final byte aColor) { - return new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], - Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[this.mTier] - }; + return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], + Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[this.mTier] }; } public ITexture[] getBack(final byte aColor) { - return new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], - new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Dimensional_Orange) - }; + return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], + new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Dimensional_Orange) }; } public ITexture[] getBottom(final byte aColor) { - return new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], - new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Dimensional_Orange) - }; + return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], + new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Dimensional_Orange) }; } public ITexture[] getTop(final byte aColor) { - return new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], - new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Screen_Logo) - }; + return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], + new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Screen_Logo) }; } public ITexture[] getSides(final byte aColor) { - return new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], - new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Dimensional_Orange) - }; + return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], + new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Dimensional_Orange) }; } public ITexture[] getFrontActive(final byte aColor) { - return new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], - Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[this.mTier] - }; + return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], + Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[this.mTier] }; } public ITexture[] getBackActive(final byte aColor) { - return new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], - new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Dimensional_Orange) - }; + return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], + new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Dimensional_Orange) }; } public ITexture[] getBottomActive(final byte aColor) { - return new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], - new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Dimensional_Orange) - }; + return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], + new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Dimensional_Orange) }; } public ITexture[] getTopActive(final byte aColor) { - return new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], - new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Screen_Logo) - }; + return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], + new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Screen_Logo) }; } public ITexture[] getSidesActive(final byte aColor) { - return new ITexture[] { - Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], - new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Dimensional_Orange) - }; - } - - /*@Override - public ITexture[][][] getTextureSet(ITexture[] aTextures) { - ITexture[][][] rTextures = new ITexture[2][17][]; - for (byte i = -1; i < 16; i++) { - rTextures[0][i + 1] = new ITexture[] { new GT_RenderedTexture( - Textures.BlockIcons.MACHINE_HEATPROOFCASING) }; - rTextures[1][i + 1] = new ITexture[] { - new GT_RenderedTexture( - Textures.BlockIcons.MACHINE_HEATPROOFCASING), - mInventory.length > 4 ? Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[mTier] - : Textures.BlockIcons.OVERLAYS_ENERGY_OUT[mTier] }; - } - return rTextures; - }*/ + return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], + new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Dimensional_Orange) }; + } /* - * @Override public ITexture[][][] getTextureSet(ITexture[] aTextures) { - * ITexture[][][] rTextures = new ITexture[5][17][]; for (byte i = -1; i < - * 16; i = (byte) (i + 1)) { ITexture[] tmp0 = { new GT_RenderedTexture( - * Textures.BlockIcons.MACHINE_STEEL_BOTTOM, Dyes.getModulation(i, - * Dyes._NULL.mRGBa)) }; rTextures[0][(i + 1)] = tmp0; ITexture[] tmp1 = { - * new GT_RenderedTexture( Textures.BlockIcons.MACHINE_STEEL_TOP) }; - * rTextures[1][(i + 1)] = tmp1; ITexture[] tmp2 = { new GT_RenderedTexture( - * Textures.BlockIcons.MACHINE_STEEL_SIDE, Dyes.getModulation(i, - * Dyes._NULL.mRGBa)), new - * GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE) }; rTextures[2][(i + - * 1)] = tmp2; ITexture[] tmp4 = { new GT_RenderedTexture( - * Textures.BlockIcons.MACHINE_STEEL_SIDE, Dyes.getModulation(i, - * Dyes._NULL.mRGBa)), new - * GT_RenderedTexture(Textures.BlockIcons.BOILER_FRONT) }; rTextures[3][(i + - * 1)] = tmp4; ITexture[] tmp5 = { new GT_RenderedTexture( - * Textures.BlockIcons.MACHINE_STEEL_SIDE, Dyes.getModulation(i, - * Dyes._NULL.mRGBa)), new GT_RenderedTexture( - * Textures.BlockIcons.BOILER_FRONT_ACTIVE) }; rTextures[4][(i + 1)] = tmp5; - * } return rTextures; } + * @Override public ITexture[][][] getTextureSet(ITexture[] aTextures) { ITexture[][][] rTextures = new + * ITexture[2][17][]; for (byte i = -1; i < 16; i++) { rTextures[0][i + 1] = new ITexture[] { new + * GT_RenderedTexture( Textures.BlockIcons.MACHINE_HEATPROOFCASING) }; rTextures[1][i + 1] = new ITexture[] { new + * GT_RenderedTexture( Textures.BlockIcons.MACHINE_HEATPROOFCASING), mInventory.length > 4 ? + * Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[mTier] : Textures.BlockIcons.OVERLAYS_ENERGY_OUT[mTier] }; } return + * rTextures; } */ - /*@Override - public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { - return mTextures[aSide == aFacing ? 1 : 0][aColorIndex+1]; - }*/ + /* + * @Override public ITexture[][][] getTextureSet(ITexture[] aTextures) { ITexture[][][] rTextures = new + * ITexture[5][17][]; for (byte i = -1; i < 16; i = (byte) (i + 1)) { ITexture[] tmp0 = { new GT_RenderedTexture( + * Textures.BlockIcons.MACHINE_STEEL_BOTTOM, Dyes.getModulation(i, Dyes._NULL.mRGBa)) }; rTextures[0][(i + 1)] = + * tmp0; ITexture[] tmp1 = { new GT_RenderedTexture( Textures.BlockIcons.MACHINE_STEEL_TOP) }; rTextures[1][(i + 1)] + * = tmp1; ITexture[] tmp2 = { new GT_RenderedTexture( Textures.BlockIcons.MACHINE_STEEL_SIDE, Dyes.getModulation(i, + * Dyes._NULL.mRGBa)), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE) }; rTextures[2][(i + 1)] = tmp2; + * ITexture[] tmp4 = { new GT_RenderedTexture( Textures.BlockIcons.MACHINE_STEEL_SIDE, Dyes.getModulation(i, + * Dyes._NULL.mRGBa)), new GT_RenderedTexture(Textures.BlockIcons.BOILER_FRONT) }; rTextures[3][(i + 1)] = tmp4; + * ITexture[] tmp5 = { new GT_RenderedTexture( Textures.BlockIcons.MACHINE_STEEL_SIDE, Dyes.getModulation(i, + * Dyes._NULL.mRGBa)), new GT_RenderedTexture( Textures.BlockIcons.BOILER_FRONT_ACTIVE) }; rTextures[4][(i + 1)] = + * tmp5; } return rTextures; } + */ + + /* + * @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte + * aColorIndex, boolean aActive, boolean aRedstone) { return mTextures[aSide == aFacing ? 1 : 0][aColorIndex+1]; } + */ @Override public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) { return new GregtechMetaEnergyBuffer( - this.mName, this.mTier, this.mDescription, this.mTextures, this.mInventory.length); + this.mName, + this.mTier, + this.mDescription, + this.mTextures, + this.mInventory.length); } @Override @@ -367,36 +314,34 @@ public class GregtechMetaEnergyBuffer extends GregtechMetaTileEntity { final double roundOff = Math.round(c * 100.00) / 100.00; PlayerUtils.messagePlayer( playerIn, - "Energy: " + GT_Utility.formatNumbers(tempStorage) + " EU at " + V[this.mTier] + "v (" + roundOff - + "%)"); + "Energy: " + GT_Utility + .formatNumbers(tempStorage) + " EU at " + V[this.mTier] + "v (" + roundOff + "%)"); PlayerUtils.messagePlayer(playerIn, "Amperage: " + GT_Utility.formatNumbers(maxAmperesOut()) + "A"); } // Utils.LOG_WARNING("Begin Show Energy"); /* - * - //Utils.LOG_INFO("getProgresstime: "+tempStorage+" maxProgresstime: "+maxEUStore()+" C: "+c); - Utils.LOG_INFO("getProgressTime: "+getProgresstime()); - Utils.LOG_INFO("maxProgressTime: "+maxProgresstime()); - Utils.LOG_INFO("getMinimumStoredEU: "+getMinimumStoredEU()); - Utils.LOG_INFO("maxEUStore: "+maxEUStore());*/ - /*final long d = (tempStorage * 100L) / maxEUStore(); - Utils.LOG_INFO("getProgresstime: "+tempStorage+" maxProgresstime: "+maxEUStore()+" D: "+d); - final double roundOff2 = Math.round(d * 100.00) / 100.00; - Utils.messagePlayer(playerIn, "Energy: " + tempStorage + " EU at "+V[mTier]+"v ("+roundOff2+"%)"); - Utils.LOG_WARNING("Making new instance of Guihandler"); - GuiHandler block = new GuiHandler(); - Utils.LOG_WARNING("Guihandler.toString(): "+block.toString()); - block.getClientGuiElement(1, playerIn, worldIn, (int) playerIn.posX, (int) playerIn.posY, (int) playerIn.posZ);*/ - - @Override - public boolean allowPullStack( - final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, final ItemStack aStack) { + * //Utils.LOG_INFO("getProgresstime: "+tempStorage+" maxProgresstime: "+maxEUStore()+" C: "+c); + * Utils.LOG_INFO("getProgressTime: "+getProgresstime()); Utils.LOG_INFO("maxProgressTime: "+maxProgresstime()); + * Utils.LOG_INFO("getMinimumStoredEU: "+getMinimumStoredEU()); Utils.LOG_INFO("maxEUStore: "+maxEUStore()); + */ + /* + * final long d = (tempStorage * 100L) / maxEUStore(); + * Utils.LOG_INFO("getProgresstime: "+tempStorage+" maxProgresstime: "+maxEUStore()+" D: "+d); final double + * roundOff2 = Math.round(d * 100.00) / 100.00; Utils.messagePlayer(playerIn, "Energy: " + tempStorage + + * " EU at "+V[mTier]+"v ("+roundOff2+"%)"); Utils.LOG_WARNING("Making new instance of Guihandler"); GuiHandler + * block = new GuiHandler(); Utils.LOG_WARNING("Guihandler.toString(): "+block.toString()); + * block.getClientGuiElement(1, playerIn, worldIn, (int) playerIn.posX, (int) playerIn.posY, (int) playerIn.posZ); + */ + + @Override + public boolean allowPullStack(final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, + final ItemStack aStack) { return false; } @Override - public boolean allowPutStack( - final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, final ItemStack aStack) { + public boolean allowPutStack(final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, + final ItemStack aStack) { return false; } @@ -409,7 +354,7 @@ public class GregtechMetaEnergyBuffer extends GregtechMetaTileEntity { String fmt = String.format("%%%ds", max.length()); cur = String.format(fmt, cur); - return new String[] {cur + " EU stored", max + " EU capacity"}; + return new String[] { cur + " EU stored", max + " EU capacity" }; } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GregtechMetaSafeBlock.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GregtechMetaSafeBlock.java index 5115b87da7..12a64f7fa8 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GregtechMetaSafeBlock.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GregtechMetaSafeBlock.java @@ -6,6 +6,7 @@ import com.gtnewhorizons.modularui.common.widget.ButtonWidget; import com.gtnewhorizons.modularui.common.widget.FakeSyncWidget; import com.gtnewhorizons.modularui.common.widget.SlotGroup; import com.gtnewhorizons.modularui.common.widget.TextWidget; + import gregtech.api.enums.Textures; import gregtech.api.gui.modularui.GT_UITextures; import gregtech.api.interfaces.ITexture; @@ -23,34 +24,29 @@ public class GregtechMetaSafeBlock extends GregtechMetaSafeBlockBase implements super(aID, aName, aNameRegional, aTier, 28, "Protecting your items from sticky fingers."); } - public GregtechMetaSafeBlock( - final int aID, - final String aName, - final String aNameRegional, - final int aTier, - final int aInvSlotCount, - final String aDescription) { + public GregtechMetaSafeBlock(final int aID, final String aName, final String aNameRegional, final int aTier, + final int aInvSlotCount, final String aDescription) { super(aID, aName, aNameRegional, aTier, aInvSlotCount, aDescription); } - public GregtechMetaSafeBlock( - final String aName, - final int aTier, - final int aInvSlotCount, - final String aDescription, - final ITexture[][][] aTextures) { + public GregtechMetaSafeBlock(final String aName, final int aTier, final int aInvSlotCount, + final String aDescription, final ITexture[][][] aTextures) { super(aName, aTier, aInvSlotCount, aDescription, aTextures); } @Override public String[] getDescription() { - return new String[] {this.mDescription, CORE.GT_Tooltip}; + return new String[] { this.mDescription, CORE.GT_Tooltip }; } @Override public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) { return new GregtechMetaSafeBlock( - this.mName, this.mTier, this.mInventory.length, this.mDescription, this.mTextures); + this.mName, + this.mTier, + this.mInventory.length, + this.mDescription, + this.mTextures); } @Override @@ -70,19 +66,15 @@ public class GregtechMetaSafeBlock extends GregtechMetaSafeBlockBase implements @Override public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildContext) { - builder.widget(SlotGroup.ofItemHandler(inventoryHandler, 9) - .endAtSlot(26) - .build() - .setPos(7, 4)) - .widget(new ButtonWidget() - .setOnClick((clickData, widget) -> bUnbreakable = !bUnbreakable) - .setBackground(GT_UITextures.BUTTON_STANDARD, GTPP_UITextures.OVERLAY_BUTTON_LOCK) - .setPos(43, 62) - .setSize(18, 18)) + builder.widget(SlotGroup.ofItemHandler(inventoryHandler, 9).endAtSlot(26).build().setPos(7, 4)) + .widget( + new ButtonWidget().setOnClick((clickData, widget) -> bUnbreakable = !bUnbreakable) + .setBackground(GT_UITextures.BUTTON_STANDARD, GTPP_UITextures.OVERLAY_BUTTON_LOCK) + .setPos(43, 62).setSize(18, 18)) .widget(new TextWidget("Safe Status").setPos(76, 61)) - .widget(TextWidget.dynamicString(() -> bUnbreakable ? "Locked" : "Unlocked") - .setSynced(false) - .setPos(82, 73)) + .widget( + TextWidget.dynamicString(() -> bUnbreakable ? "Locked" : "Unlocked").setSynced(false) + .setPos(82, 73)) .widget(new FakeSyncWidget.BooleanSyncer(() -> bUnbreakable, val -> bUnbreakable = val)); } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/creative/GT_MetaTileEntity_InfiniteItemHolder.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/creative/GT_MetaTileEntity_InfiniteItemHolder.java index bff2cad086..daf79e022f 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/creative/GT_MetaTileEntity_InfiniteItemHolder.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/creative/GT_MetaTileEntity_InfiniteItemHolder.java @@ -1,5 +1,8 @@ package gtPlusPlus.xmod.gregtech.common.tileentities.storage.creative; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; + import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; @@ -7,8 +10,6 @@ import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.util.minecraft.PlayerUtils; import gtPlusPlus.core.util.sys.KeyboardUtils; import gtPlusPlus.xmod.gregtech.common.tileentities.storage.GT_MetaTileEntity_TieredChest; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; public class GT_MetaTileEntity_InfiniteItemHolder extends GT_MetaTileEntity_TieredChest { @@ -16,14 +17,14 @@ public class GT_MetaTileEntity_InfiniteItemHolder extends GT_MetaTileEntity_Tier super(aID, aName, aNameRegional, aTier); } - public GT_MetaTileEntity_InfiniteItemHolder( - String aName, int aTier, String aDescription, ITexture[][][] aTextures) { + public GT_MetaTileEntity_InfiniteItemHolder(String aName, int aTier, String aDescription, + ITexture[][][] aTextures) { super(aName, aTier, aDescription, aTextures); } @Override public String[] getDescription() { - return new String[] {this.mDescription, CORE.GT_Tooltip}; + return new String[] { this.mDescription, CORE.GT_Tooltip }; } @Override @@ -39,7 +40,8 @@ public class GT_MetaTileEntity_InfiniteItemHolder extends GT_MetaTileEntity_Tier this.mItemCount = Short.MAX_VALUE; aPlayer.setCurrentItemOrArmor(0, null); PlayerUtils.messagePlayer( - aPlayer, "Now holding " + this.mItemStack.getDisplayName() + " x" + Short.MAX_VALUE + "."); + aPlayer, + "Now holding " + this.mItemStack.getDisplayName() + " x" + Short.MAX_VALUE + "."); return true; } } else { @@ -55,7 +57,8 @@ public class GT_MetaTileEntity_InfiniteItemHolder extends GT_MetaTileEntity_Tier PlayerUtils.messagePlayer( aPlayer, - "Currently holding: " + (this.mItemStack != null ? this.mItemStack.getDisplayName() : "Nothing") + " x" + "Currently holding: " + (this.mItemStack != null ? this.mItemStack.getDisplayName() : "Nothing") + + " x" + this.mItemCount); return true; // return super.onRightclick(aBaseMetaTileEntity, aPlayer); diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/shelving/GT4Entity_Shelf.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/shelving/GT4Entity_Shelf.java index 18e95861b3..4d959789eb 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/shelving/GT4Entity_Shelf.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/shelving/GT4Entity_Shelf.java @@ -1,5 +1,10 @@ package gtPlusPlus.xmod.gregtech.common.tileentities.storage.shelving; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; + import gregtech.api.enums.*; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; @@ -15,22 +20,19 @@ import gtPlusPlus.core.util.minecraft.PlayerUtils; import gtPlusPlus.core.util.sys.KeyboardUtils; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock.CustomIcon; -import net.minecraft.entity.item.EntityItem; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; public class GT4Entity_Shelf extends GT_MetaTileEntity_BasicHull_NonElectric { + public byte mType = 0; public String mOldDesc = ""; public boolean mLocked = false; protected byte mIndex = (byte) MathUtils.randInt(1, 3); - public static GT_RenderedTexture texBottom = - new GT_RenderedTexture(new CustomIcon("TileEntities/gt4/machine_bottom")); + public static GT_RenderedTexture texBottom = new GT_RenderedTexture( + new CustomIcon("TileEntities/gt4/machine_bottom")); public static GT_RenderedTexture texTop = new GT_RenderedTexture(new CustomIcon("TileEntities/gt4/machine_top")); public static GT_RenderedTexture texSide = new GT_RenderedTexture(new CustomIcon("TileEntities/gt4/machine_side")); - public static GT_RenderedTexture texSideCabinet = - new GT_RenderedTexture(new CustomIcon("TileEntities/gt4/machine_side_cabinet")); + public static GT_RenderedTexture texSideCabinet = new GT_RenderedTexture( + new CustomIcon("TileEntities/gt4/machine_side_cabinet")); public GT4Entity_Shelf(final int aID, final String aName, final String aNameRegional, final String aDescription) { super(aID, aName, aNameRegional, 0, aDescription); @@ -103,7 +105,9 @@ public class GT4Entity_Shelf extends GT_MetaTileEntity_BasicHull_NonElectric { if (this.mInventory[0] != null) { PlayerUtils.messagePlayer( aPlayer, - "Contains " + this.mInventory[0].getDisplayName() + " x" + this.mInventory[0].stackSize + "Contains " + this.mInventory[0].getDisplayName() + + " x" + + this.mInventory[0].stackSize + "."); } return false; @@ -112,7 +116,9 @@ public class GT4Entity_Shelf extends GT_MetaTileEntity_BasicHull_NonElectric { if (!this.mLocked) { PlayerUtils.messagePlayer( aPlayer, - "Removed " + this.mInventory[0].getDisplayName() + " x" + this.mInventory[0].stackSize + "Removed " + this.mInventory[0].getDisplayName() + + " x" + + this.mInventory[0].stackSize + "."); aPlayer.inventory.setInventorySlotContents(aPlayer.inventory.currentItem, this.mInventory[0]); getBaseMetaTileEntity().setInventorySlotContents(0, null); @@ -120,7 +126,8 @@ public class GT4Entity_Shelf extends GT_MetaTileEntity_BasicHull_NonElectric { return true; } else { PlayerUtils.messagePlayer( - aPlayer, "This container is locked. It belongs to " + aTile.getOwnerName() + "."); + aPlayer, + "This container is locked. It belongs to " + aTile.getOwnerName() + "."); return false; } } @@ -147,7 +154,7 @@ public class GT4Entity_Shelf extends GT_MetaTileEntity_BasicHull_NonElectric { @Override public void onLeftclick(IGregTechTileEntity aTile, EntityPlayer aPlayer) { if ((this.mInventory[0] != null) && (this.mInventory[0].stackSize > 0)) { - ItemStack tOutput = GT_Utility.copy(new Object[] {this.mInventory[0]}); + ItemStack tOutput = GT_Utility.copy(new Object[] { this.mInventory[0] }); if (!aPlayer.isSneaking()) { tOutput.stackSize = 1; } @@ -206,13 +213,8 @@ public class GT4Entity_Shelf extends GT_MetaTileEntity_BasicHull_NonElectric { @Override public String[] getDescription() { - return new String[] { - mOldDesc, - "Decorative Item Storage", - "Right click to store/remove something", - "Ctrl + Rmb to check contents", - "Ctrl + Rmb with a screwdriver to lock", - }; + return new String[] { mOldDesc, "Decorative Item Storage", "Right click to store/remove something", + "Ctrl + Rmb to check contents", "Ctrl + Rmb with a screwdriver to lock", }; } @Override @@ -240,44 +242,35 @@ public class GT4Entity_Shelf extends GT_MetaTileEntity_BasicHull_NonElectric { public ITexture[][][] getTextureSet(ITexture[] aTextures) { ITexture[][][] rTextures = new ITexture[7][17][]; for (byte i = -1; i < 16; i = (byte) (i + 1)) { - ITexture[] tmp0 = {this.getBottom((byte) 0)[0]}; + ITexture[] tmp0 = { this.getBottom((byte) 0)[0] }; rTextures[0][(i + 1)] = tmp0; - ITexture[] tmp1 = {this.getTop((byte) 0)[0]}; + ITexture[] tmp1 = { this.getTop((byte) 0)[0] }; rTextures[1][(i + 1)] = tmp1; - ITexture[] tmp2 = {this.getSides((byte) 0)[0]}; + ITexture[] tmp2 = { this.getSides((byte) 0)[0] }; rTextures[2][(i + 1)] = tmp2; - ITexture[] tmp4 = {this.getSides((byte) 0)[0]}; + ITexture[] tmp4 = { this.getSides((byte) 0)[0] }; rTextures[3][(i + 1)] = tmp4; - ITexture[] tmp5 = {this.getSides((byte) 0)[0], getFront((byte) 0)[0]}; + ITexture[] tmp5 = { this.getSides((byte) 0)[0], getFront((byte) 0)[0] }; rTextures[4][(i + 1)] = tmp5; - ITexture[] tmp6 = {this.getSides((byte) 0)[0], getFront((byte) 1)[0]}; + ITexture[] tmp6 = { this.getSides((byte) 0)[0], getFront((byte) 1)[0] }; rTextures[5][(i + 1)] = tmp6; - ITexture[] tmp7 = {this.getSides((byte) 0)[0], getFront((byte) 2)[0]}; + ITexture[] tmp7 = { this.getSides((byte) 0)[0], getFront((byte) 2)[0] }; rTextures[6][(i + 1)] = tmp7; } return rTextures; } @Override - public ITexture[] getTexture( - final IGregTechTileEntity aBaseMetaTileEntity, - final byte aSide, - final byte aFacing, - final byte aColorIndex, - final boolean aActive, - final boolean aRedstone) { - - ITexture[] tmp = this.mTextures[ - (aSide >= 2) - ? ((aSide != aFacing) - ? 2 - : ((byte) this.mType == 0 - ? 4 - : this.mType == 1 || this.mType == 2 ? 5 : this.mType == 3 ? 6 : 0)) - : aSide][ - aColorIndex + 1]; + public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing, + final byte aColorIndex, final boolean aActive, final boolean aRedstone) { + + ITexture[] tmp = this.mTextures[(aSide >= 2) + ? ((aSide != aFacing) ? 2 + : ((byte) this.mType == 0 ? 4 + : this.mType == 1 || this.mType == 2 ? 5 : this.mType == 3 ? 6 : 0)) + : aSide][aColorIndex + 1]; if (aSide != aFacing && tmp.length == 2) { - tmp = new ITexture[] {tmp[0]}; + tmp = new ITexture[] { tmp[0] }; } return tmp; } @@ -287,31 +280,31 @@ public class GT4Entity_Shelf extends GT_MetaTileEntity_BasicHull_NonElectric { private static GT_RenderedTexture x3 = new GT_RenderedTexture(TexturesGtBlock.OVERLAY_WOODEN_SHELF_CANS_FRONT); public ITexture[] getFrontNormal() { - return new ITexture[] {x1}; + return new ITexture[] { x1 }; } public ITexture[] getFrontActive() { - return new ITexture[] {x2}; + return new ITexture[] { x2 }; } public ITexture[] getFrontAlternative() { - return new ITexture[] {x3}; + return new ITexture[] { x3 }; } public ITexture[] getBack(final byte aColor) { - return new ITexture[] {new GT_RenderedTexture(TexturesGtBlock.VanillaIcon_OakPlanks)}; + return new ITexture[] { new GT_RenderedTexture(TexturesGtBlock.VanillaIcon_OakPlanks) }; } public ITexture[] getBottom(final byte aColor) { - return new ITexture[] {new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Acacia_Log)}; + return new ITexture[] { new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Acacia_Log) }; } public ITexture[] getTop(final byte aColor) { - return new ITexture[] {new GT_RenderedTexture(TexturesGtBlock.VanillaIcon_OakPlanks)}; + return new ITexture[] { new GT_RenderedTexture(TexturesGtBlock.VanillaIcon_OakPlanks) }; } public ITexture[] getSides(final byte aColor) { - return new ITexture[] {new GT_RenderedTexture(TexturesGtBlock.VanillaIcon_OakPlanks)}; + return new ITexture[] { new GT_RenderedTexture(TexturesGtBlock.VanillaIcon_OakPlanks) }; } public ITexture[] getFrontActive(final byte aColor) { @@ -351,8 +344,7 @@ public class GT4Entity_Shelf extends GT_MetaTileEntity_BasicHull_NonElectric { @Override public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { if (KeyboardUtils.isCtrlKeyDown()) { - if (!aPlayer.getDisplayName() - .equalsIgnoreCase(this.getBaseMetaTileEntity().getOwnerName())) { + if (!aPlayer.getDisplayName().equalsIgnoreCase(this.getBaseMetaTileEntity().getOwnerName())) { PlayerUtils.messagePlayer(aPlayer, "Container is not yours to lock."); } else { this.mLocked = Utils.invertBoolean(this.mLocked); diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/shelving/GT4Entity_Shelf_Compartment.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/shelving/GT4Entity_Shelf_Compartment.java index 93361a523f..b75b383377 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/shelving/GT4Entity_Shelf_Compartment.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/shelving/GT4Entity_Shelf_Compartment.java @@ -1,16 +1,17 @@ package gtPlusPlus.xmod.gregtech.common.tileentities.storage.shelving; +import net.minecraft.entity.player.EntityPlayer; + import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; import gtPlusPlus.core.util.minecraft.PlayerUtils; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; -import net.minecraft.entity.player.EntityPlayer; public class GT4Entity_Shelf_Compartment extends GT4Entity_Shelf { - public GT4Entity_Shelf_Compartment( - final int aID, final String aName, final String aNameRegional, final String aDescription) { + public GT4Entity_Shelf_Compartment(final int aID, final String aName, final String aNameRegional, + final String aDescription) { super(aID, aName, aNameRegional, aDescription); } @@ -33,6 +34,6 @@ public class GT4Entity_Shelf_Compartment extends GT4Entity_Shelf { @Override public ITexture[] getFront(final byte aColor) { - return new ITexture[] {TexturesGtBlock.OVERLAYS_COMPARTMENT_FRONT[this.mType < 16 ? this.mType : 0]}; + return new ITexture[] { TexturesGtBlock.OVERLAYS_COMPARTMENT_FRONT[this.mType < 16 ? this.mType : 0] }; } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/shelving/GT4Entity_Shelf_Desk.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/shelving/GT4Entity_Shelf_Desk.java index c9472e157c..0327424efb 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/shelving/GT4Entity_Shelf_Desk.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/shelving/GT4Entity_Shelf_Desk.java @@ -8,8 +8,8 @@ import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; public class GT4Entity_Shelf_Desk extends GT4Entity_Shelf { - public GT4Entity_Shelf_Desk( - final int aID, final String aName, final String aNameRegional, final String aDescription) { + public GT4Entity_Shelf_Desk(final int aID, final String aName, final String aNameRegional, + final String aDescription) { super(aID, aName, aNameRegional, aDescription); } @@ -24,22 +24,22 @@ public class GT4Entity_Shelf_Desk extends GT4Entity_Shelf { @Override public ITexture[] getFront(final byte aColor) { - return new ITexture[] {TexturesGtBlock.OVERLAYS_CABINET_FRONT[this.mType < 16 ? this.mType : 0]}; + return new ITexture[] { TexturesGtBlock.OVERLAYS_CABINET_FRONT[this.mType < 16 ? this.mType : 0] }; } public ITexture[] getBack(final byte aColor) { - return new ITexture[] {new GT_RenderedTexture(TexturesGtBlock.VanillaIcon_OakPlanks)}; + return new ITexture[] { new GT_RenderedTexture(TexturesGtBlock.VanillaIcon_OakPlanks) }; } public ITexture[] getBottom(final byte aColor) { - return new ITexture[] {new GT_RenderedTexture(TexturesGtBlock.VanillaIcon_OakPlanks)}; + return new ITexture[] { new GT_RenderedTexture(TexturesGtBlock.VanillaIcon_OakPlanks) }; } public ITexture[] getTop(final byte aColor) { - return new ITexture[] {new GT_RenderedTexture(TexturesGtBlock.VanillaIcon_OakPlanks)}; + return new ITexture[] { new GT_RenderedTexture(TexturesGtBlock.VanillaIcon_OakPlanks) }; } public ITexture[] getSides(final byte aColor) { - return new ITexture[] {new GT_RenderedTexture(TexturesGtBlock.VanillaIcon_OakPlanks)}; + return new ITexture[] { new GT_RenderedTexture(TexturesGtBlock.VanillaIcon_OakPlanks) }; } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/shelving/GT4Entity_Shelf_FileCabinet.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/shelving/GT4Entity_Shelf_FileCabinet.java index 9c4ae3aefa..b7ebac4f90 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/shelving/GT4Entity_Shelf_FileCabinet.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/shelving/GT4Entity_Shelf_FileCabinet.java @@ -1,16 +1,17 @@ package gtPlusPlus.xmod.gregtech.common.tileentities.storage.shelving; +import net.minecraft.entity.player.EntityPlayer; + import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; import gtPlusPlus.core.util.minecraft.PlayerUtils; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; -import net.minecraft.entity.player.EntityPlayer; public class GT4Entity_Shelf_FileCabinet extends GT4Entity_Shelf { - public GT4Entity_Shelf_FileCabinet( - final int aID, final String aName, final String aNameRegional, final String aDescription) { + public GT4Entity_Shelf_FileCabinet(final int aID, final String aName, final String aNameRegional, + final String aDescription) { super(aID, aName, aNameRegional, aDescription); } @@ -33,22 +34,22 @@ public class GT4Entity_Shelf_FileCabinet extends GT4Entity_Shelf { @Override public ITexture[] getFront(final byte aColor) { - return new ITexture[] {TexturesGtBlock.OVERLAYS_CABINET_FRONT[this.mType < 16 ? this.mType : 0]}; + return new ITexture[] { TexturesGtBlock.OVERLAYS_CABINET_FRONT[this.mType < 16 ? this.mType : 0] }; } public ITexture[] getBack(final byte aColor) { - return new ITexture[] {texSide}; + return new ITexture[] { texSide }; } public ITexture[] getBottom(final byte aColor) { - return new ITexture[] {texBottom}; + return new ITexture[] { texBottom }; } public ITexture[] getTop(final byte aColor) { - return new ITexture[] {texTop}; + return new ITexture[] { texTop }; } public ITexture[] getSides(final byte aColor) { - return new ITexture[] {texSide}; + return new ITexture[] { texSide }; } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/shelving/GT4Entity_Shelf_Iron.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/shelving/GT4Entity_Shelf_Iron.java index 17110e691b..a401fd96e3 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/shelving/GT4Entity_Shelf_Iron.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/shelving/GT4Entity_Shelf_Iron.java @@ -6,8 +6,8 @@ import gregtech.api.metatileentity.MetaTileEntity; public class GT4Entity_Shelf_Iron extends GT4Entity_Shelf { - public GT4Entity_Shelf_Iron( - final int aID, final String aName, final String aNameRegional, final String aDescription) { + public GT4Entity_Shelf_Iron(final int aID, final String aName, final String aNameRegional, + final String aDescription) { super(aID, aName, aNameRegional, aDescription); } @@ -21,22 +21,22 @@ public class GT4Entity_Shelf_Iron extends GT4Entity_Shelf { } public ITexture[] getFront(final byte aColor) { - return new ITexture[] {texSideCabinet}; + return new ITexture[] { texSideCabinet }; } public ITexture[] getBack(final byte aColor) { - return new ITexture[] {texSide}; + return new ITexture[] { texSide }; } public ITexture[] getBottom(final byte aColor) { - return new ITexture[] {texBottom}; + return new ITexture[] { texBottom }; } public ITexture[] getTop(final byte aColor) { - return new ITexture[] {texTop}; + return new ITexture[] { texTop }; } public ITexture[] getSides(final byte aColor) { - return new ITexture[] {texSide}; + return new ITexture[] { texSide }; } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/shelving/GT4Entity_Shelf_Large.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/shelving/GT4Entity_Shelf_Large.java index 15fa23bf95..4b8943f6d1 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/shelving/GT4Entity_Shelf_Large.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/shelving/GT4Entity_Shelf_Large.java @@ -1,10 +1,16 @@ package gtPlusPlus.xmod.gregtech.common.tileentities.storage.shelving; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTBase; +import net.minecraft.nbt.NBTTagCompound; + import com.gtnewhorizons.modularui.api.screen.ModularWindow; import com.gtnewhorizons.modularui.api.screen.UIBuildContext; import com.gtnewhorizons.modularui.common.widget.DrawableWidget; import com.gtnewhorizons.modularui.common.widget.SlotWidget; import com.gtnewhorizons.modularui.common.widget.TextWidget; + import gregtech.api.gui.modularui.GT_UIInfos; import gregtech.api.gui.modularui.GT_UITextures; import gregtech.api.interfaces.ITexture; @@ -14,10 +20,6 @@ import gregtech.api.util.GT_Utility; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.util.minecraft.PlayerUtils; import gtPlusPlus.core.util.sys.KeyboardUtils; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTBase; -import net.minecraft.nbt.NBTTagCompound; public class GT4Entity_Shelf_Large extends GT4Entity_Shelf { @@ -25,8 +27,8 @@ public class GT4Entity_Shelf_Large extends GT4Entity_Shelf { public int mItemCount; public ItemStack mItemStack; - public GT4Entity_Shelf_Large( - final int aID, final String aName, final String aNameRegional, final String aDescription, final int aSize) { + public GT4Entity_Shelf_Large(final int aID, final String aName, final String aNameRegional, + final String aDescription, final int aSize) { super(aID, aName, aNameRegional, aDescription); this.mSize = aSize; this.mItemCount = 0; @@ -45,10 +47,9 @@ public class GT4Entity_Shelf_Large extends GT4Entity_Shelf { return new GT4Entity_Shelf_Large(this.mName, this.mDescription, mSize, this.mTextures); } - /*@Override - public int getInvSize() { - return (mSize > 0 && mSize < 255 ? mSize : 255); - }*/ + /* + * @Override public int getInvSize() { return (mSize > 0 && mSize < 255 ? mSize : 255); } + */ @Override public boolean isGivingInformation() { @@ -108,8 +109,7 @@ public class GT4Entity_Shelf_Large extends GT4Entity_Shelf { } public void onPostTick(final IGregTechTileEntity aBaseMetaTileEntity, final long aTimer) { - if (this.getBaseMetaTileEntity().isServerSide() - && this.getBaseMetaTileEntity().isAllowedToWork()) { + if (this.getBaseMetaTileEntity().isServerSide() && this.getBaseMetaTileEntity().isAllowedToWork()) { try { if (this.mInventory[0] != null) { this.mType = (byte) this.mIndex; @@ -124,8 +124,7 @@ public class GT4Entity_Shelf_Large extends GT4Entity_Shelf { if (this.mItemStack == null && this.mInventory[0] != null) { this.mItemStack = this.mInventory[0].copy(); } - if (this.mInventory[0] != null - && this.mItemCount < this.getMaxItemCount() + if (this.mInventory[0] != null && this.mItemCount < this.getMaxItemCount() && GT_Utility.areStacksEqual(this.mInventory[0], this.mItemStack)) { this.mItemCount += this.mInventory[0].stackSize; if (this.mItemCount > this.getMaxItemCount()) { @@ -139,15 +138,15 @@ public class GT4Entity_Shelf_Large extends GT4Entity_Shelf { this.mInventory[1] = this.mItemStack.copy(); this.mInventory[1].stackSize = Math.min(this.mItemStack.getMaxStackSize(), this.mItemCount); this.mItemCount -= this.mInventory[1].stackSize; - } else if (this.mItemCount > 0 - && GT_Utility.areStacksEqual(this.mInventory[1], this.mItemStack) + } else if (this.mItemCount > 0 && GT_Utility.areStacksEqual(this.mInventory[1], this.mItemStack) && this.mInventory[1].getMaxStackSize() > this.mInventory[1].stackSize) { - final int tmp = Math.min( - this.mItemCount, this.mInventory[1].getMaxStackSize() - this.mInventory[1].stackSize); - final ItemStack itemStack = this.mInventory[1]; - itemStack.stackSize += tmp; - this.mItemCount -= tmp; - } + final int tmp = Math.min( + this.mItemCount, + this.mInventory[1].getMaxStackSize() - this.mInventory[1].stackSize); + final ItemStack itemStack = this.mInventory[1]; + itemStack.stackSize += tmp; + this.mItemCount -= tmp; + } if (this.mItemStack != null) { this.mInventory[2] = this.mItemStack.copy(); this.mInventory[2].stackSize = Math.min(this.mItemStack.getMaxStackSize(), this.mItemCount); @@ -170,8 +169,7 @@ public class GT4Entity_Shelf_Large extends GT4Entity_Shelf { public int getProgresstime() { try { - return this.mItemCount - + ((this.mInventory[0] == null) ? 0 : this.mInventory[0].stackSize) + return this.mItemCount + ((this.mInventory[0] == null) ? 0 : this.mInventory[0].stackSize) + ((this.mInventory[1] == null) ? 0 : this.mInventory[1].stackSize); } catch (Throwable t) { return 0; @@ -186,31 +184,28 @@ public class GT4Entity_Shelf_Large extends GT4Entity_Shelf { return this.mSize; } - public boolean allowPullStack( - final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, final ItemStack aStack) { + public boolean allowPullStack(final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, + final ItemStack aStack) { return aIndex == 1; } - public boolean allowPutStack( - final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, final ItemStack aStack) { - return aIndex == 0 - && ((this.mInventory[0] == null && this.mItemStack == null) - || GT_Utility.areStacksEqual(this.mInventory[0], aStack) - || (this.mItemStack != null && GT_Utility.areStacksEqual(this.mItemStack, aStack))); + public boolean allowPutStack(final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, + final ItemStack aStack) { + return aIndex == 0 && ((this.mInventory[0] == null && this.mItemStack == null) + || GT_Utility.areStacksEqual(this.mInventory[0], aStack) + || (this.mItemStack != null && GT_Utility.areStacksEqual(this.mItemStack, aStack))); } public String[] getInfoData() { if (this.mItemStack == null) { - return new String[] { - this.getLocalName(), "No Items Stored", "Free Space: " + Integer.toString(this.getMaxItemCount()) - }; + return new String[] { this.getLocalName(), "No Items Stored", + "Free Space: " + Integer.toString(this.getMaxItemCount()) }; } - return new String[] { - this.getLocalName(), - "Storing: " + this.mItemStack.getDisplayName() + " x" + Integer.toString(this.mItemCount), - "Space Remaining: " + Integer.toString(this.getMaxItemCount() - this.getItemCount()) + "/" - + Integer.toString(this.getMaxItemCount()) - }; + return new String[] { this.getLocalName(), + "Storing: " + this.mItemStack.getDisplayName() + " x" + Integer.toString(this.mItemCount), + "Space Remaining: " + Integer.toString(this.getMaxItemCount() - this.getItemCount()) + + "/" + + Integer.toString(this.getMaxItemCount()) }; } @Override @@ -263,18 +258,14 @@ public class GT4Entity_Shelf_Large extends GT4Entity_Shelf { @Override public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildContext) { - builder.widget(new DrawableWidget() - .setDrawable(GT_UITextures.PICTURE_SCREEN_BLACK) - .setPos(7, 16) - .setSize(71, 45)) - .widget(new SlotWidget(inventoryHandler, 0) - .setBackground(getGUITextureSet().getItemSlot(), GT_UITextures.OVERLAY_SLOT_IN) - .setPos(79, 16)) - .widget(new TextWidget("Item Amount") - .setDefaultColor(COLOR_TEXT_WHITE.get()) - .setPos(10, 20)) - .widget(TextWidget.dynamicString(() -> GT_Utility.parseNumberToString(mItemCount)) - .setDefaultColor(COLOR_TEXT_WHITE.get()) - .setPos(10, 30)); + builder.widget( + new DrawableWidget().setDrawable(GT_UITextures.PICTURE_SCREEN_BLACK).setPos(7, 16).setSize(71, 45)) + .widget( + new SlotWidget(inventoryHandler, 0) + .setBackground(getGUITextureSet().getItemSlot(), GT_UITextures.OVERLAY_SLOT_IN) + .setPos(79, 16)) + .widget(new TextWidget("Item Amount").setDefaultColor(COLOR_TEXT_WHITE.get()).setPos(10, 20)).widget( + TextWidget.dynamicString(() -> GT_Utility.parseNumberToString(mItemCount)) + .setDefaultColor(COLOR_TEXT_WHITE.get()).setPos(10, 30)); } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tools/TOOL_Gregtech_AngleGrinder.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tools/TOOL_Gregtech_AngleGrinder.java index e8b72c7ea9..8065eee736 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tools/TOOL_Gregtech_AngleGrinder.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tools/TOOL_Gregtech_AngleGrinder.java @@ -1,16 +1,8 @@ package gtPlusPlus.xmod.gregtech.common.tools; -import gregtech.GT_Mod; -import gregtech.api.GregTech_API; -import gregtech.api.enums.Materials; -import gregtech.api.enums.Textures.ItemIcons; -import gregtech.api.interfaces.IIconContainer; -import gregtech.api.items.GT_MetaGenerated_Tool; -import gregtech.common.items.behaviors.Behaviour_None; -import gregtech.common.tools.GT_Tool; -import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtTools; import java.util.Arrays; import java.util.List; + import net.minecraft.block.Block; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; @@ -23,14 +15,24 @@ import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.IChatComponent; import net.minecraftforge.event.world.BlockEvent; +import gregtech.GT_Mod; +import gregtech.api.GregTech_API; +import gregtech.api.enums.Materials; +import gregtech.api.enums.Textures.ItemIcons; +import gregtech.api.interfaces.IIconContainer; +import gregtech.api.items.GT_MetaGenerated_Tool; +import gregtech.common.items.behaviors.Behaviour_None; +import gregtech.common.tools.GT_Tool; +import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtTools; + public class TOOL_Gregtech_AngleGrinder extends GT_Tool { - public static final List<String> mEffectiveList = - Arrays.asList(new String[] {EntityIronGolem.class.getName(), "EntityTowerGuardian"}); + public static final List<String> mEffectiveList = Arrays + .asList(new String[] { EntityIronGolem.class.getName(), "EntityTowerGuardian" }); @Override - public float getNormalDamageAgainstEntity( - final float aOriginalDamage, final Entity aEntity, final ItemStack aStack, final EntityPlayer aPlayer) { + public float getNormalDamageAgainstEntity(final float aOriginalDamage, final Entity aEntity, final ItemStack aStack, + final EntityPlayer aPlayer) { String tName = aEntity.getClass().getName(); tName = tName.substring(tName.lastIndexOf(".") + 1); return (mEffectiveList.contains(tName)) || (tName.contains("Golem")) ? aOriginalDamage * 2.0F : aOriginalDamage; @@ -122,38 +124,21 @@ public class TOOL_Gregtech_AngleGrinder extends GT_Tool { } @Override - public int convertBlockDrops( - final List<ItemStack> aDrops, - final ItemStack aStack, - final EntityPlayer aPlayer, - final Block aBlock, - final int aX, - final int aY, - final int aZ, - final byte aMetaData, - final int aFortune, - final boolean aSilkTouch, - final BlockEvent.HarvestDropsEvent aEvent) { + public int convertBlockDrops(final List<ItemStack> aDrops, final ItemStack aStack, final EntityPlayer aPlayer, + final Block aBlock, final int aX, final int aY, final int aZ, final byte aMetaData, final int aFortune, + final boolean aSilkTouch, final BlockEvent.HarvestDropsEvent aEvent) { int rConversions = 0; - /*GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sHammerRecipes.findRecipe(null, true, 2147483647L, null, new ItemStack[]{new ItemStack(aBlock, 1, aMetaData)}); - if ((tRecipe == null) || (aBlock.hasTileEntity(aMetaData))) { - for (final ItemStack tDrop : aDrops) { - tRecipe = GT_Recipe.GT_Recipe_Map.sHammerRecipes.findRecipe(null, true, 2147483647L, null, new ItemStack[]{GT_Utility.copyAmount(1L, new Object[]{tDrop})}); - if (tRecipe != null) { - final ItemStack tHammeringOutput = tRecipe.getOutput(0); - if (tHammeringOutput != null) { - rConversions += tDrop.stackSize; - tDrop.stackSize *= tHammeringOutput.stackSize; - tHammeringOutput.stackSize = tDrop.stackSize; - GT_Utility.setStack(tDrop, tHammeringOutput); - } - } - } - } else { - aDrops.clear(); - aDrops.add(tRecipe.getOutput(0)); - rConversions++; - }*/ + /* + * GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sHammerRecipes.findRecipe(null, true, 2147483647L, null, new + * ItemStack[]{new ItemStack(aBlock, 1, aMetaData)}); if ((tRecipe == null) || + * (aBlock.hasTileEntity(aMetaData))) { for (final ItemStack tDrop : aDrops) { tRecipe = + * GT_Recipe.GT_Recipe_Map.sHammerRecipes.findRecipe(null, true, 2147483647L, null, new + * ItemStack[]{GT_Utility.copyAmount(1L, new Object[]{tDrop})}); if (tRecipe != null) { final ItemStack + * tHammeringOutput = tRecipe.getOutput(0); if (tHammeringOutput != null) { rConversions += tDrop.stackSize; + * tDrop.stackSize *= tHammeringOutput.stackSize; tHammeringOutput.stackSize = tDrop.stackSize; + * GT_Utility.setStack(tDrop, tHammeringOutput); } } } } else { aDrops.clear(); + * aDrops.add(tRecipe.getOutput(0)); rConversions++; } + */ return rConversions; } @@ -177,15 +162,18 @@ public class TOOL_Gregtech_AngleGrinder extends GT_Tool { try { GT_Mod.achievements.issueAchievement(aPlayer, "tools"); GT_Mod.achievements.issueAchievement(aPlayer, "unitool"); - } catch (final Exception e) { - } + } catch (final Exception e) {} } @Override public IChatComponent getDeathMessage(final EntityLivingBase aPlayer, final EntityLivingBase aEntity) { - return new ChatComponentText(EnumChatFormatting.RED + aEntity.getCommandSenderName() + EnumChatFormatting.WHITE - + " has been Ground out of existence by " + EnumChatFormatting.GREEN + aPlayer.getCommandSenderName() - + EnumChatFormatting.WHITE); + return new ChatComponentText( + EnumChatFormatting.RED + aEntity.getCommandSenderName() + + EnumChatFormatting.WHITE + + " has been Ground out of existence by " + + EnumChatFormatting.GREEN + + aPlayer.getCommandSenderName() + + EnumChatFormatting.WHITE); } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tools/TOOL_Gregtech_Base.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tools/TOOL_Gregtech_Base.java index db93f8fdd1..5939203637 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tools/TOOL_Gregtech_Base.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tools/TOOL_Gregtech_Base.java @@ -1,10 +1,7 @@ package gtPlusPlus.xmod.gregtech.common.tools; -import gregtech.api.GregTech_API; -import gregtech.api.damagesources.GT_DamageSources; -import gtPlusPlus.xmod.gregtech.api.interfaces.internal.Interface_ToolStats; -import gtPlusPlus.xmod.gregtech.api.items.Gregtech_MetaTool; import java.util.List; + import net.minecraft.block.Block; import net.minecraft.enchantment.Enchantment; import net.minecraft.entity.Entity; @@ -17,9 +14,15 @@ import net.minecraft.util.EntityDamageSource; import net.minecraft.util.IChatComponent; import net.minecraftforge.event.world.BlockEvent; +import gregtech.api.GregTech_API; +import gregtech.api.damagesources.GT_DamageSources; +import gtPlusPlus.xmod.gregtech.api.interfaces.internal.Interface_ToolStats; +import gtPlusPlus.xmod.gregtech.api.items.Gregtech_MetaTool; + public abstract class TOOL_Gregtech_Base implements Interface_ToolStats { - public static final Enchantment[] FORTUNE_ENCHANTMENT = {Enchantment.fortune}; - public static final Enchantment[] LOOTING_ENCHANTMENT = {Enchantment.looting}; + + public static final Enchantment[] FORTUNE_ENCHANTMENT = { Enchantment.fortune }; + public static final Enchantment[] LOOTING_ENCHANTMENT = { Enchantment.looting }; public static final Enchantment[] ZERO_ENCHANTMENTS = new Enchantment[0]; public static final int[] ZERO_ENCHANTMENT_LEVELS = new int[0]; @@ -127,8 +130,7 @@ public abstract class TOOL_Gregtech_Base implements Interface_ToolStats { return GT_DamageSources.getCombatDamage( (aPlayer instanceof EntityPlayer) ? "player" : "mob", aPlayer, - (aEntity instanceof EntityLivingBase) - ? this.getDeathMessage(aPlayer, (EntityLivingBase) aEntity) + (aEntity instanceof EntityLivingBase) ? this.getDeathMessage(aPlayer, (EntityLivingBase) aEntity) : null); } @@ -138,18 +140,9 @@ public abstract class TOOL_Gregtech_Base implements Interface_ToolStats { } @Override - public int convertBlockDrops( - final List<ItemStack> aDrops, - final ItemStack aStack, - final EntityPlayer aPlayer, - final Block aBlock, - final int aX, - final int aY, - final int aZ, - final byte aMetaData, - final int aFortune, - final boolean aSilkTouch, - final BlockEvent.HarvestDropsEvent aEvent) { + public int convertBlockDrops(final List<ItemStack> aDrops, final ItemStack aStack, final EntityPlayer aPlayer, + final Block aBlock, final int aX, final int aY, final int aZ, final byte aMetaData, final int aFortune, + final boolean aSilkTouch, final BlockEvent.HarvestDropsEvent aEvent) { return 0; } @@ -179,14 +172,14 @@ public abstract class TOOL_Gregtech_Base implements Interface_ToolStats { public void onStatsAddedToTool(final Gregtech_MetaTool aItem, final int aID) {} @Override - public float getNormalDamageAgainstEntity( - final float aOriginalDamage, final Entity aEntity, final ItemStack aStack, final EntityPlayer aPlayer) { + public float getNormalDamageAgainstEntity(final float aOriginalDamage, final Entity aEntity, final ItemStack aStack, + final EntityPlayer aPlayer) { return aOriginalDamage; } @Override - public float getMagicDamageAgainstEntity( - final float aOriginalDamage, final Entity aEntity, final ItemStack aStack, final EntityPlayer aPlayer) { + public float getMagicDamageAgainstEntity(final float aOriginalDamage, final Entity aEntity, final ItemStack aStack, + final EntityPlayer aPlayer) { return aOriginalDamage; } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tools/TOOL_Gregtech_Choocher.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tools/TOOL_Gregtech_Choocher.java index efdf8b18e9..bdd501ee99 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tools/TOOL_Gregtech_Choocher.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tools/TOOL_Gregtech_Choocher.java @@ -1,16 +1,8 @@ package gtPlusPlus.xmod.gregtech.common.tools; -import gregtech.GT_Mod; -import gregtech.api.GregTech_API; -import gregtech.api.interfaces.IIconContainer; -import gregtech.api.items.GT_MetaGenerated_Tool; -import gregtech.api.util.GT_Recipe; -import gregtech.api.util.GT_Utility; -import gregtech.common.tools.GT_Tool; -import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtTools; -import gtPlusPlus.xmod.gregtech.common.items.behaviours.Behaviour_Choocher; import java.util.Arrays; import java.util.List; + import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.entity.Entity; @@ -25,14 +17,24 @@ import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.IChatComponent; import net.minecraftforge.event.world.BlockEvent; +import gregtech.GT_Mod; +import gregtech.api.GregTech_API; +import gregtech.api.interfaces.IIconContainer; +import gregtech.api.items.GT_MetaGenerated_Tool; +import gregtech.api.util.GT_Recipe; +import gregtech.api.util.GT_Utility; +import gregtech.common.tools.GT_Tool; +import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtTools; +import gtPlusPlus.xmod.gregtech.common.items.behaviours.Behaviour_Choocher; + public class TOOL_Gregtech_Choocher extends GT_Tool { - public static final List<String> mEffectiveList = - Arrays.asList(new String[] {EntityIronGolem.class.getName(), "EntityTowerGuardian"}); + public static final List<String> mEffectiveList = Arrays + .asList(new String[] { EntityIronGolem.class.getName(), "EntityTowerGuardian" }); @Override - public float getNormalDamageAgainstEntity( - final float aOriginalDamage, final Entity aEntity, final ItemStack aStack, final EntityPlayer aPlayer) { + public float getNormalDamageAgainstEntity(final float aOriginalDamage, final Entity aEntity, final ItemStack aStack, + final EntityPlayer aPlayer) { String tName = aEntity.getClass().getName(); tName = tName.substring(tName.lastIndexOf(".") + 1); return (mEffectiveList.contains(tName)) || (tName.contains("Golem")) ? aOriginalDamage * 2.0F : aOriginalDamage; @@ -120,12 +122,9 @@ public class TOOL_Gregtech_Choocher extends GT_Tool { @Override public boolean isMinableBlock(final Block aBlock, final byte aMetaData) { final String tTool = aBlock.getHarvestTool(aMetaData); - return ((tTool != null) - && ((tTool.equals("sword")) - || (tTool.equals("wrench")) - || (tTool.equals("hammer")) - || (tTool.equals("pickaxe")))) - || (aBlock.getMaterial() == Material.rock) + return ((tTool != null) && ((tTool.equals("sword")) || (tTool.equals("wrench")) + || (tTool.equals("hammer")) + || (tTool.equals("pickaxe")))) || (aBlock.getMaterial() == Material.rock) || (aBlock.getMaterial() == Material.glass) || (aBlock.getMaterial() == Material.piston) || (aBlock == Blocks.hopper) @@ -155,26 +154,20 @@ public class TOOL_Gregtech_Choocher extends GT_Tool { } @Override - public int convertBlockDrops( - final List<ItemStack> aDrops, - final ItemStack aStack, - final EntityPlayer aPlayer, - final Block aBlock, - final int aX, - final int aY, - final int aZ, - final byte aMetaData, - final int aFortune, - final boolean aSilkTouch, - final BlockEvent.HarvestDropsEvent aEvent) { + public int convertBlockDrops(final List<ItemStack> aDrops, final ItemStack aStack, final EntityPlayer aPlayer, + final Block aBlock, final int aX, final int aY, final int aZ, final byte aMetaData, final int aFortune, + final boolean aSilkTouch, final BlockEvent.HarvestDropsEvent aEvent) { int rConversions = 0; - GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sHammerRecipes.findRecipe( - null, true, 2147483647L, null, new ItemStack[] {new ItemStack(aBlock, 1, aMetaData)}); + GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sHammerRecipes + .findRecipe(null, true, 2147483647L, null, new ItemStack[] { new ItemStack(aBlock, 1, aMetaData) }); if ((tRecipe == null) || (aBlock.hasTileEntity(aMetaData))) { for (final ItemStack tDrop : aDrops) { tRecipe = GT_Recipe.GT_Recipe_Map.sHammerRecipes.findRecipe( - null, true, 2147483647L, null, new ItemStack[] {GT_Utility.copyAmount(1L, new Object[] {tDrop}) - }); + null, + true, + 2147483647L, + null, + new ItemStack[] { GT_Utility.copyAmount(1L, new Object[] { tDrop }) }); if (tRecipe != null) { final ItemStack tHammeringOutput = tRecipe.getOutput(0); if (tHammeringOutput != null) { @@ -216,15 +209,18 @@ public class TOOL_Gregtech_Choocher extends GT_Tool { try { GT_Mod.achievements.issueAchievement(aPlayer, "tools"); GT_Mod.achievements.issueAchievement(aPlayer, "unitool"); - } catch (final Exception e) { - } + } catch (final Exception e) {} } @Override public IChatComponent getDeathMessage(final EntityLivingBase aPlayer, final EntityLivingBase aEntity) { - return new ChatComponentText(EnumChatFormatting.RED + aEntity.getCommandSenderName() + EnumChatFormatting.WHITE - + " has been Choochered by " + EnumChatFormatting.GREEN + aPlayer.getCommandSenderName() - + EnumChatFormatting.WHITE); + return new ChatComponentText( + EnumChatFormatting.RED + aEntity.getCommandSenderName() + + EnumChatFormatting.WHITE + + " has been Choochered by " + + EnumChatFormatting.GREEN + + aPlayer.getCommandSenderName() + + EnumChatFormatting.WHITE); } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tools/TOOL_Gregtech_ElectricButcherKnife.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tools/TOOL_Gregtech_ElectricButcherKnife.java index 06e429514e..1580119238 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tools/TOOL_Gregtech_ElectricButcherKnife.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tools/TOOL_Gregtech_ElectricButcherKnife.java @@ -1,16 +1,8 @@ package gtPlusPlus.xmod.gregtech.common.tools; -import gregtech.GT_Mod; -import gregtech.api.GregTech_API; -import gregtech.api.enums.Materials; -import gregtech.api.enums.Textures.ItemIcons; -import gregtech.api.interfaces.IIconContainer; -import gregtech.api.items.GT_MetaGenerated_Tool; -import gregtech.common.items.behaviors.Behaviour_None; -import gregtech.common.tools.GT_Tool; -import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtTools; import java.util.Arrays; import java.util.List; + import net.minecraft.block.Block; import net.minecraft.enchantment.Enchantment; import net.minecraft.entity.Entity; @@ -23,14 +15,24 @@ import net.minecraft.util.ChatComponentText; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.IChatComponent; +import gregtech.GT_Mod; +import gregtech.api.GregTech_API; +import gregtech.api.enums.Materials; +import gregtech.api.enums.Textures.ItemIcons; +import gregtech.api.interfaces.IIconContainer; +import gregtech.api.items.GT_MetaGenerated_Tool; +import gregtech.common.items.behaviors.Behaviour_None; +import gregtech.common.tools.GT_Tool; +import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtTools; + public class TOOL_Gregtech_ElectricButcherKnife extends GT_Tool { - public static final List<String> mEffectiveList = - Arrays.asList(new String[] {EntityIronGolem.class.getName(), "EntityTowerGuardian"}); + public static final List<String> mEffectiveList = Arrays + .asList(new String[] { EntityIronGolem.class.getName(), "EntityTowerGuardian" }); @Override - public float getNormalDamageAgainstEntity( - final float aOriginalDamage, final Entity aEntity, final ItemStack aStack, final EntityPlayer aPlayer) { + public float getNormalDamageAgainstEntity(final float aOriginalDamage, final Entity aEntity, final ItemStack aStack, + final EntityPlayer aPlayer) { String tName = aEntity.getClass().getName(); tName = tName.substring(tName.lastIndexOf(".") + 1); return (mEffectiveList.contains(tName)) || (tName.contains("Golem")) ? aOriginalDamage * 2.0F : aOriginalDamage; @@ -136,15 +138,18 @@ public class TOOL_Gregtech_ElectricButcherKnife extends GT_Tool { try { GT_Mod.achievements.issueAchievement(aPlayer, "tools"); GT_Mod.achievements.issueAchievement(aPlayer, "unitool"); - } catch (final Exception e) { - } + } catch (final Exception e) {} } @Override public IChatComponent getDeathMessage(final EntityLivingBase aPlayer, final EntityLivingBase aEntity) { - return new ChatComponentText(EnumChatFormatting.RED + aEntity.getCommandSenderName() + EnumChatFormatting.WHITE - + " has been Sliced out of existence by " + EnumChatFormatting.GREEN + aPlayer.getCommandSenderName() - + EnumChatFormatting.WHITE); + return new ChatComponentText( + EnumChatFormatting.RED + aEntity.getCommandSenderName() + + EnumChatFormatting.WHITE + + " has been Sliced out of existence by " + + EnumChatFormatting.GREEN + + aPlayer.getCommandSenderName() + + EnumChatFormatting.WHITE); } @Override @@ -179,6 +184,6 @@ public class TOOL_Gregtech_ElectricButcherKnife extends GT_Tool { @Override public int[] getEnchantmentLevels(ItemStack aStack) { - return new int[] {(4 + GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mToolQuality) / 2}; + return new int[] { (4 + GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mToolQuality) / 2 }; } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tools/TOOL_Gregtech_ElectricLighter.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tools/TOOL_Gregtech_ElectricLighter.java index b1f4385a11..f14af8b988 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tools/TOOL_Gregtech_ElectricLighter.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tools/TOOL_Gregtech_ElectricLighter.java @@ -1,16 +1,8 @@ package gtPlusPlus.xmod.gregtech.common.tools; -import gregtech.GT_Mod; -import gregtech.api.GregTech_API; -import gregtech.api.enums.Materials; -import gregtech.api.enums.Textures.ItemIcons; -import gregtech.api.interfaces.IIconContainer; -import gregtech.api.items.GT_MetaGenerated_Tool; -import gregtech.common.tools.GT_Tool; -import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtTools; -import gtPlusPlus.xmod.gregtech.common.items.behaviours.Behaviour_Electric_Lighter; import java.util.Arrays; import java.util.List; + import net.minecraft.block.Block; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; @@ -22,14 +14,24 @@ import net.minecraft.util.ChatComponentText; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.IChatComponent; +import gregtech.GT_Mod; +import gregtech.api.GregTech_API; +import gregtech.api.enums.Materials; +import gregtech.api.enums.Textures.ItemIcons; +import gregtech.api.interfaces.IIconContainer; +import gregtech.api.items.GT_MetaGenerated_Tool; +import gregtech.common.tools.GT_Tool; +import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtTools; +import gtPlusPlus.xmod.gregtech.common.items.behaviours.Behaviour_Electric_Lighter; + public class TOOL_Gregtech_ElectricLighter extends GT_Tool { - public static final List<String> mEffectiveList = - Arrays.asList(new String[] {EntityIronGolem.class.getName(), "EntityTowerGuardian"}); + public static final List<String> mEffectiveList = Arrays + .asList(new String[] { EntityIronGolem.class.getName(), "EntityTowerGuardian" }); @Override - public float getNormalDamageAgainstEntity( - final float aOriginalDamage, final Entity aEntity, final ItemStack aStack, final EntityPlayer aPlayer) { + public float getNormalDamageAgainstEntity(final float aOriginalDamage, final Entity aEntity, final ItemStack aStack, + final EntityPlayer aPlayer) { String tName = aEntity.getClass().getName(); tName = tName.substring(tName.lastIndexOf(".") + 1); return (mEffectiveList.contains(tName)) || (tName.contains("Golem")) ? aOriginalDamage * 2.0F : aOriginalDamage; @@ -139,15 +141,18 @@ public class TOOL_Gregtech_ElectricLighter extends GT_Tool { try { GT_Mod.achievements.issueAchievement(aPlayer, "tools"); GT_Mod.achievements.issueAchievement(aPlayer, "unitool"); - } catch (final Exception e) { - } + } catch (final Exception e) {} } @Override public IChatComponent getDeathMessage(final EntityLivingBase aPlayer, final EntityLivingBase aEntity) { - return new ChatComponentText(EnumChatFormatting.RED + aEntity.getCommandSenderName() + EnumChatFormatting.WHITE - + " has been burnt out of existence by " + EnumChatFormatting.GREEN + aPlayer.getCommandSenderName() - + EnumChatFormatting.WHITE); + return new ChatComponentText( + EnumChatFormatting.RED + aEntity.getCommandSenderName() + + EnumChatFormatting.WHITE + + " has been burnt out of existence by " + + EnumChatFormatting.GREEN + + aPlayer.getCommandSenderName() + + EnumChatFormatting.WHITE); } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tools/TOOL_Gregtech_ElectricSnips.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tools/TOOL_Gregtech_ElectricSnips.java index ae477cd7bb..9586896fc9 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tools/TOOL_Gregtech_ElectricSnips.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tools/TOOL_Gregtech_ElectricSnips.java @@ -1,12 +1,5 @@ package gtPlusPlus.xmod.gregtech.common.tools; -import gregtech.GT_Mod; -import gregtech.api.enums.Materials; -import gregtech.api.enums.Textures.ItemIcons; -import gregtech.api.interfaces.IIconContainer; -import gregtech.api.items.GT_MetaGenerated_Tool; -import gregtech.common.tools.GT_Tool_WireCutter; -import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtTools; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; @@ -15,6 +8,14 @@ import net.minecraft.util.ChatComponentText; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.IChatComponent; +import gregtech.GT_Mod; +import gregtech.api.enums.Materials; +import gregtech.api.enums.Textures.ItemIcons; +import gregtech.api.interfaces.IIconContainer; +import gregtech.api.items.GT_MetaGenerated_Tool; +import gregtech.common.tools.GT_Tool_WireCutter; +import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtTools; + public class TOOL_Gregtech_ElectricSnips extends GT_Tool_WireCutter { @Override @@ -77,14 +78,17 @@ public class TOOL_Gregtech_ElectricSnips extends GT_Tool_WireCutter { try { GT_Mod.achievements.issueAchievement(aPlayer, "tools"); GT_Mod.achievements.issueAchievement(aPlayer, "unitool"); - } catch (final Exception e) { - } + } catch (final Exception e) {} } @Override public IChatComponent getDeathMessage(final EntityLivingBase aPlayer, final EntityLivingBase aEntity) { - return new ChatComponentText(EnumChatFormatting.RED + aEntity.getCommandSenderName() + EnumChatFormatting.WHITE - + " has been Snipped out of existence by " + EnumChatFormatting.GREEN + aPlayer.getCommandSenderName() - + EnumChatFormatting.WHITE); + return new ChatComponentText( + EnumChatFormatting.RED + aEntity.getCommandSenderName() + + EnumChatFormatting.WHITE + + " has been Snipped out of existence by " + + EnumChatFormatting.GREEN + + aPlayer.getCommandSenderName() + + EnumChatFormatting.WHITE); } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/GT_Material_Loader.java b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/GT_Material_Loader.java index 894d45ee39..980efc1bdb 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/GT_Material_Loader.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/GT_Material_Loader.java @@ -1,5 +1,9 @@ package gtPlusPlus.xmod.gregtech.loaders; +import java.lang.reflect.*; +import java.util.HashMap; +import java.util.Map; + import gregtech.api.enums.Materials; import gregtech.api.enums.OrePrefixes; import gtPlusPlus.api.objects.Logger; @@ -8,9 +12,6 @@ import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.minecraft.MaterialUtils; import gtPlusPlus.core.util.reflect.ReflectionUtils; -import java.lang.reflect.*; -import java.util.HashMap; -import java.util.Map; public class GT_Material_Loader { @@ -43,14 +44,16 @@ public class GT_Material_Loader { // Make this class Dynamically implement IMaterialHandler if (mProxyObject == null) { mProxyObject = Proxy.newProxyInstance( - mInterface.getClassLoader(), new Class[] {mInterface}, new MaterialHandler(getInstance())); + mInterface.getClassLoader(), + new Class[] { mInterface }, + new MaterialHandler(getInstance())); } if (ReflectionUtils.invoke( Materials.class, "add", - new Class[] {ReflectionUtils.getClass("gregtech.api.interfaces.IMaterialHandler")}, - new Object[] {mProxyObject})) { + new Class[] { ReflectionUtils.getClass("gregtech.api.interfaces.IMaterialHandler") }, + new Object[] { mProxyObject })) { Logger.REFLECTION("Successfully invoked add, on the proxied object implementing IMaterialHandler."); Logger.REFLECTION("Examining Proxy to ensure it implements the correct Interface."); @@ -134,17 +137,22 @@ public class GT_Material_Loader { enableComponent.invoke(prefix, mMaterial); Logger.DEBUG_MATERIALS("Enabled " + prefix.name() + " for " + mMaterial.mDefaultLocalName + "."); return true; - } catch (IllegalAccessException - | IllegalArgumentException - | InvocationTargetException - | NoSuchMethodException + } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException | NoSuchMethodException | SecurityException error) { - Logger.DEBUG_MATERIALS("Failed to enabled " + prefix.name() + " for " + mMaterial.mDefaultLocalName - + ". Caught " + error.getCause().toString() + "."); + Logger.DEBUG_MATERIALS( + "Failed to enabled " + prefix.name() + + " for " + + mMaterial.mDefaultLocalName + + ". Caught " + + error.getCause().toString() + + "."); error.printStackTrace(); } - Logger.DEBUG_MATERIALS("Did not enable " + prefix.name() + " for " + mMaterial.mDefaultLocalName - + ". Report this error to Alkalus on Github."); + Logger.DEBUG_MATERIALS( + "Did not enable " + prefix.name() + + " for " + + mMaterial.mDefaultLocalName + + ". Report this error to Alkalus on Github."); return false; } @@ -169,8 +177,9 @@ public class GT_Material_Loader { } return mValid > 0; } catch (SecurityException | IllegalArgumentException e) { - Logger.DEBUG_MATERIALS("Total Failure - Unable to re-enable " + MaterialUtils.getMaterialName(material) - + ". Most likely an IllegalArgumentException, but small chance it's a SecurityException."); + Logger.DEBUG_MATERIALS( + "Total Failure - Unable to re-enable " + MaterialUtils.getMaterialName(material) + + ". Most likely an IllegalArgumentException, but small chance it's a SecurityException."); return false; } } @@ -203,77 +212,29 @@ public class GT_Material_Loader { } /* - public static class ProxyListener implements java.lang.reflect.InvocationHandler { - - public static Object IMaterialHandlerProxy; - - ProxyListener(){ - - Logger.REFLECTION("Failed setting IMaterialHandler Proxy instance."); - } - - //Loading the class at runtime - public static void main(String[] args) throws IllegalAccessException, IllegalArgumentException, InvocationTargetException, NoSuchMethodException, SecurityException, ClassNotFoundException { - Class<?> someInterface = ReflectionUtils.getClass("gregtech.api.interfaces.IMaterialHandler"); - Object instance = Proxy.newProxyInstance(someInterface.getClassLoader(), new Class<?>[]{someInterface}, new InvocationHandler() { - - @Override - public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { - //Handle the invocations - if(method.getName().equals("onMaterialsInit")){ - Logger.REFLECTION("Invoked onMaterialsInit() via IMaterialHandler proxy"); - return 1; - } - else if(method.getName().equals("onComponentInit")){ - Logger.REFLECTION("Invoked onComponentInit() via IMaterialHandler proxy"); - return 2; - } - else if(method.getName().equals("onComponentIteration")){ - Logger.REFLECTION("Invoked onComponentIteration() via IMaterialHandler proxy"); - return 3; - } - else { - return -1; - } - } - }); - System.out.println(instance.getClass().getDeclaredMethod("someMethod", (Class<?>[])null).invoke(instance, new Object[]{})); - } - - private static class MaterialHandler implements InvocationHandler { - private final Object original; - - public MaterialHandler(Object original) { - this.original = original; - } - - @Override - public Object invoke(Object proxy, Method method, Object[] args) - throws IllegalAccessException, IllegalArgumentException, - InvocationTargetException { - System.out.println("BEFORE"); - method.invoke(original, args); - System.out.println("AFTER"); - return null; - } - } - - public static void init(){ - - Class<?> someInterface = ReflectionUtils.getClass("gregtech.api.interfaces.IMaterialHandler"); - GT_Material_Loader original = GT_Material_Loader.instance; - MaterialHandler handler = new MaterialHandler(original); - - Object f = Proxy.newProxyInstance(someInterface.getClassLoader(), - new Class[] { someInterface }, - handler); - - f.originalMethod("Hallo"); - } - - - - } - + * public static class ProxyListener implements java.lang.reflect.InvocationHandler { public static Object + * IMaterialHandlerProxy; ProxyListener(){ Logger.REFLECTION("Failed setting IMaterialHandler Proxy instance."); } + * //Loading the class at runtime public static void main(String[] args) throws IllegalAccessException, + * IllegalArgumentException, InvocationTargetException, NoSuchMethodException, SecurityException, + * ClassNotFoundException { Class<?> someInterface = + * ReflectionUtils.getClass("gregtech.api.interfaces.IMaterialHandler"); Object instance = + * Proxy.newProxyInstance(someInterface.getClassLoader(), new Class<?>[]{someInterface}, new InvocationHandler() { + * @Override public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { //Handle the + * invocations if(method.getName().equals("onMaterialsInit")){ + * Logger.REFLECTION("Invoked onMaterialsInit() via IMaterialHandler proxy"); return 1; } else + * if(method.getName().equals("onComponentInit")){ + * Logger.REFLECTION("Invoked onComponentInit() via IMaterialHandler proxy"); return 2; } else + * if(method.getName().equals("onComponentIteration")){ + * Logger.REFLECTION("Invoked onComponentIteration() via IMaterialHandler proxy"); return 3; } else { return -1; } } + * }); System.out.println(instance.getClass().getDeclaredMethod("someMethod", (Class<?>[])null).invoke(instance, new + * Object[]{})); } private static class MaterialHandler implements InvocationHandler { private final Object + * original; public MaterialHandler(Object original) { this.original = original; } + * @Override public Object invoke(Object proxy, Method method, Object[] args) throws IllegalAccessException, + * IllegalArgumentException, InvocationTargetException { System.out.println("BEFORE"); method.invoke(original, + * args); System.out.println("AFTER"); return null; } } public static void init(){ Class<?> someInterface = + * ReflectionUtils.getClass("gregtech.api.interfaces.IMaterialHandler"); GT_Material_Loader original = + * GT_Material_Loader.instance; MaterialHandler handler = new MaterialHandler(original); Object f = + * Proxy.newProxyInstance(someInterface.getClassLoader(), new Class[] { someInterface }, handler); + * f.originalMethod("Hallo"); } } */ } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/ProcessingAngleGrinder.java b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/ProcessingAngleGrinder.java index f43a255534..247cdb890b 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/ProcessingAngleGrinder.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/ProcessingAngleGrinder.java @@ -1,5 +1,7 @@ package gtPlusPlus.xmod.gregtech.loaders; +import net.minecraft.item.ItemStack; + import gregtech.api.enums.GT_Values; import gregtech.api.enums.ItemList; import gregtech.api.enums.Materials; @@ -16,36 +18,27 @@ import gtPlusPlus.xmod.gregtech.api.enums.GregtechOrePrefixes; import gtPlusPlus.xmod.gregtech.api.enums.GregtechOrePrefixes.GT_Materials; import gtPlusPlus.xmod.gregtech.api.interfaces.internal.Interface_OreRecipeRegistrator; import gtPlusPlus.xmod.gregtech.common.items.MetaGeneratedGregtechTools; -import net.minecraft.item.ItemStack; public class ProcessingAngleGrinder implements Interface_OreRecipeRegistrator, Runnable { + public ProcessingAngleGrinder() { GregtechOrePrefixes.toolAngleGrinder.add(this); } @Override - public void registerOre( - final GregtechOrePrefixes aPrefix, - final Materials aMaterial, - final String aOreDictName, - final String aModName, - final ItemStack aStack) { + public void registerOre(final GregtechOrePrefixes aPrefix, final Materials aMaterial, final String aOreDictName, + final String aModName, final ItemStack aStack) { if ((aMaterial != Materials.Stone) && (aMaterial != Materials.Flint)) { if (aMaterial != Materials.Rubber) { - if ((!aMaterial.contains(SubTag.WOOD)) - && (!aMaterial.contains(SubTag.BOUNCY)) + if ((!aMaterial.contains(SubTag.WOOD)) && (!aMaterial.contains(SubTag.BOUNCY)) && (!aMaterial.contains(SubTag.NO_SMASHING))) {} } } } @Override - public void registerOre( - final GregtechOrePrefixes aPrefix, - final GT_Materials aMaterial, - final String aOreDictName, - final String aModName, - final ItemStack aStack) { + public void registerOre(final GregtechOrePrefixes aPrefix, final GT_Materials aMaterial, final String aOreDictName, + final String aModName, final ItemStack aStack) { // TODO Auto-generated method stub } @@ -58,12 +51,10 @@ public class ProcessingAngleGrinder implements Interface_OreRecipeRegistrator, R Materials aMaterial = null; for (int r = 0; r < size; r++) { aMaterial = i[r]; - if ((aMaterial != Materials.Stone) - && (aMaterial != Materials.Flint) + if ((aMaterial != Materials.Stone) && (aMaterial != Materials.Flint) && (aMaterial != Materials.Rubber) && (aMaterial != Materials._NULL)) { - if ((!aMaterial.contains(SubTag.WOOD)) - && (!aMaterial.contains(SubTag.BOUNCY)) + if ((!aMaterial.contains(SubTag.WOOD)) && (!aMaterial.contains(SubTag.BOUNCY)) && (!aMaterial.contains(SubTag.NO_SMASHING)) && (!aMaterial.contains(SubTag.TRANSPARENT)) && (!aMaterial.contains(SubTag.FLAMMABLE)) @@ -83,8 +74,11 @@ public class ProcessingAngleGrinder implements Interface_OreRecipeRegistrator, R } else { Logger.MATERIALS( "Unable to generate Angle Grinder from " + MaterialUtils.getMaterialName(aMaterial) - + ", Plate or Long Rod may be invalid. Invalid | Plate? " + (plate == null) - + " | Rod? " + (longrod == null) + " |"); + + ", Plate or Long Rod may be invalid. Invalid | Plate? " + + (plate == null) + + " | Rod? " + + (longrod == null) + + " |"); } // GT_ModHandler.addCraftingRecipe(, // GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | @@ -113,38 +107,27 @@ public class ProcessingAngleGrinder implements Interface_OreRecipeRegistrator, R public boolean addRecipe(Materials aMaterial, long aBatteryStorage, int aVoltageTier, ItemStack aBattery) { ItemStack aOutputStack = MetaGeneratedGregtechTools.INSTANCE.getToolWithStats( - MetaGeneratedGregtechTools.ANGLE_GRINDER, 1, aMaterial, Materials.Titanium, new long[] { - aBatteryStorage, GT_Values.V[aVoltageTier], 3L, -1L - }); + MetaGeneratedGregtechTools.ANGLE_GRINDER, + 1, + aMaterial, + Materials.Titanium, + new long[] { aBatteryStorage, GT_Values.V[aVoltageTier], 3L, -1L }); long aDura = MetaGeneratedGregtechTools.getToolMaxDamage(aOutputStack); if (aDura <= 32000) { - Logger.MATERIALS("Unable to generate Angle Grinder from " + MaterialUtils.getMaterialName(aMaterial) - + ", Durability: " + aDura); + Logger.MATERIALS( + "Unable to generate Angle Grinder from " + MaterialUtils.getMaterialName(aMaterial) + + ", Durability: " + + aDura); return false; } return GT_ModHandler.addCraftingRecipe( aOutputStack, RecipeBits.DISMANTLEABLE | RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | RecipeBits.BUFFERED, - new Object[] { - "SXL", - "GMG", - "PBP", - 'X', - ItemList.Component_Grinder_Tungsten.get(1), - 'M', - CI.getElectricMotor(aVoltageTier, 1), - 'S', - OrePrefixes.screw.get(Materials.Titanium), - 'L', - OrePrefixes.stickLong.get(aMaterial), - 'P', - OrePrefixes.plate.get(aMaterial), - 'G', - ELEMENT.STANDALONE.BLACK_METAL.getGear(1), - 'B', - aBattery - }); + new Object[] { "SXL", "GMG", "PBP", 'X', ItemList.Component_Grinder_Tungsten.get(1), 'M', + CI.getElectricMotor(aVoltageTier, 1), 'S', OrePrefixes.screw.get(Materials.Titanium), 'L', + OrePrefixes.stickLong.get(aMaterial), 'P', OrePrefixes.plate.get(aMaterial), 'G', + ELEMENT.STANDALONE.BLACK_METAL.getGear(1), 'B', aBattery }); } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/ProcessingElectricButcherKnife.java b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/ProcessingElectricButcherKnife.java index 43c9d31727..f1493f2e63 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/ProcessingElectricButcherKnife.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/ProcessingElectricButcherKnife.java @@ -1,5 +1,7 @@ package gtPlusPlus.xmod.gregtech.loaders; +import net.minecraft.item.ItemStack; + import gregtech.api.enums.GT_Values; import gregtech.api.enums.ItemList; import gregtech.api.enums.Materials; @@ -15,36 +17,27 @@ import gtPlusPlus.xmod.gregtech.api.enums.GregtechOrePrefixes; import gtPlusPlus.xmod.gregtech.api.enums.GregtechOrePrefixes.GT_Materials; import gtPlusPlus.xmod.gregtech.api.interfaces.internal.Interface_OreRecipeRegistrator; import gtPlusPlus.xmod.gregtech.common.items.MetaGeneratedGregtechTools; -import net.minecraft.item.ItemStack; public class ProcessingElectricButcherKnife implements Interface_OreRecipeRegistrator, Runnable { + public ProcessingElectricButcherKnife() { GregtechOrePrefixes.toolElectricButcherKnife.add(this); } @Override - public void registerOre( - final GregtechOrePrefixes aPrefix, - final Materials aMaterial, - final String aOreDictName, - final String aModName, - final ItemStack aStack) { + public void registerOre(final GregtechOrePrefixes aPrefix, final Materials aMaterial, final String aOreDictName, + final String aModName, final ItemStack aStack) { if ((aMaterial != Materials.Stone) && (aMaterial != Materials.Flint)) { if (aMaterial != Materials.Rubber) { - if ((!aMaterial.contains(SubTag.WOOD)) - && (!aMaterial.contains(SubTag.BOUNCY)) + if ((!aMaterial.contains(SubTag.WOOD)) && (!aMaterial.contains(SubTag.BOUNCY)) && (!aMaterial.contains(SubTag.NO_SMASHING))) {} } } } @Override - public void registerOre( - final GregtechOrePrefixes aPrefix, - final GT_Materials aMaterial, - final String aOreDictName, - final String aModName, - final ItemStack aStack) { + public void registerOre(final GregtechOrePrefixes aPrefix, final GT_Materials aMaterial, final String aOreDictName, + final String aModName, final ItemStack aStack) { // TODO Auto-generated method stub } @@ -57,12 +50,10 @@ public class ProcessingElectricButcherKnife implements Interface_OreRecipeRegist Materials aMaterial = null; for (int r = 0; r < size; r++) { aMaterial = i[r]; - if ((aMaterial != Materials.Stone) - && (aMaterial != Materials.Flint) + if ((aMaterial != Materials.Stone) && (aMaterial != Materials.Flint) && (aMaterial != Materials.Rubber) && (aMaterial != Materials._NULL)) { - if ((!aMaterial.contains(SubTag.WOOD)) - && (!aMaterial.contains(SubTag.BOUNCY)) + if ((!aMaterial.contains(SubTag.WOOD)) && (!aMaterial.contains(SubTag.BOUNCY)) && (!aMaterial.contains(SubTag.NO_SMASHING)) && (!aMaterial.contains(SubTag.TRANSPARENT)) && (!aMaterial.contains(SubTag.FLAMMABLE)) @@ -81,10 +72,13 @@ public class ProcessingElectricButcherKnife implements Interface_OreRecipeRegist addRecipe(aMaterial, 800000L, 3, ItemList.Battery_RE_HV_Sodium.get(1)); used++; } else { - Logger.MATERIALS("Unable to generate Electric Butcher Knife from " - + MaterialUtils.getMaterialName(aMaterial) - + ", Plate or Long Rod may be invalid. Invalid | Plate? " + (plate == null) + " | Rod? " - + " |"); + Logger.MATERIALS( + "Unable to generate Electric Butcher Knife from " + + MaterialUtils.getMaterialName(aMaterial) + + ", Plate or Long Rod may be invalid. Invalid | Plate? " + + (plate == null) + + " | Rod? " + + " |"); } // GT_ModHandler.addCraftingRecipe(, // GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | @@ -93,8 +87,9 @@ public class ProcessingElectricButcherKnife implements Interface_OreRecipeRegist // Character.valueOf('P'), OrePrefixes.plate.get(aMaterial), // Character.valueOf('H'), OrePrefixes.toolHeadHammer.get(aMaterial)}); } else { - Logger.MATERIALS("Unable to generate Electric Butcher Knife from " - + MaterialUtils.getMaterialName(aMaterial)); + Logger.MATERIALS( + "Unable to generate Electric Butcher Knife from " + + MaterialUtils.getMaterialName(aMaterial)); } } else { Logger.MATERIALS( @@ -114,17 +109,21 @@ public class ProcessingElectricButcherKnife implements Interface_OreRecipeRegist public boolean addRecipe(Materials aMaterial, long aBatteryStorage, int aVoltageTier, ItemStack aBattery) { ItemStack aOutputStack = MetaGeneratedGregtechTools.INSTANCE.getToolWithStats( - MetaGeneratedGregtechTools.ELECTRIC_BUTCHER_KNIFE, 1, aMaterial, Materials.Titanium, new long[] { - aBatteryStorage, GT_Values.V[aVoltageTier], 3L, -1L - }); + MetaGeneratedGregtechTools.ELECTRIC_BUTCHER_KNIFE, + 1, + aMaterial, + Materials.Titanium, + new long[] { aBatteryStorage, GT_Values.V[aVoltageTier], 3L, -1L }); - ItemStack aInputCutter = GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( - GT_MetaGenerated_Tool_01.BUTCHERYKNIFE, 1, aMaterial, aMaterial, null); + ItemStack aInputCutter = GT_MetaGenerated_Tool_01.INSTANCE + .getToolWithStats(GT_MetaGenerated_Tool_01.BUTCHERYKNIFE, 1, aMaterial, aMaterial, null); long aDura = MetaGeneratedGregtechTools.getToolMaxDamage(aOutputStack); if (aDura <= 32000) { - Logger.MATERIALS("Unable to generate Electric Butcher Knife from " - + MaterialUtils.getMaterialName(aMaterial) + ", Durability: " + aDura); + Logger.MATERIALS( + "Unable to generate Electric Butcher Knife from " + MaterialUtils.getMaterialName(aMaterial) + + ", Durability: " + + aDura); return false; } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/ProcessingElectricLighter.java b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/ProcessingElectricLighter.java index 5d6e87b204..ee1cbc2744 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/ProcessingElectricLighter.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/ProcessingElectricLighter.java @@ -1,5 +1,7 @@ package gtPlusPlus.xmod.gregtech.loaders; +import net.minecraft.item.ItemStack; + import gregtech.api.enums.GT_Values; import gregtech.api.enums.ItemList; import gregtech.api.enums.Materials; @@ -16,36 +18,27 @@ import gtPlusPlus.xmod.gregtech.api.enums.GregtechOrePrefixes; import gtPlusPlus.xmod.gregtech.api.enums.GregtechOrePrefixes.GT_Materials; import gtPlusPlus.xmod.gregtech.api.interfaces.internal.Interface_OreRecipeRegistrator; import gtPlusPlus.xmod.gregtech.common.items.MetaGeneratedGregtechTools; -import net.minecraft.item.ItemStack; public class ProcessingElectricLighter implements Interface_OreRecipeRegistrator, Runnable { + public ProcessingElectricLighter() { GregtechOrePrefixes.toolElectricLighter.add(this); } @Override - public void registerOre( - final GregtechOrePrefixes aPrefix, - final Materials aMaterial, - final String aOreDictName, - final String aModName, - final ItemStack aStack) { + public void registerOre(final GregtechOrePrefixes aPrefix, final Materials aMaterial, final String aOreDictName, + final String aModName, final ItemStack aStack) { if ((aMaterial != Materials.Stone) && (aMaterial != Materials.Flint)) { if (aMaterial != Materials.Rubber) { - if ((!aMaterial.contains(SubTag.WOOD)) - && (!aMaterial.contains(SubTag.BOUNCY)) + if ((!aMaterial.contains(SubTag.WOOD)) && (!aMaterial.contains(SubTag.BOUNCY)) && (!aMaterial.contains(SubTag.NO_SMASHING))) {} } } } @Override - public void registerOre( - final GregtechOrePrefixes aPrefix, - final GT_Materials aMaterial, - final String aOreDictName, - final String aModName, - final ItemStack aStack) { + public void registerOre(final GregtechOrePrefixes aPrefix, final GT_Materials aMaterial, final String aOreDictName, + final String aModName, final ItemStack aStack) { // TODO Auto-generated method stub } @@ -58,12 +51,10 @@ public class ProcessingElectricLighter implements Interface_OreRecipeRegistrator Materials aMaterial = null; for (int r = 0; r < size; r++) { aMaterial = i[r]; - if ((aMaterial != Materials.Stone) - && (aMaterial != Materials.Flint) + if ((aMaterial != Materials.Stone) && (aMaterial != Materials.Flint) && (aMaterial != Materials.Rubber) && (aMaterial != Materials._NULL)) { - if ((!aMaterial.contains(SubTag.WOOD)) - && (!aMaterial.contains(SubTag.BOUNCY)) + if ((!aMaterial.contains(SubTag.WOOD)) && (!aMaterial.contains(SubTag.BOUNCY)) && (!aMaterial.contains(SubTag.NO_SMASHING)) && (!aMaterial.contains(SubTag.TRANSPARENT)) && (!aMaterial.contains(SubTag.FLAMMABLE)) @@ -82,8 +73,10 @@ public class ProcessingElectricLighter implements Interface_OreRecipeRegistrator } else { Logger.MATERIALS( "Unable to generate Electric Lighter from " + MaterialUtils.getMaterialName(aMaterial) - + ", Plate or Long Rod may be invalid. Invalid | Plate? " + (plate == null) - + " | Rod? " + " |"); + + ", Plate or Long Rod may be invalid. Invalid | Plate? " + + (plate == null) + + " | Rod? " + + " |"); } // GT_ModHandler.addCraftingRecipe(, // GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | @@ -113,17 +106,21 @@ public class ProcessingElectricLighter implements Interface_OreRecipeRegistrator public boolean addRecipe(Materials aMaterial, long aBatteryStorage, int aVoltageTier, ItemStack aBattery) { ItemStack aOutputStack = MetaGeneratedGregtechTools.INSTANCE.getToolWithStats( - MetaGeneratedGregtechTools.ELECTRIC_LIGHTER, 1, aMaterial, Materials.Titanium, new long[] { - aBatteryStorage, GT_Values.V[aVoltageTier], 3L, -1L - }); + MetaGeneratedGregtechTools.ELECTRIC_LIGHTER, + 1, + aMaterial, + Materials.Titanium, + new long[] { aBatteryStorage, GT_Values.V[aVoltageTier], 3L, -1L }); - ItemStack aInputCutter = GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( - GT_MetaGenerated_Tool_01.SOLDERING_IRON_LV, 1, aMaterial, aMaterial, null); + ItemStack aInputCutter = GT_MetaGenerated_Tool_01.INSTANCE + .getToolWithStats(GT_MetaGenerated_Tool_01.SOLDERING_IRON_LV, 1, aMaterial, aMaterial, null); long aDura = MetaGeneratedGregtechTools.getToolMaxDamage(aOutputStack); if (aDura <= 32000) { - Logger.MATERIALS("Unable to generate Electric Lighter from " + MaterialUtils.getMaterialName(aMaterial) - + ", Durability: " + aDura); + Logger.MATERIALS( + "Unable to generate Electric Lighter from " + MaterialUtils.getMaterialName(aMaterial) + + ", Durability: " + + aDura); return false; } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/ProcessingElectricSnips.java b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/ProcessingElectricSnips.java index 9ea8eaf867..a431d4a500 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/ProcessingElectricSnips.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/ProcessingElectricSnips.java @@ -1,5 +1,7 @@ package gtPlusPlus.xmod.gregtech.loaders; +import net.minecraft.item.ItemStack; + import gregtech.api.enums.GT_Values; import gregtech.api.enums.ItemList; import gregtech.api.enums.Materials; @@ -16,36 +18,27 @@ import gtPlusPlus.xmod.gregtech.api.enums.GregtechOrePrefixes; import gtPlusPlus.xmod.gregtech.api.enums.GregtechOrePrefixes.GT_Materials; import gtPlusPlus.xmod.gregtech.api.interfaces.internal.Interface_OreRecipeRegistrator; import gtPlusPlus.xmod.gregtech.common.items.MetaGeneratedGregtechTools; -import net.minecraft.item.ItemStack; public class ProcessingElectricSnips implements Interface_OreRecipeRegistrator, Runnable { + public ProcessingElectricSnips() { GregtechOrePrefixes.toolElectricSnips.add(this); } @Override - public void registerOre( - final GregtechOrePrefixes aPrefix, - final Materials aMaterial, - final String aOreDictName, - final String aModName, - final ItemStack aStack) { + public void registerOre(final GregtechOrePrefixes aPrefix, final Materials aMaterial, final String aOreDictName, + final String aModName, final ItemStack aStack) { if ((aMaterial != Materials.Stone) && (aMaterial != Materials.Flint)) { if (aMaterial != Materials.Rubber) { - if ((!aMaterial.contains(SubTag.WOOD)) - && (!aMaterial.contains(SubTag.BOUNCY)) + if ((!aMaterial.contains(SubTag.WOOD)) && (!aMaterial.contains(SubTag.BOUNCY)) && (!aMaterial.contains(SubTag.NO_SMASHING))) {} } } } @Override - public void registerOre( - final GregtechOrePrefixes aPrefix, - final GT_Materials aMaterial, - final String aOreDictName, - final String aModName, - final ItemStack aStack) { + public void registerOre(final GregtechOrePrefixes aPrefix, final GT_Materials aMaterial, final String aOreDictName, + final String aModName, final ItemStack aStack) { // TODO Auto-generated method stub } @@ -58,12 +51,10 @@ public class ProcessingElectricSnips implements Interface_OreRecipeRegistrator, Materials aMaterial = null; for (int r = 0; r < size; r++) { aMaterial = i[r]; - if ((aMaterial != Materials.Stone) - && (aMaterial != Materials.Flint) + if ((aMaterial != Materials.Stone) && (aMaterial != Materials.Flint) && (aMaterial != Materials.Rubber) && (aMaterial != Materials._NULL)) { - if ((!aMaterial.contains(SubTag.WOOD)) - && (!aMaterial.contains(SubTag.BOUNCY)) + if ((!aMaterial.contains(SubTag.WOOD)) && (!aMaterial.contains(SubTag.BOUNCY)) && (!aMaterial.contains(SubTag.NO_SMASHING)) && (!aMaterial.contains(SubTag.TRANSPARENT)) && (!aMaterial.contains(SubTag.FLAMMABLE)) @@ -82,8 +73,10 @@ public class ProcessingElectricSnips implements Interface_OreRecipeRegistrator, } else { Logger.MATERIALS( "Unable to generate Electric Snips from " + MaterialUtils.getMaterialName(aMaterial) - + ", Plate or Long Rod may be invalid. Invalid | Plate? " + (plate == null) - + " | Rod? " + " |"); + + ", Plate or Long Rod may be invalid. Invalid | Plate? " + + (plate == null) + + " | Rod? " + + " |"); } // GT_ModHandler.addCraftingRecipe(, // GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | @@ -112,17 +105,21 @@ public class ProcessingElectricSnips implements Interface_OreRecipeRegistrator, public boolean addRecipe(Materials aMaterial, long aBatteryStorage, int aVoltageTier, ItemStack aBattery) { ItemStack aOutputStack = MetaGeneratedGregtechTools.INSTANCE.getToolWithStats( - MetaGeneratedGregtechTools.ELECTRIC_SNIPS, 1, aMaterial, Materials.Titanium, new long[] { - aBatteryStorage, GT_Values.V[aVoltageTier], 3L, -1L - }); + MetaGeneratedGregtechTools.ELECTRIC_SNIPS, + 1, + aMaterial, + Materials.Titanium, + new long[] { aBatteryStorage, GT_Values.V[aVoltageTier], 3L, -1L }); - ItemStack aInputCutter = GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( - GT_MetaGenerated_Tool_01.WIRECUTTER, 1, aMaterial, aMaterial, null); + ItemStack aInputCutter = GT_MetaGenerated_Tool_01.INSTANCE + .getToolWithStats(GT_MetaGenerated_Tool_01.WIRECUTTER, 1, aMaterial, aMaterial, null); long aDura = MetaGeneratedGregtechTools.getToolMaxDamage(aOutputStack); if (aDura <= 32000) { - Logger.MATERIALS("Unable to generate Electric Snips from " + MaterialUtils.getMaterialName(aMaterial) - + ", Durability: " + aDura); + Logger.MATERIALS( + "Unable to generate Electric Snips from " + MaterialUtils.getMaterialName(aMaterial) + + ", Durability: " + + aDura); return false; } return RecipeUtils.addShapedRecipe( diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/ProcessingToolHeadChoocher.java b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/ProcessingToolHeadChoocher.java index a9011ca3bc..7e02cfba09 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/ProcessingToolHeadChoocher.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/ProcessingToolHeadChoocher.java @@ -1,5 +1,7 @@ package gtPlusPlus.xmod.gregtech.loaders; +import net.minecraft.item.ItemStack; + import gregtech.api.enums.*; import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_OreDictUnificator; @@ -9,42 +11,33 @@ import gtPlusPlus.xmod.gregtech.api.enums.GregtechOrePrefixes; import gtPlusPlus.xmod.gregtech.api.enums.GregtechOrePrefixes.GT_Materials; import gtPlusPlus.xmod.gregtech.api.interfaces.internal.Interface_OreRecipeRegistrator; import gtPlusPlus.xmod.gregtech.common.items.MetaGeneratedGregtechTools; -import net.minecraft.item.ItemStack; public class ProcessingToolHeadChoocher implements Interface_OreRecipeRegistrator, Runnable { + public ProcessingToolHeadChoocher() { GregtechOrePrefixes.toolSkookumChoocher.add(this); } @Override - public void registerOre( - final GregtechOrePrefixes aPrefix, - final Materials aMaterial, - final String aOreDictName, - final String aModName, - final ItemStack aStack) { + public void registerOre(final GregtechOrePrefixes aPrefix, final Materials aMaterial, final String aOreDictName, + final String aModName, final ItemStack aStack) { if ((aMaterial != Materials.Stone) && (aMaterial != Materials.Flint)) { if (aMaterial != Materials.Rubber) { - if ((!aMaterial.contains(SubTag.WOOD)) - && (!aMaterial.contains(SubTag.BOUNCY)) + if ((!aMaterial.contains(SubTag.WOOD)) && (!aMaterial.contains(SubTag.BOUNCY)) && (!aMaterial.contains(SubTag.NO_SMASHING))) { GT_ModHandler.addCraftingRecipe( MetaGeneratedGregtechTools.INSTANCE.getToolWithStats(16, 1, aMaterial, aMaterial, null), GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, - new Object[] {"IhI", "III", " I ", Character.valueOf('I'), OrePrefixes.ingot.get(aMaterial) - }); + new Object[] { "IhI", "III", " I ", Character.valueOf('I'), + OrePrefixes.ingot.get(aMaterial) }); } } } } @Override - public void registerOre( - final GregtechOrePrefixes aPrefix, - final GT_Materials aMaterial, - final String aOreDictName, - final String aModName, - final ItemStack aStack) { + public void registerOre(final GregtechOrePrefixes aPrefix, final GT_Materials aMaterial, final String aOreDictName, + final String aModName, final ItemStack aStack) { // TODO Auto-generated method stub } @@ -57,12 +50,10 @@ public class ProcessingToolHeadChoocher implements Interface_OreRecipeRegistrato Materials aMaterial = null; for (int r = 0; r < size; r++) { aMaterial = i[r]; - if ((aMaterial != Materials.Stone) - && (aMaterial != Materials.Flint) + if ((aMaterial != Materials.Stone) && (aMaterial != Materials.Flint) && (aMaterial != Materials.Rubber) && (aMaterial != Materials._NULL)) { - if ((!aMaterial.contains(SubTag.WOOD)) - && (!aMaterial.contains(SubTag.BOUNCY)) + if ((!aMaterial.contains(SubTag.WOOD)) && (!aMaterial.contains(SubTag.BOUNCY)) && (!aMaterial.contains(SubTag.NO_SMASHING)) && (!aMaterial.contains(SubTag.TRANSPARENT)) && (!aMaterial.contains(SubTag.FLAMMABLE)) @@ -76,8 +67,7 @@ public class ProcessingToolHeadChoocher implements Interface_OreRecipeRegistrato final ItemStack longrod = GT_OreDictUnificator.get(OrePrefixes.stickLong, aMaterial, 1L); final ItemStack hammerhead = GT_OreDictUnificator.get(OrePrefixes.toolHeadHammer, aMaterial, 1L); - if ((null != plate) - && (null != ingot) + if ((null != plate) && (null != ingot) && (null != hammerhead) && (null != longrod) && (null != screw)) { @@ -92,12 +82,22 @@ public class ProcessingToolHeadChoocher implements Interface_OreRecipeRegistrato screw, null, MetaGeneratedGregtechTools.INSTANCE.getToolWithStats( - MetaGeneratedGregtechTools.SKOOKUM_CHOOCHER, 1, aMaterial, null, null)); + MetaGeneratedGregtechTools.SKOOKUM_CHOOCHER, + 1, + aMaterial, + null, + null)); used++; } else { - Logger.WARNING("" + aMaterial.name() + " could not be used for all input compoenents. [3x" - + aMaterial.name() + " plates, 2x" + aMaterial.name() + " ingots, 1x" + aMaterial.name() - + " Hard Hammer Head."); + Logger.WARNING( + "" + aMaterial.name() + + " could not be used for all input compoenents. [3x" + + aMaterial.name() + + " plates, 2x" + + aMaterial.name() + + " ingots, 1x" + + aMaterial.name() + + " Hard Hammer Head."); } // GT_ModHandler.addCraftingRecipe(, GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | // GT_ModHandler.RecipeBits.BUFFERED, new Object[]{"P H", "PIP", " I ", Character.valueOf('I'), diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_AlloySmelter.java b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_AlloySmelter.java index c2f0d1e623..28d0609e93 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_AlloySmelter.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_AlloySmelter.java @@ -1,13 +1,14 @@ package gtPlusPlus.xmod.gregtech.loaders; +import java.util.HashSet; +import java.util.Set; + import gregtech.api.enums.GT_Values; import gregtech.api.enums.ItemList; import gtPlusPlus.api.interfaces.RunnableWithInfo; import gtPlusPlus.core.material.Material; import gtPlusPlus.core.material.MaterialGenerator; import gtPlusPlus.core.util.minecraft.ItemUtils; -import java.util.HashSet; -import java.util.Set; public class RecipeGen_AlloySmelter extends RecipeGen_Base { diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Assembler.java b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Assembler.java index 90195a15e8..79a5947d66 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Assembler.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Assembler.java @@ -1,14 +1,16 @@ package gtPlusPlus.xmod.gregtech.loaders; +import java.util.HashSet; +import java.util.Set; + +import net.minecraft.item.ItemStack; + import gregtech.api.enums.GT_Values; import gtPlusPlus.api.interfaces.RunnableWithInfo; import gtPlusPlus.core.material.Material; import gtPlusPlus.core.material.MaterialGenerator; import gtPlusPlus.core.util.minecraft.FluidUtils; import gtPlusPlus.core.util.minecraft.ItemUtils; -import java.util.HashSet; -import java.util.Set; -import net.minecraft.item.ItemStack; public class RecipeGen_Assembler extends RecipeGen_Base { @@ -31,7 +33,7 @@ public class RecipeGen_Assembler extends RecipeGen_Base { private void generateRecipes(final Material material) { // Frame Box - if (ItemUtils.checkForInvalidItems(new ItemStack[] {material.getRod(1), material.getFrameBox(1)})) + if (ItemUtils.checkForInvalidItems(new ItemStack[] { material.getRod(1), material.getFrameBox(1) })) GT_Values.RA.addAssemblerRecipe( material.getRod(4), ItemUtils.getGregtechCircuit(4), @@ -41,22 +43,37 @@ public class RecipeGen_Assembler extends RecipeGen_Base { // Rotor if (ItemUtils.checkForInvalidItems( - new ItemStack[] {material.getPlate(1), material.getRing(1), material.getRotor(1)})) + new ItemStack[] { material.getPlate(1), material.getRing(1), material.getRotor(1) })) addAssemblerRecipe( - material.getPlate(4), material.getRing(1), material.getRotor(1), 240, material.vVoltageMultiplier); + material.getPlate(4), + material.getRing(1), + material.getRotor(1), + 240, + material.vVoltageMultiplier); } - private static void addAssemblerRecipe( - final ItemStack input1, - final ItemStack input2, - final ItemStack output1, - final int seconds, - final int euCost) { + private static void addAssemblerRecipe(final ItemStack input1, final ItemStack input2, final ItemStack output1, + final int seconds, final int euCost) { GT_Values.RA.addAssemblerRecipe( - input1, input2, FluidUtils.getFluidStack("molten.solderingalloy", 16), output1, seconds, euCost); + input1, + input2, + FluidUtils.getFluidStack("molten.solderingalloy", 16), + output1, + seconds, + euCost); GT_Values.RA.addAssemblerRecipe( - input1, input2, FluidUtils.getFluidStack("molten.tin", 32), output1, seconds, euCost); + input1, + input2, + FluidUtils.getFluidStack("molten.tin", 32), + output1, + seconds, + euCost); GT_Values.RA.addAssemblerRecipe( - input1, input2, FluidUtils.getFluidStack("molten.lead", 48), output1, seconds, euCost); + input1, + input2, + FluidUtils.getFluidStack("molten.lead", 48), + output1, + seconds, + euCost); } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_BlastSmelter.java b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_BlastSmelter.java index b6b8a3f7ac..58f8d3e349 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_BlastSmelter.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_BlastSmelter.java @@ -1,5 +1,12 @@ package gtPlusPlus.xmod.gregtech.loaders; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.Set; + +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidStack; + import gregtech.api.enums.GT_Values; import gregtech.api.enums.ItemList; import gtPlusPlus.api.interfaces.RunnableWithInfo; @@ -15,11 +22,6 @@ import gtPlusPlus.core.material.state.MaterialState; import gtPlusPlus.core.util.minecraft.FluidUtils; import gtPlusPlus.core.util.minecraft.ItemUtils; import gtPlusPlus.core.util.minecraft.MaterialUtils; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.Set; -import net.minecraft.item.ItemStack; -import net.minecraftforge.fluids.FluidStack; public class RecipeGen_BlastSmelter extends RecipeGen_Base { @@ -45,14 +47,8 @@ public class RecipeGen_BlastSmelter extends RecipeGen_Base { ItemStack tStack; if (null != (tStack = M.getDust(1))) { - final Material[] badMaterials = { - FLUORIDES.THORIUM_HEXAFLUORIDE, - FLUORIDES.THORIUM_TETRAFLUORIDE, - ALLOY.BLOODSTEEL, - NUCLIDE.LiFBeF2ThF4UF4, - NUCLIDE.LiFBeF2ZrF4UF4, - NUCLIDE.LiFBeF2ZrF4U235 - }; + final Material[] badMaterials = { FLUORIDES.THORIUM_HEXAFLUORIDE, FLUORIDES.THORIUM_TETRAFLUORIDE, + ALLOY.BLOODSTEEL, NUCLIDE.LiFBeF2ThF4UF4, NUCLIDE.LiFBeF2ZrF4UF4, NUCLIDE.LiFBeF2ZrF4U235 }; for (final Material R : badMaterials) { if (M == R) { return; @@ -71,13 +67,10 @@ public class RecipeGen_BlastSmelter extends RecipeGen_Base { ItemStack circuitGT = ItemUtils.getGregtechCircuit(0); // Set a duration - OLD - /*int duration = 0; - if (M.getMeltingPointK() > 150){ - duration = (int) Math.max(M.getMass() / 50L, 1L) * M.getMeltingPointK(); - } - else { - duration = (int) Math.max(M.getMass() / 50L, 1L) * 150; - }*/ + /* + * int duration = 0; if (M.getMeltingPointK() > 150){ duration = (int) Math.max(M.getMass() / 50L, 1L) * + * M.getMeltingPointK(); } else { duration = (int) Math.max(M.getMass() / 50L, 1L) * 150; } + */ long aVoltage = MaterialUtils.getVoltageForTier(M.vTier); @@ -112,15 +105,24 @@ public class RecipeGen_BlastSmelter extends RecipeGen_Base { // Make a simple one Material Materialstack[] and log it for validity. circuitGT = ItemUtils.getGregtechCircuit(1); - final ItemStack[] tItemStackTest = new ItemStack[] {circuitGT, tStack}; + final ItemStack[] tItemStackTest = new ItemStack[] { circuitGT, tStack }; inputStackCount = 1; fluidAmount = 144 * inputStackCount; - Logger.WARNING("[BAS] Adding an Alloy Blast Smelter Recipe for " + M.getLocalizedName() + ". Gives " - + fluidAmount + "L of molten metal."); + Logger.WARNING( + "[BAS] Adding an Alloy Blast Smelter Recipe for " + M.getLocalizedName() + + ". Gives " + + fluidAmount + + "L of molten metal."); for (int das = 0; das < tItemStackTest.length; das++) { if (tItemStackTest[das] != null) { - Logger.WARNING("[BAS] tMaterial[" + das + "]: " + tItemStackTest[das].getDisplayName() + " Meta: " - + tItemStackTest[das].getItemDamage() + ", Amount: " + tItemStackTest[das].stackSize); + Logger.WARNING( + "[BAS] tMaterial[" + das + + "]: " + + tItemStackTest[das].getDisplayName() + + " Meta: " + + tItemStackTest[das].getItemDamage() + + ", Amount: " + + tItemStackTest[das].stackSize); } } @@ -137,18 +139,18 @@ public class RecipeGen_BlastSmelter extends RecipeGen_Base { (int) aVoltage)) { Logger.WARNING("[BAS] Success."); Logger.WARNING("[BAS] Success, Also added a Fluid solidifier recipe."); - /*if (GT_Values.RA.addFluidExtractionRecipe(M.getIngot(1), null, M.getFluidStack(144), 100, duration, 120)){ - Logger.WARNING("[BAS] Success, Also added a Fluid Extractor recipe."); - } - if (GT_Values.RA.addFluidExtractionRecipe(M.getNugget(1), null, M.getFluidStack(16), 100, duration/9, 120)){ - Logger.WARNING("[BAS] Success, Also added a Fluid Extractor recipe."); - }*/ - /*if (GT_Values.RA.addFluidExtractionRecipe(M.getSmallDust(1), null, M.getFluid(36), 100, duration/4, 120)){ - Logger.WARNING("[BAS] Success, Also added a Fluid Extractor recipe."); - } - if (GT_Values.RA.addFluidExtractionRecipe(M.getTinyDust(1), null, M.getFluid(16), 100, duration/9, 120)){ - Logger.WARNING("[BAS] Success, Also added a Fluid Extractor recipe."); - }*/ + /* + * if (GT_Values.RA.addFluidExtractionRecipe(M.getIngot(1), null, M.getFluidStack(144), 100, + * duration, 120)){ Logger.WARNING("[BAS] Success, Also added a Fluid Extractor recipe."); } if + * (GT_Values.RA.addFluidExtractionRecipe(M.getNugget(1), null, M.getFluidStack(16), 100, + * duration/9, 120)){ Logger.WARNING("[BAS] Success, Also added a Fluid Extractor recipe."); } + */ + /* + * if (GT_Values.RA.addFluidExtractionRecipe(M.getSmallDust(1), null, M.getFluid(36), 100, + * duration/4, 120)){ Logger.WARNING("[BAS] Success, Also added a Fluid Extractor recipe."); } + * if (GT_Values.RA.addFluidExtractionRecipe(M.getTinyDust(1), null, M.getFluid(16), 100, + * duration/9, 120)){ Logger.WARNING("[BAS] Success, Also added a Fluid Extractor recipe."); } + */ } } else { Logger.WARNING("[BAS] Failed."); @@ -162,20 +164,24 @@ public class RecipeGen_BlastSmelter extends RecipeGen_Base { (int) aVoltage)) { Logger.WARNING("[BAS] Success."); if (GT_Values.RA.addFluidSolidifierRecipe( - ItemList.Shape_Mold_Ingot.get(0), M.getFluidStack(144), M.getIngot(1), duration / 2, 60)) { + ItemList.Shape_Mold_Ingot.get(0), + M.getFluidStack(144), + M.getIngot(1), + duration / 2, + 60)) { Logger.WARNING("[BAS] Success, Also added a Fluid solidifier recipe."); - /*if (GT_Values.RA.addFluidExtractionRecipe(M.getIngot(1), null, M.getFluidStack(144), 100, duration/2, 60)){ - Logger.WARNING("[BAS] Success, Also added a Fluid Extractor recipe."); - } - if (GT_Values.RA.addFluidExtractionRecipe(M.getNugget(1), null, M.getFluidStack(16), 100, duration/2/9, 60)){ - Logger.WARNING("[BAS] Success, Also added a Fluid Extractor recipe."); - }*/ - /*if (GT_Values.RA.addFluidExtractionRecipe(M.getSmallDust(1), null, M.getFluid(36), 100, duration/2/4, 60)){ - Logger.WARNING("[BAS] Success, Also added a Fluid Extractor recipe."); - } - if (GT_Values.RA.addFluidExtractionRecipe(M.getTinyDust(1), null, M.getFluid(16), 100, duration/2/9, 60)){ - Logger.WARNING("[BAS] Success, Also added a Fluid Extractor recipe."); - }*/ + /* + * if (GT_Values.RA.addFluidExtractionRecipe(M.getIngot(1), null, M.getFluidStack(144), 100, + * duration/2, 60)){ Logger.WARNING("[BAS] Success, Also added a Fluid Extractor recipe."); } if + * (GT_Values.RA.addFluidExtractionRecipe(M.getNugget(1), null, M.getFluidStack(16), 100, + * duration/2/9, 60)){ Logger.WARNING("[BAS] Success, Also added a Fluid Extractor recipe."); } + */ + /* + * if (GT_Values.RA.addFluidExtractionRecipe(M.getSmallDust(1), null, M.getFluid(36), 100, + * duration/2/4, 60)){ Logger.WARNING("[BAS] Success, Also added a Fluid Extractor recipe."); } + * if (GT_Values.RA.addFluidExtractionRecipe(M.getTinyDust(1), null, M.getFluid(16), 100, + * duration/2/9, 60)){ Logger.WARNING("[BAS] Success, Also added a Fluid Extractor recipe."); } + */ } } else { Logger.WARNING("[BAS] Failed."); @@ -188,8 +194,7 @@ public class RecipeGen_BlastSmelter extends RecipeGen_Base { // If this Material has some kind of compound list, proceed if (mMaterialListSize > 1) { - final gtPlusPlus.core.material.MaterialStack[] tempStack = - new gtPlusPlus.core.material.MaterialStack[mMaterialListSize]; + final gtPlusPlus.core.material.MaterialStack[] tempStack = new gtPlusPlus.core.material.MaterialStack[mMaterialListSize]; circuitGT = ItemUtils.getGregtechCircuit(mMaterialListSize); // Just double checking if (tempStack.length > 1) { @@ -199,10 +204,8 @@ public class RecipeGen_BlastSmelter extends RecipeGen_Base { for (final gtPlusPlus.core.material.MaterialStack xMaterial : M.getComposites()) { if (xMaterial != null) { if (xMaterial.getStackMaterial() != null) { - Logger.WARNING("[BAS] FOUND: " - + xMaterial.getStackMaterial().getLocalizedName()); - Logger.WARNING("[BAS] ADDING: " - + xMaterial.getStackMaterial().getLocalizedName()); + Logger.WARNING("[BAS] FOUND: " + xMaterial.getStackMaterial().getLocalizedName()); + Logger.WARNING("[BAS] ADDING: " + xMaterial.getStackMaterial().getLocalizedName()); } tempStack[ooo] = xMaterial; } @@ -218,21 +221,14 @@ public class RecipeGen_BlastSmelter extends RecipeGen_Base { if (M.getComposites().get(irc) != null) { final int r = (int) M.vSmallestRatio[irc]; inputStackCount = inputStackCount + r; - if ((M.getComposites() - .get(irc) - .getStackMaterial() - .getState() - != MaterialState.SOLID) - || !ItemUtils.checkForInvalidItems( - M.getComposites().get(irc).getDustStack(r))) { + if ((M.getComposites().get(irc).getStackMaterial().getState() != MaterialState.SOLID) + || !ItemUtils + .checkForInvalidItems(M.getComposites().get(irc).getDustStack(r))) { final int xr = r; if ((xr > 0) && (xr <= 100)) { final int mathmatics = (r * 1000); componentsFluid = FluidUtils.getFluidStack( - M.getComposites() - .get(irc) - .getStackMaterial() - .getFluidStack(mathmatics), + M.getComposites().get(irc).getStackMaterial().getFluidStack(mathmatics), mathmatics); } } else { @@ -253,8 +249,10 @@ public class RecipeGen_BlastSmelter extends RecipeGen_Base { components[fr] = components_NoCircuit[fr - 1]; } } - Logger.WARNING("[BAS] Should have added a circuit. mMaterialListSize: " + mMaterialListSize - + " | circuit: " + components[0].getDisplayName()); + Logger.WARNING( + "[BAS] Should have added a circuit. mMaterialListSize: " + mMaterialListSize + + " | circuit: " + + components[0].getDisplayName()); } else { Logger.WARNING("[BAS] Did not add a circuit. mMaterialListSize: " + mMaterialListSize); } @@ -262,23 +260,36 @@ public class RecipeGen_BlastSmelter extends RecipeGen_Base { // Set Fluid output fluidAmount = 144 * inputStackCount; - Logger.WARNING("[BAS] Adding an Alloy Blast Smelter Recipe for " + M.getLocalizedName() - + " using it's compound dusts. This material has " + inputStackCount + " parts. Gives " - + fluidAmount + "L of molten metal."); + Logger.WARNING( + "[BAS] Adding an Alloy Blast Smelter Recipe for " + M.getLocalizedName() + + " using it's compound dusts. This material has " + + inputStackCount + + " parts. Gives " + + fluidAmount + + "L of molten metal."); Logger.WARNING("[BAS] tMaterial.length: " + components.length + "."); for (int das = 0; das < components.length; das++) { if (components[das] != null) { - Logger.WARNING("[BAS] tMaterial[" + das + "]: " + components[das].getDisplayName() - + " Meta: " + components[das].getItemDamage() + ", Amount: " - + components[das].stackSize); + Logger.WARNING( + "[BAS] tMaterial[" + das + + "]: " + + components[das].getDisplayName() + + " Meta: " + + components[das].getItemDamage() + + ", Amount: " + + components[das].stackSize); } } // Adds Recipe if (M.requiresBlastFurnace()) { if (CORE.RA.addBlastSmelterRecipe( - components, componentsFluid, M.getFluidStack(fluidAmount), 100, duration, (int) - aVoltage)) { + components, + componentsFluid, + M.getFluidStack(fluidAmount), + 100, + duration, + (int) aVoltage)) { Logger.WARNING("[BAS] Success."); } else { Logger.WARNING("[BAS] Failed."); diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_BlastSmelterGT_Ex.java b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_BlastSmelterGT_Ex.java index 2e47eaf807..97807f3053 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_BlastSmelterGT_Ex.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_BlastSmelterGT_Ex.java @@ -1,5 +1,8 @@ package gtPlusPlus.xmod.gregtech.loaders; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidStack; + import gregtech.api.enums.Materials; import gregtech.api.enums.OrePrefixes; import gregtech.api.enums.SubTag; @@ -9,31 +12,20 @@ import gregtech.api.util.GT_Utility; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.util.math.MathUtils; import gtPlusPlus.core.util.minecraft.ItemUtils; -import net.minecraft.item.ItemStack; -import net.minecraftforge.fluids.FluidStack; public class RecipeGen_BlastSmelterGT_Ex implements IOreRecipeRegistrator { - private final OrePrefixes[] mSmeltingPrefixes = { - OrePrefixes.crushed, - OrePrefixes.ingot, - OrePrefixes.crushedPurified, - OrePrefixes.crushedCentrifuged, - OrePrefixes.dust, - OrePrefixes.dustPure, - OrePrefixes.dustImpure, - OrePrefixes.dustRefined, - OrePrefixes.dustSmall, - OrePrefixes.dustTiny - }; + private final OrePrefixes[] mSmeltingPrefixes = { OrePrefixes.crushed, OrePrefixes.ingot, + OrePrefixes.crushedPurified, OrePrefixes.crushedCentrifuged, OrePrefixes.dust, OrePrefixes.dustPure, + OrePrefixes.dustImpure, OrePrefixes.dustRefined, OrePrefixes.dustSmall, OrePrefixes.dustTiny }; public RecipeGen_BlastSmelterGT_Ex() { for (OrePrefixes tPrefix : this.mSmeltingPrefixes) tPrefix.add(this); } @Override - public void registerOre( - OrePrefixes aPrefix, Materials aMaterial, String aOreDictName, String aModName, ItemStack aStack) { + public void registerOre(OrePrefixes aPrefix, Materials aMaterial, String aOreDictName, String aModName, + ItemStack aStack) { boolean keepHighTempRecipes = !CORE.GTNH; @@ -45,14 +37,14 @@ public class RecipeGen_BlastSmelterGT_Ex implements IOreRecipeRegistrator { && (!aMaterial.contains(SubTag.NO_SMELTING))) { if (aMaterial.mBlastFurnaceRequired) { addBlastRecipe( - GT_Utility.copyAmount(1L, new Object[] {aStack}), + GT_Utility.copyAmount(1L, new Object[] { aStack }), null, null, null, aMaterial.mBlastFurnaceTemp > 1750 - ? GT_OreDictUnificator.get( - OrePrefixes.ingotHot, aMaterial.mSmeltInto, tDustStack, 1L) - : GT_Utility.copyAmount(1L, new Object[] {tDustStack}), + ? GT_OreDictUnificator + .get(OrePrefixes.ingotHot, aMaterial.mSmeltInto, tDustStack, 1L) + : GT_Utility.copyAmount(1L, new Object[] { tDustStack }), null, (int) Math.max(aMaterial.getMass() / 40L, 1L) * aMaterial.mBlastFurnaceTemp, 120, @@ -71,14 +63,14 @@ public class RecipeGen_BlastSmelterGT_Ex implements IOreRecipeRegistrator { && (!aMaterial.contains(SubTag.NO_SMELTING))) { if (aMaterial.mBlastFurnaceRequired) { addBlastRecipe( - GT_Utility.copyAmount(1L, new Object[] {aStack}), + GT_Utility.copyAmount(1L, new Object[] { aStack }), null, null, null, aMaterial.mBlastFurnaceTemp > 1750 - ? GT_OreDictUnificator.get( - OrePrefixes.ingotHot, aMaterial.mSmeltInto, tDustStack, 1L) - : GT_Utility.copyAmount(1L, new Object[] {tDustStack}), + ? GT_OreDictUnificator + .get(OrePrefixes.ingotHot, aMaterial.mSmeltInto, tDustStack, 1L) + : GT_Utility.copyAmount(1L, new Object[] { tDustStack }), null, (int) Math.max(aMaterial.getMass() / 40L, 1L) * aMaterial.mBlastFurnaceTemp, 120, @@ -91,7 +83,7 @@ public class RecipeGen_BlastSmelterGT_Ex implements IOreRecipeRegistrator { if (keepHighTempRecipes || aMaterial.mBlastFurnaceTemp <= 3600) { if (aMaterial.mBlastFurnaceRequired) { addBlastRecipe( - GT_Utility.copyAmount(4L, new Object[] {aStack}), + GT_Utility.copyAmount(4L, new Object[] { aStack }), null, null, null, @@ -114,7 +106,7 @@ public class RecipeGen_BlastSmelterGT_Ex implements IOreRecipeRegistrator { if (!aMaterial.contains(gregtech.api.enums.SubTag.NO_SMELTING)) { if (aMaterial.mBlastFurnaceRequired) { addBlastRecipe( - GT_Utility.copyAmount(9L, new Object[] {aStack}), + GT_Utility.copyAmount(9L, new Object[] { aStack }), null, null, null, @@ -122,8 +114,8 @@ public class RecipeGen_BlastSmelterGT_Ex implements IOreRecipeRegistrator { ? GT_OreDictUnificator.get( OrePrefixes.ingotHot, aMaterial.mSmeltInto, - GT_OreDictUnificator.get( - OrePrefixes.ingot, aMaterial.mSmeltInto, 1L), + GT_OreDictUnificator + .get(OrePrefixes.ingot, aMaterial.mSmeltInto, 1L), 1L) : GT_OreDictUnificator.get(OrePrefixes.ingot, aMaterial.mSmeltInto, 1L), null, @@ -139,17 +131,15 @@ public class RecipeGen_BlastSmelterGT_Ex implements IOreRecipeRegistrator { if (!aMaterial.contains(SubTag.NO_SMELTING)) { if ((aMaterial.mBlastFurnaceRequired) || (aMaterial.mDirectSmelting.mBlastFurnaceRequired)) { addBlastRecipe( - GT_Utility.copyAmount(1L, new Object[] {aStack}), + GT_Utility.copyAmount(1L, new Object[] { aStack }), null, null, null, - aMaterial.mBlastFurnaceTemp > 1750 - ? GT_OreDictUnificator.get( - OrePrefixes.ingotHot, - aMaterial, - GT_OreDictUnificator.get(OrePrefixes.ingot, aMaterial, 1L), - 1L) - : GT_OreDictUnificator.get(OrePrefixes.ingot, aMaterial, 1L), + aMaterial.mBlastFurnaceTemp > 1750 ? GT_OreDictUnificator.get( + OrePrefixes.ingotHot, + aMaterial, + GT_OreDictUnificator.get(OrePrefixes.ingot, aMaterial, 1L), + 1L) : GT_OreDictUnificator.get(OrePrefixes.ingot, aMaterial, 1L), null, (int) Math.max(aMaterial.getMass() / 4L, 1L) * aMaterial.mBlastFurnaceTemp, 120, @@ -165,16 +155,8 @@ public class RecipeGen_BlastSmelterGT_Ex implements IOreRecipeRegistrator { } } - public boolean addBlastRecipe( - ItemStack input1, - ItemStack input2, - FluidStack fluid1, - FluidStack fluid2, - ItemStack output1, - ItemStack output2, - int time, - int euCost, - Materials smeltInto) { + public boolean addBlastRecipe(ItemStack input1, ItemStack input2, FluidStack fluid1, FluidStack fluid2, + ItemStack output1, ItemStack output2, int time, int euCost, Materials smeltInto) { // Set up variables. ItemStack[] components; @@ -194,7 +176,7 @@ public class RecipeGen_BlastSmelterGT_Ex implements IOreRecipeRegistrator { } // Set up input components. ItemStack configCircuit = ItemUtils.getGregtechCircuit(count); - components = new ItemStack[] {configCircuit, input1, input2}; + components = new ItemStack[] { configCircuit, input1, input2 }; if (fluid1 != null || fluid2 != null) { // If it uses an input fluid, we cannot handle this. So let's not try. (Annealed copper for example) // return false; diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_BlastSmelterGT_GTNH.java b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_BlastSmelterGT_GTNH.java index f9e083a44a..bfd5fdc2cb 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_BlastSmelterGT_GTNH.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_BlastSmelterGT_GTNH.java @@ -1,5 +1,13 @@ package gtPlusPlus.xmod.gregtech.loaders; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Map; + +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.oredict.OreDictionary; + import gregtech.api.util.*; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.api.objects.minecraft.ItemStackData; @@ -8,12 +16,6 @@ import gtPlusPlus.core.recipe.common.CI; import gtPlusPlus.core.util.math.MathUtils; import gtPlusPlus.core.util.minecraft.FluidUtils; import gtPlusPlus.core.util.minecraft.ItemUtils; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Map; -import net.minecraft.item.ItemStack; -import net.minecraftforge.fluids.FluidStack; -import net.minecraftforge.oredict.OreDictionary; public class RecipeGen_BlastSmelterGT_GTNH { @@ -46,13 +48,9 @@ public class RecipeGen_BlastSmelterGT_GTNH { return null; } - private static boolean isValid( - final ItemStack[] inputs, - final ItemStack outputs[], - final FluidStack[] fluidIn, + private static boolean isValid(final ItemStack[] inputs, final ItemStack outputs[], final FluidStack[] fluidIn, final FluidStack fluidOut) { - if (inputs != null - && outputs != null + if (inputs != null && outputs != null && fluidIn != null && fluidOut != null && inputs.length > 0 @@ -83,8 +81,7 @@ public class RecipeGen_BlastSmelterGT_GTNH { if (CORE.GTNH) { mType = "ingot"; } - if (oreName.startsWith(mType) - && !oreName.contains("double") + if (oreName.startsWith(mType) && !oreName.contains("double") && !oreName.contains("triple") && !oreName.contains("quad") && !oreName.contains("quintuple")) { @@ -98,8 +95,12 @@ public class RecipeGen_BlastSmelterGT_GTNH { if (validInput != null && validOutput != null) { ItemStackData R = new ItemStackData(validInput); setIngotToFluid(R, validOutput); - Logger.MACHINE_INFO("[ABS][I2F] Cached " + validInput.getDisplayName() + " to " - + validOutput.getLocalizedName() + ". Stored Under ID of " + R.getUniqueDataIdentifier()); + Logger.MACHINE_INFO( + "[ABS][I2F] Cached " + validInput.getDisplayName() + + " to " + + validOutput.getLocalizedName() + + ". Stored Under ID of " + + R.getUniqueDataIdentifier()); } } } @@ -122,9 +123,14 @@ public class RecipeGen_BlastSmelterGT_GTNH { ItemStackData R1 = new ItemStackData(validInput); ItemStackData R2 = new ItemStackData(validOutput); setHotToCold(R1, R2); - Logger.MACHINE_INFO("[ABS][H2C] Cached " + validInput.getDisplayName() + " to " - + validOutput.getDisplayName() + ". Stored Under ID of " + R1.getUniqueDataIdentifier() - + ", links to ID " + R2.getUniqueDataIdentifier()); + Logger.MACHINE_INFO( + "[ABS][H2C] Cached " + validInput.getDisplayName() + + " to " + + validOutput.getDisplayName() + + ". Stored Under ID of " + + R1.getUniqueDataIdentifier() + + ", links to ID " + + R2.getUniqueDataIdentifier()); } } } @@ -159,9 +165,12 @@ public class RecipeGen_BlastSmelterGT_GTNH { if (x.mOutputs != null && x.mOutputs[0] != null) { mMoltenCount = x.mOutputs[0].stackSize; ItemStackData R = new ItemStackData(x.mOutputs[0]); - Logger.MACHINE_INFO("[ABS] Found " + x.mOutputs[0].getDisplayName() - + " as valid EBF output, finding it's fluid from the cache. We will require " - + (144 * mMoltenCount) + "L. Looking for ID " + R.getUniqueDataIdentifier()); + Logger.MACHINE_INFO( + "[ABS] Found " + x.mOutputs[0].getDisplayName() + + " as valid EBF output, finding it's fluid from the cache. We will require " + + (144 * mMoltenCount) + + "L. Looking for ID " + + R.getUniqueDataIdentifier()); FluidStack tempFluid = getFluidFromIngot(R); if (tempFluid != null) { // Logger.MACHINE_INFO("[ABS] Got Fluid from Cache."); diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_DustGeneration.java b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_DustGeneration.java index d3143b9706..ed8c18ba4b 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_DustGeneration.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_DustGeneration.java @@ -1,5 +1,11 @@ package gtPlusPlus.xmod.gregtech.loaders; +import java.util.HashSet; +import java.util.Set; + +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidStack; + import gregtech.api.enums.GT_Values; import gregtech.api.enums.ItemList; import gregtech.api.util.GT_ModHandler; @@ -16,10 +22,6 @@ import gtPlusPlus.core.recipe.common.CI; import gtPlusPlus.core.util.math.MathUtils; import gtPlusPlus.core.util.minecraft.ItemUtils; import gtPlusPlus.core.util.minecraft.RecipeUtils; -import java.util.HashSet; -import java.util.Set; -import net.minecraft.item.ItemStack; -import net.minecraftforge.fluids.FluidStack; public class RecipeGen_DustGeneration extends RecipeGen_Base { @@ -57,8 +59,8 @@ public class RecipeGen_DustGeneration extends RecipeGen_Base { Logger.INFO("9 Tiny dust to 1 Dust Recipe: " + M.getLocalizedName() + " - Failed"); } - if (RecipeUtils.addShapedRecipe( - normalDust, null, null, null, null, null, null, null, null, M.getTinyDust(9))) { + if (RecipeUtils + .addShapedRecipe(normalDust, null, null, null, null, null, null, null, null, M.getTinyDust(9))) { Logger.INFO("9 Tiny dust from 1 Recipe: " + M.getLocalizedName() + " - Success"); } else { Logger.INFO("9 Tiny dust from 1 Recipe: " + M.getLocalizedName() + " - Failed"); @@ -67,13 +69,22 @@ public class RecipeGen_DustGeneration extends RecipeGen_Base { if (smallDust != null && normalDust != null) { if (RecipeUtils.addShapedRecipe( - smallDust, smallDust, null, smallDust, smallDust, null, null, null, null, normalDust)) { + smallDust, + smallDust, + null, + smallDust, + smallDust, + null, + null, + null, + null, + normalDust)) { Logger.INFO("4 Small dust to 1 Dust Recipe: " + M.getLocalizedName() + " - Success"); } else { Logger.INFO("4 Small dust to 1 Dust Recipe: " + M.getLocalizedName() + " - Failed"); } - if (RecipeUtils.addShapedRecipe( - null, normalDust, null, null, null, null, null, null, null, M.getSmallDust(4))) { + if (RecipeUtils + .addShapedRecipe(null, normalDust, null, null, null, null, null, null, null, M.getSmallDust(4))) { Logger.INFO("4 Small dust from 1 Dust Recipe: " + M.getLocalizedName() + " - Success"); } else { Logger.INFO("4 Small dust from 1 Dust Recipe: " + M.getLocalizedName() + " - Failed"); @@ -162,15 +173,10 @@ public class RecipeGen_DustGeneration extends RecipeGen_Base { input[0] = CI.getNumberedCircuit(inputStacks.length + 10); } - /*for (int g = 0; g<4; g++) { - if(inputStacks.length > g) { - input[g] = inputStacks[g] != null ? inputStacks[g] : null; - } - else { - input[g] = CI.getNumberedCircuit(g+10); - break; - } - }*/ + /* + * for (int g = 0; g<4; g++) { if(inputStacks.length > g) { input[g] = inputStacks[g] != null ? + * inputStacks[g] : null; } else { input[g] = CI.getNumberedCircuit(g+10); break; } } + */ // Add mixer Recipe FluidStack oxygen = GT_Values.NF; @@ -213,14 +219,12 @@ public class RecipeGen_DustGeneration extends RecipeGen_Base { } // Add Shapeless recipe for low tier alloys. - /*if (tVoltageMultiplier <= 30){ - if (RecipeUtils.addShapedGregtechRecipe(inputStacks, outputStacks)){ - Logger.WARNING("Dust Shapeless Recipe: "+material.getLocalizedName()+" - Success"); - } - else { - Logger.WARNING("Dust Shapeless Recipe: "+material.getLocalizedName()+" - Failed"); - } - }*/ + /* + * if (tVoltageMultiplier <= 30){ if (RecipeUtils.addShapedGregtechRecipe(inputStacks, + * outputStacks)){ + * Logger.WARNING("Dust Shapeless Recipe: "+material.getLocalizedName()+" - Success"); } else { + * Logger.WARNING("Dust Shapeless Recipe: "+material.getLocalizedName()+" - Failed"); } } + */ } } } @@ -252,14 +256,11 @@ public class RecipeGen_DustGeneration extends RecipeGen_Base { // Get us four ItemStacks to input into the mixer ItemStack input1, input2, input3, input4; input1 = inputStacks[0]; - input2 = (inputStacks.length >= 2) - ? (input2 = (inputStacks[1] == null) ? null : inputStacks[1]) + input2 = (inputStacks.length >= 2) ? (input2 = (inputStacks[1] == null) ? null : inputStacks[1]) : null; - input3 = (inputStacks.length >= 3) - ? (input3 = (inputStacks[2] == null) ? null : inputStacks[2]) + input3 = (inputStacks.length >= 3) ? (input3 = (inputStacks[2] == null) ? null : inputStacks[2]) : null; - input4 = (inputStacks.length >= 4) - ? (input4 = (inputStacks[3] == null) ? null : inputStacks[3]) + input4 = (inputStacks.length >= 4) ? (input4 = (inputStacks[3] == null) ? null : inputStacks[3]) : null; if (inputStacks.length == 1) { @@ -286,14 +287,12 @@ public class RecipeGen_DustGeneration extends RecipeGen_Base { if (x != null) { if (x.getStackMaterial() != null) { if (x.getStackMaterial().getDust(1) == null) { - MaterialState f = - x.getStackMaterial().getState(); - if (f == MaterialState.GAS - || f == MaterialState.LIQUID + MaterialState f = x.getStackMaterial().getState(); + if (f == MaterialState.GAS || f == MaterialState.LIQUID || f == MaterialState.PURE_LIQUID || f == MaterialState.PURE_GAS) { - oxygen = x.getStackMaterial().getFluidStack((int) - (material.vSmallestRatio[compSlot] * 1000)); + oxygen = x.getStackMaterial().getFluidStack( + (int) (material.vSmallestRatio[compSlot] * 1000)); } } } @@ -341,19 +340,21 @@ public class RecipeGen_DustGeneration extends RecipeGen_Base { public static boolean generatePackagerRecipes(Material aMatInfo) { AutoMap<Boolean> aResults = new AutoMap<Boolean>(); // Small Dust - aResults.put(GT_Values.RA.addBoxingRecipe( - GT_Utility.copyAmount(4L, new Object[] {aMatInfo.getSmallDust(4)}), - ItemList.Schematic_Dust.get(0L, new Object[0]), - aMatInfo.getDust(1), - 100, - 4)); + aResults.put( + GT_Values.RA.addBoxingRecipe( + GT_Utility.copyAmount(4L, new Object[] { aMatInfo.getSmallDust(4) }), + ItemList.Schematic_Dust.get(0L, new Object[0]), + aMatInfo.getDust(1), + 100, + 4)); // Tiny Dust - aResults.put(GT_Values.RA.addBoxingRecipe( - GT_Utility.copyAmount(9L, new Object[] {aMatInfo.getTinyDust(9)}), - ItemList.Schematic_Dust.get(0L, new Object[0]), - aMatInfo.getDust(1), - 100, - 4)); + aResults.put( + GT_Values.RA.addBoxingRecipe( + GT_Utility.copyAmount(9L, new Object[] { aMatInfo.getTinyDust(9) }), + ItemList.Schematic_Dust.get(0L, new Object[0]), + aMatInfo.getDust(1), + 100, + 4)); for (boolean b : aResults) { if (!b) { @@ -405,13 +406,8 @@ public class RecipeGen_DustGeneration extends RecipeGen_Base { } } - private boolean addBlastFurnaceRecipe( - Material aMatInfo, - final ItemStack input1, - final ItemStack input2, - final ItemStack output1, - final ItemStack output2, - final int tempRequired) { + private boolean addBlastFurnaceRecipe(Material aMatInfo, final ItemStack input1, final ItemStack input2, + final ItemStack output1, final ItemStack output2, final int tempRequired) { try { int timeTaken = 125 * aMatInfo.vTier * 10; diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Extruder.java b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Extruder.java index e675f2758f..3d2ed68a3f 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Extruder.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Extruder.java @@ -1,5 +1,10 @@ package gtPlusPlus.xmod.gregtech.loaders; +import java.util.HashSet; +import java.util.Set; + +import net.minecraft.item.ItemStack; + import gregtech.api.enums.GT_Values; import gregtech.api.enums.ItemList; import gtPlusPlus.api.interfaces.RunnableWithInfo; @@ -7,9 +12,6 @@ import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.material.Material; import gtPlusPlus.core.material.MaterialGenerator; import gtPlusPlus.core.util.minecraft.ItemUtils; -import java.util.HashSet; -import java.util.Set; -import net.minecraft.item.ItemStack; public class RecipeGen_Extruder extends RecipeGen_Base { @@ -121,10 +123,10 @@ public class RecipeGen_Extruder extends RecipeGen_Base { material.getRod(2), (int) Math.max(material.getMass() * 2L * 1, 1), material.vVoltageMultiplier)) { - Logger.WARNING("Extruder Rod Recipe: " + material.getLocalizedName() + " - Success"); - } else { - Logger.WARNING("Extruder Rod Recipe: " + material.getLocalizedName() + " - Failed"); - } + Logger.WARNING("Extruder Rod Recipe: " + material.getLocalizedName() + " - Success"); + } else { + Logger.WARNING("Extruder Rod Recipe: " + material.getLocalizedName() + " - Failed"); + } // Bolt Recipe if (ItemUtils.checkForInvalidItems(material.getIngot(1)) && ItemUtils.checkForInvalidItems(material.getBolt(1))) @@ -143,8 +145,7 @@ public class RecipeGen_Extruder extends RecipeGen_Base { // Rotor Recipe // Shape_Extruder_Rotor - if (mRotorShapeEnabled - && ItemUtils.checkForInvalidItems(material.getIngot(1)) + if (mRotorShapeEnabled && ItemUtils.checkForInvalidItems(material.getIngot(1)) && ItemUtils.checkForInvalidItems(material.getRotor(1))) if (GT_Values.RA.addExtruderRecipe( material.getIngot(5), @@ -152,9 +153,9 @@ public class RecipeGen_Extruder extends RecipeGen_Base { material.getRotor(1), 200, 60)) { - Logger.WARNING("Extruder Rotor Recipe: " + material.getLocalizedName() + " - Success"); - } else { - Logger.WARNING("Extruder Rotor Recipe: " + material.getLocalizedName() + " - Failed"); - } + Logger.WARNING("Extruder Rotor Recipe: " + material.getLocalizedName() + " - Success"); + } else { + Logger.WARNING("Extruder Rotor Recipe: " + material.getLocalizedName() + " - Failed"); + } } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_FluidCanning.java b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_FluidCanning.java index 4b1f407809..561c0884cd 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_FluidCanning.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_FluidCanning.java @@ -1,5 +1,10 @@ package gtPlusPlus.xmod.gregtech.loaders; +import java.util.HashSet; + +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidStack; + import gregtech.api.enums.GT_Values; import gregtech.api.util.GTPP_Recipe; import gregtech.api.util.GT_Recipe; @@ -9,9 +14,6 @@ import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.util.minecraft.ItemUtils; import gtPlusPlus.core.util.reflect.ReflectionUtils; -import java.util.HashSet; -import net.minecraft.item.ItemStack; -import net.minecraftforge.fluids.FluidStack; public class RecipeGen_FluidCanning implements Runnable { @@ -60,30 +62,19 @@ public class RecipeGen_FluidCanning implements Runnable { this(aExtracting, aEmpty, aFull, aFluid, GT_Values.NF, null, null); } - public RecipeGen_FluidCanning( - boolean aExtracting, ItemStack aEmpty, ItemStack aFull, FluidStack aFluidIn, FluidStack aFluidOut) { + public RecipeGen_FluidCanning(boolean aExtracting, ItemStack aEmpty, ItemStack aFull, FluidStack aFluidIn, + FluidStack aFluidOut) { this(aExtracting, aEmpty, aFull, aFluidIn, aFluidOut, null, null); } - public RecipeGen_FluidCanning( - boolean aExtracting, - ItemStack aEmpty, - ItemStack aFull, - FluidStack aFluid, - Integer aDuration, - Integer aEUt) { + public RecipeGen_FluidCanning(boolean aExtracting, ItemStack aEmpty, ItemStack aFull, FluidStack aFluid, + Integer aDuration, Integer aEUt) { this(aExtracting, aEmpty, aFull, aFluid, GT_Values.NF, aDuration, aEUt); } // Alternative Constructor - public RecipeGen_FluidCanning( - boolean aExtracting, - ItemStack aEmpty, - ItemStack aFull, - FluidStack aFluidIn, - FluidStack aFluidOut, - Integer aDuration, - Integer aEUt) { + public RecipeGen_FluidCanning(boolean aExtracting, ItemStack aEmpty, ItemStack aFull, FluidStack aFluidIn, + FluidStack aFluidOut, Integer aDuration, Integer aEUt) { ItemStack aInput; ItemStack aOutput; FluidStack aFluidInput; @@ -91,8 +82,8 @@ public class RecipeGen_FluidCanning implements Runnable { // Safety check on the duration if (aDuration == null || aDuration <= 0) { - aDuration = - (aFluidIn != null) ? (aFluidIn.amount / 62) : ((aFluidOut != null) ? (aFluidOut.amount / 62) : 10); + aDuration = (aFluidIn != null) ? (aFluidIn.amount / 62) + : ((aFluidOut != null) ? (aFluidOut.amount / 62) : 10); } // Safety check on the EU @@ -121,12 +112,12 @@ public class RecipeGen_FluidCanning implements Runnable { GTPP_Recipe aRecipe = new GTPP_Recipe( true, - new ItemStack[] {aInput}, - new ItemStack[] {aOutput}, + new ItemStack[] { aInput }, + new ItemStack[] { aOutput }, null, - new int[] {10000}, - new FluidStack[] {aFluidInput}, - new FluidStack[] {aFluidOutput}, + new int[] { 10000 }, + new FluidStack[] { aFluidInput }, + new FluidStack[] { aFluidOutput }, aDuration, aEUt, 0); @@ -187,9 +178,15 @@ public class RecipeGen_FluidCanning implements Runnable { boolean result = false; CORE.crash(); Logger.INFO( - "[FE-Debug] " + aRecipe.mFluidOutputs[0].amount + "L of " + aRecipe.mFluidOutputs[0].getLocalizedName() - + " fluid extractor from 1 " + aRecipe.mInputs[0].getDisplayName() + " - Success. Time: " - + aRecipe.mDuration + ", Voltage: " + aRecipe.mEUt); + "[FE-Debug] " + aRecipe.mFluidOutputs[0].amount + + "L of " + + aRecipe.mFluidOutputs[0].getLocalizedName() + + " fluid extractor from 1 " + + aRecipe.mInputs[0].getDisplayName() + + " - Success. Time: " + + aRecipe.mDuration + + ", Voltage: " + + aRecipe.mEUt); int aCount1 = GT_Recipe_Map.sFluidExtractionRecipes.mRecipeList.size(); int aCount2 = aCount1; GT_Recipe_Map.sFluidExtractionRecipes.addRecipe(aRecipe); @@ -201,10 +198,14 @@ public class RecipeGen_FluidCanning implements Runnable { // "+ItemUtils.getArrayStackNames(aRecipe.mFluidInputs)+", // "+ItemUtils.getArrayStackNames(aRecipe.mFluidOutputs)); } else { - Logger.INFO("[ERROR] Failed adding Extraction recipe for " + ItemUtils.getArrayStackNames(aRecipe.mInputs) - + ", " + ItemUtils.getArrayStackNames(aRecipe.mOutputs) + ", " - + ItemUtils.getArrayStackNames(aRecipe.mFluidInputs) + ", " - + ItemUtils.getArrayStackNames(aRecipe.mFluidOutputs)); + Logger.INFO( + "[ERROR] Failed adding Extraction recipe for " + ItemUtils.getArrayStackNames(aRecipe.mInputs) + + ", " + + ItemUtils.getArrayStackNames(aRecipe.mOutputs) + + ", " + + ItemUtils.getArrayStackNames(aRecipe.mFluidInputs) + + ", " + + ItemUtils.getArrayStackNames(aRecipe.mFluidOutputs)); dumpStack(); } return result; @@ -223,10 +224,14 @@ public class RecipeGen_FluidCanning implements Runnable { // "+ItemUtils.getArrayStackNames(aRecipe.mFluidInputs)+", // "+ItemUtils.getArrayStackNames(aRecipe.mFluidOutputs)); } else { - Logger.INFO("[ERROR] Failed adding Canning recipe for " + ItemUtils.getArrayStackNames(aRecipe.mInputs) - + ", " + ItemUtils.getArrayStackNames(aRecipe.mOutputs) + ", " - + ItemUtils.getArrayStackNames(aRecipe.mFluidInputs) + ", " - + ItemUtils.getArrayStackNames(aRecipe.mFluidOutputs)); + Logger.INFO( + "[ERROR] Failed adding Canning recipe for " + ItemUtils.getArrayStackNames(aRecipe.mInputs) + + ", " + + ItemUtils.getArrayStackNames(aRecipe.mOutputs) + + ", " + + ItemUtils.getArrayStackNames(aRecipe.mFluidInputs) + + ", " + + ItemUtils.getArrayStackNames(aRecipe.mFluidOutputs)); dumpStack(); } return result; @@ -235,16 +240,21 @@ public class RecipeGen_FluidCanning implements Runnable { private void dumpStack() { int parents = 2; for (int i = 0; i < 6; i++) { - Logger.INFO((disableOptional ? "EXTRACTING" : "CANNING") + " DEBUG | " - + (i == 0 ? "Called from: " : "Parent: ") + ReflectionUtils.getMethodName(i + parents)); + Logger.INFO( + (disableOptional ? "EXTRACTING" : "CANNING") + " DEBUG | " + + (i == 0 ? "Called from: " : "Parent: ") + + ReflectionUtils.getMethodName(i + parents)); } } private String buildLogString() { int solidSize = getMapSize(GT_Recipe_Map.sCannerRecipes); int fluidSize = getMapSize(GT_Recipe_Map.sFluidCannerRecipes); - return (disableOptional ? "EXTRACTING" : "CANNING") + " DEBUG | Solids: " + solidSize + " | Liquids: " - + fluidSize + " | "; + return (disableOptional ? "EXTRACTING" : "CANNING") + " DEBUG | Solids: " + + solidSize + + " | Liquids: " + + fluidSize + + " | "; } private final int getMapSize(GT_Recipe_Map aMap) { diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Fluids.java b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Fluids.java index 50827ae39a..9f12a591ff 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Fluids.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Fluids.java @@ -1,5 +1,8 @@ package gtPlusPlus.xmod.gregtech.loaders; +import java.util.HashSet; +import java.util.Set; + import gregtech.api.enums.GT_Values; import gregtech.api.enums.ItemList; import gtPlusPlus.api.interfaces.RunnableWithInfo; @@ -8,8 +11,6 @@ import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.material.Material; import gtPlusPlus.core.material.MaterialGenerator; import gtPlusPlus.core.util.minecraft.ItemUtils; -import java.util.HashSet; -import java.util.Set; public class RecipeGen_Fluids extends RecipeGen_Base { @@ -49,83 +50,73 @@ public class RecipeGen_Fluids extends RecipeGen_Base { // Making Shapes from fluid // Ingot - if (ItemUtils.checkForInvalidItems(material.getIngot(1))) - if (GT_Values.RA.addFluidSolidifierRecipe( - ItemList.Shape_Mold_Ingot.get(0), // Item Shape - material.getFluidStack(144), // Fluid Input - material.getIngot(1), // output - 32, // Duration - material.vVoltageMultiplier // Eu Tick - )) { - Logger.WARNING( - "144l fluid molder for 1 ingot Recipe: " + material.getLocalizedName() + " - Success"); - } else { - Logger.WARNING( - "144l fluid molder for 1 ingot Recipe: " + material.getLocalizedName() + " - Failed"); - } + if (ItemUtils.checkForInvalidItems(material.getIngot(1))) if (GT_Values.RA.addFluidSolidifierRecipe( + ItemList.Shape_Mold_Ingot.get(0), // Item Shape + material.getFluidStack(144), // Fluid Input + material.getIngot(1), // output + 32, // Duration + material.vVoltageMultiplier // Eu Tick + )) { + Logger.WARNING("144l fluid molder for 1 ingot Recipe: " + material.getLocalizedName() + " - Success"); + } else { + Logger.WARNING("144l fluid molder for 1 ingot Recipe: " + material.getLocalizedName() + " - Failed"); + } // Plate - if (ItemUtils.checkForInvalidItems(material.getPlate(1))) - if (GT_Values.RA.addFluidSolidifierRecipe( - ItemList.Shape_Mold_Plate.get(0), // Item Shape - material.getFluidStack(144), // Fluid Input - material.getPlate(1), // output - 32, // Duration - material.vVoltageMultiplier // Eu Tick - )) { - Logger.WARNING( - "144l fluid molder for 1 plate Recipe: " + material.getLocalizedName() + " - Success"); - } else { - Logger.WARNING( - "144l fluid molder for 1 plate Recipe: " + material.getLocalizedName() + " - Failed"); - } + if (ItemUtils.checkForInvalidItems(material.getPlate(1))) if (GT_Values.RA.addFluidSolidifierRecipe( + ItemList.Shape_Mold_Plate.get(0), // Item Shape + material.getFluidStack(144), // Fluid Input + material.getPlate(1), // output + 32, // Duration + material.vVoltageMultiplier // Eu Tick + )) { + Logger.WARNING("144l fluid molder for 1 plate Recipe: " + material.getLocalizedName() + " - Success"); + } else { + Logger.WARNING("144l fluid molder for 1 plate Recipe: " + material.getLocalizedName() + " - Failed"); + } // Nugget - if (ItemUtils.checkForInvalidItems(material.getNugget(1))) - if (GT_Values.RA.addFluidSolidifierRecipe( - ItemList.Shape_Mold_Nugget.get(0), // Item Shape - material.getFluidStack(16), // Fluid Input - material.getNugget(1), // output - 16, // Duration - material.vVoltageMultiplier // Eu Tick - )) { - Logger.WARNING( - "16l fluid molder for 1 nugget Recipe: " + material.getLocalizedName() + " - Success"); - } else { - Logger.WARNING( - "16l fluid molder for 1 nugget Recipe: " + material.getLocalizedName() + " - Failed"); - } + if (ItemUtils.checkForInvalidItems(material.getNugget(1))) if (GT_Values.RA.addFluidSolidifierRecipe( + ItemList.Shape_Mold_Nugget.get(0), // Item Shape + material.getFluidStack(16), // Fluid Input + material.getNugget(1), // output + 16, // Duration + material.vVoltageMultiplier // Eu Tick + )) { + Logger.WARNING("16l fluid molder for 1 nugget Recipe: " + material.getLocalizedName() + " - Success"); + } else { + Logger.WARNING("16l fluid molder for 1 nugget Recipe: " + material.getLocalizedName() + " - Failed"); + } // Gears - if (ItemUtils.checkForInvalidItems(material.getGear(1))) - if (GT_Values.RA.addFluidSolidifierRecipe( - ItemList.Shape_Mold_Gear.get(0), // Item Shape - material.getFluidStack(576), // Fluid Input - material.getGear(1), // output - 128, // Duration - material.vVoltageMultiplier // Eu Tick - )) { - Logger.WARNING( - "576l fluid molder for 1 gear Recipe: " + material.getLocalizedName() + " - Success"); - } else { - Logger.WARNING("576l fluid molder for 1 gear Recipe: " + material.getLocalizedName() + " - Failed"); - } + if (ItemUtils.checkForInvalidItems(material.getGear(1))) if (GT_Values.RA.addFluidSolidifierRecipe( + ItemList.Shape_Mold_Gear.get(0), // Item Shape + material.getFluidStack(576), // Fluid Input + material.getGear(1), // output + 128, // Duration + material.vVoltageMultiplier // Eu Tick + )) { + Logger.WARNING("576l fluid molder for 1 gear Recipe: " + material.getLocalizedName() + " - Success"); + } else { + Logger.WARNING("576l fluid molder for 1 gear Recipe: " + material.getLocalizedName() + " - Failed"); + } // Blocks - if (ItemUtils.checkForInvalidItems(material.getBlock(1))) - if (GT_Values.RA.addFluidSolidifierRecipe( - ItemList.Shape_Mold_Block.get(0), // Item Shape - material.getFluidStack(144 * 9), // Fluid Input - material.getBlock(1), // output - 288, // Duration - material.vVoltageMultiplier // Eu Tick - )) { - Logger.WARNING((144 * 9) + "l fluid molder from 1 block Recipe: " + material.getLocalizedName() - + " - Success"); - } else { - Logger.WARNING((144 * 9) + "l fluid molder from 1 block Recipe: " + material.getLocalizedName() - + " - Failed"); - } + if (ItemUtils.checkForInvalidItems(material.getBlock(1))) if (GT_Values.RA.addFluidSolidifierRecipe( + ItemList.Shape_Mold_Block.get(0), // Item Shape + material.getFluidStack(144 * 9), // Fluid Input + material.getBlock(1), // output + 288, // Duration + material.vVoltageMultiplier // Eu Tick + )) { + Logger.WARNING( + (144 * 9) + "l fluid molder from 1 block Recipe: " + + material.getLocalizedName() + + " - Success"); + } else { + Logger.WARNING( + (144 * 9) + "l fluid molder from 1 block Recipe: " + material.getLocalizedName() + " - Failed"); + } if (CORE.GTNH) { @@ -146,105 +137,123 @@ public class RecipeGen_Fluids extends RecipeGen_Base { // Rod if (ItemUtils.checkForInvalidItems(material.getRod(1))) - if (mold_Rod != null - && GT_Values.RA.addFluidSolidifierRecipe( - mold_Rod.get(0), // Item Shape - material.getFluidStack(72), // Fluid Input - material.getRod(1), // output - 150, // Duration - material.vVoltageMultiplier // Eu Tick - )) { - Logger.WARNING((144 * 9) + "l fluid molder from 1 rod Recipe: " + material.getLocalizedName() - + " - Success"); + if (mold_Rod != null && GT_Values.RA.addFluidSolidifierRecipe( + mold_Rod.get(0), // Item Shape + material.getFluidStack(72), // Fluid Input + material.getRod(1), // output + 150, // Duration + material.vVoltageMultiplier // Eu Tick + )) { + Logger.WARNING( + (144 * 9) + "l fluid molder from 1 rod Recipe: " + + material.getLocalizedName() + + " - Success"); } else { - Logger.WARNING((144 * 9) + "l fluid molder from 1 rod Recipe: " + material.getLocalizedName() - + " - Failed"); + Logger.WARNING( + (144 * 9) + "l fluid molder from 1 rod Recipe: " + + material.getLocalizedName() + + " - Failed"); } // Rod Long if (ItemUtils.checkForInvalidItems(material.getLongRod(1))) - if (mold_Rod_Long != null - && GT_Values.RA.addFluidSolidifierRecipe( - mold_Rod_Long.get(0), // Item - // Shape - material.getFluidStack(144), // Fluid Input - material.getLongRod(1), // output - 300, // Duration - material.vVoltageMultiplier // Eu Tick - )) { - Logger.WARNING((144 * 9) + "l fluid molder from 1 rod long Recipe: " - + material.getLocalizedName() + " - Success"); + if (mold_Rod_Long != null && GT_Values.RA.addFluidSolidifierRecipe( + mold_Rod_Long.get(0), // Item + // Shape + material.getFluidStack(144), // Fluid Input + material.getLongRod(1), // output + 300, // Duration + material.vVoltageMultiplier // Eu Tick + )) { + Logger.WARNING( + (144 * 9) + "l fluid molder from 1 rod long Recipe: " + + material.getLocalizedName() + + " - Success"); } else { - Logger.WARNING((144 * 9) + "l fluid molder from 1 rod long Recipe: " - + material.getLocalizedName() + " - Failed"); + Logger.WARNING( + (144 * 9) + "l fluid molder from 1 rod long Recipe: " + + material.getLocalizedName() + + " - Failed"); } // Bolt if (ItemUtils.checkForInvalidItems(material.getBolt(1))) - if (mold_Bolt != null - && GT_Values.RA.addFluidSolidifierRecipe( - mold_Bolt.get(0), // Item Shape - material.getFluidStack(18), // Fluid Input - material.getBolt(1), // output - 50, // Duration - material.vVoltageMultiplier // Eu Tick - )) { - Logger.WARNING((144 * 9) + "l fluid molder from 1 bolt Recipe: " + material.getLocalizedName() - + " - Success"); + if (mold_Bolt != null && GT_Values.RA.addFluidSolidifierRecipe( + mold_Bolt.get(0), // Item Shape + material.getFluidStack(18), // Fluid Input + material.getBolt(1), // output + 50, // Duration + material.vVoltageMultiplier // Eu Tick + )) { + Logger.WARNING( + (144 * 9) + "l fluid molder from 1 bolt Recipe: " + + material.getLocalizedName() + + " - Success"); } else { - Logger.WARNING((144 * 9) + "l fluid molder from 1 bolt Recipe: " + material.getLocalizedName() - + " - Failed"); + Logger.WARNING( + (144 * 9) + "l fluid molder from 1 bolt Recipe: " + + material.getLocalizedName() + + " - Failed"); } // Screw if (ItemUtils.checkForInvalidItems(material.getScrew(1))) - if (mold_Screw != null - && GT_Values.RA.addFluidSolidifierRecipe( - mold_Screw.get(0), // Item Shape - material.getFluidStack(18), // Fluid Input - material.getScrew(1), // output - 50, // Duration - material.vVoltageMultiplier // Eu Tick - )) { - Logger.WARNING((144 * 9) + "l fluid molder from 1 screw Recipe: " + material.getLocalizedName() - + " - Success"); + if (mold_Screw != null && GT_Values.RA.addFluidSolidifierRecipe( + mold_Screw.get(0), // Item Shape + material.getFluidStack(18), // Fluid Input + material.getScrew(1), // output + 50, // Duration + material.vVoltageMultiplier // Eu Tick + )) { + Logger.WARNING( + (144 * 9) + "l fluid molder from 1 screw Recipe: " + + material.getLocalizedName() + + " - Success"); } else { - Logger.WARNING((144 * 9) + "l fluid molder from 1 screw Recipe: " + material.getLocalizedName() - + " - Failed"); + Logger.WARNING( + (144 * 9) + "l fluid molder from 1 screw Recipe: " + + material.getLocalizedName() + + " - Failed"); } // Ring if (ItemUtils.checkForInvalidItems(material.getRing(1))) - if (mold_Ring != null - && GT_Values.RA.addFluidSolidifierRecipe( - mold_Ring.get(0), // Item Shape - material.getFluidStack(36), // Fluid Input - material.getRing(1), // output - 100, // Duration - material.vVoltageMultiplier // Eu Tick - )) { - Logger.WARNING((144 * 9) + "l fluid molder from 1 ring Recipe: " + material.getLocalizedName() - + " - Success"); + if (mold_Ring != null && GT_Values.RA.addFluidSolidifierRecipe( + mold_Ring.get(0), // Item Shape + material.getFluidStack(36), // Fluid Input + material.getRing(1), // output + 100, // Duration + material.vVoltageMultiplier // Eu Tick + )) { + Logger.WARNING( + (144 * 9) + "l fluid molder from 1 ring Recipe: " + + material.getLocalizedName() + + " - Success"); } else { - Logger.WARNING((144 * 9) + "l fluid molder from 1 ring Recipe: " + material.getLocalizedName() - + " - Failed"); + Logger.WARNING( + (144 * 9) + "l fluid molder from 1 ring Recipe: " + + material.getLocalizedName() + + " - Failed"); } // Rotor if (ItemUtils.checkForInvalidItems(material.getRotor(1))) - if (mold_Rotor != null - && GT_Values.RA.addFluidSolidifierRecipe( - mold_Rotor.get(0), // Item Shape - material.getFluidStack(612), // Fluid Input - material.getRotor(1), // output - 100, // Duration - material.vVoltageMultiplier // Eu Tick - )) { - Logger.WARNING((144 * 9) + "l fluid molder from 1 rotor Recipe: " + material.getLocalizedName() - + " - Success"); + if (mold_Rotor != null && GT_Values.RA.addFluidSolidifierRecipe( + mold_Rotor.get(0), // Item Shape + material.getFluidStack(612), // Fluid Input + material.getRotor(1), // output + 100, // Duration + material.vVoltageMultiplier // Eu Tick + )) { + Logger.WARNING( + (144 * 9) + "l fluid molder from 1 rotor Recipe: " + + material.getLocalizedName() + + " - Success"); } else { - Logger.WARNING((144 * 9) + "l fluid molder from 1 rotor Recipe: " + material.getLocalizedName() - + " - Failed"); + Logger.WARNING( + (144 * 9) + "l fluid molder from 1 rotor Recipe: " + + material.getLocalizedName() + + " - Failed"); } } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Fluorite.java b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Fluorite.java index 67819c8699..d1bcab904c 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Fluorite.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Fluorite.java @@ -1,5 +1,11 @@ package gtPlusPlus.xmod.gregtech.loaders; +import java.util.HashSet; +import java.util.Set; + +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidStack; + import gregtech.api.enums.GT_Values; import gregtech.api.util.GT_ModHandler; import gtPlusPlus.api.interfaces.RunnableWithInfo; @@ -13,10 +19,6 @@ import gtPlusPlus.core.util.minecraft.FluidUtils; import gtPlusPlus.core.util.minecraft.ItemUtils; import gtPlusPlus.core.util.minecraft.MaterialUtils; import gtPlusPlus.core.util.minecraft.RecipeUtils; -import java.util.HashSet; -import java.util.Set; -import net.minecraft.item.ItemStack; -import net.minecraftforge.fluids.FluidStack; public class RecipeGen_Fluorite extends RecipeGen_Base { @@ -74,28 +76,55 @@ public class RecipeGen_Fluorite extends RecipeGen_Base { final ItemStack tinyDust = material.getTinyDust(1); if (RecipeUtils.addShapedRecipe( - tinyDust, tinyDust, tinyDust, tinyDust, tinyDust, tinyDust, tinyDust, tinyDust, tinyDust, normalDust)) { + tinyDust, + tinyDust, + tinyDust, + tinyDust, + tinyDust, + tinyDust, + tinyDust, + tinyDust, + tinyDust, + normalDust)) { Logger.WARNING("9 Tiny dust to 1 Dust Recipe: " + material.getLocalizedName() + " - Success"); } else { Logger.WARNING("9 Tiny dust to 1 Dust Recipe: " + material.getLocalizedName() + " - Failed"); } - if (RecipeUtils.addShapedRecipe( - normalDust, null, null, null, null, null, null, null, null, material.getTinyDust(9))) { + if (RecipeUtils + .addShapedRecipe(normalDust, null, null, null, null, null, null, null, null, material.getTinyDust(9))) { Logger.WARNING("9 Tiny dust from 1 Recipe: " + material.getLocalizedName() + " - Success"); } else { Logger.WARNING("9 Tiny dust from 1 Recipe: " + material.getLocalizedName() + " - Failed"); } if (RecipeUtils.addShapedRecipe( - smallDust, smallDust, null, smallDust, smallDust, null, null, null, null, normalDust)) { + smallDust, + smallDust, + null, + smallDust, + smallDust, + null, + null, + null, + null, + normalDust)) { Logger.WARNING("4 Small dust to 1 Dust Recipe: " + material.getLocalizedName() + " - Success"); } else { Logger.WARNING("4 Small dust to 1 Dust Recipe: " + material.getLocalizedName() + " - Failed"); } if (RecipeUtils.addShapedRecipe( - null, normalDust, null, null, null, null, null, null, null, material.getSmallDust(4))) { + null, + normalDust, + null, + null, + null, + null, + null, + null, + null, + material.getSmallDust(4))) { Logger.WARNING("4 Small dust from 1 Dust Recipe: " + material.getLocalizedName() + " - Success"); } else { Logger.WARNING("4 Small dust from 1 Dust Recipe: " + material.getLocalizedName() + " - Failed"); @@ -133,8 +162,8 @@ public class RecipeGen_Fluorite extends RecipeGen_Base { // Macerate ore to Crushed if (GT_Values.RA.addPulveriserRecipe( material.getOre(1), - new ItemStack[] {material.getCrushed(2)}, - new int[] {10000}, + new ItemStack[] { material.getCrushed(2) }, + new int[] { 10000 }, 20 * 20, tVoltageMultiplier / 2)) { Logger.MATERIALS("[Macerator] Added Recipe: 'Macerate ore to Crushed ore'"); @@ -142,8 +171,8 @@ public class RecipeGen_Fluorite extends RecipeGen_Base { // Macerate Centrifuged to Pure Dust if (GT_Values.RA.addPulveriserRecipe( material.getCrushedCentrifuged(1), - new ItemStack[] {matDust, matDustA}, - new int[] {10000, 1000}, + new ItemStack[] { matDust, matDustA }, + new int[] { 10000, 1000 }, 20 * 20, tVoltageMultiplier / 2)) { Logger.MATERIALS("[Macerator] Added Recipe: 'Macerate Centrifuged ore to Pure Dust'"); @@ -154,10 +183,16 @@ public class RecipeGen_Fluorite extends RecipeGen_Base { material.getCrushedCentrifuged(1), tinyDustA, dustStone)) { - Logger.MATERIALS("[ThermalCentrifuge] Added Recipe: 'Washed ore to Centrifuged Ore' | Input: " - + material.getCrushedPurified(1).getDisplayName() + " | Outputs: " - + material.getCrushedCentrifuged(1).getDisplayName() + ", " + tinyDustA.getDisplayName() + ", " - + dustStone.getDisplayName() + "."); + Logger.MATERIALS( + "[ThermalCentrifuge] Added Recipe: 'Washed ore to Centrifuged Ore' | Input: " + + material.getCrushedPurified(1).getDisplayName() + + " | Outputs: " + + material.getCrushedCentrifuged(1).getDisplayName() + + ", " + + tinyDustA.getDisplayName() + + ", " + + dustStone.getDisplayName() + + "."); } GT_Values.RA.addChemicalBathRecipe( @@ -166,7 +201,7 @@ public class RecipeGen_Fluorite extends RecipeGen_Base { FLUORIDES.FLUORITE.getCrushedPurified(8), FLUORIDES.FLUORITE.getDustImpure(4), FLUORIDES.FLUORITE.getDustPurified(2), - new int[] {10000, 5000, 1000}, + new int[] { 10000, 5000, 1000 }, 30 * 20, 240); @@ -192,7 +227,7 @@ public class RecipeGen_Fluorite extends RecipeGen_Base { null, null, null, - new int[] {10000, 10000}, // Chances + new int[] { 10000, 10000 }, // Chances (int) Math.max(1L, material.getMass() * 8L), // Time tVoltageMultiplier / 2)) { // Eu Logger.MATERIALS("[Centrifuge] Added Recipe: Purified Dust to Clean Dust"); @@ -210,7 +245,7 @@ public class RecipeGen_Fluorite extends RecipeGen_Base { null, null, null, - new int[] {10000, 10000}, // Chances + new int[] { 10000, 10000 }, // Chances (int) Math.max(1L, material.getMass() * 8L), // Time tVoltageMultiplier / 2)) { // Eu Logger.MATERIALS("[Centrifuge] Added Recipe: Inpure Dust to Clean Dust"); @@ -223,19 +258,15 @@ public class RecipeGen_Fluorite extends RecipeGen_Base { } CORE.RA.addDehydratorRecipe( - new ItemStack[] { - CI.getNumberedAdvancedCircuit(5), FLUORIDES.FLUORITE.getDust(37), - }, + new ItemStack[] { CI.getNumberedAdvancedCircuit(5), FLUORIDES.FLUORITE.getDust(37), }, FluidUtils.getFluidStack("sulfuricacid", 8000), aGregtechHydro, // Fluid output (slot 2) - new ItemStack[] { - ItemUtils.getItemStackOfAmountFromOreDict("dustCalciumSulfate", 15), - ItemUtils.getItemStackOfAmountFromOreDict("dustSilver", 1), - ItemUtils.getItemStackOfAmountFromOreDict("dustGold", 2), - ItemUtils.getItemStackOfAmountFromOreDict("dustTin", 1), - ItemUtils.getItemStackOfAmountFromOreDict("dustCopper", 2) - }, - new int[] {10000, 1000, 1000, 3000, 2000}, + new ItemStack[] { ItemUtils.getItemStackOfAmountFromOreDict("dustCalciumSulfate", 15), + ItemUtils.getItemStackOfAmountFromOreDict("dustSilver", 1), + ItemUtils.getItemStackOfAmountFromOreDict("dustGold", 2), + ItemUtils.getItemStackOfAmountFromOreDict("dustTin", 1), + ItemUtils.getItemStackOfAmountFromOreDict("dustCopper", 2) }, + new int[] { 10000, 1000, 1000, 3000, 2000 }, 10 * 60 * 20, 240); // EU } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_MaterialProcessing.java b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_MaterialProcessing.java index 958c97c652..397f590c12 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_MaterialProcessing.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_MaterialProcessing.java @@ -1,5 +1,11 @@ package gtPlusPlus.xmod.gregtech.loaders; +import java.util.HashSet; +import java.util.Set; + +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidStack; + import gregtech.api.enums.GT_Values; import gtPlusPlus.api.interfaces.RunnableWithInfo; import gtPlusPlus.api.objects.Logger; @@ -12,10 +18,6 @@ import gtPlusPlus.core.material.MaterialStack; import gtPlusPlus.core.material.state.MaterialState; import gtPlusPlus.core.recipe.common.CI; import gtPlusPlus.core.util.minecraft.ItemUtils; -import java.util.HashSet; -import java.util.Set; -import net.minecraft.item.ItemStack; -import net.minecraftforge.fluids.FluidStack; public class RecipeGen_MaterialProcessing extends RecipeGen_Base { @@ -79,16 +81,25 @@ public class RecipeGen_MaterialProcessing extends RecipeGen_Base { int mCounter = 0; for (Pair<Integer, Material> f : componentMap) { if (f.getValue().getState() != MaterialState.SOLID) { - Logger.MATERIALS("[Centrifuge] Found Fluid Component, adding " + f.getKey() + " cells of " - + f.getValue().getLocalizedName() + "."); + Logger.MATERIALS( + "[Centrifuge] Found Fluid Component, adding " + f.getKey() + + " cells of " + + f.getValue().getLocalizedName() + + "."); mInternalOutputs[mCounter++] = f.getValue().getCell(f.getKey()); mCellCount += f.getKey(); mTotalCount += f.getKey(); - Logger.MATERIALS("[Centrifuge] In total, adding " + mCellCount + " cells for " - + material.getLocalizedName() + " processing."); + Logger.MATERIALS( + "[Centrifuge] In total, adding " + mCellCount + + " cells for " + + material.getLocalizedName() + + " processing."); } else { - Logger.MATERIALS("[Centrifuge] Found Solid Component, adding " + f.getKey() + " dusts of " - + f.getValue().getLocalizedName() + "."); + Logger.MATERIALS( + "[Centrifuge] Found Solid Component, adding " + f.getKey() + + " dusts of " + + f.getValue().getLocalizedName() + + "."); mInternalOutputs[mCounter++] = f.getValue().getDust(f.getKey()); mTotalCount += f.getKey(); } @@ -96,8 +107,10 @@ public class RecipeGen_MaterialProcessing extends RecipeGen_Base { // Build Output Array for (int g = 0; g < mInternalOutputs.length; g++) { - Logger.MATERIALS("[Centrifuge] Is output[" + g + "] valid with a chance? " - + (mInternalOutputs[g] != null ? 10000 : 0)); + Logger.MATERIALS( + "[Centrifuge] Is output[" + g + + "] valid with a chance? " + + (mInternalOutputs[g] != null ? 10000 : 0)); mChances[g] = (mInternalOutputs[g] != null ? 10000 : 0); } @@ -109,14 +122,20 @@ public class RecipeGen_MaterialProcessing extends RecipeGen_Base { ItemStack mainDust = material.getDust(material.smallestStackSizeWhenProcessing); if (mainDust != null) { - Logger.MATERIALS("[Centrifuge] Recipe now requires " + material.smallestStackSizeWhenProcessing - + "x " + mainDust.getDisplayName() + " as input."); + Logger.MATERIALS( + "[Centrifuge] Recipe now requires " + material.smallestStackSizeWhenProcessing + + "x " + + mainDust.getDisplayName() + + " as input."); } else { mainDust = material.getDust(mTotalCount); Logger.MATERIALS("[Centrifuge] Could not find valid input dust, trying alternative."); if (mainDust != null) { - Logger.MATERIALS("[Centrifuge] Recipe now requires " + mTotalCount + "x " - + mainDust.getDisplayName() + " as input."); + Logger.MATERIALS( + "[Centrifuge] Recipe now requires " + mTotalCount + + "x " + + mainDust.getDisplayName() + + " as input."); } else { Logger.MATERIALS("[Centrifuge] Could not find valid input dust, exiting."); } @@ -147,11 +166,12 @@ public class RecipeGen_MaterialProcessing extends RecipeGen_Base { mChances, 20 * 1 * (tVoltageMultiplier / 10), tVoltageMultiplier)) { - Logger.MATERIALS("[Centrifuge] Generated Centrifuge recipe for " - + material.getDust(1).getDisplayName()); + Logger.MATERIALS( + "[Centrifuge] Generated Centrifuge recipe for " + material.getDust(1).getDisplayName()); } else { - Logger.MATERIALS("[Centrifuge] Failed to generate Centrifuge recipe for " - + material.getDust(1).getDisplayName()); + Logger.MATERIALS( + "[Centrifuge] Failed to generate Centrifuge recipe for " + + material.getDust(1).getDisplayName()); } } catch (Throwable t) { t.printStackTrace(); @@ -170,16 +190,25 @@ public class RecipeGen_MaterialProcessing extends RecipeGen_Base { int mCounter = 0; for (Pair<Integer, Material> f : componentMap) { if (f.getValue().getState() != MaterialState.SOLID) { - Logger.MATERIALS("[Dehydrator] Found Fluid Component, adding " + f.getKey() + " cells of " - + f.getValue().getLocalizedName() + "."); + Logger.MATERIALS( + "[Dehydrator] Found Fluid Component, adding " + f.getKey() + + " cells of " + + f.getValue().getLocalizedName() + + "."); mInternalOutputs[mCounter++] = f.getValue().getCell(f.getKey()); mCellCount += f.getKey(); mTotalCount += f.getKey(); - Logger.MATERIALS("[Dehydrator] In total, adding " + mCellCount + " cells for " - + material.getLocalizedName() + " processing."); + Logger.MATERIALS( + "[Dehydrator] In total, adding " + mCellCount + + " cells for " + + material.getLocalizedName() + + " processing."); } else { - Logger.MATERIALS("[Dehydrator] Found Solid Component, adding " + f.getKey() + " dusts of " - + f.getValue().getLocalizedName() + "."); + Logger.MATERIALS( + "[Dehydrator] Found Solid Component, adding " + f.getKey() + + " dusts of " + + f.getValue().getLocalizedName() + + "."); mInternalOutputs[mCounter++] = f.getValue().getDust(f.getKey()); mTotalCount += f.getKey(); } @@ -187,8 +216,10 @@ public class RecipeGen_MaterialProcessing extends RecipeGen_Base { // Build Output Array for (int g = 0; g < mInternalOutputs.length; g++) { - Logger.MATERIALS("[Dehydrator] Is output[" + g + "] valid with a chance? " - + (mInternalOutputs[g] != null ? 10000 : 0)); + Logger.MATERIALS( + "[Dehydrator] Is output[" + g + + "] valid with a chance? " + + (mInternalOutputs[g] != null ? 10000 : 0)); mChances[g] = (mInternalOutputs[g] != null ? 10000 : 0); } @@ -200,14 +231,20 @@ public class RecipeGen_MaterialProcessing extends RecipeGen_Base { ItemStack mainDust = material.getDust(material.smallestStackSizeWhenProcessing); if (mainDust != null) { - Logger.MATERIALS("[Dehydrator] Recipe now requires " + material.smallestStackSizeWhenProcessing - + "x " + mainDust.getDisplayName() + " as input."); + Logger.MATERIALS( + "[Dehydrator] Recipe now requires " + material.smallestStackSizeWhenProcessing + + "x " + + mainDust.getDisplayName() + + " as input."); } else { mainDust = material.getDust(mTotalCount); Logger.MATERIALS("[Dehydrator] Could not find valid input dust, trying alternative."); if (mainDust != null) { - Logger.MATERIALS("[Dehydrator] Recipe now requires " + mTotalCount + "x " - + mainDust.getDisplayName() + " as input."); + Logger.MATERIALS( + "[Dehydrator] Recipe now requires " + mTotalCount + + "x " + + mainDust.getDisplayName() + + " as input."); } else { Logger.MATERIALS("[Dehydrator] Could not find valid input dust, exiting."); } @@ -226,18 +263,19 @@ public class RecipeGen_MaterialProcessing extends RecipeGen_Base { try { if (CORE.RA.addDehydratorRecipe( - new ItemStack[] {mainDust, emptyCell}, + new ItemStack[] { mainDust, emptyCell }, null, null, mInternalOutputs, mChances, 20 * 1 * (tVoltageMultiplier / 10), tVoltageMultiplier)) { - Logger.MATERIALS("[Dehydrator] Generated Dehydrator recipe for " - + material.getDust(1).getDisplayName()); + Logger.MATERIALS( + "[Dehydrator] Generated Dehydrator recipe for " + material.getDust(1).getDisplayName()); } else { - Logger.MATERIALS("[Dehydrator] Failed to generate Dehydrator recipe for " - + material.getDust(1).getDisplayName()); + Logger.MATERIALS( + "[Dehydrator] Failed to generate Dehydrator recipe for " + + material.getDust(1).getDisplayName()); } } catch (Throwable t) { t.printStackTrace(); @@ -246,20 +284,9 @@ public class RecipeGen_MaterialProcessing extends RecipeGen_Base { } } - public static boolean addCentrifgeRecipe( - ItemStack aInput1, - ItemStack aInput2, - FluidStack aFluidInput, - FluidStack aFluidOutput, - ItemStack aOutput1, - ItemStack aOutput2, - ItemStack aOutput3, - ItemStack aOutput4, - ItemStack aOutput5, - ItemStack aOutput6, - int[] aChances, - int aDuration, - int aEUt) { + public static boolean addCentrifgeRecipe(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, + FluidStack aFluidOutput, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3, ItemStack aOutput4, + ItemStack aOutput5, ItemStack aOutput6, int[] aChances, int aDuration, int aEUt) { return GT_Values.RA.addCentrifugeRecipe( aInput1, aInput2, diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_MetalRecipe.java b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_MetalRecipe.java index eb6fa4ee75..0464ae80d7 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_MetalRecipe.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_MetalRecipe.java @@ -1,5 +1,8 @@ package gtPlusPlus.xmod.gregtech.loaders; +import java.util.HashSet; +import java.util.Set; + import gregtech.api.enums.GT_Values; import gregtech.api.util.GT_ModHandler; import gtPlusPlus.api.interfaces.RunnableWithInfo; @@ -8,8 +11,6 @@ import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.material.Material; import gtPlusPlus.core.material.MaterialGenerator; import gtPlusPlus.core.util.minecraft.ItemUtils; -import java.util.HashSet; -import java.util.Set; public class RecipeGen_MetalRecipe extends RecipeGen_Base { @@ -47,10 +48,10 @@ public class RecipeGen_MetalRecipe extends RecipeGen_Base { material.getSmallDust(2), (int) Math.max(material.getMass() / 8L, 1L), material.vVoltageMultiplier)) { - Logger.WARNING("Lathe Rod Recipe: " + material.getLocalizedName() + " - Success"); - } else { - Logger.WARNING("Lathe Rod Recipe: " + material.getLocalizedName() + " - Failed"); - } + Logger.WARNING("Lathe Rod Recipe: " + material.getLocalizedName() + " - Success"); + } else { + Logger.WARNING("Lathe Rod Recipe: " + material.getLocalizedName() + " - Failed"); + } if (ItemUtils.checkForInvalidItems(material.getRod(1)) && ItemUtils.checkForInvalidItems(material.getBolt(1))) if (GT_Values.RA.addCutterRecipe( @@ -59,10 +60,10 @@ public class RecipeGen_MetalRecipe extends RecipeGen_Base { null, (int) Math.max(material.getMass() * 2L, 1L), material.vVoltageMultiplier)) { - Logger.WARNING("Cut Bolt Recipe: " + material.getLocalizedName() + " - Success"); - } else { - Logger.WARNING("Cut Bolt Recipe: " + material.getLocalizedName() + " - Failed"); - } + Logger.WARNING("Cut Bolt Recipe: " + material.getLocalizedName() + " - Success"); + } else { + Logger.WARNING("Cut Bolt Recipe: " + material.getLocalizedName() + " - Failed"); + } if (ItemUtils.checkForInvalidItems(material.getIngot(1)) && ItemUtils.checkForInvalidItems(material.getHotIngot(1))) @@ -71,30 +72,41 @@ public class RecipeGen_MetalRecipe extends RecipeGen_Base { material.getIngot(1), (int) Math.max(material.getMass() * 3L, 1L), material.vVoltageMultiplier)) { - Logger.WARNING("Cool Hot Ingot Recipe: " + material.getLocalizedName() + " - Success"); - } else { - Logger.WARNING("Cool Hot Ingot Recipe: " + material.getLocalizedName() + " - Failed"); - } + Logger.WARNING("Cool Hot Ingot Recipe: " + material.getLocalizedName() + " - Success"); + } else { + Logger.WARNING("Cool Hot Ingot Recipe: " + material.getLocalizedName() + " - Failed"); + } if (ItemUtils.checkForInvalidItems(material.getRod(1)) && ItemUtils.checkForInvalidItems(material.getLongRod(1))) { if (GT_Values.RA.addForgeHammerRecipe( - material.getRod(2), material.getLongRod(1), (int) Math.max(material.getMass(), 1L), 16)) { + material.getRod(2), + material.getLongRod(1), + (int) Math.max(material.getMass(), 1L), + 16)) { Logger.WARNING("Hammer Long Rod Recipe: " + material.getLocalizedName() + " - Success"); } else { Logger.WARNING("Hammer Long Rod Recipe: " + material.getLocalizedName() + " - Failed"); } GT_Values.RA.addCutterRecipe( - material.getLongRod(1), material.getRod(2), null, (int) Math.max(material.getMass(), 1L), 4); + material.getLongRod(1), + material.getRod(2), + null, + (int) Math.max(material.getMass(), 1L), + 4); } if (ItemUtils.checkForInvalidItems(material.getBolt(1)) && ItemUtils.checkForInvalidItems(material.getScrew(1))) if (GT_Values.RA.addLatheRecipe( - material.getBolt(1), material.getScrew(1), null, (int) Math.max(material.getMass() / 8L, 1L), 4)) { - Logger.WARNING("Lathe Screw Recipe: " + material.getLocalizedName() + " - Success"); - } else { - Logger.WARNING("Lathe Screw Recipe: " + material.getLocalizedName() + " - Failed"); - } + material.getBolt(1), + material.getScrew(1), + null, + (int) Math.max(material.getMass() / 8L, 1L), + 4)) { + Logger.WARNING("Lathe Screw Recipe: " + material.getLocalizedName() + " - Success"); + } else { + Logger.WARNING("Lathe Screw Recipe: " + material.getLocalizedName() + " - Failed"); + } } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_MultisUsingFluidInsteadOfCells.java b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_MultisUsingFluidInsteadOfCells.java index 39d9456115..25300ed515 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_MultisUsingFluidInsteadOfCells.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_MultisUsingFluidInsteadOfCells.java @@ -1,5 +1,10 @@ package gtPlusPlus.xmod.gregtech.loaders; +import java.util.ArrayList; + +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidStack; + import gregtech.api.util.GTPP_Recipe; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Recipe.GT_Recipe_Map; @@ -8,9 +13,6 @@ import gtPlusPlus.api.objects.Logger; import gtPlusPlus.api.objects.data.AutoMap; import gtPlusPlus.core.recipe.common.CI; import gtPlusPlus.core.util.minecraft.ItemUtils; -import java.util.ArrayList; -import net.minecraft.item.ItemStack; -import net.minecraftforge.fluids.FluidStack; public class RecipeGen_MultisUsingFluidInsteadOfCells { @@ -71,8 +73,7 @@ public class RecipeGen_MultisUsingFluidInsteadOfCells { int aInvalidRecipesToConvert = 0; int aOriginalCount = aInputs.mRecipeList.size(); - recipe: - for (GT_Recipe x : aInputs.mRecipeList) { + recipe: for (GT_Recipe x : aInputs.mRecipeList) { if (x != null) { ItemStack[] aInputItems = x.mInputs.clone(); @@ -86,8 +87,7 @@ public class RecipeGen_MultisUsingFluidInsteadOfCells { AutoMap<FluidStack> aOutputFluidsMap = new AutoMap<FluidStack>(); // Iterate Inputs, Convert valid items into fluids - inputs: - for (ItemStack aInputStack : aInputItems) { + inputs: for (ItemStack aInputStack : aInputItems) { FluidStack aFoundFluid = getFluidFromItemStack(aInputStack); if (aFoundFluid == null) { for (ItemStack aBadStack : mItemsToIgnore) { @@ -104,8 +104,7 @@ public class RecipeGen_MultisUsingFluidInsteadOfCells { } } // Iterate Outputs, Convert valid items into fluids - outputs: - for (ItemStack aOutputStack : aOutputItems) { + outputs: for (ItemStack aOutputStack : aOutputItems) { FluidStack aFoundFluid = getFluidFromItemStack(aOutputStack); if (aFoundFluid == null) { for (ItemStack aBadStack : mItemsToIgnore) { diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Ore.java b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Ore.java index 4e163119a0..f276ea218f 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Ore.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Ore.java @@ -1,5 +1,12 @@ package gtPlusPlus.xmod.gregtech.loaders; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.Set; + +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidStack; + import gregtech.api.GregTech_API; import gregtech.api.enums.GT_Values; import gregtech.api.enums.Materials; @@ -17,11 +24,6 @@ import gtPlusPlus.core.recipe.common.CI; import gtPlusPlus.core.util.minecraft.ItemUtils; import gtPlusPlus.core.util.minecraft.MaterialUtils; import gtPlusPlus.core.util.minecraft.RecipeUtils; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.Set; -import net.minecraft.item.ItemStack; -import net.minecraftforge.fluids.FluidStack; public class RecipeGen_Ore extends RecipeGen_Base { @@ -96,18 +98,15 @@ public class RecipeGen_Ore extends RecipeGen_Base { if (material.getComposites().size() >= 2 && material.getComposites().get(1) != null) { bonusB = material.getComposites().get(1).getStackMaterial(); // If Secondary Output has no solid output, try the third (If it exists) - if (!bonusB.hasSolidForm() - && material.getComposites().size() >= 3 + if (!bonusB.hasSolidForm() && material.getComposites().size() >= 3 && material.getComposites().get(2) != null) { bonusB = material.getComposites().get(2).getStackMaterial(); // If Third Output has no solid output, try the Fourth (If it exists) - if (!bonusB.hasSolidForm() - && material.getComposites().size() >= 4 + if (!bonusB.hasSolidForm() && material.getComposites().size() >= 4 && material.getComposites().get(3) != null) { bonusB = material.getComposites().get(3).getStackMaterial(); // If Fourth Output has no solid output, try the Fifth (If it exists) - if (!bonusB.hasSolidForm() - && material.getComposites().size() >= 5 + if (!bonusB.hasSolidForm() && material.getComposites().size() >= 5 && material.getComposites().get(4) != null) { bonusB = material.getComposites().get(4).getStackMaterial(); // If Fifth Output has no solid output, default out to Stone dust. @@ -177,8 +176,8 @@ public class RecipeGen_Ore extends RecipeGen_Base { // Macerate ore to Crushed if (GT_Values.RA.addPulveriserRecipe( material.getOre(1), - new ItemStack[] {material.getCrushed(2)}, - new int[] {10000}, + new ItemStack[] { material.getCrushed(2) }, + new int[] { 10000 }, 20 * 20, tVoltageMultiplier / 2)) { Logger.MATERIALS("[Macerator] Added Recipe: 'Macerate ore to Crushed ore'"); @@ -186,8 +185,8 @@ public class RecipeGen_Ore extends RecipeGen_Base { // Macerate Crushed to Impure Dust if (GT_Values.RA.addPulveriserRecipe( material.getCrushed(1), - new ItemStack[] {material.getDustImpure(1), matDustA}, - new int[] {10000, 1000}, + new ItemStack[] { material.getDustImpure(1), matDustA }, + new int[] { 10000, 1000 }, 20 * 20, tVoltageMultiplier / 2)) { Logger.MATERIALS("[Macerator] Added Recipe: 'Macerate Crushed ore to Impure Dust'"); @@ -195,8 +194,8 @@ public class RecipeGen_Ore extends RecipeGen_Base { // Macerate Washed to Purified Dust if (GT_Values.RA.addPulveriserRecipe( material.getCrushedPurified(1), - new ItemStack[] {material.getDustPurified(1), matDustA}, - new int[] {10000, 1000}, + new ItemStack[] { material.getDustPurified(1), matDustA }, + new int[] { 10000, 1000 }, 20 * 20, tVoltageMultiplier / 2)) { Logger.MATERIALS("[Macerator] Added Recipe: 'Macerate Washed ore to Purified Dust'"); @@ -204,8 +203,8 @@ public class RecipeGen_Ore extends RecipeGen_Base { // Macerate Centrifuged to Pure Dust if (GT_Values.RA.addPulveriserRecipe( material.getCrushedCentrifuged(1), - new ItemStack[] {matDust, matDustA}, - new int[] {10000, 1000}, + new ItemStack[] { matDust, matDustA }, + new int[] { 10000, 1000 }, 20 * 20, tVoltageMultiplier / 2)) { Logger.MATERIALS("[Macerator] Added Recipe: 'Macerate Centrifuged ore to Pure Dust'"); @@ -215,13 +214,15 @@ public class RecipeGen_Ore extends RecipeGen_Base { * Wash */ // Wash into Purified Crushed - /*if (GT_Values.RA.addOreWasherRecipe(material.getCrushed(1), material.getCrushedPurified(1), bonusA.getTinyDust(1), dustStone, FluidUtils.getWater(1000), 25*20, 16)){ - Logger.MATERIALS("[OreWasher] Added Recipe: 'Wash Crushed ore into Purified Crushed ore'"); - }*/ + /* + * if (GT_Values.RA.addOreWasherRecipe(material.getCrushed(1), material.getCrushedPurified(1), + * bonusA.getTinyDust(1), dustStone, FluidUtils.getWater(1000), 25*20, 16)){ + * Logger.MATERIALS("[OreWasher] Added Recipe: 'Wash Crushed ore into Purified Crushed ore'"); } + */ // .08 compat method if (GT_ModHandler.addOreWasherRecipe( material.getCrushed(1), - new int[] {10000, 1111, 10000}, + new int[] { 10000, 1111, 10000 }, 1000, material.getCrushedPurified(1), matDustA, @@ -232,14 +233,14 @@ public class RecipeGen_Ore extends RecipeGen_Base { /** * Thermal Centrifuge */ - /*//Crushed ore to Centrifuged Ore - if (GT_Values.RA.addThermalCentrifugeRecipe(material.getCrushed(1), material.getCrushedCentrifuged(1), tinyDustB, dustStone, 25*20, 24)){ - Logger.MATERIALS("[ThermalCentrifuge] Added Recipe: 'Crushed ore to Centrifuged Ore'"); - } - //Washed ore to Centrifuged Ore - if (GT_Values.RA.addThermalCentrifugeRecipe(material.getCrushedPurified(1), material.getCrushedCentrifuged(1), bonusA.getTinyDust(1), dustStone, 25*20, 24)){ - Logger.MATERIALS("[ThermalCentrifuge] Added Recipe: 'Washed ore to Centrifuged Ore'"); - }*/ + /* + * //Crushed ore to Centrifuged Ore if (GT_Values.RA.addThermalCentrifugeRecipe(material.getCrushed(1), + * material.getCrushedCentrifuged(1), tinyDustB, dustStone, 25*20, 24)){ + * Logger.MATERIALS("[ThermalCentrifuge] Added Recipe: 'Crushed ore to Centrifuged Ore'"); } //Washed ore to + * Centrifuged Ore if (GT_Values.RA.addThermalCentrifugeRecipe(material.getCrushedPurified(1), + * material.getCrushedCentrifuged(1), bonusA.getTinyDust(1), dustStone, 25*20, 24)){ + * Logger.MATERIALS("[ThermalCentrifuge] Added Recipe: 'Washed ore to Centrifuged Ore'"); } + */ Logger.MATERIALS("material.getCrushed(1): " + (material.getCrushed(1) != null)); Logger.MATERIALS("material.getCrushedPurified(1): " + (material.getCrushedPurified(1) != null)); @@ -251,33 +252,43 @@ public class RecipeGen_Ore extends RecipeGen_Base { // .08 compat if (GT_ModHandler.addThermalCentrifugeRecipe( material.getCrushed(1), - new int[] {10000, 1111, 10000}, + new int[] { 10000, 1111, 10000 }, (int) Math.min(5000L, Math.abs(material.getMass() * 20L)), material.getCrushedCentrifuged(1), matDustB, dustStone)) { - Logger.MATERIALS("[ThermalCentrifuge] Added Recipe: 'Crushed ore to Centrifuged Ore' | Input: " - + material.getCrushed(1).getDisplayName() + " | Outputs: " - + material.getCrushedCentrifuged(1).getDisplayName() + ", " + matDustB.getDisplayName() + ", " - + dustStone.getDisplayName() + "."); + Logger.MATERIALS( + "[ThermalCentrifuge] Added Recipe: 'Crushed ore to Centrifuged Ore' | Input: " + + material.getCrushed(1).getDisplayName() + + " | Outputs: " + + material.getCrushedCentrifuged(1).getDisplayName() + + ", " + + matDustB.getDisplayName() + + ", " + + dustStone.getDisplayName() + + "."); } - } catch (Throwable t) { - } + } catch (Throwable t) {} try { if (GT_ModHandler.addThermalCentrifugeRecipe( material.getCrushedPurified(1), - new int[] {10000, 1111, 10000}, + new int[] { 10000, 1111, 10000 }, (int) Math.min(5000L, Math.abs(material.getMass() * 20L)), material.getCrushedCentrifuged(1), matDustA, dustStone)) { - Logger.MATERIALS("[ThermalCentrifuge] Added Recipe: 'Washed ore to Centrifuged Ore' | Input: " - + material.getCrushedPurified(1).getDisplayName() + " | Outputs: " - + material.getCrushedCentrifuged(1).getDisplayName() + ", " + matDustA.getDisplayName() + ", " - + dustStone.getDisplayName() + "."); + Logger.MATERIALS( + "[ThermalCentrifuge] Added Recipe: 'Washed ore to Centrifuged Ore' | Input: " + + material.getCrushedPurified(1).getDisplayName() + + " | Outputs: " + + material.getCrushedCentrifuged(1).getDisplayName() + + ", " + + matDustA.getDisplayName() + + ", " + + dustStone.getDisplayName() + + "."); } - } catch (Throwable t) { - } + } catch (Throwable t) {} /** * Forge Hammer @@ -286,7 +297,10 @@ public class RecipeGen_Ore extends RecipeGen_Base { Logger.MATERIALS("[ForgeHammer] Added Recipe: 'Crushed Centrifuged to Pure Dust'"); } if (GT_Values.RA.addForgeHammerRecipe( - material.getCrushedPurified(1), material.getDustPurified(1), 10, tVoltageMultiplier / 4)) { + material.getCrushedPurified(1), + material.getDustPurified(1), + 10, + tVoltageMultiplier / 4)) { Logger.MATERIALS("[ForgeHammer] Added Recipe: 'Crushed Purified to Purified Dust'"); } if (GT_Values.RA.addForgeHammerRecipe(material.getOre(1), material.getCrushed(1), 10, tVoltageMultiplier / 4)) { @@ -308,7 +322,7 @@ public class RecipeGen_Ore extends RecipeGen_Base { null, null, null, - new int[] {10000, 1111}, // Chances + new int[] { 10000, 1111 }, // Chances (int) Math.max(1L, material.getMass() * 8L), // Time tVoltageMultiplier / 2)) { // Eu Logger.MATERIALS("[Centrifuge] Added Recipe: Purified Dust to Clean Dust"); @@ -326,7 +340,7 @@ public class RecipeGen_Ore extends RecipeGen_Base { null, null, null, - new int[] {10000, 1111}, // Chances + new int[] { 10000, 1111 }, // Chances (int) Math.max(1L, material.getMass() * 8L), // Time tVoltageMultiplier / 2)) { // Eu Logger.MATERIALS("[Centrifuge] Added Recipe: Inpure Dust to Clean Dust"); @@ -348,16 +362,25 @@ public class RecipeGen_Ore extends RecipeGen_Base { int mCounter = 0; for (Pair<Integer, Material> f : componentMap) { if (f.getValue().getState() != MaterialState.SOLID) { - Logger.MATERIALS("[Electrolyzer] Found Fluid Component, adding " + f.getKey() + " cells of " - + f.getValue().getLocalizedName() + "."); + Logger.MATERIALS( + "[Electrolyzer] Found Fluid Component, adding " + f.getKey() + + " cells of " + + f.getValue().getLocalizedName() + + "."); mInternalOutputs[mCounter++] = f.getValue().getCell(f.getKey()); mCellCount += f.getKey(); mTotalCount += f.getKey(); - Logger.MATERIALS("[Electrolyzer] In total, adding " + mCellCount + " cells for " - + material.getLocalizedName() + " processing."); + Logger.MATERIALS( + "[Electrolyzer] In total, adding " + mCellCount + + " cells for " + + material.getLocalizedName() + + " processing."); } else { - Logger.MATERIALS("[Electrolyzer] Found Solid Component, adding " + f.getKey() + " dusts of " - + f.getValue().getLocalizedName() + "."); + Logger.MATERIALS( + "[Electrolyzer] Found Solid Component, adding " + f.getKey() + + " dusts of " + + f.getValue().getLocalizedName() + + "."); mInternalOutputs[mCounter++] = f.getValue().getDust(f.getKey()); mTotalCount += f.getKey(); } @@ -365,8 +388,10 @@ public class RecipeGen_Ore extends RecipeGen_Base { // Build Output Array for (int g = 0; g < mInternalOutputs.length; g++) { - Logger.MATERIALS("[Electrolyzer] Is output[" + g + "] valid with a chance? " - + (mInternalOutputs[g] != null ? 10000 : 0)); + Logger.MATERIALS( + "[Electrolyzer] Is output[" + g + + "] valid with a chance? " + + (mInternalOutputs[g] != null ? 10000 : 0)); mChances[g] = (mInternalOutputs[g] != null ? 10000 : 0); } @@ -378,14 +403,20 @@ public class RecipeGen_Ore extends RecipeGen_Base { ItemStack mainDust = material.getDust(material.smallestStackSizeWhenProcessing); if (mainDust != null) { - Logger.MATERIALS("[Electrolyzer] Recipe now requires " + material.smallestStackSizeWhenProcessing - + "x " + mainDust.getDisplayName() + " as input."); + Logger.MATERIALS( + "[Electrolyzer] Recipe now requires " + material.smallestStackSizeWhenProcessing + + "x " + + mainDust.getDisplayName() + + " as input."); } else { mainDust = material.getDust(mTotalCount); Logger.MATERIALS("[Electrolyzer] Could not find valid input dust, trying alternative."); if (mainDust != null) { - Logger.MATERIALS("[Electrolyzer] Recipe now requires " + mTotalCount + "x " - + mainDust.getDisplayName() + " as input."); + Logger.MATERIALS( + "[Electrolyzer] Recipe now requires " + mTotalCount + + "x " + + mainDust.getDisplayName() + + " as input."); } else { Logger.MATERIALS("[Electrolyzer] Could not find valid input dust, exiting."); } @@ -419,8 +450,9 @@ public class RecipeGen_Ore extends RecipeGen_Base { Logger.MATERIALS( "[Electrolyzer] Generated Electrolyzer recipe for " + matDust.getDisplayName()); } else { - Logger.MATERIALS("[Electrolyzer] Failed to generate Electrolyzer recipe for " - + matDust.getDisplayName()); + Logger.MATERIALS( + "[Electrolyzer] Failed to generate Electrolyzer recipe for " + + matDust.getDisplayName()); } } catch (Throwable t) { t.printStackTrace(); @@ -440,16 +472,25 @@ public class RecipeGen_Ore extends RecipeGen_Base { for (Pair<Integer, Material> f : componentMap) { if (f.getValue().getState() != MaterialState.SOLID && f.getValue().getState() != MaterialState.ORE) { - Logger.MATERIALS("[Dehydrator] Found Fluid Component, adding " + f.getKey() + " cells of " - + f.getValue().getLocalizedName() + "."); + Logger.MATERIALS( + "[Dehydrator] Found Fluid Component, adding " + f.getKey() + + " cells of " + + f.getValue().getLocalizedName() + + "."); mInternalOutputs[mCounter++] = f.getValue().getCell(f.getKey()); mCellCount += f.getKey(); mTotalCount += f.getKey(); - Logger.MATERIALS("[Dehydrator] In total, adding " + mCellCount + " cells for " - + material.getLocalizedName() + " processing."); + Logger.MATERIALS( + "[Dehydrator] In total, adding " + mCellCount + + " cells for " + + material.getLocalizedName() + + " processing."); } else { - Logger.MATERIALS("[Dehydrator] Found Solid Component, adding " + f.getKey() + " dusts of " - + f.getValue().getLocalizedName() + "."); + Logger.MATERIALS( + "[Dehydrator] Found Solid Component, adding " + f.getKey() + + " dusts of " + + f.getValue().getLocalizedName() + + "."); mInternalOutputs[mCounter++] = f.getValue().getDust(f.getKey()); mTotalCount += f.getKey(); } @@ -457,8 +498,10 @@ public class RecipeGen_Ore extends RecipeGen_Base { // Build Output Array for (int g = 0; g < mInternalOutputs.length; g++) { - Logger.MATERIALS("[Dehydrator] Is output[" + g + "] valid with a chance? " - + (mInternalOutputs[g] != null ? 10000 : 0)); + Logger.MATERIALS( + "[Dehydrator] Is output[" + g + + "] valid with a chance? " + + (mInternalOutputs[g] != null ? 10000 : 0)); mChances[g] = (mInternalOutputs[g] != null ? 10000 : 0); } @@ -470,14 +513,20 @@ public class RecipeGen_Ore extends RecipeGen_Base { ItemStack mainDust = material.getDust(material.smallestStackSizeWhenProcessing); if (mainDust != null) { - Logger.MATERIALS("[Dehydrator] Recipe now requires " + material.smallestStackSizeWhenProcessing - + "x " + mainDust.getDisplayName() + " as input."); + Logger.MATERIALS( + "[Dehydrator] Recipe now requires " + material.smallestStackSizeWhenProcessing + + "x " + + mainDust.getDisplayName() + + " as input."); } else { mainDust = material.getDust(mTotalCount); Logger.MATERIALS("[Dehydrator] Could not find valid input dust, trying alternative."); if (mainDust != null) { - Logger.MATERIALS("[Dehydrator] Recipe now requires " + mTotalCount + "x " - + mainDust.getDisplayName() + " as input."); + Logger.MATERIALS( + "[Dehydrator] Recipe now requires " + mTotalCount + + "x " + + mainDust.getDisplayName() + + " as input."); } else { Logger.MATERIALS("[Dehydrator] Could not find valid input dust, exiting."); } @@ -495,7 +544,7 @@ public class RecipeGen_Ore extends RecipeGen_Base { try { if (CORE.RA.addDehydratorRecipe( - new ItemStack[] {mainDust, emptyCell}, + new ItemStack[] { mainDust, emptyCell }, null, null, mInternalOutputs, @@ -503,10 +552,13 @@ public class RecipeGen_Ore extends RecipeGen_Base { (int) Math.max(material.getMass() * 4L * 1, 1), tVoltageMultiplier)) { Logger.MATERIALS("[Dehydrator] Generated Dehydrator recipe for " + matDust.getDisplayName()); - Logger.MATERIALS("Inputs: " + mainDust.getDisplayName() + " x" + mainDust.stackSize + ", " - + (emptyCell == null - ? "No Cells" - : "" + emptyCell.getDisplayName() + " x" + emptyCell.stackSize)); + Logger.MATERIALS( + "Inputs: " + mainDust.getDisplayName() + + " x" + + mainDust.stackSize + + ", " + + (emptyCell == null ? "No Cells" + : "" + emptyCell.getDisplayName() + " x" + emptyCell.stackSize)); Logger.MATERIALS("Outputs " + ItemUtils.getArrayStackNames(mInternalOutputs)); Logger.MATERIALS("Time: " + ((int) Math.max(material.getMass() * 4L * 1, 1))); Logger.MATERIALS("EU: " + tVoltageMultiplier); @@ -564,28 +616,55 @@ public class RecipeGen_Ore extends RecipeGen_Base { final ItemStack tinyDust = material.getTinyDust(1); if (RecipeUtils.addShapedRecipe( - tinyDust, tinyDust, tinyDust, tinyDust, tinyDust, tinyDust, tinyDust, tinyDust, tinyDust, normalDust)) { + tinyDust, + tinyDust, + tinyDust, + tinyDust, + tinyDust, + tinyDust, + tinyDust, + tinyDust, + tinyDust, + normalDust)) { Logger.WARNING("9 Tiny dust to 1 Dust Recipe: " + material.getLocalizedName() + " - Success"); } else { Logger.WARNING("9 Tiny dust to 1 Dust Recipe: " + material.getLocalizedName() + " - Failed"); } - if (RecipeUtils.addShapedRecipe( - normalDust, null, null, null, null, null, null, null, null, material.getTinyDust(9))) { + if (RecipeUtils + .addShapedRecipe(normalDust, null, null, null, null, null, null, null, null, material.getTinyDust(9))) { Logger.WARNING("9 Tiny dust from 1 Recipe: " + material.getLocalizedName() + " - Success"); } else { Logger.WARNING("9 Tiny dust from 1 Recipe: " + material.getLocalizedName() + " - Failed"); } if (RecipeUtils.addShapedRecipe( - smallDust, smallDust, null, smallDust, smallDust, null, null, null, null, normalDust)) { + smallDust, + smallDust, + null, + smallDust, + smallDust, + null, + null, + null, + null, + normalDust)) { Logger.WARNING("4 Small dust to 1 Dust Recipe: " + material.getLocalizedName() + " - Success"); } else { Logger.WARNING("4 Small dust to 1 Dust Recipe: " + material.getLocalizedName() + " - Failed"); } if (RecipeUtils.addShapedRecipe( - null, normalDust, null, null, null, null, null, null, null, material.getSmallDust(4))) { + null, + normalDust, + null, + null, + null, + null, + null, + null, + null, + material.getSmallDust(4))) { Logger.WARNING("4 Small dust from 1 Dust Recipe: " + material.getLocalizedName() + " - Success"); } else { Logger.WARNING("4 Small dust from 1 Dust Recipe: " + material.getLocalizedName() + " - Failed"); @@ -594,20 +673,9 @@ public class RecipeGen_Ore extends RecipeGen_Base { // } } - public static boolean addElectrolyzerRecipe( - ItemStack aInput1, - ItemStack aInput2, - FluidStack aFluidInput, - FluidStack aFluidOutput, - ItemStack aOutput1, - ItemStack aOutput2, - ItemStack aOutput3, - ItemStack aOutput4, - ItemStack aOutput5, - ItemStack aOutput6, - int[] aChances, - int aDuration, - int aEUt) { + public static boolean addElectrolyzerRecipe(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, + FluidStack aFluidOutput, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3, ItemStack aOutput4, + ItemStack aOutput5, ItemStack aOutput6, int[] aChances, int aDuration, int aEUt) { if (((aInput1 == null) && (aFluidInput == null)) || ((aOutput1 == null) && (aFluidOutput == null))) { Logger.MATERIALS("[Electrolyzer] Either both inputs or outputs are null."); return false; @@ -617,10 +685,8 @@ public class RecipeGen_Ore extends RecipeGen_Base { Logger.MATERIALS("[Electrolyzer] Fail 1."); return false; } - if ((aFluidInput != null) - && ((aDuration = GregTech_API.sRecipeFile.get( - "electrolyzer", aFluidInput.getFluid().getName(), aDuration)) - <= 0)) { + if ((aFluidInput != null) && ((aDuration = GregTech_API.sRecipeFile + .get("electrolyzer", aFluidInput.getFluid().getName(), aDuration)) <= 0)) { Logger.MATERIALS("[Electrolyzer] Fail 2."); return false; } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Plasma.java b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Plasma.java index bf9ef18720..ea77ce1761 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Plasma.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Plasma.java @@ -1,5 +1,10 @@ package gtPlusPlus.xmod.gregtech.loaders; +import java.util.HashSet; +import java.util.Set; + +import net.minecraft.item.ItemStack; + import gregtech.api.enums.GT_Values; import gregtech.api.util.GT_Utility; import gtPlusPlus.api.interfaces.RunnableWithInfo; @@ -7,9 +12,6 @@ import gtPlusPlus.core.material.Material; import gtPlusPlus.core.material.MaterialGenerator; import gtPlusPlus.core.recipe.common.CI; import gtPlusPlus.core.util.minecraft.ItemUtils; -import java.util.HashSet; -import java.util.Set; -import net.minecraft.item.ItemStack; public class RecipeGen_Plasma extends RecipeGen_Base { @@ -37,14 +39,14 @@ public class RecipeGen_Plasma extends RecipeGen_Base { ItemStack aContainerItem = GT_Utility.getFluidForFilledItem(aPlasmaCell, true) == null ? GT_Utility.getContainerItem(aPlasmaCell, true) : CI.emptyCells(1); - if (ItemUtils.checkForInvalidItems(new ItemStack[] {aPlasmaCell, aContainerItem})) { + if (ItemUtils.checkForInvalidItems(new ItemStack[] { aPlasmaCell, aContainerItem })) { GT_Values.RA.addFuel( GT_Utility.copyAmount(1L, aPlasmaCell), aContainerItem, (int) Math.max(1024L, 1024L * material.getMass()), 4); } - if (ItemUtils.checkForInvalidItems(new ItemStack[] {aCell, aPlasmaCell})) { + if (ItemUtils.checkForInvalidItems(new ItemStack[] { aCell, aPlasmaCell })) { GT_Values.RA.addVacuumFreezerRecipe(aPlasmaCell, aCell, (int) Math.max(material.getMass() * 2L, 1L)); } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Plates.java b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Plates.java index 15e77ac0f5..3de61a949f 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Plates.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Plates.java @@ -1,5 +1,10 @@ package gtPlusPlus.xmod.gregtech.loaders; +import java.util.HashSet; +import java.util.Set; + +import net.minecraft.item.ItemStack; + import gregtech.api.GregTech_API; import gregtech.api.enums.GT_Values; import gregtech.api.enums.ItemList; @@ -11,9 +16,6 @@ import gtPlusPlus.core.material.Material; import gtPlusPlus.core.material.MaterialGenerator; import gtPlusPlus.core.recipe.common.CI; import gtPlusPlus.core.util.minecraft.ItemUtils; -import java.util.HashSet; -import java.util.Set; -import net.minecraft.item.ItemStack; public class RecipeGen_Plates extends RecipeGen_Base { @@ -58,10 +60,10 @@ public class RecipeGen_Plates extends RecipeGen_Base { plate_SingleTwo, (int) Math.max(material.getMass(), 1L), material.vVoltageMultiplier)) { - Logger.WARNING("Forge Hammer Recipe: " + material.getLocalizedName() + " - Success"); - } else { - Logger.WARNING("Forge Hammer Recipe: " + material.getLocalizedName() + " - Failed"); - } + Logger.WARNING("Forge Hammer Recipe: " + material.getLocalizedName() + " - Success"); + } else { + Logger.WARNING("Forge Hammer Recipe: " + material.getLocalizedName() + " - Failed"); + } // Bender if (ItemUtils.checkForInvalidItems(ingotStackOne) && ItemUtils.checkForInvalidItems(plate_Single)) if (addBenderRecipe( @@ -69,10 +71,10 @@ public class RecipeGen_Plates extends RecipeGen_Base { plate_Single, (int) Math.max(material.getMass() * 1L, 1L), material.vVoltageMultiplier)) { - Logger.WARNING("Bender Recipe: " + material.getLocalizedName() + " - Success"); - } else { - Logger.WARNING("Bender Recipe: " + material.getLocalizedName() + " - Failed"); - } + Logger.WARNING("Bender Recipe: " + material.getLocalizedName() + " - Success"); + } else { + Logger.WARNING("Bender Recipe: " + material.getLocalizedName() + " - Failed"); + } if (ItemUtils.checkForInvalidItems(ingotStackOne) && ItemUtils.checkForInvalidItems(foil_SingleFour)) if (addBenderRecipe( ingotStackOne, @@ -80,10 +82,10 @@ public class RecipeGen_Plates extends RecipeGen_Base { foil_SingleFour, (int) Math.max(material.getMass() * 2L, 1L), material.vVoltageMultiplier)) { - Logger.WARNING("Bender Recipe: " + material.getLocalizedName() + " - Success"); - } else { - Logger.WARNING("Bender Recipe: " + material.getLocalizedName() + " - Failed"); - } + Logger.WARNING("Bender Recipe: " + material.getLocalizedName() + " - Success"); + } else { + Logger.WARNING("Bender Recipe: " + material.getLocalizedName() + " - Failed"); + } // Alloy Smelter if (ItemUtils.checkForInvalidItems(ingotStackTwo) && ItemUtils.checkForInvalidItems(plate_Single)) if (GT_Values.RA.addAlloySmelterRecipe( @@ -92,10 +94,10 @@ public class RecipeGen_Plates extends RecipeGen_Base { plate_Single, (int) Math.max(material.getMass() * 2L, 1L), material.vVoltageMultiplier)) { - Logger.WARNING("Alloy Smelter Recipe: " + material.getLocalizedName() + " - Success"); - } else { - Logger.WARNING("Alloy Smelter Recipe: " + material.getLocalizedName() + " - Failed"); - } + Logger.WARNING("Alloy Smelter Recipe: " + material.getLocalizedName() + " - Success"); + } else { + Logger.WARNING("Alloy Smelter Recipe: " + material.getLocalizedName() + " - Failed"); + } // Cutting Machine if (ItemUtils.checkForInvalidItems(block) && ItemUtils.checkForInvalidItems(plate_Single)) if (GT_Values.RA.addCutterRecipe( @@ -104,10 +106,10 @@ public class RecipeGen_Plates extends RecipeGen_Base { plate_SingleNine, (int) Math.max(material.getMass() * 10L, 1L), material.vVoltageMultiplier)) { - Logger.WARNING("Cutting Machine Recipe: " + material.getLocalizedName() + " - Success"); - } else { - Logger.WARNING("Cutting Machine Recipe: " + material.getLocalizedName() + " - Failed"); - } + Logger.WARNING("Cutting Machine Recipe: " + material.getLocalizedName() + " - Success"); + } else { + Logger.WARNING("Cutting Machine Recipe: " + material.getLocalizedName() + " - Failed"); + } // Making Double Plates if (ItemUtils.checkForInvalidItems(ingotStackTwo) && ItemUtils.checkForInvalidItems(plate_Double)) @@ -116,10 +118,10 @@ public class RecipeGen_Plates extends RecipeGen_Base { plate_Double, (int) Math.max(material.getMass() * 2L, 1L), material.vVoltageMultiplier)) { - Logger.WARNING("Bender Recipe: " + material.getLocalizedName() + " - Success"); - } else { - Logger.WARNING("Bender Recipe: " + material.getLocalizedName() + " - Failed"); - } + Logger.WARNING("Bender Recipe: " + material.getLocalizedName() + " - Success"); + } else { + Logger.WARNING("Bender Recipe: " + material.getLocalizedName() + " - Failed"); + } if (ItemUtils.checkForInvalidItems(plate_SingleTwo) && ItemUtils.checkForInvalidItems(plate_Double)) if (addBenderRecipe( @@ -127,10 +129,10 @@ public class RecipeGen_Plates extends RecipeGen_Base { plate_Double, (int) Math.max(material.getMass() * 2L, 1L), material.vVoltageMultiplier)) { - Logger.WARNING("Bender Recipe: " + material.getLocalizedName() + " - Success"); - } else { - Logger.WARNING("Bender Recipe: " + material.getLocalizedName() + " - Failed"); - } + Logger.WARNING("Bender Recipe: " + material.getLocalizedName() + " - Success"); + } else { + Logger.WARNING("Bender Recipe: " + material.getLocalizedName() + " - Failed"); + } // Bender if (ItemUtils.checkForInvalidItems(material.getPlate(1)) && ItemUtils.checkForInvalidItems(material.getFoil(1))) @@ -139,14 +141,17 @@ public class RecipeGen_Plates extends RecipeGen_Base { material.getFoil(4), (int) Math.max(material.getMass(), 1L), material.vVoltageMultiplier)) { - GregTech_API.registerCover( - material.getFoil(1), - new GT_RenderedTexture(material.getTextureSet().mTextures[70], material.getRGBA(), false), - null); - Logger.WARNING("Bender Foil Recipe: " + material.getLocalizedName() + " - Success"); - } else { - Logger.WARNING("Bender Foil Recipe: " + material.getLocalizedName() + " - Failed"); - } + GregTech_API.registerCover( + material.getFoil(1), + new GT_RenderedTexture( + material.getTextureSet().mTextures[70], + material.getRGBA(), + false), + null); + Logger.WARNING("Bender Foil Recipe: " + material.getLocalizedName() + " - Success"); + } else { + Logger.WARNING("Bender Foil Recipe: " + material.getLocalizedName() + " - Failed"); + } // Making Dense Plates if (ItemUtils.checkForInvalidItems(ingotStackNine) && ItemUtils.checkForInvalidItems(plate_Dense)) @@ -155,10 +160,10 @@ public class RecipeGen_Plates extends RecipeGen_Base { plate_Dense, (int) Math.max(material.getMass() * 2L, 1L), material.vVoltageMultiplier)) { - Logger.WARNING("Bender Recipe: " + material.getLocalizedName() + " - Success"); - } else { - Logger.WARNING("Bender Recipe: " + material.getLocalizedName() + " - Failed"); - } + Logger.WARNING("Bender Recipe: " + material.getLocalizedName() + " - Success"); + } else { + Logger.WARNING("Bender Recipe: " + material.getLocalizedName() + " - Failed"); + } if (ItemUtils.checkForInvalidItems(plate_SingleNine) && ItemUtils.checkForInvalidItems(plate_Dense)) if (addBenderRecipe( @@ -166,28 +171,24 @@ public class RecipeGen_Plates extends RecipeGen_Base { plate_Double, (int) Math.max(material.getMass() * 2L, 1L), material.vVoltageMultiplier)) { - Logger.WARNING("Bender Recipe: " + material.getLocalizedName() + " - Success"); - } else { - Logger.WARNING("Bender Recipe: " + material.getLocalizedName() + " - Failed"); - } + Logger.WARNING("Bender Recipe: " + material.getLocalizedName() + " - Success"); + } else { + Logger.WARNING("Bender Recipe: " + material.getLocalizedName() + " - Failed"); + } } - public static boolean addBenderRecipe( - final ItemStack aInput1, final ItemStack aOutput1, int aDuration, final int aEUt) { + public static boolean addBenderRecipe(final ItemStack aInput1, final ItemStack aOutput1, int aDuration, + final int aEUt) { return GT_Values.RA.addBenderRecipe(aInput1, aOutput1, aDuration, aEUt); } - public static boolean addBenderRecipe( - final ItemStack aInput1, - final ItemStack aCircuit, - final ItemStack aOutput1, - int aDuration, - final int aEUt) { + public static boolean addBenderRecipe(final ItemStack aInput1, final ItemStack aCircuit, final ItemStack aOutput1, + int aDuration, final int aEUt) { return GT_Values.RA.addBenderRecipe(aInput1, aCircuit, aOutput1, aDuration, aEUt); } - public static boolean addExtruderRecipe( - final ItemStack aInput, final ItemStack aShape, final ItemStack aOutput, int aDuration, final int aEUt) { + public static boolean addExtruderRecipe(final ItemStack aInput, final ItemStack aShape, final ItemStack aOutput, + int aDuration, final int aEUt) { if ((aInput == null) || (aShape == null) || (aOutput == null)) { return false; } @@ -196,8 +197,8 @@ public class RecipeGen_Plates extends RecipeGen_Base { } GT_Recipe.GT_Recipe_Map.sExtruderRecipes.addRecipe( true, - new ItemStack[] {aInput, aShape}, - new ItemStack[] {aOutput}, + new ItemStack[] { aInput, aShape }, + new ItemStack[] { aOutput }, null, null, null, @@ -207,8 +208,8 @@ public class RecipeGen_Plates extends RecipeGen_Base { return true; } - public static boolean addForgeHammerRecipe( - final ItemStack aInput1, final ItemStack aOutput1, final int aDuration, final int aEUt) { + public static boolean addForgeHammerRecipe(final ItemStack aInput1, final ItemStack aOutput1, final int aDuration, + final int aEUt) { if ((aInput1 == null) || (aOutput1 == null)) { return false; } @@ -216,7 +217,15 @@ public class RecipeGen_Plates extends RecipeGen_Base { return false; } GT_Recipe.GT_Recipe_Map.sHammerRecipes.addRecipe( - true, new ItemStack[] {aInput1}, new ItemStack[] {aOutput1}, null, null, null, aDuration, aEUt, 0); + true, + new ItemStack[] { aInput1 }, + new ItemStack[] { aOutput1 }, + null, + null, + null, + aDuration, + aEUt, + 0); return true; } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Recycling.java b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Recycling.java index 18391d170f..1c938e0da4 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Recycling.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Recycling.java @@ -3,6 +3,15 @@ package gtPlusPlus.xmod.gregtech.loaders; import static gregtech.api.enums.GT_Values.L; import static gregtech.api.enums.GT_Values.M; +import java.util.ArrayList; +import java.util.Map; + +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraftforge.oredict.OreDictionary; + +import org.apache.commons.lang3.reflect.FieldUtils; + import gregtech.api.enums.Materials; import gregtech.api.enums.OrePrefixes; import gregtech.api.util.GT_ModHandler; @@ -17,12 +26,6 @@ import gtPlusPlus.core.material.state.MaterialState; import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.minecraft.ItemUtils; import gtPlusPlus.core.util.reflect.ReflectionUtils; -import java.util.ArrayList; -import java.util.Map; -import net.minecraft.init.Items; -import net.minecraft.item.ItemStack; -import net.minecraftforge.oredict.OreDictionary; -import org.apache.commons.lang3.reflect.FieldUtils; public class RecipeGen_Recycling implements Runnable { @@ -58,53 +61,24 @@ public class RecipeGen_Recycling implements Runnable { if (material != null) Logger.WARNING("Generating Recycling recipes for " + material.getLocalizedName()); - final OrePrefixes[] mValidPrefixesAsString = { - OrePrefixes.ingot, - OrePrefixes.ingotHot, - OrePrefixes.nugget, - OrePrefixes.plate, - OrePrefixes.plateDense, - OrePrefixes.plateDouble, - OrePrefixes.plateTriple, - OrePrefixes.plateQuadruple, - OrePrefixes.plateQuintuple, - OrePrefixes.stick, - OrePrefixes.stickLong, - OrePrefixes.bolt, - OrePrefixes.screw, - OrePrefixes.ring, - OrePrefixes.rotor, - OrePrefixes.gearGt, - OrePrefixes.gearGtSmall, - OrePrefixes.gear, - OrePrefixes.block, - OrePrefixes.cableGt01, - OrePrefixes.cableGt02, - OrePrefixes.cableGt04, - OrePrefixes.cableGt08, - OrePrefixes.cableGt12, - OrePrefixes.wireFine, - OrePrefixes.wireGt01, - OrePrefixes.wireGt02, - OrePrefixes.wireGt04, - OrePrefixes.wireGt08, - OrePrefixes.wireGt12, - OrePrefixes.wireGt16, - OrePrefixes.foil, - OrePrefixes.frameGt, - OrePrefixes.pipeHuge, - OrePrefixes.pipeLarge, - OrePrefixes.pipeMedium, - OrePrefixes.pipeSmall, - OrePrefixes.pipeTiny, - }; + final OrePrefixes[] mValidPrefixesAsString = { OrePrefixes.ingot, OrePrefixes.ingotHot, OrePrefixes.nugget, + OrePrefixes.plate, OrePrefixes.plateDense, OrePrefixes.plateDouble, OrePrefixes.plateTriple, + OrePrefixes.plateQuadruple, OrePrefixes.plateQuintuple, OrePrefixes.stick, OrePrefixes.stickLong, + OrePrefixes.bolt, OrePrefixes.screw, OrePrefixes.ring, OrePrefixes.rotor, OrePrefixes.gearGt, + OrePrefixes.gearGtSmall, OrePrefixes.gear, OrePrefixes.block, OrePrefixes.cableGt01, + OrePrefixes.cableGt02, OrePrefixes.cableGt04, OrePrefixes.cableGt08, OrePrefixes.cableGt12, + OrePrefixes.wireFine, OrePrefixes.wireGt01, OrePrefixes.wireGt02, OrePrefixes.wireGt04, + OrePrefixes.wireGt08, OrePrefixes.wireGt12, OrePrefixes.wireGt16, OrePrefixes.foil, OrePrefixes.frameGt, + OrePrefixes.pipeHuge, OrePrefixes.pipeLarge, OrePrefixes.pipeMedium, OrePrefixes.pipeSmall, + OrePrefixes.pipeTiny, }; int mSlotIndex = 0; Pair<OrePrefixes, ItemStack>[] mValidPairs = new Pair[mValidPrefixesAsString.length]; for (int r = 0; r < mValidPairs.length; r++) { ItemStack temp = getItemStackOfAmountFromOreDictNoBroken( - mValidPrefixesAsString[r].name() + Utils.sanitizeString(material.getLocalizedName()), 1); + mValidPrefixesAsString[r].name() + Utils.sanitizeString(material.getLocalizedName()), + 1); if (temp != null) { mValidPairs[mSlotIndex++] = new Pair<OrePrefixes, ItemStack>(mValidPrefixesAsString[r], temp.copy()); } @@ -135,8 +109,7 @@ public class RecipeGen_Recycling implements Runnable { for (final Pair<OrePrefixes, ItemStack> validPrefix : mValidPairs) { try { - if (material == null - || validPrefix == null + if (material == null || validPrefix == null || (material.getState() != MaterialState.SOLID && material.getState() != MaterialState.LIQUID) || validPrefix.getKey() == OrePrefixes.ingotHot) { @@ -146,15 +119,19 @@ public class RecipeGen_Recycling implements Runnable { final ItemStack tempStack = validPrefix.getValue(); final ItemStack mDust = getDust(material, validPrefix.getKey()); final Pair<OrePrefixes, ItemStack> mData = getDustData(material, validPrefix.getKey()); - int mFluidAmount = - (int) GT_Utility.translateMaterialToFluidAmount(validPrefix.getKey().mMaterialAmount, true); + int mFluidAmount = (int) GT_Utility + .translateMaterialToFluidAmount(validPrefix.getKey().mMaterialAmount, true); // Maceration if (ItemUtils.checkForInvalidItems(tempStack)) { // mValidItems[mSlotIndex++] = tempStack; if ((mDust != null) && GT_ModHandler.addPulverisationRecipe(tempStack, mDust)) { - Logger.WARNING("Recycle Recipe: " + material.getLocalizedName() + " - Success - Recycle " - + tempStack.getDisplayName() + " and obtain " + mDust.getDisplayName()); + Logger.WARNING( + "Recycle Recipe: " + material.getLocalizedName() + + " - Success - Recycle " + + tempStack.getDisplayName() + + " and obtain " + + mDust.getDisplayName()); } else { Logger.WARNING("Recycle Recipe: " + material.getLocalizedName() + " - Failed"); if (mDust == null) { @@ -170,20 +147,31 @@ public class RecipeGen_Recycling implements Runnable { if (ItemUtils.checkForInvalidItems(tempStack)) { // mValidItems[mSlotIndex++] = tempStack; - int aFluidAmount = - (int) ((L * validPrefix.getKey().mMaterialAmount) / (M * tempStack.stackSize)); + int aFluidAmount = (int) ((L * validPrefix.getKey().mMaterialAmount) + / (M * tempStack.stackSize)); int aDuration = (int) Math.max(1, (24 * validPrefix.getKey().mMaterialAmount) / M); boolean aGenFluidExtraction = CORE.RA.addFluidExtractionRecipe( tempStack, material.getFluidStack(aFluidAmount), aDuration, material.vVoltageMultiplier); - if (aGenFluidExtraction /*(mDust != null) && CORE.RA.addFluidExtractionRecipe(tempStack, material.getFluidStack(mFluidAmount), 30, material.vVoltageMultiplier)*/) { + if (aGenFluidExtraction /* + * (mDust != null) && CORE.RA.addFluidExtractionRecipe(tempStack, + * material.getFluidStack(mFluidAmount), 30, + * material.vVoltageMultiplier) + */) { Logger.WARNING( - "Fluid Recycle Recipe: " + material.getLocalizedName() + " - Success - Recycle " - + tempStack.getDisplayName() + " and obtain " + aFluidAmount + "mb of " - + material.getFluidStack(1).getLocalizedName() + ". Time: " + aDuration - + ", Voltage: " + material.vVoltageMultiplier); + "Fluid Recycle Recipe: " + material.getLocalizedName() + + " - Success - Recycle " + + tempStack.getDisplayName() + + " and obtain " + + aFluidAmount + + "mb of " + + material.getFluidStack(1).getLocalizedName() + + ". Time: " + + aDuration + + ", Voltage: " + + material.vVoltageMultiplier); } else { Logger.WARNING("Fluid Recycle Recipe: " + material.getLocalizedName() + " - Failed"); if (mDust == null) { @@ -275,8 +263,8 @@ public class RecipeGen_Recycling implements Runnable { return get(aPrefix, aMaterial, null, aAmount); } - public static ItemStack get( - final OrePrefixes aPrefix, final Material aMaterial, final ItemStack aReplacement, final long aAmount) { + public static ItemStack get(final OrePrefixes aPrefix, final Material aMaterial, final ItemStack aReplacement, + final long aAmount) { return get( aPrefix.name() + Utils.sanitizeString(aMaterial.getLocalizedName()), aReplacement, @@ -285,12 +273,8 @@ public class RecipeGen_Recycling implements Runnable { true); } - public static ItemStack get( - final Object aName, - final ItemStack aReplacement, - final long aAmount, - final boolean aMentionPossibleTypos, - final boolean aNoInvalidAmounts) { + public static ItemStack get(final Object aName, final ItemStack aReplacement, final long aAmount, + final boolean aMentionPossibleTypos, final boolean aNoInvalidAmounts) { if (aNoInvalidAmounts && (aAmount < 1L)) { Logger.WARNING("Returning Null. Method: " + ReflectionUtils.getMethodName(0)); Logger.WARNING("Called from method: " + ReflectionUtils.getMethodName(1)); @@ -303,7 +287,8 @@ public class RecipeGen_Recycling implements Runnable { Logger.WARNING("Unknown Key for Unification, Typo? " + aName); } return GT_Utility.copyAmount( - aAmount, new Object[] {mNameMap.get(aName.toString()), getFirstOre(aName, aAmount), aReplacement}); + aAmount, + new Object[] { mNameMap.get(aName.toString()), getFirstOre(aName, aAmount), aReplacement }); } public static ItemStack getFirstOre(final Object aName, final long aAmount) { @@ -318,7 +303,7 @@ public class RecipeGen_Recycling implements Runnable { final ItemStack tStack = mNameMap.get(aName.toString()); if (GT_Utility.isStackValid(tStack)) { Logger.WARNING("Found valid stack."); - return GT_Utility.copyAmount(aAmount, new Object[] {tStack}); + return GT_Utility.copyAmount(aAmount, new Object[] { tStack }); } return GT_Utility.copyAmount(aAmount, getOres(aName).toArray()); } @@ -342,8 +327,8 @@ public class RecipeGen_Recycling implements Runnable { public Map<String, ItemStack> getNameMap() { Map<String, ItemStack> tempMap; try { - tempMap = (Map<String, ItemStack>) - FieldUtils.readStaticField(GT_OreDictUnificator.class, "sName2StackMap", true); + tempMap = (Map<String, ItemStack>) FieldUtils + .readStaticField(GT_OreDictUnificator.class, "sName2StackMap", true); if (tempMap != null) { Logger.WARNING("Found 'sName2StackMap' in GT_OreDictUnificator.class."); return tempMap; @@ -360,7 +345,7 @@ public class RecipeGen_Recycling implements Runnable { try { if (oredictName.contains("-") || oredictName.contains("_")) { - oredictName = Utils.sanitizeString(oredictName, new char[] {'-', '_'}); + oredictName = Utils.sanitizeString(oredictName, new char[] { '-', '_' }); } else { oredictName = Utils.sanitizeString(oredictName); } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_ShapedCrafting.java b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_ShapedCrafting.java index 178e84935d..8bc90b6ba0 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_ShapedCrafting.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_ShapedCrafting.java @@ -1,5 +1,8 @@ package gtPlusPlus.xmod.gregtech.loaders; +import java.util.HashSet; +import java.util.Set; + import gregtech.api.util.GT_ModHandler; import gtPlusPlus.api.interfaces.RunnableWithInfo; import gtPlusPlus.api.objects.Logger; @@ -8,8 +11,6 @@ import gtPlusPlus.core.material.Material; import gtPlusPlus.core.material.MaterialGenerator; import gtPlusPlus.core.util.minecraft.ItemUtils; import gtPlusPlus.core.util.minecraft.RecipeUtils; -import java.util.HashSet; -import java.util.Set; public class RecipeGen_ShapedCrafting extends RecipeGen_Base { @@ -36,17 +37,11 @@ public class RecipeGen_ShapedCrafting extends RecipeGen_Base { // Nuggets if (ItemUtils.checkForInvalidItems(material.getNugget(1)) && ItemUtils.checkForInvalidItems(material.getIngot(1))) - GT_ModHandler.addShapelessCraftingRecipe(material.getIngot(1), new Object[] { - material.getNugget(1), - material.getNugget(1), - material.getNugget(1), - material.getNugget(1), - material.getNugget(1), - material.getNugget(1), - material.getNugget(1), - material.getNugget(1), - material.getNugget(1) - }); + GT_ModHandler.addShapelessCraftingRecipe( + material.getIngot(1), + new Object[] { material.getNugget(1), material.getNugget(1), material.getNugget(1), + material.getNugget(1), material.getNugget(1), material.getNugget(1), + material.getNugget(1), material.getNugget(1), material.getNugget(1) }); } // Plates @@ -54,26 +49,19 @@ public class RecipeGen_ShapedCrafting extends RecipeGen_Base { // Single Plate Shaped/Shapeless if (ItemUtils.checkForInvalidItems(material.getPlate(1)) && ItemUtils.checkForInvalidItems(material.getIngot(1))) - if (material.getPlate(1) != null && material.getIngot(1) != null) - GT_ModHandler.addCraftingRecipe( - material.getPlate(1), - gregtech.api.util.GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS - | gregtech.api.util.GT_ModHandler.RecipeBits.BUFFERED, - new Object[] { - "h", - "B", - "I", - Character.valueOf('I'), - material.getIngot(1), - Character.valueOf('B'), - material.getIngot(1) - }); + if (material.getPlate(1) != null && material.getIngot(1) != null) GT_ModHandler.addCraftingRecipe( + material.getPlate(1), + gregtech.api.util.GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS + | gregtech.api.util.GT_ModHandler.RecipeBits.BUFFERED, + new Object[] { "h", "B", "I", Character.valueOf('I'), material.getIngot(1), Character.valueOf('B'), + material.getIngot(1) }); if (ItemUtils.checkForInvalidItems(material.getPlate(1)) && ItemUtils.checkForInvalidItems(material.getIngot(1))) - GT_ModHandler.addShapelessCraftingRecipe(material.getPlate(1), new Object[] { - gregtech.api.enums.ToolDictNames.craftingToolForgeHammer, material.getIngot(1), material.getIngot(1) - }); + GT_ModHandler.addShapelessCraftingRecipe( + material.getPlate(1), + new Object[] { gregtech.api.enums.ToolDictNames.craftingToolForgeHammer, material.getIngot(1), + material.getIngot(1) }); // Double Plate Shaped/Shapeless if (ItemUtils.checkForInvalidItems(material.getPlateDouble(1)) @@ -82,32 +70,25 @@ public class RecipeGen_ShapedCrafting extends RecipeGen_Base { material.getPlateDouble(1), gregtech.api.util.GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | gregtech.api.util.GT_ModHandler.RecipeBits.BUFFERED, - new Object[] { - "I", - "B", - "h", - Character.valueOf('I'), - material.getPlate(1), - Character.valueOf('B'), - material.getPlate(1) - }); + new Object[] { "I", "B", "h", Character.valueOf('I'), material.getPlate(1), Character.valueOf('B'), + material.getPlate(1) }); if (ItemUtils.checkForInvalidItems(material.getPlateDouble(1)) && ItemUtils.checkForInvalidItems(material.getPlate(1))) - GT_ModHandler.addShapelessCraftingRecipe(material.getPlateDouble(1), new Object[] { - gregtech.api.enums.ToolDictNames.craftingToolForgeHammer, material.getPlate(1), material.getPlate(1) - }); + GT_ModHandler.addShapelessCraftingRecipe( + material.getPlateDouble(1), + new Object[] { gregtech.api.enums.ToolDictNames.craftingToolForgeHammer, material.getPlate(1), + material.getPlate(1) }); // Ring Recipe - if (!material.isRadioactive - && ItemUtils.checkForInvalidItems(material.getRing(1)) + if (!material.isRadioactive && ItemUtils.checkForInvalidItems(material.getRing(1)) && ItemUtils.checkForInvalidItems(material.getRod(1))) { if (CORE.GTNH) { if (GT_ModHandler.addCraftingRecipe( material.getRing(1), gregtech.api.util.GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | gregtech.api.util.GT_ModHandler.RecipeBits.BUFFERED, - new Object[] {"h ", "fR", 'R', material.getRod(1)})) { + new Object[] { "h ", "fR", 'R', material.getRod(1) })) { Logger.WARNING("GT:NH Ring Recipe: " + material.getLocalizedName() + " - Success"); } else { Logger.WARNING("GT:NH Ring Recipe: " + material.getLocalizedName() + " - Failed"); @@ -132,14 +113,13 @@ public class RecipeGen_ShapedCrafting extends RecipeGen_Base { } // Framebox Recipe - if (!material.isRadioactive - && ItemUtils.checkForInvalidItems(material.getFrameBox(1)) + if (!material.isRadioactive && ItemUtils.checkForInvalidItems(material.getFrameBox(1)) && ItemUtils.checkForInvalidItems(material.getRod(1))) { if (GT_ModHandler.addCraftingRecipe( material.getFrameBox(2), gregtech.api.util.GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | gregtech.api.util.GT_ModHandler.RecipeBits.BUFFERED, - new Object[] {"RRR", "RwR", "RRR", 'R', material.getRod(1)})) { + new Object[] { "RRR", "RwR", "RRR", 'R', material.getRod(1) })) { Logger.WARNING("Framebox Recipe: " + material.getLocalizedName() + " - Success"); } else { Logger.WARNING("Framebox Recipe: " + material.getLocalizedName() + " - Failed"); @@ -147,14 +127,13 @@ public class RecipeGen_ShapedCrafting extends RecipeGen_Base { } // Shaped Recipe - Bolts - if (!material.isRadioactive - && ItemUtils.checkForInvalidItems(material.getBolt(1)) + if (!material.isRadioactive && ItemUtils.checkForInvalidItems(material.getBolt(1)) && ItemUtils.checkForInvalidItems(material.getRod(1))) { if (GT_ModHandler.addCraftingRecipe( material.getBolt(2), gregtech.api.util.GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | gregtech.api.util.GT_ModHandler.RecipeBits.BUFFERED, - new Object[] {"s ", " R", 'R', material.getRod(1)})) { + new Object[] { "s ", " R", 'R', material.getRod(1) })) { Logger.WARNING("Bolt Recipe: " + material.getLocalizedName() + " - Success"); } else { Logger.WARNING("Bolt Recipe: " + material.getLocalizedName() + " - Failed"); @@ -162,14 +141,13 @@ public class RecipeGen_ShapedCrafting extends RecipeGen_Base { } // Shaped Recipe - Fine Wire - if (!material.isRadioactive - && ItemUtils.checkForInvalidItems(material.getFoil(1)) + if (!material.isRadioactive && ItemUtils.checkForInvalidItems(material.getFoil(1)) && ItemUtils.checkForInvalidItems(material.getFineWire(1))) { if (GT_ModHandler.addCraftingRecipe( material.getFineWire(1), gregtech.api.util.GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | gregtech.api.util.GT_ModHandler.RecipeBits.BUFFERED, - new Object[] {"Fx", 'F', material.getFoil(1)})) { + new Object[] { "Fx", 'F', material.getFoil(1) })) { Logger.WARNING("Fine Wire Recipe: " + material.getLocalizedName() + " - Success"); } else { Logger.WARNING("Fine Wire Recipe: " + material.getLocalizedName() + " - Failed"); @@ -183,7 +161,7 @@ public class RecipeGen_ShapedCrafting extends RecipeGen_Base { material.getFoil(2), gregtech.api.util.GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | gregtech.api.util.GT_ModHandler.RecipeBits.BUFFERED, - new Object[] {"hP", 'P', material.getPlate(1)})) { + new Object[] { "hP", 'P', material.getPlate(1) })) { Logger.WARNING("Foil Recipe: " + material.getLocalizedName() + " - Success"); } else { Logger.WARNING("Foil Recipe: " + material.getLocalizedName() + " - Failed"); @@ -196,11 +174,11 @@ public class RecipeGen_ShapedCrafting extends RecipeGen_Base { material.getRod(1), gregtech.api.util.GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | gregtech.api.util.GT_ModHandler.RecipeBits.BUFFERED, - new Object[] {"f ", " I", 'I', material.getIngot(1)})) { - Logger.WARNING("Rod Recipe: " + material.getLocalizedName() + " - Success"); - } else { - Logger.WARNING("Rod Recipe: " + material.getLocalizedName() + " - Failed"); - } + new Object[] { "f ", " I", 'I', material.getIngot(1) })) { + Logger.WARNING("Rod Recipe: " + material.getLocalizedName() + " - Success"); + } else { + Logger.WARNING("Rod Recipe: " + material.getLocalizedName() + " - Failed"); + } // Shaped Recipe - Long Rod to two smalls if (ItemUtils.checkForInvalidItems(material.getRod(1)) @@ -209,11 +187,11 @@ public class RecipeGen_ShapedCrafting extends RecipeGen_Base { material.getRod(2), gregtech.api.util.GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | gregtech.api.util.GT_ModHandler.RecipeBits.BUFFERED, - new Object[] {"s", "L", 'L', material.getLongRod(1)})) { - Logger.WARNING("Rod Recipe: " + material.getLocalizedName() + " - Success"); - } else { - Logger.WARNING("Rod Recipe: " + material.getLocalizedName() + " - Failed"); - } + new Object[] { "s", "L", 'L', material.getLongRod(1) })) { + Logger.WARNING("Rod Recipe: " + material.getLocalizedName() + " - Success"); + } else { + Logger.WARNING("Rod Recipe: " + material.getLocalizedName() + " - Failed"); + } // Two small to long rod if (ItemUtils.checkForInvalidItems(material.getLongRod(1)) @@ -222,15 +200,14 @@ public class RecipeGen_ShapedCrafting extends RecipeGen_Base { material.getLongRod(1), gregtech.api.util.GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | gregtech.api.util.GT_ModHandler.RecipeBits.BUFFERED, - new Object[] {"RhR", 'R', material.getRod(1)})) { - Logger.WARNING("Long Rod Recipe: " + material.getLocalizedName() + " - Success"); - } else { - Logger.WARNING("Long Rod Recipe: " + material.getLocalizedName() + " - Failed"); - } + new Object[] { "RhR", 'R', material.getRod(1) })) { + Logger.WARNING("Long Rod Recipe: " + material.getLocalizedName() + " - Success"); + } else { + Logger.WARNING("Long Rod Recipe: " + material.getLocalizedName() + " - Failed"); + } // Rotor Recipe - if (!material.isRadioactive - && ItemUtils.checkForInvalidItems(material.getRotor(1)) + if (!material.isRadioactive && ItemUtils.checkForInvalidItems(material.getRotor(1)) && ItemUtils.checkForInvalidItems(material.getRing(1)) && !material.isRadioactive && ItemUtils.checkForInvalidItems(material.getPlate(1)) @@ -239,17 +216,8 @@ public class RecipeGen_ShapedCrafting extends RecipeGen_Base { material.getRotor(1), gregtech.api.util.GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | gregtech.api.util.GT_ModHandler.RecipeBits.BUFFERED, - new Object[] { - "PhP", - "SRf", - "PdP", - 'P', - material.getPlate(1), - 'S', - material.getScrew(1), - 'R', - material.getRing(1), - })) { + new Object[] { "PhP", "SRf", "PdP", 'P', material.getPlate(1), 'S', material.getScrew(1), 'R', + material.getRing(1), })) { Logger.WARNING("Rotor Recipe: " + material.getLocalizedName() + " - Success"); } else { Logger.WARNING("Rotor Recipe: " + material.getLocalizedName() + " - Failed"); @@ -257,17 +225,14 @@ public class RecipeGen_ShapedCrafting extends RecipeGen_Base { } // Gear Recipe - if (!material.isRadioactive - && ItemUtils.checkForInvalidItems(material.getGear(1)) + if (!material.isRadioactive && ItemUtils.checkForInvalidItems(material.getGear(1)) && ItemUtils.checkForInvalidItems(material.getPlate(1)) && ItemUtils.checkForInvalidItems(material.getRod(1))) { if (GT_ModHandler.addCraftingRecipe( material.getGear(1), gregtech.api.util.GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | gregtech.api.util.GT_ModHandler.RecipeBits.BUFFERED, - new Object[] { - "RPR", "PwP", "RPR", 'P', material.getPlate(1), 'R', material.getRod(1), - })) { + new Object[] { "RPR", "PwP", "RPR", 'P', material.getPlate(1), 'R', material.getRod(1), })) { Logger.WARNING("Gear Recipe: " + material.getLocalizedName() + " - Success"); } else { Logger.WARNING("Gear Recipe: " + material.getLocalizedName() + " - Failed"); @@ -275,16 +240,13 @@ public class RecipeGen_ShapedCrafting extends RecipeGen_Base { } // Screws - if (!material.isRadioactive - && ItemUtils.checkForInvalidItems(material.getScrew(1)) + if (!material.isRadioactive && ItemUtils.checkForInvalidItems(material.getScrew(1)) && ItemUtils.checkForInvalidItems(material.getBolt(1))) { if (GT_ModHandler.addCraftingRecipe( material.getScrew(1), gregtech.api.util.GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | gregtech.api.util.GT_ModHandler.RecipeBits.BUFFERED, - new Object[] { - "fB", "B ", 'B', material.getBolt(1), - })) { + new Object[] { "fB", "B ", 'B', material.getBolt(1), })) { Logger.WARNING("Screw Recipe: " + material.getLocalizedName() + " - Success"); } else { Logger.WARNING("Screw Recipe: " + material.getLocalizedName() + " - Failed"); diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/misc/AddCustomMachineToPA.java b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/misc/AddCustomMachineToPA.java index 5a8306abee..c89648e25f 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/misc/AddCustomMachineToPA.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/misc/AddCustomMachineToPA.java @@ -4,10 +4,11 @@ import gregtech.api.util.GTPP_Recipe; import gregtech.api.util.GT_ProcessingArray_Manager; public class AddCustomMachineToPA { + public static void register() { // Simple Washers - GT_ProcessingArray_Manager.addRecipeMapToPA( - "simplewasher.01", GTPP_Recipe.GTPP_Recipe_Map.sSimpleWasherRecipes); + GT_ProcessingArray_Manager + .addRecipeMapToPA("simplewasher.01", GTPP_Recipe.GTPP_Recipe_Map.sSimpleWasherRecipes); } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/misc/AssLineAchievements.java b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/misc/AssLineAchievements.java index 01683e8067..be7023433e 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/misc/AssLineAchievements.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/misc/AssLineAchievements.java @@ -1,5 +1,15 @@ package gtPlusPlus.xmod.gregtech.loaders.misc; +import java.util.concurrent.ConcurrentHashMap; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.stats.Achievement; +import net.minecraft.stats.AchievementList; +import net.minecraft.stats.StatBase; +import net.minecraftforge.common.AchievementPage; +import net.minecraftforge.event.entity.player.EntityItemPickupEvent; + import cpw.mods.fml.common.eventhandler.SubscribeEvent; import gregtech.GT_Mod; import gregtech.api.util.GT_Log; @@ -9,14 +19,6 @@ import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.minecraft.ItemUtils; import gtPlusPlus.xmod.gregtech.common.StaticFields59; -import java.util.concurrent.ConcurrentHashMap; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.stats.Achievement; -import net.minecraft.stats.AchievementList; -import net.minecraft.stats.StatBase; -import net.minecraftforge.common.AchievementPage; -import net.minecraftforge.event.entity.player.EntityItemPickupEvent; public class AssLineAchievements { @@ -41,8 +43,8 @@ public class AssLineAchievements { if (!ready) { active = GT_Mod.gregtechproxy.mAchievements; try { - recipeTotal = - ((GT_Recipe.GT_Recipe_Map) StaticFields59.mAssLineVisualMapNEI.get(null)).mRecipeList.size(); + recipeTotal = ((GT_Recipe.GT_Recipe_Map) StaticFields59.mAssLineVisualMapNEI.get(null)).mRecipeList + .size(); } catch (IllegalArgumentException | IllegalAccessException e) { recipeTotal = 0; } @@ -54,8 +56,10 @@ public class AssLineAchievements { public static void registerAchievements() { if (active && mAchievementMap.size() > 0) { - AchievementPage.registerAchievementPage(new AchievementPage("GT Assembly Line", (Achievement[]) - mAchievementMap.values().toArray(new Achievement[mAchievementMap.size()]))); + AchievementPage.registerAchievementPage( + new AchievementPage( + "GT Assembly Line", + (Achievement[]) mAchievementMap.values().toArray(new Achievement[mAchievementMap.size()]))); } else if (active) { Logger.INFO("Unable to register custom achievement page for Assembly Line recipes."); } @@ -104,8 +108,8 @@ public class AssLineAchievements { return aYouDidSomethingInGT; } - public static Achievement registerAchievement( - String textId, int x, int y, ItemStack icon, Achievement requirement, boolean special) { + public static Achievement registerAchievement(String textId, int x, int y, ItemStack icon, Achievement requirement, + boolean special) { if (!GT_Mod.gregtechproxy.mAchievements) { return null; } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_AlgaeFarm.java b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_AlgaeFarm.java index 3fec531a12..379d8acda0 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_AlgaeFarm.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_AlgaeFarm.java @@ -1,5 +1,10 @@ package gtPlusPlus.xmod.gregtech.loaders.recipe; +import java.util.HashMap; + +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidStack; + import gregtech.api.enums.GT_Values; import gregtech.api.util.GTPP_Recipe; import gregtech.api.util.GT_Recipe; @@ -9,15 +14,11 @@ import gtPlusPlus.api.objects.data.WeightedCollection; import gtPlusPlus.core.item.chemistry.AgriculturalChem; import gtPlusPlus.core.util.math.MathUtils; import gtPlusPlus.core.util.minecraft.ItemUtils; -import java.util.HashMap; -import net.minecraft.item.ItemStack; -import net.minecraftforge.fluids.FluidStack; public class RecipeLoader_AlgaeFarm { private static final HashMap<Integer, AutoMap<GT_Recipe>> mRecipeCache = new HashMap<Integer, AutoMap<GT_Recipe>>(); - private static final HashMap<Integer, AutoMap<GT_Recipe>> mRecipeCompostCache = - new HashMap<Integer, AutoMap<GT_Recipe>>(); + private static final HashMap<Integer, AutoMap<GT_Recipe>> mRecipeCompostCache = new HashMap<Integer, AutoMap<GT_Recipe>>(); public static void generateRecipes() { for (int i = 0; i < 10; i++) { @@ -70,7 +71,8 @@ public class RecipeLoader_AlgaeFarm { aOutputTimeMulti.put(i, aValue); } - final int[] aDurations = new int[] {2000, 1800, 1600, 1400, 1200, 1000, 512, 256, 128, 64, 32, 16, 8, 4, 2, 1}; + final int[] aDurations = new int[] { 2000, 1800, 1600, 1400, 1200, 1000, 512, 256, 128, 64, 32, 16, 8, 4, 2, + 1 }; ItemStack[] aInputs = new ItemStack[] {}; @@ -78,8 +80,9 @@ public class RecipeLoader_AlgaeFarm { // Make it use 4 compost per tier if we have some available // Compost consumption maxes out at 1 stack per cycle ItemStack aCompost = ItemUtils.getSimpleStack( - AgriculturalChem.mCompost, aTier > 1 ? (int) Math.min(64, Math.pow(2, aTier - 1)) : 1); - aInputs = new ItemStack[] {aCompost}; + AgriculturalChem.mCompost, + aTier > 1 ? (int) Math.min(64, Math.pow(2, aTier - 1)) : 1); + aInputs = new ItemStack[] { aCompost }; // Boost Tier by one if using compost so it gets a speed boost aTier++; } @@ -93,8 +96,8 @@ public class RecipeLoader_AlgaeFarm { aOutputs, (Object) null, new int[] {}, - new FluidStack[] {GT_Values.NF}, - new FluidStack[] {GT_Values.NF}, + new FluidStack[] { GT_Values.NF }, + new FluidStack[] { GT_Values.NF }, (int) (aDurations[aTier] * aOutputTimeMulti.get() / 2), // Time 0, 0); diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_ChemicalSkips.java b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_ChemicalSkips.java index c00b9b08e2..d92b117b65 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_ChemicalSkips.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_ChemicalSkips.java @@ -1,9 +1,13 @@ package gtPlusPlus.xmod.gregtech.loaders.recipe; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidStack; + import com.dreammaster.gthandler.GT_CoreModSupport; import com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader; import com.github.technus.tectech.recipe.TT_recipeAdder; import com.github.technus.tectech.thing.block.QuantumGlassBlock; + import gregtech.api.enums.*; import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_OreDictUnificator; @@ -19,8 +23,6 @@ import gtPlusPlus.core.recipe.common.CI; import gtPlusPlus.core.util.minecraft.FluidUtils; import gtPlusPlus.core.util.minecraft.ItemUtils; import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; -import net.minecraft.item.ItemStack; -import net.minecraftforge.fluids.FluidStack; public class RecipeLoader_ChemicalSkips { @@ -48,247 +50,175 @@ public class RecipeLoader_ChemicalSkips { ItemStack biocells = GT_Utility.copyAmountUnsafe(64 * 32, ItemList.Circuit_Chip_Biocell.get(1)); // Platline CORE.RA.addQuantumTransformerRecipe( - new ItemStack[] { - WerkstoffLoader.PTMetallicPowder.get(OrePrefixes.dust, 32), - ItemUtils.getSimpleStack(GenericChem.mPlatinumGroupCatalyst, 0) - }, + new ItemStack[] { WerkstoffLoader.PTMetallicPowder.get(OrePrefixes.dust, 32), + ItemUtils.getSimpleStack(GenericChem.mPlatinumGroupCatalyst, 0) }, new FluidStack[] {}, new FluidStack[] {}, - new ItemStack[] { - Materials.Platinum.getDust(64), - Materials.Palladium.getDust(64), - Materials.Iridium.getDust(64), - Materials.Osmium.getDust(64), - WerkstoffLoader.Rhodium.get(OrePrefixes.dust, 64), - WerkstoffLoader.Ruthenium.get(OrePrefixes.dust, 64) - }, - new int[] {1667, 1667, 1667, 1667, 1667, 1667}, + new ItemStack[] { Materials.Platinum.getDust(64), Materials.Palladium.getDust(64), + Materials.Iridium.getDust(64), Materials.Osmium.getDust(64), + WerkstoffLoader.Rhodium.get(OrePrefixes.dust, 64), + WerkstoffLoader.Ruthenium.get(OrePrefixes.dust, 64) }, + new int[] { 1667, 1667, 1667, 1667, 1667, 1667 }, 20 * 20, (int) GT_Values.VP[8], 1); // Early Plastics CORE.RA.addQuantumTransformerRecipe( - new ItemStack[] { - Materials.Carbon.getDust(64), ItemUtils.getSimpleStack(GenericChem.mPlasticPolymerCatalyst, 0) - }, - new FluidStack[] { - Materials.Oxygen.getGas(1000 * 16), - Materials.Hydrogen.getGas(1000 * 16), - Materials.Chlorine.getGas(1000 * 16), - Materials.Fluorine.getGas(1000 * 16) - }, - new FluidStack[] { - Materials.Plastic.getMolten(144 * 256), - Materials.PolyvinylChloride.getMolten(144 * 128), - Materials.Polystyrene.getMolten(144 * 64), - Materials.Polytetrafluoroethylene.getMolten(144 * 128), - Materials.Epoxid.getMolten(144 * 64), - Materials.Polybenzimidazole.getMolten(144 * 64) - }, + new ItemStack[] { Materials.Carbon.getDust(64), + ItemUtils.getSimpleStack(GenericChem.mPlasticPolymerCatalyst, 0) }, + new FluidStack[] { Materials.Oxygen.getGas(1000 * 16), Materials.Hydrogen.getGas(1000 * 16), + Materials.Chlorine.getGas(1000 * 16), Materials.Fluorine.getGas(1000 * 16) }, + new FluidStack[] { Materials.Plastic.getMolten(144 * 256), + Materials.PolyvinylChloride.getMolten(144 * 128), Materials.Polystyrene.getMolten(144 * 64), + Materials.Polytetrafluoroethylene.getMolten(144 * 128), Materials.Epoxid.getMolten(144 * 64), + Materials.Polybenzimidazole.getMolten(144 * 64) }, null, - new int[] {2000, 2000, 2000, 2000, 2000, 2000}, + new int[] { 2000, 2000, 2000, 2000, 2000, 2000 }, 20 * 20, (int) GT_Values.VP[7], 1); // Early Rubbers/Cable Materials CORE.RA.addQuantumTransformerRecipe( - new ItemStack[] { - Materials.Carbon.getDust(64), ItemUtils.getSimpleStack(GenericChem.mRubberPolymerCatalyst, 0) - }, - new FluidStack[] { - Materials.Oxygen.getGas(1000 * 16), - Materials.Hydrogen.getGas(1000 * 16), - Materials.Chlorine.getGas(1000 * 16) - }, - new FluidStack[] { - Materials.Silicone.getMolten(144 * 64), - Materials.StyreneButadieneRubber.getMolten(144 * 64), - Materials.PolyphenyleneSulfide.getMolten(144 * 128), - Materials.Rubber.getMolten(144 * 256) - }, + new ItemStack[] { Materials.Carbon.getDust(64), + ItemUtils.getSimpleStack(GenericChem.mRubberPolymerCatalyst, 0) }, + new FluidStack[] { Materials.Oxygen.getGas(1000 * 16), Materials.Hydrogen.getGas(1000 * 16), + Materials.Chlorine.getGas(1000 * 16) }, + new FluidStack[] { Materials.Silicone.getMolten(144 * 64), + Materials.StyreneButadieneRubber.getMolten(144 * 64), + Materials.PolyphenyleneSulfide.getMolten(144 * 128), Materials.Rubber.getMolten(144 * 256) }, null, - new int[] {2500, 2500, 2500, 2500}, + new int[] { 2500, 2500, 2500, 2500 }, 20 * 20, (int) GT_Values.VP[7], 1); // Glues and Solders CORE.RA.addQuantumTransformerRecipe( - new ItemStack[] { - Materials.Carbon.getDust(32), - Materials.Bismuth.getDust(32), - ItemUtils.getSimpleStack(GenericChem.mAdhesionPromoterCatalyst, 0) - }, - new FluidStack[] {Materials.Oxygen.getFluid(10000), Materials.Hydrogen.getFluid(10000)}, - new FluidStack[] { - MISC_MATERIALS.ETHYL_CYANOACRYLATE.getFluidStack(1000 * 32), - Materials.AdvancedGlue.getFluid(1000 * 16), - ALLOY.INDALLOY_140.getFluidStack(144 * 64), - Materials.SolderingAlloy.getMolten(144 * 128) - }, - new ItemStack[] {ItemList.StableAdhesive.get(1)}, - new int[] {2000, 2000, 2000, 2000, 2000}, + new ItemStack[] { Materials.Carbon.getDust(32), Materials.Bismuth.getDust(32), + ItemUtils.getSimpleStack(GenericChem.mAdhesionPromoterCatalyst, 0) }, + new FluidStack[] { Materials.Oxygen.getFluid(10000), Materials.Hydrogen.getFluid(10000) }, + new FluidStack[] { MISC_MATERIALS.ETHYL_CYANOACRYLATE.getFluidStack(1000 * 32), + Materials.AdvancedGlue.getFluid(1000 * 16), ALLOY.INDALLOY_140.getFluidStack(144 * 64), + Materials.SolderingAlloy.getMolten(144 * 128) }, + new ItemStack[] { ItemList.StableAdhesive.get(1) }, + new int[] { 2000, 2000, 2000, 2000, 2000 }, 20 * 20, (int) GT_Values.VP[8], 1); // Titanium, Tungsten, Indium CORE.RA.addQuantumTransformerRecipe( - new ItemStack[] { - Materials.Lead.getDust(16), - Materials.Bauxite.getDust(32), - Materials.Tungstate.getDust(16), - ItemUtils.getSimpleStack(GenericChem.mTitaTungstenIndiumCatalyst, 0) - }, + new ItemStack[] { Materials.Lead.getDust(16), Materials.Bauxite.getDust(32), + Materials.Tungstate.getDust(16), + ItemUtils.getSimpleStack(GenericChem.mTitaTungstenIndiumCatalyst, 0) }, new FluidStack[] {}, new FluidStack[] {}, - new ItemStack[] { - Materials.Titanium.getDust(64), - Materials.TungstenSteel.getDust(64), - Materials.TungstenCarbide.getDust(64), - Materials.Indium.getDust(64) - }, - new int[] {2500, 2500, 2500, 2500}, + new ItemStack[] { Materials.Titanium.getDust(64), Materials.TungstenSteel.getDust(64), + Materials.TungstenCarbide.getDust(64), Materials.Indium.getDust(64) }, + new int[] { 2500, 2500, 2500, 2500 }, 20 * 20, (int) GT_Values.VP[8], 1); // Thorium, Uranium, Plutonium CORE.RA.addQuantumTransformerRecipe( - new ItemStack[] { - Materials.Thorium.getDust(32), - Materials.Uranium.getDust(32), - ItemUtils.getSimpleStack(GenericChem.mRadioactivityCatalyst, 0) - }, + new ItemStack[] { Materials.Thorium.getDust(32), Materials.Uranium.getDust(32), + ItemUtils.getSimpleStack(GenericChem.mRadioactivityCatalyst, 0) }, new FluidStack[] {}, new FluidStack[] {}, - new ItemStack[] { - ELEMENT.getInstance().THORIUM232.getDust(64), - ELEMENT.getInstance().URANIUM233.getDust(64), - Materials.Uranium235.getDust(64), - ELEMENT.getInstance().PLUTONIUM238.getDust(64), - Materials.Plutonium.getDust(64), - Materials.Plutonium241.getDust(64) - }, - new int[] {1667, 1667, 1667, 1667, 1667, 1667}, + new ItemStack[] { ELEMENT.getInstance().THORIUM232.getDust(64), + ELEMENT.getInstance().URANIUM233.getDust(64), Materials.Uranium235.getDust(64), + ELEMENT.getInstance().PLUTONIUM238.getDust(64), Materials.Plutonium.getDust(64), + Materials.Plutonium241.getDust(64) }, + new int[] { 1667, 1667, 1667, 1667, 1667, 1667 }, 20 * 20, (int) GT_Values.VP[8], 1); // Monaline CORE.RA.addQuantumTransformerRecipe( - new ItemStack[] { - Materials.Monazite.getDust(32), ItemUtils.getSimpleStack(GenericChem.mRareEarthGroupCatalyst, 0) - }, + new ItemStack[] { Materials.Monazite.getDust(32), + ItemUtils.getSimpleStack(GenericChem.mRareEarthGroupCatalyst, 0) }, new FluidStack[] {}, new FluidStack[] {}, - new ItemStack[] { - Materials.Cerium.getDust(64), - Materials.Gadolinium.getDust(64), - Materials.Samarium.getDust(64), - GT_ModHandler.getModItem("bartworks", "gt.bwMetaGenerateddust", 64L, 11002), // Hafnia - GT_ModHandler.getModItem("bartworks", "gt.bwMetaGenerateddust", 64L, 11007), // Zirconium - ItemList.SuperconductorComposite.get(1) - }, - new int[] {1667, 1667, 1667, 1667, 1667, 1667}, + new ItemStack[] { Materials.Cerium.getDust(64), Materials.Gadolinium.getDust(64), + Materials.Samarium.getDust(64), + GT_ModHandler.getModItem("bartworks", "gt.bwMetaGenerateddust", 64L, 11002), // Hafnia + GT_ModHandler.getModItem("bartworks", "gt.bwMetaGenerateddust", 64L, 11007), // Zirconium + ItemList.SuperconductorComposite.get(1) }, + new int[] { 1667, 1667, 1667, 1667, 1667, 1667 }, 20 * 20, (int) GT_Values.VP[9], 2); // Bastline CORE.RA.addQuantumTransformerRecipe( - new ItemStack[] { - Materials.Bastnasite.getDust(32), ItemUtils.getSimpleStack(GenericChem.mRareEarthGroupCatalyst, 0) - }, + new ItemStack[] { Materials.Bastnasite.getDust(32), + ItemUtils.getSimpleStack(GenericChem.mRareEarthGroupCatalyst, 0) }, null, null, - new ItemStack[] { - Materials.Holmium.getDust(64), - Materials.Cerium.getDust(64), - Materials.Samarium.getDust(64), - Materials.Gadolinium.getDust(64), - Materials.Lanthanum.getDust(64) - }, - new int[] {2000, 2000, 2000, 2000, 2000}, + new ItemStack[] { Materials.Holmium.getDust(64), Materials.Cerium.getDust(64), + Materials.Samarium.getDust(64), Materials.Gadolinium.getDust(64), + Materials.Lanthanum.getDust(64) }, + new int[] { 2000, 2000, 2000, 2000, 2000 }, 20 * 20, (int) GT_Values.VP[9], 2); // Stem Cells CORE.RA.addQuantumTransformerRecipe( - new ItemStack[] { - Materials.Calcium.getDust(32), - Materials.MeatRaw.getDust(32), - GT_ModHandler.getModItem("dreamcraft", "GTNHBioItems", 32, 2), - ItemUtils.getSimpleStack(GenericChem.mRawIntelligenceCatalyst, 0) - }, + new ItemStack[] { Materials.Calcium.getDust(32), Materials.MeatRaw.getDust(32), + GT_ModHandler.getModItem("dreamcraft", "GTNHBioItems", 32, 2), + ItemUtils.getSimpleStack(GenericChem.mRawIntelligenceCatalyst, 0) }, new FluidStack[] {}, - new FluidStack[] { - Materials.GrowthMediumRaw.getFluid(1000 * 1024), - Materials.GrowthMediumSterilized.getFluid(1000 * 512) - }, - new ItemStack[] {stemcells}, - new int[] {3333, 3333, 3333}, + new FluidStack[] { Materials.GrowthMediumRaw.getFluid(1000 * 1024), + Materials.GrowthMediumSterilized.getFluid(1000 * 512) }, + new ItemStack[] { stemcells }, + new int[] { 3333, 3333, 3333 }, 20 * 20, (int) GT_Values.VP[10], 3); // Lategame Plastics (Missing Radox Polymer and Heavy Radox) CORE.RA.addQuantumTransformerRecipe( - new ItemStack[] { - Materials.Carbon.getDust(64), - Materials.Osmium.getDust(24), - ItemUtils.getSimpleStack(GenericChem.mUltimatePlasticCatalyst, 0) - }, - new FluidStack[] {Materials.Hydrogen.getGas(1000 * 16), Materials.Nitrogen.getGas(1000 * 16)}, - new FluidStack[] { - GT_CoreModSupport.Xenoxene.getFluid(1000 * 16), - GT_CoreModSupport.RadoxPolymer.getMolten(144 * 64), - GT_CoreModSupport.RadoxHeavy.getFluid(1000 * 16), - MaterialsKevlar.Kevlar.getMolten(144 * 64) - }, + new ItemStack[] { Materials.Carbon.getDust(64), Materials.Osmium.getDust(24), + ItemUtils.getSimpleStack(GenericChem.mUltimatePlasticCatalyst, 0) }, + new FluidStack[] { Materials.Hydrogen.getGas(1000 * 16), Materials.Nitrogen.getGas(1000 * 16) }, + new FluidStack[] { GT_CoreModSupport.Xenoxene.getFluid(1000 * 16), + GT_CoreModSupport.RadoxPolymer.getMolten(144 * 64), + GT_CoreModSupport.RadoxHeavy.getFluid(1000 * 16), MaterialsKevlar.Kevlar.getMolten(144 * 64) }, new ItemStack[] {}, - new int[] {2500, 2500, 2500, 2500}, + new int[] { 2500, 2500, 2500, 2500 }, 20 * 20, (int) GT_Values.VP[11], 4); // Lategame Kevlar using Kevlar bee comb CORE.RA.addQuantumTransformerRecipe( - new ItemStack[] { - GT_Bees.combs.getStackForType(CombType.KEVLAR, 24), - Materials.Carbon.getDust(64), - ItemUtils.getSimpleStack(GenericChem.mUltimatePlasticCatalyst, 0) - }, - new FluidStack[] {Materials.Nitrogen.getGas(1000 * 16), Materials.Hydrogen.getGas(1000 * 16)}, - new FluidStack[] { - MaterialsKevlar.PolyurethaneResin.getFluid(1000 * 32), - MaterialsKevlar.LiquidCrystalKevlar.getFluid(144 * 32), - MaterialsKevlar.Kevlar.getMolten(144 * 64) - }, + new ItemStack[] { GT_Bees.combs.getStackForType(CombType.KEVLAR, 24), Materials.Carbon.getDust(64), + ItemUtils.getSimpleStack(GenericChem.mUltimatePlasticCatalyst, 0) }, + new FluidStack[] { Materials.Nitrogen.getGas(1000 * 16), Materials.Hydrogen.getGas(1000 * 16) }, + new FluidStack[] { MaterialsKevlar.PolyurethaneResin.getFluid(1000 * 32), + MaterialsKevlar.LiquidCrystalKevlar.getFluid(144 * 32), + MaterialsKevlar.Kevlar.getMolten(144 * 64) }, new ItemStack[] {}, - new int[] {2500, 2500, 2500, 2500}, + new int[] { 2500, 2500, 2500, 2500 }, 20 * 20, (int) GT_Values.VP[11], 4); // Bio Cells and Mutated Solder CORE.RA.addQuantumTransformerRecipe( - new ItemStack[] { - ItemList.Circuit_Chip_Stemcell.get(16), - Materials.InfinityCatalyst.getDust(4), - ItemUtils.getSimpleStack(GenericChem.mBiologicalIntelligenceCatalyst, 0) - }, + new ItemStack[] { ItemList.Circuit_Chip_Stemcell.get(16), Materials.InfinityCatalyst.getDust(4), + ItemUtils.getSimpleStack(GenericChem.mBiologicalIntelligenceCatalyst, 0) }, new FluidStack[] {}, - new FluidStack[] { - MISC_MATERIALS.MUTATED_LIVING_SOLDER.getFluidStack(144 * 128), - Materials.BioMediumSterilized.getFluid(1000 * 256), - Materials.BioMediumRaw.getFluid(1000 * 512) - }, - new ItemStack[] {biocells}, - new int[] {2500, 2500, 2500, 2500}, + new FluidStack[] { MISC_MATERIALS.MUTATED_LIVING_SOLDER.getFluidStack(144 * 128), + Materials.BioMediumSterilized.getFluid(1000 * 256), + Materials.BioMediumRaw.getFluid(1000 * 512) }, + new ItemStack[] { biocells }, + new int[] { 2500, 2500, 2500, 2500 }, 20 * 20, (int) GT_Values.VP[11], 4); @@ -296,15 +226,15 @@ public class RecipeLoader_ChemicalSkips { private static void fusionReactorRecipes() { GT_Values.RA.addFusionReactorRecipe( - new FluidStack[] {Materials.Radon.getPlasma(100), Materials.Nitrogen.getPlasma(100)}, - new FluidStack[] {new FluidStack(ELEMENT.getInstance().NEPTUNIUM.getPlasma(), 100)}, + new FluidStack[] { Materials.Radon.getPlasma(100), Materials.Nitrogen.getPlasma(100) }, + new FluidStack[] { new FluidStack(ELEMENT.getInstance().NEPTUNIUM.getPlasma(), 100) }, 30 * 20, (int) GT_Values.VP[8], 1000000000); GT_Values.RA.addFusionReactorRecipe( - new FluidStack[] {Materials.Americium.getPlasma(100), Materials.Boron.getPlasma(100)}, - new FluidStack[] {new FluidStack(ELEMENT.getInstance().FERMIUM.getPlasma(), 100)}, + new FluidStack[] { Materials.Americium.getPlasma(100), Materials.Boron.getPlasma(100) }, + new FluidStack[] { new FluidStack(ELEMENT.getInstance().FERMIUM.getPlasma(), 100) }, 30 * 20, (int) GT_Values.VP[8], 1000000000); @@ -312,153 +242,100 @@ public class RecipeLoader_ChemicalSkips { private static void catalystRecipes() { CORE.RA.addSixSlotAssemblingRecipe( - new ItemStack[] { - CI.getNumberedCircuit(10), - CI.getEmptyCatalyst(1), - GT_ModHandler.getModItem("bartworks", "gt.bwMetaGenerateddust", 64L, 88), - Materials.Osmiridium.getDust(64), - Materials.Carbon.getNanite(64) - }, + new ItemStack[] { CI.getNumberedCircuit(10), CI.getEmptyCatalyst(1), + GT_ModHandler.getModItem("bartworks", "gt.bwMetaGenerateddust", 64L, 88), + Materials.Osmiridium.getDust(64), Materials.Carbon.getNanite(64) }, ELEMENT.STANDALONE.HYPOGEN.getFluidStack(360), ItemUtils.getSimpleStack(GenericChem.mPlatinumGroupCatalyst, 1), 60 * 20, (int) GT_Values.VP[9]); CORE.RA.addSixSlotAssemblingRecipe( - new ItemStack[] { - CI.getNumberedCircuit(10), - CI.getEmptyCatalyst(1), - Materials.Polybenzimidazole.getDust(64), - Materials.Polytetrafluoroethylene.getDust(64), - Materials.Carbon.getNanite(64) - }, + new ItemStack[] { CI.getNumberedCircuit(10), CI.getEmptyCatalyst(1), + Materials.Polybenzimidazole.getDust(64), Materials.Polytetrafluoroethylene.getDust(64), + Materials.Carbon.getNanite(64) }, ELEMENT.STANDALONE.HYPOGEN.getFluidStack(360), ItemUtils.getSimpleStack(GenericChem.mPlasticPolymerCatalyst, 1), 60 * 20, (int) GT_Values.VP[9]); CORE.RA.addSixSlotAssemblingRecipe( - new ItemStack[] { - CI.getNumberedCircuit(10), - CI.getEmptyCatalyst(1), - Materials.Silicone.getDust(64), - Materials.StyreneButadieneRubber.getDust(64), - Materials.Carbon.getNanite(64) - }, + new ItemStack[] { CI.getNumberedCircuit(10), CI.getEmptyCatalyst(1), Materials.Silicone.getDust(64), + Materials.StyreneButadieneRubber.getDust(64), Materials.Carbon.getNanite(64) }, ELEMENT.STANDALONE.HYPOGEN.getFluidStack(360), ItemUtils.getSimpleStack(GenericChem.mRubberPolymerCatalyst, 1), 60 * 20, (int) GT_Values.VP[9]); CORE.RA.addSixSlotAssemblingRecipe( - new ItemStack[] { - CI.getNumberedCircuit(10), - CI.getEmptyCatalyst(1), - ALLOY.INDALLOY_140.getDust(64), - MISC_MATERIALS.ETHYL_CYANOACRYLATE.getCell(64), - Materials.Carbon.getNanite(64) - }, + new ItemStack[] { CI.getNumberedCircuit(10), CI.getEmptyCatalyst(1), ALLOY.INDALLOY_140.getDust(64), + MISC_MATERIALS.ETHYL_CYANOACRYLATE.getCell(64), Materials.Carbon.getNanite(64) }, ELEMENT.STANDALONE.HYPOGEN.getFluidStack(360), ItemUtils.getSimpleStack(GenericChem.mAdhesionPromoterCatalyst, 1), 60 * 20, (int) GT_Values.VP[9]); CORE.RA.addSixSlotAssemblingRecipe( - new ItemStack[] { - CI.getNumberedCircuit(10), - CI.getEmptyCatalyst(1), - Materials.TungstenSteel.getDust(64), - Materials.Indium.getDust(64), - Materials.Carbon.getNanite(64) - }, + new ItemStack[] { CI.getNumberedCircuit(10), CI.getEmptyCatalyst(1), + Materials.TungstenSteel.getDust(64), Materials.Indium.getDust(64), + Materials.Carbon.getNanite(64) }, ELEMENT.STANDALONE.HYPOGEN.getFluidStack(360), ItemUtils.getSimpleStack(GenericChem.mTitaTungstenIndiumCatalyst, 1), 60 * 20, (int) GT_Values.VP[9]); CORE.RA.addSixSlotAssemblingRecipe( - new ItemStack[] { - CI.getNumberedCircuit(10), - CI.getEmptyCatalyst(1), - ELEMENT.getInstance().URANIUM235.getDust(64), - ELEMENT.getInstance().PLUTONIUM241.getDust(64), - Materials.Carbon.getNanite(64) - }, + new ItemStack[] { CI.getNumberedCircuit(10), CI.getEmptyCatalyst(1), + ELEMENT.getInstance().URANIUM235.getDust(64), ELEMENT.getInstance().PLUTONIUM241.getDust(64), + Materials.Carbon.getNanite(64) }, ELEMENT.STANDALONE.HYPOGEN.getFluidStack(360), ItemUtils.getSimpleStack(GenericChem.mRadioactivityCatalyst, 1), 60 * 20, (int) GT_Values.VP[9]); CORE.RA.addSixSlotAssemblingRecipe( - new ItemStack[] { - CI.getNumberedCircuit(10), - CI.getEmptyCatalyst(1), - Materials.Samarium.getDust(64), - Materials.Gadolinium.getDust(64), - Materials.Silver.getNanite(1) - }, + new ItemStack[] { CI.getNumberedCircuit(10), CI.getEmptyCatalyst(1), Materials.Samarium.getDust(64), + Materials.Gadolinium.getDust(64), Materials.Silver.getNanite(1) }, ELEMENT.STANDALONE.HYPOGEN.getFluidStack(9216), ItemUtils.getSimpleStack(GenericChem.mRareEarthGroupCatalyst, 1), 60 * 20, (int) GT_Values.VP[10]); CORE.RA.addSixSlotAssemblingRecipe( - new ItemStack[] { - CI.getNumberedCircuit(10), - CI.getEmptyCatalyst(1), - Materials.Naquadah.getDust(64), - Materials.Adamantium.getDust(64), - Materials.Silver.getNanite(1) - }, + new ItemStack[] { CI.getNumberedCircuit(10), CI.getEmptyCatalyst(1), Materials.Naquadah.getDust(64), + Materials.Adamantium.getDust(64), Materials.Silver.getNanite(1) }, ELEMENT.STANDALONE.HYPOGEN.getFluidStack(9216), ItemUtils.getSimpleStack(GenericChem.mSimpleNaquadahCatalyst, 1), 60 * 20, (int) GT_Values.VP[10]); CORE.RA.addSixSlotAssemblingRecipe( - new ItemStack[] { - CI.getNumberedCircuit(10), - CI.getEmptyCatalyst(1), - Materials.Naquadria.getDust(64), - Materials.Trinium.getDust(64), - Materials.Gold.getNanite(1) - }, + new ItemStack[] { CI.getNumberedCircuit(10), CI.getEmptyCatalyst(1), Materials.Naquadria.getDust(64), + Materials.Trinium.getDust(64), Materials.Gold.getNanite(1) }, Materials.SpaceTime.getMolten(9216L), ItemUtils.getSimpleStack(GenericChem.mAdvancedNaquadahCatalyst, 1), 60 * 20, (int) GT_Values.VP[11]); CORE.RA.addSixSlotAssemblingRecipe( - new ItemStack[] { - CI.getNumberedCircuit(10), - CI.getEmptyCatalyst(1), - ItemList.Circuit_Chip_Stemcell.get(64), - Materials.Gold.getNanite(1) - }, + new ItemStack[] { CI.getNumberedCircuit(10), CI.getEmptyCatalyst(1), + ItemList.Circuit_Chip_Stemcell.get(64), Materials.Gold.getNanite(1) }, Materials.SpaceTime.getMolten(9216L), ItemUtils.getSimpleStack(GenericChem.mRawIntelligenceCatalyst, 1), 60 * 20, (int) GT_Values.VP[11]); CORE.RA.addSixSlotAssemblingRecipe( - new ItemStack[] { - CI.getNumberedCircuit(10), - CI.getEmptyCatalyst(1), - MaterialsKevlar.Kevlar.getDust(64), - Materials.TranscendentMetal.getNanite(1) - }, + new ItemStack[] { CI.getNumberedCircuit(10), CI.getEmptyCatalyst(1), MaterialsKevlar.Kevlar.getDust(64), + Materials.TranscendentMetal.getNanite(1) }, FluidUtils.getFluidStack("molten.shirabon", 92160), ItemUtils.getSimpleStack(GenericChem.mUltimatePlasticCatalyst, 1), 60 * 20, (int) GT_Values.VP[12]); CORE.RA.addSixSlotAssemblingRecipe( - new ItemStack[] { - CI.getNumberedCircuit(10), - CI.getEmptyCatalyst(1), - ItemList.Circuit_Chip_Biocell.get(64), - Materials.TranscendentMetal.getNanite(1) - }, + new ItemStack[] { CI.getNumberedCircuit(10), CI.getEmptyCatalyst(1), + ItemList.Circuit_Chip_Biocell.get(64), Materials.TranscendentMetal.getNanite(1) }, FluidUtils.getFluidStack("molten.shirabon", 92160), ItemUtils.getSimpleStack(GenericChem.mBiologicalIntelligenceCatalyst, 1), 60 * 20, @@ -472,20 +349,14 @@ public class RecipeLoader_ChemicalSkips { 1024, (int) GT_Values.VP[7], 32, - new ItemStack[] { - GregtechItemList.ForceFieldGlass.get(1), - Materials.Carbon.getNanite(4), - ItemList.Emitter_UV.get(4), - GT_OreDictUnificator.get(OrePrefixes.wireGt16, Materials.SuperconductorUHV, 8), - GregtechItemList.Laser_Lens_Special.get(1), - GT_ModHandler.getModItem("GoodGenerator", "advancedRadiationProtectionPlate", 2) - }, - new FluidStack[] { - Materials.Thulium.getMolten(144 * 10), - Materials.ExcitedDTCC.getFluid(5000), - new FluidStack(ELEMENT.getInstance().NEPTUNIUM.getPlasma(), 500), - new FluidStack(ELEMENT.getInstance().FERMIUM.getPlasma(), 500) - }, + new ItemStack[] { GregtechItemList.ForceFieldGlass.get(1), Materials.Carbon.getNanite(4), + ItemList.Emitter_UV.get(4), + GT_OreDictUnificator.get(OrePrefixes.wireGt16, Materials.SuperconductorUHV, 8), + GregtechItemList.Laser_Lens_Special.get(1), + GT_ModHandler.getModItem("GoodGenerator", "advancedRadiationProtectionPlate", 2) }, + new FluidStack[] { Materials.Thulium.getMolten(144 * 10), Materials.ExcitedDTCC.getFluid(5000), + new FluidStack(ELEMENT.getInstance().NEPTUNIUM.getPlasma(), 500), + new FluidStack(ELEMENT.getInstance().FERMIUM.getPlasma(), 500) }, GregtechItemList.NeutronPulseManipulator.get(1), 60 * 20, (int) GT_Values.VP[10]); @@ -496,21 +367,15 @@ public class RecipeLoader_ChemicalSkips { 2048, (int) GT_Values.VP[8], 32, - new ItemStack[] { - GregtechItemList.ForceFieldGlass.get(2), - Materials.Carbon.getNanite(8), - ItemList.Emitter_UEV.get(4), - GT_OreDictUnificator.get(OrePrefixes.wireGt16, Materials.SuperconductorUEV, 8), - GregtechItemList.Laser_Lens_Special.get(1), - GT_ModHandler.getModItem("GoodGenerator", "advancedRadiationProtectionPlate", 4), - ItemList.StableAdhesive.get(4) - }, - new FluidStack[] { - Materials.Thulium.getMolten(144 * 12), - Materials.ExcitedDTPC.getFluid(5000), - new FluidStack(ELEMENT.getInstance().NEPTUNIUM.getPlasma(), 2500), - new FluidStack(ELEMENT.getInstance().FERMIUM.getPlasma(), 2500) - }, + new ItemStack[] { GregtechItemList.ForceFieldGlass.get(2), Materials.Carbon.getNanite(8), + ItemList.Emitter_UEV.get(4), + GT_OreDictUnificator.get(OrePrefixes.wireGt16, Materials.SuperconductorUEV, 8), + GregtechItemList.Laser_Lens_Special.get(1), + GT_ModHandler.getModItem("GoodGenerator", "advancedRadiationProtectionPlate", 4), + ItemList.StableAdhesive.get(4) }, + new FluidStack[] { Materials.Thulium.getMolten(144 * 12), Materials.ExcitedDTPC.getFluid(5000), + new FluidStack(ELEMENT.getInstance().NEPTUNIUM.getPlasma(), 2500), + new FluidStack(ELEMENT.getInstance().FERMIUM.getPlasma(), 2500) }, GregtechItemList.CosmicFabricManipulator.get(1), 75 * 20, (int) GT_Values.VP[11]); @@ -521,21 +386,15 @@ public class RecipeLoader_ChemicalSkips { 4096, (int) GT_Values.VP[7], 32, - new ItemStack[] { - GregtechItemList.ForceFieldGlass.get(4), - Materials.Carbon.getNanite(16), - ItemList.Emitter_UIV.get(4), - GT_OreDictUnificator.get(OrePrefixes.wireGt16, Materials.SuperconductorUIV, 8), - GregtechItemList.Laser_Lens_Special.get(1), - GT_ModHandler.getModItem("GoodGenerator", "advancedRadiationProtectionPlate", 8), - ItemList.SuperconductorComposite.get(4) - }, - new FluidStack[] { - Materials.Thulium.getMolten(144 * 15), - Materials.ExcitedDTRC.getFluid(5000), - new FluidStack(ELEMENT.getInstance().NEPTUNIUM.getPlasma(), 1000 * 10), - new FluidStack(ELEMENT.getInstance().FERMIUM.getPlasma(), 1000 * 10) - }, + new ItemStack[] { GregtechItemList.ForceFieldGlass.get(4), Materials.Carbon.getNanite(16), + ItemList.Emitter_UIV.get(4), + GT_OreDictUnificator.get(OrePrefixes.wireGt16, Materials.SuperconductorUIV, 8), + GregtechItemList.Laser_Lens_Special.get(1), + GT_ModHandler.getModItem("GoodGenerator", "advancedRadiationProtectionPlate", 8), + ItemList.SuperconductorComposite.get(4) }, + new FluidStack[] { Materials.Thulium.getMolten(144 * 15), Materials.ExcitedDTRC.getFluid(5000), + new FluidStack(ELEMENT.getInstance().NEPTUNIUM.getPlasma(), 1000 * 10), + new FluidStack(ELEMENT.getInstance().FERMIUM.getPlasma(), 1000 * 10) }, GregtechItemList.InfinityInfusedManipulator.get(1), 90 * 20, (int) GT_Values.VP[12]); @@ -545,21 +404,15 @@ public class RecipeLoader_ChemicalSkips { 1024, (int) GT_Values.VP[7], 32, - new ItemStack[] { - GregtechItemList.ForceFieldGlass.get(8), - Materials.Carbon.getNanite(32), - ItemList.Emitter_UMV.get(4), - GT_OreDictUnificator.get(OrePrefixes.wireGt16, Materials.SuperconductorUMV, 8), - GregtechItemList.Laser_Lens_Special.get(1), - GT_ModHandler.getModItem("GoodGenerator", "advancedRadiationProtectionPlate", 16), - ItemList.NaquadriaSupersolid.get(4) - }, - new FluidStack[] { - Materials.Thulium.getMolten(144 * 20), - Materials.ExcitedDTEC.getFluid(5000), - new FluidStack(ELEMENT.getInstance().NEPTUNIUM.getPlasma(), 2000 * 10), - new FluidStack(ELEMENT.getInstance().FERMIUM.getPlasma(), 2000 * 10) - }, + new ItemStack[] { GregtechItemList.ForceFieldGlass.get(8), Materials.Carbon.getNanite(32), + ItemList.Emitter_UMV.get(4), + GT_OreDictUnificator.get(OrePrefixes.wireGt16, Materials.SuperconductorUMV, 8), + GregtechItemList.Laser_Lens_Special.get(1), + GT_ModHandler.getModItem("GoodGenerator", "advancedRadiationProtectionPlate", 16), + ItemList.NaquadriaSupersolid.get(4) }, + new FluidStack[] { Materials.Thulium.getMolten(144 * 20), Materials.ExcitedDTEC.getFluid(5000), + new FluidStack(ELEMENT.getInstance().NEPTUNIUM.getPlasma(), 2000 * 10), + new FluidStack(ELEMENT.getInstance().FERMIUM.getPlasma(), 2000 * 10) }, GregtechItemList.SpaceTimeContinuumRipper.get(1), 60 * 20, (int) GT_Values.VP[13]); @@ -570,16 +423,11 @@ public class RecipeLoader_ChemicalSkips { 1024, (int) GT_Values.VP[7], 32, - new ItemStack[] { - ALLOY.QUANTUM.getFrameBox(1), - GT_OreDictUnificator.get("plateDensePreciousMetalsAlloy", 4), - GT_OreDictUnificator.get(OrePrefixes.plateDense, Materials.Neutronium, 16), - ItemList.Field_Generator_UV.get(1), - ELEMENT.STANDALONE.CHRONOMATIC_GLASS.getScrew(16) - }, - new FluidStack[] { - MISC_MATERIALS.MUTATED_LIVING_SOLDER.getFluidStack(144 * 10), - }, + new ItemStack[] { ALLOY.QUANTUM.getFrameBox(1), + GT_OreDictUnificator.get("plateDensePreciousMetalsAlloy", 4), + GT_OreDictUnificator.get(OrePrefixes.plateDense, Materials.Neutronium, 16), + ItemList.Field_Generator_UV.get(1), ELEMENT.STANDALONE.CHRONOMATIC_GLASS.getScrew(16) }, + new FluidStack[] { MISC_MATERIALS.MUTATED_LIVING_SOLDER.getFluidStack(144 * 10), }, GregtechItemList.NeutronShieldingCore.get(1), 60 * 20, (int) GT_Values.VP[10]); @@ -590,17 +438,13 @@ public class RecipeLoader_ChemicalSkips { 2048, (int) GT_Values.VP[8], 32, - new ItemStack[] { - ALLOY.QUANTUM.getFrameBox(2), - GT_OreDictUnificator.get("plateDenseEnrichedNaquadahAlloy", 4), - GT_OreDictUnificator.get(OrePrefixes.plateDense, Materials.Infinity, 16), - ItemList.Field_Generator_UEV.get(1), - GT_OreDictUnificator.get(OrePrefixes.screw, GT_CoreModSupport.RadoxPolymer, 16), - ItemList.StableAdhesive.get(4) - }, - new FluidStack[] { - MISC_MATERIALS.MUTATED_LIVING_SOLDER.getFluidStack(144 * 20), - }, + new ItemStack[] { ALLOY.QUANTUM.getFrameBox(2), + GT_OreDictUnificator.get("plateDenseEnrichedNaquadahAlloy", 4), + GT_OreDictUnificator.get(OrePrefixes.plateDense, Materials.Infinity, 16), + ItemList.Field_Generator_UEV.get(1), + GT_OreDictUnificator.get(OrePrefixes.screw, GT_CoreModSupport.RadoxPolymer, 16), + ItemList.StableAdhesive.get(4) }, + new FluidStack[] { MISC_MATERIALS.MUTATED_LIVING_SOLDER.getFluidStack(144 * 20), }, GregtechItemList.CosmicFabricShieldingCore.get(1), 75 * 20, (int) GT_Values.VP[11]); @@ -611,17 +455,11 @@ public class RecipeLoader_ChemicalSkips { 4096, (int) GT_Values.VP[9], 32, - new ItemStack[] { - ALLOY.QUANTUM.getFrameBox(4), - ELEMENT.STANDALONE.HYPOGEN.getPlateDense(4), - GT_OreDictUnificator.get(OrePrefixes.plateDense, Materials.TranscendentMetal, 16), - ItemList.Field_Generator_UIV.get(1), - GT_OreDictUnificator.get("screwMetastableOganesson", 16), - ItemList.SuperconductorComposite.get(4) - }, - new FluidStack[] { - MISC_MATERIALS.MUTATED_LIVING_SOLDER.getFluidStack(144 * 40), - }, + new ItemStack[] { ALLOY.QUANTUM.getFrameBox(4), ELEMENT.STANDALONE.HYPOGEN.getPlateDense(4), + GT_OreDictUnificator.get(OrePrefixes.plateDense, Materials.TranscendentMetal, 16), + ItemList.Field_Generator_UIV.get(1), GT_OreDictUnificator.get("screwMetastableOganesson", 16), + ItemList.SuperconductorComposite.get(4) }, + new FluidStack[] { MISC_MATERIALS.MUTATED_LIVING_SOLDER.getFluidStack(144 * 40), }, GregtechItemList.InfinityInfusedShieldingCore.get(1), 90 * 20, (int) GT_Values.VP[12]); @@ -632,28 +470,20 @@ public class RecipeLoader_ChemicalSkips { 8192, (int) GT_Values.VP[10], 32, - new ItemStack[] { - ALLOY.QUANTUM.getFrameBox(8), - GT_OreDictUnificator.get("plateDenseShirabon", 4), - GT_OreDictUnificator.get(OrePrefixes.plateDense, Materials.SpaceTime, 16), - ItemList.Field_Generator_UMV.get(1), - GT_OreDictUnificator.get(OrePrefixes.screw, Materials.Dilithium, 16), - ItemList.NaquadriaSupersolid.get(4) - }, - new FluidStack[] { - MISC_MATERIALS.MUTATED_LIVING_SOLDER.getFluidStack(144 * 80), - }, + new ItemStack[] { ALLOY.QUANTUM.getFrameBox(8), GT_OreDictUnificator.get("plateDenseShirabon", 4), + GT_OreDictUnificator.get(OrePrefixes.plateDense, Materials.SpaceTime, 16), + ItemList.Field_Generator_UMV.get(1), + GT_OreDictUnificator.get(OrePrefixes.screw, Materials.Dilithium, 16), + ItemList.NaquadriaSupersolid.get(4) }, + new FluidStack[] { MISC_MATERIALS.MUTATED_LIVING_SOLDER.getFluidStack(144 * 80), }, GregtechItemList.SpaceTimeBendingCore.get(1), 120 * 20, (int) GT_Values.VP[13]); GT_Values.RA.addAssemblerRecipe( - new ItemStack[] { - new ItemStack(QuantumGlassBlock.INSTANCE, 1), - ItemList.Field_Generator_ZPM.get(1), - ELEMENT.STANDALONE.CELESTIAL_TUNGSTEN.getLongRod(6), - ELEMENT.STANDALONE.CHRONOMATIC_GLASS.getPlate(6) - }, + new ItemStack[] { new ItemStack(QuantumGlassBlock.INSTANCE, 1), ItemList.Field_Generator_ZPM.get(1), + ELEMENT.STANDALONE.CELESTIAL_TUNGSTEN.getLongRod(6), + ELEMENT.STANDALONE.CHRONOMATIC_GLASS.getPlate(6) }, ALLOY.QUANTUM.getFluidStack(144 * 6), GregtechItemList.ForceFieldGlass.get(1), 10 * 20, diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_GTNH.java b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_GTNH.java index fa13b1d093..6caa976ac7 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_GTNH.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_GTNH.java @@ -1,14 +1,15 @@ package gtPlusPlus.xmod.gregtech.loaders.recipe; -import gregtech.api.enums.GT_Values; -import gregtech.api.enums.ItemList; -import gregtech.api.enums.Materials; -import gtPlusPlus.core.material.ELEMENT; import net.minecraft.init.Items; import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidStack; +import gregtech.api.enums.GT_Values; +import gregtech.api.enums.ItemList; +import gregtech.api.enums.Materials; +import gtPlusPlus.core.material.ELEMENT; + public class RecipeLoader_GTNH { public static void generate() { diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_GlueLine.java b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_GlueLine.java index 0ce18ad1d0..0edc2a2d00 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_GlueLine.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_GlueLine.java @@ -1,5 +1,9 @@ package gtPlusPlus.xmod.gregtech.loaders.recipe; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidStack; + import gregtech.api.enums.GT_Values; import gregtech.api.enums.ItemList; import gregtech.api.enums.Materials; @@ -18,9 +22,6 @@ import gtPlusPlus.core.util.minecraft.FluidUtils; import gtPlusPlus.core.util.minecraft.ItemUtils; import gtPlusPlus.core.util.minecraft.MaterialUtils; import gtPlusPlus.plugin.agrichem.BioRecipes; -import net.minecraft.init.Items; -import net.minecraft.item.ItemStack; -import net.minecraftforge.fluids.FluidStack; public class RecipeLoader_GlueLine { @@ -43,100 +44,82 @@ public class RecipeLoader_GlueLine { private static void chemicalPlantRecipes() { // CO + C3H6O2 = C4H6O3 CORE.RA.addChemicalPlantRecipe( - new ItemStack[] {CI.getNumberedCircuit(17), ItemUtils.getSimpleStack(GenericChem.mBlueCatalyst, 0)}, - new FluidStack[] { - FluidUtils.getFluidStack("carbonmonoxide", 1000), FluidUtils.getFluidStack("methylacetate", 1000), - }, + new ItemStack[] { CI.getNumberedCircuit(17), ItemUtils.getSimpleStack(GenericChem.mBlueCatalyst, 0) }, + new FluidStack[] { FluidUtils.getFluidStack("carbonmonoxide", 1000), + FluidUtils.getFluidStack("methylacetate", 1000), }, new ItemStack[] {}, - new FluidStack[] {MISC_MATERIALS.ACETIC_ANHYDRIDE.getFluidStack(1000)}, + new FluidStack[] { MISC_MATERIALS.ACETIC_ANHYDRIDE.getFluidStack(1000) }, 10 * 20, 500, 3); CORE.RA.addChemicalPlantRecipe( - new ItemStack[] {CI.getNumberedCircuit(18)}, - new FluidStack[] { - FluidUtils.getFluidStack("aceticacid", 1000), - FluidUtils.getFluidStack("chlorine", 1000), - MISC_MATERIALS.ACETIC_ANHYDRIDE.getFluidStack(1000) - }, + new ItemStack[] { CI.getNumberedCircuit(18) }, + new FluidStack[] { FluidUtils.getFluidStack("aceticacid", 1000), + FluidUtils.getFluidStack("chlorine", 1000), + MISC_MATERIALS.ACETIC_ANHYDRIDE.getFluidStack(1000) }, new ItemStack[] {}, - new FluidStack[] { - MISC_MATERIALS.CHLOROACETIC_MIXTURE.getFluidStack(1000), - MISC_MATERIALS.ACETIC_ANHYDRIDE.getFluidStack(950) - }, + new FluidStack[] { MISC_MATERIALS.CHLOROACETIC_MIXTURE.getFluidStack(1000), + MISC_MATERIALS.ACETIC_ANHYDRIDE.getFluidStack(950) }, 150 * 20, 1000, 4); // Na2CO3 + NaCN + C2H3O2Cl + 2HCl = C3H3NO2 + 3NaCl + CO2 + H2O CORE.RA.addChemicalPlantRecipe( - new ItemStack[] { - CI.getNumberedCircuit(19), - ItemUtils.getSimpleStack(AgriculturalChem.mSodiumCarbonate, 6), - MISC_MATERIALS.SODIUM_CYANIDE.getDust(3) - }, - new FluidStack[] { - MISC_MATERIALS.CHLOROACETIC_ACID.getFluidStack(1000), - FluidUtils.getFluidStack("hydrochloricacid_gt5u", 2000) - }, - new ItemStack[] {MISC_MATERIALS.CYANOACETIC_ACID.getDust(9), Materials.Salt.getDust(6)}, - new FluidStack[] {Materials.CarbonDioxide.getGas(1000), GT_ModHandler.getWater(1000)}, + new ItemStack[] { CI.getNumberedCircuit(19), + ItemUtils.getSimpleStack(AgriculturalChem.mSodiumCarbonate, 6), + MISC_MATERIALS.SODIUM_CYANIDE.getDust(3) }, + new FluidStack[] { MISC_MATERIALS.CHLOROACETIC_ACID.getFluidStack(1000), + FluidUtils.getFluidStack("hydrochloricacid_gt5u", 2000) }, + new ItemStack[] { MISC_MATERIALS.CYANOACETIC_ACID.getDust(9), Materials.Salt.getDust(6) }, + new FluidStack[] { Materials.CarbonDioxide.getGas(1000), GT_ModHandler.getWater(1000) }, 20 * 20, 1000, 4); // CuSO4 + 5C3H3NO2 + 5C2H6O = CuSO4·5(H2O) + 5C5H7NO2 CORE.RA.addChemicalPlantRecipe( - new ItemStack[] { - CI.getNumberedCircuit(20), - ItemUtils.getSimpleStack(GenericChem.mSolidAcidCatalyst, 0), - MISC_MATERIALS.COPPER_SULFATE.getDust(6), - MISC_MATERIALS.CYANOACETIC_ACID.getDust(45) - }, - new FluidStack[] {Materials.Ethanol.getFluid(5000)}, - new ItemStack[] {MISC_MATERIALS.COPPER_SULFATE_HYDRATED.getDust(11)}, - new FluidStack[] {MISC_MATERIALS.ETHYL_CYANOACETATE.getFluidStack(5000)}, + new ItemStack[] { CI.getNumberedCircuit(20), + ItemUtils.getSimpleStack(GenericChem.mSolidAcidCatalyst, 0), + MISC_MATERIALS.COPPER_SULFATE.getDust(6), MISC_MATERIALS.CYANOACETIC_ACID.getDust(45) }, + new FluidStack[] { Materials.Ethanol.getFluid(5000) }, + new ItemStack[] { MISC_MATERIALS.COPPER_SULFATE_HYDRATED.getDust(11) }, + new FluidStack[] { MISC_MATERIALS.ETHYL_CYANOACETATE.getFluidStack(5000) }, 500 * 20, 6000, 5); // C3H3NO2 + C2H6O = C5H7NO2 + H2O CORE.RA.addChemicalPlantRecipe( - new ItemStack[] {CI.getNumberedCircuit(21), MISC_MATERIALS.CYANOACETIC_ACID.getDust(9)}, - new FluidStack[] {Materials.Ethanol.getFluid(1000)}, + new ItemStack[] { CI.getNumberedCircuit(21), MISC_MATERIALS.CYANOACETIC_ACID.getDust(9) }, + new FluidStack[] { Materials.Ethanol.getFluid(1000) }, new ItemStack[] {}, - new FluidStack[] {MISC_MATERIALS.ETHYL_CYANOACETATE.getFluidStack(1000)}, + new FluidStack[] { MISC_MATERIALS.ETHYL_CYANOACETATE.getFluidStack(1000) }, 1000 * 20, 6000, 5); - BioRecipes.mFormaldehyde = - FluidUtils.getFluidStack("fluid.formaldehyde", 1).getFluid(); + BioRecipes.mFormaldehyde = FluidUtils.getFluidStack("fluid.formaldehyde", 1).getFluid(); CORE.RA.addChemicalPlantRecipe( - new ItemStack[] {CI.getNumberedCircuit(22), ItemUtils.getSimpleStack(GenericChem.mSolidAcidCatalyst, 0) - }, - new FluidStack[] { - MISC_MATERIALS.ETHYL_CYANOACETATE.getFluidStack(100), - FluidUtils.getFluidStack(BioRecipes.mFormaldehyde, 100) - }, + new ItemStack[] { CI.getNumberedCircuit(22), + ItemUtils.getSimpleStack(GenericChem.mSolidAcidCatalyst, 0) }, + new FluidStack[] { MISC_MATERIALS.ETHYL_CYANOACETATE.getFluidStack(100), + FluidUtils.getFluidStack(BioRecipes.mFormaldehyde, 100) }, new ItemStack[] {}, - new FluidStack[] {MISC_MATERIALS.CYANOACRYLATE_POLYMER.getFluidStack(100), FluidUtils.getWater(1000)}, + new FluidStack[] { MISC_MATERIALS.CYANOACRYLATE_POLYMER.getFluidStack(100), FluidUtils.getWater(1000) }, 10 * 20, 8000, 5); // CH4 + NH3 + 3O = HCN + 3H2O CORE.RA.addChemicalPlantRecipe( - new ItemStack[] {CI.getNumberedCircuit(23), ItemUtils.getSimpleStack(GenericChem.mPinkCatalyst, 0)}, - new FluidStack[] { - FluidUtils.getFluidStack("methane", 2000), - FluidUtils.getFluidStack("ammonia", 2000), - FluidUtils.getFluidStack("oxygen", 6000) - }, + new ItemStack[] { CI.getNumberedCircuit(23), ItemUtils.getSimpleStack(GenericChem.mPinkCatalyst, 0) }, + new FluidStack[] { FluidUtils.getFluidStack("methane", 2000), FluidUtils.getFluidStack("ammonia", 2000), + FluidUtils.getFluidStack("oxygen", 6000) }, new ItemStack[] {}, - new FluidStack[] {MISC_MATERIALS.HYDROGEN_CYANIDE.getFluidStack(2000), FluidUtils.getWater(6000)}, + new FluidStack[] { MISC_MATERIALS.HYDROGEN_CYANIDE.getFluidStack(2000), FluidUtils.getWater(6000) }, 10 * 20, 500, 3); @@ -153,12 +136,11 @@ public class RecipeLoader_GlueLine { 10 * 20); // #addChemicalRecipe won't generate LCR recipe if config >= 10 GT_Values.RA.addMultiblockChemicalRecipe( - new ItemStack[] { - CI.getNumberedCircuit(17), ItemUtils.getItemStackOfAmountFromOreDict("dustSodiumHydroxide", 3) - }, - new FluidStack[] {MISC_MATERIALS.HYDROGEN_CYANIDE.getFluidStack(1000)}, - new FluidStack[] {FluidUtils.getWater(1000)}, - new ItemStack[] {MISC_MATERIALS.SODIUM_CYANIDE.getDust(3)}, + new ItemStack[] { CI.getNumberedCircuit(17), + ItemUtils.getItemStackOfAmountFromOreDict("dustSodiumHydroxide", 3) }, + new FluidStack[] { MISC_MATERIALS.HYDROGEN_CYANIDE.getFluidStack(1000) }, + new FluidStack[] { FluidUtils.getWater(1000) }, + new ItemStack[] { MISC_MATERIALS.SODIUM_CYANIDE.getDust(3) }, 10 * 20, 30); @@ -192,23 +174,22 @@ public class RecipeLoader_GlueLine { 5 * 20); // #addChemicalRecipe won't generate LCR recipe if config >= 10 GT_Values.RA.addMultiblockChemicalRecipe( - new ItemStack[] {CI.getNumberedCircuit(19), ItemUtils.getItemStackOfAmountFromOreDict("dustCopper", 1)}, - new FluidStack[] {FluidUtils.getFluidStack("sulfuricacid", 2000)}, - new FluidStack[] {FluidUtils.getFluidStack("dilutedsulfuricacid", 1000)}, - new ItemStack[] {MISC_MATERIALS.COPPER_SULFATE.getDust(6)}, + new ItemStack[] { CI.getNumberedCircuit(19), + ItemUtils.getItemStackOfAmountFromOreDict("dustCopper", 1) }, + new FluidStack[] { FluidUtils.getFluidStack("sulfuricacid", 2000) }, + new FluidStack[] { FluidUtils.getFluidStack("dilutedsulfuricacid", 1000) }, + new ItemStack[] { MISC_MATERIALS.COPPER_SULFATE.getDust(6) }, 5 * 20, 30); } private static void dehydratorRecipes() { CORE.RA.addDehydratorRecipe( - new ItemStack[] { - MISC_MATERIALS.COPPER_SULFATE_HYDRATED.getDust(11), - }, + new ItemStack[] { MISC_MATERIALS.COPPER_SULFATE_HYDRATED.getDust(11), }, null, GT_ModHandler.getWater(5000), - new ItemStack[] {MISC_MATERIALS.COPPER_SULFATE.getDust(6)}, - new int[] {10000, 10000, 10000}, + new ItemStack[] { MISC_MATERIALS.COPPER_SULFATE.getDust(6) }, + new int[] { 10000, 10000, 10000 }, 300 * 20, 10); } @@ -216,11 +197,9 @@ public class RecipeLoader_GlueLine { private static void distillationTowerRecipes() { GT_Values.RA.addDistillationTowerRecipe( MISC_MATERIALS.CHLOROACETIC_MIXTURE.getFluidStack(1000), - new FluidStack[] { - MISC_MATERIALS.CHLOROACETIC_ACID.getFluidStack(100), - MISC_MATERIALS.DICHLOROACETIC_ACID.getFluidStack(450), - MISC_MATERIALS.TRICHLOROACETIC_ACID.getFluidStack(450) - }, + new FluidStack[] { MISC_MATERIALS.CHLOROACETIC_ACID.getFluidStack(100), + MISC_MATERIALS.DICHLOROACETIC_ACID.getFluidStack(450), + MISC_MATERIALS.TRICHLOROACETIC_ACID.getFluidStack(450) }, null, 4 * 20, MaterialUtils.getVoltageForTier(5)); @@ -239,7 +218,7 @@ public class RecipeLoader_GlueLine { null, null, null, - new int[] {10000, 10000, 10000}, + new int[] { 10000, 10000, 10000 }, 20 * 30, 120); } @@ -282,11 +261,8 @@ public class RecipeLoader_GlueLine { private static void glueUsageRecipes() { // Braintech Tape recipe, PBI and superglue make 16 tape at once GT_Values.RA.addAssemblerRecipe( - new ItemStack[] { - GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Polybenzimidazole, 1L), - GT_ModHandler.getIC2Item("carbonMesh", 1L), - CI.getNumberedCircuit(10) - }, + new ItemStack[] { GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Polybenzimidazole, 1L), + GT_ModHandler.getIC2Item("carbonMesh", 1L), CI.getNumberedCircuit(10) }, MISC_MATERIALS.ETHYL_CYANOACRYLATE.getFluidStack(100), ItemList.Duct_Tape.get(16L), 120, @@ -294,7 +270,7 @@ public class RecipeLoader_GlueLine { // Maintenance Hatch recipe, using Braintech Tape GT_Values.RA.addAssemblerRecipe( - new ItemStack[] {ItemList.Hull_LV.get(1), ItemList.Duct_Tape.get(1), CI.getNumberedCircuit(1)}, + new ItemStack[] { ItemList.Hull_LV.get(1), ItemList.Duct_Tape.get(1), CI.getNumberedCircuit(1) }, MISC_MATERIALS.ETHYL_CYANOACRYLATE.getFluidStack(100), ItemList.Hatch_Maintenance.get(1), 120, @@ -302,22 +278,16 @@ public class RecipeLoader_GlueLine { // Graphene recipes from later wafer tiers, using superglue instead of the bronze age glue GT_Values.RA.addAssemblerRecipe( - new ItemStack[] { - ItemUtils.getItemStackOfAmountFromOreDict("dustGraphite", 64), - ItemList.Circuit_Silicon_Wafer4.get(2L), - CI.getNumberedCircuit(2) - }, + new ItemStack[] { ItemUtils.getItemStackOfAmountFromOreDict("dustGraphite", 64), + ItemList.Circuit_Silicon_Wafer4.get(2L), CI.getNumberedCircuit(2) }, MISC_MATERIALS.ETHYL_CYANOACRYLATE.getFluidStack(500), ItemUtils.getItemStackOfAmountFromOreDict("dustGraphene", 64), 400, 30720); GT_Values.RA.addAssemblerRecipe( - new ItemStack[] { - ItemUtils.getItemStackOfAmountFromOreDict("dustGraphite", 64), - ItemList.Circuit_Silicon_Wafer5.get(1L), - CI.getNumberedCircuit(2) - }, + new ItemStack[] { ItemUtils.getItemStackOfAmountFromOreDict("dustGraphite", 64), + ItemList.Circuit_Silicon_Wafer5.get(1L), CI.getNumberedCircuit(2) }, MISC_MATERIALS.ETHYL_CYANOACRYLATE.getFluidStack(250), ItemUtils.getItemStackOfAmountFromOreDict("dustGraphene", 64), 80, @@ -424,12 +394,10 @@ public class RecipeLoader_GlueLine { } if (LoadedMods.DreamCraft && LoadedMods.GalacticraftCore) { GT_Values.RA.addAssemblerRecipe( - new ItemStack[] { - ItemUtils.getItemStackFromFQRN("GalacticraftMars:item.itemBasicAsteroids:7", 1), - GT_OreDictUnificator.get(OrePrefixes.foil, Materials.Titanium, 8), - ItemUtils.getItemStackFromFQRN("dreamcraft:item.TungstenString", 8), - CI.getNumberedCircuit(1) - }, + new ItemStack[] { ItemUtils.getItemStackFromFQRN("GalacticraftMars:item.itemBasicAsteroids:7", 1), + GT_OreDictUnificator.get(OrePrefixes.foil, Materials.Titanium, 8), + ItemUtils.getItemStackFromFQRN("dreamcraft:item.TungstenString", 8), + CI.getNumberedCircuit(1) }, MISC_MATERIALS.ETHYL_CYANOACRYLATE.getFluidStack(576), ItemUtils.getItemStackFromFQRN("GalaxySpace:item.ThermalClothT2", 1), 600, diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_LFTR.java b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_LFTR.java index a693cfb6d9..9c92f40608 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_LFTR.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_LFTR.java @@ -1,5 +1,9 @@ package gtPlusPlus.xmod.gregtech.loaders.recipe; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidStack; + import gregtech.api.enums.Materials; import gregtech.api.util.GTPP_Recipe; import gregtech.api.util.GasSpargingRecipeMap; @@ -7,9 +11,6 @@ import gtPlusPlus.api.objects.data.AutoMap; import gtPlusPlus.core.material.ELEMENT; import gtPlusPlus.core.material.nuclear.FLUORIDES; import gtPlusPlus.core.material.nuclear.NUCLIDE; -import net.minecraft.item.ItemStack; -import net.minecraftforge.fluids.Fluid; -import net.minecraftforge.fluids.FluidStack; public class RecipeLoader_LFTR { @@ -60,18 +61,15 @@ public class RecipeLoader_LFTR { new ItemStack[] {}, new ItemStack[] {}, null, - new int[] {10000, 10000, 5000, 2500}, - new FluidStack[] {NUCLIDE.LiFBeF2ThF4UF4.getFluidStack(100), Li2BeF4}, - new FluidStack[] { - NUCLIDE.LiFBeF2UF4FP.getFluidStack(100), - NUCLIDE.LiFBeF2ThF4.getFluidStack(200), - FLUORIDES.URANIUM_HEXAFLUORIDE.getFluidStack(20), - FLUORIDES.URANIUM_HEXAFLUORIDE.getFluidStack(10) - }, + new int[] { 10000, 10000, 5000, 2500 }, + new FluidStack[] { NUCLIDE.LiFBeF2ThF4UF4.getFluidStack(100), Li2BeF4 }, + new FluidStack[] { NUCLIDE.LiFBeF2UF4FP.getFluidStack(100), NUCLIDE.LiFBeF2ThF4.getFluidStack(200), + FLUORIDES.URANIUM_HEXAFLUORIDE.getFluidStack(20), + FLUORIDES.URANIUM_HEXAFLUORIDE.getFluidStack(10) }, 100 * 20, // time 0, // cost 32768 * 4 // fuel value - ); + ); // LiFBeF2ZrF4UF4 - T2 GTPP_Recipe.GTPP_Recipe_Map.sLiquidFluorineThoriumReactorRecipes.addRecipe( @@ -79,18 +77,15 @@ public class RecipeLoader_LFTR { new ItemStack[] {}, new ItemStack[] {}, null, - new int[] {10000, 10000, 2500, 1250}, - new FluidStack[] {NUCLIDE.LiFBeF2ZrF4UF4.getFluidStack(100), Li2BeF4}, - new FluidStack[] { - NUCLIDE.LiFBeF2UF4FP.getFluidStack(50), - NUCLIDE.LiFBeF2ThF4.getFluidStack(100), - FLUORIDES.URANIUM_HEXAFLUORIDE.getFluidStack(10), - FLUORIDES.URANIUM_HEXAFLUORIDE.getFluidStack(5) - }, + new int[] { 10000, 10000, 2500, 1250 }, + new FluidStack[] { NUCLIDE.LiFBeF2ZrF4UF4.getFluidStack(100), Li2BeF4 }, + new FluidStack[] { NUCLIDE.LiFBeF2UF4FP.getFluidStack(50), NUCLIDE.LiFBeF2ThF4.getFluidStack(100), + FLUORIDES.URANIUM_HEXAFLUORIDE.getFluidStack(10), + FLUORIDES.URANIUM_HEXAFLUORIDE.getFluidStack(5) }, 100 * 20, // time 0, // cost 8192 * 4 // fuel value - ); + ); // LiFBeF2ZrF4U235 - T1 GTPP_Recipe.GTPP_Recipe_Map.sLiquidFluorineThoriumReactorRecipes.addRecipe( @@ -98,57 +93,42 @@ public class RecipeLoader_LFTR { new ItemStack[] {}, new ItemStack[] {}, null, - new int[] {10000, 10000, 1000, 500}, - new FluidStack[] {NUCLIDE.LiFBeF2ZrF4U235.getFluidStack(100), Li2BeF4}, - new FluidStack[] { - NUCLIDE.LiFBeF2UF4FP.getFluidStack(25), - NUCLIDE.LiFThF4.getFluidStack(50), - FLUORIDES.URANIUM_HEXAFLUORIDE.getFluidStack(4), - FLUORIDES.URANIUM_HEXAFLUORIDE.getFluidStack(2) - }, + new int[] { 10000, 10000, 1000, 500 }, + new FluidStack[] { NUCLIDE.LiFBeF2ZrF4U235.getFluidStack(100), Li2BeF4 }, + new FluidStack[] { NUCLIDE.LiFBeF2UF4FP.getFluidStack(25), NUCLIDE.LiFThF4.getFluidStack(50), + FLUORIDES.URANIUM_HEXAFLUORIDE.getFluidStack(4), + FLUORIDES.URANIUM_HEXAFLUORIDE.getFluidStack(2) }, 100 * 20, // time 0, // cost 8192 // fuel value - ); + ); // Sparging NEI Recipes GasSpargingRecipeMap.addRecipe( new FluidStack(mSpargeGases.get(0), 1000), NUCLIDE.LiFBeF2UF4FP.getFluidStack(50), NUCLIDE.Sparged_LiFBeF2UF4FP.getFluidStack(50), - new FluidStack[] { - new FluidStack(mNobleGases.get(1), 10), - new FluidStack(mNobleGases.get(2), 10), - new FluidStack(mNobleGases.get(3), 10), - new FluidStack(mNobleGases.get(4), 10), - new FluidStack(mNobleGases.get(5), 10) - }, - new int[] {20000, 20000, 20000, 20000, 20000}); + new FluidStack[] { new FluidStack(mNobleGases.get(1), 10), new FluidStack(mNobleGases.get(2), 10), + new FluidStack(mNobleGases.get(3), 10), new FluidStack(mNobleGases.get(4), 10), + new FluidStack(mNobleGases.get(5), 10) }, + new int[] { 20000, 20000, 20000, 20000, 20000 }); GasSpargingRecipeMap.addRecipe( new FluidStack(mSpargeGases.get(1), 100), NUCLIDE.LiFThF4.getFluidStack(50), NUCLIDE.Sparged_LiFThF4.getFluidStack(50), - new FluidStack[] { - new FluidStack(mFluorideGases.get(1), 5), - new FluidStack(mFluorideGases.get(2), 5), - new FluidStack(mFluorideGases.get(3), 5), - new FluidStack(mFluorideGases.get(4), 5), - new FluidStack(mFluorideGases.get(5), 5) - }, - new int[] {1000, 1000, 1000, 1000, 1000}); + new FluidStack[] { new FluidStack(mFluorideGases.get(1), 5), new FluidStack(mFluorideGases.get(2), 5), + new FluidStack(mFluorideGases.get(3), 5), new FluidStack(mFluorideGases.get(4), 5), + new FluidStack(mFluorideGases.get(5), 5) }, + new int[] { 1000, 1000, 1000, 1000, 1000 }); GasSpargingRecipeMap.addRecipe( new FluidStack(mSpargeGases.get(1), 100), NUCLIDE.LiFBeF2ThF4.getFluidStack(50), NUCLIDE.Sparged_LiFBeF2ThF4.getFluidStack(50), - new FluidStack[] { - new FluidStack(mFluorideGases.get(1), 10), - new FluidStack(mFluorideGases.get(2), 10), - new FluidStack(mFluorideGases.get(3), 10), - new FluidStack(mFluorideGases.get(4), 10), - new FluidStack(mFluorideGases.get(5), 10) - }, - new int[] {2000, 2000, 2000, 2000, 2000}); + new FluidStack[] { new FluidStack(mFluorideGases.get(1), 10), new FluidStack(mFluorideGases.get(2), 10), + new FluidStack(mFluorideGases.get(3), 10), new FluidStack(mFluorideGases.get(4), 10), + new FluidStack(mFluorideGases.get(5), 10) }, + new int[] { 2000, 2000, 2000, 2000, 2000 }); } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_MolecularTransformer.java b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_MolecularTransformer.java index 28e72cc0b9..44115ea7d0 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_MolecularTransformer.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_MolecularTransformer.java @@ -21,8 +21,9 @@ public class RecipeLoader_MolecularTransformer { int aEU = MaterialUtils.getVoltageForTier(5); Logger.INFO("======================="); Logger.INFO("Generating GT recipe for Molecular Transformer."); - Logger.INFO("Input: " + aRecipe.inputStack.getDisplayName() + ", Output: " - + aRecipe.outputStack.getDisplayName() + ", EU/t: " + aEU); + Logger.INFO( + "Input: " + aRecipe.inputStack + .getDisplayName() + ", Output: " + aRecipe.outputStack.getDisplayName() + ", EU/t: " + aEU); float aTicks = (float) aRecipe.energyPerOperation / (float) aEU; Logger.INFO("Ticks: " + aTicks); int aTicksRoundedUp = MathUtils.roundToClosestInt(Math.ceil(aTicks)); diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_Nuclear.java b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_Nuclear.java index 4c0b93ce68..2a6715c1ac 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_Nuclear.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_Nuclear.java @@ -2,6 +2,9 @@ package gtPlusPlus.xmod.gregtech.loaders.recipe; import static gtPlusPlus.core.lib.CORE.GTNH; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidStack; + import gregtech.api.enums.GT_Values; import gregtech.api.enums.ItemList; import gregtech.api.enums.Materials; @@ -20,8 +23,6 @@ import gtPlusPlus.core.recipe.common.CI; import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.minecraft.FluidUtils; import gtPlusPlus.core.util.minecraft.ItemUtils; -import net.minecraft.item.ItemStack; -import net.minecraftforge.fluids.FluidStack; public class RecipeLoader_Nuclear { @@ -98,7 +99,7 @@ public class RecipeLoader_Nuclear { ELEMENT.getInstance().URANIUM233.getSmallDust(1), ELEMENT.getInstance().URANIUM235.getSmallDust(1), ELEMENT.getInstance().PLUTONIUM239.getTinyDust(1), - new int[] {0, 0, 1000, 1000, 1000, 500}, + new int[] { 0, 0, 1000, 1000, 1000, 500 }, 500 * 20, 4000); // Mox @@ -113,7 +114,7 @@ public class RecipeLoader_Nuclear { ELEMENT.getInstance().PLUTONIUM239.getTinyDust(1), ELEMENT.getInstance().PLUTONIUM238.getTinyDust(1), ELEMENT.getInstance().PLUTONIUM239.getTinyDust(1), - new int[] {0, 0, 500, 500, 500, 500}, + new int[] { 0, 0, 500, 500, 500, 500 }, 750 * 20, 4000); @@ -129,14 +130,14 @@ public class RecipeLoader_Nuclear { ELEMENT.getInstance().LUTETIUM.getSmallDust(1), ELEMENT.getInstance().POLONIUM.getSmallDust(1), ELEMENT.getInstance().THALLIUM.getTinyDust(1), - new int[] {0, 0, 5000, 5000, 5000, 2500}, + new int[] { 0, 0, 5000, 5000, 5000, 2500 }, 250 * 20, 4000); } private static void chemicalBathRecipes() { - int[] chances = {9000, 6000, 3000}; + int[] chances = { 9000, 6000, 3000 }; GT_Values.RA.addChemicalBathRecipe( ItemUtils.getItemStackOfAmountFromOreDict("dustTin", 12), FluidUtils.getFluidStack("chlorine", 2400), @@ -147,7 +148,7 @@ public class RecipeLoader_Nuclear { 30 * 20, 480); - chances = new int[] {9000, 3000, 1000}; + chances = new int[] { 9000, 3000, 1000 }; GT_Values.RA.addChemicalBathRecipe( ItemUtils.getItemStackOfAmountFromOreDict("dustRutile", 5), FluidUtils.getFluidStack("chlorine", 4000), @@ -171,8 +172,8 @@ public class RecipeLoader_Nuclear { private static void chemicalReactorRecipes() { - ItemStack aGtHydrofluoricAcid = - ItemUtils.getItemStackOfAmountFromOreDictNoBroken("cellHydrofluoricAcid_GT5U", 2); + ItemStack aGtHydrofluoricAcid = ItemUtils + .getItemStackOfAmountFromOreDictNoBroken("cellHydrofluoricAcid_GT5U", 2); GT_Values.RA.addChemicalRecipe( ItemUtils.getItemStackOfAmountFromOreDict("dustLithiumCarbonate", 5), // Input @@ -354,38 +355,36 @@ public class RecipeLoader_Nuclear { // Makes 7-Lithium CORE.RA.addDehydratorRecipe( - new ItemStack[] { - CI.getNumberedAdvancedCircuit(14), - ItemUtils.getItemStackOfAmountFromOreDict("cellSulfuricLithium", 1) - }, + new ItemStack[] { CI.getNumberedAdvancedCircuit(14), + ItemUtils.getItemStackOfAmountFromOreDict("cellSulfuricLithium", 1) }, FluidUtils.getFluidStack("sulfuriclithium", 440), null, - new ItemStack[] { - CI.emptyCells(1), - ItemUtils.getItemStackOfAmountFromOreDict("dustSulfur", 3), - ItemUtils.getItemStackOfAmountFromOreDict("dustCopper", 1), - ItemUtils.getItemStackOfAmountFromOreDict("dustSodium", 1), - ItemUtils.getItemStackOfAmountFromOreDict("dustCarbon", 1), - ItemUtils.getItemStackOfAmountFromOreDict("dustLithium7", 4) - }, - new int[] {10000, 10000, 10000, 10000, 10000}, + new ItemStack[] { CI.emptyCells(1), ItemUtils.getItemStackOfAmountFromOreDict("dustSulfur", 3), + ItemUtils.getItemStackOfAmountFromOreDict("dustCopper", 1), + ItemUtils.getItemStackOfAmountFromOreDict("dustSodium", 1), + ItemUtils.getItemStackOfAmountFromOreDict("dustCarbon", 1), + ItemUtils.getItemStackOfAmountFromOreDict("dustLithium7", 4) }, + new int[] { 10000, 10000, 10000, 10000, 10000 }, 30 * 20, 30); // Makes Lithium Carbonate CORE.RA.addDehydratorRecipe( - new ItemStack[] {CI.emptyCells(12), ItemUtils.getItemStackOfAmountFromOreDict("dustLepidolite", 20) - }, // Item input (Array, up to 2) + new ItemStack[] { CI.emptyCells(12), ItemUtils.getItemStackOfAmountFromOreDict("dustLepidolite", 20) }, // Item + // input + // (Array, + // up + // to + // 2) FluidUtils.getFluidStack("sulfuricacid", 10000), FluidUtils.getFluidStack("sulfuriclithium", 10000), - new ItemStack[] { - ItemUtils.getItemStackOfAmountFromOreDict("dustPotassium", 1), - GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Aluminium, 4), - ItemUtils.getItemStackOfAmountFromOreDict("cellOxygen", 10), - ItemUtils.getItemStackOfAmountFromOreDict("cellFluorine", 2), - ItemUtils.getItemStackOfAmountFromOreDict("dustLithiumCarbonate", 3), // LithiumCarbonate + new ItemStack[] { ItemUtils.getItemStackOfAmountFromOreDict("dustPotassium", 1), + GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Aluminium, 4), + ItemUtils.getItemStackOfAmountFromOreDict("cellOxygen", 10), + ItemUtils.getItemStackOfAmountFromOreDict("cellFluorine", 2), + ItemUtils.getItemStackOfAmountFromOreDict("dustLithiumCarbonate", 3), // LithiumCarbonate }, // Output Array of Items - Upto 9, - new int[] {10000, 10000, 10000, 10000, 10000}, + new int[] { 10000, 10000, 10000, 10000, 10000 }, 75 * 20, // Time in ticks 1000); // EU @@ -394,13 +393,12 @@ public class RecipeLoader_Nuclear { || LoadedMods.IHL) { // CaO + H2O = Ca(OH)2 CORE.RA.addDehydratorRecipe( - new ItemStack[] { - CI.getNumberedBioCircuit(20), ItemUtils.getItemStackOfAmountFromOreDict("dustQuicklime", 2) - }, + new ItemStack[] { CI.getNumberedBioCircuit(20), + ItemUtils.getItemStackOfAmountFromOreDict("dustQuicklime", 2) }, FluidUtils.getFluidStack("water", 1000), null, // Fluid output (slot 2) - new ItemStack[] {ItemUtils.getItemStackOfAmountFromOreDict("dustCalciumHydroxide", 5)}, // Output - new int[] {10000}, + new ItemStack[] { ItemUtils.getItemStackOfAmountFromOreDict("dustCalciumHydroxide", 5) }, // Output + new int[] { 10000 }, 12 * 20, // Time in ticks 120); // EU } else { @@ -414,39 +412,35 @@ public class RecipeLoader_Nuclear { // 2 LiOH + CaCO3 CORE.RA.addDehydratorRecipe( - new ItemStack[] { - CI.getNumberedAdvancedCircuit(20), ItemUtils.getItemStackOfAmountFromOreDict("dustLi2CO3CaOH2", 5) - }, // Item + new ItemStack[] { CI.getNumberedAdvancedCircuit(20), + ItemUtils.getItemStackOfAmountFromOreDict("dustLi2CO3CaOH2", 5) }, // Item null, // Fluid input (slot 1) null, // Fluid output (slot 2) - new ItemStack[] { - ItemUtils.getItemStackOfAmountFromOreDict("dustLithiumHydroxide", 2), - ItemUtils.getItemStackOfAmountFromOreDict("dustCalciumCarbonate", 3) - }, // Output - new int[] {10000, 10000}, + new ItemStack[] { ItemUtils.getItemStackOfAmountFromOreDict("dustLithiumHydroxide", 2), + ItemUtils.getItemStackOfAmountFromOreDict("dustCalciumCarbonate", 3) }, // Output + new int[] { 10000, 10000 }, 120 * 20, // Time in ticks 1000); // EU // LiOH Liquid to Dust CORE.RA.addDehydratorRecipe( - new ItemStack[] {CI.getNumberedAdvancedCircuit(22)}, + new ItemStack[] { CI.getNumberedAdvancedCircuit(22) }, FluidUtils.getFluidStack("lithiumhydroxide", 144), null, - new ItemStack[] {ItemUtils.getItemStackOfAmountFromOreDict("dustLithiumHydroxide", 1)}, - new int[] {10000}, + new ItemStack[] { ItemUtils.getItemStackOfAmountFromOreDict("dustLithiumHydroxide", 1) }, + new int[] { 10000 }, 1 * 20, // Time in ticks 64); // EU // Zirconium Chloride -> TetraFluoride FluidStack aHydrogenChloride = new FluidStack(GenericChem.HydrochloricAcid, 9000); CORE.RA.addDehydratorRecipe( - new ItemStack[] { - CI.getNumberedAdvancedCircuit(11), ItemUtils.getItemStackOfAmountFromOreDict("dustCookedZrCl4", 9), - }, // Item + new ItemStack[] { CI.getNumberedAdvancedCircuit(11), + ItemUtils.getItemStackOfAmountFromOreDict("dustCookedZrCl4", 9), }, // Item FluidUtils.getFluidStack("hydrofluoricacid", 9 * 144), aHydrogenChloride, - new ItemStack[] {FLUORIDES.ZIRCONIUM_TETRAFLUORIDE.getDust(9)}, - new int[] {10000}, + new ItemStack[] { FLUORIDES.ZIRCONIUM_TETRAFLUORIDE.getDust(9) }, + new int[] { 10000 }, 120 * 20, // Time in ticks 500); // EU @@ -454,39 +448,35 @@ public class RecipeLoader_Nuclear { FluidStack aGregtechHydro = FluidUtils.getFluidStack("hydrofluoricacid_gt5u", 1); if (aGregtechHydro != null || Utils.getGregtechVersionAsInt() >= 50929) { CORE.RA.addDehydratorRecipe( - new ItemStack[] { - CI.getNumberedAdvancedCircuit(10), - ItemUtils.getItemStackOfAmountFromOreDict("dustCookedZrCl4", 9) - }, + new ItemStack[] { CI.getNumberedAdvancedCircuit(10), + ItemUtils.getItemStackOfAmountFromOreDict("dustCookedZrCl4", 9) }, FluidUtils.getFluidStack("hydrofluoricacid_gt5u", 18 * 144), aHydrogenChloride, - new ItemStack[] {FLUORIDES.ZIRCONIUM_TETRAFLUORIDE.getDust(9)}, - new int[] {10000}, + new ItemStack[] { FLUORIDES.ZIRCONIUM_TETRAFLUORIDE.getDust(9) }, + new int[] { 10000 }, 240 * 20, // Time in ticks 500); // EU } // Be(OH)2 + 2 (NH4)HF2 → (NH4)2BeF4 + 2 H2O CORE.RA.addDehydratorRecipe( - new ItemStack[] {CI.getNumberedAdvancedCircuit(6), FLUORIDES.AMMONIUM_BIFLUORIDE.getCell(4)}, + new ItemStack[] { CI.getNumberedAdvancedCircuit(6), FLUORIDES.AMMONIUM_BIFLUORIDE.getCell(4) }, FLUORIDES.BERYLLIUM_HYDROXIDE.getFluidStack(2000), // Fluid input (slot 1) FLUORIDES.AMMONIUM_TETRAFLUOROBERYLLATE.getFluidStack(6000), - new ItemStack[] {ItemUtils.getItemStackOfAmountFromOreDict("cellWater", 4)}, - new int[] {10000}, + new ItemStack[] { ItemUtils.getItemStackOfAmountFromOreDict("cellWater", 4) }, + new int[] { 10000 }, 32 * 20, // Time in ticks 64); // EU // (NH4)2BeF4 → 2 NH3 + 2 HF + BeF2 CORE.RA.addDehydratorRecipe( - new ItemStack[] {CI.getNumberedAdvancedCircuit(17), CI.emptyCells(5)}, + new ItemStack[] { CI.getNumberedAdvancedCircuit(17), CI.emptyCells(5) }, FLUORIDES.AMMONIUM_TETRAFLUOROBERYLLATE.getFluidStack(5000), null, - new ItemStack[] { - MISC_MATERIALS.AMMONIA.getCell(2), - ItemUtils.getItemStackOfAmountFromOreDict("cellHydrofluoricAcid", 2), - FLUORIDES.BERYLLIUM_FLUORIDE.getCell(1) - }, - new int[] {10000, 10000, 10000}, + new ItemStack[] { MISC_MATERIALS.AMMONIA.getCell(2), + ItemUtils.getItemStackOfAmountFromOreDict("cellHydrofluoricAcid", 2), + FLUORIDES.BERYLLIUM_FLUORIDE.getCell(1) }, + new int[] { 10000, 10000, 10000 }, 5 * 60 * 20, 120); } @@ -499,7 +489,7 @@ public class RecipeLoader_Nuclear { ItemUtils.getItemStackOfAmountFromOreDict("dustBauxite", 1), ItemUtils.getItemStackOfAmountFromOreDict("dustSmallRutile", 1), ItemUtils.getItemStackOfAmountFromOreDict("nuggetZirconium", 1), - new int[] {10000, 2500, 4000}, + new int[] { 10000, 2500, 4000 }, 20 * 20, 24); @@ -509,7 +499,7 @@ public class RecipeLoader_Nuclear { ItemUtils.getItemStackOfAmountFromOreDict("dustMagnetite", 1), ItemUtils.getItemStackOfAmountFromOreDict("dustSmallZircon", 1), ItemUtils.getItemStackOfAmountFromOreDict("dustTinyZircon", 1), - new int[] {10000, 1250, 2500}, + new int[] { 10000, 1250, 2500 }, 20 * 20, 24); GT_Values.RA.addElectromagneticSeparatorRecipe( @@ -517,7 +507,7 @@ public class RecipeLoader_Nuclear { ItemUtils.getItemStackOfAmountFromOreDict("dustCassiterite", 1), ItemUtils.getItemStackOfAmountFromOreDict("dustSmallZircon", 1), ItemUtils.getItemStackOfAmountFromOreDict("dustTinyZircon", 1), - new int[] {10000, 1250, 2500}, + new int[] { 10000, 1250, 2500 }, 20 * 20, 24); } @@ -534,11 +524,20 @@ public class RecipeLoader_Nuclear { 500); // LFTR Fuel 1 CORE.RA.addFluidExtractionRecipe( - NUCLIDE.LiFBeF2ZrF4U235.getDust(1), NUCLIDE.LiFBeF2ZrF4U235.getFluidStack(144), 250, 1000); + NUCLIDE.LiFBeF2ZrF4U235.getDust(1), + NUCLIDE.LiFBeF2ZrF4U235.getFluidStack(144), + 250, + 1000); CORE.RA.addFluidExtractionRecipe( - NUCLIDE.LiFBeF2ZrF4UF4.getDust(1), NUCLIDE.LiFBeF2ZrF4UF4.getFluidStack(144), 150, 1500); + NUCLIDE.LiFBeF2ZrF4UF4.getDust(1), + NUCLIDE.LiFBeF2ZrF4UF4.getFluidStack(144), + 150, + 1500); CORE.RA.addFluidExtractionRecipe( - NUCLIDE.LiFBeF2ThF4UF4.getDust(1), NUCLIDE.LiFBeF2ThF4UF4.getFluidStack(144), 150, 2000); + NUCLIDE.LiFBeF2ThF4UF4.getDust(1), + NUCLIDE.LiFBeF2ThF4UF4.getFluidStack(144), + 150, + 2000); // ZIRCONIUM_TETRAFLUORIDE CORE.RA.addFluidExtractionRecipe( @@ -574,82 +573,70 @@ public class RecipeLoader_Nuclear { // Zirconium GT_Values.RA.addSifterRecipe( ItemUtils.getItemStackOfAmountFromOreDict("crushedPurifiedIlmenite", 1), - new ItemStack[] { - ItemUtils.getItemStackOfAmountFromOreDict("dustIron", 1), - ItemUtils.getItemStackOfAmountFromOreDict("dustWroughtIron", 1), - ItemUtils.getItemStackOfAmountFromOreDict("dustZirconium", 1), - ItemUtils.getItemStackOfAmountFromOreDict("dustZirconium", 1), - ItemUtils.getItemStackOfAmountFromOreDict("dustHafnium", 1), - ItemUtils.getItemStackOfAmountFromOreDict("dustHafnium", 1) - }, - new int[] {5000, 278, 1000, 1000, 300, 300}, + new ItemStack[] { ItemUtils.getItemStackOfAmountFromOreDict("dustIron", 1), + ItemUtils.getItemStackOfAmountFromOreDict("dustWroughtIron", 1), + ItemUtils.getItemStackOfAmountFromOreDict("dustZirconium", 1), + ItemUtils.getItemStackOfAmountFromOreDict("dustZirconium", 1), + ItemUtils.getItemStackOfAmountFromOreDict("dustHafnium", 1), + ItemUtils.getItemStackOfAmountFromOreDict("dustHafnium", 1) }, + new int[] { 5000, 278, 1000, 1000, 300, 300 }, 20 * 30, 500); GT_Values.RA.addSifterRecipe( ItemUtils.getItemStackOfAmountFromOreDict("crushedPurifiedTin", 1), - new ItemStack[] { - ItemUtils.getItemStackOfAmountFromOreDict("dustTin", 1), - ItemUtils.getItemStackOfAmountFromOreDict("dustZinc", 1), - ItemUtils.getItemStackOfAmountFromOreDict("dustZirconium", 1), - ItemUtils.getItemStackOfAmountFromOreDict("dustZirconium", 1), - ItemUtils.getItemStackOfAmountFromOreDict("dustZirconium", 1), - ItemUtils.getItemStackOfAmountFromOreDict("dustZirconium", 1) - }, - new int[] {10000, 556, 1500, 1000, 500, 500}, + new ItemStack[] { ItemUtils.getItemStackOfAmountFromOreDict("dustTin", 1), + ItemUtils.getItemStackOfAmountFromOreDict("dustZinc", 1), + ItemUtils.getItemStackOfAmountFromOreDict("dustZirconium", 1), + ItemUtils.getItemStackOfAmountFromOreDict("dustZirconium", 1), + ItemUtils.getItemStackOfAmountFromOreDict("dustZirconium", 1), + ItemUtils.getItemStackOfAmountFromOreDict("dustZirconium", 1) }, + new int[] { 10000, 556, 1500, 1000, 500, 500 }, 20 * 30, 500); GT_Values.RA.addSifterRecipe( ItemUtils.getItemStackOfAmountFromOreDict("crushedPurifiedCassiterite", 1), - new ItemStack[] { - ItemUtils.getItemStackOfAmountFromOreDict("dustCassiterite", 1), - ItemUtils.getItemStackOfAmountFromOreDict("dustTin", 1), - ItemUtils.getItemStackOfAmountFromOreDict("dustZirconium", 1), - ItemUtils.getItemStackOfAmountFromOreDict("dustZirconium", 1), - ItemUtils.getItemStackOfAmountFromOreDict("dustZirconium", 1), - ItemUtils.getItemStackOfAmountFromOreDict("dustZirconium", 1) - }, - new int[] {10000, 556, 1500, 1000, 500, 500}, + new ItemStack[] { ItemUtils.getItemStackOfAmountFromOreDict("dustCassiterite", 1), + ItemUtils.getItemStackOfAmountFromOreDict("dustTin", 1), + ItemUtils.getItemStackOfAmountFromOreDict("dustZirconium", 1), + ItemUtils.getItemStackOfAmountFromOreDict("dustZirconium", 1), + ItemUtils.getItemStackOfAmountFromOreDict("dustZirconium", 1), + ItemUtils.getItemStackOfAmountFromOreDict("dustZirconium", 1) }, + new int[] { 10000, 556, 1500, 1000, 500, 500 }, 20 * 30, 500); // Radium GT_Values.RA.addSifterRecipe( ItemUtils.getItemStackOfAmountFromOreDict("crushedPurifiedUranium", 1), - new ItemStack[] { - ItemUtils.getItemStackOfAmountFromOreDict("dustUranium", 1), - ItemUtils.getItemStackOfAmountFromOreDict("dustLead", 1), - ItemUtils.getItemStackOfAmountFromOreDict("dustRadium226", 1), - ItemUtils.getItemStackOfAmountFromOreDict("dustRadium226", 1), - ItemUtils.getItemStackOfAmountFromOreDict("dustRadium226", 1), - ItemUtils.getItemStackOfAmountFromOreDict("dustRadium226", 1) - }, - new int[] {10000, 556, 1000, 500, 500, 500}, + new ItemStack[] { ItemUtils.getItemStackOfAmountFromOreDict("dustUranium", 1), + ItemUtils.getItemStackOfAmountFromOreDict("dustLead", 1), + ItemUtils.getItemStackOfAmountFromOreDict("dustRadium226", 1), + ItemUtils.getItemStackOfAmountFromOreDict("dustRadium226", 1), + ItemUtils.getItemStackOfAmountFromOreDict("dustRadium226", 1), + ItemUtils.getItemStackOfAmountFromOreDict("dustRadium226", 1) }, + new int[] { 10000, 556, 1000, 500, 500, 500 }, 20 * 30, 500); GT_Values.RA.addSifterRecipe( ItemUtils.getItemStackOfAmountFromOreDict("crushedPurifiedUraninite", 1), - new ItemStack[] { - ItemUtils.getItemStackOfAmountFromOreDict("dustUraninite", 1), - ItemUtils.getItemStackOfAmountFromOreDict("dustUranium", 1), - ItemUtils.getItemStackOfAmountFromOreDict("dustRadium226", 1), - ItemUtils.getItemStackOfAmountFromOreDict("dustRadium226", 1), - ItemUtils.getItemStackOfAmountFromOreDict("dustRadium226", 1), - ItemUtils.getItemStackOfAmountFromOreDict("dustRadium226", 1) - }, - new int[] {10000, 556, 500, 250, 250, 250}, + new ItemStack[] { ItemUtils.getItemStackOfAmountFromOreDict("dustUraninite", 1), + ItemUtils.getItemStackOfAmountFromOreDict("dustUranium", 1), + ItemUtils.getItemStackOfAmountFromOreDict("dustRadium226", 1), + ItemUtils.getItemStackOfAmountFromOreDict("dustRadium226", 1), + ItemUtils.getItemStackOfAmountFromOreDict("dustRadium226", 1), + ItemUtils.getItemStackOfAmountFromOreDict("dustRadium226", 1) }, + new int[] { 10000, 556, 500, 250, 250, 250 }, 20 * 30, 500); GT_Values.RA.addSifterRecipe( ItemUtils.getItemStackOfAmountFromOreDict("crushedPurifiedPitchblende", 1), - new ItemStack[] { - ItemUtils.getItemStackOfAmountFromOreDict("dustPitchblende", 1), - ItemUtils.getItemStackOfAmountFromOreDict("dustLead", 1), - ItemUtils.getItemStackOfAmountFromOreDict("dustRadium226", 1), - ItemUtils.getItemStackOfAmountFromOreDict("dustRadium226", 1), - ItemUtils.getItemStackOfAmountFromOreDict("dustRadium226", 1), - ItemUtils.getItemStackOfAmountFromOreDict("dustRadium226", 1) - }, - new int[] {10000, 556, 500, 250, 250, 250}, + new ItemStack[] { ItemUtils.getItemStackOfAmountFromOreDict("dustPitchblende", 1), + ItemUtils.getItemStackOfAmountFromOreDict("dustLead", 1), + ItemUtils.getItemStackOfAmountFromOreDict("dustRadium226", 1), + ItemUtils.getItemStackOfAmountFromOreDict("dustRadium226", 1), + ItemUtils.getItemStackOfAmountFromOreDict("dustRadium226", 1), + ItemUtils.getItemStackOfAmountFromOreDict("dustRadium226", 1) }, + new int[] { 10000, 556, 500, 250, 250, 250 }, 20 * 30, 500); } @@ -657,6 +644,10 @@ public class RecipeLoader_Nuclear { private static void fluidHeater() { CORE.RA.addFluidHeaterRecipe( - FLUORIDES.SODIUM_FLUORIDE.getDust(1), null, FLUORIDES.SODIUM_FLUORIDE.getFluidStack(144), 20 * 30, 500); + FLUORIDES.SODIUM_FLUORIDE.getDust(1), + null, + FLUORIDES.SODIUM_FLUORIDE.getFluidStack(144), + 20 * 30, + 500); } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_NuclearFuelProcessing.java b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_NuclearFuelProcessing.java index 4e84e465c4..d2a6741221 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_NuclearFuelProcessing.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_NuclearFuelProcessing.java @@ -1,5 +1,8 @@ package gtPlusPlus.xmod.gregtech.loaders.recipe; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidStack; + import gregtech.api.enums.GT_Values; import gtPlusPlus.core.item.ModItems; import gtPlusPlus.core.item.chemistry.NuclearChem; @@ -11,8 +14,6 @@ import gtPlusPlus.core.recipe.common.CI; import gtPlusPlus.core.util.minecraft.FluidUtils; import gtPlusPlus.core.util.minecraft.ItemUtils; import gtPlusPlus.core.util.minecraft.MaterialUtils; -import net.minecraft.item.ItemStack; -import net.minecraftforge.fluids.FluidStack; public class RecipeLoader_NuclearFuelProcessing { @@ -85,17 +86,14 @@ public class RecipeLoader_NuclearFuelProcessing { CI.getNumberedAdvancedCircuit(17), ELEMENT.getInstance().FLUORINE.getCell(6), NUCLIDE.LiFThF4.getFluidStack(10000), - new ItemStack[] { - CI.emptyCells(5), - FLUORIDES.LITHIUM_FLUORIDE.getCell(1), - ItemUtils.getSimpleStack(ModItems.dustProtactinium233), - ItemUtils.getSimpleStack(ModItems.dustProtactinium233), - ItemUtils.getSimpleStack(ModItems.dustProtactinium233), - ItemUtils.getSimpleStack(ModItems.dustProtactinium233), - ItemUtils.getSimpleStack(ModItems.dustProtactinium233), - ItemUtils.getSimpleStack(ModItems.dustProtactinium233) - }, - new int[] {10000, 10000, 500, 500, 500, 250, 250, 250}, + new ItemStack[] { CI.emptyCells(5), FLUORIDES.LITHIUM_FLUORIDE.getCell(1), + ItemUtils.getSimpleStack(ModItems.dustProtactinium233), + ItemUtils.getSimpleStack(ModItems.dustProtactinium233), + ItemUtils.getSimpleStack(ModItems.dustProtactinium233), + ItemUtils.getSimpleStack(ModItems.dustProtactinium233), + ItemUtils.getSimpleStack(ModItems.dustProtactinium233), + ItemUtils.getSimpleStack(ModItems.dustProtactinium233) }, + new int[] { 10000, 10000, 500, 500, 500, 250, 250, 250 }, NUCLIDE.UF6F2.getFluidStack(1500), 20 * 60 * 10, MaterialUtils.getVoltageForTier(5)); @@ -103,18 +101,14 @@ public class RecipeLoader_NuclearFuelProcessing { CI.getNumberedAdvancedCircuit(18), ELEMENT.getInstance().FLUORINE.getCell(6), NUCLIDE.LiFBeF2ThF4.getFluidStack(10000), - new ItemStack[] { - CI.emptyCells(4), - FLUORIDES.LITHIUM_FLUORIDE.getCell(1), - FLUORIDES.BERYLLIUM_FLUORIDE.getCell(1), - ItemUtils.getSimpleStack(ModItems.dustProtactinium233), - ItemUtils.getSimpleStack(ModItems.dustProtactinium233), - ItemUtils.getSimpleStack(ModItems.dustProtactinium233), - ItemUtils.getSimpleStack(ModItems.dustProtactinium233), - ItemUtils.getSimpleStack(ModItems.dustProtactinium233), - ItemUtils.getSimpleStack(ModItems.dustProtactinium233) - }, - new int[] {10000, 10000, 10000, 1000, 1000, 1000, 500, 500, 500}, + new ItemStack[] { CI.emptyCells(4), FLUORIDES.LITHIUM_FLUORIDE.getCell(1), + FLUORIDES.BERYLLIUM_FLUORIDE.getCell(1), ItemUtils.getSimpleStack(ModItems.dustProtactinium233), + ItemUtils.getSimpleStack(ModItems.dustProtactinium233), + ItemUtils.getSimpleStack(ModItems.dustProtactinium233), + ItemUtils.getSimpleStack(ModItems.dustProtactinium233), + ItemUtils.getSimpleStack(ModItems.dustProtactinium233), + ItemUtils.getSimpleStack(ModItems.dustProtactinium233) }, + new int[] { 10000, 10000, 10000, 1000, 1000, 1000, 500, 500, 500 }, NUCLIDE.UF6F2.getFluidStack(3000), 20 * 60 * 10, MaterialUtils.getVoltageForTier(5)); @@ -124,17 +118,14 @@ public class RecipeLoader_NuclearFuelProcessing { CI.getNumberedAdvancedCircuit(7), ELEMENT.getInstance().FLUORINE.getCell(6), NUCLIDE.Sparged_LiFThF4.getFluidStack(10000), - new ItemStack[] { - CI.emptyCells(4), - FLUORIDES.LITHIUM_FLUORIDE.getCell(2), - ItemUtils.getSimpleStack(ModItems.dustProtactinium233), - ItemUtils.getSimpleStack(ModItems.dustProtactinium233), - ItemUtils.getSimpleStack(ModItems.dustProtactinium233), - ItemUtils.getSimpleStack(ModItems.dustProtactinium233), - ItemUtils.getSimpleStack(ModItems.dustProtactinium233), - ItemUtils.getSimpleStack(ModItems.dustProtactinium233) - }, - new int[] {10000, 10000, 1000, 1000, 1000, 1000, 1000, 1000}, + new ItemStack[] { CI.emptyCells(4), FLUORIDES.LITHIUM_FLUORIDE.getCell(2), + ItemUtils.getSimpleStack(ModItems.dustProtactinium233), + ItemUtils.getSimpleStack(ModItems.dustProtactinium233), + ItemUtils.getSimpleStack(ModItems.dustProtactinium233), + ItemUtils.getSimpleStack(ModItems.dustProtactinium233), + ItemUtils.getSimpleStack(ModItems.dustProtactinium233), + ItemUtils.getSimpleStack(ModItems.dustProtactinium233) }, + new int[] { 10000, 10000, 1000, 1000, 1000, 1000, 1000, 1000 }, NUCLIDE.UF6F2.getFluidStack(3000), 20 * 60 * 5, MaterialUtils.getVoltageForTier(5)); @@ -142,18 +133,14 @@ public class RecipeLoader_NuclearFuelProcessing { CI.getNumberedAdvancedCircuit(8), ELEMENT.getInstance().FLUORINE.getCell(6), NUCLIDE.Sparged_LiFBeF2ThF4.getFluidStack(10000), - new ItemStack[] { - CI.emptyCells(2), - FLUORIDES.LITHIUM_FLUORIDE.getCell(2), - FLUORIDES.BERYLLIUM_FLUORIDE.getCell(2), - ItemUtils.getSimpleStack(ModItems.dustProtactinium233), - ItemUtils.getSimpleStack(ModItems.dustProtactinium233), - ItemUtils.getSimpleStack(ModItems.dustProtactinium233), - ItemUtils.getSimpleStack(ModItems.dustProtactinium233), - ItemUtils.getSimpleStack(ModItems.dustProtactinium233), - ItemUtils.getSimpleStack(ModItems.dustProtactinium233) - }, - new int[] {10000, 10000, 10000, 2000, 2000, 2000, 2000, 2000, 2000}, + new ItemStack[] { CI.emptyCells(2), FLUORIDES.LITHIUM_FLUORIDE.getCell(2), + FLUORIDES.BERYLLIUM_FLUORIDE.getCell(2), ItemUtils.getSimpleStack(ModItems.dustProtactinium233), + ItemUtils.getSimpleStack(ModItems.dustProtactinium233), + ItemUtils.getSimpleStack(ModItems.dustProtactinium233), + ItemUtils.getSimpleStack(ModItems.dustProtactinium233), + ItemUtils.getSimpleStack(ModItems.dustProtactinium233), + ItemUtils.getSimpleStack(ModItems.dustProtactinium233) }, + new int[] { 10000, 10000, 10000, 2000, 2000, 2000, 2000, 2000, 2000 }, NUCLIDE.UF6F2.getFluidStack(6000), 20 * 60 * 5, MaterialUtils.getVoltageForTier(5)); @@ -163,32 +150,22 @@ public class RecipeLoader_NuclearFuelProcessing { 8, FLUORIDES.SODIUM_FLUORIDE.getCell(4), NUCLIDE.UF6F2.getFluidStack(3000), - new ItemStack[] { - ELEMENT.getInstance().FLUORINE.getCell(2), - FLUORIDES.URANIUM_HEXAFLUORIDE.getCell(2), - ELEMENT.getInstance().URANIUM233.getDust(1), - ELEMENT.getInstance().URANIUM233.getDust(1), - ELEMENT.getInstance().URANIUM233.getDust(1) - }, - new int[] {10000, 10000, 3000, 2000, 1000}, + new ItemStack[] { ELEMENT.getInstance().FLUORINE.getCell(2), FLUORIDES.URANIUM_HEXAFLUORIDE.getCell(2), + ELEMENT.getInstance().URANIUM233.getDust(1), ELEMENT.getInstance().URANIUM233.getDust(1), + ELEMENT.getInstance().URANIUM233.getDust(1) }, + new int[] { 10000, 10000, 3000, 2000, 1000 }, FLUORIDES.SODIUM_FLUORIDE.getFluidStack(2000), 20 * 60 * 10, MaterialUtils.getVoltageForTier(3)); // Reactor Core step 0 - Process Burnt Salt // Tier 1 Fuel - Gives back FLIBE and breeds U233 - /* CORE.RA.addReactorProcessingUnitRecipe( - CI.getNumberedAdvancedCircuit(1), - CI.emptyCells(2), - new FluidStack(NuclearChem.Burnt_LiFBeF2ZrF4U235, 4000), - new ItemStack[] { - FLUORIDES.LITHIUM_FLUORIDE.getCell(1), - ELEMENT.getInstance().URANIUM233.getCell(1) - }, - new int[] {10000, 10000}, - NUCLIDE.LiFBeF2.getFluidStack(2000), - 20 * 60 * 60, - MaterialUtils.getVoltageForTier(3));*/ + /* + * CORE.RA.addReactorProcessingUnitRecipe( CI.getNumberedAdvancedCircuit(1), CI.emptyCells(2), new + * FluidStack(NuclearChem.Burnt_LiFBeF2ZrF4U235, 4000), new ItemStack[] { FLUORIDES.LITHIUM_FLUORIDE.getCell(1), + * ELEMENT.getInstance().URANIUM233.getCell(1) }, new int[] {10000, 10000}, NUCLIDE.LiFBeF2.getFluidStack(2000), + * 20 * 60 * 60, MaterialUtils.getVoltageForTier(3)); + */ // LiBeF2UF4FP + F2 = LiFBeF2 & UF6F2FP // Reactor Core step 1 - Process Burnt Salt @@ -196,8 +173,8 @@ public class RecipeLoader_NuclearFuelProcessing { CI.getNumberedAdvancedCircuit(1), ELEMENT.getInstance().FLUORINE.getCell(1), NUCLIDE.LiFBeF2UF4FP.getFluidStack(1000), - new ItemStack[] {NUCLIDE.UF6F2FP.getCell(1)}, - new int[] {10000}, + new ItemStack[] { NUCLIDE.UF6F2FP.getCell(1) }, + new int[] { 10000 }, FluidUtils.getFluidStack(NuclearChem.Impure_LiFBeF2, 1000), 20 * 60 * 120, MaterialUtils.getVoltageForTier(3)); @@ -208,8 +185,8 @@ public class RecipeLoader_NuclearFuelProcessing { CI.getNumberedAdvancedCircuit(1), ELEMENT.getInstance().FLUORINE.getCell(3), NUCLIDE.Sparged_LiFBeF2UF4FP.getFluidStack(1000), - new ItemStack[] {CI.emptyCells(1), NUCLIDE.UF6F2FP.getCell(2)}, - new int[] {10000}, + new ItemStack[] { CI.emptyCells(1), NUCLIDE.UF6F2FP.getCell(2) }, + new int[] { 10000 }, FluidUtils.getFluidStack(NuclearChem.Impure_LiFBeF2, 2000), 20 * 60 * 60, MaterialUtils.getVoltageForTier(3)); @@ -219,18 +196,12 @@ public class RecipeLoader_NuclearFuelProcessing { 8, FLUORIDES.SODIUM_FLUORIDE.getCell(3), NUCLIDE.UF6F2FP.getFluidStack(2000), - new ItemStack[] { - ELEMENT.getInstance().FLUORINE.getCell(1), - FLUORIDES.URANIUM_HEXAFLUORIDE.getCell(2), - ELEMENT.getInstance().PHOSPHORUS.getDust(1), - ELEMENT.getInstance().PHOSPHORUS.getDust(1), - ELEMENT.getInstance().PHOSPHORUS.getDust(1), - ELEMENT.getInstance().PHOSPHORUS.getDust(1), - ELEMENT.getInstance().PHOSPHORUS.getDust(1), - ELEMENT.getInstance().PHOSPHORUS.getDust(1), - ELEMENT.getInstance().PHOSPHORUS.getDust(1) - }, - new int[] {10000, 10000, 5000, 5000, 5000, 5000, 5000, 5000, 5000}, + new ItemStack[] { ELEMENT.getInstance().FLUORINE.getCell(1), FLUORIDES.URANIUM_HEXAFLUORIDE.getCell(2), + ELEMENT.getInstance().PHOSPHORUS.getDust(1), ELEMENT.getInstance().PHOSPHORUS.getDust(1), + ELEMENT.getInstance().PHOSPHORUS.getDust(1), ELEMENT.getInstance().PHOSPHORUS.getDust(1), + ELEMENT.getInstance().PHOSPHORUS.getDust(1), ELEMENT.getInstance().PHOSPHORUS.getDust(1), + ELEMENT.getInstance().PHOSPHORUS.getDust(1) }, + new int[] { 10000, 10000, 5000, 5000, 5000, 5000, 5000, 5000, 5000 }, FLUORIDES.SODIUM_FLUORIDE.getFluidStack(2000), 20 * 60 * 10, MaterialUtils.getVoltageForTier(4)); @@ -238,7 +209,7 @@ public class RecipeLoader_NuclearFuelProcessing { // Reactor Core step 2B - Distillation GT_Values.RA.addDistillationTowerRecipe( FluidUtils.getFluidStack(NuclearChem.Impure_LiFBeF2, 1000), - new FluidStack[] {NUCLIDE.LiFBeF2.getFluidStack(250)}, + new FluidStack[] { NUCLIDE.LiFBeF2.getFluidStack(250) }, null, 450 * 20, MaterialUtils.getVoltageForTier(5)); @@ -246,51 +217,31 @@ public class RecipeLoader_NuclearFuelProcessing { // UF6 -> UF4 reduction // UF6 + LiFBeF2 + H2 -> LiFBeF2UF4 + HF CORE.RA.addBlastRecipe( - new ItemStack[] {FLUORIDES.URANIUM_HEXAFLUORIDE.getCell(1), NUCLIDE.LiFBeF2.getCell(1)}, - new FluidStack[] {ELEMENT.getInstance().HYDROGEN.getFluidStack(2000)}, - new ItemStack[] {ItemUtils.getItemStackOfAmountFromOreDict("cellHydrofluoricAcid", 2)}, - new FluidStack[] {NUCLIDE.LiFBeF2UF4.getFluidStack(3000)}, + new ItemStack[] { FLUORIDES.URANIUM_HEXAFLUORIDE.getCell(1), NUCLIDE.LiFBeF2.getCell(1) }, + new FluidStack[] { ELEMENT.getInstance().HYDROGEN.getFluidStack(2000) }, + new ItemStack[] { ItemUtils.getItemStackOfAmountFromOreDict("cellHydrofluoricAcid", 2) }, + new FluidStack[] { NUCLIDE.LiFBeF2UF4.getFluidStack(3000) }, 300 * 10, MaterialUtils.getVoltageForTier(5), 5400); // LiFBeF2ZrF4U235 - We can't add both ZrF4 and U235 here, so best we leave this disabled. - /*CORE.RA.addReactorProcessingUnitRecipe( - CI.getNumberedAdvancedCircuit(8), - NUCLIDE.LiFBeF2UF4.getCell(9), - ELEMENT.getInstance().URANIUM235.getFluidStack(1000), - new ItemStack[] { - CI.emptyCells(9) - }, - new int[] {10000}, - NUCLIDE.LiFBeF2ZrF4U235.getFluidStack(10000), - 20 * 60 * 5, - MaterialUtils.getVoltageForTier(4));*/ + /* + * CORE.RA.addReactorProcessingUnitRecipe( CI.getNumberedAdvancedCircuit(8), NUCLIDE.LiFBeF2UF4.getCell(9), + * ELEMENT.getInstance().URANIUM235.getFluidStack(1000), new ItemStack[] { CI.emptyCells(9) }, new int[] + * {10000}, NUCLIDE.LiFBeF2ZrF4U235.getFluidStack(10000), 20 * 60 * 5, MaterialUtils.getVoltageForTier(4)); + */ // LiFBeF2ZrF4UF4 - /*CORE.RA.addReactorProcessingUnitRecipe( - CI.getNumberedAdvancedCircuit(9), - NUCLIDE.LiFBeF2UF4.getCell(9), - FLUORIDES.ZIRCONIUM_TETRAFLUORIDE.getFluidStack(1000), - new ItemStack[] { - CI.emptyCells(9) - }, - new int[] {10000}, - NUCLIDE.LiFBeF2ZrF4UF4.getFluidStack(10000), - 20 * 60 * 5, - MaterialUtils.getVoltageForTier(5)); - - CORE.RA.addReactorProcessingUnitRecipe( - CI.getNumberedAdvancedCircuit(9), - FLUORIDES.ZIRCONIUM_TETRAFLUORIDE.getCell(1), - NUCLIDE.LiFBeF2UF4.getFluidStack(9000), - new ItemStack[] { - CI.emptyCells(1) - }, - new int[] {10000}, - NUCLIDE.LiFBeF2ZrF4UF4.getFluidStack(10000), - 20 * 60 * 5, - MaterialUtils.getVoltageForTier(5));*/ + /* + * CORE.RA.addReactorProcessingUnitRecipe( CI.getNumberedAdvancedCircuit(9), NUCLIDE.LiFBeF2UF4.getCell(9), + * FLUORIDES.ZIRCONIUM_TETRAFLUORIDE.getFluidStack(1000), new ItemStack[] { CI.emptyCells(9) }, new int[] + * {10000}, NUCLIDE.LiFBeF2ZrF4UF4.getFluidStack(10000), 20 * 60 * 5, MaterialUtils.getVoltageForTier(5)); + * CORE.RA.addReactorProcessingUnitRecipe( CI.getNumberedAdvancedCircuit(9), + * FLUORIDES.ZIRCONIUM_TETRAFLUORIDE.getCell(1), NUCLIDE.LiFBeF2UF4.getFluidStack(9000), new ItemStack[] { + * CI.emptyCells(1) }, new int[] {10000}, NUCLIDE.LiFBeF2ZrF4UF4.getFluidStack(10000), 20 * 60 * 5, + * MaterialUtils.getVoltageForTier(5)); + */ CORE.RA.addFissionFuel( FLUORIDES.ZIRCONIUM_TETRAFLUORIDE.getFluidStack(1000), @@ -308,29 +259,15 @@ public class RecipeLoader_NuclearFuelProcessing { MaterialUtils.getVoltageForTier(5)); // LiFBeF2ThF4UF4 - /*CORE.RA.addReactorProcessingUnitRecipe( - CI.getNumberedAdvancedCircuit(10), - NUCLIDE.LiFBeF2UF4.getCell(9), - FLUORIDES.THORIUM_TETRAFLUORIDE.getFluidStack(1000), - new ItemStack[] { - CI.emptyCells(9) - }, - new int[] {10000}, - NUCLIDE.LiFBeF2ThF4UF4.getFluidStack(10000), - 20 * 60 * 5, - MaterialUtils.getVoltageForTier(5)); - - CORE.RA.addReactorProcessingUnitRecipe( - CI.getNumberedAdvancedCircuit(10), - FLUORIDES.THORIUM_TETRAFLUORIDE.getCell(1), - NUCLIDE.LiFBeF2UF4.getFluidStack(9000), - new ItemStack[] { - CI.emptyCells(1) - }, - new int[] {10000}, - NUCLIDE.LiFBeF2ThF4UF4.getFluidStack(10000), - 20 * 60 * 5, - MaterialUtils.getVoltageForTier(5));*/ + /* + * CORE.RA.addReactorProcessingUnitRecipe( CI.getNumberedAdvancedCircuit(10), NUCLIDE.LiFBeF2UF4.getCell(9), + * FLUORIDES.THORIUM_TETRAFLUORIDE.getFluidStack(1000), new ItemStack[] { CI.emptyCells(9) }, new int[] {10000}, + * NUCLIDE.LiFBeF2ThF4UF4.getFluidStack(10000), 20 * 60 * 5, MaterialUtils.getVoltageForTier(5)); + * CORE.RA.addReactorProcessingUnitRecipe( CI.getNumberedAdvancedCircuit(10), + * FLUORIDES.THORIUM_TETRAFLUORIDE.getCell(1), NUCLIDE.LiFBeF2UF4.getFluidStack(9000), new ItemStack[] { + * CI.emptyCells(1) }, new int[] {10000}, NUCLIDE.LiFBeF2ThF4UF4.getFluidStack(10000), 20 * 60 * 5, + * MaterialUtils.getVoltageForTier(5)); + */ CORE.RA.addFissionFuel( FLUORIDES.THORIUM_TETRAFLUORIDE.getFluidStack(1000), diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/recipes/GregtechRecipeAdder.java b/src/main/java/gtPlusPlus/xmod/gregtech/recipes/GregtechRecipeAdder.java index 4c95ea4f22..e836112814 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/recipes/GregtechRecipeAdder.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/recipes/GregtechRecipeAdder.java @@ -4,6 +4,16 @@ import static gregtech.GT_Mod.GT_FML_LOGGER; import static gregtech.api.enums.GT_Values.RA; import static gtPlusPlus.core.lib.CORE.GTNH; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.oredict.OreDictionary; + import gregtech.api.GregTech_API; import gregtech.api.enums.ConfigCategories; import gregtech.api.enums.GT_Values; @@ -32,26 +42,12 @@ import gtPlusPlus.xmod.gregtech.common.StaticFields59; import gtPlusPlus.xmod.gregtech.common.helpers.FlotationRecipeHandler; import gtPlusPlus.xmod.gregtech.common.tileentities.generators.GregtechMetaTileEntity_RTG; import gtPlusPlus.xmod.gregtech.recipes.machines.RECIPEHANDLER_MatterFabricator; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import net.minecraft.item.ItemStack; -import net.minecraftforge.fluids.FluidStack; -import net.minecraftforge.oredict.OreDictionary; public class GregtechRecipeAdder implements IGregtech_RecipeAdder { @Override - public boolean addCokeOvenRecipe( - final ItemStack aInput1, - final ItemStack aInput2, - final FluidStack aFluidInput, - final FluidStack aFluidOutput, - final ItemStack aOutput, - int aDuration, - final int aEUt) { + public boolean addCokeOvenRecipe(final ItemStack aInput1, final ItemStack aInput2, final FluidStack aFluidInput, + final FluidStack aFluidOutput, final ItemStack aOutput, int aDuration, final int aEUt) { try { try { // RECIPEHANDLER_CokeOven.debug1(); @@ -91,10 +87,8 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder { try { // RECIPEHANDLER_CokeOven.debug3(aInput1, aInput2, aFluidInput, // aFluidOutput, aOutput, aDuration, aEUt); - if ((aFluidOutput == null) - || ((aDuration = GregTech_API.sRecipeFile.get( - "cokeoven", aFluidOutput.getFluid().getName(), aDuration)) - <= 0)) { + if ((aFluidOutput == null) || ((aDuration = GregTech_API.sRecipeFile + .get("cokeoven", aFluidOutput.getFluid().getName(), aDuration)) <= 0)) { // Utils.LOG_WARNING("aInput1:"+aInput1.toString()+" // aInput2:"+aInput2.toString()+" // aFluidInput:"+aFluidInput.toString()+" @@ -112,12 +106,12 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder { GTPP_Recipe aSpecialRecipe = new GTPP_Recipe( true, - new ItemStack[] {aInput1, aInput2}, - new ItemStack[] {aOutput}, + new ItemStack[] { aInput1, aInput2 }, + new ItemStack[] { aOutput }, null, new int[] {}, - new FluidStack[] {aFluidInput}, - new FluidStack[] {aFluidOutput}, + new FluidStack[] { aFluidInput }, + new FluidStack[] { aFluidOutput }, Math.max(1, aDuration), Math.max(1, aEUt), 0); @@ -129,21 +123,17 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder { // RECIPEHANDLER_CokeOven.debug4(aInput1, aInput2, aFluidInput, // aFluidOutput, aOutput, aDuration, aEUt); - /*if (aFluidInput == null && aInput2 != null) { - GTPP_Recipe.GTPP_Recipe_Map.sCokeOvenRecipes.addRecipe(true, new ItemStack[] { aInput1, aInput2 }, - new ItemStack[] { aOutput }, null, null, null, new FluidStack[] { aFluidOutput }, aDuration, - aEUt, 0); - } - else if (aFluidInput == null && aInput2 == null) { - GTPP_Recipe.GTPP_Recipe_Map.sCokeOvenRecipes.addRecipe(true, new ItemStack[] { aInput1 }, - new ItemStack[] { aOutput }, null, null, null, new FluidStack[] { aFluidOutput }, aDuration, - aEUt, 0); - } - else { - GTPP_Recipe.GTPP_Recipe_Map.sCokeOvenRecipes.addRecipe(true, new ItemStack[] { aInput1, aInput2 }, - new ItemStack[] { aOutput }, null, null, new FluidStack[] { aFluidInput }, - new FluidStack[] { aFluidOutput }, aDuration, aEUt, 0); - }*/ + /* + * if (aFluidInput == null && aInput2 != null) { + * GTPP_Recipe.GTPP_Recipe_Map.sCokeOvenRecipes.addRecipe(true, new ItemStack[] { aInput1, aInput2 }, + * new ItemStack[] { aOutput }, null, null, null, new FluidStack[] { aFluidOutput }, aDuration, aEUt, + * 0); } else if (aFluidInput == null && aInput2 == null) { + * GTPP_Recipe.GTPP_Recipe_Map.sCokeOvenRecipes.addRecipe(true, new ItemStack[] { aInput1 }, new + * ItemStack[] { aOutput }, null, null, null, new FluidStack[] { aFluidOutput }, aDuration, aEUt, 0); } + * else { GTPP_Recipe.GTPP_Recipe_Map.sCokeOvenRecipes.addRecipe(true, new ItemStack[] { aInput1, + * aInput2 }, new ItemStack[] { aOutput }, null, null, new FluidStack[] { aFluidInput }, new + * FluidStack[] { aFluidOutput }, aDuration, aEUt, 0); } + */ // RECIPEHANDLER_CokeOven.debug5(aInput1, aInput2, aFluidInput, // aFluidOutput, aOutput, aDuration, aEUt); @@ -167,30 +157,24 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder { } @Override - public boolean addCokeOvenRecipe( - int aCircuit, - ItemStack aInput2, - FluidStack[] aFluidInputs, - FluidStack[] aFluidOutputs, - ItemStack[] aOutputs, - int aDuration, - int aEUt) { + public boolean addCokeOvenRecipe(int aCircuit, ItemStack aInput2, FluidStack[] aFluidInputs, + FluidStack[] aFluidOutputs, ItemStack[] aOutputs, int aDuration, int aEUt) { return addCokeOvenRecipe( - aInput2, CI.getNumberedCircuit(aCircuit), aFluidInputs, aFluidOutputs, aOutputs, aDuration, aEUt); + aInput2, + CI.getNumberedCircuit(aCircuit), + aFluidInputs, + aFluidOutputs, + aOutputs, + aDuration, + aEUt); } @Override - public boolean addCokeOvenRecipe( - ItemStack aInput1, - ItemStack aInput2, - FluidStack[] aFluidInputs, - FluidStack[] aFluidOutputs, - ItemStack[] aOutputs, - int aDuration, - int aEUt) { + public boolean addCokeOvenRecipe(ItemStack aInput1, ItemStack aInput2, FluidStack[] aFluidInputs, + FluidStack[] aFluidOutputs, ItemStack[] aOutputs, int aDuration, int aEUt) { GTPP_Recipe aSpecialRecipe = new GTPP_Recipe( true, - new ItemStack[] {aInput1, aInput2}, + new ItemStack[] { aInput1, aInput2 }, aOutputs, null, new int[] {}, @@ -205,8 +189,8 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder { } @Override - public boolean addMatterFabricatorRecipe( - final FluidStack aFluidInput, final FluidStack aFluidOutput, final int aDuration, final int aEUt) { + public boolean addMatterFabricatorRecipe(final FluidStack aFluidInput, final FluidStack aFluidOutput, + final int aDuration, final int aEUt) { try { try { // RECIPEHANDLER_MatterFabricator.debug1(); @@ -237,7 +221,7 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder { null, new int[] {}, new FluidStack[] {}, - new FluidStack[] {aFluidOutput}, + new FluidStack[] { aFluidOutput }, aDuration, aEUt, 0); @@ -252,8 +236,8 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder { new ItemStack[] {}, null, new int[] {}, - new FluidStack[] {aFluidInput}, - new FluidStack[] {aFluidOutput}, + new FluidStack[] { aFluidInput }, + new FluidStack[] { aFluidOutput }, aDuration, aEUt, 0); @@ -277,29 +261,24 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder { } @Override - public boolean addMatterFabricatorRecipe( - final ItemStack aInputStack, - final FluidStack aFluidInput, - final FluidStack aFluidOutput, - final int aDuration, - final int aEUt) { + public boolean addMatterFabricatorRecipe(final ItemStack aInputStack, final FluidStack aFluidInput, + final FluidStack aFluidOutput, final int aDuration, final int aEUt) { try { try { if ((aFluidOutput == null) || (aInputStack == null)) { return false; } - } catch (final NullPointerException e) { - } + } catch (final NullPointerException e) {} try { if (aFluidInput == null) { GTPP_Recipe aRecipe = new GTPP_Recipe( false, - new ItemStack[] {aInputStack}, + new ItemStack[] { aInputStack }, new ItemStack[] {}, null, new int[] {}, new FluidStack[] {}, - new FluidStack[] {aFluidOutput}, + new FluidStack[] { aFluidOutput }, aDuration, aEUt, 0); @@ -307,12 +286,12 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder { } else { GTPP_Recipe aRecipe = new GTPP_Recipe( false, - new ItemStack[] {aInputStack}, + new ItemStack[] { aInputStack }, new ItemStack[] {}, null, new int[] {}, - new FluidStack[] {aFluidInput}, - new FluidStack[] {aFluidOutput}, + new FluidStack[] { aFluidInput }, + new FluidStack[] { aFluidOutput }, aDuration, aEUt, 0); @@ -340,83 +319,43 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder { } /* - * @Override public boolean addDehydratorRecipe(ItemStack aItemA, ItemStack - * aItemB, FluidStack aFluid, ItemStack[] aOutputItems, FluidStack - * aOutputFluid, int aDuration, int aEUt) { if ((aItemA == null) || (aItemB - * == null) || (aOutputItems == null)) { return false; } for (ItemStack - * tStack : aOutputItems) { if (tStack != null) { if ((aDuration = - * GregTech_API.sRecipeFile.get("dehydrator", aItemA, aDuration)) <= 0) { - * return false; } - * Recipe_GT.Gregtech_Recipe_Map.sChemicalDehydratorRecipes.addRecipe(true, - * new ItemStack[]{aItemA, aItemB}, aOutputItems, null, null, null, - * aDuration, aEUt, 0); RECIPEHANDLER_Dehydrator.debug5(aItemA, aItemB, - * aFluid, aOutputFluid, aOutputItems, aDuration, aEUt); return true; } } - * return false; } - * @Override public boolean addDehydratorRecipe(ItemStack aItemA, ItemStack - * aItemB, ItemStack[] aOutputItems, int aDuration, int aEUt) { if ((aItemA - * == null) || (aItemB == null) || (aOutputItems == null)) { return false; } - * if ((aDuration = GregTech_API.sRecipeFile.get("dehydrator", aItemA, - * aDuration)) <= 0) { return false; } - * Recipe_GT.Gregtech_Recipe_Map.sChemicalDehydratorRecipes.addRecipe(true, - * new ItemStack[]{aItemA, aItemB}, aOutputItems, null, null, null, - * aDuration, aEUt, 0); RECIPEHANDLER_Dehydrator.debug5(aItemA, aItemB, - * null, null, aOutputItems, aDuration, aEUt); return true; } - * @Override public boolean addDehydratorRecipe(FluidStack aFluid, - * FluidStack aOutputFluid, ItemStack[] aOutputItems, int aDuration, int - * aEUt){ if ((aFluid == null) || (aOutputFluid == null || aOutputItems == - * null)) { return false; } if ((aDuration = - * GregTech_API.sRecipeFile.get("dehydrator", aFluid.getUnlocalizedName(), - * aDuration)) <= 0) { return false; } - * Recipe_GT.Gregtech_Recipe_Map.sChemicalDehydratorRecipes.addRecipe(true, - * null, aOutputItems, null, new FluidStack[]{aFluid}, new - * FluidStack[]{aOutputFluid}, aDuration, aEUt, 0); - * RECIPEHANDLER_Dehydrator.debug5(null, null, aFluid, aOutputFluid, + * @Override public boolean addDehydratorRecipe(ItemStack aItemA, ItemStack aItemB, FluidStack aFluid, ItemStack[] + * aOutputItems, FluidStack aOutputFluid, int aDuration, int aEUt) { if ((aItemA == null) || (aItemB == null) || + * (aOutputItems == null)) { return false; } for (ItemStack tStack : aOutputItems) { if (tStack != null) { if + * ((aDuration = GregTech_API.sRecipeFile.get("dehydrator", aItemA, aDuration)) <= 0) { return false; } + * Recipe_GT.Gregtech_Recipe_Map.sChemicalDehydratorRecipes.addRecipe(true, new ItemStack[]{aItemA, aItemB}, + * aOutputItems, null, null, null, aDuration, aEUt, 0); RECIPEHANDLER_Dehydrator.debug5(aItemA, aItemB, aFluid, + * aOutputFluid, aOutputItems, aDuration, aEUt); return true; } } return false; } + * @Override public boolean addDehydratorRecipe(ItemStack aItemA, ItemStack aItemB, ItemStack[] aOutputItems, int + * aDuration, int aEUt) { if ((aItemA == null) || (aItemB == null) || (aOutputItems == null)) { return false; } if + * ((aDuration = GregTech_API.sRecipeFile.get("dehydrator", aItemA, aDuration)) <= 0) { return false; } + * Recipe_GT.Gregtech_Recipe_Map.sChemicalDehydratorRecipes.addRecipe(true, new ItemStack[]{aItemA, aItemB}, + * aOutputItems, null, null, null, aDuration, aEUt, 0); RECIPEHANDLER_Dehydrator.debug5(aItemA, aItemB, null, null, * aOutputItems, aDuration, aEUt); return true; } + * @Override public boolean addDehydratorRecipe(FluidStack aFluid, FluidStack aOutputFluid, ItemStack[] + * aOutputItems, int aDuration, int aEUt){ if ((aFluid == null) || (aOutputFluid == null || aOutputItems == null)) { + * return false; } if ((aDuration = GregTech_API.sRecipeFile.get("dehydrator", aFluid.getUnlocalizedName(), + * aDuration)) <= 0) { return false; } Recipe_GT.Gregtech_Recipe_Map.sChemicalDehydratorRecipes.addRecipe(true, + * null, aOutputItems, null, new FluidStack[]{aFluid}, new FluidStack[]{aOutputFluid}, aDuration, aEUt, 0); + * RECIPEHANDLER_Dehydrator.debug5(null, null, aFluid, aOutputFluid, aOutputItems, aDuration, aEUt); return true; } + */ + + /* + * @Override public boolean addDehydratorRecipe(final ItemStack aInput, final FluidStack aFluid, final ItemStack[] + * aOutput, int aDuration, final int aEUt) { Logger.WARNING("Trying to add a Dehydrator recipe."); try { if ((aInput + * == null) || (aFluid == null) || (aOutput == null)) { return false; } if ((aDuration = + * GregTech_API.sRecipeFile.get("dehydrator", aInput, aDuration)) <= 0) { return false; } GTPP_Recipe aRecipe = new + * GTPP_Recipe( false, new ItemStack[] { aInput }, aOutput, null, new int[] {}, new FluidStack[] { aFluid }, new + * FluidStack[] {}, aDuration, aEUt, 0); GTPP_Recipe.GTPP_Recipe_Map.sChemicalDehydratorRecipes.addRecipe(aRecipe); + * // RECIPEHANDLER_Dehydrator.debug5(aInput, null, aFluid, null, // aOutput, aDuration, aEUt); return true; } catch + * (final NullPointerException e) { Logger.WARNING("FAILED TO LOAD RECIPES - NULL POINTER SOMEWHERE"); return false; + * } } */ - /*@Override - public boolean addDehydratorRecipe(final ItemStack aInput, final FluidStack aFluid, final ItemStack[] aOutput, - int aDuration, final int aEUt) { - Logger.WARNING("Trying to add a Dehydrator recipe."); - try { - if ((aInput == null) || (aFluid == null) || (aOutput == null)) { - return false; - } - if ((aDuration = GregTech_API.sRecipeFile.get("dehydrator", aInput, aDuration)) <= 0) { - return false; - } - GTPP_Recipe aRecipe = new GTPP_Recipe( - false, - new ItemStack[] { aInput }, - aOutput, - null, - new int[] {}, - new FluidStack[] { aFluid }, - new FluidStack[] {}, - aDuration, - aEUt, - 0); - GTPP_Recipe.GTPP_Recipe_Map.sChemicalDehydratorRecipes.addRecipe(aRecipe); - // RECIPEHANDLER_Dehydrator.debug5(aInput, null, aFluid, null, - // aOutput, aDuration, aEUt); - return true; - } - catch (final NullPointerException e) { - Logger.WARNING("FAILED TO LOAD RECIPES - NULL POINTER SOMEWHERE"); - return false; - } - }*/ - - @Override - public boolean addDehydratorRecipe( - final ItemStack[] aInput, - final FluidStack aFluidInput, - final FluidStack aFluidOutput, - final ItemStack[] aOutputItems, - final int[] aChances, - int aDuration, - final int aEUt) - throws IndexOutOfBoundsException { + @Override + public boolean addDehydratorRecipe(final ItemStack[] aInput, final FluidStack aFluidInput, + final FluidStack aFluidOutput, final ItemStack[] aOutputItems, final int[] aChances, int aDuration, + final int aEUt) throws IndexOutOfBoundsException { Logger.WARNING("Trying to add a Dehydrator recipe."); try { if (aInput != null && aInput.length > 0) { @@ -431,8 +370,11 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder { } } if (aFluidInput != null) { - Logger.WARNING("Recipe requires input: " - + aFluidInput.getFluid().getName() + " " + aFluidInput.amount + "mbs"); + Logger.WARNING( + "Recipe requires input: " + aFluidInput.getFluid().getName() + + " " + + aFluidInput.amount + + "mbs"); } if (((aInput == null || aInput.length == 0) && (aFluidInput == null)) || ((aOutputItems == null || aOutputItems.length == 0) && (aFluidOutput == null))) { @@ -451,8 +393,8 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder { aOutputItems, null, aChances, - new FluidStack[] {aFluidInput}, - new FluidStack[] {aFluidOutput}, + new FluidStack[] { aFluidInput }, + new FluidStack[] { aFluidOutput }, Math.max(1, aDuration), Math.max(1, aEUt), 0); @@ -462,19 +404,14 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder { GTPP_Recipe.GTPP_Recipe_Map.sChemicalDehydratorRecipes.add(aSpecialRecipe); aSize = GTPP_Recipe.GTPP_Recipe_Map.sChemicalDehydratorRecipes.mRecipeList.size(); - /*if (aInput.length == 1) { - Logger.WARNING("Dehydrator recipe only has a single input item."); - GTPP_Recipe.GTPP_Recipe_Map.sChemicalDehydratorRecipes.addRecipe(true, aInput, aOutputItems, null, - aChances, new FluidStack[] { aFluidInput }, new FluidStack[] { aFluidOutput }, aDuration, aEUt, - 0); - - } - else { - Logger.WARNING("Dehydrator recipe has two input items."); - GTPP_Recipe.GTPP_Recipe_Map.sChemicalDehydratorRecipes.addRecipe(true, aInput, aOutputItems, null, - aChances, new FluidStack[] { aFluidInput }, new FluidStack[] { aFluidOutput }, aDuration, aEUt, - 0); - }*/ + /* + * if (aInput.length == 1) { Logger.WARNING("Dehydrator recipe only has a single input item."); + * GTPP_Recipe.GTPP_Recipe_Map.sChemicalDehydratorRecipes.addRecipe(true, aInput, aOutputItems, null, + * aChances, new FluidStack[] { aFluidInput }, new FluidStack[] { aFluidOutput }, aDuration, aEUt, 0); } + * else { Logger.WARNING("Dehydrator recipe has two input items."); + * GTPP_Recipe.GTPP_Recipe_Map.sChemicalDehydratorRecipes.addRecipe(true, aInput, aOutputItems, null, + * aChances, new FluidStack[] { aFluidInput }, new FluidStack[] { aFluidOutput }, aDuration, aEUt, 0); } + */ return aSize > aSize2; } catch (final NullPointerException e) { @@ -484,128 +421,124 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder { } @Override - public boolean addBlastSmelterRecipe( - final ItemStack[] aInput, FluidStack aOutput, final int aChance, int aDuration, final int aEUt) { + public boolean addBlastSmelterRecipe(final ItemStack[] aInput, FluidStack aOutput, final int aChance, int aDuration, + final int aEUt) { return addBlastSmelterRecipe( - aInput, (FluidStack) null, aOutput, new ItemStack[] {}, new int[] {aChance}, aDuration, aEUt, 3700); + aInput, + (FluidStack) null, + aOutput, + new ItemStack[] {}, + new int[] { aChance }, + aDuration, + aEUt, + 3700); } @Override - public boolean addBlastSmelterRecipe( - final ItemStack[] aInput, - FluidStack aInputFluid, - FluidStack aOutput, - final int aChance, - int aDuration, - final int aEUt) { + public boolean addBlastSmelterRecipe(final ItemStack[] aInput, FluidStack aInputFluid, FluidStack aOutput, + final int aChance, int aDuration, final int aEUt) { return addBlastSmelterRecipe( - aInput, aInputFluid, aOutput, new ItemStack[] {}, new int[] {aChance}, aDuration, aEUt, 3700); + aInput, + aInputFluid, + aOutput, + new ItemStack[] {}, + new int[] { aChance }, + aDuration, + aEUt, + 3700); } @Override - public boolean addBlastSmelterRecipe( - final ItemStack[] aInput, - FluidStack[] aInputFluid, - FluidStack aOutput, - final int aChance, - int aDuration, - final int aEUt) { + public boolean addBlastSmelterRecipe(final ItemStack[] aInput, FluidStack[] aInputFluid, FluidStack aOutput, + final int aChance, int aDuration, final int aEUt) { return addBlastSmelterRecipe( - aInput, aInputFluid, aOutput, new ItemStack[] {}, new int[] {aChance}, aDuration, aEUt, 3700); + aInput, + aInputFluid, + aOutput, + new ItemStack[] {}, + new int[] { aChance }, + aDuration, + aEUt, + 3700); } @Override - public boolean addBlastSmelterRecipe( - final ItemStack[] aInput, - FluidStack aInputFluid, - FluidStack aOutput, - ItemStack[] aOutputStack, - final int aChance[], - int aDuration, - final int aEUt) { + public boolean addBlastSmelterRecipe(final ItemStack[] aInput, FluidStack aInputFluid, FluidStack aOutput, + ItemStack[] aOutputStack, final int aChance[], int aDuration, final int aEUt) { return addBlastSmelterRecipe(aInput, aInputFluid, aOutput, aOutputStack, aChance, aDuration, aEUt, 3700); } @Override - public boolean addBlastSmelterRecipe( - final ItemStack[] aInput, - FluidStack[] aInputFluid, - FluidStack aOutput, - ItemStack[] aOutputStack, - final int aChance[], - int aDuration, - final int aEUt) { + public boolean addBlastSmelterRecipe(final ItemStack[] aInput, FluidStack[] aInputFluid, FluidStack aOutput, + ItemStack[] aOutputStack, final int aChance[], int aDuration, final int aEUt) { return addBlastSmelterRecipe(aInput, aInputFluid, aOutput, aOutputStack, aChance, aDuration, aEUt, 3700); } @Override - public boolean addBlastSmelterRecipe( - ItemStack[] aInput, - FluidStack aInputFluid, - FluidStack aOutput, - int aChance, - int aDuration, - int aEUt, - int aSpecialValue) { + public boolean addBlastSmelterRecipe(ItemStack[] aInput, FluidStack aInputFluid, FluidStack aOutput, int aChance, + int aDuration, int aEUt, int aSpecialValue) { return addBlastSmelterRecipe( - aInput, aInputFluid, aOutput, new ItemStack[] {}, new int[] {aChance}, aDuration, aEUt, aSpecialValue); + aInput, + aInputFluid, + aOutput, + new ItemStack[] {}, + new int[] { aChance }, + aDuration, + aEUt, + aSpecialValue); } @Override - public boolean addBlastSmelterRecipe( - ItemStack[] aInput, - FluidStack[] aInputFluid, - FluidStack aOutput, - int aChance, - int aDuration, - int aEUt, - int aSpecialValue) { + public boolean addBlastSmelterRecipe(ItemStack[] aInput, FluidStack[] aInputFluid, FluidStack aOutput, int aChance, + int aDuration, int aEUt, int aSpecialValue) { return addBlastSmelterRecipe( - aInput, aInputFluid, aOutput, new ItemStack[] {}, new int[] {aChance}, aDuration, aEUt, aSpecialValue); + aInput, + aInputFluid, + aOutput, + new ItemStack[] {}, + new int[] { aChance }, + aDuration, + aEUt, + aSpecialValue); } @Override - public boolean addBlastSmelterRecipe( - ItemStack[] aInput, - FluidStack aInputFluid, - FluidStack aOutput, - ItemStack[] aOutputStack, - int[] aChance, - int aDuration, - int aEUt, - int aSpecialValue) { + public boolean addBlastSmelterRecipe(ItemStack[] aInput, FluidStack aInputFluid, FluidStack aOutput, + ItemStack[] aOutputStack, int[] aChance, int aDuration, int aEUt, int aSpecialValue) { return addBlastSmelterRecipe( - aInput, aInputFluid, aOutput, aOutputStack, aChance, aDuration, aEUt, aSpecialValue, true); + aInput, + aInputFluid, + aOutput, + aOutputStack, + aChance, + aDuration, + aEUt, + aSpecialValue, + true); } @Override - public boolean addBlastSmelterRecipe( - ItemStack[] aInput, - FluidStack[] aInputFluid, - FluidStack aOutput, - ItemStack[] aOutputStack, - int[] aChance, - int aDuration, - int aEUt, - int aSpecialValue) { + public boolean addBlastSmelterRecipe(ItemStack[] aInput, FluidStack[] aInputFluid, FluidStack aOutput, + ItemStack[] aOutputStack, int[] aChance, int aDuration, int aEUt, int aSpecialValue) { return addBlastSmelterRecipe( - aInput, aInputFluid, aOutput, aOutputStack, aChance, aDuration, aEUt, aSpecialValue, true); + aInput, + aInputFluid, + aOutput, + aOutputStack, + aChance, + aDuration, + aEUt, + aSpecialValue, + true); } @Override - public boolean addBlastSmelterRecipe( - ItemStack[] aInput, - FluidStack aInputFluid, - FluidStack aOutput, - ItemStack[] aOutputStack, - int[] aChance, - int aDuration, - int aEUt, - int aSpecialValue, + public boolean addBlastSmelterRecipe(ItemStack[] aInput, FluidStack aInputFluid, FluidStack aOutput, + ItemStack[] aOutputStack, int[] aChance, int aDuration, int aEUt, int aSpecialValue, boolean aOptimizeRecipe) { return addBlastSmelterRecipe( aInput, - new FluidStack[] {aInputFluid}, + new FluidStack[] { aInputFluid }, aOutput, aOutputStack, aChance, @@ -615,15 +548,8 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder { aOptimizeRecipe); } - public boolean addBlastSmelterRecipe( - ItemStack[] aInput, - FluidStack[] aInputFluid, - FluidStack aOutput, - ItemStack[] aOutputStack, - int[] aChance, - int aDuration, - int aEUt, - int aSpecialValue, + public boolean addBlastSmelterRecipe(ItemStack[] aInput, FluidStack[] aInputFluid, FluidStack aOutput, + ItemStack[] aOutputStack, int[] aChance, int aDuration, int aEUt, int aSpecialValue, boolean aOptimizeRecipe) { if ((aInput == null) || (aOutput == null)) { Logger.WARNING("Fail - Input or Output was null."); @@ -636,17 +562,19 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder { if (aOutput.isFluidEqual(Materials.PhasedIron.getMolten(1))) { aOutput = Materials.PulsatingIron.getMolten(aOutput.amount); } - if ((aDuration = GregTech_API.sRecipeFile.get( - "blastsmelter", aOutput.getFluid().getName(), aDuration)) - <= 0) { + if ((aDuration = GregTech_API.sRecipeFile.get("blastsmelter", aOutput.getFluid().getName(), aDuration)) <= 0) { Logger.WARNING("Recipe did not register."); return false; } for (int das = 0; das < aInput.length; das++) { if (aInput[das] != null) { - Logger.WARNING("tMaterial[" + das + "]: " + aInput[das].getDisplayName() + ", Amount: " - + aInput[das].stackSize); + Logger.WARNING( + "tMaterial[" + das + + "]: " + + aInput[das].getDisplayName() + + ", Amount: " + + aInput[das].stackSize); } } @@ -664,7 +592,7 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder { null, aChance, aInputFluid, - new FluidStack[] {aOutput}, + new FluidStack[] { aOutput }, Math.max(1, aDuration), Math.max(1, aEUt), aSpecialValue); @@ -674,15 +602,8 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder { } @Override - public boolean addQuantumTransformerRecipe( - ItemStack[] aInput, - FluidStack[] aFluidInput, - FluidStack[] aFluidOutput, - ItemStack[] aOutputStack, - int[] aChances, - int aDuration, - int aEUt, - int aSpecialValue) { + public boolean addQuantumTransformerRecipe(ItemStack[] aInput, FluidStack[] aFluidInput, FluidStack[] aFluidOutput, + ItemStack[] aOutputStack, int[] aChances, int aDuration, int aEUt, int aSpecialValue) { if (aInput == null) { aInput = new ItemStack[0]; } @@ -692,7 +613,7 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder { } // if (aInput.length + aFluidInput.length < 1) { - // return false; + // return false; // } if (aOutputStack == null) { @@ -704,107 +625,91 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder { } // if (aOutputStack.length + aFluidOutput.length < 4) { - // return false; + // return false; // } // if (aChances == null || aChances.length != aOutputStack.length + aFluidOutput.length) { - // return false; + // return false; // } - GTPP_Recipe.GTPP_Recipe_Map.sQuantumForceTransformerRecipes.add(new GT_Recipe( - false, - aInput, - aOutputStack, - null, - aChances, - aFluidInput, - aFluidOutput, - aDuration, - aEUt, - aSpecialValue)); + GTPP_Recipe.GTPP_Recipe_Map.sQuantumForceTransformerRecipes.add( + new GT_Recipe( + false, + aInput, + aOutputStack, + null, + aChances, + aFluidInput, + aFluidOutput, + aDuration, + aEUt, + aSpecialValue)); return true; } @Override - public boolean addLFTRRecipe( - final ItemStack aInput1, - final FluidStack aInput2, - final ItemStack aOutput1, - final FluidStack aOutput2, - final int aDuration, - final int aEUt) { + public boolean addLFTRRecipe(final ItemStack aInput1, final FluidStack aInput2, final ItemStack aOutput1, + final FluidStack aOutput2, final int aDuration, final int aEUt) { // TODO Auto-generated method stub return false; } @Override - public boolean addLFTRRecipe( - final ItemStack aInput1, - final ItemStack aInput2, - final ItemStack aOutput1, - final int aDuration, - final int aEUt) { + public boolean addLFTRRecipe(final ItemStack aInput1, final ItemStack aInput2, final ItemStack aOutput1, + final int aDuration, final int aEUt) { return false; } @Override - public boolean addLFTRRecipe( - final FluidStack aInput1, - final FluidStack aInput2, - final FluidStack aOutput1, - final int aDuration, - final int aEUt) { + public boolean addLFTRRecipe(final FluidStack aInput1, final FluidStack aInput2, final FluidStack aOutput1, + final int aDuration, final int aEUt) { if ((aInput1 == null) || (aInput2 == null) || (aOutput1 == null) || (aDuration < 1) || (aEUt < 1)) { return false; } GTPP_Recipe.GTPP_Recipe_Map.sLiquidFluorineThoriumReactorRecipes.addRecipe( - null, new FluidStack[] {aInput1, aInput2}, new FluidStack[] {aOutput1}, aDuration, aEUt, 16000); + null, + new FluidStack[] { aInput1, aInput2 }, + new FluidStack[] { aOutput1 }, + aDuration, + aEUt, + 16000); return true; } @Override - public boolean addFissionFuel( - final FluidStack aInput1, - final FluidStack aInput2, - final FluidStack aInput3, - final FluidStack aInput4, - final FluidStack aInput5, - final FluidStack aInput6, - final FluidStack aInput7, - final FluidStack aInput8, - final FluidStack aInput9, - final FluidStack aOutput1, - final FluidStack aOutput2, - final int aDuration, - final int aEUt) { + public boolean addFissionFuel(final FluidStack aInput1, final FluidStack aInput2, final FluidStack aInput3, + final FluidStack aInput4, final FluidStack aInput5, final FluidStack aInput6, final FluidStack aInput7, + final FluidStack aInput8, final FluidStack aInput9, final FluidStack aOutput1, final FluidStack aOutput2, + final int aDuration, final int aEUt) { return addFissionFuel( - false, aInput1, aInput2, aInput3, aInput4, aInput5, aInput6, aInput7, aInput8, aInput9, aOutput1, - aOutput2, aDuration, aEUt); - } - - @Override - public boolean addFissionFuel( - final boolean aOptimise, - final FluidStack aInput1, - final FluidStack aInput2, - final FluidStack aInput3, - final FluidStack aInput4, - final FluidStack aInput5, - final FluidStack aInput6, - final FluidStack aInput7, - final FluidStack aInput8, - final FluidStack aInput9, - final FluidStack aOutput1, - final FluidStack aOutput2, - final int aDuration, - final int aEUt) { + false, + aInput1, + aInput2, + aInput3, + aInput4, + aInput5, + aInput6, + aInput7, + aInput8, + aInput9, + aOutput1, + aOutput2, + aDuration, + aEUt); + } + + @Override + public boolean addFissionFuel(final boolean aOptimise, final FluidStack aInput1, final FluidStack aInput2, + final FluidStack aInput3, final FluidStack aInput4, final FluidStack aInput5, final FluidStack aInput6, + final FluidStack aInput7, final FluidStack aInput8, final FluidStack aInput9, final FluidStack aOutput1, + final FluidStack aOutput2, final int aDuration, final int aEUt) { if ((aInput1 == null) || (aOutput1 == null) || (aDuration < 1) || (aEUt < 1)) { return false; } - final FluidStack inputs[] = {aInput1, aInput2, aInput3, aInput4, aInput5, aInput6, aInput7, aInput8, aInput9}; - final FluidStack outputs[] = {aOutput1, aOutput2}; + final FluidStack inputs[] = { aInput1, aInput2, aInput3, aInput4, aInput5, aInput6, aInput7, aInput8, aInput9 }; + final FluidStack outputs[] = { aOutput1, aOutput2 }; int aSize = GTPP_Recipe.GTPP_Recipe_Map.sFissionFuelProcessing.mRecipeList.size(); int aSize2 = aSize; @@ -829,17 +734,10 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder { } @Override - public boolean addCyclotronRecipe( - ItemStack aInputs, - FluidStack aFluidInput, - ItemStack[] aOutputs, - FluidStack aFluidOutput, - int[] aChances, - int aDuration, - int aEUt, - int aSpecialValue) { + public boolean addCyclotronRecipe(ItemStack aInputs, FluidStack aFluidInput, ItemStack[] aOutputs, + FluidStack aFluidOutput, int[] aChances, int aDuration, int aEUt, int aSpecialValue) { return addCyclotronRecipe( - new ItemStack[] {aInputs}, + new ItemStack[] { aInputs }, aFluidInput, aOutputs, aFluidOutput, @@ -850,15 +748,8 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder { } @Override - public boolean addCyclotronRecipe( - ItemStack[] aInputs, - FluidStack aFluidInput, - ItemStack[] aOutput, - FluidStack aFluidOutput, - int[] aChances, - int aDuration, - int aEUt, - int aSpecialValue) { + public boolean addCyclotronRecipe(ItemStack[] aInputs, FluidStack aFluidInput, ItemStack[] aOutput, + FluidStack aFluidOutput, int[] aChances, int aDuration, int aEUt, int aSpecialValue) { if (aOutput == null || aOutput.length < 1 || !ItemUtils.checkForInvalidItems(aOutput)) { Logger.INFO("Bad output for Cyclotron Recipe."); return false; @@ -870,8 +761,8 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder { aOutput, null, aChances, - new FluidStack[] {aFluidInput}, - new FluidStack[] {aFluidOutput}, + new FluidStack[] { aFluidInput }, + new FluidStack[] { aFluidOutput }, Math.max(1, aDuration), Math.max(1, aEUt), aSpecialValue); @@ -891,30 +782,20 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder { } @Override - public boolean addMixerRecipe( - ItemStack aInput1, - ItemStack aInput2, - ItemStack aInput3, - ItemStack aInput4, - FluidStack aFluidInput, - FluidStack aFluidOutput, - ItemStack aOutput1, - ItemStack aOutput2, - ItemStack aOutput3, - ItemStack aOutput4, - int aDuration, - int aEUt) { + public boolean addMixerRecipe(ItemStack aInput1, ItemStack aInput2, ItemStack aInput3, ItemStack aInput4, + FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3, + ItemStack aOutput4, int aDuration, int aEUt) { if (((aInput1 == null) && (aFluidInput == null)) || ((aOutput1 == null) && (aFluidOutput == null))) { return false; } GTPP_Recipe aSpecialRecipe = new GTPP_Recipe( true, - new ItemStack[] {aInput1, aInput2, aInput3, aInput4}, - new ItemStack[] {aOutput1, aOutput2, aOutput3, aOutput4}, + new ItemStack[] { aInput1, aInput2, aInput3, aInput4 }, + new ItemStack[] { aOutput1, aOutput2, aOutput3, aOutput4 }, null, new int[] {}, - new FluidStack[] {aFluidInput}, - new FluidStack[] {aFluidOutput}, + new FluidStack[] { aFluidInput }, + new FluidStack[] { aFluidOutput }, Math.max(1, aDuration), Math.max(1, aEUt), 0); @@ -926,9 +807,9 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder { // Machine Component Assembler @Override - public boolean addComponentMakerRecipe( - ItemStack[] aInputs, FluidStack aFluidInput, ItemStack aOutput1, int aDuration, int aEUt) { - if (areItemsAndFluidsBothNull(aInputs, new FluidStack[] {aFluidInput})) { + public boolean addComponentMakerRecipe(ItemStack[] aInputs, FluidStack aFluidInput, ItemStack aOutput1, + int aDuration, int aEUt) { + if (areItemsAndFluidsBothNull(aInputs, new FluidStack[] { aFluidInput })) { return false; } if (aOutput1 == null) { @@ -943,10 +824,10 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder { GTPP_Recipe aRecipe = new GTPP_Recipe( false, aInputs, - new ItemStack[] {aOutput1}, + new ItemStack[] { aOutput1 }, null, new int[] {}, - new FluidStack[] {aFluidInput}, + new FluidStack[] { aFluidInput }, new FluidStack[] {}, aDuration, aEUt, @@ -955,17 +836,10 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder { return true; } - public boolean addMultiblockCentrifugeRecipe( - ItemStack[] aInputs, - FluidStack[] aFluidInputs, - FluidStack[] aFluidOutputs, - ItemStack[] aOutputs, - int[] aChances, - int aDuration, - int aEUtick, + public boolean addMultiblockCentrifugeRecipe(ItemStack[] aInputs, FluidStack[] aFluidInputs, + FluidStack[] aFluidOutputs, ItemStack[] aOutputs, int[] aChances, int aDuration, int aEUtick, int aSpecial) { - if (areItemsAndFluidsBothNull(aInputs, aFluidInputs) - || areItemsAndFluidsBothNull(aOutputs, aFluidOutputs) + if (areItemsAndFluidsBothNull(aInputs, aFluidInputs) || areItemsAndFluidsBothNull(aOutputs, aFluidOutputs) || aEUtick <= 0) { return false; } @@ -980,7 +854,16 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder { } GTPP_Recipe aRecipe = new GTPP_Recipe( - false, aInputs, aOutputs, null, aChances, aFluidInputs, aFluidOutputs, aDuration, aEUtick, aSpecial); + false, + aInputs, + aOutputs, + null, + aChances, + aFluidInputs, + aFluidOutputs, + aDuration, + aEUtick, + aSpecial); GTPP_Recipe.GTPP_Recipe_Map.sMultiblockCentrifugeRecipes_GT.addRecipe(aRecipe); // GTPP_Recipe.GTPP_Recipe_Map.sMultiblockCentrifugeRecipes.addRecipe(true, aInputs, aOutputs, null, aChances, @@ -988,17 +871,10 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder { return true; } - public boolean addMultiblockElectrolyzerRecipe( - ItemStack[] aInputs, - FluidStack[] aFluidInputs, - FluidStack[] aFluidOutputs, - ItemStack[] aOutputs, - int[] aChances, - int aDuration, - int aEUtick, + public boolean addMultiblockElectrolyzerRecipe(ItemStack[] aInputs, FluidStack[] aFluidInputs, + FluidStack[] aFluidOutputs, ItemStack[] aOutputs, int[] aChances, int aDuration, int aEUtick, int aSpecial) { - if (areItemsAndFluidsBothNull(aInputs, aFluidInputs) - || areItemsAndFluidsBothNull(aOutputs, aFluidOutputs) + if (areItemsAndFluidsBothNull(aInputs, aFluidInputs) || areItemsAndFluidsBothNull(aOutputs, aFluidOutputs) || aEUtick <= 0) { return false; } @@ -1012,24 +888,25 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder { } GTPP_Recipe aRecipe = new GTPP_Recipe( - false, aInputs, aOutputs, null, aChances, aFluidInputs, aFluidOutputs, aDuration, aEUtick, aSpecial); + false, + aInputs, + aOutputs, + null, + aChances, + aFluidInputs, + aFluidOutputs, + aDuration, + aEUtick, + aSpecial); GTPP_Recipe.GTPP_Recipe_Map.sMultiblockElectrolyzerRecipes_GT.addRecipe(aRecipe); // GTPP_Recipe.GTPP_Recipe_Map.sMultiblockElectrolyzerRecipes.addRecipe(true, aInputs, aOutputs, null, aChances, // aFluidInputs, aFluidOutputs, aDuration, aEUtick, aSpecial); return true; } - public boolean addAdvancedFreezerRecipe( - ItemStack[] aInputs, - FluidStack[] aFluidInputs, - FluidStack[] aFluidOutputs, - ItemStack[] aOutputs, - int[] aChances, - int aDuration, - int aEUtick, - int aSpecial) { - if (areItemsAndFluidsBothNull(aInputs, aFluidInputs) - || areItemsAndFluidsBothNull(aOutputs, aFluidOutputs) + public boolean addAdvancedFreezerRecipe(ItemStack[] aInputs, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, + ItemStack[] aOutputs, int[] aChances, int aDuration, int aEUtick, int aSpecial) { + if (areItemsAndFluidsBothNull(aInputs, aFluidInputs) || areItemsAndFluidsBothNull(aOutputs, aFluidOutputs) || aEUtick <= 0) { return false; } @@ -1044,25 +921,27 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder { } GTPP_Recipe aRecipe = new GTPP_Recipe( - false, aInputs, aOutputs, null, aChances, aFluidInputs, aFluidOutputs, aDuration, aEUtick, aSpecial); + false, + aInputs, + aOutputs, + null, + aChances, + aFluidInputs, + aFluidOutputs, + aDuration, + aEUtick, + aSpecial); GTPP_Recipe.GTPP_Recipe_Map.sAdvFreezerRecipes_GT.addRecipe(aRecipe); - /*if (GTPP_Recipe.GTPP_Recipe_Map.sAdvFreezerRecipes.addRecipe(true, aInputs, aOutputs, null, aChances, aFluidInputs, aFluidOutputs, aDuration, aEUtick, aSpecial) != null) { - return true; - }*/ + /* + * if (GTPP_Recipe.GTPP_Recipe_Map.sAdvFreezerRecipes.addRecipe(true, aInputs, aOutputs, null, aChances, + * aFluidInputs, aFluidOutputs, aDuration, aEUtick, aSpecial) != null) { return true; } + */ return false; } - public boolean addMultiblockMixerRecipe( - ItemStack[] aInputs, - FluidStack[] aFluidInputs, - FluidStack[] aFluidOutputs, - ItemStack[] aOutputs, - int[] aChances, - int aDuration, - int aEUtick, - int aSpecial) { - if (areItemsAndFluidsBothNull(aInputs, aFluidInputs) - || areItemsAndFluidsBothNull(aOutputs, aFluidOutputs) + public boolean addMultiblockMixerRecipe(ItemStack[] aInputs, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, + ItemStack[] aOutputs, int[] aChances, int aDuration, int aEUtick, int aSpecial) { + if (areItemsAndFluidsBothNull(aInputs, aFluidInputs) || areItemsAndFluidsBothNull(aOutputs, aFluidOutputs) || aEUtick <= 0) { return false; } @@ -1076,22 +955,24 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder { } GTPP_Recipe aRecipe = new GTPP_Recipe( - false, aInputs, aOutputs, null, aChances, aFluidInputs, aFluidOutputs, aDuration, aEUtick, aSpecial); + false, + aInputs, + aOutputs, + null, + aChances, + aFluidInputs, + aFluidOutputs, + aDuration, + aEUtick, + aSpecial); GTPP_Recipe.GTPP_Recipe_Map.sMultiblockMixerRecipes_GT.addRecipe(aRecipe); return true; } - public boolean addMultiblockChemicalDehydratorRecipe( - ItemStack[] aInputs, - FluidStack[] aFluidInputs, - FluidStack[] aFluidOutputs, - ItemStack[] aOutputs, - int[] aChances, - int aDuration, - int aEUtick, + public boolean addMultiblockChemicalDehydratorRecipe(ItemStack[] aInputs, FluidStack[] aFluidInputs, + FluidStack[] aFluidOutputs, ItemStack[] aOutputs, int[] aChances, int aDuration, int aEUtick, int aSpecial) { - if (areItemsAndFluidsBothNull(aInputs, aFluidInputs) - || areItemsAndFluidsBothNull(aOutputs, aFluidOutputs) + if (areItemsAndFluidsBothNull(aInputs, aFluidInputs) || areItemsAndFluidsBothNull(aOutputs, aFluidOutputs) || aEUtick <= 0) { return false; } @@ -1105,13 +986,22 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder { } GTPP_Recipe aRecipe = new GTPP_Recipe( - false, aInputs, aOutputs, null, aChances, aFluidInputs, aFluidOutputs, aDuration, aEUtick, aSpecial); + false, + aInputs, + aOutputs, + null, + aChances, + aFluidInputs, + aFluidOutputs, + aDuration, + aEUtick, + aSpecial); GTPP_Recipe.GTPP_Recipe_Map.sMultiblockChemicalDehydratorRecipes.addRecipe(aRecipe); return true; } - public boolean addAssemblerRecipeWithOreDict( - Object aInput1, int aAmount1, Object aInput2, int aAmount2, ItemStack aOutput, int a1, int a2) { + public boolean addAssemblerRecipeWithOreDict(Object aInput1, int aAmount1, Object aInput2, int aAmount2, + ItemStack aOutput, int a1, int a2) { if (aInput1 instanceof String || aInput2 instanceof String) { int mCompleted = 0; if (aInput1 instanceof String && aInput2 instanceof String) { @@ -1156,15 +1046,8 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder { } } - public boolean addAssemblerRecipeWithOreDict( - Object aInput1, - int aAmount1, - Object aInput2, - int aAmount2, - FluidStack aInputFluid, - ItemStack aOutput, - int a1, - int a2) { + public boolean addAssemblerRecipeWithOreDict(Object aInput1, int aAmount1, Object aInput2, int aAmount2, + FluidStack aInputFluid, ItemStack aOutput, int a1, int a2) { if (aInput1 instanceof String || aInput2 instanceof String) { int mCompleted = 0; if (aInput1 instanceof String && aInput2 instanceof String) { @@ -1205,8 +1088,8 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder { } return mCompleted > 0; } else { - return GT_Values.RA.addAssemblerRecipe( - (ItemStack) aInput1, (ItemStack) aInput2, aInputFluid, aOutput, a1, a2); + return GT_Values.RA + .addAssemblerRecipe((ItemStack) aInput1, (ItemStack) aInput2, aInputFluid, aOutput, a1, a2); } } @@ -1281,8 +1164,13 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder { Method[] aDump = TTRecipeAdder.getDeclaredMethods(); for (Method m : aDump) { if (m != null) { - Logger.INFO("Found " + m.getName() + " | " + m.getModifiers() + " | " - + ArrayUtils.toString(m.getParameters(), "EMPTY") + ""); + Logger.INFO( + "Found " + m.getName() + + " | " + + m.getModifiers() + + " | " + + ArrayUtils.toString(m.getParameters(), "EMPTY") + + ""); if (m.getName().toLowerCase().equals("addresearchableassemblylinerecipe")) { Logger.INFO("Types: " + ArrayUtils.toString(m.getParameterTypes())); } @@ -1346,13 +1234,13 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder { } } - public boolean addSixSlotAssemblingRecipe( - ItemStack[] aInputs, FluidStack aInputFluid, ItemStack aOutput1, int aDuration, int aEUt) { + public boolean addSixSlotAssemblingRecipe(ItemStack[] aInputs, FluidStack aInputFluid, ItemStack aOutput1, + int aDuration, int aEUt) { if (CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK || CORE.GTNH) { if (mSixSlotAssembly != null) { try { - return (boolean) - mSixSlotAssembly.invoke(GT_Values.RA, aInputs, aInputFluid, aOutput1, aDuration, aEUt); + return (boolean) mSixSlotAssembly + .invoke(GT_Values.RA, aInputs, aInputFluid, aOutput1, aDuration, aEUt); } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) { if (CORE.GTNH) { return false; @@ -1364,19 +1252,11 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder { } @Override - public boolean addAssemblylineRecipe( - ItemStack aResearchItem, - int aResearchTime, - ItemStack[] aInputs, - FluidStack[] aFluidInputs, - ItemStack aOutput, - int aDuration, - int aEUt) { - if (GTNH) - return RA.addAssemblylineRecipe( - aResearchItem, aResearchTime, aInputs, aFluidInputs, aOutput, aDuration, aEUt); - if ((aResearchItem == null) - || (aResearchTime <= 0) + public boolean addAssemblylineRecipe(ItemStack aResearchItem, int aResearchTime, ItemStack[] aInputs, + FluidStack[] aFluidInputs, ItemStack aOutput, int aDuration, int aEUt) { + if (GTNH) return RA + .addAssemblylineRecipe(aResearchItem, aResearchTime, aInputs, aFluidInputs, aOutput, aDuration, aEUt); + if ((aResearchItem == null) || (aResearchTime <= 0) || (aInputs == null) || (aOutput == null) || aInputs.length > 15 @@ -1388,15 +1268,18 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder { } for (ItemStack tItem : aInputs) { if (tItem == null) { - GT_FML_LOGGER.info("addAssemblingLineRecipe " + aResearchItem.getDisplayName() + " --> " - + aOutput.getUnlocalizedName() + " there is some null item in that recipe"); + GT_FML_LOGGER.info( + "addAssemblingLineRecipe " + aResearchItem.getDisplayName() + + " --> " + + aOutput.getUnlocalizedName() + + " there is some null item in that recipe"); } } GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.addFakeRecipe( false, - new ItemStack[] {aResearchItem}, - new ItemStack[] {aOutput}, - new ItemStack[] {ItemList.Tool_DataStick.getWithName(1L, "Writes Research result", new Object[0])}, + new ItemStack[] { aResearchItem }, + new ItemStack[] { aOutput }, + new ItemStack[] { ItemList.Tool_DataStick.getWithName(1L, "Writes Research result", new Object[0]) }, null, null, aResearchTime, @@ -1405,33 +1288,32 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder { GT_Recipe.GT_Recipe_Map.sAssemblylineVisualRecipes.addFakeRecipe( false, aInputs, - new ItemStack[] {aOutput}, - new ItemStack[] {ItemList.Tool_DataStick.getWithName(1L, "Reads Research result", new Object[0])}, + new ItemStack[] { aOutput }, + new ItemStack[] { ItemList.Tool_DataStick.getWithName(1L, "Reads Research result", new Object[0]) }, aFluidInputs, null, aDuration, aEUt, 0, false); - GT_Recipe.GT_Recipe_AssemblyLine.sAssemblylineRecipes.add(new GT_Recipe_AssemblyLine( - aResearchItem, aResearchTime, aInputs, aFluidInputs, aOutput, aDuration, aEUt)); + GT_Recipe.GT_Recipe_AssemblyLine.sAssemblylineRecipes.add( + new GT_Recipe_AssemblyLine( + aResearchItem, + aResearchTime, + aInputs, + aFluidInputs, + aOutput, + aDuration, + aEUt)); return true; } @Override - public boolean addAssemblylineRecipe( - ItemStack aResearchItem, - int aResearchTime, - Object[] aInputs, - FluidStack[] aFluidInputs, - ItemStack aOutput, - int aDuration, - int aEUt) { - if (GTNH) - return RA.addAssemblylineRecipe( - aResearchItem, aResearchTime, aInputs, aFluidInputs, aOutput, aDuration, aEUt); - if ((aResearchItem == null) - || (aResearchTime <= 0) + public boolean addAssemblylineRecipe(ItemStack aResearchItem, int aResearchTime, Object[] aInputs, + FluidStack[] aFluidInputs, ItemStack aOutput, int aDuration, int aEUt) { + if (GTNH) return RA + .addAssemblylineRecipe(aResearchItem, aResearchTime, aInputs, aFluidInputs, aOutput, aDuration, aEUt); + if ((aResearchItem == null) || (aResearchTime <= 0) || (aInputs == null) || (aOutput == null) || aInputs.length > 15 @@ -1472,18 +1354,20 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder { } tAlts[i] = uList.toArray(new ItemStack[uList.size()]); continue; - } catch (Exception t) { - } + } catch (Exception t) {} } } - GT_FML_LOGGER.info("addAssemblingLineRecipe " + aResearchItem.getDisplayName() + " --> " - + aOutput.getUnlocalizedName() + " there is some null item in that recipe"); + GT_FML_LOGGER.info( + "addAssemblingLineRecipe " + aResearchItem.getDisplayName() + + " --> " + + aOutput.getUnlocalizedName() + + " there is some null item in that recipe"); } GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes.addFakeRecipe( false, - new ItemStack[] {aResearchItem}, - new ItemStack[] {aOutput}, - new ItemStack[] {ItemList.Tool_DataStick.getWithName(1L, "Writes Research result", new Object[0])}, + new ItemStack[] { aResearchItem }, + new ItemStack[] { aOutput }, + new ItemStack[] { ItemList.Tool_DataStick.getWithName(1L, "Writes Research result", new Object[0]) }, null, null, aResearchTime, @@ -1492,8 +1376,8 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder { GT_Recipe.GT_Recipe_Map.sAssemblylineVisualRecipes.addFakeRecipe( false, tInputs, - new ItemStack[] {aOutput}, - new ItemStack[] {ItemList.Tool_DataStick.getWithName(1L, "Reads Research result", new Object[0])}, + new ItemStack[] { aOutput }, + new ItemStack[] { ItemList.Tool_DataStick.getWithName(1L, "Reads Research result", new Object[0]) }, aFluidInputs, null, aDuration, @@ -1501,18 +1385,21 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder { 0, tAlts, false); - GT_Recipe.GT_Recipe_AssemblyLine.sAssemblylineRecipes.add(new GT_Recipe_AssemblyLine( - aResearchItem, aResearchTime, tInputs, aFluidInputs, aOutput, aDuration, aEUt, tAlts)); + GT_Recipe.GT_Recipe_AssemblyLine.sAssemblylineRecipes.add( + new GT_Recipe_AssemblyLine( + aResearchItem, + aResearchTime, + tInputs, + aFluidInputs, + aOutput, + aDuration, + aEUt, + tAlts)); return true; } - private boolean tryAddTecTechScannerRecipe( - ItemStack aResearchItem, - Object[] aInputs, - FluidStack[] aFluidInputs, - ItemStack aOutput, - int assDuration, - int assEUt) { + private boolean tryAddTecTechScannerRecipe(ItemStack aResearchItem, Object[] aInputs, FluidStack[] aFluidInputs, + ItemStack aOutput, int assDuration, int assEUt) { if (!LoadedMods.TecTech) { return true; } else { @@ -1534,13 +1421,16 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder { aOutput, assDuration, assEUt); - Logger.INFO("Added TecTech Scanner Recipe for " + ItemUtils.getItemName(aResearchItem) + "? " - + aResult); + Logger.INFO( + "Added TecTech Scanner Recipe for " + ItemUtils.getItemName(aResearchItem) + + "? " + + aResult); return aResult; } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) { - Logger.INFO("Failed to generate TecTech recipe for " + ItemUtils.getItemName(aResearchItem) - + ", please report this to Alkalus. [Severe]"); + Logger.INFO( + "Failed to generate TecTech recipe for " + ItemUtils.getItemName(aResearchItem) + + ", please report this to Alkalus. [Severe]"); e.printStackTrace(); } } @@ -1548,34 +1438,21 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder { return false; } - public boolean addChemicalRecipe( - ItemStack input1, - ItemStack input2, - FluidStack inputFluid, - FluidStack outputFluid, - ItemStack output, - int time, - int eu) { + public boolean addChemicalRecipe(ItemStack input1, ItemStack input2, FluidStack inputFluid, FluidStack outputFluid, + ItemStack output, int time, int eu) { return addChemicalRecipe(input1, input2, inputFluid, outputFluid, output, null, time, eu); } @Override - public boolean addChemicalRecipe( - ItemStack input1, - ItemStack input2, - FluidStack inputFluid, - FluidStack outputFluid, - ItemStack output, - Object object, - int time, - int eu) { + public boolean addChemicalRecipe(ItemStack input1, ItemStack input2, FluidStack inputFluid, FluidStack outputFluid, + ItemStack output, Object object, int time, int eu) { try { if (!CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK) { - return (boolean) - mChemicalRecipe[0].invoke(GT_Values.RA, input1, input2, inputFluid, outputFluid, output, time); + return (boolean) mChemicalRecipe[0] + .invoke(GT_Values.RA, input1, input2, inputFluid, outputFluid, output, time); } else { - return (boolean) mChemicalRecipe[1].invoke( - GT_Values.RA, input1, input2, inputFluid, outputFluid, output, time, eu); + return (boolean) mChemicalRecipe[1] + .invoke(GT_Values.RA, input1, input2, inputFluid, outputFluid, output, time, eu); } } catch (Throwable t) { return false; @@ -1583,21 +1460,15 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder { } @Override - public boolean addChemicalRecipe( - ItemStack input1, - ItemStack input2, - FluidStack inputFluid, - FluidStack outputFluid, - ItemStack output, - ItemStack output2, - int time) { + public boolean addChemicalRecipe(ItemStack input1, ItemStack input2, FluidStack inputFluid, FluidStack outputFluid, + ItemStack output, ItemStack output2, int time) { try { if (!CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK) { - return (boolean) - mChemicalRecipe[0].invoke(GT_Values.RA, input1, input2, inputFluid, outputFluid, output, time); + return (boolean) mChemicalRecipe[0] + .invoke(GT_Values.RA, input1, input2, inputFluid, outputFluid, output, time); } else { - return (boolean) mChemicalRecipe[2].invoke( - GT_Values.RA, input1, input2, inputFluid, outputFluid, output, output2, time); + return (boolean) mChemicalRecipe[2] + .invoke(GT_Values.RA, input1, input2, inputFluid, outputFluid, output, output2, time); } } catch (Throwable t) { return false; @@ -1605,27 +1476,19 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder { } @Override - public boolean addChemicalRecipe( - ItemStack input1, - ItemStack input2, - int aCircuit, - FluidStack inputFluid, - FluidStack outputFluid, - ItemStack output, - ItemStack output2, - int time, - int eu) { + public boolean addChemicalRecipe(ItemStack input1, ItemStack input2, int aCircuit, FluidStack inputFluid, + FluidStack outputFluid, ItemStack output, ItemStack output2, int time, int eu) { if (aCircuit < 0 || aCircuit > 24) { aCircuit = 22; } GT_Recipe aSpecialRecipe = new GTPP_Recipe( false, - new ItemStack[] {input1, input2}, - new ItemStack[] {output, output2}, + new ItemStack[] { input1, input2 }, + new ItemStack[] { output, output2 }, CI.getNumberedCircuit(aCircuit), new int[] {}, - new FluidStack[] {inputFluid}, - new FluidStack[] {outputFluid}, + new FluidStack[] { inputFluid }, + new FluidStack[] { outputFluid }, time, eu, 0); @@ -1633,19 +1496,14 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder { } @Override - public boolean addMultiblockChemicalRecipe( - ItemStack[] itemStacks, - FluidStack[] fluidStacks, - FluidStack[] fluidStacks2, - ItemStack[] outputs, - int time, - int eu) { + public boolean addMultiblockChemicalRecipe(ItemStack[] itemStacks, FluidStack[] fluidStacks, + FluidStack[] fluidStacks2, ItemStack[] outputs, int time, int eu) { if (!CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK || mLargeChemReactor == null) { return false; } try { - return (boolean) - mLargeChemReactor.invoke(GT_Values.RA, itemStacks, fluidStacks, fluidStacks2, outputs, time, eu); + return (boolean) mLargeChemReactor + .invoke(GT_Values.RA, itemStacks, fluidStacks, fluidStacks2, outputs, time, eu); } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) { return false; } @@ -1682,19 +1540,27 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder { return false; } GT_Recipe.GT_Recipe_Map.sCompressorRecipes.addRecipe( - true, new ItemStack[] {aInput1}, new ItemStack[] {aOutput1}, null, null, null, aDuration, aEUt, 0); + true, + new ItemStack[] { aInput1 }, + new ItemStack[] { aOutput1 }, + null, + null, + null, + aDuration, + aEUt, + 0); return true; } @Override - public boolean addBrewingRecipe( - int aCircuit, FluidStack aInput, FluidStack aOutput, int aTime, int aEu, boolean aHidden) { + public boolean addBrewingRecipe(int aCircuit, FluidStack aInput, FluidStack aOutput, int aTime, int aEu, + boolean aHidden) { return addBrewingRecipe(CI.getNumberedCircuit(aCircuit), aInput, aOutput, aTime, aEu, aHidden); } @Override - public boolean addBrewingRecipe( - ItemStack aIngredient, FluidStack aInput, FluidStack aOutput, int aTime, int aEu, boolean aHidden) { + public boolean addBrewingRecipe(ItemStack aIngredient, FluidStack aInput, FluidStack aOutput, int aTime, int aEu, + boolean aHidden) { if ((aIngredient == null) || (aInput == null) || (aOutput == null)) { return false; } @@ -1703,11 +1569,11 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder { } GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sBrewingRecipes.addRecipe( false, - new ItemStack[] {aIngredient}, + new ItemStack[] { aIngredient }, null, null, - new FluidStack[] {aInput}, - new FluidStack[] {aOutput}, + new FluidStack[] { aInput }, + new FluidStack[] { aOutput }, aTime, aEu, 0); @@ -1718,7 +1584,7 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder { } /** - * Lets me add recipes for GT 5.08 & 5.09, since someone broke the method headers. + * Lets me add recipes for GT 5.08 & 5.09, since someone broke the method headers. */ @Override public boolean addSmeltingAndAlloySmeltingRecipe(ItemStack aDust, ItemStack aOutput) { @@ -1741,14 +1607,19 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder { @Override public boolean addFluidExtractionRecipe(ItemStack input, FluidStack output, int aTime, int aEu) { - boolean aRecipe = - RA.addFluidSmelterRecipe(GT_Utility.copyAmount(1, input), null, output, 10000, aTime, aEu, false); + boolean aRecipe = RA + .addFluidSmelterRecipe(GT_Utility.copyAmount(1, input), null, output, 10000, aTime, aEu, false); if (aRecipe) { - Logger.INFO("Added Fluid Extractor Recipe: " - + input.getDisplayName() + " and obtain " - + output.amount + "mb of " + output.getLocalizedName() - + ". Time: " + aTime + ", Voltage: " - + aEu); + Logger.INFO( + "Added Fluid Extractor Recipe: " + input.getDisplayName() + + " and obtain " + + output.amount + + "mb of " + + output.getLocalizedName() + + ". Time: " + + aTime + + ", Voltage: " + + aEu); } return aRecipe; @@ -1756,10 +1627,16 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder { } @Override - public boolean addFluidExtractionRecipe( - ItemStack aEmpty, ItemStack aRemains, FluidStack aFluid, int aDuration, int aEU) { + public boolean addFluidExtractionRecipe(ItemStack aEmpty, ItemStack aRemains, FluidStack aFluid, int aDuration, + int aEU) { boolean aRecipe = RA.addFluidSmelterRecipe( - GT_Utility.copyAmount(1, aEmpty), aRemains, aFluid, 10000, aDuration, aEU, false); + GT_Utility.copyAmount(1, aEmpty), + aRemains, + aFluid, + 10000, + aDuration, + aEU, + false); return aRecipe; // return MaterialGenerator.addFluidExtractionRecipe(aEmpty, aRemains, aFluid, aDuration, aEU); } @@ -1770,44 +1647,32 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder { } @Override - public boolean addFluidCannerRecipe( - ItemStack aContainer, ItemStack aFullContainer, FluidStack rFluidIn, FluidStack rFluidOut) { + public boolean addFluidCannerRecipe(ItemStack aContainer, ItemStack aFullContainer, FluidStack rFluidIn, + FluidStack rFluidOut) { return MaterialGenerator.addFluidCannerRecipe(aContainer, aFullContainer, rFluidIn, rFluidOut); } @Override - public boolean addFluidCannerRecipe( - ItemStack aFullContainer, - ItemStack container, - FluidStack rFluidIn, - FluidStack rFluidOut, - int aTime, - int aEu) { + public boolean addFluidCannerRecipe(ItemStack aFullContainer, ItemStack container, FluidStack rFluidIn, + FluidStack rFluidOut, int aTime, int aEu) { return MaterialGenerator.addFluidCannerRecipe(container, aFullContainer, rFluidIn, rFluidOut, aTime, aEu); } /** * Adds a Fusion reactor Recipe * - * @param aInputStackA = first Input (not null, and respects StackSize) - * @param aInputStackB = second Input (not null, and respects StackSize) - * @param plasma = Output of the Fusion (can be null, and respects StackSize) - * @param aOutputChance = chance to output plasma (can be 0) - * @param aFusionDurationInTicks = How many ticks the Fusion lasts (must be > 0) - * @param aEu = The EU generated per Tick (can even be negative!) - * @param aSpecial = EU needed for heating the Reactor up (must be >= 0) + * @param aInputStackA = first Input (not null, and respects StackSize) + * @param aInputStackB = second Input (not null, and respects StackSize) + * @param plasma = Output of the Fusion (can be null, and respects StackSize) + * @param aOutputChance = chance to output plasma (can be 0) + * @param aFusionDurationInTicks = How many ticks the Fusion lasts (must be > 0) + * @param aEu = The EU generated per Tick (can even be negative!) + * @param aSpecial = EU needed for heating the Reactor up (must be >= 0) */ @Override - public boolean addFusionReactorRecipe( - FluidStack aInputStackA, - FluidStack aInputStackB, - FluidStack plasma, - int aOutputChance, - int aFusionDurationInTicks, - int aEu, - int aSpecial) { - if (aInputStackA == null - || aInputStackB == null + public boolean addFusionReactorRecipe(FluidStack aInputStackA, FluidStack aInputStackB, FluidStack plasma, + int aOutputChance, int aFusionDurationInTicks, int aEu, int aSpecial) { + if (aInputStackA == null || aInputStackB == null || plasma == null || aFusionDurationInTicks < 1 || aEu < 1 @@ -1819,9 +1684,9 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder { null, null, null, - new int[] {aOutputChance}, - new FluidStack[] {aInputStackA, aInputStackB}, - new FluidStack[] {plasma}, + new int[] { aOutputChance }, + new FluidStack[] { aInputStackA, aInputStackB }, + new FluidStack[] { plasma }, aFusionDurationInTicks, aEu, aSpecial); @@ -1832,46 +1697,34 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder { /** * Adds a Fusion reactor Recipe * - * @param aInputStackA = first Input (not null, and respects StackSize) - * @param aInputStackB = second Input (not null, and respects StackSize) - * @param plasma = Output of the Fusion (can be null, and respects StackSize) - * @param aFusionDurationInTicks = How many ticks the Fusion lasts (must be > 0) - * @param aEu = The EU generated per Tick (can even be negative!) - * @param aSpecial = EU needed for heating the Reactor up (must be >= 0) + * @param aInputStackA = first Input (not null, and respects StackSize) + * @param aInputStackB = second Input (not null, and respects StackSize) + * @param plasma = Output of the Fusion (can be null, and respects StackSize) + * @param aFusionDurationInTicks = How many ticks the Fusion lasts (must be > 0) + * @param aEu = The EU generated per Tick (can even be negative!) + * @param aSpecial = EU needed for heating the Reactor up (must be >= 0) */ @Override - public boolean addFusionReactorRecipe( - ItemStack aInputStackA, - ItemStack aInputStackB, - FluidStack plasma, - int aFusionDurationInTicks, - int aEu, - int aSpecial) { + public boolean addFusionReactorRecipe(ItemStack aInputStackA, ItemStack aInputStackB, FluidStack plasma, + int aFusionDurationInTicks, int aEu, int aSpecial) { return addFusionReactorRecipe(aInputStackA, aInputStackB, plasma, 10000, aFusionDurationInTicks, aEu, aSpecial); } /** * Adds a Fusion reactor Recipe * - * @param aInputStackA = first Input (not null, and respects StackSize) - * @param aInputStackB = second Input (not null, and respects StackSize) - * @param plasma = Output of the Fusion (can be null, and respects StackSize) - * @param aOutputChance = chance to output plasma (can be 0) - * @param aFusionDurationInTicks = How many ticks the Fusion lasts (must be > 0) - * @param aEu = The EU generated per Tick (can even be negative!) - * @param aSpecial = EU needed for heating the Reactor up (must be >= 0) + * @param aInputStackA = first Input (not null, and respects StackSize) + * @param aInputStackB = second Input (not null, and respects StackSize) + * @param plasma = Output of the Fusion (can be null, and respects StackSize) + * @param aOutputChance = chance to output plasma (can be 0) + * @param aFusionDurationInTicks = How many ticks the Fusion lasts (must be > 0) + * @param aEu = The EU generated per Tick (can even be negative!) + * @param aSpecial = EU needed for heating the Reactor up (must be >= 0) */ @Override - public boolean addFusionReactorRecipe( - ItemStack aInputStackA, - ItemStack aInputStackB, - FluidStack plasma, - int aOutputChance, - int aFusionDurationInTicks, - int aEu, - int aSpecial) { - if (aInputStackA == null - || aInputStackB == null + public boolean addFusionReactorRecipe(ItemStack aInputStackA, ItemStack aInputStackB, FluidStack plasma, + int aOutputChance, int aFusionDurationInTicks, int aEu, int aSpecial) { + if (aInputStackA == null || aInputStackB == null || plasma == null || aFusionDurationInTicks < 1 || aEu < 1 @@ -1880,12 +1733,12 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder { } GTPP_Recipe aFusionCustom = new GTPP_Recipe( true, - new ItemStack[] {aInputStackA, aInputStackB}, + new ItemStack[] { aInputStackA, aInputStackB }, null, null, - new int[] {aOutputChance}, + new int[] { aOutputChance }, null, - new FluidStack[] {plasma}, + new FluidStack[] { plasma }, aFusionDurationInTicks, aEu, aSpecial); @@ -1904,22 +1757,14 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder { } @Override - public boolean addVacuumFurnaceRecipe( - ItemStack aInput1, - ItemStack aInput2, - FluidStack aFluidInput, - FluidStack aFluidOutput, - ItemStack aOutput1, - ItemStack aOutput2, - int aDuration, - int aEUt, - int aLevel) { + public boolean addVacuumFurnaceRecipe(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, + FluidStack aFluidOutput, ItemStack aOutput1, ItemStack aOutput2, int aDuration, int aEUt, int aLevel) { if (aInput1 != null && aOutput1 != null) { return addVacuumFurnaceRecipe( - new ItemStack[] {aInput1, aInput2}, - new FluidStack[] {aFluidInput}, - new ItemStack[] {aOutput1, aOutput2}, - new FluidStack[] {aFluidOutput}, + new ItemStack[] { aInput1, aInput2 }, + new FluidStack[] { aFluidInput }, + new ItemStack[] { aOutput1, aOutput2 }, + new FluidStack[] { aFluidOutput }, aDuration, aEUt, aLevel); @@ -1929,19 +1774,22 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder { } @Override - public boolean addVacuumFurnaceRecipe( - ItemStack[] aInputs, - FluidStack[] aFluidInputs, - ItemStack[] aOutputs, - FluidStack[] aFluidOutputs, - int aDuration, - int aEUt, - int aLevel) { + public boolean addVacuumFurnaceRecipe(ItemStack[] aInputs, FluidStack[] aFluidInputs, ItemStack[] aOutputs, + FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aLevel) { if (aInputs != null && aOutputs != null) { int aSize = GTPP_Recipe.GTPP_Recipe_Map.sVacuumFurnaceRecipes.mRecipeList.size(); int aSize2 = aSize; GTPP_Recipe.GTPP_Recipe_Map.sVacuumFurnaceRecipes.addRecipe( - false, aInputs, aOutputs, null, new int[] {}, aFluidInputs, aFluidOutputs, aDuration, aEUt, aLevel); + false, + aInputs, + aOutputs, + null, + new int[] {}, + aFluidInputs, + aFluidOutputs, + aDuration, + aEUt, + aLevel); aSize = GTPP_Recipe.GTPP_Recipe_Map.sVacuumFurnaceRecipes.mRecipeList.size(); return aSize > aSize2; } else { @@ -1954,12 +1802,10 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder { // Generate Special Laser Recipe GT_Recipe u = new GTPP_Recipe( false, - new ItemStack[] { - aInput1, GregtechItemList.Laser_Lens_WoodsGlass.get(0), - }, - new ItemStack[] {aOutput}, + new ItemStack[] { aInput1, GregtechItemList.Laser_Lens_WoodsGlass.get(0), }, + new ItemStack[] { aOutput }, null, - new int[] {10000}, + new int[] { 10000 }, new FluidStack[] {}, new FluidStack[] {}, time, @@ -1974,27 +1820,14 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder { } @Override - public boolean addChemicalPlantRecipe( - ItemStack[] aInputs, - FluidStack[] aInputFluids, - ItemStack[] aOutputs, - FluidStack[] aFluidOutputs, - int time, - long eu, - int aTier) { + public boolean addChemicalPlantRecipe(ItemStack[] aInputs, FluidStack[] aInputFluids, ItemStack[] aOutputs, + FluidStack[] aFluidOutputs, int time, long eu, int aTier) { return addChemicalPlantRecipe(aInputs, aInputFluids, aOutputs, aFluidOutputs, new int[] {}, time, eu, aTier); } @Override - public boolean addChemicalPlantRecipe( - ItemStack[] aInputs, - FluidStack[] aInputFluids, - ItemStack[] aOutputs, - FluidStack[] aFluidOutputs, - int[] aChances, - int time, - long eu, - int aTier) { + public boolean addChemicalPlantRecipe(ItemStack[] aInputs, FluidStack[] aInputFluids, ItemStack[] aOutputs, + FluidStack[] aFluidOutputs, int[] aChances, int time, long eu, int aTier) { if (aInputs.length > 4 || aInputFluids.length > 4 || aOutputs.length > 4 || aFluidOutputs.length > 2) { Logger.INFO("Inputs: " + ItemUtils.getArrayStackNames(aInputs)); @@ -2007,22 +1840,34 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder { int aSize = GTPP_Recipe.GTPP_Recipe_Map.sChemicalPlantRecipes.mRecipeList.size(); int aSize2 = aSize; GTPP_Recipe.GTPP_Recipe_Map.sChemicalPlantRecipes.addRecipe( - false, aInputs, aOutputs, null, aChances, aInputFluids, aFluidOutputs, time, (int) eu, aTier); + false, + aInputs, + aOutputs, + null, + aChances, + aInputFluids, + aFluidOutputs, + time, + (int) eu, + aTier); aSize = GTPP_Recipe.GTPP_Recipe_Map.sChemicalPlantRecipes.mRecipeList.size(); return aSize > aSize2; } @Override - public boolean addBlastRecipe( - ItemStack[] aInputs, - FluidStack[] aInputFluids, - ItemStack[] aOutputs, - FluidStack[] aFluidOutputs, - int time, - long eu, - int aHeat) { + public boolean addBlastRecipe(ItemStack[] aInputs, FluidStack[] aInputFluids, ItemStack[] aOutputs, + FluidStack[] aFluidOutputs, int time, long eu, int aHeat) { GTPP_Recipe aSpecialRecipe = new GTPP_Recipe( - false, aInputs, aOutputs, null, new int[] {}, aInputFluids, aFluidOutputs, time, (int) eu, aHeat); + false, + aInputs, + aOutputs, + null, + new int[] {}, + aInputFluids, + aFluidOutputs, + time, + (int) eu, + aHeat); int aSize = GT_Recipe.GT_Recipe_Map.sBlastRecipes.mRecipeList.size(); int aSize2 = aSize; @@ -2032,47 +1877,34 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder { } @Override - public boolean addPyrolyseRecipe( - ItemStack aInput, - FluidStack aFluidInput, - int intCircuit, - ItemStack aOutput, - FluidStack aFluidOutput, - int aDuration, - int aEUt) { + public boolean addPyrolyseRecipe(ItemStack aInput, FluidStack aFluidInput, int intCircuit, ItemStack aOutput, + FluidStack aFluidOutput, int aDuration, int aEUt) { if (!CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK || mPyroOven == null) { return false; } try { - return (boolean) mPyroOven.invoke( - GT_Values.RA, aInput, aFluidInput, intCircuit, aOutput, aFluidOutput, aDuration, aEUt); + return (boolean) mPyroOven + .invoke(GT_Values.RA, aInput, aFluidInput, intCircuit, aOutput, aFluidOutput, aDuration, aEUt); } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) { return false; } } @Override - public boolean addDistilleryRecipe( - ItemStack aCircuit, - FluidStack aInput, - FluidStack aOutput, - ItemStack aSolidOutput, - int aDuration, - int aEUt, - boolean aHidden) { + public boolean addDistilleryRecipe(ItemStack aCircuit, FluidStack aInput, FluidStack aOutput, + ItemStack aSolidOutput, int aDuration, int aEUt, boolean aHidden) { if (aInput != null && aOutput != null) { - if ((aDuration = GregTech_API.sRecipeFile.get( - "distillery", aOutput.getFluid().getUnlocalizedName(), aDuration)) - <= 0) { + if ((aDuration = GregTech_API.sRecipeFile + .get("distillery", aOutput.getFluid().getUnlocalizedName(), aDuration)) <= 0) { return false; } else { GT_Recipe tRecipe = GT_Recipe_Map.sDistilleryRecipes.addRecipe( true, - new ItemStack[] {aCircuit}, - new ItemStack[] {aSolidOutput}, + new ItemStack[] { aCircuit }, + new ItemStack[] { aSolidOutput }, (Object) null, - new FluidStack[] {aInput}, - new FluidStack[] {aOutput}, + new FluidStack[] { aInput }, + new FluidStack[] { aOutput }, aDuration, aEUt, 0); @@ -2096,10 +1928,10 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder { if (aInput != null && aOutput != null) { GT_Recipe aRecipe = new GTPP_Recipe( false, - new ItemStack[] {aInput.copy()}, - new ItemStack[] {aOutput.copy()}, + new ItemStack[] { aInput.copy() }, + new ItemStack[] { aOutput.copy() }, null, - new int[] {aChance}, + new int[] { aChance }, null, null, aDuration, @@ -2114,8 +1946,8 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder { } @Override - public boolean addPulverisationRecipe( - ItemStack aInput, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3) { + public boolean addPulverisationRecipe(ItemStack aInput, ItemStack aOutput1, ItemStack aOutput2, + ItemStack aOutput3) { // return GT_Values.RA.addPulveriserRecipe(arg0, arg1, arg2, arg3, arg4) aOutput1 = GT_OreDictUnificator.get(true, aOutput1); @@ -2128,10 +1960,17 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder { if (GregTech_API.sRecipeFile.get(ConfigCategories.Machines.maceration, aInput, true)) { GT_Utility.addSimpleIC2MachineRecipe( - aInput, GT_ModHandler.getMaceratorRecipeList(), null, new Object[] {aOutput1}); + aInput, + GT_ModHandler.getMaceratorRecipeList(), + null, + new Object[] { aOutput1 }); } GT_Values.RA.addPulveriserRecipe( - aInput, new ItemStack[] {aOutput1, aOutput2, aOutput3}, new int[] {10000, 10000, 10000}, 400, 2); + aInput, + new ItemStack[] { aOutput1, aOutput2, aOutput3 }, + new int[] { 10000, 10000, 10000 }, + 400, + 2); } return true; } @@ -2156,34 +1995,45 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder { ItemStack aMillingBall_Soapstone = GregtechItemList.Milling_Ball_Soapstone.get(0); // Inputs - ItemStack[] aInputsOre1 = new ItemStack[] {CI.getNumberedCircuit(10), aOreStack, aMillingBall_Alumina}; + ItemStack[] aInputsOre1 = new ItemStack[] { CI.getNumberedCircuit(10), aOreStack, aMillingBall_Alumina }; - ItemStack[] aInputsOre2 = new ItemStack[] {CI.getNumberedCircuit(11), aOreStack, aMillingBall_Soapstone}; + ItemStack[] aInputsOre2 = new ItemStack[] { CI.getNumberedCircuit(11), aOreStack, aMillingBall_Soapstone }; - ItemStack[] aInputsCrushed1 = new ItemStack[] {CI.getNumberedCircuit(10), aCrushedStack, aMillingBall_Alumina}; + ItemStack[] aInputsCrushed1 = new ItemStack[] { CI.getNumberedCircuit(10), aCrushedStack, + aMillingBall_Alumina }; - ItemStack[] aInputsCrushed2 = - new ItemStack[] {CI.getNumberedCircuit(11), aCrushedStack, aMillingBall_Soapstone}; + ItemStack[] aInputsCrushed2 = new ItemStack[] { CI.getNumberedCircuit(11), aCrushedStack, + aMillingBall_Soapstone }; // Outputs - ItemStack[] aOutputsOre1 = new ItemStack[] {aMilledStackOres1}; + ItemStack[] aOutputsOre1 = new ItemStack[] { aMilledStackOres1 }; - ItemStack[] aOutputsOre2 = new ItemStack[] {aMilledStackOres2}; + ItemStack[] aOutputsOre2 = new ItemStack[] { aMilledStackOres2 }; - ItemStack[] aOutputsCrushed1 = new ItemStack[] {aMilledStackCrushed1}; + ItemStack[] aOutputsCrushed1 = new ItemStack[] { aMilledStackCrushed1 }; - ItemStack[] aOutputsCrushed2 = new ItemStack[] {aMilledStackCrushed2}; + ItemStack[] aOutputsCrushed2 = new ItemStack[] { aMilledStackCrushed2 }; - ItemStack[][] aInputArray = new ItemStack[][] {aInputsOre1, aInputsOre2, aInputsCrushed1, aInputsCrushed2}; - ItemStack[][] aOutputArray = new ItemStack[][] {aOutputsOre1, aOutputsOre2, aOutputsCrushed1, aOutputsCrushed2}; - int[] aTime = new int[] {2400, 3000, 1200, 1500}; + ItemStack[][] aInputArray = new ItemStack[][] { aInputsOre1, aInputsOre2, aInputsCrushed1, aInputsCrushed2 }; + ItemStack[][] aOutputArray = new ItemStack[][] { aOutputsOre1, aOutputsOre2, aOutputsCrushed1, + aOutputsCrushed2 }; + int[] aTime = new int[] { 2400, 3000, 1200, 1500 }; int aSize = GTPP_Recipe.GTPP_Recipe_Map.sOreMillRecipes.mRecipeList.size(); int aSize2 = aSize; for (int i = 0; i < 4; i++) { GTPP_Recipe aOreRecipe = new GTPP_Recipe( - false, aInputArray[i], aOutputArray[i], null, new int[] {}, null, null, aTime[i], aEU, 0); + false, + aInputArray[i], + aOutputArray[i], + null, + new int[] {}, + null, + null, + aTime[i], + aEU, + 0); GTPP_Recipe.GTPP_Recipe_Map.sOreMillRecipes.add(aOreRecipe); } @@ -2192,25 +2042,20 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder { } @Override - public boolean addFlotationRecipe( - Materials aMat, - ItemStack aXanthate, - FluidStack[] aInputFluids, - FluidStack[] aOutputFluids, - int aTime, - int aEU) { + public boolean addFlotationRecipe(Materials aMat, ItemStack aXanthate, FluidStack[] aInputFluids, + FluidStack[] aOutputFluids, int aTime, int aEU) { return addFlotationRecipe( - MaterialUtils.generateMaterialFromGtENUM(aMat), aXanthate, aInputFluids, aOutputFluids, aTime, aEU); + MaterialUtils.generateMaterialFromGtENUM(aMat), + aXanthate, + aInputFluids, + aOutputFluids, + aTime, + aEU); } @Override - public boolean addFlotationRecipe( - Material aMat, - ItemStack aXanthate, - FluidStack[] aInputFluids, - FluidStack[] aOutputFluids, - int aTime, - int aEU) { + public boolean addFlotationRecipe(Material aMat, ItemStack aXanthate, FluidStack[] aInputFluids, + FluidStack[] aOutputFluids, int aTime, int aEU) { FlotationRecipeHandler.registerOreType(aMat); @@ -2219,13 +2064,8 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder { GT_Recipe aRecipe = new GTPP_Recipe( false, - new ItemStack[] { - ItemUtils.getSimpleStack(aXanthate, 32), - aMat.getMilled(64), - aMat.getMilled(64), - aMat.getMilled(64), - aMat.getMilled(64), - }, + new ItemStack[] { ItemUtils.getSimpleStack(aXanthate, 32), aMat.getMilled(64), aMat.getMilled(64), + aMat.getMilled(64), aMat.getMilled(64), }, new ItemStack[] {}, null, new int[] {}, @@ -2242,15 +2082,25 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder { } @Override - public boolean addpackagerRecipe( - ItemStack aRecipeType, ItemStack aSmallDust, ItemStack aTinyDust, ItemStack aOutputStack1) { + public boolean addpackagerRecipe(ItemStack aRecipeType, ItemStack aSmallDust, ItemStack aTinyDust, + ItemStack aOutputStack1) { AutoMap<Boolean> aResults = new AutoMap<Boolean>(); // Dust 1 - aResults.put(GT_Values.RA.addBoxingRecipe( - GT_Utility.copyAmount(4L, new Object[] {aSmallDust}), aRecipeType, aOutputStack1, 100, 4)); + aResults.put( + GT_Values.RA.addBoxingRecipe( + GT_Utility.copyAmount(4L, new Object[] { aSmallDust }), + aRecipeType, + aOutputStack1, + 100, + 4)); // Dust 2 - aResults.put(GT_Values.RA.addBoxingRecipe( - GT_Utility.copyAmount(9L, new Object[] {aTinyDust}), aRecipeType, aOutputStack1, 100, 4)); + aResults.put( + GT_Values.RA.addBoxingRecipe( + GT_Utility.copyAmount(9L, new Object[] { aTinyDust }), + aRecipeType, + aOutputStack1, + 100, + 4)); for (boolean b : aResults) { if (!b) { return false; @@ -2263,12 +2113,20 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder { public boolean addFuelForRTG(ItemStack aFuelPellet, int aFuelDays, int aVoltage) { int aSize1 = GTPP_Recipe.GTPP_Recipe_Map.sRTGFuels.mRecipeList.size(); GTPP_Recipe.GTPP_Recipe_Map.sRTGFuels.addRecipe( - true, new ItemStack[] {aFuelPellet}, new ItemStack[] {}, null, null, null, 0, aVoltage, aFuelDays); + true, + new ItemStack[] { aFuelPellet }, + new ItemStack[] {}, + null, + null, + null, + 0, + aVoltage, + aFuelDays); int aSize2 = GTPP_Recipe.GTPP_Recipe_Map.sRTGFuels.mRecipeList.size(); if (aSize2 > aSize1) { - long eu = GregtechMetaTileEntity_RTG.getTotalEUGenerated( - GregtechMetaTileEntity_RTG.convertDaysToTicks(aFuelDays), aVoltage); + long eu = GregtechMetaTileEntity_RTG + .getTotalEUGenerated(GregtechMetaTileEntity_RTG.convertDaysToTicks(aFuelDays), aVoltage); GT_MetaTileEntity_Hatch_Energy_RTG.registerPelletForHatch(aFuelPellet, eu); return true; } else { @@ -2277,23 +2135,16 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder { } @Override - public boolean addColdTrapRecipe( - int aCircuit, - ItemStack aInput, - FluidStack aFluidInput, - ItemStack[] aOutputs, - int[] aChances, - FluidStack aFluidOutput, - int aTime, - int aEU) { + public boolean addColdTrapRecipe(int aCircuit, ItemStack aInput, FluidStack aFluidInput, ItemStack[] aOutputs, + int[] aChances, FluidStack aFluidOutput, int aTime, int aEU) { GTPP_Recipe aRecipe = new GTPP_Recipe( false, - new ItemStack[] {CI.getNumberedAdvancedCircuit(aCircuit), aInput}, + new ItemStack[] { CI.getNumberedAdvancedCircuit(aCircuit), aInput }, aOutputs, null, aChances, - new FluidStack[] {aFluidInput}, - new FluidStack[] {aFluidOutput}, + new FluidStack[] { aFluidInput }, + new FluidStack[] { aFluidOutput }, aTime, aEU, 0); @@ -2304,23 +2155,16 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder { } @Override - public boolean addReactorProcessingUnitRecipe( - ItemStack aInput1, - ItemStack aInput2, - FluidStack aFluidInput, - ItemStack[] aOutputs, - int[] aChances, - FluidStack aFluidOutput, - int aTime, - int aEU) { + public boolean addReactorProcessingUnitRecipe(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, + ItemStack[] aOutputs, int[] aChances, FluidStack aFluidOutput, int aTime, int aEU) { GTPP_Recipe aRecipe = new GTPP_Recipe( false, - new ItemStack[] {aInput1, aInput2}, + new ItemStack[] { aInput1, aInput2 }, aOutputs, null, aChances, - new FluidStack[] {aFluidInput}, - new FluidStack[] {aFluidOutput}, + new FluidStack[] { aFluidInput }, + new FluidStack[] { aFluidOutput }, aTime, aEU, 0); @@ -2331,18 +2175,18 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder { } @Override - public boolean addFluidHeaterRecipe( - ItemStack aInput, FluidStack aFluidInput, FluidStack aOutput, int aDuration, int aEUt) { + public boolean addFluidHeaterRecipe(ItemStack aInput, FluidStack aFluidInput, FluidStack aOutput, int aDuration, + int aEUt) { if ((aInput == null && aFluidInput == null) || (aOutput == null)) { return false; } GT_Recipe.GT_Recipe_Map.sFluidHeaterRecipes.addRecipe( true, - new ItemStack[] {aInput}, + new ItemStack[] { aInput }, null, null, - new FluidStack[] {aFluidInput}, - new FluidStack[] {aOutput}, + new FluidStack[] { aFluidInput }, + new FluidStack[] { aOutput }, aDuration, aEUt, 0); @@ -2356,10 +2200,10 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder { } GTPP_Recipe aRecipe = new GTPP_Recipe( false, - new ItemStack[] {aInput}, - new ItemStack[] {aOutput}, + new ItemStack[] { aInput }, + new ItemStack[] { aOutput }, null, - new int[] {10000}, + new int[] { 10000 }, new FluidStack[] {}, new FluidStack[] {}, aDuration, @@ -2378,10 +2222,10 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder { } GTPP_Recipe aRecipe = new GTPP_Recipe( false, - new ItemStack[] {aInput}, - new ItemStack[] {aOutput}, + new ItemStack[] { aInput }, + new ItemStack[] { aOutput }, null, - new int[] {10000}, + new int[] { 10000 }, new FluidStack[] {}, new FluidStack[] {}, aDuration, @@ -2394,8 +2238,8 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder { } @Override - public boolean addMolecularTransformerRecipe( - ItemStack aInput, ItemStack aOutput, int aDuration, int aEUt, int aAmps) { + public boolean addMolecularTransformerRecipe(ItemStack aInput, ItemStack aOutput, int aDuration, int aEUt, + int aAmps) { return addMolecularTransformerRecipe(aInput, aOutput, aDuration, aEUt); } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/recipes/RecipesToRemove.java b/src/main/java/gtPlusPlus/xmod/gregtech/recipes/RecipesToRemove.java index 271e29d654..aaa3ff2876 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/recipes/RecipesToRemove.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/recipes/RecipesToRemove.java @@ -1,13 +1,14 @@ package gtPlusPlus.xmod.gregtech.recipes; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidStack; + import gregtech.api.util.GTPP_Recipe; import gregtech.api.util.GT_Recipe; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.material.Material; import gtPlusPlus.core.material.ORES; import gtPlusPlus.core.util.minecraft.ItemUtils; -import net.minecraft.item.ItemStack; -import net.minecraftforge.fluids.FluidStack; public class RecipesToRemove { @@ -20,9 +21,11 @@ public class RecipesToRemove { // caesium // Replaced by advanced sifting recipe. GT_Recipe aRareEarthCentrifuging = GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.findRecipe( - null, false, 20, new FluidStack[] {}, new ItemStack[] { - ItemUtils.getItemStackOfAmountFromOreDict("dustRareEarth", 1) - }); + null, + false, + 20, + new FluidStack[] {}, + new ItemStack[] { ItemUtils.getItemStackOfAmountFromOreDict("dustRareEarth", 1) }); if (aRareEarthCentrifuging != null && aRareEarthCentrifuging.mEnabled) { aRareEarthCentrifuging.mEnabled = false; aRareEarthCentrifuging.mHidden = true; @@ -32,19 +35,15 @@ public class RecipesToRemove { Logger.INFO("Removed vanilla GT Rare Earth processing."); // Set the Chemical Symbol for Rare Earth now that we are giving it custom outputs // Best not to set this unless the original recipe is removed. - /*Materials.RareEarth.mChemicalFormula = "(" - +ELEMENT.getInstance().YTTRIUM.vChemicalSymbol - +ELEMENT.getInstance().NEODYMIUM.vChemicalSymbol - +ELEMENT.getInstance().LANTHANUM.vChemicalSymbol - +ELEMENT.getInstance().CERIUM.vChemicalSymbol - +ELEMENT.getInstance().CADMIUM.vChemicalSymbol - +ELEMENT.getInstance().CAESIUM.vChemicalSymbol - +ELEMENT.getInstance().YTTERBIUM.vChemicalSymbol - +ELEMENT.getInstance().SAMARIUM.vChemicalSymbol - +ELEMENT.getInstance().GADOLINIUM.vChemicalSymbol+ - ")";*/ + /* + * Materials.RareEarth.mChemicalFormula = "(" +ELEMENT.getInstance().YTTRIUM.vChemicalSymbol + * +ELEMENT.getInstance().NEODYMIUM.vChemicalSymbol +ELEMENT.getInstance().LANTHANUM.vChemicalSymbol + * +ELEMENT.getInstance().CERIUM.vChemicalSymbol +ELEMENT.getInstance().CADMIUM.vChemicalSymbol + * +ELEMENT.getInstance().CAESIUM.vChemicalSymbol +ELEMENT.getInstance().YTTERBIUM.vChemicalSymbol + * +ELEMENT.getInstance().SAMARIUM.vChemicalSymbol +ELEMENT.getInstance().GADOLINIUM.vChemicalSymbol+ ")"; + */ - Material[] aLowTierOutputMaterials = new Material[] {ORES.GREENOCKITE}; + Material[] aLowTierOutputMaterials = new Material[] { ORES.GREENOCKITE }; } } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/recipes/machines/RECIPEHANDLER_AssemblyLine.java b/src/main/java/gtPlusPlus/xmod/gregtech/recipes/machines/RECIPEHANDLER_AssemblyLine.java index 43c48232d8..cb0ec59f22 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/recipes/machines/RECIPEHANDLER_AssemblyLine.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/recipes/machines/RECIPEHANDLER_AssemblyLine.java @@ -5,14 +5,9 @@ import net.minecraftforge.fluids.FluidStack; public class RECIPEHANDLER_AssemblyLine { - public static boolean addAssemblylineRecipe( - ItemStack paramItemStack1, - int paramInt1, - ItemStack[] paramArrayOfItemStack, - FluidStack[] paramArrayOfFluidStack, - ItemStack paramItemStack2, - int paramInt2, - int paramInt3) { + public static boolean addAssemblylineRecipe(ItemStack paramItemStack1, int paramInt1, + ItemStack[] paramArrayOfItemStack, FluidStack[] paramArrayOfFluidStack, ItemStack paramItemStack2, + int paramInt2, int paramInt3) { return false; } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/recipes/machines/RECIPEHANDLER_CokeOven.java b/src/main/java/gtPlusPlus/xmod/gregtech/recipes/machines/RECIPEHANDLER_CokeOven.java index 627241cd53..599b98ed86 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/recipes/machines/RECIPEHANDLER_CokeOven.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/recipes/machines/RECIPEHANDLER_CokeOven.java @@ -1,9 +1,10 @@ package gtPlusPlus.xmod.gregtech.recipes.machines; -import gtPlusPlus.api.objects.Logger; import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.FluidStack; +import gtPlusPlus.api.objects.Logger; + public class RECIPEHANDLER_CokeOven { public static void debug1() { @@ -14,75 +15,105 @@ public class RECIPEHANDLER_CokeOven { Logger.WARNING("My name is Ralph and I will be your humble host."); } - public static void debug2( - final ItemStack aInput1, - final ItemStack aInput2, - final FluidStack aFluidInput, - final FluidStack aFluidOutput, - final ItemStack aOutput, - final int aDuration, - final int aEUt) { + public static void debug2(final ItemStack aInput1, final ItemStack aInput2, final FluidStack aFluidInput, + final FluidStack aFluidOutput, final ItemStack aOutput, final int aDuration, final int aEUt) { Logger.WARNING("=================================================================================="); Logger.WARNING("Taking a step forward."); Logger.WARNING("aInput1 == null && aFluidInput == null || aOutput == null && aFluidOutput == null"); - Logger.WARNING("aInput1:" + aInput1.toString() + " aInput2:" + aInput2.toString() + " aFluidInput:" - + aFluidInput.toString() + " aFluidOutput:" + aFluidOutput.toString() + " aOutput:" + aOutput.toString() - + " aDuration:" + aDuration + " aEU/t:" + aEUt); + Logger.WARNING( + "aInput1:" + aInput1.toString() + + " aInput2:" + + aInput2.toString() + + " aFluidInput:" + + aFluidInput.toString() + + " aFluidOutput:" + + aFluidOutput.toString() + + " aOutput:" + + aOutput.toString() + + " aDuration:" + + aDuration + + " aEU/t:" + + aEUt); Logger.WARNING("Passed."); } - public static void debug3( - final ItemStack aInput1, - final ItemStack aInput2, - final FluidStack aFluidInput, - final FluidStack aFluidOutput, - final ItemStack aOutput, - final int aDuration, - final int aEUt) { + public static void debug3(final ItemStack aInput1, final ItemStack aInput2, final FluidStack aFluidInput, + final FluidStack aFluidOutput, final ItemStack aOutput, final int aDuration, final int aEUt) { Logger.WARNING("=================================================================================="); Logger.WARNING("Taking a step forward."); Logger.WARNING( "(aOutput != null) && ((aDuration = GregTech_API.sRecipeFile.get(cokeoven, aOutput, aDuration)) <= 0)"); - Logger.WARNING("aInput1:" + aInput1.toString() + " aInput2:" + aInput2.toString() + " aFluidInput:" - + aFluidInput.toString() + " aFluidOutput:" + aFluidOutput.toString() + " aOutput:" + aOutput.toString() - + " aDuration:" + aDuration + " aEU/t:" + aEUt); + Logger.WARNING( + "aInput1:" + aInput1.toString() + + " aInput2:" + + aInput2.toString() + + " aFluidInput:" + + aFluidInput.toString() + + " aFluidOutput:" + + aFluidOutput.toString() + + " aOutput:" + + aOutput.toString() + + " aDuration:" + + aDuration + + " aEU/t:" + + aEUt); Logger.WARNING("Passed."); } - public static void debug4( - final ItemStack aInput1, - final ItemStack aInput2, - final FluidStack aFluidInput, - final FluidStack aFluidOutput, - final ItemStack aOutput, - final int aDuration, - final int aEUt) { + public static void debug4(final ItemStack aInput1, final ItemStack aInput2, final FluidStack aFluidInput, + final FluidStack aFluidOutput, final ItemStack aOutput, final int aDuration, final int aEUt) { Logger.WARNING("=================================================================================="); Logger.WARNING("Taking a step forward."); Logger.WARNING( "(aFluidOutput != null) && ((aDuration = GregTech_API.sRecipeFile.get(cokeoven, aFluidOutput.getFluid().getName(), aDuration)) <= 0)"); - Logger.WARNING("aInput1:" + aInput1.toString() + " aInput2:" + aInput2.toString() + " aFluidInput:" - + aFluidInput.toString() + " aFluidOutput:" + aFluidOutput.toString() + " aOutput:" + aOutput.toString() - + " aDuration:" + aDuration + " aEU/t:" + aEUt); + Logger.WARNING( + "aInput1:" + aInput1.toString() + + " aInput2:" + + aInput2.toString() + + " aFluidInput:" + + aFluidInput.toString() + + " aFluidOutput:" + + aFluidOutput.toString() + + " aOutput:" + + aOutput.toString() + + " aDuration:" + + aDuration + + " aEU/t:" + + aEUt); Logger.WARNING("Passed."); - Logger.WARNING("aInput1:" + aInput1.toString() + " aInput2:" + aInput2.toString() + " aFluidInput:" - + aFluidInput.toString() + " aFluidOutput:" + aFluidOutput.toString() + " aOutput:" + aOutput.toString() - + " aDuration:" + aDuration + " aEU/t:" + aEUt); + Logger.WARNING( + "aInput1:" + aInput1.toString() + + " aInput2:" + + aInput2.toString() + + " aFluidInput:" + + aFluidInput.toString() + + " aFluidOutput:" + + aFluidOutput.toString() + + " aOutput:" + + aOutput.toString() + + " aDuration:" + + aDuration + + " aEU/t:" + + aEUt); } - public static void debug5( - final ItemStack aInput1, - final ItemStack aInput2, - final FluidStack aFluidInput, - final FluidStack aFluidOutput, - final ItemStack aOutput, - final int aDuration, - final int aEUt) { - Logger.INFO("Successfully added a Coke Oven recipe for: " + aOutput.getDisplayName() + " & " - + aFluidOutput.getFluid().getName() + ", Using " + aInput1.getDisplayName() + " & " - + aInput2.getDisplayName() + " & liquid " - + aFluidInput.getFluid().getName() + ". This takes " + (aDuration / 20) + " seconds for " + aEUt - + "eu/t."); + public static void debug5(final ItemStack aInput1, final ItemStack aInput2, final FluidStack aFluidInput, + final FluidStack aFluidOutput, final ItemStack aOutput, final int aDuration, final int aEUt) { + Logger.INFO( + "Successfully added a Coke Oven recipe for: " + aOutput.getDisplayName() + + " & " + + aFluidOutput.getFluid().getName() + + ", Using " + + aInput1.getDisplayName() + + " & " + + aInput2.getDisplayName() + + " & liquid " + + aFluidInput.getFluid().getName() + + ". This takes " + + (aDuration / 20) + + " seconds for " + + aEUt + + "eu/t."); Logger.WARNING("=================================================================================="); Logger.WARNING("=================================================================================="); Logger.WARNING("=================================================================================="); diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/recipes/machines/RECIPEHANDLER_Dehydrator.java b/src/main/java/gtPlusPlus/xmod/gregtech/recipes/machines/RECIPEHANDLER_Dehydrator.java index b9f4c11887..fc9ed99ffe 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/recipes/machines/RECIPEHANDLER_Dehydrator.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/recipes/machines/RECIPEHANDLER_Dehydrator.java @@ -1,10 +1,11 @@ package gtPlusPlus.xmod.gregtech.recipes.machines; -import gtPlusPlus.api.objects.Logger; -import gtPlusPlus.core.util.minecraft.ItemUtils; import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.FluidStack; +import gtPlusPlus.api.objects.Logger; +import gtPlusPlus.core.util.minecraft.ItemUtils; + public class RECIPEHANDLER_Dehydrator { public static void debug1() { @@ -15,70 +16,90 @@ public class RECIPEHANDLER_Dehydrator { Logger.WARNING("My name is Willus and I will be your humble host."); } - public static void debug2( - final ItemStack aInput1, - final ItemStack aInput2, - final FluidStack aFluidInput, - final FluidStack aFluidOutput, - final ItemStack aOutput, - final int aDuration, - final int aEUt) { + public static void debug2(final ItemStack aInput1, final ItemStack aInput2, final FluidStack aFluidInput, + final FluidStack aFluidOutput, final ItemStack aOutput, final int aDuration, final int aEUt) { Logger.WARNING("=================================================================================="); Logger.WARNING("Taking a step forward."); Logger.WARNING("aInput1 == null && aFluidInput == null || aOutput == null && aFluidOutput == null"); - Logger.WARNING("aInput1:" + aInput1.toString() + " aInput2:" + aInput2.toString() + " aFluidInput:" - + aFluidInput.toString() + " aFluidOutput:" + aFluidOutput.toString() + " aOutput:" + aOutput.toString() - + " aDuration:" + aDuration + " aEU/t:" + aEUt); + Logger.WARNING( + "aInput1:" + aInput1.toString() + + " aInput2:" + + aInput2.toString() + + " aFluidInput:" + + aFluidInput.toString() + + " aFluidOutput:" + + aFluidOutput.toString() + + " aOutput:" + + aOutput.toString() + + " aDuration:" + + aDuration + + " aEU/t:" + + aEUt); Logger.WARNING("Passed."); } - public static void debug3( - final ItemStack aInput1, - final ItemStack aInput2, - final FluidStack aFluidInput, - final FluidStack aFluidOutput, - final ItemStack aOutput, - final int aDuration, - final int aEUt) { + public static void debug3(final ItemStack aInput1, final ItemStack aInput2, final FluidStack aFluidInput, + final FluidStack aFluidOutput, final ItemStack aOutput, final int aDuration, final int aEUt) { Logger.WARNING("=================================================================================="); Logger.WARNING("Taking a step forward."); Logger.WARNING( "(aOutput != null) && ((aDuration = GregTech_API.sRecipeFile.get(cokeoven, aOutput, aDuration)) <= 0)"); - Logger.WARNING("aInput1:" + aInput1.toString() + " aInput2:" + aInput2.toString() + " aFluidInput:" - + aFluidInput.toString() + " aFluidOutput:" + aFluidOutput.toString() + " aOutput:" + aOutput.toString() - + " aDuration:" + aDuration + " aEU/t:" + aEUt); + Logger.WARNING( + "aInput1:" + aInput1.toString() + + " aInput2:" + + aInput2.toString() + + " aFluidInput:" + + aFluidInput.toString() + + " aFluidOutput:" + + aFluidOutput.toString() + + " aOutput:" + + aOutput.toString() + + " aDuration:" + + aDuration + + " aEU/t:" + + aEUt); Logger.WARNING("Passed."); } - public static void debug4( - final ItemStack aInput1, - final ItemStack aInput2, - final FluidStack aFluidInput, - final FluidStack aFluidOutput, - final ItemStack aOutput, - final int aDuration, - final int aEUt) { + public static void debug4(final ItemStack aInput1, final ItemStack aInput2, final FluidStack aFluidInput, + final FluidStack aFluidOutput, final ItemStack aOutput, final int aDuration, final int aEUt) { Logger.WARNING("=================================================================================="); Logger.WARNING("Taking a step forward."); Logger.WARNING( "(aFluidOutput != null) && ((aDuration = GregTech_API.sRecipeFile.get(cokeoven, aFluidOutput.getFluid().getName(), aDuration)) <= 0)"); - Logger.WARNING("aInput1:" + aInput1.toString() + " aInput2:" + aInput2.toString() + " aFluidInput:" - + aFluidInput.toString() + " aFluidOutput:" + aFluidOutput.toString() + " aOutput:" + aOutput.toString() - + " aDuration:" + aDuration + " aEU/t:" + aEUt); + Logger.WARNING( + "aInput1:" + aInput1.toString() + + " aInput2:" + + aInput2.toString() + + " aFluidInput:" + + aFluidInput.toString() + + " aFluidOutput:" + + aFluidOutput.toString() + + " aOutput:" + + aOutput.toString() + + " aDuration:" + + aDuration + + " aEU/t:" + + aEUt); Logger.WARNING("Passed."); - Logger.WARNING("aInput1:" + aInput1.toString() + " aInput2:" + aInput2.toString() + " aFluidInput:" - + aFluidInput.toString() + " aFluidOutput:" + aFluidOutput.toString() + " aOutput:" + aOutput.toString() - + " aDuration:" + aDuration + " aEU/t:" + aEUt); + Logger.WARNING( + "aInput1:" + aInput1.toString() + + " aInput2:" + + aInput2.toString() + + " aFluidInput:" + + aFluidInput.toString() + + " aFluidOutput:" + + aFluidOutput.toString() + + " aOutput:" + + aOutput.toString() + + " aDuration:" + + aDuration + + " aEU/t:" + + aEUt); } - public static void debug5( - final ItemStack aInput1, - final ItemStack aInput2, - final FluidStack aFluidInput, - final FluidStack aFluidOutput, - final ItemStack[] aOutput, - final int aDuration, - final int aEUt) { + public static void debug5(final ItemStack aInput1, final ItemStack aInput2, final FluidStack aFluidInput, + final FluidStack aFluidOutput, final ItemStack[] aOutput, final int aDuration, final int aEUt) { String inputAname; String inputBname; @@ -109,9 +130,21 @@ public class RECIPEHANDLER_Dehydrator { outputFluidName = "null"; } - Logger.INFO("Successfully added a Chemical Dehydrator recipe for: " + ItemUtils.getArrayStackNames(aOutput) - + " & " + outputFluidName + ", Using " + inputAname + " & " + inputBname + " & liquid " + inputFluidname - + ". This takes " + (aDuration / 20) + " seconds for " + aEUt + "eu/t."); + Logger.INFO( + "Successfully added a Chemical Dehydrator recipe for: " + ItemUtils.getArrayStackNames(aOutput) + + " & " + + outputFluidName + + ", Using " + + inputAname + + " & " + + inputBname + + " & liquid " + + inputFluidname + + ". This takes " + + (aDuration / 20) + + " seconds for " + + aEUt + + "eu/t."); Logger.WARNING("=================================================================================="); Logger.WARNING("=================================================================================="); Logger.WARNING("=================================================================================="); diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/recipes/machines/RECIPEHANDLER_MatterFabricator.java b/src/main/java/gtPlusPlus/xmod/gregtech/recipes/machines/RECIPEHANDLER_MatterFabricator.java index 6523e0a6f6..ea2f4a95fe 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/recipes/machines/RECIPEHANDLER_MatterFabricator.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/recipes/machines/RECIPEHANDLER_MatterFabricator.java @@ -1,8 +1,9 @@ package gtPlusPlus.xmod.gregtech.recipes.machines; -import gtPlusPlus.api.objects.Logger; import net.minecraftforge.fluids.FluidStack; +import gtPlusPlus.api.objects.Logger; + public class RECIPEHANDLER_MatterFabricator { public static void debug1() { @@ -13,42 +14,66 @@ public class RECIPEHANDLER_MatterFabricator { Logger.WARNING("My name is Ralph and I will be your humble host."); } - public static void debug2( - final FluidStack aFluidInput, final FluidStack aFluidOutput, final int aDuration, final int aEUt) { + public static void debug2(final FluidStack aFluidInput, final FluidStack aFluidOutput, final int aDuration, + final int aEUt) { Logger.WARNING("=================================================================================="); Logger.WARNING("Taking a step forward."); Logger.WARNING("aInput1 == null && aFluidInput == null || aOutput == null && aFluidOutput == null"); - Logger.WARNING("aFluidInput:" + aFluidInput.toString() + " aFluidOutput:" + aFluidOutput.toString() - + " aDuration:" + aDuration + " aEU/t:" + aEUt); + Logger.WARNING( + "aFluidInput:" + aFluidInput.toString() + + " aFluidOutput:" + + aFluidOutput.toString() + + " aDuration:" + + aDuration + + " aEU/t:" + + aEUt); Logger.WARNING("Passed."); } - public static void debug3( - final FluidStack aFluidInput, final FluidStack aFluidOutput, final int aDuration, final int aEUt) { + public static void debug3(final FluidStack aFluidInput, final FluidStack aFluidOutput, final int aDuration, + final int aEUt) { Logger.WARNING("=================================================================================="); Logger.WARNING("Taking a step forward."); Logger.WARNING( "(aOutput != null) && ((aDuration = GregTech_API.sRecipeFile.get(cokeoven, aOutput, aDuration)) <= 0)"); - Logger.WARNING("aFluidInput:" + aFluidInput.toString() + " aFluidOutput:" + aFluidOutput.toString() - + " aDuration:" + aDuration + " aEU/t:" + aEUt); + Logger.WARNING( + "aFluidInput:" + aFluidInput.toString() + + " aFluidOutput:" + + aFluidOutput.toString() + + " aDuration:" + + aDuration + + " aEU/t:" + + aEUt); Logger.WARNING("Passed."); } - public static void debug4( - final FluidStack aFluidInput, final FluidStack aFluidOutput, final int aDuration, final int aEUt) { + public static void debug4(final FluidStack aFluidInput, final FluidStack aFluidOutput, final int aDuration, + final int aEUt) { Logger.WARNING("=================================================================================="); Logger.WARNING("Taking a step forward."); Logger.WARNING( "(aFluidOutput != null) && ((aDuration = GregTech_API.sRecipeFile.get(cokeoven, aFluidOutput.getFluid().getName(), aDuration)) <= 0)"); - Logger.WARNING("aFluidInput:" + aFluidInput.toString() + " aFluidOutput:" + aFluidOutput.toString() - + " aDuration:" + aDuration + " aEU/t:" + aEUt); + Logger.WARNING( + "aFluidInput:" + aFluidInput.toString() + + " aFluidOutput:" + + aFluidOutput.toString() + + " aDuration:" + + aDuration + + " aEU/t:" + + aEUt); Logger.WARNING("Passed."); - Logger.WARNING("aFluidInput:" + aFluidInput.toString() + " aFluidOutput:" + aFluidOutput.toString() - + " aDuration:" + aDuration + " aEU/t:" + aEUt); + Logger.WARNING( + "aFluidInput:" + aFluidInput.toString() + + " aFluidOutput:" + + aFluidOutput.toString() + + " aDuration:" + + aDuration + + " aEU/t:" + + aEUt); } - public static void debug5( - final FluidStack aFluidInput, final FluidStack aFluidOutput, final int aDuration, final int aEUt) { + public static void debug5(final FluidStack aFluidInput, final FluidStack aFluidOutput, final int aDuration, + final int aEUt) { String a = "nothing"; String b = ""; @@ -59,8 +84,16 @@ public class RECIPEHANDLER_MatterFabricator { b = aFluidOutput.getFluid().getName(); } - Logger.INFO("Successfully added a Matter Fabrication recipe for: " + b + ", Using " + " liquid " + a - + ". This takes " + (aDuration / 20) + " seconds for " + aEUt + "eu/t."); + Logger.INFO( + "Successfully added a Matter Fabrication recipe for: " + b + + ", Using " + + " liquid " + + a + + ". This takes " + + (aDuration / 20) + + " seconds for " + + aEUt + + "eu/t."); Logger.WARNING("=================================================================================="); Logger.WARNING("=================================================================================="); Logger.WARNING("=================================================================================="); diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/Gregtech4Content.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/Gregtech4Content.java index 898fe17a52..36035364c0 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/Gregtech4Content.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/Gregtech4Content.java @@ -36,30 +36,41 @@ public class Gregtech4Content { private static void computer() { Logger.INFO("Gregtech 4 Content | Registering Computer Cube."); - GregtechItemList.Gregtech_Computer_Cube_Machine.set( - new GT_TileEntity_ComputerCube(31130, "C-O-M-P-U-T-E-R").getStackForm(1L)); + GregtechItemList.Gregtech_Computer_Cube_Machine + .set(new GT_TileEntity_ComputerCube(31130, "C-O-M-P-U-T-E-R").getStackForm(1L)); } private static void workbenches() { // Gregtech 4 Workbenches Logger.INFO("Gregtech 4 Content | Registering Workbenches."); - GregtechItemList.GT4_Workbench_Bronze.set(new GT_MetaTileEntity_BronzeCraftingTable( - 31081, "workbench.basic", "Bronze Workbench", 0, "Stores 16000L of fluid") - .getStackForm(1L)); - GregtechItemList.GT4_Workbench_Advanced.set(new GT_MetaTileEntity_AdvancedCraftingTable( - 31082, "workbench.advanced", "Advanced Workbench", 3, "Stores 64000L of fluid") - .getStackForm(1L)); + GregtechItemList.GT4_Workbench_Bronze.set( + new GT_MetaTileEntity_BronzeCraftingTable( + 31081, + "workbench.basic", + "Bronze Workbench", + 0, + "Stores 16000L of fluid").getStackForm(1L)); + GregtechItemList.GT4_Workbench_Advanced.set( + new GT_MetaTileEntity_AdvancedCraftingTable( + 31082, + "workbench.advanced", + "Advanced Workbench", + 3, + "Stores 64000L of fluid").getStackForm(1L)); } private static void redstone() { Logger.INFO("Gregtech 4 Content | Registering Redstone Blocks."); GregtechItemList.GT4_Redstone_Lamp.set(new GT_MetaTileEntity_RedstoneLamp(31120).getStackForm(1L)); - GregtechItemList.GT4_Redstone_Button_Panel.set( - new GT_MetaTileEntity_RedstoneButtonPanel(31121).getStackForm(1L)); + GregtechItemList.GT4_Redstone_Button_Panel + .set(new GT_MetaTileEntity_RedstoneButtonPanel(31121).getStackForm(1L)); GregtechItemList.GT4_Redstone_Scale.set(new GT_MetaTileEntity_RedstoneStrengthScale(31122).getStackForm(1L)); - GregtechItemList.GT4_Redstone_Display.set(new GT_MetaTileEntity_RedstoneStrengthDisplay( - 31123, "redstone.display.strength", "Redstone Display", "Displays Redstone Strength") - .getStackForm(1L)); + GregtechItemList.GT4_Redstone_Display.set( + new GT_MetaTileEntity_RedstoneStrengthDisplay( + 31123, + "redstone.display.strength", + "Redstone Display", + "Displays Redstone Strength").getStackForm(1L)); GregtechItemList.GT4_Redstone_Circuit.set(new GT_MetaTileEntity_RedstoneCircuitBlock(31124).getStackForm(1L)); } @@ -157,15 +168,21 @@ public class Gregtech4Content { GregtechItemList.GT4_Shelf_Iron.set( new GT4Entity_Shelf_Iron(871, "gtplusplus.shelf.iron", "Metal Shelf", "A heavy duty shelf") .getStackForm(1L)); - GregtechItemList.GT4_Shelf_FileCabinet.set(new GT4Entity_Shelf_FileCabinet( - 872, "gtplusplus.shelf.filecabinet", "File Cabinet", "Could look nice in your office") - .getStackForm(1L)); + GregtechItemList.GT4_Shelf_FileCabinet.set( + new GT4Entity_Shelf_FileCabinet( + 872, + "gtplusplus.shelf.filecabinet", + "File Cabinet", + "Could look nice in your office").getStackForm(1L)); GregtechItemList.GT4_Shelf_Desk.set( new GT4Entity_Shelf_Desk(873, "gtplusplus.shelf.desk", "Metal encased Desk", "A place to study") .getStackForm(1L)); - GregtechItemList.GT4_Shelf_Compartment.set(new GT4Entity_Shelf_Compartment( - 874, "gtplusplus.shelf.compartment", "Compartment", "Stores Books & Things") - .getStackForm(1L)); + GregtechItemList.GT4_Shelf_Compartment.set( + new GT4Entity_Shelf_Compartment( + 874, + "gtplusplus.shelf.compartment", + "Compartment", + "Stores Books & Things").getStackForm(1L)); // Custom Storage GregtechItemList.GT4_Shelf_Large.set( diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechAdvancedBoilers.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechAdvancedBoilers.java index de8dd983e9..23d9cb88fa 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechAdvancedBoilers.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechAdvancedBoilers.java @@ -1,5 +1,7 @@ package gtPlusPlus.xmod.gregtech.registration.gregtech; +import net.minecraft.item.ItemStack; + import gregtech.api.enums.ItemList; import gregtech.api.enums.Materials; import gregtech.api.enums.OrePrefixes; @@ -13,7 +15,6 @@ import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; import gtPlusPlus.xmod.gregtech.common.tileentities.generators.GT_MetaTileEntity_Boiler_HV; import gtPlusPlus.xmod.gregtech.common.tileentities.generators.GT_MetaTileEntity_Boiler_LV; import gtPlusPlus.xmod.gregtech.common.tileentities.generators.GT_MetaTileEntity_Boiler_MV; -import net.minecraft.item.ItemStack; public class GregtechAdvancedBoilers { @@ -26,88 +27,55 @@ public class GregtechAdvancedBoilers { private static void run1() { // Boilers - GregtechItemList.Boiler_Advanced_LV.set( - new GT_MetaTileEntity_Boiler_LV(753, "Advanced Boiler [LV]", 1).getStackForm(1L)); - GregtechItemList.Boiler_Advanced_MV.set( - new GT_MetaTileEntity_Boiler_MV(754, "Advanced Boiler [MV]", 2).getStackForm(1L)); - GregtechItemList.Boiler_Advanced_HV.set( - new GT_MetaTileEntity_Boiler_HV(755, "Advanced Boiler [HV]", 3).getStackForm(1L)); + GregtechItemList.Boiler_Advanced_LV + .set(new GT_MetaTileEntity_Boiler_LV(753, "Advanced Boiler [LV]", 1).getStackForm(1L)); + GregtechItemList.Boiler_Advanced_MV + .set(new GT_MetaTileEntity_Boiler_MV(754, "Advanced Boiler [MV]", 2).getStackForm(1L)); + GregtechItemList.Boiler_Advanced_HV + .set(new GT_MetaTileEntity_Boiler_HV(755, "Advanced Boiler [HV]", 3).getStackForm(1L)); - ItemStack chassisT1 = - ItemUtils.getItemStackWithMeta(true, "miscutils:itemBoilerChassis", "Boiler_Chassis_T1", 0, 1); - ItemStack chassisT2 = - ItemUtils.getItemStackWithMeta(true, "miscutils:itemBoilerChassis", "Boiler_Chassis_T1", 1, 1); - ItemStack chassisT3 = - ItemUtils.getItemStackWithMeta(true, "miscutils:itemBoilerChassis", "Boiler_Chassis_T1", 2, 1); + ItemStack chassisT1 = ItemUtils + .getItemStackWithMeta(true, "miscutils:itemBoilerChassis", "Boiler_Chassis_T1", 0, 1); + ItemStack chassisT2 = ItemUtils + .getItemStackWithMeta(true, "miscutils:itemBoilerChassis", "Boiler_Chassis_T1", 1, 1); + ItemStack chassisT3 = ItemUtils + .getItemStackWithMeta(true, "miscutils:itemBoilerChassis", "Boiler_Chassis_T1", 2, 1); // Make the Coil in each following recipe a hammer and a Screwdriver. // Chassis Recipes GT_ModHandler.addCraftingRecipe( chassisT1, - GT_ModHandler.RecipeBits.DISMANTLEABLE - | GT_ModHandler.RecipeBits.NOT_REMOVABLE + GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED, - new Object[] { - "WCW", - "GMG", - "WPW", - Character.valueOf('M'), - ItemList.Hull_ULV, - Character.valueOf('P'), - OrePrefixes.pipeLarge.get(Materials.Bronze), - Character.valueOf('C'), - OrePrefixes.circuit.get(Materials.Primitive), - Character.valueOf('W'), - OrePrefixes.plate.get(Materials.Lead), - Character.valueOf('G'), - OrePrefixes.pipeSmall.get(Materials.Copper) - }); + new Object[] { "WCW", "GMG", "WPW", Character.valueOf('M'), ItemList.Hull_ULV, Character.valueOf('P'), + OrePrefixes.pipeLarge.get(Materials.Bronze), Character.valueOf('C'), + OrePrefixes.circuit.get(Materials.Primitive), Character.valueOf('W'), + OrePrefixes.plate.get(Materials.Lead), Character.valueOf('G'), + OrePrefixes.pipeSmall.get(Materials.Copper) }); GT_ModHandler.addCraftingRecipe( chassisT2, - GT_ModHandler.RecipeBits.DISMANTLEABLE - | GT_ModHandler.RecipeBits.NOT_REMOVABLE + GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED, - new Object[] { - "WCW", - "GMG", - "WPW", - Character.valueOf('M'), - ItemList.Hull_LV, - Character.valueOf('P'), - OrePrefixes.pipeLarge.get(Materials.Steel), - Character.valueOf('C'), - OrePrefixes.circuit.get(Materials.Basic), - Character.valueOf('W'), - OrePrefixes.plate.get(Materials.Steel), - Character.valueOf('G'), - OrePrefixes.pipeSmall.get(Materials.Bronze) - }); + new Object[] { "WCW", "GMG", "WPW", Character.valueOf('M'), ItemList.Hull_LV, Character.valueOf('P'), + OrePrefixes.pipeLarge.get(Materials.Steel), Character.valueOf('C'), + OrePrefixes.circuit.get(Materials.Basic), Character.valueOf('W'), + OrePrefixes.plate.get(Materials.Steel), Character.valueOf('G'), + OrePrefixes.pipeSmall.get(Materials.Bronze) }); GT_ModHandler.addCraftingRecipe( chassisT3, - GT_ModHandler.RecipeBits.DISMANTLEABLE - | GT_ModHandler.RecipeBits.NOT_REMOVABLE + GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED, - new Object[] { - "WCW", - "GMG", - "WPW", - Character.valueOf('M'), - ItemList.Hull_MV, - Character.valueOf('P'), - OrePrefixes.pipeLarge.get(Materials.StainlessSteel), - Character.valueOf('C'), - OrePrefixes.circuit.get(Materials.Good), - Character.valueOf('W'), - OrePrefixes.plate.get(Materials.Aluminium), - Character.valueOf('G'), - OrePrefixes.pipeSmall.get(Materials.Steel) - }); + new Object[] { "WCW", "GMG", "WPW", Character.valueOf('M'), ItemList.Hull_MV, Character.valueOf('P'), + OrePrefixes.pipeLarge.get(Materials.StainlessSteel), Character.valueOf('C'), + OrePrefixes.circuit.get(Materials.Good), Character.valueOf('W'), + OrePrefixes.plate.get(Materials.Aluminium), Character.valueOf('G'), + OrePrefixes.pipeSmall.get(Materials.Steel) }); ItemStack pipeTier1 = ItemUtils.getItemStackOfAmountFromOreDict(RECIPES_MachineComponents.pipeTier7, 1); ItemStack pipeTier2 = ItemUtils.getItemStackOfAmountFromOreDict(RECIPES_MachineComponents.pipeTier8, 1); @@ -116,68 +84,30 @@ public class GregtechAdvancedBoilers { // Boiler Recipes GT_ModHandler.addCraftingRecipe( GregtechItemList.Boiler_Advanced_LV.get(1L, new Object[0]), - GT_ModHandler.RecipeBits.DISMANTLEABLE - | GT_ModHandler.RecipeBits.NOT_REMOVABLE + GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED, - new Object[] { - "dCw", - "WMW", - "GPG", - Character.valueOf('M'), - ItemList.Hull_LV, - Character.valueOf('P'), - pipeTier1, - Character.valueOf('C'), - OrePrefixes.circuit.get(Materials.Basic), - Character.valueOf('W'), - chassisT1, - Character.valueOf('G'), - OrePrefixes.gear.get(Materials.Steel) - }); + new Object[] { "dCw", "WMW", "GPG", Character.valueOf('M'), ItemList.Hull_LV, Character.valueOf('P'), + pipeTier1, Character.valueOf('C'), OrePrefixes.circuit.get(Materials.Basic), + Character.valueOf('W'), chassisT1, Character.valueOf('G'), + OrePrefixes.gear.get(Materials.Steel) }); GT_ModHandler.addCraftingRecipe( GregtechItemList.Boiler_Advanced_MV.get(1L, new Object[0]), - GT_ModHandler.RecipeBits.DISMANTLEABLE - | GT_ModHandler.RecipeBits.NOT_REMOVABLE + GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED, - new Object[] { - "dCw", - "WMW", - "GPG", - Character.valueOf('M'), - ItemList.Hull_MV, - Character.valueOf('P'), - pipeTier2, - Character.valueOf('C'), - OrePrefixes.circuit.get(Materials.Good), - Character.valueOf('W'), - chassisT2, - Character.valueOf('G'), - ALLOY.SILICON_CARBIDE.getGear(1) - }); + new Object[] { "dCw", "WMW", "GPG", Character.valueOf('M'), ItemList.Hull_MV, Character.valueOf('P'), + pipeTier2, Character.valueOf('C'), OrePrefixes.circuit.get(Materials.Good), + Character.valueOf('W'), chassisT2, Character.valueOf('G'), ALLOY.SILICON_CARBIDE.getGear(1) }); GT_ModHandler.addCraftingRecipe( GregtechItemList.Boiler_Advanced_HV.get(1L, new Object[0]), - GT_ModHandler.RecipeBits.DISMANTLEABLE - | GT_ModHandler.RecipeBits.NOT_REMOVABLE + GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED, - new Object[] { - "dCw", - "WMW", - "GPG", - Character.valueOf('M'), - ItemList.Hull_HV, - Character.valueOf('P'), - pipeTier3, - Character.valueOf('C'), - OrePrefixes.circuit.get(Materials.Advanced), - Character.valueOf('W'), - chassisT3, - Character.valueOf('G'), - ALLOY.SILICON_CARBIDE.getGear(1) - }); + new Object[] { "dCw", "WMW", "GPG", Character.valueOf('M'), ItemList.Hull_HV, Character.valueOf('P'), + pipeTier3, Character.valueOf('C'), OrePrefixes.circuit.get(Materials.Advanced), + Character.valueOf('W'), chassisT3, Character.valueOf('G'), ALLOY.SILICON_CARBIDE.getGear(1) }); } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechBedrockPlatforms.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechBedrockPlatforms.java index 62bbb93ffd..592db618f2 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechBedrockPlatforms.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechBedrockPlatforms.java @@ -1,15 +1,6 @@ /* -package gtPlusPlus.xmod.gregtech.registration.gregtech; - - -public class GregtechBedrockPlatforms { - - //941-945 - - public static void run() { - Logger.INFO("Gregtech5u Content | Registering Bedrock Mining Platform."); - GregtechItemList.BedrockMiner_MKI.set(new GregtechMetaTileEntity_BedrockMiningPlatform1(941, "multimachine.tier.01.bedrockminer", "Experimental Deep Earth Drilling Platform - MK I").getStackForm(1)); - } - -} -*/ + * package gtPlusPlus.xmod.gregtech.registration.gregtech; public class GregtechBedrockPlatforms { //941-945 public + * static void run() { Logger.INFO("Gregtech5u Content | Registering Bedrock Mining Platform."); + * GregtechItemList.BedrockMiner_MKI.set(new GregtechMetaTileEntity_BedrockMiningPlatform1(941, + * "multimachine.tier.01.bedrockminer", "Experimental Deep Earth Drilling Platform - MK I").getStackForm(1)); } } + */ diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechBufferDynamos.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechBufferDynamos.java index 075784d85d..eb13397bf3 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechBufferDynamos.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechBufferDynamos.java @@ -19,135 +19,115 @@ public class GregtechBufferDynamos { } private static final void run2() { - GregtechItemList.Hatch_Buffer_Dynamo_ULV.set(new GT_MetaTileEntity_Hatch_DynamoBuffer( - mID++, "hatch.dynamo.buffer.tier.00", "ULV Dynamo Hatch [Buffered]", 0) - .getStackForm(1L)); - GregtechItemList.Hatch_Buffer_Dynamo_LV.set(new GT_MetaTileEntity_Hatch_DynamoBuffer( - mID++, "hatch.dynamo.buffer.tier.01", "LV Dynamo Hatch [Buffered]", 1) - .getStackForm(1L)); - GregtechItemList.Hatch_Buffer_Dynamo_MV.set(new GT_MetaTileEntity_Hatch_DynamoBuffer( - mID++, "hatch.dynamo.buffer.tier.02", "MV Dynamo Hatch [Buffered]", 2) - .getStackForm(1L)); - GregtechItemList.Hatch_Buffer_Dynamo_HV.set(new GT_MetaTileEntity_Hatch_DynamoBuffer( - mID++, "hatch.dynamo.buffer.tier.03", "HV Dynamo Hatch [Buffered]", 3) - .getStackForm(1L)); - GregtechItemList.Hatch_Buffer_Dynamo_EV.set(new GT_MetaTileEntity_Hatch_DynamoBuffer( - mID++, "hatch.dynamo.buffer.tier.04", "EV Dynamo Hatch [Buffered]", 4) - .getStackForm(1L)); - GregtechItemList.Hatch_Buffer_Dynamo_IV.set(new GT_MetaTileEntity_Hatch_DynamoBuffer( - mID++, "hatch.dynamo.buffer.tier.05", "IV Dynamo Hatch [Buffered]", 5) - .getStackForm(1L)); - GregtechItemList.Hatch_Buffer_Dynamo_LuV.set(new GT_MetaTileEntity_Hatch_DynamoBuffer( - mID++, "hatch.dynamo.buffer.tier.06", "LuV Dynamo Hatch [Buffered]", 6) - .getStackForm(1L)); - GregtechItemList.Hatch_Buffer_Dynamo_ZPM.set(new GT_MetaTileEntity_Hatch_DynamoBuffer( - mID++, "hatch.dynamo.buffer.tier.07", "ZPM Dynamo Hatch [Buffered]", 7) - .getStackForm(1L)); - GregtechItemList.Hatch_Buffer_Dynamo_UV.set(new GT_MetaTileEntity_Hatch_DynamoBuffer( - mID++, "hatch.dynamo.buffer.tier.08", "UV Dynamo Hatch [Buffered]", 8) - .getStackForm(1L)); - GregtechItemList.Hatch_Buffer_Dynamo_MAX.set(new GT_MetaTileEntity_Hatch_DynamoBuffer( - mID++, "hatch.dynamo.buffer.tier.09", "UHV Dynamo Hatch [Buffered]", 9) - .getStackForm(1L)); + GregtechItemList.Hatch_Buffer_Dynamo_ULV.set( + new GT_MetaTileEntity_Hatch_DynamoBuffer( + mID++, + "hatch.dynamo.buffer.tier.00", + "ULV Dynamo Hatch [Buffered]", + 0).getStackForm(1L)); + GregtechItemList.Hatch_Buffer_Dynamo_LV.set( + new GT_MetaTileEntity_Hatch_DynamoBuffer( + mID++, + "hatch.dynamo.buffer.tier.01", + "LV Dynamo Hatch [Buffered]", + 1).getStackForm(1L)); + GregtechItemList.Hatch_Buffer_Dynamo_MV.set( + new GT_MetaTileEntity_Hatch_DynamoBuffer( + mID++, + "hatch.dynamo.buffer.tier.02", + "MV Dynamo Hatch [Buffered]", + 2).getStackForm(1L)); + GregtechItemList.Hatch_Buffer_Dynamo_HV.set( + new GT_MetaTileEntity_Hatch_DynamoBuffer( + mID++, + "hatch.dynamo.buffer.tier.03", + "HV Dynamo Hatch [Buffered]", + 3).getStackForm(1L)); + GregtechItemList.Hatch_Buffer_Dynamo_EV.set( + new GT_MetaTileEntity_Hatch_DynamoBuffer( + mID++, + "hatch.dynamo.buffer.tier.04", + "EV Dynamo Hatch [Buffered]", + 4).getStackForm(1L)); + GregtechItemList.Hatch_Buffer_Dynamo_IV.set( + new GT_MetaTileEntity_Hatch_DynamoBuffer( + mID++, + "hatch.dynamo.buffer.tier.05", + "IV Dynamo Hatch [Buffered]", + 5).getStackForm(1L)); + GregtechItemList.Hatch_Buffer_Dynamo_LuV.set( + new GT_MetaTileEntity_Hatch_DynamoBuffer( + mID++, + "hatch.dynamo.buffer.tier.06", + "LuV Dynamo Hatch [Buffered]", + 6).getStackForm(1L)); + GregtechItemList.Hatch_Buffer_Dynamo_ZPM.set( + new GT_MetaTileEntity_Hatch_DynamoBuffer( + mID++, + "hatch.dynamo.buffer.tier.07", + "ZPM Dynamo Hatch [Buffered]", + 7).getStackForm(1L)); + GregtechItemList.Hatch_Buffer_Dynamo_UV.set( + new GT_MetaTileEntity_Hatch_DynamoBuffer( + mID++, + "hatch.dynamo.buffer.tier.08", + "UV Dynamo Hatch [Buffered]", + 8).getStackForm(1L)); + GregtechItemList.Hatch_Buffer_Dynamo_MAX.set( + new GT_MetaTileEntity_Hatch_DynamoBuffer( + mID++, + "hatch.dynamo.buffer.tier.09", + "UHV Dynamo Hatch [Buffered]", + 9).getStackForm(1L)); GT_ModHandler.addCraftingRecipe( - GregtechItemList.Hatch_Buffer_Dynamo_ULV.get(1L, new Object[0]), bitsd, new Object[] { - "TMC", - 'M', - ItemList.Hatch_Dynamo_ULV, - 'T', - CI.getTieredCircuit(0), - 'C', - OrePrefixes.cableGt04.get((Object) Materials.Lead) - }); + GregtechItemList.Hatch_Buffer_Dynamo_ULV.get(1L, new Object[0]), + bitsd, + new Object[] { "TMC", 'M', ItemList.Hatch_Dynamo_ULV, 'T', CI.getTieredCircuit(0), 'C', + OrePrefixes.cableGt04.get((Object) Materials.Lead) }); GT_ModHandler.addCraftingRecipe( - GregtechItemList.Hatch_Buffer_Dynamo_LV.get(1L, new Object[0]), bitsd, new Object[] { - "TMC", - 'M', - ItemList.Hatch_Dynamo_LV, - 'T', - CI.getTieredCircuit(1), - 'C', - OrePrefixes.cableGt04.get((Object) Materials.Tin) - }); + GregtechItemList.Hatch_Buffer_Dynamo_LV.get(1L, new Object[0]), + bitsd, + new Object[] { "TMC", 'M', ItemList.Hatch_Dynamo_LV, 'T', CI.getTieredCircuit(1), 'C', + OrePrefixes.cableGt04.get((Object) Materials.Tin) }); GT_ModHandler.addCraftingRecipe( - GregtechItemList.Hatch_Buffer_Dynamo_MV.get(1L, new Object[0]), bitsd, new Object[] { - "TMC", - 'M', - ItemList.Hatch_Dynamo_MV, - 'T', - CI.getTieredCircuit(2), - 'C', - OrePrefixes.cableGt04.get((Object) Materials.AnyCopper) - }); + GregtechItemList.Hatch_Buffer_Dynamo_MV.get(1L, new Object[0]), + bitsd, + new Object[] { "TMC", 'M', ItemList.Hatch_Dynamo_MV, 'T', CI.getTieredCircuit(2), 'C', + OrePrefixes.cableGt04.get((Object) Materials.AnyCopper) }); GT_ModHandler.addCraftingRecipe( - GregtechItemList.Hatch_Buffer_Dynamo_HV.get(1L, new Object[0]), bitsd, new Object[] { - "TMC", - 'M', - ItemList.Hatch_Dynamo_HV, - 'T', - CI.getTieredCircuit(3), - 'C', - OrePrefixes.cableGt04.get((Object) Materials.Gold) - }); + GregtechItemList.Hatch_Buffer_Dynamo_HV.get(1L, new Object[0]), + bitsd, + new Object[] { "TMC", 'M', ItemList.Hatch_Dynamo_HV, 'T', CI.getTieredCircuit(3), 'C', + OrePrefixes.cableGt04.get((Object) Materials.Gold) }); GT_ModHandler.addCraftingRecipe( - GregtechItemList.Hatch_Buffer_Dynamo_EV.get(1L, new Object[0]), bitsd, new Object[] { - "TMC", - 'M', - ItemList.Hatch_Dynamo_EV, - 'T', - CI.getTieredCircuit(4), - 'C', - OrePrefixes.cableGt04.get((Object) Materials.Aluminium) - }); + GregtechItemList.Hatch_Buffer_Dynamo_EV.get(1L, new Object[0]), + bitsd, + new Object[] { "TMC", 'M', ItemList.Hatch_Dynamo_EV, 'T', CI.getTieredCircuit(4), 'C', + OrePrefixes.cableGt04.get((Object) Materials.Aluminium) }); GT_ModHandler.addCraftingRecipe( - GregtechItemList.Hatch_Buffer_Dynamo_IV.get(1L, new Object[0]), bitsd, new Object[] { - "TMC", - 'M', - ItemList.Hatch_Dynamo_IV, - 'T', - CI.getTieredCircuit(5), - 'C', - OrePrefixes.cableGt04.get((Object) Materials.Tungsten) - }); + GregtechItemList.Hatch_Buffer_Dynamo_IV.get(1L, new Object[0]), + bitsd, + new Object[] { "TMC", 'M', ItemList.Hatch_Dynamo_IV, 'T', CI.getTieredCircuit(5), 'C', + OrePrefixes.cableGt04.get((Object) Materials.Tungsten) }); GT_ModHandler.addCraftingRecipe( - GregtechItemList.Hatch_Buffer_Dynamo_LuV.get(1L, new Object[0]), bitsd, new Object[] { - "TMC", - 'M', - ItemList.Hatch_Dynamo_LuV, - 'T', - CI.getTieredCircuit(6), - 'C', - OrePrefixes.cableGt04.get((Object) Materials.VanadiumGallium) - }); + GregtechItemList.Hatch_Buffer_Dynamo_LuV.get(1L, new Object[0]), + bitsd, + new Object[] { "TMC", 'M', ItemList.Hatch_Dynamo_LuV, 'T', CI.getTieredCircuit(6), 'C', + OrePrefixes.cableGt04.get((Object) Materials.VanadiumGallium) }); GT_ModHandler.addCraftingRecipe( - GregtechItemList.Hatch_Buffer_Dynamo_ZPM.get(1L, new Object[0]), bitsd, new Object[] { - "TMC", - 'M', - ItemList.Hatch_Dynamo_ZPM, - 'T', - CI.getTieredCircuit(7), - 'C', - OrePrefixes.cableGt04.get((Object) Materials.Naquadah) - }); + GregtechItemList.Hatch_Buffer_Dynamo_ZPM.get(1L, new Object[0]), + bitsd, + new Object[] { "TMC", 'M', ItemList.Hatch_Dynamo_ZPM, 'T', CI.getTieredCircuit(7), 'C', + OrePrefixes.cableGt04.get((Object) Materials.Naquadah) }); GT_ModHandler.addCraftingRecipe( - GregtechItemList.Hatch_Buffer_Dynamo_UV.get(1L, new Object[0]), bitsd, new Object[] { - "TMC", - 'M', - ItemList.Hatch_Dynamo_UV, - 'T', - CI.getTieredCircuit(8), - 'C', - OrePrefixes.wireGt12.get((Object) Materials.NaquadahAlloy) - }); + GregtechItemList.Hatch_Buffer_Dynamo_UV.get(1L, new Object[0]), + bitsd, + new Object[] { "TMC", 'M', ItemList.Hatch_Dynamo_UV, 'T', CI.getTieredCircuit(8), 'C', + OrePrefixes.wireGt12.get((Object) Materials.NaquadahAlloy) }); GT_ModHandler.addCraftingRecipe( - GregtechItemList.Hatch_Buffer_Dynamo_MAX.get(1L, new Object[0]), bitsd, new Object[] { - "TMC", - 'M', - ItemList.Hatch_Dynamo_MAX, - 'T', - CI.getTieredCircuit(9), - 'C', - OrePrefixes.wireGt04.get((Object) Materials.Superconductor) - }); + GregtechItemList.Hatch_Buffer_Dynamo_MAX.get(1L, new Object[0]), + bitsd, + new Object[] { "TMC", 'M', ItemList.Hatch_Dynamo_MAX, 'T', CI.getTieredCircuit(9), 'C', + OrePrefixes.wireGt04.get((Object) Materials.Superconductor) }); } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechComponentAssembler.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechComponentAssembler.java index 55a86a80d4..d2d42504db 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechComponentAssembler.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechComponentAssembler.java @@ -2,6 +2,12 @@ package gtPlusPlus.xmod.gregtech.registration.gregtech; import static gtPlusPlus.core.lib.CORE.ConfigSwitches.enableMachine_ComponentAssemblers; +import java.util.ArrayList; + +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraftforge.oredict.OreDictionary; + import gregtech.api.enums.*; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine_GT_Recipe; import gregtech.api.util.GTPP_Recipe; @@ -10,10 +16,6 @@ import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.recipe.common.CI; import gtPlusPlus.core.util.minecraft.ItemUtils; import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; -import java.util.ArrayList; -import net.minecraft.init.Items; -import net.minecraft.item.ItemStack; -import net.minecraftforge.oredict.OreDictionary; public class GregtechComponentAssembler { @@ -29,7 +31,8 @@ public class GregtechComponentAssembler { return; } - GregtechItemList.Machine_LV_Component_Maker.set(new GT_MetaTileEntity_BasicMachine_GT_Recipe( + GregtechItemList.Machine_LV_Component_Maker.set( + new GT_MetaTileEntity_BasicMachine_GT_Recipe( 985, "basicmachine.componentmaker.tier.01", "Basic Component Maker", @@ -47,23 +50,13 @@ public class GregtechComponentAssembler { false, 0, "ASSEMBLER", - new Object[] { - "ACA", - "VMV", - "WCW", - 'M', - GT_MetaTileEntity_BasicMachine_GT_Recipe.X.HULL, - 'V', - GT_MetaTileEntity_BasicMachine_GT_Recipe.X.ROBOT_ARM, - 'A', - GT_MetaTileEntity_BasicMachine_GT_Recipe.X.PISTON, - 'C', - GT_MetaTileEntity_BasicMachine_GT_Recipe.X.CIRCUIT, - 'W', - GT_MetaTileEntity_BasicMachine_GT_Recipe.X.WIRE4 - }) - .getStackForm(1L)); - GregtechItemList.Machine_MV_Component_Maker.set(new GT_MetaTileEntity_BasicMachine_GT_Recipe( + new Object[] { "ACA", "VMV", "WCW", 'M', GT_MetaTileEntity_BasicMachine_GT_Recipe.X.HULL, 'V', + GT_MetaTileEntity_BasicMachine_GT_Recipe.X.ROBOT_ARM, 'A', + GT_MetaTileEntity_BasicMachine_GT_Recipe.X.PISTON, 'C', + GT_MetaTileEntity_BasicMachine_GT_Recipe.X.CIRCUIT, 'W', + GT_MetaTileEntity_BasicMachine_GT_Recipe.X.WIRE4 }).getStackForm(1L)); + GregtechItemList.Machine_MV_Component_Maker.set( + new GT_MetaTileEntity_BasicMachine_GT_Recipe( 986, "basicmachine.componentmaker.tier.02", "Advanced Component Maker", @@ -81,23 +74,13 @@ public class GregtechComponentAssembler { false, 0, "ASSEMBLER", - new Object[] { - "ACA", - "VMV", - "WCW", - 'M', - GT_MetaTileEntity_BasicMachine_GT_Recipe.X.HULL, - 'V', - GT_MetaTileEntity_BasicMachine_GT_Recipe.X.ROBOT_ARM, - 'A', - GT_MetaTileEntity_BasicMachine_GT_Recipe.X.PISTON, - 'C', - GT_MetaTileEntity_BasicMachine_GT_Recipe.X.CIRCUIT, - 'W', - GT_MetaTileEntity_BasicMachine_GT_Recipe.X.WIRE4 - }) - .getStackForm(1L)); - GregtechItemList.Machine_HV_Component_Maker.set(new GT_MetaTileEntity_BasicMachine_GT_Recipe( + new Object[] { "ACA", "VMV", "WCW", 'M', GT_MetaTileEntity_BasicMachine_GT_Recipe.X.HULL, 'V', + GT_MetaTileEntity_BasicMachine_GT_Recipe.X.ROBOT_ARM, 'A', + GT_MetaTileEntity_BasicMachine_GT_Recipe.X.PISTON, 'C', + GT_MetaTileEntity_BasicMachine_GT_Recipe.X.CIRCUIT, 'W', + GT_MetaTileEntity_BasicMachine_GT_Recipe.X.WIRE4 }).getStackForm(1L)); + GregtechItemList.Machine_HV_Component_Maker.set( + new GT_MetaTileEntity_BasicMachine_GT_Recipe( 987, "basicmachine.componentmaker.tier.03", "Advanced Component Maker II", @@ -115,23 +98,13 @@ public class GregtechComponentAssembler { false, 0, "ASSEMBLER", - new Object[] { - "ACA", - "VMV", - "WCW", - 'M', - GT_MetaTileEntity_BasicMachine_GT_Recipe.X.HULL, - 'V', - GT_MetaTileEntity_BasicMachine_GT_Recipe.X.ROBOT_ARM, - 'A', - GT_MetaTileEntity_BasicMachine_GT_Recipe.X.PISTON, - 'C', - GT_MetaTileEntity_BasicMachine_GT_Recipe.X.CIRCUIT, - 'W', - GT_MetaTileEntity_BasicMachine_GT_Recipe.X.WIRE4 - }) - .getStackForm(1L)); - GregtechItemList.Machine_EV_Component_Maker.set(new GT_MetaTileEntity_BasicMachine_GT_Recipe( + new Object[] { "ACA", "VMV", "WCW", 'M', GT_MetaTileEntity_BasicMachine_GT_Recipe.X.HULL, 'V', + GT_MetaTileEntity_BasicMachine_GT_Recipe.X.ROBOT_ARM, 'A', + GT_MetaTileEntity_BasicMachine_GT_Recipe.X.PISTON, 'C', + GT_MetaTileEntity_BasicMachine_GT_Recipe.X.CIRCUIT, 'W', + GT_MetaTileEntity_BasicMachine_GT_Recipe.X.WIRE4 }).getStackForm(1L)); + GregtechItemList.Machine_EV_Component_Maker.set( + new GT_MetaTileEntity_BasicMachine_GT_Recipe( 988, "basicmachine.componentmaker.tier.04", "Advanced Component Maker III", @@ -149,23 +122,13 @@ public class GregtechComponentAssembler { false, 0, "ASSEMBLER", - new Object[] { - "ACA", - "VMV", - "WCW", - 'M', - GT_MetaTileEntity_BasicMachine_GT_Recipe.X.HULL, - 'V', - GT_MetaTileEntity_BasicMachine_GT_Recipe.X.ROBOT_ARM, - 'A', - GT_MetaTileEntity_BasicMachine_GT_Recipe.X.PISTON, - 'C', - GT_MetaTileEntity_BasicMachine_GT_Recipe.X.CIRCUIT, - 'W', - GT_MetaTileEntity_BasicMachine_GT_Recipe.X.WIRE4 - }) - .getStackForm(1L)); - GregtechItemList.Machine_IV_Component_Maker.set(new GT_MetaTileEntity_BasicMachine_GT_Recipe( + new Object[] { "ACA", "VMV", "WCW", 'M', GT_MetaTileEntity_BasicMachine_GT_Recipe.X.HULL, 'V', + GT_MetaTileEntity_BasicMachine_GT_Recipe.X.ROBOT_ARM, 'A', + GT_MetaTileEntity_BasicMachine_GT_Recipe.X.PISTON, 'C', + GT_MetaTileEntity_BasicMachine_GT_Recipe.X.CIRCUIT, 'W', + GT_MetaTileEntity_BasicMachine_GT_Recipe.X.WIRE4 }).getStackForm(1L)); + GregtechItemList.Machine_IV_Component_Maker.set( + new GT_MetaTileEntity_BasicMachine_GT_Recipe( 989, "basicmachine.componentmaker.tier.05", "Advanced Component Maker IV", @@ -183,23 +146,13 @@ public class GregtechComponentAssembler { false, 0, "ASSEMBLER", - new Object[] { - "ACA", - "VMV", - "WCW", - 'M', - GT_MetaTileEntity_BasicMachine_GT_Recipe.X.HULL, - 'V', - GT_MetaTileEntity_BasicMachine_GT_Recipe.X.ROBOT_ARM, - 'A', - GT_MetaTileEntity_BasicMachine_GT_Recipe.X.PISTON, - 'C', - GT_MetaTileEntity_BasicMachine_GT_Recipe.X.CIRCUIT, - 'W', - GT_MetaTileEntity_BasicMachine_GT_Recipe.X.WIRE4 - }) - .getStackForm(1L)); - GregtechItemList.Machine_LuV_Component_Maker.set(new GT_MetaTileEntity_BasicMachine_GT_Recipe( + new Object[] { "ACA", "VMV", "WCW", 'M', GT_MetaTileEntity_BasicMachine_GT_Recipe.X.HULL, 'V', + GT_MetaTileEntity_BasicMachine_GT_Recipe.X.ROBOT_ARM, 'A', + GT_MetaTileEntity_BasicMachine_GT_Recipe.X.PISTON, 'C', + GT_MetaTileEntity_BasicMachine_GT_Recipe.X.CIRCUIT, 'W', + GT_MetaTileEntity_BasicMachine_GT_Recipe.X.WIRE4 }).getStackForm(1L)); + GregtechItemList.Machine_LuV_Component_Maker.set( + new GT_MetaTileEntity_BasicMachine_GT_Recipe( 31012, "basicmachine.componentmaker.tier.06", "Advanced Component Maker V", @@ -217,23 +170,13 @@ public class GregtechComponentAssembler { false, 0, "ASSEMBLER", - new Object[] { - "ACA", - "VMV", - "WCW", - 'M', - GT_MetaTileEntity_BasicMachine_GT_Recipe.X.HULL, - 'V', - GT_MetaTileEntity_BasicMachine_GT_Recipe.X.ROBOT_ARM, - 'A', - GT_MetaTileEntity_BasicMachine_GT_Recipe.X.PISTON, - 'C', - GT_MetaTileEntity_BasicMachine_GT_Recipe.X.CIRCUIT, - 'W', - GT_MetaTileEntity_BasicMachine_GT_Recipe.X.WIRE4 - }) - .getStackForm(1L)); - GregtechItemList.Machine_ZPM_Component_Maker.set(new GT_MetaTileEntity_BasicMachine_GT_Recipe( + new Object[] { "ACA", "VMV", "WCW", 'M', GT_MetaTileEntity_BasicMachine_GT_Recipe.X.HULL, 'V', + GT_MetaTileEntity_BasicMachine_GT_Recipe.X.ROBOT_ARM, 'A', + GT_MetaTileEntity_BasicMachine_GT_Recipe.X.PISTON, 'C', + GT_MetaTileEntity_BasicMachine_GT_Recipe.X.CIRCUIT, 'W', + GT_MetaTileEntity_BasicMachine_GT_Recipe.X.WIRE4 }).getStackForm(1L)); + GregtechItemList.Machine_ZPM_Component_Maker.set( + new GT_MetaTileEntity_BasicMachine_GT_Recipe( 31013, "basicmachine.componentmaker.tier.07", "Advanced Component Maker VI", @@ -251,23 +194,13 @@ public class GregtechComponentAssembler { false, 0, "ASSEMBLER", - new Object[] { - "ACA", - "VMV", - "WCW", - 'M', - GT_MetaTileEntity_BasicMachine_GT_Recipe.X.HULL, - 'V', - GT_MetaTileEntity_BasicMachine_GT_Recipe.X.ROBOT_ARM, - 'A', - GT_MetaTileEntity_BasicMachine_GT_Recipe.X.PISTON, - 'C', - GT_MetaTileEntity_BasicMachine_GT_Recipe.X.CIRCUIT, - 'W', - GT_MetaTileEntity_BasicMachine_GT_Recipe.X.WIRE4 - }) - .getStackForm(1L)); - GregtechItemList.Machine_UV_Component_Maker.set(new GT_MetaTileEntity_BasicMachine_GT_Recipe( + new Object[] { "ACA", "VMV", "WCW", 'M', GT_MetaTileEntity_BasicMachine_GT_Recipe.X.HULL, 'V', + GT_MetaTileEntity_BasicMachine_GT_Recipe.X.ROBOT_ARM, 'A', + GT_MetaTileEntity_BasicMachine_GT_Recipe.X.PISTON, 'C', + GT_MetaTileEntity_BasicMachine_GT_Recipe.X.CIRCUIT, 'W', + GT_MetaTileEntity_BasicMachine_GT_Recipe.X.WIRE4 }).getStackForm(1L)); + GregtechItemList.Machine_UV_Component_Maker.set( + new GT_MetaTileEntity_BasicMachine_GT_Recipe( 31014, "basicmachine.componentmaker.tier.08", "Advanced Component Maker VII", @@ -285,22 +218,11 @@ public class GregtechComponentAssembler { false, 0, "ASSEMBLER", - new Object[] { - "ACA", - "VMV", - "WCW", - 'M', - GT_MetaTileEntity_BasicMachine_GT_Recipe.X.HULL, - 'V', - GT_MetaTileEntity_BasicMachine_GT_Recipe.X.ROBOT_ARM, - 'A', - GT_MetaTileEntity_BasicMachine_GT_Recipe.X.PISTON, - 'C', - GT_MetaTileEntity_BasicMachine_GT_Recipe.X.CIRCUIT, - 'W', - GT_MetaTileEntity_BasicMachine_GT_Recipe.X.WIRE4 - }) - .getStackForm(1L)); + new Object[] { "ACA", "VMV", "WCW", 'M', GT_MetaTileEntity_BasicMachine_GT_Recipe.X.HULL, 'V', + GT_MetaTileEntity_BasicMachine_GT_Recipe.X.ROBOT_ARM, 'A', + GT_MetaTileEntity_BasicMachine_GT_Recipe.X.PISTON, 'C', + GT_MetaTileEntity_BasicMachine_GT_Recipe.X.CIRCUIT, 'W', + GT_MetaTileEntity_BasicMachine_GT_Recipe.X.WIRE4 }).getStackForm(1L)); // Motors // addRecipeMotor(0, Materials.Lead, 1, Materials.RedAlloy, 1, @@ -310,7 +232,13 @@ public class GregtechComponentAssembler { addRecipeMotor(3, Materials.Copper, 4, Materials.Gold, 1, Materials.StainlessSteel, Materials.SteelMagnetic); addRecipeMotor(4, Materials.Copper, 8, Materials.Aluminium, 1, Materials.Titanium, Materials.NeodymiumMagnetic); addRecipeMotor( - 5, Materials.Copper, 16, Materials.Tungsten, 1, Materials.TungstenSteel, Materials.NeodymiumMagnetic); + 5, + Materials.Copper, + 16, + Materials.Tungsten, + 1, + Materials.TungstenSteel, + Materials.NeodymiumMagnetic); // Pistons // addRecipePiston(0, Materials.Lead, Materials.Lead); @@ -370,14 +298,8 @@ public class GregtechComponentAssembler { addRecipeSensor(5, Materials.TungstenSteel, Materials.Osmium, Materials.EnderEye); } - private static boolean addRecipeMotor( - int tier, - Materials wire, - int wirethickness, - Materials cable, - int cablethickness, - Materials stick, - Materials magstick) { + private static boolean addRecipeMotor(int tier, Materials wire, int wirethickness, Materials cable, + int cablethickness, Materials stick, Materials magstick) { try { String mWT = "" + wirethickness; String mCT = "" + cablethickness; @@ -397,7 +319,7 @@ public class GregtechComponentAssembler { ItemStack rodStack = ItemUtils.getGregtechOreStack(OrePrefixes.stick, stick, 2); ItemStack magrodStack = ItemUtils.getGregtechOreStack(OrePrefixes.stick, magstick, 1); - ItemStack Input[] = {wireStack, cableStack, rodStack, magrodStack}; + ItemStack Input[] = { wireStack, cableStack, rodStack, magrodStack }; return CORE.RA.addComponentMakerRecipe( Input, @@ -420,7 +342,7 @@ public class GregtechComponentAssembler { ItemStack gearStack = ItemUtils.getGregtechOreStack(OrePrefixes.gearGtSmall, mat, 1); ItemStack motorStack = CI.getElectricMotor(tier, 1); - ItemStack Input[] = {plateStack, cableStack, rodStack, gearStack, motorStack}; + ItemStack Input[] = { plateStack, cableStack, rodStack, gearStack, motorStack }; return CORE.RA.addComponentMakerRecipe( Input, @@ -446,7 +368,7 @@ public class GregtechComponentAssembler { for (ItemStack mRubberType : oreDictList) { final ItemStack returnValue = mRubberType.copy(); returnValue.stackSize = 6; - ItemStack Input[] = {cableStack, motorStack, returnValue}; + ItemStack Input[] = { cableStack, motorStack, returnValue }; mAdd[mcount++] = CORE.RA.addComponentMakerRecipe( Input, GT_Values.NF, @@ -466,11 +388,14 @@ public class GregtechComponentAssembler { return false; } } else { - ItemStack Input[] = { - cableStack, motorStack, ItemUtils.getItemStackOfAmountFromOreDictNoBroken("plateRubber", 6) - }; + ItemStack Input[] = { cableStack, motorStack, + ItemUtils.getItemStackOfAmountFromOreDictNoBroken("plateRubber", 6) }; return CORE.RA.addComponentMakerRecipe( - Input, GT_Values.NF, CI.getConveyor(tier, 1), (tier * 40), ((int) GT_Values.V[tier] / 16) * 15); + Input, + GT_Values.NF, + CI.getConveyor(tier, 1), + (tier * 40), + ((int) GT_Values.V[tier] / 16) * 15); } } catch (Throwable t) { @@ -493,7 +418,7 @@ public class GregtechComponentAssembler { for (ItemStack mRubberType : oreDictList) { final ItemStack returnValue = mRubberType.copy(); returnValue.stackSize = 2; - ItemStack Input[] = {cableStack, screwStack, rotorStack, pipeStack, motorStack, returnValue}; + ItemStack Input[] = { cableStack, screwStack, rotorStack, pipeStack, motorStack, returnValue }; mAdd[mcount++] = CORE.RA.addComponentMakerRecipe( Input, GT_Values.NF, @@ -513,14 +438,8 @@ public class GregtechComponentAssembler { return false; } } else { - ItemStack Input[] = { - cableStack, - screwStack, - rotorStack, - pipeStack, - motorStack, - ItemUtils.getItemStackOfAmountFromOreDictNoBroken("ringRubber", 2) - }; + ItemStack Input[] = { cableStack, screwStack, rotorStack, pipeStack, motorStack, + ItemUtils.getItemStackOfAmountFromOreDictNoBroken("ringRubber", 2) }; return CORE.RA.addComponentMakerRecipe( Input, GT_Values.NF, @@ -549,7 +468,7 @@ public class GregtechComponentAssembler { for (ItemStack mCircuitType : oreDictList) { final ItemStack returnValue = mCircuitType.copy(); returnValue.stackSize = 1; - ItemStack Input[] = {returnValue, cableStack, rodStack, pistonStack, motorStack}; + ItemStack Input[] = { returnValue, cableStack, rodStack, pistonStack, motorStack }; mAdd[mcount++] = CORE.RA.addComponentMakerRecipe( Input, GT_Values.NF, @@ -569,14 +488,14 @@ public class GregtechComponentAssembler { } } else { ItemStack Input[] = { - ItemUtils.getItemStackOfAmountFromOreDict(CI.getTieredCircuitOreDictName(tier), 1), - cableStack, - rodStack, - pistonStack, - motorStack - }; + ItemUtils.getItemStackOfAmountFromOreDict(CI.getTieredCircuitOreDictName(tier), 1), cableStack, + rodStack, pistonStack, motorStack }; return CORE.RA.addComponentMakerRecipe( - Input, GT_Values.NF, CI.getRobotArm(tier, 1), (tier * 40), ((int) GT_Values.V[tier] / 16) * 15); + Input, + GT_Values.NF, + CI.getRobotArm(tier, 1), + (tier * 40), + ((int) GT_Values.V[tier] / 16) * 15); } } catch (Throwable t) { @@ -595,10 +514,10 @@ public class GregtechComponentAssembler { else if (tier == 5) mWT = "16"; else mWT = "01"; - ItemStack eyeQuantum = - ItemUtils.getValueOfItemList("QuantumEye", 1, ItemUtils.getSimpleStack(Items.ender_eye, 4)); - ItemStack starQuantum = - ItemUtils.getValueOfItemList("QuantumStar", 1, ItemUtils.getSimpleStack(Items.nether_star, 4)); + ItemStack eyeQuantum = ItemUtils + .getValueOfItemList("QuantumEye", 1, ItemUtils.getSimpleStack(Items.ender_eye, 4)); + ItemStack starQuantum = ItemUtils + .getValueOfItemList("QuantumStar", 1, ItemUtils.getSimpleStack(Items.nether_star, 4)); if (tier == 1) gem = ItemUtils.getSimpleStack(Items.ender_pearl); else if (tier == 2) gem = ItemUtils.getSimpleStack(Items.ender_eye); @@ -618,7 +537,7 @@ public class GregtechComponentAssembler { for (ItemStack mCircuitType : oreDictList) { final ItemStack returnValue = mCircuitType.copy(); returnValue.stackSize = 4; - ItemStack Input[] = {returnValue, wireStack, gem}; + ItemStack Input[] = { returnValue, wireStack, gem }; mAdd[mcount++] = CORE.RA.addComponentMakerRecipe( Input, GT_Values.NF, @@ -638,8 +557,8 @@ public class GregtechComponentAssembler { } } else { ItemStack Input[] = { - ItemUtils.getItemStackOfAmountFromOreDict(CI.getTieredCircuitOreDictName(tier), 4), wireStack, gem - }; + ItemUtils.getItemStackOfAmountFromOreDict(CI.getTieredCircuitOreDictName(tier), 4), wireStack, + gem }; return CORE.RA.addComponentMakerRecipe( Input, GT_Values.NF, @@ -667,7 +586,7 @@ public class GregtechComponentAssembler { for (ItemStack mCircuitType : oreDictList) { final ItemStack returnValue = mCircuitType.copy(); returnValue.stackSize = 2; - ItemStack Input[] = {returnValue, cableStack, gemstack, magrodStack}; + ItemStack Input[] = { returnValue, cableStack, gemstack, magrodStack }; mAdd[mcount++] = CORE.RA.addComponentMakerRecipe( Input, GT_Values.NF, @@ -687,13 +606,14 @@ public class GregtechComponentAssembler { } } else { ItemStack Input[] = { - ItemUtils.getItemStackOfAmountFromOreDict(CI.getTieredCircuitOreDictName(tier), 2), - cableStack, - gemstack, - magrodStack - }; + ItemUtils.getItemStackOfAmountFromOreDict(CI.getTieredCircuitOreDictName(tier), 2), cableStack, + gemstack, magrodStack }; return CORE.RA.addComponentMakerRecipe( - Input, GT_Values.NF, CI.getEmitter(tier, 1), (tier * 40), ((int) GT_Values.V[tier] / 16) * 15); + Input, + GT_Values.NF, + CI.getEmitter(tier, 1), + (tier * 40), + ((int) GT_Values.V[tier] / 16) * 15); } } catch (Throwable t) { @@ -715,7 +635,7 @@ public class GregtechComponentAssembler { for (ItemStack mCircuitType : oreDictList) { final ItemStack returnValue = mCircuitType.copy(); returnValue.stackSize = 1; - ItemStack Input[] = {gemStack, cableStack, returnValue, magrodStack}; + ItemStack Input[] = { gemStack, cableStack, returnValue, magrodStack }; mAdd[mcount++] = CORE.RA.addComponentMakerRecipe( Input, GT_Values.NF, @@ -734,14 +654,14 @@ public class GregtechComponentAssembler { return false; } } else { - ItemStack Input[] = { - gemStack, - cableStack, - magrodStack, - ItemUtils.getItemStackOfAmountFromOreDict(CI.getTieredCircuitOreDictName(tier), 1) - }; + ItemStack Input[] = { gemStack, cableStack, magrodStack, + ItemUtils.getItemStackOfAmountFromOreDict(CI.getTieredCircuitOreDictName(tier), 1) }; return CORE.RA.addComponentMakerRecipe( - Input, GT_Values.NF, CI.getSensor(tier, 1), (tier * 40), ((int) GT_Values.V[tier] / 16) * 15); + Input, + GT_Values.NF, + CI.getSensor(tier, 1), + (tier * 40), + ((int) GT_Values.V[tier] / 16) * 15); } } catch (Throwable t) { diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechConduits.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechConduits.java index c48885df21..aadf6f4a12 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechConduits.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechConduits.java @@ -3,6 +3,13 @@ package gtPlusPlus.xmod.gregtech.registration.gregtech; import static gtPlusPlus.core.lib.CORE.GTNH; import static gtPlusPlus.core.lib.LoadedMods.Gregtech; +import java.lang.reflect.Constructor; +import java.lang.reflect.InvocationTargetException; +import java.util.ArrayList; + +import net.minecraft.item.ItemStack; +import net.minecraftforge.oredict.OreDictionary; + import gregtech.api.enums.GT_Values; import gregtech.api.enums.ItemList; import gregtech.api.enums.Materials; @@ -25,17 +32,15 @@ import gtPlusPlus.core.util.minecraft.RecipeUtils; import gtPlusPlus.xmod.gregtech.api.enums.GregtechOrePrefixes.GT_Materials; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GregtechMetaPipeEntityFluid; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GregtechMetaPipeEntity_Cable; -import java.lang.reflect.Constructor; -import java.lang.reflect.InvocationTargetException; -import java.util.ArrayList; -import net.minecraft.item.ItemStack; -import net.minecraftforge.oredict.OreDictionary; public class GregtechConduits { + /** * - * The Voltage Tiers. Use this Array instead of the old named Voltage Variables - * public static final long[] V = new long[] {0=8, 1=32, 2=128, 3=512, 4=2048, 5=8192, 6=32768, 7=131072, 8=524288, 9=Integer.MAX_VALUE, Integer.MAX_VALUE, Integer.MAX_VALUE, Integer.MAX_VALUE, Integer.MAX_VALUE, Integer.MAX_VALUE, Integer.MAX_VALUE}; + * The Voltage Tiers. Use this Array instead of the old named Voltage Variables public static final long[] V = new + * long[] {0=8, 1=32, 2=128, 3=512, 4=2048, 5=8192, 6=32768, 7=131072, 8=524288, 9=Integer.MAX_VALUE, + * Integer.MAX_VALUE, Integer.MAX_VALUE, Integer.MAX_VALUE, Integer.MAX_VALUE, Integer.MAX_VALUE, + * Integer.MAX_VALUE}; * */ public static OrePrefixes cableGt16; @@ -43,8 +48,7 @@ public class GregtechConduits { static { if (GTNH) { try { - cableGt16 = (OrePrefixes) - GT_Utility.getField(OrePrefixes.class, "cableGt16").get(null); + cableGt16 = (OrePrefixes) GT_Utility.getField(OrePrefixes.class, "cableGt16").get(null); } catch (IllegalAccessException | NullPointerException e) { e.printStackTrace(); } @@ -174,24 +178,17 @@ public class GregtechConduits { } // Generate Heat Pipes - // GregtechItemList.HeatPipe_Tier_1.set(new GT_MetaPipeEntity_Heat(31021, "gtpp.pipe.heat.basic.01", "Lead Heat + // GregtechItemList.HeatPipe_Tier_1.set(new GT_MetaPipeEntity_Heat(31021, "gtpp.pipe.heat.basic.01", "Lead Heat // Pipe (500C)", Materials.Lead, 500).getStackForm(1L)); - // GregtechItemList.HeatPipe_Tier_2.set(new GT_MetaPipeEntity_Heat(31022, "gtpp.pipe.heat.basic.02", "Iron Heat + // GregtechItemList.HeatPipe_Tier_2.set(new GT_MetaPipeEntity_Heat(31022, "gtpp.pipe.heat.basic.02", "Iron Heat // Pipe (500C)", Materials.Iron, 500).getStackForm(1L)); - // GregtechItemList.HeatPipe_Tier_3.set(new GT_MetaPipeEntity_Heat(31023, "gtpp.pipe.heat.basic.03", "Silver + // GregtechItemList.HeatPipe_Tier_3.set(new GT_MetaPipeEntity_Heat(31023, "gtpp.pipe.heat.basic.03", "Silver // Heat Pipe (1500C)", Materials.Silver, 1500).getStackForm(1L)); } - private static void generateFluidMultiPipes( - Constructor<GT_MetaPipeEntity_Fluid> aClazz, - Materials aMaterial, - String name, - String displayName, - int startID, - int transferRatePerSec, - int heatCapacity, - boolean gasProof) { + private static void generateFluidMultiPipes(Constructor<GT_MetaPipeEntity_Fluid> aClazz, Materials aMaterial, + String name, String displayName, int startID, int transferRatePerSec, int heatCapacity, boolean gasProof) { GT_MetaPipeEntity_Fluid aPipe; final int transferRatePerTick = transferRatePerSec / 20; try { @@ -211,9 +208,7 @@ public class GregtechConduits { Logger.INFO("Generated " + aMaterial + " Hexadecuple pipes."); GT_OreDictUnificator.registerOre("pipeHexadecuple" + aMaterial, aPipe.getStackForm(1L)); } - } catch (InstantiationException - | IllegalAccessException - | IllegalArgumentException + } catch (InstantiationException | IllegalAccessException | IllegalArgumentException | InvocationTargetException e) { Logger.INFO("Failed to Generate " + aMaterial + " Hexadecuple pipes. [Ecx]"); e.printStackTrace(); @@ -223,13 +218,13 @@ public class GregtechConduits { private static void run1() { if (LoadedMods.Big_Reactors) { - wireFactory("Blutonium", 8196, BaseWireID, 8, 32, 2, new short[] {28, 28, 218, 0}); - wireFactory("Cyanite", 512, BaseWireID + 15, 2, 16, 4, new short[] {27, 130, 178, 0}); - wireFactory("Yellorium", 2048, BaseWireID + 30, 4, 16, 2, new short[] {150, 195, 54, 0}); + wireFactory("Blutonium", 8196, BaseWireID, 8, 32, 2, new short[] { 28, 28, 218, 0 }); + wireFactory("Cyanite", 512, BaseWireID + 15, 2, 16, 4, new short[] { 27, 130, 178, 0 }); + wireFactory("Yellorium", 2048, BaseWireID + 30, 4, 16, 2, new short[] { 150, 195, 54, 0 }); } if (LoadedMods.EnderIO) { - wireFactory("RedstoneAlloy", 32, BaseWireID + 45, 0, 2, 1, new short[] {178, 34, 34, 0}); + wireFactory("RedstoneAlloy", 32, BaseWireID + 45, 0, 2, 1, new short[] { 178, 34, 34, 0 }); } if (!GTNH) { @@ -271,17 +266,16 @@ public class GregtechConduits { generateGTFluidPipes(Materials.Lead, BasePipeID + 70, 350, 1200, true); generateNonGTFluidPipes( - GT_Materials.TriniumNaquadahCarbonite, ALLOY.TRINIUM_NAQUADAH_CARBON, 30500, 20, 250000, true); + GT_Materials.TriniumNaquadahCarbonite, + ALLOY.TRINIUM_NAQUADAH_CARBON, + 30500, + 20, + 250000, + true); } - private static void wireFactory( - final String Material, - final int Voltage, - final int ID, - final long insulatedLoss, - final long uninsulatedLoss, - final long Amps, - final short[] rgb) { + private static void wireFactory(final String Material, final int Voltage, final int ID, final long insulatedLoss, + final long uninsulatedLoss, final long Amps, final short[] rgb) { @SuppressWarnings("deprecation") final Materials T = Materials.valueOf(Material); int V = GT_Utility.getTier(Voltage); @@ -294,222 +288,198 @@ public class GregtechConduits { } @SuppressWarnings("deprecation") - private static void makeWires( - final Materials aMaterial, - final int aStartID, - final long aLossInsulated, - final long aLoss, - final long aAmperage, - final long aVoltage, - final boolean aInsulatable, - final boolean aAutoInsulated, - final short[] aRGB) { + private static void makeWires(final Materials aMaterial, final int aStartID, final long aLossInsulated, + final long aLoss, final long aAmperage, final long aVoltage, final boolean aInsulatable, + final boolean aAutoInsulated, final short[] aRGB) { Logger.WARNING("Gregtech5u Content | Registered " + aMaterial.name() + " as a new material for Wire & Cable."); GT_OreDictUnificator.registerOre( OrePrefixes.wireGt01, aMaterial, new GregtechMetaPipeEntity_Cable( - aStartID + 0, - "wire." + aMaterial.name().toLowerCase() + ".01", - "1x " + aMaterial.mDefaultLocalName + " Wire", - 0.125F, - aMaterial, - aLoss, - 1L * aAmperage, - aVoltage, - false, - !aAutoInsulated, - aRGB) - .getStackForm(1L)); + aStartID + 0, + "wire." + aMaterial.name().toLowerCase() + ".01", + "1x " + aMaterial.mDefaultLocalName + " Wire", + 0.125F, + aMaterial, + aLoss, + 1L * aAmperage, + aVoltage, + false, + !aAutoInsulated, + aRGB).getStackForm(1L)); GT_OreDictUnificator.registerOre( OrePrefixes.wireGt02, aMaterial, new GregtechMetaPipeEntity_Cable( - aStartID + 1, - "wire." + aMaterial.name().toLowerCase() + ".02", - "2x " + aMaterial.mDefaultLocalName + " Wire", - 0.25F, - aMaterial, - aLoss, - 2L * aAmperage, - aVoltage, - false, - !aAutoInsulated, - aRGB) - .getStackForm(1L)); + aStartID + 1, + "wire." + aMaterial.name().toLowerCase() + ".02", + "2x " + aMaterial.mDefaultLocalName + " Wire", + 0.25F, + aMaterial, + aLoss, + 2L * aAmperage, + aVoltage, + false, + !aAutoInsulated, + aRGB).getStackForm(1L)); GT_OreDictUnificator.registerOre( OrePrefixes.wireGt04, aMaterial, new GregtechMetaPipeEntity_Cable( - aStartID + 2, - "wire." + aMaterial.name().toLowerCase() + ".04", - "4x " + aMaterial.mDefaultLocalName + " Wire", - 0.375F, - aMaterial, - aLoss, - 4L * aAmperage, - aVoltage, - false, - !aAutoInsulated, - aRGB) - .getStackForm(1L)); + aStartID + 2, + "wire." + aMaterial.name().toLowerCase() + ".04", + "4x " + aMaterial.mDefaultLocalName + " Wire", + 0.375F, + aMaterial, + aLoss, + 4L * aAmperage, + aVoltage, + false, + !aAutoInsulated, + aRGB).getStackForm(1L)); GT_OreDictUnificator.registerOre( OrePrefixes.wireGt08, aMaterial, new GregtechMetaPipeEntity_Cable( - aStartID + 3, - "wire." + aMaterial.name().toLowerCase() + ".08", - "8x " + aMaterial.mDefaultLocalName + " Wire", - 0.50F, - aMaterial, - aLoss, - 8L * aAmperage, - aVoltage, - false, - !aAutoInsulated, - aRGB) - .getStackForm(1L)); + aStartID + 3, + "wire." + aMaterial.name().toLowerCase() + ".08", + "8x " + aMaterial.mDefaultLocalName + " Wire", + 0.50F, + aMaterial, + aLoss, + 8L * aAmperage, + aVoltage, + false, + !aAutoInsulated, + aRGB).getStackForm(1L)); GT_OreDictUnificator.registerOre( OrePrefixes.wireGt12, aMaterial, new GregtechMetaPipeEntity_Cable( - aStartID + 4, - "wire." + aMaterial.name().toLowerCase() + ".12", - "12x " + aMaterial.mDefaultLocalName + " Wire", - GTNH ? 0.625F : 0.75F, - aMaterial, - aLoss, - 12L * aAmperage, - aVoltage, - false, - !aAutoInsulated, - aRGB) - .getStackForm(1L)); + aStartID + 4, + "wire." + aMaterial.name().toLowerCase() + ".12", + "12x " + aMaterial.mDefaultLocalName + " Wire", + GTNH ? 0.625F : 0.75F, + aMaterial, + aLoss, + 12L * aAmperage, + aVoltage, + false, + !aAutoInsulated, + aRGB).getStackForm(1L)); GT_OreDictUnificator.registerOre( OrePrefixes.wireGt16, aMaterial, new GregtechMetaPipeEntity_Cable( - aStartID + 5, - "wire." + aMaterial.name().toLowerCase() + ".16", - "16x " + aMaterial.mDefaultLocalName + " Wire", - GTNH ? 0.75F : 1.0F, - aMaterial, - aLoss, - 16L * aAmperage, - aVoltage, - false, - !aAutoInsulated, - aRGB) - .getStackForm(1L)); + aStartID + 5, + "wire." + aMaterial.name().toLowerCase() + ".16", + "16x " + aMaterial.mDefaultLocalName + " Wire", + GTNH ? 0.75F : 1.0F, + aMaterial, + aLoss, + 16L * aAmperage, + aVoltage, + false, + !aAutoInsulated, + aRGB).getStackForm(1L)); if (aInsulatable) { GT_OreDictUnificator.registerOre( OrePrefixes.cableGt01, aMaterial, new GregtechMetaPipeEntity_Cable( - aStartID + 6, - "cable." + aMaterial.name().toLowerCase() + ".01", - "1x " + aMaterial.mDefaultLocalName + " Cable", - 0.25F, - aMaterial, - aLossInsulated, - 1L * aAmperage, - aVoltage, - true, - false, - aRGB) - .getStackForm(1L)); + aStartID + 6, + "cable." + aMaterial.name().toLowerCase() + ".01", + "1x " + aMaterial.mDefaultLocalName + " Cable", + 0.25F, + aMaterial, + aLossInsulated, + 1L * aAmperage, + aVoltage, + true, + false, + aRGB).getStackForm(1L)); GT_OreDictUnificator.registerOre( OrePrefixes.cableGt02, aMaterial, new GregtechMetaPipeEntity_Cable( - aStartID + 7, - "cable." + aMaterial.name().toLowerCase() + ".02", - "2x " + aMaterial.mDefaultLocalName + " Cable", - 0.375F, - aMaterial, - aLossInsulated, - 2L * aAmperage, - aVoltage, - true, - false, - aRGB) - .getStackForm(1L)); + aStartID + 7, + "cable." + aMaterial.name().toLowerCase() + ".02", + "2x " + aMaterial.mDefaultLocalName + " Cable", + 0.375F, + aMaterial, + aLossInsulated, + 2L * aAmperage, + aVoltage, + true, + false, + aRGB).getStackForm(1L)); GT_OreDictUnificator.registerOre( OrePrefixes.cableGt04, aMaterial, new GregtechMetaPipeEntity_Cable( - aStartID + 8, - "cable." + aMaterial.name().toLowerCase() + ".04", - "4x " + aMaterial.mDefaultLocalName + " Cable", - 0.5F, - aMaterial, - aLossInsulated, - 4L * aAmperage, - aVoltage, - true, - false, - aRGB) - .getStackForm(1L)); + aStartID + 8, + "cable." + aMaterial.name().toLowerCase() + ".04", + "4x " + aMaterial.mDefaultLocalName + " Cable", + 0.5F, + aMaterial, + aLossInsulated, + 4L * aAmperage, + aVoltage, + true, + false, + aRGB).getStackForm(1L)); GT_OreDictUnificator.registerOre( OrePrefixes.cableGt08, aMaterial, new GregtechMetaPipeEntity_Cable( - aStartID + 9, - "cable." + aMaterial.name().toLowerCase() + ".08", - "8x " + aMaterial.mDefaultLocalName + " Cable", - 0.625F, - aMaterial, - aLossInsulated, - 8L * aAmperage, - aVoltage, - true, - false, - aRGB) - .getStackForm(1L)); + aStartID + 9, + "cable." + aMaterial.name().toLowerCase() + ".08", + "8x " + aMaterial.mDefaultLocalName + " Cable", + 0.625F, + aMaterial, + aLossInsulated, + 8L * aAmperage, + aVoltage, + true, + false, + aRGB).getStackForm(1L)); GT_OreDictUnificator.registerOre( OrePrefixes.cableGt12, aMaterial, new GregtechMetaPipeEntity_Cable( - aStartID + 10, - "cable." + aMaterial.name().toLowerCase() + ".12", - "12x " + aMaterial.mDefaultLocalName + " Cable", - GTNH ? 0.75F : 0.875F, - aMaterial, - aLossInsulated, - 12L * aAmperage, - aVoltage, - true, - false, - aRGB) - .getStackForm(1L)); + aStartID + 10, + "cable." + aMaterial.name().toLowerCase() + ".12", + "12x " + aMaterial.mDefaultLocalName + " Cable", + GTNH ? 0.75F : 0.875F, + aMaterial, + aLossInsulated, + 12L * aAmperage, + aVoltage, + true, + false, + aRGB).getStackForm(1L)); if (GTNH) { GT_OreDictUnificator.registerOre( cableGt16, aMaterial, new GregtechMetaPipeEntity_Cable( - aStartID + 11, - "cable." + aMaterial.name().toLowerCase() + ".16", - "16x " + aMaterial.mDefaultLocalName + " Cable", - 0.875f, - aMaterial, - aLossInsulated, - 16L * aAmperage, - aVoltage, - true, - false, - aRGB) - .getStackForm(1L)); + aStartID + 11, + "cable." + aMaterial.name().toLowerCase() + ".16", + "16x " + aMaterial.mDefaultLocalName + " Cable", + 0.875f, + aMaterial, + aLossInsulated, + 16L * aAmperage, + aVoltage, + true, + false, + aRGB).getStackForm(1L)); } } } - private static void customWireFactory( - final Material Material, - final int Voltage, - final int ID, - final long insulatedLoss, - final long uninsulatedLoss, - final long Amps) { + private static void customWireFactory(final Material Material, final int Voltage, final int ID, + final long insulatedLoss, final long uninsulatedLoss, final long Amps) { int V = GT_Utility.getTier(Voltage); if (V == -1) { Logger.ERROR("Failed to set voltage on " + Material + ". Invalid voltage of " + Voltage + "V set."); @@ -519,210 +489,188 @@ public class GregtechConduits { makeCustomWires(Material, ID, insulatedLoss, uninsulatedLoss, Amps, GT_Values.V[V], true, false); } - private static void makeCustomWires( - final Material aMaterial, - final int aStartID, - final long aLossInsulated, - final long aLoss, - final long aAmperage, - final long aVoltage, - final boolean aInsulatable, + private static void makeCustomWires(final Material aMaterial, final int aStartID, final long aLossInsulated, + final long aLoss, final long aAmperage, final long aVoltage, final boolean aInsulatable, final boolean aAutoInsulated) { - Logger.WARNING("Gregtech5u Content | Registered " + aMaterial.getLocalizedName() - + " as a new material for Wire & Cable."); + Logger.WARNING( + "Gregtech5u Content | Registered " + aMaterial.getLocalizedName() + + " as a new material for Wire & Cable."); registerOre( OrePrefixes.wireGt01, aMaterial, new GregtechMetaPipeEntity_Cable( - aStartID + 0, - "wire." + aMaterial.getLocalizedName().toLowerCase() + ".01", - "1x " + aMaterial.getLocalizedName() + " Wire", - 0.125F, - aLoss, - 1L * aAmperage, - aVoltage, - false, - !aAutoInsulated, - aMaterial.getRGBA()) - .getStackForm(1L)); + aStartID + 0, + "wire." + aMaterial.getLocalizedName().toLowerCase() + ".01", + "1x " + aMaterial.getLocalizedName() + " Wire", + 0.125F, + aLoss, + 1L * aAmperage, + aVoltage, + false, + !aAutoInsulated, + aMaterial.getRGBA()).getStackForm(1L)); registerOre( OrePrefixes.wireGt02, aMaterial, new GregtechMetaPipeEntity_Cable( - aStartID + 1, - "wire." + aMaterial.getLocalizedName().toLowerCase() + ".02", - "2x " + aMaterial.getLocalizedName() + " Wire", - 0.25F, - aLoss, - 2L * aAmperage, - aVoltage, - false, - !aAutoInsulated, - aMaterial.getRGBA()) - .getStackForm(1L)); + aStartID + 1, + "wire." + aMaterial.getLocalizedName().toLowerCase() + ".02", + "2x " + aMaterial.getLocalizedName() + " Wire", + 0.25F, + aLoss, + 2L * aAmperage, + aVoltage, + false, + !aAutoInsulated, + aMaterial.getRGBA()).getStackForm(1L)); registerOre( OrePrefixes.wireGt04, aMaterial, new GregtechMetaPipeEntity_Cable( - aStartID + 2, - "wire." + aMaterial.getLocalizedName().toLowerCase() + ".04", - "4x " + aMaterial.getLocalizedName() + " Wire", - 0.375F, - aLoss, - 4L * aAmperage, - aVoltage, - false, - !aAutoInsulated, - aMaterial.getRGBA()) - .getStackForm(1L)); + aStartID + 2, + "wire." + aMaterial.getLocalizedName().toLowerCase() + ".04", + "4x " + aMaterial.getLocalizedName() + " Wire", + 0.375F, + aLoss, + 4L * aAmperage, + aVoltage, + false, + !aAutoInsulated, + aMaterial.getRGBA()).getStackForm(1L)); registerOre( OrePrefixes.wireGt08, aMaterial, new GregtechMetaPipeEntity_Cable( - aStartID + 3, - "wire." + aMaterial.getLocalizedName().toLowerCase() + ".08", - "8x " + aMaterial.getLocalizedName() + " Wire", - 0.50F, - aLoss, - 8L * aAmperage, - aVoltage, - false, - !aAutoInsulated, - aMaterial.getRGBA()) - .getStackForm(1L)); + aStartID + 3, + "wire." + aMaterial.getLocalizedName().toLowerCase() + ".08", + "8x " + aMaterial.getLocalizedName() + " Wire", + 0.50F, + aLoss, + 8L * aAmperage, + aVoltage, + false, + !aAutoInsulated, + aMaterial.getRGBA()).getStackForm(1L)); registerOre( OrePrefixes.wireGt12, aMaterial, new GregtechMetaPipeEntity_Cable( - aStartID + 4, - "wire." + aMaterial.getLocalizedName().toLowerCase() + ".12", - "12x " + aMaterial.getLocalizedName() + " Wire", - GTNH ? 0.625F : 0.75F, - aLoss, - 12L * aAmperage, - aVoltage, - false, - !aAutoInsulated, - aMaterial.getRGBA()) - .getStackForm(1L)); + aStartID + 4, + "wire." + aMaterial.getLocalizedName().toLowerCase() + ".12", + "12x " + aMaterial.getLocalizedName() + " Wire", + GTNH ? 0.625F : 0.75F, + aLoss, + 12L * aAmperage, + aVoltage, + false, + !aAutoInsulated, + aMaterial.getRGBA()).getStackForm(1L)); registerOre( OrePrefixes.wireGt16, aMaterial, new GregtechMetaPipeEntity_Cable( - aStartID + 5, - "wire." + aMaterial.getLocalizedName().toLowerCase() + ".16", - "16x " + aMaterial.getLocalizedName() + " Wire", - GTNH ? 0.75F : 1.0F, - aLoss, - 16L * aAmperage, - aVoltage, - false, - !aAutoInsulated, - aMaterial.getRGBA()) - .getStackForm(1L)); + aStartID + 5, + "wire." + aMaterial.getLocalizedName().toLowerCase() + ".16", + "16x " + aMaterial.getLocalizedName() + " Wire", + GTNH ? 0.75F : 1.0F, + aLoss, + 16L * aAmperage, + aVoltage, + false, + !aAutoInsulated, + aMaterial.getRGBA()).getStackForm(1L)); if (aInsulatable) { registerOre( OrePrefixes.cableGt01, aMaterial, new GregtechMetaPipeEntity_Cable( - aStartID + 6, - "cable." + aMaterial.getLocalizedName().toLowerCase() + ".01", - "1x " + aMaterial.getLocalizedName() + " Cable", - 0.25F, - aLossInsulated, - 1L * aAmperage, - aVoltage, - true, - false, - aMaterial.getRGBA()) - .getStackForm(1L)); + aStartID + 6, + "cable." + aMaterial.getLocalizedName().toLowerCase() + ".01", + "1x " + aMaterial.getLocalizedName() + " Cable", + 0.25F, + aLossInsulated, + 1L * aAmperage, + aVoltage, + true, + false, + aMaterial.getRGBA()).getStackForm(1L)); registerOre( OrePrefixes.cableGt02, aMaterial, new GregtechMetaPipeEntity_Cable( - aStartID + 7, - "cable." + aMaterial.getLocalizedName().toLowerCase() + ".02", - "2x " + aMaterial.getLocalizedName() + " Cable", - 0.375F, - aLossInsulated, - 2L * aAmperage, - aVoltage, - true, - false, - aMaterial.getRGBA()) - .getStackForm(1L)); + aStartID + 7, + "cable." + aMaterial.getLocalizedName().toLowerCase() + ".02", + "2x " + aMaterial.getLocalizedName() + " Cable", + 0.375F, + aLossInsulated, + 2L * aAmperage, + aVoltage, + true, + false, + aMaterial.getRGBA()).getStackForm(1L)); registerOre( OrePrefixes.cableGt04, aMaterial, new GregtechMetaPipeEntity_Cable( - aStartID + 8, - "cable." + aMaterial.getLocalizedName().toLowerCase() + ".04", - "4x " + aMaterial.getLocalizedName() + " Cable", - 0.5F, - aLossInsulated, - 4L * aAmperage, - aVoltage, - true, - false, - aMaterial.getRGBA()) - .getStackForm(1L)); + aStartID + 8, + "cable." + aMaterial.getLocalizedName().toLowerCase() + ".04", + "4x " + aMaterial.getLocalizedName() + " Cable", + 0.5F, + aLossInsulated, + 4L * aAmperage, + aVoltage, + true, + false, + aMaterial.getRGBA()).getStackForm(1L)); registerOre( OrePrefixes.cableGt08, aMaterial, new GregtechMetaPipeEntity_Cable( - aStartID + 9, - "cable." + aMaterial.getLocalizedName().toLowerCase() + ".08", - "8x " + aMaterial.getLocalizedName() + " Cable", - 0.625F, - aLossInsulated, - 8L * aAmperage, - aVoltage, - true, - false, - aMaterial.getRGBA()) - .getStackForm(1L)); + aStartID + 9, + "cable." + aMaterial.getLocalizedName().toLowerCase() + ".08", + "8x " + aMaterial.getLocalizedName() + " Cable", + 0.625F, + aLossInsulated, + 8L * aAmperage, + aVoltage, + true, + false, + aMaterial.getRGBA()).getStackForm(1L)); registerOre( OrePrefixes.cableGt12, aMaterial, new GregtechMetaPipeEntity_Cable( - aStartID + 10, - "cable." + aMaterial.getLocalizedName().toLowerCase() + ".12", - "12x " + aMaterial.getLocalizedName() + " Cable", - GTNH ? 0.75F : 0.875F, - aLossInsulated, - 12L * aAmperage, - aVoltage, - true, - false, - aMaterial.getRGBA()) - .getStackForm(1L)); + aStartID + 10, + "cable." + aMaterial.getLocalizedName().toLowerCase() + ".12", + "12x " + aMaterial.getLocalizedName() + " Cable", + GTNH ? 0.75F : 0.875F, + aLossInsulated, + 12L * aAmperage, + aVoltage, + true, + false, + aMaterial.getRGBA()).getStackForm(1L)); if (GTNH) { registerOre( cableGt16, aMaterial, new GregtechMetaPipeEntity_Cable( - aStartID + 11, - "cable." + aMaterial.getLocalizedName().toLowerCase() + ".16", - "16x " + aMaterial.getLocalizedName() + " Cable", - 0.875f, - aLossInsulated, - 16L * aAmperage, - aVoltage, - true, - false, - aMaterial.getRGBA()) - .getStackForm(1L)); + aStartID + 11, + "cable." + aMaterial.getLocalizedName().toLowerCase() + ".16", + "16x " + aMaterial.getLocalizedName() + " Cable", + 0.875f, + aLossInsulated, + 16L * aAmperage, + aVoltage, + true, + false, + aMaterial.getRGBA()).getStackForm(1L)); } } } - private static void superConductorFactory( - final GT_Materials Material, - final int Voltage, - final int ID, - final long insulatedLoss, - final long uninsulatedLoss, - final long Amps) { + private static void superConductorFactory(final GT_Materials Material, final int Voltage, final int ID, + final long insulatedLoss, final long uninsulatedLoss, final long Amps) { final GT_Materials T = Material; int V = 0; if (Voltage == 8) { @@ -755,85 +703,71 @@ public class GregtechConduits { // makeWires(T, ID, bEC ? 2L : 2L, bEC ? 4L : 4L, 2L, gregtech.api.enums.GT_Values.V[V], true, false); } - private static void generateGTFluidPipes( - final Materials material, - final int startID, - final int transferRatePerSec, - final int heatResistance, - final boolean isGasProof) { + private static void generateGTFluidPipes(final Materials material, final int startID, final int transferRatePerSec, + final int heatResistance, final boolean isGasProof) { final int transferRatePerTick = transferRatePerSec / 20; final long mass = material.getMass(); final long voltage = material.mMeltingPoint >= 2800 ? 64 : 16; GT_OreDictUnificator.registerOre( OrePrefixes.pipeTiny.get(material), new GT_MetaPipeEntity_Fluid( - startID, - "GT_Pipe_" + material.mDefaultLocalName + "_Tiny", - "Tiny " + material.mDefaultLocalName + " Fluid Pipe", - 0.25F, - material, - transferRatePerTick * 2, - heatResistance, - isGasProof) - .getStackForm(1L)); + startID, + "GT_Pipe_" + material.mDefaultLocalName + "_Tiny", + "Tiny " + material.mDefaultLocalName + " Fluid Pipe", + 0.25F, + material, + transferRatePerTick * 2, + heatResistance, + isGasProof).getStackForm(1L)); GT_OreDictUnificator.registerOre( OrePrefixes.pipeSmall.get(material), new GT_MetaPipeEntity_Fluid( - startID + 1, - "GT_Pipe_" + material.mDefaultLocalName + "_Small", - "Small " + material.mDefaultLocalName + " Fluid Pipe", - 0.375F, - material, - transferRatePerTick * 4, - heatResistance, - isGasProof) - .getStackForm(1L)); + startID + 1, + "GT_Pipe_" + material.mDefaultLocalName + "_Small", + "Small " + material.mDefaultLocalName + " Fluid Pipe", + 0.375F, + material, + transferRatePerTick * 4, + heatResistance, + isGasProof).getStackForm(1L)); GT_OreDictUnificator.registerOre( OrePrefixes.pipeMedium.get(material), new GT_MetaPipeEntity_Fluid( - startID + 2, - "GT_Pipe_" + material.mDefaultLocalName + "", - "" + material.mDefaultLocalName + " Fluid Pipe", - 0.5F, - material, - transferRatePerTick * 12, - heatResistance, - isGasProof) - .getStackForm(1L)); + startID + 2, + "GT_Pipe_" + material.mDefaultLocalName + "", + "" + material.mDefaultLocalName + " Fluid Pipe", + 0.5F, + material, + transferRatePerTick * 12, + heatResistance, + isGasProof).getStackForm(1L)); GT_OreDictUnificator.registerOre( OrePrefixes.pipeLarge.get(material), new GT_MetaPipeEntity_Fluid( - startID + 3, - "GT_Pipe_" + material.mDefaultLocalName + "_Large", - "Large " + material.mDefaultLocalName + " Fluid Pipe", - 0.75F, - material, - transferRatePerTick * 24, - heatResistance, - isGasProof) - .getStackForm(1L)); + startID + 3, + "GT_Pipe_" + material.mDefaultLocalName + "_Large", + "Large " + material.mDefaultLocalName + " Fluid Pipe", + 0.75F, + material, + transferRatePerTick * 24, + heatResistance, + isGasProof).getStackForm(1L)); GT_OreDictUnificator.registerOre( OrePrefixes.pipeHuge.get(material), new GT_MetaPipeEntity_Fluid( - startID + 4, - "GT_Pipe_" + material.mDefaultLocalName + "_Huge", - "Huge " + material.mDefaultLocalName + " Fluid Pipe", - GTNH ? 0.875F : 1.0F, - material, - transferRatePerTick * 48, - heatResistance, - isGasProof) - .getStackForm(1L)); + startID + 4, + "GT_Pipe_" + material.mDefaultLocalName + "_Huge", + "Huge " + material.mDefaultLocalName + " Fluid Pipe", + GTNH ? 0.875F : 1.0F, + material, + transferRatePerTick * 48, + heatResistance, + isGasProof).getStackForm(1L)); // generatePipeRecipes(material.mDefaultLocalName, mass, voltage); } - private static void generateNonGTFluidPipes( - final GT_Materials material, - final Material myMaterial, - final int startID, - final int transferRatePerSec, - final int heatResistance, - final boolean isGasProof) { + private static void generateNonGTFluidPipes(final GT_Materials material, final Material myMaterial, + final int startID, final int transferRatePerSec, final int heatResistance, final boolean isGasProof) { final int transferRatePerTick = transferRatePerSec / 20; long mass; if (myMaterial != null) { @@ -847,63 +781,58 @@ public class GregtechConduits { GT_OreDictUnificator.registerOre( OrePrefixes.pipeTiny.get(material), new GregtechMetaPipeEntityFluid( - startID, - "GT_Pipe_" + material.mDefaultLocalName + "_Tiny", - "Tiny " + material.mDefaultLocalName + " Fluid Pipe", - 0.25F, - material, - transferRatePerTick * 2, - heatResistance, - isGasProof) - .getStackForm(1L)); + startID, + "GT_Pipe_" + material.mDefaultLocalName + "_Tiny", + "Tiny " + material.mDefaultLocalName + " Fluid Pipe", + 0.25F, + material, + transferRatePerTick * 2, + heatResistance, + isGasProof).getStackForm(1L)); GT_OreDictUnificator.registerOre( OrePrefixes.pipeSmall.get(material), new GregtechMetaPipeEntityFluid( - startID + 1, - "GT_Pipe_" + material.mDefaultLocalName + "_Small", - "Small " + material.mDefaultLocalName + " Fluid Pipe", - 0.375F, - material, - transferRatePerTick * 4, - heatResistance, - isGasProof) - .getStackForm(1L)); + startID + 1, + "GT_Pipe_" + material.mDefaultLocalName + "_Small", + "Small " + material.mDefaultLocalName + " Fluid Pipe", + 0.375F, + material, + transferRatePerTick * 4, + heatResistance, + isGasProof).getStackForm(1L)); GT_OreDictUnificator.registerOre( OrePrefixes.pipeMedium.get(material), new GregtechMetaPipeEntityFluid( - startID + 2, - "GT_Pipe_" + material.mDefaultLocalName + "", - "" + material.mDefaultLocalName + " Fluid Pipe", - 0.5F, - material, - transferRatePerTick * 12, - heatResistance, - isGasProof) - .getStackForm(1L)); + startID + 2, + "GT_Pipe_" + material.mDefaultLocalName + "", + "" + material.mDefaultLocalName + " Fluid Pipe", + 0.5F, + material, + transferRatePerTick * 12, + heatResistance, + isGasProof).getStackForm(1L)); GT_OreDictUnificator.registerOre( OrePrefixes.pipeLarge.get(material), new GregtechMetaPipeEntityFluid( - startID + 3, - "GT_Pipe_" + material.mDefaultLocalName + "_Large", - "Large " + material.mDefaultLocalName + " Fluid Pipe", - 0.75F, - material, - transferRatePerTick * 24, - heatResistance, - isGasProof) - .getStackForm(1L)); + startID + 3, + "GT_Pipe_" + material.mDefaultLocalName + "_Large", + "Large " + material.mDefaultLocalName + " Fluid Pipe", + 0.75F, + material, + transferRatePerTick * 24, + heatResistance, + isGasProof).getStackForm(1L)); GT_OreDictUnificator.registerOre( OrePrefixes.pipeHuge.get(material), new GregtechMetaPipeEntityFluid( - startID + 4, - "GT_Pipe_" + material.mDefaultLocalName + "_Huge", - "Huge " + material.mDefaultLocalName + " Fluid Pipe", - GTNH ? 0.875F : 1.0F, - material, - transferRatePerTick * 48, - heatResistance, - isGasProof) - .getStackForm(1L)); + startID + 4, + "GT_Pipe_" + material.mDefaultLocalName + "_Huge", + "Huge " + material.mDefaultLocalName + " Fluid Pipe", + GTNH ? 0.875F : 1.0F, + material, + transferRatePerTick * 48, + heatResistance, + isGasProof).getStackForm(1L)); // generatePipeRecipes(material.mDefaultLocalName, mass, tVoltageMultiplier); } @@ -929,16 +858,31 @@ public class GregtechConduits { } // Check all pipes are not null - Logger.WARNING("Generated pipeTiny from " + materialName + "? " - + ((ItemUtils.getItemStackOfAmountFromOreDict("pipe" + "Tiny" + output, 1) != null) ? true : false)); - Logger.WARNING("Generated pipeSmall from " + materialName + "? " - + ((ItemUtils.getItemStackOfAmountFromOreDict("pipe" + "Small" + output, 1) != null) ? true : false)); - Logger.WARNING("Generated pipeNormal from " + materialName + "? " - + ((ItemUtils.getItemStackOfAmountFromOreDict("pipe" + "Medium" + output, 1) != null) ? true : false)); - Logger.WARNING("Generated pipeLarge from " + materialName + "? " - + ((ItemUtils.getItemStackOfAmountFromOreDict("pipe" + "Large" + output, 1) != null) ? true : false)); - Logger.WARNING("Generated pipeHuge from " + materialName + "? " - + ((ItemUtils.getItemStackOfAmountFromOreDict("pipe" + "Huge" + output, 1) != null) ? true : false)); + Logger.WARNING( + "Generated pipeTiny from " + materialName + + "? " + + ((ItemUtils.getItemStackOfAmountFromOreDict("pipe" + "Tiny" + output, 1) != null) ? true + : false)); + Logger.WARNING( + "Generated pipeSmall from " + materialName + + "? " + + ((ItemUtils.getItemStackOfAmountFromOreDict("pipe" + "Small" + output, 1) != null) ? true + : false)); + Logger.WARNING( + "Generated pipeNormal from " + materialName + + "? " + + ((ItemUtils.getItemStackOfAmountFromOreDict("pipe" + "Medium" + output, 1) != null) ? true + : false)); + Logger.WARNING( + "Generated pipeLarge from " + materialName + + "? " + + ((ItemUtils.getItemStackOfAmountFromOreDict("pipe" + "Large" + output, 1) != null) ? true + : false)); + Logger.WARNING( + "Generated pipeHuge from " + materialName + + "? " + + ((ItemUtils.getItemStackOfAmountFromOreDict("pipe" + "Huge" + output, 1) != null) ? true + : false)); int eut = 120; eut = (int) (8 * vMulti); @@ -1036,8 +980,9 @@ public class GregtechConduits { pipePlateDouble, ItemUtils.getItemStackOfAmountFromOreDict("pipe" + "Huge" + output, 1)); } else { - Logger.INFO("Failed to add a recipe for " + materialName - + " Huge pipes. Double plates probably do not exist."); + Logger.INFO( + "Failed to add a recipe for " + materialName + + " Huge pipes. Double plates probably do not exist."); } } catch (Throwable t) { t.printStackTrace(); @@ -1056,7 +1001,7 @@ public class GregtechConduits { ArrayList<ItemStack> tList = GT_OreDictUnificator.getOres(tName); for (int i = 0; i < tList.size(); ++i) if (GT_Utility.areStacksEqual((ItemStack) tList.get(i), aStack, true)) return false; - OreDictionary.registerOre(tName, GT_Utility.copyAmount(1L, new Object[] {aStack})); + OreDictionary.registerOre(tName, GT_Utility.copyAmount(1L, new Object[] { aStack })); return true; } @@ -1080,139 +1025,209 @@ public class GregtechConduits { ItemStack aFineWire = aMaterial.getFineWire(1); // Adds manual crafting recipe - if (ItemUtils.checkForInvalidItems(new ItemStack[] {aPlate, aWire01})) { + if (ItemUtils.checkForInvalidItems(new ItemStack[] { aPlate, aWire01 })) { RecipeUtils.addShapedRecipe( - aPlate, CI.craftingToolWireCutter, null, null, null, null, null, null, null, aWire01); + aPlate, + CI.craftingToolWireCutter, + null, + null, + null, + null, + null, + null, + null, + aWire01); } // Wire mill if (ItemUtils.checkForInvalidItems( - new ItemStack[] {aIngot, aWire01, aWire02, aWire04, aWire08, aWire12, aWire16})) { + new ItemStack[] { aIngot, aWire01, aWire02, aWire04, aWire08, aWire12, aWire16 })) { GT_Values.RA.addWiremillRecipe( - aMaterial.getIngot(1), GT_Utility.getIntegratedCircuit(1), aMaterial.getWire01(2), 100, 4); + aMaterial.getIngot(1), + GT_Utility.getIntegratedCircuit(1), + aMaterial.getWire01(2), + 100, + 4); GT_Values.RA.addWiremillRecipe( - aMaterial.getIngot(1), GT_Utility.getIntegratedCircuit(2), aMaterial.getWire02(1), 150, 4); + aMaterial.getIngot(1), + GT_Utility.getIntegratedCircuit(2), + aMaterial.getWire02(1), + 150, + 4); GT_Values.RA.addWiremillRecipe( - aMaterial.getIngot(2), GT_Utility.getIntegratedCircuit(4), aMaterial.getWire04(1), 200, 4); + aMaterial.getIngot(2), + GT_Utility.getIntegratedCircuit(4), + aMaterial.getWire04(1), + 200, + 4); GT_Values.RA.addWiremillRecipe( - aMaterial.getIngot(4), GT_Utility.getIntegratedCircuit(8), aMaterial.getWire08(1), 250, 4); + aMaterial.getIngot(4), + GT_Utility.getIntegratedCircuit(8), + aMaterial.getWire08(1), + 250, + 4); GT_Values.RA.addWiremillRecipe( - aMaterial.getIngot(6), GT_Utility.getIntegratedCircuit(12), aMaterial.getWire12(1), 300, 4); + aMaterial.getIngot(6), + GT_Utility.getIntegratedCircuit(12), + aMaterial.getWire12(1), + 300, + 4); GT_Values.RA.addWiremillRecipe( - aMaterial.getIngot(8), GT_Utility.getIntegratedCircuit(16), aMaterial.getWire16(1), 350, 4); + aMaterial.getIngot(8), + GT_Utility.getIntegratedCircuit(16), + aMaterial.getWire16(1), + 350, + 4); } - if (ItemUtils.checkForInvalidItems( - new ItemStack[] {aRod, aWire01, aWire02, aWire04, aWire08, aWire12, aWire16})) { + if (ItemUtils + .checkForInvalidItems(new ItemStack[] { aRod, aWire01, aWire02, aWire04, aWire08, aWire12, aWire16 })) { GT_Values.RA.addWiremillRecipe( - aMaterial.getRod(1), GT_Utility.getIntegratedCircuit(1), aMaterial.getWire01(1), 50, 4); + aMaterial.getRod(1), + GT_Utility.getIntegratedCircuit(1), + aMaterial.getWire01(1), + 50, + 4); GT_Values.RA.addWiremillRecipe( - aMaterial.getRod(2), GT_Utility.getIntegratedCircuit(2), aMaterial.getWire02(1), 100, 4); + aMaterial.getRod(2), + GT_Utility.getIntegratedCircuit(2), + aMaterial.getWire02(1), + 100, + 4); GT_Values.RA.addWiremillRecipe( - aMaterial.getRod(4), GT_Utility.getIntegratedCircuit(4), aMaterial.getWire04(1), 150, 4); + aMaterial.getRod(4), + GT_Utility.getIntegratedCircuit(4), + aMaterial.getWire04(1), + 150, + 4); GT_Values.RA.addWiremillRecipe( - aMaterial.getRod(8), GT_Utility.getIntegratedCircuit(8), aMaterial.getWire08(1), 200, 4); + aMaterial.getRod(8), + GT_Utility.getIntegratedCircuit(8), + aMaterial.getWire08(1), + 200, + 4); GT_Values.RA.addWiremillRecipe( - aMaterial.getRod(12), GT_Utility.getIntegratedCircuit(12), aMaterial.getWire12(1), 250, 4); + aMaterial.getRod(12), + GT_Utility.getIntegratedCircuit(12), + aMaterial.getWire12(1), + 250, + 4); GT_Values.RA.addWiremillRecipe( - aMaterial.getRod(16), GT_Utility.getIntegratedCircuit(16), aMaterial.getWire16(1), 300, 4); + aMaterial.getRod(16), + GT_Utility.getIntegratedCircuit(16), + aMaterial.getWire16(1), + 300, + 4); } - if (ItemUtils.checkForInvalidItems(new ItemStack[] {aIngot, aFineWire})) { + if (ItemUtils.checkForInvalidItems(new ItemStack[] { aIngot, aFineWire })) { GT_Values.RA.addWiremillRecipe( - aMaterial.getIngot(1), GT_Utility.getIntegratedCircuit(3), aMaterial.getFineWire(8), 100, 4); + aMaterial.getIngot(1), + GT_Utility.getIntegratedCircuit(3), + aMaterial.getFineWire(8), + 100, + 4); } - if (ItemUtils.checkForInvalidItems(new ItemStack[] {aRod, aFineWire})) { + if (ItemUtils.checkForInvalidItems(new ItemStack[] { aRod, aFineWire })) { GT_Values.RA.addWiremillRecipe( - aMaterial.getRod(1), GT_Utility.getIntegratedCircuit(3), aMaterial.getFineWire(4), 50, 4); + aMaterial.getRod(1), + GT_Utility.getIntegratedCircuit(3), + aMaterial.getFineWire(4), + 50, + 4); } - if (ItemUtils.checkForInvalidItems(new ItemStack[] {aWire01, aFineWire})) { + if (ItemUtils.checkForInvalidItems(new ItemStack[] { aWire01, aFineWire })) { GT_Values.RA.addWiremillRecipe( - aMaterial.getWire01(1), GT_Utility.getIntegratedCircuit(1), aMaterial.getFineWire(4), 200, 8); + aMaterial.getWire01(1), + GT_Utility.getIntegratedCircuit(1), + aMaterial.getFineWire(4), + 200, + 8); } // Extruder - if (ItemUtils.checkForInvalidItems(new ItemStack[] {aIngot, aWire01})) { - GT_Values.RA.addExtruderRecipe( - aIngot, ItemList.Shape_Extruder_Wire.get(0), aMaterial.getWire01(2), 196, 96); + if (ItemUtils.checkForInvalidItems(new ItemStack[] { aIngot, aWire01 })) { + GT_Values.RA + .addExtruderRecipe(aIngot, ItemList.Shape_Extruder_Wire.get(0), aMaterial.getWire01(2), 196, 96); } - if (ItemUtils.checkForInvalidItems(new ItemStack[] {aCable01, aWire01})) { + if (ItemUtils.checkForInvalidItems(new ItemStack[] { aCable01, aWire01 })) { GT_Values.RA.addUnboxingRecipe(aCable01, aWire01, null, 100, 8); } // Shapeless Down-Crafting // 2x - if (ItemUtils.checkForInvalidItems(new ItemStack[] {aWire01, aWire02})) { - RecipeUtils.addShapelessGregtechRecipe(new ItemStack[] {aWire02}, aMaterial.getWire01(2)); + if (ItemUtils.checkForInvalidItems(new ItemStack[] { aWire01, aWire02 })) { + RecipeUtils.addShapelessGregtechRecipe(new ItemStack[] { aWire02 }, aMaterial.getWire01(2)); } // 4x - if (ItemUtils.checkForInvalidItems(new ItemStack[] {aWire01, aWire04})) { - RecipeUtils.addShapelessGregtechRecipe(new ItemStack[] {aWire04}, aMaterial.getWire01(4)); + if (ItemUtils.checkForInvalidItems(new ItemStack[] { aWire01, aWire04 })) { + RecipeUtils.addShapelessGregtechRecipe(new ItemStack[] { aWire04 }, aMaterial.getWire01(4)); } // 8x - if (ItemUtils.checkForInvalidItems(new ItemStack[] {aWire01, aWire08})) { - RecipeUtils.addShapelessGregtechRecipe(new ItemStack[] {aWire08}, aMaterial.getWire01(8)); + if (ItemUtils.checkForInvalidItems(new ItemStack[] { aWire01, aWire08 })) { + RecipeUtils.addShapelessGregtechRecipe(new ItemStack[] { aWire08 }, aMaterial.getWire01(8)); } // 12x - if (ItemUtils.checkForInvalidItems(new ItemStack[] {aWire01, aWire12})) { - RecipeUtils.addShapelessGregtechRecipe(new ItemStack[] {aWire12}, aMaterial.getWire01(12)); + if (ItemUtils.checkForInvalidItems(new ItemStack[] { aWire01, aWire12 })) { + RecipeUtils.addShapelessGregtechRecipe(new ItemStack[] { aWire12 }, aMaterial.getWire01(12)); } // 16x - if (ItemUtils.checkForInvalidItems(new ItemStack[] {aWire01, aWire16})) { - RecipeUtils.addShapelessGregtechRecipe(new ItemStack[] {aWire16}, aMaterial.getWire01(16)); + if (ItemUtils.checkForInvalidItems(new ItemStack[] { aWire01, aWire16 })) { + RecipeUtils.addShapelessGregtechRecipe(new ItemStack[] { aWire16 }, aMaterial.getWire01(16)); } // 1x -> 2x - if (ItemUtils.checkForInvalidItems(new ItemStack[] {aWire01, aWire02})) { - RecipeUtils.addShapelessGregtechRecipe(new ItemStack[] {aWire01, aWire01}, aWire02); + if (ItemUtils.checkForInvalidItems(new ItemStack[] { aWire01, aWire02 })) { + RecipeUtils.addShapelessGregtechRecipe(new ItemStack[] { aWire01, aWire01 }, aWire02); } // 2x -> 4x - if (ItemUtils.checkForInvalidItems(new ItemStack[] {aWire02, aWire04})) { - RecipeUtils.addShapelessGregtechRecipe(new ItemStack[] {aWire02, aWire02}, aWire04); + if (ItemUtils.checkForInvalidItems(new ItemStack[] { aWire02, aWire04 })) { + RecipeUtils.addShapelessGregtechRecipe(new ItemStack[] { aWire02, aWire02 }, aWire04); } // 4x -> 8x - if (ItemUtils.checkForInvalidItems(new ItemStack[] {aWire04, aWire08})) { - RecipeUtils.addShapelessGregtechRecipe(new ItemStack[] {aWire04, aWire04}, aWire08); + if (ItemUtils.checkForInvalidItems(new ItemStack[] { aWire04, aWire08 })) { + RecipeUtils.addShapelessGregtechRecipe(new ItemStack[] { aWire04, aWire04 }, aWire08); } // 8x -> 12x - if (ItemUtils.checkForInvalidItems(new ItemStack[] {aWire04, aWire08, aWire12})) { - RecipeUtils.addShapelessGregtechRecipe(new ItemStack[] {aWire04, aWire08}, aWire12); + if (ItemUtils.checkForInvalidItems(new ItemStack[] { aWire04, aWire08, aWire12 })) { + RecipeUtils.addShapelessGregtechRecipe(new ItemStack[] { aWire04, aWire08 }, aWire12); } // 12x -> 16x - if (ItemUtils.checkForInvalidItems(new ItemStack[] {aWire04, aWire12, aWire16})) { - RecipeUtils.addShapelessGregtechRecipe(new ItemStack[] {aWire04, aWire12}, aWire16); + if (ItemUtils.checkForInvalidItems(new ItemStack[] { aWire04, aWire12, aWire16 })) { + RecipeUtils.addShapelessGregtechRecipe(new ItemStack[] { aWire04, aWire12 }, aWire16); } // 8x -> 16x - if (ItemUtils.checkForInvalidItems(new ItemStack[] {aWire08, aWire16})) { - RecipeUtils.addShapelessGregtechRecipe(new ItemStack[] {aWire08, aWire08}, aWire16); + if (ItemUtils.checkForInvalidItems(new ItemStack[] { aWire08, aWire16 })) { + RecipeUtils.addShapelessGregtechRecipe(new ItemStack[] { aWire08, aWire08 }, aWire16); } // 1x -> 4x - if (ItemUtils.checkForInvalidItems(new ItemStack[] {aWire01, aWire04})) { - RecipeUtils.addShapelessGregtechRecipe(new ItemStack[] {aWire01, aWire01, aWire01, aWire01}, aWire04); + if (ItemUtils.checkForInvalidItems(new ItemStack[] { aWire01, aWire04 })) { + RecipeUtils.addShapelessGregtechRecipe(new ItemStack[] { aWire01, aWire01, aWire01, aWire01 }, aWire04); } // 1x -> 8x - if (ItemUtils.checkForInvalidItems(new ItemStack[] {aWire01, aWire08})) { + if (ItemUtils.checkForInvalidItems(new ItemStack[] { aWire01, aWire08 })) { RecipeUtils.addShapelessGregtechRecipe( - new ItemStack[] {aWire01, aWire01, aWire01, aWire01, aWire01, aWire01, aWire01, aWire01}, aWire08); + new ItemStack[] { aWire01, aWire01, aWire01, aWire01, aWire01, aWire01, aWire01, aWire01 }, + aWire08); } // Wire to Cable // 1x - if (ItemUtils.checkForInvalidItems(new ItemStack[] {aWire01, aCable01})) { + if (ItemUtils.checkForInvalidItems(new ItemStack[] { aWire01, aCable01 })) { GT_Values.RA.addAssemblerRecipe( aWire01, CI.getNumberedCircuit(24), @@ -1223,7 +1238,7 @@ public class GregtechConduits { } // 2x - if (ItemUtils.checkForInvalidItems(new ItemStack[] {aWire02, aCable02})) { + if (ItemUtils.checkForInvalidItems(new ItemStack[] { aWire02, aCable02 })) { GT_Values.RA.addAssemblerRecipe( aWire02, CI.getNumberedCircuit(24), @@ -1234,7 +1249,7 @@ public class GregtechConduits { } // 4x - if (ItemUtils.checkForInvalidItems(new ItemStack[] {aWire04, aCable04})) { + if (ItemUtils.checkForInvalidItems(new ItemStack[] { aWire04, aCable04 })) { GT_Values.RA.addAssemblerRecipe( aWire04, CI.getNumberedCircuit(24), @@ -1245,7 +1260,7 @@ public class GregtechConduits { } // 8x - if (ItemUtils.checkForInvalidItems(new ItemStack[] {aWire08, aCable08})) { + if (ItemUtils.checkForInvalidItems(new ItemStack[] { aWire08, aCable08 })) { GT_Values.RA.addAssemblerRecipe( aWire08, CI.getNumberedCircuit(24), @@ -1256,7 +1271,7 @@ public class GregtechConduits { } // 12x - if (ItemUtils.checkForInvalidItems(new ItemStack[] {aWire12, aCable12})) { + if (ItemUtils.checkForInvalidItems(new ItemStack[] { aWire12, aCable12 })) { GT_Values.RA.addAssemblerRecipe( aWire12, CI.getNumberedCircuit(24), @@ -1267,7 +1282,7 @@ public class GregtechConduits { } // 16x - if (ItemUtils.checkForInvalidItems(new ItemStack[] {aWire16, aCable16})) { + if (ItemUtils.checkForInvalidItems(new ItemStack[] { aWire16, aCable16 })) { GT_Values.RA.addAssemblerRecipe( aWire16, CI.getNumberedCircuit(24), @@ -1280,27 +1295,27 @@ public class GregtechConduits { // Assemble small wires into bigger wires // 2x - if (ItemUtils.checkForInvalidItems(new ItemStack[] {aWire01, aWire02})) { + if (ItemUtils.checkForInvalidItems(new ItemStack[] { aWire01, aWire02 })) { GT_Values.RA.addAssemblerRecipe(aMaterial.getWire01(2), CI.getNumberedCircuit(2), null, aWire02, 100, 8); } // 4x - if (ItemUtils.checkForInvalidItems(new ItemStack[] {aWire01, aWire02})) { + if (ItemUtils.checkForInvalidItems(new ItemStack[] { aWire01, aWire02 })) { GT_Values.RA.addAssemblerRecipe(aMaterial.getWire01(4), CI.getNumberedCircuit(4), null, aWire04, 100, 8); } // 8x - if (ItemUtils.checkForInvalidItems(new ItemStack[] {aWire01, aWire02})) { + if (ItemUtils.checkForInvalidItems(new ItemStack[] { aWire01, aWire02 })) { GT_Values.RA.addAssemblerRecipe(aMaterial.getWire01(8), CI.getNumberedCircuit(8), null, aWire08, 100, 8); } // 12x - if (ItemUtils.checkForInvalidItems(new ItemStack[] {aWire01, aWire02})) { + if (ItemUtils.checkForInvalidItems(new ItemStack[] { aWire01, aWire02 })) { GT_Values.RA.addAssemblerRecipe(aMaterial.getWire01(12), CI.getNumberedCircuit(12), null, aWire12, 100, 8); } // 16x - if (ItemUtils.checkForInvalidItems(new ItemStack[] {aWire01, aWire02})) { + if (ItemUtils.checkForInvalidItems(new ItemStack[] { aWire01, aWire02 })) { GT_Values.RA.addAssemblerRecipe(aMaterial.getWire01(16), CI.getNumberedCircuit(16), null, aWire16, 100, 8); } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechCustomHatches.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechCustomHatches.java index e261b2f01a..2cd484bc9f 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechCustomHatches.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechCustomHatches.java @@ -24,7 +24,8 @@ public class GregtechCustomHatches { private static void run1() { - GregtechItemList.Hatch_Input_Cryotheum.set(new GT_MetaTileEntity_Hatch_CustomFluidBase( + GregtechItemList.Hatch_Input_Cryotheum.set( + new GT_MetaTileEntity_Hatch_CustomFluidBase( FluidUtils.getFluidStack("cryotheum", 1).getFluid(), // Fluid // to // resitrct @@ -34,10 +35,10 @@ public class GregtechCustomHatches { 967, // ID "hatch.cryotheum.input.tier.00", // unlocal name "Cryotheum Cooling Hatch" // Local name - ) - .getStackForm(1L)); + ).getStackForm(1L)); - GregtechItemList.Hatch_Input_Pyrotheum.set(new GT_MetaTileEntity_Hatch_CustomFluidBase( + GregtechItemList.Hatch_Input_Pyrotheum.set( + new GT_MetaTileEntity_Hatch_CustomFluidBase( FluidUtils.getFluidStack("pyrotheum", 1).getFluid(), // Fluid // to // resitrct @@ -47,22 +48,21 @@ public class GregtechCustomHatches { 968, // ID "hatch.pyrotheum.input.tier.00", // unlocal name "Pyrotheum Heating Vent" // Local name - ) - .getStackForm(1L)); + ).getStackForm(1L)); - GregtechItemList.Hatch_Input_Naquadah.set(new GT_MetaTileEntity_Hatch_Naquadah( + GregtechItemList.Hatch_Input_Naquadah.set( + new GT_MetaTileEntity_Hatch_Naquadah( 969, // ID "hatch.naquadah.input.tier.00", // unlocal name "Naquadah Reactor Input hatch" // Local name - ) - .getStackForm(1L)); + ).getStackForm(1L)); - GregtechItemList.Hatch_Input_TurbineHousing.set(new GT_MetaTileEntity_Hatch_TurbineProvider( + GregtechItemList.Hatch_Input_TurbineHousing.set( + new GT_MetaTileEntity_Hatch_TurbineProvider( 31025, // ID "hatch.turbine.input.tier.00", // unlocal name "Turbine Housing", // Local name - 8) - .getStackForm(1L)); + 8).getStackForm(1L)); // Multiblock Control Core Bus GregtechItemList.Hatch_Control_Core.set( @@ -73,9 +73,12 @@ public class GregtechCustomHatches { GregtechItemList.Hatch_Air_Intake.set( new GT_MetaTileEntity_Hatch_AirIntake(861, "hatch.air.intake.tier.00", "Air Intake Hatch", 5) .getStackForm(1L)); - GregtechItemList.Hatch_Air_Intake_Extreme.set(new GT_MetaTileEntity_Hatch_AirIntake_Extreme( - 31070, "hatch.air.intake.tier.01", "Extreme Air Intake Hatch", 6) - .getStackForm(1L)); + GregtechItemList.Hatch_Air_Intake_Extreme.set( + new GT_MetaTileEntity_Hatch_AirIntake_Extreme( + 31070, + "hatch.air.intake.tier.01", + "Extreme Air Intake Hatch", + 6).getStackForm(1L)); // Multiblock Reservoir Hatch GregtechItemList.Hatch_Reservoir.set( @@ -83,7 +86,8 @@ public class GregtechCustomHatches { .getStackForm(1L)); // Steam Hatch - GregtechItemList.Hatch_Input_Steam.set(new GT_MetaTileEntity_Hatch_CustomFluidBase( + GregtechItemList.Hatch_Input_Steam.set( + new GT_MetaTileEntity_Hatch_CustomFluidBase( FluidUtils.getSteam(1).getFluid(), // Fluid // to // resitrct @@ -93,38 +97,64 @@ public class GregtechCustomHatches { 31040, // ID "hatch.steam.input.tier.00", // unlocal name "Steam Hatch" // Local name - ) - .getStackForm(1L)); + ).getStackForm(1L)); } private static void run2() { - GregtechItemList.Hatch_Muffler_Adv_LV.set((new GT_MetaTileEntity_Hatch_Muffler_Adv( - 30001, "hatch.muffler.adv.tier.01", "Advanced Muffler Hatch (LV)", 1)) - .getStackForm(1L)); - GregtechItemList.Hatch_Muffler_Adv_MV.set((new GT_MetaTileEntity_Hatch_Muffler_Adv( - 30002, "hatch.muffler.adv.tier.02", "Advanced Muffler Hatch (MV)", 2)) - .getStackForm(1L)); - GregtechItemList.Hatch_Muffler_Adv_HV.set((new GT_MetaTileEntity_Hatch_Muffler_Adv( - 30003, "hatch.muffler.adv.tier.03", "Advanced Muffler Hatch (HV)", 3)) - .getStackForm(1L)); - GregtechItemList.Hatch_Muffler_Adv_EV.set((new GT_MetaTileEntity_Hatch_Muffler_Adv( - 30004, "hatch.muffler.adv.tier.04", "Advanced Muffler Hatch (EV)", 4)) - .getStackForm(1L)); - GregtechItemList.Hatch_Muffler_Adv_IV.set((new GT_MetaTileEntity_Hatch_Muffler_Adv( - 30005, "hatch.muffler.adv.tier.05", "Advanced Muffler Hatch (IV)", 5)) - .getStackForm(1L)); - GregtechItemList.Hatch_Muffler_Adv_LuV.set((new GT_MetaTileEntity_Hatch_Muffler_Adv( - 30006, "hatch.muffler.adv.tier.06", "Advanced Muffler Hatch (LuV)", 6)) - .getStackForm(1L)); - GregtechItemList.Hatch_Muffler_Adv_ZPM.set((new GT_MetaTileEntity_Hatch_Muffler_Adv( - 30007, "hatch.muffler.adv.tier.07", "Advanced Muffler Hatch (ZPM)", 7)) - .getStackForm(1L)); - GregtechItemList.Hatch_Muffler_Adv_UV.set((new GT_MetaTileEntity_Hatch_Muffler_Adv( - 30008, "hatch.muffler.adv.tier.08", "Advanced Muffler Hatch (UV)", 8)) - .getStackForm(1L)); - GregtechItemList.Hatch_Muffler_Adv_MAX.set((new GT_MetaTileEntity_Hatch_Muffler_Adv( - 30009, "hatch.muffler.adv.tier.09", "Advanced Muffler Hatch (MAX)", 9)) - .getStackForm(1L)); + GregtechItemList.Hatch_Muffler_Adv_LV.set( + (new GT_MetaTileEntity_Hatch_Muffler_Adv( + 30001, + "hatch.muffler.adv.tier.01", + "Advanced Muffler Hatch (LV)", + 1)).getStackForm(1L)); + GregtechItemList.Hatch_Muffler_Adv_MV.set( + (new GT_MetaTileEntity_Hatch_Muffler_Adv( + 30002, + "hatch.muffler.adv.tier.02", + "Advanced Muffler Hatch (MV)", + 2)).getStackForm(1L)); + GregtechItemList.Hatch_Muffler_Adv_HV.set( + (new GT_MetaTileEntity_Hatch_Muffler_Adv( + 30003, + "hatch.muffler.adv.tier.03", + "Advanced Muffler Hatch (HV)", + 3)).getStackForm(1L)); + GregtechItemList.Hatch_Muffler_Adv_EV.set( + (new GT_MetaTileEntity_Hatch_Muffler_Adv( + 30004, + "hatch.muffler.adv.tier.04", + "Advanced Muffler Hatch (EV)", + 4)).getStackForm(1L)); + GregtechItemList.Hatch_Muffler_Adv_IV.set( + (new GT_MetaTileEntity_Hatch_Muffler_Adv( + 30005, + "hatch.muffler.adv.tier.05", + "Advanced Muffler Hatch (IV)", + 5)).getStackForm(1L)); + GregtechItemList.Hatch_Muffler_Adv_LuV.set( + (new GT_MetaTileEntity_Hatch_Muffler_Adv( + 30006, + "hatch.muffler.adv.tier.06", + "Advanced Muffler Hatch (LuV)", + 6)).getStackForm(1L)); + GregtechItemList.Hatch_Muffler_Adv_ZPM.set( + (new GT_MetaTileEntity_Hatch_Muffler_Adv( + 30007, + "hatch.muffler.adv.tier.07", + "Advanced Muffler Hatch (ZPM)", + 7)).getStackForm(1L)); + GregtechItemList.Hatch_Muffler_Adv_UV.set( + (new GT_MetaTileEntity_Hatch_Muffler_Adv( + 30008, + "hatch.muffler.adv.tier.08", + "Advanced Muffler Hatch (UV)", + 8)).getStackForm(1L)); + GregtechItemList.Hatch_Muffler_Adv_MAX.set( + (new GT_MetaTileEntity_Hatch_Muffler_Adv( + 30009, + "hatch.muffler.adv.tier.09", + "Advanced Muffler Hatch (MAX)", + 9)).getStackForm(1L)); } private static void run3() { @@ -201,25 +231,37 @@ public class GregtechCustomHatches { .getStackForm(1L)); } - private static GT_MetaTileEntity_SuperBus_Input makeInputBus( - int id, String unlocalizedName, String localizedName, int tier) { + private static GT_MetaTileEntity_SuperBus_Input makeInputBus(int id, String unlocalizedName, String localizedName, + int tier) { return new GT_MetaTileEntity_SuperBus_Input(id, unlocalizedName, localizedName, tier); } - private static GT_MetaTileEntity_SuperBus_Output makeOutputBus( - int id, String unlocalizedName, String localizedName, int tier) { + private static GT_MetaTileEntity_SuperBus_Output makeOutputBus(int id, String unlocalizedName, String localizedName, + int tier) { return new GT_MetaTileEntity_SuperBus_Output(id, unlocalizedName, localizedName, tier); } private static void run4() { int aID = 31060; // 41, "hatch.energy.tier.01", "LV Energy Hatch", 1 - GT_MetaTileEntity_Hatch_Energy_RTG aHatch1 = - new GT_MetaTileEntity_Hatch_Energy_RTG(aID++, "hatch.energy.rtg.tier.01", "RTG Power Unit [LV]", 1, 9); - GT_MetaTileEntity_Hatch_Energy_RTG aHatch2 = - new GT_MetaTileEntity_Hatch_Energy_RTG(aID++, "hatch.energy.rtg.tier.02", "RTG Power Unit [MV]", 2, 9); - GT_MetaTileEntity_Hatch_Energy_RTG aHatch3 = - new GT_MetaTileEntity_Hatch_Energy_RTG(aID++, "hatch.energy.rtg.tier.03", "RTG Power Unit [HV]", 3, 9); + GT_MetaTileEntity_Hatch_Energy_RTG aHatch1 = new GT_MetaTileEntity_Hatch_Energy_RTG( + aID++, + "hatch.energy.rtg.tier.01", + "RTG Power Unit [LV]", + 1, + 9); + GT_MetaTileEntity_Hatch_Energy_RTG aHatch2 = new GT_MetaTileEntity_Hatch_Energy_RTG( + aID++, + "hatch.energy.rtg.tier.02", + "RTG Power Unit [MV]", + 2, + 9); + GT_MetaTileEntity_Hatch_Energy_RTG aHatch3 = new GT_MetaTileEntity_Hatch_Energy_RTG( + aID++, + "hatch.energy.rtg.tier.03", + "RTG Power Unit [HV]", + 3, + 9); GregtechItemList.Hatch_RTG_LV.set(aHatch1.getStackForm(1L)); GregtechItemList.Hatch_RTG_MV.set(aHatch2.getStackForm(1L)); diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechDehydrator.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechDehydrator.java index 6dba10bb98..7a42bf1c9c 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechDehydrator.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechDehydrator.java @@ -1,5 +1,7 @@ package gtPlusPlus.xmod.gregtech.registration.gregtech; +import net.minecraft.item.ItemStack; + import gregtech.api.enums.GT_Values; import gregtech.api.enums.ItemList; import gregtech.api.enums.Materials; @@ -14,9 +16,9 @@ import gtPlusPlus.core.util.minecraft.ItemUtils; import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Dehydrator; import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing.GregtechMetaTileEntity_IndustrialDehydrator; -import net.minecraft.item.ItemStack; public class GregtechDehydrator { + public static void run() { if (LoadedMods.Gregtech) { Logger.INFO("Gregtech5u Content | Registering Chemical Dehydrators."); @@ -29,87 +31,82 @@ public class GregtechDehydrator { private static void run1() { /* - * - * public GT_MetaTileEntity_BasicMachine_GT_Recipe( int aID, String - * aName, String aNameRegional, int aTier, String aDescription, - * GT_Recipe_Map aRecipes, int aInputSlots, int aOutputSlots, int - * aTankCapacity, int aGUIParameterA, int aGUIParameterB, String - * aGUIName, String aSound, boolean aSharedTank, boolean - * aRequiresFluidForFiltering, int aSpecialEffect, String aOverlays, - * Object[] aRecipe) { - * + * public GT_MetaTileEntity_BasicMachine_GT_Recipe( int aID, String aName, String aNameRegional, int aTier, + * String aDescription, GT_Recipe_Map aRecipes, int aInputSlots, int aOutputSlots, int aTankCapacity, int + * aGUIParameterA, int aGUIParameterB, String aGUIName, String aSound, boolean aSharedTank, boolean + * aRequiresFluidForFiltering, int aSpecialEffect, String aOverlays, Object[] aRecipe) { */ // Basic - GregtechItemList.GT_Dehydrator_MV.set(new GT_MetaTileEntity_Dehydrator( + GregtechItemList.GT_Dehydrator_MV.set( + new GT_MetaTileEntity_Dehydrator( 911, "machine.dehydrator.tier.00", "Basic Dehydrator I", 2, "This dehydrates your Grapes into Raisins.", - 16000) - .getStackForm(1L)); + 16000).getStackForm(1L)); - GregtechItemList.GT_Dehydrator_HV.set(new GT_MetaTileEntity_Dehydrator( + GregtechItemList.GT_Dehydrator_HV.set( + new GT_MetaTileEntity_Dehydrator( 912, "machine.dehydrator.tier.01", "Basic Dehydrator II", 3, "This dehydrates your Grapes into Raisins.", - 32000) - .getStackForm(1L)); + 32000).getStackForm(1L)); // Chemical - GregtechItemList.GT_Dehydrator_EV.set(new GT_MetaTileEntity_Dehydrator( + GregtechItemList.GT_Dehydrator_EV.set( + new GT_MetaTileEntity_Dehydrator( 813, "advancedmachine.dehydrator.tier.01", "Chemical Dehydrator I", 4, "A hangover is the way your body reacts to dehydration.", - 48000) - .getStackForm(1L)); + 48000).getStackForm(1L)); - GregtechItemList.GT_Dehydrator_IV.set(new GT_MetaTileEntity_Dehydrator( + GregtechItemList.GT_Dehydrator_IV.set( + new GT_MetaTileEntity_Dehydrator( 814, "advancedmachine.dehydrator.tier.02", "Chemical Dehydrator II", 5, "A hangover is the way your body reacts to dehydration.", - 48000) - .getStackForm(1L)); + 48000).getStackForm(1L)); - GregtechItemList.GT_Dehydrator_LuV.set(new GT_MetaTileEntity_Dehydrator( + GregtechItemList.GT_Dehydrator_LuV.set( + new GT_MetaTileEntity_Dehydrator( 815, "advancedmachine.dehydrator.tier.03", "Chemical Dehydrator III", 6, "You could probably make space icecream with this..", - 64000) - .getStackForm(1L)); + 64000).getStackForm(1L)); - GregtechItemList.GT_Dehydrator_ZPM.set(new GT_MetaTileEntity_Dehydrator( + GregtechItemList.GT_Dehydrator_ZPM.set( + new GT_MetaTileEntity_Dehydrator( 816, "advancedmachine.dehydrator.tier.04", "Chemical Dehydrator IV", 7, "You can definitely make space icecream with this..", - 64000) - .getStackForm(1L)); + 64000).getStackForm(1L)); // Advanced GregtechItemList.Controller_Vacuum_Furnace.set( new GregtechMetaTileEntity_IndustrialDehydrator(995, "multimachine.adv.vacuumfurnace", "Utupu-Tanuri") .getStackForm(1L)); - ItemStack coilWire1 = - ItemUtils.getItemStackWithMeta(true, "miscutils:itemDehydratorCoilWire", "coilWire1", 0, 4); - ItemStack coilWire2 = - ItemUtils.getItemStackWithMeta(true, "miscutils:itemDehydratorCoilWire:1", "coilWire2", 1, 4); - ItemStack coilWire3 = - ItemUtils.getItemStackWithMeta(true, "miscutils:itemDehydratorCoilWire:2", "coilWire3", 2, 4); - ItemStack coilWire4 = - ItemUtils.getItemStackWithMeta(true, "miscutils:itemDehydratorCoilWire:3", "coilWire4", 3, 4); + ItemStack coilWire1 = ItemUtils + .getItemStackWithMeta(true, "miscutils:itemDehydratorCoilWire", "coilWire1", 0, 4); + ItemStack coilWire2 = ItemUtils + .getItemStackWithMeta(true, "miscutils:itemDehydratorCoilWire:1", "coilWire2", 1, 4); + ItemStack coilWire3 = ItemUtils + .getItemStackWithMeta(true, "miscutils:itemDehydratorCoilWire:2", "coilWire3", 2, 4); + ItemStack coilWire4 = ItemUtils + .getItemStackWithMeta(true, "miscutils:itemDehydratorCoilWire:3", "coilWire4", 3, 4); ItemStack coilT1 = ItemUtils.getItemStackWithMeta(true, "miscutils:itemDehydratorCoil", "coil1", 0, 1); ItemStack coilT2 = ItemUtils.getItemStackWithMeta(true, "miscutils:itemDehydratorCoil:1", "coil2", 1, 1); ItemStack coilT3 = ItemUtils.getItemStackWithMeta(true, "miscutils:itemDehydratorCoil:2", "coil3", 2, 1); @@ -130,146 +127,67 @@ public class GregtechDehydrator { // Basic GT_ModHandler.addCraftingRecipe( GregtechItemList.GT_Dehydrator_MV.get(1L, new Object[0]), - GT_ModHandler.RecipeBits.DISMANTLEABLE - | GT_ModHandler.RecipeBits.NOT_REMOVABLE + GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED, - new Object[] { - "ECE", - "WMW", - "GPG", - Character.valueOf('M'), - ItemList.Hull_MV, - Character.valueOf('P'), - ItemList.Robot_Arm_MV, - Character.valueOf('E'), - OrePrefixes.wireFine.get(Materials.RedAlloy), - Character.valueOf('C'), - OrePrefixes.circuit.get(Materials.Good), - Character.valueOf('W'), - OrePrefixes.cableGt04.get(Materials.Copper), - Character.valueOf('G'), - OrePrefixes.gearGt.get(Materials.Steel) - }); + new Object[] { "ECE", "WMW", "GPG", Character.valueOf('M'), ItemList.Hull_MV, Character.valueOf('P'), + ItemList.Robot_Arm_MV, Character.valueOf('E'), OrePrefixes.wireFine.get(Materials.RedAlloy), + Character.valueOf('C'), OrePrefixes.circuit.get(Materials.Good), Character.valueOf('W'), + OrePrefixes.cableGt04.get(Materials.Copper), Character.valueOf('G'), + OrePrefixes.gearGt.get(Materials.Steel) }); GT_ModHandler.addCraftingRecipe( GregtechItemList.GT_Dehydrator_HV.get(1L, new Object[0]), - GT_ModHandler.RecipeBits.DISMANTLEABLE - | GT_ModHandler.RecipeBits.NOT_REMOVABLE + GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED, - new Object[] { - "ECE", - "WMW", - "GPG", - Character.valueOf('M'), - ItemList.Hull_HV, - Character.valueOf('P'), - ItemList.Robot_Arm_HV, - Character.valueOf('E'), - OrePrefixes.wireFine.get(Materials.Electrum), - Character.valueOf('C'), - OrePrefixes.circuit.get(Materials.Advanced), - Character.valueOf('W'), - OrePrefixes.cableGt04.get(Materials.Silver), - Character.valueOf('G'), - ALLOY.POTIN.getGear(1) - }); + new Object[] { "ECE", "WMW", "GPG", Character.valueOf('M'), ItemList.Hull_HV, Character.valueOf('P'), + ItemList.Robot_Arm_HV, Character.valueOf('E'), OrePrefixes.wireFine.get(Materials.Electrum), + Character.valueOf('C'), OrePrefixes.circuit.get(Materials.Advanced), Character.valueOf('W'), + OrePrefixes.cableGt04.get(Materials.Silver), Character.valueOf('G'), ALLOY.POTIN.getGear(1) }); // Chemical GT_ModHandler.addCraftingRecipe( GregtechItemList.GT_Dehydrator_EV.get(1L, new Object[0]), - GT_ModHandler.RecipeBits.DISMANTLEABLE - | GT_ModHandler.RecipeBits.NOT_REMOVABLE + GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED, - new Object[] { - "ECE", - "WMW", - "GPG", - Character.valueOf('M'), - ItemList.Hull_EV, - Character.valueOf('P'), - ItemList.Robot_Arm_EV, - Character.valueOf('E'), - coilT1, - Character.valueOf('C'), - OrePrefixes.circuit.get(Materials.Data), - Character.valueOf('W'), - OrePrefixes.cableGt04.get(Materials.Aluminium), - Character.valueOf('G'), - ALLOY.TUMBAGA.getGear(1) - }); + new Object[] { "ECE", "WMW", "GPG", Character.valueOf('M'), ItemList.Hull_EV, Character.valueOf('P'), + ItemList.Robot_Arm_EV, Character.valueOf('E'), coilT1, Character.valueOf('C'), + OrePrefixes.circuit.get(Materials.Data), Character.valueOf('W'), + OrePrefixes.cableGt04.get(Materials.Aluminium), Character.valueOf('G'), + ALLOY.TUMBAGA.getGear(1) }); GT_ModHandler.addCraftingRecipe( GregtechItemList.GT_Dehydrator_IV.get(1L, new Object[0]), - GT_ModHandler.RecipeBits.DISMANTLEABLE - | GT_ModHandler.RecipeBits.NOT_REMOVABLE + GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED, - new Object[] { - "ECE", - "WMW", - "GPG", - Character.valueOf('M'), - ItemList.Hull_IV, - Character.valueOf('P'), - ItemList.Robot_Arm_IV, - Character.valueOf('E'), - coilT2, - Character.valueOf('C'), - OrePrefixes.circuit.get(Materials.Elite), - Character.valueOf('W'), - OrePrefixes.cableGt04.get(Materials.Tungsten), - Character.valueOf('G'), - ALLOY.INCONEL_690.getGear(1) - }); + new Object[] { "ECE", "WMW", "GPG", Character.valueOf('M'), ItemList.Hull_IV, Character.valueOf('P'), + ItemList.Robot_Arm_IV, Character.valueOf('E'), coilT2, Character.valueOf('C'), + OrePrefixes.circuit.get(Materials.Elite), Character.valueOf('W'), + OrePrefixes.cableGt04.get(Materials.Tungsten), Character.valueOf('G'), + ALLOY.INCONEL_690.getGear(1) }); GT_ModHandler.addCraftingRecipe( GregtechItemList.GT_Dehydrator_LuV.get(1L, new Object[0]), - GT_ModHandler.RecipeBits.DISMANTLEABLE - | GT_ModHandler.RecipeBits.NOT_REMOVABLE + GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED, - new Object[] { - "ECE", - "WMW", - "GPG", - Character.valueOf('M'), - ItemList.Hull_LuV, - Character.valueOf('P'), - CI.robotArm_LuV, - Character.valueOf('E'), - coilT3, - Character.valueOf('C'), - OrePrefixes.circuit.get(Materials.Master), - Character.valueOf('W'), - OrePrefixes.cableGt04.get(Materials.Naquadah), - Character.valueOf('G'), - ALLOY.HASTELLOY_N.getGear(1) - }); + new Object[] { "ECE", "WMW", "GPG", Character.valueOf('M'), ItemList.Hull_LuV, Character.valueOf('P'), + CI.robotArm_LuV, Character.valueOf('E'), coilT3, Character.valueOf('C'), + OrePrefixes.circuit.get(Materials.Master), Character.valueOf('W'), + OrePrefixes.cableGt04.get(Materials.Naquadah), Character.valueOf('G'), + ALLOY.HASTELLOY_N.getGear(1) }); GT_ModHandler.addCraftingRecipe( GregtechItemList.GT_Dehydrator_ZPM.get(1L, new Object[0]), - GT_ModHandler.RecipeBits.DISMANTLEABLE - | GT_ModHandler.RecipeBits.NOT_REMOVABLE + GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED, - new Object[] { - "ECE", - "WMW", - "GPG", - Character.valueOf('M'), - ItemList.Hull_ZPM, - Character.valueOf('P'), - CI.robotArm_ZPM, - Character.valueOf('E'), - coilT4, - Character.valueOf('C'), - OrePrefixes.circuit.get(Materials.Ultimate), - Character.valueOf('W'), - OrePrefixes.cableGt04.get(Materials.Osmium), - Character.valueOf('G'), - ALLOY.ZERON_100.getGear(1) - }); + new Object[] { "ECE", "WMW", "GPG", Character.valueOf('M'), ItemList.Hull_ZPM, Character.valueOf('P'), + CI.robotArm_ZPM, Character.valueOf('E'), coilT4, Character.valueOf('C'), + OrePrefixes.circuit.get(Materials.Ultimate), Character.valueOf('W'), + OrePrefixes.cableGt04.get(Materials.Osmium), Character.valueOf('G'), + ALLOY.ZERON_100.getGear(1) }); } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechEnergyBuffer.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechEnergyBuffer.java index 1eed50db26..4d074619dc 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechEnergyBuffer.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechEnergyBuffer.java @@ -28,7 +28,8 @@ public class GregtechEnergyBuffer { private static void run1() { // itemBufferCore = new - // Item().setUnlocalizedName("itemBufferCore").setCreativeTab(AddToCreativeTab.tabMisc).setTextureName(CORE.MODID + ":itemBufferCore"); + // Item().setUnlocalizedName("itemBufferCore").setCreativeTab(AddToCreativeTab.tabMisc).setTextureName(CORE.MODID + // + ":itemBufferCore"); // Registry // GameRegistry.registerItem(itemBufferCore, "itemBufferCore"); @@ -67,9 +68,14 @@ public class GregtechEnergyBuffer { new GregtechMetaEnergyBuffer(779, "energybuffer.tier.09", "MAX Voltage Energy Buffer", 9, "", 1) .getStackForm(1L)); // Creative Buffer Has Special ID - GregtechItemList.Energy_Buffer_CREATIVE.set(new GregtechMetaCreativeEnergyBuffer( - 750, "energybuffer.tier.xx", "512V Creative Energy Buffer", 3, "", 0) - .getStackForm(1L)); + GregtechItemList.Energy_Buffer_CREATIVE.set( + new GregtechMetaCreativeEnergyBuffer( + 750, + "energybuffer.tier.xx", + "512V Creative Energy Buffer", + 3, + "", + 0).getStackForm(1L)); if (LoadedMods.CoFHCore && CORE.ConfigSwitches.enableMachine_RF_Convetor) { // RF Convertor Buffer Has Special ID @@ -80,174 +86,92 @@ public class GregtechEnergyBuffer { GT_ModHandler.addCraftingRecipe( GregtechItemList.Energy_Buffer_1by1_ULV.get(1L, new Object[0]), - GT_ModHandler.RecipeBits.DISMANTLEABLE - | GT_ModHandler.RecipeBits.NOT_REMOVABLE + GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED, - new Object[] { - "WTW", - "WMW", - Character.valueOf('M'), - ItemList.Hull_ULV, - Character.valueOf('W'), - OrePrefixes.wireGt08.get(Materials.Lead), - Character.valueOf('T'), - GregtechOreDictNames.buffer_core - }); + new Object[] { "WTW", "WMW", Character.valueOf('M'), ItemList.Hull_ULV, Character.valueOf('W'), + OrePrefixes.wireGt08.get(Materials.Lead), Character.valueOf('T'), + GregtechOreDictNames.buffer_core }); GT_ModHandler.addCraftingRecipe( GregtechItemList.Energy_Buffer_1by1_LV.get(1L, new Object[0]), - GT_ModHandler.RecipeBits.DISMANTLEABLE - | GT_ModHandler.RecipeBits.NOT_REMOVABLE + GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED, - new Object[] { - "WTW", - "WMW", - Character.valueOf('M'), - ItemList.Hull_LV, - Character.valueOf('W'), - OrePrefixes.wireGt08.get(Materials.Tin), - Character.valueOf('T'), - GregtechOreDictNames.buffer_core - }); + new Object[] { "WTW", "WMW", Character.valueOf('M'), ItemList.Hull_LV, Character.valueOf('W'), + OrePrefixes.wireGt08.get(Materials.Tin), Character.valueOf('T'), + GregtechOreDictNames.buffer_core }); GT_ModHandler.addCraftingRecipe( GregtechItemList.Energy_Buffer_1by1_MV.get(1L, new Object[0]), - GT_ModHandler.RecipeBits.DISMANTLEABLE - | GT_ModHandler.RecipeBits.NOT_REMOVABLE + GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED, - new Object[] { - "WTW", - "WMW", - Character.valueOf('M'), - ItemList.Hull_MV, - Character.valueOf('W'), - OrePrefixes.wireGt08.get(Materials.AnyCopper), - Character.valueOf('T'), - GregtechOreDictNames.buffer_core - }); + new Object[] { "WTW", "WMW", Character.valueOf('M'), ItemList.Hull_MV, Character.valueOf('W'), + OrePrefixes.wireGt08.get(Materials.AnyCopper), Character.valueOf('T'), + GregtechOreDictNames.buffer_core }); GT_ModHandler.addCraftingRecipe( GregtechItemList.Energy_Buffer_1by1_HV.get(1L, new Object[0]), - GT_ModHandler.RecipeBits.DISMANTLEABLE - | GT_ModHandler.RecipeBits.NOT_REMOVABLE + GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED, - new Object[] { - "WTW", - "WMW", - Character.valueOf('M'), - ItemList.Hull_HV, - Character.valueOf('W'), - OrePrefixes.wireGt08.get(Materials.Gold), - Character.valueOf('T'), - GregtechOreDictNames.buffer_core - }); + new Object[] { "WTW", "WMW", Character.valueOf('M'), ItemList.Hull_HV, Character.valueOf('W'), + OrePrefixes.wireGt08.get(Materials.Gold), Character.valueOf('T'), + GregtechOreDictNames.buffer_core }); GT_ModHandler.addCraftingRecipe( GregtechItemList.Energy_Buffer_1by1_EV.get(1L, new Object[0]), - GT_ModHandler.RecipeBits.DISMANTLEABLE - | GT_ModHandler.RecipeBits.NOT_REMOVABLE + GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED, - new Object[] { - "WTW", - "WMW", - Character.valueOf('M'), - ItemList.Hull_EV, - Character.valueOf('W'), - OrePrefixes.wireGt08.get(Materials.Aluminium), - Character.valueOf('T'), - GregtechOreDictNames.buffer_core - }); + new Object[] { "WTW", "WMW", Character.valueOf('M'), ItemList.Hull_EV, Character.valueOf('W'), + OrePrefixes.wireGt08.get(Materials.Aluminium), Character.valueOf('T'), + GregtechOreDictNames.buffer_core }); GT_ModHandler.addCraftingRecipe( GregtechItemList.Energy_Buffer_1by1_IV.get(1L, new Object[0]), - GT_ModHandler.RecipeBits.DISMANTLEABLE - | GT_ModHandler.RecipeBits.NOT_REMOVABLE + GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED, - new Object[] { - "WTW", - "WMW", - Character.valueOf('M'), - ItemList.Hull_IV, - Character.valueOf('W'), - OrePrefixes.wireGt08.get(Materials.Tungsten), - Character.valueOf('T'), - GregtechOreDictNames.buffer_core - }); + new Object[] { "WTW", "WMW", Character.valueOf('M'), ItemList.Hull_IV, Character.valueOf('W'), + OrePrefixes.wireGt08.get(Materials.Tungsten), Character.valueOf('T'), + GregtechOreDictNames.buffer_core }); GT_ModHandler.addCraftingRecipe( GregtechItemList.Energy_Buffer_1by1_LuV.get(1L, new Object[0]), - GT_ModHandler.RecipeBits.DISMANTLEABLE - | GT_ModHandler.RecipeBits.NOT_REMOVABLE + GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED, - new Object[] { - "WTW", - "WMW", - Character.valueOf('M'), - ItemList.Hull_LuV, - Character.valueOf('W'), - OrePrefixes.wireGt08.get(Materials.Osmium), - Character.valueOf('T'), - GregtechOreDictNames.buffer_core - }); + new Object[] { "WTW", "WMW", Character.valueOf('M'), ItemList.Hull_LuV, Character.valueOf('W'), + OrePrefixes.wireGt08.get(Materials.Osmium), Character.valueOf('T'), + GregtechOreDictNames.buffer_core }); GT_ModHandler.addCraftingRecipe( GregtechItemList.Energy_Buffer_1by1_ZPM.get(1L, new Object[0]), - GT_ModHandler.RecipeBits.DISMANTLEABLE - | GT_ModHandler.RecipeBits.NOT_REMOVABLE + GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED, - new Object[] { - "WTW", - "WMW", - Character.valueOf('M'), - ItemList.Hull_ZPM, - Character.valueOf('W'), - OrePrefixes.wireGt08.get(Materials.Osmium), - Character.valueOf('T'), - GregtechOreDictNames.buffer_core - }); + new Object[] { "WTW", "WMW", Character.valueOf('M'), ItemList.Hull_ZPM, Character.valueOf('W'), + OrePrefixes.wireGt08.get(Materials.Osmium), Character.valueOf('T'), + GregtechOreDictNames.buffer_core }); GT_ModHandler.addCraftingRecipe( GregtechItemList.Energy_Buffer_1by1_UV.get(1L, new Object[0]), - GT_ModHandler.RecipeBits.DISMANTLEABLE - | GT_ModHandler.RecipeBits.NOT_REMOVABLE + GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED, - new Object[] { - "WTW", - "WMW", - Character.valueOf('M'), - ItemList.Hull_UV, - Character.valueOf('W'), - OrePrefixes.wireGt08.get(Materials.Osmium), - Character.valueOf('T'), - GregtechOreDictNames.buffer_core - }); + new Object[] { "WTW", "WMW", Character.valueOf('M'), ItemList.Hull_UV, Character.valueOf('W'), + OrePrefixes.wireGt08.get(Materials.Osmium), Character.valueOf('T'), + GregtechOreDictNames.buffer_core }); GT_ModHandler.addCraftingRecipe( GregtechItemList.Energy_Buffer_1by1_MAX.get(1L, new Object[0]), - GT_ModHandler.RecipeBits.DISMANTLEABLE - | GT_ModHandler.RecipeBits.NOT_REMOVABLE + GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED, - new Object[] { - "WTW", - "WMW", - Character.valueOf('M'), - ItemList.Hull_MAX, - Character.valueOf('W'), - OrePrefixes.wireGt08.get(Materials.Superconductor), - Character.valueOf('T'), - GregtechOreDictNames.buffer_core - }); - /*GT_ModHandler.addCraftingRecipe( - GregtechItemList.Energy_Buffer_1by1_MAX.get(1L, new Object[0]), - GT_ModHandler.RecipeBits.DISMANTLEABLE - | GT_ModHandler.RecipeBits.NOT_REMOVABLE - | GT_ModHandler.RecipeBits.REVERSIBLE - | GT_ModHandler.RecipeBits.BUFFERED, new Object[] { - "WTW", "WMW", Character.valueOf('M'), - ItemList.Hull_MAX, Character.valueOf('W'), - OrePrefixes.wireGt08.get(Materials.Superconductor), - Character.valueOf('T'), GregtechOreDictNames.buffer_core });*/ + new Object[] { "WTW", "WMW", Character.valueOf('M'), ItemList.Hull_MAX, Character.valueOf('W'), + OrePrefixes.wireGt08.get(Materials.Superconductor), Character.valueOf('T'), + GregtechOreDictNames.buffer_core }); + /* + * GT_ModHandler.addCraftingRecipe( GregtechItemList.Energy_Buffer_1by1_MAX.get(1L, new Object[0]), + * GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | + * GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED, new Object[] { "WTW", "WMW", + * Character.valueOf('M'), ItemList.Hull_MAX, Character.valueOf('W'), + * OrePrefixes.wireGt08.get(Materials.Superconductor), Character.valueOf('T'), GregtechOreDictNames.buffer_core + * }); + */ } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechFactoryGradeReplacementMultis.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechFactoryGradeReplacementMultis.java index f07091e481..f3d5a5b479 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechFactoryGradeReplacementMultis.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechFactoryGradeReplacementMultis.java @@ -23,21 +23,27 @@ public class GregtechFactoryGradeReplacementMultis { GregtechItemList.Machine_Adv_ImplosionCompressor.set( new GregtechMetaTileEntity_Adv_Implosion(964, "multimachine.adv.implosioncompressor", "Density^2") .getStackForm(1L)); - GregtechItemList.Industrial_Cryogenic_Freezer.set(new GregtechMetaTileEntity_IndustrialVacuumFreezer( - 910, "multimachine.adv.industrialfreezer", "Cryogenic Freezer") - .getStackForm(1L)); + GregtechItemList.Industrial_Cryogenic_Freezer.set( + new GregtechMetaTileEntity_IndustrialVacuumFreezer( + 910, + "multimachine.adv.industrialfreezer", + "Cryogenic Freezer").getStackForm(1L)); GregtechItemList.FusionComputer_UV2.set( new GregtechMetaTileEntity_Adv_Fusion_MK4(965, "fusioncomputer.tier.09", "FusionTech MK IV") .getStackForm(1L)); // 31021 - GregtechItemList.Machine_Adv_DistillationTower.set(new GregtechMetaTileEntity_Adv_DistillationTower( - 31021, "multimachine.adv.distillationtower", "Dangote Distillus") - .getStackForm(1L)); + GregtechItemList.Machine_Adv_DistillationTower.set( + new GregtechMetaTileEntity_Adv_DistillationTower( + 31021, + "multimachine.adv.distillationtower", + "Dangote Distillus").getStackForm(1L)); if (CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK) { - GregtechItemList.Machine_Adv_AssemblyLine.set(new GregtechMetaTileEntity_Adv_AssemblyLine( - 31024, "multimachine.adv.assemblyline", "Compound Fabricator") - .getStackForm(1L)); + GregtechItemList.Machine_Adv_AssemblyLine.set( + new GregtechMetaTileEntity_Adv_AssemblyLine( + 31024, + "multimachine.adv.assemblyline", + "Compound Fabricator").getStackForm(1L)); } } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechFluidReactor.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechFluidReactor.java index 81420275da..ebc6be40c9 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechFluidReactor.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechFluidReactor.java @@ -5,17 +5,13 @@ public class GregtechFluidReactor { public static void run() { /* - * GregtechItemList.FluidReactor_LV .set(new - * GregtechMetaTileEntity_ChemicalReactor(31021, "chemicalplant.01.tier.01", - * "Chemical Plant I", 1) .getStackForm(1L)); GregtechItemList.FluidReactor_HV - * .set(new GregtechMetaTileEntity_ChemicalReactor(31022, - * "chemicalplant.01.tier.02", "Chemical Plant II", 3) .getStackForm(1L)); - * GregtechItemList.FluidReactor_IV .set(new - * GregtechMetaTileEntity_ChemicalReactor(31023, "chemicalplant.01.tier.03", - * "Chemical Plant III", 5) .getStackForm(1L)); - * GregtechItemList.FluidReactor_ZPM .set(new - * GregtechMetaTileEntity_ChemicalReactor(31024, "chemicalplant.01.tier.04", - * "Chemical Plant IV", 7) .getStackForm(1L)); + * GregtechItemList.FluidReactor_LV .set(new GregtechMetaTileEntity_ChemicalReactor(31021, + * "chemicalplant.01.tier.01", "Chemical Plant I", 1) .getStackForm(1L)); GregtechItemList.FluidReactor_HV + * .set(new GregtechMetaTileEntity_ChemicalReactor(31022, "chemicalplant.01.tier.02", "Chemical Plant II", 3) + * .getStackForm(1L)); GregtechItemList.FluidReactor_IV .set(new GregtechMetaTileEntity_ChemicalReactor(31023, + * "chemicalplant.01.tier.03", "Chemical Plant III", 5) .getStackForm(1L)); GregtechItemList.FluidReactor_ZPM + * .set(new GregtechMetaTileEntity_ChemicalReactor(31024, "chemicalplant.01.tier.04", "Chemical Plant IV", 7) + * .getStackForm(1L)); */ } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechGeneratorsULV.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechGeneratorsULV.java index f93f6e165a..5593f7a239 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechGeneratorsULV.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechGeneratorsULV.java @@ -12,11 +12,15 @@ import gtPlusPlus.xmod.gregtech.common.tileentities.generators.ULV.GT_MetaTileEn import gtPlusPlus.xmod.gregtech.common.tileentities.generators.ULV.GT_MetaTileEntity_ULV_SteamTurbine; public class GregtechGeneratorsULV { + public static void run() { - GregtechItemList.Generator_Diesel_ULV.set(new GT_MetaTileEntity_ULV_CombustionGenerator( - 960, "basicgenerator.diesel.tier.00", "Simple Combustion Generator", 0) - .getStackForm(1L)); + GregtechItemList.Generator_Diesel_ULV.set( + new GT_MetaTileEntity_ULV_CombustionGenerator( + 960, + "basicgenerator.diesel.tier.00", + "Simple Combustion Generator", + 0).getStackForm(1L)); GregtechItemList.Generator_Gas_Turbine_ULV.set( new GT_MetaTileEntity_ULV_GasTurbine(961, "basicgenerator.gas.tier.00", "Simple Gas Turbine", 0) .getStackForm(1L)); @@ -25,56 +29,24 @@ public class GregtechGeneratorsULV { .getStackForm(1L)); GT_ModHandler.addCraftingRecipe( - GregtechItemList.Generator_Diesel_ULV.get(1L, new Object[0]), bitsd, new Object[] { - "PCP", - "EME", - "GWG", - 'M', - ItemList.Hull_ULV, - 'P', - GregtechItemList.Electric_Piston_ULV, - 'E', - GregtechItemList.Electric_Motor_ULV, - 'C', - OrePrefixes.circuit.get(Materials.Primitive), - 'W', - OrePrefixes.cableGt01.get(Materials.RedAlloy), - 'G', - OrePrefixes.gearGt.get(Materials.Bronze) - }); + GregtechItemList.Generator_Diesel_ULV.get(1L, new Object[0]), + bitsd, + new Object[] { "PCP", "EME", "GWG", 'M', ItemList.Hull_ULV, 'P', GregtechItemList.Electric_Piston_ULV, + 'E', GregtechItemList.Electric_Motor_ULV, 'C', OrePrefixes.circuit.get(Materials.Primitive), + 'W', OrePrefixes.cableGt01.get(Materials.RedAlloy), 'G', + OrePrefixes.gearGt.get(Materials.Bronze) }); GT_ModHandler.addCraftingRecipe( - GregtechItemList.Generator_Gas_Turbine_ULV.get(1L, new Object[0]), bitsd, new Object[] { - "CRC", - "RMR", - "EWE", - 'M', - ItemList.Hull_ULV, - 'E', - GregtechItemList.Electric_Motor_ULV, - 'R', - OrePrefixes.rotor.get(Materials.Tin), - 'C', - OrePrefixes.circuit.get(Materials.Primitive), - 'W', - OrePrefixes.cableGt01.get(Materials.RedAlloy) - }); + GregtechItemList.Generator_Gas_Turbine_ULV.get(1L, new Object[0]), + bitsd, + new Object[] { "CRC", "RMR", "EWE", 'M', ItemList.Hull_ULV, 'E', GregtechItemList.Electric_Motor_ULV, + 'R', OrePrefixes.rotor.get(Materials.Tin), 'C', OrePrefixes.circuit.get(Materials.Primitive), + 'W', OrePrefixes.cableGt01.get(Materials.RedAlloy) }); GT_ModHandler.addCraftingRecipe( - GregtechItemList.Generator_Steam_Turbine_ULV.get(1L, new Object[0]), bitsd, new Object[] { - "PCP", - "RMR", - "EWE", - 'M', - ItemList.Hull_ULV, - 'E', - GregtechItemList.Electric_Motor_ULV, - 'R', - OrePrefixes.rotor.get(Materials.Tin), - 'C', - OrePrefixes.circuit.get(Materials.Primitive), - 'W', - OrePrefixes.cableGt01.get(Materials.RedAlloy), - 'P', - OrePrefixes.pipeMedium.get(Materials.Copper) - }); + GregtechItemList.Generator_Steam_Turbine_ULV.get(1L, new Object[0]), + bitsd, + new Object[] { "PCP", "RMR", "EWE", 'M', ItemList.Hull_ULV, 'E', GregtechItemList.Electric_Motor_ULV, + 'R', OrePrefixes.rotor.get(Materials.Tin), 'C', OrePrefixes.circuit.get(Materials.Primitive), + 'W', OrePrefixes.cableGt01.get(Materials.RedAlloy), 'P', + OrePrefixes.pipeMedium.get(Materials.Copper) }); } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechGeothermalThermalGenerator.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechGeothermalThermalGenerator.java index cb8dfaf0c1..5a1638509c 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechGeothermalThermalGenerator.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechGeothermalThermalGenerator.java @@ -1,5 +1,7 @@ package gtPlusPlus.xmod.gregtech.registration.gregtech; +import net.minecraft.item.ItemStack; + import gregtech.api.enums.ItemList; import gregtech.api.enums.Materials; import gregtech.api.enums.OrePrefixes; @@ -11,7 +13,6 @@ import gtPlusPlus.core.material.ALLOY; import gtPlusPlus.core.recipe.common.CI; import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; import gtPlusPlus.xmod.gregtech.common.tileentities.generators.GregtechMetaTileEntityGeothermalGenerator; -import net.minecraft.item.ItemStack; public class GregtechGeothermalThermalGenerator { @@ -25,88 +26,58 @@ public class GregtechGeothermalThermalGenerator { } private static void run1() { - GregtechItemList.Geothermal_Engine_EV.set(new GregtechMetaTileEntityGeothermalGenerator( - 830, "advancedgenerator.geothermalFuel.tier.01", "Basic Geothermal Engine", 4) - .getStackForm(1L)); - GregtechItemList.Geothermal_Engine_IV.set(new GregtechMetaTileEntityGeothermalGenerator( - 831, "advancedgenerator.geothermalFuel.tier.02", "Turbo Geothermal Engine", 5) - .getStackForm(1L)); - GregtechItemList.Geothermal_Engine_LuV.set(new GregtechMetaTileEntityGeothermalGenerator( - 832, "advancedgenerator.geothermalFuel.tier.03", "Vulcan Geothermal Engine", 6) - .getStackForm(1L)); + GregtechItemList.Geothermal_Engine_EV.set( + new GregtechMetaTileEntityGeothermalGenerator( + 830, + "advancedgenerator.geothermalFuel.tier.01", + "Basic Geothermal Engine", + 4).getStackForm(1L)); + GregtechItemList.Geothermal_Engine_IV.set( + new GregtechMetaTileEntityGeothermalGenerator( + 831, + "advancedgenerator.geothermalFuel.tier.02", + "Turbo Geothermal Engine", + 5).getStackForm(1L)); + GregtechItemList.Geothermal_Engine_LuV.set( + new GregtechMetaTileEntityGeothermalGenerator( + 832, + "advancedgenerator.geothermalFuel.tier.03", + "Vulcan Geothermal Engine", + 6).getStackForm(1L)); GT_ModHandler.addCraftingRecipe( GregtechItemList.Geothermal_Engine_EV.get(1L, new Object[0]), - GT_ModHandler.RecipeBits.DISMANTLEABLE - | GT_ModHandler.RecipeBits.NOT_REMOVABLE + GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED, - new Object[] { - "CEC", - "GMG", - "PWP", - Character.valueOf('M'), - ItemList.Hull_EV, - Character.valueOf('P'), - ItemList.Electric_Piston_EV, - Character.valueOf('E'), - ItemList.Electric_Motor_EV, - Character.valueOf('C'), - OrePrefixes.circuit.get(Materials.Ultimate), - Character.valueOf('W'), - OrePrefixes.cableGt04.get(Materials.Aluminium), - Character.valueOf('G'), - ALLOY.TANTALLOY_61.getGear(1) - }); + new Object[] { "CEC", "GMG", "PWP", Character.valueOf('M'), ItemList.Hull_EV, Character.valueOf('P'), + ItemList.Electric_Piston_EV, Character.valueOf('E'), ItemList.Electric_Motor_EV, + Character.valueOf('C'), OrePrefixes.circuit.get(Materials.Ultimate), Character.valueOf('W'), + OrePrefixes.cableGt04.get(Materials.Aluminium), Character.valueOf('G'), + ALLOY.TANTALLOY_61.getGear(1) }); GT_ModHandler.addCraftingRecipe( GregtechItemList.Geothermal_Engine_IV.get(1L, new Object[0]), - GT_ModHandler.RecipeBits.DISMANTLEABLE - | GT_ModHandler.RecipeBits.NOT_REMOVABLE + GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED, - new Object[] { - "CEC", - "GMG", - "PWP", - Character.valueOf('M'), - ItemList.Hull_IV, - Character.valueOf('P'), - ItemList.Electric_Piston_IV, - Character.valueOf('E'), - ItemList.Electric_Motor_IV, - Character.valueOf('C'), - OrePrefixes.circuit.get(Materials.Superconductor), - Character.valueOf('W'), - OrePrefixes.cableGt04.get(Materials.Platinum), - Character.valueOf('G'), - ALLOY.STELLITE.getGear(1) - }); + new Object[] { "CEC", "GMG", "PWP", Character.valueOf('M'), ItemList.Hull_IV, Character.valueOf('P'), + ItemList.Electric_Piston_IV, Character.valueOf('E'), ItemList.Electric_Motor_IV, + Character.valueOf('C'), OrePrefixes.circuit.get(Materials.Superconductor), + Character.valueOf('W'), OrePrefixes.cableGt04.get(Materials.Platinum), Character.valueOf('G'), + ALLOY.STELLITE.getGear(1) }); final ItemStack INGREDIENT_1 = CI.electricPiston_LuV; final ItemStack INGREDIENT_2 = CI.electricMotor_LuV; GT_ModHandler.addCraftingRecipe( GregtechItemList.Geothermal_Engine_LuV.get(1L, new Object[0]), - GT_ModHandler.RecipeBits.DISMANTLEABLE - | GT_ModHandler.RecipeBits.NOT_REMOVABLE + GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED, - new Object[] { - "CEC", - "GMG", - "PWP", - Character.valueOf('M'), - ItemList.Hull_LuV, - Character.valueOf('P'), - INGREDIENT_1, - Character.valueOf('E'), - INGREDIENT_2, - Character.valueOf('C'), - OrePrefixes.circuit.get(Materials.Infinite), - Character.valueOf('W'), - OrePrefixes.cableGt04.get(Materials.Tungsten), - Character.valueOf('G'), - ALLOY.ZERON_100.getGear(1) - }); + new Object[] { "CEC", "GMG", "PWP", Character.valueOf('M'), ItemList.Hull_LuV, Character.valueOf('P'), + INGREDIENT_1, Character.valueOf('E'), INGREDIENT_2, Character.valueOf('C'), + OrePrefixes.circuit.get(Materials.Infinite), Character.valueOf('W'), + OrePrefixes.cableGt04.get(Materials.Tungsten), Character.valueOf('G'), + ALLOY.ZERON_100.getGear(1) }); } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechHiAmpTransformer.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechHiAmpTransformer.java index 0e4e6a280b..02a28e5b1f 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechHiAmpTransformer.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechHiAmpTransformer.java @@ -2,6 +2,8 @@ package gtPlusPlus.xmod.gregtech.registration.gregtech; import static gtPlusPlus.core.lib.CORE.GTNH; +import net.minecraft.item.ItemStack; + import gregtech.api.enums.ItemList; import gregtech.api.enums.Materials; import gregtech.api.enums.OrePrefixes; @@ -11,14 +13,12 @@ import gtPlusPlus.core.util.minecraft.ItemUtils; import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMetaTransformerHiAmp; import gtPlusPlus.xmod.gregtech.common.StaticFields59; -import net.minecraft.item.ItemStack; public class GregtechHiAmpTransformer { public static void run() { - long bitsd = GT_ModHandler.RecipeBits.DISMANTLEABLE - | GT_ModHandler.RecipeBits.NOT_REMOVABLE + long bitsd = GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED; int mID = 877; @@ -29,90 +29,90 @@ public class GregtechHiAmpTransformer { mHammerName = "Mallet"; } - GregtechItemList.Transformer_HA_LV_ULV.set(new GregtechMetaTransformerHiAmp( + GregtechItemList.Transformer_HA_LV_ULV.set( + new GregtechMetaTransformerHiAmp( mID++, "transformer.ha.tier.00", "ULV Hi-Amp Transformer", 0, - "LV -> ULV (Use Soft " + mHammerName + " to invert)") - .getStackForm(1L)); - GregtechItemList.Transformer_HA_MV_LV.set(new GregtechMetaTransformerHiAmp( + "LV -> ULV (Use Soft " + mHammerName + " to invert)").getStackForm(1L)); + GregtechItemList.Transformer_HA_MV_LV.set( + new GregtechMetaTransformerHiAmp( mID++, "transformer.ha.tier.01", "LV Hi-Amp Transformer", 1, - "MV -> LV (Use Soft " + mHammerName + " to invert)") - .getStackForm(1L)); - GregtechItemList.Transformer_HA_HV_MV.set(new GregtechMetaTransformerHiAmp( + "MV -> LV (Use Soft " + mHammerName + " to invert)").getStackForm(1L)); + GregtechItemList.Transformer_HA_HV_MV.set( + new GregtechMetaTransformerHiAmp( mID++, "transformer.ha.tier.02", "MV Hi-Amp Transformer", 2, - "HV -> MV (Use Soft " + mHammerName + " to invert)") - .getStackForm(1L)); - GregtechItemList.Transformer_HA_EV_HV.set(new GregtechMetaTransformerHiAmp( + "HV -> MV (Use Soft " + mHammerName + " to invert)").getStackForm(1L)); + GregtechItemList.Transformer_HA_EV_HV.set( + new GregtechMetaTransformerHiAmp( mID++, "transformer.ha.tier.03", "HV Hi-Amp Transformer", 3, - "EV -> HV (Use Soft " + mHammerName + " to invert)") - .getStackForm(1L)); - GregtechItemList.Transformer_HA_IV_EV.set(new GregtechMetaTransformerHiAmp( + "EV -> HV (Use Soft " + mHammerName + " to invert)").getStackForm(1L)); + GregtechItemList.Transformer_HA_IV_EV.set( + new GregtechMetaTransformerHiAmp( mID++, "transformer.ha.tier.04", "EV Hi-Amp Transformer", 4, - "IV -> EV (Use Soft " + mHammerName + " to invert)") - .getStackForm(1L)); - GregtechItemList.Transformer_HA_LuV_IV.set(new GregtechMetaTransformerHiAmp( + "IV -> EV (Use Soft " + mHammerName + " to invert)").getStackForm(1L)); + GregtechItemList.Transformer_HA_LuV_IV.set( + new GregtechMetaTransformerHiAmp( mID++, "transformer.ha.tier.05", "IV Hi-Amp Transformer", 5, - "LuV -> IV (Use Soft " + mHammerName + " to invert)") - .getStackForm(1L)); - GregtechItemList.Transformer_HA_ZPM_LuV.set(new GregtechMetaTransformerHiAmp( + "LuV -> IV (Use Soft " + mHammerName + " to invert)").getStackForm(1L)); + GregtechItemList.Transformer_HA_ZPM_LuV.set( + new GregtechMetaTransformerHiAmp( mID++, "transformer.ha.tier.06", "LuV Hi-Amp Transformer", 6, - "ZPM -> LuV (Use Soft " + mHammerName + " to invert)") - .getStackForm(1L)); - GregtechItemList.Transformer_HA_UV_ZPM.set(new GregtechMetaTransformerHiAmp( + "ZPM -> LuV (Use Soft " + mHammerName + " to invert)").getStackForm(1L)); + GregtechItemList.Transformer_HA_UV_ZPM.set( + new GregtechMetaTransformerHiAmp( mID++, "transformer.ha.tier.07", "ZPM Hi-Amp Transformer", 7, - "UV -> ZPM (Use Soft " + mHammerName + " to invert)") - .getStackForm(1L)); + "UV -> ZPM (Use Soft " + mHammerName + " to invert)").getStackForm(1L)); if (!GTNH) { - GregtechItemList.Transformer_HA_MAX_UV.set(new GregtechMetaTransformerHiAmp( + GregtechItemList.Transformer_HA_MAX_UV.set( + new GregtechMetaTransformerHiAmp( mID++, "transformer.ha.tier.08", "UV Hi-Amp Transformer", 8, - "Any Voltage -> UV (Use Soft " + mHammerName + " to invert)") - .getStackForm(1L)); + "Any Voltage -> UV (Use Soft " + mHammerName + " to invert)").getStackForm(1L)); } else { - GregtechItemList.Transformer_HA_MAX_UV.set(new GregtechMetaTransformerHiAmp( + GregtechItemList.Transformer_HA_MAX_UV.set( + new GregtechMetaTransformerHiAmp( mID++, "transformer.ha.tier.08", "UV Hi-Amp Transformer", 8, - "UHV -> UV (Use Soft " + mHammerName + " to invert)") - .getStackForm(1L)); + "UHV -> UV (Use Soft " + mHammerName + " to invert)").getStackForm(1L)); } ItemStack mItem_1; ItemStack mItem_2; ItemStack mItem_3; if (CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK) { - mItem_1 = ItemUtils.simpleMetaStack( - ItemUtils.getSimpleStack(StaticFields59.getBlockCasings5()).getItem(), 3, 1); - mItem_2 = ItemUtils.simpleMetaStack( - ItemUtils.getSimpleStack(StaticFields59.getBlockCasings5()).getItem(), 4, 1); - mItem_3 = ItemUtils.simpleMetaStack( - ItemUtils.getSimpleStack(StaticFields59.getBlockCasings5()).getItem(), 9, 1); + mItem_1 = ItemUtils + .simpleMetaStack(ItemUtils.getSimpleStack(StaticFields59.getBlockCasings5()).getItem(), 3, 1); + mItem_2 = ItemUtils + .simpleMetaStack(ItemUtils.getSimpleStack(StaticFields59.getBlockCasings5()).getItem(), 4, 1); + mItem_3 = ItemUtils + .simpleMetaStack(ItemUtils.getSimpleStack(StaticFields59.getBlockCasings5()).getItem(), 9, 1); } else { mItem_1 = ItemList.Circuit_Elite.get(1); mItem_2 = ItemList.Circuit_Master.get(1); @@ -121,246 +121,126 @@ public class GregtechHiAmpTransformer { if (!GTNH) { GT_ModHandler.addCraftingRecipe( - GregtechItemList.Transformer_HA_LV_ULV.get(1L, new Object[0]), bitsd, new Object[] { - " BB", - "CM ", - " BB", - Character.valueOf('M'), - ItemList.Hull_ULV, - Character.valueOf('C'), - OrePrefixes.wireGt04.get(Materials.Tin), - Character.valueOf('B'), - OrePrefixes.wireGt04.get(Materials.Lead) - }); - GT_ModHandler.addCraftingRecipe( - GregtechItemList.Transformer_HA_MV_LV.get(1L, new Object[0]), bitsd, new Object[] { - " BB", - "CM ", - " BB", - Character.valueOf('M'), - ItemList.Hull_LV, - Character.valueOf('C'), - OrePrefixes.wireGt04.get(Materials.Copper), - Character.valueOf('B'), - OrePrefixes.wireGt04.get(Materials.Tin) - }); - GT_ModHandler.addCraftingRecipe( - GregtechItemList.Transformer_HA_HV_MV.get(1L, new Object[0]), bitsd, new Object[] { - " BB", - "CM ", - " BB", - Character.valueOf('M'), - ItemList.Hull_MV, - Character.valueOf('C'), - OrePrefixes.wireGt04.get(Materials.Gold), - Character.valueOf('B'), - OrePrefixes.wireGt04.get(Materials.AnnealedCopper) - }); - GT_ModHandler.addCraftingRecipe( - GregtechItemList.Transformer_HA_EV_HV.get(1L, new Object[0]), bitsd, new Object[] { - "KBB", - "CM ", - "KBB", - Character.valueOf('M'), - ItemList.Hull_HV, - Character.valueOf('C'), - OrePrefixes.wireGt04.get(Materials.Aluminium), - Character.valueOf('B'), - OrePrefixes.wireGt04.get(Materials.Gold), - Character.valueOf('K'), - ItemList.Casing_Coil_Cupronickel - }); - GT_ModHandler.addCraftingRecipe( - GregtechItemList.Transformer_HA_IV_EV.get(1L, new Object[0]), bitsd, new Object[] { - "KBB", - "CM ", - "KBB", - Character.valueOf('M'), - ItemList.Hull_EV, - Character.valueOf('C'), - OrePrefixes.wireGt04.get(Materials.Tungsten), - Character.valueOf('B'), - OrePrefixes.wireGt04.get(Materials.Aluminium), - Character.valueOf('K'), - ItemList.Casing_Coil_Kanthal - }); - GT_ModHandler.addCraftingRecipe( - GregtechItemList.Transformer_HA_LuV_IV.get(1L, new Object[0]), bitsd, new Object[] { - "KBB", - "CM ", - "KBB", - Character.valueOf('M'), - ItemList.Hull_IV, - Character.valueOf('C'), - OrePrefixes.wireGt04.get(Materials.VanadiumGallium), - Character.valueOf('B'), - OrePrefixes.wireGt04.get(Materials.Tungsten), - Character.valueOf('K'), - ItemList.Casing_Coil_Nichrome - }); - GT_ModHandler.addCraftingRecipe( - GregtechItemList.Transformer_HA_ZPM_LuV.get(1L, new Object[0]), bitsd, new Object[] { - "KBB", - "CM ", - "KBB", - Character.valueOf('M'), - ItemList.Hull_LuV, - Character.valueOf('C'), - OrePrefixes.wireGt04.get(Materials.Naquadah), - Character.valueOf('B'), - OrePrefixes.wireGt04.get(Materials.VanadiumGallium), - Character.valueOf('K'), - mItem_1 - }); - GT_ModHandler.addCraftingRecipe( - GregtechItemList.Transformer_HA_UV_ZPM.get(1L, new Object[0]), bitsd, new Object[] { - "KBB", - "CM ", - "KBB", - Character.valueOf('M'), - ItemList.Hull_ZPM, - Character.valueOf('C'), - OrePrefixes.wireGt04.get(Materials.NaquadahAlloy), - Character.valueOf('B'), - OrePrefixes.wireGt04.get(Materials.Naquadah), - Character.valueOf('K'), - mItem_2 - }); - GT_ModHandler.addCraftingRecipe( - GregtechItemList.Transformer_HA_MAX_UV.get(1L, new Object[0]), bitsd, new Object[] { - "KBB", - "CM ", - "KBB", - Character.valueOf('M'), - ItemList.Hull_UV, - Character.valueOf('C'), - OrePrefixes.wireGt04.get(Materials.Bedrockium), - Character.valueOf('B'), - OrePrefixes.wireGt04.get(Materials.NaquadahAlloy), - Character.valueOf('K'), - mItem_3 - }); + GregtechItemList.Transformer_HA_LV_ULV.get(1L, new Object[0]), + bitsd, + new Object[] { " BB", "CM ", " BB", Character.valueOf('M'), ItemList.Hull_ULV, + Character.valueOf('C'), OrePrefixes.wireGt04.get(Materials.Tin), Character.valueOf('B'), + OrePrefixes.wireGt04.get(Materials.Lead) }); + GT_ModHandler.addCraftingRecipe( + GregtechItemList.Transformer_HA_MV_LV.get(1L, new Object[0]), + bitsd, + new Object[] { " BB", "CM ", " BB", Character.valueOf('M'), ItemList.Hull_LV, + Character.valueOf('C'), OrePrefixes.wireGt04.get(Materials.Copper), Character.valueOf('B'), + OrePrefixes.wireGt04.get(Materials.Tin) }); + GT_ModHandler.addCraftingRecipe( + GregtechItemList.Transformer_HA_HV_MV.get(1L, new Object[0]), + bitsd, + new Object[] { " BB", "CM ", " BB", Character.valueOf('M'), ItemList.Hull_MV, + Character.valueOf('C'), OrePrefixes.wireGt04.get(Materials.Gold), Character.valueOf('B'), + OrePrefixes.wireGt04.get(Materials.AnnealedCopper) }); + GT_ModHandler.addCraftingRecipe( + GregtechItemList.Transformer_HA_EV_HV.get(1L, new Object[0]), + bitsd, + new Object[] { "KBB", "CM ", "KBB", Character.valueOf('M'), ItemList.Hull_HV, + Character.valueOf('C'), OrePrefixes.wireGt04.get(Materials.Aluminium), + Character.valueOf('B'), OrePrefixes.wireGt04.get(Materials.Gold), Character.valueOf('K'), + ItemList.Casing_Coil_Cupronickel }); + GT_ModHandler.addCraftingRecipe( + GregtechItemList.Transformer_HA_IV_EV.get(1L, new Object[0]), + bitsd, + new Object[] { "KBB", "CM ", "KBB", Character.valueOf('M'), ItemList.Hull_EV, + Character.valueOf('C'), OrePrefixes.wireGt04.get(Materials.Tungsten), + Character.valueOf('B'), OrePrefixes.wireGt04.get(Materials.Aluminium), + Character.valueOf('K'), ItemList.Casing_Coil_Kanthal }); + GT_ModHandler.addCraftingRecipe( + GregtechItemList.Transformer_HA_LuV_IV.get(1L, new Object[0]), + bitsd, + new Object[] { "KBB", "CM ", "KBB", Character.valueOf('M'), ItemList.Hull_IV, + Character.valueOf('C'), OrePrefixes.wireGt04.get(Materials.VanadiumGallium), + Character.valueOf('B'), OrePrefixes.wireGt04.get(Materials.Tungsten), + Character.valueOf('K'), ItemList.Casing_Coil_Nichrome }); + GT_ModHandler.addCraftingRecipe( + GregtechItemList.Transformer_HA_ZPM_LuV.get(1L, new Object[0]), + bitsd, + new Object[] { "KBB", "CM ", "KBB", Character.valueOf('M'), ItemList.Hull_LuV, + Character.valueOf('C'), OrePrefixes.wireGt04.get(Materials.Naquadah), + Character.valueOf('B'), OrePrefixes.wireGt04.get(Materials.VanadiumGallium), + Character.valueOf('K'), mItem_1 }); + GT_ModHandler.addCraftingRecipe( + GregtechItemList.Transformer_HA_UV_ZPM.get(1L, new Object[0]), + bitsd, + new Object[] { "KBB", "CM ", "KBB", Character.valueOf('M'), ItemList.Hull_ZPM, + Character.valueOf('C'), OrePrefixes.wireGt04.get(Materials.NaquadahAlloy), + Character.valueOf('B'), OrePrefixes.wireGt04.get(Materials.Naquadah), + Character.valueOf('K'), mItem_2 }); + GT_ModHandler.addCraftingRecipe( + GregtechItemList.Transformer_HA_MAX_UV.get(1L, new Object[0]), + bitsd, + new Object[] { "KBB", "CM ", "KBB", Character.valueOf('M'), ItemList.Hull_UV, + Character.valueOf('C'), OrePrefixes.wireGt04.get(Materials.Bedrockium), + Character.valueOf('B'), OrePrefixes.wireGt04.get(Materials.NaquadahAlloy), + Character.valueOf('K'), mItem_3 }); } else { GT_ModHandler.addCraftingRecipe( - GregtechItemList.Transformer_HA_LV_ULV.get(1L, new Object[0]), bitsd, new Object[] { - " BB", - "CM ", - " BB", - Character.valueOf('M'), - ItemList.Transformer_LV_ULV, - Character.valueOf('C'), - OrePrefixes.wireGt04.get(Materials.Tin), - Character.valueOf('B'), - OrePrefixes.wireGt04.get(Materials.Lead) - }); - GT_ModHandler.addCraftingRecipe( - GregtechItemList.Transformer_HA_MV_LV.get(1L, new Object[0]), bitsd, new Object[] { - " BB", - "CM ", - " BB", - Character.valueOf('M'), - ItemList.Transformer_MV_LV, - Character.valueOf('C'), - OrePrefixes.wireGt04.get(Materials.AnyCopper), - Character.valueOf('B'), - OrePrefixes.wireGt04.get(Materials.Tin) - }); - GT_ModHandler.addCraftingRecipe( - GregtechItemList.Transformer_HA_HV_MV.get(1L, new Object[0]), bitsd, new Object[] { - " BB", - "CM ", - " BB", - Character.valueOf('M'), - ItemList.Transformer_HV_MV, - Character.valueOf('C'), - OrePrefixes.wireGt04.get(Materials.Gold), - Character.valueOf('B'), - OrePrefixes.wireGt04.get(Materials.AnyCopper) - }); - GT_ModHandler.addCraftingRecipe( - GregtechItemList.Transformer_HA_EV_HV.get(1L, new Object[0]), bitsd, new Object[] { - "KBB", - "CM ", - "KBB", - Character.valueOf('M'), - ItemList.Transformer_EV_HV, - Character.valueOf('C'), - OrePrefixes.wireGt04.get(Materials.Aluminium), - Character.valueOf('B'), - OrePrefixes.wireGt04.get(Materials.Gold), - Character.valueOf('K'), - ItemList.Casing_Coil_Cupronickel - }); - GT_ModHandler.addCraftingRecipe( - GregtechItemList.Transformer_HA_IV_EV.get(1L, new Object[0]), bitsd, new Object[] { - "KBB", - "CM ", - "KBB", - Character.valueOf('M'), - ItemList.Transformer_IV_EV, - Character.valueOf('C'), - OrePrefixes.wireGt04.get(Materials.Tungsten), - Character.valueOf('B'), - OrePrefixes.wireGt04.get(Materials.Aluminium), - Character.valueOf('K'), - ItemList.Casing_Coil_Kanthal - }); - GT_ModHandler.addCraftingRecipe( - GregtechItemList.Transformer_HA_LuV_IV.get(1L, new Object[0]), bitsd, new Object[] { - "KBB", - "CM ", - "KBB", - Character.valueOf('M'), - ItemList.Transformer_LuV_IV, - Character.valueOf('C'), - OrePrefixes.wireGt04.get(Materials.VanadiumGallium), - Character.valueOf('B'), - OrePrefixes.wireGt04.get(Materials.Tungsten), - Character.valueOf('K'), - ItemList.Casing_Coil_Nichrome - }); - GT_ModHandler.addCraftingRecipe( - GregtechItemList.Transformer_HA_ZPM_LuV.get(1L, new Object[0]), bitsd, new Object[] { - "KBB", - "CM ", - "KBB", - Character.valueOf('M'), - ItemList.Transformer_ZPM_LuV, - Character.valueOf('C'), - OrePrefixes.wireGt04.get(Materials.Naquadah), - Character.valueOf('B'), - OrePrefixes.wireGt04.get(Materials.VanadiumGallium), - Character.valueOf('K'), - mItem_1 - }); - GT_ModHandler.addCraftingRecipe( - GregtechItemList.Transformer_HA_UV_ZPM.get(1L, new Object[0]), bitsd, new Object[] { - "KBB", - "CM ", - "KBB", - Character.valueOf('M'), - ItemList.Transformer_UV_ZPM, - Character.valueOf('C'), - OrePrefixes.wireGt04.get(Materials.NaquadahAlloy), - Character.valueOf('B'), - OrePrefixes.wireGt04.get(Materials.Naquadah), - Character.valueOf('K'), - mItem_2 - }); - GT_ModHandler.addCraftingRecipe( - GregtechItemList.Transformer_HA_MAX_UV.get(1L, new Object[0]), bitsd, new Object[] { - "KBB", - "CM ", - "KBB", - Character.valueOf('M'), - ItemList.Transformer_MAX_UV, - Character.valueOf('C'), - OrePrefixes.wireGt04.get(Materials.Bedrockium), - Character.valueOf('B'), - OrePrefixes.wireGt04.get(Materials.NaquadahAlloy), - Character.valueOf('K'), - mItem_3 - }); + GregtechItemList.Transformer_HA_LV_ULV.get(1L, new Object[0]), + bitsd, + new Object[] { " BB", "CM ", " BB", Character.valueOf('M'), ItemList.Transformer_LV_ULV, + Character.valueOf('C'), OrePrefixes.wireGt04.get(Materials.Tin), Character.valueOf('B'), + OrePrefixes.wireGt04.get(Materials.Lead) }); + GT_ModHandler.addCraftingRecipe( + GregtechItemList.Transformer_HA_MV_LV.get(1L, new Object[0]), + bitsd, + new Object[] { " BB", "CM ", " BB", Character.valueOf('M'), ItemList.Transformer_MV_LV, + Character.valueOf('C'), OrePrefixes.wireGt04.get(Materials.AnyCopper), + Character.valueOf('B'), OrePrefixes.wireGt04.get(Materials.Tin) }); + GT_ModHandler.addCraftingRecipe( + GregtechItemList.Transformer_HA_HV_MV.get(1L, new Object[0]), + bitsd, + new Object[] { " BB", "CM ", " BB", Character.valueOf('M'), ItemList.Transformer_HV_MV, + Character.valueOf('C'), OrePrefixes.wireGt04.get(Materials.Gold), Character.valueOf('B'), + OrePrefixes.wireGt04.get(Materials.AnyCopper) }); + GT_ModHandler.addCraftingRecipe( + GregtechItemList.Transformer_HA_EV_HV.get(1L, new Object[0]), + bitsd, + new Object[] { "KBB", "CM ", "KBB", Character.valueOf('M'), ItemList.Transformer_EV_HV, + Character.valueOf('C'), OrePrefixes.wireGt04.get(Materials.Aluminium), + Character.valueOf('B'), OrePrefixes.wireGt04.get(Materials.Gold), Character.valueOf('K'), + ItemList.Casing_Coil_Cupronickel }); + GT_ModHandler.addCraftingRecipe( + GregtechItemList.Transformer_HA_IV_EV.get(1L, new Object[0]), + bitsd, + new Object[] { "KBB", "CM ", "KBB", Character.valueOf('M'), ItemList.Transformer_IV_EV, + Character.valueOf('C'), OrePrefixes.wireGt04.get(Materials.Tungsten), + Character.valueOf('B'), OrePrefixes.wireGt04.get(Materials.Aluminium), + Character.valueOf('K'), ItemList.Casing_Coil_Kanthal }); + GT_ModHandler.addCraftingRecipe( + GregtechItemList.Transformer_HA_LuV_IV.get(1L, new Object[0]), + bitsd, + new Object[] { "KBB", "CM ", "KBB", Character.valueOf('M'), ItemList.Transformer_LuV_IV, + Character.valueOf('C'), OrePrefixes.wireGt04.get(Materials.VanadiumGallium), + Character.valueOf('B'), OrePrefixes.wireGt04.get(Materials.Tungsten), + Character.valueOf('K'), ItemList.Casing_Coil_Nichrome }); + GT_ModHandler.addCraftingRecipe( + GregtechItemList.Transformer_HA_ZPM_LuV.get(1L, new Object[0]), + bitsd, + new Object[] { "KBB", "CM ", "KBB", Character.valueOf('M'), ItemList.Transformer_ZPM_LuV, + Character.valueOf('C'), OrePrefixes.wireGt04.get(Materials.Naquadah), + Character.valueOf('B'), OrePrefixes.wireGt04.get(Materials.VanadiumGallium), + Character.valueOf('K'), mItem_1 }); + GT_ModHandler.addCraftingRecipe( + GregtechItemList.Transformer_HA_UV_ZPM.get(1L, new Object[0]), + bitsd, + new Object[] { "KBB", "CM ", "KBB", Character.valueOf('M'), ItemList.Transformer_UV_ZPM, + Character.valueOf('C'), OrePrefixes.wireGt04.get(Materials.NaquadahAlloy), + Character.valueOf('B'), OrePrefixes.wireGt04.get(Materials.Naquadah), + Character.valueOf('K'), mItem_2 }); + GT_ModHandler.addCraftingRecipe( + GregtechItemList.Transformer_HA_MAX_UV.get(1L, new Object[0]), + bitsd, + new Object[] { "KBB", "CM ", "KBB", Character.valueOf('M'), ItemList.Transformer_MAX_UV, + Character.valueOf('C'), OrePrefixes.wireGt04.get(Materials.Bedrockium), + Character.valueOf('B'), OrePrefixes.wireGt04.get(Materials.NaquadahAlloy), + Character.valueOf('K'), mItem_3 }); } } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialAlloySmelter.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialAlloySmelter.java index a115160b51..0ee6ce78d4 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialAlloySmelter.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialAlloySmelter.java @@ -14,8 +14,10 @@ public class GregtechIndustrialAlloySmelter { } private static void run1() { - GregtechItemList.Industrial_AlloySmelter.set(new GregtechMetaTileEntity_IndustrialAlloySmelter( - 31023, "industrialalloysmelter.controller.tier.single", "Zyngen") - .getStackForm(1L)); + GregtechItemList.Industrial_AlloySmelter.set( + new GregtechMetaTileEntity_IndustrialAlloySmelter( + 31023, + "industrialalloysmelter.controller.tier.single", + "Zyngen").getStackForm(1L)); } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialArcFurnace.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialArcFurnace.java index e6afc8f352..95d80847af 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialArcFurnace.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialArcFurnace.java @@ -15,8 +15,10 @@ public class GregtechIndustrialArcFurnace { private static void run1() { // Industrial Arc Furnace Multiblock - GregtechItemList.Industrial_Arc_Furnace.set(new GregtechMetaTileEntity_IndustrialArcFurnace( - 862, "industrialarcfurnace.controller.tier.single", "High Current Industrial Arc Furnace") - .getStackForm(1L)); + GregtechItemList.Industrial_Arc_Furnace.set( + new GregtechMetaTileEntity_IndustrialArcFurnace( + 862, + "industrialarcfurnace.controller.tier.single", + "High Current Industrial Arc Furnace").getStackForm(1L)); } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialBlastSmelter.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialBlastSmelter.java index 2214aba514..f0a0bbd6aa 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialBlastSmelter.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialBlastSmelter.java @@ -19,11 +19,15 @@ public class GregtechIndustrialBlastSmelter { private static void run1() { // Industrial Alloy Blast Smelter Multiblock - GregtechItemList.Industrial_AlloyBlastSmelter.set(new GregtechMetaTileEntity_AlloyBlastSmelter( - 810, "industrialsalloyamelter.controller.tier.single", "Alloy Blast Smelter") - .getStackForm(1L)); - GregtechItemList.Mega_AlloyBlastSmelter.set(new GregTechMetaTileEntity_MegaAlloyBlastSmelter( - 31150, "industrialsalloyamelter.controller.tier.mega", "Mega Alloy Blast Smelter") - .getStackForm(1L)); + GregtechItemList.Industrial_AlloyBlastSmelter.set( + new GregtechMetaTileEntity_AlloyBlastSmelter( + 810, + "industrialsalloyamelter.controller.tier.single", + "Alloy Blast Smelter").getStackForm(1L)); + GregtechItemList.Mega_AlloyBlastSmelter.set( + new GregTechMetaTileEntity_MegaAlloyBlastSmelter( + 31150, + "industrialsalloyamelter.controller.tier.mega", + "Mega Alloy Blast Smelter").getStackForm(1L)); } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialCentrifuge.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialCentrifuge.java index 2a346a26c9..edeec33ec2 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialCentrifuge.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialCentrifuge.java @@ -18,8 +18,10 @@ public class GregtechIndustrialCentrifuge { private static void run1() { // Industrial Centrifuge Multiblock - GregtechItemList.Industrial_Centrifuge.set(new GregtechMetaTileEntity_IndustrialCentrifuge( - 790, "industrialcentrifuge.controller.tier.single", "Industrial Centrifuge") - .getStackForm(1L)); + GregtechItemList.Industrial_Centrifuge.set( + new GregtechMetaTileEntity_IndustrialCentrifuge( + 790, + "industrialcentrifuge.controller.tier.single", + "Industrial Centrifuge").getStackForm(1L)); } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialChisel.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialChisel.java index 5d5c4e43e1..feefd45619 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialChisel.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialChisel.java @@ -17,8 +17,10 @@ public class GregtechIndustrialChisel { new GregtechMetaTileEntity_AutoChisel(31068, "chisel.tier.03", "Precision Auto-Chisel", 3) .getStackForm(1L)); - GregtechItemList.Controller_IndustrialAutoChisel.set(new GregtechMetaTileEntity_IndustrialChisel( - 31069, "multimachine.adv.chisel", "Industrial 3D Copying Machine") - .getStackForm(1L)); + GregtechItemList.Controller_IndustrialAutoChisel.set( + new GregtechMetaTileEntity_IndustrialChisel( + 31069, + "multimachine.adv.chisel", + "Industrial 3D Copying Machine").getStackForm(1L)); } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialCokeOven.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialCokeOven.java index 578e4cd3fe..0f989692cc 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialCokeOven.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialCokeOven.java @@ -18,8 +18,10 @@ public class GregtechIndustrialCokeOven { private static void run1() { // Industrial Centrifuge Multiblock - GregtechItemList.Industrial_CokeOven.set(new GregtechMetaTileEntity_IndustrialCokeOven( - 791, "industrialcokeoven.controller.tier.single", "Industrial Coke Oven") - .getStackForm(1L)); + GregtechItemList.Industrial_CokeOven.set( + new GregtechMetaTileEntity_IndustrialCokeOven( + 791, + "industrialcokeoven.controller.tier.single", + "Industrial Coke Oven").getStackForm(1L)); } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialCuttingFactory.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialCuttingFactory.java index 118fa05099..ed7076b8a8 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialCuttingFactory.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialCuttingFactory.java @@ -18,8 +18,10 @@ public class GregtechIndustrialCuttingFactory { private static void run1() { // Industrial Wire Factory Multiblock - GregtechItemList.Industrial_CuttingFactoryController.set(new GregtechMetaTileEntity_IndustrialCuttingMachine( - 992, "industrialcuttingmachine.controller.tier.01", "Cutting Factory Controller") - .getStackForm(1L)); + GregtechItemList.Industrial_CuttingFactoryController.set( + new GregtechMetaTileEntity_IndustrialCuttingMachine( + 992, + "industrialcuttingmachine.controller.tier.01", + "Cutting Factory Controller").getStackForm(1L)); } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialElectrolyzer.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialElectrolyzer.java index 89f6f62ef9..99d13981e0 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialElectrolyzer.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialElectrolyzer.java @@ -18,8 +18,10 @@ public class GregtechIndustrialElectrolyzer { private static void run1() { // Industrial Electrolyzer Multiblock - GregtechItemList.Industrial_Electrolyzer.set(new GregtechMetaTileEntity_IndustrialElectrolyzer( - 796, "industrialelectrolyzer.controller.tier.single", "Industrial Electrolyzer") - .getStackForm(1L)); + GregtechItemList.Industrial_Electrolyzer.set( + new GregtechMetaTileEntity_IndustrialElectrolyzer( + 796, + "industrialelectrolyzer.controller.tier.single", + "Industrial Electrolyzer").getStackForm(1L)); } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialElementDuplicator.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialElementDuplicator.java index 705d5f02e9..8e1607087d 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialElementDuplicator.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialElementDuplicator.java @@ -14,8 +14,11 @@ public class GregtechIndustrialElementDuplicator { GregtechItemList.Controller_ElementalDuplicator.set( new GregtechMTE_ElementalDuplicator(31050, "gtpp.multimachine.replicator", "Elemental Duplicator") .getStackForm(1L)); - GregtechItemList.Hatch_Input_Elemental_Duplicator.set(new GT_MetaTileEntity_Hatch_ElementalDataOrbHolder( - 31051, "hatch.input_bus.elementalorbholder", "Data Orb Repository", 7) - .getStackForm(1L)); + GregtechItemList.Hatch_Input_Elemental_Duplicator.set( + new GT_MetaTileEntity_Hatch_ElementalDataOrbHolder( + 31051, + "hatch.input_bus.elementalorbholder", + "Data Orb Repository", + 7).getStackForm(1L)); } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialExtruder.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialExtruder.java index 40396ded0b..0a591a640b 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialExtruder.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialExtruder.java @@ -18,8 +18,10 @@ public class GregtechIndustrialExtruder { private static void run1() { // Industrial Presser Multiblock - GregtechItemList.Industrial_Extruder.set(new GregtechMetaTileEntity_IndustrialExtruder( - 859, "industrialextruder.controller.tier.single", "Industrial Extrusion Machine") - .getStackForm(1L)); + GregtechItemList.Industrial_Extruder.set( + new GregtechMetaTileEntity_IndustrialExtruder( + 859, + "industrialextruder.controller.tier.single", + "Industrial Extrusion Machine").getStackForm(1L)); } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialFishPond.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialFishPond.java index b37216b343..bc03c6e277 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialFishPond.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialFishPond.java @@ -16,8 +16,10 @@ public class GregtechIndustrialFishPond { } private static void run1() { - GregtechItemList.Industrial_FishingPond.set(new GregtechMetaTileEntity_IndustrialFishingPond( - 829, "industrial.fishpond.controller.tier.single", "Zhuhai - Fishing Port") - .getStackForm(1L)); + GregtechItemList.Industrial_FishingPond.set( + new GregtechMetaTileEntity_IndustrialFishingPond( + 829, + "industrial.fishpond.controller.tier.single", + "Zhuhai - Fishing Port").getStackForm(1L)); } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialFluidHeater.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialFluidHeater.java index a1eb79b5b1..878abd4409 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialFluidHeater.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialFluidHeater.java @@ -14,8 +14,10 @@ public class GregtechIndustrialFluidHeater { } private static void run1() { - GregtechItemList.Controller_IndustrialFluidHeater.set(new GregtechMetaTileEntity_IndustrialFluidHeater( - 31077, "industrialfluidheater.controller.tier.single", "Thermic Heating Device") - .getStackForm(1L)); + GregtechItemList.Controller_IndustrialFluidHeater.set( + new GregtechMetaTileEntity_IndustrialFluidHeater( + 31077, + "industrialfluidheater.controller.tier.single", + "Thermic Heating Device").getStackForm(1L)); } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialForgeHammer.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialForgeHammer.java index 2064d15c2b..67f95cbcda 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialForgeHammer.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialForgeHammer.java @@ -14,8 +14,10 @@ public class GregtechIndustrialForgeHammer { } private static void run1() { - GregtechItemList.Controller_IndustrialForgeHammer.set(new GregtechMetaTileEntity_IndustrialForgeHammer( - 31075, "industrialhammer.controller.tier.single", "Industrial Sledgehammer") - .getStackForm(1L)); + GregtechItemList.Controller_IndustrialForgeHammer.set( + new GregtechMetaTileEntity_IndustrialForgeHammer( + 31075, + "industrialhammer.controller.tier.single", + "Industrial Sledgehammer").getStackForm(1L)); } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialFuelRefinery.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialFuelRefinery.java index 29568c32cc..a73ad190ca 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialFuelRefinery.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialFuelRefinery.java @@ -18,8 +18,10 @@ public class GregtechIndustrialFuelRefinery { private static void run1() { // Industrial Maceration Stack Multiblock - GregtechItemList.Industrial_FuelRefinery.set(new GregtechMetaTileEntity_Refinery( - 835, "industrialrefinery.controller.tier.single", "Reactor Fuel Processing Plant") - .getStackForm(1L)); + GregtechItemList.Industrial_FuelRefinery.set( + new GregtechMetaTileEntity_Refinery( + 835, + "industrialrefinery.controller.tier.single", + "Reactor Fuel Processing Plant").getStackForm(1L)); } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialGeneratorArray.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialGeneratorArray.java index e9ad7309d3..e356de6398 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialGeneratorArray.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialGeneratorArray.java @@ -17,8 +17,10 @@ public class GregtechIndustrialGeneratorArray { private static void run1() { // Industrial Maceration Stack Multiblock - GregtechItemList.Generator_Array_Controller.set(new GregtechMetaTileEntityGeneratorArray( - 990, "generatorarray.controller.tier.01", "Large Generator Array") - .getStackForm(1L)); + GregtechItemList.Generator_Array_Controller.set( + new GregtechMetaTileEntityGeneratorArray( + 990, + "generatorarray.controller.tier.01", + "Large Generator Array").getStackForm(1L)); } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialMacerator.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialMacerator.java index 6ceb0cc089..9bcf0a44bb 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialMacerator.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialMacerator.java @@ -18,8 +18,10 @@ public class GregtechIndustrialMacerator { private static void run1() { // Industrial Maceration Stack Multiblock - GregtechItemList.Industrial_MacerationStack.set(new GregtechMetaTileEntity_IndustrialMacerator( - 797, "industrialmacerator.controller.tier.single", "Maceration Stack Controller") - .getStackForm(1L)); + GregtechItemList.Industrial_MacerationStack.set( + new GregtechMetaTileEntity_IndustrialMacerator( + 797, + "industrialmacerator.controller.tier.single", + "Maceration Stack Controller").getStackForm(1L)); } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialMassFabricator.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialMassFabricator.java index 6133919b30..997a5f7a7c 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialMassFabricator.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialMassFabricator.java @@ -1,5 +1,8 @@ package gtPlusPlus.xmod.gregtech.registration.gregtech; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidStack; + import gregtech.api.enums.GT_Values; import gregtech.api.enums.Materials; import gregtech.api.util.GTPP_Recipe; @@ -10,8 +13,6 @@ import gtPlusPlus.core.recipe.common.CI; import gtPlusPlus.core.util.minecraft.ItemUtils; import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production.GregtechMetaTileEntity_MassFabricator; -import net.minecraft.item.ItemStack; -import net.minecraftforge.fluids.FluidStack; public class GregtechIndustrialMassFabricator { @@ -27,9 +28,11 @@ public class GregtechIndustrialMassFabricator { private static void run1() { // Industrial Matter Fabricator Multiblock - GregtechItemList.Industrial_MassFab.set(new GregtechMetaTileEntity_MassFabricator( - 799, "industrialmassfab.controller.tier.single", "Matter Fabrication CPU") - .getStackForm(1L)); + GregtechItemList.Industrial_MassFab.set( + new GregtechMetaTileEntity_MassFabricator( + 799, + "industrialmassfab.controller.tier.single", + "Matter Fabrication CPU").getStackForm(1L)); } private static void generateRecipes() { @@ -39,24 +42,24 @@ public class GregtechIndustrialMassFabricator { // Basic UUA1 GT_Recipe UUA_From_Scrap = new GTPP_Recipe( false, - new ItemStack[] {CI.getNumberedCircuit(9), ItemUtils.getSimpleStack(getScrapPile(), 9)}, - new ItemStack[] {GT_Values.NI}, + new ItemStack[] { CI.getNumberedCircuit(9), ItemUtils.getSimpleStack(getScrapPile(), 9) }, + new ItemStack[] { GT_Values.NI }, null, null, - new FluidStack[] {GT_Values.NF}, - new FluidStack[] {Materials.UUAmplifier.getFluid(1)}, + new FluidStack[] { GT_Values.NF }, + new FluidStack[] { Materials.UUAmplifier.getFluid(1) }, 9 * 20, 32, 0); // Basic UUA2 GT_Recipe UUA_From_ScrapBoxes = new GTPP_Recipe( false, - new ItemStack[] {CI.getNumberedCircuit(19), ItemUtils.getSimpleStack(getScrapBox(), 1)}, - new ItemStack[] {GT_Values.NI}, + new ItemStack[] { CI.getNumberedCircuit(19), ItemUtils.getSimpleStack(getScrapBox(), 1) }, + new ItemStack[] { GT_Values.NI }, null, null, - new FluidStack[] {GT_Values.NF}, - new FluidStack[] {Materials.UUAmplifier.getFluid(1)}, + new FluidStack[] { GT_Values.NF }, + new FluidStack[] { Materials.UUAmplifier.getFluid(1) }, 9 * 20, 32, 0); @@ -68,12 +71,12 @@ public class GregtechIndustrialMassFabricator { // Basic UUM GT_Recipe generateUUM = new GTPP_Recipe( false, - new ItemStack[] {CI.getNumberedCircuit(1)}, - new ItemStack[] {GT_Values.NI}, + new ItemStack[] { CI.getNumberedCircuit(1) }, + new ItemStack[] { GT_Values.NI }, null, null, - new FluidStack[] {GT_Values.NF}, - new FluidStack[] {Materials.UUMatter.getFluid(1)}, + new FluidStack[] { GT_Values.NF }, + new FluidStack[] { Materials.UUMatter.getFluid(1) }, 160 * 20, 32, 0); @@ -81,12 +84,12 @@ public class GregtechIndustrialMassFabricator { // Basic UUM GT_Recipe generateUUMFromUUA = new GTPP_Recipe( false, - new ItemStack[] {CI.getNumberedCircuit(2)}, - new ItemStack[] {GT_Values.NI}, + new ItemStack[] { CI.getNumberedCircuit(2) }, + new ItemStack[] { GT_Values.NI }, null, null, - new FluidStack[] {Materials.UUAmplifier.getFluid(1)}, - new FluidStack[] {Materials.UUMatter.getFluid(1)}, + new FluidStack[] { Materials.UUAmplifier.getFluid(1) }, + new FluidStack[] { Materials.UUMatter.getFluid(1) }, 40 * 20, 32, 0); @@ -97,12 +100,12 @@ public class GregtechIndustrialMassFabricator { // Basic UUM GT_Recipe generateUUM_LV = new GTPP_Recipe( false, - new ItemStack[] {CI.getNumberedCircuit(1)}, - new ItemStack[] {GT_Values.NI}, + new ItemStack[] { CI.getNumberedCircuit(1) }, + new ItemStack[] { GT_Values.NI }, null, null, - new FluidStack[] {GT_Values.NF}, - new FluidStack[] {Materials.UUMatter.getFluid(1)}, + new FluidStack[] { GT_Values.NF }, + new FluidStack[] { Materials.UUMatter.getFluid(1) }, 160 * 20, 256, 0); @@ -110,12 +113,12 @@ public class GregtechIndustrialMassFabricator { // Basic UUM GT_Recipe generateUUMFromUUA_LV = new GTPP_Recipe( false, - new ItemStack[] {CI.getNumberedCircuit(2)}, - new ItemStack[] {GT_Values.NI}, + new ItemStack[] { CI.getNumberedCircuit(2) }, + new ItemStack[] { GT_Values.NI }, null, null, - new FluidStack[] {Materials.UUAmplifier.getFluid(1)}, - new FluidStack[] {Materials.UUMatter.getFluid(1)}, + new FluidStack[] { Materials.UUAmplifier.getFluid(1) }, + new FluidStack[] { Materials.UUMatter.getFluid(1) }, 40 * 20, 256, 0); @@ -124,8 +127,9 @@ public class GregtechIndustrialMassFabricator { GTPP_Recipe.GTPP_Recipe_Map.sMatterFab2Recipes.add(generateUUMFromUUA_LV); } - Logger.INFO("Generated " + GTPP_Recipe.GTPP_Recipe_Map.sMatterFab2Recipes.mRecipeList.size() - + " Matter Fabricator recipes."); + Logger.INFO( + "Generated " + GTPP_Recipe.GTPP_Recipe_Map.sMatterFab2Recipes.mRecipeList.size() + + " Matter Fabricator recipes."); } public static ItemStack getScrapPile() { diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialMixer.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialMixer.java index aaa39c906d..fe348b0982 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialMixer.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialMixer.java @@ -18,8 +18,10 @@ public class GregtechIndustrialMixer { private static void run1() { // Industrial Mixer Multiblock - GregtechItemList.Industrial_Mixer.set(new GregtechMetaTileEntity_IndustrialMixer( - 811, "industrialmixer.controller.tier.single", "Industrial Mixing Machine") - .getStackForm(1L)); + GregtechItemList.Industrial_Mixer.set( + new GregtechMetaTileEntity_IndustrialMixer( + 811, + "industrialmixer.controller.tier.single", + "Industrial Mixing Machine").getStackForm(1L)); } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialMultiMachine.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialMultiMachine.java index 06b18b3d7b..aa824c9cce 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialMultiMachine.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialMultiMachine.java @@ -17,8 +17,10 @@ public class GregtechIndustrialMultiMachine { } private static void run1() { - GregtechItemList.Industrial_MultiMachine.set(new GregtechMetaTileEntity_IndustrialMultiMachine( - 860, "industrialmultimachine.controller.tier.single", "Large Processing Factory") - .getStackForm(1L)); + GregtechItemList.Industrial_MultiMachine.set( + new GregtechMetaTileEntity_IndustrialMultiMachine( + 860, + "industrialmultimachine.controller.tier.single", + "Large Processing Factory").getStackForm(1L)); } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialMultiTank.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialMultiTank.java index f9662cfa0c..e17b8f22a2 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialMultiTank.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialMultiTank.java @@ -1,28 +1,10 @@ /* -package gtPlusPlus.xmod.gregtech.registration.gregtech; - - -public class GregtechIndustrialMultiTank { - - public static void run() { - if (gtPlusPlus.core.lib.LoadedMods.Gregtech) { - Logger.INFO("Gregtech5u Content | Registering Industrial Multitank controller blocks."); - if (CORE.ConfigSwitches.enableMultiblock_MultiTank) { - run1(); - } - } - - } - - private static void run1() { - GregtechItemList.Industrial_MultiTank - .set(new GregtechMetaTileEntity_MultiTank(827, "multitank.controller.tier.single", "Gregtech Multitank") - .getStackForm(1L)); - // GregtechItemList.Industrial_MultiTankDense.set(new - // GregtechMetaTileEntityMultiTankDense(828, - // "multitankdense.controller.tier.single", "Gregtech Dense - // Multitank").getStackForm(1L)); - - } -} -*/ + * package gtPlusPlus.xmod.gregtech.registration.gregtech; public class GregtechIndustrialMultiTank { public static void + * run() { if (gtPlusPlus.core.lib.LoadedMods.Gregtech) { + * Logger.INFO("Gregtech5u Content | Registering Industrial Multitank controller blocks."); if + * (CORE.ConfigSwitches.enableMultiblock_MultiTank) { run1(); } } } private static void run1() { + * GregtechItemList.Industrial_MultiTank .set(new GregtechMetaTileEntity_MultiTank(827, + * "multitank.controller.tier.single", "Gregtech Multitank") .getStackForm(1L)); // + * GregtechItemList.Industrial_MultiTankDense.set(new // GregtechMetaTileEntityMultiTankDense(828, // + * "multitankdense.controller.tier.single", "Gregtech Dense // Multitank").getStackForm(1L)); } } + */ diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialPlatePress.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialPlatePress.java index 2f73addbbd..5aeb63fcd0 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialPlatePress.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialPlatePress.java @@ -18,8 +18,10 @@ public class GregtechIndustrialPlatePress { private static void run1() { // Industrial Presser Multiblock - GregtechItemList.Industrial_PlatePress.set(new GregtechMetaTileEntity_IndustrialPlatePress( - 792, "industrialbender.controller.tier.single", "Industrial Material Press") - .getStackForm(1L)); + GregtechItemList.Industrial_PlatePress.set( + new GregtechMetaTileEntity_IndustrialPlatePress( + 792, + "industrialbender.controller.tier.single", + "Industrial Material Press").getStackForm(1L)); } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialRockBreaker.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialRockBreaker.java index c490ef2b81..b300a5e77c 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialRockBreaker.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialRockBreaker.java @@ -6,8 +6,10 @@ import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production.Gr public class GregtechIndustrialRockBreaker { public static void run() { - GregtechItemList.Controller_IndustrialRockBreaker.set(new GregtechMetaTileEntity_IndustrialRockBreaker( - 31065, "industrialrockcrusher.controller.tier.single", "Boldarnator") - .getStackForm(1L)); + GregtechItemList.Controller_IndustrialRockBreaker.set( + new GregtechMetaTileEntity_IndustrialRockBreaker( + 31065, + "industrialrockcrusher.controller.tier.single", + "Boldarnator").getStackForm(1L)); } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialSifter.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialSifter.java index c474b5f6c0..da538eb776 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialSifter.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialSifter.java @@ -17,8 +17,10 @@ public class GregtechIndustrialSifter { } private static void run1() { - GregtechItemList.Industrial_Sifter.set(new GregtechMetaTileEntity_IndustrialSifter( - 840, "industrialsifter.controller.tier.single", "Large Sifter Control Block") - .getStackForm(1L)); + GregtechItemList.Industrial_Sifter.set( + new GregtechMetaTileEntity_IndustrialSifter( + 840, + "industrialsifter.controller.tier.single", + "Large Sifter Control Block").getStackForm(1L)); } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialThermalCentrifuge.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialThermalCentrifuge.java index 00552d9f3a..ec647ba787 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialThermalCentrifuge.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialThermalCentrifuge.java @@ -17,8 +17,10 @@ public class GregtechIndustrialThermalCentrifuge { } private static void run1() { - GregtechItemList.Industrial_ThermalCentrifuge.set(new GregtechMetaTileEntity_IndustrialThermalCentrifuge( - 849, "industrialthermalcentrifuge.controller.tier.single", "Large Thermal Refinery") - .getStackForm(1L)); + GregtechItemList.Industrial_ThermalCentrifuge.set( + new GregtechMetaTileEntity_IndustrialThermalCentrifuge( + 849, + "industrialthermalcentrifuge.controller.tier.single", + "Large Thermal Refinery").getStackForm(1L)); } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialWashPlant.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialWashPlant.java index e1d48b3395..8093f1fcc1 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialWashPlant.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialWashPlant.java @@ -17,8 +17,10 @@ public class GregtechIndustrialWashPlant { } private static void run1() { - GregtechItemList.Industrial_WashPlant.set(new GregtechMetaTileEntity_IndustrialWashPlant( - 850, "industrialwashplant.controller.tier.single", "Ore Washing Plant") - .getStackForm(1L)); + GregtechItemList.Industrial_WashPlant.set( + new GregtechMetaTileEntity_IndustrialWashPlant( + 850, + "industrialwashplant.controller.tier.single", + "Ore Washing Plant").getStackForm(1L)); } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialWiremill.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialWiremill.java index 456b55bf7b..e16a6fe09e 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialWiremill.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialWiremill.java @@ -18,8 +18,10 @@ public class GregtechIndustrialWiremill { private static void run1() { // Industrial Wire Factory Multiblock - GregtechItemList.Industrial_WireFactory.set(new GregtechMetaTileEntity_IndustrialWireMill( - 798, "industrialwiremill.controller.tier.single", "Wire Factory Controller") - .getStackForm(1L)); + GregtechItemList.Industrial_WireFactory.set( + new GregtechMetaTileEntity_IndustrialWireMill( + 798, + "industrialwiremill.controller.tier.single", + "Wire Factory Controller").getStackForm(1L)); } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIronBlastFurnace.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIronBlastFurnace.java index 5a7b082dd5..c38e386c0f 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIronBlastFurnace.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIronBlastFurnace.java @@ -17,8 +17,10 @@ public class GregtechIronBlastFurnace { } private static void run1() { - GregtechItemList.Machine_Iron_BlastFurnace.set(new GregtechMetaTileEntity_IronBlastFurnace( - 768, "ironmachine.blastfurnace", "Iron Plated Blast Furnace") - .getStackForm(1L)); + GregtechItemList.Machine_Iron_BlastFurnace.set( + new GregtechMetaTileEntity_IronBlastFurnace( + 768, + "ironmachine.blastfurnace", + "Iron Plated Blast Furnace").getStackForm(1L)); } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechLargeTurbinesAndHeatExchanger.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechLargeTurbinesAndHeatExchanger.java index 05993e06a6..aebe678984 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechLargeTurbinesAndHeatExchanger.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechLargeTurbinesAndHeatExchanger.java @@ -34,10 +34,12 @@ public class GregtechLargeTurbinesAndHeatExchanger { new GT_MTE_LargeTurbine_SCSteam(31076, "multimachine.largerscturbine", "XL Turbo SC Steam Turbine") .getStackForm(1L)); } - GregtechItemList.Hatch_Turbine_Rotor.set( - new GT_MetaTileEntity_Hatch_Turbine(30010, "hatch.turbine", "Rotor Assembly", 8).getStackForm(1L)); - GregtechItemList.XL_HeatExchanger.set(new GregtechMetaTileEntity_Adv_HeatExchanger( - 31079, "multimachine.reallybigheatexchanger", "Whakawhiti Wera XL") - .getStackForm(1L)); + GregtechItemList.Hatch_Turbine_Rotor + .set(new GT_MetaTileEntity_Hatch_Turbine(30010, "hatch.turbine", "Rotor Assembly", 8).getStackForm(1L)); + GregtechItemList.XL_HeatExchanger.set( + new GregtechMetaTileEntity_Adv_HeatExchanger( + 31079, + "multimachine.reallybigheatexchanger", + "Whakawhiti Wera XL").getStackForm(1L)); } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechMiniRaFusion.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechMiniRaFusion.java index dead66b933..ca2b1237c3 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechMiniRaFusion.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechMiniRaFusion.java @@ -1,39 +1,13 @@ /* -package gtPlusPlus.xmod.gregtech.registration.gregtech; - - -public class GregtechMiniRaFusion { - - public static void run() { - // Register the Simple Fusion Entity. - GregtechItemList.Miniature_Fusion.set(new GregtechMTE_MiniFusionPlant(31015, "gtplusplus.fusion.single", "Helium Prime").getStackForm(1L)); - GregtechItemList.Plasma_Tank.set(new GT_MetaTileEntity_Hatch_Plasma(31016, "gtplusplus.tank.plasma", "Plasma Tank").getStackForm(1L)); - - } - - public static boolean generateSlowFusionrecipes() { - for (GT_Recipe x : GT_Recipe.GT_Recipe_Map.sFusionRecipes.mRecipeList){ - if (x.mEnabled) { - GT_Recipe y = x.copy(); - y.mDuration *= 16; - long z = y.mEUt * 4; - if (z > Integer.MAX_VALUE) { - y.mEnabled = false; - continue; - } - y.mEUt = (int) Math.min(Math.max(0, z), Integer.MAX_VALUE); - y.mCanBeBuffered = true; - GTPP_Recipe.GTPP_Recipe_Map.sSlowFusionRecipes.add(y); - } - } - int mRecipeCount = GTPP_Recipe.GTPP_Recipe_Map.sSlowFusionRecipes.mRecipeList.size(); - if (mRecipeCount > 0) { - Logger.INFO("[Pocket Fusion] Generated "+mRecipeCount+" recipes for the Pocket Fusion Reactor."); - return true; - } - return false; - } - - -} -*/ + * package gtPlusPlus.xmod.gregtech.registration.gregtech; public class GregtechMiniRaFusion { public static void run() + * { // Register the Simple Fusion Entity. GregtechItemList.Miniature_Fusion.set(new GregtechMTE_MiniFusionPlant(31015, + * "gtplusplus.fusion.single", "Helium Prime").getStackForm(1L)); GregtechItemList.Plasma_Tank.set(new + * GT_MetaTileEntity_Hatch_Plasma(31016, "gtplusplus.tank.plasma", "Plasma Tank").getStackForm(1L)); } public static + * boolean generateSlowFusionrecipes() { for (GT_Recipe x : GT_Recipe.GT_Recipe_Map.sFusionRecipes.mRecipeList){ if + * (x.mEnabled) { GT_Recipe y = x.copy(); y.mDuration *= 16; long z = y.mEUt * 4; if (z > Integer.MAX_VALUE) { + * y.mEnabled = false; continue; } y.mEUt = (int) Math.min(Math.max(0, z), Integer.MAX_VALUE); y.mCanBeBuffered = true; + * GTPP_Recipe.GTPP_Recipe_Map.sSlowFusionRecipes.add(y); } } int mRecipeCount = + * GTPP_Recipe.GTPP_Recipe_Map.sSlowFusionRecipes.mRecipeList.size(); if (mRecipeCount > 0) { + * Logger.INFO("[Pocket Fusion] Generated "+mRecipeCount+" recipes for the Pocket Fusion Reactor."); return true; } + * return false; } } + */ diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechMolecularTransformer.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechMolecularTransformer.java index 1e024389fe..7d1d77f1b4 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechMolecularTransformer.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechMolecularTransformer.java @@ -14,8 +14,10 @@ public class GregtechMolecularTransformer { } private static void run1() { - GregtechItemList.Controller_MolecularTransformer.set(new GregtechMetaTileEntity_IndustrialMolecularTransformer( - 31072, "moleculartransformer.controller.tier.single", "Molecular Transformer") - .getStackForm(1L)); + GregtechItemList.Controller_MolecularTransformer.set( + new GregtechMetaTileEntity_IndustrialMolecularTransformer( + 31072, + "moleculartransformer.controller.tier.single", + "Molecular Transformer").getStackForm(1L)); } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechNaqReactor.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechNaqReactor.java index db124f510a..c98b023b08 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechNaqReactor.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechNaqReactor.java @@ -1,21 +1,7 @@ /* -package gtPlusPlus.xmod.gregtech.registration.gregtech; - - -public class GregtechNaqReactor { - - public static void run() { - if (gtPlusPlus.core.lib.LoadedMods.Gregtech) { - Logger.INFO("Gregtech5u Content | Registering Futuristic Naquadah Reactor {LNR]."); - run1(); - } - - } - - private static void run1() { - // LFTR - GregtechItemList.Controller_Naq_Reactor.set(new GregtechMTE_LargeNaqReactor(970, "lnr.controller.single", "Naquadah Reactor Mark XII").getStackForm(1L)); - - } -} -*/ + * package gtPlusPlus.xmod.gregtech.registration.gregtech; public class GregtechNaqReactor { public static void run() { + * if (gtPlusPlus.core.lib.LoadedMods.Gregtech) { + * Logger.INFO("Gregtech5u Content | Registering Futuristic Naquadah Reactor {LNR]."); run1(); } } private static void + * run1() { // LFTR GregtechItemList.Controller_Naq_Reactor.set(new GregtechMTE_LargeNaqReactor(970, + * "lnr.controller.single", "Naquadah Reactor Mark XII").getStackForm(1L)); } } + */ diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechNitroDieselFix.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechNitroDieselFix.java index 63eb34e97f..3a632049a9 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechNitroDieselFix.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechNitroDieselFix.java @@ -1,5 +1,16 @@ package gtPlusPlus.xmod.gregtech.registration.gregtech; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.util.Arrays; +import java.util.Collection; +import java.util.List; + +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidStack; + +import org.apache.commons.lang3.reflect.FieldUtils; + import gregtech.GT_Mod; import gregtech.api.enums.*; import gregtech.api.objects.MaterialStack; @@ -12,14 +23,6 @@ import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.minecraft.ItemUtils; import gtPlusPlus.core.util.minecraft.MaterialUtils; import gtPlusPlus.core.util.reflect.ReflectionUtils; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; -import java.util.Arrays; -import java.util.Collection; -import java.util.List; -import net.minecraft.item.ItemStack; -import net.minecraftforge.fluids.FluidStack; -import org.apache.commons.lang3.reflect.FieldUtils; public class GregtechNitroDieselFix { @@ -79,9 +82,9 @@ public class GregtechNitroDieselFix { * Reflectively get all the values to maintain 5.08.xx compat */ GT_Recipe_Map recipeMapMultiblockChemReactor; - recipeMapMultiblockChemReactor = (GT_Recipe_Map) - FieldUtils.getDeclaredField(GT_Recipe_Map.class, "sMultiblockChemicalRecipes", true) - .get(null); + recipeMapMultiblockChemReactor = (GT_Recipe_Map) FieldUtils + .getDeclaredField(GT_Recipe_Map.class, "sMultiblockChemicalRecipes", true) + .get(null); /** * Do Recipe Stuff @@ -104,8 +107,9 @@ public class GregtechNitroDieselFix { } } } - Logger.INFO("[Nitro] Found " + mIndexSingle - + " single block Chemical Reactor recipes to remove."); + Logger.INFO( + "[Nitro] Found " + mIndexSingle + + " single block Chemical Reactor recipes to remove."); // Iterate Multi Block recipes for Nitro production. for (GT_Recipe rnd : xMulti) { @@ -115,8 +119,9 @@ public class GregtechNitroDieselFix { } } } - Logger.INFO("[Nitro] Found " + mIndexMulti - + " multi block Chemical Reactor recipes to remove."); + Logger.INFO( + "[Nitro] Found " + mIndexMulti + + " multi block Chemical Reactor recipes to remove."); // Remove Single Block recipes found. int mRemovedSingle = 0; @@ -141,12 +146,13 @@ public class GregtechNitroDieselFix { Materials mLightFuel = Materials.valueOf("LightFuel"); // Build a New Recipe set - Materials mFuels[] = {mLightFuel, Materials.Fuel}; + Materials mFuels[] = { mLightFuel, Materials.Fuel }; for (Materials fuel : mFuels) { boolean didAdd[] = new boolean[3]; Logger.INFO( "[Nitro] Getting ready to add back in the old nitro-diesel recipe to the mixer, using " - + fuel.mDefaultLocalName + " as the fuel input."); + + fuel.mDefaultLocalName + + " as the fuel input."); didAdd[0] = GT_Values.RA.addMixerRecipe( getCells(fuel, 4), getCells(mGlycerol, 1), @@ -177,15 +183,20 @@ public class GregtechNitroDieselFix { ItemList.Cell_Empty.get(1L), 20, 30); - Logger.INFO("[Nitro] Did the recipes add? 1: " + didAdd[0] + " | 2: " + didAdd[1] - + " | 3: " + didAdd[2]); + Logger.INFO( + "[Nitro] Did the recipes add? 1: " + didAdd[0] + + " | 2: " + + didAdd[1] + + " | 3: " + + didAdd[2]); } for (Materials fuel : mFuels) { boolean didAdd[] = new boolean[3]; Logger.INFO( "[Nitro] Getting ready to add back in the old nitro-diesel recipe to the chemical reactors, using " - + fuel.mDefaultLocalName + " as the fuel input."); + + fuel.mDefaultLocalName + + " as the fuel input."); didAdd[0] = GT_Values.RA.addChemicalRecipe( getCells(fuel, 4), getCells(mGlycerol, 1), @@ -207,8 +218,12 @@ public class GregtechNitroDieselFix { mNitroFix.getFluid(5000L), ItemList.Cell_Empty.get(1L), 20); - Logger.INFO("[Nitro] Did the recipes add? 1: " + didAdd[0] + " | 2: " + didAdd[1] - + " | 3: " + didAdd[2]); + Logger.INFO( + "[Nitro] Did the recipes add? 1: " + didAdd[0] + + " | 2: " + + didAdd[1] + + " | 3: " + + didAdd[2]); } Logger.INFO("[Nitro] Getting ready to add back in the old glycerol recipe!"); @@ -223,12 +238,8 @@ public class GregtechNitroDieselFix { } } } - } catch (IllegalArgumentException - | IllegalAccessException - | InstantiationException - | InvocationTargetException - | NoSuchMethodException - | SecurityException e) { + } catch (IllegalArgumentException | IllegalAccessException | InstantiationException + | InvocationTargetException | NoSuchMethodException | SecurityException e) { Logger.INFO("[Nitro] ================ Error ================"); e.printStackTrace(); Logger.INFO("[Nitro] ================ Error ================"); diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechPollutionDevices.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechPollutionDevices.java index 9b5968657f..348f50d3c1 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechPollutionDevices.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechPollutionDevices.java @@ -22,48 +22,80 @@ public class GregtechPollutionDevices { private static void run1() { if (CORE.ConfigSwitches.enableMachine_Pollution) { // 759 - GregtechItemList.Pollution_Detector.set(new GregtechMetaPollutionDetector( + GregtechItemList.Pollution_Detector.set( + new GregtechMetaPollutionDetector( 756, "pollutiondetector.01.tier.single", "Pollution Detection Device", 0, "Tells you if you're living in Gwalior yet.", - 0) - .getStackForm(1L)); - GregtechItemList.Pollution_Creator.set(new GregtechMetaPollutionCreator( - 951, "pollutioncreator.01.tier.single", "Smog Device", 4, "Polluting the skies.", 0) - .getStackForm(1L)); + 0).getStackForm(1L)); + GregtechItemList.Pollution_Creator.set( + new GregtechMetaPollutionCreator( + 951, + "pollutioncreator.01.tier.single", + "Smog Device", + 4, + "Polluting the skies.", + 0).getStackForm(1L)); - GregtechItemList.Pollution_Cleaner_ULV.set(new GregtechMetaAtmosphericReconditioner( - 757, "pollutioncleaner.01.tier.single", "Pollution Scrubber", 0) - .getStackForm(1L)); - GregtechItemList.Pollution_Cleaner_LV.set(new GregtechMetaAtmosphericReconditioner( - 758, "pollutioncleaner.02.tier.single", "Upgraded Pollution Scrubber", 1) - .getStackForm(1L)); - GregtechItemList.Pollution_Cleaner_MV.set(new GregtechMetaAtmosphericReconditioner( - 759, "pollutioncleaner.03.tier.single", "Advanced Pollution Scrubber", 2) - .getStackForm(1L)); - GregtechItemList.Pollution_Cleaner_HV.set(new GregtechMetaAtmosphericReconditioner( - 760, "pollutioncleaner.04.tier.single", "Precision Pollution Scrubber", 3) - .getStackForm(1L)); + GregtechItemList.Pollution_Cleaner_ULV.set( + new GregtechMetaAtmosphericReconditioner( + 757, + "pollutioncleaner.01.tier.single", + "Pollution Scrubber", + 0).getStackForm(1L)); + GregtechItemList.Pollution_Cleaner_LV.set( + new GregtechMetaAtmosphericReconditioner( + 758, + "pollutioncleaner.02.tier.single", + "Upgraded Pollution Scrubber", + 1).getStackForm(1L)); + GregtechItemList.Pollution_Cleaner_MV.set( + new GregtechMetaAtmosphericReconditioner( + 759, + "pollutioncleaner.03.tier.single", + "Advanced Pollution Scrubber", + 2).getStackForm(1L)); + GregtechItemList.Pollution_Cleaner_HV.set( + new GregtechMetaAtmosphericReconditioner( + 760, + "pollutioncleaner.04.tier.single", + "Precision Pollution Scrubber", + 3).getStackForm(1L)); GregtechItemList.Pollution_Cleaner_EV.set( new GregtechMetaAtmosphericReconditioner(761, "pollutioncleaner.05.tier.single", "Air Recycler", 4) .getStackForm(1L)); - GregtechItemList.Pollution_Cleaner_IV.set(new GregtechMetaAtmosphericReconditioner( - 762, "pollutioncleaner.06.tier.single", "Upgraded Air Recycler", 5) - .getStackForm(1L)); - GregtechItemList.Pollution_Cleaner_LuV.set(new GregtechMetaAtmosphericReconditioner( - 763, "pollutioncleaner.07.tier.single", "Advanced Air Recycler", 6) - .getStackForm(1L)); - GregtechItemList.Pollution_Cleaner_ZPM.set(new GregtechMetaAtmosphericReconditioner( - 764, "pollutioncleaner.08.tier.single", "Precision Air Recycler", 7) - .getStackForm(1L)); - GregtechItemList.Pollution_Cleaner_UV.set(new GregtechMetaAtmosphericReconditioner( - 765, "pollutioncleaner.09.tier.single", "Atmospheric Cleaner", 8) - .getStackForm(1L)); - GregtechItemList.Pollution_Cleaner_MAX.set(new GregtechMetaAtmosphericReconditioner( - 766, "pollutioncleaner.10.tier.single", "Biosphere Cleanser", 9) - .getStackForm(1L)); + GregtechItemList.Pollution_Cleaner_IV.set( + new GregtechMetaAtmosphericReconditioner( + 762, + "pollutioncleaner.06.tier.single", + "Upgraded Air Recycler", + 5).getStackForm(1L)); + GregtechItemList.Pollution_Cleaner_LuV.set( + new GregtechMetaAtmosphericReconditioner( + 763, + "pollutioncleaner.07.tier.single", + "Advanced Air Recycler", + 6).getStackForm(1L)); + GregtechItemList.Pollution_Cleaner_ZPM.set( + new GregtechMetaAtmosphericReconditioner( + 764, + "pollutioncleaner.08.tier.single", + "Precision Air Recycler", + 7).getStackForm(1L)); + GregtechItemList.Pollution_Cleaner_UV.set( + new GregtechMetaAtmosphericReconditioner( + 765, + "pollutioncleaner.09.tier.single", + "Atmospheric Cleaner", + 8).getStackForm(1L)); + GregtechItemList.Pollution_Cleaner_MAX.set( + new GregtechMetaAtmosphericReconditioner( + 766, + "pollutioncleaner.10.tier.single", + "Biosphere Cleanser", + 9).getStackForm(1L)); } } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechPowerBreakers.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechPowerBreakers.java index d1d6dd5f04..25fd245ba4 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechPowerBreakers.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechPowerBreakers.java @@ -17,35 +17,85 @@ public class GregtechPowerBreakers { private static void run1() { // 30200 int aStartID = 30400; - GregtechItemList.BreakerBox_ULV.set((new GT_MetaTileEntity_BasicBreaker( - aStartID++, "breaker.tier.00", "Ultra Low Voltage Breaker Box", 0, "", 16)) - .getStackForm(1L)); - GregtechItemList.BreakerBox_LV.set((new GT_MetaTileEntity_BasicBreaker( - aStartID++, "breaker.tier.01", "Low Voltage Breaker Box", 1, "", 16)) - .getStackForm(1L)); - GregtechItemList.BreakerBox_MV.set((new GT_MetaTileEntity_BasicBreaker( - aStartID++, "breaker.tier.02", "Medium Voltage Breaker Box", 2, "", 16)) - .getStackForm(1L)); - GregtechItemList.BreakerBox_HV.set((new GT_MetaTileEntity_BasicBreaker( - aStartID++, "breaker.tier.03", "High Voltage Breaker Box", 3, "", 16)) - .getStackForm(1L)); - GregtechItemList.BreakerBox_EV.set((new GT_MetaTileEntity_BasicBreaker( - aStartID++, "breaker.tier.04", "Extreme Voltage Breaker Box", 4, "", 16)) - .getStackForm(1L)); - GregtechItemList.BreakerBox_IV.set((new GT_MetaTileEntity_BasicBreaker( - aStartID++, "breaker.tier.05", "Insane Voltage Breaker Box", 5, "", 16)) - .getStackForm(1L)); - GregtechItemList.BreakerBox_LuV.set((new GT_MetaTileEntity_BasicBreaker( - aStartID++, "breaker.tier.06", "Ludicrous Voltage Breaker Box", 6, "", 16)) - .getStackForm(1L)); - GregtechItemList.BreakerBox_ZPM.set((new GT_MetaTileEntity_BasicBreaker( - aStartID++, "breaker.tier.07", "ZPM Voltage Breaker Box", 7, "", 16)) - .getStackForm(1L)); - GregtechItemList.BreakerBox_UV.set((new GT_MetaTileEntity_BasicBreaker( - aStartID++, "breaker.tier.08", "Ultimate Voltage Breaker Box", 8, "", 16)) - .getStackForm(1L)); - GregtechItemList.BreakerBox_MAX.set((new GT_MetaTileEntity_BasicBreaker( - aStartID++, "breaker.tier.09", GT_Values.VN[9] + " Breaker Box", 9, "", 16)) - .getStackForm(1L)); + GregtechItemList.BreakerBox_ULV.set( + (new GT_MetaTileEntity_BasicBreaker( + aStartID++, + "breaker.tier.00", + "Ultra Low Voltage Breaker Box", + 0, + "", + 16)).getStackForm(1L)); + GregtechItemList.BreakerBox_LV.set( + (new GT_MetaTileEntity_BasicBreaker( + aStartID++, + "breaker.tier.01", + "Low Voltage Breaker Box", + 1, + "", + 16)).getStackForm(1L)); + GregtechItemList.BreakerBox_MV.set( + (new GT_MetaTileEntity_BasicBreaker( + aStartID++, + "breaker.tier.02", + "Medium Voltage Breaker Box", + 2, + "", + 16)).getStackForm(1L)); + GregtechItemList.BreakerBox_HV.set( + (new GT_MetaTileEntity_BasicBreaker( + aStartID++, + "breaker.tier.03", + "High Voltage Breaker Box", + 3, + "", + 16)).getStackForm(1L)); + GregtechItemList.BreakerBox_EV.set( + (new GT_MetaTileEntity_BasicBreaker( + aStartID++, + "breaker.tier.04", + "Extreme Voltage Breaker Box", + 4, + "", + 16)).getStackForm(1L)); + GregtechItemList.BreakerBox_IV.set( + (new GT_MetaTileEntity_BasicBreaker( + aStartID++, + "breaker.tier.05", + "Insane Voltage Breaker Box", + 5, + "", + 16)).getStackForm(1L)); + GregtechItemList.BreakerBox_LuV.set( + (new GT_MetaTileEntity_BasicBreaker( + aStartID++, + "breaker.tier.06", + "Ludicrous Voltage Breaker Box", + 6, + "", + 16)).getStackForm(1L)); + GregtechItemList.BreakerBox_ZPM.set( + (new GT_MetaTileEntity_BasicBreaker( + aStartID++, + "breaker.tier.07", + "ZPM Voltage Breaker Box", + 7, + "", + 16)).getStackForm(1L)); + GregtechItemList.BreakerBox_UV.set( + (new GT_MetaTileEntity_BasicBreaker( + aStartID++, + "breaker.tier.08", + "Ultimate Voltage Breaker Box", + 8, + "", + 16)).getStackForm(1L)); + GregtechItemList.BreakerBox_MAX.set( + (new GT_MetaTileEntity_BasicBreaker( + aStartID++, + "breaker.tier.09", + GT_Values.VN[9] + " Breaker Box", + 9, + "", + 16)).getStackForm(1L)); } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechPowerSubStation.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechPowerSubStation.java index 17d89686a6..b9672c5382 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechPowerSubStation.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechPowerSubStation.java @@ -23,9 +23,11 @@ public class GregtechPowerSubStation { private static void run1() { // Steam Condensors - GregtechItemList.PowerSubStation.set(new GregtechMetaTileEntity_PowerSubStationController( - 812, "substation.01.input.single", "Power Station Control Node") - .getStackForm(1L)); + GregtechItemList.PowerSubStation.set( + new GregtechMetaTileEntity_PowerSubStationController( + 812, + "substation.01.input.single", + "Power Station Control Node").getStackForm(1L)); int tID = 886; GregtechItemList.Hatch_Input_Battery_MV.set( new GT_MetaTileEntity_Hatch_InputBattery(tID++, "hatch.input_battery.tier.00", "Charging Bus (MV)", 2) @@ -34,28 +36,34 @@ public class GregtechPowerSubStation { new GT_MetaTileEntity_Hatch_InputBattery(tID++, "hatch.input_battery.tier.01", "Charging Bus (EV)", 4) .getStackForm(1L)); - GregtechItemList.Hatch_Output_Battery_MV.set(new GT_MetaTileEntity_Hatch_OutputBattery( - tID++, "hatch.output_battery.tier.00", "Discharging Bus (MV)", 2) - .getStackForm(1L)); - GregtechItemList.Hatch_Output_Battery_EV.set(new GT_MetaTileEntity_Hatch_OutputBattery( - tID++, "hatch.output_battery.tier.01", "Discharging Bus (EV)", 4) - .getStackForm(1L)); + GregtechItemList.Hatch_Output_Battery_MV.set( + new GT_MetaTileEntity_Hatch_OutputBattery( + tID++, + "hatch.output_battery.tier.00", + "Discharging Bus (MV)", + 2).getStackForm(1L)); + GregtechItemList.Hatch_Output_Battery_EV.set( + new GT_MetaTileEntity_Hatch_OutputBattery( + tID++, + "hatch.output_battery.tier.01", + "Discharging Bus (EV)", + 4).getStackForm(1L)); GT_ModHandler.addCraftingRecipe( GregtechItemList.Hatch_Input_Battery_MV.get(1L, new Object[0]), CI.bitsd, - new Object[] {"C", "M", 'M', ItemList.Hull_MV, 'C', ItemList.Battery_Buffer_2by2_MV}); + new Object[] { "C", "M", 'M', ItemList.Hull_MV, 'C', ItemList.Battery_Buffer_2by2_MV }); GT_ModHandler.addCraftingRecipe( GregtechItemList.Hatch_Input_Battery_EV.get(1L, new Object[0]), CI.bitsd, - new Object[] {"C", "M", 'M', ItemList.Hull_EV, 'C', ItemList.Battery_Buffer_4by4_EV}); + new Object[] { "C", "M", 'M', ItemList.Hull_EV, 'C', ItemList.Battery_Buffer_4by4_EV }); GT_ModHandler.addCraftingRecipe( GregtechItemList.Hatch_Output_Battery_MV.get(1L, new Object[0]), CI.bitsd, - new Object[] {"M", "C", 'M', ItemList.Hull_MV, 'C', ItemList.Battery_Buffer_2by2_MV}); + new Object[] { "M", "C", 'M', ItemList.Hull_MV, 'C', ItemList.Battery_Buffer_2by2_MV }); GT_ModHandler.addCraftingRecipe( GregtechItemList.Hatch_Output_Battery_EV.get(1L, new Object[0]), CI.bitsd, - new Object[] {"M", "C", 'M', ItemList.Hull_EV, 'C', ItemList.Battery_Buffer_4by4_EV}); + new Object[] { "M", "C", 'M', ItemList.Hull_EV, 'C', ItemList.Battery_Buffer_4by4_EV }); } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechQuantumForceTransformer.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechQuantumForceTransformer.java index f7032838ab..392c6eced8 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechQuantumForceTransformer.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechQuantumForceTransformer.java @@ -11,9 +11,11 @@ public class GregtechQuantumForceTransformer { if (gtPlusPlus.core.lib.LoadedMods.Gregtech) { Logger.INFO("Gregtech5u Content | Registering Quantum Force Transformer Multiblock."); if (CORE.ConfigSwitches.enableMultiblock_QuantumForceTransformer) { - GregtechItemList.QuantumForceTransformer.set(new GregtechMetaTileEntity_QuantumForceTransformer( - 31151, "quantumforcetransformer.controller.tier.single", "Quantum Force Transformer") - .getStackForm(1L)); + GregtechItemList.QuantumForceTransformer.set( + new GregtechMetaTileEntity_QuantumForceTransformer( + 31151, + "quantumforcetransformer.controller.tier.single", + "Quantum Force Transformer").getStackForm(1L)); } } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechRTG.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechRTG.java index 91902396d9..40a0c5820f 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechRTG.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechRTG.java @@ -14,8 +14,11 @@ public class GregtechRTG { } private static void run1() { - GregtechItemList.RTG.set(new GregtechMetaTileEntity_RTG( - 869, "basicgenerator.rtg.tier.01", "Radioisotope Thermoelectric Generator", 3) - .getStackForm(1L)); + GregtechItemList.RTG.set( + new GregtechMetaTileEntity_RTG( + 869, + "basicgenerator.rtg.tier.01", + "Radioisotope Thermoelectric Generator", + 3).getStackForm(1L)); } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechRocketFuelGenerator.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechRocketFuelGenerator.java index 689cd53d54..6d48652202 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechRocketFuelGenerator.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechRocketFuelGenerator.java @@ -1,5 +1,7 @@ package gtPlusPlus.xmod.gregtech.registration.gregtech; +import net.minecraft.item.ItemStack; + import gregtech.api.enums.ItemList; import gregtech.api.enums.Materials; import gregtech.api.enums.OrePrefixes; @@ -13,7 +15,6 @@ import gtPlusPlus.core.util.minecraft.ItemUtils; import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; import gtPlusPlus.xmod.gregtech.common.tileentities.generators.GregtechMetaTileEntityRocketFuelGenerator; import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production.GregtechMetaTileEntity_LargeRocketEngine; -import net.minecraft.item.ItemStack; public class GregtechRocketFuelGenerator { @@ -27,203 +28,122 @@ public class GregtechRocketFuelGenerator { } private static void run1() { - GregtechItemList.Controller_RocketEngine.set(new GregtechMetaTileEntity_LargeRocketEngine( - 996, "gtpp.multimachine.rocketengine", "Rocketdyne F-1A Engine") - .getStackForm(1L)); + GregtechItemList.Controller_RocketEngine.set( + new GregtechMetaTileEntity_LargeRocketEngine( + 996, + "gtpp.multimachine.rocketengine", + "Rocketdyne F-1A Engine").getStackForm(1L)); - ItemList aDieselEngine = ItemUtils.getValueOfItemList( - "Machine_Multi_DieselEngine", ItemList.Machine_Multi_LargeBoiler_TungstenSteel); + ItemList aDieselEngine = ItemUtils + .getValueOfItemList("Machine_Multi_DieselEngine", ItemList.Machine_Multi_LargeBoiler_TungstenSteel); - GT_ModHandler.addCraftingRecipe(GregtechItemList.Controller_RocketEngine.get(1L), CI.bitsd, new Object[] { - "PCP", - "EME", - "GWG", - 'M', - aDieselEngine, - 'P', - ItemList.Electric_Piston_IV, - 'E', - ItemList.Field_Generator_EV, - 'C', - OrePrefixes.circuit.get(Materials.Master), - 'W', - OrePrefixes.cableGt08.get(Materials.Platinum), - 'G', - ALLOY.MARAGING350.getGear(1) - }); + GT_ModHandler.addCraftingRecipe( + GregtechItemList.Controller_RocketEngine.get(1L), + CI.bitsd, + new Object[] { "PCP", "EME", "GWG", 'M', aDieselEngine, 'P', ItemList.Electric_Piston_IV, 'E', + ItemList.Field_Generator_EV, 'C', OrePrefixes.circuit.get(Materials.Master), 'W', + OrePrefixes.cableGt08.get(Materials.Platinum), 'G', ALLOY.MARAGING350.getGear(1) }); - GT_ModHandler.addCraftingRecipe(GregtechItemList.Casing_RocketEngine.get(1L), CI.bitsd, new Object[] { - "PhP", - "RFR", - "PWP", - 'R', - OrePrefixes.pipeMedium.get(Materials.TungstenSteel), - 'F', - ItemList.Casing_RobustTungstenSteel, - 'P', - ALLOY.NITINOL_60.getGear(1), - 'W', - OrePrefixes.stickLong.get(Materials.TungstenSteel) - }); + GT_ModHandler.addCraftingRecipe( + GregtechItemList.Casing_RocketEngine.get(1L), + CI.bitsd, + new Object[] { "PhP", "RFR", "PWP", 'R', OrePrefixes.pipeMedium.get(Materials.TungstenSteel), 'F', + ItemList.Casing_RobustTungstenSteel, 'P', ALLOY.NITINOL_60.getGear(1), 'W', + OrePrefixes.stickLong.get(Materials.TungstenSteel) }); - GregtechItemList.Rocket_Engine_EV.set(new GregtechMetaTileEntityRocketFuelGenerator( - 793, "advancedgenerator.rocketFuel.tier.01", "Basic Rocket Engine", 4) - .getStackForm(1L)); - GregtechItemList.Rocket_Engine_IV.set(new GregtechMetaTileEntityRocketFuelGenerator( - 794, "advancedgenerator.rocketFuel.tier.02", "Advanced Rocket Engine", 5) - .getStackForm(1L)); - GregtechItemList.Rocket_Engine_LuV.set(new GregtechMetaTileEntityRocketFuelGenerator( - 795, "advancedgenerator.rocketFuel.tier.03", "Turbo Rocket Engine", 6) - .getStackForm(1L)); + GregtechItemList.Rocket_Engine_EV.set( + new GregtechMetaTileEntityRocketFuelGenerator( + 793, + "advancedgenerator.rocketFuel.tier.01", + "Basic Rocket Engine", + 4).getStackForm(1L)); + GregtechItemList.Rocket_Engine_IV.set( + new GregtechMetaTileEntityRocketFuelGenerator( + 794, + "advancedgenerator.rocketFuel.tier.02", + "Advanced Rocket Engine", + 5).getStackForm(1L)); + GregtechItemList.Rocket_Engine_LuV.set( + new GregtechMetaTileEntityRocketFuelGenerator( + 795, + "advancedgenerator.rocketFuel.tier.03", + "Turbo Rocket Engine", + 6).getStackForm(1L)); if (!CORE.GTNH) { GT_ModHandler.addCraftingRecipe( GregtechItemList.Rocket_Engine_EV.get(1L, new Object[0]), - GT_ModHandler.RecipeBits.DISMANTLEABLE - | GT_ModHandler.RecipeBits.NOT_REMOVABLE + GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED, - new Object[] { - "PCP", - "EME", - "GWG", - Character.valueOf('M'), - ItemList.Hull_EV, - Character.valueOf('P'), - ItemList.Electric_Piston_EV, - Character.valueOf('E'), - ItemList.Electric_Motor_EV, - Character.valueOf('C'), - OrePrefixes.circuit.get(Materials.Ultimate), - Character.valueOf('W'), - OrePrefixes.cableGt02.get(Materials.Aluminium), - Character.valueOf('G'), - ALLOY.TANTALLOY_61.getGear(1) - }); + new Object[] { "PCP", "EME", "GWG", Character.valueOf('M'), ItemList.Hull_EV, + Character.valueOf('P'), ItemList.Electric_Piston_EV, Character.valueOf('E'), + ItemList.Electric_Motor_EV, Character.valueOf('C'), + OrePrefixes.circuit.get(Materials.Ultimate), Character.valueOf('W'), + OrePrefixes.cableGt02.get(Materials.Aluminium), Character.valueOf('G'), + ALLOY.TANTALLOY_61.getGear(1) }); GT_ModHandler.addCraftingRecipe( GregtechItemList.Rocket_Engine_IV.get(1L, new Object[0]), - GT_ModHandler.RecipeBits.DISMANTLEABLE - | GT_ModHandler.RecipeBits.NOT_REMOVABLE + GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED, - new Object[] { - "PCP", - "EME", - "GWG", - Character.valueOf('M'), - ItemList.Hull_IV, - Character.valueOf('P'), - ItemList.Electric_Piston_IV, - Character.valueOf('E'), - ItemList.Electric_Motor_IV, - Character.valueOf('C'), - OrePrefixes.circuit.get(Materials.Superconductor), - Character.valueOf('W'), - OrePrefixes.cableGt02.get(Materials.Platinum), - Character.valueOf('G'), - ALLOY.STELLITE.getGear(1) - }); + new Object[] { "PCP", "EME", "GWG", Character.valueOf('M'), ItemList.Hull_IV, + Character.valueOf('P'), ItemList.Electric_Piston_IV, Character.valueOf('E'), + ItemList.Electric_Motor_IV, Character.valueOf('C'), + OrePrefixes.circuit.get(Materials.Superconductor), Character.valueOf('W'), + OrePrefixes.cableGt02.get(Materials.Platinum), Character.valueOf('G'), + ALLOY.STELLITE.getGear(1) }); } if (CORE.GTNH) { GT_ModHandler.addCraftingRecipe( GregtechItemList.Rocket_Engine_EV.get(1L, new Object[0]), - GT_ModHandler.RecipeBits.DISMANTLEABLE - | GT_ModHandler.RecipeBits.NOT_REMOVABLE + GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED, - new Object[] { - "PCP", - "EME", - "GWG", - Character.valueOf('M'), - ItemList.Hull_EV, - Character.valueOf('P'), - ItemList.Electric_Piston_EV, - Character.valueOf('E'), - ItemList.Electric_Motor_EV, - Character.valueOf('C'), - OrePrefixes.circuit.get(Materials.Elite), - Character.valueOf('W'), - OrePrefixes.cableGt02.get(Materials.Aluminium), - Character.valueOf('G'), - ALLOY.TANTALLOY_61.getGear(1) - }); + new Object[] { "PCP", "EME", "GWG", Character.valueOf('M'), ItemList.Hull_EV, + Character.valueOf('P'), ItemList.Electric_Piston_EV, Character.valueOf('E'), + ItemList.Electric_Motor_EV, Character.valueOf('C'), + OrePrefixes.circuit.get(Materials.Elite), Character.valueOf('W'), + OrePrefixes.cableGt02.get(Materials.Aluminium), Character.valueOf('G'), + ALLOY.TANTALLOY_61.getGear(1) }); GT_ModHandler.addCraftingRecipe( GregtechItemList.Rocket_Engine_IV.get(1L, new Object[0]), - GT_ModHandler.RecipeBits.DISMANTLEABLE - | GT_ModHandler.RecipeBits.NOT_REMOVABLE + GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED, - new Object[] { - "PCP", - "EME", - "GWG", - Character.valueOf('M'), - ItemList.Hull_IV, - Character.valueOf('P'), - ItemList.Electric_Piston_IV, - Character.valueOf('E'), - ItemList.Electric_Motor_IV, - Character.valueOf('C'), - OrePrefixes.circuit.get(Materials.Master), - Character.valueOf('W'), - OrePrefixes.cableGt02.get(Materials.Platinum), - Character.valueOf('G'), - ALLOY.STELLITE.getGear(1) - }); + new Object[] { "PCP", "EME", "GWG", Character.valueOf('M'), ItemList.Hull_IV, + Character.valueOf('P'), ItemList.Electric_Piston_IV, Character.valueOf('E'), + ItemList.Electric_Motor_IV, Character.valueOf('C'), + OrePrefixes.circuit.get(Materials.Master), Character.valueOf('W'), + OrePrefixes.cableGt02.get(Materials.Platinum), Character.valueOf('G'), + ALLOY.STELLITE.getGear(1) }); } final ItemStack INGREDIENT_1 = CI.electricPiston_LuV; final ItemStack INGREDIENT_2 = CI.electricMotor_LuV; if (!CORE.GTNH) { GT_ModHandler.addCraftingRecipe( GregtechItemList.Rocket_Engine_LuV.get(1L, new Object[0]), - GT_ModHandler.RecipeBits.DISMANTLEABLE - | GT_ModHandler.RecipeBits.NOT_REMOVABLE + GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED, - new Object[] { - "PCP", - "EME", - "GWG", - Character.valueOf('M'), - ItemList.Hull_LuV, - Character.valueOf('P'), - INGREDIENT_1, - Character.valueOf('E'), - INGREDIENT_2, - Character.valueOf('C'), - OrePrefixes.circuit.get(Materials.Infinite), - Character.valueOf('W'), - OrePrefixes.cableGt02.get(Materials.Tungsten), - Character.valueOf('G'), - ALLOY.ZERON_100.getGear(1) - }); + new Object[] { "PCP", "EME", "GWG", Character.valueOf('M'), ItemList.Hull_LuV, + Character.valueOf('P'), INGREDIENT_1, Character.valueOf('E'), INGREDIENT_2, + Character.valueOf('C'), OrePrefixes.circuit.get(Materials.Infinite), Character.valueOf('W'), + OrePrefixes.cableGt02.get(Materials.Tungsten), Character.valueOf('G'), + ALLOY.ZERON_100.getGear(1) }); } if (CORE.GTNH) { GT_ModHandler.addCraftingRecipe( GregtechItemList.Rocket_Engine_LuV.get(1L, new Object[0]), - GT_ModHandler.RecipeBits.DISMANTLEABLE - | GT_ModHandler.RecipeBits.NOT_REMOVABLE + GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED, - new Object[] { - "PCP", - "EME", - "GWG", - Character.valueOf('M'), - ItemList.Hull_LuV, - Character.valueOf('P'), - INGREDIENT_1, - Character.valueOf('E'), - INGREDIENT_2, - Character.valueOf('C'), - OrePrefixes.circuit.get(Materials.Ultimate), - Character.valueOf('W'), - OrePrefixes.cableGt02.get(Materials.Tungsten), - Character.valueOf('G'), - ALLOY.ZERON_100.getGear(1) - }); + new Object[] { "PCP", "EME", "GWG", Character.valueOf('M'), ItemList.Hull_LuV, + Character.valueOf('P'), INGREDIENT_1, Character.valueOf('E'), INGREDIENT_2, + Character.valueOf('C'), OrePrefixes.circuit.get(Materials.Ultimate), Character.valueOf('W'), + OrePrefixes.cableGt02.get(Materials.Tungsten), Character.valueOf('G'), + ALLOY.ZERON_100.getGear(1) }); } } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechSafeBlock.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechSafeBlock.java index 60b7d5a8cc..13a3e11340 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechSafeBlock.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechSafeBlock.java @@ -8,6 +8,7 @@ import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; import gtPlusPlus.xmod.gregtech.common.tileentities.storage.GregtechMetaSafeBlock; public class GregtechSafeBlock { + public static void run() { if (gtPlusPlus.core.lib.LoadedMods.Gregtech) { Logger.INFO("Gregtech5u Content | Registering Lockable Safe Blocks."); @@ -53,183 +54,83 @@ public class GregtechSafeBlock { // To-Do Change Recipes GT_ModHandler.addCraftingRecipe( GregtechItemList.GT_Safe_ULV.get(1L, new Object[0]), - GT_ModHandler.RecipeBits.DISMANTLEABLE - | GT_ModHandler.RecipeBits.NOT_REMOVABLE + GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED, - new Object[] { - "CMV", - " X ", - Character.valueOf('M'), - ItemList.Hull_ULV, - Character.valueOf('V'), - OrePrefixes.circuit.get(Materials.Basic), - Character.valueOf('C'), - OreDictNames.craftingChest, - Character.valueOf('X'), - OrePrefixes.circuit.get(Materials.Basic) - }); + new Object[] { "CMV", " X ", Character.valueOf('M'), ItemList.Hull_ULV, Character.valueOf('V'), + OrePrefixes.circuit.get(Materials.Basic), Character.valueOf('C'), OreDictNames.craftingChest, + Character.valueOf('X'), OrePrefixes.circuit.get(Materials.Basic) }); GT_ModHandler.addCraftingRecipe( GregtechItemList.GT_Safe_LV.get(1L, new Object[0]), - GT_ModHandler.RecipeBits.DISMANTLEABLE - | GT_ModHandler.RecipeBits.NOT_REMOVABLE + GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED, - new Object[] { - "CMV", - " X ", - Character.valueOf('M'), - ItemList.Hull_LV, - Character.valueOf('V'), - OrePrefixes.circuit.get(Materials.Basic), - Character.valueOf('C'), - OreDictNames.craftingChest, - Character.valueOf('X'), - OrePrefixes.circuit.get(Materials.Good) - }); + new Object[] { "CMV", " X ", Character.valueOf('M'), ItemList.Hull_LV, Character.valueOf('V'), + OrePrefixes.circuit.get(Materials.Basic), Character.valueOf('C'), OreDictNames.craftingChest, + Character.valueOf('X'), OrePrefixes.circuit.get(Materials.Good) }); GT_ModHandler.addCraftingRecipe( GregtechItemList.GT_Safe_MV.get(1L, new Object[0]), - GT_ModHandler.RecipeBits.DISMANTLEABLE - | GT_ModHandler.RecipeBits.NOT_REMOVABLE + GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED, - new Object[] { - "CMV", - " X ", - Character.valueOf('M'), - ItemList.Hull_MV, - Character.valueOf('V'), - OrePrefixes.circuit.get(Materials.Good), - Character.valueOf('C'), - OreDictNames.craftingChest, - Character.valueOf('X'), - OrePrefixes.circuit.get(Materials.Good) - }); + new Object[] { "CMV", " X ", Character.valueOf('M'), ItemList.Hull_MV, Character.valueOf('V'), + OrePrefixes.circuit.get(Materials.Good), Character.valueOf('C'), OreDictNames.craftingChest, + Character.valueOf('X'), OrePrefixes.circuit.get(Materials.Good) }); GT_ModHandler.addCraftingRecipe( GregtechItemList.GT_Safe_HV.get(1L, new Object[0]), - GT_ModHandler.RecipeBits.DISMANTLEABLE - | GT_ModHandler.RecipeBits.NOT_REMOVABLE + GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED, - new Object[] { - "CMV", - " X ", - Character.valueOf('M'), - ItemList.Hull_HV, - Character.valueOf('V'), - OrePrefixes.circuit.get(Materials.Good), - Character.valueOf('C'), - OreDictNames.craftingChest, - Character.valueOf('X'), - OrePrefixes.circuit.get(Materials.Advanced) - }); + new Object[] { "CMV", " X ", Character.valueOf('M'), ItemList.Hull_HV, Character.valueOf('V'), + OrePrefixes.circuit.get(Materials.Good), Character.valueOf('C'), OreDictNames.craftingChest, + Character.valueOf('X'), OrePrefixes.circuit.get(Materials.Advanced) }); GT_ModHandler.addCraftingRecipe( GregtechItemList.GT_Safe_EV.get(1L, new Object[0]), - GT_ModHandler.RecipeBits.DISMANTLEABLE - | GT_ModHandler.RecipeBits.NOT_REMOVABLE + GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED, - new Object[] { - "CMV", - " X ", - Character.valueOf('M'), - ItemList.Hull_EV, - Character.valueOf('V'), - OrePrefixes.circuit.get(Materials.Advanced), - Character.valueOf('C'), - OreDictNames.craftingChest, - Character.valueOf('X'), - OrePrefixes.circuit.get(Materials.Elite) - }); + new Object[] { "CMV", " X ", Character.valueOf('M'), ItemList.Hull_EV, Character.valueOf('V'), + OrePrefixes.circuit.get(Materials.Advanced), Character.valueOf('C'), OreDictNames.craftingChest, + Character.valueOf('X'), OrePrefixes.circuit.get(Materials.Elite) }); GT_ModHandler.addCraftingRecipe( GregtechItemList.GT_Safe_IV.get(1L, new Object[0]), - GT_ModHandler.RecipeBits.DISMANTLEABLE - | GT_ModHandler.RecipeBits.NOT_REMOVABLE + GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED, - new Object[] { - "CMV", - " X ", - Character.valueOf('M'), - ItemList.Hull_IV, - Character.valueOf('V'), - OrePrefixes.circuit.get(Materials.Advanced), - Character.valueOf('C'), - OreDictNames.craftingChest, - Character.valueOf('X'), - OrePrefixes.circuit.get(Materials.Master) - }); + new Object[] { "CMV", " X ", Character.valueOf('M'), ItemList.Hull_IV, Character.valueOf('V'), + OrePrefixes.circuit.get(Materials.Advanced), Character.valueOf('C'), OreDictNames.craftingChest, + Character.valueOf('X'), OrePrefixes.circuit.get(Materials.Master) }); GT_ModHandler.addCraftingRecipe( GregtechItemList.GT_Safe_LuV.get(1L, new Object[0]), - GT_ModHandler.RecipeBits.DISMANTLEABLE - | GT_ModHandler.RecipeBits.NOT_REMOVABLE + GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED, - new Object[] { - "CMV", - " X ", - Character.valueOf('M'), - ItemList.Hull_LuV, - Character.valueOf('V'), - OrePrefixes.circuit.get(Materials.Elite), - Character.valueOf('C'), - OreDictNames.craftingChest, - Character.valueOf('X'), - OrePrefixes.circuit.get(Materials.Master) - }); + new Object[] { "CMV", " X ", Character.valueOf('M'), ItemList.Hull_LuV, Character.valueOf('V'), + OrePrefixes.circuit.get(Materials.Elite), Character.valueOf('C'), OreDictNames.craftingChest, + Character.valueOf('X'), OrePrefixes.circuit.get(Materials.Master) }); GT_ModHandler.addCraftingRecipe( GregtechItemList.GT_Safe_ZPM.get(1L, new Object[0]), - GT_ModHandler.RecipeBits.DISMANTLEABLE - | GT_ModHandler.RecipeBits.NOT_REMOVABLE + GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED, - new Object[] { - "CMV", - " X ", - Character.valueOf('M'), - ItemList.Hull_ZPM, - Character.valueOf('V'), - OrePrefixes.circuit.get(Materials.Elite), - Character.valueOf('C'), - OreDictNames.craftingChest, - Character.valueOf('X'), - OrePrefixes.circuit.get(Materials.Master) - }); + new Object[] { "CMV", " X ", Character.valueOf('M'), ItemList.Hull_ZPM, Character.valueOf('V'), + OrePrefixes.circuit.get(Materials.Elite), Character.valueOf('C'), OreDictNames.craftingChest, + Character.valueOf('X'), OrePrefixes.circuit.get(Materials.Master) }); GT_ModHandler.addCraftingRecipe( GregtechItemList.GT_Safe_UV.get(1L, new Object[0]), - GT_ModHandler.RecipeBits.DISMANTLEABLE - | GT_ModHandler.RecipeBits.NOT_REMOVABLE + GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED, - new Object[] { - "CMV", - " X ", - Character.valueOf('M'), - ItemList.Hull_UV, - Character.valueOf('V'), - OrePrefixes.circuit.get(Materials.Master), - Character.valueOf('C'), - OreDictNames.craftingChest, - Character.valueOf('X'), - OrePrefixes.circuit.get(Materials.Superconductor) - }); + new Object[] { "CMV", " X ", Character.valueOf('M'), ItemList.Hull_UV, Character.valueOf('V'), + OrePrefixes.circuit.get(Materials.Master), Character.valueOf('C'), OreDictNames.craftingChest, + Character.valueOf('X'), OrePrefixes.circuit.get(Materials.Superconductor) }); GT_ModHandler.addCraftingRecipe( GregtechItemList.GT_Safe_MAX.get(1L, new Object[0]), - GT_ModHandler.RecipeBits.DISMANTLEABLE - | GT_ModHandler.RecipeBits.NOT_REMOVABLE + GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED, - new Object[] { - "CMV", - " X ", - Character.valueOf('M'), - ItemList.Hull_MAX, - Character.valueOf('V'), - OrePrefixes.circuit.get(Materials.Master), - Character.valueOf('C'), - OreDictNames.craftingChest, - Character.valueOf('X'), - OrePrefixes.circuit.get(Materials.Infinite) - }); + new Object[] { "CMV", " X ", Character.valueOf('M'), ItemList.Hull_MAX, Character.valueOf('V'), + OrePrefixes.circuit.get(Materials.Master), Character.valueOf('C'), OreDictNames.craftingChest, + Character.valueOf('X'), OrePrefixes.circuit.get(Materials.Infinite) }); } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechSemiFluidgenerators.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechSemiFluidgenerators.java index c8881c7490..32e164bc84 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechSemiFluidgenerators.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechSemiFluidgenerators.java @@ -7,23 +7,40 @@ import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production.Gr public class GregtechSemiFluidgenerators { public static void run() { - GregtechItemList.Generator_SemiFluid_LV.set(new GT_MetaTileEntity_SemiFluidGenerator( - 837, "basicgenerator.semifluid.tier.01", "Basic Semi-Fluid Generator", 1) - .getStackForm(1L)); - GregtechItemList.Generator_SemiFluid_MV.set(new GT_MetaTileEntity_SemiFluidGenerator( - 838, "basicgenerator.semifluid.tier.02", "Advanced Semi-Fluid Generator", 2) - .getStackForm(1L)); - GregtechItemList.Generator_SemiFluid_HV.set(new GT_MetaTileEntity_SemiFluidGenerator( - 839, "basicgenerator.semifluid.tier.03", "Turbo Semi-Fluid Generator", 3) - .getStackForm(1L)); - GregtechItemList.Generator_SemiFluid_EV.set(new GT_MetaTileEntity_SemiFluidGenerator( - 993, "basicgenerator.semifluid.tier.04", "Turbo Semi-Fluid Generator II", 4) - .getStackForm(1L)); - GregtechItemList.Generator_SemiFluid_IV.set(new GT_MetaTileEntity_SemiFluidGenerator( - 994, "basicgenerator.semifluid.tier.05", "Turbo Semi-Fluid Generator III", 5) - .getStackForm(1L)); - GregtechItemList.Controller_LargeSemifluidGenerator.set(new GregtechMetaTileEntity_LargeSemifluidGenerator( - 31026, "gtpp.multimachine.semifluidgenerator", "Large Semifluid Burner") - .getStackForm(1L)); + GregtechItemList.Generator_SemiFluid_LV.set( + new GT_MetaTileEntity_SemiFluidGenerator( + 837, + "basicgenerator.semifluid.tier.01", + "Basic Semi-Fluid Generator", + 1).getStackForm(1L)); + GregtechItemList.Generator_SemiFluid_MV.set( + new GT_MetaTileEntity_SemiFluidGenerator( + 838, + "basicgenerator.semifluid.tier.02", + "Advanced Semi-Fluid Generator", + 2).getStackForm(1L)); + GregtechItemList.Generator_SemiFluid_HV.set( + new GT_MetaTileEntity_SemiFluidGenerator( + 839, + "basicgenerator.semifluid.tier.03", + "Turbo Semi-Fluid Generator", + 3).getStackForm(1L)); + GregtechItemList.Generator_SemiFluid_EV.set( + new GT_MetaTileEntity_SemiFluidGenerator( + 993, + "basicgenerator.semifluid.tier.04", + "Turbo Semi-Fluid Generator II", + 4).getStackForm(1L)); + GregtechItemList.Generator_SemiFluid_IV.set( + new GT_MetaTileEntity_SemiFluidGenerator( + 994, + "basicgenerator.semifluid.tier.05", + "Turbo Semi-Fluid Generator III", + 5).getStackForm(1L)); + GregtechItemList.Controller_LargeSemifluidGenerator.set( + new GregtechMetaTileEntity_LargeSemifluidGenerator( + 31026, + "gtpp.multimachine.semifluidgenerator", + "Large Semifluid Burner").getStackForm(1L)); } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechSimpleWasher.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechSimpleWasher.java index 124c7731ee..01fdb612d4 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechSimpleWasher.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechSimpleWasher.java @@ -1,5 +1,8 @@ package gtPlusPlus.xmod.gregtech.registration.gregtech; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidStack; + import gregtech.api.enums.Materials; import gregtech.api.enums.OrePrefixes; import gregtech.api.util.GTPP_Recipe; @@ -8,8 +11,6 @@ import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.util.minecraft.FluidUtils; import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; import gtPlusPlus.xmod.gregtech.common.tileentities.machines.basic.GregtechMetaTileEntity_BasicWasher; -import net.minecraft.item.ItemStack; -import net.minecraftforge.fluids.FluidStack; public class GregtechSimpleWasher { @@ -46,8 +47,7 @@ public class GregtechSimpleWasher { ItemStack dustDirty; for (Materials v : Materials.values()) { if (disablePlat) { - if (v == Materials.Platinum - || v == Materials.Osmium + if (v == Materials.Platinum || v == Materials.Osmium || v == Materials.Iridium || v == Materials.Palladium) { continue; @@ -59,11 +59,11 @@ public class GregtechSimpleWasher { if (dustClean != null && dustDirty != null) { GTPP_Recipe aRecipe = new GTPP_Recipe( false, - new ItemStack[] {dustDirty}, - new ItemStack[] {dustClean}, + new ItemStack[] { dustDirty }, + new ItemStack[] { dustClean }, null, new int[] {}, - new FluidStack[] {FluidUtils.getFluidStack("water", 100)}, + new FluidStack[] { FluidUtils.getFluidStack("water", 100) }, new FluidStack[] {}, 5, 8, @@ -89,11 +89,11 @@ public class GregtechSimpleWasher { if (crushedClean != null && crushedDirty != null) { GTPP_Recipe aRecipe = new GTPP_Recipe( false, - new ItemStack[] {crushedDirty}, - new ItemStack[] {crushedClean}, + new ItemStack[] { crushedDirty }, + new ItemStack[] { crushedClean }, null, new int[] {}, - new FluidStack[] {FluidUtils.getFluidStack("water", 100)}, + new FluidStack[] { FluidUtils.getFluidStack("water", 100) }, new FluidStack[] {}, 5, 8, diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechSolarGenerators.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechSolarGenerators.java index 5004984f0e..d686270bad 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechSolarGenerators.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechSolarGenerators.java @@ -8,6 +8,7 @@ import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; import gtPlusPlus.xmod.gregtech.common.tileentities.generators.GregtechMetaTileEntitySolarGenerator; public class GregtechSolarGenerators { + public static void run() { if (LoadedMods.Gregtech && ConfigSwitches.enableMachine_SolarGenerators) { Logger.INFO("Gregtech5u Content | Registering Solar Generator Blocks."); @@ -19,33 +20,51 @@ public class GregtechSolarGenerators { private static void run1() { - GregtechItemList.GT_Solar_ULV.set(new GregtechMetaTileEntitySolarGenerator( - 800, "sunabsorber.tier.00", "Ultra Low Voltage Solar Generator", 0) - .getStackForm(1L)); + GregtechItemList.GT_Solar_ULV.set( + new GregtechMetaTileEntitySolarGenerator( + 800, + "sunabsorber.tier.00", + "Ultra Low Voltage Solar Generator", + 0).getStackForm(1L)); GregtechItemList.GT_Solar_LV.set( new GregtechMetaTileEntitySolarGenerator(801, "sunabsorber.tier.01", "Low Voltage Solar Generator", 1) .getStackForm(1L)); - GregtechItemList.GT_Solar_MV.set(new GregtechMetaTileEntitySolarGenerator( - 802, "sunabsorber.tier.02", "Medium Voltage Solar Generator", 2) - .getStackForm(1L)); + GregtechItemList.GT_Solar_MV.set( + new GregtechMetaTileEntitySolarGenerator( + 802, + "sunabsorber.tier.02", + "Medium Voltage Solar Generator", + 2).getStackForm(1L)); GregtechItemList.GT_Solar_HV.set( new GregtechMetaTileEntitySolarGenerator(803, "sunabsorber.tier.03", "High Voltage Solar Generator", 3) .getStackForm(1L)); - GregtechItemList.GT_Solar_EV.set(new GregtechMetaTileEntitySolarGenerator( - 804, "sunabsorber.tier.04", "Extreme Voltage Solar Generator", 4) - .getStackForm(1L)); - GregtechItemList.GT_Solar_IV.set(new GregtechMetaTileEntitySolarGenerator( - 805, "sunabsorber.tier.05", "Insane Voltage Solar Generator", 5) - .getStackForm(1L)); - GregtechItemList.GT_Solar_LuV.set(new GregtechMetaTileEntitySolarGenerator( - 806, "sunabsorber.tier.06", "Ludicrous Voltage Solar Generator", 6) - .getStackForm(1L)); + GregtechItemList.GT_Solar_EV.set( + new GregtechMetaTileEntitySolarGenerator( + 804, + "sunabsorber.tier.04", + "Extreme Voltage Solar Generator", + 4).getStackForm(1L)); + GregtechItemList.GT_Solar_IV.set( + new GregtechMetaTileEntitySolarGenerator( + 805, + "sunabsorber.tier.05", + "Insane Voltage Solar Generator", + 5).getStackForm(1L)); + GregtechItemList.GT_Solar_LuV.set( + new GregtechMetaTileEntitySolarGenerator( + 806, + "sunabsorber.tier.06", + "Ludicrous Voltage Solar Generator", + 6).getStackForm(1L)); GregtechItemList.GT_Solar_ZPM.set( new GregtechMetaTileEntitySolarGenerator(807, "sunabsorber.tier.07", "ZPM Voltage Solar Generator", 7) .getStackForm(1L)); - GregtechItemList.GT_Solar_UV.set(new GregtechMetaTileEntitySolarGenerator( - 808, "sunabsorber.tier.08", "Ultimate Voltage Solar Generator", 8) - .getStackForm(1L)); + GregtechItemList.GT_Solar_UV.set( + new GregtechMetaTileEntitySolarGenerator( + 808, + "sunabsorber.tier.08", + "Ultimate Voltage Solar Generator", + 8).getStackForm(1L)); GregtechItemList.GT_Solar_MAX.set( new GregtechMetaTileEntitySolarGenerator(809, "sunabsorber.tier.09", "MAX Voltage Solar Generator", 9) .getStackForm(1L)); diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechSolarTower.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechSolarTower.java index fdb2ea8830..3b86daf811 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechSolarTower.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechSolarTower.java @@ -1,12 +1,13 @@ package gtPlusPlus.xmod.gregtech.registration.gregtech; +import net.minecraftforge.fluids.FluidStack; + import gregtech.api.util.GTPP_Recipe; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.material.MISC_MATERIALS; import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production.GregtechMetaTileEntity_SolarTower; import gtPlusPlus.xmod.gregtech.common.tileentities.misc.TileEntitySolarHeater; -import net.minecraftforge.fluids.FluidStack; public class GregtechSolarTower { @@ -22,14 +23,14 @@ public class GregtechSolarTower { GregtechItemList.Industrial_Solar_Tower.set( new GregtechMetaTileEntity_SolarTower(863, "solartower.controller.tier.single", "Solar Tower") .getStackForm(1L)); - GregtechItemList.Solar_Tower_Reflector.set(new TileEntitySolarHeater( + GregtechItemList.Solar_Tower_Reflector.set( + new TileEntitySolarHeater( 864, "solarreflector.simple.single", "Solar Reflector", 8, "Part of the Clean Green energy movement", - 0) - .getStackForm(1L)); + 0).getStackForm(1L)); // NEI recipe GTPP_Recipe.GTPP_Recipe_Map.sSolarTowerRecipes.addRecipe( @@ -38,8 +39,8 @@ public class GregtechSolarTower { null, null, null, - new FluidStack[] {MISC_MATERIALS.SOLAR_SALT_COLD.getFluidStack(1000)}, - new FluidStack[] {MISC_MATERIALS.SOLAR_SALT_HOT.getFluidStack(1000)}, + new FluidStack[] { MISC_MATERIALS.SOLAR_SALT_COLD.getFluidStack(1000) }, + new FluidStack[] { MISC_MATERIALS.SOLAR_SALT_HOT.getFluidStack(1000) }, 0, 0, 0); diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechSteamMultis.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechSteamMultis.java index c6008c6b5c..53436350cc 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechSteamMultis.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechSteamMultis.java @@ -16,15 +16,20 @@ public class GregtechSteamMultis { GregtechItemList.Controller_SteamMaceratorMulti.set( new GregtechMetaTileEntity_SteamMacerator(31041, "gtpp.multimachine.steam.macerator", "Steam Grinder") .getStackForm(1L)); - GregtechItemList.Controller_SteamCompressorMulti.set(new GregtechMetaTileEntity_SteamCompressor( - 31078, "gtpp.multimachine.steam.compressor", "Steam Squasher") - .getStackForm(1L)); + GregtechItemList.Controller_SteamCompressorMulti.set( + new GregtechMetaTileEntity_SteamCompressor( + 31078, + "gtpp.multimachine.steam.compressor", + "Steam Squasher").getStackForm(1L)); GregtechItemList.Hatch_Input_Bus_Steam.set( new GT_MetaTileEntity_Hatch_Steam_BusInput(31046, "hatch.input_bus.tier.steam", "Input Bus (Steam)", 0) .getStackForm(1L)); - GregtechItemList.Hatch_Output_Bus_Steam.set(new GT_MetaTileEntity_Hatch_Steam_BusOutput( - 31047, "hatch.output_bus.tier.steam", "Output Bus (Steam)", 0) - .getStackForm(1L)); + GregtechItemList.Hatch_Output_Bus_Steam.set( + new GT_MetaTileEntity_Hatch_Steam_BusOutput( + 31047, + "hatch.output_bus.tier.steam", + "Output Bus (Steam)", + 0).getStackForm(1L)); } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechSuperChests.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechSuperChests.java index 5c99d2b4b7..fa2edaa030 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechSuperChests.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechSuperChests.java @@ -47,87 +47,52 @@ public class GregtechSuperChests { ItemUtils.hideItemFromNEI(GregtechItemList.Super_Chest_IV.get(1L)); } else { GT_ModHandler.addCraftingRecipe( - GregtechItemList.Super_Chest_LV.get(1L, new Object[0]), bitsd, new Object[] { - "DPD", - "PMP", - "DGD", - Character.valueOf('M'), - ItemList.Hull_LV, - Character.valueOf('G'), - ItemList.Automation_ChestBuffer_LV, - Character.valueOf('D'), - OrePrefixes.circuit.get(Materials.Basic), - Character.valueOf('P'), - OrePrefixes.plate.get(Materials.Invar) - }); + GregtechItemList.Super_Chest_LV.get(1L, new Object[0]), + bitsd, + new Object[] { "DPD", "PMP", "DGD", Character.valueOf('M'), ItemList.Hull_LV, + Character.valueOf('G'), ItemList.Automation_ChestBuffer_LV, Character.valueOf('D'), + OrePrefixes.circuit.get(Materials.Basic), Character.valueOf('P'), + OrePrefixes.plate.get(Materials.Invar) }); GT_ModHandler.addCraftingRecipe( - GregtechItemList.Super_Chest_MV.get(1L, new Object[0]), bitsd, new Object[] { - "DPD", - "PMP", - "DGD", - Character.valueOf('M'), - ItemList.Hull_MV, - Character.valueOf('G'), - ItemList.Automation_ChestBuffer_MV, - Character.valueOf('D'), - OrePrefixes.circuit.get(Materials.Good), - Character.valueOf('P'), - OrePrefixes.plate.get(Materials.Aluminium) - }); + GregtechItemList.Super_Chest_MV.get(1L, new Object[0]), + bitsd, + new Object[] { "DPD", "PMP", "DGD", Character.valueOf('M'), ItemList.Hull_MV, + Character.valueOf('G'), ItemList.Automation_ChestBuffer_MV, Character.valueOf('D'), + OrePrefixes.circuit.get(Materials.Good), Character.valueOf('P'), + OrePrefixes.plate.get(Materials.Aluminium) }); GT_ModHandler.addCraftingRecipe( - GregtechItemList.Super_Chest_HV.get(1L, new Object[0]), bitsd, new Object[] { - "DPD", - "PMP", - "DGD", - Character.valueOf('M'), - ItemList.Hull_HV, - Character.valueOf('G'), - ItemList.Automation_ChestBuffer_HV, - Character.valueOf('D'), - OrePrefixes.circuit.get(Materials.Advanced), - Character.valueOf('P'), - OrePrefixes.plate.get(Materials.StainlessSteel) - }); + GregtechItemList.Super_Chest_HV.get(1L, new Object[0]), + bitsd, + new Object[] { "DPD", "PMP", "DGD", Character.valueOf('M'), ItemList.Hull_HV, + Character.valueOf('G'), ItemList.Automation_ChestBuffer_HV, Character.valueOf('D'), + OrePrefixes.circuit.get(Materials.Advanced), Character.valueOf('P'), + OrePrefixes.plate.get(Materials.StainlessSteel) }); GT_ModHandler.addCraftingRecipe( - GregtechItemList.Super_Chest_EV.get(1L, new Object[0]), bitsd, new Object[] { - "DPD", - "PMP", - "DGD", - Character.valueOf('M'), - ItemList.Hull_EV, - Character.valueOf('G'), - ItemList.Automation_ChestBuffer_EV, - Character.valueOf('D'), - OrePrefixes.circuit.get(Materials.Data), - Character.valueOf('P'), - OrePrefixes.plate.get(Materials.Titanium) - }); + GregtechItemList.Super_Chest_EV.get(1L, new Object[0]), + bitsd, + new Object[] { "DPD", "PMP", "DGD", Character.valueOf('M'), ItemList.Hull_EV, + Character.valueOf('G'), ItemList.Automation_ChestBuffer_EV, Character.valueOf('D'), + OrePrefixes.circuit.get(Materials.Data), Character.valueOf('P'), + OrePrefixes.plate.get(Materials.Titanium) }); GT_ModHandler.addCraftingRecipe( - GregtechItemList.Super_Chest_IV.get(1L, new Object[0]), bitsd, new Object[] { - "DPD", - "PMP", - "DGD", - Character.valueOf('M'), - ItemList.Hull_IV, - Character.valueOf('G'), - ItemList.Automation_ChestBuffer_IV, - Character.valueOf('D'), - OrePrefixes.circuit.get(Materials.Elite), - Character.valueOf('P'), - OrePrefixes.plate.get(Materials.Tungsten) - }); + GregtechItemList.Super_Chest_IV.get(1L, new Object[0]), + bitsd, + new Object[] { "DPD", "PMP", "DGD", Character.valueOf('M'), ItemList.Hull_IV, + Character.valueOf('G'), ItemList.Automation_ChestBuffer_IV, Character.valueOf('D'), + OrePrefixes.circuit.get(Materials.Elite), Character.valueOf('P'), + OrePrefixes.plate.get(Materials.Tungsten) }); } // Test Thing - GregtechItemList.CrateStorage.set((new GT_MetaTileEntity_ConnectableCrate( + GregtechItemList.CrateStorage.set( + (new GT_MetaTileEntity_ConnectableCrate( GT_MetaTileEntity_ConnectableCrate.mCrateID, "crate.tier.01", "Interconnecting Storage Crate", - 0)) - .getStackForm(1L)); + 0)).getStackForm(1L)); } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechSuperConductionPoint.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechSuperConductionPoint.java index cdeb6859c7..b36a81e101 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechSuperConductionPoint.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechSuperConductionPoint.java @@ -12,7 +12,7 @@ public class GregtechSuperConductionPoint { private static void run1() { // Steam Condensors // GregtechItemList.SuperConductorInputNode.set(new GregtechMetaTileEntitySuperCondensor(811, - // "superconductor.01.input.single", "Power Phase Shifting Station", 8).getStackForm(1L)); + // "superconductor.01.input.single", "Power Phase Shifting Station", 8).getStackForm(1L)); } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechThaumcraftDevices.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechThaumcraftDevices.java index 728d23ed24..4470ebe67e 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechThaumcraftDevices.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechThaumcraftDevices.java @@ -16,8 +16,13 @@ public class GregtechThaumcraftDevices { private static void run1() { // 956-960 - GregtechItemList.Thaumcraft_Researcher.set(new GregtechMetaPollutionCreator( - 956, "thaumcraft.gtpp.machine.01", "Arcane Researcher", 5, "Thinking for you.", 0) - .getStackForm(1L)); + GregtechItemList.Thaumcraft_Researcher.set( + new GregtechMetaPollutionCreator( + 956, + "thaumcraft.gtpp.machine.01", + "Arcane Researcher", + 5, + "Thinking for you.", + 0).getStackForm(1L)); } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechThreadedBuffers.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechThreadedBuffers.java index 41ea0c3d26..737f585a56 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechThreadedBuffers.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechThreadedBuffers.java @@ -1,11 +1,12 @@ package gtPlusPlus.xmod.gregtech.registration.gregtech; +import net.minecraft.item.ItemStack; + import gregtech.api.enums.ItemList; import gregtech.api.util.GT_Recipe; import gregtech.common.tileentities.automation.GT_MetaTileEntity_SuperBuffer; import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; import gtPlusPlus.xmod.gregtech.common.tileentities.storage.creative.GT_MetaTileEntity_InfiniteItemHolder; -import net.minecraft.item.ItemStack; public class GregtechThreadedBuffers { @@ -21,86 +22,82 @@ public class GregtechThreadedBuffers { /* * This file used to contain registration and recipes for GT++ threaded super buffers. Those have now been - * deprecated and replaced by the original GT super buffers. - * - * To avoid breaking existing bases, we've assigned the threaded super buffer metadata IDs to a copy of the GT - * super buffers, with a deprecation notice attached. We've also provided disassembler recipes that are the - * reverse of the original crafting recipes, allowing players to reclaim their original materials as well as - * convert the deprecated threaded super buffer metadata ID item back to the original GT super buffer metadata - * ID item. + * deprecated and replaced by the original GT super buffers. To avoid breaking existing bases, we've assigned + * the threaded super buffer metadata IDs to a copy of the GT super buffers, with a deprecation notice attached. + * We've also provided disassembler recipes that are the reverse of the original crafting recipes, allowing + * players to reclaim their original materials as well as convert the deprecated threaded super buffer metadata + * ID item back to the original GT super buffer metadata ID item. */ final String deprecationNotice = "**DEPRECATED - Drop in disassembler!** "; - GregtechItemList.Automation_Threaded_SuperBuffer_ULV.set((new GT_MetaTileEntity_SuperBuffer( + GregtechItemList.Automation_Threaded_SuperBuffer_ULV.set( + (new GT_MetaTileEntity_SuperBuffer( 31000, "automation.superbuffer.tier.00.deprecated", deprecationNotice + "Ultra Low Voltage Super Buffer", - 0)) - .getStackForm(1L)); - GregtechItemList.Automation_Threaded_SuperBuffer_LV.set((new GT_MetaTileEntity_SuperBuffer( + 0)).getStackForm(1L)); + GregtechItemList.Automation_Threaded_SuperBuffer_LV.set( + (new GT_MetaTileEntity_SuperBuffer( 31001, "automation.superbuffer.tier.01.deprecated", deprecationNotice + "Low Voltage Super Buffer", - 1)) - .getStackForm(1L)); - GregtechItemList.Automation_Threaded_SuperBuffer_MV.set((new GT_MetaTileEntity_SuperBuffer( + 1)).getStackForm(1L)); + GregtechItemList.Automation_Threaded_SuperBuffer_MV.set( + (new GT_MetaTileEntity_SuperBuffer( 31002, "automation.superbuffer.tier.02.deprecated", deprecationNotice + "Medium Voltage Super Buffer", - 2)) - .getStackForm(1L)); - GregtechItemList.Automation_Threaded_SuperBuffer_HV.set((new GT_MetaTileEntity_SuperBuffer( + 2)).getStackForm(1L)); + GregtechItemList.Automation_Threaded_SuperBuffer_HV.set( + (new GT_MetaTileEntity_SuperBuffer( 31003, "automation.superbuffer.tier.03.deprecated", deprecationNotice + "High Voltage Super Buffer", - 3)) - .getStackForm(1L)); - GregtechItemList.Automation_Threaded_SuperBuffer_EV.set((new GT_MetaTileEntity_SuperBuffer( + 3)).getStackForm(1L)); + GregtechItemList.Automation_Threaded_SuperBuffer_EV.set( + (new GT_MetaTileEntity_SuperBuffer( 31004, "automation.superbuffer.tier.04.deprecated", deprecationNotice + "Extreme Voltage Super Buffer", - 4)) - .getStackForm(1L)); - GregtechItemList.Automation_Threaded_SuperBuffer_IV.set((new GT_MetaTileEntity_SuperBuffer( + 4)).getStackForm(1L)); + GregtechItemList.Automation_Threaded_SuperBuffer_IV.set( + (new GT_MetaTileEntity_SuperBuffer( 31005, "automation.superbuffer.tier.05.deprecated", deprecationNotice + "Insane Voltage Super Buffer", - 5)) - .getStackForm(1L)); - GregtechItemList.Automation_Threaded_SuperBuffer_LuV.set((new GT_MetaTileEntity_SuperBuffer( + 5)).getStackForm(1L)); + GregtechItemList.Automation_Threaded_SuperBuffer_LuV.set( + (new GT_MetaTileEntity_SuperBuffer( 31006, "automation.superbuffer.tier.06.deprecated", deprecationNotice + "Ludicrous Voltage Super Buffer", - 6)) - .getStackForm(1L)); - GregtechItemList.Automation_Threaded_SuperBuffer_ZPM.set((new GT_MetaTileEntity_SuperBuffer( + 6)).getStackForm(1L)); + GregtechItemList.Automation_Threaded_SuperBuffer_ZPM.set( + (new GT_MetaTileEntity_SuperBuffer( 31007, "automation.superbuffer.tier.07.deprecated", deprecationNotice + "ZPM Voltage Super Buffer", - 7)) - .getStackForm(1L)); - GregtechItemList.Automation_Threaded_SuperBuffer_UV.set((new GT_MetaTileEntity_SuperBuffer( + 7)).getStackForm(1L)); + GregtechItemList.Automation_Threaded_SuperBuffer_UV.set( + (new GT_MetaTileEntity_SuperBuffer( 31008, "automation.superbuffer.tier.08.deprecated", deprecationNotice + "Ultimate Voltage Super Buffer", - 8)) - .getStackForm(1L)); - GregtechItemList.Automation_Threaded_SuperBuffer_MAX.set((new GT_MetaTileEntity_SuperBuffer( + 8)).getStackForm(1L)); + GregtechItemList.Automation_Threaded_SuperBuffer_MAX.set( + (new GT_MetaTileEntity_SuperBuffer( 31009, "automation.superbuffer.tier.09.deprecated", deprecationNotice + "Highly Ultimate Voltage Super Buffer", - 9)) - .getStackForm(1L)); + 9)).getStackForm(1L)); // These recipes are all 1 sec @ 32 EU/t GT_Recipe.GT_Recipe_Map.sDisassemblerRecipes.addRecipe( true, - new ItemStack[] {GregtechItemList.Automation_Threaded_SuperBuffer_ULV.get(1L, new Object[0])}, - new ItemStack[] { - ItemList.Automation_SuperBuffer_ULV.get(1L, new Object[0]), - ItemList.Tool_DataOrb.get(1L, new Object[0]), - ItemList.Conveyor_Module_LV.get(1L, new Object[0]), - }, + new ItemStack[] { GregtechItemList.Automation_Threaded_SuperBuffer_ULV.get(1L, new Object[0]) }, + new ItemStack[] { ItemList.Automation_SuperBuffer_ULV.get(1L, new Object[0]), + ItemList.Tool_DataOrb.get(1L, new Object[0]), + ItemList.Conveyor_Module_LV.get(1L, new Object[0]), }, null, null, null, @@ -109,12 +106,10 @@ public class GregtechThreadedBuffers { -100); GT_Recipe.GT_Recipe_Map.sDisassemblerRecipes.addRecipe( true, - new ItemStack[] {GregtechItemList.Automation_Threaded_SuperBuffer_LV.get(1L, new Object[0])}, - new ItemStack[] { - ItemList.Automation_SuperBuffer_LV.get(1L, new Object[0]), - ItemList.Tool_DataOrb.get(1L, new Object[0]), - ItemList.Conveyor_Module_LV.get(1L, new Object[0]), - }, + new ItemStack[] { GregtechItemList.Automation_Threaded_SuperBuffer_LV.get(1L, new Object[0]) }, + new ItemStack[] { ItemList.Automation_SuperBuffer_LV.get(1L, new Object[0]), + ItemList.Tool_DataOrb.get(1L, new Object[0]), + ItemList.Conveyor_Module_LV.get(1L, new Object[0]), }, null, null, null, @@ -123,12 +118,10 @@ public class GregtechThreadedBuffers { -100); GT_Recipe.GT_Recipe_Map.sDisassemblerRecipes.addRecipe( true, - new ItemStack[] {GregtechItemList.Automation_Threaded_SuperBuffer_MV.get(1L, new Object[0])}, - new ItemStack[] { - ItemList.Automation_SuperBuffer_MV.get(1L, new Object[0]), - ItemList.Tool_DataOrb.get(1L, new Object[0]), - ItemList.Conveyor_Module_MV.get(1L, new Object[0]), - }, + new ItemStack[] { GregtechItemList.Automation_Threaded_SuperBuffer_MV.get(1L, new Object[0]) }, + new ItemStack[] { ItemList.Automation_SuperBuffer_MV.get(1L, new Object[0]), + ItemList.Tool_DataOrb.get(1L, new Object[0]), + ItemList.Conveyor_Module_MV.get(1L, new Object[0]), }, null, null, null, @@ -137,12 +130,10 @@ public class GregtechThreadedBuffers { -100); GT_Recipe.GT_Recipe_Map.sDisassemblerRecipes.addRecipe( true, - new ItemStack[] {GregtechItemList.Automation_Threaded_SuperBuffer_HV.get(1L, new Object[0])}, - new ItemStack[] { - ItemList.Automation_SuperBuffer_HV.get(1L, new Object[0]), - ItemList.Tool_DataOrb.get(1L, new Object[0]), - ItemList.Conveyor_Module_HV.get(1L, new Object[0]), - }, + new ItemStack[] { GregtechItemList.Automation_Threaded_SuperBuffer_HV.get(1L, new Object[0]) }, + new ItemStack[] { ItemList.Automation_SuperBuffer_HV.get(1L, new Object[0]), + ItemList.Tool_DataOrb.get(1L, new Object[0]), + ItemList.Conveyor_Module_HV.get(1L, new Object[0]), }, null, null, null, @@ -151,12 +142,10 @@ public class GregtechThreadedBuffers { -100); GT_Recipe.GT_Recipe_Map.sDisassemblerRecipes.addRecipe( true, - new ItemStack[] {GregtechItemList.Automation_Threaded_SuperBuffer_EV.get(1L, new Object[0])}, - new ItemStack[] { - ItemList.Automation_SuperBuffer_EV.get(1L, new Object[0]), - ItemList.Tool_DataOrb.get(1L, new Object[0]), - ItemList.Conveyor_Module_EV.get(1L, new Object[0]), - }, + new ItemStack[] { GregtechItemList.Automation_Threaded_SuperBuffer_EV.get(1L, new Object[0]) }, + new ItemStack[] { ItemList.Automation_SuperBuffer_EV.get(1L, new Object[0]), + ItemList.Tool_DataOrb.get(1L, new Object[0]), + ItemList.Conveyor_Module_EV.get(1L, new Object[0]), }, null, null, null, @@ -165,12 +154,10 @@ public class GregtechThreadedBuffers { -100); GT_Recipe.GT_Recipe_Map.sDisassemblerRecipes.addRecipe( true, - new ItemStack[] {GregtechItemList.Automation_Threaded_SuperBuffer_IV.get(1L, new Object[0])}, - new ItemStack[] { - ItemList.Automation_SuperBuffer_IV.get(1L, new Object[0]), - ItemList.Tool_DataOrb.get(1L, new Object[0]), - ItemList.Conveyor_Module_IV.get(1L, new Object[0]), - }, + new ItemStack[] { GregtechItemList.Automation_Threaded_SuperBuffer_IV.get(1L, new Object[0]) }, + new ItemStack[] { ItemList.Automation_SuperBuffer_IV.get(1L, new Object[0]), + ItemList.Tool_DataOrb.get(1L, new Object[0]), + ItemList.Conveyor_Module_IV.get(1L, new Object[0]), }, null, null, null, @@ -179,12 +166,10 @@ public class GregtechThreadedBuffers { -100); GT_Recipe.GT_Recipe_Map.sDisassemblerRecipes.addRecipe( true, - new ItemStack[] {GregtechItemList.Automation_Threaded_SuperBuffer_LuV.get(1L, new Object[0])}, - new ItemStack[] { - ItemList.Automation_SuperBuffer_LuV.get(1L, new Object[0]), - ItemList.Tool_DataOrb.get(1L, new Object[0]), - ItemList.Conveyor_Module_LuV.get(1L, new Object[0]), - }, + new ItemStack[] { GregtechItemList.Automation_Threaded_SuperBuffer_LuV.get(1L, new Object[0]) }, + new ItemStack[] { ItemList.Automation_SuperBuffer_LuV.get(1L, new Object[0]), + ItemList.Tool_DataOrb.get(1L, new Object[0]), + ItemList.Conveyor_Module_LuV.get(1L, new Object[0]), }, null, null, null, @@ -193,12 +178,10 @@ public class GregtechThreadedBuffers { -100); GT_Recipe.GT_Recipe_Map.sDisassemblerRecipes.addRecipe( true, - new ItemStack[] {GregtechItemList.Automation_Threaded_SuperBuffer_ZPM.get(1L, new Object[0])}, - new ItemStack[] { - ItemList.Automation_SuperBuffer_ZPM.get(1L, new Object[0]), - ItemList.Tool_DataOrb.get(1L, new Object[0]), - ItemList.Conveyor_Module_ZPM.get(1L, new Object[0]), - }, + new ItemStack[] { GregtechItemList.Automation_Threaded_SuperBuffer_ZPM.get(1L, new Object[0]) }, + new ItemStack[] { ItemList.Automation_SuperBuffer_ZPM.get(1L, new Object[0]), + ItemList.Tool_DataOrb.get(1L, new Object[0]), + ItemList.Conveyor_Module_ZPM.get(1L, new Object[0]), }, null, null, null, @@ -207,12 +190,10 @@ public class GregtechThreadedBuffers { -100); GT_Recipe.GT_Recipe_Map.sDisassemblerRecipes.addRecipe( true, - new ItemStack[] {GregtechItemList.Automation_Threaded_SuperBuffer_UV.get(1L, new Object[0])}, - new ItemStack[] { - ItemList.Automation_SuperBuffer_UV.get(1L, new Object[0]), - ItemList.Tool_DataOrb.get(1L, new Object[0]), - ItemList.Conveyor_Module_UV.get(1L, new Object[0]), - }, + new ItemStack[] { GregtechItemList.Automation_Threaded_SuperBuffer_UV.get(1L, new Object[0]) }, + new ItemStack[] { ItemList.Automation_SuperBuffer_UV.get(1L, new Object[0]), + ItemList.Tool_DataOrb.get(1L, new Object[0]), + ItemList.Conveyor_Module_UV.get(1L, new Object[0]), }, null, null, null, @@ -221,12 +202,10 @@ public class GregtechThreadedBuffers { -100); GT_Recipe.GT_Recipe_Map.sDisassemblerRecipes.addRecipe( true, - new ItemStack[] {GregtechItemList.Automation_Threaded_SuperBuffer_MAX.get(1L, new Object[0])}, - new ItemStack[] { - ItemList.Automation_SuperBuffer_MAX.get(1L, new Object[0]), - ItemList.Tool_DataOrb.get(1L, new Object[0]), - GregtechItemList.Conveyor_Module_MAX.get(1L, new Object[0]), - }, + new ItemStack[] { GregtechItemList.Automation_Threaded_SuperBuffer_MAX.get(1L, new Object[0]) }, + new ItemStack[] { ItemList.Automation_SuperBuffer_MAX.get(1L, new Object[0]), + ItemList.Tool_DataOrb.get(1L, new Object[0]), + GregtechItemList.Conveyor_Module_MAX.get(1L, new Object[0]), }, null, null, null, diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechTieredChunkloaders.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechTieredChunkloaders.java index 525b3f6110..a3d1b3f22f 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechTieredChunkloaders.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechTieredChunkloaders.java @@ -6,6 +6,7 @@ import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; import gtPlusPlus.xmod.gregtech.common.tileentities.machines.basic.GregtechMetaTileEntityChunkLoader; public class GregtechTieredChunkloaders { + public static void run() { if (LoadedMods.Gregtech) { Logger.INFO("Gregtech5u Content | Registering Chunk Loaders."); diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechTieredFluidTanks.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechTieredFluidTanks.java index 88984ac0c1..ac740b8210 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechTieredFluidTanks.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechTieredFluidTanks.java @@ -7,6 +7,7 @@ import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; import gtPlusPlus.xmod.gregtech.common.tileentities.storage.GT_MetaTileEntity_TieredTank; public class GregtechTieredFluidTanks { + public static void run() { if (LoadedMods.Gregtech) { Logger.INFO("Gregtech5u Content | Registering Portable Fluid Tanks."); diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechTreeFarmerTE.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechTreeFarmerTE.java index 38ef3e6b77..65c3e0b36a 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechTreeFarmerTE.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechTreeFarmerTE.java @@ -6,6 +6,7 @@ import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GregtechMetaTreeFarmerStructural; public class GregtechTreeFarmerTE { + public static void run() { if (gtPlusPlus.core.lib.LoadedMods.Gregtech) { Logger.INFO("Gregtech5u Content | Registering Tree Farmer Structural Block."); diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechWirelessChargers.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechWirelessChargers.java index fb14dad78f..413e9bb81c 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechWirelessChargers.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechWirelessChargers.java @@ -14,86 +14,85 @@ public class GregtechWirelessChargers { if (gtPlusPlus.core.lib.LoadedMods.Gregtech) { Logger.INFO("Gregtech5u Content | Registering Wireless Chargers."); - long bitsd = GT_ModHandler.RecipeBits.DISMANTLEABLE - | GT_ModHandler.RecipeBits.NOT_REMOVABLE + long bitsd = GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED; int mID = 890; Utils.registerEvent(new ChargingHelper()); - GregtechItemList.Charger_LV.set(new GregtechMetaWirelessCharger( + GregtechItemList.Charger_LV.set( + new GregtechMetaWirelessCharger( mID++, "wificharger.01.tier.single", "Wireless Charger MK I", 1, "Hopefully won't give you cancer.", - 0) - .getStackForm(1L)); - GregtechItemList.Charger_MV.set(new GregtechMetaWirelessCharger( + 0).getStackForm(1L)); + GregtechItemList.Charger_MV.set( + new GregtechMetaWirelessCharger( mID++, "wificharger.02.tier.single", "Wireless Charger MK II", 2, "Hopefully won't give you cancer.", - 0) - .getStackForm(1L)); - GregtechItemList.Charger_HV.set(new GregtechMetaWirelessCharger( + 0).getStackForm(1L)); + GregtechItemList.Charger_HV.set( + new GregtechMetaWirelessCharger( mID++, "wificharger.03.tier.single", "Wireless Charger MK III", 3, "Hopefully won't give you cancer.", - 0) - .getStackForm(1L)); - GregtechItemList.Charger_EV.set(new GregtechMetaWirelessCharger( + 0).getStackForm(1L)); + GregtechItemList.Charger_EV.set( + new GregtechMetaWirelessCharger( mID++, "wificharger.04.tier.single", "Wireless Charger MK IV", 4, "Hopefully won't give you cancer.", - 0) - .getStackForm(1L)); - GregtechItemList.Charger_IV.set(new GregtechMetaWirelessCharger( + 0).getStackForm(1L)); + GregtechItemList.Charger_IV.set( + new GregtechMetaWirelessCharger( mID++, "wificharger.05.tier.single", "Wireless Charger MK V", 5, "Hopefully won't give you cancer.", - 0) - .getStackForm(1L)); - GregtechItemList.Charger_LuV.set(new GregtechMetaWirelessCharger( + 0).getStackForm(1L)); + GregtechItemList.Charger_LuV.set( + new GregtechMetaWirelessCharger( mID++, "wificharger.06.tier.single", "Wireless Charger MK VI", 6, "Hopefully won't give you cancer.", - 0) - .getStackForm(1L)); - GregtechItemList.Charger_ZPM.set(new GregtechMetaWirelessCharger( + 0).getStackForm(1L)); + GregtechItemList.Charger_ZPM.set( + new GregtechMetaWirelessCharger( mID++, "wificharger.07.tier.single", "Wireless Charger MK VII", 7, "Hopefully won't give you cancer.", - 0) - .getStackForm(1L)); - GregtechItemList.Charger_UV.set(new GregtechMetaWirelessCharger( + 0).getStackForm(1L)); + GregtechItemList.Charger_UV.set( + new GregtechMetaWirelessCharger( mID++, "wificharger.08.tier.single", "Wireless Charger MK VIII", 8, "Hopefully won't give you cancer.", - 0) - .getStackForm(1L)); - GregtechItemList.Charger_MAX.set(new GregtechMetaWirelessCharger( + 0).getStackForm(1L)); + GregtechItemList.Charger_MAX.set( + new GregtechMetaWirelessCharger( mID++, "wificharger.09.tier.single", "Wireless Charger MK IX", 9, "Hopefully won't give you cancer.", - 0) - .getStackForm(1L)); + 0).getStackForm(1L)); } } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/NewHorizonsAccelerator.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/NewHorizonsAccelerator.java index ceeed5128d..5ed7046a93 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/NewHorizonsAccelerator.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/NewHorizonsAccelerator.java @@ -20,221 +20,125 @@ public class NewHorizonsAccelerator { } private static void run1() { - GregtechItemList.AcceleratorLV.set(new GT_MetaTileEntity_WorldAccelerator( - 841, "basicmachine.accelerator.tier.01", "Basic World Accelerator", 1) - .getStackForm(1L)); - GregtechItemList.AcceleratorMV.set(new GT_MetaTileEntity_WorldAccelerator( - 842, "basicmachine.accelerator.tier.02", "Advanced World Accelerator", 2) - .getStackForm(1L)); - GregtechItemList.AcceleratorHV.set(new GT_MetaTileEntity_WorldAccelerator( - 843, "basicmachine.accelerator.tier.03", "Advanced World Accelerator II", 3) - .getStackForm(1L)); - GregtechItemList.AcceleratorEV.set(new GT_MetaTileEntity_WorldAccelerator( - 844, "basicmachine.accelerator.tier.04", "Advanced World Accelerator III", 4) - .getStackForm(1L)); - GregtechItemList.AcceleratorIV.set(new GT_MetaTileEntity_WorldAccelerator( - 845, "basicmachine.accelerator.tier.05", "Advanced World Accelerator IV", 5) - .getStackForm(1L)); - GregtechItemList.AcceleratorLuV.set(new GT_MetaTileEntity_WorldAccelerator( - 846, "basicmachine.accelerator.tier.06", "Elite World Accelerator", 6) - .getStackForm(1L)); - GregtechItemList.AcceleratorZPM.set(new GT_MetaTileEntity_WorldAccelerator( - 847, "basicmachine.accelerator.tier.07", "Elite World Accelerator II", 7) - .getStackForm(1L)); - GregtechItemList.AcceleratorUV.set(new GT_MetaTileEntity_WorldAccelerator( - 848, "basicmachine.accelerator.tier.08", "Ultimate Time Anomaly", 8) - .getStackForm(1L)); + GregtechItemList.AcceleratorLV.set( + new GT_MetaTileEntity_WorldAccelerator( + 841, + "basicmachine.accelerator.tier.01", + "Basic World Accelerator", + 1).getStackForm(1L)); + GregtechItemList.AcceleratorMV.set( + new GT_MetaTileEntity_WorldAccelerator( + 842, + "basicmachine.accelerator.tier.02", + "Advanced World Accelerator", + 2).getStackForm(1L)); + GregtechItemList.AcceleratorHV.set( + new GT_MetaTileEntity_WorldAccelerator( + 843, + "basicmachine.accelerator.tier.03", + "Advanced World Accelerator II", + 3).getStackForm(1L)); + GregtechItemList.AcceleratorEV.set( + new GT_MetaTileEntity_WorldAccelerator( + 844, + "basicmachine.accelerator.tier.04", + "Advanced World Accelerator III", + 4).getStackForm(1L)); + GregtechItemList.AcceleratorIV.set( + new GT_MetaTileEntity_WorldAccelerator( + 845, + "basicmachine.accelerator.tier.05", + "Advanced World Accelerator IV", + 5).getStackForm(1L)); + GregtechItemList.AcceleratorLuV.set( + new GT_MetaTileEntity_WorldAccelerator( + 846, + "basicmachine.accelerator.tier.06", + "Elite World Accelerator", + 6).getStackForm(1L)); + GregtechItemList.AcceleratorZPM.set( + new GT_MetaTileEntity_WorldAccelerator( + 847, + "basicmachine.accelerator.tier.07", + "Elite World Accelerator II", + 7).getStackForm(1L)); + GregtechItemList.AcceleratorUV.set( + new GT_MetaTileEntity_WorldAccelerator( + 848, + "basicmachine.accelerator.tier.08", + "Ultimate Time Anomaly", + 8).getStackForm(1L)); GT_ModHandler.addCraftingRecipe( GregtechItemList.AcceleratorLV.get(1L), - GT_ModHandler.RecipeBits.DISMANTLEABLE - | GT_ModHandler.RecipeBits.NOT_REMOVABLE + GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED, - new Object[] { - "RMR", - "PBC", - "IMI", - 'R', - ItemList.Robot_Arm_LV, - 'M', - ItemList.Electric_Motor_LV, - 'P', - ItemList.Electric_Pump_LV, - 'B', - ItemList.Hull_LV, - 'C', - ItemList.Conveyor_Module_LV, - 'I', - ItemList.Electric_Piston_LV - }); + new Object[] { "RMR", "PBC", "IMI", 'R', ItemList.Robot_Arm_LV, 'M', ItemList.Electric_Motor_LV, 'P', + ItemList.Electric_Pump_LV, 'B', ItemList.Hull_LV, 'C', ItemList.Conveyor_Module_LV, 'I', + ItemList.Electric_Piston_LV }); GT_ModHandler.addCraftingRecipe( GregtechItemList.AcceleratorMV.get(1L), - GT_ModHandler.RecipeBits.DISMANTLEABLE - | GT_ModHandler.RecipeBits.NOT_REMOVABLE + GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED, - new Object[] { - "RMR", - "PBC", - "IMI", - 'R', - ItemList.Robot_Arm_MV, - 'M', - ItemList.Electric_Motor_MV, - 'P', - ItemList.Electric_Pump_MV, - 'B', - ItemList.Hull_MV, - 'C', - ItemList.Conveyor_Module_MV, - 'I', - ItemList.Electric_Piston_MV - }); + new Object[] { "RMR", "PBC", "IMI", 'R', ItemList.Robot_Arm_MV, 'M', ItemList.Electric_Motor_MV, 'P', + ItemList.Electric_Pump_MV, 'B', ItemList.Hull_MV, 'C', ItemList.Conveyor_Module_MV, 'I', + ItemList.Electric_Piston_MV }); GT_ModHandler.addCraftingRecipe( GregtechItemList.AcceleratorHV.get(1L), - GT_ModHandler.RecipeBits.DISMANTLEABLE - | GT_ModHandler.RecipeBits.NOT_REMOVABLE + GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED, - new Object[] { - "RMR", - "PBC", - "IMI", - 'R', - ItemList.Robot_Arm_HV, - 'M', - ItemList.Electric_Motor_HV, - 'P', - ItemList.Electric_Pump_HV, - 'B', - ItemList.Hull_HV, - 'C', - ItemList.Conveyor_Module_HV, - 'I', - ItemList.Electric_Piston_HV - }); + new Object[] { "RMR", "PBC", "IMI", 'R', ItemList.Robot_Arm_HV, 'M', ItemList.Electric_Motor_HV, 'P', + ItemList.Electric_Pump_HV, 'B', ItemList.Hull_HV, 'C', ItemList.Conveyor_Module_HV, 'I', + ItemList.Electric_Piston_HV }); GT_ModHandler.addCraftingRecipe( GregtechItemList.AcceleratorEV.get(1L), - GT_ModHandler.RecipeBits.DISMANTLEABLE - | GT_ModHandler.RecipeBits.NOT_REMOVABLE + GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED, - new Object[] { - "RMR", - "PBC", - "IMI", - 'R', - ItemList.Robot_Arm_EV, - 'M', - ItemList.Electric_Motor_EV, - 'P', - ItemList.Electric_Pump_EV, - 'B', - ItemList.Hull_EV, - 'C', - ItemList.Conveyor_Module_EV, - 'I', - ItemList.Electric_Piston_EV - }); + new Object[] { "RMR", "PBC", "IMI", 'R', ItemList.Robot_Arm_EV, 'M', ItemList.Electric_Motor_EV, 'P', + ItemList.Electric_Pump_EV, 'B', ItemList.Hull_EV, 'C', ItemList.Conveyor_Module_EV, 'I', + ItemList.Electric_Piston_EV }); GT_ModHandler.addCraftingRecipe( GregtechItemList.AcceleratorIV.get(1L), - GT_ModHandler.RecipeBits.DISMANTLEABLE - | GT_ModHandler.RecipeBits.NOT_REMOVABLE + GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED, - new Object[] { - "RMR", - "PBC", - "IMI", - 'R', - ItemList.Robot_Arm_IV, - 'M', - ItemList.Electric_Motor_IV, - 'P', - ItemList.Electric_Pump_IV, - 'B', - ItemList.Hull_IV, - 'C', - ItemList.Conveyor_Module_IV, - 'I', - ItemList.Electric_Piston_IV - }); + new Object[] { "RMR", "PBC", "IMI", 'R', ItemList.Robot_Arm_IV, 'M', ItemList.Electric_Motor_IV, 'P', + ItemList.Electric_Pump_IV, 'B', ItemList.Hull_IV, 'C', ItemList.Conveyor_Module_IV, 'I', + ItemList.Electric_Piston_IV }); GT_ModHandler.addCraftingRecipe( GregtechItemList.AcceleratorLuV.get(1L), - GT_ModHandler.RecipeBits.DISMANTLEABLE - | GT_ModHandler.RecipeBits.NOT_REMOVABLE + GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED, - new Object[] { - "RMR", - "PBC", - "IMI", - 'R', - ItemList.Robot_Arm_LuV, - 'M', - ItemList.Electric_Motor_LuV, - 'P', - ItemList.Electric_Pump_LuV, - 'B', - ItemList.Hull_LuV, - 'C', - ItemList.Conveyor_Module_LuV, - 'I', - ItemList.Electric_Piston_LuV - }); + new Object[] { "RMR", "PBC", "IMI", 'R', ItemList.Robot_Arm_LuV, 'M', ItemList.Electric_Motor_LuV, 'P', + ItemList.Electric_Pump_LuV, 'B', ItemList.Hull_LuV, 'C', ItemList.Conveyor_Module_LuV, 'I', + ItemList.Electric_Piston_LuV }); GT_ModHandler.addCraftingRecipe( GregtechItemList.AcceleratorZPM.get(1L), - GT_ModHandler.RecipeBits.DISMANTLEABLE - | GT_ModHandler.RecipeBits.NOT_REMOVABLE + GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED, - new Object[] { - "RMR", - "PBC", - "IMI", - 'R', - ItemList.Robot_Arm_ZPM, - 'M', - ItemList.Electric_Motor_ZPM, - 'P', - ItemList.Electric_Pump_ZPM, - 'B', - ItemList.Hull_ZPM, - 'C', - ItemList.Conveyor_Module_ZPM, - 'I', - ItemList.Electric_Piston_ZPM - }); + new Object[] { "RMR", "PBC", "IMI", 'R', ItemList.Robot_Arm_ZPM, 'M', ItemList.Electric_Motor_ZPM, 'P', + ItemList.Electric_Pump_ZPM, 'B', ItemList.Hull_ZPM, 'C', ItemList.Conveyor_Module_ZPM, 'I', + ItemList.Electric_Piston_ZPM }); GT_ModHandler.addCraftingRecipe( GregtechItemList.AcceleratorUV.get(1L), - GT_ModHandler.RecipeBits.DISMANTLEABLE - | GT_ModHandler.RecipeBits.NOT_REMOVABLE + GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED, - new Object[] { - "RMR", - "PBC", - "IMI", - 'R', - ItemList.Robot_Arm_UV, - 'M', - ItemList.Electric_Motor_UV, - 'P', - ItemList.Electric_Pump_UV, - 'B', - ItemList.Hull_UV, - 'C', - ItemList.Conveyor_Module_UV, - 'I', - ItemList.Electric_Piston_UV - }); + new Object[] { "RMR", "PBC", "IMI", 'R', ItemList.Robot_Arm_UV, 'M', ItemList.Electric_Motor_UV, 'P', + ItemList.Electric_Pump_UV, 'B', ItemList.Hull_UV, 'C', ItemList.Conveyor_Module_UV, 'I', + ItemList.Electric_Piston_UV }); } } |