diff options
Diffstat (limited to 'src/Java/gtPlusPlus')
202 files changed, 7512 insertions, 6805 deletions
diff --git a/src/Java/gtPlusPlus/GTplusplus.java b/src/Java/gtPlusPlus/GTplusplus.java index 7432c1905d..a70ce24e45 100644 --- a/src/Java/gtPlusPlus/GTplusplus.java +++ b/src/Java/gtPlusPlus/GTplusplus.java @@ -6,11 +6,13 @@ import static gtPlusPlus.core.lib.CORE.ConfigSwitches.enableCustomCapes; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.util.Collection; +import java.util.HashMap; import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.Mod.EventHandler; import cpw.mods.fml.common.SidedProxy; import cpw.mods.fml.common.event.*; +import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.relauncher.IFMLLoadingPlugin.MCVersion; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @@ -52,6 +54,8 @@ import gtPlusPlus.xmod.gregtech.loaders.GT_Material_Loader; import gtPlusPlus.xmod.gregtech.loaders.RecipeGen_BlastSmelterGT_GTNH; import gtPlusPlus.xmod.gregtech.loaders.RecipeGen_MultisUsingFluidInsteadOfCells; import gtPlusPlus.xmod.thaumcraft.commands.CommandDumpAspects; +import net.minecraft.block.Block; +import net.minecraft.item.Item; import net.minecraft.launchwrapper.Launch; import net.minecraft.util.IIcon; @@ -497,4 +501,64 @@ public class GTplusplus implements ActionListener { mGregMatLoader.enableMaterial(Materials.Force); } + private static final HashMap<String, Item> sMissingItemMappings = new HashMap<String, Item>(); + private static final HashMap<String, Block> sMissingBlockMappings = new HashMap<String, Block>(); + + private static void processMissingMappings() { + sMissingItemMappings.put("miscutils:Ammonium", GameRegistry.findItem(CORE.MODID, "itemCellAmmonium")); + sMissingItemMappings.put("miscutils:Hydroxide", GameRegistry.findItem(CORE.MODID, "itemCellHydroxide")); + sMissingItemMappings.put("miscutils:BerylliumHydroxide", GameRegistry.findItem(CORE.MODID, "itemCellmiscutils:BerylliumHydroxide")); + sMissingItemMappings.put("miscutils:Bromine", GameRegistry.findItem(CORE.MODID, "itemCellBromine")); + sMissingItemMappings.put("miscutils:Krypton", GameRegistry.findItem(CORE.MODID, "itemCellKrypton")); + sMissingItemMappings.put("miscutils:itemCellZirconiumTetrafluoride", GameRegistry.findItem(CORE.MODID, "ZirconiumTetrafluoride")); + sMissingItemMappings.put("miscutils:Li2BeF4", GameRegistry.findItem(CORE.MODID, "itemCellLithiumTetrafluoroberyllate")); + + // Cryolite + sMissingBlockMappings.put("miscutils:oreCryolite", GameRegistry.findBlock(CORE.MODID, "oreCryoliteF")); + sMissingItemMappings.put("miscutils:itemDustTinyCryolite", GameRegistry.findItem(CORE.MODID, "itemDustTinyCryoliteF")); + sMissingItemMappings.put("miscutils:itemDustSmallCryolite", GameRegistry.findItem(CORE.MODID, "itemDustSmallCryoliteF")); + sMissingItemMappings.put("miscutils:itemDustCryolite", GameRegistry.findItem(CORE.MODID, "itemDustCryoliteF")); + sMissingItemMappings.put("miscutils:dustPureCryolite", GameRegistry.findItem(CORE.MODID, "dustPureCryoliteF")); + sMissingItemMappings.put("miscutils:dustImpureCryolite", GameRegistry.findItem(CORE.MODID, "dustImpureCryoliteF")); + sMissingItemMappings.put("miscutils:crushedCryolite", GameRegistry.findItem(CORE.MODID, "crushedCryoliteF")); + sMissingItemMappings.put("miscutils:crushedPurifiedCryolite", GameRegistry.findItem(CORE.MODID, "crushedPurifiedCryoliteF")); + sMissingItemMappings.put("miscutils:crushedCentrifugedCryolite", GameRegistry.findItem(CORE.MODID, "crushedCentrifugedCryoliteF")); + sMissingItemMappings.put("miscutils:oreCryolite", GameRegistry.findItem(CORE.MODID, "oreCryoliteF")); + } + + @Mod.EventHandler + public void missingMapping(FMLMissingMappingsEvent event) { + processMissingMappings(); + for (FMLMissingMappingsEvent.MissingMapping mapping : event.get()) { + if (mapping.type == GameRegistry.Type.ITEM) { + Item aReplacement = sMissingItemMappings.get(mapping.name); + if (aReplacement != null) { + remap(aReplacement, mapping); + } + else { + //Logger.INFO("Unable to remap: "+mapping.name+", item has no replacement mapping."); + } + } + else if (mapping.type == GameRegistry.Type.BLOCK) { + Block aReplacement = sMissingBlockMappings.get(mapping.name); + if (aReplacement != null) { + remap(aReplacement, mapping); + } + else { + //Logger.INFO("Unable to remap: "+mapping.name+", block has no replacement mapping."); + } + } + } + } + + private static void remap(Item item, FMLMissingMappingsEvent.MissingMapping mapping) { + mapping.remap(item); + Logger.INFO("Remapping item " + mapping.name + " to " + CORE.MODID + ":" + item.getUnlocalizedName()); + } + + private static void remap(Block block, FMLMissingMappingsEvent.MissingMapping mapping) { + mapping.remap(block); + Logger.INFO("Remapping block " + mapping.name + " to " + CORE.MODID + ":" + block.getUnlocalizedName()); + } + } diff --git a/src/Java/gtPlusPlus/api/objects/Logger.java b/src/Java/gtPlusPlus/api/objects/Logger.java index ecc28d4a59..1a1da6868b 100644 --- a/src/Java/gtPlusPlus/api/objects/Logger.java +++ b/src/Java/gtPlusPlus/api/objects/Logger.java @@ -121,7 +121,7 @@ public class Logger { */ public static void MATERIALS(final String s) { if (enabled) { - if (/* CORE_Preloader.DEV_ENVIRONMENT || */CORE_Preloader.DEBUG_MODE) { + if (CORE_Preloader.DEV_ENVIRONMENT || CORE_Preloader.DEBUG_MODE) { modLogger.info("[Materials] "+s); } } diff --git a/src/Java/gtPlusPlus/api/objects/data/AutoMap.java b/src/Java/gtPlusPlus/api/objects/data/AutoMap.java index 02517097cf..e04f1af03a 100644 --- a/src/Java/gtPlusPlus/api/objects/data/AutoMap.java +++ b/src/Java/gtPlusPlus/api/objects/data/AutoMap.java @@ -153,14 +153,12 @@ public class AutoMap<V> implements Iterable<V>, Cloneable, Serializable, Collect } @SuppressWarnings("unchecked") - public synchronized V[] toArray() { - Collection<V> col = this.mInternalMap.values(); - List<V> abcList = new ArrayList<V>(); - for (V g : col) { - abcList.add(g); + public V[] toArray() { + V[] toR = (V[]) java.lang.reflect.Array.newInstance(mInternalMap.get(0).getClass(), mInternalMap.size()); + for (int i = 0; i < mInternalMap.size(); i++) { + toR[i] = mInternalMap.get(i); } - return (V[]) abcList.toArray(); - //return (V[]) new AutoArray(this).getGenericArray(); + return toR; } public synchronized final int getInternalID() { diff --git a/src/Java/gtPlusPlus/australia/biome/type/Biome_AustralianDesert.java b/src/Java/gtPlusPlus/australia/biome/type/Biome_AustralianDesert.java index 6986c9931d..666360f058 100644 --- a/src/Java/gtPlusPlus/australia/biome/type/Biome_AustralianDesert.java +++ b/src/Java/gtPlusPlus/australia/biome/type/Biome_AustralianDesert.java @@ -80,7 +80,7 @@ public class Biome_AustralianDesert { public BiomeGenAustralianDesert() { super(CORE.AUSTRALIA_BIOME_DESERT_1_ID); this.setBiomeName("Australian Desert"); - this.setBiomeID(); + //this.setBiomeID(); this.enableRain = true; this.enableSnow = false; this.topBlock = blockTopLayer; @@ -123,16 +123,19 @@ public class Biome_AustralianDesert { } private synchronized boolean setBiomeID() { - BiomeGenBase[] mTempList; try { Field mInternalBiomeList = ReflectionUtils.getField(BiomeGenBase.class, "biomeList"); Field mClone = mInternalBiomeList; - mTempList = (BiomeGenBase[]) mInternalBiomeList.get(null); + BiomeGenBase[] mOriginalList = (BiomeGenBase[]) mInternalBiomeList.get(null); + BiomeGenBase[] mTempList = new BiomeGenBase[mOriginalList.length]; + for (int index=0;index<mTempList.length;index++) { + mTempList[index] = mOriginalList[index]; + } if (mTempList != null){ mTempList[CORE.AUSTRALIA_BIOME_DESERT_1_ID] = this; mInternalBiomeList.set(null, mTempList); if (mTempList != mInternalBiomeList.get(null)){ - ReflectionUtils.setFinalStatic(mInternalBiomeList, mTempList); + ReflectionUtils.setFinalFieldValue(BiomeGenBase.class, mInternalBiomeList, mTempList); Logger.REFLECTION("Set Biome ID for "+this.biomeName+" Biome internally in 'biomeList' field from "+BiomeGenBase.class.getCanonicalName()+"."); return true; } @@ -144,6 +147,7 @@ public class Biome_AustralianDesert { } catch (Exception e) { Logger.REFLECTION("Could not access 'biomeList' field in "+BiomeGenBase.class.getCanonicalName()+"."); + e.printStackTrace(); return false; } } diff --git a/src/Java/gtPlusPlus/australia/biome/type/Biome_AustralianDesert2.java b/src/Java/gtPlusPlus/australia/biome/type/Biome_AustralianDesert2.java index 003c6cbd93..2ac11bb412 100644 --- a/src/Java/gtPlusPlus/australia/biome/type/Biome_AustralianDesert2.java +++ b/src/Java/gtPlusPlus/australia/biome/type/Biome_AustralianDesert2.java @@ -80,7 +80,7 @@ public class Biome_AustralianDesert2 { public BiomeGenAustralianDesert2() { super(CORE.AUSTRALIA_BIOME_DESERT_2_ID); this.setBiomeName("Australian Desert II"); - this.setBiomeID(); + //this.setBiomeID(); this.enableRain = true; this.enableSnow = false; this.topBlock = blockTopLayer; @@ -123,16 +123,19 @@ public class Biome_AustralianDesert2 { } private synchronized boolean setBiomeID() { - BiomeGenBase[] mTempList; try { Field mInternalBiomeList = ReflectionUtils.getField(BiomeGenBase.class, "biomeList"); Field mClone = mInternalBiomeList; - mTempList = (BiomeGenBase[]) mInternalBiomeList.get(null); + BiomeGenBase[] mOriginalList = (BiomeGenBase[]) mInternalBiomeList.get(null); + BiomeGenBase[] mTempList = new BiomeGenBase[mOriginalList.length]; + for (int index=0;index<mTempList.length;index++) { + mTempList[index] = mOriginalList[index]; + } if (mTempList != null){ - mTempList[CORE.AUSTRALIA_BIOME_DESERT_2_ID] = this; + mTempList[CORE.AUSTRALIA_BIOME_DESERT_1_ID] = this; mInternalBiomeList.set(null, mTempList); if (mTempList != mInternalBiomeList.get(null)){ - ReflectionUtils.setFinalStatic(mInternalBiomeList, mTempList); + ReflectionUtils.setFinalFieldValue(BiomeGenBase.class, mInternalBiomeList, mTempList); Logger.REFLECTION("Set Biome ID for "+this.biomeName+" Biome internally in 'biomeList' field from "+BiomeGenBase.class.getCanonicalName()+"."); return true; } @@ -144,6 +147,7 @@ public class Biome_AustralianDesert2 { } catch (Exception e) { Logger.REFLECTION("Could not access 'biomeList' field in "+BiomeGenBase.class.getCanonicalName()+"."); + e.printStackTrace(); return false; } } diff --git a/src/Java/gtPlusPlus/core/block/machine/Machine_SuperJukebox.java b/src/Java/gtPlusPlus/core/block/machine/Machine_SuperJukebox.java index fe8120e635..021279f820 100644 --- a/src/Java/gtPlusPlus/core/block/machine/Machine_SuperJukebox.java +++ b/src/Java/gtPlusPlus/core/block/machine/Machine_SuperJukebox.java @@ -532,14 +532,12 @@ public class Machine_SuperJukebox extends BlockJukebox } return this.getInventory().isItemValidForSlot(slot, itemstack); } + + private final static int[] SIDED_SLOTS = new int[] {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17}; @Override public int[] getAccessibleSlotsFromSide(final int p_94128_1_) { - final int[] accessibleSides = new int[this.getSizeInventory()]; - for (int r = 0; r < this.getInventory().getSizeInventory(); r++) { - accessibleSides[r] = r; - } - return accessibleSides; + return SIDED_SLOTS; } diff --git a/src/Java/gtPlusPlus/core/commands/CommandEnableDebugWhileRunning.java b/src/Java/gtPlusPlus/core/commands/CommandEnableDebugWhileRunning.java index c9cdc41424..493b7d415d 100644 --- a/src/Java/gtPlusPlus/core/commands/CommandEnableDebugWhileRunning.java +++ b/src/Java/gtPlusPlus/core/commands/CommandEnableDebugWhileRunning.java @@ -4,8 +4,10 @@ import java.util.ArrayList; import java.util.List; import java.util.Map; +import cpw.mods.fml.common.registry.GameRegistry; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.api.objects.data.AutoMap; +import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.minecraft.FluidUtils; import gtPlusPlus.core.util.minecraft.ItemUtils; @@ -105,6 +107,20 @@ public class CommandEnableDebugWhileRunning implements ICommand PlayerUtils.messagePlayer(P, ItemUtils.getItemName(mSemiFluidgen)); } }*/ + + else if (argString[0].toLowerCase().equals("inv")) { + final EntityPlayer P = CommandUtils.getPlayer(S); + if (P != null && !P.worldObj.isRemote) { + ItemStack[] aInv = P.inventory.mainInventory; + for (ItemStack aItem : aInv) { + if (aItem != null) { + String aModID = GameRegistry.findUniqueIdentifierFor(aItem.getItem()).modId; + String aRegistryName = GameRegistry.findUniqueIdentifierFor(aItem.getItem()).name; + Logger.INFO(aModID+":"+aRegistryName); + } + } + } + } else if (argString[0].toLowerCase().equals("hand")) { final EntityPlayer P = CommandUtils.getPlayer(S); if (P != null) { @@ -133,15 +149,21 @@ public class CommandEnableDebugWhileRunning implements ICommand } } - String aFluidContainerData = ""; + AutoMap<String> aFluidContainerData = new AutoMap<String>(); FluidStack aHeldItemFluid = FluidContainerRegistry.getFluidForFilledItem(aHeldItem); if (aHeldItemFluid != null) { - aFluidContainerData = "["+aHeldItemFluid.getUnlocalizedName()+"]["+aHeldItemFluid.getLocalizedName()+"]"; + aFluidContainerData.put("FluidStack Unlocal Name: "+aHeldItemFluid.getUnlocalizedName()); + aFluidContainerData.put("FluidStack Local Name: "+aHeldItemFluid.getLocalizedName()); + aFluidContainerData.put("Fluid Unlocal Name: "+aHeldItemFluid.getFluid().getUnlocalizedName()); + aFluidContainerData.put("Fluid Local Name: "+aHeldItemFluid.getFluid().getLocalizedName()); + aFluidContainerData.put("Fluid Name: "+aHeldItemFluid.getFluid().getName()); } PlayerUtils.messagePlayer(P, "["+aItemUnlocalName+"]"+"["+aItemDisplayName+"] "); - if (aFluidContainerData.length() > 0) { - PlayerUtils.messagePlayer(P, ""+aFluidContainerData); + if (aFluidContainerData.size() > 0) { + for (String s : aFluidContainerData) { + PlayerUtils.messagePlayer(P, ""+s); + } } if (!aOreDictNames.isEmpty()) { PlayerUtils.messagePlayer(P, ""+aOreDictData); diff --git a/src/Java/gtPlusPlus/core/common/CommonProxy.java b/src/Java/gtPlusPlus/core/common/CommonProxy.java index 9565d242c4..c038afce8f 100644 --- a/src/Java/gtPlusPlus/core/common/CommonProxy.java +++ b/src/Java/gtPlusPlus/core/common/CommonProxy.java @@ -3,7 +3,6 @@ package gtPlusPlus.core.common; import cpw.mods.fml.common.event.*; import cpw.mods.fml.common.network.simpleimpl.MessageContext; import cpw.mods.fml.common.registry.GameRegistry; -import gregtech.api.enums.ItemList; import gregtech.api.enums.OrePrefixes; import gtPlusPlus.GTplusplus; import gtPlusPlus.api.objects.Logger; @@ -51,8 +50,6 @@ import net.minecraftforge.client.IItemRenderer; public class CommonProxy { - private boolean mFluidsGenerated = false; - public CommonProxy() { // Should Register Gregtech Materials I've Made Utils.registerEvent(this); @@ -99,11 +96,6 @@ public class CommonProxy { Logger.INFO("[Proxy] Calling Render registrator."); registerRenderThings(); - if (!mFluidsGenerated && ItemList.Cell_Empty.hasBeenSet()) { - Material.generateQueuedFluids(); - mFluidsGenerated = true; - } - } public void init(final FMLInitializationEvent e) { @@ -114,15 +106,6 @@ public class CommonProxy { registerCustomItemsForMaterials(); ModBlocks.blockCustomMobSpawner = new BlockGenericSpawner(); - - if (!mFluidsGenerated && ItemList.Cell_Empty.hasBeenSet()) { - Material.generateQueuedFluids(); - mFluidsGenerated = true; - } else { - Logger.INFO("[ERROR] Did not generate fluids at all."); - Logger.WARNING("[ERROR] Did not generate fluids at all."); - Logger.ERROR("[ERROR] Did not generate fluids at all."); - } CI.init(); FluidFactory.init(); @@ -236,7 +219,7 @@ public class CommonProxy { } public void registerCustomItemsForMaterials() { - Material.registerComponentForMaterial(GenericChem.CARBYNE, OrePrefixes.plate, GregtechItemList.Carbyne_Sheet_Finished.get(1)); + //Material.registerComponentForMaterial(GenericChem.CARBYNE, OrePrefixes.plate, GregtechItemList.Carbyne_Sheet_Finished.get(1)); } public void registerCustomMobDrops() { diff --git a/src/Java/gtPlusPlus/core/config/ConfigHandler.java b/src/Java/gtPlusPlus/core/config/ConfigHandler.java index 7c1b584d87..61610a03e9 100644 --- a/src/Java/gtPlusPlus/core/config/ConfigHandler.java +++ b/src/Java/gtPlusPlus/core/config/ConfigHandler.java @@ -227,8 +227,6 @@ public class ConfigHandler { //pollutionPerSecondMultiGeneratorArray; pollutionPerSecondMultiTreeFarm = config.get("pollution", "pollutionPerSecondMultiTreeFarm", pollutionPerSecondMultiTreeFarm,"pollution rate in gibbl/s for the Tree growth simulator").getInt(pollutionPerSecondMultiTreeFarm); pollutionPerSecondMultiFrothFlotationCell = config.get("pollution", "pollutionPerSecondMultiFrothFlotationCell", pollutionPerSecondMultiFrothFlotationCell,"pollution rate in gibbl/s for the Flotation cell regulator").getInt(pollutionPerSecondMultiFrothFlotationCell); - pollutionPerSecondMultiNuclearReactor_ModeBoosted = config.get("pollution", "pollutionPerSecondMultiNuclearReactor_ModeBoosted", pollutionPerSecondMultiNuclearReactor_ModeBoosted,"pollution rate in gibbl/s for the Thorium reactor when boosted").getInt(pollutionPerSecondMultiNuclearReactor_ModeBoosted); - pollutionPerSecondMultiNuclearReactor_ModeNormal = config.get("pollution", "pollutionPerSecondMultiNuclearReactor_ModeNormal", pollutionPerSecondMultiNuclearReactor_ModeNormal,"pollution rate in gibbl/s for the Thorium reactor").getInt(pollutionPerSecondMultiNuclearReactor_ModeNormal); pollutionPerSecondMultiAutoCrafter = config.get("pollution", "pollutionPerSecondMultiAutoCrafter", pollutionPerSecondMultiAutoCrafter,"pollution rate in gibbl/s for the Large-Scale auto assembler v1.01").getInt(pollutionPerSecondMultiAutoCrafter); pollutionPerSecondMultiThermalBoiler = config.get("pollution", "pollutionPerSecondMultiThermalBoiler", pollutionPerSecondMultiThermalBoiler,"pollution rate in gibbl/s for the Thermal boiler").getInt(pollutionPerSecondMultiThermalBoiler); pollutionPerSecondMultiAlgaePond = config.get("pollution", "pollutionPerSecondMultiAlgaePond", pollutionPerSecondMultiAlgaePond,"pollution rate in gibbl/s for the Algae farm").getInt(pollutionPerSecondMultiAlgaePond); diff --git a/src/Java/gtPlusPlus/core/fluids/FluidFactory.java b/src/Java/gtPlusPlus/core/fluids/FluidFactory.java index da23824c78..d94fa35af7 100644 --- a/src/Java/gtPlusPlus/core/fluids/FluidFactory.java +++ b/src/Java/gtPlusPlus/core/fluids/FluidFactory.java @@ -3,7 +3,6 @@ package gtPlusPlus.core.fluids; import java.util.LinkedHashMap; import java.util.Map; -import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.common.eventhandler.Event.Result; import cpw.mods.fml.common.eventhandler.SubscribeEvent; import cpw.mods.fml.common.registry.GameRegistry; @@ -12,11 +11,11 @@ import gtPlusPlus.GTplusplus.INIT_PHASE; import gtPlusPlus.api.objects.GregtechException; import gtPlusPlus.api.objects.data.AutoMap; import gtPlusPlus.core.item.base.itemblock.FluidItemBlock; +import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.minecraft.FluidUtils; import gtPlusPlus.core.util.minecraft.ItemUtils; import net.minecraft.block.Block; -import net.minecraft.block.material.Material; import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.item.Item; @@ -123,7 +122,8 @@ public class FluidFactory { try { throw new GregtechException("Cannot generate Fluid Packages outside of Pre-Init!"); } catch (GregtechException e) { - FMLCommonHandler.instance().exitJava(0, true); + e.printStackTrace(); + CORE.crash("Cannot generate Fluid Packages outside of Pre-Init!"); } } diff --git a/src/Java/gtPlusPlus/core/fluids/ItemGenericFluidBucket.java b/src/Java/gtPlusPlus/core/fluids/ItemGenericFluidBucket.java index 680068402b..6354be632d 100644 --- a/src/Java/gtPlusPlus/core/fluids/ItemGenericFluidBucket.java +++ b/src/Java/gtPlusPlus/core/fluids/ItemGenericFluidBucket.java @@ -5,7 +5,6 @@ import java.util.List; import java.util.Map; import cpw.mods.fml.common.eventhandler.Event; -import cpw.mods.fml.common.FMLCommonHandler; import gtPlusPlus.api.objects.GregtechException; import gtPlusPlus.api.objects.data.AutoMap; import gtPlusPlus.core.lib.CORE; @@ -45,7 +44,8 @@ public class ItemGenericFluidBucket extends ItemBucket { try { throw new GregtechException(""+aID+" is already registered! Unable to register fluid: "+FluidFactory.mMetaToFluidMap.get(aID).getLocalizedName()); } catch (GregtechException e) { - FMLCommonHandler.instance().exitJava(0, true); + e.printStackTrace(); + CORE.crash(""+aID+" is already registered! Unable to register fluid: "+FluidFactory.mMetaToFluidMap.get(aID).getLocalizedName()); } } mInternalFluidCache.put(FluidFactory.mMetaToBlockMap.get(aID)); diff --git a/src/Java/gtPlusPlus/core/handler/BookHandler.java b/src/Java/gtPlusPlus/core/handler/BookHandler.java index 4bfd39e9a3..d85de925bf 100644 --- a/src/Java/gtPlusPlus/core/handler/BookHandler.java +++ b/src/Java/gtPlusPlus/core/handler/BookHandler.java @@ -288,49 +288,49 @@ public class BookHandler { "XXXXXXX", "Layer 2:" + "\n" + "\n" + - "AAAAAAA" + "\n" + + "XAAAAAX" + "\n" + "AMMMMMA" + "\n" + "AMCCCMA" + "\n" + "AMCCCMA" + "\n" + "AMCCCMA" + "\n" + "AMMMMMA" + "\n" + - "AAAAAAA", + "XAAAAAX", "Layer 3:" + "\n" + "\n" + - "AAAAAAA" + "\n" + + "XAAAAAX" + "\n" + "AAAAAAA" + "\n" + "AAPPPAA" + "\n" + "AAPPPAA" + "\n" + "AAPPPAA" + "\n" + "AAAAAAA" + "\n" + - "AAAAAAA", + "XAAAAAX", "Layer 4:" + "\n" + "\n" + - "AAAAAAA" + "\n" + + "XAAAAAX" + "\n" + "AAAAAAA" + "\n" + "AACCCAA" + "\n" + "AACCCAA" + "\n" + "AACCCAA" + "\n" + "AAAAAAA" + "\n" + - "AAAAAAA", + "XAAAAAX", "Layer 5:" + "\n" + "\n" + - "AAAAAAA" + "\n" + + "XAAAAAX" + "\n" + "AAAAAAA" + "\n" + "AAPPPAA" + "\n" + "AAPPPAA" + "\n" + "AAPPPAA" + "\n" + "AAAAAAA" + "\n" + - "AAAAAAA", + "XAAAAAX", "Layer 6:" + "\n" + "\n" + - "AAAAAAA" + "\n" + + "XAAAAAX" + "\n" + "AMMMMMA" + "\n" + "AMCCCMA" + "\n" + "AMCCCMA" + "\n" + "AMCCCMA" + "\n" + "AMMMMMA" + "\n" + - "AAAAAAA", + "XAAAAAX", "Layer 7:" + "\n" + "\n" + "XXXXXXX" + "\n" + diff --git a/src/Java/gtPlusPlus/core/handler/COMPAT_HANDLER.java b/src/Java/gtPlusPlus/core/handler/COMPAT_HANDLER.java index 4fda17ee8a..53d63499a6 100644 --- a/src/Java/gtPlusPlus/core/handler/COMPAT_HANDLER.java +++ b/src/Java/gtPlusPlus/core/handler/COMPAT_HANDLER.java @@ -43,6 +43,8 @@ import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; import gtPlusPlus.xmod.gregtech.common.tileentities.machines.basic.GregtechMetaGarbageCollector; import gtPlusPlus.xmod.gregtech.loaders.RecipeGen_FluidCanning; import gtPlusPlus.xmod.gregtech.loaders.RecipeGen_Recycling; +import gtPlusPlus.xmod.gregtech.loaders.recipe.RecipeLoader_GTNH; +import gtPlusPlus.xmod.gregtech.loaders.recipe.RecipeLoader_Nuclear; import gtPlusPlus.xmod.gregtech.registration.gregtech.*; import net.minecraft.item.ItemStack; @@ -228,7 +230,9 @@ public class COMPAT_HANDLER { public static void startLoadingGregAPIBasedRecipes(){ //Add hand-made recipes - RECIPES_GREGTECH.run(); + RECIPES_GREGTECH.run(); + RecipeLoader_GTNH.generate(); + RecipeLoader_Nuclear.generate(); //Add autogenerated Recipes from Item Components for (Set<RunnableWithInfo<Material>> m : MaterialGenerator.mRecipeMapsToGenerate) { for (RunnableWithInfo<Material> r : m) { diff --git a/src/Java/gtPlusPlus/core/handler/StopAnnoyingFuckingAchievements.java b/src/Java/gtPlusPlus/core/handler/StopAnnoyingFuckingAchievements.java index b3b720497e..8499f98525 100644 --- a/src/Java/gtPlusPlus/core/handler/StopAnnoyingFuckingAchievements.java +++ b/src/Java/gtPlusPlus/core/handler/StopAnnoyingFuckingAchievements.java @@ -38,7 +38,7 @@ public class StopAnnoyingFuckingAchievements { Field aGameSettings = ReflectionUtils.getField(aClazz2, "gameSettings"); Object aGameSettingsObj = ReflectionUtils.getFieldValue(aInstanceMC, aGameSettings); Class aClazz3 = aGameSettingsObj.getClass(); - if (aClazz2 != null) { + if (aClazz3 != null) { Field ainvHint = ReflectionUtils.getField(aClazz3, "showInventoryAchievementHint"); ReflectionUtils.setField(aGameSettingsObj, ainvHint, false); } diff --git a/src/Java/gtPlusPlus/core/item/ModItems.java b/src/Java/gtPlusPlus/core/item/ModItems.java index 1e0b779bac..4c6f0dc712 100644 --- a/src/Java/gtPlusPlus/core/item/ModItems.java +++ b/src/Java/gtPlusPlus/core/item/ModItems.java @@ -5,6 +5,7 @@ import static gtPlusPlus.core.lib.CORE.LOAD_ALL_CONTENT; import cpw.mods.fml.common.registry.GameRegistry; import gregtech.api.enums.Materials; +import gregtech.api.enums.OrePrefixes; import gregtech.api.util.GT_OreDictUnificator; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.block.base.BasicBlock.BlockTypes; @@ -13,6 +14,7 @@ import gtPlusPlus.core.common.compat.COMPAT_Baubles; import gtPlusPlus.core.creative.AddToCreativeTab; import gtPlusPlus.core.item.base.*; import gtPlusPlus.core.item.base.BaseItemComponent.ComponentTypes; +import gtPlusPlus.core.item.base.dusts.BaseItemDust; import gtPlusPlus.core.item.base.foil.BaseItemFoil; import gtPlusPlus.core.item.base.foods.BaseItemFood; import gtPlusPlus.core.item.base.foods.BaseItemHotFood; @@ -231,7 +233,17 @@ public final class ModItems { public static Item dustFertUN18; public static Item dustFertUN32; - public static Fluid fluidFLiBeSalt; + //public static Fluid fluidFLiBeSalt; + //public static Fluid fluidFLiBeSaltBurnt; + + public static Fluid fluidLftrCore1; + public static Fluid fluidLftrCore2; + public static Fluid fluidLftrCore3; + public static Fluid fluidLftrCore4; + public static Fluid fluidLftrBlanket1; + public static Fluid fluidLftrBlanket2; + public static Fluid fluidLftrBlanket3; + public static Fluid fluidNuclearWaste; //Possibly missing base items that GT may be missing. @@ -245,6 +257,7 @@ public final class ModItems { public static Item itemDoublePlateClay; public static Item itemDoublePlateEuropium; public static Item itemFoilUranium235; + public static Item itemDustIndium; public static BlockBaseModular blockRawMeat; public static Item itemBoilerChassis; @@ -283,6 +296,7 @@ public final class ModItems { public static Item dustNeptunium238; public static Item dustDecayedRadium226; public static Item dustRadium226; + public static Item dustProtactinium233; public static ItemGiantEgg itemBigEgg; @@ -458,6 +472,8 @@ public final class ModItems { MaterialGenerator.generate(ELEMENT.getInstance().IODINE); //LFTR byproduct MaterialGenerator.generate(ELEMENT.getInstance().HAFNIUM); MaterialGenerator.generate(ELEMENT.getInstance().DYSPROSIUM); + MaterialGenerator.generate(ELEMENT.getInstance().ERBIUM); + MaterialGenerator.generate(ELEMENT.getInstance().PRASEODYMIUM); MaterialGenerator.generate(ELEMENT.getInstance().TELLURIUM); //LFTR byproduct MaterialGenerator.generate(ELEMENT.getInstance().RHODIUM); MaterialGenerator.generate(ELEMENT.getInstance().RHENIUM); @@ -536,30 +552,31 @@ public final class ModItems { MaterialGenerator.generate(ALLOY.TUNGSTEN_TITANIUM_CARBIDE); //LFTR Fuel components - MaterialGenerator.generate(MISC_MATERIALS.HYDROXIDE); //LFTR fuel component - MaterialGenerator.generate(MISC_MATERIALS.AMMONIA); //LFTR fuel component - MaterialGenerator.generate(MISC_MATERIALS.AMMONIUM); //LFTR fuel component - MaterialGenerator.generate(FLUORIDES.AMMONIUM_BIFLUORIDE); //LFTR fuel component - MaterialGenerator.generate(FLUORIDES.BERYLLIUM_HYDROXIDE); //LFTR fuel component - MaterialGenerator.generate(FLUORIDES.AMMONIUM_TETRAFLUOROBERYLLATE); //LFTR fuel component + //MaterialGenerator.generate(MISC_MATERIALS.HYDROXIDE); //LFTR fuel component + //MaterialGenerator.generate(MISC_MATERIALS.AMMONIA); //LFTR fuel component + //MaterialGenerator.generate(MISC_MATERIALS.AMMONIUM); //LFTR fuel component + MaterialGenerator.generateNuclearDusts(FLUORIDES.AMMONIUM_BIFLUORIDE); //LFTR fuel component + MaterialGenerator.generateNuclearDusts(FLUORIDES.BERYLLIUM_HYDROXIDE); //LFTR fuel component + MaterialGenerator.generateNuclearDusts(FLUORIDES.AMMONIUM_TETRAFLUOROBERYLLATE); //LFTR fuel component //Generate Fluorides - MaterialGenerator.generateNuclearMaterial(FLUORIDES.BERYLLIUM_FLUORIDE); - MaterialGenerator.generateNuclearMaterial(FLUORIDES.LITHIUM_FLUORIDE); - MaterialGenerator.generateNuclearMaterial(FLUORIDES.THORIUM_TETRAFLUORIDE); - MaterialGenerator.generateNuclearMaterial(FLUORIDES.THORIUM_HEXAFLUORIDE); - MaterialGenerator.generateNuclearMaterial(FLUORIDES.URANIUM_TETRAFLUORIDE); - MaterialGenerator.generateNuclearMaterial(FLUORIDES.URANIUM_HEXAFLUORIDE); - MaterialGenerator.generateNuclearMaterial(FLUORIDES.ZIRCONIUM_TETRAFLUORIDE); + MaterialGenerator.generateNuclearDusts(FLUORIDES.BERYLLIUM_FLUORIDE); + MaterialGenerator.generateNuclearDusts(FLUORIDES.LITHIUM_FLUORIDE); + MaterialGenerator.generateNuclearDusts(FLUORIDES.THORIUM_TETRAFLUORIDE); + MaterialGenerator.generateNuclearDusts(FLUORIDES.THORIUM_HEXAFLUORIDE); + MaterialGenerator.generateNuclearDusts(FLUORIDES.URANIUM_TETRAFLUORIDE, false); + MaterialGenerator.generateNuclearDusts(FLUORIDES.URANIUM_HEXAFLUORIDE, false); + MaterialGenerator.generateNuclearDusts(FLUORIDES.ZIRCONIUM_TETRAFLUORIDE); //LFTR Fluoride outputs - MaterialGenerator.generateNuclearMaterial(FLUORIDES.NEPTUNIUM_HEXAFLUORIDE); - MaterialGenerator.generateNuclearMaterial(FLUORIDES.TECHNETIUM_HEXAFLUORIDE); - MaterialGenerator.generateNuclearMaterial(FLUORIDES.SELENIUM_HEXAFLUORIDE); + MaterialGenerator.generateNuclearDusts(FLUORIDES.NEPTUNIUM_HEXAFLUORIDE); + MaterialGenerator.generateNuclearDusts(FLUORIDES.TECHNETIUM_HEXAFLUORIDE); + MaterialGenerator.generateNuclearDusts(FLUORIDES.SELENIUM_HEXAFLUORIDE); //Generate Reactor Fuel Salts - MaterialGenerator.generateNuclearMaterial(NUCLIDE.LiFBeF2ZrF4U235, false); - MaterialGenerator.generateNuclearMaterial(NUCLIDE.LiFBeF2ZrF4UF4, false); - MaterialGenerator.generateNuclearMaterial(NUCLIDE.LiFBeF2ThF4UF4, false); + MaterialGenerator.generateNuclearDusts(NUCLIDE.LiFBeF2ZrF4U235); + MaterialGenerator.generateNuclearDusts(NUCLIDE.LiFBeF2ZrF4UF4); + MaterialGenerator.generateNuclearDusts(NUCLIDE.LiFBeF2ThF4UF4); + //MaterialGenerator.generateNuclearMaterial(NUCLIDE.Li2BeF4, false); //Generate some Alloys @@ -626,12 +643,14 @@ public final class ModItems { MaterialGenerator.generate(ALLOY.TRINIUM_REINFORCED_STEEL); //Top Tier Alloys + MaterialGenerator.generate(ALLOY.HELICOPTER); MaterialGenerator.generate(ALLOY.LAFIUM); MaterialGenerator.generate(ALLOY.CINOBITE); MaterialGenerator.generate(ALLOY.PIKYONIUM); MaterialGenerator.generate(ALLOY.ABYSSAL); MaterialGenerator.generate(ALLOY.LAURENIUM); MaterialGenerator.generate(ALLOY.BOTMIUM); + MaterialGenerator.generate(ALLOY.HS188A); MaterialGenerator.generate(ALLOY.TITANSTEEL); @@ -710,12 +729,26 @@ public final class ModItems { GT_OreDictUnificator.registerOre("dustCalciumSulfate", ItemUtils.getItemStackOfAmountFromOreDictNoBroken("dustGypsum", 1)); } dustLi2CO3CaOH2 = ItemUtils.generateSpecialUseDusts("Li2CO3CaOH2", "Li2CO3 + Ca(OH)2 Compound", "Li2CO3CaOH2", Utils.rgbtoHexValue(255, 255, 255))[0]; //https://en.wikipedia.org/wiki/Calcium_carbonate - + MaterialUtils.generateSpecialDustAndAssignToAMaterial(FLUORIDES.SODIUM_FLUORIDE, false); //FLiBe Fuel Compounds - dustLi2BeF4 = ItemUtils.generateSpecialUseDusts("Li2BeF4", "Li2BeF4 Fuel Compound", "Li2BeF4", Utils.rgbtoHexValue(255, 255, 255))[0]; //https://en.wikipedia.org/wiki/FLiBe + dustLi2BeF4 = ItemUtils.generateSpecialUseDusts("Li2BeF4", "Lithium Tetrafluoroberyllate Fuel Compound", "Li2BeF4", Utils.rgbtoHexValue(255, 255, 255))[0]; //https://en.wikipedia.org/wiki/FLiBe + Material.registerComponentForMaterial(NUCLIDE.Li2BeF4, OrePrefixes.dust, ItemUtils.getSimpleStack(dustLi2BeF4)); //fluidFLiBeSalt = ("Li2BeF4", "Li2BeF4", 7430, new short[]{255, 255, 255, 100}, 0); - fluidFLiBeSalt = FluidUtils.addGTFluidNoPrefix("Li2BeF4", "Li2BeF4", new short[]{255, 255, 255, 100}, 0, 743, null, CI.emptyCells(1), 1000, true); - + //fluidFLiBeSalt = FluidUtils.addGTFluidNoPrefix("Li2BeF4", "Lithium Tetrafluoroberyllate", new short[]{255, 255, 255, 100}, 0, 743, null, CI.emptyCells(1), 1000, true); + //fluidFLiBeSaltBurnt = FluidUtils.addGTFluidNoPrefix("Li2BeF2UF4", "Li2BeF2UF4", new short[]{50, 255, 50, 100}, 0, 743, null, CI.emptyCells(1), 1000, true); + + // LFTR Core Fluid Processing + //fluidLftrCore1 = FluidUtils.addGTFluidNoPrefix("LiBeF2UF4FP", "LiBeF2UF4FP", new short[]{110, 255, 110, 100}, 0, 800, null, CI.emptyCells(1), 1000, true); + //fluidLftrCore2 = FluidUtils.addGTFluidNoPrefix("UF6F2FP", "UF6F2FP", new short[]{150, 255, 150, 100}, 0, 800, null, CI.emptyCells(1), 1000, true); + //fluidLftrCore3 = FluidUtils.addGTFluidNoPrefix("LiFBeF2", "LiFBeF2", new short[]{100, 255, 50, 100}, 0, 800, null, CI.emptyCells(1), 1000, true); + //fluidLftrCore4 = FluidUtils.addGTFluidNoPrefix("LiFBeF2UF4", "LiFBeF2UF4", new short[]{50, 255, 100, 100}, 0, 800, null, CI.emptyCells(1), 1000, true); + // LFTR Blanket Fluid Processing + //fluidLftrBlanket1 = FluidUtils.addGTFluidNoPrefix("LiFThF4", "LiFThF4", new short[]{50, 150, 255, 50}, 0, 500, null, CI.emptyCells(1), 1000, true); + //fluidLftrBlanket2 = FluidUtils.addGTFluidNoPrefix("LiFBeF2ThF4", "LiFBeF2ThF4", new short[]{100, 150, 100, 100}, 0, 500, null, CI.emptyCells(1), 1000, true); + //fluidLftrBlanket3 = FluidUtils.addGTFluidNoPrefix("UF6F2", "UF6F2", new short[]{10, 150, 10, 100}, 0, 500, null, CI.emptyCells(1), 1000, true); + fluidNuclearWaste = FluidUtils.addGTFluidNoPrefix("nuclear.waste", "Nuclear Waste", new short[]{10, 250, 10, 100}, 0, 1000, null, CI.emptyCells(1), 1000, true); + + //LFTR Control Circuit itemCircuitLFTR = new CoreItem("itemCircuitLFTR", ""+EnumChatFormatting.GREEN+"Control Circuit", AddToCreativeTab.tabMisc, 1, 0, new String[] {"Keeps Multiblocks Stable"}, EnumRarity.epic, EnumChatFormatting.DARK_GREEN, false, null); @@ -737,7 +770,8 @@ public final class ModItems { //GT_OreDictUnificator.registerOre("cellZrF4", ItemUtils.getItemStackOfAmountFromOreDict("cellZirconiumTetrafluoride", 1)); //GT_OreDictUnificator.registerOre("dustZrF4", ItemUtils.getItemStackOfAmountFromOreDict("dustZirconiumTetrafluoride", 1)); fluidZrF4 = FluidUtils.generateFluidNoPrefix("ZirconiumTetrafluoride", "Zirconium Tetrafluoride", 500, new short[]{170, 170, 140, 100}); //https://en.wikipedia.org/wiki/Zirconium_tetrafluoride - + FLUORIDES.ZIRCONIUM_TETRAFLUORIDE.setFluid(fluidZrF4); + //Coolant Salt //NaBF4 - NaF - 621C //dustNaBF4NaF = ItemUtils.generateSpecialUseDusts("NaBF4NaF", "NaBF4NaF", Utils.rgbtoHexValue(45, 45, 90))[0]; //https://en.wikipedia.org/wiki/Zirconium_tetrafluoride @@ -831,6 +865,11 @@ public final class ModItems { else { itemHotTitaniumIngot = ItemUtils.getItemStackOfAmountFromOreDictNoBroken("ingotHotTitanium", 1); } + + //Need this for Laurenium + if (ItemUtils.getItemStackOfAmountFromOreDictNoBroken("dustIndium", 1) == null){ + itemDustIndium = new BaseItemDust(ELEMENT.getInstance().INDIUM); + } //Industrial Diamonds itemExquisiteIndustrialDiamond = new CoreItem("IndustrialDiamondExquisite", "High Quality Industrial Diamond", tabMisc); @@ -938,7 +977,7 @@ public final class ModItems { dustNeptunium238 = new DustDecayable("dustNeptunium238", Utils.rgbtoHexValue(175, 240, 75), 50640, new String[] {""+StringUtils.superscript("238Np"), "Result: Plutonium 238 ("+StringUtils.superscript("238Pu")+")"}, ELEMENT.getInstance().PLUTONIUM238.getDust(1).getItem(), 5); dustDecayedRadium226 = ItemUtils.generateSpecialUseDusts("DecayedRadium226", "Decayed Radium-226", "Contains Radon ("+StringUtils.superscript("222Rn")+")", ELEMENT.getInstance().RADIUM.getRgbAsHex())[0]; dustRadium226 = new DustDecayable("dustRadium226", ELEMENT.getInstance().RADIUM.getRgbAsHex(), 90000, new String[] {""+StringUtils.superscript("226Ra"), "Result: Radon ("+StringUtils.superscript("222Rn")+")"}, ItemUtils.getSimpleStack(dustDecayedRadium226).getItem(), 5); - + dustProtactinium233 = new DustDecayable("dustProtactinium233", ELEMENT.getInstance().PROTACTINIUM.getRgbAsHex(), 32000, new String[] {""+StringUtils.superscript("233Pa"), "Result: Uranium 233("+StringUtils.superscript("233U")+")"}, ELEMENT.getInstance().URANIUM233.getDust(1).getItem(), 6); dustTechnetium99 = new DustDecayable("dustTechnetium99", ELEMENT.getInstance().TECHNETIUM.getRgbAsHex(), 164500, new String[] {""+StringUtils.superscript("99Mo"), "Result: Ruthenium 99("+StringUtils.superscript("99Ru")+")"}, ELEMENT.getInstance().RUTHENIUM.getDust(1).getItem(), 4); dustTechnetium99M = new DustDecayable("dustTechnetium99M", ELEMENT.getInstance().TECHNETIUM.getRgbAsHex(), 8570, new String[] {""+StringUtils.superscript("99ᵐTc"), "Result: Technicium 99 ("+StringUtils.superscript("99Tc")+")"}, dustTechnetium99, 4); dustMolybdenum99 = new DustDecayable("dustMolybdenum99", ELEMENT.getInstance().MOLYBDENUM.getRgbAsHex(), 16450, new String[] {""+StringUtils.superscript("99Mo"), "Result: Technicium 99ᵐ ("+StringUtils.superscript("99ᵐTc")+")"}, dustTechnetium99M, 4); @@ -1037,10 +1076,10 @@ public final class ModItems { GT_OreDictUnificator.registerOre("platePhasedIron", ItemUtils.getSimpleStack(itemPlatePulsatingIron)); GT_OreDictUnificator.registerOre("blockVibrantAlloy", ItemUtils.getItemStackOfAmountFromOreDict("blockPhasedGold", 1)); - CORE.RA.addFluidExtractionRecipe(MaterialEIO.REDSTONE_ALLOY.getPlate(1), MaterialEIO.REDSTONE_ALLOY.getFluid(144), 16, 4*9); - CORE.RA.addFluidExtractionRecipe(MaterialEIO.REDSTONE_ALLOY.getIngot(1), MaterialEIO.REDSTONE_ALLOY.getFluid(144), 16, 4*9); - CORE.RA.addFluidExtractionRecipe(MaterialEIO.REDSTONE_ALLOY.getNugget(1), MaterialEIO.REDSTONE_ALLOY.getFluid(16), 16, 4); - CORE.RA.addFluidExtractionRecipe(MaterialEIO.REDSTONE_ALLOY.getBlock(1), MaterialEIO.REDSTONE_ALLOY.getFluid(1294), 16, 4*9*9); + CORE.RA.addFluidExtractionRecipe(MaterialEIO.REDSTONE_ALLOY.getPlate(1), MaterialEIO.REDSTONE_ALLOY.getFluidStack(144), 16, 4*9); + CORE.RA.addFluidExtractionRecipe(MaterialEIO.REDSTONE_ALLOY.getIngot(1), MaterialEIO.REDSTONE_ALLOY.getFluidStack(144), 16, 4*9); + CORE.RA.addFluidExtractionRecipe(MaterialEIO.REDSTONE_ALLOY.getNugget(1), MaterialEIO.REDSTONE_ALLOY.getFluidStack(16), 16, 4); + CORE.RA.addFluidExtractionRecipe(MaterialEIO.REDSTONE_ALLOY.getBlock(1), MaterialEIO.REDSTONE_ALLOY.getFluidStack(1294), 16, 4*9*9); } else { diff --git a/src/Java/gtPlusPlus/core/item/base/BaseItemComponent.java b/src/Java/gtPlusPlus/core/item/base/BaseItemComponent.java index 9b732e38e1..9ad8ea3feb 100644 --- a/src/Java/gtPlusPlus/core/item/base/BaseItemComponent.java +++ b/src/Java/gtPlusPlus/core/item/base/BaseItemComponent.java @@ -84,8 +84,9 @@ public class BaseItemComponent extends Item{ else { aFormattedNameForFluids = unlocalName; } - - this.componentMaterial = null; + Material aTempMaterial = Material.mMaterialCache.get(localName.toLowerCase()); + Logger.INFO("Attempted to get "+localName+" cell material from cache. Valid? "+(aTempMaterial != null)); + this.componentMaterial = aTempMaterial; this.unlocalName = "itemCell"+aFormattedNameForFluids; this.materialName = localName; this.componentType = ComponentTypes.CELL; @@ -94,6 +95,7 @@ public class BaseItemComponent extends Item{ this.setMaxStackSize(64); this.componentColour = MathUtils.getRgbAsHex(RGBA); this.extraData = RGBA; + this.setTextureName(CORE.MODID + ":" + "item"+ComponentTypes.CELL.COMPONENT_NAME); GameRegistry.registerItem(this, aFormattedNameForFluids); GT_OreDictUnificator.registerOre(ComponentTypes.CELL.getOreDictName()+Utils.sanitizeStringKeepBrackets(localName), ItemUtils.getSimpleStack(this)); @@ -177,10 +179,10 @@ public class BaseItemComponent extends Item{ if (this.componentMaterial != null){ - if (!this.componentMaterial.vChemicalFormula.contains("?") && this.componentMaterial.getState() != MaterialState.PURE_LIQUID) { + if (!this.componentMaterial.vChemicalFormula.contains("?")) { list.add(Utils.sanitizeStringKeepBrackets(this.componentMaterial.vChemicalFormula)); } - else if (this.componentMaterial.vChemicalFormula.contains("?") && this.componentMaterial.getState() != MaterialState.PURE_LIQUID) { + else if (this.componentMaterial.vChemicalFormula.contains("?")) { String temp = componentMaterial.vChemicalFormula; temp = temp.replace(" ", ""); temp = temp.replace("-", ""); @@ -202,6 +204,12 @@ public class BaseItemComponent extends Item{ } } } + else { + String aChemicalFormula = Material.sChemicalFormula.get(materialName.toLowerCase()); + if (aChemicalFormula != null && aChemicalFormula.length() > 0) { + list.add(Utils.sanitizeStringKeepBrackets(aChemicalFormula)); + } + } //Hidden Tooltip if (KeyboardUtils.isCtrlKeyDown()) { diff --git a/src/Java/gtPlusPlus/core/item/base/BaseItemTickable.java b/src/Java/gtPlusPlus/core/item/base/BaseItemTickable.java index 79a49f92b7..eb066024e0 100644 --- a/src/Java/gtPlusPlus/core/item/base/BaseItemTickable.java +++ b/src/Java/gtPlusPlus/core/item/base/BaseItemTickable.java @@ -45,6 +45,7 @@ public class BaseItemTickable extends CoreItem { this.maxTicks = maxTicks; this.twoRenderPasses = twoPass; this.ticksInContainers = containerTick; + this.maxStackSize = 1; //setGregtechItemList(); } diff --git a/src/Java/gtPlusPlus/core/item/base/ingots/BaseItemIngot.java b/src/Java/gtPlusPlus/core/item/base/ingots/BaseItemIngot.java index 5f0254bc51..ea96e2914c 100644 --- a/src/Java/gtPlusPlus/core/item/base/ingots/BaseItemIngot.java +++ b/src/Java/gtPlusPlus/core/item/base/ingots/BaseItemIngot.java @@ -1,12 +1,7 @@ package gtPlusPlus.core.item.base.ingots; -import net.minecraft.item.ItemStack; - -import gregtech.api.util.GT_ModHandler; - import gtPlusPlus.core.item.base.BaseItemComponent; import gtPlusPlus.core.material.Material; -import gtPlusPlus.core.util.minecraft.ItemUtils; public class BaseItemIngot extends BaseItemComponent{ @@ -21,18 +16,6 @@ public class BaseItemIngot extends BaseItemComponent{ super(material, type); this.materialName = material.getLocalizedName(); this.unlocalName = material.getUnlocalizedName(); - if (type != ComponentTypes.HOTINGOT) { - this.generateCompressorRecipe(); - } } - private void generateCompressorRecipe(){ - final ItemStack tempStack = componentMaterial.getIngot(9); - final ItemStack tempOutput = componentMaterial.getBlock(1); - if (ItemUtils.checkForInvalidItems(new ItemStack[] {tempStack, tempOutput})){ - GT_ModHandler.addCompressionRecipe(tempStack, tempOutput); - } - } - - } diff --git a/src/Java/gtPlusPlus/core/item/base/ingots/BaseItemIngotHot.java b/src/Java/gtPlusPlus/core/item/base/ingots/BaseItemIngotHot.java index f9acdded7e..c19fecd924 100644 --- a/src/Java/gtPlusPlus/core/item/base/ingots/BaseItemIngotHot.java +++ b/src/Java/gtPlusPlus/core/item/base/ingots/BaseItemIngotHot.java @@ -52,8 +52,8 @@ public class BaseItemIngotHot extends BaseItemIngot{ } private void generateRecipe(){ - Logger.WARNING("Adding Vacuum Freezer recipe for a Hot Ingot of "+this.materialName+"."); - GT_Values.RA.addVacuumFreezerRecipe(ItemUtils.getSimpleStack(this), this.outputIngot.copy(), 60*this.mTier); + Logger.WARNING("Adding Vacuum Freezer recipe for a Hot Ingot of "+this.materialName+"."); + CORE.RA.addVacuumFreezerRecipe(ItemUtils.getSimpleStack(this), this.outputIngot.copy(), (int) Math.max(this.componentMaterial.getMass() * 3L, 1L), this.componentMaterial.vVoltageMultiplier); } @Override diff --git a/src/Java/gtPlusPlus/core/item/base/nugget/BaseItemNugget.java b/src/Java/gtPlusPlus/core/item/base/nugget/BaseItemNugget.java index a6eb598622..1644856bf8 100644 --- a/src/Java/gtPlusPlus/core/item/base/nugget/BaseItemNugget.java +++ b/src/Java/gtPlusPlus/core/item/base/nugget/BaseItemNugget.java @@ -8,4 +8,5 @@ public class BaseItemNugget extends BaseItemComponent{ public BaseItemNugget(final Material material) { super(material, BaseItemComponent.ComponentTypes.NUGGET); } + } diff --git a/src/Java/gtPlusPlus/core/item/base/ore/BaseOreComponent.java b/src/Java/gtPlusPlus/core/item/base/ore/BaseOreComponent.java index 883eb241da..2cb23b3f97 100644 --- a/src/Java/gtPlusPlus/core/item/base/ore/BaseOreComponent.java +++ b/src/Java/gtPlusPlus/core/item/base/ore/BaseOreComponent.java @@ -14,7 +14,6 @@ import gtPlusPlus.core.creative.AddToCreativeTab; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.lib.LoadedMods; import gtPlusPlus.core.material.Material; -import gtPlusPlus.core.material.state.MaterialState; import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.minecraft.EntityUtils; import gtPlusPlus.core.util.minecraft.ItemUtils; @@ -124,10 +123,10 @@ public class BaseOreComponent extends Item{ public final void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) { if (this.materialName != null && !this.materialName.equals("")){ if (this.componentMaterial != null){ - if (!this.componentMaterial.vChemicalFormula.contains("?") && this.componentMaterial.getState() != MaterialState.PURE_LIQUID) { + if (!this.componentMaterial.vChemicalFormula.contains("?")) { list.add(Utils.sanitizeStringKeepBrackets(this.componentMaterial.vChemicalFormula)); } - else if (this.componentMaterial.vChemicalFormula.contains("?") && this.componentMaterial.getState() != MaterialState.PURE_LIQUID) { + else if (this.componentMaterial.vChemicalFormula.contains("?")) { String temp = componentMaterial.vChemicalFormula; temp = temp.replace(" ", ""); temp = temp.replace("-", ""); @@ -142,6 +141,12 @@ public class BaseOreComponent extends Item{ list.add(CORE.GT_Tooltip_Radioactive+" | Level: "+this.componentMaterial.vRadiationLevel); } } + else { + String aChemicalFormula = Material.sChemicalFormula.get(materialName.toLowerCase()); + if (aChemicalFormula != null && aChemicalFormula.length() > 0) { + list.add(Utils.sanitizeStringKeepBrackets(aChemicalFormula)); + } + } } super.addInformation(stack, aPlayer, list, bool); } diff --git a/src/Java/gtPlusPlus/core/item/base/plates/BaseItemPlate.java b/src/Java/gtPlusPlus/core/item/base/plates/BaseItemPlate.java index 34d44cd43e..a810b22c70 100644 --- a/src/Java/gtPlusPlus/core/item/base/plates/BaseItemPlate.java +++ b/src/Java/gtPlusPlus/core/item/base/plates/BaseItemPlate.java @@ -15,6 +15,4 @@ public class BaseItemPlate extends BaseItemComponent{ this(MaterialUtils.generateQuickMaterial(materialName, state, new short[]{colour[0], colour[1], colour[2], 0}, sRadioactivity)); } - - } diff --git a/src/Java/gtPlusPlus/core/item/base/plates/BaseItemPlateDouble.java b/src/Java/gtPlusPlus/core/item/base/plates/BaseItemPlateDouble.java index 373f84b7c5..31f86e8ffa 100644 --- a/src/Java/gtPlusPlus/core/item/base/plates/BaseItemPlateDouble.java +++ b/src/Java/gtPlusPlus/core/item/base/plates/BaseItemPlateDouble.java @@ -16,4 +16,5 @@ public class BaseItemPlateDouble extends BaseItemComponent{ public String getItemStackDisplayName(final ItemStack p_77653_1_) { return ("Double "+this.materialName+ " Plate"); } + } diff --git a/src/Java/gtPlusPlus/core/item/base/rings/BaseItemRing.java b/src/Java/gtPlusPlus/core/item/base/rings/BaseItemRing.java index 62777cc9f5..c83ae94af1 100644 --- a/src/Java/gtPlusPlus/core/item/base/rings/BaseItemRing.java +++ b/src/Java/gtPlusPlus/core/item/base/rings/BaseItemRing.java @@ -8,4 +8,5 @@ public class BaseItemRing extends BaseItemComponent{ public BaseItemRing(final Material material) { super(material, BaseItemComponent.ComponentTypes.RING); } + } diff --git a/src/Java/gtPlusPlus/core/item/base/rods/BaseItemRod.java b/src/Java/gtPlusPlus/core/item/base/rods/BaseItemRod.java index ef3266fe75..f77f846d34 100644 --- a/src/Java/gtPlusPlus/core/item/base/rods/BaseItemRod.java +++ b/src/Java/gtPlusPlus/core/item/base/rods/BaseItemRod.java @@ -1,49 +1,12 @@ package gtPlusPlus.core.item.base.rods; -import net.minecraft.item.ItemStack; - -import gregtech.api.enums.GT_Values; - -import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.item.base.BaseItemComponent; import gtPlusPlus.core.material.Material; -import gtPlusPlus.core.util.minecraft.ItemUtils; public class BaseItemRod extends BaseItemComponent{ public BaseItemRod(final Material material) { super(material, BaseItemComponent.ComponentTypes.ROD); - this.addCutterRecipe(material); - this.addLatheRecipe(material); - } - - - private void addCutterRecipe(Material material){ - Logger.WARNING("Adding cutter recipe for "+this.materialName+" Rods"); - final ItemStack stackStick = this.componentMaterial.getRod(1); - final ItemStack stackBolt = this.componentMaterial.getBolt(4); - - if (ItemUtils.checkForInvalidItems(new ItemStack[] {stackStick, stackBolt})) - GT_Values.RA.addCutterRecipe( - stackStick, - stackBolt, - null, - (int) Math.max(this.componentMaterial.getMass() * 2L, 1L), - material.vVoltageMultiplier); - } - - - private void addLatheRecipe(Material material){ - Logger.WARNING("Adding recipe for "+this.materialName+" Rod"); - ItemStack boltStack = this.componentMaterial.getIngot(1); - if (ItemUtils.checkForInvalidItems(boltStack)){ - GT_Values.RA.addLatheRecipe( - boltStack, - ItemUtils.getSimpleStack(this), - material.getSmallDust(2), - (int) Math.max(this.componentMaterial.getMass() / 8L, 1L), - material.vVoltageMultiplier); - } } } diff --git a/src/Java/gtPlusPlus/core/item/base/rods/BaseItemRodLong.java b/src/Java/gtPlusPlus/core/item/base/rods/BaseItemRodLong.java index 9b232f95c5..215012817d 100644 --- a/src/Java/gtPlusPlus/core/item/base/rods/BaseItemRodLong.java +++ b/src/Java/gtPlusPlus/core/item/base/rods/BaseItemRodLong.java @@ -1,19 +1,13 @@ package gtPlusPlus.core.item.base.rods; -import net.minecraft.item.ItemStack; - -import gregtech.api.enums.GT_Values; - -import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.item.base.BaseItemComponent; import gtPlusPlus.core.material.Material; -import gtPlusPlus.core.util.minecraft.ItemUtils; +import net.minecraft.item.ItemStack; public class BaseItemRodLong extends BaseItemComponent{ public BaseItemRodLong(final Material material) { super(material, BaseItemComponent.ComponentTypes.RODLONG); - this.addExtruderRecipe(); } @Override @@ -21,26 +15,4 @@ public class BaseItemRodLong extends BaseItemComponent{ return ("Long "+this.materialName+ " Rod"); } - private void addExtruderRecipe(){ - Logger.WARNING("Adding recipe for Long "+this.materialName+" Rods"); - - final ItemStack stackStick = this.componentMaterial.getRod(2); - final ItemStack stackLong = this.componentMaterial.getLongRod(1); - - if (ItemUtils.checkForInvalidItems(new ItemStack[] {stackStick, stackLong})) - GT_Values.RA.addForgeHammerRecipe( - stackStick, - stackLong, - (int) Math.max(this.componentMaterial.getMass(), 1L), - 16); - - if (ItemUtils.checkForInvalidItems(new ItemStack[] {stackStick, stackLong})) - GT_Values.RA.addCutterRecipe( - stackLong, - stackStick, - null, - (int) Math.max(this.componentMaterial.getMass(), 1L), - 4); - } - } diff --git a/src/Java/gtPlusPlus/core/item/base/screws/BaseItemScrew.java b/src/Java/gtPlusPlus/core/item/base/screws/BaseItemScrew.java index 29e525ed10..dbd817215a 100644 --- a/src/Java/gtPlusPlus/core/item/base/screws/BaseItemScrew.java +++ b/src/Java/gtPlusPlus/core/item/base/screws/BaseItemScrew.java @@ -1,32 +1,12 @@ package gtPlusPlus.core.item.base.screws; -import net.minecraft.item.ItemStack; - -import gregtech.api.enums.GT_Values; - -import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.item.base.BaseItemComponent; import gtPlusPlus.core.material.Material; -import gtPlusPlus.core.util.minecraft.ItemUtils; public class BaseItemScrew extends BaseItemComponent{ public BaseItemScrew(final Material material) { super(material, BaseItemComponent.ComponentTypes.SCREW); - this.addLatheRecipe(); - } - - private void addLatheRecipe(){ - Logger.WARNING("Adding recipe for "+this.materialName+" Screws"); - ItemStack boltStack = this.componentMaterial.getBolt(1); - if (ItemUtils.checkForInvalidItems(boltStack)){ - GT_Values.RA.addLatheRecipe( - boltStack, - ItemUtils.getSimpleStack(this), - null, - (int) Math.max(this.componentMaterial.getMass() / 8L, 1L), - 4); - } } } diff --git a/src/Java/gtPlusPlus/core/item/bauble/ElectricBaseBauble.java b/src/Java/gtPlusPlus/core/item/bauble/ElectricBaseBauble.java index cfa5cb363d..4316f13401 100644 --- a/src/Java/gtPlusPlus/core/item/bauble/ElectricBaseBauble.java +++ b/src/Java/gtPlusPlus/core/item/bauble/ElectricBaseBauble.java @@ -135,7 +135,7 @@ public abstract class ElectricBaseBauble extends BaseBauble implements IElectric list.add(EnumChatFormatting.GOLD + aEuInfo + EnumChatFormatting.GRAY); list.add(EnumChatFormatting.GRAY + aTier+": [" + EnumChatFormatting.YELLOW + this.getTier(stack) + EnumChatFormatting.GRAY + "] "+aInputLimit+": [" + EnumChatFormatting.YELLOW - + this.getTransferLimit(stack) + EnumChatFormatting.GRAY + aEUT); + + this.getTransferLimit(stack) + EnumChatFormatting.GRAY + aEUT+"]"); list.add(EnumChatFormatting.GRAY + aCurrentPower +": [" + EnumChatFormatting.YELLOW + (long) this.getCharge(stack) + EnumChatFormatting.GRAY + aEU +"] [" + EnumChatFormatting.YELLOW + MathUtils.findPercentage(this.getCharge(stack), this.getMaxCharge(stack)) + EnumChatFormatting.GRAY diff --git a/src/Java/gtPlusPlus/core/item/chemistry/AgriculturalChem.java b/src/Java/gtPlusPlus/core/item/chemistry/AgriculturalChem.java index e11b163753..8e7a760195 100644 --- a/src/Java/gtPlusPlus/core/item/chemistry/AgriculturalChem.java +++ b/src/Java/gtPlusPlus/core/item/chemistry/AgriculturalChem.java @@ -296,7 +296,7 @@ public class AgriculturalChem extends ItemPackage { } if (aTiCon) { - aBlood = FluidUtils.getFluidStack("hell_blood", 100); + aBlood = FluidUtils.getFluidStack("blood", 100); if (aBlood != null) { Logger.INFO("Found Tinker's Construct, enabled Blood support."); CustomBlood = aBlood.getFluid(); @@ -435,7 +435,7 @@ public class AgriculturalChem extends ItemPackage { ItemStack aBone; ItemStack aMeat; ItemStack aEmptyCells = CI.emptyCells(2); - ItemStack aInputCells = ItemUtils.getItemStackOfAmountFromOreDict("cellRawWaste", 2); + ItemStack aInputCells = ItemUtils.getItemStackOfAmountFromOreDict("cellRawAnimalWaste", 2); FluidStack aOutput = FluidUtils.getFluidStack(FertileManureSlurry, 1000); for (FluidStack aBloodStack : mBloodFluids) { diff --git a/src/Java/gtPlusPlus/core/item/chemistry/CoalTar.java b/src/Java/gtPlusPlus/core/item/chemistry/CoalTar.java index badd318414..ca9053dacb 100644 --- a/src/Java/gtPlusPlus/core/item/chemistry/CoalTar.java +++ b/src/Java/gtPlusPlus/core/item/chemistry/CoalTar.java @@ -53,27 +53,35 @@ public class CoalTar extends ItemPackage { FluidStack bioEth1 = FluidUtils.getFluidStack("fluid.bioethanol", 2000); FluidStack bioEth2 = FluidUtils.getFluidStack("bioethanol", 2000); - if (bioEth1 != null){ + if (bioEth1 != null){ CORE.RA.addDehydratorRecipe( - ItemUtils.getItemStackOfAmountFromOreDict("cellEmpty", 2), - bioEth1, + new ItemStack[] { + CI.getNumberedBioCircuit(17), + ItemUtils.getItemStackOfAmountFromOreDict("cellEmpty", 1) + }, + bioEth1, + FluidUtils.getWater(1000), new ItemStack[]{ - ItemUtils.getItemStackOfAmountFromOreDict("cellWater", 1), ItemUtils.getItemStackOfAmountFromOreDict("cellEthylene", 1) - }, - 120*20, + }, + new int[] {10000}, + 120 * 20, 80); } if (bioEth2 != null){ CORE.RA.addDehydratorRecipe( - ItemUtils.getItemStackOfAmountFromOreDict("cellEmpty", 2), - bioEth2, + new ItemStack[] { + CI.getNumberedBioCircuit(18), + ItemUtils.getItemStackOfAmountFromOreDict("cellEmpty", 1) + }, + bioEth2, + FluidUtils.getWater(1000), new ItemStack[]{ - ItemUtils.getItemStackOfAmountFromOreDict("cellWater", 1), ItemUtils.getItemStackOfAmountFromOreDict("cellEthylene", 1) - }, - 120*20, + }, + new int[] {10000}, + 120 * 20, 80); } } @@ -241,16 +249,19 @@ public class CoalTar extends ItemPackage { } - private static void recipePhthalicAcidToPhthalicAnhydride() { + private static void recipePhthalicAcidToPhthalicAnhydride() { CORE.RA.addDehydratorRecipe( - ItemUtils.getGregtechCircuit(6), - FluidUtils.getFluidStack("fluid.phthalicacid", 144), + new ItemStack[] { + CI.getNumberedBioCircuit(15) + }, + FluidUtils.getFluidStack("fluid.phthalicacid", 144), + null, new ItemStack[]{ ItemUtils.getItemStackOfAmountFromOreDict("dustPhthalicAnhydride", 1) - }, - 60*20, + }, + new int[] {10000}, + 60 * 20, 120); - } @Override diff --git a/src/Java/gtPlusPlus/core/item/chemistry/GenericChem.java b/src/Java/gtPlusPlus/core/item/chemistry/GenericChem.java index f61a2096b7..a42d179f65 100644 --- a/src/Java/gtPlusPlus/core/item/chemistry/GenericChem.java +++ b/src/Java/gtPlusPlus/core/item/chemistry/GenericChem.java @@ -36,9 +36,9 @@ public class GenericChem extends ItemPackage { * Materials */ - public static final Material BAKELITE = new Material("Bakelite", MaterialState.SOLID, TextureSet.SET_DULL, new short[]{90, 140, 140}, 120, 240, 23, 24, true, null, 0);//Not a GT Inherited Material - public static final Material NYLON = new Material("Nylon", MaterialState.SOLID, TextureSet.SET_SHINY, new short[]{45, 45, 45}, 300, 600, 44, 48, true, null, 0);//Not a GT Inherited Material - public static final Material CARBYNE = new Material("Carbyne", MaterialState.SOLID, TextureSet.SET_DULL, new short[]{25, 25, 25}, 2500, 5000, 63, 52, true, null, 0);//Not a GT Inherited Material + //public static final Material BAKELITE = new Material("Bakelite", MaterialState.SOLID, TextureSet.SET_DULL, new short[]{90, 140, 140}, 120, 240, 23, 24, true, null, 0);//Not a GT Inherited Material + //public static final Material NYLON = new Material("Nylon", MaterialState.SOLID, TextureSet.SET_SHINY, new short[]{45, 45, 45}, 300, 600, 44, 48, true, null, 0);//Not a GT Inherited Material + //public static final Material CARBYNE = new Material("Carbyne", MaterialState.SOLID, TextureSet.SET_DULL, new short[]{25, 25, 25}, 2500, 5000, 63, 52, true, null, 0);//Not a GT Inherited Material //Refined PTFE @@ -57,13 +57,7 @@ public class GenericChem extends ItemPackage { new MaterialStack(NONMATERIAL.PLASTIC, 15), new MaterialStack(ELEMENT.getInstance().CARBON, 5), new MaterialStack(ELEMENT.getInstance().SODIUM, 5) - });// Not a GT - // Inherited - // Material - - //public static final Material HYPOGEN = new Material("Hypogen", MaterialState.SOLID, TextureSets.NUCLEAR.get(), new short[]{220, 120, 75}, 12255, 19377, 240, 251, true, "Hy⚶", 0);//Not a GT Inherited Material - //public static final Material HYPOGEN = new Material("Hypogen", MaterialState.SOLID, TextureSets.NUCLEAR.get(), new short[]{220, 120, 75}, 12255, 19377, 240, 251, true, "Hy⚶", 0);//Not a GT Inherited Material - //public static final Material Nylon = new Material(); + }); /** * Fluids @@ -123,8 +117,8 @@ public class GenericChem extends ItemPackage { @Override public void items() { PhenolicResins = ItemUtils.generateSpecialUseDusts("phenolicresins", "Phenolic Resin", "HOC6H4CH2OH", Utils.rgbtoHexValue(80, 40, 40))[0]; - MaterialGenerator.generate(BAKELITE, false); - MaterialGenerator.generate(NYLON, false); + //MaterialGenerator.generate(BAKELITE, false); + //MaterialGenerator.generate(NYLON, false); MaterialGenerator.generate(TEFLON, false); mGenericChemItem1 = new ItemGenericChemBase(); @@ -351,7 +345,7 @@ public class GenericChem extends ItemPackage { }, new FluidStack[] { - ELEMENT.getInstance().HYDROGEN.getFluid(2000) + ELEMENT.getInstance().HYDROGEN.getFluidStack(2000) }, 20 *20, 120, @@ -433,8 +427,8 @@ public class GenericChem extends ItemPackage { private void recipeHydricSulfur() { ItemStack aCellHydricSulfide = ItemUtils.getItemStackOfAmountFromOreDict("cellHydrogenSulfide", 1); - GT_Values.RA.addChemicalRecipe( ELEMENT.getInstance().SULFUR.getDust(1), GT_Utility.getIntegratedCircuit(1), ELEMENT.getInstance().HYDROGEN.getFluid(2000), FluidUtils.getFluidStack(Hydrogen_Sulfide, 3000), GT_Values.NI, 60, 8); - GT_Values.RA.addChemicalRecipeForBasicMachineOnly(ELEMENT.getInstance().SULFUR.getDust(1), CI.emptyCells(3), ELEMENT.getInstance().HYDROGEN.getFluid(2000), GT_Values.NF, ItemUtils.getSimpleStack(aCellHydricSulfide, 3), GT_Values.NI, 60, 8); + GT_Values.RA.addChemicalRecipe( ELEMENT.getInstance().SULFUR.getDust(1), GT_Utility.getIntegratedCircuit(1), ELEMENT.getInstance().HYDROGEN.getFluidStack(2000), FluidUtils.getFluidStack(Hydrogen_Sulfide, 3000), GT_Values.NI, 60, 8); + GT_Values.RA.addChemicalRecipeForBasicMachineOnly(ELEMENT.getInstance().SULFUR.getDust(1), CI.emptyCells(3), ELEMENT.getInstance().HYDROGEN.getFluidStack(2000), GT_Values.NF, ItemUtils.getSimpleStack(aCellHydricSulfide, 3), GT_Values.NI, 60, 8); } @@ -516,9 +510,9 @@ public class GenericChem extends ItemPackage { private void recipeNitrogenDioxide() { ItemStack aNitricOxideCell = ItemUtils.getItemStackOfAmountFromOreDict("cellNitricOxide", 1); ItemStack aNitrogenDioxideCell = ItemUtils.getItemStackOfAmountFromOreDict("cellNitrogenDioxide", 1); - GT_Values.RA.addChemicalRecipe( ItemUtils.getSimpleStack(aNitricOxideCell, 2), GT_Utility.getIntegratedCircuit(1), ELEMENT.getInstance().OXYGEN.getFluid(1000), FluidUtils.getFluidStack(Nitrogen_Dioxide, 3000), CI.emptyCells(2), 160); + GT_Values.RA.addChemicalRecipe( ItemUtils.getSimpleStack(aNitricOxideCell, 2), GT_Utility.getIntegratedCircuit(1), ELEMENT.getInstance().OXYGEN.getFluidStack(1000), FluidUtils.getFluidStack(Nitrogen_Dioxide, 3000), CI.emptyCells(2), 160); GT_Values.RA.addChemicalRecipe( ELEMENT.getInstance().OXYGEN.getCell(1), GT_Utility.getIntegratedCircuit(1), FluidUtils.getFluidStack(Nitric_Oxide, 2000), FluidUtils.getFluidStack(Nitrogen_Dioxide, 3000), CI.emptyCells(1), 160); - GT_Values.RA.addChemicalRecipeForBasicMachineOnly(ItemUtils.getSimpleStack(aNitricOxideCell, 2), CI.emptyCells(1), ELEMENT.getInstance().OXYGEN.getFluid(1000), GT_Values.NF, ItemUtils.getSimpleStack(aNitrogenDioxideCell, 3), GT_Values.NI, 160, 30); + GT_Values.RA.addChemicalRecipeForBasicMachineOnly(ItemUtils.getSimpleStack(aNitricOxideCell, 2), CI.emptyCells(1), ELEMENT.getInstance().OXYGEN.getFluidStack(1000), GT_Values.NF, ItemUtils.getSimpleStack(aNitrogenDioxideCell, 3), GT_Values.NI, 160, 30); GT_Values.RA.addChemicalRecipeForBasicMachineOnly(ELEMENT.getInstance().OXYGEN.getCell(1), CI.emptyCells(2), FluidUtils.getFluidStack(Nitric_Oxide, 2000), GT_Values.NF, ItemUtils.getSimpleStack(aNitrogenDioxideCell, 3), GT_Values.NI, 160, 30); GT_Values.RA.addChemicalRecipeForBasicMachineOnly(ItemUtils.getSimpleStack(aNitricOxideCell, 2), ELEMENT.getInstance().OXYGEN.getCell(1), GT_Values.NF, GT_Values.NF, ItemUtils.getSimpleStack(aNitrogenDioxideCell, 3), GT_Values.NI, 160, 30); } @@ -527,16 +521,16 @@ public class GenericChem extends ItemPackage { private void recipeNitricOxide() { ItemStack aWaterCell = ItemUtils.getItemStackOfAmountFromOreDict("cellWater", 1); ItemStack aNitricOxideCell = ItemUtils.getItemStackOfAmountFromOreDict("cellNitricOxide", 1); - GT_Values.RA.addChemicalRecipeForBasicMachineOnly(MISC_MATERIALS.AMMONIA.getCell(8), CI.emptyCells(1), ELEMENT.getInstance().OXYGEN.getFluid(5000), FluidUtils.getFluidStack(Nitric_Oxide, 4000), ItemUtils.getSimpleStack(aWaterCell, 9), GT_Values.NI, 160, 30); - GT_Values.RA.addChemicalRecipeForBasicMachineOnly(ELEMENT.getInstance().OXYGEN.getCell(5), CI.emptyCells(4), MISC_MATERIALS.AMMONIA.getFluid(8000), FluidUtils.getFluidStack(Nitric_Oxide, 4000), ItemUtils.getSimpleStack(aWaterCell, 9), GT_Values.NI, 160, 30); - GT_Values.RA.addChemicalRecipe( MISC_MATERIALS.AMMONIA.getCell(8), GT_Utility.getIntegratedCircuit(11), ELEMENT.getInstance().OXYGEN.getFluid(5000), FluidUtils.getWater(9000), ItemUtils.getSimpleStack(aNitricOxideCell, 4), CI.emptyCells(4), 160); - GT_Values.RA.addChemicalRecipe( ELEMENT.getInstance().OXYGEN.getCell(5), GT_Utility.getIntegratedCircuit(11), MISC_MATERIALS.AMMONIA.getFluid(8000), FluidUtils.getWater(9000), ItemUtils.getSimpleStack(aNitricOxideCell, 4), CI.emptyCells(1), 160); - GT_Values.RA.addChemicalRecipe( MISC_MATERIALS.AMMONIA.getCell(8), GT_Utility.getIntegratedCircuit(2), ELEMENT.getInstance().OXYGEN.getFluid(5000), FluidUtils.getFluidStack(Nitric_Oxide, 4000), CI.emptyCells(8), 320); - GT_Values.RA.addChemicalRecipe( ELEMENT.getInstance().OXYGEN.getCell(5), GT_Utility.getIntegratedCircuit(2), MISC_MATERIALS.AMMONIA.getFluid(8000), FluidUtils.getFluidStack(Nitric_Oxide, 4000), CI.emptyCells(5), 320); - GT_Values.RA.addChemicalRecipe( MISC_MATERIALS.AMMONIA.getCell(8), GT_Utility.getIntegratedCircuit(12), ELEMENT.getInstance().OXYGEN.getFluid(5000), GT_Values.NF, ItemUtils.getSimpleStack(aNitricOxideCell, 4), CI.emptyCells(4), 160); - GT_Values.RA.addChemicalRecipe( ELEMENT.getInstance().OXYGEN.getCell(5), GT_Utility.getIntegratedCircuit(12), MISC_MATERIALS.AMMONIA.getFluid(8000), GT_Values.NF, ItemUtils.getSimpleStack(aNitricOxideCell, 4), CI.emptyCells(1), 160); + GT_Values.RA.addChemicalRecipeForBasicMachineOnly(MISC_MATERIALS.AMMONIA.getCell(8), CI.emptyCells(1), ELEMENT.getInstance().OXYGEN.getFluidStack(5000), FluidUtils.getFluidStack(Nitric_Oxide, 4000), ItemUtils.getSimpleStack(aWaterCell, 9), GT_Values.NI, 160, 30); + GT_Values.RA.addChemicalRecipeForBasicMachineOnly(ELEMENT.getInstance().OXYGEN.getCell(5), CI.emptyCells(4), MISC_MATERIALS.AMMONIA.getFluidStack(8000), FluidUtils.getFluidStack(Nitric_Oxide, 4000), ItemUtils.getSimpleStack(aWaterCell, 9), GT_Values.NI, 160, 30); + GT_Values.RA.addChemicalRecipe( MISC_MATERIALS.AMMONIA.getCell(8), GT_Utility.getIntegratedCircuit(11), ELEMENT.getInstance().OXYGEN.getFluidStack(5000), FluidUtils.getWater(9000), ItemUtils.getSimpleStack(aNitricOxideCell, 4), CI.emptyCells(4), 160); + GT_Values.RA.addChemicalRecipe( ELEMENT.getInstance().OXYGEN.getCell(5), GT_Utility.getIntegratedCircuit(11), MISC_MATERIALS.AMMONIA.getFluidStack(8000), FluidUtils.getWater(9000), ItemUtils.getSimpleStack(aNitricOxideCell, 4), CI.emptyCells(1), 160); + GT_Values.RA.addChemicalRecipe( MISC_MATERIALS.AMMONIA.getCell(8), GT_Utility.getIntegratedCircuit(2), ELEMENT.getInstance().OXYGEN.getFluidStack(5000), FluidUtils.getFluidStack(Nitric_Oxide, 4000), CI.emptyCells(8), 320); + GT_Values.RA.addChemicalRecipe( ELEMENT.getInstance().OXYGEN.getCell(5), GT_Utility.getIntegratedCircuit(2), MISC_MATERIALS.AMMONIA.getFluidStack(8000), FluidUtils.getFluidStack(Nitric_Oxide, 4000), CI.emptyCells(5), 320); + GT_Values.RA.addChemicalRecipe( MISC_MATERIALS.AMMONIA.getCell(8), GT_Utility.getIntegratedCircuit(12), ELEMENT.getInstance().OXYGEN.getFluidStack(5000), GT_Values.NF, ItemUtils.getSimpleStack(aNitricOxideCell, 4), CI.emptyCells(4), 160); + GT_Values.RA.addChemicalRecipe( ELEMENT.getInstance().OXYGEN.getCell(5), GT_Utility.getIntegratedCircuit(12), MISC_MATERIALS.AMMONIA.getFluidStack(8000), GT_Values.NF, ItemUtils.getSimpleStack(aNitricOxideCell, 4), CI.emptyCells(1), 160); GT_Values.RA.addChemicalRecipeForBasicMachineOnly(MISC_MATERIALS.AMMONIA.getCell(8), ELEMENT.getInstance().OXYGEN.getCell(5), GT_Values.NF, GT_Values.NF, ItemUtils.getSimpleStack(aNitricOxideCell, 4), ItemUtils.getSimpleStack(aWaterCell, 9), 160, 30); - GT_Values.RA.addMultiblockChemicalRecipe(new ItemStack[]{GT_Utility.getIntegratedCircuit(1)}, new FluidStack[]{MISC_MATERIALS.AMMONIA.getFluid(8000), ELEMENT.getInstance().OXYGEN.getFluid(5000)}, new FluidStack[]{FluidUtils.getFluidStack(Nitric_Oxide, 4000), FluidUtils.getWater(9000)}, null, 160, 30); + GT_Values.RA.addMultiblockChemicalRecipe(new ItemStack[]{GT_Utility.getIntegratedCircuit(1)}, new FluidStack[]{MISC_MATERIALS.AMMONIA.getFluidStack(8000), ELEMENT.getInstance().OXYGEN.getFluidStack(5000)}, new FluidStack[]{FluidUtils.getFluidStack(Nitric_Oxide, 4000), FluidUtils.getWater(9000)}, null, 160, 30); } @@ -547,7 +541,7 @@ public class GenericChem extends ItemPackage { CORE.RA.addChemicalRecipe( ELEMENT.getInstance().CHLORINE.getCell(1), GT_Utility.getIntegratedCircuit(1), - ELEMENT.getInstance().HYDROGEN.getFluid(1000), + ELEMENT.getInstance().HYDROGEN.getFluidStack(1000), FluidUtils.getFluidStack(HydrochloricAcid, 2000), CI.emptyCells(1), 60, @@ -556,7 +550,7 @@ public class GenericChem extends ItemPackage { CORE.RA.addChemicalRecipe( ELEMENT.getInstance().HYDROGEN.getCell(1), GT_Utility.getIntegratedCircuit(1), - ELEMENT.getInstance().CHLORINE.getFluid(1000), + ELEMENT.getInstance().CHLORINE.getFluidStack(1000), FluidUtils.getFluidStack(HydrochloricAcid, 2000), CI.emptyCells(1), 60, @@ -566,7 +560,7 @@ public class GenericChem extends ItemPackage { CI.emptyCells(1), GT_Utility.getIntegratedCircuit(1), FluidUtils.getFluidStack(HydrochloricAcid, 2000), - ELEMENT.getInstance().CHLORINE.getFluid(1000), + ELEMENT.getInstance().CHLORINE.getFluidStack(1000), ELEMENT.getInstance().HYDROGEN.getCell(1), GT_Values.NI, GT_Values.NI, @@ -581,7 +575,7 @@ public class GenericChem extends ItemPackage { CI.emptyCells(1), GT_Utility.getIntegratedCircuit(11), FluidUtils.getFluidStack(HydrochloricAcid, 2000), - ELEMENT.getInstance().HYDROGEN.getFluid(1000), + ELEMENT.getInstance().HYDROGEN.getFluidStack(1000), ELEMENT.getInstance().CHLORINE.getCell(1), GT_Values.NI, GT_Values.NI, diff --git a/src/Java/gtPlusPlus/core/item/chemistry/MilledOreProcessing.java b/src/Java/gtPlusPlus/core/item/chemistry/MilledOreProcessing.java index 8c6e66fcb8..dfc85c533b 100644 --- a/src/Java/gtPlusPlus/core/item/chemistry/MilledOreProcessing.java +++ b/src/Java/gtPlusPlus/core/item/chemistry/MilledOreProcessing.java @@ -42,6 +42,7 @@ public class MilledOreProcessing extends ItemPackage { public static Fluid GrossularFlotationFroth; public static Fluid AlmandineFlotationFroth; public static Fluid PyropeFlotationFroth; + public static Fluid MonaziteFlotationFroth; public static Fluid PineOil; @@ -81,7 +82,10 @@ public class MilledOreProcessing extends ItemPackage { public static Item milledAlmandine; // Magnesium, Manganese, Borax, Rhenium - public static Item milledPyrope; + public static Item milledPyrope; + + // Erbium, Lanthanum, Praseodymium, Europium + public static Item milledMonazite; @Override @@ -98,6 +102,7 @@ public class MilledOreProcessing extends ItemPackage { milledGrossular = BaseItemMilledOre.generate(Materials.Grossular, MaterialUtils.getVoltageForTier(6)); milledAlmandine = BaseItemMilledOre.generate(Materials.Almandine, MaterialUtils.getVoltageForTier(6)); milledPyrope = BaseItemMilledOre.generate(Materials.Pyrope, MaterialUtils.getVoltageForTier(4)); + milledMonazite = BaseItemMilledOre.generate(Materials.Monazite, MaterialUtils.getVoltageForTier(7)); } @@ -130,6 +135,8 @@ public class MilledOreProcessing extends ItemPackage { AlmandineFlotationFroth = FluidUtils.generateFluidNoPrefix("froth.almandineflotation", "Almandine Froth", 32 + 175, new short[] { aAlmandineFrothRGB[0], aAlmandineFrothRGB[1], aAlmandineFrothRGB[2], 100 }, true); short[] aPyropeFrothRGB = Materials.Pyrope.mRGBa; PyropeFlotationFroth = FluidUtils.generateFluidNoPrefix("froth.pyropeflotation", "Pyrope Froth", 32 + 175, new short[] { aPyropeFrothRGB[0], aPyropeFrothRGB[1], aPyropeFrothRGB[2], 100 }, true); + short[] aMonaziteFrothRGB = Materials.Monazite.mRGBa; + MonaziteFlotationFroth = FluidUtils.generateFluidNoPrefix("froth.Monaziteflotation", "Monazite Froth", 32 + 175, new short[] { aMonaziteFrothRGB[0], aMonaziteFrothRGB[1], aMonaziteFrothRGB[2], 100 }, true); PineOil = FluidUtils.generateFluidNoPrefix("pineoil", "Pine Oil", 32 + 175, new short[] { 250, 200, 60, 100 }, true); @@ -233,6 +240,14 @@ public class MilledOreProcessing extends ItemPackage { MaterialUtils.generateMaterialFromGtENUM(Materials.Borax), 60, ELEMENT.getInstance().RHENIUM, 20 ); + //milledMonazite TODO + registerOreDataForMilledType( + MonaziteFlotationFroth, + ELEMENT.getInstance().ERBIUM, 96, + ELEMENT.getInstance().LANTHANUM, 96, + ELEMENT.getInstance().PRASEODYMIUM, 96, + ELEMENT.getInstance().EUROPIUM, 32 + ); } @@ -409,6 +424,21 @@ public class MilledOreProcessing extends ItemPackage { 20 * 120, MaterialUtils.getVoltageForTier(4), 3500); + CORE.RA.addVacuumFurnaceRecipe( + new ItemStack[] { + CI.getNumberedCircuit(aCircuitID++) + }, + new FluidStack[] { + FluidUtils.getFluidStack(MonaziteFlotationFroth, 4000) + }, + getOutputsFromMap(MonaziteFlotationFroth), + new FluidStack[] { + FluidUtils.getFluidStack(AgriculturalChem.RedMud, 2000), + FluidUtils.getWater(2000) + }, + 20 * 120, + MaterialUtils.getVoltageForTier(7), + 7500); } @@ -559,6 +589,20 @@ public class MilledOreProcessing extends ItemPackage { MaterialUtils.getVoltageForTier(4) ); + // Monazite + CORE.RA.addFlotationRecipe( + Materials.Monazite, + ItemUtils.getSimpleStack(GenericChem.mPotassiumEthylXanthate, 1), + new FluidStack[] { + FluidUtils.getFluidStack(PineOil, 30000), + }, + new FluidStack[] { + FluidUtils.getFluidStack(MonaziteFlotationFroth, 1000) + }, + 20 * 1200, + MaterialUtils.getVoltageForTier(6) + ); + } private void addPineOilExtraction() { diff --git a/src/Java/gtPlusPlus/core/item/chemistry/NuclearChem.java b/src/Java/gtPlusPlus/core/item/chemistry/NuclearChem.java index 25beb6d9b5..f112b0d2a5 100644 --- a/src/Java/gtPlusPlus/core/item/chemistry/NuclearChem.java +++ b/src/Java/gtPlusPlus/core/item/chemistry/NuclearChem.java @@ -1,14 +1,15 @@ package gtPlusPlus.core.item.chemistry; -import net.minecraft.init.Items; - -import gregtech.api.enums.GT_Values; import gtPlusPlus.api.objects.minecraft.ItemPackage; import gtPlusPlus.core.item.ModItems; +import gtPlusPlus.core.item.chemistry.general.ItemGenericChemBase; +import gtPlusPlus.core.item.chemistry.general.ItemNuclearChemBase; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.recipe.common.CI; import gtPlusPlus.core.util.minecraft.FluidUtils; import gtPlusPlus.core.util.minecraft.ItemUtils; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.Fluid; public class NuclearChem extends ItemPackage { @@ -17,25 +18,44 @@ public class NuclearChem extends ItemPackage { public static Fluid Burnt_LiFBeF2ZrF4UF4; public static Fluid Burnt_LiFBeF2ZrF4U235; + + public static Fluid Impure_LiFBeF2; + public static Fluid GeneticMutagen; private static boolean generateMutagenRecipe = false; + + public static ItemNuclearChemBase mNuclearChemItem1; + + public static ItemStack mResidueUranium; + public static ItemStack mResiduePlutonium; + public static ItemStack mResidueFluorides; + public static ItemStack mResidueNobles; @Override - public String errorMessage() { - return "bad Nuclear Chemistry Recipes."; + public void items() { + + mNuclearChemItem1 = new ItemNuclearChemBase(); + registerItemStacks(); + registerOreDict(); } - @Override - public boolean generateRecipes() { - if (generateMutagenRecipe) { - chemReator_CreateMutagen(); - } - chemReactor_MutagenWithEggs(); - return true; + + public void registerItemStacks() { + + mResidueUranium = ItemUtils.simpleMetaStack(mNuclearChemItem1, 0, 1); + mResidueUranium = ItemUtils.simpleMetaStack(mNuclearChemItem1, 1, 1); + mResidueUranium = ItemUtils.simpleMetaStack(mNuclearChemItem1, 2, 1); + mResidueUranium = ItemUtils.simpleMetaStack(mNuclearChemItem1, 3, 1); + } - @Override - public void items() { + public void registerOreDict() { + + ItemUtils.addItemToOreDictionary(mResidueUranium, "dustResidueUranium"); + ItemUtils.addItemToOreDictionary(mResiduePlutonium, "dustResiduePlutonium"); + ItemUtils.addItemToOreDictionary(mResidueFluorides, "dustResidueFluoride"); + ItemUtils.addItemToOreDictionary(mResidueNobles, "dustResidueNoble"); + } @Override @@ -48,7 +68,7 @@ public class NuclearChem extends ItemPackage { Burnt_LiFBeF2ThF4UF4 = FluidUtils.generateFluidNonMolten("BurntLiFBeF2ThF4UF4", "Burnt LiFBeF2ThF4UF4 Salt", 545, new short[]{48, 175, 48, 100}, null, null); Burnt_LiFBeF2ZrF4UF4 = FluidUtils.generateFluidNonMolten("BurntLiFBeF2ZrF4UF4", "Burnt LiFBeF2ZrF4UF4 Salt", 520, new short[]{48, 168, 68, 100}, null, null); Burnt_LiFBeF2ZrF4U235 = FluidUtils.generateFluidNonMolten("BurntLiFBeF2ZrF4U235", "Burnt LiFBeF2ZrF4U235 Salt", 533, new short[]{68, 185, 48, 100}, null, null); - + Impure_LiFBeF2 = FluidUtils.generateFluidNonMolten("ImpureLiFBeF2", "Impure LiFBeF2 Salt", 533, new short[]{110, 75, 186, 100}, null, null); if (FluidUtils.getFluidStack("fluid.Mutagen", 1) == null) { GeneticMutagen = FluidUtils.generateFluidNonMolten("GeneticMutagen", "Genetic Mutagen", 12, new short[]{22, 148, 185, 100}, null, null); generateMutagenRecipe = true; @@ -57,6 +77,20 @@ public class NuclearChem extends ItemPackage { GeneticMutagen = FluidUtils.getFluidStack("fluid.Mutagen", 1).getFluid(); } } + + @Override + public String errorMessage() { + return "Bad Nuclear Chemistry Recipes."; + } + + @Override + public boolean generateRecipes() { + if (generateMutagenRecipe) { + chemReator_CreateMutagen(); + } + chemReactor_MutagenWithEggs(); + return true; + } private static void chemReator_CreateMutagen() { CORE.RA.addChemicalRecipe( diff --git a/src/Java/gtPlusPlus/core/item/chemistry/RocketFuels.java b/src/Java/gtPlusPlus/core/item/chemistry/RocketFuels.java index 66f20e0079..b96e0c76ea 100644 --- a/src/Java/gtPlusPlus/core/item/chemistry/RocketFuels.java +++ b/src/Java/gtPlusPlus/core/item/chemistry/RocketFuels.java @@ -144,6 +144,29 @@ public class RocketFuels extends ItemPackage { MaterialUtils.getVoltageForTier(2), 1); + FluidStack aBartWorksHydrogenPeroxide = FluidUtils.getWildcardFluidStack("Hydrogen Peroxide", 2000); + if (aBartWorksHydrogenPeroxide != null) { + Logger.INFO("Found BW Hydrogen Peroxide, adding compat recipe."); + CORE.RA.addChemicalPlantRecipe( + new ItemStack[] { + CI.getNumberedCircuit(22) + }, + new FluidStack[] { + aBartWorksHydrogenPeroxide, + FluidUtils.getFluidStack("ammonia", 2000), + }, + new ItemStack[] { + + }, + new FluidStack[] { + FluidUtils.getFluidStack(Hydrazine, 4000), + + }, + 20 * 30, + MaterialUtils.getVoltageForTier(2), + 1); + } + } @@ -177,7 +200,7 @@ public class RocketFuels extends ItemPackage { } private static void createLOH() { - GT_Values.RA.addVacuumFreezerRecipe(ItemUtils.getItemStackOfAmountFromOreDict("cellHydrogen", 1), ItemUtils.getItemStackOfAmountFromOreDict("cellLiquidhydrogen", 1), 20*16); + GT_Values.RA.addVacuumFreezerRecipe(ItemUtils.getItemStackOfAmountFromOreDict("cellHydrogen", 1), ItemUtils.getItemStackOfAmountFromOreDict("cellLiquidHydrogen", 1), 20*16); CORE.RA.addAdvancedFreezerRecipe(new ItemStack[] {}, new FluidStack[] {FluidUtils.getFluidStack("hydrogen", 300)}, new FluidStack[] {FluidUtils.getFluidStack(Liquid_Hydrogen, 300)}, new ItemStack[] {}, new int[] {}, 20*4, 540, 0); } @@ -209,7 +232,9 @@ public class RocketFuels extends ItemPackage { new ItemStack[] {CI.getNumberedCircuit(8)}, FluidUtils.getFluidStack(Hydrated_Ammonium_Nitrate_Slurry, 8*144), FluidUtils.getWater(2000), - new ItemStack[] {ItemUtils.getSimpleStack(Ammonium_Nitrate_Dust, 8)}, + new ItemStack[] { + ItemUtils.getSimpleStack(Ammonium_Nitrate_Dust, 8) + }, new int[] {10000}, 90 * 20, 480); @@ -292,7 +317,7 @@ public class RocketFuels extends ItemPackage { new FluidStack[] {}, 0, 0, - 256)); //Fuel Value + 512)); //Fuel Value mRocketFuels.put(1, new GTPP_Recipe( true, @@ -304,7 +329,7 @@ public class RocketFuels extends ItemPackage { new FluidStack[] {}, 0, 0, - 512)); //Fuel Value + 1024)); //Fuel Value mRocketFuels.put(2, new GTPP_Recipe( true, @@ -316,7 +341,7 @@ public class RocketFuels extends ItemPackage { new FluidStack[] {}, 0, 0, - 768)); //Fuel Value + 2048)); //Fuel Value mRocketFuels.put(3, new GTPP_Recipe( true, @@ -328,7 +353,7 @@ public class RocketFuels extends ItemPackage { new FluidStack[] {}, 0, 0, - 1024)); //Fuel Value + 4196)); //Fuel Value //Add in default Diesel for the Buggy diff --git a/src/Java/gtPlusPlus/core/item/chemistry/general/ItemNuclearChemBase.java b/src/Java/gtPlusPlus/core/item/chemistry/general/ItemNuclearChemBase.java new file mode 100644 index 0000000000..cfd3fd6259 --- /dev/null +++ b/src/Java/gtPlusPlus/core/item/chemistry/general/ItemNuclearChemBase.java @@ -0,0 +1,152 @@ +package gtPlusPlus.core.item.chemistry.general; + +import java.util.List; + +import cpw.mods.fml.common.registry.GameRegistry; +import gtPlusPlus.core.lib.CORE; +import gtPlusPlus.core.util.minecraft.ItemUtils; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.EnumRarity; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; +import net.minecraft.world.World; + +public class ItemNuclearChemBase extends Item { + + final protected IIcon base[]; + + final private int aMetaSize = 4; + + /* + * 0 - Uranium Residue + * 1 - Plutonium Residue + * 2 - Fluoride Reside + * 3 - Noble Gas Residue + */ + + public ItemNuclearChemBase() { + this.setHasSubtypes(true); + this.setNoRepair(); + this.setMaxStackSize(64); + this.setMaxDamage(0); + base = new IIcon[aMetaSize]; + this.setUnlocalizedName("BasicNuclearChemItem"); + GameRegistry.registerItem(this, this.getUnlocalizedName()); + } + + @Override + public int getItemStackLimit(ItemStack stack) { + return super.getItemStackLimit(stack); + } + + @Override + public boolean isDamageable() { + return false; + } + + @Override + public boolean shouldRotateAroundWhenRendering() { + return super.shouldRotateAroundWhenRendering(); + } + + @Override + public void onUpdate(ItemStack p_77663_1_, World p_77663_2_, Entity p_77663_3_, int p_77663_4_, boolean p_77663_5_) { + super.onUpdate(p_77663_1_, p_77663_2_, p_77663_3_, p_77663_4_, p_77663_5_); + } + + @Override + public String getItemStackDisplayName(ItemStack aStack) { + return super.getItemStackDisplayName(aStack); + } + + @Override + public EnumRarity getRarity(ItemStack p_77613_1_) { + return EnumRarity.common; + } + + @Override + public boolean requiresMultipleRenderPasses() { + return false; + } + + @Override + public void getSubItems(Item aItem, CreativeTabs p_150895_2_, List aList) { + for (int i=0;i<aMetaSize;i++) { + aList.add(ItemUtils.simpleMetaStack(aItem, i, 1)); + } + } + + @Override + public boolean getIsRepairable(ItemStack p_82789_1_, ItemStack p_82789_2_) { + return false; + } + + @Override + public boolean isRepairable() { + return false; + } + + @Override + public boolean isBookEnchantable(ItemStack stack, ItemStack book) { + return false; + } + + @Override + public int getDisplayDamage(ItemStack stack) { + return stack.getItemDamage(); + } + + @Override + public int getItemEnchantability() { + return 0; + } + + @Override + public int getItemEnchantability(ItemStack stack) { + return 0; + } + + @Override + public void registerIcons(final IIconRegister u) { + for (int i=0;i<this.aMetaSize;i++) { + String aPath = CORE.MODID + ":" + "science/nuclear/MetaItem1/"+i; + this.base[i] = u.registerIcon(aPath); + } + } + + + @Override + public IIcon getIconFromDamageForRenderPass(final int damage, final int pass) { + return this.base[damage]; + } + + @Override + public IIcon getIconFromDamage(int damage) { + return this.base[damage]; + } + + @Override + public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) { + return this.base[stack.getItemDamage()]; + } + + @Override + public IIcon getIcon(ItemStack stack, int pass) { + return this.base[stack.getItemDamage()]; + } + + @Override + public String getUnlocalizedName(ItemStack stack) { + return super.getUnlocalizedName() + "." + stack.getItemDamage(); + } + + @Override + public void addInformation(ItemStack aStack, EntityPlayer player, List list, boolean bool) { + super.addInformation(aStack, player, list, bool); + } + +} diff --git a/src/Java/gtPlusPlus/core/item/crafting/ItemDummyResearch.java b/src/Java/gtPlusPlus/core/item/crafting/ItemDummyResearch.java index 3f8e31d8d2..d8ddb26675 100644 --- a/src/Java/gtPlusPlus/core/item/crafting/ItemDummyResearch.java +++ b/src/Java/gtPlusPlus/core/item/crafting/ItemDummyResearch.java @@ -28,7 +28,8 @@ public class ItemDummyResearch extends ItemGenericToken { RESEARCH_6_BASIC_METALLURGY("Basic Metallurgy", "Information about material smelting"), RESEARCH_7_ADV_METALLURGY("Advanced Metallurgy", "Advanced Material Sciences!"), RESEARCH_8_TURBINE_AUTOMATION("Turbine Automation", "You really don't want to share this with anyone!"), - RESEARCH_9_CLOAKING("Cloaking Technologies", "Sneaking around like a mouse"); + RESEARCH_9_CLOAKING("Cloaking Technologies", "Sneaking around like a mouse"), + RESEARCH_10_SPARGING("Gas Sparging", "Blowing gas for results"); diff --git a/src/Java/gtPlusPlus/core/item/general/ItemHealingDevice.java b/src/Java/gtPlusPlus/core/item/general/ItemHealingDevice.java index 82bb29b5bf..db06af8297 100644 --- a/src/Java/gtPlusPlus/core/item/general/ItemHealingDevice.java +++ b/src/Java/gtPlusPlus/core/item/general/ItemHealingDevice.java @@ -144,7 +144,7 @@ public class ItemHealingDevice extends Item implements IElectricItem, IElectricI list.add(EnumChatFormatting.GOLD + aEuInfo + EnumChatFormatting.GRAY); list.add(EnumChatFormatting.GRAY + aTier+": [" + EnumChatFormatting.YELLOW + this.getTier(stack) + EnumChatFormatting.GRAY + "] "+aInputLimit+": [" + EnumChatFormatting.YELLOW - + this.getTransferLimit(stack) + EnumChatFormatting.GRAY + aEUT); + + this.getTransferLimit(stack) + EnumChatFormatting.GRAY + aEUT+"]"); list.add(EnumChatFormatting.GRAY + aCurrentPower +": [" + EnumChatFormatting.YELLOW + (long) this.getCharge(stack) + EnumChatFormatting.GRAY + aEU +"] [" + EnumChatFormatting.YELLOW + MathUtils.findPercentage(this.getCharge(stack), this.getMaxCharge(stack)) + EnumChatFormatting.GRAY diff --git a/src/Java/gtPlusPlus/core/lib/CORE.java b/src/Java/gtPlusPlus/core/lib/CORE.java index 5003eaab7f..dfd536d21c 100644 --- a/src/Java/gtPlusPlus/core/lib/CORE.java +++ b/src/Java/gtPlusPlus/core/lib/CORE.java @@ -10,7 +10,6 @@ import gregtech.api.GregTech_API; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.api.objects.data.Pair; import gtPlusPlus.api.objects.random.XSTR; -import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.reflect.ReflectionUtils; import gtPlusPlus.preloader.CORE_Preloader; import gtPlusPlus.xmod.gregtech.api.enums.GregtechOrePrefixes.GT_Materials; @@ -52,7 +51,7 @@ public class CORE { public static final String name = "GT++"; public static final String MODID = "miscutils"; - public static final String VERSION = "1.7.06-GTNH"; + public static final String VERSION = "1.7.15-GTNH"; //Tweakables public static int EVERGLADES_ID = 227; @@ -77,6 +76,7 @@ public class CORE { public static final WeakHashMap<World, EntityPlayerMP> fakePlayerCache = new WeakHashMap<World, EntityPlayerMP>(); //Tooltips; public static final String GT_Tooltip = "Added by: " + EnumChatFormatting.DARK_GREEN+"Alkalus "+EnumChatFormatting.GRAY+"- "+EnumChatFormatting.RED+"[GT++]"; + public static final String GT_Tooltip_Builder = "" + EnumChatFormatting.DARK_GREEN+"Alkalus "+EnumChatFormatting.GRAY+"- "+EnumChatFormatting.RED+"[GT++]"; public static final String GT_Tooltip_Radioactive = EnumChatFormatting.GRAY+"Warning: "+EnumChatFormatting.GREEN+"Radioactive! "+EnumChatFormatting.GOLD+" Avoid direct handling without hazmat protection."; public static final String noItem = ""; @@ -297,8 +297,6 @@ public class CORE { public static int pollutionPerSecondMultiGeneratorArray; public static int pollutionPerSecondMultiTreeFarm = 100; public static int pollutionPerSecondMultiFrothFlotationCell = 0; - public static int pollutionPerSecondMultiNuclearReactor_ModeBoosted = 160; - public static int pollutionPerSecondMultiNuclearReactor_ModeNormal = 80; public static int pollutionPerSecondMultiAutoCrafter = 500; public static int pollutionPerSecondMultiThermalBoiler = 700; public static int pollutionPerSecondMultiAlgaePond = 0; @@ -340,13 +338,21 @@ public class CORE { Logger.INFO("This should only happy in a development environment or when something really bad happens."); Logger.INFO("Reason: "+aReason); Logger.INFO("=========================================================="); - Logger.INFO("Called from: "+ReflectionUtils.getMethodName(0)); - Logger.INFO(ReflectionUtils.getMethodName(1)); + Logger.INFO("Called from: "+ReflectionUtils.getMethodName(1)); Logger.INFO(ReflectionUtils.getMethodName(2)); Logger.INFO(ReflectionUtils.getMethodName(3)); Logger.INFO(ReflectionUtils.getMethodName(4)); Logger.INFO(ReflectionUtils.getMethodName(5)); - Logger.INFO(ReflectionUtils.getMethodName(6)); + Logger.INFO(ReflectionUtils.getMethodName(6)); + Logger.INFO(ReflectionUtils.getMethodName(7)); + Logger.INFO(ReflectionUtils.getMethodName(8)); + Logger.INFO(ReflectionUtils.getMethodName(9)); + Logger.INFO(ReflectionUtils.getMethodName(10)); + Logger.INFO(ReflectionUtils.getMethodName(11)); + Logger.INFO(ReflectionUtils.getMethodName(12)); + Logger.INFO(ReflectionUtils.getMethodName(13)); + Logger.INFO(ReflectionUtils.getMethodName(14)); + Logger.INFO(ReflectionUtils.getMethodName(15)); FMLCommonHandler.instance().exitJava(0, true); } diff --git a/src/Java/gtPlusPlus/core/material/ALLOY.java b/src/Java/gtPlusPlus/core/material/ALLOY.java index 22ffc34205..fd7547970c 100644 --- a/src/Java/gtPlusPlus/core/material/ALLOY.java +++ b/src/Java/gtPlusPlus/core/material/ALLOY.java @@ -635,7 +635,27 @@ public final class ALLOY { new MaterialStack(ELEMENT.getInstance().COPPER, 3), new MaterialStack(ELEMENT.getInstance().OXYGEN, 8) }); - + + + public static final Material HS188A = new Material( + "HS188-A", //Material Name + MaterialState.SOLID, //State + null, //Material Colour + 4870, //Melting Point in C + 7550, //Boiling Point in C + -1, //Protons + -1, //Neutrons + true, //Uses Blast furnace? + new MaterialStack[]{ + new MaterialStack(ELEMENT.getInstance().COBALT, 20), + new MaterialStack(ELEMENT.getInstance().HAFNIUM, 20), + new MaterialStack(TALONITE, 16), + new MaterialStack(ELEMENT.getInstance().RHENIUM, 10), + new MaterialStack(NIOBIUM_CARBIDE, 10), + new MaterialStack(HASTELLOY_X, 8), + new MaterialStack(TUNGSTENSTEEL, 8), + new MaterialStack(ZIRCONIUM_CARBIDE, 8), + }); //Material Stacks with Percentage of required elements. /** * Stargate Materials - #D2FFA9 210, 255, 170 @@ -725,6 +745,24 @@ public final class ALLOY { /* * Top Tier Alloys */ + + public static final Material HELICOPTER = new Material( + "HeLiCoPtEr", //Material Name + MaterialState.SOLID, //State + null, //Material Colour + 5763, + 8192, + -1, + -1, + true, //Uses Blast furnace? + //Material Stacks with Percentage of required elements. + new MaterialStack[]{ + new MaterialStack(ELEMENT.getInstance().HELIUM, 20), + new MaterialStack(ELEMENT.getInstance().LITHIUM, 20), + new MaterialStack(ELEMENT.getInstance().COBALT, 20), + new MaterialStack(ELEMENT.getInstance().PLATINUM, 20), + new MaterialStack(ELEMENT.getInstance().ERBIUM, 20) + }); //0lafe Compound public static final Material LAFIUM = new Material( diff --git a/src/Java/gtPlusPlus/core/material/ELEMENT.java b/src/Java/gtPlusPlus/core/material/ELEMENT.java index 3af8b560ad..54af01ef6e 100644 --- a/src/Java/gtPlusPlus/core/material/ELEMENT.java +++ b/src/Java/gtPlusPlus/core/material/ELEMENT.java @@ -23,7 +23,7 @@ public final class ELEMENT { public final Material NITROGEN = MaterialUtils.generateMaterialFromGtENUM(Materials.Nitrogen); public final Material OXYGEN = MaterialUtils.generateMaterialFromGtENUM(Materials.Oxygen); public final Material FLUORINE = MaterialUtils.generateMaterialFromGtENUM(Materials.Fluorine); - public final Material NEON = new Material("Neon", MaterialState.GAS, new short[]{255, 255, 255}, -248, -246, 10, 10, false, "Ne", 0);//Not a GT Inherited Material + public final Material NEON = new Material("Neon", MaterialState.PURE_GAS, new short[]{240, 180, 30}, -248, -246, 10, 10, false, "Ne", 0);//Not a GT Inherited Material public final Material SODIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Sodium); public final Material MAGNESIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Magnesium); public final Material ALUMINIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Aluminium); @@ -51,7 +51,7 @@ public final class ELEMENT { public final Material ARSENIC = MaterialUtils.generateMaterialFromGtENUM(Materials.Arsenic); public final Material SELENIUM = new Material("Selenium", MaterialState.SOLID, new short[]{190, 190, 190}, 217, 685, 34, 45, false, "Se", 0);//Not a GT Inherited Material public final Material BROMINE = new Material("Bromine", MaterialState.PURE_LIQUID, new short[]{200, 25, 25}, -7, 58, 35, 45, false, "Br", 0);//Not a GT Inherited Material - public final Material KRYPTON = new Material("Krypton", MaterialState.PURE_LIQUID, new short[]{255, 255, 255}, -157, -153, 36, 48, false, "Kr", 0);//Not a GT Inherited Material + public final Material KRYPTON = new Material("Krypton", MaterialState.PURE_GAS, new short[]{5, 200, 220}, -157, -153, 36, 48, false, "Kr", 0);//Not a GT Inherited Material public final Material RUBIDIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Rubidium); public final Material STRONTIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Strontium, new short[] {230, 210, 110}, TextureSet.SET_FLINT); public final Material YTTRIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Yttrium); @@ -69,7 +69,7 @@ public final class ELEMENT { public final Material ANTIMONY = MaterialUtils.generateMaterialFromGtENUM(Materials.Antimony); public final Material TELLURIUM = new Material("Tellurium", MaterialState.SOLID, new short[]{210, 210, 210}, 449, 989, 52, 76, false, "Te", 0);//Not a GT Inherited Material public final Material IODINE = new Material("Iodine", MaterialState.SOLID, TextureSet.SET_SHINY, new short[]{96, 96, 96}, 114, 184, 53, 74, false, "I", 0);//Not a GT Inherited Material - public final Material XENON = new Material("Xenon", MaterialState.GAS, new short[]{255, 255, 255}, -111, -108, 54, 77, false, "Xe", 0);//Not a GT Inherited Material + public final Material XENON = new Material("Xenon", MaterialState.PURE_GAS, new short[]{5, 105, 210}, -111, -108, 54, 77, false, "Xe", 0);//Not a GT Inherited Material public final Material CAESIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Caesium); public final Material BARIUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Barium); public final Material LANTHANUM = MaterialUtils.generateMaterialFromGtENUM(Materials.Lanthanum); @@ -143,7 +143,7 @@ public final class ELEMENT { public final Material LITHIUM7 = new Material("Lithium 7", MaterialState.SOLID, TextureSet.SET_SHINY, Materials.Lithium.mRGBa, Materials.Lithium.mMeltingPoint, Materials.Lithium.mBlastFurnaceTemp, Materials.Lithium.getProtons(), Materials.Lithium.getNeutrons(), Materials.Lithium.mBlastFurnaceRequired, StringUtils.superscript("7Li"), 0, false);//Not a GT Inherited Material public final Material URANIUM232 = new Material("Uranium 232", MaterialState.SOLID, TextureSets.NUCLEAR.get(), new short[]{88, 220, 103, 0}, 1132, 4131, 92, 140, false, StringUtils.superscript("232U"), 4);//Not a GT Inherited Material public final Material URANIUM233 = new Material("Uranium 233", MaterialState.SOLID, TextureSets.NUCLEAR.get(), new short[]{73, 220, 83, 0}, 1132, 4131, 92, 141, false, StringUtils.superscript("233U"), 2);//Not a GT Inherited Material - public final Material THORIUM232 = new Material("Thorium 232", MaterialState.SOLID, TextureSets.NUCLEAR.get(), new short[]{15, 60, 15, 0}, Materials.Thorium.mMeltingPoint, Materials.Thorium.mBlastFurnaceTemp, 90, 142, false, StringUtils.superscript("232Th"), 1, false);//Not a GT Inherited Material + public final Material THORIUM232 = new Material("Thorium 232", MaterialState.SOLID, TextureSets.NUCLEAR.get(), new short[]{15, 60, 15, 0}, Materials.Thorium.mMeltingPoint, Materials.Thorium.mBlastFurnaceTemp, 90, 142, false, StringUtils.superscript("232Th"), 1, true);//Not a GT Inherited Material public final Material PLUTONIUM239 = new Material("Plutonium-239", MaterialState.SOLID, TextureSets.NUCLEAR.get(), Materials.Plutonium.mDurability, Materials.Plutonium.mRGBa, Materials.Plutonium.mMeltingPoint, Materials.Plutonium.mBlastFurnaceTemp, 94, 145, false, StringUtils.superscript("239Pu"), 4, true);//Not a GT Inherited Material //RTG Fuels public final Material PLUTONIUM238 = new Material("Plutonium-238", MaterialState.SOLID, TextureSets.NUCLEAR.get(), Materials.Plutonium241.mDurability, Materials.Plutonium241.mRGBa, Materials.Plutonium241.mMeltingPoint, Materials.Plutonium241.mBlastFurnaceTemp, 94, 144, false, StringUtils.superscript("238Pu"), 2, false);//Not a GT Inherited Material diff --git a/src/Java/gtPlusPlus/core/material/MISC_MATERIALS.java b/src/Java/gtPlusPlus/core/material/MISC_MATERIALS.java index 8dad69f70a..aaee1cc790 100644 --- a/src/Java/gtPlusPlus/core/material/MISC_MATERIALS.java +++ b/src/Java/gtPlusPlus/core/material/MISC_MATERIALS.java @@ -71,7 +71,7 @@ public final class MISC_MATERIALS { public static final Material HYDROGEN_CYANIDE = new Material( "Hydrogen Cyanide", - MaterialState.PURE_LIQUID, //State + MaterialState.PURE_GAS, //State null, //Material Colour 4, //Melting Point in C 26, //Boiling Point in C @@ -87,7 +87,7 @@ public final class MISC_MATERIALS { public static final Material CARBON_MONOXIDE = new Material( "Carbon Monoxide", - MaterialState.PURE_LIQUID, //State + MaterialState.PURE_GAS, //State null, //Material Colour -1, //Melting Point in C -1, //Boiling Point in C @@ -102,7 +102,7 @@ public final class MISC_MATERIALS { public static final Material CARBON_DIOXIDE = new Material( "Carbon Dioxide", - MaterialState.PURE_LIQUID, //State + MaterialState.PURE_GAS, //State null, //Material Colour -1, //Melting Point in C -1, //Boiling Point in C @@ -245,7 +245,7 @@ public final class MISC_MATERIALS { public static final Material HYDROGEN_CHLORIDE = new Material( "Hydrogen Chloride", - MaterialState.PURE_LIQUID, + MaterialState.PURE_GAS, new MaterialStack[]{ new MaterialStack(ELEMENT.getInstance().HYDROGEN, 1), new MaterialStack(ELEMENT.getInstance().CHLORINE, 1), @@ -254,7 +254,7 @@ public final class MISC_MATERIALS { public static final Material SODIUM_CHLORIDE = new Material( "Sodium Chloride", - MaterialState.PURE_LIQUID, + MaterialState.PURE_GAS, new MaterialStack[]{ new MaterialStack(ELEMENT.getInstance().SODIUM, 1), new MaterialStack(ELEMENT.getInstance().CHLORINE, 1), @@ -263,7 +263,7 @@ public final class MISC_MATERIALS { public static final Material SODIUM_HYDROXIDE = new Material( "Sodium Hydroxide", - MaterialState.PURE_LIQUID, + MaterialState.PURE_GAS, new MaterialStack[]{ new MaterialStack(ELEMENT.getInstance().SODIUM, 1), new MaterialStack(HYDROXIDE, 1), diff --git a/src/Java/gtPlusPlus/core/material/Material.java b/src/Java/gtPlusPlus/core/material/Material.java index dee064353a..0e9eb9b376 100644 --- a/src/Java/gtPlusPlus/core/material/Material.java +++ b/src/Java/gtPlusPlus/core/material/Material.java @@ -3,7 +3,11 @@ package gtPlusPlus.core.material; import static gregtech.api.enums.GT_Values.M; import static gtPlusPlus.core.util.math.MathUtils.safeCast_LongToInt; -import java.util.*; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Set; import gregtech.api.enums.Materials; import gregtech.api.enums.OrePrefixes; @@ -33,16 +37,19 @@ import net.minecraftforge.fluids.FluidStack; public class Material { public static final Set<Material> mMaterialMap = new HashSet<Material>(); + public static HashMap<String, Material> mMaterialCache = new HashMap<String, Material>(); public static final Map<String, Map<String, ItemStack>> mComponentMap = new HashMap<String, Map<String, ItemStack>>(); + public static HashMap<String, String> sChemicalFormula = new HashMap<String, String>(); + private String unlocalizedName; private String localizedName; private MaterialState materialState; private TextureSet textureSet; - private Fluid vMoltenFluid; + private Fluid mFluid; private Fluid vPlasma; private boolean vGenerateCells; @@ -163,6 +170,8 @@ public class Material { try { this.unlocalizedName = Utils.sanitizeString(materialName); this.localizedName = materialName; + mMaterialCache.put(getLocalizedName().toLowerCase(), this); + Logger.INFO("Stored "+getLocalizedName()+" to cache with key: "+getLocalizedName().toLowerCase()); this.materialState = defaultState; @@ -466,29 +475,28 @@ public class Material { } if (generateFluid){ - final Materials isValid = Materials.get(this.getLocalizedName()); + final Materials aGregtechMaterial = tryFindGregtechMaterialEquivalent(); FluidStack aTest = FluidUtils.getWildcardFluidStack(localizedName, 1); if (aTest != null){ - this.vMoltenFluid = aTest.getFluid(); + this.mFluid = aTest.getFluid(); + checkForCellAndGenerate(this); } else { - if (isValid == null || isValid == Materials._NULL){ - queueFluidGeneration(); + if (aGregtechMaterial != null && !MaterialUtils.isNullGregtechMaterial(aGregtechMaterial)){ + aTest = FluidUtils.getWildcardFluidStack(aGregtechMaterial, 1); } - else { - FluidStack aTest2 = FluidUtils.getWildcardFluidStack(localizedName, 1); - if (aTest2 != null){ - this.vMoltenFluid = aTest2.getFluid(); - } - else { - queueFluidGeneration(); - } + if (aTest != null){ + this.mFluid = aTest.getFluid(); + checkForCellAndGenerate(this); } + else { + mFluid = generateFluid(); + } } this.vPlasma = this.generatePlasma(); } else { - this.vMoltenFluid = null; + this.mFluid = null; this.vPlasma = null; } String ratio = ""; @@ -511,6 +519,7 @@ public class Material { } } + sChemicalFormula.put(materialName.toLowerCase(), this.vChemicalFormula); Logger.MATERIALS("Creating a Material instance for "+materialName); Logger.MATERIALS("Formula: "+this.vChemicalFormula + " Smallest Stack: "+this.smallestStackSizeWhenProcessing+" Smallest Ratio:"+ratio); Logger.MATERIALS("Protons: "+this.vProtons); @@ -525,6 +534,36 @@ public class Material { } } + private static void checkForCellAndGenerate(Material material) { + if (!material.vGenerateCells) { + return; + } + String aName = Utils.sanitizeString(material.unlocalizedName); + String aName2 = Utils.sanitizeString(material.unlocalizedName.toLowerCase()); + String aName3 = (material.localizedName == null) ? aName : material.localizedName; + ItemStack aTestCell1 = ItemUtils.getItemStackOfAmountFromOreDictNoBroken("cell"+aName, 1); + ItemStack aTestCell2 = ItemUtils.getItemStackOfAmountFromOreDictNoBroken("cell"+aName2, 1); + ItemStack aTestCell3 = ItemUtils.getItemStackOfAmountFromOreDictNoBroken("cell"+aName3, 1); + if (aTestCell1 == null && aTestCell2 == null && aTestCell3 == null) { + Logger.INFO("Generating cell for "+ material.localizedName); + new BaseItemCell(material); + } + else { + if (aTestCell1 != null) { + Logger.INFO("Registering existing cell for "+ material.localizedName+", "+aName); + material.registerComponentForMaterial(OrePrefixes.cell, aTestCell1); + } + else if (aTestCell2 != null) { + Logger.INFO("Registering existing cell for "+ material.localizedName+", "+aName2); + material.registerComponentForMaterial(OrePrefixes.cell, aTestCell2); + } + else if (aTestCell3 != null) { + Logger.INFO("Registering existing cell for "+ material.localizedName+", "+aName3); + material.registerComponentForMaterial(OrePrefixes.cell, aTestCell3); + } + } + } + public final TextureSet getTextureSet() { synchronized(this) { return textureSet; @@ -735,14 +774,26 @@ public class Material { else { // Try get a GT Material Materials Erf = MaterialUtils.getMaterial(this.unlocalizedName); - if (Erf != null && Erf != Materials._NULL) { + if (Erf != null && !MaterialUtils.isNullGregtechMaterial(Erf)) { ItemStack Erg = ItemUtils.getOrePrefixStack(aPrefix, Erf, stacksize); - if (Erg != null) { + if (Erg != null && ItemUtils.checkForInvalidItems(Erg)) { Logger.MATERIALS("Found \"" + aKey + this.unlocalizedName + "\" using backup GT Materials option."); g.put(aKey, Erg); mComponentMap.put(unlocalizedName, g); return Erg; } + else { + // Try get a molten cell + if (aPrefix == OrePrefixes.cell) { + Erg = ItemUtils.getOrePrefixStack(OrePrefixes.cellMolten, Erf, stacksize); + if (Erg != null && ItemUtils.checkForInvalidItems(Erg)) { + Logger.MATERIALS("Found \"" + OrePrefixes.cellMolten.name() + this.unlocalizedName + "\" using backup GT Materials option."); + g.put(aKey, Erg); + mComponentMap.put(unlocalizedName, g); + return Erg; + } + } + } } else { ItemStack u = ItemUtils.getItemStackOfAmountFromOreDictNoBroken(aKey + this.unlocalizedName, stacksize); if (u != null) { @@ -1082,7 +1133,6 @@ public class Material { public final static void generateQueuedFluids() { for (Material m : mMaterialMap) { if (m.isFluidQueued) { - m.vMoltenFluid = m.generateFluid(); } } } @@ -1185,8 +1235,9 @@ public class Material { 1000, this.vGenerateCells); } - else if (this.materialState == MaterialState.GAS){ - return FluidUtils.addGTFluid( + else if (this.materialState == MaterialState.GAS || this.materialState == MaterialState.PURE_GAS){ + return FluidUtils.generateGas(unlocalizedName, this.getLocalizedName(), getMeltingPointK(), getRGBA(), vGenerateCells); + /*return FluidUtils.addGTFluid( this.getUnlocalizedName(), this.getLocalizedName()+" Gas", this.RGBA, @@ -1195,7 +1246,7 @@ public class Material { aFullCell, ItemUtils.getEmptyCell(), 1000, - this.vGenerateCells); + this.vGenerateCells);*/ } else { //Plasma return this.generatePlasma(); @@ -1206,34 +1257,46 @@ public class Material { if (this.materialState == MaterialState.ORE){ return null; } - final Materials isValid = Materials.get(this.getLocalizedName()); + final Materials isValid = tryFindGregtechMaterialEquivalent(); if (!this.vGenerateCells){ return null; } - for (Materials m : invalidMaterials.values()){ - if (isValid == m){ - return (m.mPlasma != null ? m.mPlasma : null); + if (isValid != null) { + for (Materials m : invalidMaterials.values()){ + if (isValid == m){ + return null; + } + } + if (isValid.mPlasma != null){ + Logger.MATERIALS("Using a pre-defined Plasma from GT."); + return isValid.mPlasma; } } - if (isValid.mPlasma != null){ - Logger.MATERIALS("Using a pre-defined Plasma from GT."); - return isValid.mPlasma; - } - Logger.MATERIALS("Generating our own Plasma."); return FluidUtils.addGTPlasma(this); } + public Fluid getFluid() { + return mFluid; + } - final public FluidStack getFluid(final int fluidAmount) { - if (this.vMoltenFluid == null){ + final public FluidStack getFluidStack(final int fluidAmount) { + if (this.mFluid == null){ return null; } - final FluidStack moltenFluid = new FluidStack(this.vMoltenFluid, fluidAmount); + final FluidStack moltenFluid = new FluidStack(this.mFluid, fluidAmount); return moltenFluid; } + + final public boolean setFluid(Fluid aFluid) { + if (this.mFluid == null){ + this.mFluid = aFluid; + return true; + } + return false; + } final public int calculateMeltingPoint(){ @@ -1322,8 +1385,8 @@ public class Material { } private static boolean registerComponentForMaterial(Material componentMaterial, FluidStack aStack) { - if (componentMaterial != null && aStack != null && componentMaterial.vMoltenFluid == null) { - componentMaterial.vMoltenFluid = aStack.getFluid(); + if (componentMaterial != null && aStack != null && componentMaterial.mFluid == null) { + componentMaterial.mFluid = aStack.getFluid(); return true; } return false; @@ -1364,5 +1427,35 @@ public class Material { return false; } } + + public Materials tryFindGregtechMaterialEquivalent() { + return tryFindGregtechMaterialEquivalent(this); + } + + + public static Materials tryFindGregtechMaterialEquivalent(Material aMaterial) { + String aMaterialName = aMaterial.getLocalizedName(); + Materials aGregtechMaterial = Materials.get(aMaterialName); + if (aGregtechMaterial == null || MaterialUtils.isNullGregtechMaterial(aGregtechMaterial)) { + aMaterialName = aMaterialName.replace(" ", "_"); + aGregtechMaterial = Materials.get(aMaterialName); + if (aGregtechMaterial == null || MaterialUtils.isNullGregtechMaterial(aGregtechMaterial)) { + aMaterialName = aMaterialName.replace(" ", ""); + aGregtechMaterial = Materials.get(aMaterialName); + if (aGregtechMaterial == null || MaterialUtils.isNullGregtechMaterial(aGregtechMaterial)) { + return null; + } + else { + return aGregtechMaterial; + } + } + else { + return aGregtechMaterial; + } + } + else { + return aGregtechMaterial; + } + } }
\ No newline at end of file diff --git a/src/Java/gtPlusPlus/core/material/MaterialGenerator.java b/src/Java/gtPlusPlus/core/material/MaterialGenerator.java index 20fdfd3c8c..8425ed89be 100644 --- a/src/Java/gtPlusPlus/core/material/MaterialGenerator.java +++ b/src/Java/gtPlusPlus/core/material/MaterialGenerator.java @@ -2,6 +2,9 @@ package gtPlusPlus.core.material; import java.util.Set; +import gregtech.api.enums.GT_Values; +import gregtech.api.enums.OrePrefixes; +import gregtech.api.util.GT_Utility; import gtPlusPlus.api.interfaces.RunnableWithInfo; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.api.objects.data.AutoMap; @@ -29,7 +32,10 @@ import gtPlusPlus.core.item.base.rods.BaseItemRod; import gtPlusPlus.core.item.base.rods.BaseItemRodLong; import gtPlusPlus.core.item.base.rotors.BaseItemRotor; import gtPlusPlus.core.item.base.screws.BaseItemScrew; +import gtPlusPlus.core.lib.CORE; +import gtPlusPlus.core.material.nuclear.FLUORIDES; import gtPlusPlus.core.material.state.MaterialState; +import gtPlusPlus.core.recipe.common.CI; import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.minecraft.FluidUtils; import gtPlusPlus.core.util.minecraft.ItemUtils; @@ -41,7 +47,9 @@ import gtPlusPlus.xmod.gregtech.loaders.RecipeGen_Extruder; import gtPlusPlus.xmod.gregtech.loaders.RecipeGen_FluidCanning; import gtPlusPlus.xmod.gregtech.loaders.RecipeGen_Fluids; import gtPlusPlus.xmod.gregtech.loaders.RecipeGen_MaterialProcessing; +import gtPlusPlus.xmod.gregtech.loaders.RecipeGen_MetalRecipe; import gtPlusPlus.xmod.gregtech.loaders.RecipeGen_Ore; +import gtPlusPlus.xmod.gregtech.loaders.RecipeGen_Plasma; import gtPlusPlus.xmod.gregtech.loaders.RecipeGen_Plates; import gtPlusPlus.xmod.gregtech.loaders.RecipeGen_Recycling; import gtPlusPlus.xmod.gregtech.loaders.RecipeGen_ShapedCrafting; @@ -188,6 +196,10 @@ public class MaterialGenerator { temp = new BaseItemDust(matInfo); FluidUtils.generateGas(unlocalizedName, materialName, matInfo.getMeltingPointK(), C, true); } + else if (matInfo.getState() == MaterialState.PURE_GAS){ + FluidUtils.generateGas(unlocalizedName, materialName, matInfo.getMeltingPointK(), C, true); + return true; + } else if (matInfo.getState() == MaterialState.PURE_LIQUID){ FluidUtils.generateFluidNoPrefix(unlocalizedName, materialName, matInfo.getMeltingPointK(), C); return true; @@ -202,6 +214,7 @@ public class MaterialGenerator { if (generateBlastSmelterRecipes){ new RecipeGen_BlastSmelter(matInfo); } + new RecipeGen_MetalRecipe(matInfo); new RecipeGen_Extruder(matInfo); new RecipeGen_Fluids(matInfo); new RecipeGen_Plates(matInfo); @@ -210,6 +223,8 @@ public class MaterialGenerator { new RecipeGen_DustGeneration(matInfo); new RecipeGen_Recycling(matInfo); + new RecipeGen_Plasma(matInfo); + return true; } catch (final Throwable t) @@ -258,13 +273,50 @@ public class MaterialGenerator { generateNuclearMaterial(matInfo, true); } + + public static void generateNuclearDusts(final Material matInfo){ + generateNuclearDusts(matInfo, true); + } + + public static void generateNuclearDusts(final Material matInfo, boolean generateDehydratorRecipe){ + generateNuclearMaterial(matInfo, false, true, false, false, true); + if (generateDehydratorRecipe && matInfo.getFluid() != null && matInfo.getDust(0) != null) { + CORE.RA.addDehydratorRecipe( + new ItemStack[] { + CI.getNumberedAdvancedCircuit(20) + }, + matInfo.getFluidStack(144), + null, + new ItemStack[] { + matInfo.getDust(1), + }, + new int[] { 10000 }, + 10*(matInfo.vVoltageMultiplier/5), // Time in ticks + matInfo.vVoltageMultiplier); // EU + } + else { + Logger.INFO("Nuclear Dehydrator: Did not generate recipe for "+matInfo.getLocalizedName()+" | Null Fluid? "+(matInfo.getFluid() == null)+" | Null Dust? "+(matInfo.getDust(0) == null)); + } + } + public static void generateNuclearMaterial(final Material matInfo, final boolean generatePlates){ + generateNuclearMaterial(matInfo, true, true, true, generatePlates, true); + } + + public static void generateNuclearMaterial(final Material matInfo, final boolean generateBlock, + final boolean generateDusts, final boolean generateIngot, final boolean generatePlates, final boolean disableOptionalRecipes){ try { - tempBlock = new BlockBaseModular(matInfo,BlockTypes.STANDARD); - temp = new BaseItemDust(matInfo); - temp = new BaseItemIngot(matInfo); - temp = new BaseItemNugget(matInfo); + if (generateBlock) { + tempBlock = new BlockBaseModular(matInfo,BlockTypes.STANDARD); + } + if (generateDusts) { + temp = new BaseItemDust(matInfo); + } + if (generateIngot) { + temp = new BaseItemIngot(matInfo); + temp = new BaseItemNugget(matInfo); + } if (generatePlates) { temp = new BaseItemPlate(matInfo); @@ -274,11 +326,16 @@ public class MaterialGenerator { new RecipeGen_Assembler(matInfo); } - new RecipeGen_ShapedCrafting(matInfo); - new RecipeGen_Fluids(matInfo); - new RecipeGen_MaterialProcessing(matInfo); - new RecipeGen_DustGeneration(matInfo, true); - new RecipeGen_Recycling(matInfo); + if (!disableOptionalRecipes) { + new RecipeGen_ShapedCrafting(matInfo); + new RecipeGen_Fluids(matInfo); + new RecipeGen_MaterialProcessing(matInfo); + new RecipeGen_Recycling(matInfo); + } + + new RecipeGen_MetalRecipe(matInfo); + new RecipeGen_DustGeneration(matInfo, disableOptionalRecipes); + new RecipeGen_Plasma(matInfo); } catch (final Throwable t){ Logger.MATERIALS(""+matInfo.getLocalizedName()+" failed to generate."); diff --git a/src/Java/gtPlusPlus/core/material/ORES.java b/src/Java/gtPlusPlus/core/material/ORES.java index c2556b60f1..0186c23a07 100644 --- a/src/Java/gtPlusPlus/core/material/ORES.java +++ b/src/Java/gtPlusPlus/core/material/ORES.java @@ -6,119 +6,147 @@ import gtPlusPlus.core.material.state.MaterialState; public final class ORES { - public static final Material GEIKIELITE = new Material( - "Geikielite", //Material Name + public static final Material AGARDITE_CD = new Material( + "Agardite (Cd)", //Material Name MaterialState.ORE, //State - TextureSets.GEM_A.get(), //Texture Set - new short[]{187, 193, 204, 0}, //Material Colour + TextureSet.SET_METALLIC, //Texture Set + new short[]{170, 188, 33, 0}, //Material Colour -1, -1, -1, -1, -1, //Radiation - new MaterialStack[]{ - new MaterialStack(ELEMENT.getInstance().MAGNESIUM, 1), - new MaterialStack(ELEMENT.getInstance().TITANIUM, 1), - new MaterialStack(ELEMENT.getInstance().OXYGEN, 3) + new MaterialStack[]{// (CdCa)Cu7(AsO2)4(O2H)5·3H2O + new MaterialStack(ELEMENT.getInstance().CADMIUM, 1), + new MaterialStack(ELEMENT.getInstance().CALCIUM, 1), + new MaterialStack(ELEMENT.getInstance().COPPER, 7), + new MaterialStack(ELEMENT.getInstance().ARSENIC, 4), + new MaterialStack(ELEMENT.getInstance().OXYGEN, 21), + new MaterialStack(ELEMENT.getInstance().HYDROGEN, 11) }); - public static final Material ZIMBABWEITE = new Material( - "Zimbabweite", //Material Name + public static final Material AGARDITE_LA = new Material( + "Agardite (La)", //Material Name MaterialState.ORE, //State TextureSet.SET_FINE, //Texture Set - new short[]{193, 187, 131, 0}, //Material Colour + new short[]{206, 232, 9, 0}, //Material Colour -1, -1, -1, -1, -1, //Radiation - new MaterialStack[]{ - new MaterialStack(ELEMENT.getInstance().CALCIUM, 2), - new MaterialStack(ELEMENT.getInstance().POTASSIUM, 2), - new MaterialStack(ELEMENT.getInstance().LEAD, 1), - new MaterialStack(ELEMENT.getInstance().ARSENIC, 4), - new MaterialStack(ELEMENT.getInstance().NIOBIUM, 4), - new MaterialStack(ELEMENT.getInstance().TANTALUM, 4), - new MaterialStack(ELEMENT.getInstance().TITANIUM, 4), - new MaterialStack(ELEMENT.getInstance().OXYGEN, 18) + new MaterialStack[]{// (LaCa)Cu5(AsO6)2(OH)4·3H2O + new MaterialStack(ELEMENT.getInstance().LANTHANUM, 1), + new MaterialStack(ELEMENT.getInstance().CALCIUM, 1), + new MaterialStack(ELEMENT.getInstance().COPPER, 5), + new MaterialStack(ELEMENT.getInstance().ARSENIC, 2), + new MaterialStack(ELEMENT.getInstance().OXYGEN, 19), + new MaterialStack(ELEMENT.getInstance().HYDROGEN, 10) }); - public static final Material TITANITE = new Material( - "Titanite", //Material Name + public static final Material AGARDITE_ND = new Material( + "Agardite (Nd)", //Material Name MaterialState.ORE, //State TextureSet.SET_METALLIC, //Texture Set - new short[]{184, 198, 105, 0}, //Material Colour + new short[]{225, 244, 78, 0}, //Material Colour -1, -1, -1, -1, -1, //Radiation - new MaterialStack[]{ - new MaterialStack(ELEMENT.getInstance().CALCIUM, 2), - new MaterialStack(ELEMENT.getInstance().TITANIUM, 2), - new MaterialStack(ELEMENT.getInstance().SILICON, 2), - new MaterialStack(ELEMENT.getInstance().THORIUM, 1), - new MaterialStack(ELEMENT.getInstance().OXYGEN, 10) + new MaterialStack[]{// (NdCa)Cu6(As3O3)2(O2H)6·3H2O + new MaterialStack(ELEMENT.getInstance().NEODYMIUM, 1), + new MaterialStack(ELEMENT.getInstance().CALCIUM, 1), + new MaterialStack(ELEMENT.getInstance().COPPER, 6), + new MaterialStack(ELEMENT.getInstance().ARSENIC, 6), + new MaterialStack(ELEMENT.getInstance().OXYGEN, 21), + new MaterialStack(ELEMENT.getInstance().HYDROGEN, 12) }); - public static final Material ZIRCONILITE = new Material( - "Zirconolite", //Material Name + public static final Material AGARDITE_Y = new Material( + "Agardite (Y)", //Material Name MaterialState.ORE, //State - TextureSet.SET_FINE, //Texture Set - new short[]{45, 26, 0, 0}, //Material Colour + TextureSet.SET_METALLIC, //Texture Set + new short[]{210, 232, 44, 0}, //Material Colour -1, -1, -1, -1, -1, //Radiation - new MaterialStack[]{ - new MaterialStack(ELEMENT.getInstance().CALCIUM, 2), - new MaterialStack(ELEMENT.getInstance().ZIRCONIUM, 2), - new MaterialStack(ELEMENT.getInstance().TITANIUM, 4), - new MaterialStack(ELEMENT.getInstance().CERIUM, 1), - new MaterialStack(ELEMENT.getInstance().OXYGEN, 14) + new MaterialStack[]{// (YCa)Cu5(As2O4)3(OH)6·3H2O + new MaterialStack(ELEMENT.getInstance().YTTRIUM, 1), + new MaterialStack(ELEMENT.getInstance().CALCIUM, 1), + new MaterialStack(ELEMENT.getInstance().COPPER, 5), + new MaterialStack(ELEMENT.getInstance().ARSENIC, 6), + new MaterialStack(ELEMENT.getInstance().OXYGEN, 21), + new MaterialStack(ELEMENT.getInstance().HYDROGEN, 12) }); - public static final Material CROCROITE = new Material( - "Crocoite", //Material Name + //Alburnite + //Ag8GeTe2S4 + public static final Material ALBURNITE = new Material( + "Alburnite", //Material Name MaterialState.ORE, //State - TextureSet.SET_GEM_VERTICAL, //Texture Set - new short[]{255, 143, 84, 0}, //Material Colour + TextureSet.SET_METALLIC, //Texture Set + new short[]{16, 5, 105, 0}, //Material Colour -1, -1, -1, -1, - -1, //Radiation - new MaterialStack[]{ - new MaterialStack(ELEMENT.getInstance().LEAD, 2), - new MaterialStack(ELEMENT.getInstance().CHROMIUM, 2), - new MaterialStack(ELEMENT.getInstance().OXYGEN, 3), - new MaterialStack(ELEMENT.getInstance().CAESIUM, 1), + 0, //Radiation + new MaterialStack[]{// Na3AlF6 + new MaterialStack(ELEMENT.getInstance().GOLD, 8), + new MaterialStack(ELEMENT.getInstance().GERMANIUM, 1), + new MaterialStack(ELEMENT.getInstance().TELLURIUM, 2), + new MaterialStack(ELEMENT.getInstance().SULFUR, 4) }); - public static final Material NICHROMITE = new Material( - "Nichromite", //Material Name + public static final Material CERITE = new Material( + "Cerite", //Material Name MaterialState.ORE, //State - TextureSet.SET_METALLIC, //Texture Set - new short[]{22, 19, 19, 0}, //Material Colour + TextureSets.REFINED.get(), //Texture Set + new short[]{68, 13, 0, 0}, //Material Colour -1, -1, -1, -1, -1, //Radiation - new MaterialStack[]{ - new MaterialStack(ELEMENT.getInstance().NICKEL, 1), - new MaterialStack(ELEMENT.getInstance().COBALT, 1), + new MaterialStack[]{// (Ce,La,Ca)9(Mg,Fe+3)(SiO4)6(SiO3OH)(OH)3 + new MaterialStack(ELEMENT.getInstance().CERIUM, 9), + new MaterialStack(ELEMENT.getInstance().LANTHANUM, 9), + new MaterialStack(ELEMENT.getInstance().CALCIUM, 9), + new MaterialStack(ELEMENT.getInstance().MAGNESIUM, 3), new MaterialStack(ELEMENT.getInstance().IRON, 3), - new MaterialStack(ELEMENT.getInstance().ALUMINIUM, 2), - new MaterialStack(ELEMENT.getInstance().CHROMIUM, 2), - new MaterialStack(ELEMENT.getInstance().OXYGEN, 8) + new MaterialStack(ELEMENT.getInstance().SILICON, 7), + new MaterialStack(ELEMENT.getInstance().OXYGEN, 20), + new MaterialStack(ELEMENT.getInstance().HYDROGEN, 4) }); - public static final Material YTTRIAITE = new Material( //TODO - "Yttriaite", //Material Name + //Comancheite + //Hg55N24(NH2,OH)4(Cl,Br)34 + public static final Material COMANCHEITE = new Material( + "Comancheite", //Material Name MaterialState.ORE, //State - TextureSet.SET_METALLIC, //Texture Set + TextureSets.REFINED.get(), //Texture Set + new short[]{65, 205, 105, 0}, //Material Colour + -1, + -1, + -1, + -1, + 0, //Radiation + new MaterialStack[]{// Na3AlF6 + new MaterialStack(ELEMENT.getInstance().MERCURY, 54/4), + new MaterialStack(ELEMENT.getInstance().NITROGEN, 28/4), + new MaterialStack(ELEMENT.getInstance().HYDROGEN, 12/4), + new MaterialStack(ELEMENT.getInstance().OXYGEN, 8/4), + new MaterialStack(ELEMENT.getInstance().CHLORINE, 34/4), + new MaterialStack(ELEMENT.getInstance().BROMINE, 34/4) + }); + + public static final Material CROCROITE = new Material( + "Crocoite", //Material Name + MaterialState.ORE, //State + TextureSet.SET_GEM_VERTICAL, //Texture Set new short[]{255, 143, 84, 0}, //Material Colour -1, -1, @@ -126,67 +154,82 @@ public final class ORES { -1, -1, //Radiation new MaterialStack[]{ - new MaterialStack(ELEMENT.getInstance().YTTRIUM, 1), //Y not YT/YB + new MaterialStack(ELEMENT.getInstance().LEAD, 2), + new MaterialStack(ELEMENT.getInstance().CHROMIUM, 2), new MaterialStack(ELEMENT.getInstance().OXYGEN, 3), - new MaterialStack(ELEMENT.getInstance().IRON, 4), - new MaterialStack(ELEMENT.getInstance().TIN, 1), - new MaterialStack(ELEMENT.getInstance().NITROGEN, 2) - }); + new MaterialStack(ELEMENT.getInstance().CAESIUM, 1), + }); - //Samarskite_Y - public static final Material SAMARSKITE_Y = new Material( - "Samarskite (Y)", //Material Name + public static final Material CRYOLITE = new Material( + "Cryolite (F)", //Material Name MaterialState.ORE, //State - TextureSets.ENRICHED.get(), //Texture Set - new short[]{65, 163, 164, 0}, //Material Colour + TextureSet.SET_SHINY, //Texture Set + new short[]{205, 205, 255, 0}, //Material Colour -1, -1, -1, -1, -1, //Radiation - new MaterialStack[]{ - new MaterialStack(ELEMENT.getInstance().YTTRIUM, 2), //Y not YT/YB - new MaterialStack(ELEMENT.getInstance().IRON, 10), - new MaterialStack(ELEMENT.getInstance().URANIUM235, 2), - new MaterialStack(ELEMENT.getInstance().THORIUM, 3), - new MaterialStack(ELEMENT.getInstance().NIOBIUM, 2), - new MaterialStack(ELEMENT.getInstance().TANTALUM, 3) + new MaterialStack[]{// Na3AlF6 + new MaterialStack(ELEMENT.getInstance().SODIUM, 3), + new MaterialStack(ELEMENT.getInstance().ALUMINIUM, 1), + new MaterialStack(ELEMENT.getInstance().FLUORINE, 6) }); - //Samarskite_YB - public static final Material SAMARSKITE_YB = new Material( - "Samarskite (Yb)", //Material Name + //Demicheleite-(Br) + // BiSBr + public static final Material DEMICHELEITE_BR = new Material( + "Demicheleite (Br)", //Material Name MaterialState.ORE, //State - TextureSets.ENRICHED.get(), //Texture Set - new short[]{95, 193, 194, 0}, //Material Colour + TextureSet.SET_SHINY, //Texture Set + new short[]{165, 75, 75, 0}, //Material Colour -1, -1, -1, -1, -1, //Radiation - new MaterialStack[]{ - new MaterialStack(ELEMENT.getInstance().YTTERBIUM, 2), //Y not YT/YB - new MaterialStack(ELEMENT.getInstance().IRON, 9), - new MaterialStack(ELEMENT.getInstance().URANIUM235, 3), - new MaterialStack(ELEMENT.getInstance().THORIUM, 2), - new MaterialStack(ELEMENT.getInstance().NIOBIUM, 3), - new MaterialStack(ELEMENT.getInstance().TANTALUM, 2) + new MaterialStack[]{// Na3AlF6 + new MaterialStack(ELEMENT.getInstance().BISMUTH, 13), + new MaterialStack(ELEMENT.getInstance().SULFUR, 11), + new MaterialStack(ELEMENT.getInstance().BROMINE, 1) }); - public static final Material ZIRCON = new Material( - "Zircon", //Material Name + public static final Material FLORENCITE = new Material( + "Florencite", //Material Name MaterialState.ORE, //State - TextureSets.GEM_A.get(), //Texture Set - new short[]{195, 19, 19, 0}, //Material Colour + TextureSet.SET_METALLIC, //Texture Set + new short[]{249, 249, 124, 0}, //Material Colour -1, -1, -1, -1, -1, //Radiation - new MaterialStack[]{ - new MaterialStack(ELEMENT.getInstance().ZIRCONIUM, 1), - new MaterialStack(ELEMENT.getInstance().SILICON, 1), - new MaterialStack(ELEMENT.getInstance().OXYGEN, 4), + new MaterialStack[]{// SmAl3(PO4)2(OH)6 + new MaterialStack(ELEMENT.getInstance().SAMARIUM, 1), + new MaterialStack(ELEMENT.getInstance().ALUMINIUM, 3), + new MaterialStack(ELEMENT.getInstance().PHOSPHORUS, 1), + new MaterialStack(ELEMENT.getInstance().OXYGEN, 10), + new MaterialStack(ELEMENT.getInstance().HYDROGEN, 6) + }); + + public static final Material FLUORCAPHITE = new Material( + "Fluorcaphite", //Material Name + MaterialState.ORE, //State + TextureSet.SET_FINE, //Texture Set + new short[]{255, 255, 30, 0}, //Material Colour + -1, + -1, + -1, + -1, + -1, //Radiation + new MaterialStack[]{// (Ca,Sr,Ce,Na)5(PO4)3F + new MaterialStack(ELEMENT.getInstance().CALCIUM, 5), + new MaterialStack(MISC_MATERIALS.STRONTIUM_OXIDE, 5), + new MaterialStack(ELEMENT.getInstance().CERIUM, 5), + new MaterialStack(ELEMENT.getInstance().SODIUM, 5), + new MaterialStack(ELEMENT.getInstance().PHOSPHORUS, 3), + new MaterialStack(ELEMENT.getInstance().OXYGEN, 12), + new MaterialStack(ELEMENT.getInstance().FLUORINE, 6), }); //Gadolinite_Ce @@ -202,6 +245,7 @@ public final class ORES { -1, //Radiation new MaterialStack[]{ new MaterialStack(ELEMENT.getInstance().CERIUM, 4), + new MaterialStack(ELEMENT.getInstance().ERBIUM, 2), new MaterialStack(ELEMENT.getInstance().LANTHANUM, 2), new MaterialStack(ELEMENT.getInstance().NEODYMIUM, 2), new MaterialStack(ELEMENT.getInstance().YTTRIUM, 2), @@ -224,6 +268,7 @@ public final class ORES { -1, //Radiation new MaterialStack[]{ new MaterialStack(ELEMENT.getInstance().CERIUM, 2), + new MaterialStack(ELEMENT.getInstance().ERBIUM, 2), new MaterialStack(ELEMENT.getInstance().LANTHANUM, 2), new MaterialStack(ELEMENT.getInstance().NEODYMIUM, 2), new MaterialStack(ELEMENT.getInstance().YTTRIUM, 4), @@ -233,171 +278,161 @@ public final class ORES { new MaterialStack(ELEMENT.getInstance().OXYGEN, 9), }); - public static final Material LEPERSONNITE = new Material( - "Lepersonnite", //Material Name + public static final Material GEIKIELITE = new Material( + "Geikielite", //Material Name MaterialState.ORE, //State - TextureSet.SET_EMERALD, //Texture Set - new short[]{175, 175, 20, 0}, //Material Colour + TextureSets.GEM_A.get(), //Texture Set + new short[]{187, 193, 204, 0}, //Material Colour -1, -1, -1, -1, -1, //Radiation new MaterialStack[]{ - new MaterialStack(ELEMENT.getInstance().CALCIUM, 1), - new MaterialStack(ELEMENT.getInstance().GADOLINIUM, 2), - new MaterialStack(ELEMENT.getInstance().DYSPROSIUM, 2), - new MaterialStack(ELEMENT.getInstance().URANIUM235, 2), - new MaterialStack(ELEMENT.getInstance().OXYGEN,32), - new MaterialStack(ELEMENT.getInstance().HYDROGEN, 24) + new MaterialStack(ELEMENT.getInstance().MAGNESIUM, 1), + new MaterialStack(ELEMENT.getInstance().TITANIUM, 1), + new MaterialStack(ELEMENT.getInstance().OXYGEN, 3) }); - - public static final Material XENOTIME = new Material( - "Xenotime", //Material Name + + public static final Material GREENOCKITE = new Material( + "Greenockite", //Material Name MaterialState.ORE, //State - TextureSet.SET_OPAL, //Texture Set - new short[]{235, 89, 199, 0}, //Material Colour + TextureSets.GEM_A.get(), //Texture Set + new short[]{110, 193, 25, 0}, //Material Colour -1, -1, -1, -1, -1, //Radiation new MaterialStack[]{ - new MaterialStack(ELEMENT.getInstance().YTTRIUM, 1), - new MaterialStack(ELEMENT.getInstance().YTTERBIUM, 1), - new MaterialStack(ELEMENT.getInstance().PHOSPHORUS, 1), - new MaterialStack(ELEMENT.getInstance().OXYGEN, 4) + new MaterialStack(ELEMENT.getInstance().CADMIUM, 2), + new MaterialStack(ELEMENT.getInstance().SULFUR, 2), }); - - public static final Material YTTRIALITE = new Material( - "Yttrialite", //Material Name + + public static final Material HIBONITE = new Material( + "Hibonite", //Material Name MaterialState.ORE, //State - TextureSet.SET_RUBY, //Texture Set - new short[]{35, 189, 99, 0}, //Material Colour + TextureSet.SET_METALLIC, //Texture Set + new short[]{58, 31, 0, 0}, //Material Colour -1, -1, -1, -1, -1, //Radiation - new MaterialStack[]{ - new MaterialStack(ELEMENT.getInstance().YTTRIUM, 2), - new MaterialStack(ELEMENT.getInstance().THORIUM, 2), - new MaterialStack(ELEMENT.getInstance().SILICON, 2), - new MaterialStack(ELEMENT.getInstance().OXYGEN, 7), + new MaterialStack[]{// ((Ca,Ce)(Al,Ti,Mg)12O19) + new MaterialStack(ELEMENT.getInstance().CALCIUM, 1), + new MaterialStack(ELEMENT.getInstance().CERIUM, 1), + new MaterialStack(ELEMENT.getInstance().ALUMINIUM, 12), + new MaterialStack(ELEMENT.getInstance().TITANIUM, 12), + new MaterialStack(ELEMENT.getInstance().MAGNESIUM, 12), + new MaterialStack(ELEMENT.getInstance().OXYGEN, 19), }); - - public static final Material YTTROCERITE = new Material( - "Yttrocerite", //Material Name + + //Honeaite + //Au3TlTe2 + public static final Material HONEAITE = new Material( + "Honeaite", //Material Name MaterialState.ORE, //State - TextureSet.SET_DIAMOND, //Texture Set - new short[]{35, 19, 199, 0}, //Material Colour + TextureSet.SET_FINE, //Texture Set + new short[]{165, 165, 5, 0}, //Material Colour -1, -1, -1, -1, - -1, //Radiation - new MaterialStack[]{ - new MaterialStack(ELEMENT.getInstance().CERIUM, 1), - new MaterialStack(ELEMENT.getInstance().CALCIUM, 1), - new MaterialStack(ELEMENT.getInstance().FLUORINE, 5), - new MaterialStack(ELEMENT.getInstance().YTTRIUM, 1), + 0, //Radiation + new MaterialStack[]{// Na3AlF6 + new MaterialStack(ELEMENT.getInstance().GOLD, 3), + new MaterialStack(ELEMENT.getInstance().THALLIUM, 1), + new MaterialStack(ELEMENT.getInstance().TELLURIUM, 2) }); - public static final Material POLYCRASE = new Material( - "Polycrase", //Material Name + //Irarsite + //(Ir,Ru,Rh,Pt)AsS + public static final Material IRARSITE = new Material( + "Irarsite", //Material Name MaterialState.ORE, //State - TextureSet.SET_ROUGH, //Texture Set - new short[]{51, 0, 11, 0}, //Material Colour + TextureSets.ENRICHED.get(), //Texture Set + new short[]{125, 105, 105, 0}, //Material Colour -1, -1, -1, -1, - -1, //Radiation - new MaterialStack[]{ - new MaterialStack(ELEMENT.getInstance().YTTRIUM, 1), - new MaterialStack(ELEMENT.getInstance().CALCIUM, 1), - new MaterialStack(ELEMENT.getInstance().CERIUM, 1), - new MaterialStack(ELEMENT.getInstance().URANIUM235, 1), - new MaterialStack(ELEMENT.getInstance().THORIUM, 1), - new MaterialStack(ELEMENT.getInstance().TITANIUM, 2), - new MaterialStack(ELEMENT.getInstance().NIOBIUM, 2), - new MaterialStack(ELEMENT.getInstance().TANTALUM, 2), - new MaterialStack(ELEMENT.getInstance().OXYGEN, 6) + 0, //Radiation + new MaterialStack[]{// Na3AlF6 + new MaterialStack(ELEMENT.getInstance().IRIDIUM, 1), + new MaterialStack(ELEMENT.getInstance().RUTHENIUM, 1), + new MaterialStack(ELEMENT.getInstance().RHODIUM, 1), + new MaterialStack(ELEMENT.getInstance().PLATINUM, 1), + new MaterialStack(ELEMENT.getInstance().ARSENIC, 1), + new MaterialStack(ELEMENT.getInstance().SULFUR, 1), + new MaterialStack(ELEMENT.getInstance().OXYGEN, 1) }); - public static final Material ZIRCOPHYLLITE = new Material( - "Zircophyllite", //Material Name + //Kashinite + //(Ir,Rh)2S3 + public static final Material KASHINITE = new Material( + "Kashinite", //Material Name MaterialState.ORE, //State - TextureSets.REFINED.get(), //Texture Set - new short[]{30, 0, 6, 0}, //Material Colour + TextureSet.SET_SHINY, //Texture Set + new short[]{75, 105, 75, 0}, //Material Colour -1, -1, -1, -1, - -1, //Radiation - new MaterialStack[]{ - new MaterialStack(ELEMENT.getInstance().POTASSIUM, 3), - new MaterialStack(ELEMENT.getInstance().SODIUM, 3), - new MaterialStack(ELEMENT.getInstance().MANGANESE, 7), - new MaterialStack(ELEMENT.getInstance().IRON, 7), - new MaterialStack(ELEMENT.getInstance().ZIRCONIUM, 2), - new MaterialStack(ELEMENT.getInstance().TITANIUM, 2), - new MaterialStack(ELEMENT.getInstance().NIOBIUM, 2), - new MaterialStack(ELEMENT.getInstance().SILICON, 8), - new MaterialStack(ELEMENT.getInstance().OXYGEN, 13), - new MaterialStack(ELEMENT.getInstance().FLUORINE, 7), + 0, //Radiation + new MaterialStack[]{// Na3AlF6 + new MaterialStack(ELEMENT.getInstance().IRIDIUM, 2), + new MaterialStack(ELEMENT.getInstance().RHODIUM, 2), + new MaterialStack(ELEMENT.getInstance().SULFUR, 3) }); - public static final Material ZIRKELITE = new Material( - "Zirkelite", //Material Name + // Tl(Cl,Br) + public static final Material LAFOSSAITE = new Material( + "Lafossaite", //Material Name MaterialState.ORE, //State - TextureSets.GEM_A.get(), //Texture Set - new short[]{229, 208, 48, 0}, //Material Colour + TextureSets.REFINED.get(), //Texture Set + new short[]{165, 105, 205, 0}, //Material Colour -1, -1, -1, -1, -1, //Radiation - new MaterialStack[]{// (Ca,Th,Ce)Zr(Ti,Nb)2O7 - new MaterialStack(ELEMENT.getInstance().CALCIUM, 1), - new MaterialStack(ELEMENT.getInstance().THORIUM, 1), - new MaterialStack(ELEMENT.getInstance().CERIUM, 1), - new MaterialStack(ELEMENT.getInstance().ZIRCONIUM, 1), - new MaterialStack(ELEMENT.getInstance().TITANIUM, 2), - new MaterialStack(ELEMENT.getInstance().NIOBIUM, 2), - new MaterialStack(ELEMENT.getInstance().OXYGEN, 7) + new MaterialStack[]{// Na3AlF6 + new MaterialStack(ELEMENT.getInstance().CHLORINE, 1), + new MaterialStack(ELEMENT.getInstance().BROMINE, 1), + new MaterialStack(ELEMENT.getInstance().THALLIUM, 1) }); - public static final Material LANTHANITE_LA = new Material( - "Lanthanite (La)", //Material Name + public static final Material LANTHANITE_CE = new Material( + "Lanthanite (Ce)", //Material Name MaterialState.ORE, //State - TextureSets.REFINED.get(), //Texture Set - new short[]{219, 160, 214, 0}, //Material Colour + TextureSet.SET_METALLIC, //Texture Set + new short[]{186, 113, 179, 0}, //Material Colour -1, -1, -1, -1, -1, //Radiation - new MaterialStack[]{// (La)2(CO3)3·8(H2O) - new MaterialStack(ELEMENT.getInstance().LANTHANUM, 2), + new MaterialStack[]{// (Ce)2(CO3)3·8(H2O) + new MaterialStack(ELEMENT.getInstance().CERIUM, 2), new MaterialStack(ELEMENT.getInstance().OXYGEN, 3), new MaterialStack(ELEMENT.getInstance().CALCIUM, 3), new MaterialStack(ELEMENT.getInstance().HYDROGEN, 2), new MaterialStack(ELEMENT.getInstance().OXYGEN, 1), }); - public static final Material LANTHANITE_CE = new Material( - "Lanthanite (Ce)", //Material Name + public static final Material LANTHANITE_LA = new Material( + "Lanthanite (La)", //Material Name MaterialState.ORE, //State - TextureSet.SET_METALLIC, //Texture Set - new short[]{186, 113, 179, 0}, //Material Colour + TextureSets.REFINED.get(), //Texture Set + new short[]{219, 160, 214, 0}, //Material Colour -1, -1, -1, -1, -1, //Radiation - new MaterialStack[]{// (Ce)2(CO3)3·8(H2O) - new MaterialStack(ELEMENT.getInstance().CERIUM, 2), + new MaterialStack[]{// (La)2(CO3)3·8(H2O) + new MaterialStack(ELEMENT.getInstance().LANTHANUM, 2), new MaterialStack(ELEMENT.getInstance().OXYGEN, 3), new MaterialStack(ELEMENT.getInstance().CALCIUM, 3), new MaterialStack(ELEMENT.getInstance().HYDROGEN, 2), @@ -422,399 +457,368 @@ public final class ORES { new MaterialStack(ELEMENT.getInstance().OXYGEN, 1), }); - public static final Material HIBONITE = new Material( - "Hibonite", //Material Name + //Iodine Source + public static final Material LAUTARITE = new Material( + "Lautarite", //Material Name MaterialState.ORE, //State - TextureSet.SET_METALLIC, //Texture Set - new short[]{58, 31, 0, 0}, //Material Colour + TextureSet.SET_FINE, //Texture Set + new short[]{165, 105, 205, 0}, //Material Colour -1, -1, -1, -1, -1, //Radiation - new MaterialStack[]{// ((Ca,Ce)(Al,Ti,Mg)12O19) + new MaterialStack[]{// Na3AlF6 new MaterialStack(ELEMENT.getInstance().CALCIUM, 1), - new MaterialStack(ELEMENT.getInstance().CERIUM, 1), - new MaterialStack(ELEMENT.getInstance().ALUMINIUM, 12), - new MaterialStack(ELEMENT.getInstance().TITANIUM, 12), - new MaterialStack(ELEMENT.getInstance().MAGNESIUM, 12), - new MaterialStack(ELEMENT.getInstance().OXYGEN, 19), + new MaterialStack(ELEMENT.getInstance().IODINE, 2), + new MaterialStack(ELEMENT.getInstance().OXYGEN, 6) }); - public static final Material CERITE = new Material( - "Cerite", //Material Name + public static final Material LEPERSONNITE = new Material( + "Lepersonnite", //Material Name MaterialState.ORE, //State - TextureSets.REFINED.get(), //Texture Set - new short[]{68, 13, 0, 0}, //Material Colour + TextureSet.SET_EMERALD, //Texture Set + new short[]{175, 175, 20, 0}, //Material Colour -1, -1, -1, -1, -1, //Radiation - new MaterialStack[]{// (Ce,La,Ca)9(Mg,Fe+3)(SiO4)6(SiO3OH)(OH)3 - new MaterialStack(ELEMENT.getInstance().CERIUM, 9), - new MaterialStack(ELEMENT.getInstance().LANTHANUM, 9), - new MaterialStack(ELEMENT.getInstance().CALCIUM, 9), - new MaterialStack(ELEMENT.getInstance().MAGNESIUM, 3), - new MaterialStack(ELEMENT.getInstance().IRON, 3), - new MaterialStack(ELEMENT.getInstance().SILICON, 7), - new MaterialStack(ELEMENT.getInstance().OXYGEN, 20), - new MaterialStack(ELEMENT.getInstance().HYDROGEN, 4) + new MaterialStack[]{ + new MaterialStack(ELEMENT.getInstance().CALCIUM, 1), + new MaterialStack(ELEMENT.getInstance().GADOLINIUM, 2), + new MaterialStack(ELEMENT.getInstance().DYSPROSIUM, 2), + new MaterialStack(ELEMENT.getInstance().URANIUM235, 2), + new MaterialStack(ELEMENT.getInstance().OXYGEN,32), + new MaterialStack(ELEMENT.getInstance().HYDROGEN, 24) }); - public static final Material AGARDITE_Y = new Material( - "Agardite (Y)", //Material Name + //Miessiite + //Pd11Te2Se2 + public static final Material MIESSIITE = new Material( + "Miessiite", //Material Name MaterialState.ORE, //State - TextureSet.SET_METALLIC, //Texture Set - new short[]{210, 232, 44, 0}, //Material Colour + TextureSet.SET_FINE, //Texture Set + new short[]{75, 75, 75, 0}, //Material Colour -1, -1, -1, -1, - -1, //Radiation - new MaterialStack[]{// (YCa)Cu5(As2O4)3(OH)6·3H2O - new MaterialStack(ELEMENT.getInstance().YTTRIUM, 1), - new MaterialStack(ELEMENT.getInstance().CALCIUM, 1), - new MaterialStack(ELEMENT.getInstance().COPPER, 5), - new MaterialStack(ELEMENT.getInstance().ARSENIC, 6), - new MaterialStack(ELEMENT.getInstance().OXYGEN, 21), - new MaterialStack(ELEMENT.getInstance().HYDROGEN, 12) + 0, //Radiation + new MaterialStack[]{// Na3AlF6 + new MaterialStack(ELEMENT.getInstance().PALLADIUM, 11), + new MaterialStack(ELEMENT.getInstance().TELLURIUM, 2), + new MaterialStack(ELEMENT.getInstance().SELENIUM, 2) }); - public static final Material AGARDITE_CD = new Material( - "Agardite (Cd)", //Material Name + public static final Material NICHROMITE = new Material( + "Nichromite", //Material Name MaterialState.ORE, //State TextureSet.SET_METALLIC, //Texture Set - new short[]{170, 188, 33, 0}, //Material Colour + new short[]{22, 19, 19, 0}, //Material Colour -1, -1, -1, -1, -1, //Radiation - new MaterialStack[]{// (CdCa)Cu7(AsO2)4(O2H)5·3H2O - new MaterialStack(ELEMENT.getInstance().CADMIUM, 1), - new MaterialStack(ELEMENT.getInstance().CALCIUM, 1), - new MaterialStack(ELEMENT.getInstance().COPPER, 7), - new MaterialStack(ELEMENT.getInstance().ARSENIC, 4), - new MaterialStack(ELEMENT.getInstance().OXYGEN, 21), - new MaterialStack(ELEMENT.getInstance().HYDROGEN, 11) + new MaterialStack[]{ + new MaterialStack(ELEMENT.getInstance().NICKEL, 1), + new MaterialStack(ELEMENT.getInstance().COBALT, 1), + new MaterialStack(ELEMENT.getInstance().IRON, 3), + new MaterialStack(ELEMENT.getInstance().ALUMINIUM, 2), + new MaterialStack(ELEMENT.getInstance().CHROMIUM, 2), + new MaterialStack(ELEMENT.getInstance().OXYGEN, 8) }); - public static final Material AGARDITE_LA = new Material( - "Agardite (La)", //Material Name + //Perroudite + //Hg5Ag4S5(I,Br)2Cl2 + public static final Material PERROUDITE = new Material( + "Perroudite", //Material Name MaterialState.ORE, //State - TextureSet.SET_FINE, //Texture Set - new short[]{206, 232, 9, 0}, //Material Colour + TextureSet.SET_METALLIC, //Texture Set + new short[]{77, 165, 174, 0}, //Material Colour -1, -1, -1, -1, - -1, //Radiation - new MaterialStack[]{// (LaCa)Cu5(AsO6)2(OH)4·3H2O - new MaterialStack(ELEMENT.getInstance().LANTHANUM, 1), - new MaterialStack(ELEMENT.getInstance().CALCIUM, 1), - new MaterialStack(ELEMENT.getInstance().COPPER, 5), - new MaterialStack(ELEMENT.getInstance().ARSENIC, 2), - new MaterialStack(ELEMENT.getInstance().OXYGEN, 19), - new MaterialStack(ELEMENT.getInstance().HYDROGEN, 10) + 0, //Radiation + new MaterialStack[]{ + new MaterialStack(ELEMENT.getInstance().SULFUR, 5), + new MaterialStack(ELEMENT.getInstance().SILVER, 4), + new MaterialStack(ELEMENT.getInstance().IODINE, 2), + new MaterialStack(ELEMENT.getInstance().MERCURY, 5), + new MaterialStack(ELEMENT.getInstance().BROMINE, 2), + new MaterialStack(ELEMENT.getInstance().CHLORINE, 2) }); - public static final Material AGARDITE_ND = new Material( - "Agardite (Nd)", //Material Name + public static final Material POLYCRASE = new Material( + "Polycrase", //Material Name MaterialState.ORE, //State - TextureSet.SET_METALLIC, //Texture Set - new short[]{225, 244, 78, 0}, //Material Colour + TextureSet.SET_ROUGH, //Texture Set + new short[]{51, 0, 11, 0}, //Material Colour -1, -1, -1, -1, -1, //Radiation - new MaterialStack[]{// (NdCa)Cu6(As3O3)2(O2H)6·3H2O - new MaterialStack(ELEMENT.getInstance().NEODYMIUM, 1), + new MaterialStack[]{ + new MaterialStack(ELEMENT.getInstance().YTTRIUM, 1), new MaterialStack(ELEMENT.getInstance().CALCIUM, 1), - new MaterialStack(ELEMENT.getInstance().COPPER, 6), - new MaterialStack(ELEMENT.getInstance().ARSENIC, 6), - new MaterialStack(ELEMENT.getInstance().OXYGEN, 21), - new MaterialStack(ELEMENT.getInstance().HYDROGEN, 12) + new MaterialStack(ELEMENT.getInstance().CERIUM, 1), + new MaterialStack(ELEMENT.getInstance().URANIUM235, 1), + new MaterialStack(ELEMENT.getInstance().THORIUM, 1), + new MaterialStack(ELEMENT.getInstance().TITANIUM, 2), + new MaterialStack(ELEMENT.getInstance().NIOBIUM, 2), + new MaterialStack(ELEMENT.getInstance().TANTALUM, 2), + new MaterialStack(ELEMENT.getInstance().OXYGEN, 6) }); - - public static final Material FLUORCAPHITE = new Material( - "Fluorcaphite", //Material Name + + //Radiobarite + //Radium, Barium, Barite? + public static final Material RADIOBARITE = new Material( + "Barite (Rd)", //Material Name MaterialState.ORE, //State - TextureSet.SET_FINE, //Texture Set - new short[]{255, 255, 30, 0}, //Material Colour + TextureSet.SET_FLINT, //Texture Set + new short[]{205, 205, 205, 0}, //Material Colour -1, -1, -1, -1, - -1, //Radiation - new MaterialStack[]{// (Ca,Sr,Ce,Na)5(PO4)3F - new MaterialStack(ELEMENT.getInstance().CALCIUM, 5), - new MaterialStack(MISC_MATERIALS.STRONTIUM_OXIDE, 5), - new MaterialStack(ELEMENT.getInstance().CERIUM, 5), - new MaterialStack(ELEMENT.getInstance().SODIUM, 5), - new MaterialStack(ELEMENT.getInstance().PHOSPHORUS, 3), - new MaterialStack(ELEMENT.getInstance().OXYGEN, 12), - new MaterialStack(ELEMENT.getInstance().FLUORINE, 6), - }); + 0, //Radiation + new MaterialStack[]{// Na3AlF6 + new MaterialStack(ELEMENT.getInstance().BARIUM, 32), + new MaterialStack(ELEMENT.getInstance().RADIUM, 1), + new MaterialStack(ELEMENT.getInstance().SULFUR, 16), + new MaterialStack(ELEMENT.getInstance().OXYGEN, 15) + }); - public static final Material FLORENCITE = new Material( - "Florencite", //Material Name + //Samarskite_Y + public static final Material SAMARSKITE_Y = new Material( + "Samarskite (Y)", //Material Name MaterialState.ORE, //State - TextureSet.SET_METALLIC, //Texture Set - new short[]{249, 249, 124, 0}, //Material Colour + TextureSets.ENRICHED.get(), //Texture Set + new short[]{65, 163, 164, 0}, //Material Colour -1, -1, -1, -1, -1, //Radiation - new MaterialStack[]{// SmAl3(PO4)2(OH)6 - new MaterialStack(ELEMENT.getInstance().SAMARIUM, 1), - new MaterialStack(ELEMENT.getInstance().ALUMINIUM, 3), - new MaterialStack(ELEMENT.getInstance().PHOSPHORUS, 1), - new MaterialStack(ELEMENT.getInstance().OXYGEN, 10), - new MaterialStack(ELEMENT.getInstance().HYDROGEN, 6) + new MaterialStack[]{ + new MaterialStack(ELEMENT.getInstance().YTTRIUM, 2), //Y not YT/YB + new MaterialStack(ELEMENT.getInstance().IRON, 10), + new MaterialStack(ELEMENT.getInstance().URANIUM235, 2), + new MaterialStack(ELEMENT.getInstance().THORIUM, 3), + new MaterialStack(ELEMENT.getInstance().NIOBIUM, 2), + new MaterialStack(ELEMENT.getInstance().TANTALUM, 3) }); - public static final Material CRYOLITE = new Material( - "Cryolite", //Material Name + //Samarskite_YB + public static final Material SAMARSKITE_YB = new Material( + "Samarskite (Yb)", //Material Name MaterialState.ORE, //State - TextureSet.SET_SHINY, //Texture Set - new short[]{205, 205, 255, 0}, //Material Colour + TextureSets.ENRICHED.get(), //Texture Set + new short[]{95, 193, 194, 0}, //Material Colour -1, -1, -1, -1, -1, //Radiation - new MaterialStack[]{// Na3AlF6 - new MaterialStack(ELEMENT.getInstance().SODIUM, 3), - new MaterialStack(ELEMENT.getInstance().ALUMINIUM, 1), - new MaterialStack(ELEMENT.getInstance().FLUORINE, 6) + new MaterialStack[]{ + new MaterialStack(ELEMENT.getInstance().YTTERBIUM, 2), //Y not YT/YB + new MaterialStack(ELEMENT.getInstance().IRON, 9), + new MaterialStack(ELEMENT.getInstance().URANIUM235, 3), + new MaterialStack(ELEMENT.getInstance().THORIUM, 2), + new MaterialStack(ELEMENT.getInstance().NIOBIUM, 3), + new MaterialStack(ELEMENT.getInstance().TANTALUM, 2) }); - - //Iodine Source - public static final Material LAUTARITE = new Material( - "Lautarite", //Material Name - MaterialState.ORE, //State - TextureSet.SET_FINE, //Texture Set - new short[]{165, 105, 205, 0}, //Material Colour - -1, - -1, - -1, - -1, - -1, //Radiation - new MaterialStack[]{// Na3AlF6 - new MaterialStack(ELEMENT.getInstance().CALCIUM, 1), - new MaterialStack(ELEMENT.getInstance().IODINE, 2), - new MaterialStack(ELEMENT.getInstance().OXYGEN, 6) - }); - // Tl(Cl,Br) - public static final Material LAFOSSAITE = new Material( - "Lafossaite", //Material Name + public static final Material TITANITE = new Material( + "Titanite", //Material Name MaterialState.ORE, //State - TextureSets.REFINED.get(), //Texture Set - new short[]{165, 105, 205, 0}, //Material Colour + TextureSet.SET_METALLIC, //Texture Set + new short[]{184, 198, 105, 0}, //Material Colour -1, -1, -1, -1, -1, //Radiation - new MaterialStack[]{// Na3AlF6 - new MaterialStack(ELEMENT.getInstance().CHLORINE, 1), - new MaterialStack(ELEMENT.getInstance().BROMINE, 1), - new MaterialStack(ELEMENT.getInstance().THALLIUM, 1) + new MaterialStack[]{ + new MaterialStack(ELEMENT.getInstance().CALCIUM, 2), + new MaterialStack(ELEMENT.getInstance().TITANIUM, 2), + new MaterialStack(ELEMENT.getInstance().SILICON, 2), + new MaterialStack(ELEMENT.getInstance().THORIUM, 1), + new MaterialStack(ELEMENT.getInstance().OXYGEN, 10) }); - //Demicheleite-(Br) - // BiSBr - public static final Material DEMICHELEITE_BR = new Material( - "Demicheleite (Br)", //Material Name + public static final Material XENOTIME = new Material( + "Xenotime", //Material Name MaterialState.ORE, //State - TextureSet.SET_SHINY, //Texture Set - new short[]{165, 75, 75, 0}, //Material Colour + TextureSet.SET_OPAL, //Texture Set + new short[]{235, 89, 199, 0}, //Material Colour -1, -1, -1, -1, -1, //Radiation - new MaterialStack[]{// Na3AlF6 - new MaterialStack(ELEMENT.getInstance().BISMUTH, 13), - new MaterialStack(ELEMENT.getInstance().SULFUR, 11), - new MaterialStack(ELEMENT.getInstance().BROMINE, 1) - }); - - //Comancheite - //Hg55N24(NH2,OH)4(Cl,Br)34 - public static final Material COMANCHEITE = new Material( - "Comancheite", //Material Name - MaterialState.ORE, //State - TextureSets.REFINED.get(), //Texture Set - new short[]{65, 205, 105, 0}, //Material Colour - -1, - -1, - -1, - -1, - 0, //Radiation - new MaterialStack[]{// Na3AlF6 - new MaterialStack(ELEMENT.getInstance().MERCURY, 54/4), - new MaterialStack(ELEMENT.getInstance().NITROGEN, 28/4), - new MaterialStack(ELEMENT.getInstance().HYDROGEN, 12/4), - new MaterialStack(ELEMENT.getInstance().OXYGEN, 8/4), - new MaterialStack(ELEMENT.getInstance().CHLORINE, 34/4), - new MaterialStack(ELEMENT.getInstance().BROMINE, 34/4) + new MaterialStack[]{ + new MaterialStack(ELEMENT.getInstance().YTTRIUM, 2), + new MaterialStack(ELEMENT.getInstance().YTTERBIUM, 2), + new MaterialStack(ELEMENT.getInstance().ERBIUM, 2), + new MaterialStack(ELEMENT.getInstance().EUROPIUM, 1), + new MaterialStack(ELEMENT.getInstance().PHOSPHORUS, 2), + new MaterialStack(ELEMENT.getInstance().OXYGEN, 8) }); - //Perroudite - //Hg5Ag4S5(I,Br)2Cl2 - public static final Material PERROUDITE = new Material( - "Perroudite", //Material Name + public static final Material YTTRIAITE = new Material( //TODO + "Yttriaite", //Material Name MaterialState.ORE, //State TextureSet.SET_METALLIC, //Texture Set - new short[]{77, 165, 174, 0}, //Material Colour + new short[]{255, 143, 84, 0}, //Material Colour -1, -1, -1, -1, - 0, //Radiation + -1, //Radiation new MaterialStack[]{ - new MaterialStack(ELEMENT.getInstance().SULFUR, 5), - new MaterialStack(ELEMENT.getInstance().SILVER, 4), - new MaterialStack(ELEMENT.getInstance().IODINE, 2), - new MaterialStack(ELEMENT.getInstance().MERCURY, 5), - new MaterialStack(ELEMENT.getInstance().BROMINE, 2), - new MaterialStack(ELEMENT.getInstance().CHLORINE, 2) + new MaterialStack(ELEMENT.getInstance().YTTRIUM, 1), //Y not YT/YB + new MaterialStack(ELEMENT.getInstance().OXYGEN, 3), + new MaterialStack(ELEMENT.getInstance().IRON, 4), + new MaterialStack(ELEMENT.getInstance().TIN, 1), + new MaterialStack(ELEMENT.getInstance().NITROGEN, 2) }); - //Honeaite - //Au3TlTe2 - public static final Material HONEAITE = new Material( - "Honeaite", //Material Name + public static final Material YTTRIALITE = new Material( + "Yttrialite", //Material Name MaterialState.ORE, //State - TextureSet.SET_FINE, //Texture Set - new short[]{165, 165, 5, 0}, //Material Colour + TextureSet.SET_RUBY, //Texture Set + new short[]{35, 189, 99, 0}, //Material Colour -1, -1, -1, -1, - 0, //Radiation - new MaterialStack[]{// Na3AlF6 - new MaterialStack(ELEMENT.getInstance().GOLD, 3), - new MaterialStack(ELEMENT.getInstance().THALLIUM, 1), - new MaterialStack(ELEMENT.getInstance().TELLURIUM, 2) + -1, //Radiation + new MaterialStack[]{ + new MaterialStack(ELEMENT.getInstance().YTTRIUM, 2), + new MaterialStack(ELEMENT.getInstance().THORIUM, 2), + new MaterialStack(ELEMENT.getInstance().SILICON, 2), + new MaterialStack(ELEMENT.getInstance().OXYGEN, 7), }); - //Alburnite - //Ag8GeTe2S4 - public static final Material ALBURNITE = new Material( - "Alburnite", //Material Name + public static final Material YTTROCERITE = new Material( + "Yttrocerite", //Material Name MaterialState.ORE, //State - TextureSet.SET_METALLIC, //Texture Set - new short[]{16, 5, 105, 0}, //Material Colour + TextureSet.SET_DIAMOND, //Texture Set + new short[]{35, 19, 199, 0}, //Material Colour -1, -1, -1, -1, - 0, //Radiation - new MaterialStack[]{// Na3AlF6 - new MaterialStack(ELEMENT.getInstance().GOLD, 8), - new MaterialStack(ELEMENT.getInstance().GERMANIUM, 1), - new MaterialStack(ELEMENT.getInstance().TELLURIUM, 2), - new MaterialStack(ELEMENT.getInstance().SULFUR, 4) + -1, //Radiation + new MaterialStack[]{ + new MaterialStack(ELEMENT.getInstance().CERIUM, 1), + new MaterialStack(ELEMENT.getInstance().CALCIUM, 1), + new MaterialStack(ELEMENT.getInstance().FLUORINE, 5), + new MaterialStack(ELEMENT.getInstance().YTTRIUM, 1), }); - //Miessiite - //Pd11Te2Se2 - public static final Material MIESSIITE = new Material( - "Miessiite", //Material Name + public static final Material ZIMBABWEITE = new Material( + "Zimbabweite", //Material Name MaterialState.ORE, //State TextureSet.SET_FINE, //Texture Set - new short[]{75, 75, 75, 0}, //Material Colour + new short[]{193, 187, 131, 0}, //Material Colour -1, -1, -1, -1, - 0, //Radiation - new MaterialStack[]{// Na3AlF6 - new MaterialStack(ELEMENT.getInstance().PALLADIUM, 11), - new MaterialStack(ELEMENT.getInstance().TELLURIUM, 2), - new MaterialStack(ELEMENT.getInstance().SELENIUM, 2) + -1, //Radiation + new MaterialStack[]{ + new MaterialStack(ELEMENT.getInstance().CALCIUM, 2), + new MaterialStack(ELEMENT.getInstance().POTASSIUM, 2), + new MaterialStack(ELEMENT.getInstance().LEAD, 1), + new MaterialStack(ELEMENT.getInstance().ARSENIC, 4), + new MaterialStack(ELEMENT.getInstance().NIOBIUM, 4), + new MaterialStack(ELEMENT.getInstance().TANTALUM, 4), + new MaterialStack(ELEMENT.getInstance().TITANIUM, 4), + new MaterialStack(ELEMENT.getInstance().OXYGEN, 18) }); - //Kashinite - //(Ir,Rh)2S3 - public static final Material KASHINITE = new Material( - "Kashinite", //Material Name + public static final Material ZIRCON = new Material( + "Zircon", //Material Name MaterialState.ORE, //State - TextureSet.SET_SHINY, //Texture Set - new short[]{75, 105, 75, 0}, //Material Colour + TextureSets.GEM_A.get(), //Texture Set + new short[]{195, 19, 19, 0}, //Material Colour -1, -1, -1, -1, - 0, //Radiation - new MaterialStack[]{// Na3AlF6 - new MaterialStack(ELEMENT.getInstance().IRIDIUM, 2), - new MaterialStack(ELEMENT.getInstance().RHODIUM, 2), - new MaterialStack(ELEMENT.getInstance().SULFUR, 3) + -1, //Radiation + new MaterialStack[]{ + new MaterialStack(ELEMENT.getInstance().ZIRCONIUM, 1), + new MaterialStack(ELEMENT.getInstance().SILICON, 1), + new MaterialStack(ELEMENT.getInstance().OXYGEN, 4), }); - //Irarsite - //(Ir,Ru,Rh,Pt)AsS - public static final Material IRARSITE = new Material( - "Irarsite", //Material Name + public static final Material ZIRCONILITE = new Material( + "Zirconolite", //Material Name MaterialState.ORE, //State - TextureSets.ENRICHED.get(), //Texture Set - new short[]{125, 105, 105, 0}, //Material Colour + TextureSet.SET_FINE, //Texture Set + new short[]{45, 26, 0, 0}, //Material Colour -1, -1, -1, -1, - 0, //Radiation - new MaterialStack[]{// Na3AlF6 - new MaterialStack(ELEMENT.getInstance().IRIDIUM, 1), - new MaterialStack(ELEMENT.getInstance().RUTHENIUM, 1), - new MaterialStack(ELEMENT.getInstance().RHODIUM, 1), - new MaterialStack(ELEMENT.getInstance().PLATINUM, 1), - new MaterialStack(ELEMENT.getInstance().ARSENIC, 1), - new MaterialStack(ELEMENT.getInstance().SULFUR, 1), - new MaterialStack(ELEMENT.getInstance().OXYGEN, 1) + -1, //Radiation + new MaterialStack[]{ + new MaterialStack(ELEMENT.getInstance().CALCIUM, 2), + new MaterialStack(ELEMENT.getInstance().ZIRCONIUM, 2), + new MaterialStack(ELEMENT.getInstance().TITANIUM, 4), + new MaterialStack(ELEMENT.getInstance().CERIUM, 1), + new MaterialStack(ELEMENT.getInstance().OXYGEN, 14) }); - - //Radiobarite - //Radium, Barium, Barite? - public static final Material RADIOBARITE = new Material( - "Barite (Rd)", //Material Name + + public static final Material ZIRCOPHYLLITE = new Material( + "Zircophyllite", //Material Name MaterialState.ORE, //State - TextureSet.SET_FLINT, //Texture Set - new short[]{205, 205, 205, 0}, //Material Colour + TextureSets.REFINED.get(), //Texture Set + new short[]{30, 0, 6, 0}, //Material Colour -1, -1, -1, -1, - 0, //Radiation - new MaterialStack[]{// Na3AlF6 - new MaterialStack(ELEMENT.getInstance().BARIUM, 32), - new MaterialStack(ELEMENT.getInstance().RADIUM, 1), - new MaterialStack(ELEMENT.getInstance().SULFUR, 16), - new MaterialStack(ELEMENT.getInstance().OXYGEN, 15) + -1, //Radiation + new MaterialStack[]{ + new MaterialStack(ELEMENT.getInstance().POTASSIUM, 3), + new MaterialStack(ELEMENT.getInstance().SODIUM, 3), + new MaterialStack(ELEMENT.getInstance().MANGANESE, 7), + new MaterialStack(ELEMENT.getInstance().IRON, 7), + new MaterialStack(ELEMENT.getInstance().ZIRCONIUM, 2), + new MaterialStack(ELEMENT.getInstance().TITANIUM, 2), + new MaterialStack(ELEMENT.getInstance().NIOBIUM, 2), + new MaterialStack(ELEMENT.getInstance().SILICON, 8), + new MaterialStack(ELEMENT.getInstance().OXYGEN, 13), + new MaterialStack(ELEMENT.getInstance().FLUORINE, 7), }); + - public static final Material GREENOCKITE = new Material( - "Greenockite", //Material Name + public static final Material ZIRKELITE = new Material( + "Zirkelite", //Material Name MaterialState.ORE, //State TextureSets.GEM_A.get(), //Texture Set - new short[]{110, 193, 25, 0}, //Material Colour + new short[]{229, 208, 48, 0}, //Material Colour -1, -1, -1, -1, -1, //Radiation - new MaterialStack[]{ - new MaterialStack(ELEMENT.getInstance().CADMIUM, 2), - new MaterialStack(ELEMENT.getInstance().SULFUR, 2), + new MaterialStack[]{// (Ca,Th,Ce)Zr(Ti,Nb)2O7 + new MaterialStack(ELEMENT.getInstance().CALCIUM, 1), + new MaterialStack(ELEMENT.getInstance().THORIUM, 1), + new MaterialStack(ELEMENT.getInstance().CERIUM, 1), + new MaterialStack(ELEMENT.getInstance().ZIRCONIUM, 1), + new MaterialStack(ELEMENT.getInstance().TITANIUM, 2), + new MaterialStack(ELEMENT.getInstance().NIOBIUM, 2), + new MaterialStack(ELEMENT.getInstance().OXYGEN, 7) }); - public static final Material DEEP_EARTH_REACTOR_FUEL_DEPOSIT = new Material( "Radioactive Mineral Mix", //Material Name diff --git a/src/Java/gtPlusPlus/core/material/nuclear/FLUORIDES.java b/src/Java/gtPlusPlus/core/material/nuclear/FLUORIDES.java index bfa08d3c29..5872587872 100644 --- a/src/Java/gtPlusPlus/core/material/nuclear/FLUORIDES.java +++ b/src/Java/gtPlusPlus/core/material/nuclear/FLUORIDES.java @@ -1,7 +1,6 @@ package gtPlusPlus.core.material.nuclear; import gregtech.api.enums.Materials; -import gregtech.api.enums.TextureSet; import gtPlusPlus.core.material.ELEMENT; import gtPlusPlus.core.material.MISC_MATERIALS; import gtPlusPlus.core.material.Material; @@ -263,6 +262,21 @@ public class FLUORIDES { new MaterialStack(ELEMENT.getInstance().SELENIUM, 1), new MaterialStack(ELEMENT.getInstance().FLUORINE, 6) }); + + public static final Material SODIUM_FLUORIDE = new Material( + "Sodium Fluoride", //Material Name + MaterialState.PURE_LIQUID, //State + null, //Material Colour + -1, //Melting Point in C + -1, //Boiling Point in C + -1, //Protons + -1, //Neutrons + false, //Uses Blast furnace? + //Material Stacks with Percentage of required elements. + new MaterialStack[]{ + new MaterialStack(ELEMENT.getInstance().SODIUM, 1), + new MaterialStack(ELEMENT.getInstance().FLUORINE, 1) + }); private static final FLUORIDES INSTANCE = new FLUORIDES(); public static FLUORIDES getInstance(){return INSTANCE;} diff --git a/src/Java/gtPlusPlus/core/material/nuclear/NUCLIDE.java b/src/Java/gtPlusPlus/core/material/nuclear/NUCLIDE.java index 73751ac49d..9bc7459f0e 100644 --- a/src/Java/gtPlusPlus/core/material/nuclear/NUCLIDE.java +++ b/src/Java/gtPlusPlus/core/material/nuclear/NUCLIDE.java @@ -10,6 +10,24 @@ import gtPlusPlus.core.util.data.StringUtils; public final class NUCLIDE { + public static final Material Li2BeF4 = new Material( + "Lithium Tetrafluoroberyllate", //Material Name + MaterialState.LIQUID, //State + TextureSets.NUCLEAR.get(), + null, //Material Colour + 566, //Melting Point in C + 870, //Boiling Point in C + -1, //Protons + -1, //Neutrons + false, //Uses Blast furnace? + StringUtils.subscript(StringUtils.superscript("7")+"Li2BeF4"), //Chemical Formula + 4, //Radioactivity Level + //Material Stacks with Percentage of required elements. + new MaterialStack[]{ + new MaterialStack(FLUORIDES.LITHIUM_FLUORIDE, 2), + new MaterialStack(FLUORIDES.BERYLLIUM_FLUORIDE, 1) + }); + public static final Material LiFBeF2ThF4UF4 = new Material( "LiFBeF2ThF4UF4", //Material Name MaterialState.LIQUID, //State @@ -69,6 +87,235 @@ public final class NUCLIDE { new MaterialStack(FLUORIDES.ZIRCONIUM_TETRAFLUORIDE, 6), new MaterialStack(ELEMENT.getInstance().URANIUM235, 14) }); + + // Misc + public static final Material BurntLftrFuel_MK1 = new Material( + "Burnt Reactor Fuel I", //Material Name + MaterialState.PURE_LIQUID, //State + null, //Material Colour + -1, //Melting Point in C + -1, //Boiling Point in C + -1, //Protons + -1, //Neutrons + false, //Uses Blast furnace? + StringUtils.subscript(StringUtils.superscript("7")+"LiBeF2UF4FP"), //Chemical Formula + //Material Stacks with Percentage of required elements. + new MaterialStack[]{ + new MaterialStack(ELEMENT.getInstance().LITHIUM, 1), + new MaterialStack(FLUORIDES.BERYLLIUM_FLUORIDE, 1), + new MaterialStack(FLUORIDES.URANIUM_TETRAFLUORIDE, 1), + new MaterialStack(ELEMENT.getInstance().PROTACTINIUM, 1) + }); + + public static final Material BurntLftrFuel_MK2 = new Material( + "Burnt Reactor Fuel II", //Material Name + MaterialState.PURE_LIQUID, //State + null, //Material Colour + -1, //Melting Point in C + -1, //Boiling Point in C + -1, //Protons + -1, //Neutrons + false, //Uses Blast furnace? + StringUtils.subscript(StringUtils.superscript("7")+"LiBeF2UF4FP"), //Chemical Formula + //Material Stacks with Percentage of required elements. + new MaterialStack[]{ + new MaterialStack(ELEMENT.getInstance().LITHIUM, 1), + new MaterialStack(FLUORIDES.BERYLLIUM_FLUORIDE, 1), + new MaterialStack(FLUORIDES.URANIUM_TETRAFLUORIDE, 1), + new MaterialStack(ELEMENT.getInstance().PROTACTINIUM, 1) + }); + + + + // LFTR Core Fluids + public static final Material LiFBeF2UF4FP = new Material( + "LiFBeF2UF4FP", //Material Name + MaterialState.PURE_LIQUID, //State + null, //Material Colour + -1, //Melting Point in C + -1, //Boiling Point in C + -1, //Protons + -1, //Neutrons + false, //Uses Blast furnace? + StringUtils.subscript(StringUtils.superscript("7")+"LiFBeF2UF4FP"), //Chemical Formula + //Material Stacks with Percentage of required elements. + new MaterialStack[]{ + new MaterialStack(FLUORIDES.LITHIUM_FLUORIDE, 1), + new MaterialStack(FLUORIDES.BERYLLIUM_FLUORIDE, 1), + new MaterialStack(FLUORIDES.URANIUM_TETRAFLUORIDE, 1), + new MaterialStack(ELEMENT.getInstance().PROTACTINIUM, 1) + }); + + public static final Material Sparged_LiFBeF2UF4FP = new Material( + "Helium Sparged LiFBeF2UF4FP", //Material Name + MaterialState.PURE_LIQUID, //State + null, //Material Colour + -1, //Melting Point in C + -1, //Boiling Point in C + -1, //Protons + -1, //Neutrons + false, //Uses Blast furnace? + StringUtils.subscript(StringUtils.superscript("7")+"LiFBeF2UF4FP"), //Chemical Formula + //Material Stacks with Percentage of required elements. + new MaterialStack[]{ + new MaterialStack(FLUORIDES.LITHIUM_FLUORIDE, 1), + new MaterialStack(FLUORIDES.BERYLLIUM_FLUORIDE, 1), + new MaterialStack(FLUORIDES.URANIUM_TETRAFLUORIDE, 1), + new MaterialStack(ELEMENT.getInstance().PROTACTINIUM, 1) + }); + + public static final Material UF6F2FP = new Material( + "UF6F2FP", //Material Name + MaterialState.PURE_LIQUID, //State + null, //Material Colour + -1, //Melting Point in C + -1, //Boiling Point in C + -1, //Protons + -1, //Neutrons + false, //Uses Blast furnace? + StringUtils.subscript("UF6F2FP"), //Chemical Formula + //Material Stacks with Percentage of required elements. + new MaterialStack[]{ + new MaterialStack(FLUORIDES.URANIUM_HEXAFLUORIDE, 1), + new MaterialStack(ELEMENT.getInstance().FLUORINE, 3), + new MaterialStack(ELEMENT.getInstance().PHOSPHORUS, 1) + }); + + public static final Material LiFBeF2 = new Material( + "LiFBeF2", //Material Name + MaterialState.PURE_LIQUID, //State + null, //Material Colour + -1, //Melting Point in C + -1, //Boiling Point in C + -1, //Protons + -1, //Neutrons + false, //Uses Blast furnace? + StringUtils.subscript(StringUtils.superscript("7")+"LiFBeF2"), //Chemical Formula + //Material Stacks with Percentage of required elements. + new MaterialStack[]{ + new MaterialStack(FLUORIDES.LITHIUM_FLUORIDE, 1), + new MaterialStack(FLUORIDES.BERYLLIUM_FLUORIDE, 1) + }); + + public static final Material LiFBeF2UF4 = new Material( + "LiFBeF2UF4", //Material Name + MaterialState.PURE_LIQUID, //State + null, //Material Colour + -1, //Melting Point in C + -1, //Boiling Point in C + -1, //Protons + -1, //Neutrons + false, //Uses Blast furnace? + StringUtils.subscript(StringUtils.superscript("7")+"LiFBeF2UF4"), //Chemical Formula + //Material Stacks with Percentage of required elements. + new MaterialStack[]{ + new MaterialStack(LiFBeF2, 1), + new MaterialStack(FLUORIDES.URANIUM_TETRAFLUORIDE, 1) + }); + + + + + + + // LFTR Blanket Fluids + + // Tier 1 Fuel blanket output + public static final Material LiFThF4 = new Material( + "LiFThF4", //Material Name + MaterialState.PURE_LIQUID, //State + null, //Material Colour + -1, //Melting Point in C + -1, //Boiling Point in C + -1, //Protons + -1, //Neutrons + false, //Uses Blast furnace? + StringUtils.subscript(StringUtils.superscript("7")+"LiFThF4"), //Chemical Formula + //Material Stacks with Percentage of required elements. + new MaterialStack[]{ + new MaterialStack(FLUORIDES.LITHIUM_FLUORIDE, 1), + new MaterialStack(FLUORIDES.THORIUM_TETRAFLUORIDE, 1) + }); + + // Tier 2 Fuel blanket output + public static final Material LiFBeF2ThF4 = new Material( + "LiFBeF2ThF4", //Material Name + MaterialState.PURE_LIQUID, //State + null, //Material Colour + -1, //Melting Point in C + -1, //Boiling Point in C + -1, //Protons + -1, //Neutrons + false, //Uses Blast furnace? + StringUtils.subscript(StringUtils.superscript("7")+"LiFBeF2ThF4"), //Chemical Formula + //Material Stacks with Percentage of required elements. + new MaterialStack[]{ + new MaterialStack(FLUORIDES.LITHIUM_FLUORIDE, 1), + new MaterialStack(FLUORIDES.BERYLLIUM_FLUORIDE, 1), + new MaterialStack(FLUORIDES.THORIUM_TETRAFLUORIDE, 1) + }); + + // Tier 1 Fuel blanket output + public static final Material Sparged_LiFThF4 = new Material( + "Fluorine Sparged LiFThF4", //Material Name + MaterialState.PURE_LIQUID, //State + null, //Material Colour + -1, //Melting Point in C + -1, //Boiling Point in C + -1, //Protons + -1, //Neutrons + false, //Uses Blast furnace? + StringUtils.subscript(StringUtils.superscript("7")+"LiFThF4"), //Chemical Formula + //Material Stacks with Percentage of required elements. + new MaterialStack[]{ + new MaterialStack(FLUORIDES.LITHIUM_FLUORIDE, 1), + new MaterialStack(FLUORIDES.THORIUM_TETRAFLUORIDE, 1) + }); + + // Tier 2 Fuel blanket output + public static final Material Sparged_LiFBeF2ThF4 = new Material( + "Fluorine Sparged LiFBeF2ThF4", //Material Name + MaterialState.PURE_LIQUID, //State + null, //Material Colour + -1, //Melting Point in C + -1, //Boiling Point in C + -1, //Protons + -1, //Neutrons + false, //Uses Blast furnace? + StringUtils.subscript(StringUtils.superscript("7")+"LiFBeF2ThF4"), //Chemical Formula + //Material Stacks with Percentage of required elements. + new MaterialStack[]{ + new MaterialStack(FLUORIDES.LITHIUM_FLUORIDE, 1), + new MaterialStack(FLUORIDES.BERYLLIUM_FLUORIDE, 1), + new MaterialStack(FLUORIDES.THORIUM_TETRAFLUORIDE, 1) + }); + + public static final Material UF6F2 = new Material( + "UF6F2", //Material Name + MaterialState.PURE_LIQUID, //State + null, //Material Colour + -1, //Melting Point in C + -1, //Boiling Point in C + -1, //Protons + -1, //Neutrons + false, //Uses Blast furnace? + StringUtils.subscript("UF6F2"), //Chemical Formula + //Material Stacks with Percentage of required elements. + new MaterialStack[]{ + new MaterialStack(FLUORIDES.URANIUM_HEXAFLUORIDE, 1), + new MaterialStack(ELEMENT.getInstance().FLUORINE, 2) + }); + + + + + + + + + + + // Secondary material is molten metal public static final Material NAQ_FUEL_T1 = new Material( diff --git a/src/Java/gtPlusPlus/core/material/state/MaterialState.java b/src/Java/gtPlusPlus/core/material/state/MaterialState.java index 284e9582f1..460fe019dc 100644 --- a/src/Java/gtPlusPlus/core/material/state/MaterialState.java +++ b/src/Java/gtPlusPlus/core/material/state/MaterialState.java @@ -6,7 +6,8 @@ public enum MaterialState { GAS(2), PLASMA(3), PURE_LIQUID(4), - ORE(5); + ORE(5), + PURE_GAS(6); private int STATE; private MaterialState (final int State){ this.STATE = State; diff --git a/src/Java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java b/src/Java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java index 7410a507c4..5156b938db 100644 --- a/src/Java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java +++ b/src/Java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java @@ -30,7 +30,6 @@ import gtPlusPlus.core.material.MISC_MATERIALS; import gtPlusPlus.core.material.ORES; import gtPlusPlus.core.material.Particle; import gtPlusPlus.core.material.nuclear.FLUORIDES; -import gtPlusPlus.core.material.nuclear.NUCLIDE; import gtPlusPlus.core.recipe.common.CI; import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.minecraft.EnchantingUtils; @@ -448,17 +447,17 @@ public class RECIPES_GREGTECH { //Hypogen Creation GT_Values.RA.addFusionReactorRecipe( Materials.Neutronium.getMolten(128), - ALLOY.QUANTUM.getFluid(256), - ELEMENT.STANDALONE.HYPOGEN.getFluid(4), + ALLOY.QUANTUM.getFluidStack(256), + ELEMENT.STANDALONE.HYPOGEN.getFluidStack(4), 2048 * 4, (int) MaterialUtils.getVoltageForTier(9), 600000000 * 2); //Rhugnor GT_Values.RA.addFusionReactorRecipe( - GenericChem.TEFLON.getFluid(64), - ALLOY.PIKYONIUM.getFluid(128), - ELEMENT.STANDALONE.RHUGNOR.getFluid(8), + GenericChem.TEFLON.getFluidStack(64), + ALLOY.PIKYONIUM.getFluidStack(128), + ELEMENT.STANDALONE.RHUGNOR.getFluidStack(8), 2048 * 4, (int) MaterialUtils.getVoltageForTier(7), 150000000 * 2); @@ -483,7 +482,7 @@ public class RECIPES_GREGTECH { CORE.RA.addAssemblylineRecipe( ItemDummyResearch.getResearchStack(ASSEMBLY_LINE_RESEARCH.RESEARCH_1_CONTAINMENT, 1), 20 * 60 * 30, - new ItemStack[] { + new Object[] { ItemList.Field_Generator_IV.get(GTNH ? 32 : 16), ItemList.Electric_Motor_EV.get(GTNH ? 64 : 32), ItemList.Energy_LapotronicOrb.get(GTNH ? 32 : 16), @@ -493,18 +492,17 @@ public class RECIPES_GREGTECH { ELEMENT.getInstance().GADOLINIUM.getDust(GTNH ? 32 : 8), ELEMENT.getInstance().SAMARIUM.getDust(GTNH ? 16 : 4), ALLOY.ARCANITE.getGear(GTNH ? 8 : 2), - CI.getTieredComponent(OrePrefixes.circuit, 5, GTNH ? 64 : 32), - CI.getTieredComponent(OrePrefixes.circuit, 6, GTNH ? 32 : 16), - CI.getTieredComponent(OrePrefixes.circuit, 7, GTNH ? 16 : 8), + new Object[] {CI.getTieredCircuitOreDictName(5), 64}, + new Object[] {CI.getTieredCircuitOreDictName(6), 32}, + new Object[] {CI.getTieredCircuitOreDictName(7), 16}, GregtechItemList.Laser_Lens_Special.get(1), aCoilWire[3] }, new FluidStack[] { - ALLOY.NITINOL_60.getFluid(144 * 9 * (GTNH ? 4 : 2)), - ALLOY.ENERGYCRYSTAL.getFluid(144 * 9 * (GTNH ? 8 : 4)), - ALLOY.TUMBAGA.getFluid(144 * 9 * (GTNH ? 32 : 8)), - ALLOY.NICHROME.getFluid(144 * 1 * (GTNH ? 16 : 4)), - + ALLOY.NITINOL_60.getFluidStack(144 * 9 * (GTNH ? 4 : 2)), + ALLOY.ENERGYCRYSTAL.getFluidStack(144 * 9 * (GTNH ? 8 : 4)), + ALLOY.TUMBAGA.getFluidStack(144 * 9 * (GTNH ? 32 : 8)), + ALLOY.NICHROME.getFluidStack(144 * 1 * (GTNH ? 16 : 4)), }, ItemUtils.getSimpleStack(ModBlocks.blockCasings3Misc, 15, 32), 20 * 60 * 10 * (GTNH ? 2 : 1), @@ -565,7 +563,7 @@ public class RECIPES_GREGTECH { CORE.RA.addAssemblylineRecipe( ItemDummyResearch.getResearchStack(ASSEMBLY_LINE_RESEARCH.RESEARCH_8_TURBINE_AUTOMATION, 1), 20 * 60 * 60 * 24, - new ItemStack[] { + new Object[] { CI.getTieredMachineHull(8, 4), CI.getConveyor(8, GTNH ? 24 : 12), CI.getElectricMotor(7, GTNH ? 32 : 16), @@ -575,15 +573,15 @@ public class RECIPES_GREGTECH { CI.getTieredComponent(OrePrefixes.screw, 8, GTNH ? 48 : 24), CI.getTieredComponent(OrePrefixes.bolt, 7, GTNH ? 32 : 16), CI.getTieredComponent(OrePrefixes.rod, 6, GTNH ? 12 : 6), - CI.getTieredComponent(OrePrefixes.circuit, 7, GTNH ? 20 : 10), + new Object[] {CI.getTieredCircuitOreDictName(7), 20}, CI.getTieredComponent(OrePrefixes.rotor, 6, GTNH ? 16 : 8), }, new FluidStack[] { CI.getTieredFluid(8, 144 * 32), CI.getAlternativeTieredFluid(7, 144 * 16), CI.getTertiaryTieredFluid(7, 144 * 16), - ALLOY.BABBIT_ALLOY.getFluid(128 * 144), - ALLOY.ZERON_100.getFluid(144 * 64) + ALLOY.BABBIT_ALLOY.getFluidStack(128 * 144), + ALLOY.ZERON_100.getFluidStack(144 * 64) }, GregtechItemList.Hatch_Input_TurbineHousing.get(4), @@ -652,11 +650,11 @@ public class RECIPES_GREGTECH { CORE.RA.addAssemblylineRecipe( aExoticInputs[aCasingSlot], 20 * 60 * 60 * 5, - new ItemStack[] { + new Object[] { aGemCasings[aCasingSlot], ItemUtils.getSimpleStack(aExoticInputs[aCasingSlot], 16), CI.getTieredComponent(OrePrefixes.plate, j, 16), - CI.getTieredComponent(OrePrefixes.circuit, j, 8), + new Object[] {CI.getTieredCircuitOreDictName(j), 8}, CI.getTieredComponent(OrePrefixes.wireGt16, j+1, GTNH ? 32 : 16), CI.getTieredComponent(OrePrefixes.bolt, j, GTNH ? 8 : 4), CI.getTieredComponent(OrePrefixes.screw, j-1, GTNH ? 8 : 4), @@ -678,10 +676,10 @@ public class RECIPES_GREGTECH { CORE.RA.addAssemblylineRecipe( ItemUtils.simpleMetaStack(Items.golden_apple, 1, 1), 20 * 60 * 10, - new ItemStack[] { + new Object[] { ItemUtils.getSimpleStack(aGemCasings[2], GTNH ? 4 : 2), CI.getTieredComponent(OrePrefixes.plate, 8, GTNH ? 32 : 16), - CI.getTieredComponent(OrePrefixes.circuit, 7, GTNH ? 16 : 4), + new Object[] {CI.getTieredCircuitOreDictName(7), 16}, CI.getTieredComponent(OrePrefixes.cableGt02, 7, GTNH ? 16 : 8), CI.getTieredComponent(OrePrefixes.gearGt, 6, GTNH ? 6 : 3), CI.getTieredComponent(OrePrefixes.screw, 7, GTNH ? 16 : 8), @@ -723,12 +721,12 @@ public class RECIPES_GREGTECH { CORE.RA.addAssemblylineRecipe( aChargeResearch[aCurrSlot], 20 * 60 * 10 * (aCurrSlot + 1), - new ItemStack[] { + new Object[] { ItemUtils.getSimpleStack(aGemBatteries[aCurrSlot],2), aCoilWire[aCurrSlot], CI.getTieredComponent(OrePrefixes.plate, h, 8), - CI.getTieredComponent(OrePrefixes.circuit, h, 4), - CI.getTieredComponent(OrePrefixes.circuit, h-1, 8), + new Object[] {CI.getTieredCircuitOreDictName(h), 4}, + new Object[] {CI.getTieredCircuitOreDictName(h-1), 8}, CI.getTieredComponent(OrePrefixes.cableGt12, h-1, 16), CI.getTieredComponent(OrePrefixes.screw, h, GTNH ? 16 : 8), CI.getTieredComponent(OrePrefixes.bolt, h-2, GTNH ? 32 : 16), @@ -750,10 +748,10 @@ public class RECIPES_GREGTECH { CORE.RA.addAssemblylineRecipe( ItemDummyResearch.getResearchStack(ASSEMBLY_LINE_RESEARCH.RESEARCH_9_CLOAKING, 1), 20 * 60 * 10, - new ItemStack[] { + new Object[] { ItemUtils.getSimpleStack(aGemCasings[3], GTNH ? 4 : 2), CI.getTieredComponent(OrePrefixes.plate, 8, GTNH ? 32 : 16), - CI.getTieredComponent(OrePrefixes.circuit, 7, GTNH ? 16 : 4), + new Object[] {CI.getTieredCircuitOreDictName(7), 16}, CI.getTieredComponent(OrePrefixes.cableGt04, 8, GTNH ? 16 : 8), CI.getTieredComponent(OrePrefixes.gearGt, 7, GTNH ? 6 : 3), CI.getTieredComponent(OrePrefixes.screw, 8, GTNH ? 16 : 8), @@ -935,7 +933,7 @@ public class RECIPES_GREGTECH { ELEMENT.getInstance().CARBON.getDust(1), ELEMENT.getInstance().SILICON.getDust(4) }, - ALLOY.EGLIN_STEEL.getFluid(16 * 144), + ALLOY.EGLIN_STEEL.getFluidStack(16 * 144), 0, 20 * 45, 120); @@ -949,8 +947,8 @@ public class RECIPES_GREGTECH { ELEMENT.getInstance().CALCIUM.getDust(2), ELEMENT.getInstance().COPPER.getDust(3), }, - ELEMENT.getInstance().OXYGEN.getFluid(8000), - ALLOY.HG1223.getFluid(16 * 144), + ELEMENT.getInstance().OXYGEN.getFluidStack(8000), + ALLOY.HG1223.getFluidStack(16 * 144), new ItemStack[] { CI.emptyCells(1) }, @@ -965,7 +963,7 @@ public class RECIPES_GREGTECH { ELEMENT.getInstance().TITANIUM.getDust(3), ELEMENT.getInstance().NICKEL.getDust(2) }, - ALLOY.NITINOL_60.getFluid(5 * 144), + ALLOY.NITINOL_60.getFluidStack(5 * 144), 0, 20 * 75, 7680); @@ -982,7 +980,7 @@ public class RECIPES_GREGTECH { ELEMENT.getInstance().CARBON.getDust(32), }, Materials.SulfuricAcid.getFluid(2000), - ELEMENT.getInstance().GERMANIUM.getFluid(288), + ELEMENT.getInstance().GERMANIUM.getFluidStack(288), 0, 20 * 300, 4000); @@ -996,7 +994,7 @@ public class RECIPES_GREGTECH { ELEMENT.getInstance().CARBON.getDust(32), }, Materials.SulfuricAcid.getFluid(2000), - ELEMENT.getInstance().RUTHENIUM.getFluid(288), + ELEMENT.getInstance().RUTHENIUM.getFluidStack(288), 0, 20 * 300, 8000); @@ -1007,7 +1005,7 @@ public class RECIPES_GREGTECH { ELEMENT.getInstance().CARBON.getDust(32), }, Materials.SulfuricAcid.getFluid(2000), - ELEMENT.getInstance().RUTHENIUM.getFluid(288), + ELEMENT.getInstance().RUTHENIUM.getFluidStack(288), 0, 20 * 300, 8000); @@ -1018,7 +1016,7 @@ public class RECIPES_GREGTECH { ELEMENT.getInstance().CARBON.getDust(32), }, Materials.SulfuricAcid.getFluid(2000), - ELEMENT.getInstance().RUTHENIUM.getFluid(288), + ELEMENT.getInstance().RUTHENIUM.getFluidStack(288), 0, 20 * 300, 8000); @@ -1029,7 +1027,7 @@ public class RECIPES_GREGTECH { ELEMENT.getInstance().CARBON.getDust(32), }, Materials.SulfuricAcid.getFluid(8000), - ELEMENT.getInstance().RUTHENIUM.getFluid(144), + ELEMENT.getInstance().RUTHENIUM.getFluidStack(144), 0, 20 * 300, 8000); @@ -1042,7 +1040,7 @@ public class RECIPES_GREGTECH { ELEMENT.getInstance().CARBON.getDust(32), }, Materials.SulfuricAcid.getFluid(10000), - ELEMENT.getInstance().RHENIUM.getFluid(144), + ELEMENT.getInstance().RHENIUM.getFluidStack(144), 0, 20 * 300, 4000); @@ -1053,7 +1051,7 @@ public class RECIPES_GREGTECH { ELEMENT.getInstance().CARBON.getDust(32), }, Materials.SulfuricAcid.getFluid(7500), - ELEMENT.getInstance().RHENIUM.getFluid(144), + ELEMENT.getInstance().RHENIUM.getFluidStack(144), 0, 20 * 300, 4000); @@ -1064,7 +1062,7 @@ public class RECIPES_GREGTECH { ELEMENT.getInstance().CARBON.getDust(32), }, Materials.SulfuricAcid.getFluid(5000), - ELEMENT.getInstance().RHENIUM.getFluid(288), + ELEMENT.getInstance().RHENIUM.getFluidStack(288), 0, 20 * 300, 4000); @@ -1078,7 +1076,7 @@ public class RECIPES_GREGTECH { ELEMENT.getInstance().CARBON.getDust(64), }, Materials.SulfuricAcid.getFluid(5000), - ELEMENT.getInstance().THALLIUM.getFluid(288+144), + ELEMENT.getInstance().THALLIUM.getFluidStack(288+144), 0, 20 * 300, 8000); @@ -1093,7 +1091,7 @@ public class RECIPES_GREGTECH { ELEMENT.getInstance().ALUMINIUM.getDust(8), }, null, - ELEMENT.getInstance().OXYGEN.getFluid(8000), + ELEMENT.getInstance().OXYGEN.getFluidStack(8000), new ItemStack[] { ELEMENT.getInstance().ALUMINIUM.getIngot(8), ELEMENT.getInstance().STRONTIUM.getIngot(8) @@ -1229,310 +1227,86 @@ public class RECIPES_GREGTECH { private static void dehydratorRecipes() { Logger.INFO("Loading Recipes for Chemical Dehydrator."); - try { - // Makes Lithium Carbonate - CORE.RA.addDehydratorRecipe(ItemUtils.getItemStackOfAmountFromOreDict("cellSulfuricLithium", 1), - FluidUtils.getFluidStack("sulfuriclithium", 440), - new ItemStack[] { - CI.emptyCells(1), - ItemUtils.getItemStackOfAmountFromOreDict("dustSulfur", 3), - ItemUtils.getItemStackOfAmountFromOreDict("dustCopper", 1), - ItemUtils.getItemStackOfAmountFromOreDict("dustSodium", 1), - ItemUtils.getItemStackOfAmountFromOreDict("dustCarbon", 1), - ItemUtils.getItemStackOfAmountFromOreDict("dustLithium7", 3) - }, - 30 * 20, // Time in ticks - 30); // EU - } - catch (final NullPointerException e) { - Logger.INFO("[cellSulfuricLithium] FAILED TO LOAD RECIPES - NULL POINTER SOMEWHERE"); - } - try { - - ItemStack cells = CI.emptyCells(12); - - final ItemStack[] input = { cells, ItemUtils.getItemStackOfAmountFromOreDict("dustLepidolite", 20) }; - - CORE.RA.addDehydratorRecipe(input, // Item input (Array, up to 2) - FluidUtils.getFluidStack("sulfuricacid", 10000), - FluidUtils.getFluidStack("sulfuriclithium", 10000), - new ItemStack[] { - ItemUtils.getItemStackOfAmountFromOreDict("dustPotassium", 1), - ItemUtils.getItemStackOfAmountFromOreDict("dustAluminium", 4), - ItemUtils.getItemStackOfAmountFromOreDict("cellOxygen", 10), - ItemUtils.getItemStackOfAmountFromOreDict("cellFluorine", 2), - ItemUtils.getItemStackOfAmountFromOreDict("dustLithiumCarbonate", 3), // LithiumCarbonate - }, // Output Array of Items - Upto 9, - new int[] { 0 }, - 75 * 20, // Time in ticks - 1000); // EU - - } - catch (final NullPointerException e) { - Logger.INFO("[dustLepidolite] FAILED TO LOAD RECIPES - NULL POINTER SOMEWHERE"); - } - try { - - CORE.RA.addDehydratorRecipe( - new ItemStack[] { - ItemUtils.getItemStackOfAmountFromOreDict("cellWater", 10) - }, - FluidUtils.getFluidStack("molten.uraniumtetrafluoride", 1440), - null, - new ItemStack[] { - ItemUtils.getItemStackOfAmountFromOreDict("dustUraniumTetrafluoride", 10), - CI.emptyCells(10) - }, - new int[] { 0 }, 150 * 20, // Time in ticks - 2000); // EU - - } - catch (final NullPointerException e) { - Logger.INFO("[dustUraniumTetrafluoride] FAILED TO LOAD RECIPES - NULL POINTER SOMEWHERE"); - } - try { - - CORE.RA.addDehydratorRecipe( - new ItemStack[] { - ItemUtils.getItemStackOfAmountFromOreDict("cellWater", 10) - }, // Item - FluidUtils.getFluidStack("molten.uraniumhexafluoride", 1440), // Fluid - null, // Fluid output (slot 2) - new ItemStack[] { - ItemUtils.getItemStackOfAmountFromOreDict("dustUraniumHexafluoride", 10), - CI.emptyCells(10) }, // Output - new int[] { 0 }, 300 * 20, // Time in ticks - 4000); // EU - - } - catch (final NullPointerException e) { - Logger.INFO("[dustUraniumHexafluoride] FAILED TO LOAD RECIPES - NULL POINTER SOMEWHERE"); - } - - // Raisins from Grapes - try { - - ItemStack cropGrape = ItemUtils.getItemStackOfAmountFromOreDictNoBroken("cropGrape", 1); - ItemStack foodRaisins = ItemUtils.getItemStackOfAmountFromOreDictNoBroken("foodRaisins", 1); - - if (cropGrape != null && foodRaisins != null) - CORE.RA.addDehydratorRecipe(new ItemStack[] { - cropGrape - }, // Item - null, // Fluid input (slot 1) - null, // Fluid output (slot 2) - new ItemStack[] { - foodRaisins - }, // Output - new int[] { 0 }, 10, // Time in ticks - 2); // EU - - } - catch (final NullPointerException e) { - Logger.INFO("[foodRaisins] FAILED TO LOAD RECIPES - NULL POINTER SOMEWHERE"); - } - - // Calcium Hydroxide - if ((ItemUtils.checkForInvalidItems(ItemUtils.getItemStackOfAmountFromOreDict("dustQuicklime", 1))) || LoadedMods.IHL) { - try { - - CORE.RA.addDehydratorRecipe( - new ItemStack[] { ItemUtils.getItemStackOfAmountFromOreDict("dustQuicklime", 10) }, // Item - FluidUtils.getFluidStack("water", 10000), // Fluid input - // (slot 1) - null, // Fluid output (slot 2) - new ItemStack[] { ItemUtils.getItemStackOfAmountFromOreDict("dustCalciumHydroxide", 20) }, // Output - new int[] { 0 }, 120 * 20, // Time in ticks - 120); // EU - - } - catch (final NullPointerException e) { - Logger.INFO("[dustCalciumHydroxide] FAILED TO LOAD RECIPES - NULL POINTER SOMEWHERE"); - } - - } - - // Process Waste Water - try { - - CORE.RA.addDehydratorRecipe(null, - FluidUtils.getFluidStack("fluid.sludge", 1000), - FluidUtils.getFluidStack("nitricacid", 10), - new ItemStack[] { ItemUtils.getItemStackOfAmountFromOreDict("dustTinyIron", 1), - ItemUtils.getItemStackOfAmountFromOreDict("dustTinyCopper", 1), - ItemUtils.getItemStackOfAmountFromOreDict("dustTinyTin", 1), - ItemUtils.getItemStackOfAmountFromOreDict("dustTinyNickel", 1), - ItemUtils.getItemStackOfAmountFromOreDict("dustTinyCobalt", 1), - ItemUtils.getItemStackOfAmountFromOreDict("dustTinyAluminium", 1), - ItemUtils.getItemStackOfAmountFromOreDict("dustTinySilver", 1), - ItemUtils.getItemStackOfAmountFromOreDict("dustTinyGold", 1), - ItemUtils.getItemStackOfAmountFromOreDict("dustTinyIridium", 1) }, - new int[] { 10, 5, 5, 4, 4, 3, 2, 2, 1 }, - 2 * 20, - 500); // EU - - } - catch (final NullPointerException e) { - Logger.INFO("[sludge] FAILED TO LOAD RECIPES - NULL POINTER SOMEWHERE"); - } - - - - // 2 LiOH + CaCO3 - try { - - CORE.RA.addDehydratorRecipe( - new ItemStack[] { - 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[] { 0 }, 120 * 20, // Time in ticks - 1000); // EU - - } - catch (final NullPointerException e) { - Logger.INFO("[dustLi2CO3CaOH2] FAILED TO LOAD RECIPES - NULL POINTER SOMEWHERE"); - } - // LiOH Liquid to Dust - try { + ItemStack cropGrape = ItemUtils.getItemStackOfAmountFromOreDictNoBroken("cropGrape", 1); + ItemStack foodRaisins = ItemUtils.getItemStackOfAmountFromOreDictNoBroken("foodRaisins", 1); - CORE.RA.addDehydratorRecipe(new ItemStack[] { - ItemUtils.getGregtechCircuit(0) + if (cropGrape != null && foodRaisins != null) + CORE.RA.addDehydratorRecipe(new ItemStack[] { + CI.getNumberedBioCircuit(20), + cropGrape }, // Item - FluidUtils.getFluidStack("lithiumhydroxide", 144), // Fluid + null, // Fluid input (slot 1) null, // Fluid output (slot 2) new ItemStack[] { - ItemUtils.getItemStackOfAmountFromOreDict("dustLithiumHydroxide", 1) + foodRaisins }, // Output - new int[] { 0 }, - 1 * 20, // Time in ticks - 64); // EU + new int[] { 10000 }, + 10, // Time in ticks + 2); // EU - } - catch (final NullPointerException e) { - Logger.INFO("[dustLithiumHydroxide] FAILED TO LOAD RECIPES - NULL POINTER SOMEWHERE"); - } - // Zirconium Chloride -> TetraFluoride - try { - CORE.RA.addDehydratorRecipe( - new ItemStack[] { - ItemUtils.getItemStackOfAmountFromOreDict("dustCookedZrCl4", 9), - CI.emptyCells(9) - }, // Item - FluidUtils.getFluidStack("hydrofluoricacid", 9 * 144), - null, - new ItemStack[] { ItemUtils.getItemStackOfAmountFromOreDict("cellHydrogenChloride", 9), - FLUORIDES.ZIRCONIUM_TETRAFLUORIDE.getDust(9) - }, - new int[] { 0 }, 120 * 20, // Time in ticks - 500); // EU - - - if (Utils.getGregtechVersionAsInt() >= 50929) { - CORE.RA.addDehydratorRecipe( - new ItemStack[] { ItemUtils.getItemStackOfAmountFromOreDict("dustCookedZrCl4", 9), - CI.emptyCells(9) }, - FluidUtils.getFluidStack("hydrofluoricacid_gt5u", 18 * 144), - null, - new ItemStack[] { ItemUtils.getItemStackOfAmountFromOreDict("cellHydrogenChloride", 9), - FLUORIDES.ZIRCONIUM_TETRAFLUORIDE.getDust(9) }, - new int[] { 0 }, - 120 * 20, // Time in ticks - 500); // EU - } - - - } - catch (final NullPointerException e) { - Logger.INFO("[dustZrF4] FAILED TO LOAD RECIPES - NULL POINTER SOMEWHERE"); - } + // Process Waste Water + CORE.RA.addDehydratorRecipe( + new ItemStack[] { + CI.getNumberedBioCircuit(21) + }, + FluidUtils.getFluidStack("fluid.sludge", 1000), + FluidUtils.getFluidStack("nitricacid", 10), + new ItemStack[] { + ItemUtils.getItemStackOfAmountFromOreDict("dustTinyIron", 1), + ItemUtils.getItemStackOfAmountFromOreDict("dustTinyCopper", 1), + ItemUtils.getItemStackOfAmountFromOreDict("dustTinyTin", 1), + ItemUtils.getItemStackOfAmountFromOreDict("dustTinyNickel", 1), + ItemUtils.getItemStackOfAmountFromOreDict("dustTinyCobalt", 1), + ItemUtils.getItemStackOfAmountFromOreDict("dustTinyAluminium", 1), + ItemUtils.getItemStackOfAmountFromOreDict("dustTinySilver", 1), + ItemUtils.getItemStackOfAmountFromOreDict("dustTinyGold", 1), + ItemUtils.getItemStackOfAmountFromOreDict("dustTinyIridium", 1) }, + new int[] { 10, 5, 5, 4, 4, 3, 2, 2, 1 }, + 2 * 20, + 500); // EU // CaF2 + H2SO4 → CaSO4(solid) + 2 HF - try { - - CORE.RA.addDehydratorRecipe( - new ItemStack[] { - ItemUtils.getItemStackOfAmountFromOreDict("dustFluorite", 37), - CI.emptyCells(16) - }, - FluidUtils.getFluidStack("sulfuricacid", 56 * 144), - null, // Fluid output (slot 2) - new ItemStack[] { - ItemUtils.getItemStackOfAmountFromOreDict("dustCalciumSulfate", 30), - ItemUtils.getItemStackOfAmountFromOreDict("cellHydrofluoricAcid", 16), - ItemUtils.getItemStackOfAmountFromOreDict("dustSilver", 1), - ItemUtils.getItemStackOfAmountFromOreDict("dustGold", 2), - ItemUtils.getItemStackOfAmountFromOreDict("dustTin", 1), - ItemUtils.getItemStackOfAmountFromOreDict("dustCopper", 2) - }, - new int[] { 0, 0, 100, 100, 300, 200 }, - 10 * 60 * 20, - 230); // EU - - } - catch (final NullPointerException e) { - Logger.INFO("[dustFluorite] FAILED TO LOAD RECIPES - NULL POINTER SOMEWHERE"); + FluidStack aGregtechHydro = FluidUtils.getFluidStack("hydrofluoricacid_gt5u", 16000); + if (aGregtechHydro == null) { + aGregtechHydro = FluidUtils.getFluidStack("hydrofluoricacid", 16000); } - // Be(OH)2 + 2 (NH4)HF2 → (NH4)2BeF4 + 2 H2O - try { - CORE.RA.addDehydratorRecipe( - new ItemStack[] { - ItemUtils.getItemStackOfAmountFromOreDict("cellBerylliumHydroxide", 2), - ItemUtils.getItemStackOfAmountFromOreDict("cellAmmoniumBifluoride", 4) - }, - null, // Fluid input (slot 1) - FluidUtils.getFluidStack("ammoniumtetrafluoroberyllate", 6000), - new ItemStack[] { - ItemUtils.getItemStackOfAmountFromOreDict("cellWater", 4), - CI.emptyCells(2) - }, - new int[] { 0, 0, 0 }, - 32 * 20, // Time in ticks - 64); // EU - - } - catch (final NullPointerException e) { - Logger.INFO("[ammoniumtetrafluoroberyllate] FAILED TO LOAD RECIPES - NULL POINTER SOMEWHERE"); - } - - // (NH4)2BeF4 → 2 NH3 + 2 HF + BeF2 - try { - CORE.RA.addDehydratorRecipe( - new ItemStack[] { - CI.emptyCells(5) - }, - FluidUtils.getFluidStack("ammoniumtetrafluoroberyllate", 5000), - null, // Fluid output (slot 2) - new ItemStack[] { ItemUtils.getItemStackOfAmountFromOreDict("cellAmmonia", 2), - ItemUtils.getItemStackOfAmountFromOreDict("cellHydrofluoricAcid", 2), - ItemUtils.getItemStackOfAmountFromOreDict("cellBerylliumFluoride", 1) }, - new int[] { 0, 0, 0 }, - 5 * 60 * 20, // Time in ticks - 120); // EU + CORE.RA.addDehydratorRecipe( + new ItemStack[] { + CI.getNumberedAdvancedCircuit(5), + ItemUtils.getItemStackOfAmountFromOreDict("dustFluorite", 37), + }, + FluidUtils.getFluidStack("sulfuricacid", 56 * 144), + aGregtechHydro, // Fluid output (slot 2) + new ItemStack[] { + ItemUtils.getItemStackOfAmountFromOreDict("dustCalciumSulfate", 30), + ItemUtils.getItemStackOfAmountFromOreDict("dustSilver", 1), + ItemUtils.getItemStackOfAmountFromOreDict("dustGold", 2), + ItemUtils.getItemStackOfAmountFromOreDict("dustTin", 1), + ItemUtils.getItemStackOfAmountFromOreDict("dustCopper", 2) + }, + new int[] { 10000, 100, 100, 300, 200 }, + 10 * 60 * 20, + 230); // EU - } - catch (final NullPointerException e) { - Logger.INFO("[cellBerylliumFluoride] FAILED TO LOAD RECIPES - NULL POINTER SOMEWHERE"); - } - // Makes Styrene CORE.RA.addDehydratorRecipe( - CI.emptyCells(3), // Item Input - FluidUtils.getFluidStack("fluid.ethylbenzene", 1000), // Fluid + new ItemStack[] { + CI.getNumberedAdvancedCircuit(18), + CI.emptyCells(3) + }, + FluidUtils.getFluidStack("fluid.ethylbenzene", 1000), + null, new ItemStack[] { ItemUtils.getItemStackOfAmountFromOreDict("cellStyrene", 1), - ItemUtils.getItemStackOfAmountFromOreDict("cellHydrogen", 2) }, // Output - 3 * 20, // Time in ticks - 30); // EU + ItemUtils.getItemStackOfAmountFromOreDict("cellHydrogen", 2) + }, + new int[] {10000, 10000}, + 3 * 20, + 30); /* * Try Add custom Recipe for drying leather @@ -1542,11 +1316,16 @@ public class RECIPES_GREGTECH { aLeather1 = ItemUtils.getCorrectStacktype("harvestcraft:hardenedleatherItem", 1); aLeather2 = ItemUtils.getCorrectStacktype("Backpack:tannedLeather", 1); CORE.RA.addDehydratorRecipe( - aLeather1, - GT_Values.NF, new ItemStack[] { - aLeather2 + CI.getNumberedAdvancedCircuit(18), + aLeather1 + }, + FluidUtils.getFluidStack("fluid.ethylbenzene", 1000), + null, + new ItemStack[] { + aLeather2 }, + new int[] {10000}, 5 * 20, 180); } @@ -1586,77 +1365,6 @@ public class RECIPES_GREGTECH { private static void fissionFuelRecipes() { try { - final String salt_LiFBeF2ThF4UF4 = "LiFBeF2ThF4UF4".toLowerCase(); - final String salt_LiFBeF2ZrF4U235 = "LiFBeF2ZrF4U235".toLowerCase(); - final String salt_LiFBeF2ZrF4UF4 = "LiFBeF2ZrF4UF4".toLowerCase(); - - final FluidStack LithiumFluoride = FluidUtils.getFluidStack("molten.lithiumfluoride", 100); // Re-usable - // FluidStacks - final FluidStack BerylliumFluoride = FluidUtils.getFluidStack("molten.berylliumfluoride", 100); // Re-usable - // FluidStacks - final FluidStack ThoriumFluoride = FluidUtils.getFluidStack("molten.thoriumtetrafluoride", 100); // Re-usable - // FluidStacks - final FluidStack ZirconiumFluoride = FluidUtils.getFluidStack("zirconiumtetrafluoride", 100); // Re-usable - // FluidStacks - final FluidStack UraniumTetraFluoride = FluidUtils.getFluidStack("molten.uraniumtetrafluoride", 100); // Re-usable - // FluidStacks - final FluidStack Uranium235 = FluidUtils.getFluidStack("molten.uranium235", 1000); // Re-usable - // FluidStacks - - final FluidStack LiFBeF2ThF4UF4 = FluidUtils.getFluidStack("molten." + salt_LiFBeF2ThF4UF4, 100); // Re-usable - // FluidStacks - final FluidStack LiFBeF2ZrF4U235 = FluidUtils.getFluidStack("molten." + salt_LiFBeF2ZrF4U235, 100); // Re-usable - // FluidStacks - final FluidStack LiFBeF2ZrF4UF4 = FluidUtils.getFluidStack("molten." + salt_LiFBeF2ZrF4UF4, 100); // Re-usable - // FluidStacks - - // 7LiF - BeF2 - ZrF4 - UF4 - 650C - CORE.RA.addFissionFuel(FluidUtils.getFluidStack(LithiumFluoride, 650), // Input - // A - FluidUtils.getFluidStack(BerylliumFluoride, 250), // Input - // B - FluidUtils.getFluidStack(ZirconiumFluoride, 80), // Input C - FluidUtils.getFluidStack(UraniumTetraFluoride, 70), // Input - // D - null, null, null, null, null, // Extra 5 inputs - FluidUtils.getFluidStack(LiFBeF2ZrF4UF4, 1000), // Output - // Fluid - // 1 - null, // Output Fluid 2 - 60 * 60 * 20, // Duration - 500); - - // 7LiF - BeF2 - ZrF4 - U235 - 590C - CORE.RA.addFissionFuel(FluidUtils.getFluidStack(LithiumFluoride, 550), // Input - // A - FluidUtils.getFluidStack(BerylliumFluoride, 150), // Input - // B - FluidUtils.getFluidStack(ZirconiumFluoride, 60), // Input C - FluidUtils.getFluidStack(Uranium235, 240), // Input D - null, null, null, null, null, // Extra 5 inputs - FluidUtils.getFluidStack(LiFBeF2ZrF4U235, 1000), // Output - // Fluid - // 1 - null, // Output Fluid 2 - 45 * 60 * 20, // Duration - 500); - - // 7liF - BeF2 - ThF4 - UF4 - 566C - CORE.RA.addFissionFuel(FluidUtils.getFluidStack(LithiumFluoride, 620), // Input - // A - FluidUtils.getFluidStack(BerylliumFluoride, 280), // Input - // B - FluidUtils.getFluidStack(ThoriumFluoride, 70), // Input C - FluidUtils.getFluidStack(UraniumTetraFluoride, 70), // Input - // D - null, null, null, null, null, // Extra 5 inputs - FluidUtils.getFluidStack(LiFBeF2ThF4UF4, 1000), // Output - // Fluid - // 1 - null, // Output Fluid 2 - 60 * 60 * 20, // Duration - 500); - } catch (final NullPointerException e) { Logger.INFO("FAILED TO LOAD RECIPES - NULL POINTER SOMEWHERE"); @@ -1703,7 +1411,7 @@ public class RECIPES_GREGTECH { T5, 1000, 128000); addAR(T5, ItemUtils.getItemStackOfAmountFromOreDict("plateDenseAmericium", 4), - FluidUtils.getFluidStack("molten.krypton", 500), + FluidUtils.getFluidStack("krypton", 500), T6, 2000, 512000); addAR(ItemUtils.getItemStackOfAmountFromOreDict( @@ -2022,160 +1730,45 @@ public class RECIPES_GREGTECH { ItemList.Battery_Hull_HV.get(4L, new Object[0])); } - private static void fluidExtractorRecipes() { - //FLiBe fuel - CORE.RA.addFluidExtractionRecipe(ItemUtils.getItemStackOfAmountFromOreDict("dustLi2BeF4", 1), - FluidUtils.getFluidStack("li2bef4", 144), 100, 500); - //LFTR Fuel 1 - CORE.RA.addFluidExtractionRecipe(NUCLIDE.LiFBeF2ZrF4U235.getDust(1), - NUCLIDE.LiFBeF2ZrF4U235.getFluid(144), 250, 1000); - CORE.RA.addFluidExtractionRecipe(NUCLIDE.LiFBeF2ZrF4UF4.getDust(1), - NUCLIDE.LiFBeF2ZrF4UF4.getFluid(144), 150, 2000); - CORE.RA.addFluidExtractionRecipe(NUCLIDE.LiFBeF2ThF4UF4.getDust(1), - NUCLIDE.LiFBeF2ThF4UF4.getFluid(144), 200, 1500); - - //ZIRCONIUM_TETRAFLUORIDE - CORE.RA.addFluidExtractionRecipe(FLUORIDES.ZIRCONIUM_TETRAFLUORIDE.getDust(1), - FluidUtils.getFluidStack(ModItems.fluidZrF4, 144), 200, 512+256); - - - - /* GT_Values.RA.addFluidExtractionRecipe(ItemUtils.getItemStackOfAmountFromOreDict("dustLiBeF2ZrF4U235", 1), null, - FluidUtils.getFluidStack("molten.libef2zrf4u235", 144), 10000, 250, 1000); - //LFTR Fuel 2 - GT_Values.RA.addFluidExtractionRecipe(ItemUtils.getItemStackOfAmountFromOreDict("dustLiBeF2ZrF4UF4", 1), null, - FluidUtils.getFluidStack("molten.libef2zrf4uf4", 144), 10000, 150, 2000); - //LFTR Fuel 2 - GT_Values.RA.addFluidExtractionRecipe(ItemUtils.getItemStackOfAmountFromOreDict("dustLiBeF2ThF4UF4", 1), null, - FluidUtils.getFluidStack("molten.libef2thf4uf4", 144), 10000, 200, 1500);*/ + private static void fluidExtractorRecipes() { + } private static void chemicalBathRecipes() { - int[] chances = {9000, 6000, 3000}; - GT_Values.RA.addChemicalBathRecipe(ItemUtils.getItemStackOfAmountFromOreDict("dustTin", 12), - FluidUtils.getFluidStack("chlorine", 2400), - ItemUtils.getItemStackOfAmountFromOreDict("dustZirconium", 3), - ItemUtils.getItemStackOfAmountFromOreDict("dustZirconium", 4), - ItemUtils.getItemStackOfAmountFromOreDict("dustZirconium", 5), chances, 30 * 20, 480); - chances = new int[]{9000, 3000, 1000}; - GT_Values.RA.addChemicalBathRecipe(ItemUtils.getItemStackOfAmountFromOreDict("dustRutile", 5), - FluidUtils.getFluidStack("chlorine", 4000), - ItemUtils.getItemStackOfAmountFromOreDict("dustZirconium", 3), - ItemUtils.getItemStackOfAmountFromOreDict("dustTitanium", 1), - ItemUtils.getItemStackOfAmountFromOreDict("dustHafnium", 1), - chances, 30 * 20, 1024); - - GT_Values.RA.addChemicalBathRecipe(FLUORIDES.FLUORITE.getCrushed(2), FluidUtils.getFluidStack("hydrogen", 2000), - FLUORIDES.FLUORITE.getCrushedPurified(8), FLUORIDES.FLUORITE.getDustImpure(4), - FLUORIDES.FLUORITE.getDustPurified(2), new int[] { 10000, 5000, 1000 }, 30 * 20, 240); - - GT_Values.RA.addChemicalBathRecipe(ItemUtils.getItemStackOfAmountFromOreDict("dustLithiumCarbonate", 10), - FluidUtils.getFluidStack("hydrofluoricacid", 10 * 144), - ItemUtils.getItemStackOfAmountFromOreDict("dustLithiumFluoride", 10), null, null, new int[] {}, 90 * 20, - 500); + GT_Values.RA.addChemicalBathRecipe( + FLUORIDES.FLUORITE.getCrushed(2), + FluidUtils.getFluidStack("hydrogen", 2000), + FLUORIDES.FLUORITE.getCrushedPurified(8), + FLUORIDES.FLUORITE.getDustImpure(4), + FLUORIDES.FLUORITE.getDustPurified(2), + new int[] { 10000, 5000, 1000 }, + 30 * 20, + 240); + } - private static void centrifugeRecipes() { - - //Process Used Fuel Rods for Krypton - - //Uranium - GT_Values.RA.addCentrifugeRecipe( - CI.getNumberedCircuit(20), - ItemUtils.getItemStackFromFQRN("IC2:reactorUraniumSimpledepleted", 8), - GT_Values.NF, - ELEMENT.getInstance().KRYPTON.getFluid(60), - ItemList.IC2_Fuel_Rod_Empty.get(8), - ELEMENT.getInstance().URANIUM238.getDust(2), - ELEMENT.getInstance().URANIUM232.getSmallDust(1), - ELEMENT.getInstance().URANIUM233.getSmallDust(1), - ELEMENT.getInstance().URANIUM235.getSmallDust(1), - ELEMENT.getInstance().PLUTONIUM239.getTinyDust(1), - new int[] { 0, 0, 1000, 1000, 1000, 500 }, 500 * 20, 4000); - //Mox - GT_Values.RA.addCentrifugeRecipe( - CI.getNumberedCircuit(20), - ItemUtils.getItemStackFromFQRN("IC2:reactorMOXSimpledepleted", 8), - GT_Values.NF, - ELEMENT.getInstance().KRYPTON.getFluid(90), - ItemList.IC2_Fuel_Rod_Empty.get(8), - ELEMENT.getInstance().PLUTONIUM244.getDust(2), - ELEMENT.getInstance().PLUTONIUM241.getTinyDust(1), - ELEMENT.getInstance().PLUTONIUM239.getTinyDust(1), - ELEMENT.getInstance().PLUTONIUM238.getTinyDust(1), - ELEMENT.getInstance().PLUTONIUM239.getTinyDust(1), - new int[] { 0, 0, 500, 500, 500, 500 }, 750 * 20, 4000); - - //Thorium - GT_Values.RA.addCentrifugeRecipe( - CI.getNumberedCircuit(20), - ItemList.Depleted_Thorium_1.get(8), - GT_Values.NF, - ELEMENT.getInstance().KRYPTON.getFluid(30), - ItemList.IC2_Fuel_Rod_Empty.get(8), - ELEMENT.getInstance().THORIUM.getDust(2), - ELEMENT.getInstance().THORIUM232.getDust(1), - ELEMENT.getInstance().LUTETIUM.getSmallDust(1), - ELEMENT.getInstance().POLONIUM.getSmallDust(1), - ELEMENT.getInstance().THALLIUM.getTinyDust(1), - new int[] { 0, 0, 5000, 5000, 5000, 2500 }, 250 * 20, 4000); - - - + private static void centrifugeRecipes() { + } private static void mixerRecipes() { - GT_Values.RA.addMixerRecipe(ItemUtils.getItemStackOfAmountFromOreDict("dustSulfur", 1), null, null, null, - FluidUtils.getFluidStack("oxygen", 288), FluidUtils.getFluidStack("sulfurdioxide", 432), null, 600, 60); - GT_Values.RA.addMixerRecipe(ItemUtils.getItemStackOfAmountFromOreDict("dustUranium233", 4), - ItemUtils.getItemStackOfAmountFromOreDict("dustUranium235", 1), null, null, - FluidUtils.getFluidStack("hydrofluoricacid", 144 * 5), - FluidUtils.getFluidStack("molten.uraniumtetrafluoride", 144 * 5), null, 3000, 500); - /*GT_Values.RA.addMixerRecipe( - ItemUtils.getItemStackOfAmountFromOreDict("cellMercury", 1), - ItemUtils.getItemStackOfAmountFromOreDict("dustBarium", 2), - ItemUtils.getItemStackOfAmountFromOreDict("dustCalcium", 2), - ItemUtils.getItemStackOfAmountFromOreDict("dustCopper", 3), + + GT_Values.RA.addMixerRecipe( + ItemUtils.getItemStackOfAmountFromOreDict("dustSulfur", 1), + null, + null, null, - ALLOY.HG1223.getFluid(144*16), - CI.emptyCells(1), - 30 * 20, - 500);*/ + FluidUtils.getFluidStack("oxygen", 2000), + FluidUtils.getFluidStack("sulfurdioxide", 3000), + null, + 600, + 60); + } private static void chemicalReactorRecipes() { - GT_Values.RA.addChemicalRecipe(ItemUtils.getItemStackOfAmountFromOreDict("dustLithiumCarbonate", 5), // Input - ItemUtils.getItemStackOfAmountFromOreDict("dustCalciumHydroxide", 5), // Input - null, // Fluid Input - null, // Fluid Output - ItemUtils.getItemStackOfAmountFromOreDict("dustLi2CO3CaOH2", 10), // Output - // Stack - 600 * 20); - - GT_Values.RA.addChemicalRecipe(ItemUtils.getItemStackOfAmountFromOreDict("dustLithiumHydroxide", 5), // Input - null, // Input Stack 2 - FluidUtils.getFluidStack("hydrofluoricacid", 5 * 144), // Fluid - // Input - FluidUtils.getFluidStack("water", 5 * 144), // Fluid Output - ItemUtils.getItemStackOfAmountFromOreDict("dustLithiumFluoride", 5), // Output - // Stack - 600 * 20); - - GT_Values.RA.addChemicalRecipe(ItemUtils.getItemStackOfAmountFromOreDict("dustApatite", 16), null, - FluidUtils.getFluidStack("sulfuricacid", 144 * 32), - FluidUtils.getFluidStack("sulfuricapatite", 144 * 8), - ItemUtils.getItemStackOfAmountFromOreDict("dustSmallSulfur", 1), 20 * 20); - - GT_Values.RA.addChemicalRecipe(ItemUtils.getItemStackOfAmountFromOreDict("dustLithium7", 1), null, - FluidUtils.getFluidStack("sulfuricacid", 144 * 8), FluidUtils.getFluidStack("sulfuriclithium", 144 * 2), - ItemUtils.getItemStackOfAmountFromOreDict("dustSmallLithium7", 1), 20 * 20); - - GT_Values.RA.addChemicalRecipe(ItemUtils.getItemStackOfAmountFromOreDict("cellOxygen", 1), - ItemUtils.getItemStackOfAmountFromOreDict("dustLithium7", 16), FluidUtils.getFluidStack("water", 1000), - FluidUtils.getFluidStack("lithiumhydroxide", 144 * 4), - CI.emptyCells(1), 300 * 20); - + //Bombs GT_Values.RA.addChemicalRecipe( ItemUtils.getSimpleStack(ModItems.itemBombCasing, 4), @@ -2191,60 +1784,15 @@ public class RECIPES_GREGTECH { FluidUtils.getFluidStack(RocketFuels.Kerosene, 100), null, ItemUtils.getSimpleStack(ModItems.itemBomb, 4), - 10 * 20); - - - // LFTR Fuel Related Compounds - if (GTNH) { - // Hydroxide - AddGregtechRecipe.addChemicalRecipeForBasicMachineOnly( - ItemUtils.getItemStackOfAmountFromOreDict("cellOxygen", 1), - ItemUtils.getItemStackOfAmountFromOreDict("cellHydrogen", 1), GT_Values.NF, - FluidUtils.getFluidStack("hydroxide", 2000), - CI.emptyCells(2), GT_Values.NI, 8 * 20, 30); - // Beryllium Hydroxide - GT_Values.RA.addChemicalRecipe(ItemUtils.getItemStackOfAmountFromOreDict("dustBeryllium", 7), - ItemUtils.getGregtechCircuit(3), FluidUtils.getFluidStack("hydroxide", 1000), - FluidUtils.getFluidStack("berylliumhydroxide", 2000), GT_Values.NI, 8 * 20); - // Ammonium Bifluoride - GT_Values.RA.addChemicalRecipe(ItemUtils.getItemStackOfAmountFromOreDict("cellHydrofluoricAcid", 1), - ItemUtils.getGregtechCircuit(3), FluidUtils.getFluidStack("ammonium", 1000), - FluidUtils.getFluidStack("ammoniumbifluoride", 2000), - CI.emptyCells(1), 26 * 20); - // Ammonium - AddGregtechRecipe.addChemicalRecipeForBasicMachineOnly( - ItemUtils.getItemStackOfAmountFromOreDict("cellAmmonia", 1), - ItemUtils.getItemStackOfAmountFromOreDict("cellHydrogen", 1), GT_Values.NF, - FluidUtils.getFluidStack("ammonium", 2000), - CI.emptyCells(2), GT_Values.NI, 20 * 20, 30); - } - - if (!GTNH) { - // Hydroxide - GT_Values.RA.addChemicalRecipe(ItemUtils.getItemStackOfAmountFromOreDict("cellOxygen", 1), - ItemUtils.getItemStackOfAmountFromOreDict("cellHydrogen", 1), GT_Values.NF, - FluidUtils.getFluidStack("hydroxide", 2000), - CI.emptyCells(2), 8 * 20); - // Ammonia (moved to GTNH core mod) - GT_Values.RA.addChemicalRecipe(ItemUtils.getItemStackOfAmountFromOreDict("cellHydrogen", 3), - ItemUtils.getItemStackOfAmountFromOreDict("dustMagnetite", 0), - FluidUtils.getFluidStack("nitrogen", 1000), FluidUtils.getFluidStack("ammonia", 1000), - CI.emptyCells(3), 14 * 20); - // Beryllium Hydroxide - GT_Values.RA.addChemicalRecipe(ItemUtils.getItemStackOfAmountFromOreDict("dustBeryllium", 7), GT_Values.NI, - FluidUtils.getFluidStack("hydroxide", 1000), FluidUtils.getFluidStack("berylliumhydroxide", 2000), - GT_Values.NI, 8 * 20); - // Ammonium Bifluoride - GT_Values.RA.addChemicalRecipe(ItemUtils.getItemStackOfAmountFromOreDict("cellHydrofluoricAcid", 1), - GT_Values.NI, FluidUtils.getFluidStack("ammonium", 1000), - FluidUtils.getFluidStack("ammoniumbifluoride", 2000), - CI.emptyCells(1), 26 * 20); - // Ammonium - GT_Values.RA.addChemicalRecipe(ItemUtils.getItemStackOfAmountFromOreDict("cellAmmonia", 1), - ItemUtils.getItemStackOfAmountFromOreDict("cellHydrogen", 1), GT_Values.NF, - FluidUtils.getFluidStack("ammonium", 2000), - CI.emptyCells(2), 20 * 20); - } + 10 * 20); + + GT_Values.RA.addChemicalRecipe( + ItemUtils.getItemStackOfAmountFromOreDict("dustApatite", 16), + null, + FluidUtils.getFluidStack("sulfuricacid", 144 * 32), + FluidUtils.getFluidStack("sulfuricapatite", 144 * 8), + ItemUtils.getItemStackOfAmountFromOreDict("dustSmallSulfur", 1), + 20 * 20); ItemStack temp_GT5u_SA = ItemUtils.getItemStackOfAmountFromOreDictNoBroken("cellHydrofluoricAcid_GT5U", 5); if (temp_GT5u_SA != null) { @@ -2258,14 +1806,6 @@ public class RECIPES_GREGTECH { 2 * 20); } - - //Technetium - GT_Values.RA.addChemicalRecipe(ItemUtils.getItemStackOfAmountFromOreDict("dustTechnetium99", 1), null, - FluidUtils.getFluidStack("sulfuricacid", 1000), FluidUtils.getFluidStack("sulfuricacid", 144 * 2), - ItemUtils.getItemStackOfAmountFromOreDict("dustTechnetium", 1), 100 * 20); - - - } private static void blastFurnaceRecipes() { @@ -2274,20 +1814,14 @@ public class RECIPES_GREGTECH { //ItemStack aInput1, ItemStack aInput2, //FluidStack aFluidInput, FluidStack aFluidOutput, //ItemStack aOutput1, ItemStack aOutput2, - //int aDuration, int aEUt, int aLevel) - - GT_Values.RA.addBlastRecipe(ItemUtils.getItemStackOfAmountFromOreDict("dustLithiumFluoride", 2), - ItemUtils.getItemStackOfAmountFromOreDict("dustBerylliumFluoride", 1), GT_Values.NF, GT_Values.NF, - ItemUtils.getItemStackOfAmountFromOreDict("dustLi2BeF4", 3), null, 60 * 20, 2000, 3000); - GT_Values.RA.addBlastRecipe(ItemUtils.getItemStackOfAmountFromOreDict("dustZrCl4", 1), null, GT_Values.NF, - GT_Values.NF, ItemUtils.getItemStackOfAmountFromOreDict("dustCookedZrCl4", 1), null, 60 * 20, 340, 300); + //int aDuration, int aEUt, int aLevel) //Synthetic Graphite GT_Values.RA.addBlastRecipe( CI.getNumberedCircuit(22), ALLOY.SILICON_CARBIDE.getDust(16), - ELEMENT.getInstance().NITROGEN.getFluid(4000), + ELEMENT.getInstance().NITROGEN.getFluidStack(4000), GT_Values.NF, ItemUtils.getItemStackOfAmountFromOreDict("dustGraphite", 8), ItemUtils.getItemStackOfAmountFromOreDict("dustSmallSilicon", 8), @@ -2299,7 +1833,7 @@ public class RECIPES_GREGTECH { GT_Values.RA.addBlastRecipe( GregtechItemList.Bomb_Cast.get(4), ALLOY.STEEL.getDust(16), - ELEMENT.getInstance().OXYGEN.getFluid(2000), + ELEMENT.getInstance().OXYGEN.getFluidStack(2000), GT_Values.NF, GregtechItemList.Bomb_Cast_Molten.get(4), null, @@ -2324,9 +1858,7 @@ public class RECIPES_GREGTECH { } private static void autoclaveRecipes() { - GT_Values.RA.addAutoclaveRecipe(ItemUtils.getItemStackOfAmountFromOreDict("dustZirconium", 9), - FluidUtils.getFluidStack("chlorine", 9 * 4 * 144), - ItemUtils.getItemStackOfAmountFromOreDict("pelletZirconium", 9), 0, 120 * 20, 30); + } private static void benderRecipes() { @@ -2349,9 +1881,7 @@ public class RECIPES_GREGTECH { } private static void macerationRecipes() { - GT_ModHandler.addPulverisationRecipe(ItemUtils.getItemStackOfAmountFromOreDict("pelletZirconium", 1), - ItemUtils.getItemStackOfAmountFromOreDict("dustZrCl4", 1)); - + GT_ModHandler.addPulverisationRecipe(ItemUtils.getItemStackOfAmountFromOreDict("blockMeatRaw", 1), ItemUtils.getItemStackOfAmountFromOreDict("dustMeatRaw", 9)); @@ -2690,91 +2220,12 @@ public class RECIPES_GREGTECH { } - private static void sifterRecipes() { - - // Zirconium - GT_Values.RA.addSifterRecipe(ItemUtils.getItemStackOfAmountFromOreDict("crushedPurifiedIlmenite", 1), - new ItemStack[] { ItemUtils.getItemStackOfAmountFromOreDict("dustIron", 1), - ItemUtils.getItemStackOfAmountFromOreDict("dustTinyWroughtIron", 1), - ItemUtils.getItemStackOfAmountFromOreDict("dustZirconium", 1), - ItemUtils.getItemStackOfAmountFromOreDict("dustZirconium", 1), - ItemUtils.getItemStackOfAmountFromOreDict("dustHafnium", 1), - ItemUtils.getItemStackOfAmountFromOreDict("dustHafnium", 1) }, - new int[] { 5000, 2500, 1000, 1000, 300, 300 }, 20 * 30, 500); - - // Zirconium - GT_Values.RA.addSifterRecipe(ItemUtils.getItemStackOfAmountFromOreDict("crushedPurifiedTin", 1), - new ItemStack[] { ItemUtils.getItemStackOfAmountFromOreDict("dustTin", 1), - ItemUtils.getItemStackOfAmountFromOreDict("dustTinyZinc", 1), - ItemUtils.getItemStackOfAmountFromOreDict("dustZirconium", 1), - ItemUtils.getItemStackOfAmountFromOreDict("dustZirconium", 1), - ItemUtils.getItemStackOfAmountFromOreDict("dustZirconium", 1), - ItemUtils.getItemStackOfAmountFromOreDict("dustZirconium", 1) }, - new int[] { 10000, 5000, 1500, 1000, 500, 500 }, 20 * 30, 500); - - // Zirconium - GT_Values.RA.addSifterRecipe(ItemUtils.getItemStackOfAmountFromOreDict("crushedPurifiedCassiterite", 1), - new ItemStack[] { ItemUtils.getItemStackOfAmountFromOreDict("dustCassiterite", 1), - ItemUtils.getItemStackOfAmountFromOreDict("dustTinyTin", 1), - ItemUtils.getItemStackOfAmountFromOreDict("dustZirconium", 1), - ItemUtils.getItemStackOfAmountFromOreDict("dustZirconium", 1), - ItemUtils.getItemStackOfAmountFromOreDict("dustZirconium", 1), - ItemUtils.getItemStackOfAmountFromOreDict("dustZirconium", 1) }, - new int[] { 10000, 5000, 1500, 1000, 500, 500 }, 20 * 30, 500); - - // Radium - GT_Values.RA.addSifterRecipe(ItemUtils.getItemStackOfAmountFromOreDict("crushedPurifiedUranium", 1), - new ItemStack[] { ItemUtils.getItemStackOfAmountFromOreDict("dustUranium", 1), - ItemUtils.getItemStackOfAmountFromOreDict("dustTinyLead", 1), - ItemUtils.getItemStackOfAmountFromOreDict("dustRadium226", 1), - ItemUtils.getItemStackOfAmountFromOreDict("dustRadium226", 1), - ItemUtils.getItemStackOfAmountFromOreDict("dustRadium226", 1), - ItemUtils.getItemStackOfAmountFromOreDict("dustRadium226", 1) }, - new int[] { 10000, 5000, 1000, 500, 500, 500 }, 20 * 30, 500); - // Radium - GT_Values.RA.addSifterRecipe(ItemUtils.getItemStackOfAmountFromOreDict("crushedPurifiedUraninite", 1), - new ItemStack[] { ItemUtils.getItemStackOfAmountFromOreDict("dustUraninite", 1), - ItemUtils.getItemStackOfAmountFromOreDict("dustTinyUranium", 1), - ItemUtils.getItemStackOfAmountFromOreDict("dustRadium226", 1), - ItemUtils.getItemStackOfAmountFromOreDict("dustRadium226", 1), - ItemUtils.getItemStackOfAmountFromOreDict("dustRadium226", 1), - ItemUtils.getItemStackOfAmountFromOreDict("dustRadium226", 1) }, - new int[] { 10000, 5000, 500, 250, 250, 250 }, 20 * 30, 500); - // Radium - GT_Values.RA.addSifterRecipe(ItemUtils.getItemStackOfAmountFromOreDict("crushedPurifiedPitchblende", 1), - new ItemStack[] { ItemUtils.getItemStackOfAmountFromOreDict("dustPitchblende", 1), - ItemUtils.getItemStackOfAmountFromOreDict("dustTinyLead", 1), - ItemUtils.getItemStackOfAmountFromOreDict("dustRadium226", 1), - ItemUtils.getItemStackOfAmountFromOreDict("dustRadium226", 1), - ItemUtils.getItemStackOfAmountFromOreDict("dustRadium226", 1), - ItemUtils.getItemStackOfAmountFromOreDict("dustRadium226", 1) }, - new int[] { 10000, 5000, 500, 250, 250, 250 }, 20 * 30, 500); + private static void sifterRecipes() { + } private static void electroMagneticSeperatorRecipes() { - // Zirconium - GT_Values.RA.addElectromagneticSeparatorRecipe( - ItemUtils.getItemStackOfAmountFromOreDict("crushedPurifiedBauxite", 1), - ItemUtils.getItemStackOfAmountFromOreDict("dustBauxite", 1), - ItemUtils.getItemStackOfAmountFromOreDict("dustSmallRutile", 1), - ItemUtils.getItemStackOfAmountFromOreDict("nuggetZirconium", 1), new int[] { 10000, 2500, 4000 }, - 20 * 20, 24); - // Zircon - GT_Values.RA.addElectromagneticSeparatorRecipe( - ItemUtils.getItemStackOfAmountFromOreDict("crushedPurifiedMagnetite", 1), - ItemUtils.getItemStackOfAmountFromOreDict("dustMagnetite", 1), - ItemUtils.getItemStackOfAmountFromOreDict("dustSmallZircon", 1), - ItemUtils.getItemStackOfAmountFromOreDict("dustTinyZircon", 1), new int[] { 10000, 1250, 2500 }, - 20 * 20, 24); - GT_Values.RA.addElectromagneticSeparatorRecipe( - ItemUtils.getItemStackOfAmountFromOreDict("crushedPurifiedCassiterite", 1), - ItemUtils.getItemStackOfAmountFromOreDict("dustCassiterite", 1), - ItemUtils.getItemStackOfAmountFromOreDict("dustSmallZircon", 1), - ItemUtils.getItemStackOfAmountFromOreDict("dustTinyZircon", 1), new int[] { 10000, 1250, 2500 }, - 20 * 20, 24); - - - + if (!GTNH) { // Trinium GT_Values.RA.addElectromagneticSeparatorRecipe( @@ -2801,9 +2252,6 @@ public class RECIPES_GREGTECH { 20 * 20, 24); } - - - } private static void advancedMixerRecipes() { diff --git a/src/Java/gtPlusPlus/core/recipe/RECIPES_Machines.java b/src/Java/gtPlusPlus/core/recipe/RECIPES_Machines.java index 0a4e760a17..14001d86bd 100644 --- a/src/Java/gtPlusPlus/core/recipe/RECIPES_Machines.java +++ b/src/Java/gtPlusPlus/core/recipe/RECIPES_Machines.java @@ -10,6 +10,8 @@ import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.block.ModBlocks; import gtPlusPlus.core.item.ModItems; import gtPlusPlus.core.item.chemistry.AgriculturalChem; +import gtPlusPlus.core.item.crafting.ItemDummyResearch; +import gtPlusPlus.core.item.crafting.ItemDummyResearch.ASSEMBLY_LINE_RESEARCH; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.lib.LoadedMods; import gtPlusPlus.core.material.ALLOY; @@ -99,6 +101,14 @@ public class RECIPES_Machines { public static ItemStack RECIPE_LFTROuterCasing; public static ItemStack RECIPE_LFTRInnerCasing; + //Milling + public static ItemStack RECIPE_ISAMill_Controller; + public static ItemStack RECIPE_ISAMill_Gearbox; + public static ItemStack RECIPE_ISAMill_Casing; + public static ItemStack RECIPE_ISAMill_Hatch; + public static ItemStack RECIPE_Flotation_Controller; + public static ItemStack RECIPE_Flotation_Casing; + //Cyclotron public static ItemStack RECIPE_CyclotronController; public static ItemStack RECIPE_CyclotronOuterCasing; @@ -242,6 +252,8 @@ public class RECIPES_Machines { algaeFarm(); chemPlant(); zyngen(); + milling(); + sparging(); } @@ -263,6 +275,35 @@ public class RECIPES_Machines { } private static void chemPlant() { + + + GT_ModHandler.addCraftingRecipe( + GregtechItemList.Casing_Machine_Custom_1.get(2L, new Object[0]), + CI.bits, + new Object[]{ + "PhP", + "PFP", + "PwP", + 'P', + OrePrefixes.plate.get(Materials.Bronze), + 'F', + OrePrefixes.frameGt.get(Materials.Bronze) + } + ); + + GT_ModHandler.addCraftingRecipe( + GregtechItemList.Casing_Machine_Custom_2.get(2L, new Object[0]), + CI.bits, + new Object[]{ + "PhP", + "PFP", + "PwP", + 'P', + OrePrefixes.plate.get(Materials.Aluminium), + 'F', + OrePrefixes.frameGt.get(Materials.Aluminium) + } + ); CORE.RA.addSixSlotAssemblingRecipe( new ItemStack[] { @@ -273,7 +314,7 @@ public class RECIPES_Machines { CI.getTieredComponentOfMaterial(Materials.CobaltBrass, OrePrefixes.dust, 16), CI.getTieredComponent(OrePrefixes.frameGt, 2, 4), }, - ALLOY.STEEL.getFluid(2 * (144 * 4)), + ALLOY.STEEL.getFluidStack(2 * (144 * 4)), GregtechItemList.ChemicalPlant_Controller.get(1), 120 * 20, MaterialUtils.getVoltageForTier(2)); @@ -288,7 +329,7 @@ public class RECIPES_Machines { CI.getTieredComponentOfMaterial(Materials.Lead, OrePrefixes.plate, 48), CI.getTieredComponentOfMaterial(Materials.SolderingAlloy, OrePrefixes.wireFine, 16), }, - ALLOY.BRONZE.getFluid(2 * (144 * 4)), + ALLOY.BRONZE.getFluidStack(2 * (144 * 4)), GregtechItemList.Bus_Catalysts.get(1), 60 * 20, MaterialUtils.getVoltageForTier(2)); @@ -316,7 +357,7 @@ public class RECIPES_Machines { CI.getTieredComponentOfMaterial(Materials.Bronze, OrePrefixes.bolt, 16), CI.getTieredComponentOfMaterial(Materials.Redstone, OrePrefixes.dust, 32), }, - ALLOY.POTIN.getFluid(2 * (144 * 4)), + ALLOY.POTIN.getFluidStack(2 * (144 * 4)), GregtechItemList.AlgaeFarm_Controller.get(1), 60 * 20, MaterialUtils.getVoltageForTier(1)); @@ -334,10 +375,10 @@ public class RECIPES_Machines { CI.getTieredComponent(OrePrefixes.circuit, 6, 8) }, new FluidStack[] { - ALLOY.AQUATIC_STEEL.getFluid(144 * 32), - ALLOY.BABBIT_ALLOY.getFluid(144 * 16), - ALLOY.BRONZE.getFluid(144 * 64), - ALLOY.KANTHAL.getFluid(144 * 16), + ALLOY.AQUATIC_STEEL.getFluidStack(144 * 32), + ALLOY.BABBIT_ALLOY.getFluidStack(144 * 16), + ALLOY.BRONZE.getFluidStack(144 * 64), + ALLOY.KANTHAL.getFluidStack(144 * 16), }, new ItemStack[] { GregtechItemList.Machine_Adv_DistillationTower.get(1) @@ -374,7 +415,7 @@ public class RECIPES_Machines { CI.getTransmissionComponent(i - 1, 8), CI.getTieredComponent(OrePrefixes.cableGt08, i, 16) }, - ALLOY.EGLIN_STEEL.getFluid(i * (144 * 4)), + ALLOY.EGLIN_STEEL.getFluidStack(i * (144 * 4)), aOutputs[aIndex++].copy(), 300 * 20, MaterialUtils.getVoltageForTier(i)); @@ -514,7 +555,7 @@ public class RECIPES_Machines { CI.machineHull_IV, ItemUtils.getItemStackOfAmountFromOreDict(CI.getTieredCircuitOreDictName(7), 2) }, - ELEMENT.getInstance().TANTALUM.getFluid(144 * 16), + ELEMENT.getInstance().TANTALUM.getFluidStack(144 * 16), GregtechItemList.Gregtech_Computer_Cube.get(1), 60 * 20 * 3, 8000); @@ -528,7 +569,7 @@ public class RECIPES_Machines { ItemUtils.getItemStackOfAmountFromOreDict(CI.getTieredCircuitOreDictName(1), 2), ItemUtils.getItemStackOfAmountFromOreDict(CI.getTieredCircuitOreDictName(2), 2) }, - ELEMENT.getInstance().IRON.getFluid(144 * 4), + ELEMENT.getInstance().IRON.getFluidStack(144 * 4), ItemUtils.getSimpleStack(ModBlocks.blockCircuitProgrammer), 60 * 10 * 1, 30); @@ -541,7 +582,7 @@ public class RECIPES_Machines { ItemUtils.getItemStackOfAmountFromOreDict("plateDenseLead", 9), ItemUtils.getSimpleStack(Blocks.chest) }, - ELEMENT.getInstance().LEAD.getFluid(144 * 16), + ELEMENT.getInstance().LEAD.getFluidStack(144 * 16), ItemUtils.getSimpleStack(ModBlocks.blockDecayablesChest), 60 * 10 * 3, 60); @@ -556,7 +597,7 @@ public class RECIPES_Machines { ItemUtils.getItemStackOfAmountFromOreDict("wireFinePlatinum", GTNH ? 64 : 32), ItemUtils.getItemStackOfAmountFromOreDict(CI.getTieredCircuitOreDictName(GTNH ? 7 : 6), GTNH ? 5 : 4) }, - ALLOY.NIOBIUM_CARBIDE.getFluid(144 * 16), + ALLOY.NIOBIUM_CARBIDE.getFluidStack(144 * 16), GregtechItemList.RTG.get(1), 60 * 20 * 10, 8000); @@ -569,7 +610,7 @@ public class RECIPES_Machines { ItemUtils.getItemStackOfAmountFromOreDict("plateTumbaga", 8), ItemUtils.getSimpleStack(Blocks.jukebox) }, - ELEMENT.getInstance().COPPER.getFluid(144 * 2), + ELEMENT.getInstance().COPPER.getFluidStack(144 * 2), ItemUtils.getSimpleStack(ModBlocks.blockCustomJukebox), 20 * 30, 30); @@ -586,7 +627,7 @@ public class RECIPES_Machines { ALLOY.EGLIN_STEEL.getPlate(GTNH ? 8 : 4), ALLOY.POTIN.getScrew(GTNH ? 12 : 6) }, - ALLOY.TUMBAGA.getFluid(144 * 4), + ALLOY.TUMBAGA.getFluidStack(144 * 4), ItemUtils.getSimpleStack(ModBlocks.blockPooCollector), 20 * 60, 30); @@ -1020,9 +1061,9 @@ public class RECIPES_Machines { CI.getGear(3, GTNH ? 4 : 2) }; FluidStack[] aSemiFluidFluidInputs = new FluidStack[] { - ALLOY.BRONZE.getFluid(144 * 8), - ALLOY.STEEL.getFluid(144 * 8), - ELEMENT.getInstance().ALUMINIUM.getFluid(144 * 8), + ALLOY.BRONZE.getFluidStack(144 * 8), + ALLOY.STEEL.getFluidStack(144 * 8), + ELEMENT.getInstance().ALUMINIUM.getFluidStack(144 * 8), }; //ItemUtils.simpleMetaStack("IC2:blockGenerator:7", 7, 1); @@ -1383,18 +1424,18 @@ public class RECIPES_Machines { RecipeUtils.addShapedGregtechRecipe( controlCircuit, "cableGt12NaquadahAlloy", controlCircuit, "plateDoubleHastelloyN", GregtechItemList.Gregtech_Computer_Cube.get(1), "plateDoubleHastelloyN", - "plateThorium232", CI.machineHull_UV, "plateThorium232", + "plateThorium232", CI.machineHull_EV, "plateThorium232", RECIPE_LFTRController); } else { RecipeUtils.addShapedGregtechRecipe( controlCircuit, "cableGt12NaquadahAlloy", controlCircuit, "plateDoubleHastelloyN", GregtechItemList.Gregtech_Computer_Cube.get(1), "plateDoubleHastelloyN", - "plateThorium232", CI.machineHull_LuV, "plateThorium232", + "plateThorium232", CI.machineHull_IV, "plateThorium232", RECIPE_LFTRController); } RecipeUtils.addShapedGregtechRecipe( "plateDoubleZeron100", CI.craftingToolScrewdriver, "plateDoubleZeron100", - "gearGtTalonite", CI.fieldGenerator_ULV, "gearGtTalonite", + "gearGtTalonite", CI.fieldGenerator_MV, "gearGtTalonite", "plateDoubleZeron100", CI.craftingToolHammer_Hard, "plateDoubleZeron100", RECIPE_LFTRInnerCasing); @@ -1412,9 +1453,9 @@ public class RECIPES_Machines { //Fission Fuel Plant RecipeUtils.addShapedGregtechRecipe( - CI.getTieredCircuit(5), CI.craftingToolSolderingIron, CI.getTieredCircuit(5), + CI.getTieredCircuitOreDictName(5), CI.craftingToolSolderingIron, CI.getTieredCircuitOreDictName(5), "plateDenseTungstenSteel", GregtechItemList.Gregtech_Computer_Cube.get(1), "plateDenseTungstenSteel", - "gearGtStellite", CI.machineHull_LuV, "gearGtStellite", + "gearGtStellite", CI.machineHull_IV, "gearGtStellite", GregtechItemList.Industrial_FuelRefinery.get(1)); ItemStack mInnerTank; @@ -1445,7 +1486,30 @@ public class RECIPES_Machines { "ringInconel792", "gearGtHastelloyX", CI.component_Plate[5], CI.craftingToolHammer_Hard, "frameGtHastelloyC276", CI.craftingToolWrench, CI.component_Plate[5], CI.getTieredMachineCasing(4), "ringInconel792", - GregtechItemList.Casing_Refinery_Structural.get(Casing_Amount)); + GregtechItemList.Casing_Refinery_Structural.get(Casing_Amount)); + + RecipeUtils.addShapedGregtechRecipe( + CI.getPlate(5, 1), ALLOY.HASTELLOY_X.getPlateDouble(1), CI.getPlate(5, 1), + CI.getPlate(5, 1), CI.getTieredMachineCasing(5), CI.getPlate(5, 1), + CI.getRobotArm(5, 1), ItemList.Casing_FrostProof.get(1), CI.getRobotArm(5, 1), + GregtechItemList.ColdTrap_IV.get(1)); + RecipeUtils.addShapedGregtechRecipe( + CI.getPlate(7, 1), ALLOY.HS188A.getPlateDouble(1), CI.getPlate(7, 1), + CI.getPlate(7, 1), GregtechItemList.ColdTrap_IV.get(1), CI.getPlate(7, 1), + CI.getRobotArm(7, 1), ItemList.Casing_FrostProof.get(1), CI.getRobotArm(7, 1), + GregtechItemList.ColdTrap_ZPM.get(1)); + + RecipeUtils.addShapedGregtechRecipe( + CI.getFieldGenerator(3, 1), CI.getRobotArm(5, 1), CI.getPlate(5, 1), + ALLOY.HASTELLOY_N.getPlateDouble(1), ItemList.Machine_IV_ChemicalReactor.get(1), ALLOY.HASTELLOY_N.getPlateDouble(1), + CI.getPlate(5, 1), ALLOY.HASTELLOY_N.getPlateDouble(1), CI.getFieldGenerator(3, 1), + GregtechItemList.ReactorProcessingUnit_IV.get(1)); + RecipeUtils.addShapedGregtechRecipe( + CI.getFieldGenerator(5, 1), CI.getRobotArm(7, 1), CI.getPlate(7, 1), + ALLOY.HS188A.getPlateDouble(1), GregtechItemList.ReactorProcessingUnit_IV.get(1), ALLOY.HS188A.getPlateDouble(1), + CI.getPlate(7, 1), ALLOY.HS188A.getPlateDouble(1), CI.getFieldGenerator(5, 1), + GregtechItemList.ReactorProcessingUnit_ZPM.get(1)); + } //Shelves @@ -1478,7 +1542,7 @@ public class RECIPES_Machines { ALLOY.EGLIN_STEEL.getLongRod(GTNH ? 16 : 4), CI.getElectricPiston(3, GTNH ? 4 : 2) }, - ALLOY.ZIRCONIUM_CARBIDE.getFluid(144 * 8), //Input Fluid + ALLOY.ZIRCONIUM_CARBIDE.getFluidStack(144 * 8), //Input Fluid RECIPE_CyclotronOuterCasing, 30 * 20 * 2, MaterialUtils.getVoltageForTier(4)); @@ -1494,7 +1558,7 @@ public class RECIPES_Machines { ALLOY.INCOLOY_020.getScrew(GTNH ? 64 : 32), CI.getFieldGenerator(4, GTNH ? 2 : 1) }, - ALLOY.HG1223.getFluid(144 * 5), //Input Fluid + ALLOY.HG1223.getFluidStack(144 * 5), //Input Fluid RECIPE_CyclotronInnerCoil, 60 * 20 * 2, MaterialUtils.getVoltageForTier(5)); @@ -1510,7 +1574,7 @@ public class RECIPES_Machines { ALLOY.INCOLOY_MA956.getScrew(GTNH ? 64 : 16), ItemUtils.getItemStackOfAmountFromOreDict(CI.getTieredCircuitOreDictName(GTNH ? 6 : 5), GTNH ? 8 : 16) }, - ALLOY.INCOLOY_020.getFluid(144 * 9), //Input Fluid + ALLOY.INCOLOY_020.getFluidStack(144 * 9), //Input Fluid RECIPE_CyclotronController, 60 * 20 * 5, MaterialUtils.getVoltageForTier(5)); @@ -1806,9 +1870,9 @@ public class RECIPES_Machines { CORE.RA.addAssemblylineRecipe( ItemList.FusionComputer_UV.get(1), (int) GT_Values.V[5], - new ItemStack[] { - ItemUtils.getItemStackOfAmountFromOreDict(CI.getTieredCircuitOreDictName(9), 4 * (GTNH ? 2 : 1)), - ItemUtils.getItemStackOfAmountFromOreDict(CI.getTieredCircuitOreDictName(7), 32 * (GTNH ? 2 : 1)), + new Object[] { + new Object[] {CI.getTieredCircuitOreDictName(9), 4 * (GTNH ? 2 : 1)}, + new Object[] {CI.getTieredCircuitOreDictName(7), 32 * (GTNH ? 2 : 1)}, ItemUtils.getItemStackOfAmountFromOreDict("wireGt16Superconductor", 8 * (GTNH ? 4 : 2)), ItemUtils.getItemStackOfAmountFromOreDict("plateDenseNeutronium", 2 * (GTNH ? 4 : 1)), ItemUtils.getSimpleStack((GTNH ? CI.fieldGenerator_MAX : CI.fieldGenerator_ZPM), 5), @@ -1817,8 +1881,8 @@ public class RECIPES_Machines { GregtechItemList.Casing_Fusion_Internal.get(1) }, new FluidStack[] { - ALLOY.PIKYONIUM.getFluid(32 * 144 * (GTNH ? 2 : 1)), - ALLOY.HG1223.getFluid(64 * 144) + ALLOY.PIKYONIUM.getFluidStack(32 * 144 * (GTNH ? 2 : 1)), + ALLOY.HG1223.getFluidStack(64 * 144) }, GregtechItemList.FusionComputer_UV2.get(1), (int) GT_Values.V[6], @@ -1828,9 +1892,9 @@ public class RECIPES_Machines { CORE.RA.addAssemblylineRecipe( ItemList.Casing_Fusion2.get(1), (int) GT_Values.V[4], - new ItemStack[] { - ItemUtils.getItemStackOfAmountFromOreDict(CI.getTieredCircuitOreDictName(5), 8 * (GTNH ? 2 : 1)), - ItemUtils.getItemStackOfAmountFromOreDict(CI.getTieredCircuitOreDictName(4), 16 * (GTNH ? 2 : 1)), + new Object[] { + new Object[] {CI.getTieredCircuitOreDictName(5), 8 * (GTNH ? 2 : 1)}, + new Object[] {CI.getTieredCircuitOreDictName(4), 16 * (GTNH ? 2 : 1)}, ItemUtils.getItemStackOfAmountFromOreDict("blockTungstenCarbide", 4 * (GTNH ? 2 : 1)), ItemUtils.getItemStackOfAmountFromOreDict("plateNeutronium", 2 * (GTNH ? 2 : 1)), ItemUtils.getSimpleStack((GTNH ? CI.electricMotor_MAX : CI.electricMotor_ZPM), 3 * (GTNH ? 2 : 1)), @@ -1840,7 +1904,7 @@ public class RECIPES_Machines { }, new FluidStack[] { Materials.NaquadahAlloy.getMolten(576 * (GTNH ? 2 : 1)), - ALLOY.ZERON_100.getFluid(16 * 144) + ALLOY.ZERON_100.getFluidStack(16 * 144) }, GregtechItemList.Casing_Fusion_External.get(1), (int) GT_Values.V[5], @@ -1850,20 +1914,20 @@ public class RECIPES_Machines { CORE.RA.addAssemblylineRecipe( ItemList.Casing_Fusion_Coil.get(1), (int) GT_Values.V[4], - new ItemStack[] { - ItemUtils.getItemStackOfAmountFromOreDict(CI.getTieredCircuitOreDictName(8), 4 * (GTNH ? 2 : 1)), - ItemUtils.getItemStackOfAmountFromOreDict(CI.getTieredCircuitOreDictName(6), 8 * (GTNH ? 2 : 1)), + new Object[] { + new Object[] {CI.getTieredCircuitOreDictName(8), 4 * (GTNH ? 2 : 1)}, + new Object[] {CI.getTieredCircuitOreDictName(6), 8 * (GTNH ? 2 : 1)}, ItemUtils.getItemStackOfAmountFromOreDict("plateNeutronium", 2 * (GTNH ? 3 : 1)), ItemUtils.getSimpleStack((GTNH ? CI.emitter_MAX : CI.emitter_ZPM), 2 * (GTNH ? 2 : 1)), ItemUtils.getSimpleStack((GTNH ? CI.sensor_MAX : CI.sensor_ZPM), 2 * (GTNH ? 2 : 1)), ItemUtils.getSimpleStack((GTNH ? CI.fieldGenerator_MAX : CI.fieldGenerator_LuV), 2 * (GTNH ? 2 : 1)), - ItemUtils.getSimpleStack((GTNH ? ItemUtils.getItemStackOfAmountFromOreDict(CI.getTieredCircuitOreDictName(8), 8) : CI.getDataOrb()), 8 * (GTNH ? 2 : 1)), + new Object[] {CI.getTieredCircuitOreDictName(8), 8}, ItemList.Energy_LapotronicOrb2.get(2 * (GTNH ? 16 : 1)), ItemList.Casing_Fusion_Coil.get(1) }, new FluidStack[] { - ALLOY.CINOBITE.getFluid(16 * 144 * (GTNH ? 2 : 1)), - ALLOY.ABYSSAL.getFluid(64 * 144) + ALLOY.CINOBITE.getFluidStack(16 * 144 * (GTNH ? 2 : 1)), + ALLOY.ABYSSAL.getFluidStack(64 * 144) }, GregtechItemList.Casing_Fusion_Internal.get(1), (int) GT_Values.V[5], @@ -1897,7 +1961,7 @@ public class RECIPES_Machines { ALLOY.TRINIUM_REINFORCED_STEEL.getPlateDouble(4 * (GTNH ? 2 : 1)), ItemUtils.getSimpleStack((GTNH ? CI.machineHull_UV : CI.machineHull_LuV), 1 * (GTNH ? 2 : 1)), }, - ALLOY.MARAGING350.getFluid(144 * 16 * (GTNH ? 2 : 1)), + ALLOY.MARAGING350.getFluidStack(144 * 16 * (GTNH ? 2 : 1)), GregtechItemList.Casing_BedrockMiner.get(1), (int) GT_Values.V[4], (int) GT_Values.V[6]); @@ -2046,7 +2110,7 @@ public class RECIPES_Machines { ItemUtils.getItemStackFromFQRN("miscutils:item.itemBufferCore"+(GTNH ? "2" : "1"), GTNH ? 4 : 2), ItemUtils.getItemStackOfAmountFromOreDict(CI.getTieredCircuitOreDictName(GTNH ? 3 : 2), GTNH ? 10 : 5) }, - aMat_B[3].getFluid(144 * 8), //Input Fluid + aMat_B[3].getFluidStack(144 * 8), //Input Fluid GregtechItemList.Hatch_Control_Core.get(1), 60 * 20 * 5, MaterialUtils.getVoltageForTier(3)); @@ -2367,6 +2431,212 @@ public class RECIPES_Machines { 60 * 20 * 12, MaterialUtils.getVoltageForTier(7)); } + + private static void milling() { + + + /*public static ItemStack RECIPE_ISAMill_Controller; + public static ItemStack RECIPE_ISAMill_Gearbox; + public static ItemStack RECIPE_ISAMill_Casing; + public static ItemStack RECIPE_ISAMill_Hatch; + public static ItemStack RECIPE_Flotation_Controller; + public static ItemStack RECIPE_Flotation_Casing;*/ + + // Isa Mill Controller + CORE.RA.addAssemblylineRecipe( + ItemList.Machine_IV_Macerator.get(1), + 20 * 60 * 20, + new Object[] { + GregtechItemList.Casing_IsaMill_Gearbox.get(4), + CI.getTieredGTPPMachineCasing(6, 4), + ItemList.Component_Grinder_Tungsten.get(16), + new Object[] {CI.getTieredCircuitOreDictName(6), 8}, + ALLOY.INCONEL_625.getGear(8), + ALLOY.INCONEL_625.getPlate(32), + ALLOY.ZERON_100.getPlateDouble(8), + ALLOY.ZERON_100.getPlateDouble(8), + ALLOY.ZERON_100.getScrew(64), + CI.getTieredComponentOfMaterial(Materials.NiobiumTitanium, OrePrefixes.wireFine, 32), + CI.getTieredComponentOfMaterial(Materials.NiobiumTitanium, OrePrefixes.wireFine, 32), + CI.getTieredComponentOfMaterial(Materials.Titanium, OrePrefixes.foil, 16), + CI.getTieredComponentOfMaterial(Materials.Titanium, OrePrefixes.foil, 16), + + }, + new FluidStack[] { + CI.getTieredFluid(6, 16 * 144), + CI.getAlternativeTieredFluid(6, 32 * 144), + CI.getTertiaryTieredFluid(6, 32 * 144) + }, + GregtechItemList.Controller_IsaMill.get(1), + 20 * 60 * 10, + MaterialUtils.getVoltageForTier(6)); + + // Isa Mill Gearbox + CORE.RA.addSixSlotAssemblingRecipe( + new ItemStack[] { + CI.getNumberedAdvancedCircuit(7), + ItemList.Casing_Gearbox_Titanium.get(2), + ALLOY.INCONEL_625.getGear(4), + CI.getTieredComponentOfMaterial(Materials.HSSE, OrePrefixes.gearGtSmall, 8), + ALLOY.INCONEL_625.getPlate(16), + ALLOY.ZERON_100.getBolt(16), + }, + ALLOY.TUNGSTENSTEEL.getFluidStack(8 * 144), + GregtechItemList.Casing_IsaMill_Gearbox.get(1), + 60 * 20 * 2, + MaterialUtils.getVoltageForTier(6)); + + // Isa Mill Casing + CORE.RA.addSixSlotAssemblingRecipe( + new ItemStack[] { + CI.getNumberedAdvancedCircuit(7), + CI.getTieredGTPPMachineCasing(5, 1), + ALLOY.INCONEL_625.getPlate(8), + ALLOY.ZERON_100.getRod(4), + CI.getTieredComponentOfMaterial(Materials.HSSG, OrePrefixes.gearGtSmall, 4), + ALLOY.ZERON_100.getScrew(8), + }, + ELEMENT.getInstance().TITANIUM.getFluidStack(4 * 144), + GregtechItemList.Casing_IsaMill_Casing.get(1), + 60 * 20 * 2, + MaterialUtils.getVoltageForTier(6)); + + // Isa Mill Pipe + CORE.RA.addSixSlotAssemblingRecipe( + new ItemStack[] { + CI.getNumberedAdvancedCircuit(7), + CI.getTieredGTPPMachineCasing(4, 2), + ALLOY.INCONEL_625.getPlateDouble(4), + ALLOY.INCOLOY_MA956.getRing(8), + CI.getTieredComponentOfMaterial(Materials.HSSE, OrePrefixes.plate, 8), + ALLOY.INCOLOY_MA956.getBolt(16), + }, + ELEMENT.getInstance().ALUMINIUM.getFluidStack(8 * 144), + GregtechItemList.Casing_IsaMill_Pipe.get(1), + 60 * 20 * 8, + MaterialUtils.getVoltageForTier(4)); + + // Flotation Cell Controller + CORE.RA.addAssemblylineRecipe( + ItemList.Distillation_Tower.get(1), + 20 * 60 * 20, + new Object[] { + GregtechItemList.Casing_Flotation_Cell.get(4), + CI.getTieredGTPPMachineCasing(5, 4), + ItemList.Machine_IV_Distillery.get(1), + new Object[] {CI.getTieredCircuitOreDictName(6), 8}, + ALLOY.STELLITE.getGear(8), + ALLOY.STELLITE.getPlate(32), + ALLOY.HASTELLOY_N.getPlateDouble(8), + ALLOY.HASTELLOY_N.getPlateDouble(8), + ALLOY.HASTELLOY_N.getScrew(64), + CI.getTieredComponentOfMaterial(Materials.YttriumBariumCuprate, OrePrefixes.wireFine, 64), + CI.getTieredComponentOfMaterial(Materials.YttriumBariumCuprate, OrePrefixes.wireFine, 64), + CI.getTieredComponentOfMaterial(Materials.Platinum, OrePrefixes.foil, 32), + CI.getTieredComponentOfMaterial(Materials.Platinum, OrePrefixes.foil, 32), + + }, + new FluidStack[] { + CI.getTieredFluid(5, 16 * 144), + CI.getAlternativeTieredFluid(4, 32 * 144), + CI.getTertiaryTieredFluid(4, 32 * 144) + }, + GregtechItemList.Controller_Flotation_Cell.get(1), + 20 * 60 * 10, + MaterialUtils.getVoltageForTier(6)); + + // Flotation Cell Casing + CORE.RA.addSixSlotAssemblingRecipe( + new ItemStack[] { + CI.getNumberedAdvancedCircuit(7), + CI.getTieredGTPPMachineCasing(4, 1), + ALLOY.AQUATIC_STEEL.getPlate(8), + ALLOY.STELLITE.getRing(8), + CI.getTieredComponentOfMaterial(Materials.HSSG, OrePrefixes.plateDouble, 4), + ALLOY.HASTELLOY_N.getScrew(8), + }, + ALLOY.STAINLESS_STEEL.getFluidStack(8 * 144), + GregtechItemList.Casing_Flotation_Cell.get(1), + 60 * 20 * 2, + MaterialUtils.getVoltageForTier(6)); + + // Milling Bus + CORE.RA.addSixSlotAssemblingRecipe( + new ItemStack[] { + CI.getNumberedAdvancedCircuit(7), + CI.getTieredGTPPMachineCasing(5, 1), + ItemList.Hatch_Input_Bus_EV.get(1), + CI.getTieredComponentOfMaterial(Materials.Titanium, OrePrefixes.gearGt, 8), + CI.getTieredComponentOfMaterial(Materials.TungstenSteel, OrePrefixes.plate, 32), + CI.getTieredComponentOfMaterial(Materials.SolderingAlloy, OrePrefixes.wireFine, 16), + }, + ELEMENT.getInstance().TUNGSTEN.getFluidStack(8 * 144), + GregtechItemList.Bus_Milling_Balls.get(1), + 60 * 20 * 4, + MaterialUtils.getVoltageForTier(5)); + + } + + private static void sparging() { + + // Sparge Tower Research + CORE.RA.addSixSlotAssemblingRecipe( + new ItemStack[] { + CI.getNumberedAdvancedCircuit(8), + ELEMENT.getInstance().HELIUM.getCell(8), + ELEMENT.getInstance().FLUORINE.getCell(8), + ALLOY.HS188A.getIngot(8), + ItemList.Distillation_Tower.get(1) + }, + null, + ItemDummyResearch.getResearchStack(ASSEMBLY_LINE_RESEARCH.RESEARCH_10_SPARGING, 1), + 60 * 20 * 5, + MaterialUtils.getVoltageForTier(5)); + + // Sparge Tower Controller + CORE.RA.addAssemblylineRecipe( + ItemDummyResearch.getResearchStack(ASSEMBLY_LINE_RESEARCH.RESEARCH_10_SPARGING, 1), + 20 * 60 * 20, + new Object[] { + GregtechItemList.Casing_Sparge_Tower_Exterior.get(4), + CI.getTieredGTPPMachineCasing(4, 4), + ItemList.Machine_IV_Distillery.get(1), + new Object[] {CI.getTieredCircuitOreDictName(5), 8}, + ALLOY.HS188A.getGear(8), + ALLOY.HS188A.getPlate(32), + ALLOY.HASTELLOY_N.getPlateDouble(8), + ALLOY.HASTELLOY_N.getPlateDouble(8), + ALLOY.HASTELLOY_N.getScrew(64), + CI.getTieredComponentOfMaterial(Materials.YttriumBariumCuprate, OrePrefixes.wireFine, 64), + CI.getTieredComponentOfMaterial(Materials.YttriumBariumCuprate, OrePrefixes.wireFine, 64), + CI.getTieredComponentOfMaterial(Materials.Platinum, OrePrefixes.foil, 32), + CI.getTieredComponentOfMaterial(Materials.Platinum, OrePrefixes.foil, 32), + + }, + new FluidStack[] { + CI.getTieredFluid(4, 16 * 144), + CI.getAlternativeTieredFluid(3, 32 * 144), + CI.getTertiaryTieredFluid(3, 32 * 144) + }, + GregtechItemList.Controller_Sparge_Tower.get(1), + 20 * 60 * 10, + MaterialUtils.getVoltageForTier(6)); + + // Sparge Tower Casing + CORE.RA.addSixSlotAssemblingRecipe( + new ItemStack[] { + CI.getNumberedAdvancedCircuit(8), + CI.getTieredGTPPMachineCasing(3, 1), + ALLOY.HS188A.getPlate(8), + ALLOY.HASTELLOY_N.getRing(4), + CI.getTieredComponentOfMaterial(Materials.TungstenSteel, OrePrefixes.plateDouble, 4), + ALLOY.HASTELLOY_N.getScrew(4), + }, + ALLOY.STAINLESS_STEEL.getFluidStack(8 * 144), + GregtechItemList.Casing_Sparge_Tower_Exterior.get(1), + 60 * 20 * 2, + MaterialUtils.getVoltageForTier(5)); + } private static void fakeMachineCasingCovers() { GregtechItemList[] mMachineCasingCovers = new GregtechItemList[] { diff --git a/src/Java/gtPlusPlus/core/recipe/RECIPES_RareEarthProcessing.java b/src/Java/gtPlusPlus/core/recipe/RECIPES_RareEarthProcessing.java index d3c0b4c093..97636e9e65 100644 --- a/src/Java/gtPlusPlus/core/recipe/RECIPES_RareEarthProcessing.java +++ b/src/Java/gtPlusPlus/core/recipe/RECIPES_RareEarthProcessing.java @@ -51,7 +51,7 @@ public class RECIPES_RareEarthProcessing { if (mSaltWater == null) { Fluid f = SALT_WATER.generateFluid(); SALT_WATER.registerComponentForMaterial(FluidUtils.getFluidStack(f, 1000)); - mSaltWater = SALT_WATER.getFluid(1000); + mSaltWater = SALT_WATER.getFluidStack(1000); } else { SALT_WATER.registerComponentForMaterial(FluidUtils.getFluidStack(mSaltWater, 1000)); @@ -62,7 +62,7 @@ public class RECIPES_RareEarthProcessing { if (mBrine == null) { Fluid f = BRINE.generateFluid(); BRINE.registerComponentForMaterial(FluidUtils.getFluidStack(f, 1000)); - mBrine = BRINE.getFluid(1000); + mBrine = BRINE.getFluidStack(1000); } else { BRINE.registerComponentForMaterial(FluidUtils.getFluidStack(mBrine, 1000)); @@ -88,7 +88,7 @@ public class RECIPES_RareEarthProcessing { mHydrogenChloride = FluidUtils.getFluidStack("hydrogenchloride", 1000); if (mHydrogenChloride == null) { HYDROGEN_CHLORIDE.generateFluid(); - mHydrogenChloride = BRINE.getFluid(1000); + mHydrogenChloride = BRINE.getFluidStack(1000); } else { HYDROGEN_CHLORIDE.registerComponentForMaterial(FluidUtils.getFluidStack(mHydrogenChloride, 1000)); @@ -98,7 +98,7 @@ public class RECIPES_RareEarthProcessing { // Add Process for creating Brine CORE.RA.addBrewingRecipe( ItemUtils.getSimpleStack(mDustSalt, 16), - MISC_MATERIALS.SALT_WATER.getFluid(2000), + MISC_MATERIALS.SALT_WATER.getFluidStack(2000), FluidUtils.getFluidStack(mBrine, 4000), 20 * 20, 120, diff --git a/src/Java/gtPlusPlus/core/recipe/RECIPES_SeleniumProcessing.java b/src/Java/gtPlusPlus/core/recipe/RECIPES_SeleniumProcessing.java index 902806e026..9a2ea8bad0 100644 --- a/src/Java/gtPlusPlus/core/recipe/RECIPES_SeleniumProcessing.java +++ b/src/Java/gtPlusPlus/core/recipe/RECIPES_SeleniumProcessing.java @@ -14,40 +14,40 @@ import net.minecraft.item.ItemStack; public class RECIPES_SeleniumProcessing { - public static void init() { - - //We need this - MaterialUtils.generateSpecialDustAndAssignToAMaterial(MISC_MATERIALS.SELENIUM_DIOXIDE, false); - - // Makes Selenium Dioxide - processCopperRecipes(); - - //Liquify the Dried Dioxide - AddGregtechRecipe.addCokeAndPyrolyseRecipes(MISC_MATERIALS.SELENIUM_DIOXIDE.getDust(1), 13, FluidUtils.getSteam(500), null, MISC_MATERIALS.SELENIUM_DIOXIDE.getFluid(1000), 20, 1024); - - // Produce Selenious Acid - AddGregtechRecipe.addCokeAndPyrolyseRecipes(MISC_MATERIALS.SELENIUM_DIOXIDE.getCell(1), 14, FluidUtils.getHotWater(4000), CI.emptyCells(1), MISC_MATERIALS.SELENIOUS_ACID.getFluid(1000), 20, 2048); - - // Make Selenium - CORE.RA.addBlastSmelterRecipe( - new ItemStack[] { - ItemUtils.getGregtechCircuit(14), - ItemUtils.getItemStackOfAmountFromOreDict("cellSulfuricAcid", 8), - ELEMENT.getInstance().CARBON.getDust(16), - }, - MISC_MATERIALS.SELENIOUS_ACID.getFluid(750), - ELEMENT.getInstance().SELENIUM.getFluid(144 * 1), - new ItemStack[] { - CI.emptyCells(8), - ELEMENT.getInstance().SELENIUM.getIngot(1), - ELEMENT.getInstance().SELENIUM.getIngot(1), - }, - new int[] {10000, 2000, 2000}, - 20 * 300, - 7200); - - - /*// Old recipes for Selenium Roasting + public static void init() { + + //We need this + MaterialUtils.generateSpecialDustAndAssignToAMaterial(MISC_MATERIALS.SELENIUM_DIOXIDE, false); + + // Makes Selenium Dioxide + processCopperRecipes(); + + //Liquify the Dried Dioxide + AddGregtechRecipe.addCokeAndPyrolyseRecipes(MISC_MATERIALS.SELENIUM_DIOXIDE.getDust(1), 13, FluidUtils.getSteam(500), null, MISC_MATERIALS.SELENIUM_DIOXIDE.getFluidStack(1000), 20, 1024); + + // Produce Selenious Acid + AddGregtechRecipe.addCokeAndPyrolyseRecipes(MISC_MATERIALS.SELENIUM_DIOXIDE.getCell(1), 14, FluidUtils.getHotWater(4000), CI.emptyCells(1), MISC_MATERIALS.SELENIOUS_ACID.getFluidStack(1000), 20, 2048); + + // Make Selenium + CORE.RA.addBlastSmelterRecipe( + new ItemStack[] { + ItemUtils.getGregtechCircuit(14), + ItemUtils.getItemStackOfAmountFromOreDict("cellSulfuricAcid", 8), + ELEMENT.getInstance().CARBON.getDust(16), + }, + MISC_MATERIALS.SELENIOUS_ACID.getFluidStack(750), + ELEMENT.getInstance().SELENIUM.getFluidStack(144 * 1), + new ItemStack[] { + CI.emptyCells(8), + ELEMENT.getInstance().SELENIUM.getIngot(1), + ELEMENT.getInstance().SELENIUM.getIngot(1), + }, + new int[] {10000, 2000, 2000}, + 20 * 300, + 7200); + + + /*// Old recipes for Selenium Roasting CORE.RA.addBlastSmelterRecipe( new ItemStack[] { ItemUtils.getGregtechCircuit(16), @@ -81,138 +81,142 @@ public class RECIPES_SeleniumProcessing { 0, 20 * 300, 2000);*/ - } - - - public static void processCopperRecipes() { - - //Copper - CORE.RA.addDehydratorRecipe( - new ItemStack[]{ - ItemUtils.getOrePrefixStack(OrePrefixes.crushedPurified, Materials.Copper, 1), // Item Input - }, - FluidUtils.getHotWater(1000), // Fluid - MISC_MATERIALS.SELENIUM_DIOXIDE.getFluid(20), // Fluid - new ItemStack[] { - ItemUtils.getOrePrefixStack(OrePrefixes.crushedCentrifuged, Materials.Copper, 1), - MISC_MATERIALS.SELENIUM_DIOXIDE.getDust(1), - MISC_MATERIALS.SELENIUM_DIOXIDE.getDust(1), - MISC_MATERIALS.SELENIUM_DIOXIDE.getSmallDust(1), - MISC_MATERIALS.SELENIUM_DIOXIDE.getSmallDust(1), - MISC_MATERIALS.SELENIUM_DIOXIDE.getSmallDust(1), - MISC_MATERIALS.SELENIUM_DIOXIDE.getTinyDust(1), - MISC_MATERIALS.SELENIUM_DIOXIDE.getTinyDust(1), - MISC_MATERIALS.SELENIUM_DIOXIDE.getTinyDust(1), - }, // Output - new int[] { - 10000, - 100, - 100, - 500, - 500, - 500, - 1000, - 1000, - 1000 - }, - 40 * 20, // Time in ticks - 1024); // EU - - //Tetra - CORE.RA.addDehydratorRecipe( - new ItemStack[]{ - ItemUtils.getOrePrefixStack(OrePrefixes.crushedPurified, Materials.Tetrahedrite, 1), // Item Input - }, - FluidUtils.getHotWater(1000), // Fluid - MISC_MATERIALS.SELENIUM_DIOXIDE.getFluid(10), // Fluid - new ItemStack[] { - ItemUtils.getOrePrefixStack(OrePrefixes.crushedCentrifuged, Materials.Tetrahedrite, 1), - MISC_MATERIALS.SELENIUM_DIOXIDE.getDust(1), - MISC_MATERIALS.SELENIUM_DIOXIDE.getDust(1), - MISC_MATERIALS.SELENIUM_DIOXIDE.getSmallDust(1), - MISC_MATERIALS.SELENIUM_DIOXIDE.getSmallDust(1), - MISC_MATERIALS.SELENIUM_DIOXIDE.getSmallDust(1), - MISC_MATERIALS.SELENIUM_DIOXIDE.getTinyDust(1), - MISC_MATERIALS.SELENIUM_DIOXIDE.getTinyDust(1), - MISC_MATERIALS.SELENIUM_DIOXIDE.getTinyDust(1), - }, // Output - new int[] { - 10000, - 100, - 100, - 300, - 300, - 300, - 800, - 800, - 800 - }, - 40 * 20, // Time in ticks - 1024); // EU - - //Chalco - CORE.RA.addDehydratorRecipe( - new ItemStack[]{ - ItemUtils.getOrePrefixStack(OrePrefixes.crushedPurified, Materials.Chalcopyrite, 1), // Item Input - }, - FluidUtils.getHotWater(1000), // Fluid - MISC_MATERIALS.SELENIUM_DIOXIDE.getFluid(10), // Fluid - new ItemStack[] { - ItemUtils.getOrePrefixStack(OrePrefixes.crushedCentrifuged, Materials.Chalcopyrite, 1), - MISC_MATERIALS.SELENIUM_DIOXIDE.getDust(1), - MISC_MATERIALS.SELENIUM_DIOXIDE.getDust(1), - MISC_MATERIALS.SELENIUM_DIOXIDE.getSmallDust(1), - MISC_MATERIALS.SELENIUM_DIOXIDE.getSmallDust(1), - MISC_MATERIALS.SELENIUM_DIOXIDE.getSmallDust(1), - MISC_MATERIALS.SELENIUM_DIOXIDE.getTinyDust(1), - MISC_MATERIALS.SELENIUM_DIOXIDE.getTinyDust(1), - MISC_MATERIALS.SELENIUM_DIOXIDE.getTinyDust(1), - }, // Output - new int[] { - 10000, - 100, - 100, - 300, - 300, - 300, - 800, - 800, - 800 - }, - 40 * 20, // Time in ticks - 1024); // EU - - //Malachite - CORE.RA.addDehydratorRecipe( - new ItemStack[]{ - ItemUtils.getOrePrefixStack(OrePrefixes.crushedPurified, Materials.Malachite, 1), // Item Input - }, - FluidUtils.getHotWater(1000), // Fluid - MISC_MATERIALS.SELENIUM_DIOXIDE.getFluid(10), // Fluid - new ItemStack[] { - ItemUtils.getOrePrefixStack(OrePrefixes.crushedCentrifuged, Materials.Malachite, 1), - MISC_MATERIALS.SELENIUM_DIOXIDE.getDust(1), - MISC_MATERIALS.SELENIUM_DIOXIDE.getDust(1), - MISC_MATERIALS.SELENIUM_DIOXIDE.getSmallDust(1), - MISC_MATERIALS.SELENIUM_DIOXIDE.getSmallDust(1), - MISC_MATERIALS.SELENIUM_DIOXIDE.getSmallDust(1), - MISC_MATERIALS.SELENIUM_DIOXIDE.getTinyDust(1), - MISC_MATERIALS.SELENIUM_DIOXIDE.getTinyDust(1), - MISC_MATERIALS.SELENIUM_DIOXIDE.getTinyDust(1), - }, // Output - new int[] { - 10000, - 100, - 100, - 300, - 300, - 300, - 800, - 800, - 800 - }, - 40 * 20, // Time in ticks - 1024); // EU - } + } + + + public static void processCopperRecipes() { + + //Copper + CORE.RA.addDehydratorRecipe( + new ItemStack[]{ + CI.getNumberedAdvancedCircuit(23), + ItemUtils.getOrePrefixStack(OrePrefixes.crushedPurified, Materials.Copper, 1), // Item Input + }, + FluidUtils.getHotWater(1000), // Fluid + MISC_MATERIALS.SELENIUM_DIOXIDE.getFluidStack(20), // Fluid + new ItemStack[] { + ItemUtils.getOrePrefixStack(OrePrefixes.crushedCentrifuged, Materials.Copper, 1), + MISC_MATERIALS.SELENIUM_DIOXIDE.getDust(1), + MISC_MATERIALS.SELENIUM_DIOXIDE.getDust(1), + MISC_MATERIALS.SELENIUM_DIOXIDE.getSmallDust(1), + MISC_MATERIALS.SELENIUM_DIOXIDE.getSmallDust(1), + MISC_MATERIALS.SELENIUM_DIOXIDE.getSmallDust(1), + MISC_MATERIALS.SELENIUM_DIOXIDE.getTinyDust(1), + MISC_MATERIALS.SELENIUM_DIOXIDE.getTinyDust(1), + MISC_MATERIALS.SELENIUM_DIOXIDE.getTinyDust(1), + }, // Output + new int[] { + 10000, + 100, + 100, + 500, + 500, + 500, + 1000, + 1000, + 1000 + }, + 40 * 20, // Time in ticks + 1024); // EU + + //Tetra + CORE.RA.addDehydratorRecipe( + new ItemStack[]{ + CI.getNumberedAdvancedCircuit(23), + ItemUtils.getOrePrefixStack(OrePrefixes.crushedPurified, Materials.Tetrahedrite, 1), // Item Input + }, + FluidUtils.getHotWater(1000), // Fluid + MISC_MATERIALS.SELENIUM_DIOXIDE.getFluidStack(10), // Fluid + new ItemStack[] { + ItemUtils.getOrePrefixStack(OrePrefixes.crushedCentrifuged, Materials.Tetrahedrite, 1), + MISC_MATERIALS.SELENIUM_DIOXIDE.getDust(1), + MISC_MATERIALS.SELENIUM_DIOXIDE.getDust(1), + MISC_MATERIALS.SELENIUM_DIOXIDE.getSmallDust(1), + MISC_MATERIALS.SELENIUM_DIOXIDE.getSmallDust(1), + MISC_MATERIALS.SELENIUM_DIOXIDE.getSmallDust(1), + MISC_MATERIALS.SELENIUM_DIOXIDE.getTinyDust(1), + MISC_MATERIALS.SELENIUM_DIOXIDE.getTinyDust(1), + MISC_MATERIALS.SELENIUM_DIOXIDE.getTinyDust(1), + }, // Output + new int[] { + 10000, + 100, + 100, + 300, + 300, + 300, + 800, + 800, + 800 + }, + 40 * 20, // Time in ticks + 1024); // EU + + //Chalco + CORE.RA.addDehydratorRecipe( + new ItemStack[]{ + CI.getNumberedAdvancedCircuit(23), + ItemUtils.getOrePrefixStack(OrePrefixes.crushedPurified, Materials.Chalcopyrite, 1), // Item Input + }, + FluidUtils.getHotWater(1000), // Fluid + MISC_MATERIALS.SELENIUM_DIOXIDE.getFluidStack(10), // Fluid + new ItemStack[] { + ItemUtils.getOrePrefixStack(OrePrefixes.crushedCentrifuged, Materials.Chalcopyrite, 1), + MISC_MATERIALS.SELENIUM_DIOXIDE.getDust(1), + MISC_MATERIALS.SELENIUM_DIOXIDE.getDust(1), + MISC_MATERIALS.SELENIUM_DIOXIDE.getSmallDust(1), + MISC_MATERIALS.SELENIUM_DIOXIDE.getSmallDust(1), + MISC_MATERIALS.SELENIUM_DIOXIDE.getSmallDust(1), + MISC_MATERIALS.SELENIUM_DIOXIDE.getTinyDust(1), + MISC_MATERIALS.SELENIUM_DIOXIDE.getTinyDust(1), + MISC_MATERIALS.SELENIUM_DIOXIDE.getTinyDust(1), + }, // Output + new int[] { + 10000, + 100, + 100, + 300, + 300, + 300, + 800, + 800, + 800 + }, + 40 * 20, // Time in ticks + 1024); // EU + + //Malachite + CORE.RA.addDehydratorRecipe( + new ItemStack[]{ + CI.getNumberedAdvancedCircuit(23), + ItemUtils.getOrePrefixStack(OrePrefixes.crushedPurified, Materials.Malachite, 1), // Item Input + }, + FluidUtils.getHotWater(1000), // Fluid + MISC_MATERIALS.SELENIUM_DIOXIDE.getFluidStack(10), // Fluid + new ItemStack[] { + ItemUtils.getOrePrefixStack(OrePrefixes.crushedCentrifuged, Materials.Malachite, 1), + MISC_MATERIALS.SELENIUM_DIOXIDE.getDust(1), + MISC_MATERIALS.SELENIUM_DIOXIDE.getDust(1), + MISC_MATERIALS.SELENIUM_DIOXIDE.getSmallDust(1), + MISC_MATERIALS.SELENIUM_DIOXIDE.getSmallDust(1), + MISC_MATERIALS.SELENIUM_DIOXIDE.getSmallDust(1), + MISC_MATERIALS.SELENIUM_DIOXIDE.getTinyDust(1), + MISC_MATERIALS.SELENIUM_DIOXIDE.getTinyDust(1), + MISC_MATERIALS.SELENIUM_DIOXIDE.getTinyDust(1), + }, // Output + new int[] { + 10000, + 100, + 100, + 300, + 300, + 300, + 800, + 800, + 800 + }, + 40 * 20, // Time in ticks + 1024); // EU + } } diff --git a/src/Java/gtPlusPlus/core/recipe/common/CI.java b/src/Java/gtPlusPlus/core/recipe/common/CI.java index 9379ac139a..0a1b762a97 100644 --- a/src/Java/gtPlusPlus/core/recipe/common/CI.java +++ b/src/Java/gtPlusPlus/core/recipe/common/CI.java @@ -626,7 +626,7 @@ public class CI { }*/ // Modern Handling - FluidStack a = aMaster[aType][aTier].getFluid(aAmount); + FluidStack a = aMaster[aType][aTier].getFluidStack(aAmount); if (a == null) { ItemStack aCell = getTieredComponent(OrePrefixes.liquid, aTier, 1); if (aCell != null) { diff --git a/src/Java/gtPlusPlus/core/slots/SlotChemicalPlantInput.java b/src/Java/gtPlusPlus/core/slots/SlotChemicalPlantInput.java index 4b9cda0b9b..1029d37a78 100644 --- a/src/Java/gtPlusPlus/core/slots/SlotChemicalPlantInput.java +++ b/src/Java/gtPlusPlus/core/slots/SlotChemicalPlantInput.java @@ -1,7 +1,7 @@ package gtPlusPlus.core.slots; -import gregtech.api.util.GTPP_Recipe; import gregtech.api.util.GTPP_Recipe.GTPP_Recipe_Map; +import gregtech.api.util.GT_Recipe; import net.minecraft.inventory.IInventory; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; @@ -22,7 +22,7 @@ public class SlotChemicalPlantInput extends Slot { public static boolean isItemValidForChemicalPlantSlot(ItemStack aStack) { boolean validItem = GTPP_Recipe_Map.sChemicalPlantRecipes.containsInput(aStack); if (!validItem) { - for (GTPP_Recipe f : GTPP_Recipe_Map.sChemicalPlantRecipes.mRecipeList) { + for (GT_Recipe f : GTPP_Recipe_Map.sChemicalPlantRecipes.mRecipeList) { if (f.mFluidInputs.length > 0) { for (FluidStack g : f.mFluidInputs) { if (g != null) { diff --git a/src/Java/gtPlusPlus/core/slots/SlotIntegratedCircuit.java b/src/Java/gtPlusPlus/core/slots/SlotIntegratedCircuit.java index 19795a41e4..8c8a118abb 100644 --- a/src/Java/gtPlusPlus/core/slots/SlotIntegratedCircuit.java +++ b/src/Java/gtPlusPlus/core/slots/SlotIntegratedCircuit.java @@ -82,7 +82,7 @@ public class SlotIntegratedCircuit extends Slot { } if (mCircuitItem != null && mCircuitItem2 != null && mCircuitItem3 != null) { if (itemstack != null) { - if (itemstack.getItem() == mCircuitItem || itemstack.getItem() == mCircuitItem2) { + if (itemstack.getItem() == mCircuitItem || itemstack.getItem() == mCircuitItem2 || itemstack.getItem() == mCircuitItem3) { if (itemstack.getItem() == mCircuitItem) { return 0; } diff --git a/src/Java/gtPlusPlus/core/tileentities/machines/TileEntityPestKiller.java b/src/Java/gtPlusPlus/core/tileentities/machines/TileEntityPestKiller.java index 3ebe5be40d..012c9f4ff5 100644 --- a/src/Java/gtPlusPlus/core/tileentities/machines/TileEntityPestKiller.java +++ b/src/Java/gtPlusPlus/core/tileentities/machines/TileEntityPestKiller.java @@ -183,7 +183,7 @@ public class TileEntityPestKiller extends TileEntity implements ISidedInventory, if (f != null) { if (f.isFluidEqual(FluidUtils.getWildcardFluidStack("formaldehyde", 1))) { return 1; - } else if (f.isFluidEqual(MISC_MATERIALS.HYDROGEN_CYANIDE.getFluid(1))) { + } else if (f.isFluidEqual(MISC_MATERIALS.HYDROGEN_CYANIDE.getFluidStack(1))) { return 2; } } @@ -443,7 +443,7 @@ public class TileEntityPestKiller extends TileEntity implements ISidedInventory, ArrayList<ItemStack> t2Cells = OreDictionary.getOres("cellHydrogenCyanide"); didFill = addFluid(t1Cells, aInput, FluidUtils.getWildcardFluidStack("formaldehyde", 1000)); if (!didFill) { - didFill = addFluid(t2Cells, aInput, MISC_MATERIALS.HYDROGEN_CYANIDE.getFluid(1000)); + didFill = addFluid(t2Cells, aInput, MISC_MATERIALS.HYDROGEN_CYANIDE.getFluidStack(1000)); } } diff --git a/src/Java/gtPlusPlus/core/util/data/ArrayUtils.java b/src/Java/gtPlusPlus/core/util/data/ArrayUtils.java index c9c8d26744..62f703f5f5 100644 --- a/src/Java/gtPlusPlus/core/util/data/ArrayUtils.java +++ b/src/Java/gtPlusPlus/core/util/data/ArrayUtils.java @@ -26,6 +26,18 @@ public class ArrayUtils { return series; } + public static <V> V[] insertElementAtIndex(V[] aArray, int aIndex, V aObjectToInsert) { + V[] newArray = Arrays.copyOf(aArray, aArray.length + 1); + for (int i=0;i<aIndex;i++) { + newArray[i] = aArray[i]; + } + newArray[aIndex] = aObjectToInsert; + for (int i=(aIndex+1);i<newArray.length;i++) { + newArray[i] = aArray[i-1]; + } + return newArray; + } + /*public static <V> Object getMostCommonElement(List<V> list) { Optional r = list.stream().map(V::getTextureSet).collect(Collectors.groupingBy(Function.identity(), Collectors.counting())).entrySet().stream().max(Map.Entry.comparingByValue()).map(Map.Entry::getKey); return r.get(); diff --git a/src/Java/gtPlusPlus/core/util/math/MathUtils.java b/src/Java/gtPlusPlus/core/util/math/MathUtils.java index 2f4db2efcc..7573e0d51c 100644 --- a/src/Java/gtPlusPlus/core/util/math/MathUtils.java +++ b/src/Java/gtPlusPlus/core/util/math/MathUtils.java @@ -1,5 +1,6 @@ package gtPlusPlus.core.util.math; +import java.text.NumberFormat; import java.util.Map; import java.util.Random; @@ -15,6 +16,13 @@ public class MathUtils { final static Random rand = CORE.RANDOM; + /** Formats a number with group separator and at most 2 fraction digits. */ + private static final NumberFormat sNumberFormat = NumberFormat.getInstance(); + + static { + sNumberFormat.setMaximumFractionDigits(2); + } + /** * Returns a psuedo-random number between min and max, inclusive. * The difference between min and max can be at most @@ -766,6 +774,14 @@ public class MathUtils { public static Number max(Number a, Number b) { return (a.longValue() >= b.longValue()) ? a : b; } + + public static String formatNumbers(long aNumber) { + return sNumberFormat.format(aNumber); + } + + public static String formatNumbers(double aNumber) { + return sNumberFormat.format(aNumber); + } } diff --git a/src/Java/gtPlusPlus/core/util/minecraft/FluidUtils.java b/src/Java/gtPlusPlus/core/util/minecraft/FluidUtils.java index 758ec8bab0..a6bd50ff17 100644 --- a/src/Java/gtPlusPlus/core/util/minecraft/FluidUtils.java +++ b/src/Java/gtPlusPlus/core/util/minecraft/FluidUtils.java @@ -175,7 +175,7 @@ public class FluidUtils { } public static Fluid addGTFluid(final String aName, final String aLocalized, final short[] aRGBa, final int aState, final long aTemperatureK, final ItemStack aFullContainer, final ItemStack aEmptyContainer, final int aFluidAmount, final boolean aGenerateCell) { - return addGTFluid("molten."+aName, "molten.autogenerated", aLocalized, aRGBa, aState, aTemperatureK, aFullContainer, aEmptyContainer, aFluidAmount, aGenerateCell); + return addGTFluid("molten."+aName, "fluid.autogenerated", aLocalized, aRGBa, aState, aTemperatureK, aFullContainer, aEmptyContainer, aFluidAmount, aGenerateCell); } public static Fluid addGTFluidNonMolten(final String aName, final String aLocalized, final short[] aRGBa, final int aState, final long aTemperatureK, final ItemStack aFullContainer, final ItemStack aEmptyContainer, final int aFluidAmount, final boolean aGenerateCell) { @@ -232,6 +232,7 @@ public class FluidUtils { public static Fluid addGTFluid(String aName, final String aTexture, final String aLocalized, final short[] aRGBa, final int aState, final long aTemperatureK, ItemStack aFullContainer, final ItemStack aEmptyContainer, final int aFluidAmount, final boolean aGenerateFilledCell) { String aNameOriginal = aName; + Logger.INFO("Generating Fluid for "+aName); aName = Utils.sanitizeString(aName.toLowerCase()); @@ -286,10 +287,28 @@ public class FluidUtils { } + String aNameNonMolten = aLocalName.contains("Molten") ? aLocalName.replace("Molten", "") : aLocalName; if (aFullContainer == null) { - ItemStack oreStack = ItemUtils.getItemStackOfAmountFromOreDictNoBroken("cell"+aName, 1); - aFullContainer = oreStack; + ItemStack oreStack = ItemUtils.getItemStackOfAmountFromOreDictNoBroken("cell"+aLocalName, 1); + aFullContainer = oreStack; + if (aFullContainer == null) { + oreStack = ItemUtils.getItemStackOfAmountFromOreDictNoBroken("cell"+aNameOriginal, 1); + aFullContainer = oreStack; + if (aFullContainer == null) { + oreStack = ItemUtils.getItemStackOfAmountFromOreDictNoBroken("cell"+aNameNonMolten, 1); + aFullContainer = oreStack; + if (aFullContainer != null) { + Logger.INFO("Found cell for "+aNameNonMolten); + } + } + else { + Logger.INFO("Found cell for "+aNameOriginal); + } + } + else { + Logger.INFO("Found cell for "+aLocalName); + } } Item tempCell = null; @@ -304,7 +323,8 @@ public class FluidUtils { aMatName = aMatName.replace("fluid.", ""); aMatName = aMatName.substring(0, 1).toUpperCase() + aMatName.substring(1); } - tempCell = new BaseItemComponent(aMatName, aLocalized, aRGBa); + Logger.INFO("Generating cell for "+aMatName+", "+aLocalName); + tempCell = new BaseItemComponent(aMatName, aLocalName, aRGBa); aFullContainer = ItemUtils.getSimpleStack(tempCell); } @@ -563,11 +583,11 @@ public class FluidUtils { return aFStack1 != null || aFStack2 != null || aFStack3 != null || aFStack4 != null || aFStack5 != null || aFStack6 != null; } - public static FluidStack getWildcardFluidStack(String aFluidName, int amount) { - FluidStack aFStack1 = (FluidUtils.getFluidStack("molten"+"."+aFluidName.toLowerCase(), amount)); - FluidStack aFStack2 = (FluidUtils.getFluidStack("fluid"+"."+aFluidName.toLowerCase(), amount)); - FluidStack aFStack3 = (FluidUtils.getFluidStack(aFluidName.toLowerCase(), amount)); - FluidStack aFStack4 = (FluidUtils.getFluidStack(aFluidName, amount)); + public static FluidStack getWildcardFluidStack(String aFluidName, int amount) { + FluidStack aFStack1 = (FluidUtils.getFluidStack(aFluidName, amount)); + FluidStack aFStack2 = (FluidUtils.getFluidStack(aFluidName.toLowerCase(), amount)); + FluidStack aFStack3 = (FluidUtils.getFluidStack("molten"+"."+aFluidName.toLowerCase(), amount)); + FluidStack aFStack4 = (FluidUtils.getFluidStack("fluid"+"."+aFluidName.toLowerCase(), amount)); FluidStack aFStack5 = (FluidUtils.getFluidStack("liquid_"+aFluidName.toLowerCase(), amount)); FluidStack aFStack6 = (FluidUtils.getFluidStack("liquid"+"."+aFluidName.toLowerCase(), amount)); if (aFStack1 != null) { diff --git a/src/Java/gtPlusPlus/core/util/minecraft/ItemUtils.java b/src/Java/gtPlusPlus/core/util/minecraft/ItemUtils.java index 1e282fb849..e96bd3391b 100644 --- a/src/Java/gtPlusPlus/core/util/minecraft/ItemUtils.java +++ b/src/Java/gtPlusPlus/core/util/minecraft/ItemUtils.java @@ -703,6 +703,44 @@ public class ItemUtils { } return sRadiation; } + + public static String getArrayStackNames(ArrayList<?> aStack) { + Object aType = aStack.get(0); + if (aType instanceof FluidStack) { + FluidStack[] aItems = new FluidStack[aStack.size()]; + for (int i=0;i<aItems.length;i++) { + aItems[i] = (FluidStack) aStack.get(i); + } + return getArrayStackNames(aItems); + } + if (aType instanceof ItemStack) { + ItemStack[] aItems = new ItemStack[aStack.size()]; + for (int i=0;i<aItems.length;i++) { + aItems[i] = (ItemStack) aStack.get(i); + } + return getArrayStackNames(aItems); + } + return ""; + } + + public static String getArrayStackNames(final AutoMap<?> aStack) { + Object aType = aStack.get(0); + if (aType instanceof FluidStack) { + FluidStack[] aItems = new FluidStack[aStack.size()]; + for (int i=0;i<aItems.length;i++) { + aItems[i] = (FluidStack) aStack.get(i); + } + return getArrayStackNames(aItems); + } + if (aType instanceof ItemStack) { + ItemStack[] aItems = new ItemStack[aStack.size()]; + for (int i=0;i<aItems.length;i++) { + aItems[i] = (ItemStack) aStack.get(i); + } + return getArrayStackNames(aItems); + } + return ""; + } public static String getArrayStackNames(final FluidStack[] aStack) { String itemNames = "Fluid Array: "; @@ -717,7 +755,7 @@ public class ItemUtils { } return itemNames; } - + public static String getArrayStackNames(final ItemStack[] aStack) { String itemNames = ""; int aPos = 0; @@ -913,10 +951,11 @@ public class ItemUtils { } public static ItemStack getErrorStack(int mAmount, String aName) { - ItemStack g = getSimpleStack(ModItems.AAA_Broken, 1); - NBTUtils.setString(g, "Lore", EnumChatFormatting.RED+aName); + ItemStack g = getSimpleStack(ModItems.AAA_Broken, 1); if (aName != null) { - NBTUtils.setBookTitle(g, EnumChatFormatting.YELLOW+"Maybe Alkalus should know about this"); + //NBTUtils.setString(g, "Lore", EnumChatFormatting.RED+aName); + NBTUtils.setBookTitle(g, EnumChatFormatting.RED+aName); + //NBTUtils.setBookTitle(g, EnumChatFormatting.YELLOW+"Maybe Alkalus should know about this"); } return g; } @@ -1375,6 +1414,6 @@ public class ItemUtils { public static boolean areItemsEqual(ItemStack aStack1, ItemStack aStack2, boolean aIgnoreNBT) { return GT_Utility.areStacksEqual(aStack1, aStack2, aIgnoreNBT); - } + } } diff --git a/src/Java/gtPlusPlus/core/util/minecraft/MaterialUtils.java b/src/Java/gtPlusPlus/core/util/minecraft/MaterialUtils.java index 7e9e34ae47..0323bf0161 100644 --- a/src/Java/gtPlusPlus/core/util/minecraft/MaterialUtils.java +++ b/src/Java/gtPlusPlus/core/util/minecraft/MaterialUtils.java @@ -512,5 +512,12 @@ public class MaterialUtils { return false; } + public static boolean isNullGregtechMaterial(Materials aGregtechMaterial) { + if (aGregtechMaterial == Materials._NULL || aGregtechMaterial.equals(Materials._NULL) || aGregtechMaterial.name().equals(Materials._NULL.name())) { + return true; + } + return false; + } + }
\ No newline at end of file diff --git a/src/Java/gtPlusPlus/core/util/minecraft/RecipeUtils.java b/src/Java/gtPlusPlus/core/util/minecraft/RecipeUtils.java index df64017ac0..da5bc071bc 100644 --- a/src/Java/gtPlusPlus/core/util/minecraft/RecipeUtils.java +++ b/src/Java/gtPlusPlus/core/util/minecraft/RecipeUtils.java @@ -1,15 +1,18 @@ package gtPlusPlus.core.util.minecraft; import java.util.ArrayList; +import java.util.Arrays; import java.util.Iterator; import java.util.List; import cpw.mods.fml.common.registry.GameRegistry; -import cpw.mods.fml.common.FMLCommonHandler; import gregtech.api.enums.Materials; import gregtech.api.objects.ItemData; -import gregtech.api.util.*; +import gregtech.api.util.GT_ModHandler; +import gregtech.api.util.GT_OreDictUnificator; +import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Recipe.GT_Recipe_Map; +import gregtech.api.util.GT_Utility; import gtPlusPlus.GTplusplus; import gtPlusPlus.api.interfaces.RunnableWithInfo; import gtPlusPlus.api.objects.Logger; @@ -21,7 +24,6 @@ import gtPlusPlus.core.handler.Recipes.RegistrationHandler; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.recipe.common.CI; import gtPlusPlus.core.util.data.ArrayUtils; -import gtPlusPlus.core.util.reflect.ReflectionUtils; import net.minecraft.block.Block; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; @@ -348,16 +350,7 @@ public static int mInvalidID = 1; if (gtPlusPlus.GTplusplus.CURRENT_LOAD_PHASE != GTplusplus.INIT_PHASE.POST_INIT) { - Logger.RECIPE(ReflectionUtils.getMethodName(1)); - Logger.RECIPE(ReflectionUtils.getMethodName(2)); - Logger.RECIPE(ReflectionUtils.getMethodName(3)); - Logger.RECIPE(ReflectionUtils.getMethodName(4)); - Logger.RECIPE(ReflectionUtils.getMethodName(5)); - Logger.RECIPE(ReflectionUtils.getMethodName(6)); - Logger.RECIPE(ReflectionUtils.getMethodName(7)); - Logger.RECIPE(ReflectionUtils.getMethodName(8)); - Logger.RECIPE(ReflectionUtils.getMethodName(9)); - FMLCommonHandler.instance().exitJava(1, true); + CORE.crash("Load Phase "+gtPlusPlus.GTplusplus.CURRENT_LOAD_PHASE+" should be "+GTplusplus.INIT_PHASE.POST_INIT+". Unable to register recipe."); } @@ -418,6 +411,20 @@ public static int mInvalidID = 1; } return false; } + + public static boolean addShapelessGregtechRecipe( + final Object InputItem1, final Object InputItem2, final Object InputItem3, + final Object InputItem4, final Object InputItem5, final Object InputItem6, + final Object InputItem7, final Object InputItem8, final Object InputItem9, + final ItemStack OutputItem){ + + Object[] inputItems = { + InputItem1, InputItem2, InputItem3, + InputItem4, InputItem5, InputItem6, + InputItem7, InputItem8, InputItem9 + }; + return addShapelessGregtechRecipe(inputItems, OutputItem); + } public static boolean addShapelessGregtechRecipe(final Object[] inputItems, final ItemStack OutputItem){ //Catch Invalid Recipes @@ -492,10 +499,7 @@ public static int mInvalidID = 1; result.put("Is Enabled? "+m.mEnabled); result.put("Special Value: "+m.mSpecialValue); result.put("====================================="); - String s[] = new String[result.size()]; - for (int i=0;i<result.size();i++) { - s[i] = result.get(i); - } + String s[] = result.toArray(); return s; } @@ -729,7 +733,7 @@ public static int mInvalidID = 1; Logger.INFO("Data Size: "+aDataObject.length); aDataObject = ArrayUtils.removeNulls(aDataObject); Logger.INFO("Clean Size: "+aDataObject.length); - Logger.INFO("ArrayData: "+aDataObject.toString()); + Logger.INFO("ArrayData: "+Arrays.toString(aDataObject)); ShapedOreRecipe aRecipe = new ShapedOreRecipe(aOutputStack, aDataObject); diff --git a/src/Java/gtPlusPlus/core/util/reflect/AddGregtechRecipe.java b/src/Java/gtPlusPlus/core/util/reflect/AddGregtechRecipe.java index 0b22ea3acc..fc8e84cb61 100644 --- a/src/Java/gtPlusPlus/core/util/reflect/AddGregtechRecipe.java +++ b/src/Java/gtPlusPlus/core/util/reflect/AddGregtechRecipe.java @@ -3,16 +3,15 @@ package gtPlusPlus.core.util.reflect; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; -import net.minecraft.item.ItemStack; - import gregtech.api.enums.GT_Values; import gregtech.api.interfaces.internal.IGT_RecipeAdder; import gregtech.api.util.GT_Recipe; -import gregtech.api.util.GT_Utility; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.recipe.common.CI; import gtPlusPlus.core.util.minecraft.FluidUtils; import gtPlusPlus.core.util.minecraft.ItemUtils; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.FluidStack; public final class AddGregtechRecipe { @@ -24,53 +23,47 @@ public final class AddGregtechRecipe { if (aRecipe.mInputs == null || aRecipe.mFluidInputs == null || aRecipe.mFluidOutputs == null || aRecipe.mOutputs == null) { return false; - } - - if (aRecipe.mInputs.length > 2 || aRecipe.mFluidInputs.length > 1 || aRecipe.mFluidOutputs.length > 1 || aRecipe.mOutputs.length > 1) { + } + if (aRecipe.mInputs.length > 2 || aRecipe.mFluidInputs.length > 1 || aRecipe.mFluidOutputs.length > 1 || aRecipe.mOutputs.length > 9) { return false; } - else if (aRecipe.mInputs.length <= 0 || aRecipe.mFluidInputs.length <= 0 || aRecipe.mFluidOutputs.length <= 0 || aRecipe.mOutputs.length <= 0) { + else if (aRecipe.mInputs.length <= 0) { return false; } int aCircuitNumber = -1; - int aItemSlot = -1; + Item aCircuit = CI.getNumberedCircuit(1).getItem(); + boolean hasCircuit = false; - int aSlot = 0; for (ItemStack a : aRecipe.mInputs) { - if (a != null && a.getItem() != CI.getNumberedCircuit(1).getItem()) { - aItemSlot = aSlot; - } - else { - aSlot++; + if (a != null && a.getItem() == aCircuit) { + hasCircuit = true; + aCircuitNumber = a.getItemDamage(); + break; } } - for (int i=0;i<25;i++) { - ItemStack aTest = CI.getNumberedCircuit(i); - for (ItemStack a : aRecipe.mInputs) { - if (a != null && GT_Utility.areStacksEqual(a, aTest)) { - aCircuitNumber = i; - break; - } - } + ItemStack aInputItem = null; + if (!hasCircuit || aCircuitNumber < 1) { + return false; } - if (aCircuitNumber < 0) { - return false; + for (ItemStack a : aRecipe.mInputs) { + if (a != null && a.getItem() != aCircuit) { + aInputItem = a; + break; + } } - return CORE.RA.addCokeOvenRecipe( - aRecipe.mInputs[aItemSlot], - ItemUtils.getGregtechCircuit(aCircuitNumber), - aRecipe.mFluidInputs[0], - aRecipe.mFluidOutputs[0], - aRecipe.mOutputs[0], - aModifiedTime, - aRecipe.mEUt); - - + aCircuitNumber, + aInputItem, + aRecipe.mFluidInputs, + aRecipe.mFluidOutputs, + aRecipe.mOutputs, + aModifiedTime, + aRecipe.mEUt); + } diff --git a/src/Java/gtPlusPlus/core/util/reflect/ReflectionUtils.java b/src/Java/gtPlusPlus/core/util/reflect/ReflectionUtils.java index e0634dfb14..1ef925f793 100644 --- a/src/Java/gtPlusPlus/core/util/reflect/ReflectionUtils.java +++ b/src/Java/gtPlusPlus/core/util/reflect/ReflectionUtils.java @@ -432,6 +432,18 @@ public class ReflectionUtils { t.printStackTrace(); } } + + /** + * Allows to change the state of an immutable instance. Huh?!? + */ + public static void setFinalFieldValue(Class<?> clazz, Field field, Object newValue) { + try { + setFieldValue_Internal(clazz, field, newValue); + } + catch (Throwable t) { + t.printStackTrace(); + } + } @Deprecated public static void setFinalStatic(Field field, Object newValue) throws Exception { diff --git a/src/Java/gtPlusPlus/everglades/biome/Biome_Everglades.java b/src/Java/gtPlusPlus/everglades/biome/Biome_Everglades.java index aadbfeb495..b31f6d034e 100644 --- a/src/Java/gtPlusPlus/everglades/biome/Biome_Everglades.java +++ b/src/Java/gtPlusPlus/everglades/biome/Biome_Everglades.java @@ -61,7 +61,7 @@ public class Biome_Everglades { @SuppressWarnings("unchecked") public BiomeGenEverglades() { super(CORE.EVERGLADESBIOME_ID); - this.setBiomeID(); + //this.setBiomeID(); this.theBiomeDecorator = new BiomeGenerator_Custom(); this.theBiomeDecorator.treesPerChunk = 10; //Logger.INFO("Dark World Temperature Category: "+getTempCategory()); @@ -93,27 +93,31 @@ public class Biome_Everglades { } private synchronized boolean setBiomeID() { - BiomeGenBase[] mTempList; try { Field mInternalBiomeList = ReflectionUtils.getField(BiomeGenBase.class, "biomeList"); Field mClone = mInternalBiomeList; - mTempList = (BiomeGenBase[]) mInternalBiomeList.get(null); + BiomeGenBase[] mOriginalList = (BiomeGenBase[]) mInternalBiomeList.get(null); + BiomeGenBase[] mTempList = new BiomeGenBase[mOriginalList.length]; + for (int index=0;index<mTempList.length;index++) { + mTempList[index] = mOriginalList[index]; + } if (mTempList != null){ - mTempList[CORE.EVERGLADESBIOME_ID] = this; + mTempList[CORE.AUSTRALIA_BIOME_DESERT_1_ID] = this; mInternalBiomeList.set(null, mTempList); if (mTempList != mInternalBiomeList.get(null)){ - ReflectionUtils.setFinalStatic(mInternalBiomeList, mTempList); - Logger.REFLECTION("Set Biome ID for Dark World Biome internally in 'biomeList' field from "+BiomeGenBase.class.getCanonicalName()+"."); + ReflectionUtils.setFinalFieldValue(BiomeGenBase.class, mInternalBiomeList, mTempList); + Logger.REFLECTION("Set Biome ID for "+this.biomeName+" Biome internally in 'biomeList' field from "+BiomeGenBase.class.getCanonicalName()+"."); return true; } else { - Logger.REFLECTION("Failed to set Biome ID for Dark World Biome internally in 'biomeList' field from "+BiomeGenBase.class.getCanonicalName()+"."); + Logger.REFLECTION("Failed to set Biome ID for "+this.biomeName+" Biome internally in 'biomeList' field from "+BiomeGenBase.class.getCanonicalName()+"."); } } return false; } catch (Exception e) { Logger.REFLECTION("Could not access 'biomeList' field in "+BiomeGenBase.class.getCanonicalName()+"."); + e.printStackTrace(); return false; } } diff --git a/src/Java/gtPlusPlus/nei/GTPP_NEI_DefaultHandler.java b/src/Java/gtPlusPlus/nei/GTPP_NEI_DefaultHandler.java index 2c00010a1a..de2c29db9f 100644 --- a/src/Java/gtPlusPlus/nei/GTPP_NEI_DefaultHandler.java +++ b/src/Java/gtPlusPlus/nei/GTPP_NEI_DefaultHandler.java @@ -2,40 +2,73 @@ package gtPlusPlus.nei; import java.awt.Point; import java.awt.Rectangle; -import java.util.*; +import java.lang.ref.SoftReference; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.stream.Collectors; import org.lwjgl.opengl.GL11; +import codechicken.lib.gui.GuiDraw; +import codechicken.nei.PositionedStack; +import codechicken.nei.guihook.GuiContainerManager; +import codechicken.nei.guihook.IContainerInputHandler; +import codechicken.nei.guihook.IContainerTooltipHandler; +import codechicken.nei.recipe.GuiCraftingRecipe; +import codechicken.nei.recipe.GuiRecipe; +import codechicken.nei.recipe.GuiUsageRecipe; +import codechicken.nei.recipe.TemplateRecipeHandler; import cpw.mods.fml.common.event.FMLInterModComms; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.inventory.GuiContainer; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; - import gregtech.api.enums.GT_Values; import gregtech.api.enums.OrePrefixes; import gregtech.api.gui.GT_GUIContainer_BasicMachine; import gregtech.api.objects.ItemData; -import gregtech.api.util.*; +import gregtech.api.util.GT_LanguageManager; +import gregtech.api.util.GT_OreDictUnificator; +import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Recipe.GT_Recipe_Map; -import codechicken.lib.gui.GuiDraw; -import codechicken.nei.PositionedStack; -import codechicken.nei.guihook.GuiContainerManager; -import codechicken.nei.guihook.IContainerInputHandler; -import codechicken.nei.guihook.IContainerTooltipHandler; -import codechicken.nei.recipe.*; -import net.minecraftforge.fluids.FluidContainerRegistry; +import gregtech.api.util.GT_Utility; +import gtPlusPlus.api.objects.Logger; +import gtPlusPlus.api.objects.data.Pair; +import gtPlusPlus.core.util.math.MathUtils; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.FluidStack; -public class GTPP_NEI_DefaultHandler -extends TemplateRecipeHandler { +public class GTPP_NEI_DefaultHandler extends TemplateRecipeHandler { + public static final int sOffsetX = 5; public static final int sOffsetY = 11; + private SoftReference<List<CachedDefaultRecipe>> mCachedRecipes = null; + + private static final HashMap<Integer, Pair<Integer, Integer>> mInputSlotMap = new HashMap<Integer, Pair<Integer, Integer>>(); + private static final HashMap<Integer, Pair<Integer, Integer>> mOutputSlotMap = new HashMap<Integer, Pair<Integer, Integer>>(); static { GuiContainerManager.addInputHandler(new GT_RectHandler()); GuiContainerManager.addTooltipHandler(new GT_RectHandler()); + int[] aSlotX = new int[] {12, 30, 48}; + int[] aSlotY = new int[] {5, 23, 41, 64}; + // Input slots + int aIndex = 0; + for (int y=0; y<aSlotY.length;y++) { + for (int x=0; x<aSlotX.length;x++) { + mInputSlotMap.put(aIndex++, new Pair<Integer, Integer>(aSlotX[x], aSlotY[y])); + } + } + // Output slots + aSlotX = new int[] {102, 120, 138}; + aIndex = 0; + for (int y=0; y<aSlotY.length;y++) { + for (int x=0; x<aSlotX.length;x++) { + mOutputSlotMap.put(aIndex++, new Pair<Integer, Integer>(aSlotX[x], aSlotY[y])); + } + } } protected final GT_Recipe_Map mRecipeMap; @@ -66,13 +99,28 @@ extends TemplateRecipeHandler { return result; } + public List<CachedDefaultRecipe> getCache() { + List<CachedDefaultRecipe> cache; + if (mCachedRecipes == null || (cache = mCachedRecipes.get()) == null) { + cache = mRecipeMap.mRecipeList.stream() // do not use parallel stream. This is already parallelized by NEI + .filter(r -> !r.mHidden) + .sorted() + .map(temp -> {return createCachedRecipe(temp);}) + .collect(Collectors.toList()); + // while the NEI parallelize handlers, for each individual handler it still uses sequential execution model + // so we do not need any synchronization here + mCachedRecipes = new SoftReference<>(cache); + } + return cache; + } + + public CachedDefaultRecipe createCachedRecipe(GT_Recipe aRecipe) { + return new CachedDefaultRecipe(aRecipe); + } + public void loadCraftingRecipes(String outputId, Object... results) { if (outputId.equals(getOverlayIdentifier())) { - for (GT_Recipe tRecipe : getSortedRecipes()) { - if (!tRecipe.mHidden) { - this.arecipes.add(new CachedDefaultRecipe(tRecipe)); - } - } + arecipes.addAll(getCache()); } else { super.loadCraftingRecipes(outputId, results); } @@ -81,7 +129,7 @@ extends TemplateRecipeHandler { public void loadCraftingRecipes(ItemStack aResult) { ItemData tPrefixMaterial = GT_OreDictUnificator.getAssociation(aResult); - ArrayList<ItemStack> tResults = new ArrayList<ItemStack>(); + ArrayList<ItemStack> tResults = new ArrayList<>(); tResults.add(aResult); tResults.add(GT_OreDictUnificator.get(true, aResult)); if ((tPrefixMaterial != null) && (!tPrefixMaterial.mBlackListed) && (!tPrefixMaterial.mPrefix.mFamiliarPrefixes.isEmpty())) { @@ -90,30 +138,25 @@ extends TemplateRecipeHandler { } } FluidStack tFluid = GT_Utility.getFluidForFilledItem(aResult, true); + FluidStack tFluidStack; if (tFluid != null) { + tFluidStack = tFluid; tResults.add(GT_Utility.getFluidDisplayStack(tFluid, false)); - for (FluidContainerRegistry.FluidContainerData tData : FluidContainerRegistry.getRegisteredFluidContainerData()) { - if (tData.fluid.isFluidEqual(tFluid)) { - tResults.add(GT_Utility.copy(new Object[]{tData.filledContainer})); - } - } } - for (GT_Recipe tRecipe : getSortedRecipes()) { - if (!tRecipe.mHidden) { - CachedDefaultRecipe tNEIRecipe = new CachedDefaultRecipe(tRecipe); - for (ItemStack tStack : tResults) { - if (tNEIRecipe.contains(tNEIRecipe.mOutputs, tStack)) { - this.arecipes.add(tNEIRecipe); - break; - } - } - } + else tFluidStack = GT_Utility.getFluidFromDisplayStack(aResult); + if (tFluidStack != null) { + tResults.addAll(GT_Utility.getContainersFromFluid(tFluidStack)); + } + for (CachedDefaultRecipe recipe : getCache()) { + if (tResults.stream().anyMatch(stack -> recipe.contains(recipe.mOutputs, stack))) + arecipes.add(recipe); } } public void loadUsageRecipes(ItemStack aInput) { ItemData tPrefixMaterial = GT_OreDictUnificator.getAssociation(aInput); - ArrayList<ItemStack> tInputs = new ArrayList<ItemStack>(); + + ArrayList<ItemStack> tInputs = new ArrayList<>(); tInputs.add(aInput); tInputs.add(GT_OreDictUnificator.get(false, aInput)); if ((tPrefixMaterial != null) && (!tPrefixMaterial.mPrefix.mFamiliarPrefixes.isEmpty())) { @@ -122,24 +165,18 @@ extends TemplateRecipeHandler { } } FluidStack tFluid = GT_Utility.getFluidForFilledItem(aInput, true); + FluidStack tFluidStack; if (tFluid != null) { + tFluidStack = tFluid; tInputs.add(GT_Utility.getFluidDisplayStack(tFluid, false)); - for (FluidContainerRegistry.FluidContainerData tData : FluidContainerRegistry.getRegisteredFluidContainerData()) { - if (tData.fluid.isFluidEqual(tFluid)) { - tInputs.add(GT_Utility.copy(new Object[]{tData.filledContainer})); - } - } } - for (GT_Recipe tRecipe : getSortedRecipes()) { - if (!tRecipe.mHidden) { - CachedDefaultRecipe tNEIRecipe = new CachedDefaultRecipe(tRecipe); - for (ItemStack tStack : tInputs) { - if (tNEIRecipe.contains(tNEIRecipe.mInputs, tStack)) { - this.arecipes.add(tNEIRecipe); - break; - } - } - } + else tFluidStack = GT_Utility.getFluidFromDisplayStack(aInput); + if (tFluidStack != null) { + tInputs.addAll(GT_Utility.getContainersFromFluid(tFluidStack)); + } + for (CachedDefaultRecipe recipe : getCache()) { + if (tInputs.stream().anyMatch(stack -> recipe.contains(recipe.mInputs, stack))) + arecipes.add(recipe); } } @@ -167,7 +204,6 @@ extends TemplateRecipeHandler { @Override public String getGuiTexture() { - // return "gregtech:textures/gui/" + this.mRecipeMap.mUnlocalizedName + ".png"; return this.mRecipeMap.mNEIGUIPath; } @@ -201,13 +237,13 @@ extends TemplateRecipeHandler { @Override public void drawExtras(final int aRecipeIndex) { - final int tEUt = ((CachedDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.mEUt; - final int tDuration = ((CachedDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.mDuration; + final long tEUt = ((CachedDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.mEUt; + final long tDuration = ((CachedDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.mDuration; if (tEUt != 0) { - drawText(10, 73, "Total: " + (tDuration * tEUt) + " EU", -16777216); - drawText(10, 83, "Usage: " + tEUt + " EU/t", -16777216); + drawText(10, 73, "Total: " + MathUtils.formatNumbers((long) (tDuration * tEUt)) + " EU", -16777216); + drawText(10, 83, "Usage: " + MathUtils.formatNumbers(tEUt) + " EU/t", -16777216); if (this.mRecipeMap.mShowVoltageAmperageInNEI) { - drawText(10, 93, "Voltage: " + (tEUt / this.mRecipeMap.mAmperage) + " EU", -16777216); + drawText(10, 93, "Voltage: " + MathUtils.formatNumbers(tEUt / this.mRecipeMap.mAmperage) + " EU", -16777216); drawText(10, 103, "Amperage: " + this.mRecipeMap.mAmperage, -16777216); } else { drawText(10, 93, "Voltage: unspecified", -16777216); @@ -215,7 +251,7 @@ extends TemplateRecipeHandler { } } if (tDuration > 0) { - drawText(10, 113, "Time: " + (tDuration < 20 ? "< 1" : Integer.valueOf(tDuration / 20)) + " secs", -16777216); + drawText(10, 113, "Time: " + (tDuration < 20 ? "< 1" : MathUtils.formatNumbers(Long.valueOf(tDuration / 20))) + " secs", -16777216); } if ((GT_Utility.isStringValid(this.mRecipeMap.mNEISpecialValuePre)) || (GT_Utility.isStringValid(this.mRecipeMap.mNEISpecialValuePost))) { drawText(10, 123, this.mRecipeMap.mNEISpecialValuePre + (((CachedDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.mSpecialValue * this.mRecipeMap.mNEISpecialValueMultiplier) + this.mRecipeMap.mNEISpecialValuePost, -16777216); @@ -243,7 +279,7 @@ extends TemplateRecipeHandler { } public boolean canHandle(final GuiContainer gui) { - return (((gui instanceof GT_GUIContainer_BasicMachine)) && (GT_Utility.isStringValid(((GT_GUIContainer_BasicMachine) gui).mNEI)) /*|| ((gui instanceof GT_GUIContainer_FusionReactor)) && (GT_Utility.isStringValid(((GT_GUIContainer_FusionReactor) gui).mNEI))*/); + return (((gui instanceof GT_GUIContainer_BasicMachine)) && (GT_Utility.isStringValid(((GT_GUIContainer_BasicMachine) gui).mNEI))); } @Override @@ -251,10 +287,7 @@ extends TemplateRecipeHandler { if ((this.canHandle(gui)) && (currenttip.isEmpty())) { if ((gui instanceof GT_GUIContainer_BasicMachine) && new Rectangle(65, 13, 36, 18).contains(new Point(GuiDraw.getMousePosition().x - ((GT_GUIContainer_BasicMachine) gui).getLeft() - codechicken.nei.recipe.RecipeInfo.getGuiOffset(gui)[0], GuiDraw.getMousePosition().y - ((GT_GUIContainer_BasicMachine) gui).getTop() - codechicken.nei.recipe.RecipeInfo.getGuiOffset(gui)[1]))) { currenttip.add("Recipes"); - } /*else if (gui instanceof GT_GUIContainer_FusionReactor && new Rectangle(145, 0, 24, 24).contains(new Point(GuiDraw.getMousePosition().x - ((GT_GUIContainer_FusionReactor) gui).getLeft() - codechicken.nei.recipe.RecipeInfo.getGuiOffset(gui)[0], GuiDraw.getMousePosition().y - ((GT_GUIContainer_FusionReactor) gui).getTop() - codechicken.nei.recipe.RecipeInfo.getGuiOffset(gui)[1]))) { - currenttip.add("Recipes"); - }*/ - + } } return currenttip; } @@ -262,9 +295,7 @@ extends TemplateRecipeHandler { private boolean transferRect(final GuiContainer gui, final boolean usage) { if (gui instanceof GT_GUIContainer_BasicMachine) { return (this.canHandle(gui)) && (new Rectangle(65, 13, 36, 18).contains(new Point(GuiDraw.getMousePosition().x - ((GT_GUIContainer_BasicMachine) gui).getLeft() - codechicken.nei.recipe.RecipeInfo.getGuiOffset(gui)[0], GuiDraw.getMousePosition().y - ((GT_GUIContainer_BasicMachine) gui).getTop() - codechicken.nei.recipe.RecipeInfo.getGuiOffset(gui)[1]))) && (usage ? GuiUsageRecipe.openRecipeGui(((GT_GUIContainer_BasicMachine) gui).mNEI, new Object[0]) : GuiCraftingRecipe.openRecipeGui(((GT_GUIContainer_BasicMachine) gui).mNEI, new Object[0])); - } /*else if (gui instanceof GT_GUIContainer_FusionReactor) { - return (canHandle(gui)) && (new Rectangle(145, 0, 24, 24).contains(new Point(GuiDraw.getMousePosition().x - ((GT_GUIContainer_FusionReactor) gui).getLeft() - codechicken.nei.recipe.RecipeInfo.getGuiOffset(gui)[0], GuiDraw.getMousePosition().y - ((GT_GUIContainer_FusionReactor) gui).getTop() - codechicken.nei.recipe.RecipeInfo.getGuiOffset(gui)[1]))) && (usage ? GuiUsageRecipe.openRecipeGui(((GT_GUIContainer_FusionReactor) gui).mNEI, new Object[0]) : GuiCraftingRecipe.openRecipeGui(((GT_GUIContainer_FusionReactor) gui).mNEI, new Object[0])); - }*/ + } return false; } @@ -357,8 +388,7 @@ extends TemplateRecipeHandler { } } - public class CachedDefaultRecipe - extends TemplateRecipeHandler.CachedRecipe { + public class CachedDefaultRecipe extends TemplateRecipeHandler.CachedRecipe { public final GT_Recipe mRecipe; public final List<PositionedStack> mOutputs = new ArrayList<PositionedStack>(); public final List<PositionedStack> mInputs = new ArrayList<PositionedStack>(); @@ -366,442 +396,444 @@ extends TemplateRecipeHandler { public CachedDefaultRecipe(final GT_Recipe aRecipe) { super(); this.mRecipe = aRecipe; - + handleSlots(); + } + + public void handleSlots() { int tStartIndex = 0; switch (GTPP_NEI_DefaultHandler.this.mRecipeMap.mUsualInputCount) { case 0: break; case 1: - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 48, 14)); + if (mRecipe.getRepresentativeInput(tStartIndex) != null) { + this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 48, 14)); } tStartIndex++; break; case 2: - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 30, 14)); + if (mRecipe.getRepresentativeInput(tStartIndex) != null) { + this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 30, 14)); } tStartIndex++; - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 48, 14)); + if (mRecipe.getRepresentativeInput(tStartIndex) != null) { + this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 48, 14)); } tStartIndex++; break; case 3: - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 12, 14)); + if (mRecipe.getRepresentativeInput(tStartIndex) != null) { + this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 12, 14)); } tStartIndex++; - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 30, 14)); + if (mRecipe.getRepresentativeInput(tStartIndex) != null) { + this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 30, 14)); } tStartIndex++; - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 48, 14)); + if (mRecipe.getRepresentativeInput(tStartIndex) != null) { + this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 48, 14)); } tStartIndex++; break; case 4: - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 30, 5)); + if (mRecipe.getRepresentativeInput(tStartIndex) != null) { + this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 30, 5)); } tStartIndex++; - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 48, 5)); + if (mRecipe.getRepresentativeInput(tStartIndex) != null) { + this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 48, 5)); } tStartIndex++; - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 30, 23)); + if (mRecipe.getRepresentativeInput(tStartIndex) != null) { + this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 30, 23)); } tStartIndex++; - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 48, 23)); + if (mRecipe.getRepresentativeInput(tStartIndex) != null) { + this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 48, 23)); } tStartIndex++; break; case 5: - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 12, 5)); + if (mRecipe.getRepresentativeInput(tStartIndex) != null) { + this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 12, 5)); } tStartIndex++; - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 30, 5)); + if (mRecipe.getRepresentativeInput(tStartIndex) != null) { + this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 30, 5)); } tStartIndex++; - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 48, 5)); + if (mRecipe.getRepresentativeInput(tStartIndex) != null) { + this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 48, 5)); } tStartIndex++; - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 30, 23)); + if (mRecipe.getRepresentativeInput(tStartIndex) != null) { + this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 30, 23)); } tStartIndex++; - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 48, 23)); + if (mRecipe.getRepresentativeInput(tStartIndex) != null) { + this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 48, 23)); } tStartIndex++; break; case 6: - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 12, 5)); + if (mRecipe.getRepresentativeInput(tStartIndex) != null) { + this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 12, 5)); } tStartIndex++; - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 30, 5)); + if (mRecipe.getRepresentativeInput(tStartIndex) != null) { + this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 30, 5)); } tStartIndex++; - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 48, 5)); + if (mRecipe.getRepresentativeInput(tStartIndex) != null) { + this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 48, 5)); } tStartIndex++; - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 12, 23)); + if (mRecipe.getRepresentativeInput(tStartIndex) != null) { + this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 12, 23)); } tStartIndex++; - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 30, 23)); + if (mRecipe.getRepresentativeInput(tStartIndex) != null) { + this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 30, 23)); } tStartIndex++; - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 48, 23)); + if (mRecipe.getRepresentativeInput(tStartIndex) != null) { + this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 48, 23)); } tStartIndex++; break; case 7: - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 12, -4)); + if (mRecipe.getRepresentativeInput(tStartIndex) != null) { + this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 12, -4)); } tStartIndex++; - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 30, -4)); + if (mRecipe.getRepresentativeInput(tStartIndex) != null) { + this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 30, -4)); } tStartIndex++; - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 48, -4)); + if (mRecipe.getRepresentativeInput(tStartIndex) != null) { + this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 48, -4)); } tStartIndex++; - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 12, 14)); + if (mRecipe.getRepresentativeInput(tStartIndex) != null) { + this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 12, 14)); } tStartIndex++; - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 30, 14)); + if (mRecipe.getRepresentativeInput(tStartIndex) != null) { + this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 30, 14)); } tStartIndex++; - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 48, 14)); + if (mRecipe.getRepresentativeInput(tStartIndex) != null) { + this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 48, 14)); } tStartIndex++; - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 12, 32)); + if (mRecipe.getRepresentativeInput(tStartIndex) != null) { + this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 12, 32)); } tStartIndex++; break; case 8: - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 12, -4)); + if (mRecipe.getRepresentativeInput(tStartIndex) != null) { + this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 12, -4)); } tStartIndex++; - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 30, -4)); + if (mRecipe.getRepresentativeInput(tStartIndex) != null) { + this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 30, -4)); } tStartIndex++; - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 48, -4)); + if (mRecipe.getRepresentativeInput(tStartIndex) != null) { + this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 48, -4)); } tStartIndex++; - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 12, 14)); + if (mRecipe.getRepresentativeInput(tStartIndex) != null) { + this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 12, 14)); } tStartIndex++; - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 30, 14)); + if (mRecipe.getRepresentativeInput(tStartIndex) != null) { + this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 30, 14)); } tStartIndex++; - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 48, 14)); + if (mRecipe.getRepresentativeInput(tStartIndex) != null) { + this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 48, 14)); } tStartIndex++; - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 12, 32)); + if (mRecipe.getRepresentativeInput(tStartIndex) != null) { + this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 12, 32)); } tStartIndex++; - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 30, 32)); + if (mRecipe.getRepresentativeInput(tStartIndex) != null) { + this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 30, 32)); } tStartIndex++; break; default: - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 12, -4)); + if (mRecipe.getRepresentativeInput(tStartIndex) != null) { + this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 12, -4)); } tStartIndex++; - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 30, -4)); + if (mRecipe.getRepresentativeInput(tStartIndex) != null) { + this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 30, -4)); } tStartIndex++; - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 48, -4)); + if (mRecipe.getRepresentativeInput(tStartIndex) != null) { + this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 48, -4)); } tStartIndex++; - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 12, 14)); + if (mRecipe.getRepresentativeInput(tStartIndex) != null) { + this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 12, 14)); } tStartIndex++; - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 30, 14)); + if (mRecipe.getRepresentativeInput(tStartIndex) != null) { + this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 30, 14)); } tStartIndex++; - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 48, 14)); + if (mRecipe.getRepresentativeInput(tStartIndex) != null) { + this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 48, 14)); } tStartIndex++; - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 12, 32)); + if (mRecipe.getRepresentativeInput(tStartIndex) != null) { + this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 12, 32)); } tStartIndex++; - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 30, 32)); + if (mRecipe.getRepresentativeInput(tStartIndex) != null) { + this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 30, 32)); } tStartIndex++; - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 48, 32)); + if (mRecipe.getRepresentativeInput(tStartIndex) != null) { + this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 48, 32)); } tStartIndex++; } - if (aRecipe.mSpecialItems != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.mSpecialItems, 120, 52)); + if (mRecipe.mSpecialItems != null) { + this.mInputs.add(new FixedPositionedStack(mRecipe.mSpecialItems, 120, 52)); } tStartIndex = 0; switch (GTPP_NEI_DefaultHandler.this.mRecipeMap.mUsualOutputCount) { case 0: break; case 1: - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 102, 14, aRecipe.getOutputChance(tStartIndex))); + if (mRecipe.getOutput(tStartIndex) != null) { + this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 102, 14, mRecipe.getOutputChance(tStartIndex))); } tStartIndex++; break; case 2: - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 102, 14, aRecipe.getOutputChance(tStartIndex))); + if (mRecipe.getOutput(tStartIndex) != null) { + this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 102, 14, mRecipe.getOutputChance(tStartIndex))); } tStartIndex++; - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 120, 14, aRecipe.getOutputChance(tStartIndex))); + if (mRecipe.getOutput(tStartIndex) != null) { + this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 120, 14, mRecipe.getOutputChance(tStartIndex))); } tStartIndex++; break; case 3: - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 102, 14, aRecipe.getOutputChance(tStartIndex))); + if (mRecipe.getOutput(tStartIndex) != null) { + this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 102, 14, mRecipe.getOutputChance(tStartIndex))); } tStartIndex++; - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 120, 14, aRecipe.getOutputChance(tStartIndex))); + if (mRecipe.getOutput(tStartIndex) != null) { + this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 120, 14, mRecipe.getOutputChance(tStartIndex))); } tStartIndex++; - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 138, 14, aRecipe.getOutputChance(tStartIndex))); + if (mRecipe.getOutput(tStartIndex) != null) { + this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 138, 14, mRecipe.getOutputChance(tStartIndex))); } tStartIndex++; break; case 4: - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 102, 5, aRecipe.getOutputChance(tStartIndex))); + if (mRecipe.getOutput(tStartIndex) != null) { + this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 102, 5, mRecipe.getOutputChance(tStartIndex))); } tStartIndex++; - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 120, 5, aRecipe.getOutputChance(tStartIndex))); + if (mRecipe.getOutput(tStartIndex) != null) { + this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 120, 5, mRecipe.getOutputChance(tStartIndex))); } tStartIndex++; - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 102, 23, aRecipe.getOutputChance(tStartIndex))); + if (mRecipe.getOutput(tStartIndex) != null) { + this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 102, 23, mRecipe.getOutputChance(tStartIndex))); } tStartIndex++; - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 120, 23, aRecipe.getOutputChance(tStartIndex))); + if (mRecipe.getOutput(tStartIndex) != null) { + this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 120, 23, mRecipe.getOutputChance(tStartIndex))); } tStartIndex++; break; case 5: - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 102, 5, aRecipe.getOutputChance(tStartIndex))); + if (mRecipe.getOutput(tStartIndex) != null) { + this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 102, 5, mRecipe.getOutputChance(tStartIndex))); } tStartIndex++; - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 120, 5, aRecipe.getOutputChance(tStartIndex))); + if (mRecipe.getOutput(tStartIndex) != null) { + this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 120, 5, mRecipe.getOutputChance(tStartIndex))); } tStartIndex++; - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 138, 5, aRecipe.getOutputChance(tStartIndex))); + if (mRecipe.getOutput(tStartIndex) != null) { + this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 138, 5, mRecipe.getOutputChance(tStartIndex))); } tStartIndex++; - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 102, 23, aRecipe.getOutputChance(tStartIndex))); + if (mRecipe.getOutput(tStartIndex) != null) { + this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 102, 23, mRecipe.getOutputChance(tStartIndex))); } tStartIndex++; - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 120, 23, aRecipe.getOutputChance(tStartIndex))); + if (mRecipe.getOutput(tStartIndex) != null) { + this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 120, 23, mRecipe.getOutputChance(tStartIndex))); } tStartIndex++; break; case 6: - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 102, 5, aRecipe.getOutputChance(tStartIndex))); + if (mRecipe.getOutput(tStartIndex) != null) { + this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 102, 5, mRecipe.getOutputChance(tStartIndex))); } tStartIndex++; - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 120, 5, aRecipe.getOutputChance(tStartIndex))); + if (mRecipe.getOutput(tStartIndex) != null) { + this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 120, 5, mRecipe.getOutputChance(tStartIndex))); } tStartIndex++; - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 138, 5, aRecipe.getOutputChance(tStartIndex))); + if (mRecipe.getOutput(tStartIndex) != null) { + this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 138, 5, mRecipe.getOutputChance(tStartIndex))); } tStartIndex++; - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 102, 23, aRecipe.getOutputChance(tStartIndex))); + if (mRecipe.getOutput(tStartIndex) != null) { + this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 102, 23, mRecipe.getOutputChance(tStartIndex))); } tStartIndex++; - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 120, 23, aRecipe.getOutputChance(tStartIndex))); + if (mRecipe.getOutput(tStartIndex) != null) { + this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 120, 23, mRecipe.getOutputChance(tStartIndex))); } tStartIndex++; - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 138, 23, aRecipe.getOutputChance(tStartIndex))); + if (mRecipe.getOutput(tStartIndex) != null) { + this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 138, 23, mRecipe.getOutputChance(tStartIndex))); } tStartIndex++; break; case 7: - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 102, -4, aRecipe.getOutputChance(tStartIndex))); + if (mRecipe.getOutput(tStartIndex) != null) { + this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 102, -4, mRecipe.getOutputChance(tStartIndex))); } tStartIndex++; - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 120, -4, aRecipe.getOutputChance(tStartIndex))); + if (mRecipe.getOutput(tStartIndex) != null) { + this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 120, -4, mRecipe.getOutputChance(tStartIndex))); } tStartIndex++; - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 138, -4, aRecipe.getOutputChance(tStartIndex))); + if (mRecipe.getOutput(tStartIndex) != null) { + this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 138, -4, mRecipe.getOutputChance(tStartIndex))); } tStartIndex++; - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 102, 14, aRecipe.getOutputChance(tStartIndex))); + if (mRecipe.getOutput(tStartIndex) != null) { + this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 102, 14, mRecipe.getOutputChance(tStartIndex))); } tStartIndex++; - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 120, 14, aRecipe.getOutputChance(tStartIndex))); + if (mRecipe.getOutput(tStartIndex) != null) { + this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 120, 14, mRecipe.getOutputChance(tStartIndex))); } tStartIndex++; - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 138, 14, aRecipe.getOutputChance(tStartIndex))); + if (mRecipe.getOutput(tStartIndex) != null) { + this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 138, 14, mRecipe.getOutputChance(tStartIndex))); } tStartIndex++; - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 102, 32, aRecipe.getOutputChance(tStartIndex))); + if (mRecipe.getOutput(tStartIndex) != null) { + this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 102, 32, mRecipe.getOutputChance(tStartIndex))); } tStartIndex++; break; case 8: - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 102, -4, aRecipe.getOutputChance(tStartIndex))); + if (mRecipe.getOutput(tStartIndex) != null) { + this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 102, -4, mRecipe.getOutputChance(tStartIndex))); } tStartIndex++; - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 120, -4, aRecipe.getOutputChance(tStartIndex))); + if (mRecipe.getOutput(tStartIndex) != null) { + this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 120, -4, mRecipe.getOutputChance(tStartIndex))); } tStartIndex++; - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 138, -4, aRecipe.getOutputChance(tStartIndex))); + if (mRecipe.getOutput(tStartIndex) != null) { + this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 138, -4, mRecipe.getOutputChance(tStartIndex))); } tStartIndex++; - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 102, 14, aRecipe.getOutputChance(tStartIndex))); + if (mRecipe.getOutput(tStartIndex) != null) { + this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 102, 14, mRecipe.getOutputChance(tStartIndex))); } tStartIndex++; - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 120, 14, aRecipe.getOutputChance(tStartIndex))); + if (mRecipe.getOutput(tStartIndex) != null) { + this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 120, 14, mRecipe.getOutputChance(tStartIndex))); } tStartIndex++; - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 138, 14, aRecipe.getOutputChance(tStartIndex))); + if (mRecipe.getOutput(tStartIndex) != null) { + this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 138, 14, mRecipe.getOutputChance(tStartIndex))); } tStartIndex++; - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 102, 32, aRecipe.getOutputChance(tStartIndex))); + if (mRecipe.getOutput(tStartIndex) != null) { + this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 102, 32, mRecipe.getOutputChance(tStartIndex))); } tStartIndex++; - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 120, 32, aRecipe.getOutputChance(tStartIndex))); + if (mRecipe.getOutput(tStartIndex) != null) { + this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 120, 32, mRecipe.getOutputChance(tStartIndex))); } tStartIndex++; break; default: - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 102, -4, aRecipe.getOutputChance(tStartIndex))); + if (mRecipe.getOutput(tStartIndex) != null) { + this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 102, -4, mRecipe.getOutputChance(tStartIndex))); } tStartIndex++; - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 120, -4, aRecipe.getOutputChance(tStartIndex))); + if (mRecipe.getOutput(tStartIndex) != null) { + this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 120, -4, mRecipe.getOutputChance(tStartIndex))); } tStartIndex++; - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 138, -4, aRecipe.getOutputChance(tStartIndex))); + if (mRecipe.getOutput(tStartIndex) != null) { + this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 138, -4, mRecipe.getOutputChance(tStartIndex))); } tStartIndex++; - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 102, 14, aRecipe.getOutputChance(tStartIndex))); + if (mRecipe.getOutput(tStartIndex) != null) { + this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 102, 14, mRecipe.getOutputChance(tStartIndex))); } tStartIndex++; - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 120, 14, aRecipe.getOutputChance(tStartIndex))); + if (mRecipe.getOutput(tStartIndex) != null) { + this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 120, 14, mRecipe.getOutputChance(tStartIndex))); } tStartIndex++; - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 138, 14, aRecipe.getOutputChance(tStartIndex))); + if (mRecipe.getOutput(tStartIndex) != null) { + this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 138, 14, mRecipe.getOutputChance(tStartIndex))); } tStartIndex++; - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 102, 32, aRecipe.getOutputChance(tStartIndex))); + if (mRecipe.getOutput(tStartIndex) != null) { + this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 102, 32, mRecipe.getOutputChance(tStartIndex))); } tStartIndex++; - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 120, 32, aRecipe.getOutputChance(tStartIndex))); + if (mRecipe.getOutput(tStartIndex) != null) { + this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 120, 32, mRecipe.getOutputChance(tStartIndex))); } tStartIndex++; - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 138, 32, aRecipe.getOutputChance(tStartIndex))); + if (mRecipe.getOutput(tStartIndex) != null) { + this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 138, 32, mRecipe.getOutputChance(tStartIndex))); } tStartIndex++; } - if ((aRecipe.mFluidInputs.length > 0) && (aRecipe.mFluidInputs[0] != null) && (aRecipe.mFluidInputs[0].getFluid() != null)) { - this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidInputs[0], true), 48, 52)); - if ((aRecipe.mFluidInputs.length > 1) && (aRecipe.mFluidInputs[1] != null) && (aRecipe.mFluidInputs[1].getFluid() != null)) { - this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidInputs[1], true), 30, 52)); + if ((mRecipe.mFluidInputs.length > 0) && (mRecipe.mFluidInputs[0] != null) && (mRecipe.mFluidInputs[0].getFluid() != null)) { + this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidInputs[0], true), 48, 52)); + if ((mRecipe.mFluidInputs.length > 1) && (mRecipe.mFluidInputs[1] != null) && (mRecipe.mFluidInputs[1].getFluid() != null)) { + this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidInputs[1], true), 30, 52)); } } - if (aRecipe.mFluidOutputs.length > 1) { - if (aRecipe.mFluidOutputs[0] != null && (aRecipe.mFluidOutputs[0].getFluid() != null)) { - this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidOutputs[0], true), 120, 5)); + if (mRecipe.mFluidOutputs.length > 1) { + if (mRecipe.mFluidOutputs[0] != null && (mRecipe.mFluidOutputs[0].getFluid() != null)) { + this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidOutputs[0], true), 120, 5)); } - if (aRecipe.mFluidOutputs[1] != null && (aRecipe.mFluidOutputs[1].getFluid() != null)) { - this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidOutputs[1], true), 138, 5)); + if (mRecipe.mFluidOutputs[1] != null && (mRecipe.mFluidOutputs[1].getFluid() != null)) { + this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidOutputs[1], true), 138, 5)); } - if (aRecipe.mFluidOutputs.length > 2 && aRecipe.mFluidOutputs[2] != null && (aRecipe.mFluidOutputs[2].getFluid() != null)) { - this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidOutputs[2], true), 102, 23)); + if (mRecipe.mFluidOutputs.length > 2 && mRecipe.mFluidOutputs[2] != null && (mRecipe.mFluidOutputs[2].getFluid() != null)) { + this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidOutputs[2], true), 102, 23)); } - if (aRecipe.mFluidOutputs.length > 3 && aRecipe.mFluidOutputs[3] != null && (aRecipe.mFluidOutputs[3].getFluid() != null)) { - this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidOutputs[3], true), 120, 23)); + if (mRecipe.mFluidOutputs.length > 3 && mRecipe.mFluidOutputs[3] != null && (mRecipe.mFluidOutputs[3].getFluid() != null)) { + this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidOutputs[3], true), 120, 23)); } - if (aRecipe.mFluidOutputs.length > 4 && aRecipe.mFluidOutputs[4] != null && (aRecipe.mFluidOutputs[4].getFluid() != null)) { - this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidOutputs[4], true), 138, 23)); + if (mRecipe.mFluidOutputs.length > 4 && mRecipe.mFluidOutputs[4] != null && (mRecipe.mFluidOutputs[4].getFluid() != null)) { + this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidOutputs[4], true), 138, 23)); } - } else if ((aRecipe.mFluidOutputs.length > 0) && (aRecipe.mFluidOutputs[0] != null) && (aRecipe.mFluidOutputs[0].getFluid() != null)) { - this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidOutputs[0], true), 102, 52)); - } - + } else if ((mRecipe.mFluidOutputs.length > 0) && (mRecipe.mFluidOutputs[0] != null) && (mRecipe.mFluidOutputs[0].getFluid() != null)) { + this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidOutputs[0], true), 102, 52)); + } } @Override @@ -819,4 +851,92 @@ extends TemplateRecipeHandler { return this.mOutputs; } } + + public class NoCellMultiDefaultRecipe extends CachedDefaultRecipe { + + public NoCellMultiDefaultRecipe(final GT_Recipe aRecipe) { + super(aRecipe); + + } + + @Override + public void handleSlots() { + + int aInputItemsCount = this.mRecipe.mInputs.length; + int aInputFluidsCount = this.mRecipe.mFluidInputs.length; + int aOutputItemsCount = this.mRecipe.mOutputs.length; + int aOutputFluidsCount = this.mRecipe.mFluidOutputs.length; + int aInputSlotsUsed = 0; + int aOutputSlotsUsed = 0; + int aSlotToCheck = 0; + + // Special Slot + if (mRecipe.mSpecialItems != null) { + this.mInputs.add(new FixedPositionedStack(mRecipe.mSpecialItems, 120, 52)); + } + + /* + * Items + */ + + // Upto 9 Inputs Slots + if (aInputItemsCount > 0) { + if (aInputItemsCount > 9) { + aInputItemsCount = 9; + } + for (int i=0;i<aInputItemsCount;i++) { + int x = mInputSlotMap.get(aInputSlotsUsed).getKey(); + int y = mInputSlotMap.get(aInputSlotsUsed).getValue(); + ItemStack aRepStack = mRecipe.getRepresentativeInput(aSlotToCheck++); + if (aRepStack != null) { + this.mInputs.add(new FixedPositionedStack(aRepStack, x, y)); + aInputSlotsUsed++; + } + } + } + aSlotToCheck = 0; + // Upto 9 Output Slots + if (aOutputItemsCount > 0) { + if (aOutputItemsCount > 9) { + aOutputItemsCount = 9; + } + for (int i=0;i<aOutputItemsCount;i++) { + int x = mOutputSlotMap.get(aOutputSlotsUsed).getKey(); + int y = mOutputSlotMap.get(aOutputSlotsUsed).getValue(); + ItemStack aRepStack = mRecipe.getOutput(aSlotToCheck++); + if (aRepStack != null) { + this.mOutputs.add(new FixedPositionedStack(aRepStack, x, y, mRecipe.getOutputChance(aSlotToCheck))); + aOutputSlotsUsed++; + } + } + } + + /* + * Fluids + */ + + // Upto 9 Fluid Inputs Slots + aSlotToCheck = aInputSlotsUsed; + if (aInputFluidsCount > 0) { + for (int i=0;i<aInputFluidsCount;i++) { + int x = mInputSlotMap.get(aSlotToCheck).getKey(); + int y = mInputSlotMap.get(aSlotToCheck).getValue(); + this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidInputs[i], true), x, y)); + aSlotToCheck++; + aInputSlotsUsed++; + } + } + // Upto 9 Fluid Outputs Slots + aSlotToCheck = aOutputSlotsUsed; + if (aOutputFluidsCount > 0) { + for (int i=0;i<aOutputFluidsCount;i++) { + int x = mOutputSlotMap.get(aSlotToCheck).getKey(); + int y = mOutputSlotMap.get(aSlotToCheck).getValue(); + this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidOutputs[i], true), x, y)); + aSlotToCheck++; + aOutputSlotsUsed++; + } + } + } + } } diff --git a/src/Java/gtPlusPlus/nei/GT_NEI_FlotationCell.java b/src/Java/gtPlusPlus/nei/GT_NEI_FlotationCell.java index c4eff20a27..ca12e1c740 100644 --- a/src/Java/gtPlusPlus/nei/GT_NEI_FlotationCell.java +++ b/src/Java/gtPlusPlus/nei/GT_NEI_FlotationCell.java @@ -1,63 +1,14 @@ package gtPlusPlus.nei; -import java.awt.Point; -import java.awt.Rectangle; -import java.util.*; - -import org.lwjgl.opengl.GL11; - -import codechicken.lib.gui.GuiDraw; -import codechicken.nei.PositionedStack; -import codechicken.nei.guihook.GuiContainerManager; -import codechicken.nei.guihook.IContainerInputHandler; -import codechicken.nei.guihook.IContainerTooltipHandler; -import codechicken.nei.recipe.*; -import cpw.mods.fml.common.event.FMLInterModComms; -import gregtech.api.enums.GT_Values; -import gregtech.api.enums.OrePrefixes; -import gregtech.api.gui.GT_GUIContainer_BasicMachine; -import gregtech.api.objects.ItemData; -import gregtech.api.util.*; -import gregtech.api.util.GT_Recipe.GT_Recipe_Map; +import codechicken.nei.recipe.TemplateRecipeHandler; import gregtech.api.util.GTPP_Recipe.GTPP_Recipe_Map; -import gtPlusPlus.core.util.minecraft.ItemUtils; -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.inventory.GuiContainer; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; -import net.minecraftforge.fluids.FluidContainerRegistry; -import net.minecraftforge.fluids.FluidStack; - -public class GT_NEI_FlotationCell -extends TemplateRecipeHandler { - public static final int sOffsetX = 5; - public static final int sOffsetY = 11; - - static { - GuiContainerManager.addInputHandler(new GT_RectHandler()); - GuiContainerManager.addTooltipHandler(new GT_RectHandler()); - } +import gregtech.api.util.GT_Recipe; +import gregtech.api.util.GT_Utility; - protected GT_Recipe_Map mRecipeMap; +public class GT_NEI_FlotationCell extends GTPP_NEI_DefaultHandler { public GT_NEI_FlotationCell() { - this.mRecipeMap = GTPP_Recipe_Map.sFlotationCellRecipes; - this.transferRects.add(new TemplateRecipeHandler.RecipeTransferRect(new Rectangle(65, 13, 36, 18), this.getRecipeMapName(), new Object[0])); - if (!NEI_GT_Config.sIsAdded) { - FMLInterModComms.sendRuntimeMessage(GT_Values.GT, "NEIPlugins", "register-crafting-handler", "gregtechplusplus@" + this.getRecipeName() + "@" + this.getRecipeMapName()); - GuiCraftingRecipe.craftinghandlers.add(this); - GuiUsageRecipe.usagehandlers.add(this); - } - } - - public List<GTPP_Recipe> getSortedRecipes() { - List<GTPP_Recipe> result = new ArrayList(this.mRecipeMap.mRecipeList); - Collections.sort(result); - return result; - } - - public static void drawText(final int aX, final int aY, final String aString, final int aColor) { - Minecraft.getMinecraft().fontRenderer.drawString(aString, aX, aY, aColor); + super(GTPP_Recipe_Map.sFlotationCellRecipes); } @Override @@ -66,397 +17,84 @@ extends TemplateRecipeHandler { } @Override - public void loadCraftingRecipes(final String outputId, final Object... results) { - if (outputId.equals(getRecipeMapName())) { - for (GTPP_Recipe tRecipe : getSortedRecipes()) { - if (!tRecipe.mHidden) { - this.arecipes.add(new CachedDefaultRecipe(tRecipe)); - } - } - } else { - super.loadCraftingRecipes(outputId, results); - } - } - - @Override - public void loadCraftingRecipes(final ItemStack aResult) { - ItemData tPrefixMaterial = GT_OreDictUnificator.getAssociation(aResult); - - ArrayList<ItemStack> tResults = new ArrayList<ItemStack>(); - tResults.add(aResult); - tResults.add(GT_OreDictUnificator.get(true, aResult)); - if ((tPrefixMaterial != null) && (!tPrefixMaterial.mBlackListed) && (!tPrefixMaterial.mPrefix.mFamiliarPrefixes.isEmpty())) { - for (OrePrefixes tPrefix : tPrefixMaterial.mPrefix.mFamiliarPrefixes) { - tResults.add(GT_OreDictUnificator.get(tPrefix, tPrefixMaterial.mMaterial.mMaterial, 1L)); - } - } - FluidStack tFluid = GT_Utility.getFluidForFilledItem(aResult, true); - if (tFluid != null) { - tResults.add(GT_Utility.getFluidDisplayStack(tFluid, false)); - for (FluidContainerRegistry.FluidContainerData tData : FluidContainerRegistry.getRegisteredFluidContainerData()) { - if (tData.fluid.isFluidEqual(tFluid)) { - tResults.add(GT_Utility.copy(new Object[]{tData.filledContainer})); - } - } - } - for (GTPP_Recipe tRecipe : getSortedRecipes()) { - if (!tRecipe.mHidden) { - CachedDefaultRecipe tNEIRecipe = new CachedDefaultRecipe(tRecipe); - for (ItemStack tStack : tResults) { - if (tNEIRecipe.contains(tNEIRecipe.mOutputs, tStack)) { - this.arecipes.add(tNEIRecipe); - break; - } - } - } - } - //CachedDefaultRecipe tNEIRecipe; - } - - public void loadUsageRecipes(ItemStack aInput) { - ItemData tPrefixMaterial = GT_OreDictUnificator.getAssociation(aInput); - - ArrayList<ItemStack> tInputs = new ArrayList<ItemStack>(); - tInputs.add(aInput); - tInputs.add(GT_OreDictUnificator.get(false, aInput)); - if ((tPrefixMaterial != null) && (!tPrefixMaterial.mPrefix.mFamiliarPrefixes.isEmpty())) { - for (OrePrefixes tPrefix : tPrefixMaterial.mPrefix.mFamiliarPrefixes) { - tInputs.add(GT_OreDictUnificator.get(tPrefix, tPrefixMaterial.mMaterial.mMaterial, 1L)); - } - } - FluidStack tFluid = GT_Utility.getFluidForFilledItem(aInput, true); - if (tFluid != null) { - tInputs.add(GT_Utility.getFluidDisplayStack(tFluid, false)); - for (FluidContainerRegistry.FluidContainerData tData : FluidContainerRegistry.getRegisteredFluidContainerData()) { - if (tData.fluid.isFluidEqual(tFluid)) { - tInputs.add(GT_Utility.copy(new Object[]{tData.filledContainer})); - } - } - } - for (GTPP_Recipe tRecipe : getSortedRecipes()) { - if (!tRecipe.mHidden) { - CachedDefaultRecipe tNEIRecipe = new CachedDefaultRecipe(tRecipe); - for (ItemStack tStack : tInputs) { - if (tNEIRecipe.contains(tNEIRecipe.mInputs, tStack)) { - this.arecipes.add(tNEIRecipe); - break; - } - } - } - } - //CachedDefaultRecipe tNEIRecipe; - } - - public String getRecipeMapName() { - return this.mRecipeMap.mNEIName; - } - - @Override - public String getOverlayIdentifier() { - return this.mRecipeMap.mNEIName; - } - - @Override - public void drawBackground(final int recipe) { - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - GuiDraw.changeTexture(this.getGuiTexture()); - GuiDraw.drawTexturedModalRect(-4, -8, 1, 3, 174, 78); - } - - @Override - public int recipiesPerPage() { - return 1; - } - - @Override - public String getRecipeName() { - return GT_LanguageManager.getTranslation(this.mRecipeMap.mUnlocalizedName); - } - - @Override - public String getGuiTexture() { - return this.mRecipeMap.mNEIGUIPath; - } - - @Override - public List<String> handleItemTooltip(final GuiRecipe gui, final ItemStack aStack, final List<String> currenttip, final int aRecipeIndex) { - final TemplateRecipeHandler.CachedRecipe tObject = this.arecipes.get(aRecipeIndex); - if ((tObject instanceof CachedDefaultRecipe)) { - final CachedDefaultRecipe tRecipe = (CachedDefaultRecipe) tObject; - for (final PositionedStack tStack : tRecipe.mOutputs) { - if (aStack == tStack.item) { - if ((!(tStack instanceof FixedPositionedStack)) || (((FixedPositionedStack) tStack).mChance <= 0) || (((FixedPositionedStack) tStack).mChance == 10000)) { - break; - } - currenttip.add("Chance: " + (((FixedPositionedStack) tStack).mChance / 100) + "." + ((((FixedPositionedStack) tStack).mChance % 100) < 10 ? "0" + (((FixedPositionedStack) tStack).mChance % 100) : Integer.valueOf(((FixedPositionedStack) tStack).mChance % 100)) + "%"); - break; - } - } - for (final PositionedStack tStack : tRecipe.mInputs) { - if (GT_Utility.areStacksEqual(aStack, tStack.item)) { - if ((gregtech.api.enums.ItemList.Display_Fluid.isStackEqual(tStack.item, true, true)) || - (tStack.item.stackSize != 0)) { - break; - } - if (ItemUtils.isControlCircuit(aStack)) { - currenttip.add("Does not get consumed in the process"); - } - break; - } - } - } - return currenttip; - } - - @Override - public void drawExtras(final int aRecipeIndex) { - final long tEUt = ((CachedDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.mEUt; - final int tDuration = ((CachedDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.mDuration; - if (tEUt != 0) { - drawText(10, 73, "Total: " + (long) (tDuration * tEUt) + " EU", -16777216); - //drawText(10, 83, "Usage: " + tEUt + " EU/t", -16777216); - if (this.mRecipeMap.mShowVoltageAmperageInNEI) { - drawText(10, 83, "Voltage: " + (tEUt / this.mRecipeMap.mAmperage) + " EU/t", -16777216); - drawText(10, 93, "Amperage: " + this.mRecipeMap.mAmperage, -16777216); - } else { - drawText(10, 93, "Voltage: unspecified", -16777216); - drawText(10, 103, "Amperage: unspecified", -16777216); - } - } - if (tDuration > 0) { - drawText(10, 103, "Time: " + (tDuration < 20 ? "< 1" : Integer.valueOf(tDuration / 20)) + " secs", -16777216); - } - //if ((GT_Utility.isStringValid(this.mRecipeMap.mNEISpecialValuePre)) || (GT_Utility.isStringValid(this.mRecipeMap.mNEISpecialValuePost))) { - //drawText(10, 113, this.mRecipeMap.mNEISpecialValuePre + (((CachedDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.mSpecialValue * this.mRecipeMap.mNEISpecialValueMultiplier) + this.mRecipeMap.mNEISpecialValuePost, -16777216); - //} - } + public CachedDefaultRecipe createCachedRecipe(GT_Recipe aRecipe) { + return new FlotationCellDefaultRecipe(aRecipe); + } - public static class GT_RectHandler - implements IContainerInputHandler, IContainerTooltipHandler { - @Override - public boolean mouseClicked(final GuiContainer gui, final int mousex, final int mousey, final int button) { - if (this.canHandle(gui)) { - if (button == 0) { - return this.transferRect(gui, false); - } - if (button == 1) { - return this.transferRect(gui, true); - } - } - return false; - } + public class FlotationCellDefaultRecipe extends CachedDefaultRecipe { - @Override - public boolean lastKeyTyped(final GuiContainer gui, final char keyChar, final int keyCode) { - return false; - } - - public boolean canHandle(final GuiContainer gui) { - return (((gui instanceof GT_GUIContainer_BasicMachine)) && (GT_Utility.isStringValid(((GT_GUIContainer_BasicMachine) gui).mNEI)) /*|| ((gui instanceof GT_GUIContainer_FusionReactor)) && (GT_Utility.isStringValid(((GT_GUIContainer_FusionReactor) gui).mNEI))*/); + public FlotationCellDefaultRecipe(final GT_Recipe aRecipe) { + super(aRecipe); } @Override - public List<String> handleTooltip(final GuiContainer gui, final int mousex, final int mousey, final List<String> currenttip) { - if ((this.canHandle(gui)) && (currenttip.isEmpty())) { - if ((gui instanceof GT_GUIContainer_BasicMachine) && new Rectangle(65, 13, 36, 18).contains(new Point(GuiDraw.getMousePosition().x - ((GT_GUIContainer_BasicMachine) gui).getLeft() - codechicken.nei.recipe.RecipeInfo.getGuiOffset(gui)[0], GuiDraw.getMousePosition().y - ((GT_GUIContainer_BasicMachine) gui).getTop() - codechicken.nei.recipe.RecipeInfo.getGuiOffset(gui)[1]))) { - currenttip.add("Recipes"); - } /*else if (gui instanceof GT_GUIContainer_FusionReactor && new Rectangle(145, 0, 24, 24).contains(new Point(GuiDraw.getMousePosition().x - ((GT_GUIContainer_FusionReactor) gui).getLeft() - codechicken.nei.recipe.RecipeInfo.getGuiOffset(gui)[0], GuiDraw.getMousePosition().y - ((GT_GUIContainer_FusionReactor) gui).getTop() - codechicken.nei.recipe.RecipeInfo.getGuiOffset(gui)[1]))) { - currenttip.add("Recipes"); - }*/ + public void handleSlots() { + int tStartIndex = 0; - } - return currenttip; - } - - private boolean transferRect(final GuiContainer gui, final boolean usage) { - if (gui instanceof GT_GUIContainer_BasicMachine) { - return (this.canHandle(gui)) && (new Rectangle(65, 13, 36, 18).contains(new Point(GuiDraw.getMousePosition().x - ((GT_GUIContainer_BasicMachine) gui).getLeft() - codechicken.nei.recipe.RecipeInfo.getGuiOffset(gui)[0], GuiDraw.getMousePosition().y - ((GT_GUIContainer_BasicMachine) gui).getTop() - codechicken.nei.recipe.RecipeInfo.getGuiOffset(gui)[1]))) && (usage ? GuiUsageRecipe.openRecipeGui(((GT_GUIContainer_BasicMachine) gui).mNEI, new Object[0]) : GuiCraftingRecipe.openRecipeGui(((GT_GUIContainer_BasicMachine) gui).mNEI, new Object[0])); - } /*else if (gui instanceof GT_GUIContainer_FusionReactor) { - return (canHandle(gui)) && (new Rectangle(145, 0, 24, 24).contains(new Point(GuiDraw.getMousePosition().x - ((GT_GUIContainer_FusionReactor) gui).getLeft() - codechicken.nei.recipe.RecipeInfo.getGuiOffset(gui)[0], GuiDraw.getMousePosition().y - ((GT_GUIContainer_FusionReactor) gui).getTop() - codechicken.nei.recipe.RecipeInfo.getGuiOffset(gui)[1]))) && (usage ? GuiUsageRecipe.openRecipeGui(((GT_GUIContainer_FusionReactor) gui).mNEI, new Object[0]) : GuiCraftingRecipe.openRecipeGui(((GT_GUIContainer_FusionReactor) gui).mNEI, new Object[0])); - }*/ - return false; - } - - @Override - public List<String> handleItemDisplayName(final GuiContainer gui, final ItemStack itemstack, final List<String> currenttip) { - return currenttip; - } - - @Override - public List<String> handleItemTooltip(final GuiContainer gui, final ItemStack itemstack, final int mousex, final int mousey, final List<String> currenttip) { - return currenttip; - } - - @Override - public boolean keyTyped(final GuiContainer gui, final char keyChar, final int keyCode) { - return false; - } - - @Override - public void onKeyTyped(final GuiContainer gui, final char keyChar, final int keyID) { - } - - @Override - public void onMouseClicked(final GuiContainer gui, final int mousex, final int mousey, final int button) { - } - - @Override - public void onMouseUp(final GuiContainer gui, final int mousex, final int mousey, final int button) { - } - - @Override - public boolean mouseScrolled(final GuiContainer gui, final int mousex, final int mousey, final int scrolled) { - return false; - } - - @Override - public void onMouseScrolled(final GuiContainer gui, final int mousex, final int mousey, final int scrolled) { - } - - @Override - public void onMouseDragged(final GuiContainer gui, final int mousex, final int mousey, final int button, final long heldTime) { - } - } - - public class FixedPositionedStack - extends PositionedStack { - public final int mChance; - public boolean permutated = false; - - public FixedPositionedStack(final Object object, final int x, final int y) { - this(object, x, y, 0); - } - - public FixedPositionedStack(final Object object, final int x, final int y, final int aChance) { - super(object, x, y, true); - this.mChance = aChance; - } - - @Override - public void generatePermutations() { - if (this.permutated) { - return; - } - final ArrayList<ItemStack> tDisplayStacks = new ArrayList<ItemStack>(); - for (final ItemStack tStack : this.items) { - if (GT_Utility.isStackValid(tStack)) { - if (tStack.getItemDamage() == 32767) { - final List<ItemStack> permutations = codechicken.nei.ItemList.itemMap.get(tStack.getItem()); - if (!permutations.isEmpty()) { - ItemStack stack; - for (final Iterator<ItemStack> i$ = permutations.iterator(); i$.hasNext(); tDisplayStacks.add(GT_Utility.copyAmount(tStack.stackSize, new Object[]{stack}))) { - stack = i$.next(); - } - } else { - final ItemStack base = new ItemStack(tStack.getItem(), tStack.stackSize); - base.stackTagCompound = tStack.stackTagCompound; - tDisplayStacks.add(base); - } - } else { - tDisplayStacks.add(GT_Utility.copy(new Object[]{tStack})); - } - } - } - this.items = (tDisplayStacks.toArray(new ItemStack[0])); - if (this.items.length == 0) { - this.items = new ItemStack[]{new ItemStack(Blocks.fire)}; - } - this.permutated = true; - this.setPermutationToRender(0); - } - } - - public class CachedDefaultRecipe - extends TemplateRecipeHandler.CachedRecipe { - public final GT_Recipe mRecipe; - public final List<PositionedStack> mOutputs = new ArrayList<PositionedStack>(); - public final List<PositionedStack> mInputs = new ArrayList<PositionedStack>(); - - public CachedDefaultRecipe(final GT_Recipe aRecipe) { - super(); - this.mRecipe = aRecipe; - - int tStartIndex = 0; - - - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 12, 5)); + if (mRecipe.getRepresentativeInput(tStartIndex) != null) { + this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 12, 5)); } tStartIndex++; - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 30, 5)); + if (mRecipe.getRepresentativeInput(tStartIndex) != null) { + this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 30, 5)); } tStartIndex++; - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 48, 5)); + if (mRecipe.getRepresentativeInput(tStartIndex) != null) { + this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 48, 5)); } tStartIndex++; - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 12, 23)); + if (mRecipe.getRepresentativeInput(tStartIndex) != null) { + this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 12, 23)); } tStartIndex++; - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 30, 23)); + if (mRecipe.getRepresentativeInput(tStartIndex) != null) { + this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 30, 23)); } tStartIndex++; - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 48, 23)); + if (mRecipe.getRepresentativeInput(tStartIndex) != null) { + this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 48, 23)); } tStartIndex++; - if (aRecipe.mSpecialItems != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.mSpecialItems, 120, 52)); + if (mRecipe.mSpecialItems != null) { + this.mInputs.add(new FixedPositionedStack(mRecipe.mSpecialItems, 120, 52)); } tStartIndex = 0; //Four Output Slots - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 102, 5, aRecipe.getOutputChance(tStartIndex))); + if (mRecipe.getOutput(tStartIndex) != null) { + this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 102, 5, mRecipe.getOutputChance(tStartIndex))); } tStartIndex++; - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 120, 5, aRecipe.getOutputChance(tStartIndex))); + if (mRecipe.getOutput(tStartIndex) != null) { + this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 120, 5, mRecipe.getOutputChance(tStartIndex))); } tStartIndex++; - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 102, 23, aRecipe.getOutputChance(tStartIndex))); + if (mRecipe.getOutput(tStartIndex) != null) { + this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 102, 23, mRecipe.getOutputChance(tStartIndex))); } tStartIndex++; - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 120, 23, aRecipe.getOutputChance(tStartIndex))); + if (mRecipe.getOutput(tStartIndex) != null) { + this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 120, 23, mRecipe.getOutputChance(tStartIndex))); } tStartIndex++; - if ((aRecipe.mFluidInputs.length > 0) && (aRecipe.mFluidInputs[0] != null) && (aRecipe.mFluidInputs[0].getFluid() != null)) { - this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidInputs[0], true), 30, 52)); - if ((aRecipe.mFluidInputs.length > 1) && (aRecipe.mFluidInputs[1] != null) && (aRecipe.mFluidInputs[1].getFluid() != null)) { - this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidInputs[1], true), 48, 52)); + if ((mRecipe.mFluidInputs.length > 0) && (mRecipe.mFluidInputs[0] != null) && (mRecipe.mFluidInputs[0].getFluid() != null)) { + this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidInputs[0], true), 30, 52)); + if ((mRecipe.mFluidInputs.length > 1) && (mRecipe.mFluidInputs[1] != null) && (mRecipe.mFluidInputs[1].getFluid() != null)) { + this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidInputs[1], true), 48, 52)); } } - if (aRecipe.mFluidOutputs.length > 0) { - if ((aRecipe.mFluidOutputs[0] != null) && (aRecipe.mFluidOutputs[0].getFluid() != null)) { - this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidOutputs[0], true), 102, 52)); + if (mRecipe.mFluidOutputs.length > 0) { + if ((mRecipe.mFluidOutputs[0] != null) && (mRecipe.mFluidOutputs[0].getFluid() != null)) { + this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidOutputs[0], true), 102, 52)); } - if ((aRecipe.mFluidOutputs.length > 1) && (aRecipe.mFluidOutputs[1] != null) && (aRecipe.mFluidOutputs[1].getFluid() != null)) { - this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidOutputs[1], true), 120, 52)); + if ((mRecipe.mFluidOutputs.length > 1) && (mRecipe.mFluidOutputs[1] != null) && (mRecipe.mFluidOutputs[1].getFluid() != null)) { + this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidOutputs[1], true), 120, 52)); } } } - - @Override - public List<PositionedStack> getIngredients() { - return this.getCycledIngredients(GT_NEI_FlotationCell.this.cycleticks / 10, this.mInputs); - } - - @Override - public PositionedStack getResult() { - return null; - } - - @Override - public List<PositionedStack> getOtherStacks() { - return this.mOutputs; - } + } } diff --git a/src/Java/gtPlusPlus/nei/GT_NEI_FluidReactor.java b/src/Java/gtPlusPlus/nei/GT_NEI_FluidReactor.java index 213d022478..7ef76f68b2 100644 --- a/src/Java/gtPlusPlus/nei/GT_NEI_FluidReactor.java +++ b/src/Java/gtPlusPlus/nei/GT_NEI_FluidReactor.java @@ -1,72 +1,21 @@ package gtPlusPlus.nei; -import java.awt.Point; -import java.awt.Rectangle; -import java.util.ArrayList; -import java.util.Collections; -import java.util.Iterator; import java.util.List; -import org.lwjgl.opengl.GL11; - -import codechicken.lib.gui.GuiDraw; import codechicken.nei.PositionedStack; -import codechicken.nei.guihook.GuiContainerManager; -import codechicken.nei.guihook.IContainerInputHandler; -import codechicken.nei.guihook.IContainerTooltipHandler; -import codechicken.nei.recipe.GuiCraftingRecipe; import codechicken.nei.recipe.GuiRecipe; -import codechicken.nei.recipe.GuiUsageRecipe; import codechicken.nei.recipe.TemplateRecipeHandler; -import cpw.mods.fml.common.event.FMLInterModComms; -import gregtech.api.enums.GT_Values; -import gregtech.api.enums.OrePrefixes; -import gregtech.api.gui.GT_GUIContainer_BasicMachine; -import gregtech.api.objects.ItemData; -import gregtech.api.util.GT_OreDictUnificator; +import gregtech.api.util.GTPP_Recipe.GTPP_Recipe_Map; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; -import gregtech.api.util.GTPP_Recipe; -import gregtech.api.util.GTPP_Recipe.GTPP_Recipe_Map; -import gtPlusPlus.core.lib.CORE; +import gtPlusPlus.core.util.math.MathUtils; import gtPlusPlus.core.util.minecraft.ItemUtils; -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.inventory.GuiContainer; -import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; -import net.minecraftforge.fluids.FluidContainerRegistry; -import net.minecraftforge.fluids.FluidStack; - -public class GT_NEI_FluidReactor -extends TemplateRecipeHandler { - public static final int sOffsetX = 5; - public static final int sOffsetY = 11; - static { - GuiContainerManager.addInputHandler(new GT_RectHandler()); - GuiContainerManager.addTooltipHandler(new GT_RectHandler()); - } - - protected GTPP_Recipe_Map mRecipeMap; +public class GT_NEI_FluidReactor extends GTPP_NEI_DefaultHandler { public GT_NEI_FluidReactor() { - this.mRecipeMap = GTPP_Recipe_Map.sChemicalPlantRecipes; - this.transferRects.add(new TemplateRecipeHandler.RecipeTransferRect(new Rectangle(65, 13, 36, 18), this.getRecipeMapName(), new Object[0])); - if (!NEI_GT_Config.sIsAdded) { - FMLInterModComms.sendRuntimeMessage(GT_Values.GT, "NEIPlugins", "register-crafting-handler", "gregtechplusplus@" + this.getRecipeName() + "@" + this.getRecipeMapName()); - GuiCraftingRecipe.craftinghandlers.add(this); - GuiUsageRecipe.usagehandlers.add(this); - } - } - - public List<GTPP_Recipe> getSortedRecipes() { - List<GTPP_Recipe> result = new ArrayList(this.mRecipeMap.mRecipeList); - Collections.sort(result); - return result; - } - - public static void drawText(final int aX, final int aY, final String aString, final int aColor) { - Minecraft.getMinecraft().fontRenderer.drawString(aString, aX, aY, aColor); + super(GTPP_Recipe_Map.sChemicalPlantRecipes); } @Override @@ -75,125 +24,15 @@ extends TemplateRecipeHandler { } @Override - public void loadCraftingRecipes(final String outputId, final Object... results) { - if (outputId.equals(getRecipeMapName())) { - for (GTPP_Recipe tRecipe : getSortedRecipes()) { - if (!tRecipe.mHidden) { - this.arecipes.add(new CachedDefaultRecipe(tRecipe)); - } - } - } else { - super.loadCraftingRecipes(outputId, results); - } - } - - @Override - public void loadCraftingRecipes(final ItemStack aResult) { - ItemData tPrefixMaterial = GT_OreDictUnificator.getAssociation(aResult); - - ArrayList<ItemStack> tResults = new ArrayList<ItemStack>(); - tResults.add(aResult); - tResults.add(GT_OreDictUnificator.get(true, aResult)); - if ((tPrefixMaterial != null) && (!tPrefixMaterial.mBlackListed) && (!tPrefixMaterial.mPrefix.mFamiliarPrefixes.isEmpty())) { - for (OrePrefixes tPrefix : tPrefixMaterial.mPrefix.mFamiliarPrefixes) { - tResults.add(GT_OreDictUnificator.get(tPrefix, tPrefixMaterial.mMaterial.mMaterial, 1L)); - } - } - FluidStack tFluid = GT_Utility.getFluidForFilledItem(aResult, true); - if (tFluid != null) { - tResults.add(GT_Utility.getFluidDisplayStack(tFluid, false)); - for (FluidContainerRegistry.FluidContainerData tData : FluidContainerRegistry.getRegisteredFluidContainerData()) { - if (tData.fluid.isFluidEqual(tFluid)) { - tResults.add(GT_Utility.copy(new Object[]{tData.filledContainer})); - } - } - } - for (GTPP_Recipe tRecipe : getSortedRecipes()) { - if (!tRecipe.mHidden) { - CachedDefaultRecipe tNEIRecipe = new CachedDefaultRecipe(tRecipe); - for (ItemStack tStack : tResults) { - if (tNEIRecipe.contains(tNEIRecipe.mOutputs, tStack)) { - this.arecipes.add(tNEIRecipe); - break; - } - } - } - } - //CachedDefaultRecipe tNEIRecipe; - } - - public void loadUsageRecipes(ItemStack aInput) { - ItemData tPrefixMaterial = GT_OreDictUnificator.getAssociation(aInput); - - ArrayList<ItemStack> tInputs = new ArrayList<ItemStack>(); - tInputs.add(aInput); - tInputs.add(GT_OreDictUnificator.get(false, aInput)); - if ((tPrefixMaterial != null) && (!tPrefixMaterial.mPrefix.mFamiliarPrefixes.isEmpty())) { - for (OrePrefixes tPrefix : tPrefixMaterial.mPrefix.mFamiliarPrefixes) { - tInputs.add(GT_OreDictUnificator.get(tPrefix, tPrefixMaterial.mMaterial.mMaterial, 1L)); - } - } - FluidStack tFluid = GT_Utility.getFluidForFilledItem(aInput, true); - if (tFluid != null) { - tInputs.add(GT_Utility.getFluidDisplayStack(tFluid, false)); - for (FluidContainerRegistry.FluidContainerData tData : FluidContainerRegistry.getRegisteredFluidContainerData()) { - if (tData.fluid.isFluidEqual(tFluid)) { - tInputs.add(GT_Utility.copy(new Object[]{tData.filledContainer})); - } - } - } - for (GTPP_Recipe tRecipe : getSortedRecipes()) { - if (!tRecipe.mHidden) { - CachedDefaultRecipe tNEIRecipe = new CachedDefaultRecipe(tRecipe); - for (ItemStack tStack : tInputs) { - if (tNEIRecipe.contains(tNEIRecipe.mInputs, tStack)) { - this.arecipes.add(tNEIRecipe); - break; - } - } - } - } - //CachedDefaultRecipe tNEIRecipe; - } - - public String getRecipeMapName() { - return this.mRecipeMap.mNEIName; - } - - @Override - public String getOverlayIdentifier() { - //return this.mRecipeMap.mNEIName; - return ""; - } - - @Override - public void drawBackground(final int recipe) { - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - GuiDraw.changeTexture(this.getGuiTexture()); - GuiDraw.drawTexturedModalRect(-4, -8, 1, 3, 174, 78); - } - - @Override - public int recipiesPerPage() { - return 1; - } - - @Override - public String getRecipeName() { - //return GT_LanguageManager.getTranslation(this.mRecipeMap.mUnlocalizedName); - return " Chem Plant"; - } - - @Override - public String getGuiTexture() { - return CORE.MODID+":textures/gui/FluidReactor.png"; - } + public CachedDefaultRecipe createCachedRecipe(GT_Recipe aRecipe) { + return new ChemPlantDefaultRecipe(aRecipe); + } @Override public List<String> handleItemTooltip(final GuiRecipe gui, final ItemStack aStack, final List<String> currenttip, final int aRecipeIndex) { final TemplateRecipeHandler.CachedRecipe tObject = this.arecipes.get(aRecipeIndex); - if ((tObject instanceof CachedDefaultRecipe)) { - final CachedDefaultRecipe tRecipe = (CachedDefaultRecipe) tObject; + if ((tObject instanceof ChemPlantDefaultRecipe)) { + final ChemPlantDefaultRecipe tRecipe = (ChemPlantDefaultRecipe) tObject; for (final PositionedStack tStack : tRecipe.mOutputs) { if (aStack == tStack.item) { if ((!(tStack instanceof FixedPositionedStack)) || (((FixedPositionedStack) tStack).mChance <= 0) || (((FixedPositionedStack) tStack).mChance == 10000)) { @@ -225,13 +64,13 @@ extends TemplateRecipeHandler { @Override public void drawExtras(final int aRecipeIndex) { - final long tEUt = ((CachedDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.mEUt; - final int tDuration = ((CachedDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.mDuration; + final long tEUt = ((ChemPlantDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.mEUt; + final int tDuration = ((ChemPlantDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.mDuration; if (tEUt != 0) { - drawText(10, 73, "Total: " + (long) (tDuration * tEUt) + " EU", -16777216); + drawText(10, 73, "Total: " + MathUtils.formatNumbers((long) (tDuration * tEUt)) + " EU", -16777216); //drawText(10, 83, "Usage: " + tEUt + " EU/t", -16777216); if (this.mRecipeMap.mShowVoltageAmperageInNEI) { - drawText(10, 83, "Voltage: " + (tEUt / this.mRecipeMap.mAmperage) + " EU/t", -16777216); + drawText(10, 83, "Voltage: " + MathUtils.formatNumbers((tEUt / this.mRecipeMap.mAmperage)) + " EU/t", -16777216); drawText(10, 93, "Amperage: " + this.mRecipeMap.mAmperage, -16777216); } else { drawText(10, 93, "Voltage: unspecified", -16777216); @@ -239,10 +78,10 @@ extends TemplateRecipeHandler { } } if (tDuration > 0) { - drawText(10, 103, "Time: " + (tDuration < 20 ? "< 1" : Integer.valueOf(tDuration / 20)) + " secs", -16777216); + drawText(10, 103, "Time: " + (tDuration < 20 ? "< 1" : MathUtils.formatNumbers(Integer.valueOf(tDuration / 20))) + " secs", -16777216); } if ((GT_Utility.isStringValid(this.mRecipeMap.mNEISpecialValuePre)) || (GT_Utility.isStringValid(this.mRecipeMap.mNEISpecialValuePost))) { - int aTier = (((CachedDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.mSpecialValue); + int aTier = (((ChemPlantDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.mSpecialValue); String aTierMaterial = " - "; if (aTier <= 0) { aTierMaterial += "Bronze"; @@ -269,239 +108,88 @@ extends TemplateRecipeHandler { aTierMaterial += "Botmium"; } - drawText(10, 113, this.mRecipeMap.mNEISpecialValuePre + (((CachedDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.mSpecialValue * this.mRecipeMap.mNEISpecialValueMultiplier) + aTierMaterial, -16777216); + drawText(10, 113, this.mRecipeMap.mNEISpecialValuePre + (((ChemPlantDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.mSpecialValue * this.mRecipeMap.mNEISpecialValueMultiplier) + aTierMaterial, -16777216); } } - public static class GT_RectHandler - implements IContainerInputHandler, IContainerTooltipHandler { - @Override - public boolean mouseClicked(final GuiContainer gui, final int mousex, final int mousey, final int button) { - if (this.canHandle(gui)) { - if (button == 0) { - return this.transferRect(gui, false); - } - if (button == 1) { - return this.transferRect(gui, true); - } - } - return false; - } + public class ChemPlantDefaultRecipe extends CachedDefaultRecipe { - @Override - public boolean lastKeyTyped(final GuiContainer gui, final char keyChar, final int keyCode) { - return false; + public ChemPlantDefaultRecipe(final GT_Recipe aRecipe) { + super(aRecipe); } - - public boolean canHandle(final GuiContainer gui) { - return (((gui instanceof GT_GUIContainer_BasicMachine)) && (GT_Utility.isStringValid(((GT_GUIContainer_BasicMachine) gui).mNEI)) /*|| ((gui instanceof GT_GUIContainer_FusionReactor)) && (GT_Utility.isStringValid(((GT_GUIContainer_FusionReactor) gui).mNEI))*/); - } - - @Override - public List<String> handleTooltip(final GuiContainer gui, final int mousex, final int mousey, final List<String> currenttip) { - if ((this.canHandle(gui)) && (currenttip.isEmpty())) { - if ((gui instanceof GT_GUIContainer_BasicMachine) && new Rectangle(65, 13, 36, 18).contains(new Point(GuiDraw.getMousePosition().x - ((GT_GUIContainer_BasicMachine) gui).getLeft() - codechicken.nei.recipe.RecipeInfo.getGuiOffset(gui)[0], GuiDraw.getMousePosition().y - ((GT_GUIContainer_BasicMachine) gui).getTop() - codechicken.nei.recipe.RecipeInfo.getGuiOffset(gui)[1]))) { - currenttip.add("Recipes"); - } /*else if (gui instanceof GT_GUIContainer_FusionReactor && new Rectangle(145, 0, 24, 24).contains(new Point(GuiDraw.getMousePosition().x - ((GT_GUIContainer_FusionReactor) gui).getLeft() - codechicken.nei.recipe.RecipeInfo.getGuiOffset(gui)[0], GuiDraw.getMousePosition().y - ((GT_GUIContainer_FusionReactor) gui).getTop() - codechicken.nei.recipe.RecipeInfo.getGuiOffset(gui)[1]))) { - currenttip.add("Recipes"); - }*/ - - } - return currenttip; - } - - private boolean transferRect(final GuiContainer gui, final boolean usage) { - if (gui instanceof GT_GUIContainer_BasicMachine) { - return (this.canHandle(gui)) && (new Rectangle(65, 13, 36, 18).contains(new Point(GuiDraw.getMousePosition().x - ((GT_GUIContainer_BasicMachine) gui).getLeft() - codechicken.nei.recipe.RecipeInfo.getGuiOffset(gui)[0], GuiDraw.getMousePosition().y - ((GT_GUIContainer_BasicMachine) gui).getTop() - codechicken.nei.recipe.RecipeInfo.getGuiOffset(gui)[1]))) && (usage ? GuiUsageRecipe.openRecipeGui(((GT_GUIContainer_BasicMachine) gui).mNEI, new Object[0]) : GuiCraftingRecipe.openRecipeGui(((GT_GUIContainer_BasicMachine) gui).mNEI, new Object[0])); - } /*else if (gui instanceof GT_GUIContainer_FusionReactor) { - return (canHandle(gui)) && (new Rectangle(145, 0, 24, 24).contains(new Point(GuiDraw.getMousePosition().x - ((GT_GUIContainer_FusionReactor) gui).getLeft() - codechicken.nei.recipe.RecipeInfo.getGuiOffset(gui)[0], GuiDraw.getMousePosition().y - ((GT_GUIContainer_FusionReactor) gui).getTop() - codechicken.nei.recipe.RecipeInfo.getGuiOffset(gui)[1]))) && (usage ? GuiUsageRecipe.openRecipeGui(((GT_GUIContainer_FusionReactor) gui).mNEI, new Object[0]) : GuiCraftingRecipe.openRecipeGui(((GT_GUIContainer_FusionReactor) gui).mNEI, new Object[0])); - }*/ - return false; - } - - @Override - public List<String> handleItemDisplayName(final GuiContainer gui, final ItemStack itemstack, final List<String> currenttip) { - return currenttip; - } - - @Override - public List<String> handleItemTooltip(final GuiContainer gui, final ItemStack itemstack, final int mousex, final int mousey, final List<String> currenttip) { - return currenttip; - } - + @Override - public boolean keyTyped(final GuiContainer gui, final char keyChar, final int keyCode) { - return false; - } - - @Override - public void onKeyTyped(final GuiContainer gui, final char keyChar, final int keyID) { - } - - @Override - public void onMouseClicked(final GuiContainer gui, final int mousex, final int mousey, final int button) { - } - - @Override - public void onMouseUp(final GuiContainer gui, final int mousex, final int mousey, final int button) { - } - - @Override - public boolean mouseScrolled(final GuiContainer gui, final int mousex, final int mousey, final int scrolled) { - return false; - } - - @Override - public void onMouseScrolled(final GuiContainer gui, final int mousex, final int mousey, final int scrolled) { - } - - @Override - public void onMouseDragged(final GuiContainer gui, final int mousex, final int mousey, final int button, final long heldTime) { - } - } - - public class FixedPositionedStack - extends PositionedStack { - public final int mChance; - public boolean permutated = false; - - public FixedPositionedStack(final Object object, final int x, final int y) { - this(object, x, y, 0); - } - - public FixedPositionedStack(final Object object, final int x, final int y, final int aChance) { - super(object, x, y, true); - this.mChance = aChance; - } - - @Override - public void generatePermutations() { - if (this.permutated) { - return; - } - final ArrayList<ItemStack> tDisplayStacks = new ArrayList<ItemStack>(); - for (final ItemStack tStack : this.items) { - if (GT_Utility.isStackValid(tStack)) { - if (tStack.getItemDamage() == 32767) { - final List<ItemStack> permutations = codechicken.nei.ItemList.itemMap.get(tStack.getItem()); - if (!permutations.isEmpty()) { - ItemStack stack; - for (final Iterator<ItemStack> i$ = permutations.iterator(); i$.hasNext(); tDisplayStacks.add(GT_Utility.copyAmount(tStack.stackSize, new Object[]{stack}))) { - stack = i$.next(); - } - } else { - final ItemStack base = new ItemStack(tStack.getItem(), tStack.stackSize); - base.stackTagCompound = tStack.stackTagCompound; - tDisplayStacks.add(base); - } - } else { - tDisplayStacks.add(GT_Utility.copy(new Object[]{tStack})); - } - } - } - this.items = (tDisplayStacks.toArray(new ItemStack[0])); - if (this.items.length == 0) { - this.items = new ItemStack[]{new ItemStack(Blocks.fire)}; - } - this.permutated = true; - this.setPermutationToRender(0); - } - } - - public class CachedDefaultRecipe - extends TemplateRecipeHandler.CachedRecipe { - public final GT_Recipe mRecipe; - public final List<PositionedStack> mOutputs = new ArrayList<PositionedStack>(); - public final List<PositionedStack> mInputs = new ArrayList<PositionedStack>(); - - public CachedDefaultRecipe(final GT_Recipe aRecipe) { - super(); - this.mRecipe = aRecipe; - - int tStartIndex = 0; + public void handleSlots() { + int tStartIndex = 0; // Four Input Slots - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 3, -4)); + if (mRecipe.getRepresentativeInput(tStartIndex) != null) { + this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 3, -4)); } tStartIndex++; - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 21, -4)); + if (mRecipe.getRepresentativeInput(tStartIndex) != null) { + this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 21, -4)); } tStartIndex++; - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 39, -4)); + if (mRecipe.getRepresentativeInput(tStartIndex) != null) { + this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 39, -4)); } tStartIndex++; - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 57, -4)); + if (mRecipe.getRepresentativeInput(tStartIndex) != null) { + this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 57, -4)); } tStartIndex++; - if (aRecipe.mSpecialItems != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.mSpecialItems, 120, 52)); + if (mRecipe.mSpecialItems != null) { + this.mInputs.add(new FixedPositionedStack(mRecipe.mSpecialItems, 120, 52)); } tStartIndex = 0; //Four Output Slots - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 102, 5, aRecipe.getOutputChance(tStartIndex))); + if (mRecipe.getOutput(tStartIndex) != null) { + this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 102, 5, mRecipe.getOutputChance(tStartIndex))); } tStartIndex++; - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 120, 5, aRecipe.getOutputChance(tStartIndex))); + if (mRecipe.getOutput(tStartIndex) != null) { + this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 120, 5, mRecipe.getOutputChance(tStartIndex))); } tStartIndex++; - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 102, 23, aRecipe.getOutputChance(tStartIndex))); + if (mRecipe.getOutput(tStartIndex) != null) { + this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 102, 23, mRecipe.getOutputChance(tStartIndex))); } tStartIndex++; - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 120, 23, aRecipe.getOutputChance(tStartIndex))); + if (mRecipe.getOutput(tStartIndex) != null) { + this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 120, 23, mRecipe.getOutputChance(tStartIndex))); } tStartIndex++; //New fluid display behaviour when 3 fluid inputs are detected. (Basically a mix of the code below for outputs an the code above for 9 input slots.) - if (aRecipe.mFluidInputs.length >= 1) { - if ((aRecipe.mFluidInputs[0] != null) && (aRecipe.mFluidInputs[0].getFluid() != null)) { - this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidInputs[0], true), 3, 31)); + if (mRecipe.mFluidInputs.length >= 1) { + if ((mRecipe.mFluidInputs[0] != null) && (mRecipe.mFluidInputs[0].getFluid() != null)) { + this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidInputs[0], true), 3, 31)); } - if ((aRecipe.mFluidInputs.length > 1) && (aRecipe.mFluidInputs[1] != null) && (aRecipe.mFluidInputs[1].getFluid() != null)) { - this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidInputs[1], true), 21, 31)); + if ((mRecipe.mFluidInputs.length > 1) && (mRecipe.mFluidInputs[1] != null) && (mRecipe.mFluidInputs[1].getFluid() != null)) { + this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidInputs[1], true), 21, 31)); } - if ((aRecipe.mFluidInputs.length > 2) && (aRecipe.mFluidInputs[2] != null) && (aRecipe.mFluidInputs[2].getFluid() != null)) { - this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidInputs[2], true), 39, 31)); + if ((mRecipe.mFluidInputs.length > 2) && (mRecipe.mFluidInputs[2] != null) && (mRecipe.mFluidInputs[2].getFluid() != null)) { + this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidInputs[2], true), 39, 31)); } - if ((aRecipe.mFluidInputs.length > 3) && (aRecipe.mFluidInputs[3] != null) && (aRecipe.mFluidInputs[3].getFluid() != null)) { - this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidInputs[3], true), 57, 31)); + if ((mRecipe.mFluidInputs.length > 3) && (mRecipe.mFluidInputs[3] != null) && (mRecipe.mFluidInputs[3].getFluid() != null)) { + this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidInputs[3], true), 57, 31)); } } - if (aRecipe.mFluidOutputs.length > 0) { - if ((aRecipe.mFluidOutputs[0] != null) && (aRecipe.mFluidOutputs[0].getFluid() != null)) { - this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidOutputs[0], true), 138, 5)); + if (mRecipe.mFluidOutputs.length > 0) { + if ((mRecipe.mFluidOutputs[0] != null) && (mRecipe.mFluidOutputs[0].getFluid() != null)) { + this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidOutputs[0], true), 138, 5)); } - if ((aRecipe.mFluidOutputs.length > 1) && (aRecipe.mFluidOutputs[1] != null) && (aRecipe.mFluidOutputs[1].getFluid() != null)) { - this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidOutputs[1], true), 138, 23)); + if ((mRecipe.mFluidOutputs.length > 1) && (mRecipe.mFluidOutputs[1] != null) && (mRecipe.mFluidOutputs[1].getFluid() != null)) { + this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidOutputs[1], true), 138, 23)); } } - } - - @Override - public List<PositionedStack> getIngredients() { - return this.getCycledIngredients(GT_NEI_FluidReactor.this.cycleticks / 10, this.mInputs); - } - - @Override - public PositionedStack getResult() { - return null; - } - - @Override - public List<PositionedStack> getOtherStacks() { - return this.mOutputs; + } } } diff --git a/src/Java/gtPlusPlus/nei/GT_NEI_LFTR.java b/src/Java/gtPlusPlus/nei/GT_NEI_LFTR.java new file mode 100644 index 0000000000..dd7338eccd --- /dev/null +++ b/src/Java/gtPlusPlus/nei/GT_NEI_LFTR.java @@ -0,0 +1,118 @@ +package gtPlusPlus.nei; + +import org.lwjgl.opengl.GL11; + +import codechicken.lib.gui.GuiDraw; +import codechicken.nei.recipe.TemplateRecipeHandler; +import gregtech.api.util.GTPP_Recipe.GTPP_Recipe_Map; +import gregtech.api.util.GT_Recipe; +import gregtech.api.util.GT_Utility; +import gtPlusPlus.core.util.math.MathUtils; + +public class GT_NEI_LFTR extends GTPP_NEI_DefaultHandler { + + public GT_NEI_LFTR() { + super(GTPP_Recipe_Map.sLiquidFluorineThoriumReactorRecipes); + } + + @Override + public TemplateRecipeHandler newInstance() { + return new GT_NEI_LFTR(); + } + + @Override + public CachedDefaultRecipe createCachedRecipe(GT_Recipe aRecipe) { + return new LFTRDefaultRecipe(aRecipe); + } + + @Override + public void drawBackground(final int recipe) { + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + GuiDraw.changeTexture(this.getGuiTexture()); + GuiDraw.drawTexturedModalRect(-4, -8, 1, 3, 174, 89); + } + + @Override + public void drawExtras(final int aRecipeIndex) { + final long tEUt = ((CachedDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.mSpecialValue; + final int tDuration = ((CachedDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.mDuration; + drawText(10, 83, "Time: " + (tDuration < 20 ? "< 1" : MathUtils.formatNumbers(Integer.valueOf(tDuration / 20))) + " secs", -16777216); + drawText(10, 93, this.mRecipeMap.mNEISpecialValuePre + MathUtils.formatNumbers((((CachedDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.mSpecialValue * this.mRecipeMap.mNEISpecialValueMultiplier)) + this.mRecipeMap.mNEISpecialValuePost, -16777216); + drawText(10, 103, "Dynamo: " + MathUtils.formatNumbers((long) (tDuration * tEUt)) + " EU", -16777216); + drawText(10, 113, "Total: " + MathUtils.formatNumbers((long) (tDuration * tEUt * 4)) + " EU", -16777216); + } + + public class LFTRDefaultRecipe extends CachedDefaultRecipe { + + public LFTRDefaultRecipe(final GT_Recipe aRecipe) { + super(aRecipe); + } + + @Override + public void handleSlots() { + int tStartIndex = 0; + if (mRecipe.mFluidInputs.length > 0) { + if ((mRecipe.mFluidInputs[0] != null) && (mRecipe.mFluidInputs[0].getFluid() != null)) { + this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidInputs[0], true), 12, 5)); + } + if ((mRecipe.mFluidInputs.length > 1) && (mRecipe.mFluidInputs[1] != null) && (mRecipe.mFluidInputs[1].getFluid() != null)) { + this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidInputs[1], true), 30, 5)); + } + if ((mRecipe.mFluidInputs.length > 2) && (mRecipe.mFluidInputs[2] != null) && (mRecipe.mFluidInputs[2].getFluid() != null)) { + this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidInputs[2], true), 48, 5)); + } + if ((mRecipe.mFluidInputs.length > 3) && (mRecipe.mFluidInputs[3] != null) && (mRecipe.mFluidInputs[3].getFluid() != null)) { + this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidInputs[3], true), 12, 23)); + } + if ((mRecipe.mFluidInputs.length > 4) && (mRecipe.mFluidInputs[4] != null) && (mRecipe.mFluidInputs[4].getFluid() != null)) { + this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidInputs[4], true), 30, 23)); + } + if ((mRecipe.mFluidInputs.length > 5) && (mRecipe.mFluidInputs[5] != null) && (mRecipe.mFluidInputs[5].getFluid() != null)) { + this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidInputs[5], true), 48, 23)); + } + if ((mRecipe.mFluidInputs.length > 6) && (mRecipe.mFluidInputs[6] != null) && (mRecipe.mFluidInputs[6].getFluid() != null)) { + this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidInputs[6], true), 12, 41)); + } + if ((mRecipe.mFluidInputs.length > 7) && (mRecipe.mFluidInputs[7] != null) && (mRecipe.mFluidInputs[7].getFluid() != null)) { + this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidInputs[7], true), 30, 41)); + } + if ((mRecipe.mFluidInputs.length > 8) && (mRecipe.mFluidInputs[8] != null) && (mRecipe.mFluidInputs[8].getFluid() != null)) { + this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidInputs[8], true), 48, 41)); + } + } + + tStartIndex = 0; + if (mRecipe.mFluidOutputs.length > 0) { + if ((mRecipe.mFluidOutputs[0] != null) && (mRecipe.mFluidOutputs[0].getFluid() != null)) { + this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidOutputs[0], true), 102, 5, mRecipe.getOutputChance(tStartIndex++))); + } + if ((mRecipe.mFluidOutputs.length > 1) && (mRecipe.mFluidOutputs[1] != null) && (mRecipe.mFluidOutputs[1].getFluid() != null)) { + this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidOutputs[1], true), 120, 5, mRecipe.getOutputChance(tStartIndex++))); + } + if ((mRecipe.mFluidOutputs.length > 2) && (mRecipe.mFluidOutputs[2] != null) && (mRecipe.mFluidOutputs[2].getFluid() != null)) { + this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidOutputs[2], true), 138, 5, mRecipe.getOutputChance(tStartIndex++))); + } + if ((mRecipe.mFluidOutputs.length > 3) && (mRecipe.mFluidOutputs[3] != null) && (mRecipe.mFluidOutputs[3].getFluid() != null)) { + this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidOutputs[3], true), 102, 23, mRecipe.getOutputChance(tStartIndex++))); + } + if ((mRecipe.mFluidOutputs.length > 4) && (mRecipe.mFluidOutputs[4] != null) && (mRecipe.mFluidOutputs[4].getFluid() != null)) { + this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidOutputs[4], true), 120, 23, mRecipe.getOutputChance(tStartIndex++))); + } + if ((mRecipe.mFluidOutputs.length > 5) && (mRecipe.mFluidOutputs[5] != null) && (mRecipe.mFluidOutputs[5].getFluid() != null)) { + this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidOutputs[5], true), 138, 23, mRecipe.getOutputChance(tStartIndex++))); + } + if ((mRecipe.mFluidOutputs.length > 6) && (mRecipe.mFluidOutputs[6] != null) && (mRecipe.mFluidOutputs[6].getFluid() != null)) { + this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidOutputs[6], true), 102, 41, mRecipe.getOutputChance(tStartIndex++))); + } + if ((mRecipe.mFluidOutputs.length > 7) && (mRecipe.mFluidOutputs[7] != null) && (mRecipe.mFluidOutputs[7].getFluid() != null)) { + this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidOutputs[7], true), 120, 41, mRecipe.getOutputChance(tStartIndex++))); + } + if ((mRecipe.mFluidOutputs.length > 8) && (mRecipe.mFluidOutputs[8] != null) && (mRecipe.mFluidOutputs[8].getFluid() != null)) { + this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidOutputs[8], true), 138, 41, mRecipe.getOutputChance(tStartIndex++))); + } + } + + } + + } +} diff --git a/src/Java/gtPlusPlus/nei/GT_NEI_LFTR_Sparging.java b/src/Java/gtPlusPlus/nei/GT_NEI_LFTR_Sparging.java new file mode 100644 index 0000000000..c9f9f0722a --- /dev/null +++ b/src/Java/gtPlusPlus/nei/GT_NEI_LFTR_Sparging.java @@ -0,0 +1,372 @@ +package gtPlusPlus.nei; + +import java.awt.Rectangle; +import java.lang.ref.SoftReference; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.stream.Collectors; + +import org.lwjgl.opengl.GL11; + +import codechicken.lib.gui.GuiDraw; +import codechicken.nei.PositionedStack; +import codechicken.nei.recipe.GuiCraftingRecipe; +import codechicken.nei.recipe.GuiRecipe; +import codechicken.nei.recipe.GuiUsageRecipe; +import codechicken.nei.recipe.TemplateRecipeHandler; +import cpw.mods.fml.common.event.FMLInterModComms; +import gregtech.api.enums.GT_Values; +import gregtech.api.enums.ItemList; +import gregtech.api.enums.OrePrefixes; +import gregtech.api.objects.ItemData; +import gregtech.api.util.GT_OreDictUnificator; +import gregtech.api.util.GT_Utility; +import gregtech.api.util.GasSpargingRecipe; +import gregtech.api.util.GasSpargingRecipeMap; +import gtPlusPlus.core.util.math.MathUtils; +import gtPlusPlus.core.util.minecraft.ItemUtils; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidStack; + +public class GT_NEI_LFTR_Sparging extends TemplateRecipeHandler { + + public static final String mNEIName = GasSpargingRecipeMap.mNEIDisplayName; + private SoftReference<List<GasSpargingRecipeNEI>> mCachedRecipes = null; + + public GT_NEI_LFTR_Sparging() { + this.transferRects.add(new TemplateRecipeHandler.RecipeTransferRect(new Rectangle(65, 13, 36, 18), this.getOverlayIdentifier(), new Object[0])); + if (!NEI_GT_Config.sIsAdded) { + FMLInterModComms.sendRuntimeMessage(GT_Values.GT, "NEIPlugins", "register-crafting-handler", "gregtechplusplus@" + this.getRecipeName() + "@" + this.getOverlayIdentifier()); + GuiCraftingRecipe.craftinghandlers.add(this); + GuiUsageRecipe.usagehandlers.add(this); + } + } + + public String getRecipeName() { + return mNEIName; + } + + public String getGuiTexture() { + return GasSpargingRecipeMap.mNEIGUIPath; + } + + public String getOverlayIdentifier() { + return gregtech.api.util.GasSpargingRecipeMap.mUnlocalizedName; + } + + public int recipiesPerPage() { + return 1; + } + + @Override + public void drawBackground(final int recipe) { + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + GuiDraw.changeTexture(this.getGuiTexture()); + GuiDraw.drawTexturedModalRect(-4, -8, 1, 3, 174, 68); + } + + public void loadTransferRects() { + this.transferRects.add(new RecipeTransferRect(new Rectangle(72, 14, 22, 16), getRecipeName(), new Object[0])); + } + + public List<GasSpargingRecipeNEI> getCache() { + List<GasSpargingRecipeNEI> cache; + if (mCachedRecipes == null || (cache = mCachedRecipes.get()) == null) { + cache = GasSpargingRecipeMap.mRecipes.stream() // do not use parallel stream. This is already parallelized by NEI + .sorted() + .map(temp -> {return createCachedRecipe(temp);}) + .collect(Collectors.toList()); + // while the NEI parallelize handlers, for each individual handler it still uses sequential execution model + // so we do not need any synchronization here + mCachedRecipes = new SoftReference<>(cache); + } + return cache; + } + + public GasSpargingRecipeNEI createCachedRecipe(GasSpargingRecipe aRecipe) { + return new GasSpargingRecipeNEI(aRecipe); + } + + public void loadCraftingRecipes(String outputId, Object... results) { + if (outputId.equals(getOverlayIdentifier())) { + arecipes.addAll(getCache()); + } else { + super.loadCraftingRecipes(outputId, results); + } + } + + public void loadCraftingRecipes(ItemStack aResult) { + ItemData tPrefixMaterial = GT_OreDictUnificator.getAssociation(aResult); + + ArrayList<ItemStack> tResults = new ArrayList<>(); + tResults.add(aResult); + tResults.add(GT_OreDictUnificator.get(true, aResult)); + if ((tPrefixMaterial != null) && (!tPrefixMaterial.mBlackListed) && (!tPrefixMaterial.mPrefix.mFamiliarPrefixes.isEmpty())) { + for (OrePrefixes tPrefix : tPrefixMaterial.mPrefix.mFamiliarPrefixes) { + tResults.add(GT_OreDictUnificator.get(tPrefix, tPrefixMaterial.mMaterial.mMaterial, 1L)); + } + } + FluidStack tFluid = GT_Utility.getFluidForFilledItem(aResult, true); + FluidStack tFluidStack; + if (tFluid != null) { + tFluidStack = tFluid; + tResults.add(GT_Utility.getFluidDisplayStack(tFluid, false)); + } + else tFluidStack = GT_Utility.getFluidFromDisplayStack(aResult); + if (tFluidStack != null) { + tResults.addAll(GT_Utility.getContainersFromFluid(tFluidStack)); + } + for (GasSpargingRecipeNEI recipe : getCache()) { + if (tResults.stream().anyMatch(stack -> recipe.contains(recipe.mOutputs, stack))) + arecipes.add(recipe); + } + } + + public void loadUsageRecipes(ItemStack aInput) { + ItemData tPrefixMaterial = GT_OreDictUnificator.getAssociation(aInput); + + ArrayList<ItemStack> tInputs = new ArrayList<>(); + tInputs.add(aInput); + tInputs.add(GT_OreDictUnificator.get(false, aInput)); + if ((tPrefixMaterial != null) && (!tPrefixMaterial.mPrefix.mFamiliarPrefixes.isEmpty())) { + for (OrePrefixes tPrefix : tPrefixMaterial.mPrefix.mFamiliarPrefixes) { + tInputs.add(GT_OreDictUnificator.get(tPrefix, tPrefixMaterial.mMaterial.mMaterial, 1L)); + } + } + FluidStack tFluid = GT_Utility.getFluidForFilledItem(aInput, true); + FluidStack tFluidStack; + if (tFluid != null) { + tFluidStack = tFluid; + tInputs.add(GT_Utility.getFluidDisplayStack(tFluid, false)); + } + else tFluidStack = GT_Utility.getFluidFromDisplayStack(aInput); + if (tFluidStack != null) { + tInputs.addAll(GT_Utility.getContainersFromFluid(tFluidStack)); + } + for (GasSpargingRecipeNEI recipe : getCache()) { + if (tInputs.stream().anyMatch(stack -> recipe.contains(recipe.mInputs, stack))) + arecipes.add(recipe); + } + } + + public void drawExtras(int aRecipeIndex) { + final long tEUt = ((GasSpargingRecipeNEI) this.arecipes.get(aRecipeIndex)).mRecipe.mEUt; + final long tDuration = ((GasSpargingRecipeNEI) this.arecipes.get(aRecipeIndex)).mRecipe.mDuration; + GT_NEI_LFTR.drawText(10, 73, "Total: " + MathUtils.formatNumbers((long) (tDuration * tEUt)) + " EU", -16777216); + GT_NEI_LFTR.drawText(10, 83, "Usage: " + MathUtils.formatNumbers(tEUt) + " EU/t", -16777216); + GT_NEI_LFTR.drawText(10, 93, "Time: " + (tDuration < 20 ? "< 1" : MathUtils.formatNumbers(Long.valueOf(tDuration / 20))) + " secs", -16777216); + GT_NEI_LFTR.drawText(10, 103, "Gas not used to sparge is", -16777216); + GT_NEI_LFTR.drawText(10, 113, "returned alongside outputs.", -16777216); + } + + @Override + public List<String> handleItemTooltip(final GuiRecipe gui, final ItemStack aStack, final List<String> currenttip, final int aRecipeIndex) { + final TemplateRecipeHandler.CachedRecipe tObject = this.arecipes.get(aRecipeIndex); + if ((tObject instanceof GasSpargingRecipeNEI)) { + final GasSpargingRecipeNEI tRecipe = (GasSpargingRecipeNEI) tObject; + ItemStack aSpargeInput = tRecipe.mOutputs.get(0).item; + ItemStack aSpentFuel = tRecipe.mOutputs.get(1).item; + for (final PositionedStack tStack : tRecipe.mOutputs) { + if (aStack == tStack.item) { + if (ItemList.Display_Fluid.isStackEqual(tStack.item, true, true)) { + if (GT_Utility.areStacksEqual(aStack, aSpentFuel, true)) { + break; + } + if (GT_Utility.areStacksEqual(aStack, aSpargeInput, true)) { + currenttip.add("The amount returned is the remainder after all other outputs."); + } + currenttip.add("Maximum Output: " + (((FixedPositionedStack) tStack).mChance / 100) + "." + ((((FixedPositionedStack) tStack).mChance % 100) < 10 ? "0" + (((FixedPositionedStack) tStack).mChance % 100) : Integer.valueOf(((FixedPositionedStack) tStack).mChance % 100)) + "L"); + break; + } + break; + } + } + for (final PositionedStack tStack : tRecipe.mInputs) { + if (GT_Utility.areStacksEqual(aStack, tStack.item)) { + if ((gregtech.api.enums.ItemList.Display_Fluid.isStackEqual(tStack.item, true, true)) || + (tStack.item.stackSize != 0)) { + break; + } + if (ItemUtils.isControlCircuit(aStack)) { + currenttip.add("Does not get consumed in the process"); + } + break; + } + } + } + return currenttip; + } + + public class FixedPositionedStack + extends PositionedStack { + public final int mChance; + public boolean permutated = false; + + public FixedPositionedStack(final Object object, final int x, final int y) { + this(object, x, y, 0); + } + + public FixedPositionedStack(final Object object, final int x, final int y, final int aChance) { + super(object, x, y, true); + this.mChance = aChance; + } + + @Override + public void generatePermutations() { + if (this.permutated) { + return; + } + final ArrayList<ItemStack> tDisplayStacks = new ArrayList<ItemStack>(); + for (final ItemStack tStack : this.items) { + if (GT_Utility.isStackValid(tStack)) { + if (tStack.getItemDamage() == 32767) { + final List<ItemStack> permutations = codechicken.nei.ItemList.itemMap.get(tStack.getItem()); + if (!permutations.isEmpty()) { + ItemStack stack; + for (final Iterator<ItemStack> i$ = permutations.iterator(); i$.hasNext(); tDisplayStacks.add(GT_Utility.copyAmount(tStack.stackSize, new Object[]{stack}))) { + stack = i$.next(); + } + } else { + final ItemStack base = new ItemStack(tStack.getItem(), tStack.stackSize); + base.stackTagCompound = tStack.stackTagCompound; + tDisplayStacks.add(base); + } + } else { + tDisplayStacks.add(GT_Utility.copy(new Object[]{tStack})); + } + } + } + this.items = (tDisplayStacks.toArray(new ItemStack[0])); + if (this.items.length == 0) { + this.items = new ItemStack[]{new ItemStack(Blocks.fire)}; + } + this.permutated = true; + this.setPermutationToRender(0); + } + } + + public class GasSpargingRecipeNEI extends CachedRecipe implements Comparable<CachedRecipe> { + + public final GasSpargingRecipe mRecipe; + public final List<PositionedStack> mOutputs = new ArrayList<PositionedStack>(); + public final List<PositionedStack> mInputs = new ArrayList<PositionedStack>(); + + public GasSpargingRecipeNEI(GasSpargingRecipe tRecipe) { + super(); + this.mRecipe = tRecipe; + int tStartIndex = 0; + if (tRecipe.mFluidInputs.length > 0) { + if ((tRecipe.mFluidInputs[0] != null) && (tRecipe.mFluidInputs[0].getFluid() != null)) { + this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(tRecipe.mFluidInputs[0], true), 30, 5)); + } + if ((tRecipe.mFluidInputs.length > 1) && (tRecipe.mFluidInputs[1] != null) && (tRecipe.mFluidInputs[1].getFluid() != null)) { + this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(tRecipe.mFluidInputs[1], true), 12, 5)); + } + if ((tRecipe.mFluidInputs.length > 2) && (tRecipe.mFluidInputs[2] != null) && (tRecipe.mFluidInputs[2].getFluid() != null)) { + this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(tRecipe.mFluidInputs[2], true), 48, 5)); + } + if ((tRecipe.mFluidInputs.length > 3) && (tRecipe.mFluidInputs[3] != null) && (tRecipe.mFluidInputs[3].getFluid() != null)) { + this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(tRecipe.mFluidInputs[3], true), 12, 23)); + } + if ((tRecipe.mFluidInputs.length > 4) && (tRecipe.mFluidInputs[4] != null) && (tRecipe.mFluidInputs[4].getFluid() != null)) { + this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(tRecipe.mFluidInputs[4], true), 30, 23)); + } + if ((tRecipe.mFluidInputs.length > 5) && (tRecipe.mFluidInputs[5] != null) && (tRecipe.mFluidInputs[5].getFluid() != null)) { + this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(tRecipe.mFluidInputs[5], true), 48, 23)); + } + if ((tRecipe.mFluidInputs.length > 6) && (tRecipe.mFluidInputs[6] != null) && (tRecipe.mFluidInputs[6].getFluid() != null)) { + this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(tRecipe.mFluidInputs[6], true), 12, 41)); + } + if ((tRecipe.mFluidInputs.length > 7) && (tRecipe.mFluidInputs[7] != null) && (tRecipe.mFluidInputs[7].getFluid() != null)) { + this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(tRecipe.mFluidInputs[7], true), 30, 41)); + } + if ((tRecipe.mFluidInputs.length > 8) && (tRecipe.mFluidInputs[8] != null) && (tRecipe.mFluidInputs[8].getFluid() != null)) { + this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(tRecipe.mFluidInputs[8], true), 48, 41)); + } + } + + tStartIndex = 0; + if (tRecipe.mFluidOutputs.length > 0) { + if ((tRecipe.mFluidOutputs[0] != null) && (tRecipe.mFluidOutputs[0].getFluid() != null)) { + this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(tRecipe.mFluidOutputs[0], false), 120, 5, tRecipe.getMaxOutput(tStartIndex++))); + } + if ((tRecipe.mFluidOutputs.length > 1) && (tRecipe.mFluidOutputs[1] != null) && (tRecipe.mFluidOutputs[1].getFluid() != null)) { + this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(tRecipe.mFluidOutputs[1], true), 102, 5, tRecipe.getMaxOutput(tStartIndex++))); + } + if ((tRecipe.mFluidOutputs.length > 2) && (tRecipe.mFluidOutputs[2] != null) && (tRecipe.mFluidOutputs[2].getFluid() != null)) { + this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(tRecipe.mFluidOutputs[2], false), 138, 5, tRecipe.getMaxOutput(tStartIndex++))); + } + if ((tRecipe.mFluidOutputs.length > 3) && (tRecipe.mFluidOutputs[3] != null) && (tRecipe.mFluidOutputs[3].getFluid() != null)) { + this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(tRecipe.mFluidOutputs[3], false), 102, 23, tRecipe.getMaxOutput(tStartIndex++))); + } + if ((tRecipe.mFluidOutputs.length > 4) && (tRecipe.mFluidOutputs[4] != null) && (tRecipe.mFluidOutputs[4].getFluid() != null)) { + this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(tRecipe.mFluidOutputs[4], false), 120, 23, tRecipe.getMaxOutput(tStartIndex++))); + } + if ((tRecipe.mFluidOutputs.length > 5) && (tRecipe.mFluidOutputs[5] != null) && (tRecipe.mFluidOutputs[5].getFluid() != null)) { + this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(tRecipe.mFluidOutputs[5], false), 138, 23, tRecipe.getMaxOutput(tStartIndex++))); + } + if ((tRecipe.mFluidOutputs.length > 6) && (tRecipe.mFluidOutputs[6] != null) && (tRecipe.mFluidOutputs[6].getFluid() != null)) { + this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(tRecipe.mFluidOutputs[6], false), 102, 41, tRecipe.getMaxOutput(tStartIndex++))); + } + if ((tRecipe.mFluidOutputs.length > 7) && (tRecipe.mFluidOutputs[7] != null) && (tRecipe.mFluidOutputs[7].getFluid() != null)) { + this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(tRecipe.mFluidOutputs[7], false), 120, 41, tRecipe.getMaxOutput(tStartIndex++))); + } + if ((tRecipe.mFluidOutputs.length > 8) && (tRecipe.mFluidOutputs[8] != null) && (tRecipe.mFluidOutputs[8].getFluid() != null)) { + this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(tRecipe.mFluidOutputs[8], false), 138, 41, tRecipe.getMaxOutput(tStartIndex++))); + } + } + } + + @Override + public int compareTo(CachedRecipe o) { + boolean b = GasSpargingRecipeNEI.class.isInstance(o); + if (b) { + GasSpargingRecipeNEI p = (GasSpargingRecipeNEI) o; + if (p.mOutputs.size() > this.mOutputs.size()) { + return 1; + } else if (p.mOutputs.size() == this.mOutputs.size()) { + return 0; + } else { + return -1; + } + } + return 0; + } + + @Override + public boolean equals(Object obj) { + if (obj != null) { + if (GasSpargingRecipeNEI.class.isInstance(obj)) { + GasSpargingRecipeNEI p = (GasSpargingRecipeNEI) obj; + if (p != null) { + if (GT_Utility.areStacksEqual(p.mInputs.get(0).item, this.mInputs.get(0).item, true)) { + if (p.mOutputs.size() == this.mOutputs.size()) { + return true; + } + } + } + } + } + return false; + } + + @Override + public List<PositionedStack> getIngredients() { + return this.getCycledIngredients(GT_NEI_LFTR_Sparging.this.cycleticks / 10, this.mInputs); + } + + @Override + public PositionedStack getResult() { + return null; + } + + @Override + public List<PositionedStack> getOtherStacks() { + return this.mOutputs; + } + + + } +}
\ No newline at end of file diff --git a/src/Java/gtPlusPlus/nei/GT_NEI_MillingMachine.java b/src/Java/gtPlusPlus/nei/GT_NEI_MillingMachine.java index 8aea87b6d4..5d09b9003f 100644 --- a/src/Java/gtPlusPlus/nei/GT_NEI_MillingMachine.java +++ b/src/Java/gtPlusPlus/nei/GT_NEI_MillingMachine.java @@ -1,73 +1,20 @@ package gtPlusPlus.nei; -import java.awt.Point; -import java.awt.Rectangle; -import java.util.ArrayList; -import java.util.Collections; -import java.util.Iterator; import java.util.List; -import org.lwjgl.opengl.GL11; - -import codechicken.lib.gui.GuiDraw; import codechicken.nei.PositionedStack; -import codechicken.nei.guihook.GuiContainerManager; -import codechicken.nei.guihook.IContainerInputHandler; -import codechicken.nei.guihook.IContainerTooltipHandler; -import codechicken.nei.recipe.GuiCraftingRecipe; import codechicken.nei.recipe.GuiRecipe; -import codechicken.nei.recipe.GuiUsageRecipe; import codechicken.nei.recipe.TemplateRecipeHandler; -import cpw.mods.fml.common.event.FMLInterModComms; -import gregtech.api.enums.GT_Values; -import gregtech.api.enums.OrePrefixes; -import gregtech.api.gui.GT_GUIContainer_BasicMachine; -import gregtech.api.objects.ItemData; -import gregtech.api.util.GT_LanguageManager; -import gregtech.api.util.GT_OreDictUnificator; +import gregtech.api.util.GTPP_Recipe.GTPP_Recipe_Map; import gregtech.api.util.GT_Recipe; -import gregtech.api.util.GT_Recipe.GT_Recipe_Map; import gregtech.api.util.GT_Utility; -import gregtech.api.util.GTPP_Recipe; -import gregtech.api.util.GTPP_Recipe.GTPP_Recipe_Map; import gtPlusPlus.core.util.minecraft.ItemUtils; -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.inventory.GuiContainer; -import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; -import net.minecraftforge.fluids.FluidContainerRegistry; -import net.minecraftforge.fluids.FluidStack; -public class GT_NEI_MillingMachine -extends TemplateRecipeHandler { - public static final int sOffsetX = 5; - public static final int sOffsetY = 11; - - static { - GuiContainerManager.addInputHandler(new GT_RectHandler()); - GuiContainerManager.addTooltipHandler(new GT_RectHandler()); - } - - protected GT_Recipe_Map mRecipeMap; +public class GT_NEI_MillingMachine extends GTPP_NEI_DefaultHandler { public GT_NEI_MillingMachine() { - this.mRecipeMap = GTPP_Recipe_Map.sOreMillRecipes; - this.transferRects.add(new TemplateRecipeHandler.RecipeTransferRect(new Rectangle(65, 13, 36, 18), this.getRecipeMapName(), new Object[0])); - if (!NEI_GT_Config.sIsAdded) { - FMLInterModComms.sendRuntimeMessage(GT_Values.GT, "NEIPlugins", "register-crafting-handler", "gregtechplusplus@" + this.getRecipeName() + "@" + this.getRecipeMapName()); - GuiCraftingRecipe.craftinghandlers.add(this); - GuiUsageRecipe.usagehandlers.add(this); - } - } - - public List<GTPP_Recipe> getSortedRecipes() { - List<GTPP_Recipe> result = new ArrayList(this.mRecipeMap.mRecipeList); - Collections.sort(result); - return result; - } - - public static void drawText(final int aX, final int aY, final String aString, final int aColor) { - Minecraft.getMinecraft().fontRenderer.drawString(aString, aX, aY, aColor); + super(GTPP_Recipe_Map.sOreMillRecipes); } @Override @@ -76,118 +23,10 @@ extends TemplateRecipeHandler { } @Override - public void loadCraftingRecipes(final String outputId, final Object... results) { - if (outputId.equals(getRecipeMapName())) { - for (GTPP_Recipe tRecipe : getSortedRecipes()) { - if (!tRecipe.mHidden) { - this.arecipes.add(new CachedDefaultRecipe(tRecipe)); - } - } - } else { - super.loadCraftingRecipes(outputId, results); - } - } - - @Override - public void loadCraftingRecipes(final ItemStack aResult) { - ItemData tPrefixMaterial = GT_OreDictUnificator.getAssociation(aResult); - - ArrayList<ItemStack> tResults = new ArrayList<ItemStack>(); - tResults.add(aResult); - tResults.add(GT_OreDictUnificator.get(true, aResult)); - if ((tPrefixMaterial != null) && (!tPrefixMaterial.mBlackListed) && (!tPrefixMaterial.mPrefix.mFamiliarPrefixes.isEmpty())) { - for (OrePrefixes tPrefix : tPrefixMaterial.mPrefix.mFamiliarPrefixes) { - tResults.add(GT_OreDictUnificator.get(tPrefix, tPrefixMaterial.mMaterial.mMaterial, 1L)); - } - } - FluidStack tFluid = GT_Utility.getFluidForFilledItem(aResult, true); - if (tFluid != null) { - tResults.add(GT_Utility.getFluidDisplayStack(tFluid, false)); - for (FluidContainerRegistry.FluidContainerData tData : FluidContainerRegistry.getRegisteredFluidContainerData()) { - if (tData.fluid.isFluidEqual(tFluid)) { - tResults.add(GT_Utility.copy(new Object[]{tData.filledContainer})); - } - } - } - for (GTPP_Recipe tRecipe : getSortedRecipes()) { - if (!tRecipe.mHidden) { - CachedDefaultRecipe tNEIRecipe = new CachedDefaultRecipe(tRecipe); - for (ItemStack tStack : tResults) { - if (tNEIRecipe.contains(tNEIRecipe.mOutputs, tStack)) { - this.arecipes.add(tNEIRecipe); - break; - } - } - } - } - //CachedDefaultRecipe tNEIRecipe; - } - - public void loadUsageRecipes(ItemStack aInput) { - ItemData tPrefixMaterial = GT_OreDictUnificator.getAssociation(aInput); - - ArrayList<ItemStack> tInputs = new ArrayList<ItemStack>(); - tInputs.add(aInput); - tInputs.add(GT_OreDictUnificator.get(false, aInput)); - if ((tPrefixMaterial != null) && (!tPrefixMaterial.mPrefix.mFamiliarPrefixes.isEmpty())) { - for (OrePrefixes tPrefix : tPrefixMaterial.mPrefix.mFamiliarPrefixes) { - tInputs.add(GT_OreDictUnificator.get(tPrefix, tPrefixMaterial.mMaterial.mMaterial, 1L)); - } - } - FluidStack tFluid = GT_Utility.getFluidForFilledItem(aInput, true); - if (tFluid != null) { - tInputs.add(GT_Utility.getFluidDisplayStack(tFluid, false)); - for (FluidContainerRegistry.FluidContainerData tData : FluidContainerRegistry.getRegisteredFluidContainerData()) { - if (tData.fluid.isFluidEqual(tFluid)) { - tInputs.add(GT_Utility.copy(new Object[]{tData.filledContainer})); - } - } - } - for (GTPP_Recipe tRecipe : getSortedRecipes()) { - if (!tRecipe.mHidden) { - CachedDefaultRecipe tNEIRecipe = new CachedDefaultRecipe(tRecipe); - for (ItemStack tStack : tInputs) { - if (tNEIRecipe.contains(tNEIRecipe.mInputs, tStack)) { - this.arecipes.add(tNEIRecipe); - break; - } - } - } - } - //CachedDefaultRecipe tNEIRecipe; - } - - public String getRecipeMapName() { - return this.mRecipeMap.mNEIName; - } - - @Override - public String getOverlayIdentifier() { - return this.mRecipeMap.mNEIName; - } - - @Override - public void drawBackground(final int recipe) { - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - GuiDraw.changeTexture(this.getGuiTexture()); - GuiDraw.drawTexturedModalRect(-4, -8, 1, 3, 174, 78); - } - - @Override - public int recipiesPerPage() { - return 1; - } - - @Override - public String getRecipeName() { - return GT_LanguageManager.getTranslation(this.mRecipeMap.mUnlocalizedName); - } - - @Override - public String getGuiTexture() { - return this.mRecipeMap.mNEIGUIPath; - } - + public CachedDefaultRecipe createCachedRecipe(GT_Recipe aRecipe) { + return new MillingDefaultRecipe(aRecipe); + } + @Override public List<String> handleItemTooltip(final GuiRecipe gui, final ItemStack aStack, final List<String> currenttip, final int aRecipeIndex) { final TemplateRecipeHandler.CachedRecipe tObject = this.arecipes.get(aRecipeIndex); @@ -221,252 +60,77 @@ extends TemplateRecipeHandler { return currenttip; } - @Override - public void drawExtras(final int aRecipeIndex) { - final long tEUt = ((CachedDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.mEUt; - final int tDuration = ((CachedDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.mDuration; - if (tEUt != 0) { - drawText(10, 73, "Total: " + (long) (tDuration * tEUt) + " EU", -16777216); - //drawText(10, 83, "Usage: " + tEUt + " EU/t", -16777216); - if (this.mRecipeMap.mShowVoltageAmperageInNEI) { - drawText(10, 83, "Voltage: " + (tEUt / this.mRecipeMap.mAmperage) + " EU/t", -16777216); - drawText(10, 93, "Amperage: " + this.mRecipeMap.mAmperage, -16777216); - } else { - drawText(10, 93, "Voltage: unspecified", -16777216); - drawText(10, 103, "Amperage: unspecified", -16777216); - } - } - if (tDuration > 0) { - drawText(10, 103, "Time: " + (tDuration < 20 ? "< 1" : Integer.valueOf(tDuration / 20)) + " secs", -16777216); - } - if ((GT_Utility.isStringValid(this.mRecipeMap.mNEISpecialValuePre)) || (GT_Utility.isStringValid(this.mRecipeMap.mNEISpecialValuePost))) { - drawText(10, 113, this.mRecipeMap.mNEISpecialValuePre + (((CachedDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.mSpecialValue * this.mRecipeMap.mNEISpecialValueMultiplier) + this.mRecipeMap.mNEISpecialValuePost, -16777216); - } - } - - public static class GT_RectHandler - implements IContainerInputHandler, IContainerTooltipHandler { - @Override - public boolean mouseClicked(final GuiContainer gui, final int mousex, final int mousey, final int button) { - if (this.canHandle(gui)) { - if (button == 0) { - return this.transferRect(gui, false); - } - if (button == 1) { - return this.transferRect(gui, true); - } - } - return false; - } - - @Override - public boolean lastKeyTyped(final GuiContainer gui, final char keyChar, final int keyCode) { - return false; - } - - public boolean canHandle(final GuiContainer gui) { - return (((gui instanceof GT_GUIContainer_BasicMachine)) && (GT_Utility.isStringValid(((GT_GUIContainer_BasicMachine) gui).mNEI)) /*|| ((gui instanceof GT_GUIContainer_FusionReactor)) && (GT_Utility.isStringValid(((GT_GUIContainer_FusionReactor) gui).mNEI))*/); - } - - @Override - public List<String> handleTooltip(final GuiContainer gui, final int mousex, final int mousey, final List<String> currenttip) { - if ((this.canHandle(gui)) && (currenttip.isEmpty())) { - if ((gui instanceof GT_GUIContainer_BasicMachine) && new Rectangle(65, 13, 36, 18).contains(new Point(GuiDraw.getMousePosition().x - ((GT_GUIContainer_BasicMachine) gui).getLeft() - codechicken.nei.recipe.RecipeInfo.getGuiOffset(gui)[0], GuiDraw.getMousePosition().y - ((GT_GUIContainer_BasicMachine) gui).getTop() - codechicken.nei.recipe.RecipeInfo.getGuiOffset(gui)[1]))) { - currenttip.add("Recipes"); - } /*else if (gui instanceof GT_GUIContainer_FusionReactor && new Rectangle(145, 0, 24, 24).contains(new Point(GuiDraw.getMousePosition().x - ((GT_GUIContainer_FusionReactor) gui).getLeft() - codechicken.nei.recipe.RecipeInfo.getGuiOffset(gui)[0], GuiDraw.getMousePosition().y - ((GT_GUIContainer_FusionReactor) gui).getTop() - codechicken.nei.recipe.RecipeInfo.getGuiOffset(gui)[1]))) { - currenttip.add("Recipes"); - }*/ - - } - return currenttip; - } - - private boolean transferRect(final GuiContainer gui, final boolean usage) { - if (gui instanceof GT_GUIContainer_BasicMachine) { - return (this.canHandle(gui)) && (new Rectangle(65, 13, 36, 18).contains(new Point(GuiDraw.getMousePosition().x - ((GT_GUIContainer_BasicMachine) gui).getLeft() - codechicken.nei.recipe.RecipeInfo.getGuiOffset(gui)[0], GuiDraw.getMousePosition().y - ((GT_GUIContainer_BasicMachine) gui).getTop() - codechicken.nei.recipe.RecipeInfo.getGuiOffset(gui)[1]))) && (usage ? GuiUsageRecipe.openRecipeGui(((GT_GUIContainer_BasicMachine) gui).mNEI, new Object[0]) : GuiCraftingRecipe.openRecipeGui(((GT_GUIContainer_BasicMachine) gui).mNEI, new Object[0])); - } /*else if (gui instanceof GT_GUIContainer_FusionReactor) { - return (canHandle(gui)) && (new Rectangle(145, 0, 24, 24).contains(new Point(GuiDraw.getMousePosition().x - ((GT_GUIContainer_FusionReactor) gui).getLeft() - codechicken.nei.recipe.RecipeInfo.getGuiOffset(gui)[0], GuiDraw.getMousePosition().y - ((GT_GUIContainer_FusionReactor) gui).getTop() - codechicken.nei.recipe.RecipeInfo.getGuiOffset(gui)[1]))) && (usage ? GuiUsageRecipe.openRecipeGui(((GT_GUIContainer_FusionReactor) gui).mNEI, new Object[0]) : GuiCraftingRecipe.openRecipeGui(((GT_GUIContainer_FusionReactor) gui).mNEI, new Object[0])); - }*/ - return false; - } - - @Override - public List<String> handleItemDisplayName(final GuiContainer gui, final ItemStack itemstack, final List<String> currenttip) { - return currenttip; - } - - @Override - public List<String> handleItemTooltip(final GuiContainer gui, final ItemStack itemstack, final int mousex, final int mousey, final List<String> currenttip) { - return currenttip; - } - - @Override - public boolean keyTyped(final GuiContainer gui, final char keyChar, final int keyCode) { - return false; - } - - @Override - public void onKeyTyped(final GuiContainer gui, final char keyChar, final int keyID) { - } - - @Override - public void onMouseClicked(final GuiContainer gui, final int mousex, final int mousey, final int button) { - } - - @Override - public void onMouseUp(final GuiContainer gui, final int mousex, final int mousey, final int button) { - } + public class MillingDefaultRecipe extends CachedDefaultRecipe { - @Override - public boolean mouseScrolled(final GuiContainer gui, final int mousex, final int mousey, final int scrolled) { - return false; + public MillingDefaultRecipe(final GT_Recipe aRecipe) { + super(aRecipe); } - + @Override - public void onMouseScrolled(final GuiContainer gui, final int mousex, final int mousey, final int scrolled) { - } - - @Override - public void onMouseDragged(final GuiContainer gui, final int mousex, final int mousey, final int button, final long heldTime) { - } - } - - public class FixedPositionedStack - extends PositionedStack { - public final int mChance; - public boolean permutated = false; - - public FixedPositionedStack(final Object object, final int x, final int y) { - this(object, x, y, 0); - } - - public FixedPositionedStack(final Object object, final int x, final int y, final int aChance) { - super(object, x, y, true); - this.mChance = aChance; - } - - @Override - public void generatePermutations() { - if (this.permutated) { - return; - } - final ArrayList<ItemStack> tDisplayStacks = new ArrayList<ItemStack>(); - for (final ItemStack tStack : this.items) { - if (GT_Utility.isStackValid(tStack)) { - if (tStack.getItemDamage() == 32767) { - final List<ItemStack> permutations = codechicken.nei.ItemList.itemMap.get(tStack.getItem()); - if (!permutations.isEmpty()) { - ItemStack stack; - for (final Iterator<ItemStack> i$ = permutations.iterator(); i$.hasNext(); tDisplayStacks.add(GT_Utility.copyAmount(tStack.stackSize, new Object[]{stack}))) { - stack = i$.next(); - } - } else { - final ItemStack base = new ItemStack(tStack.getItem(), tStack.stackSize); - base.stackTagCompound = tStack.stackTagCompound; - tDisplayStacks.add(base); - } - } else { - tDisplayStacks.add(GT_Utility.copy(new Object[]{tStack})); - } - } - } - this.items = (tDisplayStacks.toArray(new ItemStack[0])); - if (this.items.length == 0) { - this.items = new ItemStack[]{new ItemStack(Blocks.fire)}; - } - this.permutated = true; - this.setPermutationToRender(0); - } - } + public void handleSlots() { + int tStartIndex = 0; - public class CachedDefaultRecipe - extends TemplateRecipeHandler.CachedRecipe { - public final GT_Recipe mRecipe; - public final List<PositionedStack> mOutputs = new ArrayList<PositionedStack>(); - public final List<PositionedStack> mInputs = new ArrayList<PositionedStack>(); - - public CachedDefaultRecipe(final GT_Recipe aRecipe) { - super(); - this.mRecipe = aRecipe; - - int tStartIndex = 0; - - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 12, 14)); + if (mRecipe.getRepresentativeInput(tStartIndex) != null) { + this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 12, 14)); } tStartIndex++; - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 30, 14)); + if (mRecipe.getRepresentativeInput(tStartIndex) != null) { + this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 30, 14)); } tStartIndex++; - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 48, 14)); + if (mRecipe.getRepresentativeInput(tStartIndex) != null) { + this.mInputs.add(new FixedPositionedStack(mRecipe.getRepresentativeInput(tStartIndex), 48, 14)); } tStartIndex++; - if (aRecipe.mSpecialItems != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.mSpecialItems, 120, 52)); + if (mRecipe.mSpecialItems != null) { + this.mInputs.add(new FixedPositionedStack(mRecipe.mSpecialItems, 120, 52)); } tStartIndex = 0; //Four Output Slots - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 102, 5, aRecipe.getOutputChance(tStartIndex))); + if (mRecipe.getOutput(tStartIndex) != null) { + this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 102, 5, mRecipe.getOutputChance(tStartIndex))); } tStartIndex++; - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 120, 5, aRecipe.getOutputChance(tStartIndex))); + if (mRecipe.getOutput(tStartIndex) != null) { + this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 120, 5, mRecipe.getOutputChance(tStartIndex))); } tStartIndex++; - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 102, 23, aRecipe.getOutputChance(tStartIndex))); + if (mRecipe.getOutput(tStartIndex) != null) { + this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 102, 23, mRecipe.getOutputChance(tStartIndex))); } tStartIndex++; - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 120, 23, aRecipe.getOutputChance(tStartIndex))); + if (mRecipe.getOutput(tStartIndex) != null) { + this.mOutputs.add(new FixedPositionedStack(mRecipe.getOutput(tStartIndex), 120, 23, mRecipe.getOutputChance(tStartIndex))); } tStartIndex++; //New fluid display behaviour when 3 fluid inputs are detected. (Basically a mix of the code below for outputs an the code above for 9 input slots.) - if (aRecipe.mFluidInputs.length >= 1) { - if ((aRecipe.mFluidInputs[0] != null) && (aRecipe.mFluidInputs[0].getFluid() != null)) { - this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidInputs[0], true), 3, 31)); + if (mRecipe.mFluidInputs.length >= 1) { + if ((mRecipe.mFluidInputs[0] != null) && (mRecipe.mFluidInputs[0].getFluid() != null)) { + this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidInputs[0], true), 3, 31)); } - if ((aRecipe.mFluidInputs.length > 1) && (aRecipe.mFluidInputs[1] != null) && (aRecipe.mFluidInputs[1].getFluid() != null)) { - this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidInputs[1], true), 21, 31)); + if ((mRecipe.mFluidInputs.length > 1) && (mRecipe.mFluidInputs[1] != null) && (mRecipe.mFluidInputs[1].getFluid() != null)) { + this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidInputs[1], true), 21, 31)); } - if ((aRecipe.mFluidInputs.length > 2) && (aRecipe.mFluidInputs[2] != null) && (aRecipe.mFluidInputs[2].getFluid() != null)) { - this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidInputs[2], true), 39, 31)); + if ((mRecipe.mFluidInputs.length > 2) && (mRecipe.mFluidInputs[2] != null) && (mRecipe.mFluidInputs[2].getFluid() != null)) { + this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidInputs[2], true), 39, 31)); } - if ((aRecipe.mFluidInputs.length > 3) && (aRecipe.mFluidInputs[3] != null) && (aRecipe.mFluidInputs[3].getFluid() != null)) { - this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidInputs[3], true), 57, 31)); + if ((mRecipe.mFluidInputs.length > 3) && (mRecipe.mFluidInputs[3] != null) && (mRecipe.mFluidInputs[3].getFluid() != null)) { + this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidInputs[3], true), 57, 31)); } } - if (aRecipe.mFluidOutputs.length > 0) { - if ((aRecipe.mFluidOutputs[0] != null) && (aRecipe.mFluidOutputs[0].getFluid() != null)) { - this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidOutputs[0], true), 138, 5)); + if (mRecipe.mFluidOutputs.length > 0) { + if ((mRecipe.mFluidOutputs[0] != null) && (mRecipe.mFluidOutputs[0].getFluid() != null)) { + this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidOutputs[0], true), 138, 5)); } - if ((aRecipe.mFluidOutputs.length > 1) && (aRecipe.mFluidOutputs[1] != null) && (aRecipe.mFluidOutputs[1].getFluid() != null)) { - this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidOutputs[1], true), 138, 23)); + if ((mRecipe.mFluidOutputs.length > 1) && (mRecipe.mFluidOutputs[1] != null) && (mRecipe.mFluidOutputs[1].getFluid() != null)) { + this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(mRecipe.mFluidOutputs[1], true), 138, 23)); } } } - - @Override - public List<PositionedStack> getIngredients() { - return this.getCycledIngredients(GT_NEI_MillingMachine.this.cycleticks / 10, this.mInputs); - } - - @Override - public PositionedStack getResult() { - return null; - } - - @Override - public List<PositionedStack> getOtherStacks() { - return this.mOutputs; - } } } diff --git a/src/Java/gtPlusPlus/nei/GT_NEI_MultiNoCell.java b/src/Java/gtPlusPlus/nei/GT_NEI_MultiNoCell.java new file mode 100644 index 0000000000..f4f69589b6 --- /dev/null +++ b/src/Java/gtPlusPlus/nei/GT_NEI_MultiNoCell.java @@ -0,0 +1,58 @@ +package gtPlusPlus.nei; + +import static gregtech.api.enums.GT_Values.RES_PATH_GUI; + +import org.lwjgl.opengl.GL11; + +import codechicken.lib.gui.GuiDraw; +import codechicken.nei.recipe.TemplateRecipeHandler; +import gregtech.api.util.GT_Recipe; +import gregtech.api.util.GT_Recipe.GT_Recipe_Map; +import gregtech.api.util.GT_Utility; +import gtPlusPlus.core.util.math.MathUtils; + +public class GT_NEI_MultiNoCell extends GTPP_NEI_DefaultHandler { + + public GT_NEI_MultiNoCell(GT_Recipe_Map aMap) { + super(aMap); + } + + @Override + public TemplateRecipeHandler newInstance() { + return new GT_NEI_MultiNoCell(mRecipeMap); + } + + @Override + public CachedDefaultRecipe createCachedRecipe(GT_Recipe aRecipe) { + return new NoCellMultiDefaultRecipe(aRecipe); + } + + @Override + public void drawBackground(final int recipe) { + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + GuiDraw.changeTexture(this.getGuiTexture()); + GuiDraw.drawTexturedModalRect(-4, -8, 1, 3, 174, 89); + } + + @Override + public String getGuiTexture() { + return RES_PATH_GUI + "basicmachines/FissionFuel.png"; + } + + @Override + public void drawExtras(final int aRecipeIndex) { + final long tEUt = ((CachedDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.mEUt; + final int tDuration = ((CachedDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.mDuration; + if (tEUt != 0) { + drawText(10, 90, "Total: " + MathUtils.formatNumbers((long) (tDuration * tEUt)) + " EU", -16777216); + drawText(10, 100, "Usage: " + MathUtils.formatNumbers(tEUt) + " EU/t", -16777216); + } + if (tDuration > 0) { + drawText(10, 110, "Time: " + (tDuration < 20 ? "< 1" : MathUtils.formatNumbers(Integer.valueOf(tDuration / 20))) + " secs", -16777216); + } + if ((GT_Utility.isStringValid(this.mRecipeMap.mNEISpecialValuePre)) || (GT_Utility.isStringValid(this.mRecipeMap.mNEISpecialValuePost))) { + drawText(10, 120, this.mRecipeMap.mNEISpecialValuePre + MathUtils.formatNumbers((((CachedDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.mSpecialValue * this.mRecipeMap.mNEISpecialValueMultiplier)) + this.mRecipeMap.mNEISpecialValuePost, -16777216); + } + } + +} diff --git a/src/Java/gtPlusPlus/nei/GT_NEI_RFPP.java b/src/Java/gtPlusPlus/nei/GT_NEI_RFPP.java deleted file mode 100644 index 93ad7a775b..0000000000 --- a/src/Java/gtPlusPlus/nei/GT_NEI_RFPP.java +++ /dev/null @@ -1,515 +0,0 @@ -package gtPlusPlus.nei; - -import java.awt.Point; -import java.awt.Rectangle; -import java.util.*; - -import org.lwjgl.opengl.GL11; - -import codechicken.lib.gui.GuiDraw; -import codechicken.nei.PositionedStack; -import codechicken.nei.guihook.GuiContainerManager; -import codechicken.nei.guihook.IContainerInputHandler; -import codechicken.nei.guihook.IContainerTooltipHandler; -import codechicken.nei.recipe.*; -import cpw.mods.fml.common.event.FMLInterModComms; -import gregtech.api.enums.GT_Values; -import gregtech.api.enums.OrePrefixes; -import gregtech.api.gui.GT_GUIContainer_BasicMachine; -import gregtech.api.objects.ItemData; -import gregtech.api.util.*; -import gregtech.api.util.GTPP_Recipe.GTPP_Recipe_Map_Internal; -import gtPlusPlus.core.util.minecraft.ItemUtils; -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.inventory.GuiContainer; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; -import net.minecraftforge.fluids.FluidContainerRegistry; -import net.minecraftforge.fluids.FluidStack; - -public class GT_NEI_RFPP -extends TemplateRecipeHandler { - public static final int sOffsetX = 5; - public static final int sOffsetY = 11; - - static { - GuiContainerManager.addInputHandler(new GT_RectHandler()); - GuiContainerManager.addTooltipHandler(new GT_RectHandler()); - } - - protected GTPP_Recipe_Map_Internal mRecipeMap; - - public GT_NEI_RFPP() { - this.mRecipeMap = GTPP_Recipe.GTPP_Recipe_Map.sFissionFuelProcessing; - this.transferRects.add(new TemplateRecipeHandler.RecipeTransferRect(new Rectangle(65, 13, 36, 18), this.getRecipeMapName(), new Object[0])); - if (!NEI_GT_Config.sIsAdded) { - FMLInterModComms.sendRuntimeMessage(GT_Values.GT, "NEIPlugins", "register-crafting-handler", "gregtechplusplus@" + this.getRecipeName() + "@" + this.getRecipeMapName()); - GuiCraftingRecipe.craftinghandlers.add(this); - GuiUsageRecipe.usagehandlers.add(this); - } - } - - public List<GTPP_Recipe> getSortedRecipes() { - List<GTPP_Recipe> result = new ArrayList(this.mRecipeMap.mRecipeList); - Collections.sort(result); - return result; - } - - public static void drawText(final int aX, final int aY, final String aString, final int aColor) { - Minecraft.getMinecraft().fontRenderer.drawString(aString, aX, aY, aColor); - } - - @Override - public TemplateRecipeHandler newInstance() { - return new GT_NEI_RFPP(); - } - - @Override - public void loadCraftingRecipes(final String outputId, final Object... results) { - if (outputId.equals(getRecipeMapName())) { - for (GTPP_Recipe tRecipe : getSortedRecipes()) { - if (!tRecipe.mHidden) { - this.arecipes.add(new CachedDefaultRecipe(tRecipe)); - } - } - } else { - super.loadCraftingRecipes(outputId, results); - } - } - - @Override - public void loadCraftingRecipes(final ItemStack aResult) { - ItemData tPrefixMaterial = GT_OreDictUnificator.getAssociation(aResult); - - ArrayList<ItemStack> tResults = new ArrayList<ItemStack>(); - tResults.add(aResult); - tResults.add(GT_OreDictUnificator.get(true, aResult)); - if ((tPrefixMaterial != null) && (!tPrefixMaterial.mBlackListed) && (!tPrefixMaterial.mPrefix.mFamiliarPrefixes.isEmpty())) { - for (OrePrefixes tPrefix : tPrefixMaterial.mPrefix.mFamiliarPrefixes) { - tResults.add(GT_OreDictUnificator.get(tPrefix, tPrefixMaterial.mMaterial.mMaterial, 1L)); - } - } - FluidStack tFluid = GT_Utility.getFluidForFilledItem(aResult, true); - if (tFluid != null) { - tResults.add(GT_Utility.getFluidDisplayStack(tFluid, false)); - for (FluidContainerRegistry.FluidContainerData tData : FluidContainerRegistry.getRegisteredFluidContainerData()) { - if (tData.fluid.isFluidEqual(tFluid)) { - tResults.add(GT_Utility.copy(new Object[]{tData.filledContainer})); - } - } - } - for (GTPP_Recipe tRecipe : getSortedRecipes()) { - if (!tRecipe.mHidden) { - CachedDefaultRecipe tNEIRecipe = new CachedDefaultRecipe(tRecipe); - for (ItemStack tStack : tResults) { - if (tNEIRecipe.contains(tNEIRecipe.mOutputs, tStack)) { - this.arecipes.add(tNEIRecipe); - break; - } - } - } - } - //CachedDefaultRecipe tNEIRecipe; - } - - public void loadUsageRecipes(ItemStack aInput) { - ItemData tPrefixMaterial = GT_OreDictUnificator.getAssociation(aInput); - - ArrayList<ItemStack> tInputs = new ArrayList<ItemStack>(); - tInputs.add(aInput); - tInputs.add(GT_OreDictUnificator.get(false, aInput)); - if ((tPrefixMaterial != null) && (!tPrefixMaterial.mPrefix.mFamiliarPrefixes.isEmpty())) { - for (OrePrefixes tPrefix : tPrefixMaterial.mPrefix.mFamiliarPrefixes) { - tInputs.add(GT_OreDictUnificator.get(tPrefix, tPrefixMaterial.mMaterial.mMaterial, 1L)); - } - } - FluidStack tFluid = GT_Utility.getFluidForFilledItem(aInput, true); - if (tFluid != null) { - tInputs.add(GT_Utility.getFluidDisplayStack(tFluid, false)); - for (FluidContainerRegistry.FluidContainerData tData : FluidContainerRegistry.getRegisteredFluidContainerData()) { - if (tData.fluid.isFluidEqual(tFluid)) { - tInputs.add(GT_Utility.copy(new Object[]{tData.filledContainer})); - } - } - } - for (GTPP_Recipe tRecipe : getSortedRecipes()) { - if (!tRecipe.mHidden) { - CachedDefaultRecipe tNEIRecipe = new CachedDefaultRecipe(tRecipe); - for (ItemStack tStack : tInputs) { - if (tNEIRecipe.contains(tNEIRecipe.mInputs, tStack)) { - this.arecipes.add(tNEIRecipe); - break; - } - } - } - } - //CachedDefaultRecipe tNEIRecipe; - } - - public String getRecipeMapName() { - return this.mRecipeMap.mNEIName; - } - - @Override - public String getOverlayIdentifier() { - return this.mRecipeMap.mNEIName; - } - - @Override - public void drawBackground(final int recipe) { - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - GuiDraw.changeTexture(this.getGuiTexture()); - GuiDraw.drawTexturedModalRect(-4, -8, 1, 3, 174, 78); - } - - @Override - public int recipiesPerPage() { - return 1; - } - - @Override - public String getRecipeName() { - return GT_LanguageManager.getTranslation(this.mRecipeMap.mUnlocalizedName); - } - - @Override - public String getGuiTexture() { - return this.mRecipeMap.mNEIGUIPath; - } - - @Override - public List<String> handleItemTooltip(final GuiRecipe gui, final ItemStack aStack, final List<String> currenttip, final int aRecipeIndex) { - final TemplateRecipeHandler.CachedRecipe tObject = this.arecipes.get(aRecipeIndex); - if ((tObject instanceof CachedDefaultRecipe)) { - final CachedDefaultRecipe tRecipe = (CachedDefaultRecipe) tObject; - for (final PositionedStack tStack : tRecipe.mOutputs) { - if (aStack == tStack.item) { - if ((!(tStack instanceof FixedPositionedStack)) || (((FixedPositionedStack) tStack).mChance <= 0) || (((FixedPositionedStack) tStack).mChance == 10000)) { - break; - } - currenttip.add("Chance: " + (((FixedPositionedStack) tStack).mChance / 100) + "." + ((((FixedPositionedStack) tStack).mChance % 100) < 10 ? "0" + (((FixedPositionedStack) tStack).mChance % 100) : Integer.valueOf(((FixedPositionedStack) tStack).mChance % 100)) + "%"); - break; - } - } - for (final PositionedStack tStack : tRecipe.mInputs) { - if (GT_Utility.areStacksEqual(aStack, tStack.item)) { - if ((gregtech.api.enums.ItemList.Display_Fluid.isStackEqual(tStack.item, true, true)) || - (tStack.item.stackSize != 0)) { - break; - } - if (ItemUtils.isControlCircuit(aStack)) { - currenttip.add("Does not get consumed in the process"); - } - break; - } - } - } - return currenttip; - } - - @Override - public void drawExtras(final int aRecipeIndex) { - final long tEUt = ((CachedDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.mEUt; - final int tDuration = ((CachedDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.mDuration; - if (tEUt != 0) { - drawText(10, 73, "Total: " + (long) (tDuration * tEUt) + " EU", -16777216); - //drawText(10, 83, "Usage: " + tEUt + " EU/t", -16777216); - if (this.mRecipeMap.mShowVoltageAmperageInNEI) { - drawText(10, 83, "Voltage: " + (tEUt / this.mRecipeMap.mAmperage) + " EU/t", -16777216); - drawText(10, 93, "Amperage: " + this.mRecipeMap.mAmperage, -16777216); - } else { - drawText(10, 93, "Voltage: unspecified", -16777216); - drawText(10, 103, "Amperage: unspecified", -16777216); - } - } - if (tDuration > 0) { - drawText(10, 103, "Time: " + (tDuration < 20 ? "< 1" : Integer.valueOf(tDuration / 20)) + " secs", -16777216); - } - //if ((GT_Utility.isStringValid(this.mRecipeMap.mNEISpecialValuePre)) || (GT_Utility.isStringValid(this.mRecipeMap.mNEISpecialValuePost))) { - //drawText(10, 113, this.mRecipeMap.mNEISpecialValuePre + (((CachedDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.mSpecialValue * this.mRecipeMap.mNEISpecialValueMultiplier) + this.mRecipeMap.mNEISpecialValuePost, -16777216); - //} - } - - public static class GT_RectHandler - implements IContainerInputHandler, IContainerTooltipHandler { - @Override - public boolean mouseClicked(final GuiContainer gui, final int mousex, final int mousey, final int button) { - if (this.canHandle(gui)) { - if (button == 0) { - return this.transferRect(gui, false); - } - if (button == 1) { - return this.transferRect(gui, true); - } - } - return false; - } - - @Override - public boolean lastKeyTyped(final GuiContainer gui, final char keyChar, final int keyCode) { - return false; - } - - public boolean canHandle(final GuiContainer gui) { - return (((gui instanceof GT_GUIContainer_BasicMachine)) && (GT_Utility.isStringValid(((GT_GUIContainer_BasicMachine) gui).mNEI)) /*|| ((gui instanceof GT_GUIContainer_FusionReactor)) && (GT_Utility.isStringValid(((GT_GUIContainer_FusionReactor) gui).mNEI))*/); - } - - @Override - public List<String> handleTooltip(final GuiContainer gui, final int mousex, final int mousey, final List<String> currenttip) { - if ((this.canHandle(gui)) && (currenttip.isEmpty())) { - if ((gui instanceof GT_GUIContainer_BasicMachine) && new Rectangle(65, 13, 36, 18).contains(new Point(GuiDraw.getMousePosition().x - ((GT_GUIContainer_BasicMachine) gui).getLeft() - codechicken.nei.recipe.RecipeInfo.getGuiOffset(gui)[0], GuiDraw.getMousePosition().y - ((GT_GUIContainer_BasicMachine) gui).getTop() - codechicken.nei.recipe.RecipeInfo.getGuiOffset(gui)[1]))) { - currenttip.add("Recipes"); - } /*else if (gui instanceof GT_GUIContainer_FusionReactor && new Rectangle(145, 0, 24, 24).contains(new Point(GuiDraw.getMousePosition().x - ((GT_GUIContainer_FusionReactor) gui).getLeft() - codechicken.nei.recipe.RecipeInfo.getGuiOffset(gui)[0], GuiDraw.getMousePosition().y - ((GT_GUIContainer_FusionReactor) gui).getTop() - codechicken.nei.recipe.RecipeInfo.getGuiOffset(gui)[1]))) { - currenttip.add("Recipes"); - }*/ - - } - return currenttip; - } - - private boolean transferRect(final GuiContainer gui, final boolean usage) { - if (gui instanceof GT_GUIContainer_BasicMachine) { - return (this.canHandle(gui)) && (new Rectangle(65, 13, 36, 18).contains(new Point(GuiDraw.getMousePosition().x - ((GT_GUIContainer_BasicMachine) gui).getLeft() - codechicken.nei.recipe.RecipeInfo.getGuiOffset(gui)[0], GuiDraw.getMousePosition().y - ((GT_GUIContainer_BasicMachine) gui).getTop() - codechicken.nei.recipe.RecipeInfo.getGuiOffset(gui)[1]))) && (usage ? GuiUsageRecipe.openRecipeGui(((GT_GUIContainer_BasicMachine) gui).mNEI, new Object[0]) : GuiCraftingRecipe.openRecipeGui(((GT_GUIContainer_BasicMachine) gui).mNEI, new Object[0])); - } /*else if (gui instanceof GT_GUIContainer_FusionReactor) { - return (canHandle(gui)) && (new Rectangle(145, 0, 24, 24).contains(new Point(GuiDraw.getMousePosition().x - ((GT_GUIContainer_FusionReactor) gui).getLeft() - codechicken.nei.recipe.RecipeInfo.getGuiOffset(gui)[0], GuiDraw.getMousePosition().y - ((GT_GUIContainer_FusionReactor) gui).getTop() - codechicken.nei.recipe.RecipeInfo.getGuiOffset(gui)[1]))) && (usage ? GuiUsageRecipe.openRecipeGui(((GT_GUIContainer_FusionReactor) gui).mNEI, new Object[0]) : GuiCraftingRecipe.openRecipeGui(((GT_GUIContainer_FusionReactor) gui).mNEI, new Object[0])); - }*/ - return false; - } - - @Override - public List<String> handleItemDisplayName(final GuiContainer gui, final ItemStack itemstack, final List<String> currenttip) { - return currenttip; - } - - @Override - public List<String> handleItemTooltip(final GuiContainer gui, final ItemStack itemstack, final int mousex, final int mousey, final List<String> currenttip) { - return currenttip; - } - - @Override - public boolean keyTyped(final GuiContainer gui, final char keyChar, final int keyCode) { - return false; - } - - @Override - public void onKeyTyped(final GuiContainer gui, final char keyChar, final int keyID) { - } - - @Override - public void onMouseClicked(final GuiContainer gui, final int mousex, final int mousey, final int button) { - } - - @Override - public void onMouseUp(final GuiContainer gui, final int mousex, final int mousey, final int button) { - } - - @Override - public boolean mouseScrolled(final GuiContainer gui, final int mousex, final int mousey, final int scrolled) { - return false; - } - - @Override - public void onMouseScrolled(final GuiContainer gui, final int mousex, final int mousey, final int scrolled) { - } - - @Override - public void onMouseDragged(final GuiContainer gui, final int mousex, final int mousey, final int button, final long heldTime) { - } - } - - public class FixedPositionedStack - extends PositionedStack { - public final int mChance; - public boolean permutated = false; - - public FixedPositionedStack(final Object object, final int x, final int y) { - this(object, x, y, 0); - } - - public FixedPositionedStack(final Object object, final int x, final int y, final int aChance) { - super(object, x, y, true); - this.mChance = aChance; - } - - @Override - public void generatePermutations() { - if (this.permutated) { - return; - } - final ArrayList<ItemStack> tDisplayStacks = new ArrayList<ItemStack>(); - for (final ItemStack tStack : this.items) { - if (GT_Utility.isStackValid(tStack)) { - if (tStack.getItemDamage() == 32767) { - final List<ItemStack> permutations = codechicken.nei.ItemList.itemMap.get(tStack.getItem()); - if (!permutations.isEmpty()) { - ItemStack stack; - for (final Iterator<ItemStack> i$ = permutations.iterator(); i$.hasNext(); tDisplayStacks.add(GT_Utility.copyAmount(tStack.stackSize, new Object[]{stack}))) { - stack = i$.next(); - } - } else { - final ItemStack base = new ItemStack(tStack.getItem(), tStack.stackSize); - base.stackTagCompound = tStack.stackTagCompound; - tDisplayStacks.add(base); - } - } else { - tDisplayStacks.add(GT_Utility.copy(new Object[]{tStack})); - } - } - } - this.items = (tDisplayStacks.toArray(new ItemStack[0])); - if (this.items.length == 0) { - this.items = new ItemStack[]{new ItemStack(Blocks.fire)}; - } - this.permutated = true; - this.setPermutationToRender(0); - } - } - - public class CachedDefaultRecipe - extends TemplateRecipeHandler.CachedRecipe { - public final GT_Recipe mRecipe; - public final List<PositionedStack> mOutputs = new ArrayList<PositionedStack>(); - public final List<PositionedStack> mInputs = new ArrayList<PositionedStack>(); - - public CachedDefaultRecipe(final GT_Recipe aRecipe) { - super(); - this.mRecipe = aRecipe; - - int tStartIndex = 0; - - - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 12, 5)); - } - tStartIndex++; - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 30, 5)); - } - tStartIndex++; - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 48, 5)); - } - tStartIndex++; - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 12, 23)); - } - tStartIndex++; - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 30, 23)); - } - tStartIndex++; - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 48, 23)); - } - tStartIndex++; - - if (aRecipe.mSpecialItems != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.mSpecialItems, 120, 52)); - } - tStartIndex = 0; - - //Four Output Slots - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 102, 5, aRecipe.getOutputChance(tStartIndex))); - } - tStartIndex++; - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 120, 5, aRecipe.getOutputChance(tStartIndex))); - } - tStartIndex++; - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 102, 23, aRecipe.getOutputChance(tStartIndex))); - } - tStartIndex++; - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 120, 23, aRecipe.getOutputChance(tStartIndex))); - } - tStartIndex++; - - //New fluid display behaviour when 3 fluid inputs are detected. (Basically a mix of the code below for outputs an the code above for 9 input slots.) - if (aRecipe.mFluidInputs.length > 2) { - if ((aRecipe.mFluidInputs[0] != null) && (aRecipe.mFluidInputs[0].getFluid() != null)) { - this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidInputs[0], true), 12, 5)); - } - if ((aRecipe.mFluidInputs[1] != null) && (aRecipe.mFluidInputs[1].getFluid() != null)) { - this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidInputs[1], true), 30, 5)); - } - if ((aRecipe.mFluidInputs.length > 2) && (aRecipe.mFluidInputs[2] != null) && (aRecipe.mFluidInputs[2].getFluid() != null)) { - this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidInputs[2], true), 48, 5)); - } - if ((aRecipe.mFluidInputs.length > 3) && (aRecipe.mFluidInputs[3] != null) && (aRecipe.mFluidInputs[3].getFluid() != null)) { - this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidInputs[3], true), 12, 23)); - } - if ((aRecipe.mFluidInputs.length > 4) && (aRecipe.mFluidInputs[4] != null) && (aRecipe.mFluidInputs[4].getFluid() != null)) { - this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidInputs[4], true), 30, 23)); - } - if ((aRecipe.mFluidInputs.length > 5) && (aRecipe.mFluidInputs[5] != null) && (aRecipe.mFluidInputs[5].getFluid() != null)) { - this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidInputs[5], true), 48, 23)); - } - if ((aRecipe.mFluidInputs.length > 6) && (aRecipe.mFluidInputs[6] != null) && (aRecipe.mFluidInputs[6].getFluid() != null)) { - this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidInputs[6], true), 12, 41)); - } - if ((aRecipe.mFluidInputs.length > 7) && (aRecipe.mFluidInputs[7] != null) && (aRecipe.mFluidInputs[7].getFluid() != null)) { - this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidInputs[7], true), 30, 41)); - } - if ((aRecipe.mFluidInputs.length > 8) && (aRecipe.mFluidInputs[8] != null) && (aRecipe.mFluidInputs[8].getFluid() != null)) { - this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidInputs[8], true), 48, 41)); - } - } - //Returns to old behaviour if fluid inputs < 3 - else if ((aRecipe.mFluidInputs.length > 0) && (aRecipe.mFluidInputs[0] != null) && (aRecipe.mFluidInputs[0].getFluid() != null)) { - this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidInputs[0], true), 48, 52)); - if ((aRecipe.mFluidInputs.length == 2) && (aRecipe.mFluidInputs[1] != null) && (aRecipe.mFluidInputs[1].getFluid() != null)) { - this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidInputs[1], true), 30, 52)); - } - } - - if (aRecipe.mFluidOutputs.length > 1) { - if ((aRecipe.mFluidOutputs[0] != null) && (aRecipe.mFluidOutputs[0].getFluid() != null)) { - this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidOutputs[0], true), 102, 5)); - } - if ((aRecipe.mFluidOutputs[1] != null) && (aRecipe.mFluidOutputs[1].getFluid() != null)) { - this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidOutputs[1], true), 120, 5)); - } - if ((aRecipe.mFluidOutputs.length > 2) && (aRecipe.mFluidOutputs[2] != null) && (aRecipe.mFluidOutputs[2].getFluid() != null)) { - this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidOutputs[2], true), 138, 5)); - } - if ((aRecipe.mFluidOutputs.length > 3) && (aRecipe.mFluidOutputs[3] != null) && (aRecipe.mFluidOutputs[3].getFluid() != null)) { - this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidOutputs[3], true), 102, 23)); - } - if ((aRecipe.mFluidOutputs.length > 4) && (aRecipe.mFluidOutputs[4] != null) && (aRecipe.mFluidOutputs[4].getFluid() != null)) { - this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidOutputs[4], true), 120, 23)); - } - if ((aRecipe.mFluidOutputs.length > 5) && (aRecipe.mFluidOutputs[5] != null) && (aRecipe.mFluidOutputs[5].getFluid() != null)) { - this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidOutputs[5], true), 138, 23)); - } - if ((aRecipe.mFluidOutputs.length > 6) && (aRecipe.mFluidOutputs[6] != null) && (aRecipe.mFluidOutputs[6].getFluid() != null)) { - this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidOutputs[6], true), 102, 41)); - } - if ((aRecipe.mFluidOutputs.length > 7) && (aRecipe.mFluidOutputs[7] != null) && (aRecipe.mFluidOutputs[7].getFluid() != null)) { - this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidOutputs[7], true), 120, 41)); - } - if ((aRecipe.mFluidOutputs.length > 8) && (aRecipe.mFluidOutputs[8] != null) && (aRecipe.mFluidOutputs[8].getFluid() != null)) { - this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidOutputs[8], true), 138, 41)); - } - } else if ((aRecipe.mFluidOutputs.length > 0) && (aRecipe.mFluidOutputs[0] != null) && (aRecipe.mFluidOutputs[0].getFluid() != null)) { - this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidOutputs[0], true), 102, 5)); - } - } - - @Override - public List<PositionedStack> getIngredients() { - return this.getCycledIngredients(GT_NEI_RFPP.this.cycleticks / 10, this.mInputs); - } - - @Override - public PositionedStack getResult() { - return null; - } - - @Override - public List<PositionedStack> getOtherStacks() { - return this.mOutputs; - } - } -} diff --git a/src/Java/gtPlusPlus/nei/GT_NEI_VacFurnace.java b/src/Java/gtPlusPlus/nei/GT_NEI_VacFurnace.java deleted file mode 100644 index e17bc6b15e..0000000000 --- a/src/Java/gtPlusPlus/nei/GT_NEI_VacFurnace.java +++ /dev/null @@ -1,482 +0,0 @@ -package gtPlusPlus.nei; - -import java.awt.Point; -import java.awt.Rectangle; -import java.util.*; - -import org.lwjgl.opengl.GL11; - -import codechicken.lib.gui.GuiDraw; -import codechicken.nei.PositionedStack; -import codechicken.nei.guihook.GuiContainerManager; -import codechicken.nei.guihook.IContainerInputHandler; -import codechicken.nei.guihook.IContainerTooltipHandler; -import codechicken.nei.recipe.*; -import cpw.mods.fml.common.event.FMLInterModComms; -import gregtech.api.enums.GT_Values; -import gregtech.api.enums.OrePrefixes; -import gregtech.api.gui.GT_GUIContainer_BasicMachine; -import gregtech.api.objects.ItemData; -import gregtech.api.util.*; -import gregtech.api.util.GT_Recipe.GT_Recipe_Map; -import gregtech.api.util.GTPP_Recipe.GTPP_Recipe_Map; -import gtPlusPlus.core.util.minecraft.ItemUtils; -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.inventory.GuiContainer; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; -import net.minecraftforge.fluids.FluidContainerRegistry; -import net.minecraftforge.fluids.FluidStack; - -public class GT_NEI_VacFurnace -extends TemplateRecipeHandler { - public static final int sOffsetX = 5; - public static final int sOffsetY = 11; - - static { - GuiContainerManager.addInputHandler(new GT_RectHandler()); - GuiContainerManager.addTooltipHandler(new GT_RectHandler()); - } - - protected GT_Recipe_Map mRecipeMap; - - public GT_NEI_VacFurnace() { - this.mRecipeMap = GTPP_Recipe_Map.sVacuumFurnaceRecipes; - this.transferRects.add(new TemplateRecipeHandler.RecipeTransferRect(new Rectangle(65, 13, 36, 18), this.getRecipeMapName(), new Object[0])); - if (!NEI_GT_Config.sIsAdded) { - FMLInterModComms.sendRuntimeMessage(GT_Values.GT, "NEIPlugins", "register-crafting-handler", "gregtechplusplus@" + this.getRecipeName() + "@" + this.getRecipeMapName()); - GuiCraftingRecipe.craftinghandlers.add(this); - GuiUsageRecipe.usagehandlers.add(this); - } - } - - public List<GTPP_Recipe> getSortedRecipes() { - List<GTPP_Recipe> result = new ArrayList(this.mRecipeMap.mRecipeList); - Collections.sort(result); - return result; - } - - public static void drawText(final int aX, final int aY, final String aString, final int aColor) { - Minecraft.getMinecraft().fontRenderer.drawString(aString, aX, aY, aColor); - } - - @Override - public TemplateRecipeHandler newInstance() { - return new GT_NEI_VacFurnace(); - } - - @Override - public void loadCraftingRecipes(final String outputId, final Object... results) { - if (outputId.equals(getRecipeMapName())) { - for (GTPP_Recipe tRecipe : getSortedRecipes()) { - if (!tRecipe.mHidden) { - this.arecipes.add(new CachedDefaultRecipe(tRecipe)); - } - } - } else { - super.loadCraftingRecipes(outputId, results); - } - } - - @Override - public void loadCraftingRecipes(final ItemStack aResult) { - ItemData tPrefixMaterial = GT_OreDictUnificator.getAssociation(aResult); - - ArrayList<ItemStack> tResults = new ArrayList<ItemStack>(); - tResults.add(aResult); - tResults.add(GT_OreDictUnificator.get(true, aResult)); - if ((tPrefixMaterial != null) && (!tPrefixMaterial.mBlackListed) && (!tPrefixMaterial.mPrefix.mFamiliarPrefixes.isEmpty())) { - for (OrePrefixes tPrefix : tPrefixMaterial.mPrefix.mFamiliarPrefixes) { - tResults.add(GT_OreDictUnificator.get(tPrefix, tPrefixMaterial.mMaterial.mMaterial, 1L)); - } - } - FluidStack tFluid = GT_Utility.getFluidForFilledItem(aResult, true); - if (tFluid != null) { - tResults.add(GT_Utility.getFluidDisplayStack(tFluid, false)); - for (FluidContainerRegistry.FluidContainerData tData : FluidContainerRegistry.getRegisteredFluidContainerData()) { - if (tData.fluid.isFluidEqual(tFluid)) { - tResults.add(GT_Utility.copy(new Object[]{tData.filledContainer})); - } - } - } - for (GTPP_Recipe tRecipe : getSortedRecipes()) { - if (!tRecipe.mHidden) { - CachedDefaultRecipe tNEIRecipe = new CachedDefaultRecipe(tRecipe); - for (ItemStack tStack : tResults) { - if (tNEIRecipe.contains(tNEIRecipe.mOutputs, tStack)) { - this.arecipes.add(tNEIRecipe); - break; - } - } - } - } - //CachedDefaultRecipe tNEIRecipe; - } - - public void loadUsageRecipes(ItemStack aInput) { - ItemData tPrefixMaterial = GT_OreDictUnificator.getAssociation(aInput); - - ArrayList<ItemStack> tInputs = new ArrayList<ItemStack>(); - tInputs.add(aInput); - tInputs.add(GT_OreDictUnificator.get(false, aInput)); - if ((tPrefixMaterial != null) && (!tPrefixMaterial.mPrefix.mFamiliarPrefixes.isEmpty())) { - for (OrePrefixes tPrefix : tPrefixMaterial.mPrefix.mFamiliarPrefixes) { - tInputs.add(GT_OreDictUnificator.get(tPrefix, tPrefixMaterial.mMaterial.mMaterial, 1L)); - } - } - FluidStack tFluid = GT_Utility.getFluidForFilledItem(aInput, true); - if (tFluid != null) { - tInputs.add(GT_Utility.getFluidDisplayStack(tFluid, false)); - for (FluidContainerRegistry.FluidContainerData tData : FluidContainerRegistry.getRegisteredFluidContainerData()) { - if (tData.fluid.isFluidEqual(tFluid)) { - tInputs.add(GT_Utility.copy(new Object[]{tData.filledContainer})); - } - } - } - for (GTPP_Recipe tRecipe : getSortedRecipes()) { - if (!tRecipe.mHidden) { - CachedDefaultRecipe tNEIRecipe = new CachedDefaultRecipe(tRecipe); - for (ItemStack tStack : tInputs) { - if (tNEIRecipe.contains(tNEIRecipe.mInputs, tStack)) { - this.arecipes.add(tNEIRecipe); - break; - } - } - } - } - //CachedDefaultRecipe tNEIRecipe; - } - - public String getRecipeMapName() { - return this.mRecipeMap.mNEIName; - } - - @Override - public String getOverlayIdentifier() { - return this.mRecipeMap.mNEIName; - } - - @Override - public void drawBackground(final int recipe) { - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - GuiDraw.changeTexture(this.getGuiTexture()); - GuiDraw.drawTexturedModalRect(-4, -8, 1, 3, 174, 78); - } - - @Override - public int recipiesPerPage() { - return 1; - } - - @Override - public String getRecipeName() { - return GT_LanguageManager.getTranslation(this.mRecipeMap.mUnlocalizedName); - } - - @Override - public String getGuiTexture() { - return GTPP_Recipe.GTPP_Recipe_Map.sFissionFuelProcessing.mNEIGUIPath; - } - - @Override - public List<String> handleItemTooltip(final GuiRecipe gui, final ItemStack aStack, final List<String> currenttip, final int aRecipeIndex) { - final TemplateRecipeHandler.CachedRecipe tObject = this.arecipes.get(aRecipeIndex); - if ((tObject instanceof CachedDefaultRecipe)) { - final CachedDefaultRecipe tRecipe = (CachedDefaultRecipe) tObject; - for (final PositionedStack tStack : tRecipe.mOutputs) { - if (aStack == tStack.item) { - if ((!(tStack instanceof FixedPositionedStack)) || (((FixedPositionedStack) tStack).mChance <= 0) || (((FixedPositionedStack) tStack).mChance == 10000)) { - break; - } - currenttip.add("Chance: " + (((FixedPositionedStack) tStack).mChance / 100) + "." + ((((FixedPositionedStack) tStack).mChance % 100) < 10 ? "0" + (((FixedPositionedStack) tStack).mChance % 100) : Integer.valueOf(((FixedPositionedStack) tStack).mChance % 100)) + "%"); - break; - } - } - for (final PositionedStack tStack : tRecipe.mInputs) { - if (GT_Utility.areStacksEqual(aStack, tStack.item)) { - if ((gregtech.api.enums.ItemList.Display_Fluid.isStackEqual(tStack.item, true, true)) || - (tStack.item.stackSize != 0)) { - break; - } - if (ItemUtils.isControlCircuit(aStack)) { - currenttip.add("Does not get consumed in the process"); - } - break; - } - } - } - return currenttip; - } - - @Override - public void drawExtras(final int aRecipeIndex) { - final long tEUt = ((CachedDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.mEUt; - final int tDuration = ((CachedDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.mDuration; - if (tEUt != 0) { - drawText(10, 88, "Total: " + (long) (tDuration * tEUt) + " EU", -16777216); - drawText(10, 98, "Usage: " + tEUt + " EU/t", -16777216); - /*if (this.mRecipeMap.mShowVoltageAmperageInNEI) { - drawText(10, 83, "Voltage: " + (tEUt / this.mRecipeMap.mAmperage) + " EU/t", -16777216); - drawText(10, 93, "Amperage: " + this.mRecipeMap.mAmperage, -16777216); - } else { - drawText(10, 93, "Voltage: unspecified", -16777216); - drawText(10, 103, "Amperage: unspecified", -16777216); - }*/ - } - if (tDuration > 0) { - drawText(10, 108, "Time: " + (tDuration < 20 ? "< 1" : Integer.valueOf(tDuration / 20)) + " secs", -16777216); - } - if ((GT_Utility.isStringValid(this.mRecipeMap.mNEISpecialValuePre)) || (GT_Utility.isStringValid(this.mRecipeMap.mNEISpecialValuePost))) { - drawText(10, 118, this.mRecipeMap.mNEISpecialValuePre + (((CachedDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.mSpecialValue * this.mRecipeMap.mNEISpecialValueMultiplier) + this.mRecipeMap.mNEISpecialValuePost, -16777216); - } - } - - public static class GT_RectHandler - implements IContainerInputHandler, IContainerTooltipHandler { - @Override - public boolean mouseClicked(final GuiContainer gui, final int mousex, final int mousey, final int button) { - if (this.canHandle(gui)) { - if (button == 0) { - return this.transferRect(gui, false); - } - if (button == 1) { - return this.transferRect(gui, true); - } - } - return false; - } - - @Override - public boolean lastKeyTyped(final GuiContainer gui, final char keyChar, final int keyCode) { - return false; - } - - public boolean canHandle(final GuiContainer gui) { - return (((gui instanceof GT_GUIContainer_BasicMachine)) && (GT_Utility.isStringValid(((GT_GUIContainer_BasicMachine) gui).mNEI)) /*|| ((gui instanceof GT_GUIContainer_FusionReactor)) && (GT_Utility.isStringValid(((GT_GUIContainer_FusionReactor) gui).mNEI))*/); - } - - @Override - public List<String> handleTooltip(final GuiContainer gui, final int mousex, final int mousey, final List<String> currenttip) { - if ((this.canHandle(gui)) && (currenttip.isEmpty())) { - if ((gui instanceof GT_GUIContainer_BasicMachine) && new Rectangle(65, 13, 36, 18).contains(new Point(GuiDraw.getMousePosition().x - ((GT_GUIContainer_BasicMachine) gui).getLeft() - codechicken.nei.recipe.RecipeInfo.getGuiOffset(gui)[0], GuiDraw.getMousePosition().y - ((GT_GUIContainer_BasicMachine) gui).getTop() - codechicken.nei.recipe.RecipeInfo.getGuiOffset(gui)[1]))) { - currenttip.add("Recipes"); - } /*else if (gui instanceof GT_GUIContainer_FusionReactor && new Rectangle(145, 0, 24, 24).contains(new Point(GuiDraw.getMousePosition().x - ((GT_GUIContainer_FusionReactor) gui).getLeft() - codechicken.nei.recipe.RecipeInfo.getGuiOffset(gui)[0], GuiDraw.getMousePosition().y - ((GT_GUIContainer_FusionReactor) gui).getTop() - codechicken.nei.recipe.RecipeInfo.getGuiOffset(gui)[1]))) { - currenttip.add("Recipes"); - }*/ - - } - return currenttip; - } - - private boolean transferRect(final GuiContainer gui, final boolean usage) { - if (gui instanceof GT_GUIContainer_BasicMachine) { - return (this.canHandle(gui)) && (new Rectangle(65, 13, 36, 18).contains(new Point(GuiDraw.getMousePosition().x - ((GT_GUIContainer_BasicMachine) gui).getLeft() - codechicken.nei.recipe.RecipeInfo.getGuiOffset(gui)[0], GuiDraw.getMousePosition().y - ((GT_GUIContainer_BasicMachine) gui).getTop() - codechicken.nei.recipe.RecipeInfo.getGuiOffset(gui)[1]))) && (usage ? GuiUsageRecipe.openRecipeGui(((GT_GUIContainer_BasicMachine) gui).mNEI, new Object[0]) : GuiCraftingRecipe.openRecipeGui(((GT_GUIContainer_BasicMachine) gui).mNEI, new Object[0])); - } /*else if (gui instanceof GT_GUIContainer_FusionReactor) { - return (canHandle(gui)) && (new Rectangle(145, 0, 24, 24).contains(new Point(GuiDraw.getMousePosition().x - ((GT_GUIContainer_FusionReactor) gui).getLeft() - codechicken.nei.recipe.RecipeInfo.getGuiOffset(gui)[0], GuiDraw.getMousePosition().y - ((GT_GUIContainer_FusionReactor) gui).getTop() - codechicken.nei.recipe.RecipeInfo.getGuiOffset(gui)[1]))) && (usage ? GuiUsageRecipe.openRecipeGui(((GT_GUIContainer_FusionReactor) gui).mNEI, new Object[0]) : GuiCraftingRecipe.openRecipeGui(((GT_GUIContainer_FusionReactor) gui).mNEI, new Object[0])); - }*/ - return false; - } - - @Override - public List<String> handleItemDisplayName(final GuiContainer gui, final ItemStack itemstack, final List<String> currenttip) { - return currenttip; - } - - @Override - public List<String> handleItemTooltip(final GuiContainer gui, final ItemStack itemstack, final int mousex, final int mousey, final List<String> currenttip) { - return currenttip; - } - - @Override - public boolean keyTyped(final GuiContainer gui, final char keyChar, final int keyCode) { - return false; - } - - @Override - public void onKeyTyped(final GuiContainer gui, final char keyChar, final int keyID) { - } - - @Override - public void onMouseClicked(final GuiContainer gui, final int mousex, final int mousey, final int button) { - } - - @Override - public void onMouseUp(final GuiContainer gui, final int mousex, final int mousey, final int button) { - } - - @Override - public boolean mouseScrolled(final GuiContainer gui, final int mousex, final int mousey, final int scrolled) { - return false; - } - - @Override - public void onMouseScrolled(final GuiContainer gui, final int mousex, final int mousey, final int scrolled) { - } - - @Override - public void onMouseDragged(final GuiContainer gui, final int mousex, final int mousey, final int button, final long heldTime) { - } - } - - public class FixedPositionedStack - extends PositionedStack { - public final int mChance; - public boolean permutated = false; - - public FixedPositionedStack(final Object object, final int x, final int y) { - this(object, x, y, 0); - } - - public FixedPositionedStack(final Object object, final int x, final int y, final int aChance) { - super(object, x, y, true); - this.mChance = aChance; - } - - @Override - public void generatePermutations() { - if (this.permutated) { - return; - } - final ArrayList<ItemStack> tDisplayStacks = new ArrayList<ItemStack>(); - for (final ItemStack tStack : this.items) { - if (GT_Utility.isStackValid(tStack)) { - if (tStack.getItemDamage() == 32767) { - final List<ItemStack> permutations = codechicken.nei.ItemList.itemMap.get(tStack.getItem()); - if (!permutations.isEmpty()) { - ItemStack stack; - for (final Iterator<ItemStack> i$ = permutations.iterator(); i$.hasNext(); tDisplayStacks.add(GT_Utility.copyAmount(tStack.stackSize, new Object[]{stack}))) { - stack = i$.next(); - } - } else { - final ItemStack base = new ItemStack(tStack.getItem(), tStack.stackSize); - base.stackTagCompound = tStack.stackTagCompound; - tDisplayStacks.add(base); - } - } else { - tDisplayStacks.add(GT_Utility.copy(new Object[]{tStack})); - } - } - } - this.items = (tDisplayStacks.toArray(new ItemStack[0])); - if (this.items.length == 0) { - this.items = new ItemStack[]{new ItemStack(Blocks.fire)}; - } - this.permutated = true; - this.setPermutationToRender(0); - } - } - - public class CachedDefaultRecipe - extends TemplateRecipeHandler.CachedRecipe { - public final GT_Recipe mRecipe; - public final List<PositionedStack> mOutputs = new ArrayList<PositionedStack>(); - public final List<PositionedStack> mInputs = new ArrayList<PositionedStack>(); - - public CachedDefaultRecipe(final GT_Recipe aRecipe) { - super(); - this.mRecipe = aRecipe; - - int tStartIndex = 0; - - - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 12, 5)); - } - tStartIndex++; - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 30, 5)); - } - tStartIndex++; - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 48, 5)); - } - tStartIndex++; - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 12, 23)); - } - tStartIndex++; - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 30, 23)); - } - tStartIndex++; - if (aRecipe.getRepresentativeInput(tStartIndex) != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(tStartIndex), 48, 23)); - } - tStartIndex++; - - if (aRecipe.mSpecialItems != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.mSpecialItems, 120, 52)); - } - tStartIndex = 0; - - //9 Output Slots - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 101, 4, aRecipe.getOutputChance(tStartIndex))); - } - tStartIndex++; - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 119, 4, aRecipe.getOutputChance(tStartIndex))); - } - tStartIndex++; - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 137, 4, aRecipe.getOutputChance(tStartIndex))); - } - tStartIndex++; - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 101, 22, aRecipe.getOutputChance(tStartIndex))); - } - tStartIndex++; - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 119, 22, aRecipe.getOutputChance(tStartIndex))); - } - tStartIndex++; - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 137, 22, aRecipe.getOutputChance(tStartIndex))); - } - tStartIndex++; - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 101, 40, aRecipe.getOutputChance(tStartIndex))); - } - tStartIndex++; - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 119, 40, aRecipe.getOutputChance(tStartIndex))); - } - tStartIndex++; - if (aRecipe.getOutput(tStartIndex) != null) { - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(tStartIndex), 137, 40, aRecipe.getOutputChance(tStartIndex))); - } - tStartIndex++; - - if ((aRecipe.mFluidInputs.length > 0) && (aRecipe.mFluidInputs[0] != null) && (aRecipe.mFluidInputs[0].getFluid() != null)) { - this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidInputs[0], true), 12, 60)); - if ((aRecipe.mFluidInputs.length > 1) && (aRecipe.mFluidInputs[1] != null) && (aRecipe.mFluidInputs[1].getFluid() != null)) { - this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidInputs[1], true), 30, 60)); - } - } - - if (aRecipe.mFluidOutputs.length > 0) { - if ((aRecipe.mFluidOutputs[0] != null) && (aRecipe.mFluidOutputs[0].getFluid() != null)) { - this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidOutputs[0], true), 101, 60)); - } - if ((aRecipe.mFluidOutputs.length > 1) && (aRecipe.mFluidOutputs[1] != null) && (aRecipe.mFluidOutputs[1].getFluid() != null)) { - this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidOutputs[1], true), 119, 60)); - } - } - } - - @Override - public List<PositionedStack> getIngredients() { - return this.getCycledIngredients(GT_NEI_VacFurnace.this.cycleticks / 10, this.mInputs); - } - - @Override - public PositionedStack getResult() { - return null; - } - - @Override - public List<PositionedStack> getOtherStacks() { - return this.mOutputs; - } - } -} diff --git a/src/Java/gtPlusPlus/nei/GT_NEI_multiCentriElectroFreezer.java b/src/Java/gtPlusPlus/nei/GT_NEI_multiCentriElectroFreezer.java deleted file mode 100644 index a8c77094cd..0000000000 --- a/src/Java/gtPlusPlus/nei/GT_NEI_multiCentriElectroFreezer.java +++ /dev/null @@ -1,554 +0,0 @@ -package gtPlusPlus.nei; - -import java.awt.Point; -import java.awt.Rectangle; -import java.util.*; - -import org.lwjgl.opengl.GL11; - -import codechicken.lib.gui.GuiDraw; -import codechicken.nei.PositionedStack; -import codechicken.nei.guihook.GuiContainerManager; -import codechicken.nei.guihook.IContainerInputHandler; -import codechicken.nei.guihook.IContainerTooltipHandler; -import codechicken.nei.recipe.*; -import cpw.mods.fml.common.event.FMLInterModComms; -import gregtech.api.enums.GT_Values; -import gregtech.api.enums.OrePrefixes; -import gregtech.api.gui.GT_GUIContainer_BasicMachine; -import gregtech.api.objects.ItemData; -import gregtech.api.util.*; -import gregtech.api.util.GTPP_Recipe.GTPP_Recipe_Map_Internal; -import gtPlusPlus.api.objects.Logger; -import gtPlusPlus.api.objects.data.Pair; -import gtPlusPlus.core.util.minecraft.ItemUtils; -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.inventory.GuiContainer; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; -import net.minecraftforge.fluids.FluidContainerRegistry; -import net.minecraftforge.fluids.FluidStack; - -public class GT_NEI_multiCentriElectroFreezer -extends TemplateRecipeHandler { - public static final int sOffsetX = 5; - public static final int sOffsetY = 11; - - static { - GuiContainerManager.addInputHandler(new GT_RectHandler()); - GuiContainerManager.addTooltipHandler(new GT_RectHandler()); - } - - protected GTPP_Recipe_Map_Internal mRecipeMap; - - public GT_NEI_multiCentriElectroFreezer(GTPP_Recipe_Map_Internal aMap) { - this.mRecipeMap = aMap; - this.transferRects.add(new TemplateRecipeHandler.RecipeTransferRect(new Rectangle(65, 13, 36, 18), this.getRecipeMapName(), new Object[0])); - if (!NEI_GT_Config.sIsAdded) { - FMLInterModComms.sendRuntimeMessage(GT_Values.GT, "NEIPlugins", "register-crafting-handler", "gregtechplusplus@" + this.getRecipeName() + "@" + this.getRecipeMapName()); - GuiCraftingRecipe.craftinghandlers.add(this); - GuiUsageRecipe.usagehandlers.add(this); - } - } - - public static void logRecipeError(GT_Recipe aRecipe) { - if (aRecipe == null) { - Logger.INFO("Tried to handle null recipe. :("); - } - else { - ItemStack[] aInputs = aRecipe.mInputs; - ItemStack[] aOutputs = aRecipe.mOutputs; - FluidStack[] aFluidInputs = aRecipe.mFluidInputs; - FluidStack[] aFluidOutputs = aRecipe.mFluidOutputs; - int aEU = aRecipe.mEUt; - int aTime = aRecipe.mDuration; - int aSpecialValue = aRecipe.mSpecialValue; - String aInputitems = ItemUtils.getArrayStackNames(aInputs); - String aOutputitems = ItemUtils.getArrayStackNames(aOutputs); - String aInputFluids = ItemUtils.getArrayStackNames(aFluidInputs); - String aOutputFluids = ItemUtils.getArrayStackNames(aFluidOutputs); - Logger.INFO("Logging Broken Recipe Details:"); - Logger.INFO("Input Items - "+aInputitems); - Logger.INFO("Output Items - "+aOutputitems); - Logger.INFO("Input Fluids - "+aInputFluids); - Logger.INFO("Output Fluids - "+aOutputFluids); - Logger.INFO("EU/t - "+aEU); - Logger.INFO("Duration - "+aTime); - Logger.INFO("Special Value - "+aSpecialValue); - } - } - - public List<GTPP_Recipe> getSortedRecipes() { - List<GTPP_Recipe> result = new ArrayList(this.mRecipeMap.mRecipeList); - Collections.sort(result); - return result; - } - - public static void drawText(final int aX, final int aY, final String aString, final int aColor) { - Minecraft.getMinecraft().fontRenderer.drawString(aString, aX, aY, aColor); - } - - @Override - public TemplateRecipeHandler newInstance() { - return new GT_NEI_multiCentriElectroFreezer(mRecipeMap); - } - - @Override - public void loadCraftingRecipes(final String outputId, final Object... results) { - if (outputId.equals(getRecipeMapName())) { - for (GTPP_Recipe tRecipe : getSortedRecipes()) { - if (!tRecipe.mHidden) { - CachedDefaultRecipe tNEIRecipe = getCachedRecipe(tRecipe); - if (tNEIRecipe == null) { - continue; - } - this.arecipes.add(tNEIRecipe); - } - } - } else { - super.loadCraftingRecipes(outputId, results); - } - } - - @Override - public void loadCraftingRecipes(final ItemStack aResult) { - ItemData tPrefixMaterial = GT_OreDictUnificator.getAssociation(aResult); - - ArrayList<ItemStack> tResults = new ArrayList<ItemStack>(); - tResults.add(aResult); - tResults.add(GT_OreDictUnificator.get(true, aResult)); - if ((tPrefixMaterial != null) && (!tPrefixMaterial.mBlackListed) && (!tPrefixMaterial.mPrefix.mFamiliarPrefixes.isEmpty())) { - for (OrePrefixes tPrefix : tPrefixMaterial.mPrefix.mFamiliarPrefixes) { - tResults.add(GT_OreDictUnificator.get(tPrefix, tPrefixMaterial.mMaterial.mMaterial, 1L)); - } - } - FluidStack tFluid = GT_Utility.getFluidForFilledItem(aResult, true); - if (tFluid != null) { - tResults.add(GT_Utility.getFluidDisplayStack(tFluid, false)); - for (FluidContainerRegistry.FluidContainerData tData : FluidContainerRegistry.getRegisteredFluidContainerData()) { - if (tData.fluid.isFluidEqual(tFluid)) { - tResults.add(GT_Utility.copy(new Object[]{tData.filledContainer})); - } - } - } - for (GTPP_Recipe tRecipe : getSortedRecipes()) { - if (!tRecipe.mHidden) { - CachedDefaultRecipe tNEIRecipe = getCachedRecipe(tRecipe); - if (tNEIRecipe == null) { - continue; - } - for (ItemStack tStack : tResults) { - if (tNEIRecipe.contains(tNEIRecipe.mOutputs, tStack)) { - this.arecipes.add(tNEIRecipe); - break; - } - } - } - } - //CachedDefaultRecipe tNEIRecipe; - } - - public void loadUsageRecipes(ItemStack aInput) { - ItemData tPrefixMaterial = GT_OreDictUnificator.getAssociation(aInput); - - ArrayList<ItemStack> tInputs = new ArrayList<ItemStack>(); - tInputs.add(aInput); - tInputs.add(GT_OreDictUnificator.get(false, aInput)); - if ((tPrefixMaterial != null) && (!tPrefixMaterial.mPrefix.mFamiliarPrefixes.isEmpty())) { - for (OrePrefixes tPrefix : tPrefixMaterial.mPrefix.mFamiliarPrefixes) { - tInputs.add(GT_OreDictUnificator.get(tPrefix, tPrefixMaterial.mMaterial.mMaterial, 1L)); - } - } - FluidStack tFluid = GT_Utility.getFluidForFilledItem(aInput, true); - if (tFluid != null) { - tInputs.add(GT_Utility.getFluidDisplayStack(tFluid, false)); - for (FluidContainerRegistry.FluidContainerData tData : FluidContainerRegistry.getRegisteredFluidContainerData()) { - if (tData.fluid.isFluidEqual(tFluid)) { - tInputs.add(GT_Utility.copy(new Object[]{tData.filledContainer})); - } - } - } - for (GTPP_Recipe tRecipe : getSortedRecipes()) { - if (!tRecipe.mHidden) { - CachedDefaultRecipe tNEIRecipe = getCachedRecipe(tRecipe); - if (tNEIRecipe == null) { - continue; - } - for (ItemStack tStack : tInputs) { - if (tNEIRecipe.contains(tNEIRecipe.mInputs, tStack)) { - this.arecipes.add(tNEIRecipe); - break; - } - } - } - } - //CachedDefaultRecipe tNEIRecipe; - } - - public String getRecipeMapName() { - return this.mRecipeMap.mNEIName; - } - - @Override - public String getOverlayIdentifier() { - return this.mRecipeMap.mNEIName; - } - - @Override - public void drawBackground(final int recipe) { - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - GuiDraw.changeTexture(this.getGuiTexture()); - GuiDraw.drawTexturedModalRect(-4, -8, 1, 3, 174, 78); - } - - @Override - public int recipiesPerPage() { - return 1; - } - - @Override - public String getRecipeName() { - return GT_LanguageManager.getTranslation(this.mRecipeMap.mUnlocalizedName); - } - - @Override - public String getGuiTexture() { - return this.mRecipeMap.mNEIGUIPath; - } - - @Override - public List<String> handleItemTooltip(final GuiRecipe gui, final ItemStack aStack, final List<String> currenttip, final int aRecipeIndex) { - final TemplateRecipeHandler.CachedRecipe tObject = this.arecipes.get(aRecipeIndex); - if ((tObject instanceof CachedDefaultRecipe)) { - final CachedDefaultRecipe tRecipe = (CachedDefaultRecipe) tObject; - for (final PositionedStack tStack : tRecipe.mOutputs) { - if (aStack == tStack.item) { - if ((!(tStack instanceof FixedPositionedStack)) || (((FixedPositionedStack) tStack).mChance <= 0) || (((FixedPositionedStack) tStack).mChance == 10000)) { - break; - } - currenttip.add("Chance: " + (((FixedPositionedStack) tStack).mChance / 100) + "." + ((((FixedPositionedStack) tStack).mChance % 100) < 10 ? "0" + (((FixedPositionedStack) tStack).mChance % 100) : Integer.valueOf(((FixedPositionedStack) tStack).mChance % 100)) + "%"); - break; - } - } - for (final PositionedStack tStack : tRecipe.mInputs) { - if (aStack == tStack.item) { - if ((gregtech.api.enums.ItemList.Display_Fluid.isStackEqual(tStack.item, true, true)) || - (tStack.item.stackSize != 0)) { - break; - } - currenttip.add("Does not get consumed in the process"); - break; - } - } - } - return currenttip; - } - - @Override - public void drawExtras(final int aRecipeIndex) { - final int tEUt = ((CachedDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.mEUt; - final int tDuration = ((CachedDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.mDuration; - if (tEUt != 0) { - drawText(10, 83, "Total: " + (tDuration * tEUt) + " EU", -16777216); - drawText(10, 93, "Usage: " + tEUt + " EU/t", -16777216); - if (this.mRecipeMap.mShowVoltageAmperageInNEI) { - drawText(10, 103, "Voltage: " + (tEUt / this.mRecipeMap.mAmperage) + " EU", -16777216); - drawText(10, 113, "Amperage: " + this.mRecipeMap.mAmperage, -16777216); - } else { - drawText(10, 103, "Voltage: unspecified", -16777216); - drawText(10, 113, "Amperage: unspecified", -16777216); - } - } - if (tDuration > 0) { - drawText(10, 123, "Time: " + (tDuration < 20 ? "< 1" : Integer.valueOf(tDuration / 20)) + " secs", -16777216); - } - if ((GT_Utility.isStringValid(this.mRecipeMap.mNEISpecialValuePre)) || (GT_Utility.isStringValid(this.mRecipeMap.mNEISpecialValuePost))) { - drawText(10, 133, this.mRecipeMap.mNEISpecialValuePre + (((CachedDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.mSpecialValue * this.mRecipeMap.mNEISpecialValueMultiplier) + this.mRecipeMap.mNEISpecialValuePost, -16777216); - } - } - - public static class GT_RectHandler - implements IContainerInputHandler, IContainerTooltipHandler { - @Override - public boolean mouseClicked(final GuiContainer gui, final int mousex, final int mousey, final int button) { - if (this.canHandle(gui)) { - if (button == 0) { - return this.transferRect(gui, false); - } - if (button == 1) { - return this.transferRect(gui, true); - } - } - return false; - } - - @Override - public boolean lastKeyTyped(final GuiContainer gui, final char keyChar, final int keyCode) { - return false; - } - - public boolean canHandle(final GuiContainer gui) { - return (((gui instanceof GT_GUIContainer_BasicMachine)) && (GT_Utility.isStringValid(((GT_GUIContainer_BasicMachine) gui).mNEI)) /*|| ((gui instanceof GT_GUIContainer_FusionReactor)) && (GT_Utility.isStringValid(((GT_GUIContainer_FusionReactor) gui).mNEI))*/); - } - - @Override - public List<String> handleTooltip(final GuiContainer gui, final int mousex, final int mousey, final List<String> currenttip) { - if ((this.canHandle(gui)) && (currenttip.isEmpty())) { - if ((gui instanceof GT_GUIContainer_BasicMachine) && new Rectangle(65, 13, 36, 18).contains(new Point(GuiDraw.getMousePosition().x - ((GT_GUIContainer_BasicMachine) gui).getLeft() - codechicken.nei.recipe.RecipeInfo.getGuiOffset(gui)[0], GuiDraw.getMousePosition().y - ((GT_GUIContainer_BasicMachine) gui).getTop() - codechicken.nei.recipe.RecipeInfo.getGuiOffset(gui)[1]))) { - currenttip.add("Recipes"); - } /*else if (gui instanceof GT_GUIContainer_FusionReactor && new Rectangle(145, 0, 24, 24).contains(new Point(GuiDraw.getMousePosition().x - ((GT_GUIContainer_FusionReactor) gui).getLeft() - codechicken.nei.recipe.RecipeInfo.getGuiOffset(gui)[0], GuiDraw.getMousePosition().y - ((GT_GUIContainer_FusionReactor) gui).getTop() - codechicken.nei.recipe.RecipeInfo.getGuiOffset(gui)[1]))) { - currenttip.add("Recipes"); - }*/ - - } - return currenttip; - } - - private boolean transferRect(final GuiContainer gui, final boolean usage) { - if (gui instanceof GT_GUIContainer_BasicMachine) { - return (this.canHandle(gui)) && (new Rectangle(65, 13, 36, 18).contains(new Point(GuiDraw.getMousePosition().x - ((GT_GUIContainer_BasicMachine) gui).getLeft() - codechicken.nei.recipe.RecipeInfo.getGuiOffset(gui)[0], GuiDraw.getMousePosition().y - ((GT_GUIContainer_BasicMachine) gui).getTop() - codechicken.nei.recipe.RecipeInfo.getGuiOffset(gui)[1]))) && (usage ? GuiUsageRecipe.openRecipeGui(((GT_GUIContainer_BasicMachine) gui).mNEI, new Object[0]) : GuiCraftingRecipe.openRecipeGui(((GT_GUIContainer_BasicMachine) gui).mNEI, new Object[0])); - } /*else if (gui instanceof GT_GUIContainer_FusionReactor) { - return (canHandle(gui)) && (new Rectangle(145, 0, 24, 24).contains(new Point(GuiDraw.getMousePosition().x - ((GT_GUIContainer_FusionReactor) gui).getLeft() - codechicken.nei.recipe.RecipeInfo.getGuiOffset(gui)[0], GuiDraw.getMousePosition().y - ((GT_GUIContainer_FusionReactor) gui).getTop() - codechicken.nei.recipe.RecipeInfo.getGuiOffset(gui)[1]))) && (usage ? GuiUsageRecipe.openRecipeGui(((GT_GUIContainer_FusionReactor) gui).mNEI, new Object[0]) : GuiCraftingRecipe.openRecipeGui(((GT_GUIContainer_FusionReactor) gui).mNEI, new Object[0])); - }*/ - return false; - } - - @Override - public List<String> handleItemDisplayName(final GuiContainer gui, final ItemStack itemstack, final List<String> currenttip) { - return currenttip; - } - - @Override - public List<String> handleItemTooltip(final GuiContainer gui, final ItemStack itemstack, final int mousex, final int mousey, final List<String> currenttip) { - return currenttip; - } - - @Override - public boolean keyTyped(final GuiContainer gui, final char keyChar, final int keyCode) { - return false; - } - - @Override - public void onKeyTyped(final GuiContainer gui, final char keyChar, final int keyID) { - } - - @Override - public void onMouseClicked(final GuiContainer gui, final int mousex, final int mousey, final int button) { - } - - @Override - public void onMouseUp(final GuiContainer gui, final int mousex, final int mousey, final int button) { - } - - @Override - public boolean mouseScrolled(final GuiContainer gui, final int mousex, final int mousey, final int scrolled) { - return false; - } - - @Override - public void onMouseScrolled(final GuiContainer gui, final int mousex, final int mousey, final int scrolled) { - } - - @Override - public void onMouseDragged(final GuiContainer gui, final int mousex, final int mousey, final int button, final long heldTime) { - } - } - - public class FixedPositionedStack - extends PositionedStack { - public final int mChance; - public boolean permutated = false; - - public FixedPositionedStack(final Object object, final int x, final int y) { - this(object, x, y, 0); - } - - public FixedPositionedStack(final Object object, final int x, final int y, final int aChance) { - super(object, x, y, true); - this.mChance = aChance; - } - - @Override - public void generatePermutations() { - if (this.permutated) { - return; - } - final ArrayList<ItemStack> tDisplayStacks = new ArrayList<ItemStack>(); - for (final ItemStack tStack : this.items) { - if (GT_Utility.isStackValid(tStack)) { - if (tStack.getItemDamage() == 32767) { - final List<ItemStack> permutations = codechicken.nei.ItemList.itemMap.get(tStack.getItem()); - if (!permutations.isEmpty()) { - ItemStack stack; - for (final Iterator<ItemStack> i$ = permutations.iterator(); i$.hasNext(); tDisplayStacks.add(GT_Utility.copyAmount(tStack.stackSize, new Object[]{stack}))) { - stack = i$.next(); - } - } else { - final ItemStack base = new ItemStack(tStack.getItem(), tStack.stackSize); - base.stackTagCompound = tStack.stackTagCompound; - tDisplayStacks.add(base); - } - } else { - tDisplayStacks.add(GT_Utility.copy(new Object[]{tStack})); - } - } - } - this.items = (tDisplayStacks.toArray(new ItemStack[0])); - if (this.items.length == 0) { - this.items = new ItemStack[]{new ItemStack(Blocks.fire)}; - } - this.permutated = true; - this.setPermutationToRender(0); - } - } - private static final HashMap<Integer, Pair<Integer, Integer>> mInputSlotMap = new HashMap<Integer, Pair<Integer, Integer>>(); - private static final HashMap<Integer, Pair<Integer, Integer>> mOutputSlotMap = new HashMap<Integer, Pair<Integer, Integer>>(); - - static { - int aSlotX_1 = 12; - int aSlotX_2 = 30; - int aSlotX_3 = 48; - int aSlotY_1 = 5; - int aSlotY_2 = 23; - int aSlotY_3 = 41; - int aSlotY_10 = 65; // Only if 9 input items and a FLuid - mInputSlotMap.put(0, new Pair<Integer, Integer>(aSlotX_1, aSlotY_1)); - mInputSlotMap.put(1, new Pair<Integer, Integer>(aSlotX_2, aSlotY_1)); - mInputSlotMap.put(2, new Pair<Integer, Integer>(aSlotX_3, aSlotY_1)); - mInputSlotMap.put(3, new Pair<Integer, Integer>(aSlotX_1, aSlotY_2)); - mInputSlotMap.put(4, new Pair<Integer, Integer>(aSlotX_2, aSlotY_2)); - mInputSlotMap.put(5, new Pair<Integer, Integer>(aSlotX_3, aSlotY_2)); - mInputSlotMap.put(6, new Pair<Integer, Integer>(aSlotX_1, aSlotY_3)); - mInputSlotMap.put(7, new Pair<Integer, Integer>(aSlotX_2, aSlotY_3)); - mInputSlotMap.put(8, new Pair<Integer, Integer>(aSlotX_3, aSlotY_3)); - mInputSlotMap.put(9, new Pair<Integer, Integer>(aSlotX_1, aSlotY_10)); - mInputSlotMap.put(10, new Pair<Integer, Integer>(aSlotX_2, aSlotY_10)); - mInputSlotMap.put(11, new Pair<Integer, Integer>(aSlotX_3, aSlotY_10)); - aSlotX_1 = 102; - aSlotX_2 = 120; - aSlotX_3 = 138; - mOutputSlotMap.put(0, new Pair<Integer, Integer>(aSlotX_1, aSlotY_1)); - mOutputSlotMap.put(1, new Pair<Integer, Integer>(aSlotX_2, aSlotY_1)); - mOutputSlotMap.put(2, new Pair<Integer, Integer>(aSlotX_3, aSlotY_1)); - mOutputSlotMap.put(3, new Pair<Integer, Integer>(aSlotX_1, aSlotY_2)); - mOutputSlotMap.put(4, new Pair<Integer, Integer>(aSlotX_2, aSlotY_2)); - mOutputSlotMap.put(5, new Pair<Integer, Integer>(aSlotX_3, aSlotY_2)); - mOutputSlotMap.put(6, new Pair<Integer, Integer>(aSlotX_1, aSlotY_3)); - mOutputSlotMap.put(7, new Pair<Integer, Integer>(aSlotX_2, aSlotY_3)); - mOutputSlotMap.put(8, new Pair<Integer, Integer>(aSlotX_3, aSlotY_3)); - mOutputSlotMap.put(9, new Pair<Integer, Integer>(aSlotX_1, aSlotY_10)); - mOutputSlotMap.put(10, new Pair<Integer, Integer>(aSlotX_2, aSlotY_10)); - mOutputSlotMap.put(11, new Pair<Integer, Integer>(aSlotX_3, aSlotY_10)); - } - - private CachedDefaultRecipe getCachedRecipe(GT_Recipe aRecipe) { - try { - return new CachedDefaultRecipe(aRecipe); - } - catch(Throwable e) { - logRecipeError(aRecipe); - } - return null; - } - - public class CachedDefaultRecipe - extends TemplateRecipeHandler.CachedRecipe { - - - public final GT_Recipe mRecipe; - public final List<PositionedStack> mOutputs = new ArrayList<PositionedStack>(); - public final List<PositionedStack> mInputs = new ArrayList<PositionedStack>(); - - public CachedDefaultRecipe(final GT_Recipe aRecipe) { - super(); - this.mRecipe = aRecipe; - int aInputItemsCount = this.mRecipe.mInputs.length; - int aInputFluidsCount = this.mRecipe.mFluidInputs.length; - int aOutputItemsCount = this.mRecipe.mOutputs.length; - int aOutputFluidsCount = this.mRecipe.mFluidOutputs.length; - int aInputSlotsUsed = 0; - int aOutputSlotsUsed = 0; - int aSlotToCheck = 0; - - // Special Slot - if (aRecipe.mSpecialItems != null) { - this.mInputs.add(new FixedPositionedStack(aRecipe.mSpecialItems, 120, 52)); - } - - /* - * Items - */ - - // Upto 9 Inputs Slots - if (aInputItemsCount > 0) { - if (aInputItemsCount > 9) { - aInputItemsCount = 9; - } - for (int i=0;i<aInputItemsCount;i++) { - int x = mInputSlotMap.get(aSlotToCheck).getKey(); - int y = mInputSlotMap.get(aSlotToCheck).getValue(); - this.mInputs.add(new FixedPositionedStack(aRecipe.getRepresentativeInput(aSlotToCheck), x, y)); - aSlotToCheck++; - aInputSlotsUsed++; - } - } - aSlotToCheck = 0; - // Upto 9 Output Slots - if (aOutputItemsCount > 0) { - if (aOutputItemsCount > 9) { - aOutputItemsCount = 9; - } - for (int i=0;i<aOutputItemsCount;i++) { - int x = mOutputSlotMap.get(aSlotToCheck).getKey(); - int y = mOutputSlotMap.get(aSlotToCheck).getValue(); - this.mOutputs.add(new FixedPositionedStack(aRecipe.getOutput(aSlotToCheck), x, y, aRecipe.getOutputChance(aSlotToCheck))); - aSlotToCheck++; - aOutputSlotsUsed++; - } - } - - /* - * Fluids - */ - - // Upto 9 Fluid Inputs Slots - aSlotToCheck = aInputSlotsUsed; - if (aInputFluidsCount > 0) { - for (int i=0;i<aInputFluidsCount;i++) { - int x = mInputSlotMap.get(aSlotToCheck).getKey(); - int y = mInputSlotMap.get(aSlotToCheck).getValue(); - this.mInputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidInputs[i], true), x, y)); - aSlotToCheck++; - aInputSlotsUsed++; - } - } - // Upto 9 Fluid Outputs Slots - aSlotToCheck = aOutputSlotsUsed; - if (aOutputFluidsCount > 0) { - for (int i=0;i<aOutputFluidsCount;i++) { - int x = mOutputSlotMap.get(aSlotToCheck).getKey(); - int y = mOutputSlotMap.get(aSlotToCheck).getValue(); - this.mOutputs.add(new FixedPositionedStack(GT_Utility.getFluidDisplayStack(aRecipe.mFluidOutputs[i], true), x, y)); - aSlotToCheck++; - aOutputSlotsUsed++; - } - } - - } - - @Override - public List<PositionedStack> getIngredients() { - return this.getCycledIngredients(GT_NEI_multiCentriElectroFreezer.this.cycleticks / 10, this.mInputs); - } - - @Override - public PositionedStack getResult() { - return null; - } - - @Override - public List<PositionedStack> getOtherStacks() { - return this.mOutputs; - } - } -} diff --git a/src/Java/gtPlusPlus/nei/NEI_GT_Config.java b/src/Java/gtPlusPlus/nei/NEI_GT_Config.java index 07bd7ef46c..0b3cf8e66e 100644 --- a/src/Java/gtPlusPlus/nei/NEI_GT_Config.java +++ b/src/Java/gtPlusPlus/nei/NEI_GT_Config.java @@ -2,11 +2,13 @@ package gtPlusPlus.nei; import codechicken.nei.api.API; import codechicken.nei.api.IConfigureNEI; -import gregtech.api.util.GTPP_Recipe; import gregtech.api.util.GTPP_Recipe.GTPP_Recipe_Map; +import gregtech.api.util.GTPP_Recipe.GTPP_Recipe_Map_Internal; import gregtech.api.util.GT_Recipe.GT_Recipe_Map; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.api.objects.data.AutoMap; +import gtPlusPlus.core.util.Utils; +import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; public class NEI_GT_Config implements IConfigureNEI { @@ -18,7 +20,8 @@ implements IConfigureNEI { @Override public synchronized void loadConfig() { - mUniqueRecipeMapHandling.add(GTPP_Recipe.GTPP_Recipe_Map.sFissionFuelProcessing.mUnlocalizedName); + mUniqueRecipeMapHandling.add(GTPP_Recipe_Map.sFissionFuelProcessing.mUnlocalizedName); + mUniqueRecipeMapHandling.add(GTPP_Recipe_Map.sLiquidFluorineThoriumReactorRecipes.mUnlocalizedName); mUniqueRecipeMapHandling.add(GTPP_Recipe_Map.sChemicalPlantRecipes.mUnlocalizedName); mUniqueRecipeMapHandling.add(GTPP_Recipe_Map.sOreMillRecipes.mUnlocalizedName); mUniqueRecipeMapHandling.add(GTPP_Recipe_Map.sFlotationCellRecipes.mUnlocalizedName); @@ -28,27 +31,11 @@ implements IConfigureNEI { mUniqueRecipeMapHandling.add(GTPP_Recipe_Map.sMultiblockCentrifugeRecipes_GT.mUnlocalizedName); mUniqueRecipeMapHandling.add(GTPP_Recipe_Map.sMultiblockElectrolyzerRecipes_GT.mUnlocalizedName); mUniqueRecipeMapHandling.add(GTPP_Recipe_Map.sMultiblockMixerRecipes_GT.mUnlocalizedName); - - // Custom Recipe Maps - /*Logger.INFO("NEI Registration: "+CustomRecipeMap.sMappings.size()+" CustomRecipeMaps"); - for (final CustomRecipeMap tMap : CustomRecipeMap.sMappings) { - if (tMap.mNEIAllowed) { - if (!mUniqueRecipeMapHandling.contains(tMap.mUnlocalizedName)) { - Logger.INFO("NEI Registration: Registering NEI handler for "+tMap.mNEIName); - new GTPP_NEI_CustomMapHandler(tMap); - } - else { - Logger.INFO("NEI Registration: Not allowed to register NEI handler for "+tMap.mNEIName); - } - } - else { - Logger.INFO("NEI Registration: Not allowed to register NEI handler for "+tMap.mNEIName); - } - }*/ + mUniqueRecipeMapHandling.add(GTPP_Recipe_Map.sAlloyBlastSmelterRecipes.mUnlocalizedName); // Standard GT Recipe Maps - Logger.INFO("NEI Registration: "+GTPP_Recipe.GTPP_Recipe_Map_Internal.sMappingsEx.size()+" sMappingEx"); - for (final GT_Recipe_Map tMap : GTPP_Recipe.GTPP_Recipe_Map_Internal.sMappingsEx) { + Logger.INFO("NEI Registration: "+GTPP_Recipe_Map_Internal.sMappingsEx.size()+" sMappingEx"); + for (final GT_Recipe_Map tMap : GTPP_Recipe_Map_Internal.sMappingsEx) { if (tMap.mNEIAllowed) { if (!mUniqueRecipeMapHandling.contains(tMap.mUnlocalizedName)) { Logger.INFO("NEI Registration: Registering NEI handler for "+tMap.mNEIName); @@ -62,29 +49,42 @@ implements IConfigureNEI { Logger.INFO("NEI Registration: Skipping registration of NEI handler for "+tMap.mNEIName); } } - Logger.INFO("NEI Registration: Registering NEI handler for "+GTPP_Recipe.GTPP_Recipe_Map.sChemicalPlantRecipes.mNEIName); + + Logger.INFO("NEI Registration: Registering NEI handler for "+GTPP_Recipe_Map.sChemicalPlantRecipes.mNEIName); new GT_NEI_FluidReactor(); - Logger.INFO("NEI Registration: Registering NEI handler for "+GTPP_Recipe.GTPP_Recipe_Map.sOreMillRecipes.mNEIName); + Logger.INFO("NEI Registration: Registering NEI handler for "+GTPP_Recipe_Map.sOreMillRecipes.mNEIName); new GT_NEI_MillingMachine(); - Logger.INFO("NEI Registration: Registering NEI handler for "+GTPP_Recipe.GTPP_Recipe_Map.sFlotationCellRecipes.mNEIName); + Logger.INFO("NEI Registration: Registering NEI handler for "+GTPP_Recipe_Map.sFlotationCellRecipes.mNEIName); new GT_NEI_FlotationCell(); - Logger.INFO("NEI Registration: Registering NEI handler for "+GTPP_Recipe.GTPP_Recipe_Map.sVacuumFurnaceRecipes.mNEIName); - new GT_NEI_VacFurnace(); - Logger.INFO("NEI Registration: Registering NEI handler for "+GTPP_Recipe.GTPP_Recipe_Map.sFissionFuelProcessing.mNEIName); - new GT_NEI_RFPP(); - - Logger.INFO("NEI Registration: Registering NEI handler for "+GTPP_Recipe.GTPP_Recipe_Map.sAdvFreezerRecipes_GT.mNEIName); - new GT_NEI_multiCentriElectroFreezer(GTPP_Recipe.GTPP_Recipe_Map.sAdvFreezerRecipes_GT); - Logger.INFO("NEI Registration: Registering NEI handler for "+GTPP_Recipe.GTPP_Recipe_Map.sMultiblockCentrifugeRecipes_GT.mNEIName); - new GT_NEI_multiCentriElectroFreezer(GTPP_Recipe.GTPP_Recipe_Map.sMultiblockCentrifugeRecipes_GT); - Logger.INFO("NEI Registration: Registering NEI handler for "+GTPP_Recipe.GTPP_Recipe_Map.sMultiblockElectrolyzerRecipes_GT.mNEIName); - new GT_NEI_multiCentriElectroFreezer(GTPP_Recipe.GTPP_Recipe_Map.sMultiblockElectrolyzerRecipes_GT); - Logger.INFO("NEI Registration: Registering NEI handler for "+GTPP_Recipe.GTPP_Recipe_Map.sMultiblockMixerRecipes_GT.mNEIName); - new GT_NEI_multiCentriElectroFreezer(GTPP_Recipe.GTPP_Recipe_Map.sMultiblockMixerRecipes_GT); + Logger.INFO("NEI Registration: Registering NEI handler for "+GTPP_Recipe_Map.sLiquidFluorineThoriumReactorRecipes.mNEIName); + new GT_NEI_LFTR(); + Logger.INFO("NEI Registration: Registering NEI handler for "+GTPP_Recipe_Map.sFissionFuelProcessing.mNEIName); + new GT_NEI_MultiNoCell(GTPP_Recipe_Map.sFissionFuelProcessing); + Logger.INFO("NEI Registration: Registering NEI handler for "+GTPP_Recipe_Map.sVacuumFurnaceRecipes.mNEIName); + new GT_NEI_MultiNoCell(GTPP_Recipe_Map.sVacuumFurnaceRecipes); + Logger.INFO("NEI Registration: Registering NEI handler for "+GTPP_Recipe_Map.sAdvFreezerRecipes_GT.mNEIName); + new GT_NEI_MultiNoCell(GTPP_Recipe_Map.sAdvFreezerRecipes_GT); + Logger.INFO("NEI Registration: Registering NEI handler for "+GTPP_Recipe_Map.sMultiblockCentrifugeRecipes_GT.mNEIName); + new GT_NEI_MultiNoCell(GTPP_Recipe_Map.sMultiblockCentrifugeRecipes_GT); + Logger.INFO("NEI Registration: Registering NEI handler for "+GTPP_Recipe_Map.sMultiblockElectrolyzerRecipes_GT.mNEIName); + new GT_NEI_MultiNoCell(GTPP_Recipe_Map.sMultiblockElectrolyzerRecipes_GT); + Logger.INFO("NEI Registration: Registering NEI handler for "+GTPP_Recipe_Map.sMultiblockMixerRecipes_GT.mNEIName); + new GT_NEI_MultiNoCell(GTPP_Recipe_Map.sMultiblockMixerRecipes_GT); + Logger.INFO("NEI Registration: Registering NEI handler for "+GTPP_Recipe_Map.sAlloyBlastSmelterRecipes.mNEIName); + new GT_NEI_MultiNoCell(GTPP_Recipe_Map.sAlloyBlastSmelterRecipes); Logger.INFO("NEI Registration: Registering NEI handler for "+DecayableRecipeHandler.mNEIName); API.registerRecipeHandler(new DecayableRecipeHandler()); API.registerUsageHandler(new DecayableRecipeHandler()); + + Logger.INFO("NEI Registration: Registering NEI handler for "+GT_NEI_LFTR_Sparging.mNEIName); + new GT_NEI_LFTR_Sparging(); + + // Hide Flasks + if (Utils.isClient()) { + codechicken.nei.api.API.addItemListEntry(GregtechItemList.VOLUMETRIC_FLASK_8k.get(1)); + codechicken.nei.api.API.addItemListEntry(GregtechItemList.VOLUMETRIC_FLASK_32k.get(1)); + } sIsAdded = true; } diff --git a/src/Java/gtPlusPlus/nei/NEI_IMC_Sender.java b/src/Java/gtPlusPlus/nei/NEI_IMC_Sender.java index 461678dd7a..7bc2316a04 100644 --- a/src/Java/gtPlusPlus/nei/NEI_IMC_Sender.java +++ b/src/Java/gtPlusPlus/nei/NEI_IMC_Sender.java @@ -5,30 +5,37 @@ import net.minecraft.nbt.NBTTagCompound; public class NEI_IMC_Sender { public static void IMCSender() { - setNBTInfoAndSendIt("gtpp.recipe.alloyblastsmelter", "gregtech:gt.blockmachines:810"); + setNBTInfoAndSendIt("gtpp.recipe.alloyblastsmelter", "gregtech:gt.blockmachines:810", 1); setNBTInfoAndSendIt("gtpp.recipe.rocketenginefuel", "gregtech:gt.blockmachines:793"); setNBTInfoAndSendIt("gtpp.recipe.cyclotron", "gregtech:gt.blockmachines:828"); - setNBTInfoAndSendIt("gtpp.recipe.chemicaldehydrator", "gregtech:gt.blockmachines:911"); + setNBTInfoAndSendIt("gtpp.recipe.chemicaldehydrator", "gregtech:gt.blockmachines:911", 1); setNBTInfoAndSendIt("gtpp.recipe.slowfusionreactor", "gregtech:gt.blockmachines:31015"); setNBTInfoAndSendIt("gtpp.recipe.RTGgenerators", "gregtech:gt.blockmachines:869"); setNBTInfoAndSendIt("gtpp.recipe.cokeoven", "gregtech:gt.blockmachines:791"); setNBTInfoAndSendIt("gtpp.recipe.semifluidgeneratorfuels", "gregtech:gt.blockmachines:837"); - setNBTInfoAndSendIt("gtpp.recipe.fishpond", "gregtech:gt.blockmachines:829"); + setNBTInfoAndSendIt("gtpp.recipe.fishpond", "gregtech:gt.blockmachines:829", 1); setNBTInfoAndSendIt("gtpp.recipe.multimixer", "gregtech:gt.blockmachines:811"); setNBTInfoAndSendIt("gtpp.recipe.advanced.mixer", "gregtech:gt.blockmachines:811"); setNBTInfoAndSendIt("gtpp.recipe.cryogenicfreezer", "gregtech:gt.blockmachines:910"); - setNBTInfoAndSendIt("gtpp.recipe.fissionfuel", "gregtech:gt.blockmachines:835"); setNBTInfoAndSendIt("gtpp.recipe.geothermalfuel", "gregtech:gt.blockmachines:830"); - setNBTInfoAndSendIt("gtpp.recipe.lftr", "gregtech:gt.blockmachines:751"); - setNBTInfoAndSendIt("gtpp.recipe.lftr.2", "gregtech:gt.blockmachines:751"); setNBTInfoAndSendIt("gtpp.recipe.matterfab2", "gregtech:gt.blockmachines:799"); - setNBTInfoAndSendIt("gtpp.recipe.multicentrifuge", "gregtech:gt.blockmachines:790"); - setNBTInfoAndSendIt("gtpp.recipe.multielectro", "gregtech:gt.blockmachines:796"); + setNBTInfoAndSendIt("gtpp.recipe.multicentrifuge", "gregtech:gt.blockmachines:790", 1); + setNBTInfoAndSendIt("gtpp.recipe.multielectro", "gregtech:gt.blockmachines:796", 1); setNBTInfoAndSendIt("gtpp.recipe.simplewasher", "gregtech:gt.blockmachines:767"); - setNBTInfoAndSendIt("gtpp.recipe.vacfurnace", "gregtech:gt.blockmachines:995"); + setNBTInfoAndSendIt("gtpp.recipe.vacfurnace", "gregtech:gt.blockmachines:995", 1); + setNBTInfoAndSendIt("gtpp.recipe.fissionfuel", "gregtech:gt.blockmachines:835", 1); + setNBTInfoAndSendIt("gtpp.recipe.lftr", "gregtech:gt.blockmachines:751", 1); + setNBTInfoAndSendIt("gtpp.recipe.lftr.sparging", "gregtech:gt.blockmachines:31035", 1); + setNBTInfoAndSendIt("gtpp.recipe.coldtrap", "gregtech:gt.blockmachines:31034"); + setNBTInfoAndSendIt("gtpp.recipe.reactorprocessingunit", "gregtech:gt.blockmachines:31032"); } + private static void setNBTInfoAndSendIt(String aRecipeName, String aBlock) { + setNBTInfoAndSendIt(aRecipeName, aBlock, 2); + } + + private static void setNBTInfoAndSendIt(String aRecipeName, String aBlock, int aRecipesPerPage) { NBTTagCompound aNBT = new NBTTagCompound(); aNBT.setString("handler", aRecipeName); aNBT.setString("modName", "GT++"); @@ -38,7 +45,7 @@ public class NEI_IMC_Sender { aNBT.setInteger("yShift", 6); aNBT.setInteger("handlerHeight", 135); aNBT.setInteger("handlerWidth", 166); - aNBT.setInteger("maxRecipesPerPage", 2); + aNBT.setInteger("maxRecipesPerPage", aRecipesPerPage); FMLInterModComms.sendMessage("NotEnoughItems", "registerHandlerInfo", aNBT); } } diff --git a/src/Java/gtPlusPlus/plugin/agrichem/BioRecipes.java b/src/Java/gtPlusPlus/plugin/agrichem/BioRecipes.java index 077b397f88..edfd42b5ca 100644 --- a/src/Java/gtPlusPlus/plugin/agrichem/BioRecipes.java +++ b/src/Java/gtPlusPlus/plugin/agrichem/BioRecipes.java @@ -23,7 +23,11 @@ import gtPlusPlus.core.lib.LoadedMods; import gtPlusPlus.core.material.ALLOY; import gtPlusPlus.core.material.MISC_MATERIALS; import gtPlusPlus.core.recipe.common.CI; -import gtPlusPlus.core.util.minecraft.*; +import gtPlusPlus.core.util.minecraft.FluidUtils; +import gtPlusPlus.core.util.minecraft.ItemUtils; +import gtPlusPlus.core.util.minecraft.MaterialUtils; +import gtPlusPlus.core.util.minecraft.OreDictUtils; +import gtPlusPlus.core.util.minecraft.RecipeUtils; import gtPlusPlus.core.util.reflect.ReflectionUtils; import gtPlusPlus.plugin.agrichem.block.AgrichemFluids; import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; @@ -128,7 +132,7 @@ public class BioRecipes { mThermalWater = FluidUtils.getFluidStack("ic2hotwater", 1).getFluid(); mAir = FluidUtils.getFluidStack("air", 1).getFluid(); mSulfuricWasteWater = FluidUtils.getFluidStack("sulfuricapatite", 1).getFluid(); - mAmmonia = MISC_MATERIALS.AMMONIA.getFluid(1).getFluid(); + mAmmonia = MISC_MATERIALS.AMMONIA.getFluidStack(1).getFluid(); mEthylene = FluidUtils.getFluidStack("ethylene", 1).getFluid(); mEthanol = FluidUtils.getFluidStack("bioethanol", 1).getFluid(); mDilutedSulfuricAcid = FluidUtils.getFluidStack("dilutedsulfuricacid", 1).getFluid(); @@ -140,8 +144,8 @@ public class BioRecipes { mStyrene = FluidUtils.getFluidStack("styrene", 1).getFluid(); mMethanol = FluidUtils.getFluidStack("methanol", 1).getFluid(); mLiquidPlastic = FluidUtils.getWildcardFluidStack("plastic", 1).getFluid(); - mCarbonDioxide = MISC_MATERIALS.CARBON_DIOXIDE.getFluid(1).getFluid(); - mCarbonMonoxide = MISC_MATERIALS.CARBON_MONOXIDE.getFluid(1).getFluid(); + mCarbonDioxide = MISC_MATERIALS.CARBON_DIOXIDE.getFluidStack(1).getFluid(); + mCarbonMonoxide = MISC_MATERIALS.CARBON_MONOXIDE.getFluidStack(1).getFluid(); mChlorine = FluidUtils.getFluidStack("chlorine", 1).getFluid(); mHydrogen = FluidUtils.getFluidStack("hydrogen", 1).getFluid(); mAceticAcid = AgrichemFluids.mAceticAcid; @@ -502,14 +506,19 @@ public class BioRecipes { 120 * 20, 60, 1); - + CORE.RA.addDehydratorRecipe( - CI.emptyCells(1), - FluidUtils.getFluidStack(mFermentationBase, 4000), + new ItemStack[] { + CI.getNumberedBioCircuit(14), + CI.emptyCells(1) + }, + FluidUtils.getFluidStack(mFermentationBase, 4000), + null, new ItemStack[] { ItemUtils.getSimpleStack(AgriculturalChem.mCompost, 1), ItemUtils.getItemStackOfAmountFromOreDict("cellAceticAcid", 1) }, + new int[] {10000, 10000}, 60 * 20, 16); diff --git a/src/Java/gtPlusPlus/preloader/asm/Preloader_FMLLoadingPlugin.java b/src/Java/gtPlusPlus/preloader/asm/Preloader_FMLLoadingPlugin.java index 8aa449df5d..22568e6de7 100644 --- a/src/Java/gtPlusPlus/preloader/asm/Preloader_FMLLoadingPlugin.java +++ b/src/Java/gtPlusPlus/preloader/asm/Preloader_FMLLoadingPlugin.java @@ -1,11 +1,14 @@ package gtPlusPlus.preloader.asm; import java.io.File; +import java.text.NumberFormat; +import java.util.Locale; import java.util.Map; import cpw.mods.fml.relauncher.IFMLLoadingPlugin; import cpw.mods.fml.relauncher.IFMLLoadingPlugin.MCVersion; import cpw.mods.fml.relauncher.IFMLLoadingPlugin.SortingIndex; +import gtPlusPlus.core.util.reflect.ReflectionUtils; import gtPlusPlus.preloader.CORE_Preloader; import gtPlusPlus.preloader.Preloader_Logger; import gtPlusPlus.preloader.asm.transformers.Preloader_Transformer_Handler; @@ -71,6 +74,11 @@ public class Preloader_FMLLoadingPlugin implements IFMLLoadingPlugin { CORE_Preloader.DEV_ENVIRONMENT = (Boolean) Launch.blackboard.get("fml.deobfuscatedEnvironment"); CORE_Preloader.DEBUG_MODE = AsmConfig.debugMode; Preloader_Logger.INFO("Running on "+gtPlusPlus.preloader.CORE_Preloader.JAVA_VERSION+" | Development Environment: "+CORE_Preloader.DEV_ENVIRONMENT); + Locale aDefaultLocale = Locale.getDefault(); + NumberFormat aFormat = NumberFormat.getInstance(); + Locale aDisplayLocale = (Locale) ReflectionUtils.getFieldValue(ReflectionUtils.getField(Locale.class, "defaultDisplayLocale")); + Locale aFormatLocale = (Locale) ReflectionUtils.getFieldValue(ReflectionUtils.getField(Locale.class, "defaultFormatLocale")); + Preloader_Logger.INFO("Locale: "+aDefaultLocale+" | Test: "+aFormat.format(1000000000)+" | Display: "+aDisplayLocale+" | Format: "+aFormatLocale); } }
\ No newline at end of file diff --git a/src/Java/gtPlusPlus/preloader/asm/transformers/Preloader_Transformer_Handler.java b/src/Java/gtPlusPlus/preloader/asm/transformers/Preloader_Transformer_Handler.java index 698edf0b56..5cb2eef066 100644 --- a/src/Java/gtPlusPlus/preloader/asm/transformers/Preloader_Transformer_Handler.java +++ b/src/Java/gtPlusPlus/preloader/asm/transformers/Preloader_Transformer_Handler.java @@ -122,8 +122,8 @@ public class Preloader_Transformer_Handler implements IClassTransformer { // Log Handling of CodeChicken if (transformedName.equals("codechicken.nei.guihook.GuiContainerManager")) { - Preloader_Logger.INFO("CodeChicken GuiContainerManager Patch", "Transforming "+transformedName); - return new ClassTransformer_CC_GuiContainerManager(basicClass).getWriter().toByteArray(); + //Preloader_Logger.INFO("CodeChicken GuiContainerManager Patch", "Transforming "+transformedName); + //return new ClassTransformer_CC_GuiContainerManager(basicClass).getWriter().toByteArray(); } // Fix the OreDictionary COFH if (transformedName.equals(COFH_ORE_DICTIONARY_ARBITER) && (AsmConfig.enableCofhPatch || !obfuscated)) { @@ -223,8 +223,8 @@ public class Preloader_Transformer_Handler implements IClassTransformer { //Patching Meta Tile Tooltips if (transformedName.equals(GT_ITEM_MACHINES) && AsmConfig.enableGtTooltipFix) { - Preloader_Logger.INFO("Gregtech Tooltip Patch", "Transforming "+transformedName); - return new ClassTransformer_GT_ItemMachines_Tooltip(basicClass, false).getWriter().toByteArray(); + //Preloader_Logger.INFO("Gregtech Tooltip Patch", "Transforming "+transformedName); + //return new ClassTransformer_GT_ItemMachines_Tooltip(basicClass, false).getWriter().toByteArray(); } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java b/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java index fd5ceed89b..8c814489f2 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java @@ -396,9 +396,15 @@ public enum GregtechItemList implements GregtechItemContainer { // Flotation Cell Controller_Flotation_Cell, + Casing_Flotation_Cell, + + // Sparge Tower + Controller_Sparge_Tower, + Casing_Sparge_Tower_Exterior, + Casing_Sparge_Tower_Interior, // Elemental Duplicator - /*Controller_ElementalDuplicator,*/ + Controller_ElementalDuplicator, Casing_ElementalDuplicator, // Big Steam Macerator @@ -452,7 +458,7 @@ public enum GregtechItemList implements GregtechItemContainer { Hatch_Output_Bus_Steam, //Elemental Duplicator Data Orb Bus - /*Hatch_Input_Elemental_Duplicator,*/ + Hatch_Input_Elemental_Duplicator, //RTG Hatch Hatch_RTG_LV, @@ -585,9 +591,13 @@ public enum GregtechItemList implements GregtechItemContainer { Machine_ZPM_Component_Maker, Machine_UV_Component_Maker, - // Fluid Reactor - FluidReactor_LV, FluidReactor_HV, - FluidReactor_IV, FluidReactor_ZPM, + // Reactor Processing Unit + ReactorProcessingUnit_IV, + ReactorProcessingUnit_ZPM, + + // Cold Trap + ColdTrap_IV, + ColdTrap_ZPM, //Breakers BreakerBox_ULV, BreakerBox_LV, BreakerBox_MV, diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/IGregtech_RecipeAdder.java b/src/Java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/IGregtech_RecipeAdder.java index 229bc234e9..6bf048320f 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/IGregtech_RecipeAdder.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/IGregtech_RecipeAdder.java @@ -1,6 +1,8 @@ package gtPlusPlus.xmod.gregtech.api.interfaces.internal; +import gregtech.api.GregTech_API; import gregtech.api.enums.Materials; +import gregtech.api.util.GT_Recipe; import gtPlusPlus.core.material.Material; import net.minecraft.item.ItemStack; @@ -22,6 +24,13 @@ public interface IGregtech_RecipeAdder { //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(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 addFuel(ItemStack aInput1, ItemStack aOutput1, int aEU, int aType); @@ -62,7 +71,7 @@ public interface IGregtech_RecipeAdder { * @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(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);*/ @@ -124,16 +133,16 @@ public interface IGregtech_RecipeAdder { public boolean addBlastSmelterRecipe(ItemStack[] aInput, FluidStack aInputFluid, FluidStack aOutput, int aChance, int aDuration, int aEUt, int aSpecialValue); /** - * Adds a Recipe for the Alloy Blast Smelter. (up to 9 Inputs) + * Adds a Recipe for the LFTRr. (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 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 = Stores the Required Temp for the Recipe + * @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); @@ -166,6 +175,14 @@ public interface IGregtech_RecipeAdder { 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); @@ -200,9 +217,27 @@ public interface IGregtech_RecipeAdder { 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 + * + * @param aInputs must be != null, 4-16 inputs + * @param aFluidInputs 0-4 fluids + * @param aOutput1 must be != null + * @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); + /** + * Adds a Assemblyline Recipe + * + * @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); + + 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); @@ -297,5 +332,12 @@ public interface IGregtech_RecipeAdder { 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 addVacuumFreezerRecipe(ItemStack aInput, ItemStack aOutput, int aDuration, int aEU); } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Dehydrator.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Dehydrator.java new file mode 100644 index 0000000000..aebf188fc0 --- /dev/null +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Dehydrator.java @@ -0,0 +1,163 @@ +package gtPlusPlus.xmod.gregtech.api.metatileentity.implementations; + +import static gregtech.api.enums.Textures.BlockIcons.MACHINE_CASINGS; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_PIPE_OUT; + +import gregtech.api.enums.Textures; +import gregtech.api.enums.Textures.BlockIcons.CustomIcon; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine_GT_Recipe; +import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.render.TextureFactory; +import gregtech.api.util.GTPP_Recipe; +import gregtech.api.util.GT_Recipe; +import gregtech.api.util.GT_Recipe.GT_Recipe_Map; +import gtPlusPlus.core.lib.CORE; + +@SuppressWarnings("deprecation") +public class GT_MetaTileEntity_Dehydrator extends GT_MetaTileEntity_BasicMachine_GT_Recipe { + + private static final CustomIcon[] sDehydratorOverlays = new CustomIcon[10]; + static { + sDehydratorOverlays[0] = new CustomIcon("basicmachines/microwave/OVERLAY_FRONT"); + sDehydratorOverlays[2] = new CustomIcon("basicmachines/plasma_arc_furnace/OVERLAY_BOTTOM"); + sDehydratorOverlays[3] = new CustomIcon("basicmachines/fluid_heater/OVERLAY_SIDE"); + sDehydratorOverlays[4] = new CustomIcon("basicmachines/chemical_bath/OVERLAY_FRONT"); + sDehydratorOverlays[5] = new CustomIcon("basicmachines/microwave/OVERLAY_FRONT_ACTIVE"); + sDehydratorOverlays[7] = new CustomIcon("basicmachines/plasma_arc_furnace/OVERLAY_BOTTOM_ACTIVE"); + sDehydratorOverlays[8] = new CustomIcon("basicmachines/fluid_heater/OVERLAY_SIDE_ACTIVE"); + sDehydratorOverlays[9] = new CustomIcon("basicmachines/chemical_bath/OVERLAY_FRONT_ACTIVE"); + //3 8 + } + + private GT_Recipe_Map xRecipes; + private int xTankCapacity; + + public GT_MetaTileEntity_Dehydrator(int aID, String aName, String aNameRegional, int aTier, String aDescription, int aTankCapacity) { + super(aID, aName, aNameRegional, aTier, aDescription, GTPP_Recipe.GTPP_Recipe_Map.sChemicalDehydratorRecipes, 2, 9, aTankCapacity, 2, 5, "Dehydrator.png", "UNBOXINATOR", false, false, 0, "", null); + xRecipes = GTPP_Recipe.GTPP_Recipe_Map.sChemicalDehydratorRecipes; + xTankCapacity = aTankCapacity; + } + + 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, aDescription, aRecipes, 2, 9, aTankCapacity, aAmperage, 2, 5, aTextures, aGUIName, aNEIName, "", false, false, 0); + + } + + @Override + public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new GT_MetaTileEntity_Dehydrator(this.mName, this.mTier, this.mDescriptionArray, this.xRecipes, this.xTankCapacity, this.mAmperage, this.mTextures, this.mGUIName, this.mNEIName); + } + + @Override + public String[] getDescription() { + String[] S = super.getDescription(); + final String[] desc = new String[S.length + 1]; + System.arraycopy(S, 0, desc, 0, S.length); + desc[S.length] = CORE.GT_Tooltip; + return desc; + } + + @Override + public ITexture[][][] getTextureSet(final ITexture[] aTextures) { + final ITexture[][][] rTextures = new ITexture[15][17][]; + for (byte i = -1; i < 16; i++) { + rTextures[0][i + 1] = getSideFacingActive(i); + rTextures[1][i + 1] = getSideFacingInactive(i); + rTextures[2][i + 1] = getFrontFacingActive(i); + rTextures[3][i + 1] = getFrontFacingInactive(i); + rTextures[4][i + 1] = getTopFacingActive(i); + rTextures[5][i + 1] = getTopFacingInactive(i); + rTextures[6][i + 1] = getBottomFacingActive(i); + rTextures[7][i + 1] = getBottomFacingInactive(i); + rTextures[8][i + 1] = getBottomFacingPipeActive(i); + rTextures[9][i + 1] = getBottomFacingPipeInactive(i); + rTextures[10][i + 1] = getTopFacingPipeActive(i); + rTextures[11][i + 1] = getTopFacingPipeInactive(i); + rTextures[12][i + 1] = getSideFacingPipeActive(i); + rTextures[13][i + 1] = getSideFacingPipeInactive(i); + } + 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 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]; + } + + @Override + public ITexture[] getFrontFacingInactive(final byte aColor) { + 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])}; + } + + @Override + public ITexture[] getTopFacingInactive(final byte aColor) { + 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])}; + } + + @Override + public ITexture[] getFrontFacingActive(final byte aColor) { + 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])}; + } + + @Override + public ITexture[] getTopFacingActive(final byte aColor) { + 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])}; + } + + @Override + public ITexture[] getBottomFacingPipeActive(byte aColor) { + 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)}; + } + + @Override + public ITexture[] getTopFacingPipeActive(byte aColor) { + 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)}; + } + + @Override + public ITexture[] getSideFacingPipeActive(byte aColor) { + 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)}; + } + +} diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_AirIntake.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_AirIntake.java index a7d395b0a1..e6fd5dc797 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_AirIntake.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_AirIntake.java @@ -70,15 +70,16 @@ public class GT_MetaTileEntity_Hatch_AirIntake extends GT_MetaTileEntity_Hatch_I } if (S != null) { - final String[] desc = new String[S.length + 3]; + final String[] desc = new String[S.length + 4]; System.arraycopy(S, 0, desc, 0, S.length); desc[S.length] = "DO NOT OBSTRUCT THE INPUT!"; desc[S.length + 1] = "Draws in Air from the surrounding environment"; desc[S.length + 2] = "Creates 1000L of Air every 4 ticks"; + desc[S.length + 3] = CORE.GT_Tooltip; return desc; } else { - return new String[] {"DO NOT OBSTRUCT THE INPUT!", "Draws in Air from the surrounding environment", "Creates 1000L of Air every 4 ticks"}; + return new String[] {"DO NOT OBSTRUCT THE INPUT!", "Draws in Air from the surrounding environment", "Creates 1000L of Air every 4 ticks", CORE.GT_Tooltip}; } @@ -126,7 +127,7 @@ public class GT_MetaTileEntity_Hatch_AirIntake extends GT_MetaTileEntity_Hatch_I public void onPostTick(final IGregTechTileEntity aBaseMetaTileEntity, final long aTick) { super.onPostTick(aBaseMetaTileEntity, aTick); - if (addAirToHatch(aTick)) { + if (this.getBaseMetaTileEntity().isActive() && addAirToHatch(aTick)) { if (aTick % 8 == 0) { if (aBaseMetaTileEntity.isClientSide()) { this.pollutionParticles(this.getBaseMetaTileEntity().getWorld(), "cloud"); diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_ControlCore.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_ControlCore.java index 7a532807c8..5347b2e4f7 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_ControlCore.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_ControlCore.java @@ -10,6 +10,7 @@ import gregtech.api.util.GT_Recipe.GT_Recipe_Map; import gregtech.api.util.GT_Utility; import gtPlusPlus.api.objects.minecraft.BlockPos; 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; @@ -34,6 +35,13 @@ public class GT_MetaTileEntity_Hatch_ControlCore extends GT_MetaTileEntity_Hatch 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}; + } @Override public ITexture[] getTexturesActive(ITexture aBaseTexture) { diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_DynamoBuffer.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_DynamoBuffer.java index 5fef0f1088..39f477b173 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_DynamoBuffer.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_DynamoBuffer.java @@ -53,11 +53,21 @@ public class GT_MetaTileEntity_Hatch_DynamoBuffer extends GT_MetaTileEntity_Hatc 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", "Capacity: "+maxEUStore()+"EU", "Voltage: "+this.maxEUOutput(), "Amperage In: 4", "Amperage Out: 4"}; + 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()+"EU/t as input", "Large Turbines only supply 1A to this, other Multiblocks can inject more amps"}; + 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/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_ElementalDataOrbHolder.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_ElementalDataOrbHolder.java index a98c57eb30..a892346463 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_ElementalDataOrbHolder.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_ElementalDataOrbHolder.java @@ -1,5 +1,7 @@ package gtPlusPlus.xmod.gregtech.api.metatileentity.implementations; +import java.util.ArrayList; + import gregtech.api.gui.GT_Container_4by4; import gregtech.api.gui.GT_GUIContainer_4by4; import gregtech.api.interfaces.ITexture; @@ -9,6 +11,7 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch; import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.util.GT_LanguageManager; 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.entity.player.InventoryPlayer; @@ -17,13 +20,12 @@ import net.minecraft.nbt.NBTTagCompound; public class GT_MetaTileEntity_Hatch_ElementalDataOrbHolder extends GT_MetaTileEntity_Hatch { public GT_Recipe_Map mRecipeMap = null; - public boolean disableSort; public GT_MetaTileEntity_Hatch_ElementalDataOrbHolder(int aID, String aName, String aNameRegional, int aTier) { super(aID, aName, aNameRegional, aTier, 16, new String[]{ "Holds Data Orbs for the Elemental Duplicator", - }); - disableSort = true; + CORE.GT_Tooltip + }); } public GT_MetaTileEntity_Hatch_ElementalDataOrbHolder(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { @@ -83,7 +85,7 @@ public class GT_MetaTileEntity_Hatch_ElementalDataOrbHolder extends GT_MetaTileE @Override public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_GUIContainer_4by4(aPlayerInventory, aBaseMetaTileEntity, "Steam Input Bus"); + return new GT_GUIContainer_4by4(aPlayerInventory, aBaseMetaTileEntity, "Data Orb Repository"); } @Override @@ -100,28 +102,26 @@ public class GT_MetaTileEntity_Hatch_ElementalDataOrbHolder extends GT_MetaTileE } protected void fillStacksIntoFirstSlots() { - if (disableSort) { - for (int i = 0; i < mInventory.length; i++) - if (mInventory[i] != null && mInventory[i].stackSize <= 0) - mInventory[i] = null; - } + for (int i = 0; i < mInventory.length; i++) { + if (mInventory[i] != null && mInventory[i].stackSize <= 0) { + mInventory[i] = null; + } + } } @Override public void saveNBTData(NBTTagCompound aNBT) { super.saveNBTData(aNBT); - aNBT.setBoolean("disableSort", disableSort); } @Override public void loadNBTData(NBTTagCompound aNBT) { super.loadNBTData(aNBT); - disableSort = aNBT.getBoolean("disableSort"); } @Override public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { - + } public String trans(String aKey, String aEnglish) { @@ -137,5 +137,13 @@ public class GT_MetaTileEntity_Hatch_ElementalDataOrbHolder extends GT_MetaTileE public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { return aSide == getBaseMetaTileEntity().getFrontFacing() && (mRecipeMap == null || mRecipeMap.containsInput(aStack)); } + + public ArrayList<ItemStack> getInventory(){ + ArrayList<ItemStack> aContents = new ArrayList<ItemStack>(); + for (int i=0;i<this.getSizeInventory();i++) { + aContents.add(this.getStackInSlot(i)); + } + return aContents; + } } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Energy_RTG.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Energy_RTG.java index 7b52b9449f..93e6274508 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Energy_RTG.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Energy_RTG.java @@ -12,6 +12,7 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy; import gtPlusPlus.api.objects.Logger; +import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.util.minecraft.InventoryUtils; import gtPlusPlus.core.util.minecraft.ItemUtils; import gtPlusPlus.core.util.reflect.ReflectionUtils; @@ -37,8 +38,12 @@ public class GT_MetaTileEntity_Hatch_Energy_RTG extends GT_MetaTileEntity_Hatch_ } @Override - public String[] getDescription() { - return super.getDescription(); + public String[] getDescription() { + String[] S = super.getDescription(); + final String[] desc = new String[S.length + 1]; + System.arraycopy(S, 0, desc, 0, S.length); + desc[S.length] = CORE.GT_Tooltip; + return desc; } @Override diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_InputBattery.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_InputBattery.java index 01134817ae..57f8b722c3 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_InputBattery.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_InputBattery.java @@ -51,7 +51,8 @@ GT_MetaTileEntity_Hatch { } return new String[]{ this.mDescription, - "Capacity: " + mSlots + " slots"}; + "Capacity: " + mSlots + " slots", + CORE.GT_Tooltip}; } @Override diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Muffler_Adv.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Muffler_Adv.java index 5303a42bf6..ba4e394114 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Muffler_Adv.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Muffler_Adv.java @@ -62,15 +62,15 @@ public class GT_MetaTileEntity_Hatch_Muffler_Adv extends GT_MetaTileEntity_Hatch public String[] getDescription() { if (CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK) { String[] mDescArray = StaticFields59.getDescriptionArray(this); - String[] desc = new String[mDescArray.length + 6]; + String[] desc = new String[mDescArray.length + 7]; System.arraycopy(mDescArray, 0, desc, 0, mDescArray.length); desc[mDescArray.length] = "DO NOT OBSTRUCT THE OUTPUT!"; 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 + 5] = "Recovers " + (105 - this.calculatePollutionReductionForTooltip(100)) + "% of CO2/CO/SO2"; + desc[mDescArray.length + 6] = CORE.GT_Tooltip; return desc; } else { diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Naquadah.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Naquadah.java index 0d4d8b6cdd..d0f1d8e03f 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Naquadah.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Naquadah.java @@ -12,6 +12,7 @@ import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Input; import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.util.GT_Utility; +import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.util.reflect.ReflectionUtils; import gtPlusPlus.xmod.gregtech.common.StaticFields59; import net.minecraft.item.ItemStack; @@ -115,7 +116,8 @@ public class GT_MetaTileEntity_Hatch_Naquadah extends GT_MetaTileEntity_Hatch_In "Capacity: " + getCapacity()+"L", "Accepted Fluid: " + aNaq, "Accepted Fluid: " + aEnrNaq, - "Accepted Fluid: " + aNaquad + "Accepted Fluid: " + aNaquad, + CORE.GT_Tooltip }; return s2; } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_OutputBattery.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_OutputBattery.java index 8cb7c943c0..ba97cc38eb 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_OutputBattery.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_OutputBattery.java @@ -49,7 +49,8 @@ GT_MetaTileEntity_Hatch { } return new String[]{ this.mDescription, - "Capacity: " + mSlots + " slots"}; + "Capacity: " + mSlots + " slots", + CORE.GT_Tooltip}; } @Override diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Plasma.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Plasma.java index b395bbbabe..1251c42ae3 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Plasma.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Plasma.java @@ -11,6 +11,7 @@ import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Output; import gregtech.api.util.GT_Utility; import gtPlusPlus.api.objects.data.AutoMap; +import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.util.reflect.ReflectionUtils; import gtPlusPlus.xmod.gregtech.common.StaticFields59; import net.minecraft.item.ItemStack; @@ -159,7 +160,7 @@ public class GT_MetaTileEntity_Hatch_Plasma extends GT_MetaTileEntity_Hatch_Outp String[] s2 = new String[]{ - a1, a2, a3 + a1, a2, a3, CORE.GT_Tooltip }; return s2; } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Steam_BusInput.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Steam_BusInput.java index fb67b48e7f..f1dd131a67 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Steam_BusInput.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Steam_BusInput.java @@ -10,6 +10,7 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch; import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.util.GT_LanguageManager; import gregtech.api.util.GT_Recipe.GT_Recipe_Map; +import gtPlusPlus.core.lib.CORE; import gregtech.api.util.GT_Utility; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; @@ -25,7 +26,8 @@ public class GT_MetaTileEntity_Hatch_Steam_BusInput extends GT_MetaTileEntity_Ha "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"}); + "Does not work with non-steam multiblocks", + CORE.GT_Tooltip}); } public GT_MetaTileEntity_Hatch_Steam_BusInput(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Steam_BusOutput.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Steam_BusOutput.java index fb626cb817..2fb3fea084 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Steam_BusOutput.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Steam_BusOutput.java @@ -8,6 +8,7 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch; import gregtech.api.objects.GT_RenderedTexture; +import gtPlusPlus.core.lib.CORE; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; @@ -16,7 +17,8 @@ public class GT_MetaTileEntity_Hatch_Steam_BusOutput extends GT_MetaTileEntity_H 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"}); + "Does not work with non-steam multiblocks", + CORE.GT_Tooltip}); } public GT_MetaTileEntity_Hatch_Steam_BusOutput(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_TurbineProvider.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_TurbineProvider.java index 752321506d..0b84f676f4 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_TurbineProvider.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_TurbineProvider.java @@ -8,6 +8,7 @@ import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_InputBus; import gregtech.common.tileentities.machines.multi.GT_MetaTileEntity_LargeTurbine; import gtPlusPlus.api.objects.Logger; +import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.minecraft.PlayerUtils; import gtPlusPlus.core.util.sys.KeyboardUtils; @@ -49,7 +50,14 @@ 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"}; + "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}; } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_SuperBus_Input.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_SuperBus_Input.java index d503452022..b27cb95ca4 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_SuperBus_Input.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_SuperBus_Input.java @@ -8,6 +8,7 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Input import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.util.GT_Utility; import gregtech.api.util.extensions.ArrayExt; +import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.util.minecraft.ItemUtils; import gtPlusPlus.core.util.minecraft.PlayerUtils; import net.minecraft.entity.player.EntityPlayer; @@ -125,6 +126,7 @@ public class GT_MetaTileEntity_SuperBus_Input extends GT_MetaTileEntity_Hatch_In "Item Input for Multiblocks", "This bus has no GUI, but can have items extracted", ""+getSlots(this.mTier)+" Slots", + CORE.GT_Tooltip }; return aDesc; } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_SuperBus_Output.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_SuperBus_Output.java index 66bfbea8b1..37aa57298a 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_SuperBus_Output.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_SuperBus_Output.java @@ -6,6 +6,7 @@ import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_OutputBus; import gregtech.api.util.GT_Utility; import gregtech.api.util.extensions.ArrayExt; +import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.util.minecraft.ItemUtils; import gtPlusPlus.core.util.minecraft.PlayerUtils; import net.minecraft.entity.player.EntityPlayer; @@ -93,6 +94,7 @@ public class GT_MetaTileEntity_SuperBus_Output extends GT_MetaTileEntity_Hatch_O "Item Output for Multiblocks", "This bus has no GUI", ""+getSlots(this.mTier)+" Slots", + CORE.GT_Tooltip }; return aDesc; } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GT_MetaTileEntity_Hatch_CustomFluidBase.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GT_MetaTileEntity_Hatch_CustomFluidBase.java index e0ff04763d..124f8695f5 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GT_MetaTileEntity_Hatch_CustomFluidBase.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GT_MetaTileEntity_Hatch_CustomFluidBase.java @@ -2,6 +2,7 @@ package gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base; import gregtech.api.util.GT_Utility; import gtPlusPlus.api.objects.Logger; +import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.util.minecraft.FluidUtils; import net.minecraft.item.ItemStack; import net.minecraft.util.EnumChatFormatting; @@ -114,7 +115,8 @@ public class GT_MetaTileEntity_Hatch_CustomFluidBase extends GT_MetaTileEntity_H String[] s2 = new String[]{ "Fluid Input for "+(isSteam ? "Steam " : "")+"Multiblocks", "Capacity: " + getCapacity()+"L", - aFluidName + aFluidName, + CORE.GT_Tooltip }; return s2; } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMetaTransformerHiAmp.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMetaTransformerHiAmp.java index ccf31673e7..768a57f8b2 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMetaTransformerHiAmp.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMetaTransformerHiAmp.java @@ -85,7 +85,9 @@ public class GregtechMetaTransformerHiAmp extends GT_MetaTileEntity_Transformer @Override public String[] getDescription() { - return new String[] { this.mDescription, "Accepts 4A and outputs 16A"}; + return new String[] { this.mDescription, + "Accepts 4A and outputs 16A", + CORE.GT_Tooltip}; } @Override diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java index 0b8182c64a..d413ce44e4 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java @@ -30,6 +30,7 @@ import gtPlusPlus.core.lib.LoadedMods; import gtPlusPlus.core.recipe.common.CI; import gtPlusPlus.core.util.math.MathUtils; import gtPlusPlus.core.util.minecraft.ItemUtils; +import gtPlusPlus.core.util.minecraft.PlayerUtils; import gtPlusPlus.core.util.reflect.ReflectionUtils; import gtPlusPlus.preloader.CORE_Preloader; import gtPlusPlus.preloader.asm.AsmConfig; @@ -51,6 +52,8 @@ 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 org.apache.commons.lang3.ArrayUtils; import java.lang.reflect.InvocationTargetException; @@ -63,6 +66,10 @@ import java.util.function.Function; import static gtPlusPlus.core.util.data.ArrayUtils.removeNulls; +// Glee8e - 11/12/21 - 2:15pm +// Yeah, now I see what's wrong. Someone inherited from GregtechMeta_MultiBlockBase instead of GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_IndustrialDehydrator> as it should have been +// so any method in GregtechMetaTileEntity_IndustrialDehydrator would see generic field declared in GregtechMeta_MultiBlockBase without generic parameter + public abstract class GregtechMeta_MultiBlockBase<T extends GT_MetaTileEntity_EnhancedMultiBlockBase<T>> extends GT_MetaTileEntity_EnhancedMultiBlockBase<T> { public static final boolean DEBUG_DISABLE_CORES_TEMPORARILY = true; @@ -91,14 +98,15 @@ public abstract class GregtechMeta_MultiBlockBase<T extends GT_MetaTileEntity_En protected long mTotalRunTime = 0; protected boolean mVoidExcess = false; - //Control Core Hatch public ArrayList<GT_MetaTileEntity_Hatch_ControlCore> mControlCoreBus = new ArrayList<GT_MetaTileEntity_Hatch_ControlCore>(); public ArrayList<GT_MetaTileEntity_Hatch_AirIntake> mAirIntakes = new ArrayList<GT_MetaTileEntity_Hatch_AirIntake>(); public ArrayList<GT_MetaTileEntity_Hatch_InputBattery> mChargeHatches = new ArrayList<GT_MetaTileEntity_Hatch_InputBattery>(); public ArrayList<GT_MetaTileEntity_Hatch_OutputBattery> mDischargeHatches = new ArrayList<GT_MetaTileEntity_Hatch_OutputBattery>(); + public ArrayList<GT_MetaTileEntity_Hatch> mAllEnergyHatches = new ArrayList<GT_MetaTileEntity_Hatch>(); + public ArrayList<GT_MetaTileEntity_Hatch> mAllDynamoHatches = new ArrayList<GT_MetaTileEntity_Hatch>(); // Custom Behaviour Map - private static final HashMap<String, SpecialMultiBehaviour> mCustomBehviours = new HashMap<String, SpecialMultiBehaviour>();; + private static final HashMap<String, SpecialMultiBehaviour> mCustomBehviours = new HashMap<String, SpecialMultiBehaviour>(); public GregtechMeta_MultiBlockBase(final int aID, final String aName, @@ -1464,6 +1472,8 @@ public abstract class GregtechMeta_MultiBlockBase<T extends GT_MetaTileEntity_En this.mAirIntakes.clear(); this.mTecTechEnergyHatches.clear(); this.mTecTechDynamoHatches.clear(); + this.mAllEnergyHatches.clear(); + this.mAllDynamoHatches.clear(); } } @@ -1654,8 +1664,11 @@ public abstract class GregtechMeta_MultiBlockBase<T extends GT_MetaTileEntity_En return mMaintenanceHatches.size() <= 1 && !mMufflerHatches.isEmpty(); } - public <E> boolean addToMachineListInternal(ArrayList<E> aList, final IMetaTileEntity 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) { if (aTileEntity == null) { return false; } @@ -1665,7 +1678,15 @@ public abstract class GregtechMeta_MultiBlockBase<T extends GT_MetaTileEntity_En * Class <?> aHatchType = ReflectionUtils.getTypeOfGenericObject(aList); if * (!aHatchType.isInstance(aTileEntity)) { return false; } */ + + // Try setRecipeMap + if (aTileEntity instanceof GT_MetaTileEntity_Hatch_Input) { + ((GT_MetaTileEntity_Hatch_Input) aTileEntity).mRecipeMap = getRecipeMap(); + } + if (aTileEntity instanceof GT_MetaTileEntity_Hatch_InputBus) { + ((GT_MetaTileEntity_Hatch_InputBus) aTileEntity).mRecipeMap = getRecipeMap(); + } if (aList.isEmpty()) { if (aTileEntity instanceof GT_MetaTileEntity_Hatch) { @@ -1742,33 +1763,35 @@ public abstract class GregtechMeta_MultiBlockBase<T extends GT_MetaTileEntity_En //mControlCoreBus public boolean addControlCoreToMachineList(final IGregTechTileEntity aTileEntity, final int aBaseCasingIndex) { - final IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); - if (aMetaTileEntity == null) { - log("Tried to add null module entity."); - return false; - } if (!mControlCoreBus.isEmpty()) { log("Tried to add a secondary control core module."); return false; } - - GT_MetaTileEntity_Hatch_ControlCore Module = (GT_MetaTileEntity_Hatch_ControlCore) aMetaTileEntity; - + GT_MetaTileEntity_Hatch_ControlCore Module = (GT_MetaTileEntity_Hatch_ControlCore) getMetaTileEntity(aTileEntity); if (Module != null) { if (Module.setOwner(aTileEntity)) { log("Adding control core module."); - return addToMachineListInternal(mControlCoreBus, aMetaTileEntity, aBaseCasingIndex); + return addToMachineListInternal(mControlCoreBus, Module, aBaseCasingIndex); } } return false; } - @Override - public boolean addToMachineList(final IGregTechTileEntity aTileEntity, final int aBaseCasingIndex) { + private IMetaTileEntity getMetaTileEntity(final IGregTechTileEntity aTileEntity) { if (aTileEntity == null) { - return false; + return null; } final IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); + return aMetaTileEntity; + } + + + @Override + public boolean addToMachineList(final IGregTechTileEntity aTileEntity, final int aBaseCasingIndex) { + return addToMachineList(getMetaTileEntity(aTileEntity), aBaseCasingIndex); + } + + public boolean addToMachineList(final IMetaTileEntity aMetaTileEntity, final int aBaseCasingIndex) { if (aMetaTileEntity == null) { return false; } @@ -1776,10 +1799,14 @@ public abstract class GregtechMeta_MultiBlockBase<T extends GT_MetaTileEntity_En //Use this to determine the correct value, then update the hatch texture after. boolean aDidAdd = false; - //Handle Custom Hustoms + //Handle Custom Hatches if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_ControlCore) { log("Found GT_MetaTileEntity_Hatch_ControlCore"); - aDidAdd = addControlCoreToMachineList(aTileEntity, aBaseCasingIndex); + if (!mControlCoreBus.isEmpty()) { + log("Tried to add a secondary control core module."); + return false; + } + aDidAdd = addToMachineListInternal(this.mControlCoreBus, aMetaTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputBattery) { log("Found GT_MetaTileEntity_Hatch_InputBattery"); @@ -1789,17 +1816,22 @@ public abstract class GregtechMeta_MultiBlockBase<T extends GT_MetaTileEntity_En log("Found GT_MetaTileEntity_Hatch_OutputBattery"); aDidAdd = addToMachineListInternal(mDischargeHatches, aMetaTileEntity, aBaseCasingIndex); } + else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_AirIntake) { + aDidAdd = addToMachineListInternal(mAirIntakes, aMetaTileEntity, aBaseCasingIndex); + } //Handle TT Multi-A Energy Hatches else if (LoadedMods.TecTech && isThisHatchMultiEnergy(aMetaTileEntity)) { log("Found isThisHatchMultiEnergy"); aDidAdd = addToMachineListInternal(mTecTechEnergyHatches, aMetaTileEntity, aBaseCasingIndex); + updateMasterEnergyHatchList(aMetaTileEntity); } //Handle TT Multi-A Dynamos else if (LoadedMods.TecTech && isThisHatchMultiDynamo(aMetaTileEntity)) { log("Found isThisHatchMultiDynamo"); aDidAdd = addToMachineListInternal(mTecTechDynamoHatches, aMetaTileEntity, aBaseCasingIndex); + updateMasterDynamoHatchList(aMetaTileEntity); } //Handle Fluid Hatches using seperate logic @@ -1813,10 +1845,14 @@ public abstract class GregtechMeta_MultiBlockBase<T extends GT_MetaTileEntity_En aDidAdd = addToMachineListInternal(mInputBusses, aMetaTileEntity, aBaseCasingIndex); else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_OutputBus) aDidAdd = addToMachineListInternal(mOutputBusses, aMetaTileEntity, aBaseCasingIndex); - else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Energy) + else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Energy) { aDidAdd = addToMachineListInternal(mEnergyHatches, aMetaTileEntity, aBaseCasingIndex); - else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Dynamo) + updateMasterEnergyHatchList(aMetaTileEntity); + } + else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Dynamo) { aDidAdd = addToMachineListInternal(mDynamoHatches, aMetaTileEntity, aBaseCasingIndex); + updateMasterDynamoHatchList(aMetaTileEntity); + } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Maintenance) aDidAdd = addToMachineListInternal(mMaintenanceHatches, aMetaTileEntity, aBaseCasingIndex); else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Muffler) @@ -1830,57 +1866,54 @@ public abstract class GregtechMeta_MultiBlockBase<T extends GT_MetaTileEntity_En @Override public boolean addMaintenanceToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { - return addToMachineList(aTileEntity, aBaseCasingIndex); + IMetaTileEntity aMetaTileEntity = getMetaTileEntity(aTileEntity); + if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Maintenance) { + return addToMachineList(aMetaTileEntity, aBaseCasingIndex); + } + return false; } @Override public boolean addMufflerToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { - return addToMachineList(aTileEntity, aBaseCasingIndex); + IMetaTileEntity aMetaTileEntity = getMetaTileEntity(aTileEntity); + if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Muffler) { + return addToMachineList(aMetaTileEntity, aBaseCasingIndex); + } + return false; } @Override public boolean addInputToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { - return addToMachineList(aTileEntity, aBaseCasingIndex); + IMetaTileEntity aMetaTileEntity = getMetaTileEntity(aTileEntity); + if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input || aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputBus) { + return addToMachineList(aMetaTileEntity, aBaseCasingIndex); + } + return false; } @Override public boolean addOutputToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { - return addToMachineList(aTileEntity, aBaseCasingIndex); + IMetaTileEntity aMetaTileEntity = getMetaTileEntity(aTileEntity); + if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Output || aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_OutputBus) { + return addToMachineList(aMetaTileEntity, aBaseCasingIndex); + } + return false; } - public boolean addAirIntakeToMachineList(final IGregTechTileEntity aTileEntity, final int aBaseCasingIndex) { - if (aTileEntity == null) { - return false; - } - final IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); - if (aMetaTileEntity == null) { - return false; - } + public boolean addAirIntakeToMachineList(final IGregTechTileEntity aMetaTileEntity, final int aBaseCasingIndex) { if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_AirIntake) { - this.mAirIntakes.add((GT_MetaTileEntity_Hatch_AirIntake)aMetaTileEntity); + return addToMachineList(aMetaTileEntity, aBaseCasingIndex); } - return addToMachineList(aTileEntity, aBaseCasingIndex); + return false; } public boolean addFluidInputToMachineList(final IGregTechTileEntity aTileEntity, final int aBaseCasingIndex) { - if (aTileEntity == null) { - return false; - } - final IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); - if (aMetaTileEntity == null) { - return false; - } - return addFluidInputToMachineList(aMetaTileEntity, aBaseCasingIndex); + return addFluidInputToMachineList(getMetaTileEntity(aTileEntity), aBaseCasingIndex); } - public boolean addFluidInputToMachineList(final IMetaTileEntity aTileEntity, final int aBaseCasingIndex) { - if (aTileEntity == null) { - return false; - } - final IMetaTileEntity aMetaTileEntity = aTileEntity; + public boolean addFluidInputToMachineList(final IMetaTileEntity aMetaTileEntity, final int aBaseCasingIndex) { if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input) { - ((GT_MetaTileEntity_Hatch_Input) aMetaTileEntity).mRecipeMap = this.getRecipeMap(); - return addToMachineListInternal(mInputHatches, aMetaTileEntity, aBaseCasingIndex); + return addToMachineList(aMetaTileEntity, aBaseCasingIndex); } return false; } @@ -1909,10 +1942,7 @@ public abstract class GregtechMeta_MultiBlockBase<T extends GT_MetaTileEntity_En } public boolean resetRecipeMapForHatch(IGregTechTileEntity aTileEntity, GT_Recipe_Map aMap) { try { - if (aTileEntity == null) { - return false; - } - final IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); + final IMetaTileEntity aMetaTileEntity = getMetaTileEntity(aTileEntity); if (aMetaTileEntity == null) { return false; } @@ -1982,11 +2012,7 @@ public abstract class GregtechMeta_MultiBlockBase<T extends GT_MetaTileEntity_En */ public boolean updateTexture(final IGregTechTileEntity aTileEntity, int aCasingID){ - final IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); - if (aMetaTileEntity == null) { - return false; - } - return updateTexture(aMetaTileEntity, aCasingID); + return updateTexture(getMetaTileEntity(aTileEntity), aCasingID); } /** @@ -2071,22 +2097,21 @@ public abstract class GregtechMeta_MultiBlockBase<T extends GT_MetaTileEntity_En */ public boolean addMultiAmpDynamoToMachineList(final IGregTechTileEntity aTileEntity, final int aBaseCasingIndex){ - //GT_MetaTileEntity_Hatch_DynamoMulti - if (aTileEntity == null) { - return false; - } - final IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); + final IMetaTileEntity aMetaTileEntity = getMetaTileEntity(aTileEntity); if (aMetaTileEntity == null) { return false; } if (isThisHatchMultiDynamo(aTileEntity)) { - updateTexture(aTileEntity, aBaseCasingIndex); - return this.mTecTechDynamoHatches.add((GT_MetaTileEntity_Hatch) aMetaTileEntity); + return addToMachineListInternal(mTecTechDynamoHatches, aMetaTileEntity, aBaseCasingIndex); } return false; } - public boolean isThisHatchMultiDynamo(Object aMetaTileEntity){ + public boolean isThisHatchMultiDynamo(IGregTechTileEntity aTileEntity){ + return isThisHatchMultiDynamo(getMetaTileEntity(aTileEntity)); + } + + public boolean isThisHatchMultiDynamo(IMetaTileEntity aMetaTileEntity){ Class<?> mDynamoClass; mDynamoClass = ReflectionUtils.getClass("com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_DynamoMulti"); if (mDynamoClass != null){ @@ -2099,13 +2124,22 @@ public abstract class GregtechMeta_MultiBlockBase<T extends GT_MetaTileEntity_En @Override public boolean addDynamoToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { - if (LoadedMods.TecTech){ - if (isThisHatchMultiDynamo(aTileEntity)) { - return addMultiAmpDynamoToMachineList(aTileEntity, aBaseCasingIndex); - } - + IMetaTileEntity aMetaTileEntity = getMetaTileEntity(aTileEntity); + if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Dynamo || isThisHatchMultiDynamo(aMetaTileEntity)) { + return addToMachineList(aMetaTileEntity, aBaseCasingIndex); } - return addToMachineList(aTileEntity, aBaseCasingIndex); + return false; + } + + private boolean updateMasterDynamoHatchList(IMetaTileEntity aMetaTileEntity) { + if (aMetaTileEntity == null) { + return false; + } + if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch) { + GT_MetaTileEntity_Hatch aHatch = (GT_MetaTileEntity_Hatch) aMetaTileEntity; + return mAllDynamoHatches.add(aHatch); + } + return false; } @@ -2117,22 +2151,21 @@ public abstract class GregtechMeta_MultiBlockBase<T extends GT_MetaTileEntity_En */ public boolean addMultiAmpEnergyToMachineList(final IGregTechTileEntity aTileEntity, final int aBaseCasingIndex){ - //GT_MetaTileEntity_Hatch_DynamoMulti - if (aTileEntity == null) { - return false; - } - final IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); + final IMetaTileEntity aMetaTileEntity = getMetaTileEntity(aTileEntity); if (aMetaTileEntity == null) { return false; } - if (isThisHatchMultiEnergy(aTileEntity)) { - updateTexture(aTileEntity, aBaseCasingIndex); - return this.mTecTechEnergyHatches.add((GT_MetaTileEntity_Hatch) aMetaTileEntity); + if (isThisHatchMultiEnergy(aMetaTileEntity)) { + return addToMachineListInternal(mTecTechEnergyHatches, aMetaTileEntity, aBaseCasingIndex); } return false; + } + + public boolean isThisHatchMultiEnergy(IGregTechTileEntity aTileEntity){ + return isThisHatchMultiEnergy(getMetaTileEntity(aTileEntity)); } - public boolean isThisHatchMultiEnergy(Object aMetaTileEntity){ + public boolean isThisHatchMultiEnergy(IMetaTileEntity aMetaTileEntity){ Class<?> mDynamoClass; mDynamoClass = ReflectionUtils.getClass("com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_EnergyMulti"); if (mDynamoClass != null){ @@ -2145,13 +2178,22 @@ public abstract class GregtechMeta_MultiBlockBase<T extends GT_MetaTileEntity_En @Override public boolean addEnergyInputToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { - if (LoadedMods.TecTech){ - if (isThisHatchMultiEnergy(aTileEntity)) { - return addMultiAmpEnergyToMachineList(aTileEntity, aBaseCasingIndex); - } - + IMetaTileEntity aMetaTileEntity = getMetaTileEntity(aTileEntity); + if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Energy || isThisHatchMultiEnergy(aMetaTileEntity)) { + return addToMachineList(aMetaTileEntity, aBaseCasingIndex); } - return super.addEnergyInputToMachineList(aTileEntity, aBaseCasingIndex); + return false; + } + + private boolean updateMasterEnergyHatchList(IMetaTileEntity aMetaTileEntity) { + if (aMetaTileEntity == null) { + return false; + } + if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch) { + GT_MetaTileEntity_Hatch aHatch = (GT_MetaTileEntity_Hatch) aMetaTileEntity; + return mAllEnergyHatches.add(aHatch); + } + return false; } @@ -2388,20 +2430,43 @@ public abstract class GregtechMeta_MultiBlockBase<T extends GT_MetaTileEntity_En @Override public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer, byte aSide, float aX, float aY, float aZ) { - //Do Super - boolean aSuper = super.onRightclick(aBaseMetaTileEntity, aPlayer, aSide, aX, aY, aZ); // Do Things if (this.getBaseMetaTileEntity().isServerSide()) { + //Logger.INFO("Right Clicked Controller."); ItemStack tCurrentItem = aPlayer.inventory.getCurrentItem(); - if (tCurrentItem != null) { - if (GT_Utility.isStackInList(tCurrentItem, GregTech_API.sSoftHammerList)) { - - } + if (tCurrentItem != null) { + //Logger.INFO("Holding Item."); + if (tCurrentItem.getItem() instanceof GT_MetaGenerated_Tool) { + //Logger.INFO("Is GT_MetaGenerated_Tool."); + int[] aOreID = OreDictionary.getOreIDs(tCurrentItem); + for (int id : aOreID) { + // Plunger + if (OreDictionary.getOreName(id).equals("craftingToolPlunger")) { + //Logger.INFO("Is Plunger."); + return onPlungerRightClick(aPlayer, aSide, aX, aY, aZ); + } + } + } } } + //Do Super + boolean aSuper = super.onRightclick(aBaseMetaTileEntity, aPlayer, aSide, aX, aY, aZ); return aSuper; } + public boolean onPlungerRightClick(EntityPlayer aPlayer, byte aSide, float aX, float aY, float aZ) { + int aHatchIndex = 0; + PlayerUtils.messagePlayer(aPlayer, "Trying to clear "+mOutputHatches.size()+" output hatches."); + for (GT_MetaTileEntity_Hatch_Output hatch : this.mOutputHatches) { + if (hatch.mFluid != null) { + PlayerUtils.messagePlayer(aPlayer, "Clearing "+hatch.mFluid.amount+"L of "+hatch.mFluid.getLocalizedName()+" from hatch "+aHatchIndex+"."); + hatch.mFluid = null; + } + aHatchIndex++; + } + return aHatchIndex > 0; + } + @Override 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); diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_SteamMultiBase.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_SteamMultiBase.java index 36e68f6438..21b0efff99 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_SteamMultiBase.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_SteamMultiBase.java @@ -290,18 +290,18 @@ public abstract class GregtechMeta_SteamMultiBase extends GregtechMeta_MultiBloc } //Use this to determine the correct value, then update the hatch texture after. - boolean aDidAdd = false; + boolean aDidAdd = false; - //Handle Custom Hustoms - - if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_CustomFluidBase) + if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_CustomFluidBase) { aDidAdd = addToMachineListInternal(mSteamInputFluids, aMetaTileEntity, aBaseCasingIndex); - - else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Steam_BusInput) - aDidAdd = addToMachineListInternal(mSteamInputs, aMetaTileEntity, aBaseCasingIndex); - - else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Steam_BusOutput) + } + else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Steam_BusInput) { + ((GT_MetaTileEntity_Hatch_InputBus) aTileEntity).mRecipeMap = getRecipeMap(); + aDidAdd = addToMachineListInternal(mSteamInputs, aMetaTileEntity, aBaseCasingIndex); + } + else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Steam_BusOutput) { aDidAdd = addToMachineListInternal(mSteamOutputs, aMetaTileEntity, aBaseCasingIndex); + } return aDidAdd; } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/generators/GregtechRocketFuelGeneratorBase.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/generators/GregtechRocketFuelGeneratorBase.java index 885069693d..f9105dceb1 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/generators/GregtechRocketFuelGeneratorBase.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/generators/GregtechRocketFuelGeneratorBase.java @@ -12,7 +12,6 @@ import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Recipe.GT_Recipe_Map; import gregtech.api.util.GT_Utility; import gtPlusPlus.core.lib.CORE; -import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.math.MathUtils; import gtPlusPlus.core.util.minecraft.gregtech.PollutionUtils; import net.minecraft.entity.player.EntityPlayer; @@ -63,16 +62,16 @@ public abstract class GregtechRocketFuelGeneratorBase extends GT_MetaTileEntity_ @Override public String[] getDescription() { - int pollMin = mTier == 4 ? 250 : (mTier == 5 ? 500 : 750); - int pollMax = mTier == 4 ? 2000 : (mTier == 5 ? 4000 : 6000); - String aPollution = "Causes between "+pollMin+" and "+pollMax+ " Pollution per second"; - return new String[]{ - this.mDescription, - "Fuel Efficiency: " + this.getEfficiency() + "%", - aPollution}; + String aPollution = "Causes between "+pollMin+" and "+pollMax+ " Pollution per second"; + return new String[]{ + this.mDescription, + "Fuel Efficiency: " + this.getEfficiency() + "%", + aPollution, + CORE.GT_Tooltip}; } + @Override public boolean onRightclick(final IGregTechTileEntity aBaseMetaTileEntity, final EntityPlayer aPlayer) { if (aBaseMetaTileEntity.isClientSide()) { @@ -199,8 +198,8 @@ public abstract class GregtechRocketFuelGeneratorBase extends GT_MetaTileEntity_ @Override public void onPostTick(final IGregTechTileEntity aBaseMetaTileEntity, final long aTick) { - - + + //super.onPostTick(aBaseMetaTileEntity, aTick); /*if (aBaseMetaTileEntity.isServerSide() && aBaseMetaTileEntity.isAllowedToWork() && aTick % 10L == 0L) { @@ -251,9 +250,9 @@ public abstract class GregtechRocketFuelGeneratorBase extends GT_MetaTileEntity_ .getUniversalEnergyStored() >= this.maxEUOutput() + this.getMinimumStoredEU()); }*/ - - - + + + if (aBaseMetaTileEntity.isServerSide() && aBaseMetaTileEntity.isAllowedToWork() && ((aTick % 10) == 0)) { if (this.mFluid == null) { if (aBaseMetaTileEntity.getUniversalEnergyStored() < (this.maxEUOutput() + this.getMinimumStoredEU())) { diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/nbthandlers/GT_MetaTileEntity_Hatch_Catalysts.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/nbthandlers/GT_MetaTileEntity_Hatch_Catalysts.java index ea74e650dd..5e0918059d 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/nbthandlers/GT_MetaTileEntity_Hatch_Catalysts.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/nbthandlers/GT_MetaTileEntity_Hatch_Catalysts.java @@ -3,6 +3,7 @@ package gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.nbthandlers; 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; @@ -30,6 +31,13 @@ public class GT_MetaTileEntity_Hatch_Catalysts extends GT_MetaTileEntity_Hatch_N public ITexture[] getTexturesInactive(ITexture aBaseTexture) { return new ITexture[]{aBaseTexture, new GT_RenderedTexture(TexturesGtBlock.Overlay_Bus_Catalyst)}; } + + @Override + public String[] getDescription() { + return new String[]{ + this.mDescription, + CORE.GT_Tooltip}; + } @Override public boolean isFacingValid(byte aFacing) { diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/nbthandlers/GT_MetaTileEntity_Hatch_MillingBalls.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/nbthandlers/GT_MetaTileEntity_Hatch_MillingBalls.java index 6c28ab2e27..7514855a2c 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/nbthandlers/GT_MetaTileEntity_Hatch_MillingBalls.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/nbthandlers/GT_MetaTileEntity_Hatch_MillingBalls.java @@ -3,6 +3,7 @@ package gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.nbthandlers; 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; @@ -30,6 +31,13 @@ public class GT_MetaTileEntity_Hatch_MillingBalls extends GT_MetaTileEntity_Hatc public ITexture[] getTexturesInactive(ITexture aBaseTexture) { return new ITexture[]{aBaseTexture, new GT_RenderedTexture(TexturesGtBlock.Overlay_Bus_Milling_Balls)}; } + + @Override + public String[] getDescription() { + return new String[]{ + this.mDescription, + CORE.GT_Tooltip}; + } @Override public boolean isFacingValid(byte aFacing) { diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks5.java b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks5.java index 832ee2b56e..c594ee0e5d 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks5.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks5.java @@ -18,7 +18,7 @@ import net.minecraft.world.IBlockAccess; public class GregtechMetaCasingBlocks5 extends GregtechMetaCasingBlocksAbstract { - //84, 90, 91, 92, 94, 114, 116, 117, 118, 119, 120, 121, 124, 125, 126, 127 + //Free Indexes within TAE: 90, 91, 92, 94, 114, 116, 117, 118, 119, 120, 121, 124, 125, 126, 127 private static final TexturesGrinderMultiblock mGrinderOverlayHandler = new TexturesGrinderMultiblock(); public GregtechMetaCasingBlocks5() { @@ -29,7 +29,8 @@ extends GregtechMetaCasingBlocksAbstract { 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 GT_CopiedBlockTexture(this, 6, 3)); - GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".4.name", ""); // Unused + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".4.name", "Sparge Tower Exterior Casing"); // Sparge Tower Casing + TAE.registerTexture(0, 4, new GT_CopiedBlockTexture(this, 6, 4)); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".5.name", ""); // Unused GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".6.name", ""); // Unused GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".7.name", ""); // Unused @@ -45,7 +46,8 @@ extends GregtechMetaCasingBlocksAbstract { GregtechItemList.Casing_IsaMill_Casing.set(new ItemStack(this, 1, 0)); GregtechItemList.Casing_IsaMill_Pipe.set(new ItemStack(this, 1, 1)); GregtechItemList.Casing_IsaMill_Gearbox.set(new ItemStack(this, 1, 2)); - GregtechItemList.Casing_ElementalDuplicator.set(new ItemStack(this, 1, 2)); + GregtechItemList.Casing_ElementalDuplicator.set(new ItemStack(this, 1, 3)); + GregtechItemList.Casing_Sparge_Tower_Exterior.set(new ItemStack(this, 1, 4)); } @Override @@ -65,6 +67,8 @@ extends GregtechMetaCasingBlocksAbstract { return TexturesGtBlock.TEXTURE_GEARBOX_GRINDING_MILL.getIcon(); case 3: return TexturesGtBlock.TEXTURE_TECH_PANEL_D.getIcon(); + case 4: + return TexturesGtBlock.Casing_Machine_Metal_Sheet_H.getIcon(); } } return Textures.BlockIcons.RENDERING_ERROR.getIcon(); diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaSpecialMultiCasings.java b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaSpecialMultiCasings.java index a4a396e4cf..5a5c923d10 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaSpecialMultiCasings.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaSpecialMultiCasings.java @@ -64,7 +64,8 @@ public class GregtechMetaSpecialMultiCasings extends GregtechMetaCasingBlocksAbs GregtechItemList.Casing_SolarTower_Structural.set(new ItemStack(this, 1, 6)); GregtechItemList.Casing_SolarTower_SaltContainment.set(new ItemStack(this, 1, 7)); GregtechItemList.Casing_SolarTower_HeatContainment.set(new ItemStack(this, 1, 8)); - GregtechItemList.Casing_Reinforced_Engine_Casing.set(new ItemStack(this, 1, 9)); + GregtechItemList.Casing_Flotation_Cell.set(new ItemStack(this, 1, 9)); + GregtechItemList.Casing_Reinforced_Engine_Casing.set(new ItemStack(this, 1, 10)); } public IIcon getIcon(int aSide, int aMeta) { diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtBlock.java b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtBlock.java index d4221f064a..518ffe0eae 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtBlock.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtBlock.java @@ -276,6 +276,26 @@ public class TexturesGtBlock { public static final CustomIcon Casing_Machine_Metal_Sheet_A = Internal_Casing_Machine_Metal_Sheet_A; private static final CustomIcon Internal_Casing_Machine_Metal_Sheet_B = new CustomIcon("chrono/MetalSheet2"); public static final CustomIcon Casing_Machine_Metal_Sheet_B = Internal_Casing_Machine_Metal_Sheet_B; + private static final CustomIcon Internal_Casing_Machine_Metal_Sheet_C = new CustomIcon("chrono/MetalSheet3"); + public static final CustomIcon Casing_Machine_Metal_Sheet_C = Internal_Casing_Machine_Metal_Sheet_C; + private static final CustomIcon Internal_Casing_Machine_Metal_Sheet_D = new CustomIcon("chrono/MetalSheet4"); + public static final CustomIcon Casing_Machine_Metal_Sheet_D = Internal_Casing_Machine_Metal_Sheet_D; + private static final CustomIcon Internal_Casing_Machine_Metal_Sheet_E = new CustomIcon("chrono/MetalSheet5"); + public static final CustomIcon Casing_Machine_Metal_Sheet_E = Internal_Casing_Machine_Metal_Sheet_E; + private static final CustomIcon Internal_Casing_Machine_Metal_Sheet_F = new CustomIcon("chrono/MetalSheet6"); + public static final CustomIcon Casing_Machine_Metal_Sheet_F = Internal_Casing_Machine_Metal_Sheet_F; + private static final CustomIcon Internal_Casing_Machine_Metal_Sheet_G = new CustomIcon("chrono/MetalSheet7"); + public static final CustomIcon Casing_Machine_Metal_Sheet_G = Internal_Casing_Machine_Metal_Sheet_G; + private static final CustomIcon Internal_Casing_Machine_Metal_Sheet_H = new CustomIcon("chrono/MetalSheet8"); + public static final CustomIcon Casing_Machine_Metal_Sheet_H = Internal_Casing_Machine_Metal_Sheet_H; + private static final CustomIcon Internal_Casing_Machine_Metal_Sheet_I = new CustomIcon("chrono/MetalSheet9"); + public static final CustomIcon Casing_Machine_Metal_Sheet_I = Internal_Casing_Machine_Metal_Sheet_I; + private static final CustomIcon Internal_Casing_Machine_Metal_Sheet_J = new CustomIcon("chrono/MetalSheet10"); + public static final CustomIcon Casing_Machine_Metal_Sheet_J = Internal_Casing_Machine_Metal_Sheet_J; + private static final CustomIcon Internal_Casing_Machine_Metal_Sheet_K = new CustomIcon("chrono/MetalSheet11"); + public static final CustomIcon Casing_Machine_Metal_Sheet_K = Internal_Casing_Machine_Metal_Sheet_K; + private static final CustomIcon Internal_Casing_Machine_Metal_Sheet_L = new CustomIcon("chrono/MetalSheet12"); + public static final CustomIcon Casing_Machine_Metal_Sheet_L = Internal_Casing_Machine_Metal_Sheet_L; private static final CustomIcon Internal_Overlay_Machine_Cyber_A = new CustomIcon("chrono/CyberPanel"); public static final CustomIcon Overlay_Machine_Cyber_A = Internal_Overlay_Machine_Cyber_A; private static final CustomIcon Internal_Overlay_Machine_Cyber_B = new CustomIcon("chrono/CyberPanel2"); @@ -477,6 +497,21 @@ public class TexturesGtBlock { 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"); //Overlay Arrays diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/helpers/VolumetricFlaskHelper.java b/src/Java/gtPlusPlus/xmod/gregtech/common/helpers/VolumetricFlaskHelper.java index 84bb52d064..575e094696 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/helpers/VolumetricFlaskHelper.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/helpers/VolumetricFlaskHelper.java @@ -152,6 +152,26 @@ public class VolumetricFlaskHelper { nbt.setInteger("Capacity", aCapacity); return true; } + + public static int fillFlask(ItemStack stack, FluidStack resource, boolean doFill) { + if (stack.stackSize != 1) + return 0; + if ((resource == null) || (resource.amount <= 0)) { + return 0; + } + FluidStack fluidStack = getFlaskFluid(stack); + if (fluidStack == null) { + fluidStack = new FluidStack(resource, 0); + } else if (!fluidStack.isFluidEqual(resource)) { + return 0; + } + int amount = Math.min(getMaxFlaskCapacity(stack) - fluidStack.amount, resource.amount); + if ((doFill) && (amount > 0)) { + fluidStack.amount += amount; + setFluid(stack, fluidStack); + } + return amount; + } public static Item generateNewFlask(String unlocalized, String english, int maxCapacity) { Constructor aFlask = ReflectionUtils.getConstructor(sClassVolumetricFlask, new Class[] {String.class, String.class, int.class}); diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/items/MetaGeneratedGregtechTools.java b/src/Java/gtPlusPlus/xmod/gregtech/common/items/MetaGeneratedGregtechTools.java index bc11cb6a11..14100d1599 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/items/MetaGeneratedGregtechTools.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/items/MetaGeneratedGregtechTools.java @@ -10,7 +10,7 @@ import gregtech.api.objects.GT_HashSet; import gregtech.api.objects.GT_ItemStack; import gtPlusPlus.core.util.reflect.ReflectionUtils; import gtPlusPlus.xmod.gregtech.api.enums.GregtechToolDictNames; -import gtPlusPlus.xmod.gregtech.common.tools.TOOL_Gregtech_AngelGrinder; +import gtPlusPlus.xmod.gregtech.common.tools.TOOL_Gregtech_AngleGrinder; 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; @@ -47,7 +47,7 @@ public class MetaGeneratedGregtechTools extends GT_MetaGenerated_Tool { // Electric File this.addTool(ANGLE_GRINDER, "Angle Grinder", "Hand-held electric filing device", - new TOOL_Gregtech_AngelGrinder(), + 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), diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/GT_MetaTileEntity_TesseractGenerator.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/GT_MetaTileEntity_TesseractGenerator.java index c97723b042..9c856840b0 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/GT_MetaTileEntity_TesseractGenerator.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/GT_MetaTileEntity_TesseractGenerator.java @@ -629,7 +629,8 @@ public class GT_MetaTileEntity_TesseractGenerator extends GT_MetaTileEntity_Basi "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", }; + "Consumes "+TESSERACT_ENERGY_COST_DIMENSIONAL+"EU/t for cross dimensional transfers", + CORE.GT_Tooltip}; } @Override diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/GT_MetaTileEntity_TesseractTerminal.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/GT_MetaTileEntity_TesseractTerminal.java index ed8b2db41f..088a596410 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/GT_MetaTileEntity_TesseractTerminal.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/GT_MetaTileEntity_TesseractTerminal.java @@ -498,7 +498,8 @@ public class GT_MetaTileEntity_TesseractTerminal extends GT_MetaTileEntity_Basic "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", }; + "Consumes "+TESSERACT_ENERGY_COST_DIMENSIONAL+"EU/t for cross dimensional transfers", + CORE.GT_Tooltip}; } @Override diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_Boiler_Base.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_Boiler_Base.java index b38cff5e19..4173489be6 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_Boiler_Base.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_Boiler_Base.java @@ -46,7 +46,8 @@ public class GT_MetaTileEntity_Boiler_Base extends GT_MetaTileEntity_Boiler { "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" + "Doesn't explode if there's no water", + CORE.GT_Tooltip }; } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_Boiler_Solar.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_Boiler_Solar.java index babba5afe9..f9cf904cc2 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_Boiler_Solar.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_Boiler_Solar.java @@ -1,5 +1,6 @@ package gtPlusPlus.xmod.gregtech.common.tileentities.generators; +import gtPlusPlus.core.lib.CORE; import gtPlusPlus.xmod.gregtech.api.gui.CONTAINER_AdvancedBoiler; import gtPlusPlus.xmod.gregtech.api.gui.GUI_AdvancedBoiler; import net.minecraft.entity.player.InventoryPlayer; @@ -29,6 +30,14 @@ extends GT_MetaTileEntity_Boiler { 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}; + } @Override public ITexture[][][] getTextureSet(final ITexture[] aTextures) { diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_RfConvertor.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_RfConvertor.java index 08356dd6ef..c6f368f0c0 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_RfConvertor.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_RfConvertor.java @@ -54,7 +54,11 @@ public class GT_MetaTileEntity_RfConvertor extends GregtechMetaEnergyBuffer impl @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"}; + 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 diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_SemiFluidGenerator.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_SemiFluidGenerator.java index 1ace02ce3a..d1628bdb59 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_SemiFluidGenerator.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_SemiFluidGenerator.java @@ -67,7 +67,11 @@ 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() + "%"}; + return new String[]{ + this.mDescription, + "Produces "+(this.getPollution())+" pollution/sec", + "Fuel Efficiency: "+this.getEfficiency() + "%", + CORE.GT_Tooltip}; } @Override diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntityDoubleFuelGeneratorBase.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntityDoubleFuelGeneratorBase.java index facba4fb57..2a0133245e 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntityDoubleFuelGeneratorBase.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntityDoubleFuelGeneratorBase.java @@ -14,7 +14,7 @@ import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.util.GT_ModHandler; 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; @@ -32,6 +32,15 @@ extends GregtechRocketFuelGeneratorBase { 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 + }; + } @Override public boolean isOutputFacing(final byte aSide) { diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntityGeothermalGenerator.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntityGeothermalGenerator.java index a3c882a4af..a392ae5a58 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntityGeothermalGenerator.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntityGeothermalGenerator.java @@ -38,8 +38,12 @@ extends GT_MetaTileEntity_BasicGenerator @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}; + 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}; } @Override diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntitySolarGenerator.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntitySolarGenerator.java index 1d1c4fbfab..68dbc4fb61 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntitySolarGenerator.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntitySolarGenerator.java @@ -13,6 +13,7 @@ import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.objects.GT_RenderedTexture; import gtPlusPlus.api.objects.Logger; +import gtPlusPlus.core.lib.CORE; import gtPlusPlus.xmod.gregtech.api.gui.CONTAINER_SolarGenerator; import gtPlusPlus.xmod.gregtech.api.gui.GUI_SolarGenerator; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.generators.GregtechMetaSolarGenerator; @@ -28,6 +29,15 @@ public class GregtechMetaTileEntitySolarGenerator extends GregtechMetaSolarGener 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 + }; + } @Override public boolean isOutputFacing(final byte aSide) { diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntity_RTG.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntity_RTG.java index 14417cb921..ab000b98d4 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntity_RTG.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntity_RTG.java @@ -173,6 +173,7 @@ public class GregtechMetaTileEntity_RTG extends GT_MetaTileEntity_BasicGenerator "RTG changes output voltage depending on fuel", "Generates power at " + this.getEfficiency() + "% Efficiency per tick", "Output Voltage: "+this.getOutputTier()+" EU/t", + CORE.GT_Tooltip }; } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/ULV/GT_MetaTileEntity_ULV_CombustionGenerator.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/ULV/GT_MetaTileEntity_ULV_CombustionGenerator.java index b92a9ce06b..58919f0954 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/ULV/GT_MetaTileEntity_ULV_CombustionGenerator.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/ULV/GT_MetaTileEntity_ULV_CombustionGenerator.java @@ -1,11 +1,14 @@ package gtPlusPlus.xmod.gregtech.common.tileentities.generators.ULV; +import static gregtech.api.enums.GT_Values.V; + import gregtech.api.GregTech_API; import gregtech.api.enums.ConfigCategories; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; 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) { @@ -15,8 +18,22 @@ public class GT_MetaTileEntity_ULV_CombustionGenerator extends GT_MetaTileEntity 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}; + } @Override + public long maxEUStore() { + return Math.max(getEUVar(), V[1] * 80L + getMinimumStoredEU()); + } + + @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new GT_MetaTileEntity_ULV_CombustionGenerator(this.mName, this.mTier, this.mDescription, this.mTextures); } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/ULV/GT_MetaTileEntity_ULV_GasTurbine.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/ULV/GT_MetaTileEntity_ULV_GasTurbine.java index c53436b059..17bb4463c4 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/ULV/GT_MetaTileEntity_ULV_GasTurbine.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/ULV/GT_MetaTileEntity_ULV_GasTurbine.java @@ -1,5 +1,7 @@ package gtPlusPlus.xmod.gregtech.common.tileentities.generators.ULV; +import static gregtech.api.enums.GT_Values.V; + import gregtech.api.GregTech_API; import gregtech.api.enums.ConfigCategories; import gregtech.api.interfaces.IIconContainer; @@ -8,7 +10,7 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.objects.GT_RenderedTexture; import gregtech.common.tileentities.generators.GT_MetaTileEntity_GasTurbine; - +import gtPlusPlus.core.lib.CORE; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; public class GT_MetaTileEntity_ULV_GasTurbine extends GT_MetaTileEntity_GasTurbine { @@ -19,6 +21,20 @@ public class GT_MetaTileEntity_ULV_GasTurbine extends GT_MetaTileEntity_GasTurbi public GT_MetaTileEntity_ULV_GasTurbine(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}; + } + + @Override + public long maxEUStore() { + return Math.max(getEUVar(), V[1] * 80L + getMinimumStoredEU()); + } public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new GT_MetaTileEntity_ULV_GasTurbine(this.mName, this.mTier, this.mDescription, this.mTextures); diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/ULV/GT_MetaTileEntity_ULV_SteamTurbine.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/ULV/GT_MetaTileEntity_ULV_SteamTurbine.java index 11bdc01823..ef3310c6fc 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/ULV/GT_MetaTileEntity_ULV_SteamTurbine.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/ULV/GT_MetaTileEntity_ULV_SteamTurbine.java @@ -1,15 +1,16 @@ package gtPlusPlus.xmod.gregtech.common.tileentities.generators.ULV; +import static gregtech.api.enums.GT_Values.V; + import gregtech.api.GregTech_API; import gregtech.api.enums.ConfigCategories; -import gregtech.api.enums.Textures; import gregtech.api.interfaces.IIconContainer; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.objects.GT_RenderedTexture; import gregtech.common.tileentities.generators.GT_MetaTileEntity_SteamTurbine; - +import gtPlusPlus.core.lib.CORE; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; public class GT_MetaTileEntity_ULV_SteamTurbine extends GT_MetaTileEntity_SteamTurbine { @@ -20,7 +21,20 @@ public class GT_MetaTileEntity_ULV_SteamTurbine extends GT_MetaTileEntity_SteamT public GT_MetaTileEntity_ULV_SteamTurbine(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}; + } + @Override + public long maxEUStore() { + return Math.max(getEUVar(), V[1] * 80L + getMinimumStoredEU()); + } public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new GT_MetaTileEntity_ULV_SteamTurbine(this.mName, this.mTier, this.mDescription, this.mTextures); diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/creative/GregtechMetaCreativeEnergyBuffer.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/creative/GregtechMetaCreativeEnergyBuffer.java index faaabbd159..a62a5d16c8 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/creative/GregtechMetaCreativeEnergyBuffer.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/creative/GregtechMetaCreativeEnergyBuffer.java @@ -49,7 +49,11 @@ public class GregtechMetaCreativeEnergyBuffer extends GregtechMetaEnergyBuffer { @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"}; + 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}; } /* diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaCondensor.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaCondensor.java index 78b7e40f01..0f7edd062d 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaCondensor.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaCondensor.java @@ -34,7 +34,7 @@ public class GregtechMetaCondensor extends GregtechMetaBoilerBase{ @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.", }; + 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 diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaGarbageCollector.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaGarbageCollector.java index 0a65db7be4..88658c399d 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaGarbageCollector.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaGarbageCollector.java @@ -32,7 +32,12 @@ 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"}; + 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 diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaPollutionCreator.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaPollutionCreator.java index 4e5c296629..5f55e080ad 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaPollutionCreator.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaPollutionCreator.java @@ -39,7 +39,7 @@ public class GregtechMetaPollutionCreator extends GregtechMetaTileEntity { @Override public String[] getDescription() { - return new String[] {this.mDescription, "A useful debug machine to create pollution."}; + return new String[] {this.mDescription, "A useful debug machine to create pollution.", CORE.GT_Tooltip}; } @Override diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaPollutionDetector.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaPollutionDetector.java index 78f60f13c9..10319f2269 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaPollutionDetector.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaPollutionDetector.java @@ -43,7 +43,8 @@ public class GregtechMetaPollutionDetector extends GregtechMetaTileEntity { 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."}; + "Does not use power.", + CORE.GT_Tooltip}; } @Override diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_BasicWasher.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_BasicWasher.java index 01944c6ce5..99b3faa7d4 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_BasicWasher.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_BasicWasher.java @@ -7,6 +7,7 @@ import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine; import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.util.GT_Recipe; +import gtPlusPlus.core.lib.CORE; import gregtech.api.util.GTPP_Recipe; import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.FluidStack; @@ -39,7 +40,7 @@ public class GregtechMetaTileEntity_BasicWasher extends GT_MetaTileEntity_BasicM @Override public String[] getDescription() { - return new String[]{this.mDescription, "Grants no byproducts, but it is fast.", }; + return new String[]{this.mDescription, "Grants no byproducts, but it is fast.", CORE.GT_Tooltip}; } @Override diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_ChemicalReactor.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_ChemicalReactor.java index 7505c721f4..c872e5c912 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_ChemicalReactor.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_ChemicalReactor.java @@ -69,7 +69,7 @@ public class GregtechMetaTileEntity_ChemicalReactor extends GT_MetaTileEntity_Ba @Override public String[] getDescription() { - return new String[]{this.mDescription, "Because why not?", }; + return new String[]{this.mDescription, "Because why not?", CORE.GT_Tooltip}; } @Override diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_PocketFusion.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_PocketFusion.java index cf9ab2b7e3..6cae58ced2 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_PocketFusion.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_PocketFusion.java @@ -55,7 +55,7 @@ public class GregtechMetaTileEntity_PocketFusion extends GT_MetaTileEntity_Delux 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." }; + "Front & Back are Input Plasma 1.", "Sides are Input Plasma 2.", CORE.GT_Tooltip }; } @Override diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_ReactorColdTrap.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_ReactorColdTrap.java new file mode 100644 index 0000000000..85e2df42c9 --- /dev/null +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_ReactorColdTrap.java @@ -0,0 +1,67 @@ +package gtPlusPlus.xmod.gregtech.common.tileentities.machines.basic; + +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.MetaTileEntity; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine; +import gregtech.api.objects.GT_RenderedTexture; +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) + } + ); + } + + public GregtechMetaTileEntity_ReactorColdTrap(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, "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); + } + + @Override + public GT_Recipe.GT_Recipe_Map getRecipeList() { + return GTPP_Recipe.GTPP_Recipe_Map.sColdTrapRecipes; + } + + @Override + public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { + return (super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack)) && (getRecipeList().containsInput(aStack)); + } + + @Override + public boolean isFluidInputAllowed(FluidStack aFluid) { + return super.isFluidInputAllowed(aFluid); + } + + @Override + public int getCapacity() { + return 16000 * Math.max(1, this.mTier); + } + +} diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_ReactorProcessingUnit.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_ReactorProcessingUnit.java new file mode 100644 index 0000000000..60e2ec8c0a --- /dev/null +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_ReactorProcessingUnit.java @@ -0,0 +1,67 @@ +package gtPlusPlus.xmod.gregtech.common.tileentities.machines.basic; + +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.MetaTileEntity; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine; +import gregtech.api.objects.GT_RenderedTexture; +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 { + + public GregtechMetaTileEntity_ReactorProcessingUnit(int aID, String aName, String aNameRegional, int aTier) { + super(aID, aName, aNameRegional, aTier, 1, + "Processes Nuclear things", 2, 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) + } + ); + } + + public GregtechMetaTileEntity_ReactorProcessingUnit(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, 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); + } + + @Override + public GT_Recipe.GT_Recipe_Map getRecipeList() { + return GTPP_Recipe.GTPP_Recipe_Map.sReactorProcessingUnitRecipes; + } + + @Override + public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { + return (super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack)) && (getRecipeList().containsInput(aStack)); + } + + @Override + public boolean isFluidInputAllowed(FluidStack aFluid) { + return super.isFluidInputAllowed(aFluid); + } + + @Override + public int getCapacity() { + return 8000 * Math.max(1, this.mTier); + } + +} diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaWirelessCharger.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaWirelessCharger.java index 8e4b9ff79c..ffaa77a0be 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaWirelessCharger.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaWirelessCharger.java @@ -48,6 +48,7 @@ public class GregtechMetaWirelessCharger extends GregtechMetaTileEntity { "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 }; } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/misc/GMTE_AmazonPackager.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/misc/GMTE_AmazonPackager.java index bdd49eb803..b8f24d6c5e 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/misc/GMTE_AmazonPackager.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/misc/GMTE_AmazonPackager.java @@ -98,20 +98,15 @@ public class GMTE_AmazonPackager extends GregtechMeta_MultiBlockBase { } else { IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputBus){ - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mInputBusses.add((GT_MetaTileEntity_Hatch_InputBus)aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Maintenance){ - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mMaintenanceHatches.add((GT_MetaTileEntity_Hatch_Maintenance)aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Energy){ - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mEnergyHatches.add((GT_MetaTileEntity_Hatch_Energy)aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_OutputBus) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mOutputBusses.add((GT_MetaTileEntity_Hatch_OutputBus) aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Muffler) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mMufflerHatches.add((GT_MetaTileEntity_Hatch_Muffler) aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } } return false; diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialAlloySmelter.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialAlloySmelter.java index 9b978d9a01..df01d01679 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialAlloySmelter.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialAlloySmelter.java @@ -28,6 +28,7 @@ import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; 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 net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; @@ -126,7 +127,7 @@ public class GregtechMetaTileEntity_IndustrialAlloySmelter extends GregtechMeta_ .addEnergyHatch("Any Inconel Reinforced Casing", 1) .addMaintenanceHatch("Any Inconel Reinforced Casing", 1) .addMufflerHatch("Any Inconel Reinforced Casing", 1) - .toolTipFinisher("GT++"); + .toolTipFinisher(CORE.GT_Tooltip_Builder); return tt; } @@ -178,20 +179,15 @@ public class GregtechMetaTileEntity_IndustrialAlloySmelter extends GregtechMeta_ } else { IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputBus){ - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mInputBusses.add((GT_MetaTileEntity_Hatch_InputBus)aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Maintenance){ - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mMaintenanceHatches.add((GT_MetaTileEntity_Hatch_Maintenance)aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Energy){ - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mEnergyHatches.add((GT_MetaTileEntity_Hatch_Energy)aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_OutputBus) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mOutputBusses.add((GT_MetaTileEntity_Hatch_OutputBus) aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Muffler) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mMufflerHatches.add((GT_MetaTileEntity_Hatch_Muffler) aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } } return false; diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialArcFurnace.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialArcFurnace.java index f51e8b3ee2..35a92d5be3 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialArcFurnace.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialArcFurnace.java @@ -85,7 +85,7 @@ extends GregtechMeta_MultiBlockBase { .addEnergyHatch("Any Casing", 1) .addMaintenanceHatch("Any Casing", 1) .addMufflerHatch("Any Casing", 1) - .toolTipFinisher("GT++"); + .toolTipFinisher(CORE.GT_Tooltip_Builder); return tt; } @@ -143,26 +143,19 @@ extends GregtechMeta_MultiBlockBase { } else { IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputBus){ - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mInputBusses.add((GT_MetaTileEntity_Hatch_InputBus)aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Maintenance){ - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mMaintenanceHatches.add((GT_MetaTileEntity_Hatch_Maintenance)aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Energy){ - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mEnergyHatches.add((GT_MetaTileEntity_Hatch_Energy)aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_OutputBus) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mOutputBusses.add((GT_MetaTileEntity_Hatch_OutputBus) aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Muffler) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mMufflerHatches.add((GT_MetaTileEntity_Hatch_Muffler) aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mInputHatches.add((GT_MetaTileEntity_Hatch_Input) aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Output) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mOutputHatches.add((GT_MetaTileEntity_Hatch_Output) aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } } return false; diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialCentrifuge.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialCentrifuge.java index 8ffdbc7efe..8802a7148b 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialCentrifuge.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialCentrifuge.java @@ -83,7 +83,7 @@ extends GregtechMeta_MultiBlockBase { .addEnergyHatch("Any Casing except front", 1) .addMaintenanceHatch("Any Casing except front", 1) .addMufflerHatch("Any Casing except front", 1) - .toolTipFinisher("GT++"); + .toolTipFinisher(CORE.GT_Tooltip_Builder); return tt; } @@ -132,26 +132,19 @@ extends GregtechMeta_MultiBlockBase { } else { IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputBus){ - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mInputBusses.add((GT_MetaTileEntity_Hatch_InputBus)aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Maintenance){ - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mMaintenanceHatches.add((GT_MetaTileEntity_Hatch_Maintenance)aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Energy){ - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mEnergyHatches.add((GT_MetaTileEntity_Hatch_Energy)aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_OutputBus) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mOutputBusses.add((GT_MetaTileEntity_Hatch_OutputBus) aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Muffler) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mMufflerHatches.add((GT_MetaTileEntity_Hatch_Muffler) aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mInputHatches.add((GT_MetaTileEntity_Hatch_Input) aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Output) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mOutputHatches.add((GT_MetaTileEntity_Hatch_Output) aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } } return false; diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialCokeOven.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialCokeOven.java index d1c766968f..21caf135b1 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialCokeOven.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialCokeOven.java @@ -72,7 +72,7 @@ extends GregtechMeta_MultiBlockBase { .addEnergyHatch("Any Casing", 1) .addMaintenanceHatch("Any Casing", 1) .addMufflerHatch("Any Casing", 1) - .toolTipFinisher("GT++"); + .toolTipFinisher(CORE.GT_Tooltip_Builder); return tt; } @@ -146,26 +146,19 @@ extends GregtechMeta_MultiBlockBase { } else { IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputBus){ - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mInputBusses.add((GT_MetaTileEntity_Hatch_InputBus)aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Maintenance){ - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mMaintenanceHatches.add((GT_MetaTileEntity_Hatch_Maintenance)aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Energy){ - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mEnergyHatches.add((GT_MetaTileEntity_Hatch_Energy)aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_OutputBus) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mOutputBusses.add((GT_MetaTileEntity_Hatch_OutputBus) aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Muffler) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mMufflerHatches.add((GT_MetaTileEntity_Hatch_Muffler) aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mInputHatches.add((GT_MetaTileEntity_Hatch_Input) aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Output) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mOutputHatches.add((GT_MetaTileEntity_Hatch_Output) aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } } return false; diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialCuttingMachine.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialCuttingMachine.java index 6c025a1177..bf5f8aaeaf 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialCuttingMachine.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialCuttingMachine.java @@ -71,7 +71,7 @@ extends GregtechMeta_MultiBlockBase { .addEnergyHatch("Any Casing", 1) .addMaintenanceHatch("Any Casing", 1) .addMufflerHatch("Any Casing", 1) - .toolTipFinisher("GT++"); + .toolTipFinisher(CORE.GT_Tooltip_Builder); return tt; } @@ -120,23 +120,17 @@ extends GregtechMeta_MultiBlockBase { } else { IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputBus){ - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mInputBusses.add((GT_MetaTileEntity_Hatch_InputBus)aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Maintenance){ - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mMaintenanceHatches.add((GT_MetaTileEntity_Hatch_Maintenance)aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Energy){ - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mEnergyHatches.add((GT_MetaTileEntity_Hatch_Energy)aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_OutputBus) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mOutputBusses.add((GT_MetaTileEntity_Hatch_OutputBus) aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Muffler) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mMufflerHatches.add((GT_MetaTileEntity_Hatch_Muffler) aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mInputHatches.add((GT_MetaTileEntity_Hatch_Input) aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } } return false; diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialDehydrator.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialDehydrator.java index 9786cf8ea6..44552ea2f7 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialDehydrator.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialDehydrator.java @@ -28,6 +28,7 @@ import gregtech.api.util.GT_Utility; import gregtech.api.util.GTPP_Recipe; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.block.ModBlocks; +import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.minecraft.ItemUtils; import gtPlusPlus.core.util.minecraft.PlayerUtils; @@ -89,7 +90,7 @@ public class GregtechMetaTileEntity_IndustrialDehydrator extends GregtechMeta_Mu .addEnergyHatch("Any Casing", 1) .addMaintenanceHatch("Any Casing", 1) .addMufflerHatch("Any Casing", 1) - .toolTipFinisher("GT++"); + .toolTipFinisher(CORE.GT_Tooltip_Builder); return tt; } @@ -147,26 +148,19 @@ public class GregtechMetaTileEntity_IndustrialDehydrator extends GregtechMeta_Mu } else { IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputBus){ - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mInputBusses.add((GT_MetaTileEntity_Hatch_InputBus)aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Maintenance){ - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mMaintenanceHatches.add((GT_MetaTileEntity_Hatch_Maintenance)aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Energy){ - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mEnergyHatches.add((GT_MetaTileEntity_Hatch_Energy)aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_OutputBus) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mOutputBusses.add((GT_MetaTileEntity_Hatch_OutputBus) aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Muffler) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mMufflerHatches.add((GT_MetaTileEntity_Hatch_Muffler) aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mInputHatches.add((GT_MetaTileEntity_Hatch_Input) aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Output) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mOutputHatches.add((GT_MetaTileEntity_Hatch_Output) aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } } return false; diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialElectrolyzer.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialElectrolyzer.java index ebeeb93658..f6613980ca 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialElectrolyzer.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialElectrolyzer.java @@ -66,7 +66,7 @@ extends GregtechMeta_MultiBlockBase { .addEnergyHatch("Any Casing", 1) .addMaintenanceHatch("Any Casing", 1) .addMufflerHatch("Any Casing", 1) - .toolTipFinisher("GT++"); + .toolTipFinisher(CORE.GT_Tooltip_Builder); return tt; } @@ -115,26 +115,19 @@ extends GregtechMeta_MultiBlockBase { } else { IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputBus){ - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mInputBusses.add((GT_MetaTileEntity_Hatch_InputBus)aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Maintenance){ - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mMaintenanceHatches.add((GT_MetaTileEntity_Hatch_Maintenance)aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Energy){ - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mEnergyHatches.add((GT_MetaTileEntity_Hatch_Energy)aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_OutputBus) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mOutputBusses.add((GT_MetaTileEntity_Hatch_OutputBus) aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Muffler) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mMufflerHatches.add((GT_MetaTileEntity_Hatch_Muffler) aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mInputHatches.add((GT_MetaTileEntity_Hatch_Input) aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Output) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mOutputHatches.add((GT_MetaTileEntity_Hatch_Output) aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } } return false; diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialExtruder.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialExtruder.java index 600004a882..a5c7f62578 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialExtruder.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialExtruder.java @@ -72,7 +72,7 @@ extends GregtechMeta_MultiBlockBase { .addEnergyHatch("Any Casing", 1) .addMaintenanceHatch("Any Casing", 1) .addMufflerHatch("Back Center", 2) - .toolTipFinisher("GT++"); + .toolTipFinisher(CORE.GT_Tooltip_Builder); return tt; } @@ -127,20 +127,15 @@ extends GregtechMeta_MultiBlockBase { } else { IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputBus){ - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mInputBusses.add((GT_MetaTileEntity_Hatch_InputBus)aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Maintenance){ - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mMaintenanceHatches.add((GT_MetaTileEntity_Hatch_Maintenance)aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Energy){ - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mEnergyHatches.add((GT_MetaTileEntity_Hatch_Energy)aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_OutputBus) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mOutputBusses.add((GT_MetaTileEntity_Hatch_OutputBus) aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Muffler) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mMufflerHatches.add((GT_MetaTileEntity_Hatch_Muffler) aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } } return false; diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialMacerator.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialMacerator.java index 73c1587f4f..b6e072b653 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialMacerator.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialMacerator.java @@ -67,7 +67,7 @@ extends GregtechMeta_MultiBlockBase { .addMaintenanceHatch("Bottom Casing", 1) .addOutputBus("One per layer except bottom layer", 2) .addMufflerHatch("Any Casing", 2) - .toolTipFinisher("GT++"); + .toolTipFinisher(CORE.GT_Tooltip_Builder); return tt; } @@ -148,14 +148,11 @@ extends GregtechMeta_MultiBlockBase { } else { IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputBus){ - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mInputBusses.add((GT_MetaTileEntity_Hatch_InputBus)aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Maintenance){ - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mMaintenanceHatches.add((GT_MetaTileEntity_Hatch_Maintenance)aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Energy){ - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mEnergyHatches.add((GT_MetaTileEntity_Hatch_Energy)aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } } return false; @@ -167,11 +164,9 @@ extends GregtechMeta_MultiBlockBase { } else { IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_OutputBus) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mOutputBusses.add((GT_MetaTileEntity_Hatch_OutputBus) aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Muffler) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mMufflerHatches.add((GT_MetaTileEntity_Hatch_Muffler) aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } } return false; diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialMixer.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialMixer.java index 312a982a11..5e405d426d 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialMixer.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialMixer.java @@ -89,7 +89,7 @@ extends GregtechMeta_MultiBlockBase { .addEnergyHatch("Any Casing", 1) .addMaintenanceHatch("Any Casing", 1) .addMufflerHatch("Any Casing", 1) - .toolTipFinisher("GT++"); + .toolTipFinisher(CORE.GT_Tooltip_Builder); return tt; } @@ -145,26 +145,19 @@ extends GregtechMeta_MultiBlockBase { } else { IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputBus){ - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mInputBusses.add((GT_MetaTileEntity_Hatch_InputBus)aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Maintenance){ - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mMaintenanceHatches.add((GT_MetaTileEntity_Hatch_Maintenance)aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Energy){ - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mEnergyHatches.add((GT_MetaTileEntity_Hatch_Energy)aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_OutputBus) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mOutputBusses.add((GT_MetaTileEntity_Hatch_OutputBus) aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Muffler) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mMufflerHatches.add((GT_MetaTileEntity_Hatch_Muffler) aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mInputHatches.add((GT_MetaTileEntity_Hatch_Input) aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Output) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mOutputHatches.add((GT_MetaTileEntity_Hatch_Output) aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } } return false; diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialMultiMachine.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialMultiMachine.java index 232c6ab89f..a0909a4fff 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialMultiMachine.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialMultiMachine.java @@ -23,6 +23,7 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.objects.GT_RenderedTexture; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.block.ModBlocks; +import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.recipe.common.CI; import gtPlusPlus.core.util.minecraft.ItemUtils; import gtPlusPlus.core.util.minecraft.PlayerUtils; @@ -109,7 +110,7 @@ extends GregtechMeta_MultiBlockBase { .addEnergyHatch("Any Casing", 1) .addMaintenanceHatch("Any Casing", 1) .addMufflerHatch("Any Casing", 1) - .toolTipFinisher("GT++"); + .toolTipFinisher(CORE.GT_Tooltip_Builder); return tt; } @@ -158,26 +159,19 @@ extends GregtechMeta_MultiBlockBase { } else { IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputBus){ - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mInputBusses.add((GT_MetaTileEntity_Hatch_InputBus)aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Maintenance){ - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mMaintenanceHatches.add((GT_MetaTileEntity_Hatch_Maintenance)aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Energy){ - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mEnergyHatches.add((GT_MetaTileEntity_Hatch_Energy)aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_OutputBus) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mOutputBusses.add((GT_MetaTileEntity_Hatch_OutputBus) aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Muffler) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mMufflerHatches.add((GT_MetaTileEntity_Hatch_Muffler) aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mInputHatches.add((GT_MetaTileEntity_Hatch_Input) aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Output) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mOutputHatches.add((GT_MetaTileEntity_Hatch_Output) aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } } return false; diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialPlatePress.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialPlatePress.java index 02c123c926..007d1a0d0f 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialPlatePress.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialPlatePress.java @@ -72,7 +72,7 @@ public class GregtechMetaTileEntity_IndustrialPlatePress extends GregtechMeta_Mu .addEnergyHatch("Any Casing", 1) .addMaintenanceHatch("Any Casing", 1) .addMufflerHatch("Any Casing", 1) - .toolTipFinisher("GT++"); + .toolTipFinisher(CORE.GT_Tooltip_Builder); return tt; } @@ -121,20 +121,15 @@ public class GregtechMetaTileEntity_IndustrialPlatePress extends GregtechMeta_Mu } else { IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputBus){ - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mInputBusses.add((GT_MetaTileEntity_Hatch_InputBus)aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Maintenance){ - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mMaintenanceHatches.add((GT_MetaTileEntity_Hatch_Maintenance)aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Energy){ - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mEnergyHatches.add((GT_MetaTileEntity_Hatch_Energy)aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_OutputBus) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mOutputBusses.add((GT_MetaTileEntity_Hatch_OutputBus) aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Muffler) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mMufflerHatches.add((GT_MetaTileEntity_Hatch_Muffler) aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } } return false; diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialSifter.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialSifter.java index e98ea7b3c7..c5450fec5b 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialSifter.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialSifter.java @@ -67,7 +67,7 @@ extends GregtechMeta_MultiBlockBase { .addEnergyHatch("Any Casing", 1) .addMaintenanceHatch("Any Casing", 1) .addMufflerHatch("Any Casing", 1) - .toolTipFinisher("GT++"); + .toolTipFinisher(CORE.GT_Tooltip_Builder); return tt; } @@ -122,20 +122,15 @@ extends GregtechMeta_MultiBlockBase { } else { IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputBus){ - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mInputBusses.add((GT_MetaTileEntity_Hatch_InputBus)aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Maintenance){ - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mMaintenanceHatches.add((GT_MetaTileEntity_Hatch_Maintenance)aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Energy){ - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mEnergyHatches.add((GT_MetaTileEntity_Hatch_Energy)aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_OutputBus) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mOutputBusses.add((GT_MetaTileEntity_Hatch_OutputBus) aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Muffler) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mMufflerHatches.add((GT_MetaTileEntity_Hatch_Muffler) aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } } return false; diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialThermalCentrifuge.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialThermalCentrifuge.java index 5f420a3e9e..01b887694a 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialThermalCentrifuge.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialThermalCentrifuge.java @@ -66,7 +66,7 @@ extends GregtechMeta_MultiBlockBase { .addEnergyHatch("Bottom Casing", 1) .addMaintenanceHatch("Bottom Casing", 1) .addMufflerHatch("Bottom Casing", 1) - .toolTipFinisher("GT++"); + .toolTipFinisher(CORE.GT_Tooltip_Builder); return tt; } @@ -137,20 +137,15 @@ extends GregtechMeta_MultiBlockBase { } else { IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputBus){ - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mInputBusses.add((GT_MetaTileEntity_Hatch_InputBus)aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Maintenance){ - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mMaintenanceHatches.add((GT_MetaTileEntity_Hatch_Maintenance)aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Energy){ - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mEnergyHatches.add((GT_MetaTileEntity_Hatch_Energy)aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_OutputBus) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mOutputBusses.add((GT_MetaTileEntity_Hatch_OutputBus) aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Muffler) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mMufflerHatches.add((GT_MetaTileEntity_Hatch_Muffler) aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } } return false; diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialVacuumFreezer.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialVacuumFreezer.java index f4ab3207eb..1f63995651 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialVacuumFreezer.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialVacuumFreezer.java @@ -99,7 +99,7 @@ public class GregtechMetaTileEntity_IndustrialVacuumFreezer extends GregtechMeta .addEnergyHatch("Any Casing", 1) .addMaintenanceHatch("Any Casing", 1) .addMufflerHatch("Any Casing", 1) - .toolTipFinisher("GT++"); + .toolTipFinisher(CORE.GT_Tooltip_Builder); return tt; } @@ -149,30 +149,22 @@ public class GregtechMetaTileEntity_IndustrialVacuumFreezer extends GregtechMeta } else { IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_CustomFluidBase && aMetaTileEntity.getBaseMetaTileEntity().getMetaTileID() == 967) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); mHaveHatch = true; - return this.mInputHatches.add((GT_MetaTileEntity_Hatch_Input) aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputBus){ - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mInputBusses.add((GT_MetaTileEntity_Hatch_InputBus)aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Maintenance){ - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mMaintenanceHatches.add((GT_MetaTileEntity_Hatch_Maintenance)aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Energy){ - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mEnergyHatches.add((GT_MetaTileEntity_Hatch_Energy)aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_OutputBus) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mOutputBusses.add((GT_MetaTileEntity_Hatch_OutputBus) aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Muffler) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mMufflerHatches.add((GT_MetaTileEntity_Hatch_Muffler) aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mInputHatches.add((GT_MetaTileEntity_Hatch_Input) aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Output) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mOutputHatches.add((GT_MetaTileEntity_Hatch_Output) aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } } return false; diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialWashPlant.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialWashPlant.java index a8df92a5ab..168d4ff6d6 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialWashPlant.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialWashPlant.java @@ -80,7 +80,7 @@ extends GregtechMeta_MultiBlockBase { .addEnergyHatch("Any Casing", 1) .addMaintenanceHatch("Any Casing", 1) .addMufflerHatch("Any Casing", 1) - .toolTipFinisher("GT++"); + .toolTipFinisher(CORE.GT_Tooltip_Builder); return tt; } @@ -129,23 +129,17 @@ extends GregtechMeta_MultiBlockBase { } else { IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputBus){ - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mInputBusses.add((GT_MetaTileEntity_Hatch_InputBus)aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Maintenance){ - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mMaintenanceHatches.add((GT_MetaTileEntity_Hatch_Maintenance)aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Energy){ - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mEnergyHatches.add((GT_MetaTileEntity_Hatch_Energy)aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_OutputBus) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mOutputBusses.add((GT_MetaTileEntity_Hatch_OutputBus) aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Muffler) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mMufflerHatches.add((GT_MetaTileEntity_Hatch_Muffler) aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mInputHatches.add((GT_MetaTileEntity_Hatch_Input) aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } } return false; diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialWireMill.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialWireMill.java index b1ecce7670..ccce25d925 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialWireMill.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialWireMill.java @@ -66,7 +66,7 @@ extends GregtechMeta_MultiBlockBase { .addEnergyHatch("Any Casing", 1) .addMaintenanceHatch("Any Casing", 1) .addMufflerHatch("Any Casing", 1) - .toolTipFinisher("GT++"); + .toolTipFinisher(CORE.GT_Tooltip_Builder); return tt; } @@ -115,20 +115,15 @@ extends GregtechMeta_MultiBlockBase { } else { IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputBus){ - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mInputBusses.add((GT_MetaTileEntity_Hatch_InputBus)aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Maintenance){ - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mMaintenanceHatches.add((GT_MetaTileEntity_Hatch_Maintenance)aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Energy){ - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mEnergyHatches.add((GT_MetaTileEntity_Hatch_Energy)aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_OutputBus) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mOutputBusses.add((GT_MetaTileEntity_Hatch_OutputBus) aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Muffler) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mMufflerHatches.add((GT_MetaTileEntity_Hatch_Muffler) aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } } return false; diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IsaMill.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IsaMill.java index cd76749283..59e6e78757 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IsaMill.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IsaMill.java @@ -31,6 +31,7 @@ import gtPlusPlus.api.objects.data.AutoMap; import gtPlusPlus.api.objects.minecraft.BlockPos; import gtPlusPlus.core.block.ModBlocks; import gtPlusPlus.core.item.chemistry.general.ItemGenericChemBase; +import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.util.math.MathUtils; import gtPlusPlus.core.util.minecraft.EntityUtils; import gtPlusPlus.core.util.minecraft.ItemUtils; @@ -79,16 +80,19 @@ public class GregtechMetaTileEntity_IsaMill extends GregtechMeta_MultiBlockBase .addInfo("Grind ores.") .addPollutionAmount(getPollutionPerSecond(null)) .addSeparator() - .beginStructureBlock(3, 3, 4, false) + .beginStructureBlock(3, 3, 7, false) .addController("Front Center") .addCasingInfo("IsaMill Exterior Casing", 40) - .addCasingInfo("IsaMill Gearbox", 6) + .addOtherStructurePart("IsaMill Gearbox", "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("GT++"); + .toolTipFinisher(CORE.GT_Tooltip_Builder); return tt; } @@ -105,7 +109,7 @@ public class GregtechMetaTileEntity_IsaMill extends GregtechMeta_MultiBlockBase 'C', ofChain( ofHatchAdder( - GregtechMetaTileEntity_IsaMill::addIsaMillList, getCasingTextureIndex(), 1 + GregtechMetaTileEntity_IsaMill::addToMachineList, getCasingTextureIndex(), 1 ), onElementPass( x -> ++x.mCasing, @@ -144,34 +148,6 @@ public class GregtechMetaTileEntity_IsaMill extends GregtechMeta_MultiBlockBase return checkPiece(mName, 1, 1, 0) && mCasing >= 48 - 8 && checkHatch(); } - public final boolean addIsaMillList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { - if (aTileEntity == null) { - return false; - } else { - IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); - if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_MillingBalls){ - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - return addToMachineListInternal(mMillingBallBuses, aMetaTileEntity, aBaseCasingIndex); - } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputBus){ - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mInputBusses.add((GT_MetaTileEntity_Hatch_InputBus)aMetaTileEntity); - } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Maintenance){ - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mMaintenanceHatches.add((GT_MetaTileEntity_Hatch_Maintenance)aMetaTileEntity); - } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Energy){ - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mEnergyHatches.add((GT_MetaTileEntity_Hatch_Energy)aMetaTileEntity); - } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_OutputBus) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mOutputBusses.add((GT_MetaTileEntity_Hatch_OutputBus) aMetaTileEntity); - } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Muffler) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mMufflerHatches.add((GT_MetaTileEntity_Hatch_Muffler) aMetaTileEntity); - } - } - return false; - } - public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing, final byte aColorIndex, final boolean aActive, final boolean aRedstone) { return new ITexture[]{ Textures.BlockIcons.getCasingTextureForId(TAE.GTPP_INDEX(2)), @@ -345,7 +321,7 @@ public class GregtechMetaTileEntity_IsaMill extends GregtechMeta_MultiBlockBase } public byte getIntakeMeta() { - return 0; + return 1; } public Block getGearboxBlock() { @@ -381,7 +357,7 @@ public class GregtechMetaTileEntity_IsaMill extends GregtechMeta_MultiBlockBase } public int getMaxEfficiency(ItemStack aStack) { - return boostEu ? 20000 : 10000; + return 10000; } @Override diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_SpargeTower.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_SpargeTower.java new file mode 100644 index 0000000000..81f8ba9edb --- /dev/null +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_SpargeTower.java @@ -0,0 +1,414 @@ +package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing; + +import static com.gtnewhorizon.structurelib.structure.StructureUtility.isAir; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofChain; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.onElementPass; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose; +import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; + +import java.util.ArrayList; +import java.util.List; + +import com.gtnewhorizon.structurelib.alignment.IAlignmentLimits; +import com.gtnewhorizon.structurelib.structure.IStructureDefinition; +import com.gtnewhorizon.structurelib.structure.StructureDefinition; + +import gregtech.api.enums.Textures; +import gregtech.api.enums.Textures.BlockIcons; +import gregtech.api.gui.GT_GUIContainer_MultiMachine; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Output; +import gregtech.api.render.TextureFactory; +import gregtech.api.util.GTPP_Recipe; +import gregtech.api.util.GTPP_Recipe.GTPP_Recipe_Map; +import gregtech.api.util.GT_Multiblock_Tooltip_Builder; +import gregtech.api.util.GT_Recipe; +import gregtech.api.util.GT_Utility; +import gregtech.api.util.GasSpargingRecipe; +import gregtech.api.util.GasSpargingRecipeMap; +import gtPlusPlus.api.objects.Logger; +import gtPlusPlus.core.block.ModBlocks; +import gtPlusPlus.core.lib.CORE; +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 net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidStack; + +public class GregtechMetaTileEntity_SpargeTower extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_SpargeTower> { + + protected static final String STRUCTURE_PIECE_BASE = "base"; + protected static final String STRUCTURE_PIECE_LAYER = "layer"; + protected static final String STRUCTURE_PIECE_LAYER_HINT = "layerHint"; + protected static final String STRUCTURE_PIECE_TOP_HINT = "topHint"; + private static final IStructureDefinition<GregtechMetaTileEntity_SpargeTower> 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"} + })) + .addElement('b', ofChain( + ofHatchAdder(GregtechMetaTileEntity_SpargeTower::addEnergyInputToMachineList, getCasingIndex(), 1), + ofHatchAdder(GregtechMetaTileEntity_SpargeTower::addInputToMachineList, getCasingIndex(), 1), + ofHatchAdder(GregtechMetaTileEntity_SpargeTower::addMaintenanceToMachineList, getCasingIndex(), 1), + onElementPass(GregtechMetaTileEntity_SpargeTower::onCasingFound, ofBlock(ModBlocks.blockCasings5Misc, 4)) + )) + .addElement('l', ofChain( + ofHatchAdder(GregtechMetaTileEntity_SpargeTower::addEnergyInputToMachineList, getCasingIndex(), 2), + ofHatchAdder(GregtechMetaTileEntity_SpargeTower::addLayerOutputHatch, getCasingIndex(), 2), + ofHatchAdder(GregtechMetaTileEntity_SpargeTower::addMaintenanceToMachineList, getCasingIndex(), 2), + onElementPass(GregtechMetaTileEntity_SpargeTower::onCasingFound, ofBlock(ModBlocks.blockCasings5Misc, 4)) + )) + .addElement('c', ofChain( + onElementPass(t -> t.onTopLayerFound(false), ofHatchAdder(GregtechMetaTileEntity_SpargeTower::addOutputToMachineList, getCasingIndex(), 3)), + onElementPass(t -> t.onTopLayerFound(false), ofHatchAdder(GregtechMetaTileEntity_SpargeTower::addMaintenanceToMachineList, getCasingIndex(), 3)), + onElementPass(t -> t.onTopLayerFound(true), ofBlock(ModBlocks.blockCasings5Misc, 4)), + isAir() + )) + .build(); + + protected final List<List<GT_MetaTileEntity_Hatch_Output>> mOutputHatchesByLayer = new ArrayList<>(); + protected int mHeight; + protected int mCasing; + protected boolean mTopLayerFound; + + public GregtechMetaTileEntity_SpargeTower(int aID, String aName, String aNameRegional) { + super(aID, aName, aNameRegional); + } + + public GregtechMetaTileEntity_SpargeTower(String aName) { + super(aName); + } + + public static int getCasingIndex() { + return 68; + } + + @Override + public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new GregtechMetaTileEntity_SpargeTower(this.mName); + } + + @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") + .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") + .addOtherStructurePart("Sparge Tower Exterior Casing", "45 (minimum)") + .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); + return tt; + } + + @Override + public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { + if (aSide == aFacing) { + if (aActive) + return new ITexture[]{ + BlockIcons.getCasingTextureForId(getCasingIndex()), + TextureFactory.builder().addIcon(TexturesGtBlock.Overlay_Machine_Controller_Advanced_Active).extFacing().build()}; + return new ITexture[]{ + BlockIcons.getCasingTextureForId(getCasingIndex()), + TextureFactory.builder().addIcon(TexturesGtBlock.Overlay_Machine_Controller_Advanced).extFacing().build()}; + } + return new ITexture[]{Textures.BlockIcons.getCasingTextureForId(getCasingIndex())}; + } + + @Override + public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { + return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "DistillationTower.png"); + } + + @Override + public GT_Recipe.GT_Recipe_Map getRecipeMap() { + if (GTPP_Recipe_Map.sSpargeTowerRecipes.mRecipeList.isEmpty()) { + generateRecipes(); + } + return GTPP_Recipe_Map.sSpargeTowerRecipes; + } + + private static boolean generateRecipes() { + for (GasSpargingRecipe aRecipe : GasSpargingRecipeMap.mRecipes) { + GTPP_Recipe newRecipe = new GTPP_Recipe( + false, + new ItemStack[] {}, + new ItemStack[] {}, + null, + null, + aRecipe.mFluidInputs.clone(), + new FluidStack[] {}, + aRecipe.mDuration, + aRecipe.mEUt, + 0); + GTPP_Recipe_Map.sSpargeTowerRecipes.add(newRecipe); + } + if (GTPP_Recipe_Map.sSpargeTowerRecipes.mRecipeList.isEmpty()) { + return false; + } + return true; + } + + @Override + public boolean isCorrectMachinePart(ItemStack aStack) { + return true; + } + + @Override + public boolean checkRecipe(ItemStack aStack) { + ArrayList<FluidStack> tFluidList = getStoredFluids(); + long tVoltage = getMaxInputVoltage(); + 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."); + GT_Recipe tRecipe = getRecipeMap().findRecipe(getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[tTier], tFluids); + if (tRecipe != null) { + Logger.INFO("Found recipe!"); + if (tRecipe.isRecipeInputEqual(true, tFluids)) { + Logger.INFO("Found recipe that matches!"); + this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000); + this.mEfficiencyIncrease = 10000; + + // Reset outputs and progress stats + this.mEUt = 0; + this.mProgresstime = 0; + this.mMaxProgresstime = 0; + this.mOutputItems = new ItemStack[]{}; + this.mOutputFluids = new FluidStack[]{}; + this.mLastRecipe = tRecipe; + + calculateOverclockedNessMulti(tRecipe.mEUt, tRecipe.mDuration, 1, tVoltage); + 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]); + this.mOutputFluids = (FluidStack[]) aFluidOutputs.toArray(new FluidStack[0]); + updateSlots(); + Logger.INFO("Done!"); + return true; + } + } + else { + Logger.INFO("Did not find recipe!"); + } + } + this.mEUt = 0; + this.mEfficiency = 0; + Logger.INFO("Did not find recipe! (2)"); + return false; + } + + 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) { + Logger.INFO("Did not find sparge recipe!"); + return aOutputGases; + } + int aSpargeGasAmount = aSpargeRecipe.mInputGas.amount; + + aOutputGases.add(aSpargeRecipe.mOutputSpargedFuel.copy()); + ArrayList<FluidStack> aTempMap = new ArrayList<FluidStack>(); + for (int i=2;i<aSpargeRecipe.mFluidOutputs.length;i++) { + int aGasAmount = MathUtils.randInt(0, (aSpargeRecipe.mMaxOutputQuantity[i-2]/100)); + FluidStack aOutput = aSpargeRecipe.mFluidOutputs[i].copy(); + aSpargeGasAmount -= aGasAmount; + FluidStack aSpargeOutput = null; + if (aGasAmount > 0) { + aSpargeOutput = new FluidStack(aOutput.getFluid(), aGasAmount); + } + aTempMap.add(aSpargeOutput); + } + Logger.INFO("Sparge gas left: "+aSpargeGasAmount); + if (aSpargeGasAmount > 0) { + aOutputGases.add(new FluidStack(aSpargeRecipe.mInputGas.getFluid(), aSpargeGasAmount)); + } + //Logger.INFO("Sparge Outputs: "+ItemUtils.getArrayStackNames(aTempMap)); + aOutputGases.addAll(aTempMap); + Logger.INFO("Sparge output size: "+aOutputGases.size()); + //Logger.INFO("Output of sparging: "+ItemUtils.getArrayStackNames(aOutputGases)); + return aOutputGases; + } + + protected void onCasingFound() { + mCasing++; + } + + protected void onTopLayerFound(boolean aIsCasing) { + mTopLayerFound = true; + if (aIsCasing) { + onCasingFound(); + } + } + + protected boolean addLayerOutputHatch(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { + if (aTileEntity == null || aTileEntity.isDead() || !(aTileEntity.getMetaTileEntity() instanceof GT_MetaTileEntity_Hatch_Output)) { + Logger.INFO("Bad Output Hatch"); + return false; + } + while (mOutputHatchesByLayer.size() < mHeight) { + mOutputHatchesByLayer.add(new ArrayList<>()); + } + GT_MetaTileEntity_Hatch_Output tHatch = (GT_MetaTileEntity_Hatch_Output) aTileEntity.getMetaTileEntity(); + tHatch.updateTexture(aBaseCasingIndex); + boolean addedHatch = mOutputHatchesByLayer.get(mHeight - 1).add(tHatch); + Logger.INFO("Added Hatch: "+addedHatch); + return addedHatch; + } + + @Override + protected IAlignmentLimits getInitialAlignmentLimits() { + // don't rotate a freaking tower, it won't work + return (d, r, f) -> d.offsetY == 0 && r.isNotRotated() && !f.isVerticallyFliped(); + } + + @Override + public IStructureDefinition<GregtechMetaTileEntity_SpargeTower> getStructureDefinition() { + return STRUCTURE_DEFINITION; + } + + @Override + public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) { + // reset + mOutputHatchesByLayer.forEach(List::clear); + mHeight = 1; + mTopLayerFound = false; + mCasing = 0; + + // check base + if (!checkPiece(STRUCTURE_PIECE_BASE, 1, 0, 0)) { + Logger.INFO("Bad Base. Height: "+mHeight); + return false; + } + + // check each layer + while (mHeight < 8 && checkPiece(STRUCTURE_PIECE_LAYER, 1, mHeight, 0) && !mTopLayerFound) { + if (mOutputHatchesByLayer.get(mHeight - 1).isEmpty()) { + // layer without output hatch + Logger.INFO("Height: "+mHeight + " - Missing output on "+(mHeight - 1)); + return false; + } + // not top + mHeight++; + } + + // validate final invariants... + Logger.INFO("Height: "+mHeight); + Logger.INFO("Casings: "+mCasing); + Logger.INFO("Required: "+(7 * mHeight - 5)); + Logger.INFO("Found Top: "+mTopLayerFound); + return mCasing >= 45 && mTopLayerFound && mMaintenanceHatches.size() == 1; + } + + @Override + public int getMaxEfficiency(ItemStack aStack) { + return 10000; + } + + @Override + public int getPollutionPerTick(ItemStack aStack) { + return 0; + } + + @Override + public int getDamageToComponent(ItemStack aStack) { + return 0; + } + + @Override + public boolean explodesOnComponentBreak(ItemStack aStack) { + return false; + } + + @Override + protected void addFluidOutputs(FluidStack[] mOutputFluids2) { + for (int i = 0; i < mOutputFluids2.length && i < mOutputHatchesByLayer.size(); i++) { + FluidStack tStack = mOutputFluids2[i] != null ? mOutputFluids2[i].copy() : null; + if (tStack == null) { + continue; + } + if (!dumpFluid(mOutputHatchesByLayer.get(i), tStack, true)) { + dumpFluid(mOutputHatchesByLayer.get(i), tStack, false); + } + } + } + + @Override + public void construct(ItemStack stackSize, boolean hintsOnly) { + buildPiece(STRUCTURE_PIECE_BASE, stackSize, hintsOnly, 1, 0, 0); + int tTotalHeight = 8; // min 2 output layer, so at least 1 + 2 height + for (int i = 1; i < tTotalHeight - 1; i++) { + buildPiece(STRUCTURE_PIECE_LAYER_HINT, stackSize, hintsOnly, 1, i, 0); + } + buildPiece(STRUCTURE_PIECE_TOP_HINT, stackSize, hintsOnly, 1, tTotalHeight - 1, 0); + } + + @Override + public boolean hasSlotInGUI() { + return false; + } + + @Override + public String getCustomGUIResourceName() { + return null; + } + + @Override + public boolean requiresVanillaGtGUI() { + return true; + } + + @Override + public String getMachineType() { + return "Gas Sparger"; + } + + @Override + public int getMaxParallelRecipes() { + return 1; + } + + @Override + public int getEuDiscountForParallelism() { + return 0; + } + + @Override + 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."); + 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+"."); + hatch.mFluid = null; + } + aHatchIndex++; + } + aLayerIndex++; + } + return aLayerIndex > 0; + } +} diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_DistillationTower.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_DistillationTower.java index 78c72bed69..6d8ca49d7d 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_DistillationTower.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_DistillationTower.java @@ -98,20 +98,15 @@ public class GregtechMetaTileEntity_Adv_DistillationTower extends GregtechMeta_M } else { IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputBus){ - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mInputBusses.add((GT_MetaTileEntity_Hatch_InputBus)aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Maintenance){ - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mMaintenanceHatches.add((GT_MetaTileEntity_Hatch_Maintenance)aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Energy){ - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mEnergyHatches.add((GT_MetaTileEntity_Hatch_Energy)aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_OutputBus) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mOutputBusses.add((GT_MetaTileEntity_Hatch_OutputBus) aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mInputHatches.add((GT_MetaTileEntity_Hatch_Input) aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } } return false; @@ -123,8 +118,7 @@ public class GregtechMetaTileEntity_Adv_DistillationTower extends GregtechMeta_M } else { IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Output){ - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mOutputHatches.add((GT_MetaTileEntity_Hatch_Output)aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } } return false; @@ -136,11 +130,9 @@ public class GregtechMetaTileEntity_Adv_DistillationTower extends GregtechMeta_M } else { IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Output){ - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mOutputHatches.add((GT_MetaTileEntity_Hatch_Output)aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Muffler){ - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mMufflerHatches.add((GT_MetaTileEntity_Hatch_Muffler)aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } } return false; @@ -166,7 +158,7 @@ public class GregtechMetaTileEntity_Adv_DistillationTower extends GregtechMeta_M .addEnergyHatch("Bottom Casing", 1) .addOutputHatch("One per layer except bottom", 2) .addMufflerHatch("Top Center Casing", 3) - .toolTipFinisher("GT++"); + .toolTipFinisher(CORE.GT_Tooltip_Builder); return tt; } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_EBF.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_EBF.java index 098642978d..ce54aef282 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_EBF.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_EBF.java @@ -32,6 +32,7 @@ import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.block.ModBlocks; +import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.util.minecraft.FluidUtils; import gtPlusPlus.core.util.minecraft.ItemUtils; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase; @@ -106,7 +107,7 @@ public class GregtechMetaTileEntity_Adv_EBF extends GregtechMeta_MultiBlockBase .addEnergyHatch("Any Casing", 1) .addMufflerHatch("Any Casing", 1) .addMaintenanceHatch("Any Casing", 1) - .toolTipFinisher("GT++"); + .toolTipFinisher(CORE.GT_Tooltip_Builder); return tt; } @@ -164,31 +165,23 @@ public class GregtechMetaTileEntity_Adv_EBF extends GregtechMeta_MultiBlockBase } else { IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_CustomFluidBase && aMetaTileEntity.getBaseMetaTileEntity().getMetaTileID() == 968) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); mHaveHatch = true; - return this.mInputHatches.add((GT_MetaTileEntity_Hatch_Input) aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputBus){ - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mInputBusses.add((GT_MetaTileEntity_Hatch_InputBus)aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Maintenance){ - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mMaintenanceHatches.add((GT_MetaTileEntity_Hatch_Maintenance)aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Energy){ - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mEnergyHatches.add((GT_MetaTileEntity_Hatch_Energy)aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_OutputBus) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mOutputBusses.add((GT_MetaTileEntity_Hatch_OutputBus) aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Muffler) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mMufflerHatches.add((GT_MetaTileEntity_Hatch_Muffler) aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mInputHatches.add((GT_MetaTileEntity_Hatch_Input) aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Output) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mOutputHatches.add((GT_MetaTileEntity_Hatch_Output) aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } } return false; diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_Fusion_MK4.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_Fusion_MK4.java index 385826d0df..56206f8178 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_Fusion_MK4.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_Fusion_MK4.java @@ -15,6 +15,7 @@ import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.common.tileentities.machines.multi.GT_MetaTileEntity_FusionComputer; 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 net.minecraft.block.Block; @@ -52,7 +53,7 @@ public class GregtechMetaTileEntity_Adv_Fusion_MK4 extends GT_MetaTileEntity_Fus .addInputHatch("2-16, Specified casings", 1) .addOutputHatch("1-16, Specified casings", 3) .addStructureInfo("ALL Hatches must be UHV or better") - .toolTipFinisher("GT++"); + .toolTipFinisher(CORE.GT_Tooltip_Builder); return tt; } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_Implosion.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_Implosion.java index cece6c9daf..aff614184a 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_Implosion.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_Implosion.java @@ -69,7 +69,7 @@ extends GregtechMeta_MultiBlockBase { .addEnergyHatch("Any casing", 1) .addMaintenanceHatch("Any casing", 1) .addMufflerHatch("Any casing", 1) - .toolTipFinisher("GT++"); + .toolTipFinisher(CORE.GT_Tooltip_Builder); return tt; } @@ -107,20 +107,15 @@ extends GregtechMeta_MultiBlockBase { } else { IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputBus){ - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mInputBusses.add((GT_MetaTileEntity_Hatch_InputBus)aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Maintenance){ - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mMaintenanceHatches.add((GT_MetaTileEntity_Hatch_Maintenance)aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Energy){ - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mEnergyHatches.add((GT_MetaTileEntity_Hatch_Energy)aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_OutputBus) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mOutputBusses.add((GT_MetaTileEntity_Hatch_OutputBus) aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Muffler) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mMufflerHatches.add((GT_MetaTileEntity_Hatch_Muffler) aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } } return false; diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/steam/GregtechMetaTileEntity_SteamMacerator.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/steam/GregtechMetaTileEntity_SteamMacerator.java index 6deead6c48..3191f56889 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/steam/GregtechMetaTileEntity_SteamMacerator.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/steam/GregtechMetaTileEntity_SteamMacerator.java @@ -15,6 +15,7 @@ import gregtech.api.metatileentity.implementations.*; import gregtech.api.objects.GT_RenderedTexture; 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.GT_MetaTileEntity_Hatch_Steam_BusInput; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Steam_BusOutput; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GT_MetaTileEntity_Hatch_CustomFluidBase; @@ -71,7 +72,7 @@ public class GregtechMetaTileEntity_SteamMacerator extends GregtechMeta_SteamMul .addStructureHint("Input Bus (Steam)", 1) .addStructureHint("Output Bus (Steam)", 1) .addStructureHint("Steam Hatch", 1) - .toolTipFinisher("GT++"); + .toolTipFinisher(CORE.GT_Tooltip_Builder); return tt; } @@ -109,14 +110,11 @@ public class GregtechMetaTileEntity_SteamMacerator extends GregtechMeta_SteamMul } else { IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_CustomFluidBase && aMetaTileEntity.getBaseMetaTileEntity().getMetaTileID() == 31040){ - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mSteamInputFluids.add((GT_MetaTileEntity_Hatch_CustomFluidBase)aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Steam_BusInput){ - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mSteamInputs.add((GT_MetaTileEntity_Hatch_Steam_BusInput)aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Steam_BusOutput){ - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mSteamOutputs.add((GT_MetaTileEntity_Hatch_Steam_BusOutput)aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } } return false; diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GT4Entity_AutoCrafter.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GT4Entity_AutoCrafter.java index 5e9b9685f4..eae51e5c1d 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GT4Entity_AutoCrafter.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GT4Entity_AutoCrafter.java @@ -144,7 +144,7 @@ public class GT4Entity_AutoCrafter extends GregtechMeta_MultiBlockBase { .addEnergyHatch("Any Casing", 1) .addMaintenanceHatch("Any Casing", 1) .addMufflerHatch("Any Casing", 1) - .toolTipFinisher("GT++"); + .toolTipFinisher(CORE.GT_Tooltip_Builder); return tt; } @@ -207,23 +207,17 @@ public class GT4Entity_AutoCrafter extends GregtechMeta_MultiBlockBase { } else { IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputBus){ - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mInputBusses.add((GT_MetaTileEntity_Hatch_InputBus)aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Maintenance){ - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mMaintenanceHatches.add((GT_MetaTileEntity_Hatch_Maintenance)aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Energy){ - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mEnergyHatches.add((GT_MetaTileEntity_Hatch_Energy)aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_OutputBus) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mOutputBusses.add((GT_MetaTileEntity_Hatch_OutputBus) aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Muffler) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mMufflerHatches.add((GT_MetaTileEntity_Hatch_Muffler) aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mInputHatches.add((GT_MetaTileEntity_Hatch_Input) aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } } return false; diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GT4Entity_ThermalBoiler.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GT4Entity_ThermalBoiler.java index 991f2b54ed..65474d38ed 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GT4Entity_ThermalBoiler.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GT4Entity_ThermalBoiler.java @@ -222,7 +222,7 @@ extends GregtechMeta_MultiBlockBase .addOutputHatch("Any Casing", 1) .addMaintenanceHatch("Any Casing", 1) .addMufflerHatch("Any Casing", 1) - .toolTipFinisher("GT++"); + .toolTipFinisher(CORE.GT_Tooltip_Builder); return tt; } @@ -280,23 +280,17 @@ extends GregtechMeta_MultiBlockBase } else { IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputBus){ - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mInputBusses.add((GT_MetaTileEntity_Hatch_InputBus)aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Maintenance){ - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mMaintenanceHatches.add((GT_MetaTileEntity_Hatch_Maintenance)aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_OutputBus) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mOutputBusses.add((GT_MetaTileEntity_Hatch_OutputBus) aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Muffler) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mMufflerHatches.add((GT_MetaTileEntity_Hatch_Muffler) aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mInputHatches.add((GT_MetaTileEntity_Hatch_Input) aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Output) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mOutputHatches.add((GT_MetaTileEntity_Hatch_Output) aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } } return false; diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_ElementalDuplicator.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_ElementalDuplicator.java index 6f8f082065..326cc01de7 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_ElementalDuplicator.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_ElementalDuplicator.java @@ -1,6 +1,9 @@ -/* package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofChain; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.onElementPass; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose; +import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; import static gtPlusPlus.core.util.data.ArrayUtils.removeNulls; import java.util.ArrayList; @@ -9,6 +12,11 @@ import java.util.List; import org.apache.commons.lang3.ArrayUtils; +import com.gtnewhorizon.structurelib.StructureLibAPI; +import com.gtnewhorizon.structurelib.structure.IStructureDefinition; +import com.gtnewhorizon.structurelib.structure.IStructureElement; +import com.gtnewhorizon.structurelib.structure.StructureDefinition; + import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.GregTech_API; @@ -16,15 +24,22 @@ 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.metatileentity.implementations.GT_MetaTileEntity_Hatch; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Input; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_InputBus; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Maintenance; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Output; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_OutputBus; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_TieredMachineBlock; import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.util.GTPP_Recipe; +import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.api.objects.data.AutoMap; import gtPlusPlus.api.objects.data.Triplet; -import gtPlusPlus.core.block.ModBlocks; import gtPlusPlus.core.item.chemistry.general.ItemGenericChemBase; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.recipe.common.CI; @@ -32,14 +47,11 @@ import gtPlusPlus.core.util.math.MathUtils; import gtPlusPlus.core.util.minecraft.ItemUtils; 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.api.metatileentity.implementations.nbthandlers.GT_MetaTileEntity_Hatch_Catalysts; -import gtPlusPlus.xmod.gregtech.common.Meta_GT_Proxy; -import gtPlusPlus.xmod.gregtech.common.StaticFields59; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; import net.minecraft.block.Block; -import net.minecraft.init.Blocks; 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.FluidStack; @@ -48,12 +60,19 @@ public class GregtechMTE_ElementalDuplicator extends GregtechMeta_MultiBlockBase private int mSolidCasingTier = 0; private int mMachineCasingTier = 0; private int mPipeCasingTier = 0; - private int mCoilTier = 0; + private int mCoilTier = 0; + private int checkCoil; + private int[] checkCasing = new int[8]; + private int checkMachine; + private int checkPipe; + private int maxTierOfHatch; + private int mCasing; + private IStructureDefinition<GregtechMTE_ElementalDuplicator> STRUCTURE_DEFINITION = null; + + private ArrayList<GT_MetaTileEntity_Hatch_ElementalDataOrbHolder> mReplicatorDataOrbHatches = new ArrayList<GT_MetaTileEntity_Hatch_ElementalDataOrbHolder>(); - private ArrayList<GT_MetaTileEntity_Hatch_ElementalDataOrbHolder> mDataHolders = new ArrayList<GT_MetaTileEntity_Hatch_ElementalDataOrbHolder>(); - private static final HashMap<Integer, Triplet<Block, Integer, Integer>> mTieredBlockRegistry = new HashMap<Integer, Triplet<Block, Integer, Integer>>(); - + public GregtechMTE_ElementalDuplicator(final int aID, final String aName, final String aNameRegional) { super(aID, aName, aNameRegional); } @@ -61,7 +80,7 @@ public class GregtechMTE_ElementalDuplicator extends GregtechMeta_MultiBlockBase public GregtechMTE_ElementalDuplicator(final String aName) { super(aName); } - + public static boolean registerMachineCasingForTier(int aTier, Block aBlock, int aMeta, int aCasingTextureID) { int aSize = mTieredBlockRegistry.size(); int aSize2 = aSize; @@ -73,21 +92,14 @@ public class GregtechMTE_ElementalDuplicator extends GregtechMeta_MultiBlockBase aSize = mTieredBlockRegistry.size(); return aSize > aSize2; } - - private static Block getBlockForTier(int aTier) { - if (!mTieredBlockRegistry.containsKey(aTier)) { - return Blocks.bedrock; - } - return mTieredBlockRegistry.get(aTier).getValue_1(); - } - private static int getMetaForTier(int aTier) { + + private static int getCasingTextureIdForTier(int aTier) { if (!mTieredBlockRegistry.containsKey(aTier)) { - return 32; + return 10; } - return mTieredBlockRegistry.get(aTier).getValue_2(); - } - private static int getCasingTextureIdForTier(int aTier) { - return 67; + int aCasingID = mTieredBlockRegistry.get(aTier).getValue_3(); + //Logger.INFO("Found casing texture ID "+aCasingID+" for tier "+aTier); + return aCasingID; } @Override @@ -97,20 +109,288 @@ public class GregtechMTE_ElementalDuplicator extends GregtechMeta_MultiBlockBase @Override public String getMachineType() { - return "Chemical Plant"; + return "Replicator"; + } + + @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 Replication Machine") + .addInfo("Now replication is less painful") + .addInfo("Please read to user manual for more information on construction & 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) + .toolTipFinisher(CORE.GT_Tooltip_Builder); + return tt; + } + + public void setMachineMeta(int meta) { + checkMachine = meta; + } + + public int getMachineMeta() { + return checkMachine; + } + + public void setPipeMeta(int meta) { + checkPipe = meta; + } + + public int getPipeMeta() { + return checkPipe; + } + + public void setCoilMeta(int meta) { + checkCoil = meta; + } + + public int getCoilMeta() { + return checkCoil; + } + + public int coilTier(int meta) { + switch (meta) { + case 0: return 1; + case 1: return 2; + case 2: return 3; + case 3: return 4; + case 4: return 5; + case 5: return 7; + case 6: return 8; + case 7: return 10; + case 8: return 11; + case 9: return 6; + case 10: return 9; + } + return 0; } @Override - public String[] getTooltip() { - return new String[] { - "Controller Block for the Industrial Replication Machine", - "Now replication is less painful", - "Please read to user manual for more information on construction & usage", - TAG_HIDE_MAINT + public IStructureDefinition<GregtechMTE_ElementalDuplicator> getStructureDefinition() { + if (STRUCTURE_DEFINITION == null) { + STRUCTURE_DEFINITION = StructureDefinition.<GregtechMTE_ElementalDuplicator>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( + ofHatchAdder( + GregtechMTE_ElementalDuplicator::addChemicalPlantList, getCasingTextureID(), 1 + ), + onElementPass( + x -> {++x.checkCasing[0]; ++x.mCasing;}, + ofSolidCasing(0) + ), + onElementPass( + x -> {++x.checkCasing[1]; ++x.mCasing;}, + ofSolidCasing(1) + ), + onElementPass( + x -> {++x.checkCasing[2]; ++x.mCasing;}, + ofSolidCasing(2) + ), + onElementPass( + x -> {++x.checkCasing[3]; ++x.mCasing;}, + ofSolidCasing(3) + ), + onElementPass( + x -> {++x.checkCasing[4]; ++x.mCasing;}, + ofSolidCasing(4) + ), + onElementPass( + x -> {++x.checkCasing[5]; ++x.mCasing;}, + ofSolidCasing(5) + ), + onElementPass( + x -> {++x.checkCasing[6]; ++x.mCasing;}, + ofSolidCasing(6) + ), + onElementPass( + x -> {++x.checkCasing[7]; ++x.mCasing;}, + ofSolidCasing(7) + ) + ) + ) + .addElement( + 'X', + ofChain( + onElementPass( + x -> {++x.checkCasing[0]; ++x.mCasing;}, + ofSolidCasing(0) + ), + onElementPass( + x -> {++x.checkCasing[1]; ++x.mCasing;}, + ofSolidCasing(1) + ), + onElementPass( + x -> {++x.checkCasing[2]; ++x.mCasing;}, + ofSolidCasing(2) + ), + onElementPass( + x -> {++x.checkCasing[3]; ++x.mCasing;}, + ofSolidCasing(3) + ), + onElementPass( + x -> {++x.checkCasing[4]; ++x.mCasing;}, + ofSolidCasing(4) + ), + onElementPass( + x -> {++x.checkCasing[5]; ++x.mCasing;}, + ofSolidCasing(5) + ), + onElementPass( + x -> {++x.checkCasing[6]; ++x.mCasing;}, + ofSolidCasing(6) + ), + onElementPass( + x -> {++x.checkCasing[7]; ++x.mCasing;}, + ofSolidCasing(7) + ) + ) + ) + .addElement( + 'M', + addTieredBlock( + GregTech_API.sBlockCasings1, GregtechMTE_ElementalDuplicator::setMachineMeta, GregtechMTE_ElementalDuplicator::getMachineMeta, 10 + ) + ) + .addElement( + 'H', + addTieredBlock( + GregTech_API.sBlockCasings5, GregtechMTE_ElementalDuplicator::setCoilMeta, GregtechMTE_ElementalDuplicator::getCoilMeta, 11 + ) + ) + .addElement( + 'P', + addTieredBlock( + GregTech_API.sBlockCasings2, GregtechMTE_ElementalDuplicator::setPipeMeta, GregtechMTE_ElementalDuplicator::getPipeMeta, 12, 16 + ) + ) + .build(); + } + return STRUCTURE_DEFINITION; + } + + public static <T> IStructureElement<T> ofSolidCasing(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); + int meta = world.getBlockMetadata(x, y, z); + Block target = mTieredBlockRegistry.get(aIndex).getValue_1(); + int targetMeta = mTieredBlockRegistry.get(aIndex).getValue_2(); + return target.equals(block) && meta == targetMeta; + } + + int getIndex(int size) { + if (size > 8) size = 8; + return size - 1; + } + + @Override + public boolean spawnHint(T t, World world, int x, int y, int z, ItemStack trigger) { + StructureLibAPI.hintParticle(world, x, y, z, mTieredBlockRegistry.get(getIndex(trigger.stackSize)).getValue_1(), mTieredBlockRegistry.get(getIndex(trigger.stackSize)).getValue_2()); + return true; + } + + @Override + public boolean placeBlock(T t, World world, int x, int y, int z, ItemStack trigger) { + return world.setBlock(x, y, z, mTieredBlockRegistry.get(getIndex(trigger.stackSize)).getValue_1(), mTieredBlockRegistry.get(getIndex(trigger.stackSize)).getValue_2(), 3); + } }; } @Override + public void construct(ItemStack stackSize, boolean hintsOnly) { + buildPiece(mName , stackSize, hintsOnly, 3, 6, 0); + } + + @Override + public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) { + mCasing = 0; + for (int i = 0; i < 8; i++) { + checkCasing[i] = 0; + } + checkCoil = 0; + checkPipe = 0; + checkMachine = 0; + mSolidCasingTier = 0; + mMachineCasingTier = 0; + mPipeCasingTier = 0; + mCoilTier = 0; + mReplicatorDataOrbHatches.clear(); + if (checkPiece(mName, 3, 6, 0) && mCasing >= 80) { + for (int i = 0; i < 8; i++) { + if (checkCasing[i] == mCasing) { + mSolidCasingTier = i; + } + else if (checkCasing[i] > 0) + return false; + } + mMachineCasingTier = checkMachine - 1; + mPipeCasingTier = checkPipe - 12; + mCoilTier = coilTier(checkCoil - 1); + updateHatchTexture(); + return mMachineCasingTier >= maxTierOfHatch; + } + return false; + } + + public void updateHatchTexture() { + for (GT_MetaTileEntity_Hatch h : mReplicatorDataOrbHatches) h.updateTexture(getCasingTextureID()); + for (GT_MetaTileEntity_Hatch h : mInputBusses) h.updateTexture(getCasingTextureID()); + for (GT_MetaTileEntity_Hatch h : mMaintenanceHatches) h.updateTexture(getCasingTextureID()); + for (GT_MetaTileEntity_Hatch h : mEnergyHatches) h.updateTexture(getCasingTextureID()); + for (GT_MetaTileEntity_Hatch h : mOutputBusses) h.updateTexture(getCasingTextureID()); + for (GT_MetaTileEntity_Hatch h : mInputHatches) h.updateTexture(getCasingTextureID()); + for (GT_MetaTileEntity_Hatch h : mOutputHatches) h.updateTexture(getCasingTextureID()); + } + + public final boolean addChemicalPlantList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { + if (aTileEntity == null) { + return false; + } else { + IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); + if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_ElementalDataOrbHolder){ + return addToMachineList(aTileEntity, aBaseCasingIndex); + } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputBus){ + maxTierOfHatch = Math.max(maxTierOfHatch, ((GT_MetaTileEntity_Hatch_InputBus) aMetaTileEntity).mTier); + return addToMachineList(aTileEntity, aBaseCasingIndex); + } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Maintenance){ + return addToMachineList(aTileEntity, aBaseCasingIndex); + } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Energy){ + maxTierOfHatch = Math.max(maxTierOfHatch, ((GT_MetaTileEntity_Hatch_Energy) aMetaTileEntity).mTier); + return addToMachineList(aTileEntity, aBaseCasingIndex); + } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_OutputBus) { + maxTierOfHatch = Math.max(maxTierOfHatch, ((GT_MetaTileEntity_Hatch_OutputBus) aMetaTileEntity).mTier); + return addToMachineList(aTileEntity, aBaseCasingIndex); + } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input) { + maxTierOfHatch = Math.max(maxTierOfHatch, ((GT_MetaTileEntity_Hatch_Input) aMetaTileEntity).mTier); + return addToMachineList(aTileEntity, aBaseCasingIndex); + } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Output) { + maxTierOfHatch = Math.max(maxTierOfHatch, ((GT_MetaTileEntity_Hatch_Output) aMetaTileEntity).mTier); + return addToMachineList(aTileEntity, aBaseCasingIndex); + } + } + return false; + } + + @Override public String getSound() { return GregTech_API.sSoundList.get(Integer.valueOf(207)); } @@ -140,21 +420,19 @@ public class GregtechMTE_ElementalDuplicator extends GregtechMeta_MultiBlockBase @Override public GT_Recipe.GT_Recipe_Map getRecipeMap() { + if (GTPP_Recipe.GTPP_Recipe_Map.sChemicalPlant_GT.mRecipeList.size() == 0) { + generateRecipes(); + } return GTPP_Recipe.GTPP_Recipe_Map.sChemicalPlant_GT; } public static void generateRecipes() { - for (GTPP_Recipe i : GTPP_Recipe.GTPP_Recipe_Map.sChemicalPlantRecipes.mRecipeList) { + for (GT_Recipe i : GTPP_Recipe.GTPP_Recipe_Map.sChemicalPlantRecipes.mRecipeList) { GTPP_Recipe.GTPP_Recipe_Map.sChemicalPlant_GT.add(i); } } @Override - public boolean isFacingValid(final byte aFacing) { - return aFacing > 1; - } - - @Override public int getMaxParallelRecipes() { return 2 * getPipeCasingTier(); } @@ -171,12 +449,10 @@ public class GregtechMTE_ElementalDuplicator extends GregtechMeta_MultiBlockBase private int getMachineCasingTier() { return mMachineCasingTier; } + private int getPipeCasingTier() { return mPipeCasingTier; } - private int getCoilTier() { - return mCoilTier; - } private int getCasingTextureID() { // Check the Tier Client Side @@ -192,15 +468,15 @@ public class GregtechMTE_ElementalDuplicator extends GregtechMeta_MultiBlockBase GT_MetaTileEntity_TieredMachineBlock aMachineBlock = (GT_MetaTileEntity_TieredMachineBlock) aMetaTileEntity; int aTileTier = aMachineBlock.mTier; if (aTileTier > aMaxTier) { - Logger.INFO("Hatch tier too high."); + log("Hatch tier too high."); return false; } - else { + else { return addToMachineList(aTileEntity, getCasingTextureID()); } } else { - Logger.INFO("Bad Tile Entity being added to hatch map."); // Shouldn't ever happen, but.. ya know.. + log("Bad Tile Entity being added to hatch map."); // Shouldn't ever happen, but.. ya know.. return false; } } @@ -223,368 +499,6 @@ public class GregtechMTE_ElementalDuplicator extends GregtechMeta_MultiBlockBase mCoilTier = aNBT.getInteger("mCoilTier"); } - private static boolean isBlockSolidCasing(int aCurrentTier, Block aBlock, int aMeta) { - if (aBlock == null || (aMeta < 0 || aMeta > 16)) { - return false; - } - Block aTieredCasing = ModBlocks.blockCasings5Misc; - int aTieredMeta = 3; - if (aBlock == aTieredCasing && aMeta == aTieredMeta) { - return true; - } - return false; - } - private static boolean isBlockMachineCasing(Block aBlock, int aMeta) { - Block aCasingBlock1 = GregTech_API.sBlockCasings1; - if (aBlock == aCasingBlock1) { - if (aMeta > 9 || aMeta < 0) { - return false; - } - else { - return true; - } - } - else { - return false; - } - } - private static boolean isBlockPipeCasing(Block aBlock, int aMeta) { - Block aCasingBlock2 = GregTech_API.sBlockCasings2; - if (aBlock == aCasingBlock2) { - int aMetaBronzePipeCasing = 12; - //int aMetaSteelPipeCasing = 13; - //int aMetaTitaniumPipeCasing = 14; - int aMetaTungstenPipeCasing = 15; - if (aMeta > aMetaTungstenPipeCasing || aMeta < aMetaBronzePipeCasing) { - return false; - } - else { - return true; - } - } - else { - return false; - } - } - - private static AutoMap<Integer> mValidCoilMetaCache; - - private static boolean isBlockCoil(Block aBlock, int aMeta) { - Block aCasingBlock; - if (CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK) { - aCasingBlock = StaticFields59.getBlockCasings5(); - } - else { - aCasingBlock = GregTech_API.sBlockCasings1; - } - // Cache the meta values for later - if (mValidCoilMetaCache == null || mValidCoilMetaCache.isEmpty()) { - AutoMap<Integer> aValidCoilMeta = new AutoMap<Integer>(); - // Only use the right meta values available. - if (CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK) { - aValidCoilMeta = Meta_GT_Proxy.GT_ValidHeatingCoilMetas; - } - else { - aValidCoilMeta.put(12); - aValidCoilMeta.put(13); - aValidCoilMeta.put(14); - } - mValidCoilMetaCache = aValidCoilMeta; - } - if (aBlock == aCasingBlock) { - for (int i: mValidCoilMetaCache.values()) { - if (i == aMeta) { - return true; - } - } - } - return false; - } - - - @Override - public boolean checkMultiblock(final IGregTechTileEntity aBaseMetaTileEntity, final ItemStack aStack) { - - int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX * 3; - int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ * 3; - - Logger.INFO("Checking ChemPlant Structure"); - - // Require Air above controller - boolean aAirCheck = aBaseMetaTileEntity.getAirOffset(0, 1, 0); - - if (!aAirCheck) { - Logger.INFO("No Air Above Controller"); - return false; - } else { - - //String aName = aInitStructureCheck != null ? ItemUtils.getLocalizedNameOfBlock(aInitStructureCheck, aInitStructureCheckMeta) : "Air"; - - mSolidCasingTier = getSolidCasingTierCheck(aBaseMetaTileEntity, xDir, zDir); - mMachineCasingTier = getMachineCasingTierCheck(aBaseMetaTileEntity, xDir, zDir); - - Logger.INFO("Initial Casing Check Complete, Solid Casing Tier: "+mSolidCasingTier+", Machine Casing Tier: "+mMachineCasingTier); - - int aSolidCasingCount = 0; - int aMachineCasingCount = 0; - int aPipeCount = 0; - int aCoilCount = 0; - - aSolidCasingCount = checkSolidCasings(aBaseMetaTileEntity, aStack, xDir, zDir); - aMachineCasingCount = checkMachineCasings(aBaseMetaTileEntity, aStack, xDir, zDir); - aPipeCount = checkPipes(aBaseMetaTileEntity, aStack, xDir, zDir); - aCoilCount = checkCoils(aBaseMetaTileEntity, aStack, xDir, zDir); - - Logger.INFO("Casing Counts: "); - Logger.INFO("Solid: "+aSolidCasingCount+", Machine: "+aMachineCasingCount); - Logger.INFO("Pipe: "+aPipeCount+", Coil: "+aCoilCount); - - - Logger.INFO("Casing Tiers: "); - Logger.INFO("Solid: "+getSolidCasingTier()+", Machine: "+getMachineCasingTier()); - Logger.INFO("Pipe: "+getPipeCasingTier()+", Coil: "+getCoilTier()); - - // Attempt to sync fields here, so that it updates client side values. - aBaseMetaTileEntity.getWorld().markBlockForUpdate(aBaseMetaTileEntity.getXCoord(), aBaseMetaTileEntity.getYCoord(), aBaseMetaTileEntity.getZCoord()); - - - - // Minimum 80/93 Solid Casings - if (aSolidCasingCount < 80) { - Logger.INFO("Not enough solid casings. Found "+aSolidCasingCount+", require: 80."); - return false; - } - if (aMachineCasingCount != 57) { - Logger.INFO("Not enough machine casings. Found "+aMachineCasingCount+", require: 57."); - return false; - } - if (aPipeCount != 18) { - Logger.INFO("Not enough pipe casings. Found "+aPipeCount+", require: 18."); - return false; - } - if (aCoilCount != 27) { - Logger.INFO("Not enough coils. Found "+aCoilCount+", require: 27."); - return false; - } - - Logger.INFO("Structure Check Complete!"); - - return true; - } - } - - - public int checkCoils(final IGregTechTileEntity aBaseMetaTileEntity, final ItemStack aStack, int aOffsetX, int aOffsetZ) { - int tAmount = 0; - int aCurrentCoilMeta = -1; - for (int i = -1; i < 2; i++) { - for (int j = -1; j < 2; j++) { - for (int h = 0; h < 8; h++) { - if (h == 1 || h == 3 || h == 5) { - Block aBlock = aBaseMetaTileEntity.getBlockOffset(aOffsetX + i, h, aOffsetZ + j); - int aMeta = aBaseMetaTileEntity.getMetaIDOffset(aOffsetX + i, h, aOffsetZ + j); - if (isBlockCoil(aBlock, aMeta)) { - if (aCurrentCoilMeta < 0) { - aCurrentCoilMeta = aMeta; - } - if (aCurrentCoilMeta != aMeta) { - return tAmount; - } - else { - tAmount++; - } - } - } - } - } - } - - if (CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK) { - this.mCoilTier = (aCurrentCoilMeta+1); - } - else { - if (aCurrentCoilMeta == 12) { - this.mCoilTier = 1; - } - else if (aCurrentCoilMeta == 13) { - this.mCoilTier = 2; - } - else if (aCurrentCoilMeta == 14) { - this.mCoilTier = 3; - } - else { - this.mCoilTier = 0; - } - } - - return tAmount; - } - - - public int checkPipes(final IGregTechTileEntity aBaseMetaTileEntity, final ItemStack aStack, int aOffsetX, int aOffsetZ) { - int tAmount = 0; - int aCurrentPipeMeta = -1; - for (int i = -1; i < 2; i++) { - for (int j = -1; j < 2; j++) { - for (int h = 0; h < 8; h++) { - if (h == 2 || h == 4) { - Block aBlock = aBaseMetaTileEntity.getBlockOffset(aOffsetX + i, h, aOffsetZ + j); - int aMeta = aBaseMetaTileEntity.getMetaIDOffset(aOffsetX + i, h, aOffsetZ + j); - if (isBlockPipeCasing(aBlock, aMeta)) { - if (aCurrentPipeMeta < 0) { - aCurrentPipeMeta = aMeta; - } - if (aCurrentPipeMeta != aMeta) { - return tAmount; - } - else { - tAmount++; - } - } - } - } - } - } - - if (aCurrentPipeMeta == 12) { - this.mPipeCasingTier = 1; - } - else if (aCurrentPipeMeta == 13) { - this.mPipeCasingTier = 2; - } - else if (aCurrentPipeMeta == 14) { - this.mPipeCasingTier = 3; - } - else if (aCurrentPipeMeta == 15) { - this.mPipeCasingTier = 4; - } - else { - this.mPipeCasingTier = 0; - } - - return tAmount; - } - - - public int checkSolidCasings(final IGregTechTileEntity aBaseMetaTileEntity, final ItemStack aStack, int aOffsetX, int aOffsetZ) { - - int tAmount = 0; - - // Only check a 7x7 - for (int i = -3; i < 4; i++) { - for (int j = -3; j < 4; j++) { - // If we are on the 7x7 ring, proceed - IGregTechTileEntity aTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(aOffsetX + i, 0, aOffsetZ + j); - Block aBlock = aBaseMetaTileEntity.getBlockOffset(aOffsetX + i, 0, aOffsetZ + j); - int aMeta = aBaseMetaTileEntity.getMetaIDOffset(aOffsetX + i, 0, aOffsetZ + j); - - if (aTileEntity != null) { - - if (this.addToMachineList(aTileEntity)) { - tAmount++; - } - else { - if (aTileEntity != null) { - Logger.INFO("Adding "+aTileEntity.getInventoryName()); - } - final IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); - if (aMetaTileEntity == null) { - Logger.INFO("Error counting Bottom Layer Casing Ring. Bad Tile Entity. Found "+aTileEntity.getInventoryName()); - return tAmount; - } - //Handle controller - if (aMetaTileEntity instanceof GregtechMTE_ElementalDuplicator) { - continue; - } - else { - Logger.INFO("Error counting Bottom Layer Casing Ring. Bad Tile Entity. Found "+aMetaTileEntity.getInventoryName()); - return tAmount; - } - } - } - else { - if (isBlockSolidCasing(mSolidCasingTier, aBlock, aMeta)) { - tAmount++; - } - else { - Logger.INFO("Error counting Bottom Layer Casing Ring. Found "+aBlock.getLocalizedName()+":"+aMeta); - return tAmount; - } - } - - } - } - - return tAmount; - } - - - public int checkMachineCasings(final IGregTechTileEntity aBaseMetaTileEntity, final ItemStack aStack, int aOffsetX, int aOffsetZ) { - int tAmount = 0; - int aHeight = 0; - // Iterate once for each layer - for (int aIteration=0;aIteration<3;aIteration++) { - // Dynamically set height - aHeight = (aIteration == 0 ? 0 : aIteration == 1 ? 1 : 5); - // Only check a 5x5 area - for (int i = -2; i < 3; i++) { - for (int j = -2; j < 3; j++) { - // If we are on the 5x5 ring, proceed - if (i == -2 || i == 2 || j == -2 || j == 2) { - // If the second axis is on the outer ring, continue - if (i < -2 || i > 2 || j < -2 || j > 2) { - continue; - } - Block aBlock = aBaseMetaTileEntity.getBlockOffset(aOffsetX + i, aHeight, aOffsetZ + j); - int aMeta = aBaseMetaTileEntity.getMetaIDOffset(aOffsetX + i, aHeight, aOffsetZ + j); - if (isBlockMachineCasing(aBlock, aMeta)) { - tAmount++; - } - else { - return tAmount; - } - } - } - } - } - - // Check bottom layer inner 3x3 - for (int i = -1; i < 2; i++) { - for (int j = -1; j < 2; j++) { - Block aBlock = aBaseMetaTileEntity.getBlockOffset(aOffsetX + i, 0, aOffsetZ + j); - int aMeta = aBaseMetaTileEntity.getMetaIDOffset(aOffsetX + i, 0, aOffsetZ + j); - if (isBlockMachineCasing(aBlock, aMeta)) { - tAmount++; - } - else { - return tAmount; - } - } - } - - return tAmount; - } - - public int getSolidCasingTierCheck(IGregTechTileEntity aBaseMetaTileEntity, int xDir, int zDir) { - Block aInitStructureCheck; - int aInitStructureCheckMeta; - if (xDir == 0) { - aInitStructureCheck = aBaseMetaTileEntity.getBlockOffset(zDir, 1, 0); - aInitStructureCheckMeta = aBaseMetaTileEntity.getMetaIDOffset(zDir, 1, 0); - } - else { - aInitStructureCheck = aBaseMetaTileEntity.getBlockOffset(0, 1, xDir); - aInitStructureCheckMeta = aBaseMetaTileEntity.getMetaIDOffset(0, 1, xDir); - } - for (int aTier : mTieredBlockRegistry.keySet()) { - Triplet<Block, Integer, Integer> aData = mTieredBlockRegistry.get(aTier); - if (aData.getValue_1() == aInitStructureCheck && aData.getValue_2() == aInitStructureCheckMeta) { - return aTier; - } - } - return 0; - } - @Override public boolean addToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { final IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); @@ -593,16 +507,12 @@ public class GregtechMTE_ElementalDuplicator extends GregtechMeta_MultiBlockBase } if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_ElementalDataOrbHolder) { log("Found GT_MetaTileEntity_Hatch_ElementalDataOrbHolder"); - return addToMachineListInternal(mDataHolders, aMetaTileEntity, aBaseCasingIndex); + ((GT_MetaTileEntity_Hatch_ElementalDataOrbHolder) aTileEntity).mRecipeMap = getRecipeMap(); + return addToMachineListInternal(mReplicatorDataOrbHatches, aMetaTileEntity, aBaseCasingIndex); } return super.addToMachineList(aTileEntity, aBaseCasingIndex); } - public int getMachineCasingTierCheck(IGregTechTileEntity aBaseMetaTileEntity, int xDir, int zDir) { - return 10; - } - - @Override public int getMaxEfficiency(final ItemStack aStack) { return 10000; @@ -610,7 +520,7 @@ public class GregtechMTE_ElementalDuplicator extends GregtechMeta_MultiBlockBase @Override public int getPollutionPerTick(final ItemStack aStack) { - return 0; + return 100; } @Override @@ -633,24 +543,13 @@ public class GregtechMTE_ElementalDuplicator extends GregtechMeta_MultiBlockBase return 50 * (this.mCoilTier - 2); } - public int getMaxCatalystDurability() { - return 50; - } - @Override public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { if (aBaseMetaTileEntity.isServerSide()) { if (this.mUpdate == 1 || this.mStartUpCheck == 1) { - this.mDataHolders.clear(); + this.mReplicatorDataOrbHatches.clear(); } } - // Silly Client Syncing - if (aBaseMetaTileEntity.isClientSide()) { - if (this != null && this.getBaseMetaTileEntity() != null && this.getBaseMetaTileEntity().getWorld() != null) { - this.mSolidCasingTier = getCasingTierOnClientSide(); - markDirty(); - } - } super.onPostTick(aBaseMetaTileEntity, aTick); } @@ -669,325 +568,177 @@ public class GregtechMTE_ElementalDuplicator extends GregtechMeta_MultiBlockBase 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. - - // Reset outputs and progress stats - this.mEUt = 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)); - long tEnergy = getMaxInputEnergy(); - log("Running checkRecipeGeneric(0)"); - - // checks if it has a catalyst with enough durability - ItemStack tCatalystRecipe = findCatalyst(aItemInputs); - if (tCatalystRecipe == null) { - log("does not have catalyst"); - return false; - } - - GT_Recipe tRecipe = 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 (tRecipe.mSpecialValue > this.mSolidCasingTier) { - log("solid tier is too low"); - return false; - } - - - aMaxParallelRecipes = this.canBufferOutputs(tRecipe, aMaxParallelRecipes); - if (aMaxParallelRecipes == 0) { - log("BAD RETURN - 2"); - return false; - } - - // checks if it has enough catalyst durabilety - ArrayList<ItemStack>tCatalysts = null; - int tMaxParrallelCatalyst = aMaxParallelRecipes; - if (tCatalystRecipe != null) { - tCatalysts = new ArrayList<ItemStack>(); - tMaxParrallelCatalyst = getCatalysts(aItemInputs, tCatalystRecipe, aMaxParallelRecipes, tCatalysts); - log("Can process "+tMaxParrallelCatalyst+" recipes. If less than "+aMaxParallelRecipes+", catalyst does not have enough durability."); - } - - if (tMaxParrallelCatalyst == 0) { - log("found not enough catalysts"); - return false; - } - - // EU discount - float tRecipeEUt = (tRecipe.mEUt * aEUPercent) / 100.0f; - float tTotalEUt = 0.0f; - log("aEUPercent "+aEUPercent); - log("mEUt "+tRecipe.mEUt); - - int parallelRecipes = 0; - - log("parallelRecipes: "+parallelRecipes); - log("aMaxParallelRecipes: "+tMaxParrallelCatalyst); - log("tTotalEUt: "+tTotalEUt); - log("tVoltage: "+tVoltage); - log("tEnergy: "+tEnergy); - log("tRecipeEUt: "+tRecipeEUt); - // Count recipes to do in parallel, consuming input items and fluids and considering input voltage limits - for (; parallelRecipes < tMaxParrallelCatalyst && tTotalEUt < (tEnergy - tRecipeEUt); parallelRecipes++) { - if (!tRecipe.isRecipeInputEqual(true, aFluidInputs, aItemInputs)) { - log("Broke at "+parallelRecipes+"."); - break; - } - log("Bumped EU from "+tTotalEUt+" to "+(tTotalEUt+tRecipeEUt)+"."); - tTotalEUt += tRecipeEUt; - } - - if (parallelRecipes == 0) { - log("BAD RETURN - 3"); - return false; - } - - // -- 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); - - this.mEUt = (int)Math.ceil(tTotalEUt); - - this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000); - this.mEfficiencyIncrease = 10000; + int aSpeedBonusPercent, int aOutputChanceRoll, GT_Recipe aRecipe, boolean isOC) { + return false; + } - // Overclock - if (this.mEUt <= 16) { - this.mEUt = (this.mEUt * (1 << tTier - 1) * (1 << tTier - 1)); - this.mMaxProgresstime = (this.mMaxProgresstime / (1 << tTier - 1)); - } else { - while (this.mEUt <= gregtech.api.enums.GT_Values.V[(tTier - 1)]) { - this.mEUt *= 4; - this.mMaxProgresstime /= 2; + private static final HashMap<Long, AutoMap<GT_Recipe>> mTieredRecipeMap = new HashMap<Long, AutoMap<GT_Recipe>>(); + private static final AutoMap<GT_Recipe> aTier0Recipes = new AutoMap<GT_Recipe>(); + private static final AutoMap<GT_Recipe> aTier1Recipes = new AutoMap<GT_Recipe>(); + private static final AutoMap<GT_Recipe> aTier2Recipes = new AutoMap<GT_Recipe>(); + private static final AutoMap<GT_Recipe> aTier3Recipes = new AutoMap<GT_Recipe>(); + private static final AutoMap<GT_Recipe> aTier4Recipes = new AutoMap<GT_Recipe>(); + private static final AutoMap<GT_Recipe> aTier5Recipes = new AutoMap<GT_Recipe>(); + private static final AutoMap<GT_Recipe> aTier6Recipes = new AutoMap<GT_Recipe>(); + private static final AutoMap<GT_Recipe> aTier7Recipes = new AutoMap<GT_Recipe>(); + private static boolean mInitRecipeCache = false; + + private static void initRecipeCaches() { + if (!mInitRecipeCache) { + mTieredRecipeMap.put((long) 0, aTier0Recipes); + mTieredRecipeMap.put((long) 1, aTier1Recipes); + mTieredRecipeMap.put((long) 2, aTier2Recipes); + mTieredRecipeMap.put((long) 3, aTier3Recipes); + mTieredRecipeMap.put((long) 4, aTier4Recipes); + mTieredRecipeMap.put((long) 5, aTier5Recipes); + mTieredRecipeMap.put((long) 6, aTier6Recipes); + mTieredRecipeMap.put((long) 7, aTier7Recipes); + for (GT_Recipe aRecipe : GTPP_Recipe.GTPP_Recipe_Map.sChemicalPlant_GT.mRecipeList) { + if (aRecipe != null) { + switch (aRecipe.mSpecialValue) { + case 0: + aTier0Recipes.add(aRecipe); + continue; + case 1: + aTier1Recipes.add(aRecipe); + continue; + case 2: + aTier2Recipes.add(aRecipe); + continue; + case 3: + aTier3Recipes.add(aRecipe); + continue; + case 4: + aTier4Recipes.add(aRecipe); + continue; + case 5: + aTier5Recipes.add(aRecipe); + continue; + case 6: + aTier6Recipes.add(aRecipe); + continue; + case 7: + aTier7Recipes.add(aRecipe); + continue; + } + } } - } - - if (this.mEUt > 0) { - this.mEUt = (-this.mEUt); - } - - - 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; + mInitRecipeCache = true; + } + } + + private static boolean areInputsEqual(GT_Recipe aComparator, ItemStack[] aInputs, FluidStack[] aFluids) { + int aInputCount = aComparator.mInputs.length; + if (aInputCount > 0) { + //Logger.INFO("Looking for recipe with "+aInputCount+" Items"); + int aMatchingInputs = 0; + recipe : for (ItemStack a : aComparator.mInputs) { + for (ItemStack b : aInputs) { + if (a.getItem() == b.getItem()) { + if (a.getItemDamage() == b.getItemDamage()) { + //Logger.INFO("Found matching Item Input - "+b.getUnlocalizedName()); + aMatchingInputs++; + continue recipe; + } + } + } } - } - - // 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; + if (aMatchingInputs != aInputCount) { + return false; } } - - // 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; + int aFluidInputCount = aComparator.mFluidInputs.length; + if (aFluidInputCount > 0) { + //Logger.INFO("Looking for recipe with "+aFluidInputCount+" Fluids"); + int aMatchingFluidInputs = 0; + recipe : for (FluidStack b : aComparator.mFluidInputs) { + //Logger.INFO("Checking for fluid "+b.getLocalizedName()); + for (FluidStack a : aFluids) { + if (GT_Utility.areFluidsEqual(a, b)) { + //Logger.INFO("Found matching Fluid Input - "+b.getLocalizedName()); + aMatchingFluidInputs++; + continue recipe; + } + else { + //Logger.INFO("Found fluid which did not match - "+a.getLocalizedName()); + } } } - } - - 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 (aMatchingFluidInputs != aFluidInputCount) { + return false; } } - - 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()]); - - // Damage catalyst once all is said and done. - if (tCatalystRecipe != null) { - log("damaging catalyst"); - damageCatalyst(tCatalystRecipe, parallelRecipes); - } - - // Commit outputs - this.mOutputItems = tOutputItems; - this.mOutputFluids = tOutputFluids; - updateSlots(); - - // Play sounds (GT++ addition - GT multiblocks play no sounds) - startProcess(); - - log("GOOD RETURN - 1"); + Logger.INFO("Recipes Match!"); return true; } - private int getCatalysts(ItemStack[] aItemInputs, ItemStack aRecipeCatalyst, int aMaxParrallel, ArrayList<ItemStack> aOutPut) { - int allowedParrallel = 0; - for (final ItemStack aInput : aItemInputs) { - if (aRecipeCatalyst.isItemEqual(aInput)) { - int aDurabilityRemaining = getMaxCatalystDurability() - getDamage(aInput); - return Math.min(aMaxParrallel, aDurabilityRemaining); - } + public GT_Recipe findRecipe(final GT_Recipe aRecipe, final long aVoltage, final long aSpecialValue, ItemStack[] aInputs, final FluidStack[] aFluids) { + if (!mInitRecipeCache) { + initRecipeCaches(); } - return allowedParrallel; - } - - private ItemStack findCatalyst(ItemStack[] aItemInputs) { - if (aItemInputs != null) { - for (final ItemStack aInput : aItemInputs) { - if (aInput != null) { - if (ItemUtils.isCatalyst(aInput)) { - return aInput; + if (this.getRecipeMap().mRecipeList.isEmpty()) { + log("No Recipes in Map to search through."); + return null; + } + else { + log("Checking tier "+aSpecialValue+" recipes and below. Using Input Voltage of "+aVoltage+"V."); + log("We have "+aInputs.length+" Items and "+aFluids.length+" Fluids."); + // Try check the cached recipe first + if (aRecipe != null) { + if (areInputsEqual(aRecipe, aInputs, aFluids)) { + if (aRecipe.mEUt <= aVoltage) { + Logger.INFO("Using cached recipe."); + return aRecipe; } } } - } - return null; - } - - private void damageCatalyst(ItemStack aStack, int parallelRecipes) { - for (int i=0; i<parallelRecipes; i++){ - if (MathUtils.randFloat(0, 10000000)/10000000f < (1.2f - (0.2 * this.mPipeCasingTier))) { - int damage = getDamage(aStack) + 1; - log("damage catalyst "+damage); - if (damage >= getMaxCatalystDurability()) { - log("consume catalyst"); - addOutput(CI.getEmptyCatalyst(1)); - aStack = null; - } - else { - log("damaging catalyst"); - setDamage(aStack, damage); + // Get all recipes for the tier + AutoMap<AutoMap<GT_Recipe>> aMasterMap = new AutoMap<AutoMap<GT_Recipe>>(); + for (long i=0;i<=aSpecialValue;i++) { + aMasterMap.add(mTieredRecipeMap.get(i)); + } + GT_Recipe aFoundRecipe = null; + + // Iterate the tiers recipes until we find the one with all inputs matching + master : for (AutoMap<GT_Recipe> aTieredMap : aMasterMap) { + for (GT_Recipe aRecipeToCheck : aTieredMap) { + if (areInputsEqual(aRecipeToCheck, aInputs, aFluids)) { + log("Found recipe with matching inputs!"); + if (aRecipeToCheck.mSpecialValue <= aSpecialValue) { + if (aRecipeToCheck.mEUt <= aVoltage) { + aFoundRecipe = aRecipeToCheck; + break master; + } + } + } } - } - else { - log("not consuming catalyst"); } - } - - - - } - - private int getDamage(ItemStack aStack) { - return ItemGenericChemBase.getCatalystDamage(aStack); - } - private void setDamage(ItemStack aStack,int aAmount) { - ItemGenericChemBase.setCatalystDamage(aStack, aAmount); - } - - - - @SideOnly(Side.CLIENT) - private final int getCasingTierOnClientSide() { - - if (this == null || this.getBaseMetaTileEntity().getWorld() == null) { - return 0; - } - try { - Block aInitStructureCheck; - int aInitStructureCheckMeta; - IGregTechTileEntity aBaseMetaTileEntity = this.getBaseMetaTileEntity(); - int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX * 3; - int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ * 3; - if (xDir == 0) { - aInitStructureCheck = aBaseMetaTileEntity.getBlockOffset(zDir, 1, 0); - aInitStructureCheckMeta = aBaseMetaTileEntity.getMetaIDOffset(zDir, 1, 0); - } - else { - aInitStructureCheck = aBaseMetaTileEntity.getBlockOffset(0, 1, xDir); - aInitStructureCheckMeta = aBaseMetaTileEntity.getMetaIDOffset(0, 1, xDir); - } - for (int aTier : mTieredBlockRegistry.keySet()) { - Triplet<Block, Integer, Integer> aData = mTieredBlockRegistry.get(aTier); - if (aData.getValue_1() == aInitStructureCheck && aData.getValue_2() == aInitStructureCheckMeta) { - return aTier; - } + // If we found a recipe, return it + if (aFoundRecipe != null) { + log("Found valid recipe."); + return aFoundRecipe; } - return 0; } - catch (Throwable t) { - t.printStackTrace(); - return 0; - } - + log("Did not find valid recipe."); + return null; } - - - */ -/* + /* * Catalyst Handling - *//* + */ - - - @Override - public ArrayList<ItemStack> getStoredInputs() { + public ArrayList<ItemStack> getStoredInputs() { ArrayList<ItemStack> tItems = super.getStoredInputs(); - for (GT_MetaTileEntity_Hatch_ElementalDataOrbHolder tHatch : mDataHolders) { - tHatch.mRecipeMap = getRecipeMap(); - if (isValidMetaTileEntity(tHatch)) { - ArrayList<ItemStack> aTempList = new ArrayList(); - for (ItemStack s : tHatch.mInventory) { - aTempList.add(s); - } - tItems.addAll(aTempList); - } - } + for (GT_MetaTileEntity_Hatch_ElementalDataOrbHolder tHatch : mReplicatorDataOrbHatches) { + tHatch.mRecipeMap = getRecipeMap(); + if (isValidMetaTileEntity(tHatch)) { + tItems.addAll(tHatch.getInventory()); + } + } return tItems; } - - - - } -*/ diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_FrothFlotationCell.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_FrothFlotationCell.java index 8f4fb2f706..8a936525f0 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_FrothFlotationCell.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_FrothFlotationCell.java @@ -26,6 +26,7 @@ import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import gregtech.api.util.GTPP_Recipe; 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 gtPlusPlus.xmod.gregtech.common.helpers.FlotationRecipeHandler; @@ -72,7 +73,7 @@ public class GregtechMTE_FrothFlotationCell extends GregtechMeta_MultiBlockBase .addOutputHatch("Bottom Casing", 1) .addEnergyHatch("Bottom Casing", 1) .addMaintenanceHatch("Bottom Casing", 1) - .toolTipFinisher("GT++"); + .toolTipFinisher(CORE.GT_Tooltip_Builder); return tt; } @@ -173,20 +174,15 @@ public class GregtechMTE_FrothFlotationCell extends GregtechMeta_MultiBlockBase } else { IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputBus){ - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mInputBusses.add((GT_MetaTileEntity_Hatch_InputBus)aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Maintenance){ - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mMaintenanceHatches.add((GT_MetaTileEntity_Hatch_Maintenance)aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Energy){ - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mEnergyHatches.add((GT_MetaTileEntity_Hatch_Energy)aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mInputHatches.add((GT_MetaTileEntity_Hatch_Input) aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Output) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mOutputHatches.add((GT_MetaTileEntity_Hatch_Output) aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } } return false; diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_NuclearReactor.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_NuclearReactor.java index acfa1e7c5a..1f6ae41be2 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_NuclearReactor.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_NuclearReactor.java @@ -1,46 +1,48 @@ package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production; -import java.util.ArrayList; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofChain; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.onElementPass; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose; +import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; + import java.util.Collection; import com.gtnewhorizon.structurelib.structure.IStructureDefinition; import com.gtnewhorizon.structurelib.structure.StructureDefinition; -import gregtech.api.enums.Materials; + import gregtech.api.enums.TAE; 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.metatileentity.MetaTileEntity; -import gregtech.api.metatileentity.implementations.*; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Dynamo; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Input; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Maintenance; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Muffler; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Output; import gregtech.api.objects.GT_ItemStack; import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.util.GTPP_Recipe.GTPP_Recipe_Map; import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_Recipe; -import gregtech.api.util.GTPP_Recipe; +import gregtech.api.util.GT_Recipe.GT_Recipe_Map; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.block.ModBlocks; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.material.ELEMENT; -import gtPlusPlus.core.material.nuclear.FLUORIDES; import gtPlusPlus.core.material.nuclear.NUCLIDE; import gtPlusPlus.core.util.math.MathUtils; -import gtPlusPlus.core.util.minecraft.FluidUtils; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase; import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; import net.minecraftforge.fluids.FluidStack; -import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; -import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock; -import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; +public class GregtechMTE_NuclearReactor extends GregtechMeta_MultiBlockBase<GregtechMTE_NuclearReactor> { -public class GregtechMTE_NuclearReactor extends GregtechMeta_MultiBlockBase { + protected int mFuelRemaining = 0; - protected int fuelConsumption = 0; - protected int fuelValue = 0; - protected int fuelRemaining = 0; - protected boolean boostEu = false; - protected boolean heliumSparging = false; private int mCasing; private IStructureDefinition<GregtechMTE_NuclearReactor> STRUCTURE_DEFINITION = null; @@ -64,30 +66,36 @@ public class GregtechMTE_NuclearReactor extends GregtechMeta_MultiBlockBase { } @Override + public GT_Recipe_Map getRecipeMap() { + return GTPP_Recipe_Map.sLiquidFluorineThoriumReactorRecipes; + } + + @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.") - .addInfo("Produces Heat & Energy from Radioactive Beta Decay.") - .addInfo("Outputs U233 every 10 seconds, on average") - .addInfo("Input Fluorine and Helium for bonus byproducts") - .addInfo("Input Li2BeF4 and a molten salt as fuel.") - .addInfo("LiFBeF2ThF4UF4, LiFBeF2ZrF4UF4 or LiFBeF2ZrF4U235") - .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 hatches must have IV+ tier.") - .addStructureInfo("10+ Output Hatches, 4+ Input Hatches, 4x Dynamo Hatches") - .addStructureInfo("2x Maintenance Hatches, 4x Mufflers") - .toolTipFinisher("GT++"); + .addInfo("Controller Block for the Liquid Fluoride Thorium Reactor.") + .addInfo("Produces Heat & Energy from Radioactive Beta Decay.") + .addInfo("Outputs U233 every 10 seconds, on average") + .addInfo("Input Fluorine and Helium for bonus byproducts") + .addInfo("Input Li2BeF4 and a molten salt as fuel.") + .addInfo("LiFBeF2ThF4UF4, LiFBeF2ZrF4UF4 or LiFBeF2ZrF4U235") + .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 IV or 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); return tt; } @@ -101,14 +109,10 @@ public class GregtechMTE_NuclearReactor extends GregtechMeta_MultiBlockBase { tRunning, tMaintainance, "Current Output: "+this.mEUt+" EU/t", - "Fuel Consumption: "+this.fuelConsumption+"L/t", - "Fuel Value: "+this.fuelValue+" EU/L", - "Fuel Remaining: "+this.fuelRemaining+" Litres", + "Fuel Remaining: "+this.mFuelRemaining+" Litres", "Current Efficiency: "+(this.mEfficiency/5)+"%", "Current Efficiency (Raw): "+(this.mEfficiency), - "Boosted Output: "+this.boostEu+".", - "Boosted Output gives 4x EU/t for double fuel usage.", - "It requires you to have 100% Efficiency."}; + "It requires you to have 100% Efficiency."}; } @Override @@ -118,14 +122,15 @@ public class GregtechMTE_NuclearReactor extends GregtechMeta_MultiBlockBase { @Override public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing, final byte aColorIndex, final boolean aActive, final boolean aRedstone) { - if (!aBaseMetaTileEntity.isActive() || this.mEfficiency < 500){ + boolean aWarmedUp = this.mEfficiency == this.getMaxEfficiency(null); + if (!aBaseMetaTileEntity.isActive() || !aWarmedUp){ if (aSide == aFacing) { return new ITexture[]{Textures.BlockIcons.getCasingTextureForId(TAE.GTPP_INDEX(12)), new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_REPLICATOR_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_REPLICATOR)}; } return new ITexture[]{Textures.BlockIcons.getCasingTextureForId(TAE.GTPP_INDEX(12))}; } - else if(aBaseMetaTileEntity.isActive() && this.mEfficiency >= 500){ + else if(aBaseMetaTileEntity.isActive() && aWarmedUp){ if (aSide == aFacing) { return new ITexture[]{Textures.BlockIcons.getCasingTextureForId(TAE.GTPP_INDEX(13)), new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_REPLICATOR_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_REPLICATOR)}; @@ -133,7 +138,7 @@ public class GregtechMTE_NuclearReactor extends GregtechMeta_MultiBlockBase { return new ITexture[]{Textures.BlockIcons.getCasingTextureForId(TAE.GTPP_INDEX(13))}; } return new ITexture[]{Textures.BlockIcons.getCasingTextureForId(TAE.GTPP_INDEX(12))}; - + } @Override @@ -152,17 +157,13 @@ public class GregtechMTE_NuclearReactor extends GregtechMeta_MultiBlockBase { } else { IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Maintenance){ - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mMaintenanceHatches.add((GT_MetaTileEntity_Hatch_Maintenance)aMetaTileEntity); - } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Dynamo && ((GT_MetaTileEntity_Hatch_Dynamo) aMetaTileEntity).mTier >= 5){ - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mDynamoHatches.add((GT_MetaTileEntity_Hatch_Dynamo)aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); + } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Dynamo && (((GT_MetaTileEntity_Hatch_Dynamo) aMetaTileEntity).mTier >= 5 && ((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) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mInputHatches.add((GT_MetaTileEntity_Hatch_Input) aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Output && ((GT_MetaTileEntity_Hatch_Output) aMetaTileEntity).mTier >= 5) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mOutputHatches.add((GT_MetaTileEntity_Hatch_Output) aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } } return false; @@ -174,8 +175,7 @@ public class GregtechMTE_NuclearReactor extends GregtechMeta_MultiBlockBase { } else { IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Muffler && ((GT_MetaTileEntity_Hatch_Muffler) aMetaTileEntity).mTier >= 5) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mMufflerHatches.add((GT_MetaTileEntity_Hatch_Muffler) aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } } return false; @@ -186,52 +186,51 @@ public class GregtechMTE_NuclearReactor extends GregtechMeta_MultiBlockBase { 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"}, + {"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( ofHatchAdder( GregtechMTE_NuclearReactor::addNuclearReactorEdgeList, TAE.GTPP_INDEX(12), 1 - ), + ), onElementPass( x -> ++x.mCasing, ofBlock( ModBlocks.blockCasingsMisc, 12 + ) ) ) ) - ) .addElement( 'X', ofChain( ofHatchAdder( GregtechMTE_NuclearReactor::addNuclearReactorTopList, TAE.GTPP_INDEX(12), 2 - ), + ), onElementPass( x -> ++x.mCasing, ofBlock( ModBlocks.blockCasingsMisc, 12 + ) ) ) ) - - ) .addElement( 'O', ofBlock( ModBlocks.blockCasingsMisc, 12 + ) ) - ) .addElement( 'G', ofBlock( ModBlocks.blockCasingsMisc, 13 + ) ) - ) .build(); } return STRUCTURE_DEFINITION; @@ -246,23 +245,23 @@ public class GregtechMTE_NuclearReactor extends GregtechMeta_MultiBlockBase { public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) { mCasing = 0; if (checkPiece(mName, 3, 3, 0) && mCasing >= 27) { - if (mOutputHatches.size() >= 10 && mInputHatches.size() >= 4 && mDynamoHatches.size() == 4 && + if (mOutputHatches.size() >= 3 && mInputHatches.size() >= 2 && mDynamoHatches.size() == 4 && mMufflerHatches.size() == 4 && mMaintenanceHatches.size() == 2) { - this.mWrench = true; - this.mScrewdriver = true; - this.mSoftHammer = true; - this.mHardHammer = true; - this.mSolderingTool = true; - this.mCrowbar = true; - this.turnCasingActive(false); - return true; + this.mWrench = true; + this.mScrewdriver = true; + this.mSoftHammer = true; + this.mHardHammer = true; + this.mSolderingTool = true; + this.mCrowbar = true; + this.turnCasingActive(false); + return true; } } return false; } - // Alk's Life Lessons from 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? @@ -277,7 +276,7 @@ public class GregtechMTE_NuclearReactor extends GregtechMeta_MultiBlockBase { [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) { @@ -286,13 +285,12 @@ public class GregtechMTE_NuclearReactor extends GregtechMeta_MultiBlockBase { @Override public int getMaxEfficiency(final ItemStack aStack) { - return this.boostEu ? 30000 : 10000; + return 10000; } @Override - public int getPollutionPerSecond(final ItemStack aStack) { - if (this.boostEu) return CORE.ConfigSwitches.pollutionPerSecondMultiNuclearReactor_ModeBoosted; - return CORE.ConfigSwitches.pollutionPerSecondMultiNuclearReactor_ModeNormal; + public int getPollutionPerTick(final ItemStack aStack) { + return 0; } @Override @@ -310,10 +308,6 @@ public class GregtechMTE_NuclearReactor extends GregtechMeta_MultiBlockBase { return new GregtechMTE_NuclearReactor(this.mName); } - public static int overclock(final int mStartEnergy) { - return mStartEnergy < 160000000 ? 4 : mStartEnergy < 320000000 ? 2 : 1; - } - public boolean turnCasingActive(final boolean status) { //TODO if (this.mDynamoHatches != null) { @@ -344,155 +338,94 @@ public class GregtechMTE_NuclearReactor extends GregtechMeta_MultiBlockBase { return true; } + public FluidStack[] getStoredFluidsAsArray() { + return getStoredFluids().toArray(new FluidStack[0]); + } + + public int getStoredFuel(GT_Recipe aRecipe) { + int aFuelStored = 0; + FluidStack aFuelFluid = null; + for (FluidStack aFluidInput : aRecipe.mFluidInputs) { + if (!aFluidInput.getFluid().equals(NUCLIDE.Li2BeF4.getFluid())) { + aFuelFluid = aFluidInput; + break; + } + } + if (aFuelFluid != null) { + for (GT_MetaTileEntity_Hatch_Input aInputHatch : this.mInputHatches) { + if (aInputHatch.getFluid() != null && aInputHatch.getFluidAmount() > 0) { + if (aInputHatch.getFluid().isFluidEqual(aFuelFluid)) { + aFuelStored += aInputHatch.getFluidAmount(); + } + } + } + } + return aFuelStored; + } + @Override public boolean checkRecipe(final ItemStack aStack) { - final ArrayList<FluidStack> tFluids = this.getStoredFluids(); - final Collection<GT_Recipe> tRecipeList = GTPP_Recipe.GTPP_Recipe_Map.sLiquidFluorineThoriumReactorRecipes.mRecipeList; - if((tFluids.size() > 0) && (tRecipeList != null)) { //Does input hatch have a LFTR fuel? + // Warm up for 4~ minutes + Logger.WARNING("Checking LFTR recipes."); + if (mEfficiency < this.getMaxEfficiency(null)) { + this.mProgresstime = 0; + this.mMaxProgresstime = 1; + this.mEfficiencyIncrease = 2; + Logger.WARNING("Warming Up! "+this.mEfficiency+"/"+this.getMaxEfficiency(null)); + return true; + } + Logger.WARNING("Warmed up, checking LFTR recipes."); + + final FluidStack[] tFluids = getStoredFluidsAsArray(); + final Collection<GT_Recipe> tRecipeList = getRecipeMap().mRecipeList; + 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."); - for (final FluidStack hatchFluid1 : tFluids) { //Loops through hatches - Logger.WARNING("Looping through Input hatches - Found "+hatchFluid1.getLocalizedName()); - for(final GT_Recipe aFuel : tRecipeList) { //Loops through LFTR fuel recipes - Logger.WARNING("Looping through Recipes. "+aFuel.mSpecialValue); - FluidStack tLiquid; - final FluidStack testStack = aFuel.mFluidInputs[1]; - if ((tLiquid = testStack) != null) { //Create fluidstack from current recipe - Logger.WARNING("Creating a fluidstack from the current recipe. "+testStack.getLocalizedName()); - if (hatchFluid1.isFluidEqual(tLiquid)) { //Has a LFTR fluid - this.fuelConsumption = this.boostEu ? (aFuel.mSpecialValue/4096) : (aFuel.mSpecialValue/2048); //Calc fuel consumption - - this.mMaxProgresstime = 500; - - if(tFluids.contains(NUCLIDE.LiFBeF2ThF4UF4.getFluid(1)) || - tFluids.contains(NUCLIDE.LiFBeF2ZrF4UF4.getFluid(2)) || - tFluids.contains(NUCLIDE.LiFBeF2ZrF4U235.getFluid(10))) { //Has a Primary fuel salt? - //Deplete Primary Salt. 1000L should = 1 hour of runtime (if baseEU = 2048) && using 1l each time - if(((this.mRuntime % 72) == 0) || (this.mRuntime == 0)){ - //U235 fuel is 10x less efficient than UF4 with Thorium, UF4 with Zirconium is only 2x less efficient than UF4 with Thorium. - //Most Efficient - if(tFluids.contains(NUCLIDE.LiFBeF2ThF4UF4.getFluid(2))){ - - FluidStack depletionStack = FluidUtils.getFluidStack(tLiquid, (this.boostEu ? (aFuel.mSpecialValue/4096) : (aFuel.mSpecialValue/2048))); - Logger.WARNING("Input hatch contains some FLiBe Fuel, using "+this.fuelConsumption+" | "+aFuel.mSpecialValue+" | "+depletionStack.amount); - if(this.depleteInput(depletionStack)) { //Deplete that amount - Logger.WARNING("Depleted some FLiBe fluid"); - } - - this.depleteInput(NUCLIDE.LiFBeF2ThF4UF4.getFluid(this.boostEu ? 2 : 1)); - Logger.WARNING("Depleted "+(this.boostEu ? 2 : 1)+"L of LiFBeF2ThF4UF4 fluid"); - } - //1/2 as Efficient - if (tFluids.contains(NUCLIDE.LiFBeF2ZrF4UF4.getFluid(4))){ - - FluidStack depletionStack = FluidUtils.getFluidStack(tLiquid, (this.boostEu ? (aFuel.mSpecialValue/4096) : (aFuel.mSpecialValue/2048))); - Logger.WARNING("Input hatch contains some FLiBe Fuel, using "+this.fuelConsumption+" | "+aFuel.mSpecialValue+" | "+depletionStack.amount); - if(this.depleteInput(depletionStack)) { //Deplete that amount - Logger.WARNING("Depleted some FLiBe fluid"); - } - - this.depleteInput(NUCLIDE.LiFBeF2ZrF4UF4.getFluid(this.boostEu ? 4 : 2)); - Logger.WARNING("Depleted "+(this.boostEu ? 4 : 2)+"L of LiFBeF2ZrF4UF4 fluid"); - } - //10x less Efficient. - if (tFluids.contains(NUCLIDE.LiFBeF2ZrF4U235.getFluid(20))) { - - FluidStack depletionStack = FluidUtils.getFluidStack(tLiquid, (this.boostEu ? (aFuel.mSpecialValue/4096) : (aFuel.mSpecialValue/2048))); - Logger.WARNING("Input hatch contains some FLiBe Fuel, using "+this.fuelConsumption+" | "+aFuel.mSpecialValue+" | "+depletionStack.amount); - if(this.depleteInput(depletionStack)) { //Deplete that amount - Logger.WARNING("Depleted some FLiBe fluid"); - } - - this.depleteInput(NUCLIDE.LiFBeF2ZrF4U235.getFluid(this.boostEu ? 20 : 10)); - Logger.WARNING("Depleted "+(this.boostEu ? 20 : 10)+"L of LiFBeF2ZrF4U235 fluid"); - } - } - } else { - return false; - } - - - if (this.getBaseMetaTileEntity().getWorld().getTotalWorldTime() % 100 == 0) { - //Try Sparge Noble Gases - if (this.heliumSparging){ - if (this.depleteInput(Materials.Helium.getGas(1000L))){ - //Make an empty fluid stack for possible sparging output - FluidStack[] spargeOutput = new FluidStack[]{}; - Logger.WARNING("Doing a Sparge with Helium - "+this.heliumSparging); - this.heliumSparging = false; - spargeOutput = this.getByproductsOfSparge(Materials.Helium.getGas(1000L)); - - //If Sparging occurred, try add the outputs to the output hatches. - try { - if (spargeOutput.length >= 1){ - for (final FluidStack F : spargeOutput){ - Logger.WARNING("Adding Sparge Output - "+F.getLocalizedName()); - this.addOutput(F); - } - } - } catch (final Throwable T){} - } - } - //Try Sparge Fluorides - else { - if (this.depleteInput(Materials.Fluorine.getGas(100L))){ - //Make an empty fluid stack for possible sparging output - FluidStack[] spargeOutput = new FluidStack[]{}; - Logger.WARNING("Doing a Sparge with Fluorine"); - spargeOutput = this.getByproductsOfSparge(Materials.Fluorine.getGas(100L)); - this.heliumSparging = true; - //If Sparging occurred, try add the outputs to the output hatches. - if (spargeOutput.length > 0){ - for (final FluidStack F : spargeOutput){ - Logger.WARNING("Adding Sparge Output - "+F.getLocalizedName()); - this.addOutput(F); - } - } - } - } - } - - - if (aFuel != null){ - //Utils.LOG_WARNING("Saving previous Recipe."); - //this.mLastRecipe = aFuel; - } - - this.fuelValue = aFuel.mSpecialValue; - this.fuelRemaining = hatchFluid1.amount; //Record available fuel - - if (this.mEfficiency < 500){ - this.mEfficiency++; - this.mMaxProgresstime = 500; - } - else if (this.mEfficiency == 500) { - this.mMaxProgresstime = 300; - } - else if (this.mEfficiency > 500){ - this.mEfficiency = 500; - } - Logger.WARNING("Efficiency == "+this.mEfficiency); - - this.mEUt = (this.mEfficiency < 500 ? 2048 : (8196)); //Output 0 if startup is less than 20% - Logger.WARNING("Generating "+this.mEUt+"EU/t @ an efficiency level of "+this.mEfficiency); - - this.mProgresstime = 1; - this.mMaxProgresstime = 1; - this.mEfficiencyIncrease = 15; - - //Best output some Fluids - //this.mOutputFluids = this.mLastRecipe.mFluidOutputs; - - return true; - } - } - } - } + // Find a valid recipe + 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; + } + else { + Logger.WARNING("Found recipe? "+(aFuelProcessing != null ? "true" : "false")); + for (FluidStack aFluidInput : aFuelProcessing.mFluidInputs) { + Logger.WARNING("Using "+aFluidInput.getLocalizedName()); + } + } + // Reset outputs and progress stats + this.mEUt = 0; + this.mMaxProgresstime = 0; + this.mOutputItems = new ItemStack[]{}; + this.mOutputFluids = new FluidStack[]{}; + this.mLastRecipe = aFuelProcessing; + // Deplete Inputs + if (aFuelProcessing.mFluidInputs.length > 0) { + for (FluidStack aInputToConsume : aFuelProcessing.mFluidInputs) { + Logger.WARNING("Depleting "+aInputToConsume.getLocalizedName()+" - "+aInputToConsume.amount+"L"); + this.depleteInput(aInputToConsume); + } + } + // -- Try not to fail after this point - inputs have already been consumed! -- + this.mMaxProgresstime = (int)(aFuelProcessing.mDuration); + this.mEUt = aFuelProcessing.mSpecialValue * 4; + Logger.WARNING("Outputting "+this.mEUt+"eu/t"); + this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000); + this.mEfficiencyIncrease = 10000; + this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime); + Logger.WARNING("Recipe time: "+this.mMaxProgresstime); + mFuelRemaining = getStoredFuel(aFuelProcessing); //Record available fuel + + this.mOutputFluids = aFuelProcessing.mFluidOutputs.clone(); + updateSlots(); + Logger.WARNING("Recipe Good!"); + return true; } this.mEUt = 0; this.mEfficiency = 0; + Logger.WARNING("Recipe Bad!"); return false; } - + @Override public int getMaxParallelRecipes() { return 1; @@ -503,10 +436,6 @@ public class GregtechMTE_NuclearReactor extends GregtechMeta_MultiBlockBase { return 0; } - public int getAmountOfOutputs() { - return 10; - } - @Override public void explodeMultiblock() { this.mInventory[1] = null; @@ -547,86 +476,48 @@ public class GregtechMTE_NuclearReactor extends GregtechMeta_MultiBlockBase { this.getBaseMetaTileEntity().doExplosion(explodevalue); } - - protected FluidStack[] getByproductsOfSparge(final FluidStack spargeGas){ - FluidStack[] outputArrayOfGases = new FluidStack[]{}; - if (spargeGas != null){ - if (spargeGas.isFluidEqual(Materials.Helium.getGas(1000))){ - final int outputChances[] = { - MathUtils.roundToClosestInt(MathUtils.randInt(10, 1000)/10), - MathUtils.roundToClosestInt(MathUtils.randInt(10, 600)/10), - MathUtils.roundToClosestInt(MathUtils.randInt(10, 400)/10), - MathUtils.roundToClosestInt(MathUtils.randInt(10, 1000)/10), - MathUtils.roundToClosestInt(MathUtils.randInt(10, 100)/10) - }; - final int heliumContent = (1000-outputChances[0]-outputChances[1]-outputChances[2]-outputChances[3]-outputChances[4]); - Logger.WARNING("Helium remaining: "+heliumContent); - outputArrayOfGases = new FluidStack[]{ - ELEMENT.getInstance().XENON.getFluid(outputChances[0]), - ELEMENT.getInstance().NEON.getFluid(outputChances[1]), - ELEMENT.getInstance().ARGON.getFluid(outputChances[2]), - ELEMENT.getInstance().KRYPTON.getFluid(outputChances[3]), - ELEMENT.getInstance().RADON.getFluid(outputChances[4]), - Materials.Helium.getGas(heliumContent) - }; - } - else if (spargeGas.isFluidEqual(Materials.Fluorine.getGas(100))){ - final int outputChances[] = { - MathUtils.roundToClosestInt(MathUtils.randDouble(10, 100)), - MathUtils.roundToClosestInt(MathUtils.randDouble(1, 50)/10), - MathUtils.roundToClosestInt(MathUtils.randDouble(1, 50)/10), - MathUtils.roundToClosestInt(MathUtils.randDouble(1, 50)/10) - }; - final int fluorineContent = (100-outputChances[0]-outputChances[1]-outputChances[2]-outputChances[3]); - Logger.WARNING("Fluorine remaining: "+fluorineContent); - outputArrayOfGases = new FluidStack[]{ - FLUORIDES.LITHIUM_FLUORIDE.getFluid(outputChances[0]), - FLUORIDES.NEPTUNIUM_HEXAFLUORIDE.getFluid(outputChances[1]), - FLUORIDES.TECHNETIUM_HEXAFLUORIDE.getFluid(outputChances[2]), - FLUORIDES.SELENIUM_HEXAFLUORIDE.getFluid(outputChances[3]), - Materials.Fluorine.getGas(fluorineContent) - }; - } - } - return outputArrayOfGases; - } - @Override public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { - //Add Power if active - if (aBaseMetaTileEntity.isActive()){ - //this.getBaseMetaTileEntity().increaseStoredEnergyUnits(this.mEUt, false); - - if (this.mEfficiency >= 500){ - this.boostEu = true; - this.turnCasingActive(true); + if (aBaseMetaTileEntity.getWorld().isRemote) { + if (aBaseMetaTileEntity.isActive()){ + // Set casings active if we're warmed up. + if (this.mEfficiency == this.getMaxEfficiency(null)){ + this.turnCasingActive(true); + } + else { + this.turnCasingActive(false); + } } else { - this.boostEu = false; this.turnCasingActive(false); } - - if (MathUtils.randInt(1, 200) == 1){ - //Utils.LOG_INFO("Adding U233"); - this.addOutput(ELEMENT.getInstance().URANIUM233.getFluid(MathUtils.randInt(1, 10))); - } - - if (this.mDynamoHatches != null) { - for (GT_MetaTileEntity_Hatch_Dynamo tHatch : this.mDynamoHatches) { - if (tHatch.mTier >= 5){ - if (isValidMetaTileEntity(tHatch)){ - tHatch.getBaseMetaTileEntity().increaseStoredEnergyUnits(this.mEUt, false); - //Utils.LOG_WARNING("Adding "+this.mEUt+"eu to internal storage of dynamo "+hatchNo+"."); - } - } - } + } + super.onPostTick(aBaseMetaTileEntity, aTick); + } + + @Override + public boolean onRunningTick(ItemStack aStack) { + // See if we're warmed up. + if (this.mEfficiency == this.getMaxEfficiency(null)){ + // Try output some Uranium-233 + if (MathUtils.randInt(1, 300) == 1){ + this.addOutput(ELEMENT.getInstance().URANIUM233.getFluidStack(MathUtils.randInt(1, 10))); } } - else { - this.turnCasingActive(false); - } - super.onPostTick(aBaseMetaTileEntity, aTick); + return super.onRunningTick(aStack); + } + + @Override + public void saveNBTData(NBTTagCompound aNBT) { + aNBT.setInteger("mFuelRemaining", this.mFuelRemaining); + super.saveNBTData(aNBT); + } + + @Override + public void loadNBTData(NBTTagCompound aNBT) { + this.mFuelRemaining = aNBT.getInteger("mFuelRemaining"); + super.loadNBTData(aNBT); } } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntityGeneratorArray.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntityGeneratorArray.java index db922e0841..cccee84c99 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntityGeneratorArray.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntityGeneratorArray.java @@ -22,6 +22,7 @@ import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import gregtech.api.util.GTPP_Recipe; import gtPlusPlus.api.objects.Logger; +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; @@ -72,7 +73,7 @@ public class GregtechMetaTileEntityGeneratorArray extends GregtechMeta_MultiBloc .addOutputHatch("Any Casing", 1) .addDynamoHatch("Any casing", 1) .addMaintenanceHatch("Any casing", 1) - .toolTipFinisher("GT++"); + .toolTipFinisher(CORE.GT_Tooltip_Builder); return tt; } @@ -364,23 +365,17 @@ public class GregtechMetaTileEntityGeneratorArray extends GregtechMeta_MultiBloc } else { IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputBus){ - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mInputBusses.add((GT_MetaTileEntity_Hatch_InputBus)aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Maintenance){ - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mMaintenanceHatches.add((GT_MetaTileEntity_Hatch_Maintenance)aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Dynamo){ - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mDynamoHatches.add((GT_MetaTileEntity_Hatch_Dynamo)aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_OutputBus) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mOutputBusses.add((GT_MetaTileEntity_Hatch_OutputBus) aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mInputHatches.add((GT_MetaTileEntity_Hatch_Input) aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Output) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mOutputHatches.add((GT_MetaTileEntity_Hatch_Output) aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } } return false; diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntityTreeFarm.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntityTreeFarm.java index 4fd39740a1..83b8eae458 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntityTreeFarm.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntityTreeFarm.java @@ -89,7 +89,7 @@ public class GregtechMetaTileEntityTreeFarm extends GregtechMeta_MultiBlockBase .addEnergyHatch("Any casing", 1) .addMaintenanceHatch("Any casing", 1) .addMufflerHatch("Any casing", 1) - .toolTipFinisher("GT++"); + .toolTipFinisher(CORE.GT_Tooltip_Builder); return tt; } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_AlloyBlastSmelter.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_AlloyBlastSmelter.java index b36e32d092..c84c5e162e 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_AlloyBlastSmelter.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_AlloyBlastSmelter.java @@ -81,7 +81,7 @@ extends GregtechMeta_MultiBlockBase { .addEnergyHatch("Any Casing", 1) .addMaintenanceHatch("Any Casing", 1) .addMufflerHatch("Any Casing", 1) - .toolTipFinisher("GT++"); + .toolTipFinisher(CORE.GT_Tooltip_Builder); return tt; } @@ -137,23 +137,17 @@ extends GregtechMeta_MultiBlockBase { } else { IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputBus){ - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mInputBusses.add((GT_MetaTileEntity_Hatch_InputBus)aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Maintenance){ - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mMaintenanceHatches.add((GT_MetaTileEntity_Hatch_Maintenance)aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Energy){ - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mEnergyHatches.add((GT_MetaTileEntity_Hatch_Energy)aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Muffler) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mMufflerHatches.add((GT_MetaTileEntity_Hatch_Muffler) aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mInputHatches.add((GT_MetaTileEntity_Hatch_Input) aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Output) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mOutputHatches.add((GT_MetaTileEntity_Hatch_Output) aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } } return false; diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_Cyclotron.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_Cyclotron.java index d8e91a3170..ecd4882516 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_Cyclotron.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_Cyclotron.java @@ -202,23 +202,17 @@ public class GregtechMetaTileEntity_Cyclotron extends GregtechMeta_MultiBlockBas } else { IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputBus && ((GT_MetaTileEntity_Hatch_InputBus) aMetaTileEntity).mTier >= 5){ - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mInputBusses.add((GT_MetaTileEntity_Hatch_InputBus)aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Maintenance){ - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mMaintenanceHatches.add((GT_MetaTileEntity_Hatch_Maintenance)aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Energy && ((GT_MetaTileEntity_Hatch_Energy) aMetaTileEntity).mTier >= 5){ - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mEnergyHatches.add((GT_MetaTileEntity_Hatch_Energy)aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_OutputBus && ((GT_MetaTileEntity_Hatch_OutputBus) aMetaTileEntity).mTier >= 5) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mOutputBusses.add((GT_MetaTileEntity_Hatch_OutputBus) aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Muffler && ((GT_MetaTileEntity_Hatch_Muffler) aMetaTileEntity).mTier >= 5) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mMufflerHatches.add((GT_MetaTileEntity_Hatch_Muffler) aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input && ((GT_MetaTileEntity_Hatch_Input) aMetaTileEntity).mTier >= 5) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mInputHatches.add((GT_MetaTileEntity_Hatch_Input) aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } } return false; @@ -264,7 +258,7 @@ public class GregtechMetaTileEntity_Cyclotron extends GregtechMeta_MultiBlockBas .addEnergyHatch("Any Casing", 1) .addMaintenanceHatch("Any Casing", 1) .addMufflerHatch("Any Casing", 1) - .toolTipFinisher("GT++"); + .toolTipFinisher(CORE.GT_Tooltip_Builder); return tt; } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_IndustrialFishingPond.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_IndustrialFishingPond.java index 50ae499ff7..80eb09640d 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_IndustrialFishingPond.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_IndustrialFishingPond.java @@ -85,7 +85,7 @@ public class GregtechMetaTileEntity_IndustrialFishingPond extends GregtechMeta_M .addEnergyHatch("Any Casing", 1) .addMaintenanceHatch("Any Casing", 1) .addMufflerHatch("Any Casing", 1) - .toolTipFinisher("GT++"); + .toolTipFinisher(CORE.GT_Tooltip_Builder); return tt; } @@ -129,23 +129,17 @@ public class GregtechMetaTileEntity_IndustrialFishingPond extends GregtechMeta_M } else { IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputBus){ - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mInputBusses.add((GT_MetaTileEntity_Hatch_InputBus)aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Maintenance){ - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mMaintenanceHatches.add((GT_MetaTileEntity_Hatch_Maintenance)aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Energy){ - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mEnergyHatches.add((GT_MetaTileEntity_Hatch_Energy)aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_OutputBus) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mOutputBusses.add((GT_MetaTileEntity_Hatch_OutputBus) aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Muffler) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mMufflerHatches.add((GT_MetaTileEntity_Hatch_Muffler) aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mInputHatches.add((GT_MetaTileEntity_Hatch_Input) aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } } return false; diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_LargeRocketEngine.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_LargeRocketEngine.java index 13240c78e2..d9162cea89 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_LargeRocketEngine.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_LargeRocketEngine.java @@ -18,6 +18,7 @@ import gregtech.api.util.GT_Recipe; import gregtech.api.util.GTPP_Recipe; import gtPlusPlus.core.block.ModBlocks; import gtPlusPlus.core.item.chemistry.RocketFuels; +import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.lib.LoadedMods; import gtPlusPlus.core.material.MISC_MATERIALS; import gtPlusPlus.core.util.minecraft.FluidUtils; @@ -36,7 +37,7 @@ import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock; import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; -public class GregtechMetaTileEntity_LargeRocketEngine extends GregtechMeta_MultiBlockBase +public class GregtechMetaTileEntity_LargeRocketEngine extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_LargeRocketEngine> { protected int fuelConsumption; protected int fuelValue; @@ -56,8 +57,6 @@ public class GregtechMetaTileEntity_LargeRocketEngine extends GregtechMeta_Multi private IStructureDefinition<GregtechMetaTileEntity_LargeRocketEngine> STRUCTURE_DEFINITION = null; private final static int CASING_ID = TAE.getIndexFromPage(3, 11); - - public ArrayList<GT_MetaTileEntity_Hatch> mAllDynamoHatches = new ArrayList<GT_MetaTileEntity_Hatch>(); public GregtechMetaTileEntity_LargeRocketEngine(final int aID, final String aName, final String aNameRegional) { super(aID, aName, aNameRegional); @@ -115,7 +114,7 @@ public class GregtechMetaTileEntity_LargeRocketEngine extends GregtechMeta_Multi .addMaintenanceHatch("Side center line", 1) .addDynamoHatch("Top center line", 2) .addMufflerHatch("Back Center", 3) - .toolTipFinisher("GT++"); + .toolTipFinisher(CORE.GT_Tooltip_Builder); return tt; } @@ -199,15 +198,12 @@ public class GregtechMetaTileEntity_LargeRocketEngine extends GregtechMeta_Multi } else { IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Maintenance){ - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mMaintenanceHatches.add((GT_MetaTileEntity_Hatch_Maintenance)aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Dynamo) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mAllDynamoHatches.add((GT_MetaTileEntity_Hatch_Dynamo) aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } if (LoadedMods.TecTech) { if (isThisHatchMultiDynamo(aMetaTileEntity)) { - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mAllDynamoHatches.add((GT_MetaTileEntity_Hatch) aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } } } @@ -220,17 +216,13 @@ public class GregtechMetaTileEntity_LargeRocketEngine extends GregtechMeta_Multi } else { IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Maintenance){ - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mMaintenanceHatches.add((GT_MetaTileEntity_Hatch_Maintenance)aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_AirIntake) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mAirIntakes.add(aMetaTileEntity) && this.mInputHatches.add((GT_MetaTileEntity_Hatch_Input) aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mInputHatches.add((GT_MetaTileEntity_Hatch_Input) aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputBus) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mInputBusses.add((GT_MetaTileEntity_Hatch_InputBus) aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } } return false; @@ -242,8 +234,7 @@ public class GregtechMetaTileEntity_LargeRocketEngine extends GregtechMeta_Multi } else { IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Muffler){ - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mMufflerHatches.add((GT_MetaTileEntity_Hatch_Muffler)aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } } return false; @@ -274,8 +265,7 @@ public class GregtechMetaTileEntity_LargeRocketEngine extends GregtechMeta_Multi else { int totalAir = 0; FluidStack airstack = FluidUtils.getFluidStack("air", 1); - for (Object U : this.mAirIntakes) { - GT_MetaTileEntity_Hatch_AirIntake u = (GT_MetaTileEntity_Hatch_AirIntake) U; + for (GT_MetaTileEntity_Hatch_AirIntake u : this.mAirIntakes) { if (u != null && u.mFluid != null) { // had this trow errors cousing the machine to stop probebly fixed FluidStack f = u.mFluid; @@ -317,7 +307,7 @@ public class GregtechMetaTileEntity_LargeRocketEngine extends GregtechMeta_Multi if (tFluids.size() > 0 && tRecipeList != null) { - if (tFluids.contains(MISC_MATERIALS.CARBON_DIOXIDE.getFluid(this.boostEu ? 3 : 1)) || tFluids.contains(FluidUtils.getFluidStack("carbondioxide", (this.boostEu ? 3 : 1)))) { + if (tFluids.contains(MISC_MATERIALS.CARBON_DIOXIDE.getFluidStack(this.boostEu ? 3 : 1)) || tFluids.contains(FluidUtils.getFluidStack("carbondioxide", (this.boostEu ? 3 : 1)))) { if (this.mRuntime % 72 == 0 || this.mRuntime == 0) { if (!consumeCO2()) { freeFuelTicks = 0; @@ -420,7 +410,7 @@ public class GregtechMetaTileEntity_LargeRocketEngine extends GregtechMeta_Multi } public boolean consumeCO2() { - if (this.depleteInput(MISC_MATERIALS.CARBON_DIOXIDE.getFluid(this.boostEu ? 3 : 1)) || this.depleteInput(FluidUtils.getFluidStack("carbondioxide", (this.boostEu ? 3 : 1)))) { + if (this.depleteInput(MISC_MATERIALS.CARBON_DIOXIDE.getFluidStack(this.boostEu ? 3 : 1)) || this.depleteInput(FluidUtils.getFluidStack("carbondioxide", (this.boostEu ? 3 : 1)))) { return true; } else { diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_LargeSemifluidGenerator.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_LargeSemifluidGenerator.java index 3860d27706..9be787e922 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_LargeSemifluidGenerator.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_LargeSemifluidGenerator.java @@ -67,7 +67,7 @@ public class GregtechMetaTileEntity_LargeSemifluidGenerator extends GregtechMeta .addMaintenanceHatch("Any Casing", 1) .addMufflerHatch("Any Casing", 1) .addDynamoHatch("Back Center", 2) - .toolTipFinisher("GT++"); + .toolTipFinisher(CORE.GT_Tooltip_Builder); return tt; } @@ -213,14 +213,11 @@ public class GregtechMetaTileEntity_LargeSemifluidGenerator extends GregtechMeta } else { IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Maintenance){ - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mMaintenanceHatches.add((GT_MetaTileEntity_Hatch_Maintenance)aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Muffler) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mMufflerHatches.add((GT_MetaTileEntity_Hatch_Muffler) aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mInputHatches.add((GT_MetaTileEntity_Hatch_Input) aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } } return false; @@ -231,9 +228,8 @@ public class GregtechMetaTileEntity_LargeSemifluidGenerator extends GregtechMeta return false; } else { IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); - if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Dynamo){ - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mDynamoHatches.add((GT_MetaTileEntity_Hatch_Dynamo)aMetaTileEntity); + if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Dynamo || this.isThisHatchMultiDynamo(aTileEntity)){ + return addToMachineList(aTileEntity, aBaseCasingIndex); } } return false; diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_MassFabricator.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_MassFabricator.java index 4d9df7deea..f016288547 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_MassFabricator.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_MassFabricator.java @@ -121,7 +121,7 @@ public class GregtechMetaTileEntity_MassFabricator extends GregtechMeta_MultiBlo .addEnergyHatch("Any Casing", 1) .addMaintenanceHatch("Any Casing", 1) .addMufflerHatch("Any Casing", 1) - .toolTipFinisher("GT++"); + .toolTipFinisher(CORE.GT_Tooltip_Builder); return tt; } @@ -239,26 +239,19 @@ public class GregtechMetaTileEntity_MassFabricator extends GregtechMeta_MultiBlo } else { IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputBus){ - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mInputBusses.add((GT_MetaTileEntity_Hatch_InputBus)aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Maintenance){ - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mMaintenanceHatches.add((GT_MetaTileEntity_Hatch_Maintenance)aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Energy){ - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mEnergyHatches.add((GT_MetaTileEntity_Hatch_Energy)aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_OutputBus) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mOutputBusses.add((GT_MetaTileEntity_Hatch_OutputBus) aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Muffler) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mMufflerHatches.add((GT_MetaTileEntity_Hatch_Muffler) aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mInputHatches.add((GT_MetaTileEntity_Hatch_Input) aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Output) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mOutputHatches.add((GT_MetaTileEntity_Hatch_Output) aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } } return false; diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_Refinery.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_Refinery.java index 9f21154707..f86ecf3196 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_Refinery.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_Refinery.java @@ -58,10 +58,10 @@ public class GregtechMetaTileEntity_Refinery extends GregtechMeta_MultiBlockBase .addMufflerHatch("Base platform", 1) .addMaintenanceHatch("Base platform", 1) .addEnergyHatch("Base platform", 1) - .addStructureInfo("Muffler's Tier must be ZPM/ZPM+") + .addStructureInfo("Muffler's Tier must be LuV+") .addStructureInfo("4x Input Hatches, 2x Output Hatches, 1x Output Bus") .addStructureInfo("1x Muffler, 1x Maintenance Hatch, 1x Energy Hatch") - .toolTipFinisher("GT++"); + .toolTipFinisher(CORE.GT_Tooltip_Builder); return tt; } @@ -115,23 +115,17 @@ public class GregtechMetaTileEntity_Refinery extends GregtechMeta_MultiBlockBase } else { IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Maintenance){ - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mMaintenanceHatches.add((GT_MetaTileEntity_Hatch_Maintenance)aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Energy){ - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mEnergyHatches.add((GT_MetaTileEntity_Hatch_Energy)aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_OutputBus) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mOutputBusses.add((GT_MetaTileEntity_Hatch_OutputBus) aMetaTileEntity); - } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Muffler && ((GT_MetaTileEntity_Hatch_Muffler) aMetaTileEntity).mTier >= 7) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mMufflerHatches.add((GT_MetaTileEntity_Hatch_Muffler) aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); + } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Muffler && ((GT_MetaTileEntity_Hatch_Muffler) aMetaTileEntity).mTier >= 6) { + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mInputHatches.add((GT_MetaTileEntity_Hatch_Input) aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Output) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mOutputHatches.add((GT_MetaTileEntity_Hatch_Output) aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } } return false; diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/algae/GregtechMTE_AlgaePondBase.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/algae/GregtechMTE_AlgaePondBase.java index c06f764bfe..4759457d8d 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/algae/GregtechMTE_AlgaePondBase.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/algae/GregtechMTE_AlgaePondBase.java @@ -28,6 +28,7 @@ import gregtech.api.util.GT_Utility; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.block.ModBlocks; import gtPlusPlus.core.item.chemistry.AgriculturalChem; +import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.util.minecraft.FluidUtils; import gtPlusPlus.core.util.minecraft.ItemUtils; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase; @@ -85,7 +86,7 @@ public class GregtechMTE_AlgaePondBase extends GregtechMeta_MultiBlockBase { .addInputBus("Any Casing", 1) .addOutputBus("Any Casing", 1) .addInputHatch("Any Casing", 1) - .toolTipFinisher("GT++"); + .toolTipFinisher(CORE.GT_Tooltip_Builder); return tt; } @@ -154,14 +155,11 @@ public class GregtechMTE_AlgaePondBase extends GregtechMeta_MultiBlockBase { } else { IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputBus){ - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mInputBusses.add((GT_MetaTileEntity_Hatch_InputBus)aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_OutputBus) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mOutputBusses.add((GT_MetaTileEntity_Hatch_OutputBus) aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); }else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mInputHatches.add((GT_MetaTileEntity_Hatch_Input) aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } } return false; diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/chemplant/GregtechMTE_ChemicalPlant.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/chemplant/GregtechMTE_ChemicalPlant.java index 5edff05e48..42912c4fa8 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/chemplant/GregtechMTE_ChemicalPlant.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/chemplant/GregtechMTE_ChemicalPlant.java @@ -1,6 +1,8 @@ package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production.chemplant; -import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofChain; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.onElementPass; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose; import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; import static gtPlusPlus.core.util.data.ArrayUtils.removeNulls; @@ -8,14 +10,12 @@ import java.util.ArrayList; import java.util.HashMap; import java.util.List; +import org.apache.commons.lang3.ArrayUtils; + import com.gtnewhorizon.structurelib.StructureLibAPI; import com.gtnewhorizon.structurelib.structure.IStructureDefinition; import com.gtnewhorizon.structurelib.structure.IStructureElement; import com.gtnewhorizon.structurelib.structure.StructureDefinition; -import gregtech.api.metatileentity.implementations.*; -import gregtech.api.util.*; -import net.minecraft.world.World; -import org.apache.commons.lang3.ArrayUtils; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @@ -24,7 +24,19 @@ 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.metatileentity.implementations.GT_MetaTileEntity_Hatch; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Input; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_InputBus; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Maintenance; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Output; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_OutputBus; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_TieredMachineBlock; import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.util.GTPP_Recipe; +import gregtech.api.util.GT_Multiblock_Tooltip_Builder; +import gregtech.api.util.GT_Recipe; +import gregtech.api.util.GT_Utility; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.api.objects.data.AutoMap; import gtPlusPlus.api.objects.data.Triplet; @@ -39,6 +51,7 @@ 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.world.World; import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.FluidStack; @@ -115,7 +128,7 @@ public class GregtechMTE_ChemicalPlant extends GregtechMeta_MultiBlockBase { .addOutputHatch("Bottom Casing", 1) .addEnergyHatch("Bottom Casing", 1) .addMaintenanceHatch("Bottom Casing", 1) - .toolTipFinisher("GT++"); + .toolTipFinisher(CORE.GT_Tooltip_Builder); return tt; } @@ -354,24 +367,24 @@ public class GregtechMTE_ChemicalPlant extends GregtechMeta_MultiBlockBase { } else { IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Catalysts){ - return addToMachineListInternal(mCatalystBuses, aMetaTileEntity, aBaseCasingIndex); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputBus){ maxTierOfHatch = Math.max(maxTierOfHatch, ((GT_MetaTileEntity_Hatch_InputBus) aMetaTileEntity).mTier); - return this.mInputBusses.add((GT_MetaTileEntity_Hatch_InputBus)aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Maintenance){ - return this.mMaintenanceHatches.add((GT_MetaTileEntity_Hatch_Maintenance)aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Energy){ maxTierOfHatch = Math.max(maxTierOfHatch, ((GT_MetaTileEntity_Hatch_Energy) aMetaTileEntity).mTier); - return this.mEnergyHatches.add((GT_MetaTileEntity_Hatch_Energy)aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_OutputBus) { maxTierOfHatch = Math.max(maxTierOfHatch, ((GT_MetaTileEntity_Hatch_OutputBus) aMetaTileEntity).mTier); - return this.mOutputBusses.add((GT_MetaTileEntity_Hatch_OutputBus) aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input) { maxTierOfHatch = Math.max(maxTierOfHatch, ((GT_MetaTileEntity_Hatch_Input) aMetaTileEntity).mTier); - return this.mInputHatches.add((GT_MetaTileEntity_Hatch_Input) aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Output) { maxTierOfHatch = Math.max(maxTierOfHatch, ((GT_MetaTileEntity_Hatch_Output) aMetaTileEntity).mTier); - return this.mOutputHatches.add((GT_MetaTileEntity_Hatch_Output) aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } } return false; @@ -414,7 +427,7 @@ public class GregtechMTE_ChemicalPlant extends GregtechMeta_MultiBlockBase { } public static void generateRecipes() { - for (GTPP_Recipe i : GTPP_Recipe.GTPP_Recipe_Map.sChemicalPlantRecipes.mRecipeList) { + for (GT_Recipe i : GTPP_Recipe.GTPP_Recipe_Map.sChemicalPlantRecipes.mRecipeList) { GTPP_Recipe.GTPP_Recipe_Map.sChemicalPlant_GT.add(i); } } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/storage/GregtechMetaTileEntity_PowerSubStationController.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/storage/GregtechMetaTileEntity_PowerSubStationController.java index b09c5e611b..a90c962cae 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/storage/GregtechMetaTileEntity_PowerSubStationController.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/storage/GregtechMetaTileEntity_PowerSubStationController.java @@ -1,18 +1,25 @@ package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.storage; -import java.util.ArrayList; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofChain; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.onElementPass; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose; +import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; import com.gtnewhorizon.structurelib.StructureLibAPI; import com.gtnewhorizon.structurelib.structure.IStructureDefinition; import com.gtnewhorizon.structurelib.structure.IStructureElement; import com.gtnewhorizon.structurelib.structure.StructureDefinition; + import gregtech.api.enums.TAE; 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.metatileentity.MetaTileEntity; -import gregtech.api.metatileentity.implementations.*; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Dynamo; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy; import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_Utility; @@ -37,11 +44,7 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumChatFormatting; import net.minecraft.world.World; -import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; -import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock; -import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; - -public class GregtechMetaTileEntity_PowerSubStationController extends GregtechMeta_MultiBlockBase { +public class GregtechMetaTileEntity_PowerSubStationController extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_PowerSubStationController> { protected long mAverageEuUsage = 0; protected long mTotalEnergyAdded = 0; @@ -56,10 +59,6 @@ public class GregtechMetaTileEntity_PowerSubStationController extends GregtechMe private int[] cellCount = new int[6]; private IStructureDefinition<GregtechMetaTileEntity_PowerSubStationController> STRUCTURE_DEFINITION = null; - //TecTech Support - public ArrayList<GT_MetaTileEntity_Hatch> mAllEnergyHatches = new ArrayList<GT_MetaTileEntity_Hatch>(); - public ArrayList<GT_MetaTileEntity_Hatch> mAllDynamoHatches = new ArrayList<GT_MetaTileEntity_Hatch>(); - public GregtechMetaTileEntity_PowerSubStationController(final int aID, final String aName, final String aNameRegional) { super(aID, aName, aNameRegional); } @@ -89,7 +88,7 @@ public class GregtechMetaTileEntity_PowerSubStationController extends GregtechMe .addCasingInfo("Sub-Station External Casings", 10) .addDynamoHatch("Any Casing", 1) .addEnergyHatch("Any Casing", 1) - .toolTipFinisher("GT++"); + .toolTipFinisher(CORE.GT_Tooltip_Builder); return tt; } @@ -345,18 +344,14 @@ public class GregtechMetaTileEntity_PowerSubStationController extends GregtechMe } else { IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Energy) { - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mAllEnergyHatches.add((GT_MetaTileEntity_Hatch_Energy)aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Dynamo) { - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mAllDynamoHatches.add((GT_MetaTileEntity_Hatch_Dynamo)aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } if (LoadedMods.TecTech) { if (isThisHatchMultiDynamo(aMetaTileEntity)) { - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mAllDynamoHatches.add((GT_MetaTileEntity_Hatch) aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (isThisHatchMultiEnergy(aMetaTileEntity)) { - ((GT_MetaTileEntity_Hatch)aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mAllEnergyHatches.add((GT_MetaTileEntity_Hatch) aMetaTileEntity); + return addToMachineList(aTileEntity, aBaseCasingIndex); } } } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GT_MetaTileEntity_ConnectableCrate.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GT_MetaTileEntity_ConnectableCrate.java index e6d825ea8f..a3c11d486b 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GT_MetaTileEntity_ConnectableCrate.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GT_MetaTileEntity_ConnectableCrate.java @@ -19,6 +19,7 @@ import gregtech.api.util.GT_Utility; import gtPlusPlus.api.objects.data.AutoMap; import gtPlusPlus.api.objects.minecraft.BlockPos; +import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.util.data.ArrayUtils; import gtPlusPlus.xmod.gregtech.api.gui.CONTAINER_SuperChest; import gtPlusPlus.xmod.gregtech.api.gui.GUI_SuperChest; @@ -73,6 +74,13 @@ public class GT_MetaTileEntity_ConnectableCrate extends GT_MetaTileEntity_Tiered public GT_MetaTileEntity_ConnectableCrate(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}; + } public boolean isSimpleMachine() { return true; diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GT_MetaTileEntity_TieredChest.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GT_MetaTileEntity_TieredChest.java index bb46a0060d..951b4223dc 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GT_MetaTileEntity_TieredChest.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GT_MetaTileEntity_TieredChest.java @@ -12,7 +12,7 @@ import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_TieredMachineBlock; import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.util.GT_Utility; - +import gtPlusPlus.core.lib.CORE; import gtPlusPlus.xmod.gregtech.api.gui.CONTAINER_SuperChest; import gtPlusPlus.xmod.gregtech.api.gui.GUI_SuperChest; @@ -33,6 +33,13 @@ public class GT_MetaTileEntity_TieredChest extends GT_MetaTileEntity_TieredMachi /*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}; + } public boolean isSimpleMachine() { return true; diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GT_MetaTileEntity_TieredTank.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GT_MetaTileEntity_TieredTank.java index ad9876bcf0..ef7fe829d4 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GT_MetaTileEntity_TieredTank.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GT_MetaTileEntity_TieredTank.java @@ -29,13 +29,13 @@ public class GT_MetaTileEntity_TieredTank extends GT_MetaTileEntity_BasicTank { public String[] getDescription() { String[] aTip; - String aTankPortableness = CORE.GTNH ? "non-portable" : "portable"; + String aTankPortableness = "portable"; if (this.mFluid == null) { - aTip = new String[] {this.mDescription, "A "+aTankPortableness+" tank."}; + 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"}; + aTip = new String[] {this.mDescription, "A "+aTankPortableness+" tank.", "Fluid: "+mFluid.getLocalizedName()+" "+mFluid.amount+"L", CORE.GT_Tooltip}; } return aTip; } @@ -146,7 +146,7 @@ public class GT_MetaTileEntity_TieredTank extends GT_MetaTileEntity_BasicTank { @Override public void setItemNBT(NBTTagCompound aNBT) { - if (CORE.NBT_PERSISTENCY_PATCH_APPLIED && !CORE.GTNH) { + if (CORE.NBT_PERSISTENCY_PATCH_APPLIED) { if (mFluid != null){ Logger.WARNING("Setting item fluid nbt"); aNBT.setTag("mFluid", mFluid.writeToNBT(new NBTTagCompound())); diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GregtechMetaEnergyBuffer.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GregtechMetaEnergyBuffer.java index 4f0197c060..320e2175b0 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GregtechMetaEnergyBuffer.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GregtechMetaEnergyBuffer.java @@ -38,7 +38,11 @@ public class GregtechMetaEnergyBuffer extends GregtechMetaTileEntity { @Override public String[] getDescription() { - return new String[] {this.mDescription, "Defaults 4A In/Out", "Change output Amperage with a screwdriver", "Now Portable!"}; + return new String[] {this.mDescription, + "Defaults 4A In/Out", + "Change output Amperage with a screwdriver", + "Now Portable!", + CORE.GT_Tooltip}; } @Override diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GregtechMetaSafeBlock.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GregtechMetaSafeBlock.java index b52ed040f4..63042d4702 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GregtechMetaSafeBlock.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GregtechMetaSafeBlock.java @@ -16,11 +16,6 @@ import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.machines public class GregtechMetaSafeBlock extends GregtechMetaSafeBlockBase { - @Override - public String[] getDescription() { - return new String[] {this.mDescription}; - } - public GregtechMetaSafeBlock(final int aID, final String aName, final String aNameRegional, final int aTier) { super(aID, aName, aNameRegional, aTier, 28, "Protecting your items from sticky fingers."); } @@ -32,6 +27,13 @@ extends GregtechMetaSafeBlockBase { 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}; + } @Override public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) { diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/creative/GT_MetaTileEntity_InfiniteItemHolder.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/creative/GT_MetaTileEntity_InfiniteItemHolder.java index 529a0b79f6..fb37f33055 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/creative/GT_MetaTileEntity_InfiniteItemHolder.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/creative/GT_MetaTileEntity_InfiniteItemHolder.java @@ -7,7 +7,7 @@ import net.minecraft.item.ItemStack; 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.PlayerUtils; import gtPlusPlus.core.util.sys.KeyboardUtils; import gtPlusPlus.xmod.gregtech.common.tileentities.storage.GT_MetaTileEntity_TieredChest; @@ -21,6 +21,13 @@ public class GT_MetaTileEntity_InfiniteItemHolder extends GT_MetaTileEntity_Tier 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}; + } @Override public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) { diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tools/TOOL_Gregtech_AngelGrinder.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tools/TOOL_Gregtech_AngleGrinder.java index 905164802c..27f118e363 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tools/TOOL_Gregtech_AngelGrinder.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tools/TOOL_Gregtech_AngleGrinder.java @@ -26,7 +26,7 @@ import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.IChatComponent; import net.minecraftforge.event.world.BlockEvent; -public class TOOL_Gregtech_AngelGrinder +public class TOOL_Gregtech_AngleGrinder extends GT_Tool { public static final List<String> mEffectiveList = Arrays.asList(new String[]{EntityIronGolem.class.getName(), "EntityTowerGuardian"}); @@ -162,7 +162,7 @@ extends GT_Tool { } public short[] getRGBa(boolean aIsToolHead, ItemStack aStack) { - return !aIsToolHead + return aIsToolHead ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mRGBa : Materials.TungstenSteel.mRGBa; } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tools/TOOL_Gregtech_ElectricSnips.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tools/TOOL_Gregtech_ElectricSnips.java index 3da1763634..2277ce339f 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tools/TOOL_Gregtech_ElectricSnips.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tools/TOOL_Gregtech_ElectricSnips.java @@ -1,6 +1,7 @@ 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; @@ -70,9 +71,9 @@ extends GT_Tool_WireCutter { } public short[] getRGBa(boolean aIsToolHead, ItemStack aStack) { - return !aIsToolHead + return aIsToolHead ? GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mRGBa - : GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mRGBa; + : Materials.TungstenSteel.mRGBa; } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_BlastSmelter.java b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_BlastSmelter.java index 9e00ada163..9e58d486d3 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_BlastSmelter.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_BlastSmelter.java @@ -131,13 +131,13 @@ public class RecipeGen_BlastSmelter extends RecipeGen_Base { //Generate Recipes for all singular materials that can be made molten. if (hasMoreInputThanACircuit){ if (M.requiresBlastFurnace()) { - if (CORE.RA.addBlastSmelterRecipe(tItemStackTest, M.getFluid(fluidAmount), 100, (duration/(mTotalPartsCounter > 0 ? mTotalPartsCounter : 1)), (int) aVoltage)){ + if (CORE.RA.addBlastSmelterRecipe(tItemStackTest, M.getFluidStack(fluidAmount), 100, (duration/(mTotalPartsCounter > 0 ? mTotalPartsCounter : 1)), (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.getFluid(144), 100, duration, 120)){ + 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.getFluid(16), 100, duration/9, 120)){ + 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)){ @@ -153,14 +153,14 @@ public class RecipeGen_BlastSmelter extends RecipeGen_Base { } } else { - if (CORE.RA.addBlastSmelterRecipe(tItemStackTest, M.getFluid(fluidAmount), 100, duration/(mTotalPartsCounter > 0 ? mTotalPartsCounter : 1)/2, (int) aVoltage)){ + if (CORE.RA.addBlastSmelterRecipe(tItemStackTest, M.getFluidStack(fluidAmount), 100, duration/(mTotalPartsCounter > 0 ? mTotalPartsCounter : 1)/2, (int) aVoltage)){ Logger.WARNING("[BAS] Success."); - if (GT_Values.RA.addFluidSolidifierRecipe(ItemList.Shape_Mold_Ingot.get(0), M.getFluid(144), M.getIngot(1), duration/2, 60)){ + if (GT_Values.RA.addFluidSolidifierRecipe(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.getFluid(144), 100, duration/2, 60)){ + 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.getFluid(16), 100, duration/2/9, 60)){ + 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)){ @@ -212,7 +212,7 @@ public class RecipeGen_BlastSmelter extends RecipeGen_Base { final int xr = r; if ((xr > 0) && (xr <= 100)){ final int mathmatics = (r*1000); - componentsFluid = FluidUtils.getFluidStack(M.getComposites().get(irc).getStackMaterial().getFluid(mathmatics), mathmatics); + componentsFluid = FluidUtils.getFluidStack(M.getComposites().get(irc).getStackMaterial().getFluidStack(mathmatics), mathmatics); } } else { @@ -254,7 +254,7 @@ public class RecipeGen_BlastSmelter extends RecipeGen_Base { //Adds Recipe if (M.requiresBlastFurnace()) { - if (CORE.RA.addBlastSmelterRecipe(components, componentsFluid, M.getFluid(fluidAmount), 100, duration, (int) aVoltage)){ + if (CORE.RA.addBlastSmelterRecipe(components, componentsFluid, M.getFluidStack(fluidAmount), 100, duration, (int) aVoltage)){ Logger.WARNING("[BAS] Success."); } else { @@ -262,7 +262,7 @@ public class RecipeGen_BlastSmelter extends RecipeGen_Base { } } else { - if (CORE.RA.addBlastSmelterRecipe(components, componentsFluid, M.getFluid(fluidAmount), 100, duration, (int) aVoltage/2)){ + if (CORE.RA.addBlastSmelterRecipe(components, componentsFluid, M.getFluidStack(fluidAmount), 100, duration, (int) aVoltage/2)){ Logger.WARNING("[BAS] Success."); } else { diff --git a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_DustGeneration.java b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_DustGeneration.java index a346464eeb..24c8eb488f 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_DustGeneration.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_DustGeneration.java @@ -38,71 +38,72 @@ public class RecipeGen_DustGeneration extends RecipeGen_Base { this.toGenerate = M; this.disableOptional = O; mRecipeGenMap.add(this); - } - - @Override - public void run() { - generateRecipes(this.toGenerate, this.disableOptional); - } - - private void generateRecipes(final Material material, final boolean disableOptional){ - - Logger.WARNING("Generating Shaped Crafting recipes for "+material.getLocalizedName()); - - final ItemStack normalDust = material.getDust(1); - final ItemStack smallDust = material.getSmallDust(1); - final ItemStack tinyDust = material.getTinyDust(1); - - final ItemStack[] inputStacks = material.getMaterialComposites(); - final ItemStack outputStacks = material.getDust(material.smallestStackSizeWhenProcessing); - - - if (ItemUtils.checkForInvalidItems(tinyDust) && ItemUtils.checkForInvalidItems(normalDust)) { + final ItemStack normalDust = M.getDust(1); + final ItemStack smallDust = M.getSmallDust(1); + final ItemStack tinyDust = M.getTinyDust(1); + if (tinyDust != null && normalDust != null) { if (RecipeUtils.addShapedRecipe( - tinyDust, tinyDust, tinyDust, + tinyDust, tinyDust, tinyDust, tinyDust, tinyDust, tinyDust, tinyDust, tinyDust, tinyDust, normalDust)){ - Logger.WARNING("9 Tiny dust to 1 Dust Recipe: "+material.getLocalizedName()+" - Success"); + Logger.INFO("9 Tiny dust to 1 Dust Recipe: "+M.getLocalizedName()+" - Success"); } else { - Logger.WARNING("9 Tiny dust to 1 Dust Recipe: "+material.getLocalizedName()+" - Failed"); + Logger.INFO("9 Tiny dust to 1 Dust Recipe: "+M.getLocalizedName()+" - Failed"); } 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"); + M.getTinyDust(9))){ + Logger.INFO("9 Tiny dust from 1 Recipe: "+M.getLocalizedName()+" - Success"); } else { - Logger.WARNING("9 Tiny dust from 1 Recipe: "+material.getLocalizedName()+" - Failed"); + Logger.INFO("9 Tiny dust from 1 Recipe: "+M.getLocalizedName()+" - Failed"); } } - if (ItemUtils.checkForInvalidItems(smallDust) && ItemUtils.checkForInvalidItems(normalDust)) { + if (smallDust != null && normalDust != null) { if (RecipeUtils.addShapedRecipe( smallDust, smallDust, null, smallDust, smallDust, null, null, null, null, normalDust)){ - Logger.WARNING("4 Small dust to 1 Dust Recipe: "+material.getLocalizedName()+" - Success"); + Logger.INFO("4 Small dust to 1 Dust Recipe: "+M.getLocalizedName()+" - Success"); } else { - Logger.WARNING("4 Small dust to 1 Dust Recipe: "+material.getLocalizedName()+" - Failed"); + Logger.INFO("4 Small dust to 1 Dust Recipe: "+M.getLocalizedName()+" - Failed"); } if (RecipeUtils.addShapedRecipe( null, normalDust, null, null, null, null, null, null, null, - material.getSmallDust(4))){ - Logger.WARNING("4 Small dust from 1 Dust Recipe: "+material.getLocalizedName()+" - Success"); + M.getSmallDust(4))){ + Logger.INFO("4 Small dust from 1 Dust Recipe: "+M.getLocalizedName()+" - Success"); } else { - Logger.WARNING("4 Small dust from 1 Dust Recipe: "+material.getLocalizedName()+" - Failed"); + Logger.INFO("4 Small dust from 1 Dust Recipe: "+M.getLocalizedName()+" - Failed"); } } + } + + @Override + public void run() { + generateRecipes(this.toGenerate, this.disableOptional); + } + + private void generateRecipes(final Material material, final boolean disableOptional){ + + Logger.INFO("Generating Shaped Crafting recipes for "+material.getLocalizedName()); + + final ItemStack normalDust = material.getDust(1); + final ItemStack smallDust = material.getSmallDust(1); + final ItemStack tinyDust = material.getTinyDust(1); + + final ItemStack[] inputStacks = material.getMaterialComposites(); + final ItemStack outputStacks = material.getDust(material.smallestStackSizeWhenProcessing); //Macerate blocks back to dusts. final ItemStack materialBlock = material.getBlock(1); @@ -192,7 +193,7 @@ public class RecipeGen_DustGeneration extends RecipeGen_Base { if (x.getStackMaterial() != null){ if (x.getStackMaterial().getDust(1) == null){ if (x.getStackMaterial().getState() != MaterialState.SOLID && x.getStackMaterial().getState() != MaterialState.ORE && x.getStackMaterial().getState() != MaterialState.PLASMA){ - oxygen = x.getStackMaterial().getFluid(1000); + oxygen = x.getStackMaterial().getFluidStack(1000); break; } } @@ -297,8 +298,8 @@ public class RecipeGen_DustGeneration extends RecipeGen_Base { if (x.getStackMaterial() != null){ if (x.getStackMaterial().getDust(1) == null){ MaterialState f = x.getStackMaterial().getState(); - if (f == MaterialState.GAS || f == MaterialState.LIQUID || f == MaterialState.PURE_LIQUID){ - oxygen = x.getStackMaterial().getFluid((int) (material.vSmallestRatio[compSlot] * 1000)); + if (f == MaterialState.GAS || f == MaterialState.LIQUID || f == MaterialState.PURE_LIQUID || f == MaterialState.PURE_GAS){ + oxygen = x.getStackMaterial().getFluidStack((int) (material.vSmallestRatio[compSlot] * 1000)); } } } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Fluids.java b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Fluids.java index 3c74c4166d..e87fc08c90 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Fluids.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Fluids.java @@ -41,8 +41,8 @@ public class RecipeGen_Fluids extends RecipeGen_Base { } // Melting Shapes to fluid - if (material.getFluid(1) != null - && !material.getFluid(1).getUnlocalizedName().toLowerCase().contains("plasma")) { + if (material.getFluidStack(1) != null + && !material.getFluidStack(1).getUnlocalizedName().toLowerCase().contains("plasma")) { if (!material.requiresBlastFurnace()) { @@ -50,7 +50,7 @@ public class RecipeGen_Fluids extends RecipeGen_Base { if (ItemUtils.checkForInvalidItems(material.getIngot(1))) if (CORE.RA.addFluidExtractionRecipe( material.getIngot(1), // Input - material.getFluid(144), // Fluid Output + material.getFluidStack(144), // Fluid Output 1 * 20, // Duration material.vVoltageMultiplier // Eu Tick )) { @@ -65,7 +65,7 @@ public class RecipeGen_Fluids extends RecipeGen_Base { if (ItemUtils.checkForInvalidItems(material.getPlate(1))) if (CORE.RA.addFluidExtractionRecipe( material.getPlate(1), // Input - material.getFluid(144), // Fluid Output + material.getFluidStack(144), // Fluid Output 1 * 20, // Duration material.vVoltageMultiplier // Eu Tick )) { @@ -80,7 +80,7 @@ public class RecipeGen_Fluids extends RecipeGen_Base { if (ItemUtils.checkForInvalidItems(material.getPlateDouble(1))) if (CORE.RA.addFluidExtractionRecipe( material.getPlateDouble(1), // Input - material.getFluid(288), // Fluid Output + material.getFluidStack(288), // Fluid Output 1 * 20, // Duration material.vVoltageMultiplier // Eu Tick )) { @@ -95,7 +95,7 @@ public class RecipeGen_Fluids extends RecipeGen_Base { if (ItemUtils.checkForInvalidItems(material.getNugget(1))) if (CORE.RA.addFluidExtractionRecipe( material.getNugget(1), // Input - material.getFluid(16), // Fluid Output + material.getFluidStack(16), // Fluid Output 16, // Duration material.vVoltageMultiplier // Eu Tick )) { @@ -110,7 +110,7 @@ public class RecipeGen_Fluids extends RecipeGen_Base { if (ItemUtils.checkForInvalidItems(material.getBlock(1))) if (CORE.RA.addFluidExtractionRecipe( material.getBlock(1), // Input - material.getFluid(144 * 9), // Fluid Output + material.getFluidStack(144 * 9), // Fluid Output 288, // Duration material.vVoltageMultiplier // Eu Tick )) { @@ -128,7 +128,7 @@ public class RecipeGen_Fluids extends RecipeGen_Base { // Ingot if (ItemUtils.checkForInvalidItems(material.getIngot(1))) if (GT_Values.RA.addFluidSolidifierRecipe(ItemList.Shape_Mold_Ingot.get(0), // Item Shape - material.getFluid(144), // Fluid Input + material.getFluidStack(144), // Fluid Input material.getIngot(1), // output 32, // Duration material.vVoltageMultiplier // Eu Tick @@ -143,7 +143,7 @@ public class RecipeGen_Fluids extends RecipeGen_Base { // Plate if (ItemUtils.checkForInvalidItems(material.getPlate(1))) if (GT_Values.RA.addFluidSolidifierRecipe(ItemList.Shape_Mold_Plate.get(0), // Item Shape - material.getFluid(144), // Fluid Input + material.getFluidStack(144), // Fluid Input material.getPlate(1), // output 32, // Duration material.vVoltageMultiplier // Eu Tick @@ -158,7 +158,7 @@ public class RecipeGen_Fluids extends RecipeGen_Base { // Nugget if (ItemUtils.checkForInvalidItems(material.getNugget(1))) if (GT_Values.RA.addFluidSolidifierRecipe(ItemList.Shape_Mold_Nugget.get(0), // Item Shape - material.getFluid(16), // Fluid Input + material.getFluidStack(16), // Fluid Input material.getNugget(1), // output 16, // Duration material.vVoltageMultiplier // Eu Tick @@ -173,7 +173,7 @@ public class RecipeGen_Fluids extends RecipeGen_Base { // Gears if (ItemUtils.checkForInvalidItems(material.getGear(1))) if (GT_Values.RA.addFluidSolidifierRecipe(ItemList.Shape_Mold_Gear.get(0), // Item Shape - material.getFluid(576), // Fluid Input + material.getFluidStack(576), // Fluid Input material.getGear(1), // output 128, // Duration material.vVoltageMultiplier // Eu Tick @@ -187,7 +187,7 @@ public class RecipeGen_Fluids extends RecipeGen_Base { // Blocks if (ItemUtils.checkForInvalidItems(material.getBlock(1))) if (GT_Values.RA.addFluidSolidifierRecipe(ItemList.Shape_Mold_Block.get(0), // Item Shape - material.getFluid(144 * 9), // Fluid Input + material.getFluidStack(144 * 9), // Fluid Input material.getBlock(1), // output 288, // Duration material.vVoltageMultiplier // Eu Tick @@ -219,7 +219,7 @@ 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.getFluid(72), // Fluid Input + material.getFluidStack(72), // Fluid Input material.getRod(1), // output 150, // Duration material.vVoltageMultiplier // Eu Tick @@ -235,7 +235,7 @@ public class RecipeGen_Fluids extends RecipeGen_Base { if (ItemUtils.checkForInvalidItems(material.getLongRod(1))) if (mold_Rod_Long != null && GT_Values.RA.addFluidSolidifierRecipe(mold_Rod_Long.get(0), // Item // Shape - material.getFluid(144), // Fluid Input + material.getFluidStack(144), // Fluid Input material.getLongRod(1), // output 300, // Duration material.vVoltageMultiplier // Eu Tick @@ -250,7 +250,7 @@ public class RecipeGen_Fluids extends RecipeGen_Base { // Bolt if (ItemUtils.checkForInvalidItems(material.getBolt(1))) if (mold_Bolt != null && GT_Values.RA.addFluidSolidifierRecipe(mold_Bolt.get(0), // Item Shape - material.getFluid(18), // Fluid Input + material.getFluidStack(18), // Fluid Input material.getBolt(1), // output 50, // Duration material.vVoltageMultiplier // Eu Tick @@ -265,7 +265,7 @@ public class RecipeGen_Fluids extends RecipeGen_Base { // Screw if (ItemUtils.checkForInvalidItems(material.getScrew(1))) if (mold_Screw != null && GT_Values.RA.addFluidSolidifierRecipe(mold_Screw.get(0), // Item Shape - material.getFluid(18), // Fluid Input + material.getFluidStack(18), // Fluid Input material.getScrew(1), // output 50, // Duration material.vVoltageMultiplier // Eu Tick @@ -280,7 +280,7 @@ public class RecipeGen_Fluids extends RecipeGen_Base { // Ring if (ItemUtils.checkForInvalidItems(material.getRing(1))) if (mold_Ring != null && GT_Values.RA.addFluidSolidifierRecipe(mold_Ring.get(0), // Item Shape - material.getFluid(36), // Fluid Input + material.getFluidStack(36), // Fluid Input material.getRing(1), // output 100, // Duration material.vVoltageMultiplier // Eu Tick diff --git a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_MaterialProcessing.java b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_MaterialProcessing.java index 90bd1d8f1a..f8108852f4 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_MaterialProcessing.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_MaterialProcessing.java @@ -18,6 +18,7 @@ import gtPlusPlus.core.material.Material; import gtPlusPlus.core.material.MaterialGenerator; import gtPlusPlus.core.material.MaterialStack; import gtPlusPlus.core.material.state.MaterialState; +import gtPlusPlus.core.recipe.common.CI; import gtPlusPlus.core.util.minecraft.ItemUtils; import net.minecraftforge.fluids.FluidStack; @@ -186,7 +187,7 @@ public class RecipeGen_MaterialProcessing extends RecipeGen_Base { ItemStack emptyCell = null; if (mCellCount > 0){ - emptyCell = ItemUtils.getItemStackOfAmountFromOreDict("cellEmpty", mCellCount); + emptyCell = CI.emptyCells(mCellCount); Logger.MATERIALS("[Dehydrator] Recipe now requires "+mCellCount+" empty cells as input."); } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_MetalRecipe.java b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_MetalRecipe.java new file mode 100644 index 0000000000..830fae78ab --- /dev/null +++ b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_MetalRecipe.java @@ -0,0 +1,119 @@ +package gtPlusPlus.xmod.gregtech.loaders; + +import gregtech.api.enums.GT_Values; +import gregtech.api.util.GT_ModHandler; +import gtPlusPlus.api.interfaces.RunnableWithInfo; +import gtPlusPlus.api.objects.Logger; +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 { + + public final static Set<RunnableWithInfo<Material>> mRecipeGenMap = new HashSet<RunnableWithInfo<Material>>(); + static { + MaterialGenerator.mRecipeMapsToGenerate.put(mRecipeGenMap); + } + + public RecipeGen_MetalRecipe(final Material M){ + this.toGenerate = M; + mRecipeGenMap.add(this); + } + + @Override + public void run() { + generateRecipes(this.toGenerate); + } + + private void generateRecipes(final Material material) { + + Logger.WARNING("Generating Metal recipes for "+material.getLocalizedName()); + if (ItemUtils.checkForInvalidItems(material.getIngot(1)) && ItemUtils.checkForInvalidItems(material.getBlock(1))) + if (GT_ModHandler.addCompressionRecipe( + material.getIngot(9), + material.getBlock(1) + )){ + Logger.WARNING("Compress Block Recipe: "+material.getLocalizedName()+" - Success"); + } + else { + Logger.WARNING("Compress Block Recipe: "+material.getLocalizedName()+" - Failed"); + } + + if (ItemUtils.checkForInvalidItems(material.getIngot(1)) && ItemUtils.checkForInvalidItems(material.getRod(1))) + if (GT_Values.RA.addLatheRecipe( + material.getIngot(1), + material.getRod(1), + 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"); + } + + if (ItemUtils.checkForInvalidItems(material.getRod(1)) && ItemUtils.checkForInvalidItems(material.getBolt(1))) + if (GT_Values.RA.addCutterRecipe( + material.getRod(1), + material.getBolt(4), + 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"); + } + + if (ItemUtils.checkForInvalidItems(material.getIngot(1)) && ItemUtils.checkForInvalidItems(material.getHotIngot(1))) + if (CORE.RA.addVacuumFreezerRecipe( + material.getHotIngot(1), + 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"); + } + + 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)){ + 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); + } + + 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"); + } + + } +}
\ No newline at end of file diff --git a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_MultisUsingFluidInsteadOfCells.java b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_MultisUsingFluidInsteadOfCells.java index 90d7aaa806..a76322e4f4 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_MultisUsingFluidInsteadOfCells.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_MultisUsingFluidInsteadOfCells.java @@ -151,6 +151,11 @@ public class RecipeGen_MultisUsingFluidInsteadOfCells { for (int i = 0; i < aOutputFluidsMap.size(); i++) { aNewFluidOutputs[i] = aOutputFluidsMap.get(i); } + + if (!ItemUtils.checkForInvalidItems(aNewItemInputs, aNewItemOutputs)) { + aInvalidRecipesToConvert++; + continue recipe; // Skip this recipe entirely if we find an item we don't like + } // Add Recipe to map GT_Recipe aNewRecipe = new GTPP_Recipe( diff --git a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Plasma.java b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Plasma.java new file mode 100644 index 0000000000..5f53defc2f --- /dev/null +++ b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Plasma.java @@ -0,0 +1,42 @@ +package gtPlusPlus.xmod.gregtech.loaders; + +import java.util.HashSet; +import java.util.Set; + +import gregtech.api.enums.GT_Values; +import gregtech.api.util.GT_Utility; +import gtPlusPlus.api.interfaces.RunnableWithInfo; +import gtPlusPlus.core.material.Material; +import gtPlusPlus.core.material.MaterialGenerator; +import net.minecraft.item.ItemStack; + +public class RecipeGen_Plasma extends RecipeGen_Base { + + public final static Set<RunnableWithInfo<Material>> mRecipeGenMap = new HashSet<RunnableWithInfo<Material>>(); + static { + MaterialGenerator.mRecipeMapsToGenerate.put(mRecipeGenMap); + } + + public RecipeGen_Plasma(final Material M){ + this.toGenerate = M; + mRecipeGenMap.add(this); + } + + @Override + public void run() { + generateRecipes(this.toGenerate); + } + + private void generateRecipes(final Material material) { + // Cool Plasma + ItemStack aPlasmaCell = material.getPlasmaCell(1); + ItemStack aCell = material.getCell(1); + if (material.getPlasmaCell(1) != null){ + GT_Values.RA.addFuel(GT_Utility.copyAmount(1L, aPlasmaCell), GT_Utility.getFluidForFilledItem(aPlasmaCell, true) == null ? GT_Utility.getContainerItem(aPlasmaCell, true) : null, (int) Math.max(1024L, 1024L * material.getMass()), 4); + } + if (material.getCell(1) != null && material.getPlasmaCell(1) != null){ + GT_Values.RA.addVacuumFreezerRecipe(aPlasmaCell, aCell, (int) Math.max(material.getMass() * 2L, 1L)); + } + } + +} diff --git a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Recycling.java b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Recycling.java index 84188a44aa..acb7e5fe02 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Recycling.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Recycling.java @@ -137,9 +137,9 @@ public class RecipeGen_Recycling implements Runnable { //Fluid Extractor if (ItemUtils.checkForInvalidItems(tempStack)) { // mValidItems[mSlotIndex++] = tempStack; - if ((mDust != null) && CORE.RA.addFluidExtractionRecipe(tempStack, material.getFluid(mFluidAmount), 30, material.vVoltageMultiplier)) { + if ((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 " + mFluidAmount+"mb of "+material.getFluid(1).getLocalizedName()+"."); + + tempStack.getDisplayName() + " and obtain " + mFluidAmount+"mb of "+material.getFluidStack(1).getLocalizedName()+"."); } else { Logger.WARNING("Fluid Recycle Recipe: " + material.getLocalizedName() + " - Failed"); diff --git a/src/Java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_GTNH.java b/src/Java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_GTNH.java new file mode 100644 index 0000000000..0197142e96 --- /dev/null +++ b/src/Java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_GTNH.java @@ -0,0 +1,22 @@ +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; + +public class RecipeLoader_GTNH { + + public static void generate() { + GT_Values.RA.addFluidSolidifierRecipe(ItemList.Shape_Mold_Ball.get(0L), new FluidStack(FluidRegistry.getFluid("ender"), 250), new ItemStack(Items.ender_pearl, 1, 0), 100, 30); + //MK4 + GT_Values.RA.addFusionReactorRecipe(Materials.Plutonium241.getMolten(144), Materials.Helium.getGas(1000), ELEMENT.getInstance().CURIUM.getFluidStack(144), 96, 98304, 500000000); + GT_Values.RA.addFusionReactorRecipe(ELEMENT.getInstance().CURIUM.getFluidStack(144), Materials.Helium.getPlasma(144), ELEMENT.getInstance().CALIFORNIUM.getFluidStack(144), 128, 196608, 750000000); + GT_Values.RA.addFusionReactorRecipe(Materials.Plutonium241.getMolten(144), Materials.Calcium.getPlasma(144), Materials.Flerovium.getMolten(144), 160, 196608, 1000000000); + } + +} diff --git a/src/Java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_LFTR.java b/src/Java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_LFTR.java index 424c2ecce5..a09cbcce0d 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_LFTR.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_LFTR.java @@ -1,24 +1,47 @@ package gtPlusPlus.xmod.gregtech.loaders.recipe; -import java.util.Collection; - -import net.minecraft.item.ItemStack; - -import gregtech.api.util.GT_Recipe; +import gregtech.api.enums.Materials; import gregtech.api.util.GTPP_Recipe; - -import gtPlusPlus.api.objects.minecraft.NoConflictGTRecipeMap; -import gtPlusPlus.core.recipe.common.CI; -import gtPlusPlus.core.util.minecraft.FluidUtils; +import gregtech.api.util.GT_Recipe; +import gregtech.api.util.GasSpargingRecipeMap; +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 { - +public class RecipeLoader_LFTR { - protected final static NoConflictGTRecipeMap mRecipesLFTR = new NoConflictGTRecipeMap(); + private static AutoMap<Fluid> mNobleGases; + private static AutoMap<Fluid> mFluorideGases; + private static AutoMap<Fluid> mSpargeGases; - public static Collection<GT_Recipe> getRecipes(){ - return mRecipesLFTR.getRecipeMap(); + private static void configureSparging() { + if (mSpargeGases == null) { + mSpargeGases = new AutoMap<Fluid>(); + mSpargeGases.add(Materials.Helium.getGas(1).getFluid()); + mSpargeGases.add(Materials.Fluorine.getGas(1).getFluid()); + } + if (mNobleGases == null) { + mNobleGases = new AutoMap<Fluid>(); + mNobleGases.add(mSpargeGases.get(0)); + mNobleGases.add(ELEMENT.getInstance().XENON.getFluid()); + mNobleGases.add(ELEMENT.getInstance().NEON.getFluid()); + mNobleGases.add(ELEMENT.getInstance().ARGON.getFluid()); + mNobleGases.add(ELEMENT.getInstance().KRYPTON.getFluid()); + mNobleGases.add(ELEMENT.getInstance().RADON.getFluid()); + } + if (mFluorideGases == null) { + mFluorideGases = new AutoMap<Fluid>(); + mFluorideGases.add(mSpargeGases.get(1)); + mFluorideGases.add(FLUORIDES.LITHIUM_FLUORIDE.getFluid()); + mFluorideGases.add(FLUORIDES.NEPTUNIUM_HEXAFLUORIDE.getFluid()); + mFluorideGases.add(FLUORIDES.TECHNETIUM_HEXAFLUORIDE.getFluid()); + mFluorideGases.add(FLUORIDES.SELENIUM_HEXAFLUORIDE.getFluid()); + mFluorideGases.add(FLUORIDES.THORIUM_TETRAFLUORIDE.getFluid()); + } } public static void generate() { @@ -29,70 +52,122 @@ public class RecipeLoader_LFTR { //1l/20t= 1000l/2.5hr LiFBeF2ZrF4UF4 //1l/10t= 1000l/2.5hr LiFBeF2ZrF4U235 - //LiFBeF2ThF4UF4 + configureSparging(); + FluidStack Li2BeF4 = NUCLIDE.Li2BeF4.getFluidStack(200); + + //LiFBeF2ThF4UF4 - T3 GT_Recipe LFTR1 = new GTPP_Recipe( - true, - new ItemStack[] {CI.getNumberedCircuit(1)}, + false, new ItemStack[] {}, - null, new int[] {5000, 2500}, + new ItemStack[] {}, + null, new int[] {10000, 10000, 5000, 2500}, new FluidStack[] { - FluidUtils.getFluidStack("molten.li2bef4", 34), - FluidUtils.getFluidStack("molten.LiFBeF2ThF4UF4".toLowerCase(), 17) + NUCLIDE.LiFBeF2ThF4UF4.getFluidStack(100), + Li2BeF4 }, new FluidStack[] { - FluidUtils.getFluidStack("molten.uraniumhexafluoride", 10), - FluidUtils.getFluidStack("molten.uraniumhexafluoride", 5) + NUCLIDE.LiFBeF2UF4FP.getFluidStack(100), + NUCLIDE.LiFBeF2ThF4.getFluidStack(200), + FLUORIDES.URANIUM_HEXAFLUORIDE.getFluidStack(20), + FLUORIDES.URANIUM_HEXAFLUORIDE.getFluidStack(10) }, - 12000,//time + 400 * 20,//time 0,//cost - 4096//fuel value + 8192*4//fuel value ); - //LiFBeF2ZrF4UF4 + //LiFBeF2ZrF4UF4 - T2 GT_Recipe LFTR2 = new GTPP_Recipe( - true, - new ItemStack[] {CI.getNumberedCircuit(2)}, + false, + new ItemStack[] {}, new ItemStack[] {}, - null, new int[] {2500, 1250}, + null, new int[] {10000, 10000, 2500, 1250}, new FluidStack[] { - FluidUtils.getFluidStack("molten.li2bef4", 34), - FluidUtils.getFluidStack("molten.LiFBeF2ZrF4UF4".toLowerCase(), 17) + NUCLIDE.LiFBeF2ZrF4UF4.getFluidStack(100), + Li2BeF4 }, new FluidStack[] { - FluidUtils.getFluidStack("molten.uraniumhexafluoride", 4), - FluidUtils.getFluidStack("molten.uraniumhexafluoride", 2) + NUCLIDE.LiFBeF2UF4FP.getFluidStack(50), + NUCLIDE.LiFBeF2ThF4.getFluidStack(100), + FLUORIDES.URANIUM_HEXAFLUORIDE.getFluidStack(10), + FLUORIDES.URANIUM_HEXAFLUORIDE.getFluidStack(5) }, - 6000,//time + 400 * 20,//time 0,//cost - 4096//fuel value + 8192//fuel value ); - //LiFBeF2ZrF4U235 + //LiFBeF2ZrF4U235 - T1 GT_Recipe LFTR3 = new GTPP_Recipe( - true, - new ItemStack[] {CI.getNumberedCircuit(3)}, + false, new ItemStack[] {}, - null, new int[] {1000, 500}, + new ItemStack[] {}, + null, new int[] {10000, 10000, 1000, 500}, new FluidStack[] { - FluidUtils.getFluidStack("molten.li2bef4", 34), - FluidUtils.getFluidStack("molten.LiFBeF2ZrF4U235".toLowerCase(), 17) + NUCLIDE.LiFBeF2ZrF4U235.getFluidStack(100), + Li2BeF4 }, new FluidStack[] { - FluidUtils.getFluidStack("molten.uraniumhexafluoride", 2), - FluidUtils.getFluidStack("molten.uraniumhexafluoride", 1) + NUCLIDE.LiFBeF2UF4FP.getFluidStack(25), + NUCLIDE.LiFThF4.getFluidStack(50), + FLUORIDES.URANIUM_HEXAFLUORIDE.getFluidStack(4), + FLUORIDES.URANIUM_HEXAFLUORIDE.getFluidStack(2) }, - 3000,//time + 100 *20,//time 0,//cost - 4096//fuel value + 8192//fuel value ); - /*mRecipesLFTR.add(LFTR1); - mRecipesLFTR.add(LFTR2); - mRecipesLFTR.add(LFTR3);*/ - GTPP_Recipe.GTPP_Recipe_Map.sLiquidFluorineThoriumReactorRecipesEx.add(LFTR1); - GTPP_Recipe.GTPP_Recipe_Map.sLiquidFluorineThoriumReactorRecipesEx.add(LFTR2); - GTPP_Recipe.GTPP_Recipe_Map.sLiquidFluorineThoriumReactorRecipesEx.add(LFTR3); - + // Sparging NEI Recipes + GasSpargingRecipeMap.addRecipe( + new FluidStack(mSpargeGases.get(0), 50), + 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[] { + 1000, 1000, 1000, 1000, 1000 + }); + + GasSpargingRecipeMap.addRecipe( + new FluidStack(mSpargeGases.get(1), 50), + 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[] { + 500, 500, 500, 500, 500 + }); + + GasSpargingRecipeMap.addRecipe( + new FluidStack(mSpargeGases.get(1), 50), + 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[] { + 1000, 1000, 1000, 1000, 1000 + }); + + GTPP_Recipe.GTPP_Recipe_Map.sLiquidFluorineThoriumReactorRecipes.add(LFTR1); + GTPP_Recipe.GTPP_Recipe_Map.sLiquidFluorineThoriumReactorRecipes.add(LFTR2); + GTPP_Recipe.GTPP_Recipe_Map.sLiquidFluorineThoriumReactorRecipes.add(LFTR3); + } } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_Nuclear.java b/src/Java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_Nuclear.java new file mode 100644 index 0000000000..330d507115 --- /dev/null +++ b/src/Java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_Nuclear.java @@ -0,0 +1,695 @@ +package gtPlusPlus.xmod.gregtech.loaders.recipe; + +import static gtPlusPlus.core.lib.CORE.GTNH; + +import gregtech.api.enums.GT_Values; +import gregtech.api.enums.ItemList; +import gregtech.api.util.GT_ModHandler; +import gtPlusPlus.api.objects.Logger; +import gtPlusPlus.core.item.chemistry.GenericChem; +import gtPlusPlus.core.lib.CORE; +import gtPlusPlus.core.lib.LoadedMods; +import gtPlusPlus.core.material.ELEMENT; +import gtPlusPlus.core.material.MISC_MATERIALS; +import gtPlusPlus.core.material.nuclear.FLUORIDES; +import gtPlusPlus.core.material.nuclear.NUCLIDE; +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 { + + + + public static void generate() { + createRecipes(); + RecipeLoader_LFTR.generate(); + RecipeLoader_NuclearFuelProcessing.generate(); + } + + private static void createRecipes() { + autoclave(); + blastFurnace(); + centrifugeRecipes(); + chemicalBathRecipes(); + chemicalReactorRecipes(); + dehydratorRecipes(); + electroMagneticSeperator(); + fluidExtractorRecipes(); + fluidHeater(); + macerator(); + mixerRecipes(); + sifter(); + } + + private static void autoclave() { + + GT_Values.RA.addAutoclaveRecipe( + ItemUtils.getItemStackOfAmountFromOreDict("dustZirconium", 9), + FluidUtils.getFluidStack("chlorine", 9 * 4 * 144), + ItemUtils.getItemStackOfAmountFromOreDict("pelletZirconium", 9), + 0, + 120 * 20, + 30); + + } + + private static void blastFurnace() { + + GT_Values.RA.addBlastRecipe( + FLUORIDES.LITHIUM_FLUORIDE.getDust(2), + FLUORIDES.BERYLLIUM_FLUORIDE.getDust(1), + GT_Values.NF, + GT_Values.NF, + NUCLIDE.Li2BeF4.getDust(3), + null, + 60 * 20, 2000, + 3000); + + GT_Values.RA.addBlastRecipe( + ItemUtils.getItemStackOfAmountFromOreDict("dustZrCl4", 1), + null, + GT_Values.NF, + GT_Values.NF, + ItemUtils.getItemStackOfAmountFromOreDict("dustCookedZrCl4", 1), + null, + 60 * 20, + 340, + 300); + + } + + + private static void centrifugeRecipes() { + + //Process Used Fuel Rods for Krypton + + //Uranium + GT_Values.RA.addCentrifugeRecipe( + CI.getNumberedCircuit(20), + ItemUtils.getItemStackFromFQRN("IC2:reactorUraniumSimpledepleted", 8), + GT_Values.NF, + ELEMENT.getInstance().KRYPTON.getFluidStack(60), + ItemList.IC2_Fuel_Rod_Empty.get(8), + ELEMENT.getInstance().URANIUM238.getDust(2), + ELEMENT.getInstance().URANIUM232.getSmallDust(1), + ELEMENT.getInstance().URANIUM233.getSmallDust(1), + ELEMENT.getInstance().URANIUM235.getSmallDust(1), + ELEMENT.getInstance().PLUTONIUM239.getTinyDust(1), + new int[] { 0, 0, 1000, 1000, 1000, 500 }, 500 * 20, 4000); + //Mox + GT_Values.RA.addCentrifugeRecipe( + CI.getNumberedCircuit(20), + ItemUtils.getItemStackFromFQRN("IC2:reactorMOXSimpledepleted", 8), + GT_Values.NF, + ELEMENT.getInstance().KRYPTON.getFluidStack(90), + ItemList.IC2_Fuel_Rod_Empty.get(8), + ELEMENT.getInstance().PLUTONIUM244.getDust(2), + ELEMENT.getInstance().PLUTONIUM241.getTinyDust(1), + ELEMENT.getInstance().PLUTONIUM239.getTinyDust(1), + ELEMENT.getInstance().PLUTONIUM238.getTinyDust(1), + ELEMENT.getInstance().PLUTONIUM239.getTinyDust(1), + new int[] { 0, 0, 500, 500, 500, 500 }, 750 * 20, 4000); + + //Thorium + GT_Values.RA.addCentrifugeRecipe( + CI.getNumberedCircuit(20), + ItemList.Depleted_Thorium_1.get(8), + GT_Values.NF, + ELEMENT.getInstance().KRYPTON.getFluidStack(30), + ItemList.IC2_Fuel_Rod_Empty.get(8), + ELEMENT.getInstance().THORIUM.getDust(2), + ELEMENT.getInstance().THORIUM232.getDust(1), + ELEMENT.getInstance().LUTETIUM.getSmallDust(1), + ELEMENT.getInstance().POLONIUM.getSmallDust(1), + ELEMENT.getInstance().THALLIUM.getTinyDust(1), + new int[] { 0, 0, 5000, 5000, 5000, 2500 }, 250 * 20, 4000); + + } + + + private static void chemicalBathRecipes() { + + int[] chances = {9000, 6000, 3000}; + GT_Values.RA.addChemicalBathRecipe(ItemUtils.getItemStackOfAmountFromOreDict("dustTin", 12), + FluidUtils.getFluidStack("chlorine", 2400), + ItemUtils.getItemStackOfAmountFromOreDict("dustZirconium", 3), + ItemUtils.getItemStackOfAmountFromOreDict("dustZirconium", 4), + ItemUtils.getItemStackOfAmountFromOreDict("dustZirconium", 5), + chances, + 30 * 20, + 480); + + chances = new int[]{9000, 3000, 1000}; + GT_Values.RA.addChemicalBathRecipe(ItemUtils.getItemStackOfAmountFromOreDict("dustRutile", 5), + FluidUtils.getFluidStack("chlorine", 4000), + ItemUtils.getItemStackOfAmountFromOreDict("dustZirconium", 3), + ItemUtils.getItemStackOfAmountFromOreDict("dustTitanium", 1), + ItemUtils.getItemStackOfAmountFromOreDict("dustHafnium", 1), + chances, + 30 * 20, + 1024); + + GT_Values.RA.addChemicalBathRecipe( + ItemUtils.getItemStackOfAmountFromOreDict("dustLithiumCarbonate", 10), + FluidUtils.getFluidStack("hydrofluoricacid", 10 * 144), + ItemUtils.getItemStackOfAmountFromOreDict("dustLithiumFluoride", 10), + null, + null, + new int[] {}, + 90 * 20, + 500); + + } + + + private static void chemicalReactorRecipes() { + + ItemStack aGtHydrofluoricAcid = ItemUtils.getItemStackOfAmountFromOreDictNoBroken("cellHydrofluoricAcid_GT5U", 2); + + GT_Values.RA.addChemicalRecipe( + ItemUtils.getItemStackOfAmountFromOreDict("dustLithiumCarbonate", 5), // Input + ItemUtils.getItemStackOfAmountFromOreDict("dustCalciumHydroxide", 5), // Input + null, // Fluid Input + null, // Fluid Output + ItemUtils.getItemStackOfAmountFromOreDict("dustLi2CO3CaOH2", 10), + 600 * 20); + + GT_Values.RA.addChemicalRecipe( + ItemUtils.getItemStackOfAmountFromOreDict("dustLithiumHydroxide", 5), // Input + null, // Input Stack 2 + FluidUtils.getFluidStack("hydrofluoricacid", 5 * 144), + FluidUtils.getFluidStack("water", 5 * 144), // Fluid Output + ItemUtils.getItemStackOfAmountFromOreDict("dustLithiumFluoride", 5), + 600 * 20); + + GT_Values.RA.addChemicalRecipe( + ItemUtils.getItemStackOfAmountFromOreDict("dustLithium7", 1), null, + FluidUtils.getFluidStack("sulfuricacid", 144 * 8), + FluidUtils.getFluidStack("sulfuriclithium", 144 * 2), + ItemUtils.getItemStackOfAmountFromOreDict("dustSmallLithium7", 1), + 20 * 20); + + GT_Values.RA.addChemicalRecipe( + ItemUtils.getItemStackOfAmountFromOreDict("cellOxygen", 1), + ItemUtils.getItemStackOfAmountFromOreDict("dustLithium7", 16), + FluidUtils.getFluidStack("water", 1000), + FluidUtils.getFluidStack("lithiumhydroxide", 144 * 4), + CI.emptyCells(1), + 300 * 20); + + // LFTR Fuel Related Compounds + if (GTNH) { + // Hydroxide + GT_Values.RA.addChemicalRecipe( + ItemUtils.getGregtechCircuit(3), + ELEMENT.getInstance().OXYGEN.getCell(1), + ELEMENT.getInstance().HYDROGEN.getFluidStack(1000), + MISC_MATERIALS.HYDROXIDE.getFluidStack(2000), + CI.emptyCells(2), + GT_Values.NI, + 8 * 20, + 30); + // Beryllium Hydroxide + GT_Values.RA.addChemicalRecipe( + ItemUtils.getGregtechCircuit(3), + ELEMENT.getInstance().BERYLLIUM.getDust(7), + MISC_MATERIALS.HYDROXIDE.getFluidStack(1000), + FLUORIDES.BERYLLIUM_HYDROXIDE.getFluidStack(2000), + GT_Values.NI, + 8 * 20, + 30); + // Ammonium Bifluoride + GT_Values.RA.addChemicalRecipe( + ItemUtils.getGregtechCircuit(3), + ItemUtils.getItemStackOfAmountFromOreDict("cellHydrofluoricAcid", 1), + MISC_MATERIALS.AMMONIUM.getFluidStack(1000), + FLUORIDES.AMMONIUM_BIFLUORIDE.getFluidStack(2000), + CI.emptyCells(1), + 20 * 20, + 30); + if (aGtHydrofluoricAcid != null) { + // Ammonium Bifluoride + GT_Values.RA.addChemicalRecipe( + ItemUtils.getGregtechCircuit(3), + aGtHydrofluoricAcid, + MISC_MATERIALS.AMMONIUM.getFluidStack(1000), + FLUORIDES.AMMONIUM_BIFLUORIDE.getFluidStack(2000), + CI.emptyCells(2), + 40 * 20, + 30); + } + // Ammonium + GT_Values.RA.addChemicalRecipe( + ItemUtils.getGregtechCircuit(3), + ELEMENT.getInstance().HYDROGEN.getCell(1), + MISC_MATERIALS.AMMONIA.getFluidStack(1000), + MISC_MATERIALS.AMMONIUM.getFluidStack(2000), + CI.emptyCells(1), + GT_Values.NI, + 20 * 20, + 30); + } + + if (!GTNH) { + // Hydroxide + GT_Values.RA.addChemicalRecipe( + ItemUtils.getGregtechCircuit(3), + ELEMENT.getInstance().OXYGEN.getCell(1), + ELEMENT.getInstance().HYDROGEN.getFluidStack(1000), + MISC_MATERIALS.HYDROXIDE.getFluidStack(2000), + CI.emptyCells(2), + GT_Values.NI, + 8 * 20, + 30); + // Beryllium Hydroxide + GT_Values.RA.addChemicalRecipe( + ItemUtils.getGregtechCircuit(3), + ELEMENT.getInstance().BERYLLIUM.getDust(7), + MISC_MATERIALS.HYDROXIDE.getFluidStack(1000), + FLUORIDES.BERYLLIUM_HYDROXIDE.getFluidStack(2000), + GT_Values.NI, + 8 * 20, + 30); + // Ammonium Bifluoride + GT_Values.RA.addChemicalRecipe( + ItemUtils.getGregtechCircuit(3), + ItemUtils.getItemStackOfAmountFromOreDict("cellHydrofluoricAcid", 1), + MISC_MATERIALS.AMMONIUM.getFluidStack(1000), + FLUORIDES.AMMONIUM_BIFLUORIDE.getFluidStack(3000), + CI.emptyCells(1), + 20 * 20, + 30); + + if (aGtHydrofluoricAcid != null) { + // Ammonium Bifluoride + GT_Values.RA.addChemicalRecipe( + ItemUtils.getGregtechCircuit(3), + aGtHydrofluoricAcid, + MISC_MATERIALS.AMMONIUM.getFluidStack(1000), + FLUORIDES.AMMONIUM_BIFLUORIDE.getFluidStack(2000), + CI.emptyCells(2), + 40 * 20, + 30); + } + + // Ammonium + GT_Values.RA.addChemicalRecipe( + ItemUtils.getGregtechCircuit(3), + ELEMENT.getInstance().HYDROGEN.getCell(1), + MISC_MATERIALS.AMMONIA.getFluidStack(1000), + MISC_MATERIALS.AMMONIUM.getFluidStack(2000), + CI.emptyCells(1), + GT_Values.NI, + 20 * 20, + 30); + // Ammonia + GT_Values.RA.addChemicalRecipe( + ItemUtils.getItemStackOfAmountFromOreDict("cellHydrogen", 3), + ItemUtils.getItemStackOfAmountFromOreDict("dustMagnetite", 0), + FluidUtils.getFluidStack("nitrogen", 1000), + FluidUtils.getFluidStack("ammonia", 1000), + CI.emptyCells(3), + 14 * 20); + } + + + //Technetium + GT_Values.RA.addChemicalRecipe( + CI.getNumberedAdvancedCircuit(22), + ItemUtils.getItemStackOfAmountFromOreDict("dustTechnetium99", 1), + FluidUtils.getFluidStack("sulfuricacid", 1000), + FluidUtils.getFluidStack("sulfuricacid", 144 * 2), + ItemUtils.getItemStackOfAmountFromOreDict("dustTechnetium", 1), + 100 * 20); + + // Sodium Hydroxide + GT_Values.RA.addChemicalRecipe( + CI.getNumberedBioCircuit(15), + ItemUtils.getItemStackOfAmountFromOreDict("dustSodiumHydroxide", 1), + FluidUtils.getFluidStack("hydrofluoricacid", 500), + FluidUtils.getWater(1000), + FLUORIDES.SODIUM_FLUORIDE.getDust(1), + 60 * 20); + + if (FluidUtils.doesFluidExist("hydrofluoricacid_gt5u")) { + GT_Values.RA.addChemicalRecipe( + CI.getNumberedBioCircuit(15), + ItemUtils.getItemStackOfAmountFromOreDict("dustSodiumHydroxide", 1), + FluidUtils.getFluidStack("hydrofluoricacid_gt5u", 1000), + FluidUtils.getWater(1000), + FLUORIDES.SODIUM_FLUORIDE.getDust(1), + 60 * 20); + } + + } + + private static void dehydratorRecipes() { + + // Makes 7-Lithium + CORE.RA.addDehydratorRecipe( + 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}, + 30 * 20, + 30); + + // Makes Lithium Carbonate + CORE.RA.addDehydratorRecipe( + 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), + ItemUtils.getItemStackOfAmountFromOreDict("dustAluminium", 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 }, + 75 * 20, // Time in ticks + 1000); // EU + + // Calcium Hydroxide + if ((ItemUtils.checkForInvalidItems(ItemUtils.getItemStackOfAmountFromOreDict("dustQuicklime", 1))) || LoadedMods.IHL) { + CORE.RA.addDehydratorRecipe( + new ItemStack[] { + CI.getNumberedBioCircuit(20), + ItemUtils.getItemStackOfAmountFromOreDict("dustQuicklime", 10) + }, + FluidUtils.getFluidStack("water", 10000), + null, // Fluid output (slot 2) + new ItemStack[] { + ItemUtils.getItemStackOfAmountFromOreDict("dustCalciumHydroxide", 20) + }, // Output + new int[] { 10000 }, + 120 * 20, // Time in ticks + 120); // EU + } + else { + Logger.INFO("[dustCalciumHydroxide] FAILED TO LOAD RECIPE"); + if (!ItemUtils.checkForInvalidItems(ItemUtils.getItemStackOfAmountFromOreDict("dustQuicklime", 1))) { + Logger.INFO("Could not find dustQuicklime, cannot make dustCalciumHydroxide."); + } + else if (!LoadedMods.IHL) { + Logger.INFO("IHL not loaded."); + } + } + + // 2 LiOH + CaCO3 + CORE.RA.addDehydratorRecipe( + 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 }, + 120 * 20, // Time in ticks + 1000); // EU + + // LiOH Liquid to Dust + CORE.RA.addDehydratorRecipe( + new ItemStack[] { + CI.getNumberedAdvancedCircuit(22) + }, + FluidUtils.getFluidStack("lithiumhydroxide", 144), + null, + 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 + FluidUtils.getFluidStack("hydrofluoricacid", 9 * 144), + aHydrogenChloride, + new ItemStack[] { + FLUORIDES.ZIRCONIUM_TETRAFLUORIDE.getDust(9) + }, + new int[] { 10000 }, + 120 * 20, // Time in ticks + 500); // EU + + // Zirconium Chloride -> TetraFluoride + 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) + }, + FluidUtils.getFluidStack("hydrofluoricacid_gt5u", 18 * 144), + aHydrogenChloride, + 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) + }, + FLUORIDES.BERYLLIUM_HYDROXIDE.getFluidStack(2000), // Fluid input (slot 1) + FLUORIDES.AMMONIUM_TETRAFLUOROBERYLLATE.getFluidStack(6000), + 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) + }, + 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}, + 5 * 60 * 20, + 120); + + } + + private static void electroMagneticSeperator() { + + // Zirconium + GT_Values.RA.addElectromagneticSeparatorRecipe( + ItemUtils.getItemStackOfAmountFromOreDict("crushedPurifiedBauxite", 1), + ItemUtils.getItemStackOfAmountFromOreDict("dustBauxite", 1), + ItemUtils.getItemStackOfAmountFromOreDict("dustSmallRutile", 1), + ItemUtils.getItemStackOfAmountFromOreDict("nuggetZirconium", 1), + new int[] { 10000, 2500, 4000 }, + 20 * 20, + 24); + + // Zircon + GT_Values.RA.addElectromagneticSeparatorRecipe( + ItemUtils.getItemStackOfAmountFromOreDict("crushedPurifiedMagnetite", 1), + ItemUtils.getItemStackOfAmountFromOreDict("dustMagnetite", 1), + ItemUtils.getItemStackOfAmountFromOreDict("dustSmallZircon", 1), + ItemUtils.getItemStackOfAmountFromOreDict("dustTinyZircon", 1), + new int[] { 10000, 1250, 2500 }, + 20 * 20, + 24); + GT_Values.RA.addElectromagneticSeparatorRecipe( + ItemUtils.getItemStackOfAmountFromOreDict("crushedPurifiedCassiterite", 1), + ItemUtils.getItemStackOfAmountFromOreDict("dustCassiterite", 1), + ItemUtils.getItemStackOfAmountFromOreDict("dustSmallZircon", 1), + ItemUtils.getItemStackOfAmountFromOreDict("dustTinyZircon", 1), + new int[] { 10000, 1250, 2500 }, + 20 * 20, + 24); + + } + + private static void fluidExtractorRecipes() { + + //FLiBe fuel + CORE.RA.addFluidExtractionRecipe( + NUCLIDE.Li2BeF4.getDust(1), + NUCLIDE.Li2BeF4.getFluidStack(144), + 100, + 500); + //LFTR Fuel 1 + CORE.RA.addFluidExtractionRecipe( + NUCLIDE.LiFBeF2ZrF4U235.getDust(1), + NUCLIDE.LiFBeF2ZrF4U235.getFluidStack(144), + 250, + 1000); + CORE.RA.addFluidExtractionRecipe( + NUCLIDE.LiFBeF2ZrF4UF4.getDust(1), + NUCLIDE.LiFBeF2ZrF4UF4.getFluidStack(144), + 150, + 1500); + CORE.RA.addFluidExtractionRecipe( + NUCLIDE.LiFBeF2ThF4UF4.getDust(1), + NUCLIDE.LiFBeF2ThF4UF4.getFluidStack(144), + 150, + 2000); + + //ZIRCONIUM_TETRAFLUORIDE + CORE.RA.addFluidExtractionRecipe( + FLUORIDES.ZIRCONIUM_TETRAFLUORIDE.getDust(1), + FLUORIDES.ZIRCONIUM_TETRAFLUORIDE.getFluidStack(144), + 200, + 512+256); + + } + + private static void macerator() { + + GT_ModHandler.addPulverisationRecipe( + ItemUtils.getItemStackOfAmountFromOreDict("pelletZirconium", 1), + ItemUtils.getItemStackOfAmountFromOreDict("dustZrCl4", 1)); + + } + + private static void mixerRecipes() { + + GT_Values.RA.addMixerRecipe( + ItemUtils.getItemStackOfAmountFromOreDict("dustUranium233", 4), + ItemUtils.getItemStackOfAmountFromOreDict("dustUranium235", 1), + null, + null, + FluidUtils.getFluidStack("hydrofluoricacid", 5000), + FLUORIDES.URANIUM_TETRAFLUORIDE.getFluidStack(5000), + null, + 3000, + 500); + + } + + + private static void sifter() { + + // Zirconium + GT_Values.RA.addSifterRecipe( + ItemUtils.getItemStackOfAmountFromOreDict("crushedPurifiedIlmenite", 1), + new ItemStack[] { + ItemUtils.getItemStackOfAmountFromOreDict("dustIron", 1), + ItemUtils.getItemStackOfAmountFromOreDict("dustTinyWroughtIron", 1), + ItemUtils.getItemStackOfAmountFromOreDict("dustZirconium", 1), + ItemUtils.getItemStackOfAmountFromOreDict("dustZirconium", 1), + ItemUtils.getItemStackOfAmountFromOreDict("dustHafnium", 1), + ItemUtils.getItemStackOfAmountFromOreDict("dustHafnium", 1) }, + new int[] { 5000, 2500, 1000, 1000, 300, 300 }, + 20 * 30, + 500); + GT_Values.RA.addSifterRecipe( + ItemUtils.getItemStackOfAmountFromOreDict("crushedPurifiedTin", 1), + new ItemStack[] { + ItemUtils.getItemStackOfAmountFromOreDict("dustTin", 1), + ItemUtils.getItemStackOfAmountFromOreDict("dustTinyZinc", 1), + ItemUtils.getItemStackOfAmountFromOreDict("dustZirconium", 1), + ItemUtils.getItemStackOfAmountFromOreDict("dustZirconium", 1), + ItemUtils.getItemStackOfAmountFromOreDict("dustZirconium", 1), + ItemUtils.getItemStackOfAmountFromOreDict("dustZirconium", 1) }, + new int[] { 10000, 5000, 1500, 1000, 500, 500 }, + 20 * 30, + 500); + GT_Values.RA.addSifterRecipe( + ItemUtils.getItemStackOfAmountFromOreDict("crushedPurifiedCassiterite", 1), + new ItemStack[] { + ItemUtils.getItemStackOfAmountFromOreDict("dustCassiterite", 1), + ItemUtils.getItemStackOfAmountFromOreDict("dustTinyTin", 1), + ItemUtils.getItemStackOfAmountFromOreDict("dustZirconium", 1), + ItemUtils.getItemStackOfAmountFromOreDict("dustZirconium", 1), + ItemUtils.getItemStackOfAmountFromOreDict("dustZirconium", 1), + ItemUtils.getItemStackOfAmountFromOreDict("dustZirconium", 1) }, + new int[] { 10000, 5000, 1500, 1000, 500, 500 }, + 20 * 30, + 500); + + // Radium + GT_Values.RA.addSifterRecipe( + ItemUtils.getItemStackOfAmountFromOreDict("crushedPurifiedUranium", 1), + new ItemStack[] { + ItemUtils.getItemStackOfAmountFromOreDict("dustUranium", 1), + ItemUtils.getItemStackOfAmountFromOreDict("dustTinyLead", 1), + ItemUtils.getItemStackOfAmountFromOreDict("dustRadium226", 1), + ItemUtils.getItemStackOfAmountFromOreDict("dustRadium226", 1), + ItemUtils.getItemStackOfAmountFromOreDict("dustRadium226", 1), + ItemUtils.getItemStackOfAmountFromOreDict("dustRadium226", 1) }, + new int[] { 10000, 5000, 1000, 500, 500, 500 }, + 20 * 30, + 500); + GT_Values.RA.addSifterRecipe( + ItemUtils.getItemStackOfAmountFromOreDict("crushedPurifiedUraninite", 1), + new ItemStack[] { + ItemUtils.getItemStackOfAmountFromOreDict("dustUraninite", 1), + ItemUtils.getItemStackOfAmountFromOreDict("dustTinyUranium", 1), + ItemUtils.getItemStackOfAmountFromOreDict("dustRadium226", 1), + ItemUtils.getItemStackOfAmountFromOreDict("dustRadium226", 1), + ItemUtils.getItemStackOfAmountFromOreDict("dustRadium226", 1), + ItemUtils.getItemStackOfAmountFromOreDict("dustRadium226", 1) }, + new int[] { 10000, 5000, 500, 250, 250, 250 }, + 20 * 30, + 500); + GT_Values.RA.addSifterRecipe( + ItemUtils.getItemStackOfAmountFromOreDict("crushedPurifiedPitchblende", 1), + new ItemStack[] { + ItemUtils.getItemStackOfAmountFromOreDict("dustPitchblende", 1), + ItemUtils.getItemStackOfAmountFromOreDict("dustTinyLead", 1), + ItemUtils.getItemStackOfAmountFromOreDict("dustRadium226", 1), + ItemUtils.getItemStackOfAmountFromOreDict("dustRadium226", 1), + ItemUtils.getItemStackOfAmountFromOreDict("dustRadium226", 1), + ItemUtils.getItemStackOfAmountFromOreDict("dustRadium226", 1) }, + new int[] { 10000, 5000, 500, 250, 250, 250 }, + 20 * 30, + 500); + } + + private static void fluidHeater() { + + CORE.RA.addFluidHeaterRecipe( + FLUORIDES.SODIUM_FLUORIDE.getDust(1), + null, + FLUORIDES.SODIUM_FLUORIDE.getFluidStack(144), + 20 * 30, + 500); + + } + +} diff --git a/src/Java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_NuclearFuelProcessing.java b/src/Java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_NuclearFuelProcessing.java new file mode 100644 index 0000000000..c2c8c01f45 --- /dev/null +++ b/src/Java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_NuclearFuelProcessing.java @@ -0,0 +1,372 @@ +package gtPlusPlus.xmod.gregtech.loaders.recipe; + +import gregtech.api.enums.GT_Values; +import gtPlusPlus.core.item.ModItems; +import gtPlusPlus.core.item.chemistry.NuclearChem; +import gtPlusPlus.core.lib.CORE; +import gtPlusPlus.core.material.ELEMENT; +import gtPlusPlus.core.material.nuclear.FLUORIDES; +import gtPlusPlus.core.material.nuclear.NUCLIDE; +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 { + + public static void generate() { + + // Create Fuels + + final FluidStack aLithiumFluoride = FLUORIDES.LITHIUM_FLUORIDE.getFluidStack(100); + final FluidStack aBerylliumFluoride = FLUORIDES.BERYLLIUM_FLUORIDE.getFluidStack(100); + final FluidStack aThoriumFluoride = FLUORIDES.THORIUM_TETRAFLUORIDE.getFluidStack(100); + final FluidStack aZirconiumFluoride = FLUORIDES.ZIRCONIUM_TETRAFLUORIDE.getFluidStack(100); + final FluidStack aUraniumTetraFluoride = FLUORIDES.URANIUM_TETRAFLUORIDE.getFluidStack(100); + final FluidStack aUranium235 = ELEMENT.getInstance().URANIUM235.getFluidStack(1000); + final FluidStack aLiFBeF2ZrF4U235 = NUCLIDE.LiFBeF2ZrF4U235.getFluidStack(100); + final FluidStack aLiFBeF2ZrF4UF4 = NUCLIDE.LiFBeF2ZrF4UF4.getFluidStack(100); + final FluidStack aLiFBeF2ThF4UF4 = NUCLIDE.LiFBeF2ThF4UF4.getFluidStack(100); + + // 7LiF - BeF2 - ZrF4 - U235 - 590C + CORE.RA.addFissionFuel( + FluidUtils.getFluidStack(aLithiumFluoride, 550), + FluidUtils.getFluidStack(aBerylliumFluoride, 150), + FluidUtils.getFluidStack(aZirconiumFluoride, 60), + FluidUtils.getFluidStack(aUranium235, 240), + null, null, null, null, null, // Extra 5 inputs + FluidUtils.getFluidStack(aLiFBeF2ZrF4U235, 1000), + null, + 90 * 60 * 20, // Duration + MaterialUtils.getVoltageForTier(4) + ); + + // 7LiF - BeF2 - ZrF4 - UF4 - 650C + CORE.RA.addFissionFuel( + FluidUtils.getFluidStack(aLithiumFluoride, 600), + FluidUtils.getFluidStack(aBerylliumFluoride, 250), + FluidUtils.getFluidStack(aZirconiumFluoride, 80), + FluidUtils.getFluidStack(aUraniumTetraFluoride, 70), + null, null, null, null, null, // Extra 5 inputs + FluidUtils.getFluidStack(aLiFBeF2ZrF4UF4, 1000), + null, + 120 * 60 * 20, + MaterialUtils.getVoltageForTier(5) + ); + + // 7liF - BeF2 - ThF4 - UF4 - 566C + CORE.RA.addFissionFuel( + FluidUtils.getFluidStack(aLithiumFluoride, 580), + FluidUtils.getFluidStack(aBerylliumFluoride, 270), + FluidUtils.getFluidStack(aThoriumFluoride, 80), + FluidUtils.getFluidStack(aUraniumTetraFluoride, 70), + null, null, null, null, null, // Extra 5 inputs + FluidUtils.getFluidStack(aLiFBeF2ThF4UF4, 1000), + null, + 150 * 60 * 20, // Duration + MaterialUtils.getVoltageForTier(5) + ); + + + // Reprocess Fuels + + + // Reactor Blanket step 1 - Fluorination + CORE.RA.addReactorProcessingUnitRecipe( + 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}, + NUCLIDE.UF6F2.getFluidStack(1500), + 20 * 60 * 10, + MaterialUtils.getVoltageForTier(5)); + CORE.RA.addReactorProcessingUnitRecipe( + 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}, + NUCLIDE.UF6F2.getFluidStack(3000), + 20 * 60 * 10, + MaterialUtils.getVoltageForTier(5)); + + // Reactor Blanket step 1 - Fluorination + CORE.RA.addReactorProcessingUnitRecipe( + 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}, + NUCLIDE.UF6F2.getFluidStack(3000), + 20 * 60 * 5, + MaterialUtils.getVoltageForTier(5)); + CORE.RA.addReactorProcessingUnitRecipe( + 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}, + NUCLIDE.UF6F2.getFluidStack(6000), + 20 * 60 * 5, + MaterialUtils.getVoltageForTier(5)); + + + // Reactor Blanket step 2 - Sorption + Cold Trap + CORE.RA.addColdTrapRecipe( + 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}, + 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));*/ + + + + // LiBeF2UF4FP + F2 = LiFBeF2 & UF6F2FP + // Reactor Core step 1 - Process Burnt Salt + CORE.RA.addReactorProcessingUnitRecipe( + CI.getNumberedAdvancedCircuit(1), + ELEMENT.getInstance().FLUORINE.getCell(1), + NUCLIDE.LiFBeF2UF4FP.getFluidStack(1000), + new ItemStack[] { + NUCLIDE.UF6F2FP.getCell(1) + }, + new int[] {10000}, + FluidUtils.getFluidStack(NuclearChem.Impure_LiFBeF2, 1000), + 20 * 60 * 120, + MaterialUtils.getVoltageForTier(3)); + + // LiBeF2UF4FP + F2 = LiFBeF2 & UF6F2FP + // Reactor Core step 1 - Process Burnt Salt + CORE.RA.addReactorProcessingUnitRecipe( + 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}, + FluidUtils.getFluidStack(NuclearChem.Impure_LiFBeF2, 2000), + 20 * 60 * 60, + MaterialUtils.getVoltageForTier(3)); + + + + // Reactor Core step 2A - Sorption + Cold Trap + CORE.RA.addColdTrapRecipe( + 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}, + FLUORIDES.SODIUM_FLUORIDE.getFluidStack(2000), + 20 * 60 * 10, + MaterialUtils.getVoltageForTier(4)); + + + // Reactor Core step 2B - Distillation + GT_Values.RA.addDistillationTowerRecipe( + FluidUtils.getFluidStack(NuclearChem.Impure_LiFBeF2, 1000), + new FluidStack[] { + NUCLIDE.LiFBeF2.getFluidStack(250) + }, + null, + 120 * 60 * 20, + MaterialUtils.getVoltageForTier(3)); + + + // 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), + CI.emptyCells(1) + }, + new FluidStack[] { + NUCLIDE.LiFBeF2UF4.getFluidStack(3000) + }, + 20 * 60 * 10, + MaterialUtils.getVoltageForTier(4), + 6500); + + + + + // 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));*/ + + // 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.addFissionFuel( + FLUORIDES.ZIRCONIUM_TETRAFLUORIDE.getFluidStack(1000), + NUCLIDE.LiFBeF2UF4.getFluidStack(9000), + null, + null, + null, null, null, null, null, + NUCLIDE.LiFBeF2ZrF4UF4.getFluidStack(10000), + null, + 20 * 60 * 120, // Duration + 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.addFissionFuel( + FLUORIDES.THORIUM_TETRAFLUORIDE.getFluidStack(1000), + NUCLIDE.LiFBeF2UF4.getFluidStack(9000), + null, + null, + null, null, null, null, null, + NUCLIDE.LiFBeF2ThF4UF4.getFluidStack(10000), + null, + 20 * 60 * 150, // Duration + MaterialUtils.getVoltageForTier(5) + ); + + + + + } +} diff --git a/src/Java/gtPlusPlus/xmod/gregtech/recipes/GregtechRecipeAdder.java b/src/Java/gtPlusPlus/xmod/gregtech/recipes/GregtechRecipeAdder.java index 0b4649e414..be4d6a8f7d 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/recipes/GregtechRecipeAdder.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/recipes/GregtechRecipeAdder.java @@ -1,17 +1,23 @@ package gtPlusPlus.xmod.gregtech.recipes; +import static gregtech.GT_Mod.GT_FML_LOGGER; 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 gregtech.api.GregTech_API; import gregtech.api.enums.ConfigCategories; import gregtech.api.enums.GT_Values; +import gregtech.api.enums.ItemList; import gregtech.api.enums.Materials; import gregtech.api.interfaces.internal.IGT_RecipeAdder; import gregtech.api.util.*; +import gregtech.api.util.GTPP_Recipe.GTPP_Recipe_Map; +import gregtech.api.util.GT_Recipe.GT_Recipe_AssemblyLine; import gregtech.api.util.GT_Recipe.GT_Recipe_Map; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.api.objects.data.AutoMap; @@ -157,6 +163,30 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder { return false; } } + + + @Override + public boolean addCokeOvenRecipe(int aCircuit, ItemStack aInput2, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, ItemStack[] aOutputs, int aDuration, int aEUt) { + return addCokeOvenRecipe(CI.getNumberedCircuit(aCircuit), aInput2, aFluidInputs, aFluidOutputs, aOutputs, aDuration, aEUt); + } + + @Override + 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 }, + aOutputs, + null, + new int[] {}, + aFluidInputs, + aFluidOutputs, + Math.max(1, aDuration), + Math.max(1, aEUt), + 0); + int aSize = GTPP_Recipe.GTPP_Recipe_Map.sCokeOvenRecipes.mRecipeList.size(); + GTPP_Recipe.GTPP_Recipe_Map.sCokeOvenRecipes.add(aSpecialRecipe); + return GTPP_Recipe.GTPP_Recipe_Map.sCokeOvenRecipes.mRecipeList.size() > aSize; + } @Override public boolean addMatterFabricatorRecipe(final FluidStack aFluidInput, final FluidStack aFluidOutput, @@ -332,7 +362,7 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder { * aOutputItems, aDuration, aEUt); return true; } */ - @Override + /*@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."); @@ -363,7 +393,7 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder { Logger.WARNING("FAILED TO LOAD RECIPES - NULL POINTER SOMEWHERE"); return false; } - } + }*/ @Override public boolean addDehydratorRecipe(final ItemStack[] aInput, final FluidStack aFluidInput, @@ -371,32 +401,26 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder { final int aEUt) throws IndexOutOfBoundsException { Logger.WARNING("Trying to add a Dehydrator recipe."); try { - if (aInput[0] != null) { - Logger.WARNING("Recipe requires input: " + aInput[0].getDisplayName() + " x" + aInput[0].stackSize); - } - if (aInput.length > 1) { - if (aInput[1] != null) { - Logger.WARNING("Recipe requires input: " + aInput[1].getDisplayName() + " x" + aInput[1].stackSize); + if (aInput != null && aInput.length > 0) { + if (aInput[0] != null) { + Logger.WARNING("Recipe requires input: " + aInput[0].getDisplayName() + " x" + aInput[0].stackSize); + } + if (aInput.length > 1) { + if (aInput[1] != null) { + Logger.WARNING("Recipe requires input: " + aInput[1].getDisplayName() + " x" + aInput[1].stackSize); + } } } if (aFluidInput != null) { Logger.WARNING("Recipe requires input: " + aFluidInput.getFluid().getName() + " " + aFluidInput.amount - + "mbst"); + + "mbs"); } - if (((aInput[0] == null) && (aFluidInput == null)) || ((aOutputItems == null) && (aFluidOutput == null))) { - return false; - } - if ((aOutputItems != null) - && ((aDuration = GregTech_API.sRecipeFile.get("dehydrator", aOutputItems[0], aDuration)) <= 0)) { + if (((aInput == null || aInput.length == 0) && (aFluidInput == null)) || ((aOutputItems == null || aOutputItems.length == 0) && (aFluidOutput == null))) { return false; } if (aOutputItems != null) { Logger.WARNING("Recipe will output: " + ItemUtils.getArrayStackNames(aOutputItems)); } - if ((aFluidOutput != null) && ((aDuration = GregTech_API.sRecipeFile.get("dehydrator", - aFluidOutput.getFluid().getName(), aDuration)) <= 0)) { - return false; - } if (aFluidOutput != null) { Logger.WARNING("Recipe will output: " + aFluidOutput.getFluid().getName()); } @@ -542,21 +566,29 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder { 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) { + return addFissionFuel(false, aInput1, aInput2, aInput3, aInput4, aInput5, aInput6, aInput7, aInput8, aInput9, aOutput1, aOutput2, aDuration, aEUt); + } - if ((aInput1 == null) || (aInput2 == null) || (aOutput1 == null) || (aDuration < 1) || (aEUt < 1)) { + @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 }; GTPP_Recipe aSpecialRecipe = new GTPP_Recipe( - true, + aOptimise, new ItemStack[] {}, new ItemStack[] {}, null, @@ -1004,67 +1036,74 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder { return CORE.RA.addComponentMakerRecipe(aInputs, aInputFluid, aOutput1, aDuration, aEUt); } - public boolean addAssemblylineRecipe(ItemStack aResearchItem, int aResearchTime, ItemStack[] aInputs, FluidStack[] aFluidInputs_OLD, ItemStack aOutput, int aDuration, int aEUt) { - - FluidStack[] aFluidInputs = new FluidStack[4]; - AutoMap<FluidStack> aNewFluidMap = new AutoMap<FluidStack>(); - if (aFluidInputs_OLD.length > 4) { - for (FluidStack s : aFluidInputs_OLD) { - aNewFluidMap.put(s); - } - for (int i = 0; i < 4; i++) { - aFluidInputs[i] = aNewFluidMap.get(i); - } - } - else { - aFluidInputs = aFluidInputs_OLD; - } - - - if (!CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK) { - if (aInputs.length < 6 && aFluidInputs.length < 2) { - ItemStack[] aInputStack = new ItemStack[] {aResearchItem, aInputs[0], aInputs[1], aInputs[2], aInputs[3], aInputs[4]}; - return addSixSlotAssemblingRecipe(aInputStack, aFluidInputs[0], aOutput, aDuration, aEUt); - } - return false; - } - else { - if ((aResearchItem==null)||(aResearchTime<=0)||(aInputs == null) || (aOutput == null) || aInputs.length>15 || aInputs.length<4) { - return false; - } - else { - if (mAssemblyLine != null) { - try { - if (!tryAddTecTechScannerRecipe(aResearchItem, aInputs, aFluidInputs, aOutput, aDuration, aEUt)) { - try { - Logger.INFO("Failed to generate TecTech recipe for "+ItemUtils.getItemName(aResearchItem)+", please report this to Alkalus."); - } - catch (Throwable t) { - t.printStackTrace(); - } - } - return (boolean) mAssemblyLine.invoke(GT_Values.RA, aResearchItem, aResearchTime, aInputs, - aFluidInputs, aOutput, aDuration, aEUt); - } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) { - if (aInputs.length < 6 && aFluidInputs.length < 2) { - ItemStack[] aInputStack = new ItemStack[] { aResearchItem, aInputs[0], aInputs[1], - aInputs[2], aInputs[3], aInputs[4] }; - return addSixSlotAssemblingRecipe(aInputStack, aFluidInputs[0], aOutput, aDuration, - aEUt); - } - return false; - } - } else { - if (aInputs.length < 6 && aFluidInputs.length < 2) { - ItemStack[] aInputStack = new ItemStack[] { aResearchItem, aInputs[0], aInputs[1], aInputs[2], - aInputs[3], aInputs[4] }; - return addSixSlotAssemblingRecipe(aInputStack, aFluidInputs[0], aOutput, aDuration, - aEUt); - } - return false; - } - } - } + @Override + public boolean addAssemblylineRecipe(ItemStack aResearchItem, int aResearchTime, ItemStack[] aInputs, FluidStack[] aFluidInputs, ItemStack aOutput, int aDuration, int aEUt) { + if ((aResearchItem==null)||(aResearchTime<=0)||(aInputs == null) || (aOutput == null) || aInputs.length>15 || aInputs.length<4) { + return false; + } + if ((aDuration = GregTech_API.sRecipeFile.get("assemblingline", aOutput, aDuration)) <= 0) { + return false; + } + 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_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])}, null, null, aResearchTime, 30, -201); + 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])}, aFluidInputs, null, aDuration, aEUt, 0,true); + 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 ((aResearchItem==null)||(aResearchTime<=0)||(aInputs == null) || (aOutput == null) || aInputs.length>15 || aInputs.length<4) { + return false; + } + if ((aDuration = GregTech_API.sRecipeFile.get("assemblingline", aOutput, aDuration)) <= 0) { + return false; + } + ItemStack[] tInputs = new ItemStack[aInputs.length]; + ItemStack[][] tAlts = new ItemStack[aInputs.length][]; + for(int i = 0; i < aInputs.length; i++){ + Object obj = aInputs[i]; + if (obj instanceof ItemStack) { + tInputs[i] = (ItemStack) obj; + tAlts[i] = null; + continue; + } else if (obj instanceof ItemStack[]) { + ItemStack[] aStacks = (ItemStack[]) obj; + if (aStacks.length > 0) { + tInputs[i] = aStacks[0]; + tAlts[i] = (ItemStack[]) Arrays.copyOf(aStacks, aStacks.length); + continue; + } + } else if (obj instanceof Object[]) { + Object[] objs = (Object[]) obj; + List<ItemStack> tList; + if (objs.length >= 2 && !(tList = GT_OreDictUnificator.getOres(objs[0])).isEmpty()) { + try { + int tAmount = ((Number) objs[1]).intValue(); + List<ItemStack> uList = new ArrayList<>(); + for (ItemStack tStack : tList) { + ItemStack uStack = GT_Utility.copyAmount(tAmount, tStack); + if (GT_Utility.isStackValid(uStack)) { + uList.add(uStack); + if (tInputs[i] == null) + tInputs[i] = uStack; + } + } + tAlts[i] = uList.toArray(new ItemStack[uList.size()]); + continue; + } catch (Exception t) {} + } + } + 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])}, null, null, aResearchTime, 30, -201); + 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])},aFluidInputs,null,aDuration,aEUt,0,tAlts,true); + 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) { @@ -1731,8 +1770,77 @@ 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) { + GTPP_Recipe aRecipe = new GTPP_Recipe( + false, + new ItemStack[] {CI.getNumberedAdvancedCircuit(aCircuit), aInput}, + aOutputs, + null, + aChances, + new FluidStack[] {aFluidInput}, + new FluidStack[] {aFluidOutput}, + aTime, + aEU, + 0); + + int aSize = GTPP_Recipe_Map.sColdTrapRecipes.mRecipeList.size(); + GTPP_Recipe_Map.sColdTrapRecipes.add(aRecipe); + return GTPP_Recipe_Map.sColdTrapRecipes.mRecipeList.size() > aSize; + } + + + @Override + 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}, + aOutputs, + null, + aChances, + new FluidStack[] {aFluidInput}, + new FluidStack[] {aFluidOutput}, + aTime, + aEU, + 0); + int aSize = GTPP_Recipe_Map.sReactorProcessingUnitRecipes.mRecipeList.size(); + GTPP_Recipe_Map.sReactorProcessingUnitRecipes.add(aRecipe); + return GTPP_Recipe_Map.sReactorProcessingUnitRecipes.mRecipeList.size() > aSize; + } + + + @Override + 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}, null, null, new FluidStack[]{aFluidInput}, new FluidStack[]{aOutput}, aDuration, aEUt, 0); + return true; + } + + + @Override + public boolean addVacuumFreezerRecipe(ItemStack aInput, ItemStack aOutput, int aDuration, int aEUt) { + if ((aInput == null) || (aOutput == null)) { + return false; + } + GTPP_Recipe aRecipe = new GTPP_Recipe( + false, + new ItemStack[] {aInput}, + new ItemStack[] {aOutput}, + null, + new int[] {10000}, + new FluidStack[] {}, + new FluidStack[] {}, + aDuration, + aEUt, + 0); + int aSize = GT_Recipe_Map.sVacuumRecipes.mRecipeList.size(); + GT_Recipe_Map.sVacuumRecipes.add(aRecipe); + return GT_Recipe_Map.sVacuumRecipes.mRecipeList.size() > aSize; + } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechDehydrator.java b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechDehydrator.java index 5f6f557b11..a8b5aea0e6 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechDehydrator.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechDehydrator.java @@ -1,12 +1,10 @@ package gtPlusPlus.xmod.gregtech.registration.gregtech; -import net.minecraft.item.ItemStack; - -import gregtech.api.enums.*; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine_GT_Recipe; +import gregtech.api.enums.GT_Values; +import gregtech.api.enums.ItemList; +import gregtech.api.enums.Materials; +import gregtech.api.enums.OrePrefixes; import gregtech.api.util.GT_ModHandler; -import gregtech.api.util.GTPP_Recipe; - import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.lib.LoadedMods; @@ -14,8 +12,9 @@ import gtPlusPlus.core.material.ALLOY; import gtPlusPlus.core.recipe.common.CI; 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 gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing.advanced.GregtechMetaTileEntity_Adv_EBF; +import net.minecraft.item.ItemStack; public class GregtechDehydrator { public static void run() { @@ -44,37 +43,67 @@ public class GregtechDehydrator { //Basic GregtechItemList.GT_Dehydrator_MV - .set(new GT_MetaTileEntity_BasicMachine_GT_Recipe(911, "machine.dehydrator.tier.00", - "Basic Dehydrator I", 2, "This dehydrates your Grapes into Raisins. ", - GTPP_Recipe.GTPP_Recipe_Map.sChemicalDehydratorRecipes, 2, 9, 16000, 2, 5, "Dehydrator.png", - "", false, false, 0, "UNBOXINATOR", null).getStackForm(1L)); + .set(new GT_MetaTileEntity_Dehydrator( + 911, + "machine.dehydrator.tier.00", + "Basic Dehydrator I", + 2, + "This dehydrates your Grapes into Raisins.", + 16000) + .getStackForm(1L)); + GregtechItemList.GT_Dehydrator_HV - .set(new GT_MetaTileEntity_BasicMachine_GT_Recipe(912, "machine.dehydrator.tier.01", - "Basic Dehydrator II", 3, "This dehydrates your Grapes into Raisins. ", - GTPP_Recipe.GTPP_Recipe_Map.sChemicalDehydratorRecipes, 2, 9, 32000, 2, 5, "Dehydrator.png", - "", false, false, 0, "UNBOXINATOR", null).getStackForm(1L)); + .set(new GT_MetaTileEntity_Dehydrator( + 912, + "machine.dehydrator.tier.01", + "Basic Dehydrator II", + 3, + "This dehydrates your Grapes into Raisins.", + 32000) + .getStackForm(1L)); + //Chemical + GregtechItemList.GT_Dehydrator_EV - .set(new GT_MetaTileEntity_BasicMachine_GT_Recipe(813, "advancedmachine.dehydrator.tier.01", - "Chemical Dehydrator I", 4, "This dehydrates your Grapes into Raisins. ", - GTPP_Recipe.GTPP_Recipe_Map.sChemicalDehydratorRecipes, 2, 9, 48000, 2, 5, "Dehydrator.png", - "", false, false, 0, "UNBOXINATOR", null).getStackForm(1L)); - GregtechItemList.GT_Dehydrator_IV.set(new GT_MetaTileEntity_BasicMachine_GT_Recipe(814, - "advancedmachine.dehydrator.tier.02", "Chemical Dehydrator II", 5, - "A hangover is the way your body reacts to dehydration. ", - GTPP_Recipe.GTPP_Recipe_Map.sChemicalDehydratorRecipes, 2, 9, 64000, 2, 5, "Dehydrator.png", "", - false, false, 0, "UNBOXINATOR", null).getStackForm(1L)); - GregtechItemList.GT_Dehydrator_LuV.set(new GT_MetaTileEntity_BasicMachine_GT_Recipe(815, - "advancedmachine.dehydrator.tier.03", "Chemical Dehydrator III", 6, - "You could probably make space icecream with this.. ", - GTPP_Recipe.GTPP_Recipe_Map.sChemicalDehydratorRecipes, 2, 9, 64000, 2, 5, "Dehydrator.png", "", - false, false, 0, "UNBOXINATOR", null).getStackForm(1L)); - GregtechItemList.GT_Dehydrator_ZPM.set(new GT_MetaTileEntity_BasicMachine_GT_Recipe(816, - "advancedmachine.dehydrator.tier.04", "Chemical Dehydrator IV", 7, - "You can definitely make space icecream with this.. ", - GTPP_Recipe.GTPP_Recipe_Map.sChemicalDehydratorRecipes, 2, 9, 64000, 2, 5, "Dehydrator.png", "", - false, false, 0, "UNBOXINATOR", null).getStackForm(1L)); + .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)); + + 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)); + + 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)); + + 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)); //Advanced GregtechItemList.Controller_Vacuum_Furnace.set(new GregtechMetaTileEntity_IndustrialDehydrator(995, "multimachine.adv.vacuumfurnace", "Utupu-Tanuri").getStackForm(1L)); diff --git a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialElementDuplicator.java b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialElementDuplicator.java index 59b6d78a4f..9e940dff26 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialElementDuplicator.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialElementDuplicator.java @@ -1,10 +1,8 @@ -/* package gtPlusPlus.xmod.gregtech.registration.gregtech; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_ElementalDataOrbHolder; -import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Steam_BusInput; import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production.GregtechMTE_ElementalDuplicator; public class GregtechIndustrialElementDuplicator { @@ -19,4 +17,4 @@ public class GregtechIndustrialElementDuplicator { } } -*/ + diff --git a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechLFTR.java b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechLFTR.java index a9eee53a7c..cef60ba712 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechLFTR.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechLFTR.java @@ -3,6 +3,9 @@ package gtPlusPlus.xmod.gregtech.registration.gregtech; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; +import gtPlusPlus.xmod.gregtech.common.tileentities.machines.basic.GregtechMetaTileEntity_ReactorColdTrap; +import gtPlusPlus.xmod.gregtech.common.tileentities.machines.basic.GregtechMetaTileEntity_ReactorProcessingUnit; +import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing.GregtechMetaTileEntity_SpargeTower; import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production.GregtechMTE_NuclearReactor; public class GregtechLFTR { @@ -19,9 +22,15 @@ public class GregtechLFTR { private static void run1() { // LFTR - GregtechItemList.ThoriumReactor - .set(new GregtechMTE_NuclearReactor(751, "lftr.controller.single", "Thorium Reactor [LFTR]") - .getStackForm(1L)); - + GregtechItemList.ThoriumReactor.set(new GregtechMTE_NuclearReactor(751, "lftr.controller.single", "Thorium Reactor [LFTR]").getStackForm(1L)); + // Reactor Processing Units + GregtechItemList.ReactorProcessingUnit_IV.set(new GregtechMetaTileEntity_ReactorProcessingUnit(31031, "rpu.tier.01", "Reactor Processing Unit I", 5).getStackForm(1L)); + GregtechItemList.ReactorProcessingUnit_ZPM.set(new GregtechMetaTileEntity_ReactorProcessingUnit(31032, "rpu.tier.02", "Reactor Processing Unit II", 7).getStackForm(1L)); + // Cold Traps + GregtechItemList.ColdTrap_IV.set(new GregtechMetaTileEntity_ReactorColdTrap(31033, "coldtrap.tier.01", "Cold Trap I", 5).getStackForm(1L)); + GregtechItemList.ColdTrap_ZPM.set(new GregtechMetaTileEntity_ReactorColdTrap(31034, "coldtrap.tier.02", "Cold Trap II", 7).getStackForm(1L)); + // Sparge Tower + GregtechItemList.Controller_Sparge_Tower.set(new GregtechMetaTileEntity_SpargeTower(31035, "sparge.controller.single", "Sparge Tower Controller").getStackForm(1L)); + } } diff --git a/src/Java/gtPlusPlus/xmod/ic2/recipe/RECIPE_IC2.java b/src/Java/gtPlusPlus/xmod/ic2/recipe/RECIPE_IC2.java index e22a609814..1b090cc51a 100644 --- a/src/Java/gtPlusPlus/xmod/ic2/recipe/RECIPE_IC2.java +++ b/src/Java/gtPlusPlus/xmod/ic2/recipe/RECIPE_IC2.java @@ -272,7 +272,7 @@ public class RECIPE_IC2 { ItemUtils.getSimpleStack(aCoilIC2, 8), ItemUtils.getSimpleStack(aGearSmallAluminium, 4), }, - aRubber.getFluid(144 * 4), + aRubber.getFluidStack(144 * 4), GregtechItemList.Armour_Hazmat_Advanced_Helmet.get(1), 30 * 20, MaterialUtils.getVoltageForTier(2)); @@ -287,7 +287,7 @@ public class RECIPE_IC2 { ItemUtils.getSimpleStack(aPlateCobalt, 16), ItemUtils.getSimpleStack(aGearSiliconCarbide, 8), }, - aRubber.getFluid(144 * 10), + aRubber.getFluidStack(144 * 10), GregtechItemList.Armour_Hazmat_Advanced_Chest.get(1), 90 * 20, MaterialUtils.getVoltageForTier(2)); @@ -302,7 +302,7 @@ public class RECIPE_IC2 { ItemUtils.getSimpleStack(aPlateCobalt, 8), ItemUtils.getSimpleStack(aGearSiliconCarbide, 4), }, - aRubber.getFluid(144 * 8), + aRubber.getFluidStack(144 * 8), GregtechItemList.Armour_Hazmat_Advanced_Legs.get(1), 75 * 20, MaterialUtils.getVoltageForTier(2)); @@ -317,7 +317,7 @@ public class RECIPE_IC2 { ItemUtils.getSimpleStack(aGearSmallSteel, 8), ItemUtils.getSimpleStack(aGearPotin, 4), }, - aRubber.getFluid(144 * 6), + aRubber.getFluidStack(144 * 6), GregtechItemList.Armour_Hazmat_Advanced_Boots.get(1), 45 * 20, MaterialUtils.getVoltageForTier(2)); diff --git a/src/Java/gtPlusPlus/xmod/tinkers/material/BaseTinkersMaterial.java b/src/Java/gtPlusPlus/xmod/tinkers/material/BaseTinkersMaterial.java index 6f47909a01..0d2c79db08 100644 --- a/src/Java/gtPlusPlus/xmod/tinkers/material/BaseTinkersMaterial.java +++ b/src/Java/gtPlusPlus/xmod/tinkers/material/BaseTinkersMaterial.java @@ -204,7 +204,7 @@ public class BaseTinkersMaterial { try { aMatBlock = aMaterial.getBlock(); aMelt = aMaterial.getMeltingPointC(); - aFluid = aMaterial.getFluid(0).getFluid(); + aFluid = aMaterial.getFluidStack(0).getFluid(); } catch (Throwable t) { return false; @@ -217,14 +217,14 @@ public class BaseTinkersMaterial { //Smeltery.addMelting(new ItemStack(ExtraUtils.unstableIngot, 1, 0), ExtraUtils.decorative1, 5, 850, aMaterial.getFluid(72)); TinkersUtils.registerFluidType(mLocalName, aMatBlock, 0, aMelt, aFluid, true); - TinkersUtils.addMelting(aMaterial.getBlock(1), aMatBlock, 0, aMelt, aMaterial.getFluid(144*9)); - TinkersUtils.addMelting(aMaterial.getIngot(1), aMatBlock, 0, aMelt, aMaterial.getFluid(144)); + TinkersUtils.addMelting(aMaterial.getBlock(1), aMatBlock, 0, aMelt, aMaterial.getFluidStack(144*9)); + TinkersUtils.addMelting(aMaterial.getIngot(1), aMatBlock, 0, aMelt, aMaterial.getFluidStack(144)); if (aMelt <= 3600) { ItemStack ingotcast = TinkersUtils.getPattern(1); TinkersUtils.addBasinRecipe(aMaterial.getBlock(1), - aMaterial.getFluid(144*9), (ItemStack) null, true, 100); + aMaterial.getFluidStack(144*9), (ItemStack) null, true, 100); TinkersUtils.addCastingTableRecipe(aMaterial.getIngot(1), - aMaterial.getFluid(144), ingotcast, false, 50); + aMaterial.getFluidStack(144), ingotcast, false, 50); } boolean extended = TinkersUtils.generateCastingRecipes(aMaterial, aID); diff --git a/src/Java/gtPlusPlus/xmod/tinkers/util/TinkersUtils.java b/src/Java/gtPlusPlus/xmod/tinkers/util/TinkersUtils.java index 15ca3b497e..cf3284bfae 100644 --- a/src/Java/gtPlusPlus/xmod/tinkers/util/TinkersUtils.java +++ b/src/Java/gtPlusPlus/xmod/tinkers/util/TinkersUtils.java @@ -180,8 +180,8 @@ public class TinkersUtils { public static boolean addBaseMeltingRecipes(Material aMaterial) { - return addMelting(aMaterial.getBlock(1), aMaterial.getBlock(), 0, aMaterial.getMeltingPointC(), aMaterial.getFluid(144*9)) && - addMelting(aMaterial.getIngot(1), aMaterial.getBlock(), 0, aMaterial.getMeltingPointC(), aMaterial.getFluid(144)); + return addMelting(aMaterial.getBlock(1), aMaterial.getBlock(), 0, aMaterial.getMeltingPointC(), aMaterial.getFluidStack(144*9)) && + addMelting(aMaterial.getIngot(1), aMaterial.getBlock(), 0, aMaterial.getMeltingPointC(), aMaterial.getFluidStack(144)); } public static boolean addMelting(ItemStack input, Block block, int metadata, int temperature, FluidStack liquid) { @@ -221,7 +221,7 @@ public class TinkersUtils { public static boolean addBaseBasinRecipes(Material aMaterial) { - return addBasinRecipe(aMaterial.getBlock(1), aMaterial.getFluid(144*9), (ItemStack) null, true, 100); + return addBasinRecipe(aMaterial.getBlock(1), aMaterial.getFluidStack(144*9), (ItemStack) null, true, 100); } public static boolean addBasinRecipe(ItemStack output, FluidStack metal, ItemStack cast, boolean consume, int delay) { @@ -245,7 +245,7 @@ public class TinkersUtils { public static boolean addBaseCastingRecipes(Material aMaterial) { ItemStack ingotcast = getPattern(1); - return addCastingTableRecipe(aMaterial.getIngot(1), aMaterial.getFluid(144), ingotcast, false, 50); + return addCastingTableRecipe(aMaterial.getIngot(1), aMaterial.getFluidStack(144), ingotcast, false, 50); } public static boolean addCastingTableRecipe(ItemStack output, FluidStack metal, ItemStack cast, boolean consume, int delay) { @@ -482,7 +482,7 @@ public class TinkersUtils { //CastingRecipe recipe = (CastingRecipe) i$.next(); ItemStack output = recipe.getResult().copy(); output.setItemDamage(aID); - FluidStack liquid2 = new FluidStack(aMaterial.getFluid(0).getFluid(), recipe.castingMetal.amount); + FluidStack liquid2 = new FluidStack(aMaterial.getFluidStack(0).getFluid(), recipe.castingMetal.amount); addCastingTableRecipe(output, liquid2, recipe.cast, recipe.consumeCast, recipe.coolTime); addMelting(ft, output, 0, liquid2.amount / 2); } |