aboutsummaryrefslogtreecommitdiff
path: root/src/Java/gtPlusPlus
diff options
context:
space:
mode:
Diffstat (limited to 'src/Java/gtPlusPlus')
-rw-r--r--src/Java/gtPlusPlus/GTplusplus.java2
-rw-r--r--src/Java/gtPlusPlus/api/helpers/GregtechPlusPlus_API.java6
-rw-r--r--src/Java/gtPlusPlus/core/block/ModBlocks.java4
-rw-r--r--src/Java/gtPlusPlus/core/block/general/antigrief/BlockWitherProof.java56
-rw-r--r--src/Java/gtPlusPlus/core/commands/CommandEnableDebugWhileRunning.java102
-rw-r--r--src/Java/gtPlusPlus/core/config/ConfigHandler.java3
-rw-r--r--src/Java/gtPlusPlus/core/handler/BookHandler.java2
-rw-r--r--src/Java/gtPlusPlus/core/handler/COMPAT_HANDLER.java2
-rw-r--r--src/Java/gtPlusPlus/core/item/ModItems.java12
-rw-r--r--src/Java/gtPlusPlus/core/item/chemistry/CoalTar.java12
-rw-r--r--src/Java/gtPlusPlus/core/item/chemistry/GenericChem.java55
-rw-r--r--src/Java/gtPlusPlus/core/item/chemistry/general/ItemGenericChemBase.java3
-rw-r--r--src/Java/gtPlusPlus/core/lib/CORE.java1
-rw-r--r--src/Java/gtPlusPlus/core/lib/LoadedMods.java108
-rw-r--r--src/Java/gtPlusPlus/core/material/ALLOY.java2
-rw-r--r--src/Java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java99
-rw-r--r--src/Java/gtPlusPlus/core/recipe/RECIPES_Machines.java40
-rw-r--r--src/Java/gtPlusPlus/core/recipe/common/CI.java97
-rw-r--r--src/Java/gtPlusPlus/core/slots/SlotChemicalPlantInput.java4
-rw-r--r--src/Java/gtPlusPlus/core/util/data/ArrayUtils.java10
-rw-r--r--src/Java/gtPlusPlus/core/util/minecraft/HazmatUtils.java76
-rw-r--r--src/Java/gtPlusPlus/core/util/minecraft/ItemUtils.java138
-rw-r--r--src/Java/gtPlusPlus/core/util/minecraft/LangUtils.java100
-rw-r--r--src/Java/gtPlusPlus/core/util/minecraft/MaterialUtils.java3
-rw-r--r--src/Java/gtPlusPlus/core/util/minecraft/NBTUtils.java11
-rw-r--r--src/Java/gtPlusPlus/core/util/minecraft/PlayerUtils.java26
-rw-r--r--src/Java/gtPlusPlus/nei/GT_NEI_FluidReactor.java104
-rw-r--r--src/Java/gtPlusPlus/nei/NEI_GT_Config.java5
-rw-r--r--src/Java/gtPlusPlus/plugin/agrichem/BioRecipes.java72
-rw-r--r--src/Java/gtPlusPlus/preloader/asm/AsmConfig.java17
-rw-r--r--src/Java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_Forge_EntityLivingBase_SetHealth.java130
-rw-r--r--src/Java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_GT_CharcoalPit.java102
-rw-r--r--src/Java/gtPlusPlus/preloader/asm/transformers/Preloader_Transformer_Handler.java67
-rw-r--r--src/Java/gtPlusPlus/xmod/bop/blocks/BOP_Block_Registrator.java6
-rw-r--r--src/Java/gtPlusPlus/xmod/bop/blocks/base/LeavesBase.java2
-rw-r--r--src/Java/gtPlusPlus/xmod/bop/blocks/base/LogBase.java4
-rw-r--r--src/Java/gtPlusPlus/xmod/bop/blocks/base/SaplingBase.java2
-rw-r--r--src/Java/gtPlusPlus/xmod/cofh/HANDLER_COFH.java15
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/HANDLER_GT.java2
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java16
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/IGregtech_RecipeAdder.java2
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/items/Gregtech_MetaItem_X32.java43
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java197
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/generators/GregtechRocketFuelGeneratorBase.java7
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/Meta_GT_Proxy.java48
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/StaticFields59.java32
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/covers/GTPP_Cover_Overflow.java210
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/covers/GTPP_Cover_Overflow2.java131
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/items/MetaGeneratedGregtechItems.java53
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/items/behaviours/Behaviour_Electric_Lighter.java18
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_RfConvertor.java344
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntityGeothermalGenerator.java3
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntityRocketFuelGenerator.java4
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntityChunkLoader.java63
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_ChemicalReactor.java24
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialAlloySmelter.java380
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialArcFurnace.java14
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialDehydrator.java3
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialMixer.java26
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialMultiMachine.java423
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialSifter.java2
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialWashPlant.java3
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_EBF.java31
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GT4Entity_AutoCrafter.java51
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_LargeNaqReactor.java495
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_AlloyBlastSmelter.java17
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_Cyclotron.java123
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_IndustrialFishingPond.java3
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_LargeRocketEngine.java135
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/algae/GregtechMTE_AlgaePondBase.java16
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/chemplant/GregtechMTE_ChemicalPlant.java129
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/storage/GregtechMetaTileEntity_PowerSubStationController.java55
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GregtechMetaEnergyBuffer.java4
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/loaders/Gregtech_Blocks.java2
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_AlloySmelter.java8
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Extruder.java1
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/loaders/misc/WoodCentrifuging.java85
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_AlgaeFarm.java111
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/recipes/GregtechRecipeAdder.java8
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechDehydrator.java12
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechEnergyBuffer.java16
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialAlloySmelter.java22
-rw-r--r--src/Java/gtPlusPlus/xmod/ob/GliderHandler.java10
83 files changed, 3053 insertions, 1829 deletions
diff --git a/src/Java/gtPlusPlus/GTplusplus.java b/src/Java/gtPlusPlus/GTplusplus.java
index 7f22ac179e..6f734db111 100644
--- a/src/Java/gtPlusPlus/GTplusplus.java
+++ b/src/Java/gtPlusPlus/GTplusplus.java
@@ -58,6 +58,7 @@ import gtPlusPlus.xmod.gregtech.api.objects.GregtechBufferThread;
import gtPlusPlus.xmod.gregtech.common.Meta_GT_Proxy;
import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock;
import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtTools;
+import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production.chemplant.GregtechMTE_ChemicalPlant;
import gtPlusPlus.xmod.gregtech.loaders.GT_Material_Loader;
import gtPlusPlus.xmod.gregtech.loaders.RecipeGen_BlastSmelterGT_GTNH;
import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechMiniRaFusion;
@@ -291,6 +292,7 @@ public class GTplusplus implements ActionListener {
FishPondFakeRecipe.generateFishPondRecipes();
GregtechMiniRaFusion.generateSlowFusionrecipes();
SemiFluidFuelHandler.generateFuels();
+ GregtechMTE_ChemicalPlant.generateRecipes();
//Large Centrifuge generation
mOriginalCount[0] = GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.mRecipeList.size();
diff --git a/src/Java/gtPlusPlus/api/helpers/GregtechPlusPlus_API.java b/src/Java/gtPlusPlus/api/helpers/GregtechPlusPlus_API.java
index 3acca269d7..fb1258f6d2 100644
--- a/src/Java/gtPlusPlus/api/helpers/GregtechPlusPlus_API.java
+++ b/src/Java/gtPlusPlus/api/helpers/GregtechPlusPlus_API.java
@@ -14,11 +14,7 @@ public class GregtechPlusPlus_API {
public static class Multiblock_API {
- private static final HashMap<String, SpecialMultiBehaviour> mSpecialBehaviourItemMap;
-
- static {
- mSpecialBehaviourItemMap = new HashMap<String, SpecialMultiBehaviour>();
- }
+ private static final HashMap<String, SpecialMultiBehaviour> mSpecialBehaviourItemMap = new HashMap<String, SpecialMultiBehaviour>();
/**
* Register a special behaviour for GT++ Multis to listen use.
diff --git a/src/Java/gtPlusPlus/core/block/ModBlocks.java b/src/Java/gtPlusPlus/core/block/ModBlocks.java
index 4bc5908f98..db9ad2264c 100644
--- a/src/Java/gtPlusPlus/core/block/ModBlocks.java
+++ b/src/Java/gtPlusPlus/core/block/ModBlocks.java
@@ -55,7 +55,8 @@ public final class ModBlocks {
public static Block blockCasingsMisc;
public static Block blockCasings2Misc;
public static Block blockCasings3Misc;
- public static Block blockCasings4Misc;
+ public static Block blockCasings4Misc;
+ public static Block blockCasingsTieredGTPP;
public static Block blockMetaTileEntity;
public static Block blockHeliumGenerator;
@@ -97,7 +98,6 @@ public final class ModBlocks {
public static Block blockPooCollector;
public static Block blockPestKiller;
- public static GregtechMetaTieredCasingBlocks1 BlockTieredCasings1;
public static void init() {
Logger.INFO("Initializing Blocks.");
diff --git a/src/Java/gtPlusPlus/core/block/general/antigrief/BlockWitherProof.java b/src/Java/gtPlusPlus/core/block/general/antigrief/BlockWitherProof.java
index ed531cef2d..2210e68e8a 100644
--- a/src/Java/gtPlusPlus/core/block/general/antigrief/BlockWitherProof.java
+++ b/src/Java/gtPlusPlus/core/block/general/antigrief/BlockWitherProof.java
@@ -12,6 +12,8 @@ import net.minecraft.entity.EnumCreatureType;
import net.minecraft.entity.boss.EntityDragon;
import net.minecraft.entity.boss.EntityWither;
import net.minecraft.entity.boss.IBossDisplayData;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.world.Explosion;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
@@ -105,6 +107,60 @@ public class BlockWitherProof extends Block{
return false;
}
+ @Override
+ public void breakBlock(World p_149749_1_, int p_149749_2_, int p_149749_3_, int p_149749_4_, Block p_149749_5_, int p_149749_6_) {
+ super.breakBlock(p_149749_1_, p_149749_2_, p_149749_3_, p_149749_4_, p_149749_5_, p_149749_6_);
+ }
+
+ @Override
+ public float getPlayerRelativeBlockHardness(EntityPlayer aPlayer, World p_149737_2_, int p_149737_3_, int p_149737_4_, int p_149737_5_) {
+ if (aPlayer != null && aPlayer instanceof EntityPlayerMP) {
+ return 1f;
+ }
+ return -1f;
+ }
+
+ @Override
+ public float getExplosionResistance(Entity p_149638_1_) {
+ return Float.MAX_VALUE;
+ }
+
+ @Override
+ public void onBlockClicked(World p_149699_1_, int p_149699_2_, int p_149699_3_, int p_149699_4_, EntityPlayer p_149699_5_) {
+ super.onBlockClicked(p_149699_1_, p_149699_2_, p_149699_3_, p_149699_4_, p_149699_5_);
+ }
+
+ @Override
+ public void onEntityCollidedWithBlock(World world, int x, int y, int z, Entity entity) {
+ if ((entity == null) || !entity.isEntityAlive()){
+ return;
+ }
+ if ((entity instanceof EntityWither) || (entity instanceof EntityDragon) || (entity instanceof IBossDisplayData)){
+ return;
+ }
+ else {
+ super.onEntityCollidedWithBlock(world, x, y, z, entity);
+ }
+ }
+
+ @Override
+ public void harvestBlock(World p_149636_1_, EntityPlayer p_149636_2_, int p_149636_3_, int p_149636_4_, int p_149636_5_, int p_149636_6_) {
+ super.harvestBlock( p_149636_1_, p_149636_2_, p_149636_3_, p_149636_4_, p_149636_5_, p_149636_6_);
+ }
+
+ @Override
+ public boolean canHarvestBlock(EntityPlayer player, int meta) {
+ if (player != null && player instanceof EntityPlayerMP) {
+ return true;
+ }
+ return super.canHarvestBlock(player, meta);
+ }
+
+ @Override
+ public float getExplosionResistance(Entity par1Entity, World world, int x, int y, int z, double explosionX, double explosionY, double explosionZ) {
+ return Float.MAX_VALUE;
+ }
+
}
diff --git a/src/Java/gtPlusPlus/core/commands/CommandEnableDebugWhileRunning.java b/src/Java/gtPlusPlus/core/commands/CommandEnableDebugWhileRunning.java
index 5b9c17bacf..06b6f14822 100644
--- a/src/Java/gtPlusPlus/core/commands/CommandEnableDebugWhileRunning.java
+++ b/src/Java/gtPlusPlus/core/commands/CommandEnableDebugWhileRunning.java
@@ -20,92 +20,92 @@ public class CommandEnableDebugWhileRunning implements ICommand
public CommandEnableDebugWhileRunning(){
this.aliases = new ArrayList<>();
+ this.aliases.add("gtplusplus");
}
@Override
public int compareTo(final Object o){
- return 0;
-
+ if (o instanceof Comparable<?>) {
+ @SuppressWarnings("unchecked")
+ Comparable<ICommand> a = (Comparable<ICommand>) o;
+ if (a.equals(this)) {
+ return 0;
+ }
+ else {
+ return -1;
+ }
+ }
+ return -1;
}
@Override
public String getCommandName(){
- return "debugmodegtpp";
+ return "gtpp";
}
-
- // Use '/debugmodegtpp' along with 'logging' or 'debug' to toggle Debug mode and Logging.
+
+ // Use '/gtpp' along with 'logging' or 'debug' to toggle Debug mode and Logging.
// Using nothing after the command toggles both to their opposite states respectively.
@Override
public String getCommandUsage(final ICommandSender var1){
- return "/debugmodegtpp";
-
+ return "/gtpp ?";
}
@Override
public List<String> getCommandAliases(){
return this.aliases;
-
}
@Override
public void processCommand(final ICommandSender S, final String[] argString){
-
- if (argString == null || argString.length == 0 || argString.length > 1) {
- Logger.INFO("Toggling Debug Mode & Logging.");
+ int aMaxArgumentsAllowed = 1;
+
+ if ((argString == null || argString.length == 0 || argString.length > aMaxArgumentsAllowed) || argString[0].toLowerCase().equals("?")) {
+ Logger.INFO("Listing commands and their uses.");
+ final EntityPlayer P = CommandUtils.getPlayer(S);
+ AsmConfig.disableAllLogging = Utils.invertBoolean(AsmConfig.disableAllLogging);
+ PlayerUtils.messagePlayer(P, "The following are valid args for the '/gtpp' command:");
+ PlayerUtils.messagePlayer(P, "? - This help command.");
+ PlayerUtils.messagePlayer(P, "logging - Toggles ALL GT++ logging for current session.");
+ PlayerUtils.messagePlayer(P, "debug - Toggles GT++ Debug Mode. Only use when advised, may break everything. (OP)");
+ }
+ else if (argString[0].toLowerCase().equals("debug")) {
+ Logger.INFO("Toggling Debug Mode.");
final EntityPlayer P = CommandUtils.getPlayer(S);
if (PlayerUtils.isPlayerOP(P)) {
- CORE.DEBUG = Utils.invertBoolean(CORE.DEBUG);
- PlayerUtils.messagePlayer(P, "Toggled GT++ Debug Mode - Enabled: "+CORE.DEBUG);
- AsmConfig.disableAllLogging = Utils.invertBoolean(AsmConfig.disableAllLogging);
- PlayerUtils.messagePlayer(P, "Toggled GT++ Logging - Enabled: "+(!AsmConfig.disableAllLogging));
- }
- }
- else {
- if (argString[0].toLowerCase().equals("debug")) {
- Logger.INFO("Toggling Debug Mode.");
- final EntityPlayer P = CommandUtils.getPlayer(S);
- if (PlayerUtils.isPlayerOP(P)) {
- CORE.DEBUG = Utils.invertBoolean(CORE.DEBUG);
- PlayerUtils.messagePlayer(P, "Toggled GT++ Debug Mode - Enabled: "+CORE.DEBUG);
- }
- }
- else if (argString[0].toLowerCase().equals("logging")) {
- Logger.INFO("Toggling Logging.");
- final EntityPlayer P = CommandUtils.getPlayer(S);
- if (PlayerUtils.isPlayerOP(P)) {
- AsmConfig.disableAllLogging = Utils.invertBoolean(AsmConfig.disableAllLogging);
- PlayerUtils.messagePlayer(P, "Toggled GT++ Logging - Enabled: "+(!AsmConfig.disableAllLogging));
- }
- }
- else {
- final EntityPlayer P = CommandUtils.getPlayer(S);
- if (PlayerUtils.isPlayerOP(P)) {
- PlayerUtils.messagePlayer(P, "Invalid command, use 'debug' or 'logging'");
- }
+ CORE.DEBUG = Utils.invertBoolean(CORE.DEBUG);
+ PlayerUtils.messagePlayer(P, "Toggled GT++ Debug Mode - Enabled: "+CORE.DEBUG);
}
}
-
-
-
+ else if (argString[0].toLowerCase().equals("logging")) {
+ Logger.INFO("Toggling Logging.");
+ final EntityPlayer P = CommandUtils.getPlayer(S);
+ AsmConfig.disableAllLogging = Utils.invertBoolean(AsmConfig.disableAllLogging);
+ PlayerUtils.messagePlayer(P, "Toggled GT++ Logging - Enabled: "+(!AsmConfig.disableAllLogging));
+ }
+ else {
+ final EntityPlayer P = CommandUtils.getPlayer(S);
+ PlayerUtils.messagePlayer(P, "Invalid command, use '?' as an argument for help.'");
+ }
+
}
@Override
public boolean canCommandSenderUseCommand(final ICommandSender var1){
- if (var1 == null) {
- return false;
- }
- final EntityPlayer P = CommandUtils.getPlayer(var1);
- if (P != null && PlayerUtils.isPlayerOP(P)) {
- return true;
+ if (var1 == null || CommandUtils.getPlayer(var1) == null) {
+ return false;
}
- return false;
+ return true;
}
@Override
public List<?> addTabCompletionOptions(final ICommandSender var1, final String[] var2){
- return null;
+ ArrayList<String> aTabCompletes = new ArrayList<String>();
+ aTabCompletes.add("?");
+ aTabCompletes.add("logging");
+ aTabCompletes.add("debug");
+ return aTabCompletes;
}
@Override
@@ -115,7 +115,7 @@ public class CommandEnableDebugWhileRunning implements ICommand
}
public boolean playerUsesCommand(final World W, final EntityPlayer P, final int cost){
- return true;
+ return true;
}
} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/core/config/ConfigHandler.java b/src/Java/gtPlusPlus/core/config/ConfigHandler.java
index ecaf031030..61e7045192 100644
--- a/src/Java/gtPlusPlus/core/config/ConfigHandler.java
+++ b/src/Java/gtPlusPlus/core/config/ConfigHandler.java
@@ -113,6 +113,9 @@ public class ConfigHandler {
"gregtech", true, "Very basic automated cauldron for dust washing.");
enableMachine_Pollution = config.getBoolean("enableMachinePollution",
"gregtech", true, "Pollution Detector & Scrubbers.");
+ enableMachine_RF_Convetor = config.getBoolean("enableMachineRFConvetor", "gregtech",
+ true, "Converts RF to GTEU. Requires COFH-Core to be installed.");
+
// Multi machines
enableMultiblock_AlloyBlastSmelter = config.getBoolean("enableMultiblockAlloyBlastSmelter",
diff --git a/src/Java/gtPlusPlus/core/handler/BookHandler.java b/src/Java/gtPlusPlus/core/handler/BookHandler.java
index 860946f513..d9d3efe680 100644
--- a/src/Java/gtPlusPlus/core/handler/BookHandler.java
+++ b/src/Java/gtPlusPlus/core/handler/BookHandler.java
@@ -125,7 +125,7 @@ public class BookHandler {
"The Mode can be set by using a Screwdriver on the controller block. Each mode allows the use of Numbered Circuits, to allow a different machine 'type' for each input bus.",
"[Metal Work] Mode A - Allows the multiblock to function as a Compressor, a Lathe or an Electro-Magnet. To allow a hatch to run in Compressor mode, insert a No. 20 circuit. For Lathe, use No. 21 and for Electro-Magnet use No. 22.",
"[Fluid Work] Mode B - Allows the multiblock to function as a Fermenter, a Fluid Extractor or an Extractor. To allow a hatch to run in Fermenter mode, insert a No. 20 circuit. For Fluid Extractor, use No. 21 and for Extractor use No. 22.",
- "[Misc. Work] Mode C - Allows the multiblock to function as a Laser Engraver, a Replicator or an Autoclave. To allow a hatch to run in Laser Engraver mode, insert a No. 20 circuit. For Autoclave, use No. 21 and for Replicator use No. 22. REPLICATOR DISABLED.",
+ "[Misc. Work] Mode C - Allows the multiblock to function as a Laser Engraver, an Autoclave or a Fluid Solidifier. To allow a hatch to run in Laser Engraver mode, insert a No. 20 circuit. For Autoclave, use No. 21 and for Solidifier use No. 22.",
});
book_NuclearManual = writeBookTemplate(
diff --git a/src/Java/gtPlusPlus/core/handler/COMPAT_HANDLER.java b/src/Java/gtPlusPlus/core/handler/COMPAT_HANDLER.java
index be02e352c7..d7c971e71f 100644
--- a/src/Java/gtPlusPlus/core/handler/COMPAT_HANDLER.java
+++ b/src/Java/gtPlusPlus/core/handler/COMPAT_HANDLER.java
@@ -68,6 +68,7 @@ import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechIndustrialCuttingF
import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechIndustrialElectrolyzer;
import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechIndustrialExtruder;
import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechIndustrialFishPond;
+import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechIndustrialAlloySmelter;
import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechIndustrialFuelRefinery;
import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechIndustrialGeneratorArray;
import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechIndustrialMacerator;
@@ -216,6 +217,7 @@ public class COMPAT_HANDLER {
GregtechPowerBreakers.run();
GregtechFluidReactor.run();
GregtechAlgaeContent.run();
+ GregtechIndustrialAlloySmelter.run();
//New Horizons Content
NewHorizonsAccelerator.run();
diff --git a/src/Java/gtPlusPlus/core/item/ModItems.java b/src/Java/gtPlusPlus/core/item/ModItems.java
index 8bfcfe2d70..354107147b 100644
--- a/src/Java/gtPlusPlus/core/item/ModItems.java
+++ b/src/Java/gtPlusPlus/core/item/ModItems.java
@@ -4,7 +4,6 @@ import static gtPlusPlus.core.creative.AddToCreativeTab.tabMisc;
import static gtPlusPlus.core.lib.CORE.LOAD_ALL_CONTENT;
import cpw.mods.fml.common.registry.GameRegistry;
-import gregtech.api.enums.GT_Values;
import gregtech.api.enums.Materials;
import gregtech.api.util.GT_OreDictUnificator;
import gtPlusPlus.api.objects.Logger;
@@ -14,7 +13,6 @@ import gtPlusPlus.core.common.compat.COMPAT_Baubles;
import gtPlusPlus.core.creative.AddToCreativeTab;
import gtPlusPlus.core.item.base.BaseEuItem;
import gtPlusPlus.core.item.base.BaseItemBackpack;
-import gtPlusPlus.core.item.base.BaseItemBurnable;
import gtPlusPlus.core.item.base.BaseItemComponent.ComponentTypes;
import gtPlusPlus.core.item.base.BaseItemDamageable;
import gtPlusPlus.core.item.base.BaseItemTCShard;
@@ -55,7 +53,6 @@ import gtPlusPlus.core.item.general.ItemGenericToken;
import gtPlusPlus.core.item.general.ItemGiantEgg;
import gtPlusPlus.core.item.general.ItemHalfCompleteCasings;
import gtPlusPlus.core.item.general.ItemLavaFilter;
-import gtPlusPlus.core.item.general.RF2EU_Battery;
import gtPlusPlus.core.item.general.books.ItemBaseBook;
import gtPlusPlus.core.item.general.capture.ItemEntityCatcher;
import gtPlusPlus.core.item.general.chassis.ItemBoilerChassis;
@@ -97,6 +94,7 @@ import gtPlusPlus.core.util.minecraft.ItemUtils;
import gtPlusPlus.core.util.minecraft.MaterialUtils;
import gtPlusPlus.core.util.reflect.ReflectionUtils;
import gtPlusPlus.everglades.GTplusplus_Everglades;
+import gtPlusPlus.xmod.cofh.HANDLER_COFH;
import gtPlusPlus.xmod.eio.material.MaterialEIO;
import gtPlusPlus.xmod.gregtech.common.items.MetaGeneratedGregtechItems;
import net.minecraft.item.EnumRarity;
@@ -621,7 +619,7 @@ public final class ModItems {
MaterialGenerator.generate(ALLOY.MARAGING350);
MaterialGenerator.generate(ALLOY.AQUATIC_STEEL);
- MaterialGenerator.generate(ALLOY.NITINOL_60);
+ MaterialGenerator.generate(ALLOY.NITINOL_60,true,false);
//Composite Alloys
MaterialGenerator.generate(ALLOY.STELLITE);
@@ -1135,10 +1133,6 @@ public final class ModItems {
if (LoadedMods.IndustrialCraft2|| LOAD_ALL_CONTENT){
Logger.INFO("IndustrialCraft2 Found - Loading Resources.");
- if (LoadedMods.CoFHCore) {
- RfEuBattery = new RF2EU_Battery();
- }
-
//Baubles Mod Test
try {
final Class<?> baublesTest = ReflectionUtils.getClass("baubles.api.IBauble");
@@ -1167,7 +1161,7 @@ public final class ModItems {
//UtilsItems.generateSpawnEgg("ic2", "boatcarbon", Utils.generateSingularRandomHexValue(), Utils.generateSingularRandomHexValue());
-
+ HANDLER_COFH.initItems();
/*
* Misc Items
diff --git a/src/Java/gtPlusPlus/core/item/chemistry/CoalTar.java b/src/Java/gtPlusPlus/core/item/chemistry/CoalTar.java
index 8428328f37..981bfed479 100644
--- a/src/Java/gtPlusPlus/core/item/chemistry/CoalTar.java
+++ b/src/Java/gtPlusPlus/core/item/chemistry/CoalTar.java
@@ -272,6 +272,8 @@ public class CoalTar extends ItemPackage {
recipePhthalicAcidToPhthalicAnhydride();
recipeEthylBenzineFuelsIntoHeavyFuel();
+
+ recipePhthalicAcidConversion();
//Burn the coal gas!
GT_Values.RA.addFuel(ItemUtils.getItemStackOfAmountFromOreDict("cellCoalGas", 1), null, 96, 1);
@@ -282,6 +284,14 @@ public class CoalTar extends ItemPackage {
return true;
}
+ private void recipePhthalicAcidConversion() {
+ FluidStack aMyAcid = FluidUtils.getFluidStack(Phthalic_Acid, 500);
+ FluidStack aGtAcid = FluidUtils.getFluidStack("phtalicacid", 500);
+ if (aMyAcid != null && aGtAcid != null) {
+ CORE.RA.addDistilleryRecipe(CI.getNumberedBioCircuit(8), aMyAcid, aGtAcid, null, 50, 16, false);
+ }
+ }
+
@Override
public void items() {
//Phthalic_Acid = FluidUtils.generateFluidNonMolten("PhthalicAcid", "Phthalic Acid", 207, new short[]{210, 220, 210, 100}, null, null);
@@ -347,7 +357,7 @@ public class CoalTar extends ItemPackage {
Naphthalene = FluidUtils.generateFluidNonMolten("Naphthalene", "Naphthalene", 115, new short[]{210, 185, 135, 100}, null, null);
// v - Oxidize with mercury and nitric acid
//Create Phthalic Acid
- Phthalic_Acid = FluidUtils.generateFluidNonMolten("PhthalicAcid", "Phthalic Acid", 207, new short[]{210, 220, 210, 100}, null, null);
+ Phthalic_Acid = FluidUtils.generateFluidNonMolten("PhthalicAcid", "Phtalic Acid", 207, new short[]{210, 220, 210, 100}, null, null);
// v - Dehydrate at 180C+
//Create Phthalic Anhydride
//ItemUtils.generateSpecialUseDusts("PhthalicAnhydride", "Phthalic Anhydride", "C6H4(CO)2O", Utils.rgbtoHexValue(175, 175, 175));
diff --git a/src/Java/gtPlusPlus/core/item/chemistry/GenericChem.java b/src/Java/gtPlusPlus/core/item/chemistry/GenericChem.java
index 6e5b47041f..49d3303688 100644
--- a/src/Java/gtPlusPlus/core/item/chemistry/GenericChem.java
+++ b/src/Java/gtPlusPlus/core/item/chemistry/GenericChem.java
@@ -87,7 +87,7 @@ public class GenericChem extends ItemPackage {
// Phenol Byproducts
public Item PhenolicResins; //https://en.wikipedia.org/wiki/Phenol_formaldehyde_resin
- public ItemGenericChemBase mGenericChemItem1;
+ public static ItemGenericChemBase mGenericChemItem1;
@@ -112,6 +112,7 @@ public class GenericChem extends ItemPackage {
public static ItemStack mOrangeCatalyst;
public static ItemStack mPurpleCatalyst;
public static ItemStack mBrownCatalyst;
+ public static ItemStack mPinkCatalyst;
public void registerItemStacks() {
@@ -124,6 +125,7 @@ public class GenericChem extends ItemPackage {
mOrangeCatalyst = ItemUtils.simpleMetaStack(mGenericChemItem1, 3, 1);
mPurpleCatalyst = ItemUtils.simpleMetaStack(mGenericChemItem1, 4, 1);
mBrownCatalyst = ItemUtils.simpleMetaStack(mGenericChemItem1, 5, 1);
+ mPinkCatalyst = ItemUtils.simpleMetaStack(mGenericChemItem1, 6, 1);
}
@@ -135,6 +137,7 @@ public class GenericChem extends ItemPackage {
ItemUtils.addItemToOreDictionary(mOrangeCatalyst, "catalystVanadiumPalladium");
ItemUtils.addItemToOreDictionary(mPurpleCatalyst, "catalystIridiumRuthenium");
ItemUtils.addItemToOreDictionary(mBrownCatalyst, "catalystNickelAluminium");
+ ItemUtils.addItemToOreDictionary(mPinkCatalyst, "catalystPlatinumRhodium");
}
@@ -206,6 +209,7 @@ public class GenericChem extends ItemPackage {
recipeCatalystOrange();
recipeCatalystPurple();
recipeCatalystBrown();
+ recipeCatalystPink();
recipeNitroBenzene();
recipeAniline();
@@ -224,7 +228,7 @@ public class GenericChem extends ItemPackage {
private void recipeCyclohexane() {
- CORE.RA.addFluidReactorRecipe(
+ CORE.RA.addChemicalPlantRecipe(
new ItemStack[] {
getTierTwoChip(),
ItemUtils.getSimpleStack(mBrownCatalyst, 0)
@@ -247,7 +251,7 @@ public class GenericChem extends ItemPackage {
private void recipeCyclohexanone() {
- CORE.RA.addFluidReactorRecipe(
+ CORE.RA.addChemicalPlantRecipe(
new ItemStack[] {
getTierTwoChip(),
ItemUtils.getSimpleStack(mBlueCatalyst, 0)
@@ -266,7 +270,7 @@ public class GenericChem extends ItemPackage {
120,
2);
- CORE.RA.addFluidReactorRecipe(
+ CORE.RA.addChemicalPlantRecipe(
new ItemStack[] {
getTierTwoChip(),
},
@@ -293,7 +297,7 @@ public class GenericChem extends ItemPackage {
// Assembly Recipe
CORE.RA.addSixSlotAssemblingRecipe(new ItemStack[] {
getTierOneChip(),
- ItemUtils.getSimpleStack(AgriculturalChem.mCatalystCarrier, 10),
+ CI.getEmptyCatalyst(10),
ELEMENT.getInstance().IRON.getDust(2),
ELEMENT.getInstance().COPPER.getDust(2),
},
@@ -308,7 +312,7 @@ public class GenericChem extends ItemPackage {
// Assembly Recipe
CORE.RA.addSixSlotAssemblingRecipe(new ItemStack[] {
getTierThreeChip(),
- ItemUtils.getSimpleStack(AgriculturalChem.mCatalystCarrier, 10),
+ CI.getEmptyCatalyst(10),
ELEMENT.getInstance().TUNGSTEN.getDust(4),
ELEMENT.getInstance().NICKEL.getDust(4),
},
@@ -323,7 +327,7 @@ public class GenericChem extends ItemPackage {
// Assembly Recipe
CORE.RA.addSixSlotAssemblingRecipe(new ItemStack[] {
getTierTwoChip(),
- ItemUtils.getSimpleStack(AgriculturalChem.mCatalystCarrier, 10),
+ CI.getEmptyCatalyst(10),
ELEMENT.getInstance().COBALT.getDust(3),
ELEMENT.getInstance().TITANIUM.getDust(3),
},
@@ -338,7 +342,7 @@ public class GenericChem extends ItemPackage {
// Assembly Recipe
CORE.RA.addSixSlotAssemblingRecipe(new ItemStack[] {
getTierTwoChip(),
- ItemUtils.getSimpleStack(AgriculturalChem.mCatalystCarrier, 10),
+ CI.getEmptyCatalyst(10),
ELEMENT.getInstance().VANADIUM.getDust(5),
ELEMENT.getInstance().PALLADIUM.getDust(5),
},
@@ -353,7 +357,7 @@ public class GenericChem extends ItemPackage {
// Assembly Recipe
CORE.RA.addSixSlotAssemblingRecipe(new ItemStack[] {
getTierFourChip(),
- ItemUtils.getSimpleStack(AgriculturalChem.mCatalystCarrier, 10),
+ CI.getEmptyCatalyst(10),
ELEMENT.getInstance().IRIDIUM.getDust(6),
ELEMENT.getInstance().RUTHENIUM.getDust(6),
},
@@ -368,7 +372,7 @@ public class GenericChem extends ItemPackage {
// Assembly Recipe
CORE.RA.addSixSlotAssemblingRecipe(new ItemStack[] {
getTierOneChip(),
- ItemUtils.getSimpleStack(AgriculturalChem.mCatalystCarrier, 10),
+ CI.getEmptyCatalyst(10),
ELEMENT.getInstance().NICKEL.getDust(4),
ELEMENT.getInstance().ALUMINIUM.getDust(4),
},
@@ -379,10 +383,25 @@ public class GenericChem extends ItemPackage {
}
+ private void recipeCatalystPink() {
+ // Assembly Recipe
+ CORE.RA.addSixSlotAssemblingRecipe(new ItemStack[] {
+ getTierThreeChip(),
+ CI.getEmptyCatalyst(10),
+ ELEMENT.getInstance().PLATINUM.getDust(4),
+ ELEMENT.getInstance().RHODIUM.getDust(4),
+ },
+ GT_Values.NF,
+ ItemUtils.getSimpleStack(mPinkCatalyst, 10),
+ 30 * 20,
+ 2000);
+
+ }
+
private void recipeCadaverineAndPutrescine() {
// Basic Recipe
- CORE.RA.addFluidReactorRecipe(
+ CORE.RA.addChemicalPlantRecipe(
new ItemStack[] {
getTierOneChip(),
ItemUtils.getSimpleStack(Items.rotten_flesh, 64)
@@ -402,7 +421,7 @@ public class GenericChem extends ItemPackage {
1);
// Advanced Recipe
- CORE.RA.addFluidReactorRecipe(
+ CORE.RA.addChemicalPlantRecipe(
new ItemStack[] {
getTierTwoChip(),
ItemUtils.getSimpleStack(Items.rotten_flesh, 128),
@@ -426,7 +445,7 @@ public class GenericChem extends ItemPackage {
private void recipeAniline() {
- CORE.RA.addFluidReactorRecipe(
+ CORE.RA.addChemicalPlantRecipe(
new ItemStack[] {
getTierThreeChip(),
ItemUtils.getSimpleStack(mBlueCatalyst, 0)
@@ -449,7 +468,7 @@ public class GenericChem extends ItemPackage {
private void recipeNitroBenzene() {
- CORE.RA.addFluidReactorRecipe(
+ CORE.RA.addChemicalPlantRecipe(
new ItemStack[] {
getTierThreeChip(),
},
@@ -474,7 +493,7 @@ public class GenericChem extends ItemPackage {
private void recipe2Ethylanthraquinone() {
- CORE.RA.addFluidReactorRecipe(
+ CORE.RA.addChemicalPlantRecipe(
new ItemStack[] {
CI.getNumberedCircuit(4),
ItemUtils.getItemStackOfAmountFromOreDict("dustPhthalicAnhydride", 4),
@@ -504,7 +523,7 @@ public class GenericChem extends ItemPackage {
private void recipe2Ethylanthrahydroquinone() {
- CORE.RA.addFluidReactorRecipe(
+ CORE.RA.addChemicalPlantRecipe(
new ItemStack[] {
CI.getNumberedCircuit(4),
ItemUtils.getSimpleStack(mOrangeCatalyst, 0),
@@ -553,7 +572,7 @@ public class GenericChem extends ItemPackage {
private void recipeLithiumHydroperoxide() {
- CORE.RA.addFluidReactorRecipe(
+ CORE.RA.addChemicalPlantRecipe(
new ItemStack[] {
CI.getNumberedCircuit(4),
ItemUtils.getItemStackOfAmountFromOreDict("dustLithiumHydroxide", 7),
@@ -587,7 +606,7 @@ public class GenericChem extends ItemPackage {
private void recipeHydrogenPeroxide() {
- CORE.RA.addFluidReactorRecipe(
+ CORE.RA.addChemicalPlantRecipe(
new ItemStack[] {
CI.getNumberedCircuit(4),
},
diff --git a/src/Java/gtPlusPlus/core/item/chemistry/general/ItemGenericChemBase.java b/src/Java/gtPlusPlus/core/item/chemistry/general/ItemGenericChemBase.java
index 8a003ec7aa..208fecd57c 100644
--- a/src/Java/gtPlusPlus/core/item/chemistry/general/ItemGenericChemBase.java
+++ b/src/Java/gtPlusPlus/core/item/chemistry/general/ItemGenericChemBase.java
@@ -19,7 +19,7 @@ public class ItemGenericChemBase extends Item {
final protected IIcon base[];
- final private int aMetaSize = 6;
+ final private int aMetaSize = 7;
/*
* 0 - Red Metal Catalyst //FeCu
@@ -28,6 +28,7 @@ public class ItemGenericChemBase extends Item {
* 3 - Orange Metal Catalyst //Vanadium Pd
* 4 - Purple Metal Catalyst //IrIdium Ruthenium
* 5 - Brown Metal Catalyst //NiAl
+ * 6 - Pink Metal Catalyst //PtRh
*
*/
diff --git a/src/Java/gtPlusPlus/core/lib/CORE.java b/src/Java/gtPlusPlus/core/lib/CORE.java
index 2a267dc16d..34d7475df3 100644
--- a/src/Java/gtPlusPlus/core/lib/CORE.java
+++ b/src/Java/gtPlusPlus/core/lib/CORE.java
@@ -237,6 +237,7 @@ public class CORE {
public static boolean enableMachine_ComponentAssemblers = false;
public static boolean enableCustom_Pipes = true;
public static boolean enableCustom_Cables = true;
+ public static boolean enableMachine_RF_Convetor = false;
//Multiblocks
public static boolean enableMultiblock_AlloyBlastSmelter = true;
diff --git a/src/Java/gtPlusPlus/core/lib/LoadedMods.java b/src/Java/gtPlusPlus/core/lib/LoadedMods.java
index d96875b811..329cf634b6 100644
--- a/src/Java/gtPlusPlus/core/lib/LoadedMods.java
+++ b/src/Java/gtPlusPlus/core/lib/LoadedMods.java
@@ -2,6 +2,8 @@ package gtPlusPlus.core.lib;
import static gtPlusPlus.core.lib.CORE.*;
+import java.util.HashMap;
+
import cpw.mods.fml.common.Loader;
import gtPlusPlus.api.objects.Logger;
@@ -50,6 +52,7 @@ public class LoadedMods {
public static boolean Mekanism = false;
public static boolean RedTech = false; //RedMage's Mod
public static boolean TecTech = false; //Technus' Mod
+ public static boolean KekzTech = false; //KekzDealers' Mod
public static boolean TiCon = false;
public static boolean StevesCarts = false;
public static boolean Witchery = false;
@@ -63,7 +66,7 @@ public class LoadedMods {
@SuppressWarnings("deprecation")
public static void checkLoaded(){
Logger.INFO("Looking for optional mod prereqs.");
- if (Loader.isModLoaded("gregtech") ){
+ if (isModLoaded("gregtech") ){
Gregtech = true;
Logger.INFO("Components enabled for: Gregtech");
if (Gregtech){
@@ -80,140 +83,140 @@ public class LoadedMods {
totalMods++;
}
- if (Loader.isModLoaded("dreamcraft")){
+ if (isModLoaded("dreamcraft")){
DreamCraft = true;
GTNH = true;
Logger.INFO("Components enabled for: DreamCraft");
Logger.INFO("Components enabled for: GT: New Horizons");
totalMods++;
}
- if (Loader.isModLoaded("beyondrealitycore")){
+ if (isModLoaded("beyondrealitycore")){
BeyondRealityCore = true;
BRC = true;
Logger.INFO("Components enabled for: Beyond Reality");
totalMods++;
}
- if (Loader.isModLoaded("PlayerAPI")){
+ if (isModLoaded("PlayerAPI")){
PlayerAPI = true;
Logger.INFO("Components enabled for: PlayerAPI");
totalMods++;
}
- if (Loader.isModLoaded("berriespp")) {
+ if (isModLoaded("berriespp")) {
CropsPlusPlus = true;
Logger.INFO("Components enabled for: Crops++");
totalMods++;
}
- if (Loader.isModLoaded("xreliquary")) {
+ if (isModLoaded("xreliquary")) {
Reliquary = true;
Logger.INFO("Components enabled for: Reliquary");
totalMods++;
}
- if (Loader.isModLoaded("TConstruct")){
+ if (isModLoaded("TConstruct")){
TiCon = true;
Logger.INFO("Components enabled for: Tinkers Construct");
totalMods++;
}
- if (Loader.isModLoaded("BuildCraft")){
+ if (isModLoaded("BuildCraft")){
BuildCraft = true;
Logger.INFO("Components enabled for: BuildCraft");
totalMods++;
}
- if ((Loader.isModLoaded("EnderIO")) && !ConfigSwitches.disableEnderIOIntegration){
+ if ((isModLoaded("EnderIO")) && !ConfigSwitches.disableEnderIOIntegration){
EnderIO = true;
Logger.INFO("Components enabled for: EnderIO");
totalMods++;
}
- if (Loader.isModLoaded("BigReactors")){
+ if (isModLoaded("BigReactors")){
Big_Reactors = true;
Logger.INFO("Components enabled for: Big Reactors");
totalMods++;
}
- if (Loader.isModLoaded("IC2")){
+ if (isModLoaded("IC2")){
IndustrialCraft2 = true;
Logger.INFO("Components enabled for: IndustrialCraft2");
totalMods++;
}
- if (Loader.isModLoaded("IC2-Classic-Spmod")){
+ if (isModLoaded("IC2-Classic-Spmod")){
IndustrialCraft2Classic = true;
Logger.INFO("Components enabled for: IndustrialCraft2-Classic");
totalMods++;
}
- if (Loader.isModLoaded("simplyjetpacks")){
+ if (isModLoaded("simplyjetpacks")){
Simply_Jetpacks = true;
Logger.INFO("Components enabled for: Simply Jetpacks");
totalMods++;
}
- if (Loader.isModLoaded("rftools")){
+ if (isModLoaded("rftools")){
RFTools = true;
Logger.INFO("Components enabled for: RFTools");
totalMods++;
}
- if (Loader.isModLoaded("StevesCarts")){
+ if (isModLoaded("StevesCarts")){
StevesCarts = true;
Logger.INFO("Components enabled for: StevesCarts");
totalMods++;
}
- if (Loader.isModLoaded("OpenBlocks")){
+ if (isModLoaded("OpenBlocks")){
OpenBlocks = true;
Logger.INFO("Components enabled for: OpenBlocks");
totalMods++;
}
- if (Loader.isModLoaded("Thaumcraft")){
+ if (isModLoaded("Thaumcraft")){
Thaumcraft = true;
Logger.INFO("Components enabled for: Thaumcraft");
totalMods++;
}
- if (Loader.isModLoaded("BiomesOPlenty")){
+ if (isModLoaded("BiomesOPlenty")){
BiomesOPlenty = true;
Logger.INFO("Components enabled for: BiomesOPlenty");
totalMods++;
}
- if (Loader.isModLoaded("ExtraUtilities")){
+ if (isModLoaded("ExtraUtilities")){
Extra_Utils = true;
Logger.INFO("Components enabled for: Extra_Utils");
totalMods++;
}
- if (Loader.isModLoaded("harvestcraft")){
+ if (isModLoaded("harvestcraft")){
PamsHarvestcraft = true;
Logger.INFO("Components enabled for: PamsHarvestcraft");
totalMods++;
}
- if (Loader.isModLoaded("PneumaticCraft")){
+ if (isModLoaded("PneumaticCraft")){
PneumaticCraft = true;
Logger.INFO("Components enabled for: PneumaticCraft");
totalMods++;
}
- if (Loader.isModLoaded("MorePlanet")){
+ if (isModLoaded("MorePlanet")){
MorePlanets = true;
Logger.INFO("Components enabled for: MorePlanets");
totalMods++;
}
- if (Loader.isModLoaded("ForbiddenMagic")){
+ if (isModLoaded("ForbiddenMagic")){
ForbiddenMagic = true;
Logger.INFO("Components enabled for: ForbiddenMagic");
totalMods++;
}
- if (Loader.isModLoaded("CompactWindmills")){
+ if (isModLoaded("CompactWindmills")){
CompactWindmills = true;
Logger.INFO("Components enabled for: CompactWindmills");
totalMods++;
}
- if (Loader.isModLoaded("Railcraft")){
+ if (isModLoaded("Railcraft")){
Railcraft = true;
Logger.INFO("Components enabled for: Railcraft");
totalMods++;
}
- if (Loader.isModLoaded("Waila")){
+ if (isModLoaded("Waila")){
Waila = true;
Logger.INFO("Components enabled for: WAILA");
totalMods++;
}
- if (Loader.isModLoaded("Mekanism")){
+ if (isModLoaded("Mekanism")){
Mekanism = true;
Logger.INFO("Components enabled for: Mekanism - This feature is not configurable and balances Mekanism to suit GT.");
totalMods++;
}
- if (Loader.isModLoaded("Growthcraft")){
+ if (isModLoaded("Growthcraft")){
Logger.INFO("Growthcraft Version: "+getModVersion("Growthcraft"));
if (getModVersion("Growthcraft").equals("1.7.10-2.3.1")){
//Load Growthcraft Compat
@@ -226,67 +229,67 @@ public class LoadedMods {
Logger.INFO("Growthcraft found, but the version was too new. I will update GC support eventually.");
}
}
- if (Loader.isModLoaded("CoFHCore")){
+ if (isModLoaded("CoFHCore")){
CoFHCore = true;
Logger.INFO("Components enabled for: CoFHCore");
totalMods++;
}
- if (Loader.isModLoaded("Forestry")){
+ if (isModLoaded("Forestry")){
Forestry = true;
Logger.INFO("Components enabled for: Forestry");
totalMods++;
}
- if (Loader.isModLoaded("MagicBees")){
+ if (isModLoaded("MagicBees")){
MagicBees = true;
Logger.INFO("Components enabled for: MagicBees");
totalMods++;
}
- if (Loader.isModLoaded("psychedelicraft")){
+ if (isModLoaded("psychedelicraft")){
Psychedelicraft = true;
Logger.INFO("Components enabled for: Psychedelicraft");
totalMods++;
}
- if (Loader.isModLoaded("ImmersiveEngineering")){
+ if (isModLoaded("ImmersiveEngineering")){
ImmersiveEngineering = true;
Logger.INFO("Components enabled for: ImmersiveEngineering");
totalMods++;
}
- if (Loader.isModLoaded("ExtraBees")){
+ if (isModLoaded("ExtraBees")){
ExtraBees = true;
Logger.INFO("Components enabled for: ExtraBees");
totalMods++;
}
- if (Loader.isModLoaded("ThermalFoundation") == false){
+ if (isModLoaded("ThermalFoundation") == false){
ThermalFoundation = false;
Logger.INFO("Components enabled for: ThermalFoundation - This feature will disable itself if you add TF.");
totalMods++;
}
- else if (Loader.isModLoaded("ThermalFoundation")){
+ else if (isModLoaded("ThermalFoundation")){
ThermalFoundation = true;
Logger.INFO("Components disabled for: ThermalFoundation - This feature will enable itself if you remove TF.");
//totalMods++;
}
- if (Loader.isModLoaded("ihl")){
+ if (isModLoaded("ihl")){
IHL = true;
Logger.INFO("Components enabled for: IHL");
totalMods++;
}
- if (Loader.isModLoaded("Baubles")){
+ if (isModLoaded("Baubles")){
Baubles = true;
Logger.INFO("Components enabled for: Baubles");
totalMods++;
}
- if (Loader.isModLoaded("GalacticraftCore")){
+ if (isModLoaded("GalacticraftCore")){
GalacticraftCore = true;
Logger.INFO("Components enabled for: Galacticraft Core");
totalMods++;
}
- if (Loader.isModLoaded("OpenComputers")){
+ if (isModLoaded("OpenComputers")){
OpenComputers = true;
Logger.INFO("Components enabled for: OpenComputers");
totalMods++;
}
- if (Loader.isModLoaded("computronics")){
+ if (isModLoaded("computronics")){
Computronics = true;
Logger.INFO("Components disabled for: Computronics - This feature will enable itself if you remove Computronics.");
totalMods++;
@@ -294,17 +297,22 @@ public class LoadedMods {
else {
Logger.INFO("Components enabled for: Computronics - This feature will disable itself if you add Computronics.");
}
- if (Loader.isModLoaded("GTRedtech")){
+ if (isModLoaded("GTRedtech")){
RedTech = true;
Logger.INFO("Components enabled for: GTRedtech");
totalMods++;
}
- if (Loader.isModLoaded("tectech")){
+ if (isModLoaded("tectech")){
TecTech = true;
Logger.INFO("Components enabled for: TecTech");
totalMods++;
+ }
+ if (isModLoaded("kekztech")){
+ KekzTech = true;
+ Logger.INFO("Components enabled for: KekzTech");
+ totalMods++;
}
- if (Loader.isModLoaded("witchery")){
+ if (isModLoaded("witchery")){
Witchery = true;
Logger.INFO("Components enabled for: Witchery");
totalMods++;
@@ -318,5 +326,17 @@ public class LoadedMods {
final String ver = cpw.mods.fml.common.FMLCommonHandler.instance().findContainerFor(modName).getVersion();
return ver;
}
+
+ private static final HashMap<String, Boolean> mLoadedModCache = new HashMap<String, Boolean>();
+
+ public static boolean isModLoaded(String aModName) {
+ Boolean aResult = mLoadedModCache.get(aModName);
+ if (aResult == null) {
+ boolean aTemp = Loader.isModLoaded(aModName);
+ mLoadedModCache.put(aModName, aTemp);
+ aResult = aTemp;
+ }
+ return aResult;
+ }
}
diff --git a/src/Java/gtPlusPlus/core/material/ALLOY.java b/src/Java/gtPlusPlus/core/material/ALLOY.java
index 95e3631aaf..4e28b4a428 100644
--- a/src/Java/gtPlusPlus/core/material/ALLOY.java
+++ b/src/Java/gtPlusPlus/core/material/ALLOY.java
@@ -775,7 +775,7 @@ public final class ALLOY {
"Pikyonium 64B", //Material Name
MaterialState.SOLID, //State
new short[]{52, 103, 186, 0}, //Material Colour
- 7850, //Melting Point in C
+ 6850, //Melting Point in C
11765, //Boiling Point in C
-1,
-1,
diff --git a/src/Java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java b/src/Java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java
index cf2242067f..f1676689e7 100644
--- a/src/Java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java
+++ b/src/Java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java
@@ -17,6 +17,7 @@ import gregtech.api.util.ThermalFuel;
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.chemistry.GenericChem;
import gtPlusPlus.core.item.chemistry.IonParticles;
import gtPlusPlus.core.item.chemistry.RocketFuels;
@@ -39,6 +40,7 @@ import gtPlusPlus.core.util.minecraft.ItemUtils;
import gtPlusPlus.core.util.minecraft.MaterialUtils;
import gtPlusPlus.core.util.reflect.AddGregtechRecipe;
import gtPlusPlus.everglades.dimension.Dimension_Everglades;
+import gtPlusPlus.plugin.agrichem.BioRecipes;
import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
@@ -91,6 +93,7 @@ public class RECIPES_GREGTECH {
latheRecipes();
vacuumFreezerRecipes();
fluidheaterRecipes();
+ chemplantRecipes();
/**
@@ -107,6 +110,30 @@ public class RECIPES_GREGTECH {
addFuels();
}
+ private static void chemplantRecipes() {
+
+ // Advanced method for Nitric Acid Production
+ /* CORE.RA.addChemicalPlantRecipe(
+ new ItemStack[] {
+ CI.getNumberedBioCircuit(17),
+ CI.getPinkCatalyst(0),
+ },
+ new FluidStack[] {
+ FluidUtils.getLava(10000),
+ FluidUtils.getDistilledWater(5000)
+ },
+ new ItemStack[] {
+
+ },
+ new FluidStack[] {
+ FluidUtils.getFluidStack("nitricacid", 2000),
+ },
+ 10 * 20,
+ 480,
+ 3);*/
+
+ }
+
private static void fluidheaterRecipes() {
GT_Values.RA.addFluidHeaterRecipe(CI.getNumberedCircuit(20), FluidUtils.getWater(1000), FluidUtils.getHotWater(1000), 30, 30);
@@ -511,6 +538,30 @@ public class RECIPES_GREGTECH {
private static void laserEngraverRecipes() {
+ // Laser Sensors and Emitters together
+ GregtechItemList[] aTransParts = new GregtechItemList[] {
+ GregtechItemList.TransmissionComponent_ULV,
+ GregtechItemList.TransmissionComponent_LV,
+ GregtechItemList.TransmissionComponent_MV,
+ GregtechItemList.TransmissionComponent_HV,
+ GregtechItemList.TransmissionComponent_EV,
+ GregtechItemList.TransmissionComponent_IV,
+ GregtechItemList.TransmissionComponent_LuV,
+ GregtechItemList.TransmissionComponent_ZPM,
+ GregtechItemList.TransmissionComponent_UV,
+ GregtechItemList.TransmissionComponent_MAX,
+ };
+ for (int i=0;i<10;i++) {
+ GT_Values.RA.addLaserEngraverRecipe(
+ CI.getEmitter(i, 2),
+ CI.getSensor(i, 2),
+ aTransParts[i].get(1),
+ 20 * 5,
+ MaterialUtils.getVoltageForTier(i));
+ }
+
+
+
GT_Values.RA.addLaserEngraverRecipe(
GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Tungsten, 6L),
GregtechItemList.Laser_Lens_Special.get(0),
@@ -647,6 +698,18 @@ public class RECIPES_GREGTECH {
20 * 120,
30720);
+ //NITINOL_60
+ CORE.RA.addBlastSmelterRecipe(
+ new ItemStack[] {
+ ELEMENT.getInstance().TITANIUM.getDust(3),
+ ELEMENT.getInstance().NICKEL.getDust(2)
+ },
+ ALLOY.NITINOL_60.getFluid(5 * 144),
+ 0,
+ 20 * 75,
+ 7680);
+
+
@@ -835,13 +898,13 @@ public class RECIPES_GREGTECH {
//Gelid Cryotheum
CORE.RA.addFluidExtractionRecipe(ItemUtils.getItemStackOfAmountFromOreDict("dustCryotheum", 1), FluidUtils.getFluidStack("cryotheum", 250), 200, 240);
-
+
//Ender Fluid
CORE.RA.addFluidExtractionRecipe(ItemUtils.getSimpleStack(Items.ender_pearl), FluidUtils.getFluidStack("ender", 250), 100, 30);
-
+
//Blazing Pyrotheum
CORE.RA.addFluidExtractionRecipe(ItemUtils.getItemStackOfAmountFromOreDict("dustPyrotheum", 1), FluidUtils.getFluidStack("pyrotheum", 250), 200, 240);
-
+
}
@@ -1556,10 +1619,10 @@ public class RECIPES_GREGTECH {
GT_Values.RA.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Invar, 8L), GT_OreDictUnificator.get(OrePrefixes.ring, Materials.Invar, 4L), GregtechItemList.Fluid_Cell_144L.get(1L, new Object[0]), 75, 32);
}
}
-
+
if (LoadedMods.Baubles) {
-
+
// Turbine Housing Research Page
@@ -1588,8 +1651,8 @@ public class RECIPES_GREGTECH {
ItemDummyResearch.getResearchStack(ASSEMBLY_LINE_RESEARCH.RESEARCH_9_CLOAKING, 1),
20 * 60 * 10,
(int) GT_Values.V[7]);
-
-
+
+
// Supreme Pizza Gloves
CORE.RA.addSixSlotAssemblingRecipe(new ItemStack[] {
ItemUtils.getGregtechCircuit(19),
@@ -1752,27 +1815,7 @@ public class RECIPES_GREGTECH {
}
- private static void centrifugeRecipes() {
-
- //Try use all woods found, fix/add methane extraction.
- ArrayList<ItemStack> aLogData = OreDictionary.getOres("logWood");
- ArrayList<ItemStack> aRubberLogs = OreDictionary.getOres("logRubber");
- if (!aLogData.isEmpty() && !aRubberLogs.isEmpty()) {
- Logger.INFO("Fixing Methane output of centrifuged logs.");
- //First Check to see if it's a rubber log
- for (ItemStack stack : aLogData) {
- if (aRubberLogs.contains(stack)) {
- if (GT_Values.RA.addCentrifugeRecipe(GT_Utility.copyAmount(1L, stack), null, null, Materials.Methane.getGas(60L), ItemList.IC2_Resin.get(1L, new Object[0]), GT_ModHandler.getIC2Item("plantBall", 1L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Carbon, 1L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Wood, 1L), null, null, new int[] { 5000, 3750, 2500, 2500 }, 200, 20)) {
- Logger.INFO("Added rubber plant based methane extraction for "+ItemUtils.getItemName(stack));
- }
- }
- else {
- if (GT_Values.RA.addCentrifugeRecipe(GT_Utility.copyAmount(1L, stack), null, null, Materials.Methane.getGas(60L), GT_Values.NI, GT_Values.NI, GT_Values.NI, GT_Values.NI, GT_Values.NI, GT_Values.NI, null, 200, 20)) {
- Logger.INFO("Added methane extraction for "+ItemUtils.getItemName(stack));
- }
- }
- }
- }
+ private static void centrifugeRecipes() {
GT_Values.RA.addCentrifugeRecipe(ItemUtils.getItemStackOfAmountFromOreDict("dustThorium", 8), GT_Values.NI,
GT_Values.NF, GT_Values.NF, ELEMENT.getInstance().THORIUM232.getDust(2),
diff --git a/src/Java/gtPlusPlus/core/recipe/RECIPES_Machines.java b/src/Java/gtPlusPlus/core/recipe/RECIPES_Machines.java
index 8225a40c29..2165f27ec7 100644
--- a/src/Java/gtPlusPlus/core/recipe/RECIPES_Machines.java
+++ b/src/Java/gtPlusPlus/core/recipe/RECIPES_Machines.java
@@ -22,6 +22,7 @@ import gtPlusPlus.core.util.minecraft.gregtech.PollutionUtils;
import gtPlusPlus.core.util.reflect.ReflectionUtils;
import gtPlusPlus.everglades.dimension.Dimension_Everglades;
import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList;
+import gtPlusPlus.xmod.gregtech.common.Meta_GT_Proxy;
import gtPlusPlus.xmod.gregtech.common.covers.CoverManager;
import gtPlusPlus.xmod.gregtech.common.items.MetaCustomCoverItem;
import net.minecraft.block.Block;
@@ -252,7 +253,7 @@ public class RECIPES_Machines {
CI.getTieredComponentOfMaterial(Materials.Steel, OrePrefixes.gearGt, 6),
CI.getTieredComponentOfMaterial(Materials.Aluminium, OrePrefixes.plate, 32),
CI.getTieredComponentOfMaterial(Materials.CobaltBrass, OrePrefixes.dust, 16),
- ALLOY.STAINLESS_STEEL.getFrameBox(4),
+ CI.getTieredComponent(OrePrefixes.frameGt, 2, 4),
},
ALLOY.STEEL.getFluid(2 * (144 * 4)),
GregtechItemList.ChemicalPlant_Controller.get(1),
@@ -292,7 +293,7 @@ public class RECIPES_Machines {
private static void distillus() {
- CORE.RA.addFluidReactorRecipe(
+ CORE.RA.addChemicalPlantRecipe(
new ItemStack[] {
CI.getNumberedBioCircuit(19),
ItemList.Distillation_Tower.get(2),
@@ -337,7 +338,7 @@ public class RECIPES_Machines {
CI.getElectricPiston(i, 10),
CI.getFieldGenerator(i + 1, 6),
CI.getPlate(i, 16),
- CI.getEmitter(i - 1, 24),
+ CI.getTransmissionComponent(i - 1, 8),
CI.getTieredComponent(OrePrefixes.cableGt08, i, 16)
},
ALLOY.EGLIN_STEEL.getFluid(i * (144 * 4)),
@@ -393,14 +394,14 @@ public class RECIPES_Machines {
for (int i=0;i<10;i++) {
CORE.RA.addSixSlotAssemblingRecipe(
new ItemStack[] {
- CI.getNumberedBioCircuit(22),
+ CI.getNumberedBioCircuit(20),
CI.getTieredMachineCasing(i),
CI.getPlate(i, 8),
CI.getGear(i, 2),
CI.getTieredComponent(OrePrefixes.cableGt02, i, 4),
CI.getTieredComponent(OrePrefixes.circuit, i, 2)
},
- CI.getTieredFluid(i, 144 * i * 2),
+ CI.getAlternativeTieredFluid(i, 144 * i * 2),
aHulls[i].get(1),
20 * 20,
MaterialUtils.getVoltageForTier(i));
@@ -540,13 +541,15 @@ public class RECIPES_Machines {
20 * 30,
30);
+ ItemStack aFluidRegulator1 = ItemUtils.getItemListObject("FluidRegulator_MV", "Pump_HV", GTNH ? 4 : 2);
+ ItemStack aFluidRegulator2 = ItemUtils.getItemListObject("FluidRegulator_IV", "Pump_LuV", GTNH ? 4 : 2);
+
//Poo Collector
CORE.RA.addSixSlotAssemblingRecipe(
new ItemStack[] {
CI.machineHull_MV,
- CI.getTieredComponent(OrePrefixes.circuit, 2, GTNH ? 4 : 2),
+ aFluidRegulator1,
CI.getTieredComponent(OrePrefixes.pipeMedium, 2, GTNH ? 4 : 2),
- CI.getElectricPump(2, GTNH ? 4 : 2),
ALLOY.EGLIN_STEEL.getPlate(GTNH ? 8 : 4),
ALLOY.POTIN.getScrew(GTNH ? 12 : 6)
},
@@ -560,9 +563,8 @@ public class RECIPES_Machines {
new ItemStack[] {
CI.getTieredMachineHull(-1),
ItemUtils.getSimpleStack(ModBlocks.blockPooCollector),
- CI.getTieredComponent(OrePrefixes.circuit, 5, GTNH ? 8 : 4),
+ aFluidRegulator2,
CI.getTieredComponent(OrePrefixes.pipeHuge, 6, GTNH ? 8 : 4),
- CI.getElectricPump(5, GTNH ? 12 : 6),
CI.getTieredComponent(OrePrefixes.screw, 6, GTNH ? 32 : 16)
},
CI.getAlternativeTieredFluid(5, 144 * 9),
@@ -603,6 +605,16 @@ public class RECIPES_Machines {
plateEnergeticAlloy, pipeLargeCopper, plateEnergeticAlloy,
RECIPE_SteamCondenser);
}
+
+
+ //Steam Condenser
+ if (LoadedMods.CoFHCore && CORE.ConfigSwitches.enableMachine_RF_Convetor){
+ RecipeUtils.addShapedGregtechRecipe(
+ CI.getPlate(4, 1), CI.getTieredCircuitOreDictName(5), CI.getPlate(4, 1),
+ CI.getTransmissionComponent(3, 1), CI.getTieredGTPPMachineCasing(4, 1), CI.getTransmissionComponent(3, 1),
+ CI.getPlate(4, 1), plateEnergeticAlloy, CI.getPlate(4, 1),
+ GregtechItemList.Energy_Buffer_RF_Convertor.get(1));
+ }
if (CORE.ConfigSwitches.enableMultiblock_IronBlastFurnace){
@@ -886,6 +898,7 @@ public class RECIPES_Machines {
"plateDoubleGrisium", "rotorGrisium", "plateDoubleGrisium",
RECIPE_IndustrialMultiTankController);
}
+ //TODO
//Semi-Fluid Generators
ItemStack mSemiFluidgen = ItemUtils.getItemStackFromFQRN("IC2:blockGenerator:7", 1);
@@ -1485,8 +1498,7 @@ public class RECIPES_Machines {
GregtechItemList.Casing_Refinery_Structural.get(4),
ItemUtils.getSimpleStack(ModItems.itemCircuitLFTR, GTNH ? 2 : 1),
CI.getTieredComponent(OrePrefixes.cableGt08, GTNH ? 7 : 6, GTNH ? 32 : 16),
- CI.getEmitter(GTNH ? 6 : 5, 2),
- CI.getSensor(GTNH ? 6 : 5, 2),
+ CI.getTransmissionComponent(GTNH ? 6 : 5, 2),
GregtechItemList.Gregtech_Computer_Cube.get(1),
},
CI.getTieredFluid(7, 144 * (GTNH ? 32 : 8)), GregtechItemList.GT4_Multi_Crafter.get(1),
@@ -2175,8 +2187,7 @@ public class RECIPES_Machines {
int aTier = (i + 1);
ItemStack[] aInputs = new ItemStack[] {
CI.getTieredMachineHull(i, 1 * aCostMultiplier),
- CI.getEmitter(i, 2 * aCostMultiplier),
- CI.getSensor(i, 2 * aCostMultiplier),
+ CI.getTransmissionComponent(i, 2 * aCostMultiplier),
CI.getFieldGenerator(i, 1 * aCostMultiplier),
CI.getTieredComponent(OrePrefixes.plate, aTier, 4 * aCostMultiplier),
CI.getTieredComponent(OrePrefixes.circuit, aTier, 2 * aCostMultiplier),
@@ -2196,9 +2207,8 @@ public class RECIPES_Machines {
CORE.RA.addSixSlotAssemblingRecipe(
new ItemStack[] {
CI.getTieredMachineHull(-1, 1 * aCostMultiplier),
- CI.getEmitter(2, 2 * aCostMultiplier),
+ CI.getTransmissionComponent(2, 2 * aCostMultiplier),
CI.getElectricPiston(4, 2 * aCostMultiplier),
- CI.getSensor(4, 1 * aCostMultiplier),
CI.getTieredComponent(OrePrefixes.plate, 5, 4 * aCostMultiplier),
CI.getTieredComponent(OrePrefixes.pipeSmall, 4, 1 * aCostMultiplier),
},
diff --git a/src/Java/gtPlusPlus/core/recipe/common/CI.java b/src/Java/gtPlusPlus/core/recipe/common/CI.java
index 6b8f992266..1d3d386da3 100644
--- a/src/Java/gtPlusPlus/core/recipe/common/CI.java
+++ b/src/Java/gtPlusPlus/core/recipe/common/CI.java
@@ -7,6 +7,7 @@ import gregtech.api.util.GT_ModHandler;
import gregtech.api.util.GT_Utility;
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.item.chemistry.AgriculturalChem;
+import gtPlusPlus.core.item.chemistry.GenericChem;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.lib.LoadedMods;
import gtPlusPlus.core.material.ALLOY;
@@ -564,7 +565,7 @@ public class CI {
private static final Material[] aMaterial_Secondary = new Material[] {
ALLOY.STEEL,
ALLOY.SILICON_CARBIDE,
- ALLOY.TUNGSTEN_CARBIDE,
+ ALLOY.BABBIT_ALLOY,
ALLOY.INCONEL_690,
ALLOY.STELLITE,
ALLOY.ARCANITE,
@@ -579,7 +580,7 @@ public class CI {
private static final Material[] aMaterial_Tertiary = new Material[] {
ELEMENT.getInstance().LEAD,
ELEMENT.getInstance().ALUMINIUM,
- ALLOY.STAINLESS_STEEL,
+ ELEMENT.STANDALONE.BLACK_METAL,
ELEMENT.getInstance().TUNGSTEN,
ALLOY.HASTELLOY_N,
ALLOY.ENERGYCRYSTAL,
@@ -1264,4 +1265,96 @@ public class CI {
return ItemUtils.getOrePrefixStack(aPrefix, aMaterial, aAmount);
}
+ public static ItemStack getTransmissionComponent(int aTier, int aAmount) {
+ GregtechItemList[] aTransParts = new GregtechItemList[] {
+ GregtechItemList.TransmissionComponent_ULV,
+ GregtechItemList.TransmissionComponent_LV,
+ GregtechItemList.TransmissionComponent_MV,
+ GregtechItemList.TransmissionComponent_HV,
+ GregtechItemList.TransmissionComponent_EV,
+ GregtechItemList.TransmissionComponent_IV,
+ GregtechItemList.TransmissionComponent_LuV,
+ GregtechItemList.TransmissionComponent_ZPM,
+ GregtechItemList.TransmissionComponent_UV,
+ GregtechItemList.TransmissionComponent_MAX,
+ };
+ return aTransParts[aTier].get(aAmount);
+ }
+
+ public static ItemStack getEmptyCatalyst(int aAmount) {
+ return ItemUtils.simpleMetaStack(AgriculturalChem.mAgrichemItem1, 13, aAmount);
+ }
+
+ /**
+ * Aluminium + Silver Catalyst
+ * @param aAmount - Stacksize
+ * @return - A Catalyst stack of given size
+ */
+ public static ItemStack getGreenCatalyst(int aAmount) {
+ return ItemUtils.simpleMetaStack(AgriculturalChem.mAgrichemItem1, 14, aAmount);
+ }
+
+ /**
+ * Iron + Copper Catalyst
+ * @param aAmount - Stacksize
+ * @return - A Catalyst stack of given size
+ */
+ public static ItemStack getRedCatalyst(int aAmount) {
+ return ItemUtils.simpleMetaStack(GenericChem.mGenericChemItem1, 0, aAmount);
+ }
+
+ /**
+ * Tungsten + Nickel Catalyst
+ * @param aAmount - Stacksize
+ * @return - A Catalyst stack of given size
+ */
+ public static ItemStack getYellowCatalyst(int aAmount) {
+ return ItemUtils.simpleMetaStack(GenericChem.mGenericChemItem1, 1, aAmount);
+ }
+
+ /**
+ * Cobalt + Titanium Catalyst
+ * @param aAmount - Stacksize
+ * @return - A Catalyst stack of given size
+ */
+ public static ItemStack getBlueCatalyst(int aAmount) {
+ return ItemUtils.simpleMetaStack(GenericChem.mGenericChemItem1, 2, aAmount);
+ }
+
+ /**
+ * Vanadium + Palladium Catalyst
+ * @param aAmount - Stacksize
+ * @return - A Catalyst stack of given size
+ */
+ public static ItemStack getOrangeCatalyst(int aAmount) {
+ return ItemUtils.simpleMetaStack(GenericChem.mGenericChemItem1, 3, aAmount);
+ }
+
+ /**
+ * Iridium + Ruthenium Catalyst
+ * @param aAmount - Stacksize
+ * @return - A Catalyst stack of given size
+ */
+ public static ItemStack getPurpleCatalyst(int aAmount) {
+ return ItemUtils.simpleMetaStack(GenericChem.mGenericChemItem1, 4, aAmount);
+ }
+
+ /**
+ * Aluminium + Nickel Catalyst
+ * @param aAmount - Stacksize
+ * @return - A Catalyst stack of given size
+ */
+ public static ItemStack getBrownCatalyst(int aAmount) {
+ return ItemUtils.simpleMetaStack(GenericChem.mGenericChemItem1, 5, aAmount);
+ }
+
+ /**
+ * Platinum + Rhodium Catalyst
+ * @param aAmount - Stacksize
+ * @return - A Catalyst stack of given size
+ */
+ public static ItemStack getPinkCatalyst(int aAmount) {
+ return ItemUtils.simpleMetaStack(GenericChem.mGenericChemItem1, 6, aAmount);
+ }
+
}
diff --git a/src/Java/gtPlusPlus/core/slots/SlotChemicalPlantInput.java b/src/Java/gtPlusPlus/core/slots/SlotChemicalPlantInput.java
index 6cd13dc209..add55b8d27 100644
--- a/src/Java/gtPlusPlus/core/slots/SlotChemicalPlantInput.java
+++ b/src/Java/gtPlusPlus/core/slots/SlotChemicalPlantInput.java
@@ -20,9 +20,9 @@ public class SlotChemicalPlantInput extends Slot {
}
public static boolean isItemValidForChemicalPlantSlot(ItemStack aStack) {
- boolean validItem = Gregtech_Recipe_Map.sFluidChemicalReactorRecipes.containsInput(aStack);
+ boolean validItem = Gregtech_Recipe_Map.sChemicalPlantRecipes.containsInput(aStack);
if (!validItem) {
- for (Recipe_GT f : Gregtech_Recipe_Map.sFluidChemicalReactorRecipes.mRecipeList) {
+ for (Recipe_GT f : Gregtech_Recipe_Map.sChemicalPlantRecipes.mRecipeList) {
if (f.mFluidInputs.length > 0) {
for (FluidStack g : f.mFluidInputs) {
if (g != null) {
diff --git a/src/Java/gtPlusPlus/core/util/data/ArrayUtils.java b/src/Java/gtPlusPlus/core/util/data/ArrayUtils.java
index 3e96220995..6f5bb5b453 100644
--- a/src/Java/gtPlusPlus/core/util/data/ArrayUtils.java
+++ b/src/Java/gtPlusPlus/core/util/data/ArrayUtils.java
@@ -10,6 +10,7 @@ import java.util.Set;
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.api.objects.data.AutoMap;
import net.minecraft.item.ItemStack;
+import net.minecraftforge.fluids.FluidStack;
public class ArrayUtils {
@@ -88,5 +89,14 @@ public class ArrayUtils {
return org.apache.commons.lang3.ArrayUtils.toString(aArray);
}
+ public static <T> Object[] getArrayFromArrayList(ArrayList<T> aArrayList) {
+ Object[] aGenericArray = new Object[aArrayList.size()];
+ int aIndex = 0;
+ for (T object : aArrayList) {
+ aGenericArray[aIndex++] = object;
+ }
+ return aGenericArray;
+ }
+
}
diff --git a/src/Java/gtPlusPlus/core/util/minecraft/HazmatUtils.java b/src/Java/gtPlusPlus/core/util/minecraft/HazmatUtils.java
index d69dd5d66e..be57853dda 100644
--- a/src/Java/gtPlusPlus/core/util/minecraft/HazmatUtils.java
+++ b/src/Java/gtPlusPlus/core/util/minecraft/HazmatUtils.java
@@ -18,6 +18,7 @@ import gtPlusPlus.GTplusplus;
import gtPlusPlus.GTplusplus.INIT_PHASE;
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.api.objects.data.AutoMap;
+import gtPlusPlus.core.lib.LoadedMods;
import gtPlusPlus.core.util.Utils;
import ic2.core.item.armor.ItemArmorHazmat;
import ic2.core.item.armor.ItemArmorNanoSuit;
@@ -35,6 +36,38 @@ public class HazmatUtils {
private static boolean mInit = false;
private static HazmatUtils mInstance;
+
+ private static final String[] mDefaultHazmat = new String[] {
+ "IC2:itemArmorNanoHelmet:27",
+ "IC2:itemArmorNanoChestplate:27",
+ "IC2:itemArmorNanoLegs:27",
+ "IC2:itemArmorNanoBoots:27",
+
+ "IC2:itemArmorQuantumHelmet:27",
+ "IC2:itemArmorQuantumChestplate:27",
+ "IC2:itemArmorQuantumLegs:27",
+ "IC2:itemArmorQuantumBoots:27",
+ };
+
+
+ private static final String[] mGravisuit = new String[] {
+ "GraviSuite:advNanoChestPlate:27",
+ "GraviSuite:graviChestPlate:27",
+ };
+ private static final String[] mElectroMagicTools = new String[] {
+ "EMT:NanosuitGogglesRevealing:27",
+ "EMT:NanoBootsTraveller:27",
+ "EMT:NanosuitWing:27",
+ "EMT:itemArmorQuantumChestplate:27",
+ "EMT:QuantumGogglesRevealing:27",
+ "EMT:QuantumBootsTraveller:27",
+ "EMT:QuantumWing:27",
+ };
+ private static final String[] mAdvancedSolarPanels = new String[] {
+ "AdvancedSolarPanel:advanced_solar_helmet:27",
+ "AdvancedSolarPanel:hybrid_solar_helmet:27",
+ "AdvancedSolarPanel:ultimate_solar_helmet:27",
+ };
public static void init() {
if (mInit) {
@@ -49,19 +82,36 @@ public class HazmatUtils {
sHazmatList.add(GT_ModHandler.getIC2Item("hazmatBoots", 1L, 32767));
// Make Nano a hazmat suit
- addProtection(ItemUtils.getItemStackFromFQRN("IC2:itemArmorNanoHelmet:27", 1));
- addProtection(ItemUtils.getItemStackFromFQRN("IC2:itemArmorNanoChestplate:27", 1));
- addProtection(ItemUtils.getItemStackFromFQRN("IC2:itemArmorNanoLegs:27", 1));
- addProtection(ItemUtils.getItemStackFromFQRN("IC2:itemArmorNanoBoots:27", 1));
-
- Logger.INFO("[Hazmat] Registered Nano as hazmat gear.");
-
- // Make Quantum a hazmat suit
- addProtection(ItemUtils.getItemStackFromFQRN("IC2:itemArmorQuantumHelmet:27", 1));
- addProtection(ItemUtils.getItemStackFromFQRN("IC2:itemArmorQuantumChestplate:27", 1));
- addProtection(ItemUtils.getItemStackFromFQRN("IC2:itemArmorQuantumLegs:27", 1));
- addProtection(ItemUtils.getItemStackFromFQRN("IC2:itemArmorQuantumBoots:27", 1));
- Logger.INFO("[Hazmat] Registered Quantum as hazmat gear.");
+ // Make Quantum a hazmat suit
+
+
+ if (LoadedMods.IndustrialCraft2 || LoadedMods.IndustrialCraft2Classic) {
+ for (String aItemName : mDefaultHazmat) {
+ addProtection(ItemUtils.getItemStackFromFQRN(aItemName, 1));
+ }
+ Logger.INFO("[Hazmat] Registered IC2 Items as hazmat gear.");
+ }
+
+ if (LoadedMods.isModLoaded("EMT")) {
+ for (String aItemName : mElectroMagicTools) {
+ addProtection(ItemUtils.getItemStackFromFQRN(aItemName, 1));
+ }
+ Logger.INFO("[Hazmat] Registered EMT Items as hazmat gear.");
+ }
+
+ if (LoadedMods.isModLoaded("GraviSuite")) {
+ for (String aItemName : mGravisuit) {
+ addProtection(ItemUtils.getItemStackFromFQRN(aItemName, 1));
+ }
+ Logger.INFO("[Hazmat] Registered Gravisuit Items as hazmat gear.");
+ }
+
+ if (LoadedMods.isModLoaded("AdvancedSolarPanel")) {
+ for (String aItemName : mAdvancedSolarPanels) {
+ addProtection(ItemUtils.getItemStackFromFQRN(aItemName, 1));
+ }
+ Logger.INFO("[Hazmat] Registered Adv. Solar Items as hazmat gear.");
+ }
Utils.registerEvent(mInstance);
Logger.INFO("[Hazmat] Registered Tooltip handler for hazmat gear.");
diff --git a/src/Java/gtPlusPlus/core/util/minecraft/ItemUtils.java b/src/Java/gtPlusPlus/core/util/minecraft/ItemUtils.java
index cb490203df..d7d611a1e4 100644
--- a/src/Java/gtPlusPlus/core/util/minecraft/ItemUtils.java
+++ b/src/Java/gtPlusPlus/core/util/minecraft/ItemUtils.java
@@ -25,11 +25,14 @@ import gtPlusPlus.core.item.base.dusts.BaseItemDustUnique;
import gtPlusPlus.core.item.base.dusts.decimal.BaseItemCentidust;
import gtPlusPlus.core.item.base.dusts.decimal.BaseItemDecidust;
import gtPlusPlus.core.item.base.plates.BaseItemPlate_OLD;
+import gtPlusPlus.core.item.chemistry.AgriculturalChem;
+import gtPlusPlus.core.item.chemistry.GenericChem;
import gtPlusPlus.core.item.tool.staballoy.MultiPickaxeBase;
import gtPlusPlus.core.item.tool.staballoy.MultiSpadeBase;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.lib.LoadedMods;
import gtPlusPlus.core.material.Material;
+import gtPlusPlus.core.recipe.common.CI;
import gtPlusPlus.core.util.Utils;
import gtPlusPlus.core.util.math.MathUtils;
import gtPlusPlus.core.util.reflect.ReflectionUtils;
@@ -39,6 +42,7 @@ import gtPlusPlus.xmod.gregtech.loaders.RecipeGen_DustGeneration;
import net.minecraft.block.Block;
import net.minecraft.enchantment.Enchantment;
import net.minecraft.enchantment.EnchantmentData;
+import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.Item;
@@ -100,6 +104,11 @@ public class ItemUtils {
return y;
}
+ public static ItemStack getWildcardStack(final ItemStack x) {
+ final ItemStack y = ItemUtils.simpleMetaStack(x, WILDCARD_VALUE, 1);
+ return y;
+ }
+
public static ItemStack getIC2Cell(final String S) {
final ItemStack moreTemp = ItemUtils.getItemStackOfAmountFromOreDictNoBroken("cell" + S, 1);
@@ -154,13 +163,20 @@ public class ItemUtils {
}
}
- public static void addItemToOreDictionary(final ItemStack stack, final String oreDictName) {
+ public static void addItemToOreDictionary(ItemStack stack, final String oreDictName, boolean useWildcardMeta) {
+ if (useWildcardMeta) {
+ stack = ItemUtils.getWildcardStack(stack);
+ }
try {
- GT_OreDictUnificator.registerOre(oreDictName, stack);
+ OreDictionary.registerOre(oreDictName, stack);
} catch (final NullPointerException e) {
- Logger.ERROR(stack.getDisplayName() + " not registered. [NULL]");
+ Logger.ERROR(ItemUtils.getItemName(stack) + " not registered. [NULL]");
}
}
+
+ public static void addItemToOreDictionary(final ItemStack stack, final String oreDictName) {
+ addItemToOreDictionary(stack, oreDictName, false);
+ }
public static ItemStack getItemStackWithMeta(final boolean MOD, final String FQRN, final String itemName,
final int meta, final int itemstackSize) {
@@ -896,46 +912,10 @@ public class ItemUtils {
return CORE.burnables.add(new Pair<Integer, ItemStack>(burn, aBurnable));
}
- /**
- * Quick Block Name Lookup that is friendly to servers and locale.
- */
- private static volatile Map<String, String> mLocaleCache = new HashMap<String, String>();
-
public static String getLocalizedNameOfBlock(BlockPos pos) {
Block block = pos.world.getBlock(pos.xPos, pos.yPos, pos.zPos);
int metaData = pos.world.getBlockMetadata(pos.xPos, pos.yPos, pos.zPos);
- return getLocalizedNameOfBlock(block, metaData);
- }
-
- public synchronized static String getLocalizedNameOfBlock(Block block, int meta) {
- if (block == null || meta < 0) {
- return "Bad Block";
- }
- String mCacheKey = block.getUnlocalizedName() + ":" + meta;
- if (mLocaleCache.containsKey(mCacheKey)) {
- // Recache the key if it's invalid.
- if (mLocaleCache.get(mCacheKey).toLowerCase().contains(".name")) {
- mLocaleCache.remove(mCacheKey);
- String mNew = ItemUtils.simpleMetaStack(block, meta, 1).getDisplayName();
- //Logger.INFO("Re-caching "+mNew+" into locale cache.");
- mLocaleCache.put(mCacheKey, mNew);
- }
- //Logger.INFO("Returning Cached Value.");
- return mLocaleCache.get(mCacheKey);
- } else {
- Item item = Item.getItemFromBlock(block);
- if (item == null) {
- return "Bad Item";
- }
- String unlocalizedName = item.getUnlocalizedName(new ItemStack(block, 1, meta));
- String blockName = StatCollector.translateToLocal(unlocalizedName + ".name");
- if (blockName.toLowerCase().contains(".name")) {
- blockName = ItemUtils.simpleMetaStack(block, meta, 1).getDisplayName();
- }
- mLocaleCache.put(mCacheKey, blockName);
- //Logger.INFO("Cached New Value.");
- return blockName;
- }
+ return LangUtils.getLocalizedNameOfBlock(block, metaData);
}
public static boolean checkForInvalidItems(ItemStack mInput) {
@@ -1255,5 +1235,83 @@ public class ItemUtils {
}
return getNullStack();
}
+
+ public static ItemStack getItemListObject(String aObjectFromExperimentalName, String aReplacementName, int aAmount) {
+ ItemList aItemListObject = getItemListObject(aObjectFromExperimentalName, aReplacementName);
+ if (aItemListObject == ItemList.NULL || aItemListObject == null) {
+ return null;
+ }
+ else {
+ return aItemListObject.get(aAmount);
+ }
+ }
+
+ public static ItemStack getItemListObject(ItemList aItemListObject, int aAmount) {
+ if (aItemListObject == ItemList.NULL || aItemListObject == null) {
+ return null;
+ }
+ else {
+ return aItemListObject.get(aAmount);
+ }
+ }
+
+ public static ItemList getItemListObject(String aObjectFromExperimentalName, String aReplacementName) {
+ ItemList aVal = ItemList.valueOf(aObjectFromExperimentalName);
+ if (aVal != null) {
+ return aVal;
+ }
+ else {
+ aVal = ItemList.valueOf(aReplacementName);
+ if (aVal != null) {
+ return aVal;
+ }
+ else {
+ return ItemList.NULL;
+ }
+ }
+ }
+
+ public static boolean isControlCircuit(ItemStack aStack) {
+ if (aStack != null) {
+ Item aItem = aStack.getItem();
+ if (aItem == CI.getNumberedBioCircuit(0).getItem() || aItem == CI.getNumberedCircuit(0).getItem()) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ public static boolean isCatalyst(ItemStack aStack) {
+
+ if (GT_Utility.areStacksEqual(aStack, GenericChem.mBlueCatalyst, true)) {
+ return true;
+ }
+ if (GT_Utility.areStacksEqual(aStack, GenericChem.mBrownCatalyst, true)) {
+ return true;
+ }
+ if (GT_Utility.areStacksEqual(aStack, GenericChem.mOrangeCatalyst, true)) {
+ return true;
+ }
+ if (GT_Utility.areStacksEqual(aStack, GenericChem.mPurpleCatalyst, true)) {
+ return true;
+ }
+ if (GT_Utility.areStacksEqual(aStack, GenericChem.mRedCatalyst, true)) {
+ return true;
+ }
+ if (GT_Utility.areStacksEqual(aStack, GenericChem.mYellowCatalyst, true)) {
+ return true;
+ }
+ if (GT_Utility.areStacksEqual(aStack, GenericChem.mPinkCatalyst, true)) {
+ return true;
+ }
+ if (GT_Utility.areStacksEqual(aStack, AgriculturalChem.mGreenCatalyst, true)) {
+ return true;
+ }
+ return false;
+ }
+
+ public static String getLocalizedNameOfBlock(Block aBlock, int aMeta) {
+ return LangUtils.getLocalizedNameOfBlock(aBlock, aMeta);
+ }
}
diff --git a/src/Java/gtPlusPlus/core/util/minecraft/LangUtils.java b/src/Java/gtPlusPlus/core/util/minecraft/LangUtils.java
index 01d0efac54..0b24e962af 100644
--- a/src/Java/gtPlusPlus/core/util/minecraft/LangUtils.java
+++ b/src/Java/gtPlusPlus/core/util/minecraft/LangUtils.java
@@ -7,7 +7,13 @@ import java.util.Properties;
import cpw.mods.fml.common.registry.LanguageRegistry;
import gregtech.api.util.GT_LanguageManager;
+import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.util.reflect.ReflectionUtils;
+import net.minecraft.block.Block;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.util.StatCollector;
public class LangUtils {
@@ -15,7 +21,7 @@ public class LangUtils {
public static boolean rewriteEntryForLanguageRegistry(String aKey, String aNewValue){
return rewriteEntryForLanguageRegistry("en_US", aKey, aNewValue);
}
-
+
@SuppressWarnings("unchecked")
public static boolean rewriteEntryForLanguageRegistry(String aLang, String aKey, String aNewValue){
LanguageRegistry aInstance = LanguageRegistry.instance();
@@ -43,7 +49,7 @@ public class LangUtils {
}
}
catch (IllegalArgumentException | IllegalAccessException e) {
-
+
}
}
return false;
@@ -52,5 +58,93 @@ public class LangUtils {
public static String trans(String aNr, String aEnglish) {
return GT_LanguageManager.addStringLocalization("Interaction_DESCRIPTION_Index_GTPP_" + aNr, aEnglish, false);
}
-
+
+
+
+ /**
+ * Quick Block Name Lookup that is friendly to servers and locale.
+ */
+ private static final Map<String, String> mLocaleCache = new HashMap<String, String>();
+
+ public static String getLocalizedNameOfBlock(Block aBlock, int aMeta) {
+ if (aBlock != null) {
+ return getLocalizedNameOfItemStack(ItemUtils.simpleMetaStack(aBlock, aMeta, 1));
+ }
+ return "Bad Block Name";
+ }
+
+ public static String getLocalizedNameOfItem(Item aItem, int aMeta) {
+ if (aItem != null) {
+ return getLocalizedNameOfItemStack(ItemUtils.simpleMetaStack(aItem, aMeta, 1));
+ }
+ return "Bad Item Name";
+ }
+
+ public static String getLocalizedNameOfItemStack(ItemStack aStack) {
+ String aUnlocalized;
+ if (aStack != null) {
+ aUnlocalized = ItemUtils.getUnlocalizedItemName(aStack)+"."+aStack.getItemDamage()+".name";
+ if (aUnlocalized == null || aUnlocalized.length() <= 0) {
+ return "Bad Locale Data";
+ }
+ String mCacheKey = aUnlocalized;
+ if (mLocaleCache.containsKey(mCacheKey)) {
+ // Recache the key if it's invalid.
+ if (mLocaleCache.get(mCacheKey).toLowerCase().contains(".name") || mLocaleCache.get(mCacheKey).toLowerCase().contains("|")) {
+ mLocaleCache.remove(mCacheKey);
+ String mNew;
+ try {
+ mNew = ("" + StatCollector
+ .translateToLocal(aStack.getItem().getUnlocalizedNameInefficiently(aStack) + ".name"))
+ .trim();
+ if (aStack.hasTagCompound()) {
+ if (aStack.stackTagCompound != null && aStack.stackTagCompound.hasKey("display", 10)) {
+ NBTTagCompound nbttagcompound = aStack.stackTagCompound.getCompoundTag("display");
+
+ if (nbttagcompound.hasKey("Name", 8)) {
+ mNew = nbttagcompound.getString("Name");
+ }
+ }
+ }
+ } catch (Throwable t) {
+ mNew = "ERROR - Empty Stack";
+ }
+ Logger.INFO("Re-caching "+mNew+" into locale cache. Key: "+mCacheKey);
+ mLocaleCache.put(mCacheKey, mNew);
+ }
+ Logger.INFO("Returning Cached Value. Key: "+mCacheKey);
+ return mLocaleCache.get(mCacheKey);
+ }
+ else {
+ String unlocalizedName = aStack.getItem().getUnlocalizedName(aStack);
+ Logger.INFO("Cached New Value. UnlocalName: "+unlocalizedName);
+ String blockName = StatCollector.translateToLocal(unlocalizedName + ".name");
+ Logger.INFO("Cached New Value. TranslatedName: "+unlocalizedName);
+ if (blockName.toLowerCase().contains(".name") || blockName.toLowerCase().contains("|")) {
+ try {
+ blockName = ("" + StatCollector
+ .translateToLocal(aStack.getItem().getUnlocalizedNameInefficiently(aStack) + ".name"))
+ .trim();
+ if (aStack.hasTagCompound()) {
+ if (aStack.stackTagCompound != null && aStack.stackTagCompound.hasKey("display", 10)) {
+ NBTTagCompound nbttagcompound = aStack.stackTagCompound.getCompoundTag("display");
+ if (nbttagcompound.hasKey("Name", 8)) {
+ blockName = nbttagcompound.getString("Name");
+ }
+ }
+ }
+ } catch (Throwable t) {
+ blockName = "ERROR - Empty Stack";
+ }
+ }
+ mLocaleCache.put(mCacheKey, blockName);
+ Logger.INFO("Cached New Value. Key: "+mCacheKey);
+ return blockName;
+ }
+
+ }
+ return "Bad ItemStack Name";
+ }
+
+
}
diff --git a/src/Java/gtPlusPlus/core/util/minecraft/MaterialUtils.java b/src/Java/gtPlusPlus/core/util/minecraft/MaterialUtils.java
index 9c623bb9be..2108087542 100644
--- a/src/Java/gtPlusPlus/core/util/minecraft/MaterialUtils.java
+++ b/src/Java/gtPlusPlus/core/util/minecraft/MaterialUtils.java
@@ -352,7 +352,8 @@ public class MaterialUtils {
}
if (g == null) {
Logger.INFO("Failed finding material '"+aMaterialName+"' & fallback '"+aFallbackMaterialName+"', returning _NULL.");
- g = Materials._NULL;
+ CORE.crash();
+ //g = Materials._NULL;
}
return g;
}
diff --git a/src/Java/gtPlusPlus/core/util/minecraft/NBTUtils.java b/src/Java/gtPlusPlus/core/util/minecraft/NBTUtils.java
index 66abbded15..b0623d429d 100644
--- a/src/Java/gtPlusPlus/core/util/minecraft/NBTUtils.java
+++ b/src/Java/gtPlusPlus/core/util/minecraft/NBTUtils.java
@@ -464,4 +464,15 @@ public class NBTUtils {
return ReflectionUtils.setField(aEntity, "customEntityData", aTag);
}
+ public static boolean hasTagCompound(ItemStack aStack) {
+ return aStack.hasTagCompound();
+ }
+
+ public static void createEmptyTagCompound(ItemStack aStack) {
+ if (!hasTagCompound(aStack)) {
+ NBTTagCompound aTag = new NBTTagCompound();
+ aStack.setTagCompound(aTag);
+ }
+ }
+
}
diff --git a/src/Java/gtPlusPlus/core/util/minecraft/PlayerUtils.java b/src/Java/gtPlusPlus/core/util/minecraft/PlayerUtils.java
index 2fb7344a28..9a8a8e691c 100644
--- a/src/Java/gtPlusPlus/core/util/minecraft/PlayerUtils.java
+++ b/src/Java/gtPlusPlus/core/util/minecraft/PlayerUtils.java
@@ -1,10 +1,13 @@
package gtPlusPlus.core.util.minecraft;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.UUID;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
-
+import gtPlusPlus.core.util.Utils;
import net.minecraft.client.Minecraft;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
@@ -13,8 +16,6 @@ import net.minecraft.item.ItemStack;
import net.minecraft.server.MinecraftServer;
import net.minecraft.world.World;
-import gtPlusPlus.core.util.Utils;
-
public class PlayerUtils {
public static void messagePlayer(final EntityPlayer P, final String S){
@@ -100,18 +101,27 @@ public class PlayerUtils {
return null;
}
- @SideOnly(Side.SERVER)
public static ItemStack getItemStackInPlayersHand(final EntityPlayer player){
ItemStack heldItem = null;
- try{heldItem = player.getHeldItem();
- }catch(final NullPointerException e){
+ try{
+ heldItem = player.getHeldItem();
+ }
+ catch(final NullPointerException e){
e.printStackTrace();
return null;
}
if (heldItem != null){
return heldItem;
}
- return null;
+ else {
+ if (Utils.isClient()) {
+ heldItem = player.getItemInUse();
+ }
+ else {
+ heldItem = player.getCurrentEquippedItem();
+ }
+ }
+ return heldItem;
}
@SideOnly(Side.CLIENT)
diff --git a/src/Java/gtPlusPlus/nei/GT_NEI_FluidReactor.java b/src/Java/gtPlusPlus/nei/GT_NEI_FluidReactor.java
index ce1b11e7d4..810076743f 100644
--- a/src/Java/gtPlusPlus/nei/GT_NEI_FluidReactor.java
+++ b/src/Java/gtPlusPlus/nei/GT_NEI_FluidReactor.java
@@ -3,32 +3,39 @@ 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 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_OreDictUnificator;
+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.Recipe_GT;
import gregtech.api.util.Recipe_GT.Gregtech_Recipe_Map;
import gtPlusPlus.core.lib.CORE;
-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 gtPlusPlus.core.util.minecraft.ItemUtils;
+import gtPlusPlus.nei.GT_NEI_MultiBlockHandler.CachedDefaultRecipe;
+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;
@@ -42,31 +49,37 @@ extends TemplateRecipeHandler {
GuiContainerManager.addTooltipHandler(new GT_RectHandler());
}
- protected final Gregtech_Recipe_Map mRecipeMap;
+ protected Gregtech_Recipe_Map mRecipeMap;
- public GT_NEI_FluidReactor(final Gregtech_Recipe_Map sfluidchemicalreactorrecipes) {
- this.mRecipeMap = sfluidchemicalreactorrecipes;
- this.transferRects.add(new TemplateRecipeHandler.RecipeTransferRect(new Rectangle(65, 13, 36, 18), this.getOverlayIdentifier(), new Object[0]));
+ public GT_NEI_FluidReactor() {
+ this.mRecipeMap = Gregtech_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.getOverlayIdentifier());
+ FMLInterModComms.sendRuntimeMessage(GT_Values.GT, "NEIPlugins", "register-crafting-handler", "gregtechplusplus@" + this.getRecipeName() + "@" + this.getRecipeMapName());
GuiCraftingRecipe.craftinghandlers.add(this);
GuiUsageRecipe.usagehandlers.add(this);
}
}
+ public List<Recipe_GT> getSortedRecipes() {
+ List<Recipe_GT> 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_FluidReactor(this.mRecipeMap);
+ return new GT_NEI_FluidReactor();
}
@Override
public void loadCraftingRecipes(final String outputId, final Object... results) {
- if (outputId.equals(this.mRecipeMap.mNEIName)) {
- for (final GT_Recipe tRecipe : this.mRecipeMap.mRecipeList) {
+ if (outputId.equals(getRecipeMapName())) {
+ for (Recipe_GT tRecipe : getSortedRecipes()) {
if (!tRecipe.mHidden) {
this.arecipes.add(new CachedDefaultRecipe(tRecipe));
}
@@ -78,29 +91,29 @@ extends TemplateRecipeHandler {
@Override
public void loadCraftingRecipes(final ItemStack aResult) {
- final ItemData tPrefixMaterial = GT_OreDictUnificator.getAssociation(aResult);
+ ItemData tPrefixMaterial = GT_OreDictUnificator.getAssociation(aResult);
- final ArrayList<ItemStack> tResults = new ArrayList<ItemStack>();
+ 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 (final OrePrefixes tPrefix : tPrefixMaterial.mPrefix.mFamiliarPrefixes) {
+ for (OrePrefixes tPrefix : tPrefixMaterial.mPrefix.mFamiliarPrefixes) {
tResults.add(GT_OreDictUnificator.get(tPrefix, tPrefixMaterial.mMaterial.mMaterial, 1L));
}
}
- final FluidStack tFluid = GT_Utility.getFluidForFilledItem(aResult, true);
+ FluidStack tFluid = GT_Utility.getFluidForFilledItem(aResult, true);
if (tFluid != null) {
tResults.add(GT_Utility.getFluidDisplayStack(tFluid, false));
- for (final FluidContainerRegistry.FluidContainerData tData : FluidContainerRegistry.getRegisteredFluidContainerData()) {
+ for (FluidContainerRegistry.FluidContainerData tData : FluidContainerRegistry.getRegisteredFluidContainerData()) {
if (tData.fluid.isFluidEqual(tFluid)) {
tResults.add(GT_Utility.copy(new Object[]{tData.filledContainer}));
}
}
}
- for (final GT_Recipe tRecipe : this.mRecipeMap.mRecipeList) {
+ for (Recipe_GT tRecipe : getSortedRecipes()) {
if (!tRecipe.mHidden) {
- final CachedDefaultRecipe tNEIRecipe = new CachedDefaultRecipe(tRecipe);
- for (final ItemStack tStack : tResults) {
+ CachedDefaultRecipe tNEIRecipe = new CachedDefaultRecipe(tRecipe);
+ for (ItemStack tStack : tResults) {
if (tNEIRecipe.contains(tNEIRecipe.mOutputs, tStack)) {
this.arecipes.add(tNEIRecipe);
break;
@@ -108,33 +121,33 @@ extends TemplateRecipeHandler {
}
}
}
+ //CachedDefaultRecipe tNEIRecipe;
}
- @Override
- public void loadUsageRecipes(final ItemStack aInput) {
- final ItemData tPrefixMaterial = GT_OreDictUnificator.getAssociation(aInput);
+ public void loadUsageRecipes(ItemStack aInput) {
+ ItemData tPrefixMaterial = GT_OreDictUnificator.getAssociation(aInput);
- final ArrayList<ItemStack> tInputs = new ArrayList<ItemStack>();
+ ArrayList<ItemStack> tInputs = new ArrayList<ItemStack>();
tInputs.add(aInput);
tInputs.add(GT_OreDictUnificator.get(false, aInput));
if ((tPrefixMaterial != null) && (!tPrefixMaterial.mPrefix.mFamiliarPrefixes.isEmpty())) {
- for (final OrePrefixes tPrefix : tPrefixMaterial.mPrefix.mFamiliarPrefixes) {
+ for (OrePrefixes tPrefix : tPrefixMaterial.mPrefix.mFamiliarPrefixes) {
tInputs.add(GT_OreDictUnificator.get(tPrefix, tPrefixMaterial.mMaterial.mMaterial, 1L));
}
}
- final FluidStack tFluid = GT_Utility.getFluidForFilledItem(aInput, true);
+ FluidStack tFluid = GT_Utility.getFluidForFilledItem(aInput, true);
if (tFluid != null) {
tInputs.add(GT_Utility.getFluidDisplayStack(tFluid, false));
- for (final FluidContainerRegistry.FluidContainerData tData : FluidContainerRegistry.getRegisteredFluidContainerData()) {
+ for (FluidContainerRegistry.FluidContainerData tData : FluidContainerRegistry.getRegisteredFluidContainerData()) {
if (tData.fluid.isFluidEqual(tFluid)) {
tInputs.add(GT_Utility.copy(new Object[]{tData.filledContainer}));
}
}
}
- for (final GT_Recipe tRecipe : this.mRecipeMap.mRecipeList) {
+ for (Recipe_GT tRecipe : getSortedRecipes()) {
if (!tRecipe.mHidden) {
- final CachedDefaultRecipe tNEIRecipe = new CachedDefaultRecipe(tRecipe);
- for (final ItemStack tStack : tInputs) {
+ CachedDefaultRecipe tNEIRecipe = new CachedDefaultRecipe(tRecipe);
+ for (ItemStack tStack : tInputs) {
if (tNEIRecipe.contains(tNEIRecipe.mInputs, tStack)) {
this.arecipes.add(tNEIRecipe);
break;
@@ -142,6 +155,11 @@ extends TemplateRecipeHandler {
}
}
}
+ //CachedDefaultRecipe tNEIRecipe;
+ }
+
+ public String getRecipeMapName() {
+ return this.mRecipeMap.mNEIName;
}
@Override
@@ -193,7 +211,13 @@ extends TemplateRecipeHandler {
(tStack.item.stackSize != 0)) {
break;
}
- currenttip.add("Does not get consumed in the process");
+ if (ItemUtils.isCatalyst(aStack)) {
+ currenttip.add("Does not always get consumed in the process");
+ currenttip.add("Higher tier pipe casings allow this item to last longer");
+ }
+ else if (ItemUtils.isControlCircuit(aStack)) {
+ currenttip.add("Does not get consumed in the process");
+ }
break;
}
}
diff --git a/src/Java/gtPlusPlus/nei/NEI_GT_Config.java b/src/Java/gtPlusPlus/nei/NEI_GT_Config.java
index ad03040059..45d406aa96 100644
--- a/src/Java/gtPlusPlus/nei/NEI_GT_Config.java
+++ b/src/Java/gtPlusPlus/nei/NEI_GT_Config.java
@@ -4,6 +4,7 @@ import codechicken.nei.api.API;
import codechicken.nei.api.IConfigureNEI;
import gregtech.api.util.CustomRecipeMap;
import gregtech.api.util.Recipe_GT.Gregtech_Recipe_Map;
+import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production.chemplant.GregtechMTE_ChemicalPlant;
public class NEI_GT_Config
implements IConfigureNEI {
@@ -19,12 +20,12 @@ implements IConfigureNEI {
}
for (final Gregtech_Recipe_Map tMap : gregtech.api.util.Recipe_GT.Gregtech_Recipe_Map.sMappings) {
if (tMap.mNEIAllowed) {
- if (!tMap.mUnlocalizedName.equals(Gregtech_Recipe_Map.sFluidChemicalReactorRecipes.mUnlocalizedName)) {
+ if (!tMap.mUnlocalizedName.equals(Gregtech_Recipe_Map.sChemicalPlantRecipes.mUnlocalizedName)) {
new GT_NEI_MultiBlockHandler(tMap);
}
}
}
- new GT_NEI_FluidReactor(Gregtech_Recipe_Map.sFluidChemicalReactorRecipes);
+ new GT_NEI_FluidReactor();
sIsAdded = true;
API.registerRecipeHandler(new DecayableRecipeHandler());
API.registerUsageHandler(new DecayableRecipeHandler());
diff --git a/src/Java/gtPlusPlus/plugin/agrichem/BioRecipes.java b/src/Java/gtPlusPlus/plugin/agrichem/BioRecipes.java
index 54e2f55851..541f02cccd 100644
--- a/src/Java/gtPlusPlus/plugin/agrichem/BioRecipes.java
+++ b/src/Java/gtPlusPlus/plugin/agrichem/BioRecipes.java
@@ -339,7 +339,7 @@ public class BioRecipes {
ItemUtils.getSimpleStack(AgriculturalChem.mCompost, 1));
// Plastic
- CORE.RA.addFluidReactorRecipe(
+ CORE.RA.addChemicalPlantRecipe(
new ItemStack[] {
getBioChip(16),
ItemUtils.getSimpleStack(AgriculturalChem.mCellulosePulp, 64),
@@ -457,7 +457,7 @@ public class BioRecipes {
ItemUtils.getItemStackOfAmountFromOreDict("screwTin", GTNH ? 6 : 3)
},
GT_Values.NF,
- ItemUtils.getSimpleStack(AgriculturalChem.mCatalystCarrier, 1),
+ CI.getEmptyCatalyst(1),
300 * 20,
16);
}
@@ -466,12 +466,12 @@ public class BioRecipes {
// Assembly Recipe
CORE.RA.addSixSlotAssemblingRecipe(new ItemStack[] {
getBioChip(4),
- ItemUtils.getSimpleStack(AgriculturalChem.mCatalystCarrier, 10),
+ CI.getEmptyCatalyst(10),
ItemUtils.getItemStackOfAmountFromOreDict("dustAluminium", 4),
ItemUtils.getItemStackOfAmountFromOreDict("dustSilver", 4)
},
GT_Values.NF,
- ItemUtils.getSimpleStack(AgriculturalChem.mGreenCatalyst, 10),
+ CI.getGreenCatalyst(10),
20 * 20,
30);
}
@@ -479,7 +479,7 @@ public class BioRecipes {
private static void recipeAceticAcid() {
/* GT_Values.RA.addMixerRecipe(
- ItemUtils.getSimpleStack(AgriculturalChem.mGreenCatalyst, 10),
+ CI.getGreenCatalyst(10),
var2,
var3, var4,
var5, // Fluid in
@@ -489,9 +489,9 @@ public class BioRecipes {
var9); // Eu
*/
- CORE.RA.addFluidReactorRecipe(
+ CORE.RA.addChemicalPlantRecipe(
new ItemStack[] {
- ItemUtils.getSimpleStack(AgriculturalChem.mGreenCatalyst, 0)
+ CI.getGreenCatalyst(0)
},
new FluidStack[] {
FluidUtils.getFluidStack(BioRecipes.mMethanol, 700),
@@ -583,7 +583,7 @@ public class BioRecipes {
continue;
}
if (ItemUtils.checkForInvalidItems(a)) {
- CORE.RA.addFluidReactorRecipe(
+ CORE.RA.addChemicalPlantRecipe(
new ItemStack[] {
getBioChip(2),
ItemUtils.getSimpleStack(a, 10)
@@ -605,7 +605,7 @@ public class BioRecipes {
}
for (ItemStack a : aSeeds) {
if (ItemUtils.checkForInvalidItems(a)) {
- CORE.RA.addFluidReactorRecipe(
+ CORE.RA.addChemicalPlantRecipe(
new ItemStack[] {
getBioChip(3),
ItemUtils.getSimpleStack(a, 20)
@@ -626,7 +626,7 @@ public class BioRecipes {
}
// Sugar Cane
- CORE.RA.addFluidReactorRecipe(
+ CORE.RA.addChemicalPlantRecipe(
new ItemStack[] {
getBioChip(4),
ItemUtils.getSimpleStack(Items.reeds, 16)
@@ -644,7 +644,7 @@ public class BioRecipes {
30,
1);
- CORE.RA.addFluidReactorRecipe(
+ CORE.RA.addChemicalPlantRecipe(
new ItemStack[] {
getBioChip(5),
ItemUtils.getSimpleStack(Items.reeds, 32),
@@ -666,7 +666,7 @@ public class BioRecipes {
// Sugar Beet
if (OreDictUtils.containsValidEntries("cropSugarbeet")) {
- CORE.RA.addFluidReactorRecipe(
+ CORE.RA.addChemicalPlantRecipe(
new ItemStack[] {
getBioChip(4),
ItemUtils.getItemStackOfAmountFromOreDict("cropSugarbeet", 8),
@@ -684,7 +684,7 @@ public class BioRecipes {
30,
1);
- CORE.RA.addFluidReactorRecipe(
+ CORE.RA.addChemicalPlantRecipe(
new ItemStack[] {
getBioChip(5),
ItemUtils.getItemStackOfAmountFromOreDict("cropSugarbeet", 16),
@@ -705,7 +705,7 @@ public class BioRecipes {
}
// Produce Acetone, Butanol and Ethanol
- CORE.RA.addFluidReactorRecipe(
+ CORE.RA.addChemicalPlantRecipe(
new ItemStack[] {
getBioChip(5),
ItemUtils.getItemStackOfAmountFromOreDict("cellFermentationBase", 48),
@@ -732,9 +732,9 @@ public class BioRecipes {
}
private static void recipePropionicAcid() {
- CORE.RA.addFluidReactorRecipe(
+ CORE.RA.addChemicalPlantRecipe(
new ItemStack[] {
- ItemUtils.getSimpleStack(AgriculturalChem.mGreenCatalyst, 0)
+ CI.getGreenCatalyst(0)
},
new FluidStack[] {
FluidUtils.getFluidStack(BioRecipes.mEthylene, 500),
@@ -781,7 +781,7 @@ public class BioRecipes {
}
private static void recipeSodiumHydroxide() {
- CORE.RA.addFluidReactorRecipe(
+ CORE.RA.addChemicalPlantRecipe(
new ItemStack[] {
getBioChip(4)
},
@@ -799,7 +799,7 @@ public class BioRecipes {
120,
1);
- CORE.RA.addFluidReactorRecipe(
+ CORE.RA.addChemicalPlantRecipe(
new ItemStack[] {
getBioChip(5),
ItemUtils.getItemStackOfAmountFromOreDict("dustSodium", 5)
@@ -821,7 +821,7 @@ public class BioRecipes {
private static void recipeSodiumCarbonate() {
if (OreDictUtils.containsValidEntries("fuelCoke")) {
- CORE.RA.addFluidReactorRecipe(
+ CORE.RA.addChemicalPlantRecipe(
new ItemStack[] {
getBioChip(18),
ItemUtils.getItemStackOfAmountFromOreDict("fuelCoke", 3),
@@ -844,7 +844,7 @@ public class BioRecipes {
}
- CORE.RA.addFluidReactorRecipe(
+ CORE.RA.addChemicalPlantRecipe(
new ItemStack[] {
getBioChip(18),
ItemUtils.getItemStackOfAmountFromOreDict("dustCoal", 6),
@@ -938,7 +938,7 @@ public class BioRecipes {
}
for (String aOreName : aOreNames) {
- CORE.RA.addFluidReactorRecipe(
+ CORE.RA.addChemicalPlantRecipe(
new ItemStack[] {
CI.getNumberedBioCircuit(14),
ItemUtils.getSimpleStack(aOreCache.get(aOreName), aOreData2.get(aOreName))
@@ -1051,7 +1051,7 @@ public class BioRecipes {
private static void recipeSulfuricAcid() {
- CORE.RA.addFluidReactorRecipe(
+ CORE.RA.addChemicalPlantRecipe(
new ItemStack[] {
getBioChip(7),
ItemUtils.getSimpleStack(AgriculturalChem.mGoldenBrownCelluloseFiber, 10),
@@ -1070,7 +1070,7 @@ public class BioRecipes {
60,
1);
- CORE.RA.addFluidReactorRecipe(
+ CORE.RA.addChemicalPlantRecipe(
new ItemStack[] {
getBioChip(7),
ItemUtils.getSimpleStack(AgriculturalChem.mRedCelluloseFiber, 5),
@@ -1094,7 +1094,7 @@ public class BioRecipes {
private static void recipeUrea() {
- CORE.RA.addFluidReactorRecipe(
+ CORE.RA.addChemicalPlantRecipe(
new ItemStack[] {
getBioChip(9),
},
@@ -1113,7 +1113,7 @@ public class BioRecipes {
30,
1);
- CORE.RA.addFluidReactorRecipe(
+ CORE.RA.addChemicalPlantRecipe(
new ItemStack[] {
getBioChip(9),
},
@@ -1134,7 +1134,7 @@ public class BioRecipes {
private static void recipeRawBioResin() {
- CORE.RA.addFluidReactorRecipe(
+ CORE.RA.addChemicalPlantRecipe(
new ItemStack[] {
getBioChip(3),
ItemUtils.getSimpleStack(AgriculturalChem.mGreenAlgaeBiosmass, 10),
@@ -1156,7 +1156,7 @@ public class BioRecipes {
private static void recipeLiquidResin() {
- CORE.RA.addFluidReactorRecipe(
+ CORE.RA.addChemicalPlantRecipe(
new ItemStack[] {
getBioChip(3),
ItemUtils.getSimpleStack(AgriculturalChem.mRawBioResin, 1)
@@ -1174,7 +1174,7 @@ public class BioRecipes {
30,
1);
- CORE.RA.addFluidReactorRecipe(
+ CORE.RA.addChemicalPlantRecipe(
new ItemStack[] {
getBioChip(3),
ItemUtils.getSimpleStack(AgriculturalChem.mCellulosePulp, 8)
@@ -1199,7 +1199,7 @@ public class BioRecipes {
ItemStack aFert;
if (LoadedMods.Forestry) {
aFert = ItemUtils.getSimpleStack(AgriculturalChem.aFertForestry, 2);
- CORE.RA.addFluidReactorRecipe(
+ CORE.RA.addChemicalPlantRecipe(
new ItemStack[] {
getBioChip(11),
ItemUtils.getSimpleStack(AgriculturalChem.mGreenAlgaeBiosmass, 16),
@@ -1220,7 +1220,7 @@ public class BioRecipes {
}
aFert = ItemUtils.getSimpleStack(AgriculturalChem.aFertIC2, 2);
- CORE.RA.addFluidReactorRecipe(
+ CORE.RA.addChemicalPlantRecipe(
new ItemStack[] {
getBioChip(12),
ItemUtils.getSimpleStack(AgriculturalChem.mGreenAlgaeBiosmass, 16),
@@ -1243,7 +1243,7 @@ public class BioRecipes {
private static void recipeMethane() {
- CORE.RA.addFluidReactorRecipe(
+ CORE.RA.addChemicalPlantRecipe(
new ItemStack[] {
getBioChip(12),
ItemUtils.getSimpleStack(AgriculturalChem.mAlgaeBiosmass, 20)
@@ -1261,7 +1261,7 @@ public class BioRecipes {
8,
1);
- CORE.RA.addFluidReactorRecipe(
+ CORE.RA.addChemicalPlantRecipe(
new ItemStack[] {
getBioChip(13),
ItemUtils.getSimpleStack(AgriculturalChem.mCelluloseFiber, 64),
@@ -1284,10 +1284,10 @@ public class BioRecipes {
private static void recipeBenzene() {
- CORE.RA.addFluidReactorRecipe(
+ CORE.RA.addChemicalPlantRecipe(
new ItemStack[] {
getBioChip(19),
- ItemUtils.getSimpleStack(AgriculturalChem.mGreenCatalyst, 0),
+ CI.getGreenCatalyst(0),
},
new FluidStack[] {
FluidUtils.getFluidStack(BioRecipes.mMethane, 1000),
@@ -1304,10 +1304,10 @@ public class BioRecipes {
private static void recipeStyrene() {
- CORE.RA.addFluidReactorRecipe(
+ CORE.RA.addChemicalPlantRecipe(
new ItemStack[] {
getBioChip(20),
- ItemUtils.getSimpleStack(AgriculturalChem.mGreenCatalyst, 0),
+ CI.getGreenCatalyst(0),
},
new FluidStack[] {
FluidUtils.getFluidStack(BioRecipes.mEthylbenzene, 100),
diff --git a/src/Java/gtPlusPlus/preloader/asm/AsmConfig.java b/src/Java/gtPlusPlus/preloader/asm/AsmConfig.java
index b3fbcb2d61..88bcf6b28b 100644
--- a/src/Java/gtPlusPlus/preloader/asm/AsmConfig.java
+++ b/src/Java/gtPlusPlus/preloader/asm/AsmConfig.java
@@ -15,6 +15,7 @@ public class AsmConfig {
public static boolean enableTiConFluidLighting;
public static boolean enableGtTooltipFix;
public static boolean enableGtNbtFix;
+ public static boolean enableGtCharcoalPitFix;
public static boolean enableChunkDebugging;
public static boolean enableCofhPatch;
public static boolean enableGcFuelChanges;
@@ -22,6 +23,7 @@ public class AsmConfig {
public static boolean enableRcItemDupeFix;
public static boolean enableTcAspectSafety;
public static boolean enabledLwjglKeybindingFix;
+ public static boolean enabledFixEntitySetHealth;
public static boolean disableAllLogging;
@@ -51,6 +53,12 @@ public class AsmConfig {
disableAllLogging = prop.getBoolean(false);
propOrderDebug.add(prop.getName());
+ prop = config.get("debug", "enabledFixEntitySetHealth", false);
+ prop.comment = "Enable/Disable entity setHealth() fix.";
+ prop.setLanguageKey("gtpp.enabledFixEntitySetHealth").setRequiresMcRestart(true);
+ enabledFixEntitySetHealth = prop.getBoolean(false);
+ propOrderDebug.add(prop.getName());
+
prop = config.get("debug", "enableChunkDebugging", false);
prop.comment = "Enable/Disable Chunk Debugging Features, Must Be enabled on Client and Server.";
prop.setLanguageKey("gtpp.enableChunkDebugging").setRequiresMcRestart(true);
@@ -91,6 +99,14 @@ public class AsmConfig {
enableGtTooltipFix = prop.getBoolean(true);
propOrder.add(prop.getName());
+
+
+ prop = config.get("general", "enableGtCharcoalPitFix", true);
+ prop.comment = "Makes the Charcoal Pile Igniter work better.";
+ prop.setLanguageKey("gtpp.enableGtCharcoalPitFix").setRequiresMcRestart(true);
+ enableGtCharcoalPitFix = prop.getBoolean(true);
+ propOrder.add(prop.getName());
+
prop = config.get("general", "enableGcFuelChanges", true);
prop.comment = "Enable/Disable changes to Galacticraft Rocket Fuels.";
prop.setLanguageKey("gtpp.enableGcFuelChanges").setRequiresMcRestart(true);
@@ -137,6 +153,7 @@ public class AsmConfig {
FMLLog.log(Level.INFO, "[GT++ ASM] Gc Fuel Changes Patch - Enabled: "+enableGcFuelChanges, new Object[0]);
FMLLog.log(Level.INFO, "[GT++ ASM] Railcraft Fluid Flow Patch - Enabled: "+enableRcFlowFix, new Object[0]);
FMLLog.log(Level.INFO, "[GT++ ASM] Thaumcraft Aspect Safety Patch - Enabled: "+enableTcAspectSafety, new Object[0]);
+ FMLLog.log(Level.INFO, "[GT++ ASM] Fix bad usage of EntityLivingBase.setHealth Patch - Enabled: "+enabledFixEntitySetHealth, new Object[0]);
} catch (Exception var3) {
FMLLog.log(Level.ERROR, var3, "GT++ ASM had a problem loading it's config", new Object[0]);
diff --git a/src/Java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_Forge_EntityLivingBase_SetHealth.java b/src/Java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_Forge_EntityLivingBase_SetHealth.java
new file mode 100644
index 0000000000..d56b9de059
--- /dev/null
+++ b/src/Java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_Forge_EntityLivingBase_SetHealth.java
@@ -0,0 +1,130 @@
+package gtPlusPlus.preloader.asm.transformers;
+
+import org.objectweb.asm.ClassReader;
+import org.objectweb.asm.ClassVisitor;
+import org.objectweb.asm.ClassWriter;
+import org.objectweb.asm.MethodVisitor;
+import org.objectweb.asm.Opcodes;
+
+import cpw.mods.fml.relauncher.FMLRelaunchLog;
+import net.minecraft.entity.EntityLivingBase;
+import net.minecraft.util.DamageSource;
+
+public class ClassTransformer_Forge_EntityLivingBase_SetHealth {
+
+ private boolean isValid = false;
+ private ClassReader mReader = null;
+ private ClassWriter mWriter = null;
+ private boolean didPatch = false;
+
+ public ClassTransformer_Forge_EntityLivingBase_SetHealth(String aClassName, byte[] basicClass) {
+ if (basicClass == null) {
+ return;
+ }
+
+ ClassReader reader = new ClassReader(basicClass);
+ ClassWriter writer = new ClassWriter(reader, ClassWriter.COMPUTE_MAXS);
+ ClassVisitor visitor = writer;
+ SetHealthVisitor aVisitor = new SetHealthVisitor(visitor);
+ visitor = aVisitor;
+ reader.accept(visitor, 0);
+ if (reader != null && writer != null) {
+ isValid = true;
+ }
+ else {
+ isValid = false;
+ }
+ mReader = reader;
+ mWriter = writer;
+ didPatch = aVisitor.didPatchInternal;
+ }
+
+ public boolean isValidTransformer() {
+ return isValid;
+ }
+
+ public ClassReader getReader() {
+ return mReader;
+ }
+
+ public ClassWriter getWriter() {
+ return mWriter;
+ }
+
+
+ public static class SetHealthVisitor extends ClassVisitor {
+ private String clsName = null;
+ private boolean didPatchInternal = false;
+ private static final String callbackOwner = org.objectweb.asm.Type.getInternalName(SetHealthVisitor.class);
+
+ private SetHealthVisitor(ClassVisitor cv) {
+ super(Opcodes.ASM5, cv);
+ }
+
+ @Override
+ public void visit(int version, int access, String name, String signature, String superName, String[] interfaces) {
+ super.visit(
+ version, access, name, signature, superName, interfaces
+ );
+ this.clsName = name;
+ }
+
+ @Override
+ public MethodVisitor visitMethod(
+ int mAccess, final String mName, final String mDesc, String mSignature, String[] mExceptions) {
+ final boolean warn = !(clsName.equals(
+ "net/minecraft/entity/EntityLivingBase"
+ ));
+
+ return new MethodVisitor(Opcodes.ASM5, super.visitMethod(mAccess, mName, mDesc, mSignature, mExceptions)) {
+ @Override
+ public void visitMethodInsn(
+ int opcode, String owner, String name, String desc, boolean isIntf
+ ) {
+ if (owner.equals(
+ "net/minecraft/entity/EntityLivingBase"
+ ) && name.equals("setHealth") && desc.equals("(F)V")) {
+ if (warn) {
+ FMLRelaunchLog.warning(
+ "============================================================="
+ );
+ FMLRelaunchLog.warning(
+ "MOD HAS DIRECT REFERENCE Entity.setHealth() THIS IS NOT ALLOWED!"
+ );
+ FMLRelaunchLog.warning(
+ "Offendor: %s.%s%s", SetHealthVisitor.this.clsName, mName, mDesc
+ );
+ FMLRelaunchLog.warning(
+ "Use EntityLiving.attackEntityFrom(DamageSource, damageDealt) instead"
+ );
+ FMLRelaunchLog.warning(
+ "============================================================="
+ );
+ }
+ didPatchInternal = true;
+ //opcode = Opcodes.INVOKESTATIC; // Set it static
+ //owner = SetHealthVisitor.callbackOwner;
+ //name = "setHealthGeneric"; // Replace the method name
+ //desc = "(Lnet/minecraft/entity/EntityLivingBase;F)V"; // Replace the method desc
+
+ }
+ super.visitMethodInsn(opcode, owner, name, desc, isIntf);
+ }
+ };
+ }
+
+
+ private final static DamageSource mGenericDamageSource = new DamageSource("gtpp.generic");
+
+ public static void setHealthGeneric(EntityLivingBase aEntity, float aValue) {
+ aEntity.attackEntityFrom(mGenericDamageSource, aValue);
+ }
+
+ }
+
+
+ public boolean didPatchClass() {
+ return didPatch;
+ }
+
+}
diff --git a/src/Java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_GT_CharcoalPit.java b/src/Java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_GT_CharcoalPit.java
index 9c79db265d..1e54bd3632 100644
--- a/src/Java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_GT_CharcoalPit.java
+++ b/src/Java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_GT_CharcoalPit.java
@@ -1,10 +1,6 @@
package gtPlusPlus.preloader.asm.transformers;
-import static org.objectweb.asm.Opcodes.ACC_PUBLIC;
-import static org.objectweb.asm.Opcodes.ALOAD;
-import static org.objectweb.asm.Opcodes.ASM5;
-import static org.objectweb.asm.Opcodes.INVOKESTATIC;
-import static org.objectweb.asm.Opcodes.IRETURN;
+import static org.objectweb.asm.Opcodes.*;
import java.util.ArrayList;
@@ -17,10 +13,10 @@ import org.objectweb.asm.MethodVisitor;
import cpw.mods.fml.relauncher.FMLRelaunchLog;
import gregtech.api.enums.OrePrefixes;
-import gtPlusPlus.api.objects.Logger;
+import gregtech.api.util.GT_Utility;
import gtPlusPlus.core.util.minecraft.ItemUtils;
+import gtPlusPlus.core.util.reflect.ReflectionUtils;
import net.minecraft.block.Block;
-import net.minecraft.block.material.Material;
import net.minecraft.item.ItemStack;
import net.minecraftforge.oredict.OreDictionary;
@@ -31,35 +27,58 @@ public class ClassTransformer_GT_CharcoalPit {
private final ClassWriter writer;
public static boolean isWoodLog(Block log) {
- //Logger.INFO("checking for log");
- boolean isLog1 = OrePrefixes.log.contains(new ItemStack(log, 1));
- if (isLog1) {
- //Logger.INFO("Found 1");
- return true;
+ return isWoodLog(log, Short.MAX_VALUE);
+ }
+
+ public static boolean isWoodLog(Block log, int meta) {
+ ItemStack aLogStack = ItemUtils.getSimpleStack(log, meta, 1);
+ ArrayList<ItemStack> aData = OrePrefixes.log.mPrefixedItems;
+ for (ItemStack aStack : aData) {
+ if (GT_Utility.areStacksEqual(aStack, aLogStack)) {
+ return true;
+ }
+ }
+ aData.clear();
+ aData = OreDictionary.getOres("logWood");
+ for (ItemStack aStack : aData) {
+ if (GT_Utility.areStacksEqual(aStack, aLogStack)) {
+ return true;
+ }
}
- ArrayList<ItemStack> oredict = OreDictionary.getOres("logWood");
- if (oredict.contains(ItemUtils.getSimpleStack(log))) {
- //Logger.INFO("found 2");
- return true;
- }
- //Logger.INFO("Did not find. "+(log != null ? ""+log.getLocalizedName() : "Null or invalid block?"));
return false;
}
-
+
public ClassTransformer_GT_CharcoalPit(byte[] basicClass, boolean obfuscated) {
ClassReader aTempReader = null;
ClassWriter aTempWriter = null;
+ boolean aBadTime = false;
+ if (ReflectionUtils.doesClassExist("aji")) {
+ obfuscated = true;
+ }
+ else {
+ if (ReflectionUtils.doesClassExist("net.minecraft.block.Block")) {
+ obfuscated = false;
+ }
+ else {
+ // Bad... Like.. very bad..
+ FMLRelaunchLog.log("[GT++ ASM] GT Charcoal Pit Fix", Level.INFO, "Unable to find Block.class/aji.class, this is BAD. Not Patching.");
+ }
+ }
aTempReader = new ClassReader(basicClass);
aTempWriter = new ClassWriter(aTempReader, ClassWriter.COMPUTE_FRAMES);
- aTempReader.accept(new AddFieldAdapter(aTempWriter), 0);
- injectMethod("isWoodLog", obfuscated, aTempWriter);
- if (aTempReader != null && aTempWriter != null) {
- isValid = true;
- } else {
+ if (!aBadTime) {
+ aTempReader.accept(new CustomClassVisitor(aTempWriter), 0);
+ injectMethod("isWoodLog", obfuscated, aTempWriter);
+ if (aTempReader != null && aTempWriter != null) {
+ isValid = true;
+ } else {
+ isValid = false;
+ }
+ }
+ else {
isValid = false;
}
- FMLRelaunchLog.log("[GT++ ASM] GT Charcoal Pit Fix", Level.INFO,
- "Valid? " + isValid + ".");
+ FMLRelaunchLog.log("[GT++ ASM] GT Charcoal Pit Fix", Level.INFO, "Valid? " + isValid + ".");
reader = aTempReader;
writer = aTempWriter;
}
@@ -80,17 +99,19 @@ public class ClassTransformer_GT_CharcoalPit {
MethodVisitor mv;
boolean didInject = false;
FMLRelaunchLog.log("[GT++ ASM] GT Charcoal Pit Fix", Level.INFO, "Injecting " + aMethodName + ".");
-
+
String aBlockClassName = "net/minecraft/block/Block";
if (obfuscated) {
aBlockClassName = "aji";
}
if (aMethodName.equals("isWoodLog")) {
+
+ // Inject original Method with only block arg.
mv = cw.visitMethod(ACC_PUBLIC, "isWoodLog", "(L"+aBlockClassName+";)Z", null, null);
mv.visitCode();
Label l0 = new Label();
mv.visitLabel(l0);
- mv.visitLineNumber(49, l0);
+ mv.visitLineNumber(197, l0);
mv.visitVarInsn(ALOAD, 1);
mv.visitMethodInsn(INVOKESTATIC, "gtPlusPlus/preloader/asm/transformers/ClassTransformer_GT_CharcoalPit", "isWoodLog", "(L"+aBlockClassName+";)Z", false);
mv.visitInsn(IRETURN);
@@ -100,15 +121,36 @@ public class ClassTransformer_GT_CharcoalPit {
mv.visitLocalVariable("log", "L"+aBlockClassName+";", null, l0, l1, 1);
mv.visitMaxs(1, 2);
mv.visitEnd();
+
+
+ // Inject better Method with block & meta arg.
+ mv = cw.visitMethod(ACC_PUBLIC, "isWoodLog", "(L"+aBlockClassName+";I)Z", null, null);
+ mv.visitCode();
+ Label label0 = new Label();
+ mv.visitLabel(label0);
+ mv.visitLineNumber(201, label0);
+ mv.visitVarInsn(ALOAD, 1);
+ mv.visitVarInsn(ILOAD, 2);
+ mv.visitMethodInsn(INVOKESTATIC, "gtPlusPlus/preloader/asm/transformers/ClassTransformer_GT_CharcoalPit", "isWoodLog", "(L"+aBlockClassName+";I)Z", false);
+ mv.visitInsn(IRETURN);
+ Label label1 = new Label();
+ mv.visitLabel(label1);
+ mv.visitLocalVariable("this", "Lgregtech/common/tileentities/machines/multi/GT_MetaTileEntity_Charcoal_Pit;", null, label0, label1, 0);
+ mv.visitLocalVariable("log", "L"+aBlockClassName+";", null, label0, label1, 1);
+ mv.visitLocalVariable("meta", "I", null, label0, label1, 2);
+ mv.visitMaxs(2, 3);
+ mv.visitEnd();
+
didInject = true;
+
}
FMLRelaunchLog.log("[GT++ ASM] GT Charcoal Pit Fix", Level.INFO, "Method injection complete.");
return didInject;
}
- public class AddFieldAdapter extends ClassVisitor {
+ public class CustomClassVisitor extends ClassVisitor {
- public AddFieldAdapter(ClassVisitor cv) {
+ public CustomClassVisitor(ClassVisitor cv) {
super(ASM5, cv);
this.cv = cv;
}
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 d81c96dcca..d8dc71dff0 100644
--- a/src/Java/gtPlusPlus/preloader/asm/transformers/Preloader_Transformer_Handler.java
+++ b/src/Java/gtPlusPlus/preloader/asm/transformers/Preloader_Transformer_Handler.java
@@ -30,9 +30,9 @@ public class Preloader_Transformer_Handler implements IClassTransformer {
System.out.println("[GT++ ASM] Asm Config Location: "+mConfig.config.getConfigFile().getAbsolutePath());
System.out.println("[GT++ ASM] Is DevHelper Valid? "+gtPlusPlus.preloader.DevHelper.mIsValidHelper);
}
-
+
private static Boolean mObf = null;
-
+
public boolean checkObfuscated() {
if (mObf != null) {
return mObf;
@@ -60,6 +60,25 @@ public class Preloader_Transformer_Handler implements IClassTransformer {
}
public byte[] transform(String name, String transformedName, byte[] basicClass) {
+ /*
+ * Here we patch all instances of entity.setHealth and replace them with a static function.
+ * Only EntityLivingBase is left untouched, as nothing else truly needs to be calling this method and avoiding forge hooks.
+ * May exclude all vanilla/forge class if this causes issues though.
+ */
+ PatchForge : if (mConfig.enabledFixEntitySetHealth && !transformedName.contains("gtPlusPlus.preloader")) {
+
+ //Skip Vanilla/Forge Classes
+ if (transformedName.contains("net.minecraft.") || transformedName.contains("cpw.")) {
+ //break PatchForge;
+ }
+
+ ClassTransformer_Forge_EntityLivingBase_SetHealth aForgeHealthFix = new ClassTransformer_Forge_EntityLivingBase_SetHealth(transformedName, basicClass);
+ if (aForgeHealthFix.isValidTransformer() && aForgeHealthFix.didPatchClass()) {
+ FMLRelaunchLog.log("[GT++ ASM] Fix EntityLivingBase.setHealth misuse", Level.INFO, "Transforming %s", transformedName);
+ basicClass = aForgeHealthFix.getWriter().toByteArray();
+ }
+ }
+
// Is this environment obfuscated? (Extra checks just in case some weird shit happens during the check)
boolean obfuscated = checkObfuscated();
boolean probablyShouldBeFalse = false;
@@ -69,7 +88,7 @@ public class Preloader_Transformer_Handler implements IClassTransformer {
FMLRelaunchLog.log("[GT++ ASM] LWJGL Keybinding index out of bounds fix", Level.INFO, "Transforming %s", transformedName);
return new ClassTransformer_LWJGL_Keyboard(basicClass).getWriter().toByteArray();
}
-
+
//Enable mapping of Tickets and loaded chunks. - Forge
if (transformedName.equals("net.minecraftforge.common.ForgeChunkManager") && mConfig.enableChunkDebugging) {
FMLRelaunchLog.log("[GT++ ASM] Chunkloading Patch", Level.INFO, "Transforming %s", transformedName);
@@ -94,7 +113,7 @@ public class Preloader_Transformer_Handler implements IClassTransformer {
FMLRelaunchLog.log("[GT++ ASM] Bright Fluids", Level.INFO, "Transforming %s", transformedName);
return new ClassTransformer_TiConFluids("getLightValue", obfuscated, basicClass).getWriter().toByteArray();
}
-
+
//Fix RC stuff
//Patching PROCESS_VOLUME to allow 4x more transfer limits
if (transformedName.equals("mods.railcraft.common.fluids.FluidHelper") && mConfig.enableRcFlowFix) {
@@ -123,15 +142,15 @@ public class Preloader_Transformer_Handler implements IClassTransformer {
}
}
-
-
-
-
-
+
+
+
+
+
/**
* Gregtech ASM Patches
*/
-
+
//Make GT_Utilities safer
if (transformedName.equals("gtPlusPlus.preloader.asm.transformers.ClassTransformer_GT_Utility")) {
FMLRelaunchLog.log("[GT++ ASM] Gregtech Utilities Patch", Level.INFO, "Transforming %s", transformedName);
@@ -147,7 +166,7 @@ public class Preloader_Transformer_Handler implements IClassTransformer {
FMLRelaunchLog.log("[GT++ ASM] Gregtech Achievements Patch", Level.INFO, "Transforming %s", transformedName);
return new ClassTransformer_GT_Achievements_CrashFix(basicClass, obfuscated).getWriter().toByteArray();
}
-
+
//Fix bad handling of a loop left from original decompilation
//Also Fix Achievements, although currently disabled.
if (transformedName.equals("gregtech.common.GT_Client")) {
@@ -165,16 +184,16 @@ public class Preloader_Transformer_Handler implements IClassTransformer {
FMLRelaunchLog.log("[GT++ ASM] Gregtech setMetaTileEntity Patch", Level.INFO, "Transforming %s", transformedName);
return new ClassTransformer_GT_BaseMetaTileEntity(basicClass).getWriter().toByteArray();
}
-
+
//Fix log handling on the charcoal pit
- if (transformedName.equals("gregtech.common.tileentities.machines.multi.GT_MetaTileEntity_Charcoal_Pit")) {
+ if (transformedName.equals("gregtech.common.tileentities.machines.multi.GT_MetaTileEntity_Charcoal_Pit") && mConfig.enableGtCharcoalPitFix) {
FMLRelaunchLog.log("[GT++ ASM] GT Charcoal Pit Fix", Level.INFO, "Transforming %s", transformedName);
return new ClassTransformer_GT_CharcoalPit(basicClass, obfuscated).getWriter().toByteArray();
}
-
-
-
-
+
+
+
+
//Patching Meta Tile Tooltips
if (transformedName.equals("gregtech.common.blocks.GT_Item_Machines") && mConfig.enableGtTooltipFix) {
FMLRelaunchLog.log("[GT++ ASM] Gregtech Tooltip Patch", Level.INFO, "Transforming %s", transformedName);
@@ -203,7 +222,7 @@ public class Preloader_Transformer_Handler implements IClassTransformer {
}
return new ClassTransformer_GT_BlockMachines_MetaPipeEntity(basicClass, probablyShouldBeFalse, mode).getWriter().toByteArray();
}
-
+
String[] aIC2ClassNames = new String[] {
"ic2.core.block.BlockTileEntity",
"ic2.core.block.machine.BlockMachine",
@@ -230,24 +249,24 @@ public class Preloader_Transformer_Handler implements IClassTransformer {
return new ClassTransformer_IC2_GetHarvestTool(basicClass, obfuscated, transformedName).getWriter().toByteArray();
}
}
-
+
//Fix IC2 Hazmat
if (transformedName.equals("ic2.core.item.armor.ItemArmorHazmat")) {
FMLRelaunchLog.log("[GT++ ASM] IC2 Hazmat Patch", Level.INFO, "Transforming %s", transformedName);
return new ClassTransformer_IC2_Hazmat(basicClass, transformedName).getWriter().toByteArray();
}
-
+
//Fix Thaumcraft Shit
//Patching ItemWispEssence to allow invalid item handling
if (transformedName.equals("thaumcraft.common.items.ItemWispEssence") && mConfig.enableTcAspectSafety) {
FMLRelaunchLog.log("[GT++ ASM] Thaumcraft WispEssence_Patch", Level.INFO, "Transforming %s", transformedName);
return new ClassTransformer_TC_ItemWispEssence(basicClass, obfuscated).getWriter().toByteArray();
}
-
-
+
+
return basicClass;
}
-
-
+
+
}
diff --git a/src/Java/gtPlusPlus/xmod/bop/blocks/BOP_Block_Registrator.java b/src/Java/gtPlusPlus/xmod/bop/blocks/BOP_Block_Registrator.java
index f5e1d429f7..2ee1587809 100644
--- a/src/Java/gtPlusPlus/xmod/bop/blocks/BOP_Block_Registrator.java
+++ b/src/Java/gtPlusPlus/xmod/bop/blocks/BOP_Block_Registrator.java
@@ -41,9 +41,9 @@ public class BOP_Block_Registrator {
log_Rainforest = new LogRainforestTree();
leaves_Rainforest = new LeavesRainforestTree();
sapling_Rainforest = new SaplingRainforestTree();
- ItemUtils.addItemToOreDictionary(ItemUtils.getSimpleStack(log_Rainforest), "logWood");
- ItemUtils.addItemToOreDictionary(ItemUtils.getSimpleStack(leaves_Rainforest), "treeLeaves");
- ItemUtils.addItemToOreDictionary(ItemUtils.getSimpleStack(sapling_Rainforest), "treeSapling");
+ ItemUtils.addItemToOreDictionary(ItemUtils.getSimpleStack(log_Rainforest), "logWood", true);
+ ItemUtils.addItemToOreDictionary(ItemUtils.getSimpleStack(leaves_Rainforest), "treeLeaves", true);
+ ItemUtils.addItemToOreDictionary(ItemUtils.getSimpleStack(sapling_Rainforest), "treeSapling", true);
return true;
}
diff --git a/src/Java/gtPlusPlus/xmod/bop/blocks/base/LeavesBase.java b/src/Java/gtPlusPlus/xmod/bop/blocks/base/LeavesBase.java
index 7a40ab154d..264aaa2a20 100644
--- a/src/Java/gtPlusPlus/xmod/bop/blocks/base/LeavesBase.java
+++ b/src/Java/gtPlusPlus/xmod/bop/blocks/base/LeavesBase.java
@@ -37,7 +37,7 @@ public class LeavesBase extends BlockLeaves {
String blockName = "block"+Utils.sanitizeString(blockNameLocalized)+"Leaves";
GameRegistry.registerBlock(this, ItemBlock.class, blockName);
this.setBlockName(blockName);
- ItemUtils.addItemToOreDictionary(ItemUtils.getSimpleStack(this), "treeLeaves");
+ ItemUtils.addItemToOreDictionary(ItemUtils.getSimpleStack(this), "treeLeaves", true);
this.setCreativeTab(AddToCreativeTab.tabBOP);
LanguageRegistry.addName(this, blockNameLocalized+" Leaves");
Blocks.fire.setFireInfo(this, 80, 150);
diff --git a/src/Java/gtPlusPlus/xmod/bop/blocks/base/LogBase.java b/src/Java/gtPlusPlus/xmod/bop/blocks/base/LogBase.java
index 976361a01b..8e8ca0ed0a 100644
--- a/src/Java/gtPlusPlus/xmod/bop/blocks/base/LogBase.java
+++ b/src/Java/gtPlusPlus/xmod/bop/blocks/base/LogBase.java
@@ -33,8 +33,8 @@ public abstract class LogBase extends BlockLog
String blockName = "block"+Utils.sanitizeString(blockNameLocalized)+"Log";
GameRegistry.registerBlock(this, ItemBlock.class, blockName);
this.setBlockName(blockName);
- ItemUtils.addItemToOreDictionary(ItemUtils.getSimpleStack(this), "log"+Utils.sanitizeString(blockNameLocalized));
- ItemUtils.addItemToOreDictionary(ItemUtils.getSimpleStack(this), "logWood");
+ ItemUtils.addItemToOreDictionary(ItemUtils.getSimpleStack(this), "log"+Utils.sanitizeString(blockNameLocalized), true);
+ ItemUtils.addItemToOreDictionary(ItemUtils.getSimpleStack(this), "logWood", true);
this.setCreativeTab(AddToCreativeTab.tabBOP);
LanguageRegistry.addName(this, blockNameLocalized);
Blocks.fire.setFireInfo(this, 20, 100);
diff --git a/src/Java/gtPlusPlus/xmod/bop/blocks/base/SaplingBase.java b/src/Java/gtPlusPlus/xmod/bop/blocks/base/SaplingBase.java
index 1aab5133dc..c039e1ebac 100644
--- a/src/Java/gtPlusPlus/xmod/bop/blocks/base/SaplingBase.java
+++ b/src/Java/gtPlusPlus/xmod/bop/blocks/base/SaplingBase.java
@@ -45,7 +45,7 @@ public class SaplingBase extends BlockSapling
String blockName = "block"+Utils.sanitizeString(blockNameLocalized);
GameRegistry.registerBlock(this, ItemBlock.class, blockName);
this.setBlockName(blockName);
- ItemUtils.addItemToOreDictionary(ItemUtils.getSimpleStack(this), "treeSapling");
+ ItemUtils.addItemToOreDictionary(ItemUtils.getSimpleStack(this), "treeSapling", true);
this.setCreativeTab(AddToCreativeTab.tabBOP);
LanguageRegistry.addName(this, blockNameLocalized);
}
diff --git a/src/Java/gtPlusPlus/xmod/cofh/HANDLER_COFH.java b/src/Java/gtPlusPlus/xmod/cofh/HANDLER_COFH.java
new file mode 100644
index 0000000000..7bce4ab173
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/cofh/HANDLER_COFH.java
@@ -0,0 +1,15 @@
+package gtPlusPlus.xmod.cofh;
+
+import gtPlusPlus.core.item.ModItems;
+import gtPlusPlus.core.item.general.RF2EU_Battery;
+import gtPlusPlus.core.lib.LoadedMods;
+
+public class HANDLER_COFH {
+
+ public static void initItems() {
+ if (LoadedMods.CoFHCore && (LoadedMods.IndustrialCraft2 || LoadedMods.IndustrialCraft2Classic)) {
+ ModItems.RfEuBattery = new RF2EU_Battery();
+ }
+ }
+
+}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/HANDLER_GT.java b/src/Java/gtPlusPlus/xmod/gregtech/HANDLER_GT.java
index 80839f0f64..663804bc81 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/HANDLER_GT.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/HANDLER_GT.java
@@ -50,6 +50,7 @@ import gtPlusPlus.xmod.gregtech.loaders.ProcessingElectricButcherKnife;
import gtPlusPlus.xmod.gregtech.loaders.ProcessingElectricLighter;
import gtPlusPlus.xmod.gregtech.loaders.ProcessingElectricSnips;
import gtPlusPlus.xmod.gregtech.loaders.ProcessingToolHeadChoocher;
+import gtPlusPlus.xmod.gregtech.loaders.misc.WoodCentrifuging;
import gtPlusPlus.xmod.gregtech.loaders.recipe.RecipeLoader_AlgaeFarm;
import gtPlusPlus.xmod.gregtech.recipes.RecipesToRemove;
import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechConduits;
@@ -145,6 +146,7 @@ public class HANDLER_GT {
convertPyroToCokeOven();
Meta_GT_Proxy.fixIC2FluidNames();
RecipeLoader_AlgaeFarm.generateRecipes();
+ WoodCentrifuging.processLogsForMethane();
}
private static void convertPyroToCokeOven() {
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java b/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java
index 28692e25cb..cd4b0947e4 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java
@@ -39,6 +39,13 @@ public enum GregtechItemList implements GregtechItemContainer {
Emitter_ULV,
Sensor_ULV,
+ // Mixed Components
+ TransmissionComponent_ULV, TransmissionComponent_LV,
+ TransmissionComponent_MV, TransmissionComponent_HV,
+ TransmissionComponent_EV, TransmissionComponent_IV,
+ TransmissionComponent_LuV, TransmissionComponent_ZPM,
+ TransmissionComponent_UV, TransmissionComponent_MAX,
+
//Recipe Circuit
Circuit_BioRecipeSelector,
@@ -148,6 +155,9 @@ public enum GregtechItemList implements GregtechItemContainer {
Industrial_Centrifuge,
Casing_Centrifuge1,
+ // Large Alloy Smelter
+ Industrial_AlloySmelter,
+
//Coke Oven
Industrial_CokeOven,
Casing_CokeOven,
@@ -517,6 +527,8 @@ public enum GregtechItemList implements GregtechItemContainer {
//512v Creative Buffer
Energy_Buffer_CREATIVE,
+ //Variable voltage RF convertor
+ Energy_Buffer_RF_Convertor,
//Energy Buffers
Energy_Buffer_1by1_ULV, Energy_Buffer_1by1_LV,
Energy_Buffer_1by1_MV, Energy_Buffer_1by1_HV,
@@ -625,7 +637,9 @@ public enum GregtechItemList implements GregtechItemContainer {
FakeMachineCasingPlate_MV, FakeMachineCasingPlate_HV,
FakeMachineCasingPlate_EV, FakeMachineCasingPlate_IV,
FakeMachineCasingPlate_LuV, FakeMachineCasingPlate_ZPM,
- FakeMachineCasingPlate_UV, FakeMachineCasingPlate_MAX,
+ FakeMachineCasingPlate_UV, FakeMachineCasingPlate_MAX,
+
+
//----------------------------------------------------------------------------
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 83f052a983..cb889e0233 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
@@ -271,7 +271,7 @@ public interface IGregtech_RecipeAdder {
public boolean addUvLaserRecipe(ItemStack aInput1, ItemStack aInput2, ItemStack aOutput, int time, long eu);
public boolean addIrLaserRecipe(ItemStack aInput1, ItemStack aInput2, ItemStack aOutput, int time, long eu);
- public boolean addFluidReactorRecipe(ItemStack[] aInputs, FluidStack[] aInputFluids, ItemStack[] aOutputs, FluidStack[] aFluidOutputs, int time, long eu, int aTier);
+ public boolean addChemicalPlantRecipe(ItemStack[] aInputs, FluidStack[] aInputFluids, ItemStack[] aOutputs, FluidStack[] aFluidOutputs, int time, long eu, int aTier);
public boolean addBlastRecipe(ItemStack[] aInputs, FluidStack[] aInputFluids, ItemStack[] aOutputs, FluidStack[] aFluidOutputs, int time, long eu, int aHeat);
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/items/Gregtech_MetaItem_X32.java b/src/Java/gtPlusPlus/xmod/gregtech/api/items/Gregtech_MetaItem_X32.java
index ef92f9919d..a5430846a9 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/api/items/Gregtech_MetaItem_X32.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/items/Gregtech_MetaItem_X32.java
@@ -192,22 +192,9 @@ public abstract class Gregtech_MetaItem_X32 extends Gregtech_MetaItem {
@Override
public int getColorFromItemStack(final ItemStack stack, int HEX_OxFFFFFF) {
- if (stack.getDisplayName().contains("ULV")){
- HEX_OxFFFFFF = Utils.rgbtoHexValue(200, 180, 180);
- }
- else if (stack.getDisplayName().contains("LuV")){
- HEX_OxFFFFFF = 0xffffcc;
- }
- else if (stack.getDisplayName().contains("ZPM")){
- HEX_OxFFFFFF = 0xffe600;
- }
- else if (stack.getDisplayName().contains("UV")){
- HEX_OxFFFFFF = 0xffb300;
- }
- else if (stack.getDisplayName().contains("MAX")){
- HEX_OxFFFFFF = Utils.rgbtoHexValue(MathUtils.randInt(220, 250), MathUtils.randInt(221, 251), MathUtils.randInt(220, 250));
- }
- else if (stack.getDisplayName().contains("Sodium")){
+
+ int aMeta = stack.getItemDamage();
+ if (stack.getDisplayName().contains("Sodium")){
HEX_OxFFFFFF = Utils.rgbtoHexValue(90, 90, 255);
}
else if (stack.getDisplayName().contains("Cadmium")){
@@ -228,8 +215,28 @@ public abstract class Gregtech_MetaItem_X32 extends Gregtech_MetaItem {
else if (stack.getDisplayName().contains("Invar")){
HEX_OxFFFFFF = Utils.rgbtoHexValue(180, 180, 120);
}
- else {
- HEX_OxFFFFFF = 0xffffff;
+ else {
+ if (aMeta > 50 && aMeta != 150) {
+ HEX_OxFFFFFF = 0xffffff;
+ }
+ else if (stack.getDisplayName().contains("ULV")){
+ HEX_OxFFFFFF = Utils.rgbtoHexValue(200, 180, 180);
+ }
+ else if (stack.getDisplayName().contains("LuV")){
+ HEX_OxFFFFFF = 0xffffcc;
+ }
+ else if (stack.getDisplayName().contains("ZPM")){
+ HEX_OxFFFFFF = 0xffe600;
+ }
+ else if (stack.getDisplayName().contains("UV")){
+ HEX_OxFFFFFF = 0xffb300;
+ }
+ else if (stack.getDisplayName().contains("MAX")){
+ HEX_OxFFFFFF = Utils.rgbtoHexValue(MathUtils.randInt(220, 250), MathUtils.randInt(221, 251), MathUtils.randInt(220, 250));
+ }
+ else {
+ HEX_OxFFFFFF = 0xffffff;
+ }
}
return HEX_OxFFFFFF;
}
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 f41efe602a..ef5429af62 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
@@ -99,9 +99,8 @@ public abstract class GregtechMeta_MultiBlockBase extends GT_MetaTileEntity_Mult
try {
calculatePollutionReduction = GT_MetaTileEntity_Hatch_Muffler.class.getDeclaredMethod("calculatePollutionReduction", int.class);
- } catch (NoSuchMethodException | SecurityException e) {}
-
- mCustomBehviours = new HashMap<String, SpecialMultiBehaviour>();
+ }
+ catch (NoSuchMethodException | SecurityException e) {}
}
@@ -121,7 +120,7 @@ public abstract class GregtechMeta_MultiBlockBase extends GT_MetaTileEntity_Mult
public ArrayList<GT_MetaTileEntity_Hatch_OutputBattery> mDischargeHatches = new ArrayList<GT_MetaTileEntity_Hatch_OutputBattery>();
// Custom Behaviour Map
- private static final HashMap<String, SpecialMultiBehaviour> mCustomBehviours;
+ private static final HashMap<String, SpecialMultiBehaviour> mCustomBehviours = new HashMap<String, SpecialMultiBehaviour>();;
public GregtechMeta_MultiBlockBase(final int aID, final String aName,
@@ -416,7 +415,8 @@ public abstract class GregtechMeta_MultiBlockBase extends GT_MetaTileEntity_Mult
aToolTip = ArrayUtils.addAll(aToolTip, x);
aToolTip = ArrayUtils.addAll(aToolTip, z);
- if (aCachedToolTip == null || aCachedToolTip.length <= 0) {
+ //Valid Cached Tooltip during Run-Time
+ if (aCachedToolTip == null || aCachedToolTip.length <= 0 || aCachedToolTip.length != aToolTip.length || this.mTotalRunTime % 100 == 0) {
aCachedToolTip = aToolTip;
}
return aCachedToolTip;
@@ -472,11 +472,11 @@ public abstract class GregtechMeta_MultiBlockBase extends GT_MetaTileEntity_Mult
public String getSound() { return ""; }
- public boolean canBufferOutputs(final GT_Recipe aRecipe, int aParallelRecipes) {
+ public int canBufferOutputs(final GT_Recipe aRecipe, int aParallelRecipes) {
return canBufferOutputs(aRecipe, aParallelRecipes, true);
}
- public boolean canBufferOutputs(final GT_Recipe aRecipe, int aParallelRecipes, boolean aAllow16SlotWithoutCheck) {
+ public int canBufferOutputs(final GT_Recipe aRecipe, int aParallelRecipes, boolean aAllow16SlotWithoutCheck) {
Logger.INFO("Determining if we have space to buffer outputs. Parallel: "+aParallelRecipes);
@@ -485,11 +485,11 @@ public abstract class GregtechMeta_MultiBlockBase extends GT_MetaTileEntity_Mult
// Do it anyway, provided the multi allows it. Default behaviour is aAllow16SlotWithoutCheck = true.
if (aRecipe == null || aRecipe.mOutputs.length > 16) {
if (aRecipe == null) {
- return false;
+ return 0;
}
else if (aRecipe.mOutputs.length > 16) {
if (aAllow16SlotWithoutCheck) {
- return true;
+ return aParallelRecipes;
}
else {
// Do nothing, we want to check this recipe properly.
@@ -626,9 +626,14 @@ public abstract class GregtechMeta_MultiBlockBase extends GT_MetaTileEntity_Mult
// We have stacks that did not merge, do we have space for them?
if (aInputMap.size() > 0) {
if (aInputMap.size() > aInputBusSlotsFree) {
+ aParallelRecipes = (int) Math.floor((double) aInputBusSlotsFree/aInputMap.size() * aParallelRecipes);
// We do not have enough free slots in total to accommodate the remaining managed stacks.
- Logger.INFO("Failed to find enough space for all item outputs. Free: "+aInputBusSlotsFree+", Required: "+aInputMap.size());
- return false;
+ Logger.INFO(" Free: "+aInputBusSlotsFree+", Required: "+aInputMap.size());
+ if(aParallelRecipes == 0) {
+ Logger.INFO("Failed to find enough space for all item outputs.");
+ return 0;
+ }
+
}
}
@@ -656,7 +661,7 @@ public abstract class GregtechMeta_MultiBlockBase extends GT_MetaTileEntity_Mult
int aEmptyFluidHatches = 0;
int aFullFluidHatches = 0;
// Create Map for Fluid Output
- ConcurrentHashSet<Triplet<GT_MetaTileEntity_Hatch_Output, FluidStack, Integer>> aOutputHatches = new ConcurrentHashSet<Triplet<GT_MetaTileEntity_Hatch_Output, FluidStack, Integer>>();
+ ArrayList<Triplet<GT_MetaTileEntity_Hatch_Output, FluidStack, Integer>> aOutputHatches = new ArrayList<Triplet<GT_MetaTileEntity_Hatch_Output, FluidStack, Integer>>();
for (final GT_MetaTileEntity_Hatch_Output tBus : this.mOutputHatches) {
if (!isValidMetaTileEntity(tBus)) {
continue;
@@ -672,32 +677,36 @@ public abstract class GregtechMeta_MultiBlockBase extends GT_MetaTileEntity_Mult
}
}
// Create a map of all the fluids we would like to output, we can iterate over this and see how many we can merge into existing hatch stacks.
- ConcurrentHashSet<FluidStack> aOutputFluids = new ConcurrentHashSet<FluidStack>();
+ ArrayList<FluidStack> aOutputFluids = new ArrayList<FluidStack>();
// Ugly ass boxing
aOutputFluids.addAll(new AutoMap<FluidStack>(aRecipe.mFluidOutputs));
// Iterate the Hatches, updating their 'stored' data.
- aHatchIterator: for (Triplet<GT_MetaTileEntity_Hatch_Output, FluidStack, Integer> aHatchData : aOutputHatches) {
+ //for (Triplet<GT_MetaTileEntity_Hatch_Output, FluidStack, Integer> aHatchData : aOutputHatches) {
+ for (int i = 0;i<aOutputHatches.size();i++) {
// The Hatch Itself
- GT_MetaTileEntity_Hatch_Output aHatch = aHatchData.getValue_1();
+ GT_MetaTileEntity_Hatch_Output aHatch = aOutputHatches.get(i).getValue_1();
// Fluid in the Hatch
- FluidStack aHatchStack = aHatchData.getValue_2();
+ FluidStack aHatchStack = aOutputHatches.get(i).getValue_2();
// Space left in Hatch
- int aSpaceLeftInHatch = aHatch.getCapacity() - aHatch.getFluidAmount();
+ int aSpaceLeftInHatch = aHatch.getCapacity() - aHatch.getFluidAmount();
// Hatch is full,
if (aSpaceLeftInHatch <= 0) {
aFullFluidHatches++;
- aOutputHatches.remove(aHatchData);
- continue aHatchIterator;
- }
+ aOutputHatches.remove(aOutputHatches.get(i));
+ i--;
+ continue;
+ }
// Hatch has space
- else {
+ else {
// Check if any fluids match
- aFluidMatch: for (FluidStack aOutputStack : aOutputFluids) {
- if (GT_Utility.areFluidsEqual(aHatchStack, aOutputStack)) {
- int aFluidToPutIntoHatch = aOutputStack.amount;
+ //aFluidMatch: for (FluidStack aOutputStack : aOutputFluids) {
+ for(int j = 0;j<aOutputFluids.size();j++) {
+ //log(" aHatchStack "+aHatchStack.getLocalizedName()+" aOutput stack "+aOutputStack.getLocalizedName());
+ if (GT_Utility.areFluidsEqual(aHatchStack, aOutputFluids.get(j))) {
+ int aFluidToPutIntoHatch = aOutputFluids.get(j).amount * aParallelRecipes;
// Not Enough space to insert all of the fluid.
// We fill this hatch and add a smaller Fluidstack back to the iterator.
- if (aSpaceLeftInHatch < aFluidToPutIntoHatch) {
+ if (aSpaceLeftInHatch < aFluidToPutIntoHatch) {
// Copy existing Hatch Stack
FluidStack aNewHatchStack = aHatchStack.copy();
aNewHatchStack.amount = 0;
@@ -710,51 +719,57 @@ public abstract class GregtechMeta_MultiBlockBase extends GT_MetaTileEntity_Mult
aNewHatchStack.amount = aHatch.getCapacity();
aNewOutputStack.amount = aFluidLeftAfterInsert;
// Remove fluid from output list, merge success
- aOutputFluids.remove(aOutputStack);
+ aOutputFluids.remove(aOutputFluids.get(j));
+ j--;
// Remove hatch from hatch list, data is now invalid.
- aOutputHatches.remove(aHatchData);
+ aOutputHatches.remove(aOutputHatches.get(i));
+ i--;
// Add remaining Fluid to Output list
aOutputFluids.add(aNewOutputStack);
// Re-add hatch to hatch list, with new data.
- Triplet<GT_MetaTileEntity_Hatch_Output, FluidStack, Integer> aNewHatchData = new Triplet<GT_MetaTileEntity_Hatch_Output, FluidStack, Integer>(aHatch, aNewHatchStack, aNewHatchStack.amount);
- aOutputHatches.add(aNewHatchData);
- continue aHatchIterator;
+ //Triplet<GT_MetaTileEntity_Hatch_Output, FluidStack, Integer> aNewHatchData = new Triplet<GT_MetaTileEntity_Hatch_Output, FluidStack, Integer>(aHatch, aNewHatchStack, aNewHatchStack.amount);
+ //aOutputHatches.add(aNewHatchData);
+ break;
}
// We can fill this hatch perfectly (rare case), may as well add it directly to the full list.
else if (aSpaceLeftInHatch == aFluidToPutIntoHatch) {
// Copy Old Stack
FluidStack aNewHatchStack = aHatchStack.copy();
// Add in amount from output stack
- aNewHatchStack.amount += aOutputStack.amount;
+ aNewHatchStack.amount += aFluidToPutIntoHatch;
// Remove fluid from output list, merge success
- aOutputFluids.remove(aOutputStack);
+ aOutputFluids.remove(aOutputFluids.get(j));
+ j--;
// Remove hatch from hatch list, data is now invalid.
- aOutputHatches.remove(aHatchData);
+ aOutputHatches.remove(aOutputHatches.get(i));
+ i--;
// Re-add hatch to hatch list, with new data.
Triplet<GT_MetaTileEntity_Hatch_Output, FluidStack, Integer> aNewHatchData = new Triplet<GT_MetaTileEntity_Hatch_Output, FluidStack, Integer>(aHatch, aNewHatchStack, aNewHatchStack.amount);
aOutputHatches.add(aNewHatchData);
- continue aHatchIterator;
+ break;
}
// We have more space than we need to merge, so we remove the stack from the output list and update the hatch list.
- else {
+ else {
// Copy Old Stack
FluidStack aNewHatchStack = aHatchStack.copy();
// Add in amount from output stack
- aNewHatchStack.amount += aOutputStack.amount;
+ aNewHatchStack.amount += aFluidToPutIntoHatch;
// Remove fluid from output list, merge success
- aOutputFluids.remove(aOutputStack);
+ aOutputFluids.remove(aOutputFluids.get(j));
+ j--;
// Remove hatch from hatch list, data is now invalid.
- aOutputHatches.remove(aHatchData);
+ aOutputHatches.remove(aOutputHatches.get(i));
+ i--;
// Re-add hatch to hatch list, with new data.
Triplet<GT_MetaTileEntity_Hatch_Output, FluidStack, Integer> aNewHatchData = new Triplet<GT_MetaTileEntity_Hatch_Output, FluidStack, Integer>(aHatch, aNewHatchStack, aNewHatchStack.amount);
aOutputHatches.add(aNewHatchData);
// Check next fluid
- continue aFluidMatch;
+ continue;
}
}
else {
- continue aFluidMatch;
+ continue;
}
}
}
@@ -768,11 +783,14 @@ public abstract class GregtechMeta_MultiBlockBase extends GT_MetaTileEntity_Mult
}
// We have Fluid Stacks we did not merge. Do we have space?
+ Logger.INFO("fluids to output "+aOutputFluids.size()+" empty hatches "+aEmptyFluidHatches);
if (aOutputFluids.size() > 0) {
// Not enough space to add fluids.
if (aOutputFluids.size() > aEmptyFluidHatches) {
- Logger.INFO("Failed to find enough space for all fluid outputs.");
- return false;
+ aParallelRecipes = (int) Math.floor((double) aEmptyFluidHatches/aOutputFluids.size() * aParallelRecipes);
+ Logger.INFO("Failed to find enough space for all fluid outputs. Free: "+aEmptyFluidHatches+", Required: "+aOutputFluids.size());
+ return 0;
+
}
}
@@ -781,7 +799,7 @@ public abstract class GregtechMeta_MultiBlockBase extends GT_MetaTileEntity_Mult
*/
}
- return true;
+ return aParallelRecipes;
}
/**
@@ -1034,7 +1052,7 @@ public abstract class GregtechMeta_MultiBlockBase extends GT_MetaTileEntity_Mult
*/
// First populate the map if we need to.
- if (mCustomBehviours == null || mCustomBehviours.isEmpty()) {
+ if (mCustomBehviours.isEmpty()) {
mCustomBehviours.putAll(Multiblock_API.getSpecialBehaviourItemMap());
}
@@ -1071,8 +1089,9 @@ public abstract class GregtechMeta_MultiBlockBase extends GT_MetaTileEntity_Mult
}
}
}
-
- if (!this.canBufferOutputs(tRecipe, aMaxParallelRecipes)) {
+
+ aMaxParallelRecipes = this.canBufferOutputs(tRecipe, aMaxParallelRecipes);
+ if (aMaxParallelRecipes == 0) {
log("BAD RETURN - 2");
return false;
}
@@ -1379,7 +1398,8 @@ public abstract class GregtechMeta_MultiBlockBase extends GT_MetaTileEntity_Mult
return false;
}
- if (!this.canBufferOutputs(tRecipe, aMaxParallelRecipes)) {
+ aMaxParallelRecipes = this.canBufferOutputs(tRecipe, aMaxParallelRecipes);
+ if (aMaxParallelRecipes == 0) {
log("BAD RETURN - 2");
return false;
}
@@ -1553,7 +1573,8 @@ public abstract class GregtechMeta_MultiBlockBase extends GT_MetaTileEntity_Mult
this.mDischargeHatches.clear();
this.mControlCoreBus.clear();
this.mAirIntakes.clear();
- this.mMultiDynamoHatches.clear();
+ this.mTecTechEnergyHatches.clear();
+ this.mTecTechDynamoHatches.clear();
}
}
@@ -1578,7 +1599,14 @@ public abstract class GregtechMeta_MultiBlockBase extends GT_MetaTileEntity_Mult
tTileEntity = localIterator.next();
}
tTileEntity = null;
- for (final Iterator<GT_MetaTileEntity_Hatch> localIterator = this.mMultiDynamoHatches
+ for (final Iterator<GT_MetaTileEntity_Hatch> localIterator = this.mTecTechDynamoHatches
+ .iterator(); localIterator.hasNext(); tTileEntity
+ .getBaseMetaTileEntity()
+ .doExplosion(gregtech.api.enums.GT_Values.V[8])) {
+ tTileEntity = localIterator.next();
+ }
+ tTileEntity = null;
+ for (final Iterator<GT_MetaTileEntity_Hatch> localIterator = this.mTecTechEnergyHatches
.iterator(); localIterator.hasNext(); tTileEntity
.getBaseMetaTileEntity()
.doExplosion(gregtech.api.enums.GT_Values.V[8])) {
@@ -1870,10 +1898,16 @@ public abstract class GregtechMeta_MultiBlockBase extends GT_MetaTileEntity_Mult
aDidAdd = addToMachineListInternal(mDischargeHatches, aMetaTileEntity, aBaseCasingIndex);
}
+ //Handle TT Multi-A Energy Hatches
+ else if (LoadedMods.TecTech && isThisHatchMultiEnergy(aMetaTileEntity)) {
+ log("Found isThisHatchMultiEnergy");
+ aDidAdd = addToMachineListInternal(mTecTechEnergyHatches, aMetaTileEntity, aBaseCasingIndex);
+ }
+
//Handle TT Multi-A Dynamos
else if (LoadedMods.TecTech && isThisHatchMultiDynamo(aMetaTileEntity)) {
log("Found isThisHatchMultiDynamo");
- aDidAdd = addToMachineListInternal(mMultiDynamoHatches, aMetaTileEntity, aBaseCasingIndex);
+ aDidAdd = addToMachineListInternal(mTecTechDynamoHatches, aMetaTileEntity, aBaseCasingIndex);
}
//Handle Fluid Hatches using seperate logic
@@ -2126,10 +2160,16 @@ public abstract class GregtechMeta_MultiBlockBase extends GT_MetaTileEntity_Mult
/**
- * This is the array Used to Store the Tectech Multi-Amp hatches.
+ * This is the array Used to Store the Tectech Multi-Amp Dynamo hatches.
+ */
+
+ public ArrayList<GT_MetaTileEntity_Hatch> mTecTechDynamoHatches = new ArrayList<GT_MetaTileEntity_Hatch>();
+
+ /**
+ * This is the array Used to Store the Tectech Multi-Amp Energy hatches.
*/
- public ArrayList<GT_MetaTileEntity_Hatch> mMultiDynamoHatches = new ArrayList<GT_MetaTileEntity_Hatch>();
+ public ArrayList<GT_MetaTileEntity_Hatch> mTecTechEnergyHatches = new ArrayList<GT_MetaTileEntity_Hatch>();
/**
* TecTech Multi-Amp Dynamo Support
@@ -2149,12 +2189,11 @@ public abstract class GregtechMeta_MultiBlockBase extends GT_MetaTileEntity_Mult
}
if (isThisHatchMultiDynamo(aTileEntity)) {
updateTexture(aTileEntity, aBaseCasingIndex);
- return this.mMultiDynamoHatches.add((GT_MetaTileEntity_Hatch) aMetaTileEntity);
+ return this.mTecTechDynamoHatches.add((GT_MetaTileEntity_Hatch) aMetaTileEntity);
}
return false;
}
- @SuppressWarnings("rawtypes")
public boolean isThisHatchMultiDynamo(Object aMetaTileEntity){
Class<?> mDynamoClass;
mDynamoClass = ReflectionUtils.getClass("com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_DynamoMulti");
@@ -2170,12 +2209,58 @@ public abstract class GregtechMeta_MultiBlockBase extends GT_MetaTileEntity_Mult
public boolean addDynamoToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) {
if (LoadedMods.TecTech){
if (isThisHatchMultiDynamo(aTileEntity)) {
- addMultiAmpDynamoToMachineList(aTileEntity, aBaseCasingIndex);
+ return addMultiAmpDynamoToMachineList(aTileEntity, aBaseCasingIndex);
}
}
return super.addDynamoToMachineList(aTileEntity, aBaseCasingIndex);
}
+
+
+ /**
+ * TecTech Multi-Amp Energy Hatch Support
+ * @param aTileEntity - The Energy Hatch
+ * @param aBaseCasingIndex - Casing Texture
+ * @return
+ */
+
+ public boolean addMultiAmpEnergyToMachineList(final IGregTechTileEntity aTileEntity, final int aBaseCasingIndex){
+ //GT_MetaTileEntity_Hatch_DynamoMulti
+ if (aTileEntity == null) {
+ return false;
+ }
+ final IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity();
+ if (aMetaTileEntity == null) {
+ return false;
+ }
+ if (isThisHatchMultiEnergy(aTileEntity)) {
+ updateTexture(aTileEntity, aBaseCasingIndex);
+ return this.mTecTechEnergyHatches.add((GT_MetaTileEntity_Hatch) aMetaTileEntity);
+ }
+ return false;
+ }
+
+ public boolean isThisHatchMultiEnergy(Object aMetaTileEntity){
+ Class<?> mDynamoClass;
+ mDynamoClass = ReflectionUtils.getClass("com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_EnergyMulti");
+ if (mDynamoClass != null){
+ if (mDynamoClass.isInstance(aMetaTileEntity)){
+ return true;
+ }
+ }
+ return false;
+ }
+
+ @Override
+ public boolean addEnergyInputToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) {
+ if (LoadedMods.TecTech){
+ if (isThisHatchMultiEnergy(aTileEntity)) {
+ return addMultiAmpEnergyToMachineList(aTileEntity, aBaseCasingIndex);
+ }
+
+ }
+ return super.addEnergyInputToMachineList(aTileEntity, aBaseCasingIndex);
+ }
/**
@@ -2497,7 +2582,7 @@ public abstract class GregtechMeta_MultiBlockBase extends GT_MetaTileEntity_Mult
else if (aFoundBlock != aExpectedBlock) {
if (GTplusplus.CURRENT_LOAD_PHASE == INIT_PHASE.STARTED) {
log("A1 - Found: "+aFoundBlock.getLocalizedName()+":"+aFoundMeta+", Expected: "+aExpectedBlock.getLocalizedName()+":"+aExpectedMeta);
- log("Loc: "+(new BlockPos(aBaseMetaTileEntity).getLocationString()));
+ //log("Loc: "+(new BlockPos(aBaseMetaTileEntity).getLocationString()));
}
return false;
}
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 e72838fcad..6e33529b66 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
@@ -63,12 +63,12 @@ public abstract class GregtechRocketFuelGeneratorBase extends GT_MetaTileEntity_
String aPollution = "Causes between "+pollMin+" and "+pollMax+ " Pollution per second";
return new String[]{
this.mDescription,
- "Fuel Efficiency: " + this.getEfficiency()*2 + "%",
+ "Fuel Efficiency: " + this.getEfficiency() + "%",
aPollution};
}
return new String[]{
this.mDescription,
- "Fuel Efficiency: " + this.getEfficiency()*2 + "%"};
+ "Fuel Efficiency: " + this.getEfficiency() + "%"};
}
@@ -267,9 +267,8 @@ public abstract class GregtechRocketFuelGeneratorBase extends GT_MetaTileEntity_
final int tFuelValue = this.getFuelValue(this.mFluid), tConsumed = this.consumedFluidPerOperation(this.mFluid);
if ((tFuelValue > 0) && (tConsumed > 0) && (this.mFluid.amount >= tConsumed)) {
final long tFluidAmountToUse = Math.min(this.mFluid.amount / tConsumed, (((this.maxEUOutput() * 20) + this.getMinimumStoredEU()) - aBaseMetaTileEntity.getUniversalEnergyStored()) / tFuelValue);
- if ((tFluidAmountToUse > 0) && aBaseMetaTileEntity.increaseStoredEnergyUnits(tFluidAmountToUse * tFuelValue, true)){
+ if ((tFluidAmountToUse > 0) && aBaseMetaTileEntity.increaseStoredEnergyUnits(tFluidAmountToUse * tFuelValue, true)){
int aSafeFloor = (int) Math.max(((tFluidAmountToUse * tConsumed)/3), 1);
- //Logger.INFO("True consumption: "+toConsumeTrue+" | Consuming this tick? "+useFuel);
this.mFluid.amount -= (int) aSafeFloor;
PollutionUtils.addPollution(getBaseMetaTileEntity(), 10 * getPollution());
}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/Meta_GT_Proxy.java b/src/Java/gtPlusPlus/xmod/gregtech/common/Meta_GT_Proxy.java
index 430ae44d64..ef013fa3a2 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/Meta_GT_Proxy.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/Meta_GT_Proxy.java
@@ -1,16 +1,11 @@
package gtPlusPlus.xmod.gregtech.common;
-import static gtPlusPlus.xmod.gregtech.common.covers.GTPP_Cover_Overflow.mOverflowCache;
-
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
-import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
-import java.util.Timer;
-import java.util.TimerTask;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.common.registry.LanguageRegistry;
@@ -29,7 +24,6 @@ import gregtech.api.util.Recipe_GT;
import gregtech.common.GT_Proxy;
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.api.objects.data.AutoMap;
-import gtPlusPlus.api.objects.data.ObjMap;
import gtPlusPlus.api.objects.minecraft.FormattedTooltipString;
import gtPlusPlus.core.handler.AchievementHandler;
import gtPlusPlus.core.lib.CORE;
@@ -117,7 +111,6 @@ public class Meta_GT_Proxy {
}
public static void init() {
- scheduleCoverMapCleaner();
setValidHeatingCoilMetas();
PollutionUtils.setPollutionFluids();
fixIC2FluidNames();
@@ -435,47 +428,6 @@ public class Meta_GT_Proxy {
}
}
-
- public static void scheduleCoverMapCleaner(){
- TimerTask repeatedTask = new TimerTask() {
- public void run() {
- cleanupOverFlowCoverCache();
- }
- };
- Timer timer = new Timer("CoverCleanupManager");
- long delay = 120000L;
- long period = 300000L;
- timer.scheduleAtFixedRate(repeatedTask, delay, period);
- }
-
- public static int cleanupOverFlowCoverCache() {
- ObjMap<String, ?> cache = mOverflowCache;
- int aRemoved = 0;
- long aCurrentTime = System.currentTimeMillis()/1000;
- for (Object o : cache.values()) {
- if (o != null && o instanceof HashMap) {
- @SuppressWarnings("unchecked")
- HashMap<String, Object> m = (HashMap<String, Object>) o;
- if (m != null) {
- String s = (String) m.get("aCoverKey");
- if (m.containsKey("aLastUpdatedTime")) {
- long mapTime = (long) m.get("mLastUpdatedTime");
- if ((aCurrentTime-(mapTime/1000) > 30)){
- mOverflowCache.remove(s);
- aRemoved++;
- }
- }
- else {
- mOverflowCache.remove(s);
- aRemoved++;
- }
- }
- }
- }
- return aRemoved;
- }
-
-
static GT_Proxy[] mProxies = new GT_Proxy[2];
/**
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/StaticFields59.java b/src/Java/gtPlusPlus/xmod/gregtech/common/StaticFields59.java
index 814ed589f0..74e269e932 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/StaticFields59.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/StaticFields59.java
@@ -238,44 +238,51 @@ public class StaticFields59 {
return null;
}
- public static int getHeatingCapacityForCoil(Block aBlock, int aMeta) {
+
+
+ public static int getTierForCoil(Block aBlock, int aMeta) {
if (aBlock == GregTech_API.sBlockCasings1 && (aMeta >= 12 && aMeta <= 14)) {
- return getHeatingCapacityForCoilTier(aMeta == 12 ? 1 : aMeta == 13 ? 2 : 3);
+ return aMeta == 12 ? 1 : aMeta == 13 ? 2 : 3;
}
else if (aBlock == getBlockCasings5() && (aMeta >= 0 && aMeta <= 8)) {
- return getHeatingCapacityForCoilTier(aMeta);
+ return aMeta;
}
return 0;
}
+ public static int getHeatingCapacityForCoil(Block aBlock, int aMeta) {
+ int aTier = getTierForCoil(aBlock, aMeta);
+ return aTier > 0 ? getHeatingCapacityForCoilTier(aTier) : 0;
+ }
+
public static int getHeatingCapacityForCoilTier(int aCoilTier) {
int mHeatingCapacity = 0;
switch (aCoilTier) {
- case 0:
+ case 1:
mHeatingCapacity = 1800;
break;
- case 1:
+ case 2:
mHeatingCapacity = 2700;
break;
- case 2:
+ case 3:
mHeatingCapacity = 3600;
break;
- case 3:
+ case 4:
mHeatingCapacity = 4500;
break;
- case 4:
+ case 5:
mHeatingCapacity = 5400;
break;
- case 5:
+ case 6:
mHeatingCapacity = 7200;
break;
- case 6:
+ case 7:
mHeatingCapacity = 9000;
break;
- case 7:
+ case 8:
mHeatingCapacity = 9900;
break;
- case 8:
+ case 9:
mHeatingCapacity = 10800;
break;
default:
@@ -285,7 +292,6 @@ public class StaticFields59 {
if (CORE.GTNH && aCoilTier <= 6) {
mHeatingCapacity += 1;
}
-
return mHeatingCapacity;
}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/covers/GTPP_Cover_Overflow.java b/src/Java/gtPlusPlus/xmod/gregtech/common/covers/GTPP_Cover_Overflow.java
index b220dd74e8..1c1f9c20f9 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/covers/GTPP_Cover_Overflow.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/covers/GTPP_Cover_Overflow.java
@@ -1,13 +1,9 @@
package gtPlusPlus.xmod.gregtech.common.covers;
-import java.util.HashMap;
-
import gregtech.api.interfaces.tileentity.ICoverable;
-import gregtech.api.interfaces.tileentity.IMachineProgress;
import gregtech.api.util.GT_CoverBehavior;
import gregtech.api.util.GT_Utility;
-import gtPlusPlus.api.objects.Logger;
-import gtPlusPlus.api.objects.data.ObjMap;
+import gtPlusPlus.core.util.minecraft.LangUtils;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraftforge.common.util.ForgeDirection;
import net.minecraftforge.fluids.Fluid;
@@ -15,123 +11,90 @@ import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.fluids.IFluidHandler;
public class GTPP_Cover_Overflow extends GT_CoverBehavior {
+
+ public final int mTransferRate;
+ public final int mInitialTransferRate;
public final int mMaxTransferRate;
-
- public static final ObjMap<String, HashMap<String, Object>> mOverflowCache = new ObjMap<String, HashMap<String, Object>>(10000, 0.5f);
public GTPP_Cover_Overflow(int aTransferRate) {
- this.mMaxTransferRate = aTransferRate*1000;
+ this.mTransferRate = aTransferRate * 1000 / 10;
+ this.mInitialTransferRate = aTransferRate;
+ this.mMaxTransferRate = aTransferRate * 1000;
}
public int doCoverThings(byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity,
long aTimer) {
-
- HashMap<String, Object> aCoverData = getCover(aSide, aCoverID, aCoverVariable, aTileEntity);
- //Do things
-
- if (aCoverData != null) {
- if (aCoverData.containsKey("aCoverVariable"))
- return (int) aCoverData.get("aCoverVariable");
- }
-
-
- if (aCoverVariable % 6 > 1 && aTileEntity instanceof IMachineProgress
- && ((IMachineProgress) aTileEntity).isAllowedToWork() != aCoverVariable % 6 < 4) {
+ if (aCoverVariable == 0) {
return aCoverVariable;
- } else {
- if (aTileEntity instanceof IFluidHandler) {
- IFluidHandler tTank2 = aTileEntity.getITankContainerAtSide(aSide);
- if (tTank2 != null) {
- IFluidHandler tTank1 = (IFluidHandler) aTileEntity;
- FluidStack tLiquid;
- if (aCoverVariable % 2 == 0) {
- tLiquid = tTank1.drain(ForgeDirection.getOrientation(aSide), this.mMaxTransferRate, false);
- if (tLiquid != null) {
- tLiquid = tLiquid.copy();
- tLiquid.amount = tTank2.fill(ForgeDirection.getOrientation(aSide).getOpposite(), tLiquid,
- false);
- if (tLiquid.amount > 0) {
- if ((aCoverVariable % 2 == 0 || aSide != 1) && (aCoverVariable % 2 != 0 || aSide != 0)
- && aTileEntity.getUniversalEnergyCapacity() >= (long) Math.min(1,
- tLiquid.amount / 10)) {
- if (aTileEntity.isUniversalEnergyStored((long) Math.min(1, tLiquid.amount / 10))) {
- aTileEntity.decreaseStoredEnergyUnits((long) Math.min(1, tLiquid.amount / 10),
- true);
- tTank2.fill(ForgeDirection.getOrientation(aSide).getOpposite(), tTank1.drain(
- ForgeDirection.getOrientation(aSide), tLiquid.amount, true), true);
- }
- } else {
- tTank2.fill(ForgeDirection.getOrientation(aSide).getOpposite(),
- tTank1.drain(ForgeDirection.getOrientation(aSide), tLiquid.amount, true),
- true);
- }
- }
- }
- } else {
- tLiquid = tTank2.drain(ForgeDirection.getOrientation(aSide).getOpposite(), this.mMaxTransferRate,
- false);
- if (tLiquid != null) {
- tLiquid = tLiquid.copy();
- tLiquid.amount = tTank1.fill(ForgeDirection.getOrientation(aSide), tLiquid, false);
- if (tLiquid.amount > 0) {
- if ((aCoverVariable % 2 == 0 || aSide != 1) && (aCoverVariable % 2 != 0 || aSide != 0)
- && aTileEntity.getUniversalEnergyCapacity() >= (long) Math.min(1,
- tLiquid.amount / 10)) {
- if (aTileEntity.isUniversalEnergyStored((long) Math.min(1, tLiquid.amount / 10))) {
- aTileEntity.decreaseStoredEnergyUnits((long) Math.min(1, tLiquid.amount / 10),
- true);
- tTank1.fill(ForgeDirection.getOrientation(aSide),
- tTank2.drain(ForgeDirection.getOrientation(aSide).getOpposite(),
- tLiquid.amount, true),
- true);
- }
- } else {
- tTank1.fill(ForgeDirection.getOrientation(aSide),
- tTank2.drain(ForgeDirection.getOrientation(aSide).getOpposite(),
- tLiquid.amount, true),
- true);
- }
+ }
+ if ((aTileEntity instanceof IFluidHandler)) {
+ //Logger.INFO("Trying to Void via Overflow.");
+ IFluidHandler tTank1;
+ ForgeDirection directionFrom;
+ directionFrom = ForgeDirection.UNKNOWN;
+ tTank1 = (IFluidHandler) aTileEntity;
+ if (tTank1 != null) {
+ //Logger.INFO("Found Self. "+aSide);
+ //FluidStack aTankStack = tTank1.drain(ForgeDirection.UNKNOWN, 1, false);
+ FluidStack aTankStack = tTank1.getTankInfo(directionFrom)[0].fluid;
+ if (aTankStack != null) {
+ //Logger.INFO("Found Fluid inside self - "+aTankStack.getLocalizedName()+", overflow point set at "+aCoverVariable+"L and we have "+aTankStack.amount+"L inside.");
+ if (aTankStack.amount > aCoverVariable) {
+ int aAmountToDrain = aTankStack.amount - aCoverVariable;
+ //Logger.INFO("There is "+aAmountToDrain+" more fluid in the tank than we would like.");
+ if (aAmountToDrain > 0) {
+ FluidStack tLiquid = tTank1.drain(directionFrom, Math.abs(aAmountToDrain), true);
+ if (tLiquid != null) {
+ //Logger.INFO("Drained "+aAmountToDrain+"L.");
}
}
}
}
+ else {
+ //Logger.INFO("Could not simulate drain on self.");
+ }
}
-
- return aCoverVariable;
}
+ return aCoverVariable;
}
public int onCoverScrewdriverclick(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity,
EntityPlayer aPlayer, float aX, float aY, float aZ) {
-
-
- if ((double) aX > 0.375D && (double) aX < 0.625D || aSide <= 3 || (double) aY > 0.375D && (double) aY < 0.625D
- || (double) aZ <= 0.375D || (double) aZ >= 0.625D) {
- HashMap<String, Object> aCoverData = getCover(aSide, aCoverID, aCoverVariable, aTileEntity);
- float[] tCoords = GT_Utility.getClickedFacingCoords(aSide, aX, aY, aZ);
- switch ((byte) ((byte) ((int) (tCoords[0] * 2.0F)) + 2 * (byte) ((int) (tCoords[1] * 2.0F)))) {
- case 0 :
- aCoverVariable -= 1000;
- break;
- case 1 :
- aCoverVariable += 1000;
- break;
- case 2 :
- aCoverVariable -= 32000;
- break;
- case 3 :
- aCoverVariable += 32000;
- }
- aCoverData.remove("aCoverVariable");
- aCoverData.put("aCoverVariable", aCoverVariable);
- updateCoverMap(aCoverData);
-
+ if (GT_Utility.getClickedFacingCoords(aSide, aX, aY, aZ)[0] >= 0.5F) {
+ aCoverVariable += aPlayer.isSneaking() ? 4096 : 1024;
+ } else {
+ aCoverVariable -= aPlayer.isSneaking() ? 4096 : 1024;
}
- GT_Utility.sendChatToPlayer(aPlayer, "Overflow Limit: " + aCoverVariable);
-
+ if (aCoverVariable > mMaxTransferRate) {
+ aCoverVariable = mInitialTransferRate;
+ }
+ if (aCoverVariable <= 0) {
+ aCoverVariable = mInitialTransferRate;
+ }
+ GT_Utility.sendChatToPlayer(aPlayer, LangUtils.trans("009", "Overflow point: ") + aCoverVariable + trans("010", "L"));
return aCoverVariable;
}
+ public boolean onCoverRightclick(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity,
+ EntityPlayer aPlayer, float aX, float aY, float aZ) {
+ boolean aShift = aPlayer.isSneaking();
+ int aAmount = aShift ? 128 : 8;
+ if (GT_Utility.getClickedFacingCoords(aSide, aX, aY, aZ)[0] >= 0.5F) {
+ aCoverVariable += aAmount;
+ } else {
+ aCoverVariable -= aAmount;
+ }
+ if (aCoverVariable > mMaxTransferRate) {
+ aCoverVariable = mInitialTransferRate;
+ }
+ if (aCoverVariable <= 0) {
+ aCoverVariable = mInitialTransferRate;
+ }
+ GT_Utility.sendChatToPlayer(aPlayer, LangUtils.trans("009", "Overflow point: ") + aCoverVariable + trans("010", "L"));
+ aTileEntity.setCoverDataAtSide(aSide, aCoverVariable);
+ return true;
+ }
+
public boolean letsRedstoneGoIn(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) {
return true;
}
@@ -157,17 +120,11 @@ public class GTPP_Cover_Overflow extends GT_CoverBehavior {
}
public boolean letsFluidIn(byte aSide, int aCoverID, int aCoverVariable, Fluid aFluid, ICoverable aTileEntity) {
- return aCoverVariable > 1 && aTileEntity instanceof IMachineProgress
- && ((IMachineProgress) aTileEntity).isAllowedToWork() != aCoverVariable % 6 < 4
- ? false
- : aCoverVariable >= 6 || aCoverVariable % 2 != 0;
+ return false;
}
public boolean letsFluidOut(byte aSide, int aCoverID, int aCoverVariable, Fluid aFluid, ICoverable aTileEntity) {
- return aCoverVariable > 1 && aTileEntity instanceof IMachineProgress
- && ((IMachineProgress) aTileEntity).isAllowedToWork() != aCoverVariable % 6 < 4
- ? false
- : aCoverVariable >= 6 || aCoverVariable % 2 == 0;
+ return true;
}
public boolean alwaysLookConnected(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) {
@@ -175,39 +132,6 @@ public class GTPP_Cover_Overflow extends GT_CoverBehavior {
}
public int getTickRate(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) {
- return 1;
- }
-
- public HashMap<String, Object> getCover(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity){
- //Map this cover
- String aTileDataKey = "|"+aTileEntity.getXCoord()+"|"+aTileEntity.getYCoord()+"|"+aTileEntity.getZCoord()+"|"+aTileEntity.getWorld().provider.dimensionId+"|"+aSide+"|";
- HashMap<String, Object> aTileData;
- long aCurrentTime = System.currentTimeMillis();
- if (mOverflowCache.get(aTileDataKey) != null) {
- aTileData = mOverflowCache.get(aTileDataKey);
- aTileData.remove("aLastUpdatedTime");
- aTileData.put("aLastUpdateTime", aCurrentTime);
- //Logger.INFO("Found Existing Cover in Cache.");
- }
- else {
- aTileData = new HashMap<String, Object>();
- aTileData.put("aCoverKey", aTileDataKey);
- aTileData.put("aSide", aSide);
- aTileData.put("aCoverID", aCoverID);
- aTileData.put("aCoverVariable", aCoverVariable);
- aTileData.put("aLastUpdateTime", aCurrentTime);
- mOverflowCache.put(aTileDataKey, aTileData);
- Logger.INFO("Adding new Cover to Cache. Storing under key: "+aTileDataKey);
- }
- return aTileData;
- }
-
- public void updateCoverMap(HashMap<String, Object> aCoverData) {
- String mAccessKey = (String) aCoverData.get("aCoverKey");
- if (mOverflowCache.get(mAccessKey) != null) {
- mOverflowCache.remove(mAccessKey);
- }
- mOverflowCache.put(mAccessKey, aCoverData);
- return;
+ return 5;
}
-} \ No newline at end of file
+}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/covers/GTPP_Cover_Overflow2.java b/src/Java/gtPlusPlus/xmod/gregtech/common/covers/GTPP_Cover_Overflow2.java
deleted file mode 100644
index 8a378cf6ad..0000000000
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/covers/GTPP_Cover_Overflow2.java
+++ /dev/null
@@ -1,131 +0,0 @@
-package gtPlusPlus.xmod.gregtech.common.covers;
-
-import gregtech.api.interfaces.tileentity.ICoverable;
-import gregtech.api.util.GT_CoverBehavior;
-import gregtech.api.util.GT_Utility;
-import gtPlusPlus.core.util.minecraft.LangUtils;
-import gtPlusPlus.core.util.sys.KeyboardUtils;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraftforge.common.util.ForgeDirection;
-import net.minecraftforge.fluids.Fluid;
-import net.minecraftforge.fluids.FluidStack;
-import net.minecraftforge.fluids.IFluidHandler;
-
-public class GTPP_Cover_Overflow2 extends GT_CoverBehavior {
-
- public final int mTransferRate;
- public final int mInitialTransferRate;
- public final int mMaxTransferRate;
-
- public GTPP_Cover_Overflow2(int aTransferRate) {
- this.mTransferRate = aTransferRate * 1000 / 10;
- this.mInitialTransferRate = aTransferRate;
- this.mMaxTransferRate = aTransferRate * 1000;
- }
-
- public int doCoverThings(byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity,
- long aTimer) {
- if (aCoverVariable == 0) {
- return aCoverVariable;
- }
- if ((aTileEntity instanceof IFluidHandler)) {
- IFluidHandler tTank1;
- ForgeDirection directionFrom;
- directionFrom = ForgeDirection.UNKNOWN;
- if (aCoverVariable > 0) {
- tTank1 = (IFluidHandler) aTileEntity;
- } else {
- tTank1 = aTileEntity.getITankContainerAtSide(aSide);
- }
- if (tTank1 != null) {
- FluidStack aTankStack = tTank1.drain(ForgeDirection.UNKNOWN, 0, false);
- if (aTankStack != null) {
- if (aTankStack.amount > aCoverVariable) {
- int aAmountToDrain = aTankStack.amount - aCoverVariable;
- if (aAmountToDrain > 0) {
- FluidStack tLiquid = tTank1.drain(directionFrom, Math.abs(aAmountToDrain), false);
- }
- }
- }
- }
- }
- return aCoverVariable;
- }
-
- public int onCoverScrewdriverclick(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity,
- EntityPlayer aPlayer, float aX, float aY, float aZ) {
- if (GT_Utility.getClickedFacingCoords(aSide, aX, aY, aZ)[0] >= 0.5F) {
- aCoverVariable += aPlayer.isSneaking() ? 4096 : 1024;
- } else {
- aCoverVariable -= aPlayer.isSneaking() ? 4096 : 1024;
- }
- if (aCoverVariable > mMaxTransferRate) {
- aCoverVariable = mInitialTransferRate;
- }
- if (aCoverVariable <= 0) {
- aCoverVariable = mInitialTransferRate;
- }
- GT_Utility.sendChatToPlayer(aPlayer, LangUtils.trans("009", "Overflow point: ") + aCoverVariable + trans("010", "L/5T"));
- return aCoverVariable;
- }
-
- public boolean onCoverRightclick(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity,
- EntityPlayer aPlayer, float aX, float aY, float aZ) {
- boolean aShift = aPlayer.isSneaking();
- int aAmount = aShift ? 128 : 8;
- if (GT_Utility.getClickedFacingCoords(aSide, aX, aY, aZ)[0] >= 0.5F) {
- aCoverVariable += aAmount;
- } else {
- aCoverVariable -= aAmount;
- }
- if (aCoverVariable > mMaxTransferRate) {
- aCoverVariable = mInitialTransferRate;
- }
- if (aCoverVariable <= 0) {
- aCoverVariable = mInitialTransferRate;
- }
- GT_Utility.sendChatToPlayer(aPlayer, LangUtils.trans("009", "Overflow point: ") + aCoverVariable + trans("010", "L/5T"));
- aTileEntity.setCoverDataAtSide(aSide, aCoverVariable);
- return true;
- }
-
- public boolean letsRedstoneGoIn(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) {
- return true;
- }
-
- public boolean letsRedstoneGoOut(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) {
- return true;
- }
-
- public boolean letsEnergyIn(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) {
- return true;
- }
-
- public boolean letsEnergyOut(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) {
- return true;
- }
-
- public boolean letsItemsIn(byte aSide, int aCoverID, int aCoverVariable, int aSlot, ICoverable aTileEntity) {
- return true;
- }
-
- public boolean letsItemsOut(byte aSide, int aCoverID, int aCoverVariable, int aSlot, ICoverable aTileEntity) {
- return true;
- }
-
- public boolean letsFluidIn(byte aSide, int aCoverID, int aCoverVariable, Fluid aFluid, ICoverable aTileEntity) {
- return false;
- }
-
- public boolean letsFluidOut(byte aSide, int aCoverID, int aCoverVariable, Fluid aFluid, ICoverable aTileEntity) {
- return true;
- }
-
- public boolean alwaysLookConnected(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) {
- return true;
- }
-
- public int getTickRate(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) {
- return 5;
- }
-}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/items/MetaGeneratedGregtechItems.java b/src/Java/gtPlusPlus/xmod/gregtech/common/items/MetaGeneratedGregtechItems.java
index 97621203cd..5d4cf5ea94 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/items/MetaGeneratedGregtechItems.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/items/MetaGeneratedGregtechItems.java
@@ -2,20 +2,26 @@ package gtPlusPlus.xmod.gregtech.common.items;
import static gtPlusPlus.core.util.Utils.getTcAspectStack;
-import net.minecraft.item.EnumAction;
-import net.minecraft.item.ItemStack;
-
import gregtech.api.GregTech_API;
-import gregtech.api.enums.*;
+import gregtech.api.enums.GT_Values;
+import gregtech.api.enums.Materials;
+import gregtech.api.enums.OrePrefixes;
+import gregtech.api.enums.SubTag;
+import gregtech.api.enums.TC_Aspects;
+import gregtech.api.enums.Textures;
import gregtech.api.interfaces.ITexture;
-import gregtech.api.objects.*;
-import gregtech.api.util.*;
+import gregtech.api.objects.GT_MultiTexture;
+import gregtech.api.objects.GT_RenderedTexture;
+import gregtech.api.objects.ItemData;
+import gregtech.api.objects.MaterialStack;
+import gregtech.api.util.GT_FoodStat;
+import gregtech.api.util.GT_ModHandler;
+import gregtech.api.util.Recipe_GT;
import gregtech.common.covers.GT_Cover_Arm;
import gregtech.common.covers.GT_Cover_Conveyor;
import gregtech.common.covers.GT_Cover_Pump;
import gregtech.common.items.behaviors.Behaviour_DataOrb;
import gregtech.common.items.behaviors.Behaviour_DataStick;
-
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.handler.OldCircuitHandler;
import gtPlusPlus.core.lib.CORE;
@@ -29,8 +35,9 @@ import gtPlusPlus.xmod.gregtech.api.enums.GregtechOrePrefixes.GT_Materials;
import gtPlusPlus.xmod.gregtech.api.items.Gregtech_MetaItem_X32;
import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock;
import gtPlusPlus.xmod.gregtech.common.covers.GTPP_Cover_Overflow;
-import gtPlusPlus.xmod.gregtech.common.covers.GTPP_Cover_Overflow2;
import gtPlusPlus.xmod.gregtech.common.covers.GTPP_Cover_ToggleVisual;
+import net.minecraft.item.EnumAction;
+import net.minecraft.item.ItemStack;
public class MetaGeneratedGregtechItems extends Gregtech_MetaItem_X32 {
@@ -263,12 +270,12 @@ public class MetaGeneratedGregtechItems extends Gregtech_MetaItem_X32 {
GregtechItemList.Cover_Overflow_EV.set(this.addItem(75, "Overflow Valve (EV)", "Maximum void amount: 32768000", new Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, 1L), getTcAspectStack(TC_Aspects.MACHINA, 1L), getTcAspectStack(TC_Aspects.ITER, 1L), getTcAspectStack(TC_Aspects.AQUA, 1L)}));
GregtechItemList.Cover_Overflow_IV.set(this.addItem(76, "Overflow Valve (IV)", "Maximum void amount: 262144000", new Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, 1L), getTcAspectStack(TC_Aspects.MACHINA, 1L), getTcAspectStack(TC_Aspects.ITER, 1L), getTcAspectStack(TC_Aspects.AQUA, 1L)}));
- GregTech_API.registerCover(GregtechItemList.Cover_Overflow_ULV.get(1L), new GT_MultiTexture(new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[4][0], new GT_RenderedTexture(TexturesGtBlock.Overlay_Overflow_Valve)}), new GTPP_Cover_Overflow2(8));
- GregTech_API.registerCover(GregtechItemList.Cover_Overflow_LV.get(1L), new GT_MultiTexture(new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[4][0], new GT_RenderedTexture(TexturesGtBlock.Overlay_Overflow_Valve)}), new GTPP_Cover_Overflow2(64));
- GregTech_API.registerCover(GregtechItemList.Cover_Overflow_MV.get(1L), new GT_MultiTexture(new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[5][0], new GT_RenderedTexture(TexturesGtBlock.Overlay_Overflow_Valve)}), new GTPP_Cover_Overflow2(512));
- GregTech_API.registerCover(GregtechItemList.Cover_Overflow_HV.get(1L), new GT_MultiTexture(new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[5][0], new GT_RenderedTexture(TexturesGtBlock.Overlay_Overflow_Valve)}), new GTPP_Cover_Overflow2(4096));
- GregTech_API.registerCover(GregtechItemList.Cover_Overflow_EV.get(1L), new GT_MultiTexture(new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[8][0], new GT_RenderedTexture(TexturesGtBlock.Overlay_Overflow_Valve)}), new GTPP_Cover_Overflow2(32768));
- GregTech_API.registerCover(GregtechItemList.Cover_Overflow_IV.get(1L), new GT_MultiTexture(new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[8][0], new GT_RenderedTexture(TexturesGtBlock.Overlay_Overflow_Valve)}), new GTPP_Cover_Overflow2(262144));
+ GregTech_API.registerCover(GregtechItemList.Cover_Overflow_ULV.get(1L), new GT_MultiTexture(new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[4][0], new GT_RenderedTexture(TexturesGtBlock.Overlay_Overflow_Valve)}), new GTPP_Cover_Overflow(8));
+ GregTech_API.registerCover(GregtechItemList.Cover_Overflow_LV.get(1L), new GT_MultiTexture(new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[4][0], new GT_RenderedTexture(TexturesGtBlock.Overlay_Overflow_Valve)}), new GTPP_Cover_Overflow(64));
+ GregTech_API.registerCover(GregtechItemList.Cover_Overflow_MV.get(1L), new GT_MultiTexture(new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[5][0], new GT_RenderedTexture(TexturesGtBlock.Overlay_Overflow_Valve)}), new GTPP_Cover_Overflow(512));
+ GregTech_API.registerCover(GregtechItemList.Cover_Overflow_HV.get(1L), new GT_MultiTexture(new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[5][0], new GT_RenderedTexture(TexturesGtBlock.Overlay_Overflow_Valve)}), new GTPP_Cover_Overflow(4096));
+ GregTech_API.registerCover(GregtechItemList.Cover_Overflow_EV.get(1L), new GT_MultiTexture(new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[8][0], new GT_RenderedTexture(TexturesGtBlock.Overlay_Overflow_Valve)}), new GTPP_Cover_Overflow(32768));
+ GregTech_API.registerCover(GregtechItemList.Cover_Overflow_IV.get(1L), new GT_MultiTexture(new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[8][0], new GT_RenderedTexture(TexturesGtBlock.Overlay_Overflow_Valve)}), new GTPP_Cover_Overflow(262144));
//Fusion Reactor MK4 Singularity
GregtechItemList.Compressed_Fusion_Reactor.set(this.addItem(100, "Hypervisor Matrix (Fusion)", "A memory unit containing an RI (Restricted Intelligence)"));
@@ -339,7 +346,23 @@ public class MetaGeneratedGregtechItems extends Gregtech_MetaItem_X32 {
}
}
GregtechItemList.Laser_Lens_WoodsGlass.set(this.addItem(140, "Wood's Glass Lens", "Allows UV & IF to pass through, blocks visible light spectrums"));
-
+
+ int aStartID = 141;
+ GregtechItemList[] aTransParts = new GregtechItemList[] {
+ GregtechItemList.TransmissionComponent_ULV,
+ GregtechItemList.TransmissionComponent_LV,
+ GregtechItemList.TransmissionComponent_MV,
+ GregtechItemList.TransmissionComponent_HV,
+ GregtechItemList.TransmissionComponent_EV,
+ GregtechItemList.TransmissionComponent_IV,
+ GregtechItemList.TransmissionComponent_LuV,
+ GregtechItemList.TransmissionComponent_ZPM,
+ GregtechItemList.TransmissionComponent_UV,
+ GregtechItemList.TransmissionComponent_MAX,
+ };
+ for (int aIndex=0;aIndex<10;aIndex++){
+ aTransParts[aIndex].set(this.addItem(aStartID++, "Transmission Component ("+GT_Values.VN[aIndex]+")", "", new Object[]{getTcAspectStack(TC_Aspects.ELECTRUM, aIndex), getTcAspectStack(TC_Aspects.MACHINA, aIndex), getTcAspectStack(TC_Aspects.MAGNETO, aIndex)}));
+ }
}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/items/behaviours/Behaviour_Electric_Lighter.java b/src/Java/gtPlusPlus/xmod/gregtech/common/items/behaviours/Behaviour_Electric_Lighter.java
index a063d334bf..422a29c34e 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/items/behaviours/Behaviour_Electric_Lighter.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/items/behaviours/Behaviour_Electric_Lighter.java
@@ -1,6 +1,5 @@
package gtPlusPlus.xmod.gregtech.common.items.behaviours;
-import java.util.ArrayList;
import java.util.List;
import codechicken.lib.math.MathHelper;
@@ -63,7 +62,7 @@ public class Behaviour_Electric_Lighter extends Behaviour_None {
if (!aWorld.isRemote && aStack != null && aStack.stackSize == 1) {
if (aPlayer.isSneaking()) {
Logger.INFO("Changing Mode");
- boolean aCurrentMode = NBTUtils.getBoolean(aStack, "aFireballMod");
+ boolean aCurrentMode = NBTUtils.getBoolean(aStack, "aFireballMode");
Logger.INFO("Is currently in Fireball mode? "+aCurrentMode);
boolean aNewMode = Utils.invertBoolean(aCurrentMode);
Logger.INFO("Is now set to Fireball mode? "+aNewMode);
@@ -72,7 +71,7 @@ public class Behaviour_Electric_Lighter extends Behaviour_None {
PlayerUtils.messagePlayer(aPlayer, "Current Mode: "+EnumChatFormatting.RED+(aNewMode ? "Projectile" : "Fire Starter"));
}
else {
- boolean aCurrentMode = NBTUtils.getBoolean(aStack, "aFireballMod");
+ boolean aCurrentMode = NBTUtils.getBoolean(aStack, "aFireballMode");
if (aCurrentMode) {
//Shoot Lightning Attack
aWorld.playSoundAtEntity(aPlayer, "random.bow", 0.5F, 0.4F / (CORE.RANDOM.nextFloat() * 0.4F + 0.8F));
@@ -112,16 +111,16 @@ public class Behaviour_Electric_Lighter extends Behaviour_None {
if (!aWorld.isRemote && aStack != null && aStack.stackSize == 1) {
if (aPlayer.isSneaking()) {
Logger.INFO("Changing Mode");
- boolean aCurrentMode = NBTUtils.getBoolean(aStack, "aFireballMod");
+ boolean aCurrentMode = NBTUtils.getBoolean(aStack, "aFireballMode");
Logger.INFO("Is currently in Fireball mode? "+aCurrentMode);
boolean aNewMode = Utils.invertBoolean(aCurrentMode);
Logger.INFO("Is now set to Fireball mode? "+aNewMode);
- aStack.getTagCompound().setBoolean("aFireballMod", aNewMode);
+ aStack.getTagCompound().setBoolean("aFireballMode", aNewMode);
//NBTUtils.setBoolean(aStack, "aFireballMode", aNewMode);
PlayerUtils.messagePlayer(aPlayer, "Current Mode: "+EnumChatFormatting.RED+(aNewMode ? "Projectile" : "Fire Starter"));
}
else {
- boolean aCurrentMode = NBTUtils.getBoolean(aStack, "aFireballMod");
+ boolean aCurrentMode = NBTUtils.getBoolean(aStack, "aFireballMode");
if (aCurrentMode) {
//Shoot Lightning Attack
aWorld.playSoundAtEntity(aPlayer, "random.bow", 0.5F, 0.4F / (CORE.RANDOM.nextFloat() * 0.4F + 0.8F));
@@ -199,11 +198,14 @@ public class Behaviour_Electric_Lighter extends Behaviour_None {
}
}
boolean aCurrentMode;
+ if (!NBTUtils.hasTagCompound(aStack)) {
+ NBTUtils.createEmptyTagCompound(aStack);
+ }
if (NBTUtils.hasKey(aStack, "aFireballMode")) {
- aCurrentMode = NBTUtils.getBoolean(aStack, "aFireballMod");
+ aCurrentMode = NBTUtils.getBoolean(aStack, "aFireballMode");
}
else {
- aStack.getTagCompound().setBoolean("aFireballMod", false);
+ aStack.getTagCompound().setBoolean("aFireballMode", false);
aCurrentMode = false;
}
aList.add("Current Mode: "+EnumChatFormatting.RED+(aCurrentMode ? "Projectile" : "Fire Starter"));
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
new file mode 100644
index 0000000000..08356dd6ef
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_RfConvertor.java
@@ -0,0 +1,344 @@
+package gtPlusPlus.xmod.gregtech.common.tileentities.generators;
+
+import static gregtech.api.enums.GT_Values.V;
+
+import cofh.api.energy.IEnergyConnection;
+import cofh.api.energy.IEnergyHandler;
+import cofh.api.energy.IEnergyProvider;
+import cofh.api.energy.IEnergyReceiver;
+import cofh.api.energy.IEnergyStorage;
+import crazypants.enderio.machine.capbank.TileCapBank;
+import crazypants.enderio.machine.capbank.network.ICapBankNetwork;
+import crazypants.enderio.power.IPowerContainer;
+import gregtech.api.GregTech_API;
+import gregtech.api.enums.GT_Values;
+import gregtech.api.enums.Textures;
+import gregtech.api.interfaces.ITexture;
+import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import gregtech.api.objects.GT_RenderedTexture;
+import gregtech.api.util.GT_Utility;
+import gtPlusPlus.api.objects.Logger;
+import gtPlusPlus.core.lib.CORE;
+import gtPlusPlus.core.lib.LoadedMods;
+import gtPlusPlus.core.util.math.MathUtils;
+import gtPlusPlus.core.util.minecraft.PlayerUtils;
+import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock;
+import gtPlusPlus.xmod.gregtech.common.tileentities.storage.GregtechMetaEnergyBuffer;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.entity.player.InventoryPlayer;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.tileentity.TileEntity;
+import net.minecraft.util.EnumChatFormatting;
+import net.minecraftforge.common.util.ForgeDirection;
+
+/**
+ * NEVER INCLUDE THIS FILE IN YOUR MOD!!!
+ *
+ * This is the main construct for my Basic Machines such as the Automatic Extractor
+ * Extend this class to make a simple Machine
+ */
+public class GT_MetaTileEntity_RfConvertor extends GregtechMetaEnergyBuffer implements IEnergyReceiver {
+
+
+ public GT_MetaTileEntity_RfConvertor(final String aName, final int aTier,
+ final String aDescription, final ITexture[][][] aTextures, final int aSlotCount) {
+ super(aName, aTier, aDescription, aTextures, aSlotCount);
+ }
+
+ public GT_MetaTileEntity_RfConvertor(final int aID, final String aName,
+ final String aNameRegional, final int aTier, final String aDescription, final int aSlotCount) {
+ super(aID, aName, aNameRegional, aTier, aDescription, aSlotCount);
+ }
+
+ @Override
+ public String[] getDescription() {
+ return new String[] {"Use Screwdriver to change voltage", "Hold Shift while using Screwdriver to change amperage", EnumChatFormatting.DARK_AQUA+"Variable Output Voltage"};
+ }
+
+ @Override
+ public ITexture[][][] getTextureSet(ITexture[] aTextures) {
+ ITexture[][][] rTextures = new ITexture[12][17][];
+ GT_RenderedTexture aTex = new GT_RenderedTexture(TexturesGtBlock.Casing_Material_ZirconiumCarbide);
+ for (byte i = -1; i < 16; i++) {
+ rTextures[0][i + 1] = new ITexture[]{aTex, Textures.BlockIcons.OVERLAYS_ENERGY_OUT[mTier]};
+ rTextures[1][i + 1] = new ITexture[]{aTex, Textures.BlockIcons.OVERLAYS_ENERGY_OUT[mTier]};
+ rTextures[2][i + 1] = new ITexture[]{aTex, Textures.BlockIcons.OVERLAYS_ENERGY_OUT[mTier]};
+ rTextures[3][i + 1] = new ITexture[]{aTex, Textures.BlockIcons.OVERLAYS_ENERGY_IN_MULTI[mTier]};
+ rTextures[4][i + 1] = new ITexture[]{aTex, Textures.BlockIcons.OVERLAYS_ENERGY_IN_MULTI[mTier]};
+ rTextures[5][i + 1] = new ITexture[]{aTex, Textures.BlockIcons.OVERLAYS_ENERGY_IN_MULTI[mTier]};
+ rTextures[6][i + 1] = new ITexture[]{aTex, Textures.BlockIcons.OVERLAYS_ENERGY_IN[mTier]};
+ rTextures[7][i + 1] = new ITexture[]{aTex, Textures.BlockIcons.OVERLAYS_ENERGY_IN[mTier]};
+ rTextures[8][i + 1] = new ITexture[]{aTex, Textures.BlockIcons.OVERLAYS_ENERGY_IN[mTier]};
+ rTextures[9][i + 1] = new ITexture[]{aTex, Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[mTier]};
+ rTextures[10][i + 1] = new ITexture[]{aTex, Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[mTier]};
+ rTextures[11][i + 1] = new ITexture[]{aTex, Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[mTier]};
+ }
+ return rTextures;
+ }
+
+ @Override
+ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) {
+ return mTextures[Math.min(2, aSide) + (aSide == aFacing ? 3 : 0) + (aActive ? 0 : 6)][aColorIndex + 1];
+ }
+
+ @Override
+ public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
+ return new GT_MetaTileEntity_RfConvertor(this.mName, this.mTier, this.mDescription,
+ this.mTextures, this.mInventory.length);
+ }
+
+ @Override
+ public long getMinimumStoredEU() {
+ return 0;
+ }
+
+ @Override
+ public long maxEUStore() {
+ return Integer.MAX_VALUE;
+ }
+
+ @Override
+ public long maxEUInput() {
+ return 0;
+ }
+
+ @Override
+ public long maxEUOutput() {
+ return V[this.mTier];
+ }
+
+ @Override
+ public long maxAmperesIn() {
+ return 0;
+ }
+
+ @Override
+ public boolean isEnetInput() {
+ return false;
+ }
+
+ @Override
+ public boolean isEnetOutput() {
+ return true;
+ }
+
+ @Override
+ public boolean isInputFacing(byte aSide) {
+ return !isOutputFacing(aSide);
+ }
+
+ @Override
+ public boolean isOutputFacing(byte aSide) {
+ return aSide == getBaseMetaTileEntity().getFrontFacing();
+ }
+
+ @Override public boolean isAccessAllowed(final EntityPlayer aPlayer) {return true;}
+
+ @Override
+ public Object getServerGUI(final int aID, final InventoryPlayer aPlayerInventory,
+ final IGregTechTileEntity aBaseMetaTileEntity) {
+ return null;
+ }
+
+ @Override
+ public Object getClientGUI(final int aID, final InventoryPlayer aPlayerInventory,
+ final IGregTechTileEntity aBaseMetaTileEntity) {
+ return null;
+ }
+
+ @Override
+ public void onPostTick(final IGregTechTileEntity aBaseMetaTileEntity, final long aTick) {
+ if (aBaseMetaTileEntity.isServerSide()) {
+ if (!aBaseMetaTileEntity.isActive()) {
+ aBaseMetaTileEntity.setActive(true);
+ }
+ if (this.getEUVar() < this.maxEUStore()) {
+ for (byte i = 0; i < 6 && aBaseMetaTileEntity.getStoredEU() < aBaseMetaTileEntity.getEUCapacity(); i++) {
+ if (isInputFacing(i)) {
+ receiveEnergy(ForgeDirection.getOrientation(i), Integer.MAX_VALUE, false);
+ }
+ }
+ }
+ return;
+ }
+ }
+
+ @Override
+ public boolean allowPullStack(final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, final ItemStack aStack) {
+ return false;
+ }
+
+ @Override
+ public boolean allowPutStack(final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide, final ItemStack aStack) {
+ return false;
+ }
+
+ @Override
+ public String[] getInfoData() {
+ String[] infoData = super.getInfoData();
+ return new String[] {
+ infoData[0],
+ "Converts RF -> GTEU | Tier: "+this.mTier,
+ infoData[1],
+ infoData[2]
+ };
+ }
+
+ @Override
+ public boolean isGivingInformation() {
+ return true;
+ }
+
+ @Override
+ public void saveNBTData(NBTTagCompound aNBT) {
+ aNBT.setByte("mTier", this.mTier);
+ super.saveNBTData(aNBT);
+ }
+
+ @Override
+ public void loadNBTData(NBTTagCompound aNBT) {
+ super.loadNBTData(aNBT);
+ this.mTier = aNBT.getByte("mTier");
+ }
+
+ @Override
+ public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
+ if (aPlayer.isSneaking()) {
+ byte aTest = (byte) (aCurrentOutputAmperage + 1);
+ if (aTest > 16 || aTest <= 0 ) {
+ aTest = 1;
+ }
+ aCurrentOutputAmperage = aTest;
+ PlayerUtils.messagePlayer(aPlayer, "Now handling "+maxAmperesOut()+" Amps.");
+ }
+ else {
+ if (this.mTier < (CORE.GTNH ? GT_Values.V.length : 9)) {
+ this.mTier++;
+ }
+ else {
+ this.mTier = 0;
+ }
+ PlayerUtils.messagePlayer(aPlayer, "Now running at "+GT_Values.VOLTAGE_NAMES[this.mTier]+".");
+ }
+
+ }
+
+ @Override
+ public boolean canConnectEnergy(ForgeDirection from) {
+ if (isOutputFacing((byte) from.ordinal())) {
+ return false;
+ }
+ return true;
+ }
+
+ @Override
+ public int receiveEnergy(ForgeDirection from, int maxReceive, boolean simulate) {
+
+ // Cannot accept power on the output face.
+ if (!canConnectEnergy(from) || isOutputFacing((byte) from.ordinal())) {
+ return 0;
+ }
+
+ TileEntity tTileEntity = this.getBaseMetaTileEntity().getTileEntityAtSide((byte) from.ordinal());
+ if (tTileEntity == null) {
+ return 0;
+ }
+
+ Logger.WARNING("Someone is trying to inject RF from "+from+". Type:"+tTileEntity.getClass().getName());
+
+ // Calculate maximum RF we need to consume
+ int aInputRF = MathUtils.safeInt(this.maxEUOutput() * GregTech_API.mEUtoRF / 100);
+
+ // Make sure we only consume the correct amount of RF that is pushed into this Tile.
+ if (aInputRF > maxReceive) {
+ aInputRF = maxReceive;
+ }
+
+ int aInjectedRF = 0;
+ boolean aVal = false;
+
+ long aStoredEU = this.getEUVar();
+ long aMaxEU = this.maxEUStore();
+ Logger.WARNING("Stored: "+aStoredEU+", Capacity: "+aMaxEU+"");
+ if (aStoredEU < aMaxEU) {
+ Logger.WARNING("StoredEU < MaxEU");
+ long aRemainingSpace = aMaxEU - aStoredEU;
+ if (aRemainingSpace > 0) {
+ long tEU = 0;
+ byte aSide = (byte) from.ordinal();
+ Logger.WARNING("Free: "+aRemainingSpace+"EU");
+ if (tTileEntity instanceof IEnergyProvider && ((IEnergyProvider) tTileEntity).extractEnergy(ForgeDirection.getOrientation(GT_Utility.getOppositeSide(aSide)), 1, true) == 1) {
+ tEU = (long) ((IEnergyProvider) tTileEntity).extractEnergy(ForgeDirection.getOrientation(GT_Utility.getOppositeSide(aSide)), (int) maxEUOutput() * 100 / GregTech_API.mRFtoEU, false);
+ Logger.WARNING("Drained from IEnergyProvider Tile: "+(tEU * 100 / GregTech_API.mRFtoEU)+"");
+ tEU = tEU * GregTech_API.mRFtoEU / 100;
+ }
+ else if (tTileEntity instanceof IEnergyStorage && ((IEnergyStorage) tTileEntity).extractEnergy(1, true) == 1) {
+ tEU = (long) ((IEnergyStorage) tTileEntity).extractEnergy((int) maxEUOutput() * 100 / GregTech_API.mRFtoEU, false);
+ Logger.WARNING("Drained from IEnergyStorage Tile: "+(tEU * 100 / GregTech_API.mRFtoEU)+"");
+ tEU = tEU * GregTech_API.mRFtoEU / 100;
+ }
+ else if (GregTech_API.meIOLoaded && tTileEntity instanceof IPowerContainer && ((IPowerContainer) tTileEntity).getEnergyStored() > 0) {
+ int storedRF = ((IPowerContainer) tTileEntity).getEnergyStored();
+ int extractRF = (int) maxEUOutput() * 100 / GregTech_API.mRFtoEU;
+ tEU = 0;
+ if (tTileEntity instanceof TileCapBank) {
+ ICapBankNetwork network = ((TileCapBank) tTileEntity).getNetwork();
+ if (network != null && network.getEnergyStoredL() > 0) {
+ tEU = Math.min((Math.min(Math.min(network.getEnergyStoredL(), storedRF - extractRF), network.getMaxOutput())) * GregTech_API.mRFtoEU / 100, maxEUOutput());
+ Logger.WARNING("Drained from EIO CapBank Tile: "+(tEU * 100 / GregTech_API.mRFtoEU)+"");
+ network.addEnergy((int) -(tEU * 100 / GregTech_API.mRFtoEU));
+ }
+ } else {
+ if (storedRF > extractRF) {
+ ((IPowerContainer) tTileEntity).setEnergyStored(storedRF - extractRF);
+ tEU = maxEUOutput();
+ Logger.WARNING("Drained from EIO Tile: "+(tEU * 100 / GregTech_API.mRFtoEU)+"");
+ } else {
+ ((IPowerContainer) tTileEntity).setEnergyStored(0);
+ tEU = storedRF * GregTech_API.mRFtoEU / 100;
+ Logger.WARNING("Drained from EIO Tile: "+(tEU * 100 / GregTech_API.mRFtoEU)+"");
+ }
+ }
+ }
+ Logger.WARNING("EU to inject: "+tEU+"EU");
+ if (!simulate) {
+ aVal = this.getBaseMetaTileEntity().increaseStoredEnergyUnits(tEU, true);
+ }
+ if (tEU > 0) {
+ Logger.WARNING("Tried injecting "+tEU+" eu into self. Success? "+aVal);
+ }
+ }
+ }
+ return aInjectedRF;
+ }
+
+ @Override
+ public int getEnergyStored(ForgeDirection from) {
+ long aStoredEU = this.getEUVar();
+ long aMaxEU = this.maxEUStore();
+ if (aStoredEU == 0) {
+ return 0;
+ }
+ if (aStoredEU < aMaxEU) {
+ long aRemainingSpace = aMaxEU - aStoredEU;
+ if (aRemainingSpace > 0) {
+ if (aRemainingSpace > (this.maxEUOutput() / (GregTech_API.mEUtoRF / 100))) {
+ int aCalculatedFreeSpace = 0;
+ int aRfPer10Eu = GregTech_API.mEUtoRF / 10;
+ // Calculate how many lots of '10
+ aCalculatedFreeSpace = (int) Math.floor(aRemainingSpace / 10);
+ // Return value equal to how many lots of '10eu' packets we can fit in.
+ return Integer.MAX_VALUE - MathUtils.balance(aCalculatedFreeSpace * aRfPer10Eu, 0, Integer.MAX_VALUE);
+ }
+ }
+ }
+ return Integer.MAX_VALUE;
+ }
+
+ @Override
+ public int getMaxEnergyStored(ForgeDirection from) {
+ return Integer.MAX_VALUE;
+ }
+} \ No newline at end of file
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 5ebdbf0ef8..cfbf7bd487 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntityGeothermalGenerator.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntityGeothermalGenerator.java
@@ -38,7 +38,8 @@ extends GT_MetaTileEntity_BasicGenerator
@Override
public String[] getDescription() {
- return new String[]{this.mDescription, "Generates power at " + this.getEfficiency() + "% Efficiency per tick"};
+ String aPollution = "Causes between "+this.getPollution()+ " Pollution per second";
+ return new String[]{this.mDescription, "Generates power at " + this.getEfficiency() + "% Efficiency per tick", aPollution};
}
@Override
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntityRocketFuelGenerator.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntityRocketFuelGenerator.java
index 6a42232e40..7d20f1eb59 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntityRocketFuelGenerator.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntityRocketFuelGenerator.java
@@ -54,12 +54,12 @@ extends GregtechRocketFuelGeneratorBase {
}
public void onConfigLoad() {
- this.mEfficiency = GregTech_API.sMachineFile.get(ConfigCategories.machineconfig, "RocketEngine.efficiency.tier." + this.mTier, ((40+((this.mTier) * 16))/4)+(this.mTier));
+ this.mEfficiency = GregTech_API.sMachineFile.get(ConfigCategories.machineconfig, "RocketEngine.efficiency.tier." + this.mTier, 80 - (10 * (this.mTier - 4)));
}
@Override
public int getEfficiency() {
- int eff = ((40+((this.mTier) * 16))/4)+(this.mTier);
+ int eff = 80 - (10 * (this.mTier - 4));
return eff;
}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntityChunkLoader.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntityChunkLoader.java
index 2a2b6d5090..140f1d9cd5 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntityChunkLoader.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntityChunkLoader.java
@@ -1,7 +1,6 @@
package gtPlusPlus.xmod.gregtech.common.tileentities.machines.basic;
import static gregtech.api.enums.GT_Values.V;
-import static gtPlusPlus.core.util.minecraft.gregtech.PollutionUtils.mPollution;
import java.util.HashSet;
import java.util.Set;
@@ -10,20 +9,13 @@ 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.items.GT_MetaGenerated_Tool;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine;
import gregtech.api.objects.GT_RenderedTexture;
import gregtech.api.util.GT_Utility;
import gtPlusPlus.api.interfaces.IChunkLoader;
-import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.chunkloading.GTPP_ChunkManager;
import gtPlusPlus.core.chunkloading.StaticChunkFunctions;
import gtPlusPlus.core.lib.CORE;
-import gtPlusPlus.core.util.Utils;
-import gtPlusPlus.core.util.math.MathUtils;
-import gtPlusPlus.core.util.minecraft.PlayerUtils;
-import gtPlusPlus.core.util.minecraft.gregtech.PollutionUtils;
-import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMetaTileEntity;
import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
@@ -36,17 +28,7 @@ import net.minecraft.world.chunk.Chunk;
public class GregtechMetaTileEntityChunkLoader extends GT_MetaTileEntity_BasicMachine implements IChunkLoader {
public GregtechMetaTileEntityChunkLoader(int aID, String aName, String aNameRegional, int aTier) {
- super(aID, aName, aNameRegional, aTier, 2, "Loads " + getMaxChunksToLoadForTier(aTier) + " chunks when powered", 0, 0, "Recycler.png", "",
- new ITexture[]{
- new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_MASSFAB_ACTIVE),
- new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_MASSFAB),
- new GT_RenderedTexture(TexturesGtBlock.Overlay_MatterFab_Active),
- new GT_RenderedTexture(TexturesGtBlock.Overlay_MatterFab),
- new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Vent_Fast),
- new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Vent),
- new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_MASSFAB_ACTIVE),
- new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_MASSFAB)
- });
+ super(aID, aName, aNameRegional, aTier, 2, "Loads " + getMaxChunksToLoadForTier(aTier) + " chunks when powered", 0, 0, "Recycler.png", "", new ITexture[]{});
}
public GregtechMetaTileEntityChunkLoader(String aName, int aTier, String aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName) {
@@ -54,13 +36,27 @@ public class GregtechMetaTileEntityChunkLoader extends GT_MetaTileEntity_BasicMa
}
public static int getMaxChunksToLoadForTier(int aTier) {
- return (aTier * aTier);
+ if (aTier < 4) {
+ return 3 * 3;
+ }
+ if (aTier < 6) {
+ return 7 * 7;
+ }
+ if (aTier < 8) {
+ return 15 * 15;
+ }
+ else {
+ return 0;
+ }
}
@Override
public String[] getDescription() {
return new String[] {
- this.mDescription,
+ "Loads " + getMaxChunksToLoadForTier(this.mTier) + " chunks when powered",
+ "Consumes 2A",
+ "Behaves Identically to a Railcraft World Anchor",
+ CORE.GT_Tooltip
};
}
@@ -89,57 +85,56 @@ public class GregtechMetaTileEntityChunkLoader extends GT_MetaTileEntity_BasicMa
public ITexture[] getFront(final byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Casing_Material_RedSteel)};
+ return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Casing_Material_MaragingSteel), new GT_RenderedTexture(TexturesGtBlock.TIERED_MACHINE_HULLS[mTier])};
}
public ITexture[] getBack(final byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Casing_Material_RedSteel)};
+ return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Casing_Material_MaragingSteel), new GT_RenderedTexture(TexturesGtBlock.TIERED_MACHINE_HULLS[mTier])};
}
public ITexture[] getBottom(final byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Casing_Material_Grisium)};
+ return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Casing_Material_MaragingSteel), new GT_RenderedTexture(TexturesGtBlock.TIERED_MACHINE_HULLS[mTier])};
}
public ITexture[] getTop(final byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Casing_Material_Grisium)};
+ return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Casing_Material_MaragingSteel), new GT_RenderedTexture(TexturesGtBlock.TIERED_MACHINE_HULLS[mTier])};
}
public ITexture[] getSides(final byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Casing_Redox_3)};
+ return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Casing_Material_MaragingSteel), new GT_RenderedTexture(TexturesGtBlock.TIERED_MACHINE_HULLS[mTier])};
}
public ITexture[] getFrontActive(final byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Casing_Material_RedSteel)};
+ return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Casing_Material_MaragingSteel), new GT_RenderedTexture(TexturesGtBlock.TIERED_MACHINE_HULLS[mTier+1])};
}
public ITexture[] getBackActive(final byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Casing_Material_RedSteel)};
+ return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Casing_Material_MaragingSteel), new GT_RenderedTexture(TexturesGtBlock.TIERED_MACHINE_HULLS[mTier+1])};
}
public ITexture[] getBottomActive(final byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Casing_Material_Grisium)};
+ return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Casing_Material_MaragingSteel), new GT_RenderedTexture(TexturesGtBlock.TIERED_MACHINE_HULLS[mTier+1])};
}
public ITexture[] getTopActive(final byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Casing_Material_Grisium)};
+ return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Casing_Material_MaragingSteel), new GT_RenderedTexture(TexturesGtBlock.TIERED_MACHINE_HULLS[mTier+1])};
}
public ITexture[] getSidesActive(final byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Casing_Redox_3)};
+ return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Casing_Material_MaragingSteel), new GT_RenderedTexture(TexturesGtBlock.TIERED_MACHINE_HULLS[mTier+1])};
}
@Override
public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
- PlayerUtils.messagePlayer(aPlayer, "Running every "+" minutes.");
super.onScrewdriverRightClick(aSide, aPlayer, aX, aY, aZ);
}
@@ -175,9 +170,7 @@ public class GregtechMetaTileEntityChunkLoader extends GT_MetaTileEntity_BasicMa
@Override
public String[] getInfoData() {
- return new String[] {
- this.getLocalName()
- };
+ return super.getInfoData();
}
@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 b7e4618e07..79d256909d 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
@@ -43,23 +43,6 @@ public class GregtechMetaTileEntity_ChemicalReactor extends GT_MetaTileEntity_Ba
public FluidStack[] mInputFluids = new FluidStack[4];
public FluidStack[] mOutputFluids = new FluidStack[2];
- private static final GT_Recipe_Map mFluidChemicalReactorRecipes = new GT_Recipe_Map(
- new HashSet<GT_Recipe>(100),
- "gt.recipe.fluidchemicaleactor",
- "Chemical Plant",
- null,
- CORE.MODID+":textures/gui/FluidReactor",
- 0,
- 0,
- 0,
- 2,
- 1,
- "Tier: ",
- 1,
- E,
- true,
- false);
-
public GregtechMetaTileEntity_ChemicalReactor(int aID, String aName, String aNameRegional, int aTier) {
super(aID, aName, aNameRegional, aTier, 1,
"For mixing fluids", 4, 4, "ChemicalReactor.png", "",
@@ -124,12 +107,7 @@ public class GregtechMetaTileEntity_ChemicalReactor extends GT_MetaTileEntity_Ba
@Override
public GT_Recipe.GT_Recipe_Map getRecipeList() {
- if (mFluidChemicalReactorRecipes.mRecipeList.isEmpty()) {
- for (Recipe_GT i :Recipe_GT.Gregtech_Recipe_Map.sFluidChemicalReactorRecipes.mRecipeList) {
- mFluidChemicalReactorRecipes.add(i);
- }
- }
- return mFluidChemicalReactorRecipes;
+ return null;
}
@Override
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
new file mode 100644
index 0000000000..ddbd87da64
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialAlloySmelter.java
@@ -0,0 +1,380 @@
+package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing;
+
+import static gtPlusPlus.core.util.data.ArrayUtils.removeNulls;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.commons.lang3.ArrayUtils;
+
+import gregtech.api.enums.TAE;
+import gregtech.api.enums.Textures;
+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.objects.GT_RenderedTexture;
+import gregtech.api.util.GT_Recipe;
+import gregtech.api.util.GT_Utility;
+import gtPlusPlus.api.objects.Logger;
+import gtPlusPlus.core.block.ModBlocks;
+import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase;
+import gtPlusPlus.xmod.gregtech.common.StaticFields59;
+import net.minecraft.block.Block;
+import net.minecraft.entity.player.InventoryPlayer;
+import net.minecraft.item.ItemStack;
+import net.minecraftforge.common.util.ForgeDirection;
+import net.minecraftforge.fluids.FluidStack;
+
+public class GregtechMetaTileEntity_IndustrialAlloySmelter extends GregtechMeta_MultiBlockBase {
+
+ public static int CASING_TEXTURE_ID;
+ private int mHeatingCapacity = 0;
+ private int mLevel = 0;
+
+ public GregtechMetaTileEntity_IndustrialAlloySmelter(int aID, String aName, String aNameRegional) {
+ super(aID, aName, aNameRegional);
+ CASING_TEXTURE_ID = TAE.getIndexFromPage(2, 1);
+ }
+
+ public GregtechMetaTileEntity_IndustrialAlloySmelter(String aName) {
+ super(aName);
+ CASING_TEXTURE_ID = TAE.getIndexFromPage(2, 1);
+ }
+
+ public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GregtechMetaTileEntity_IndustrialAlloySmelter(this.mName);
+ }
+
+ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) {
+ if (aSide == aFacing) {
+ return new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[CASING_TEXTURE_ID], new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_MULTI_SMELTER_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_MULTI_SMELTER)};
+ }
+ return new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[CASING_TEXTURE_ID]};
+ }
+
+ public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
+ return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "MultiFurnace.png");
+ }
+
+ public GT_Recipe.GT_Recipe_Map getRecipeMap() {
+ return GT_Recipe.GT_Recipe_Map.sAlloySmelterRecipes;
+ }
+
+ public boolean isCorrectMachinePart(ItemStack aStack) {
+ return true;
+ }
+
+ public boolean isFacingValid(byte aFacing) {
+ return aFacing > 1;
+ }
+
+ public int getMaxEfficiency(ItemStack aStack) {
+ return 10000;
+ }
+
+ public int getPollutionPerTick(ItemStack aStack) {
+ return 15;
+ }
+
+ public int getDamageToComponent(ItemStack aStack) {
+ return 0;
+ }
+
+ public boolean explodesOnComponentBreak(ItemStack aStack) {
+ return false;
+ }
+
+ @Override
+ public boolean hasSlotInGUI() {
+ return false;
+ }
+
+ @Override
+ public String getCustomGUIResourceName() {
+ return null;
+ }
+
+ @Override
+ public String getMachineType() {
+ return "Alloy Smelter";
+ }
+
+ @Override
+ public String[] getTooltip() {
+ return new String[]{
+ "Controller Block for the Industrial Alloy Smelter",
+ "Gains one parallel per voltage tier",
+ "Gains one multiplier per coil tier",
+ "parallel = tier * coil tier",
+ "Gains 5% speed bonus per coil tier",
+ "Size(WxHxD): 3x5x3 (Hollow)",
+ "Controller (Front middle at bottom)",
+ "Inconel Reinforced Casings (layers 0/4, 10 at least!)",
+ "16x Heating Coils (layers 1/3, hollow)",
+ "8x Integral Encasement V (middle layer, hollow)",
+ "1x Input Bus",
+ "1x Output Bus",
+ "1x Output Hatch",
+ "1x Energy Hatch",
+ };
+ }
+
+ @Override
+ public int getMaxParallelRecipes() {
+ return (this.mLevel * GT_Utility.getTier(this.getMaxInputVoltage()));
+ }
+
+ @Override
+ public int getEuDiscountForParallelism() {
+ return 0;
+ }
+
+ @Override
+ public boolean checkMultiblock(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
+ int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX;
+ int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ;
+
+ this.mLevel = 0;
+ this.mHeatingCapacity = 0;
+ for (int i=1;i<4;i++) {
+ if (!aBaseMetaTileEntity.getAirOffset(xDir, i, zDir)) {
+ Logger.INFO("Did not find air inside on layer "+i);
+ return false;
+ }
+ }
+ /*if (!addMufflerToMachineList(aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir, 3, zDir),
+ CASING_TEXTURE_ID)) {
+ return false;
+ }*/
+ Block tUsedBlock = aBaseMetaTileEntity.getBlockOffset(xDir + 1, 1, zDir);
+ byte tUsedMeta = aBaseMetaTileEntity.getMetaIDOffset(xDir + 1, 1, zDir);
+ this.mLevel = StaticFields59.getTierForCoil(tUsedBlock, tUsedMeta);
+ this.mHeatingCapacity = StaticFields59.getHeatingCapacityForCoil(tUsedBlock, tUsedMeta);
+
+ int aCasingCount = 0;
+
+ for (int i = -1; i < 2; i++) {
+ for (int j = -1; j < 2; j++) {
+
+ if ((i != 0) || (j != 0)) {
+ //Coils 1
+ if (!isValidBlockForStructure(null, CASING_TEXTURE_ID, false, aBaseMetaTileEntity.getBlockOffset(xDir + i, 1, zDir + j), (int) aBaseMetaTileEntity.getMetaIDOffset(xDir + i, 1, zDir + j), StaticFields59.getBlockCasings5(), tUsedMeta)) {
+ Logger.INFO("Heating Coils missing. First Layer");
+ return false;
+ }
+
+ //Integral Casings
+ if (!isValidBlockForStructure(null, CASING_TEXTURE_ID, false, aBaseMetaTileEntity.getBlockOffset(xDir + i, 2, zDir + j), (int) aBaseMetaTileEntity.getMetaIDOffset(xDir + i, 2, zDir + j), ModBlocks.blockCasingsTieredGTPP, 4)) {
+ Logger.INFO("Integral Framework missing. Second Layer");
+ return false;
+ }
+
+ //Coils 2
+ if (!isValidBlockForStructure(null, CASING_TEXTURE_ID, false, aBaseMetaTileEntity.getBlockOffset(xDir + i, 3, zDir + j), (int) aBaseMetaTileEntity.getMetaIDOffset(xDir + i, 3, zDir + j), StaticFields59.getBlockCasings5(), tUsedMeta)) {
+ Logger.INFO("Heating Coils missing. Third Layer");
+ return false;
+ }
+ }
+
+ //Top Layer
+
+ Block aCurrentBlock = aBaseMetaTileEntity.getBlockOffset(xDir + i, 4, zDir + j);
+ int aCurrentMeta = (int) aBaseMetaTileEntity.getMetaIDOffset(xDir + i, 4, zDir + j);
+ if (aCurrentBlock == ModBlocks.blockCasings3Misc && aCurrentMeta == 1) {
+ aCasingCount++;
+ }
+
+ final IGregTechTileEntity tTileEntity2 = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, 4, zDir + j);
+ if (!isValidBlockForStructure(tTileEntity2, CASING_TEXTURE_ID, true, aCurrentBlock, aCurrentMeta, ModBlocks.blockCasings3Misc, 1)) {
+ Logger.INFO("Top Layer missing.");
+ return false;
+ }
+ }
+ }
+ for (int i = -1; i < 2; i++) {
+ for (int j = -1; j < 2; j++) {
+
+
+ Block aCurrentBlock = aBaseMetaTileEntity.getBlockOffset(xDir + i, 0, zDir + j);
+ int aCurrentMeta = (int) aBaseMetaTileEntity.getMetaIDOffset(xDir + i, 0, zDir + j);
+ if (aCurrentBlock == ModBlocks.blockCasings3Misc && aCurrentMeta == 1) {
+ aCasingCount++;
+ }
+ if ((xDir + i != 0) || (zDir + j != 0)) {
+ IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, 0, zDir + j);
+ if (!isValidBlockForStructure(tTileEntity, CASING_TEXTURE_ID, true, aCurrentBlock, aCurrentMeta, ModBlocks.blockCasings3Misc, 1)) {
+ Logger.INFO("Bottom Layer missing.");
+ return false;
+ }
+ }
+ }
+ }
+
+ return aCasingCount >= 10;
+ }
+
+ public boolean checkRecipe(ItemStack aStack) {
+ return checkRecipeGeneric(this.getMaxParallelRecipes(), 0, 5 * this.mLevel); // Will have to clone the logic from parent class to handle heating coil
+ // tiers.
+ }
+
+ @Override
+ public boolean checkRecipeGeneric(ItemStack[] aItemInputs, FluidStack[] aFluidInputs, int aMaxParallelRecipes,
+ int aEUPercent, int aSpeedBonusPercent, int aOutputChanceRoll) {
+ // 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();
+ Logger.WARNING("Running checkRecipeGeneric(0)");
+
+ GT_Recipe tRecipe = this.getRecipeMap().findRecipe(getBaseMetaTileEntity(), mLastRecipe, false,
+ gregtech.api.enums.GT_Values.V[tTier], aFluidInputs, aItemInputs);
+
+ Logger.WARNING("Running checkRecipeGeneric(1)");
+ // Remember last recipe - an optimization for findRecipe()
+ this.mLastRecipe = tRecipe;
+
+ if (tRecipe == null) {
+ Logger.WARNING("BAD RETURN - 1");
+ return false;
+ }
+
+ aMaxParallelRecipes = this.canBufferOutputs(tRecipe, aMaxParallelRecipes);
+ if (aMaxParallelRecipes == 0) {
+ Logger.WARNING("BAD RETURN - 2");
+ return false;
+ }
+
+ // EU discount
+ float tRecipeEUt = (tRecipe.mEUt * aEUPercent) / 100.0f;
+ int tHeatCapacityDivTiers = mHeatingCapacity / 900;
+ if (tHeatCapacityDivTiers > 0) {
+ tRecipeEUt = (int) (tRecipeEUt * (Math.pow(0.95, tHeatCapacityDivTiers)));
+ }
+ float tTotalEUt = 0.0f;
+
+ int parallelRecipes = 0;
+ // Count recipes to do in parallel, consuming input items and fluids and
+ // considering input voltage limits
+ for (; parallelRecipes < aMaxParallelRecipes && tTotalEUt < (tEnergy - tRecipeEUt); parallelRecipes++) {
+ if (!tRecipe.isRecipeInputEqual(true, aFluidInputs, aItemInputs)) {
+ Logger.WARNING("Broke at " + parallelRecipes + ".");
+ break;
+ }
+ Logger.WARNING("Bumped EU from " + tTotalEUt + " to " + (tTotalEUt + tRecipeEUt) + ".");
+ tTotalEUt += tRecipeEUt;
+ }
+
+ if (parallelRecipes == 0) {
+ Logger.WARNING("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);
+ int rInt = 2;
+
+ this.mEUt = (int) Math.ceil(tTotalEUt);
+
+ this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000);
+ this.mEfficiencyIncrease = 10000;
+
+ // 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 /= (tHeatCapacityDivTiers >= rInt ? 4 : 2);
+ }
+ }
+ 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;
+ }
+ }
+
+ // Collect output item types
+ ItemStack[] tOutputItems = new ItemStack[tRecipe.mOutputs.length];
+ for (int h = 0; h < tRecipe.mOutputs.length; h++) {
+ if (tRecipe.getOutput(h) != null) {
+ tOutputItems[h] = tRecipe.getOutput(h).copy();
+ tOutputItems[h].stackSize = 0;
+ }
+ }
+
+ // Set output item stack sizes (taking output chance into account)
+ for (int f = 0; f < tOutputItems.length; f++) {
+ if (tRecipe.mOutputs[f] != null && tOutputItems[f] != null) {
+ for (int g = 0; g < parallelRecipes; g++) {
+ if (getBaseMetaTileEntity().getRandomNumber(aOutputChanceRoll) < tRecipe.getOutputChance(f))
+ tOutputItems[f].stackSize += tRecipe.mOutputs[f].stackSize;
+ }
+ }
+ }
+
+ tOutputItems = removeNulls(tOutputItems);
+
+ // Sanitize item stack size, splitting any stacks greater than max stack size
+ List<ItemStack> splitStacks = new ArrayList<ItemStack>();
+ for (ItemStack tItem : tOutputItems) {
+ while (tItem.getMaxStackSize() < tItem.stackSize) {
+ ItemStack tmp = tItem.copy();
+ tmp.stackSize = tmp.getMaxStackSize();
+ tItem.stackSize = tItem.stackSize - tItem.getMaxStackSize();
+ splitStacks.add(tmp);
+ }
+ }
+
+ if (splitStacks.size() > 0) {
+ ItemStack[] tmp = new ItemStack[splitStacks.size()];
+ tmp = splitStacks.toArray(tmp);
+ tOutputItems = ArrayUtils.addAll(tOutputItems, tmp);
+ }
+
+ // Strip empty stacks
+ List<ItemStack> tSList = new ArrayList<ItemStack>();
+ for (ItemStack tS : tOutputItems) {
+ if (tS.stackSize > 0)
+ tSList.add(tS);
+ }
+ tOutputItems = tSList.toArray(new ItemStack[tSList.size()]);
+
+ // Commit outputs
+ this.mOutputItems = tOutputItems;
+ this.mOutputFluids = tOutputFluids;
+ updateSlots();
+
+ // Play sounds (GT++ addition - GT multiblocks play no sounds)
+ startProcess();
+
+ Logger.WARNING("GOOD RETURN - 1");
+ return true;
+
+ }
+
+
+}
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 c549cf9216..68e060c778 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
@@ -137,13 +137,13 @@ extends GregtechMeta_MultiBlockBase {
int depth = 1;
int mPlascreteCount = 0;
for (int i = 1; i < 4; i++) {
- Block tBlock = aBaseMetaTileEntity.getBlockOffset(i, 0, 0);
- int tMeta = aBaseMetaTileEntity.getMetaIDOffset(i, 0, 0);
- if (tBlock == ModBlocks.blockCasings3Misc && tMeta == 1) {
- Logger.INFO("Found Correct Top Casing at offset "+i);
+ if (aBaseMetaTileEntity.getAirOffset(i, -1, 0)) {
+ Logger.INFO("aitfound "+i);
continue;
}
- else {
+ Block tBlock = aBaseMetaTileEntity.getBlockOffset(i, -1, 0);
+ int tMeta = aBaseMetaTileEntity.getMetaIDOffset(i, -1, 0);
+ {
if (isValidCasingBlock(tBlock, tMeta)) {
x = i;
z = i;
@@ -176,7 +176,7 @@ extends GregtechMeta_MultiBlockBase {
}
//!addToMachineList(tTileEntity, mCasingTextureID)
if (depth >= -1) {
- Logger.INFO("Structure is not 5 blocks or taller.");
+ Logger.INFO("Structure is not 5 blocks or taller. depth = "+depth);
return false;
}
@@ -207,7 +207,7 @@ extends GregtechMeta_MultiBlockBase {
}
else if (dY < 0) {
//Check Walls
- if (dX == -x || dX == x || dZ == -z || dZ == z) {
+ if (dY != depth && (dX == -x || dX == x || dZ == -z || dZ == z)) {
if (!isValidCasingBlock(tBlock, tMeta) && !addToMachineList(tTileEntity, mCasingTextureID)) {
Logger.INFO("Found Incorrect Wall Casing at offset X:"+dX+" | Y:"+dY+" | Z:"+dZ);
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 78896dd650..b5cfff10e4 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
@@ -227,7 +227,8 @@ public class GregtechMetaTileEntity_IndustrialDehydrator extends GregtechMeta_Mu
return false;
}
- if (!this.canBufferOutputs(tRecipe, aMaxParallelRecipes)) {
+ aMaxParallelRecipes = this.canBufferOutputs(tRecipe, aMaxParallelRecipes);
+ if (aMaxParallelRecipes == 0) {
Logger.WARNING("BAD RETURN - 2");
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 e721761d82..0c7067b3c0 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
@@ -14,6 +14,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.util.data.ArrayUtils;
import gtPlusPlus.core.util.minecraft.ItemUtils;
import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase;
import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock;
@@ -112,7 +113,30 @@ extends GregtechMeta_MultiBlockBase {
@Override
public boolean checkRecipe(final ItemStack aStack) {
- return checkRecipeGeneric(getMaxParallelRecipes(), getEuDiscountForParallelism(), 250);
+ for (GT_MetaTileEntity_Hatch_InputBus tBus : mInputBusses) {
+ ArrayList<ItemStack> tBusItems = new ArrayList<ItemStack>();
+ tBus.mRecipeMap = getRecipeMap();
+ if (isValidMetaTileEntity(tBus)) {
+ for (int i = tBus.getBaseMetaTileEntity().getSizeInventory() - 1; i >= 0; i--) {
+ if (tBus.getBaseMetaTileEntity().getStackInSlot(i) != null)
+ tBusItems.add(tBus.getBaseMetaTileEntity().getStackInSlot(i));
+ }
+ }
+ ItemStack[] inputs = new ItemStack[tBusItems.size()];
+ int slot = 0;
+ for (ItemStack g : tBusItems) {
+ inputs[slot++] = g;
+ }
+ if (inputs.length > 0) {
+ log("Recipe. ["+inputs.length+"]["+getMaxParallelRecipes()+"]");
+ if (checkRecipeGeneric(inputs, (FluidStack[]) ArrayUtils.getArrayFromArrayList(this.getStoredFluids()), getMaxParallelRecipes(), getEuDiscountForParallelism(), 250, 10000)) {
+ log("Recipe 2.");
+ return true;
+ }
+ }
+
+ }
+ return false;
}
@Override
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 8b07117596..05aec14500 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
@@ -55,12 +55,12 @@ extends GregtechMeta_MultiBlockBase {
private static final int MODE_EXTRACTOR = 5;
private static final int MODE_LASER = 6;
private static final int MODE_AUTOCLAVE = 7;
- private static final int MODE_REPLICATOR = 8;
+ private static final int MODE_FLUIDSOLIDIFY = 8;
private static final int[][] MODE_MAP = new int[][] {{0, 1, 2}, {3, 4, 5}, {6, 7, 8}};
public static final String[] aToolTipNames = new String[9];
static {
- for (int id = 0; id < 8; id++) {
+ for (int id = 0; id < 9; id++) {
String aNEI = GT_LanguageManager.getTranslation(getRecipeMap(id).mUnlocalizedName);
aToolTipNames[id] = aNEI != null ? aNEI : "BAD NEI NAME (Report to Github)";
}
@@ -143,7 +143,17 @@ extends GregtechMeta_MultiBlockBase {
tBusItems.add(tBus.getBaseMetaTileEntity().getStackInSlot(i));
}
}
-
+
+ boolean aFoundCircuitInBus = false;
+ for (ItemStack aBusItem : tBusItems) {
+ if (ItemUtils.isControlCircuit(aBusItem)) {
+ aFoundCircuitInBus = true;
+ }
+ }
+ if (!aFoundCircuitInBus) {
+ continue;
+ }
+
Object[] tempArray = tFluids.toArray(new FluidStack[] {});
FluidStack[] properArray;
properArray = ((tempArray != null && tempArray.length > 0) ? (FluidStack[]) tempArray : new FluidStack[] {});
@@ -188,7 +198,7 @@ extends GregtechMeta_MultiBlockBase {
if (!isValidBlockForStructure(tTileEntity, getTextureIndex(), true, aBlock, aMeta,
ModBlocks.blockCasings3Misc, 2)) {
- Logger.INFO("Bad centrifuge casing");
+ Logger.INFO("Bad casing");
return false;
}
++tAmount;
@@ -287,16 +297,14 @@ extends GregtechMeta_MultiBlockBase {
else if (aMode == MODE_AUTOCLAVE) {
return GT_Recipe.GT_Recipe_Map.sAutoclaveRecipes;
}
- else if (aMode == MODE_REPLICATOR) {
- return null;
+ else if (aMode == MODE_FLUIDSOLIDIFY) {
+ return GT_Recipe.GT_Recipe_Map.sFluidSolidficationRecipes;
}
else {
return null;
}
}
- private final AutoMap<ItemStack> mReplicatorOutputMap = new AutoMap<ItemStack>();
-
@Override
public boolean checkRecipeGeneric(
ItemStack[] aItemInputs, FluidStack[] aFluidInputs,
@@ -311,12 +319,6 @@ extends GregtechMeta_MultiBlockBase {
Logger.MACHINE_INFO("Mode: "+tCircuitID);
- // Time to Defer to Special Handling if it's in replicator mode.
- if (tCircuitID == MODE_REPLICATOR) {
- return false;
- // return checkReplicatorRecipe(aItemInputs, aFluidInputs, aMaxParallelRecipes, aEUPercent, aSpeedBonusPercent, aOutputChanceRoll);
- }
-
// Reset outputs and progress stats
this.mEUt = 0;
this.mMaxProgresstime = 0;
@@ -351,7 +353,8 @@ extends GregtechMeta_MultiBlockBase {
return false;
}
- if (!this.canBufferOutputs(tRecipe, aMaxParallelRecipes)) {
+ aMaxParallelRecipes = this.canBufferOutputs(tRecipe, aMaxParallelRecipes);
+ if (aMaxParallelRecipes == 0) {
Logger.MACHINE_INFO("BAD RETURN - 2|"+tCircuitID);
return false;
}
@@ -479,396 +482,6 @@ extends GregtechMeta_MultiBlockBase {
return true;
}
- private FluidStack mReplicatorFluidOutput;
- //Replicator handling
- public boolean checkReplicatorRecipe(
- ItemStack[] aItemInputs, FluidStack[] aFluidInputs,
- int aMaxParallelRecipes, int aEUPercent,
- int aSpeedBonusPercent, int aOutputChanceRoll) {
-
- // 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[]{};
- this.mReplicatorOutputMap.clear();
-
- long tVoltage = getMaxInputVoltage();
- byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage));
-
- if (canBufferOutputs(aItemInputs, aMaxParallelRecipes)) {
- Logger.WARNING("BAD RETURN - 2.0");
- return false;
- }
-
- ItemStack tDataOrb = null;
- ItemStack tCellStack = null;
- ItemStack tReplicatedItem;
- FluidStack tOutputFluid = null;
- FluidStack tInputFluid = null;
- final Materials tMaterial = Element.get(Behaviour_DataOrb.getDataName(tDataOrb)).mLinkedMaterials.get(0);
- final long tMass = tMaterial.getMass();
-
- // Find First Data Orb with Scan Data
- for (ItemStack I : aItemInputs) {
- if (ItemList.Tool_DataOrb.isStackEqual((Object) I, false, true) && Behaviour_DataOrb.getDataTitle(I).equals("Elemental-Scan")) {
- tDataOrb = I.copy();
- break;
- }
- }
-
- // Find First empty cell stack
- for (ItemStack I : aItemInputs) {
- if (ItemList.Cell_Empty.isStackEqual((Object) I)) {
- tCellStack = I.copy();
- break;
- }
- }
-
- // Find UUM
- for (FluidStack F : aFluidInputs) {
- if (F != null && F.isFluidEqual(Materials.UUMatter.getFluid(1L))) {
- final FluidStack tFluid = F;
- if (tFluid.amount >= tMass && tMass > 0L) {
- tInputFluid = tFluid;
- }
- }
- }
-
- // No Data Orb or UUM found?
- if (tDataOrb == null || tInputFluid == null) {
- return false;
- }
- // Temp Values
- int tEUt = (int) GT_Values.V[(int) this.getInputTier()];
- int tMaxProgresstime = (int) (tMass * 512L / (1 << tTier - 1));
- float tRecipeEUt = (tEUt * aEUPercent) / 100.0f;
- float tTotalEUt = 0.0f;
- int parallelRecipes = 0;
- ItemStack[] expectedInputs = {tDataOrb};
- FluidStack[] expectedFluidInputs = {Materials.UUMatter.getFluid(tMass)};
-
- /**
- * Magic
- */
-
- int COST_UUM = 0;
- int COST_CELLS = 0;
-
- // Determine Output Item & Cost.
- if ((tReplicatedItem = GT_OreDictUnificator.get(OrePrefixes.dust, (Object) tMaterial, 1L)) == null) {
- if ((tReplicatedItem = GT_OreDictUnificator.get(OrePrefixes.cell, (Object) tMaterial, 1L)) != null) {
- if ((tOutputFluid = GT_Utility.getFluidForFilledItem(tReplicatedItem, true)) == null) {
- if (ItemList.Cell_Empty.isStackEqual((Object) tCellStack) && this.canBufferOutputs(new ItemStack[]{tReplicatedItem}, 1)) {
- COST_CELLS = 1;
- COST_UUM = (int) tMass;
- }
- } else {
- tReplicatedItem = null;
- if (this.getDrainableStack() == null || (this.getDrainableStack().isFluidEqual(tOutputFluid) && this.getDrainableStack().amount < 16000)) {
- COST_UUM = (int) tMass;
- }
- }
- }
- } else if (this.canBufferOutputs(new ItemStack[]{tReplicatedItem}, 1)) {
- COST_UUM = (int) tMass;
- }
-
- // Costs no UUM and no valid outputs? Let's bail gracefully before we consume inputs.
- if (COST_UUM <= 0 || (tReplicatedItem == null && tOutputFluid == null)) {
- return false;
- }
-
- // Count recipes to do in parallel, consuming input items and fluids and considering input voltage limits
- for (; parallelRecipes < aMaxParallelRecipes && tTotalEUt < (tVoltage - tRecipeEUt); parallelRecipes++) {
- if (!isRecipeInputEqual(true, aFluidInputs, aItemInputs, expectedFluidInputs, expectedInputs)) {
- Logger.WARNING("Broke at "+parallelRecipes+"..0");
- break;
- }
- Logger.WARNING("Bumped EU from "+tTotalEUt+" to "+(tTotalEUt+tRecipeEUt)+"..0");
- tTotalEUt += tRecipeEUt;
- }
-
- if (parallelRecipes == 0) {
- Logger.WARNING("BAD RETURN - 3.0");
- return false;
- }
-
- // Set Vars to Parralel amount
- COST_CELLS *= parallelRecipes;
-
- // Requires a cell? Ok, let's use some.
- if (COST_CELLS > 0) {
- this.depleteInput(ItemUtils.getEmptyCell(COST_CELLS));
- }
-
- // Build an output map, for simplicity.
- for (int r=0;r<parallelRecipes;r++) {
- this.mReplicatorOutputMap.put(ItemUtils.getSimpleStack(tReplicatedItem, 1));
- }
-
- // -- Try not to fail after this point - inputs have already been consumed! --
- ItemStack[] mBuiltOutput = new ItemStack[this.mReplicatorOutputMap.size()];
- int aIndex = 0;
- for (ItemStack i : this.mReplicatorOutputMap) {
- mBuiltOutput[aIndex++] = i;
- }
-
-
- // 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)(tMaxProgresstime * tTimeFactor);
-
- this.mEUt = (int)Math.ceil(tTotalEUt);
-
- this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000);
- this.mEfficiencyIncrease = 10000;
-
- // 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;
- }
- }
-
- if (this.mEUt > 0) {
- this.mEUt = (-this.mEUt);
- }
-
- this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime);
-
- // Collect output item types
- ItemStack[] tOutputItems = new ItemStack[1];
- for (int h = 0; h < 1; h++) {
- if (mBuiltOutput[h] != null) {
- tOutputItems[h] = mBuiltOutput[h].copy();
- tOutputItems[h].stackSize = 0;
- }
- }
-
- // Set output item stack sizes (taking output chance into account)
- for (int f = 0; f < tOutputItems.length; f++) {
- if (mBuiltOutput[f] != null && tOutputItems[f] != null) {
- for (int g = 0; g < parallelRecipes; g++) {
- tOutputItems[f].stackSize += mBuiltOutput[f].stackSize;
- }
- }
- }
-
- tOutputItems = removeNulls(tOutputItems);
-
- // Sanitize item stack size, splitting any stacks greater than max stack size
- List<ItemStack> splitStacks = new ArrayList<ItemStack>();
- for (ItemStack tItem : tOutputItems) {
- while (tItem.getMaxStackSize() < tItem.stackSize) {
- ItemStack tmp = tItem.copy();
- tmp.stackSize = tmp.getMaxStackSize();
- tItem.stackSize = tItem.stackSize - tItem.getMaxStackSize();
- splitStacks.add(tmp);
- }
- }
-
- if (splitStacks.size() > 0) {
- ItemStack[] tmp = new ItemStack[splitStacks.size()];
- tmp = splitStacks.toArray(tmp);
- tOutputItems = ArrayUtils.addAll(tOutputItems, tmp);
- }
-
- // Strip empty stacks
- List<ItemStack> tSList = new ArrayList<ItemStack>();
- for (ItemStack tS : tOutputItems) {
- if (tS.stackSize > 0) tSList.add(tS);
- }
- tOutputItems = tSList.toArray(new ItemStack[tSList.size()]);
-
- // Commit outputs
- this.mOutputItems = tOutputItems;
- //this.mOutputFluids = tOutputFluids;
- updateSlots();
-
- // Play sounds (GT++ addition - GT multiblocks play no sounds)
- startProcess();
-
- Logger.WARNING("GOOD RETURN - 1.0");
- return true;
- }
-
-
- //Special Space Checking
- private boolean canBufferOutputs(ItemStack[] aInputs, int aParallelRecipes) {
- // Count slots available in output buses
- ArrayList<ItemStack> tBusStacks = new ArrayList<>();
-
- int tEmptySlots = 0;
- for (final GT_MetaTileEntity_Hatch_OutputBus tBus : this.mOutputBusses) {
- if (!isValidMetaTileEntity(tBus)) {
- continue;
- }
- final IInventory tBusInv = tBus.getBaseMetaTileEntity();
- for (int i = 0; i < tBusInv.getSizeInventory(); i++) {
- if (tBus.getStackInSlot(i) == null) {
- tEmptySlots++;
- }
- else {
- tBusStacks.add(tBus.getStackInSlot(i));
- }
- }
- }
-
- int slotsNeeded = aInputs.length;
- for (final ItemStack tRecipeOutput: aInputs) {
- if (tRecipeOutput == null) continue;
- int amount = tRecipeOutput.stackSize * aParallelRecipes;
- for (final ItemStack tBusStack : tBusStacks) {
- if (GT_Utility.areStacksEqual(tBusStack, tRecipeOutput)) {
- if (tBusStack.stackSize + amount <= tBusStack.getMaxStackSize()) {
- slotsNeeded--;
- break;
- }
- }
- }
- }
- // Enough open slots?
- if (tEmptySlots < slotsNeeded) return false;
- return true;
-
- }
-
- public FluidStack getDrainableStack() {
- return this.mReplicatorFluidOutput;
- }
-
- public FluidStack setDrainableStack(final FluidStack aFluid) {
- return this.mReplicatorFluidOutput = aFluid;
- }
-
- public boolean isRecipeInputEqual(final boolean aDecreaseStacksizeBySuccess,
- final FluidStack[] aFluidInputs,
- final ItemStack[] aInputs,
- final FluidStack[] mFluidInputs,
- final ItemStack[] mInputs) {
- return this.isRecipeInputEqual(aDecreaseStacksizeBySuccess, false, aFluidInputs, aInputs, mFluidInputs, mInputs);
- }
-
- public boolean isRecipeInputEqual(
- final boolean aDecreaseStacksizeBySuccess,
- final boolean aDontCheckStackSizes,
- final FluidStack[] aFluidInputs,
- final ItemStack[] aInputs,
- final FluidStack[] aExpectedFluidInputs,
- final ItemStack[] mExpectedInputs) {
- if (aExpectedFluidInputs.length > 0 && aFluidInputs == null) {
- return false;
- }
- for (final FluidStack tFluid : aExpectedFluidInputs) {
- if (tFluid != null) {
- boolean temp = true;
- int amt = tFluid.amount;
- for (final FluidStack aFluid : aFluidInputs) {
- if (aFluid != null && aFluid.isFluidEqual(tFluid)) {
- if (aDontCheckStackSizes) {
- temp = false;
- break;
- }
- amt -= aFluid.amount;
- if (amt < 1) {
- temp = false;
- break;
- }
- }
- }
- if (temp) {
- return false;
- }
- }
- }
- if (mExpectedInputs.length > 0 && aInputs == null) {
- return false;
- }
- for (final ItemStack tStack : mExpectedInputs) {
- if (tStack != null) {
- int amt = tStack.stackSize;
- boolean temp = true;
- for (final ItemStack aStack : aInputs) {
- if (GT_Utility.areUnificationsEqual(aStack, tStack, true)
- || GT_Utility.areUnificationsEqual(GT_OreDictUnificator.get(false, aStack), tStack, true)) {
- if (aDontCheckStackSizes) {
- temp = false;
- break;
- }
- amt -= aStack.stackSize;
- if (amt < 1) {
- temp = false;
- break;
- }
- }
- }
- if (temp) {
- return false;
- }
- }
- }
- if (aDecreaseStacksizeBySuccess) {
- if (aFluidInputs != null) {
- for (final FluidStack tFluid : aExpectedFluidInputs) {
- if (tFluid != null) {
- int amt = tFluid.amount;
- for (final FluidStack aFluid2 : aFluidInputs) {
- if (aFluid2 != null && aFluid2.isFluidEqual(tFluid)) {
- if (aDontCheckStackSizes) {
- final FluidStack fluidStack = aFluid2;
- fluidStack.amount -= amt;
- break;
- }
- if (aFluid2.amount >= amt) {
- final FluidStack fluidStack2 = aFluid2;
- fluidStack2.amount -= amt;
- amt = 0;
- break;
- }
- amt -= aFluid2.amount;
- aFluid2.amount = 0;
- }
- }
- }
- }
- }
- if (aInputs != null) {
- for (final ItemStack tStack : mExpectedInputs) {
- if (tStack != null) {
- int amt = tStack.stackSize;
- for (final ItemStack aStack2 : aInputs) {
- if (GT_Utility.areUnificationsEqual(aStack2, tStack, true) || GT_Utility
- .areUnificationsEqual(GT_OreDictUnificator.get(false, aStack2), tStack, true)) {
- if (aDontCheckStackSizes) {
- final ItemStack itemStack = aStack2;
- itemStack.stackSize -= amt;
- break;
- }
- if (aStack2.stackSize >= amt) {
- final ItemStack itemStack2 = aStack2;
- itemStack2.stackSize -= amt;
- amt = 0;
- break;
- }
- amt -= aStack2.stackSize;
- aStack2.stackSize = 0;
- }
- }
- }
- }
- }
- }
- return true;
- }
-
@Override
public void onModeChangeByScrewdriver(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
if (mInternalMode < 2) {
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 8c62937bae..c99a6e286b 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
@@ -53,8 +53,6 @@ extends GregtechMeta_MultiBlockBase {
"Controller (Center Bottom)",
"1x Input Bus (Any top or bottom edge casing)",
"4x Output Bus (Any top or bottom edge casing)",
- "1x Maintenance Hatch (Any top or bottom edge casing)",
- "1x Muffler Hatch (Any top or bottom edge casing)",
"1x Energy Hatch (Any top or bottom edge casing)",
"18x Sieve Grate (Top and Middle 3x3)",
"Sieve Casings for the rest (35 min)"
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 ce1fe57e63..ca6eeda207 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
@@ -56,13 +56,14 @@ extends GregtechMeta_MultiBlockBase {
"Can be configured with a screwdriver to also process Chemical Bathing",
"400% faster than using single block machines of the same voltage",
"Processes four item per voltage tier",
+ "Always requires an Input Hatch full of water to refill structure",
"Size: 5x3x7 [WxHxL] (open)",
"X X",
"X X",
"XXXXX",
"Controller (front centered)",
"1x Input Bus (Any casing)",
- "1x Input Hatch (Any casing)",
+ "2x Input Hatch (Any casing)",
"1x Output Bus (Any casing)",
"1x Energy Hatch (Any casing)",
"Wash Plant Casings for the rest"
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 ab7fb79c4b..96a85a3d1c 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
@@ -86,7 +86,7 @@ public class GregtechMetaTileEntity_Adv_EBF extends GregtechMeta_MultiBlockBase
"Speed: 120% | Eu Usage: 90% | Parallel: 8",
"Consumes 10L of " + mHotFuelName + " per second during operation",
"Constructed exactly the same as a normal EBF",
- "Use "+mCasingName+"s (10 at least!)",
+ "Use "+mCasingName+"s (9 at least!)",
"1x " + mHatchName + " (Required)",
"TAG_HIDE_HATCHES"
};
@@ -152,9 +152,14 @@ public class GregtechMetaTileEntity_Adv_EBF extends GregtechMeta_MultiBlockBase
Block tUsedBlock = aBaseMetaTileEntity.getBlockOffset(xDir + 1, 2, zDir);
byte tUsedMeta = aBaseMetaTileEntity.getMetaIDOffset(xDir + 1, 2, zDir);
this.mHeatingCapacity = StaticFields59.getHeatingCapacityForCoil(tUsedBlock, tUsedMeta);
+
+ int aCasingCount = 0;
for (int i = -1; i < 2; i++) {
for (int j = -1; j < 2; j++) {
+
+
+
if ((i != 0) || (j != 0)) {
//Coils 1
if (!isValidBlockForStructure(null, CASING_TEXTURE_ID, false, aBaseMetaTileEntity.getBlockOffset(xDir + i, 1, zDir + j), (int) aBaseMetaTileEntity.getMetaIDOffset(xDir + i, 1, zDir + j), StaticFields59.getBlockCasings5(), tUsedMeta)) {
@@ -170,8 +175,15 @@ public class GregtechMetaTileEntity_Adv_EBF extends GregtechMeta_MultiBlockBase
}
//Top Layer
+
+ Block aCurrentBlock = aBaseMetaTileEntity.getBlockOffset(xDir + i, 3, zDir + j);
+ int aCurrentMeta = (int) aBaseMetaTileEntity.getMetaIDOffset(xDir + i, 3, zDir + j);
+ if (aCurrentBlock == ModBlocks.blockCasings3Misc && aCurrentMeta == 11) {
+ aCasingCount++;
+ }
+
final IGregTechTileEntity tTileEntity2 = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, 3, zDir + j);
- if (!isValidBlockForStructure(tTileEntity2, CASING_TEXTURE_ID, true, aBaseMetaTileEntity.getBlockOffset(xDir + i, 3, zDir + j), (int) aBaseMetaTileEntity.getMetaIDOffset(xDir + i, 3, zDir + j), ModBlocks.blockCasings3Misc, 11)) {
+ if (!isValidBlockForStructure(tTileEntity2, CASING_TEXTURE_ID, true, aCurrentBlock, aCurrentMeta, ModBlocks.blockCasings3Misc, 11)) {
Logger.INFO("Top Layer missing.");
return false;
}
@@ -179,9 +191,16 @@ public class GregtechMetaTileEntity_Adv_EBF extends GregtechMeta_MultiBlockBase
}
for (int i = -1; i < 2; i++) {
for (int j = -1; j < 2; j++) {
+
+
+ Block aCurrentBlock = aBaseMetaTileEntity.getBlockOffset(xDir + i, 0, zDir + j);
+ int aCurrentMeta = (int) aBaseMetaTileEntity.getMetaIDOffset(xDir + i, 0, zDir + j);
+ if (aCurrentBlock == ModBlocks.blockCasings3Misc && aCurrentMeta == 11) {
+ aCasingCount++;
+ }
if ((xDir + i != 0) || (zDir + j != 0)) {
IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, 0,zDir + j);
- if (!isValidBlockForStructure(tTileEntity, CASING_TEXTURE_ID, true, aBaseMetaTileEntity.getBlockOffset(xDir + i, 0, zDir + j), (int) aBaseMetaTileEntity.getMetaIDOffset(xDir + i, 0, zDir + j), ModBlocks.blockCasings3Misc, 11)) {
+ if (!isValidBlockForStructure(tTileEntity, CASING_TEXTURE_ID, true, aCurrentBlock, aCurrentMeta, ModBlocks.blockCasings3Misc, 11)) {
Logger.INFO("Bottom Layer missing.");
return false;
}
@@ -189,8 +208,7 @@ public class GregtechMetaTileEntity_Adv_EBF extends GregtechMeta_MultiBlockBase
}
}
- // TODO - Fix Casing Count
- return true;
+ return aCasingCount >= 9;
}
public int getMaxEfficiency(ItemStack aStack) {
@@ -282,7 +300,8 @@ public class GregtechMetaTileEntity_Adv_EBF extends GregtechMeta_MultiBlockBase
return false;
}
- if (!this.canBufferOutputs(tRecipe, aMaxParallelRecipes)) {
+ aMaxParallelRecipes = this.canBufferOutputs(tRecipe, aMaxParallelRecipes);
+ if (aMaxParallelRecipes == 0) {
Logger.WARNING("BAD RETURN - 2");
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 c31a7c0758..9754eebbb8 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
@@ -33,6 +33,7 @@ import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.Gregtech
import gtPlusPlus.xmod.gregtech.common.helpers.CraftingHelper;
import gtPlusPlus.xmod.gregtech.common.helpers.autocrafter.AC_Helper_Utils;
import net.minecraftforge.common.util.ForgeDirection;
+import net.minecraftforge.fluids.FluidStack;
public class GT4Entity_AutoCrafter extends GregtechMeta_MultiBlockBase {
@@ -223,7 +224,10 @@ public class GT4Entity_AutoCrafter extends GregtechMeta_MultiBlockBase {
}
} catch (IllegalArgumentException | IllegalAccessException e) {
}
- }
+ }
+ else if (this.mMachineMode == MODE.DISASSEMBLY) {
+ return null;
+ }
return GT_Recipe.GT_Recipe_Map.sAssemblerRecipes;
}
@@ -266,20 +270,53 @@ public class GT4Entity_AutoCrafter extends GregtechMeta_MultiBlockBase {
}
}
+// @Override
+// public boolean checkRecipe(final ItemStack aStack) {
+//
+// final long tVoltage = this.getMaxInputVoltage();
+// final byte tTier = this.mTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage));
+//
+// if (mMachineMode == MODE.DISASSEMBLY) {
+// return doDisassembly();
+// } else if (mMachineMode == MODE.CRAFTING) {
+// return doCrafting(aStack);
+// } else {
+// return super.checkRecipeGeneric(getMaxParallelRecipes(), 100, 200);
+// }
+// }
+
@Override
public boolean checkRecipe(final ItemStack aStack) {
-
- final long tVoltage = this.getMaxInputVoltage();
- final byte tTier = this.mTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage));
-
if (mMachineMode == MODE.DISASSEMBLY) {
return doDisassembly();
} else if (mMachineMode == MODE.CRAFTING) {
return doCrafting(aStack);
} else {
- return super.checkRecipeGeneric(getMaxParallelRecipes(), 100, 200);
+ ArrayList<FluidStack> tFluids = getStoredFluids();
+ //Logger.MACHINE_INFO("1");
+ for (GT_MetaTileEntity_Hatch_InputBus tBus : mInputBusses) {
+ ArrayList<ItemStack> tBusItems = new ArrayList<ItemStack>();
+ tBus.mRecipeMap = getRecipeMap();
+ //Logger.MACHINE_INFO("2");
+ if (isValidMetaTileEntity(tBus)) {
+ //Logger.MACHINE_INFO("3");
+ for (int i = tBus.getBaseMetaTileEntity().getSizeInventory() - 1; i >= 0; i--) {
+ if (tBus.getBaseMetaTileEntity().getStackInSlot(i) != null)
+ tBusItems.add(tBus.getBaseMetaTileEntity().getStackInSlot(i));
+ }
+ }
+
+ Object[] tempArray = tFluids.toArray(new FluidStack[] {});
+ FluidStack[] properArray;
+ properArray = ((tempArray != null && tempArray.length > 0) ? (FluidStack[]) tempArray : new FluidStack[] {});
+
+ //Logger.MACHINE_INFO("4");
+ if (checkRecipeGeneric(tBusItems.toArray(new ItemStack[]{}), properArray,
+ getMaxParallelRecipes(), 100, 200, 10000)) return true;
+ }
+ return false;
}
- }
+ }
@Override
public int getMaxParallelRecipes() {
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_LargeNaqReactor.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_LargeNaqReactor.java
index 89bb00f64d..1d3591731a 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_LargeNaqReactor.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_LargeNaqReactor.java
@@ -1,6 +1,5 @@
package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production;
-import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import gregtech.api.GregTech_API;
@@ -10,35 +9,45 @@ 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;
import gregtech.api.objects.GT_RenderedTexture;
import gregtech.api.util.GT_Recipe.GT_Recipe_Map;
import gregtech.api.util.GT_Utility;
+import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.block.ModBlocks;
-import gtPlusPlus.core.util.minecraft.ItemUtils;
+import gtPlusPlus.core.util.minecraft.LangUtils;
+import gtPlusPlus.core.util.minecraft.PlayerUtils;
import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Naquadah;
import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase;
import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock;
-import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing.advanced.GregtechMetaTileEntity_Adv_Fusion_MK4;
import net.minecraft.block.Block;
+import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
+import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack;
import net.minecraftforge.common.util.ForgeDirection;
public class GregtechMTE_LargeNaqReactor extends GregtechMeta_MultiBlockBase {
-
+
public ArrayList<GT_MetaTileEntity_Hatch_Naquadah> mNaqHatches = new ArrayList<GT_MetaTileEntity_Hatch_Naquadah>();
public static String[] mCasingName = new String[5];
- public static String mHatchName = "Naquadah Fuel Hatch";
+ public static String mHatchName = "Naquadah Fuel Hatch";
+
+ private final int CASING_TEXTURE_ID = TAE.getIndexFromPage(0, 13);
+ private final int META_BaseCasing = 0; //4
+ private final int META_ContainmentCasing = 15; //3
+ private final int META_Shielding = 13; //1
+ private final int META_PipeCasing = 1; //4
+ private final int META_IntegralCasing = 6; //0
+ private final int META_ContainmentChamberCasing = 2; //4
public GregtechMTE_LargeNaqReactor(int aID, String aName, String aNameRegional) {
super(aID, aName, aNameRegional);
- mCasingName[0] = ItemUtils.getLocalizedNameOfBlock(getCasing(4), 0);
- mCasingName[1] = ItemUtils.getLocalizedNameOfBlock(getCasing(4), 1);
- mCasingName[2] = ItemUtils.getLocalizedNameOfBlock(getCasing(4), 2);
- mCasingName[3] = ItemUtils.getLocalizedNameOfBlock(getCasing(3), 15);
- mCasingName[4] = ItemUtils.getLocalizedNameOfBlock(getCasing(3), 3);
- mHatchName = ItemUtils.getLocalizedNameOfBlock(GregTech_API.sBlockMachines, 969);
+ mCasingName[0] = LangUtils.getLocalizedNameOfBlock(getCasing(4), 0);
+ mCasingName[1] = LangUtils.getLocalizedNameOfBlock(getCasing(4), 1);
+ mCasingName[2] = LangUtils.getLocalizedNameOfBlock(getCasing(4), 2);
+ mCasingName[3] = LangUtils.getLocalizedNameOfBlock(getCasing(3), 15);
+ mCasingName[4] = LangUtils.getLocalizedNameOfBlock(getCasing(1), 13);
+ mHatchName = LangUtils.getLocalizedNameOfBlock(GregTech_API.sBlockMachines, 969);
}
public GregtechMTE_LargeNaqReactor(String aName) {
@@ -51,22 +60,22 @@ public class GregtechMTE_LargeNaqReactor extends GregtechMeta_MultiBlockBase {
public String[] getTooltip() {
if (mCasingName[0].toLowerCase().contains(".name")) {
- mCasingName[0] = ItemUtils.getLocalizedNameOfBlock(getCasing(4), 0);
+ mCasingName[0] = LangUtils.getLocalizedNameOfBlock(getCasing(4), 0);
}
if (mCasingName[1].toLowerCase().contains(".name")) {
- mCasingName[1] = ItemUtils.getLocalizedNameOfBlock(getCasing(4), 1);
+ mCasingName[1] = LangUtils.getLocalizedNameOfBlock(getCasing(4), 1);
}
if (mCasingName[2].toLowerCase().contains(".name")) {
- mCasingName[2] = ItemUtils.getLocalizedNameOfBlock(getCasing(4), 2);
+ mCasingName[2] = LangUtils.getLocalizedNameOfBlock(getCasing(4), 2);
}
if (mCasingName[3].toLowerCase().contains(".name")) {
- mCasingName[3] = ItemUtils.getLocalizedNameOfBlock(getCasing(3), 15);
+ mCasingName[3] = LangUtils.getLocalizedNameOfBlock(getCasing(3), 15);
}
if (mCasingName[4].toLowerCase().contains(".name")) {
- mCasingName[4] = ItemUtils.getLocalizedNameOfBlock(getCasing(3), 3);
+ mCasingName[4] = LangUtils.getLocalizedNameOfBlock(getCasing(1), 13);
}
if (mHatchName.toLowerCase().contains(".name")) {
- mHatchName = ItemUtils.getLocalizedNameOfBlock(GregTech_API.sBlockMachines, 969);
+ mHatchName = LangUtils.getLocalizedNameOfBlock(GregTech_API.sBlockMachines, 969);
}
return new String[]{
"Naquadah reacts violently with potassium, ",
@@ -83,18 +92,18 @@ public class GregtechMTE_LargeNaqReactor extends GregtechMeta_MultiBlockBase {
"1x " + mHatchName + " (Any bottom layer casing)",
"1x " + "Maintenance Hatch" + " (Any bottom layer side casing)",
"1x " + "Energy Hatch" + " (Any top layer casing)",
-
- };
+
+ };
}
public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex,
boolean aActive, boolean aRedstone) {
return aSide == aFacing
- ? new ITexture[]{BlockIcons.CASING_BLOCKS[TAE.getIndexFromPage(2, 3)],
+ ? new ITexture[]{BlockIcons.CASING_BLOCKS[TAE.getIndexFromPage(3, 0)],
new GT_RenderedTexture(aActive
? TexturesGtBlock.Overlay_Machine_Controller_Default_Active
- : TexturesGtBlock.Overlay_Machine_Controller_Default)}
- : new ITexture[]{BlockIcons.CASING_BLOCKS[TAE.getIndexFromPage(2, 3)]};
+ : TexturesGtBlock.Overlay_Machine_Controller_Default)}
+ : new ITexture[]{BlockIcons.CASING_BLOCKS[TAE.getIndexFromPage(3, 0)]};
}
public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
@@ -111,13 +120,13 @@ public class GregtechMTE_LargeNaqReactor extends GregtechMeta_MultiBlockBase {
}
public boolean isFacingValid(byte aFacing) {
- return aFacing > 1;
+ return aFacing == 1;
}
public boolean checkRecipe(ItemStack aStack) {
return false;
}
-
+
@Override
public int getMaxParallelRecipes() {
return 1;
@@ -140,7 +149,7 @@ public class GregtechMTE_LargeNaqReactor extends GregtechMeta_MultiBlockBase {
public String getSound() {
return (String) GregTech_API.sSoundList.get(Integer.valueOf(212));
}
-
+
private Block getCasing(int casingID) {
if (casingID == 1) {
return ModBlocks.blockCasingsMisc;
@@ -155,12 +164,12 @@ public class GregtechMTE_LargeNaqReactor extends GregtechMeta_MultiBlockBase {
return ModBlocks.blockCasings4Misc;
}
else {
- return ModBlocks.blockCasingsMisc;
+ return ModBlocks.blockCasingsTieredGTPP;
}
}
-
-
-
+
+
+
//Casing3, Meta 10 - "Grate Machine Casing");
//Casing2, Meta 0 - "Solid Steel Machine Casing"
//Casing2, Meta 5 - "Assembling Line Casing"
@@ -168,185 +177,295 @@ public class GregtechMTE_LargeNaqReactor extends GregtechMeta_MultiBlockBase {
//Magic Glass - blockAlloyGlass
public boolean checkMultiblock(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
- int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX;
- int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ;
- int r;
- int i;
- IGregTechTileEntity tTileEntity;
- if (xDir != 0) {
- for (r = 0; r <= 16; ++r) {
- i = r * xDir;
- tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(0, 0, i);
- if (i != 0
- && (aBaseMetaTileEntity.getBlockOffset(0, 0, i) != getCasing(3)
- || aBaseMetaTileEntity.getMetaIDOffset(0, 0, i) != 3)
- && r == 1 && !this.addNaquadahHatchToMachineInput(tTileEntity, TAE.getIndexFromPage(2, 3))) {
- return false;
- }
-
- if (aBaseMetaTileEntity.getBlockOffset(0, -1, i) != getCasing(3) || aBaseMetaTileEntity.getMetaIDOffset(0, -1, i) != 15) {
- return false;
- }
-
- tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(0, -2, i);
- if (!this.addMaintenanceToMachineList(tTileEntity, TAE.getIndexFromPage(3, 0))
- && !this.addInputToMachineList(tTileEntity, TAE.getIndexFromPage(3, 0))) {
- if (aBaseMetaTileEntity.getBlockOffset(0, -2, i) != getCasing(4)) {
- return false;
- }
-
- if (aBaseMetaTileEntity.getMetaIDOffset(0, -2, i) != 0) {
- return false;
- }
- }
-
- tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir, 1, i);
- if (!this.addDynamoToMachineList(tTileEntity, TAE.getIndexFromPage(3, 0))) {
- if (aBaseMetaTileEntity.getBlockOffset(xDir, 1, i) != getCasing(4)) {
- return false;
- }
-
- if (aBaseMetaTileEntity.getMetaIDOffset(xDir, 1, i) != 0) {
- return false;
- }
- }
-
- if (i != 0 && (aBaseMetaTileEntity.getBlockOffset(xDir, 0, i) != getCasing(4)
- || aBaseMetaTileEntity.getMetaIDOffset(xDir, 0, i) != 1)) {
- return false;
- }
-
- if (i != 0 && (aBaseMetaTileEntity.getBlockOffset(xDir, -1, i) != getCasing(4)
- || aBaseMetaTileEntity.getMetaIDOffset(xDir, -1, i) != 2)) {
- return false;
- }
-
- if (aBaseMetaTileEntity.getBlockOffset(xDir * 2, 0, i) != getCasing(3)
- || aBaseMetaTileEntity.getMetaIDOffset(xDir * 2, 0, i) != 3) {
- return false;
- }
-
- if (aBaseMetaTileEntity.getBlockOffset(xDir * 2, -1, i) != getCasing(3) || aBaseMetaTileEntity.getMetaIDOffset(xDir * 2, -1, i) != 15) {
- return false;
- }
-
- tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir * 2, -2, i);
- if (!this.addMaintenanceToMachineList(tTileEntity, TAE.getIndexFromPage(3, 0))
- && !this.addInputToMachineList(tTileEntity, TAE.getIndexFromPage(3, 0))) {
- if (aBaseMetaTileEntity.getBlockOffset(xDir * 2, -2, i) != getCasing(4)) {
- return false;
- }
-
- if (aBaseMetaTileEntity.getMetaIDOffset(xDir * 2, -2, i) != 0) {
- return false;
- }
- }
-
- tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir, -2, i);
- if (!this.addInputToMachineList(tTileEntity, TAE.getIndexFromPage(3, 0)) && this.addOutputToMachineList(tTileEntity, TAE.getIndexFromPage(3, 0))) {
- return r > 0 && this.mEnergyHatches.size() > 0;
- }
+ int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX * 4;
+ int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ * 4;
+
+ // Counts for all Casing Types
+ int aBaseCasingCount = 0;
+ int aContainmentCasingCount = 0;
+ int aShieldingCount = 0;
+ int aPipeCount = 0;
+ int aIntegralCasingCount = 0;
+ int aContainmentChamberCount = 0;
+
+ // Bottom Layer
+ aBaseCasingCount += checkEntireLayer(aBaseMetaTileEntity, getCasing(4), META_BaseCasing, -7, xDir, zDir);
+ log("Bottom Layer is Valid. Moving to Layer 1.");
+
+ // Layer 1
+ aShieldingCount += checkOuterRing(aBaseMetaTileEntity, getCasing(1), this.META_Shielding, -6, xDir, zDir);
+ aIntegralCasingCount += checkIntegralRing(aBaseMetaTileEntity, getCasing(0), this.META_IntegralCasing, -6, xDir, zDir);
+ aContainmentChamberCount += checkContainmentRing(aBaseMetaTileEntity, getCasing(4), this.META_ContainmentChamberCasing, -6, xDir, zDir);
+ log("Layer 1 is Valid. Moving to Layer 2.");
+
+ // Layer 2
+ aShieldingCount += checkOuterRing(aBaseMetaTileEntity, getCasing(1), this.META_Shielding, -5, xDir, zDir);
+ aPipeCount += checkPipes(aBaseMetaTileEntity, getCasing(4), this.META_PipeCasing, -5, xDir, zDir);
+ log("Layer 2 is Valid. Moving to Layer 3.");
+
+ // Layer 3
+ aContainmentCasingCount += checkOuterRing(aBaseMetaTileEntity, getCasing(3), this.META_ContainmentCasing, -4, xDir, zDir);
+ aPipeCount += checkPipes(aBaseMetaTileEntity, getCasing(4), this.META_PipeCasing, -4, xDir, zDir);
+ log("Layer 3 is Valid. Moving to Layer 4.");
+
+ // Layer 4
+ aContainmentCasingCount += checkOuterRing(aBaseMetaTileEntity, getCasing(3), this.META_ContainmentCasing, -3, xDir, zDir);
+ aPipeCount += checkPipes(aBaseMetaTileEntity, getCasing(4), this.META_PipeCasing, -3, xDir, zDir);
+ log("Layer 4 is Valid. Moving to Layer 5.");
+
+ // Layer 5
+ aShieldingCount += checkOuterRing(aBaseMetaTileEntity, getCasing(1), this.META_Shielding, -2, xDir, zDir);
+ aPipeCount += checkPipes(aBaseMetaTileEntity, getCasing(4), this.META_PipeCasing, -2, xDir, zDir);
+ log("Layer 5 is Valid. Moving to Layer 6.");
+
+ // Layer 6
+ aShieldingCount += checkOuterRing(aBaseMetaTileEntity, getCasing(1), this.META_Shielding, -1, xDir, zDir);
+ aIntegralCasingCount += checkIntegralRing(aBaseMetaTileEntity, getCasing(0), this.META_IntegralCasing, -1, xDir, zDir);
+ aContainmentChamberCount += checkContainmentRing(aBaseMetaTileEntity, getCasing(4), this.META_ContainmentChamberCasing, -1, xDir, zDir);
+ log("Layer 6 is Valid. Moving to Top Layer.");
+
+ // Top Layer
+ aBaseCasingCount += checkEntireLayer(aBaseMetaTileEntity, getCasing(4), META_BaseCasing, 0, xDir, zDir);
+
+ log("Found "+aBaseCasingCount+" "+mCasingName[0]+"s");
+ log("Found "+aShieldingCount+" "+mCasingName[4]+"s");
+ log("Found "+aPipeCount+" "+mCasingName[1]+"s");
+ log("Found "+aContainmentCasingCount+" "+mCasingName[3]+"s");
+ log("Found "+aIntegralCasingCount+" "+LangUtils.getLocalizedNameOfBlock(getCasing(0), 6)+"s");
+ log("Found "+aContainmentChamberCount+" "+mCasingName[2]+"s");
+
+ // Try mesage player
+ String aOwnerName = this.getBaseMetaTileEntity().getOwnerName();
+ EntityPlayer aOwner = null;
+ if (aOwnerName != null && aOwnerName.length() > 0) {
+ aOwner = PlayerUtils.getPlayer(aOwnerName);
+ }
+
+ if (aShieldingCount != 128) {
+ log("Not enough "+mCasingName[4]+"s, require 128.");
+ if (aOwner != null) {
+ PlayerUtils.messagePlayer(aOwner, "Not enough "+mCasingName[4]+"s, require 128.");
+ }
+ return false;
+ }
+ if (aPipeCount != 20) {
+ log("Not enough "+mCasingName[1]+"s, require 20.");
+ if (aOwner != null) {
+ PlayerUtils.messagePlayer(aOwner, "Not enough "+mCasingName[1]+"s, require 20.");
+ }
+ return false;
+ }
+ if (aContainmentCasingCount != 64) {
+ log("Not enough "+mCasingName[3]+"s, require 64.");
+ if (aOwner != null) {
+ PlayerUtils.messagePlayer(aOwner, "Not enough "+mCasingName[3]+"s, require 64.");
+ }
+ return false;
+ }
+ if (aContainmentChamberCount != 42) {
+ log("Not enough "+mCasingName[2]+"s, require 42.");
+ if (aOwner != null) {
+ PlayerUtils.messagePlayer(aOwner, "Not enough "+mCasingName[2]+"s, require 42.");
}
+ return false;
+ }
+ if (aBaseCasingCount < 140) {
+ log("Not enough "+mCasingName[0]+"s, require 140 at a minimum.");
+ if (aOwner != null) {
+ PlayerUtils.messagePlayer(aOwner, "Not enough "+mCasingName[0]+"s, require 140 at a minimum.");
+ }
+ return false;
+ }
+ if (aIntegralCasingCount != 48) {
+ log("Not enough "+LangUtils.getLocalizedNameOfBlock(getCasing(0), 6)+"s, require 48.");
+ if (aOwner != null) {
+ PlayerUtils.messagePlayer(aOwner, "Not enough "+LangUtils.getLocalizedNameOfBlock(getCasing(0), 6)+"s, require 48.");
+ }
+ return false;
+ }
+ log("LNR Formed.");
+ if (aOwner != null) {
+ PlayerUtils.messagePlayer(aOwner, "Large Naquadah Reactor has formed successfully.");
+ }
+ return true;
+ }
+
+ public boolean addNaquadahHatchToMachineInput(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) {
+ if (aTileEntity == null) {
+ return false;
} else {
- for (r = 0; r <= 16; ++r) {
- i = r * -zDir;
- tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(i, 0, 0);
- if (i != 0
- && (aBaseMetaTileEntity.getBlockOffset(i, 0, 0) != getCasing(3)
- || aBaseMetaTileEntity.getMetaIDOffset(i, 0, 0) != 3)
- && r == 1 && !this.addNaquadahHatchToMachineInput(tTileEntity, TAE.getIndexFromPage(2, 3))) {
- return false;
- }
+ IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity();
+ if (aMetaTileEntity == null) {
+ return false;
+ } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Naquadah) {
+ this.updateTexture(aMetaTileEntity, aBaseCasingIndex);
+ return this.mNaqHatches.add((GT_MetaTileEntity_Hatch_Naquadah) aMetaTileEntity);
+ } else {
+ return false;
+ }
+ }
+ }
- if (aBaseMetaTileEntity.getBlockOffset(i, -1, 0) != getCasing(3) || aBaseMetaTileEntity.getMetaIDOffset(i, -1, 0) != 15) {
- return false;
+ public int checkEntireLayer(IGregTechTileEntity aBaseMetaTileEntity, Block aBlock, int aMeta, int aY, int xDir, int zDir) {
+ int aCasingCount = 0;
+ for (int x = -4; x < 5; x++) {
+ for (int z = -4; z < 5; z++) {
+ int aOffsetX = this.getBaseMetaTileEntity().getXCoord() + x;
+ int aOffsetY = this.getBaseMetaTileEntity().getYCoord() + aY;
+ int aOffsetZ = this.getBaseMetaTileEntity().getZCoord() + z;
+ //Skip the corners
+ if ((x == 4 && z == 4) || (x == -4 && z == -4) || (x == 4 && z == -4) || (x == -4 && z == 4)) {
+ continue;
+ }
+ // Skip controller
+ if (aY == 0 && x == 0 && z == 0) {
+ continue;
}
-
- tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(i, -2, 0);
- if (!this.addMaintenanceToMachineList(tTileEntity, TAE.getIndexFromPage(3, 0))
- && !this.addInputToMachineList(tTileEntity, TAE.getIndexFromPage(3, 0))) {
- if (aBaseMetaTileEntity.getBlockOffset(i, -2, 0) != getCasing(4)) {
- return false;
- }
-
- if (aBaseMetaTileEntity.getMetaIDOffset(i, -2, 0) != 0) {
- return false;
- }
+
+ Block aCurrentBlock = aBaseMetaTileEntity.getBlockOffset(xDir + x, aY, zDir + z);
+ int aCurrentMeta = (int) aBaseMetaTileEntity.getMetaIDOffset(xDir + x, aY, zDir + z);
+ if (aCurrentBlock == aBlock && aCurrentMeta == aMeta) {
+ aCasingCount++;
+ }
+ final IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, aY, zDir + z);
+ if (!isValidBlockForStructure(tTileEntity, CASING_TEXTURE_ID, true, aCurrentBlock, aCurrentMeta, aBlock, aMeta)) {
+ log("Layer has error. Height: "+aY);
+ //this.getBaseMetaTileEntity().getWorld().setBlock(aOffsetX, aOffsetY, aOffsetZ, aBlock, aMeta, 3);
+ return 0;
}
+ }
+ }
+ return aCasingCount;
+ }
- tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(i, 1, zDir);
- if (!this.addDynamoToMachineList(tTileEntity, TAE.getIndexFromPage(3, 0))) {
- if (aBaseMetaTileEntity.getBlockOffset(i, 1, zDir) != getCasing(4)) {
- return false;
+ public int checkOuterRing(IGregTechTileEntity aBaseMetaTileEntity, Block aBlock, int aMeta, int aY, int xDir, int zDir) {
+ int aCasingCount = 0;
+ for (int x = -4; x < 5; x++) {
+ for (int z = -4; z < 5; z++) {
+ int aOffsetX = this.getBaseMetaTileEntity().getXCoord() + x;
+ int aOffsetY = this.getBaseMetaTileEntity().getYCoord() + aY;
+ int aOffsetZ = this.getBaseMetaTileEntity().getZCoord() + z;
+ //Skip the corners
+ if ((x == 4 && z == 4) || (x == -4 && z == -4) || (x == 4 && z == -4) || (x == -4 && z == 4)) {
+ continue;
+ }
+
+ // If we are on the 5x5 ring, proceed
+ if ((x > -4 && x < 4 ) && (z > -4 && z < 4)) {
+ if ((x == 3 && z == 3) || (x == -3 && z == -3) || (x == 3 && z == -3) || (x == -3 && z == 3)) {
+ //this.getBaseMetaTileEntity().getWorld().setBlock(aOffsetX, aOffsetY, aOffsetZ, aBlock, aMeta, 3);
}
-
- if (aBaseMetaTileEntity.getMetaIDOffset(i, 1, zDir) != 0) {
- return false;
+ else {
+ continue;
}
}
- if (i != 0 && (aBaseMetaTileEntity.getBlockOffset(i, 0, zDir) != getCasing(4)
- || aBaseMetaTileEntity.getMetaIDOffset(i, 0, zDir) != 1)) {
- return false;
- }
-
- if (i != 0 && (aBaseMetaTileEntity.getBlockOffset(i, -1, zDir) != getCasing(4)
- || aBaseMetaTileEntity.getMetaIDOffset(i, -1, zDir) != 2)) {
- return false;
+ Block aCurrentBlock = aBaseMetaTileEntity.getBlockOffset(xDir + x, aY, zDir + z);
+ int aCurrentMeta = (int) aBaseMetaTileEntity.getMetaIDOffset(xDir + x, aY, zDir + z);
+ if (aCurrentBlock == aBlock && aCurrentMeta == aMeta) {
+ aCasingCount++;
+ }
+ final IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, aY, zDir + z);
+ if (!isValidBlockForStructure(tTileEntity, CASING_TEXTURE_ID, false, aCurrentBlock, aCurrentMeta, aBlock, aMeta)) {
+ log("Layer has error. Height: "+aY);
+ //this.getBaseMetaTileEntity().getWorld().setBlock(aOffsetX, aOffsetY, aOffsetZ, aBlock, aMeta, 3);
+ return 0;
}
-
- if (aBaseMetaTileEntity.getBlockOffset(i, 0, zDir * 2) != getCasing(3)
- || aBaseMetaTileEntity.getMetaIDOffset(i, 0, zDir * 2) != 3) {
- return false;
- }
-
- if (aBaseMetaTileEntity.getBlockOffset(i, -1, zDir * 2) != getCasing(3) || aBaseMetaTileEntity.getMetaIDOffset(i, -1, zDir * 2) != 15) {
- return false;
- }
-
- tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(i, -2, zDir * 2);
- if (!this.addMaintenanceToMachineList(tTileEntity, TAE.getIndexFromPage(3, 0))
- && !this.addInputToMachineList(tTileEntity, TAE.getIndexFromPage(3, 0))) {
- if (aBaseMetaTileEntity.getBlockOffset(i, -2, zDir * 2) != getCasing(4)) {
- return false;
+ }
+ }
+ return aCasingCount;
+ }
+ public int checkIntegralRing(IGregTechTileEntity aBaseMetaTileEntity, Block aBlock, int aMeta, int aY, int xDir, int zDir) {
+ int aCasingCount = 0;
+ for (int x = -3; x < 4; x++) {
+ for (int z = -3; z < 4; z++) {
+ int aOffsetX = this.getBaseMetaTileEntity().getXCoord() + x;
+ int aOffsetY = this.getBaseMetaTileEntity().getYCoord() + aY;
+ int aOffsetZ = this.getBaseMetaTileEntity().getZCoord() + z;
+ //Skip the corners
+ if ((x == 3 && z == 3) || (x == -3 && z == -3) || (x == 3 && z == -3) || (x == -3 && z == 3)) {
+ continue;
+ }
+
+ // If we are on the 5x5 ring, proceed
+ if ((x > -3 && x < 3 ) && (z > -3 && z < 3)) {
+ if ((x == 2 && z == 2) || (x == -2 && z == -2) || (x == 2 && z == -2) || (x == -2 && z == 2)) {
+ //this.getBaseMetaTileEntity().getWorld().setBlock(aOffsetX, aOffsetY, aOffsetZ, aBlock, aMeta, 3);
}
-
- if (aBaseMetaTileEntity.getMetaIDOffset(i, -2, zDir * 2) != 0) {
- return false;
+ else {
+ continue;
}
}
- tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(i, -2, zDir);
- if (!this.addInputToMachineList(tTileEntity, TAE.getIndexFromPage(3, 0)) && this.addOutputToMachineList(tTileEntity, TAE.getIndexFromPage(3, 0))) {
- return r > 0 && this.mEnergyHatches.size() > 0;
+ Block aCurrentBlock = aBaseMetaTileEntity.getBlockOffset(xDir + x, aY, zDir + z);
+ int aCurrentMeta = (int) aBaseMetaTileEntity.getMetaIDOffset(xDir + x, aY, zDir + z);
+ if (aCurrentBlock == aBlock && aCurrentMeta == aMeta) {
+ aCasingCount++;
+ }
+ final IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, aY, zDir + z);
+ if (!isValidBlockForStructure(tTileEntity, CASING_TEXTURE_ID, false, aCurrentBlock, aCurrentMeta, aBlock, aMeta)) {
+ log("Layer has error. Height: "+aY);
+ //this.getBaseMetaTileEntity().getWorld().setBlock(aOffsetX, aOffsetY, aOffsetZ, aBlock, aMeta, 3);
+ return 0;
}
- }
+ }
}
-
- return false;
+ return aCasingCount;
}
- public boolean addNaquadahHatchToMachineInput(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) {
- if (aTileEntity == null) {
- return false;
- } else {
- IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity();
- if (aMetaTileEntity == null) {
- return false;
- } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Naquadah) {
-
- try {
- GregtechMetaTileEntity_Adv_Fusion_MK4.mUpdateHatchTexture.invoke((GT_MetaTileEntity_Hatch) aMetaTileEntity, aBaseCasingIndex);
- } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
+ public int checkPipes(IGregTechTileEntity aBaseMetaTileEntity, Block aBlock, int aMeta, int aY, int xDir, int zDir) {
+ int aCasingCount = 0;
+ for (int x = -1; x < 2; x++) {
+ for (int z = -1; z < 2; z++) {
+ int aOffsetX = this.getBaseMetaTileEntity().getXCoord() + x;
+ int aOffsetY = this.getBaseMetaTileEntity().getYCoord() + aY;
+ int aOffsetZ = this.getBaseMetaTileEntity().getZCoord() + z;
+ //Skip the corners
+ if ((x == 1 && z == 1) || (x == -1 && z == -1) || (x == 1 && z == -1) || (x == -1 && z == 1) || (x == 0 && z == 0)) {
+ Block aCurrentBlock = aBaseMetaTileEntity.getBlockOffset(xDir + x, aY, zDir + z);
+ int aCurrentMeta = (int) aBaseMetaTileEntity.getMetaIDOffset(xDir + x, aY, zDir + z);
+ if (aCurrentBlock == aBlock && aCurrentMeta == aMeta) {
+ aCasingCount++;
+ }
+ final IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, aY, zDir + z);
+ if (!isValidBlockForStructure(tTileEntity, CASING_TEXTURE_ID, false, aCurrentBlock, aCurrentMeta, aBlock, aMeta)) {
+ log("Pipe has error. Height: "+aY);
+ //this.getBaseMetaTileEntity().getWorld().setBlock(aOffsetX, aOffsetY, aOffsetZ, aBlock, aMeta, 3);
+ return 0;
+ };
}
-
- //((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex);
- return this.mNaqHatches.add((GT_MetaTileEntity_Hatch_Naquadah) aMetaTileEntity);
- } else {
- return false;
- }
+ }
}
- }
+ return aCasingCount;
+ }
+
+ public int checkContainmentRing(IGregTechTileEntity aBaseMetaTileEntity, Block aBlock, int aMeta, int aY, int xDir, int zDir) {
+ int aCasingCount = 0;
+ for (int x = -2; x < 3; x++) {
+ for (int z = -2; z < 3; z++) {
+ int aOffsetX = this.getBaseMetaTileEntity().getXCoord() + x;
+ int aOffsetY = this.getBaseMetaTileEntity().getYCoord() + aY;
+ int aOffsetZ = this.getBaseMetaTileEntity().getZCoord() + z;
+ //Skip the corners
+ if ((x == 2 && z == 2) || (x == -2 && z == -2) || (x == 2 && z == -2) || (x == -2 && z == 2)) {
+ continue;
+ }
+
+ Block aCurrentBlock = aBaseMetaTileEntity.getBlockOffset(xDir + x, aY, zDir + z);
+ int aCurrentMeta = (int) aBaseMetaTileEntity.getMetaIDOffset(xDir + x, aY, zDir + z);
+ if (aCurrentBlock == aBlock && aCurrentMeta == aMeta) {
+ aCasingCount++;
+ }
+ final IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, aY, zDir + z);
+ if (!isValidBlockForStructure(tTileEntity, CASING_TEXTURE_ID, false, aCurrentBlock, aCurrentMeta, aBlock, aMeta)) {
+ log("Layer has error. Height: "+aY);
+ //this.getBaseMetaTileEntity().getWorld().setBlock(aOffsetX, aOffsetY, aOffsetZ, aBlock, aMeta, 3);
+ return 0;
+ }
+ }
+ }
+ return aCasingCount;
+ }
public int getMaxEfficiency(ItemStack aStack) {
return 10000;
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 4e5c95ad73..3592475a5c 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
@@ -2,6 +2,7 @@ package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production;
import java.util.ArrayList;
import java.util.Arrays;
+import java.util.List;
import gregtech.api.GregTech_API;
import gregtech.api.enums.TAE;
@@ -16,6 +17,7 @@ import gregtech.api.util.Recipe_GT;
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.block.ModBlocks;
import gtPlusPlus.core.recipe.common.CI;
+import gtPlusPlus.core.util.minecraft.ItemUtils;
import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase;
import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock;
import net.minecraft.item.Item;
@@ -29,7 +31,7 @@ extends GregtechMeta_MultiBlockBase {
private int mHeatingCapacity = 0;
private int mMode = 0;
private boolean isUsingControllerCircuit = false;
- private static final Item circuit = CI.getNumberedCircuit(0).getItem();
+ private static Item circuit;
public GregtechMetaTileEntity_AlloyBlastSmelter(final int aID, final String aName, final String aNameRegional) {
super(aID, aName, aNameRegional);
@@ -46,7 +48,7 @@ extends GregtechMeta_MultiBlockBase {
@Override
public String getMachineType() {
- return "Alloy Smelter";
+ return "Fluid Alloy Cooker";
}
@Override
@@ -104,6 +106,9 @@ extends GregtechMeta_MultiBlockBase {
public boolean isCorrectMachinePart(final ItemStack aStack) {
if (this.getBaseMetaTileEntity().isServerSide()) {
//Get Controller Circuit
+ if (circuit == null) {
+ circuit = CI.getNumberedCircuit(0).getItem();
+ }
if (aStack != null && aStack.getItem() == circuit) {
this.mMode = aStack.getItemDamage();
return this.isUsingControllerCircuit = true;
@@ -197,6 +202,14 @@ extends GregtechMeta_MultiBlockBase {
}
this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime);
this.mOutputFluids = new FluidStack[]{tRecipe.getFluidOutput(0)};
+ List<ItemStack> tOutPutItems = new ArrayList<ItemStack>();
+ for (ItemStack tOut : tRecipe.mOutputs) {
+ if (ItemUtils.checkForInvalidItems(tOut)) {
+ tOutPutItems.add(tOut);
+ }
+ }
+ if (tOutPutItems.size() > 0)
+ this.mOutputItems = tOutPutItems.toArray(new ItemStack[tOutPutItems.size()]);
this.updateSlots();
return true;
}
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 ed6c913e6b..6070e3604a 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
@@ -2,7 +2,6 @@ package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production;
import java.util.ArrayList;
-import gregtech.GT_Mod;
import gregtech.api.enums.Dyes;
import gregtech.api.enums.TAE;
import gregtech.api.enums.Textures;
@@ -10,7 +9,6 @@ import gregtech.api.interfaces.IIconContainer;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.MetaTileEntity;
-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_Maintenance;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Muffler;
@@ -25,7 +23,6 @@ import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.block.ModBlocks;
import gtPlusPlus.core.item.chemistry.IonParticles;
import gtPlusPlus.core.util.math.MathUtils;
-import gtPlusPlus.core.util.minecraft.gregtech.PollutionUtils;
import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase;
import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock;
import net.minecraft.block.Block;
@@ -37,8 +34,6 @@ import net.minecraftforge.fluids.FluidStack;
public class GregtechMetaTileEntity_Cyclotron extends GregtechMeta_MultiBlockBase {
- public long mEUStore;
-
public GregtechMetaTileEntity_Cyclotron(int aID, String aName, String aNameRegional, int tier) {
super(aID, aName, aNameRegional);
}
@@ -95,13 +90,11 @@ public class GregtechMetaTileEntity_Cyclotron extends GregtechMeta_MultiBlockBas
@Override
public void saveNBTData(NBTTagCompound aNBT) {
- aNBT.setLong("mEUStore", mEUStore);
super.saveNBTData(aNBT);
}
@Override
public void loadNBTData(NBTTagCompound aNBT) {
- mEUStore = aNBT.getLong("mEUStore");
super.loadNBTData(aNBT);
}
@@ -395,113 +388,6 @@ public class GregtechMetaTileEntity_Cyclotron extends GregtechMeta_MultiBlockBas
}
@Override
- public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
- if (aBaseMetaTileEntity.isServerSide()) {
- if (mEfficiency < 0)
- mEfficiency = 0;
-
- //Time Counter
- this.mTotalRunTime++;
- this.fixAllMaintenanceIssue();
-
- onRunningTick(null);
-
- boolean aFormCheck = (aTick % 100 == 0 ? checkMultiblock(aBaseMetaTileEntity, mInventory[1]) : true);
-
-
-
- if (mRunningOnLoad && aFormCheck) {
- this.mEUStore = (int) aBaseMetaTileEntity.getStoredEU();
- checkRecipe(mInventory[1]);
- }
- if (--mUpdate == 0 || --mStartUpCheck == 0) {
- mInputHatches.clear();
- mInputBusses.clear();
- mOutputHatches.clear();
- mOutputBusses.clear();
- mDynamoHatches.clear();
- mEnergyHatches.clear();
- mMufflerHatches.clear();
- mMaintenanceHatches.clear();
- mChargeHatches.clear();
- mDischargeHatches.clear();
- mControlCoreBus.clear();
- mAirIntakes.clear();
- mMultiDynamoHatches.clear();
- mMachine = aFormCheck;
- }
- if (mStartUpCheck < 0) {
- if (mMachine) {
- if (this.mEnergyHatches != null) {
- for (GT_MetaTileEntity_Hatch_Energy tHatch : mEnergyHatches)
- if (isValidMetaTileEntity(tHatch)) {
- if (aBaseMetaTileEntity.getStoredEU() + (2048*4) < maxEUStore()
- && tHatch.getBaseMetaTileEntity().decreaseStoredEnergyUnits((2048*4), false)) {
- aBaseMetaTileEntity.increaseStoredEnergyUnits((2048*4), true);
- }
- }
- }
- if (this.mEUStore <= 0 && mMaxProgresstime > 0) {
- stopMachine();
- }
- if (getRepairStatus() > 0) {
- if (mMaxProgresstime > 0) {
- this.getBaseMetaTileEntity().decreaseStoredEnergyUnits(mEUt, true);
- if (mMaxProgresstime > 0 && ++mProgresstime >= mMaxProgresstime) {
- if (mOutputItems != null)
- for (ItemStack tStack : mOutputItems) if (tStack != null) addOutput(tStack);
- if (mOutputFluids != null)
- for (FluidStack tStack : mOutputFluids) if (tStack != null) addOutput(tStack);
- mEfficiency = Math.max(0, Math.min(mEfficiency + mEfficiencyIncrease, getMaxEfficiency(mInventory[1]) - ((getIdealStatus() - getRepairStatus()) * 1000)));
- mOutputItems = null;
- mProgresstime = 0;
- mMaxProgresstime = 0;
- mEfficiencyIncrease = 0;
- if (mOutputFluids != null && mOutputFluids.length > 0) {
- try {
- GT_Mod.instance.achievements.issueAchivementHatchFluid(aBaseMetaTileEntity.getWorld().getPlayerEntityByName(aBaseMetaTileEntity.getOwnerName()), mOutputFluids[0]);
- } catch (Exception e) {
- }
- }
- this.mEUStore = (int) aBaseMetaTileEntity.getStoredEU();
- if (aBaseMetaTileEntity.isAllowedToWork())
- checkRecipe(mInventory[1]);
- }
- } else {
- if (aTick % 100 == 0 || aBaseMetaTileEntity.hasWorkJustBeenEnabled() || aBaseMetaTileEntity.hasInventoryBeenModified()) {
- turnCasingActive(mMaxProgresstime > 0);
- if (aBaseMetaTileEntity.isAllowedToWork()) {
- this.mEUStore = (int) aBaseMetaTileEntity.getStoredEU();
- if (checkRecipe(mInventory[1])) {
- if (this.mEUStore < this.mLastRecipe.mSpecialValue) {
- mMaxProgresstime = 0;
- turnCasingActive(false);
- }
- aBaseMetaTileEntity.decreaseStoredEnergyUnits(this.mLastRecipe.mSpecialValue, true);
- }
- }
- if (mMaxProgresstime <= 0)
- mEfficiency = Math.max(0, mEfficiency - 1000);
- }
- }
- } else {
- this.mLastRecipe = null;
- stopMachine();
- }
- } else {
- turnCasingActive(false);
- this.mLastRecipe = null;
- stopMachine();
- }
- }
- //doRandomMaintenanceDamage();
- aBaseMetaTileEntity.setErrorDisplayID((aBaseMetaTileEntity.getErrorDisplayID() & ~127) | (mWrench ? 0 : 1) | (mScrewdriver ? 0 : 2) | (mSoftHammer ? 0 : 4) | (mHardHammer ? 0 : 8)
- | (mSolderingTool ? 0 : 16) | (mCrowbar ? 0 : 32) | (mMachine ? 0 : 64));
- aBaseMetaTileEntity.setActive(mMaxProgresstime > 0);
- }
- }
-
- @Override
public boolean onRunningTick(ItemStack aStack) {
if (this.mOutputBusses.size() > 0) {
for (GT_MetaTileEntity_Hatch_OutputBus g : this.mOutputBusses) {
@@ -529,10 +415,9 @@ public class GregtechMetaTileEntity_Cyclotron extends GregtechMeta_MultiBlockBas
}
}
}
- }
- PollutionUtils.addPollution(getBaseMetaTileEntity(), this.getPollutionPerTick(aStack));
-
- return true;
+ }
+ this.fixAllMaintenanceIssue();
+ return super.onRunningTick(aStack);
}
@@ -570,7 +455,7 @@ public class GregtechMetaTileEntity_Cyclotron extends GregtechMeta_MultiBlockBas
return new String[]{
"COMET - Compact Cyclotron MK "+tier,
"EU Required: "+powerRequired+"EU/t",
- "Stored EU: "+mEUStore+" / "+maxEUStore()};
+ "Stored EU: "+this.getEUVar()+" / "+maxEUStore()};
}
@Override
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 031bf16b17..cb9c68b53c 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
@@ -549,7 +549,8 @@ public class GregtechMetaTileEntity_IndustrialFishingPond extends GregtechMeta_M
ItemStack[] mFishOutput = generateLoot(this.mMode);
mFishOutput = removeNulls(mFishOutput);
GT_Recipe g = new Recipe_GT(true, new ItemStack[] {}, mFishOutput, null, new int[] {}, aFluidInputs, mOutputFluids, 200, 16, 0);
- if (!this.canBufferOutputs(g, aMaxParallelRecipes)) {
+ aMaxParallelRecipes = this.canBufferOutputs(g, aMaxParallelRecipes);
+ if (aMaxParallelRecipes == 0) {
log("No Space");
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 8e3e40b3ab..af4132f5ff 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
@@ -12,6 +12,7 @@ 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;
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_Muffler;
@@ -22,6 +23,7 @@ import gregtech.api.util.Recipe_GT;
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.block.ModBlocks;
import gtPlusPlus.core.item.chemistry.RocketFuels;
+import gtPlusPlus.core.lib.LoadedMods;
import gtPlusPlus.core.material.MISC_MATERIALS;
import gtPlusPlus.core.util.minecraft.FluidUtils;
import gtPlusPlus.core.util.minecraft.ItemUtils;
@@ -52,6 +54,8 @@ public class GregtechMetaTileEntity_LargeRocketEngine extends GregtechMeta_Multi
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);
@@ -91,13 +95,13 @@ public class GregtechMetaTileEntity_LargeRocketEngine extends GregtechMeta_Multi
"Supply Rocket Fuels and 1000L(3000L boosted) of "+mLubricantName+" per hour to run",
"Supply 4L of "+mCoolantName+" per second per 2100 eu/t to boost output (optional)",
"Consumes upto 37500L of Air per second",
- "Produces between 4K and 32K eu/t depending on how much fuel is fed",
- "When producing more then 16K eu/t fuel wil be consume less efficiently (3x - 1.5x eff)",
+ "Produces as much energy as you put fuel in becomes less ",
+ "When producing more then 30K eu/t fuel wil be consume less efficiently (3x - 1.5x eff@55Keu/t)",
"Boosting will produce 3x the amount of power but will consume 3x fuel",
"Size(WxHxD): 3x3x10, Controller (front centered)",
"3x3x10 of Stable "+mCasingName+" (hollow, Min 64!)",
"8x "+mGearboxName+" inside the Hollow Casing",
- "1x Dynamo Hatch (Top Middle, Max 8)",
+ "1x Dynamo Hatch (Top Middle, Max 8) suports tectech dynamos",
"8x Air Intake Hatch (one of the Casings next to a Gear Box, top row allowed)",
"2x Input Hatch (Rocket Fuel/Booster) (one of the Casings next to a Gear Box, top row not allowed)",
"1x Maintenance Hatch (one of the Casings next to a Gear Box)",
@@ -149,21 +153,20 @@ public class GregtechMetaTileEntity_LargeRocketEngine extends GregtechMeta_Multi
@Override
public boolean checkRecipe(final ItemStack aStack) {
- if (this.mEfficiency < 0)
log(" geting air");
final ArrayList<FluidStack> tFluids = this.getStoredFluids();
FluidStack air = FluidUtils.getFluidStack("air", 1);
log(" geting air 2");
int aircount = getAir() ;
- if (aircount < euProduction/32) {
+ if (aircount < euProduction/100) {
log(" not enough air");
//log("Not Enough Air to Run "+aircount);
return false;
}
else {
log(" no boost");
- boolean hasIntakeAir = this.depleteInput(FluidUtils.getFluidStack(air, euProduction/32));
+ boolean hasIntakeAir = this.depleteInput(FluidUtils.getFluidStack(air, euProduction/100));
if (!hasIntakeAir) {
//log("Could not consume Air to run "+aircount);
freeFuelTicks = 0;
@@ -221,7 +224,7 @@ public class GregtechMetaTileEntity_LargeRocketEngine extends GregtechMeta_Multi
this.mEUt = (int) ((this.mEfficiency < 2000) ? 0 : GT_Values.V[5]<<1);
this.mProgresstime = 1;
this.mMaxProgresstime = 1;
- this.mEfficiencyIncrease = euProduction/4000;
+ this.mEfficiencyIncrease = euProduction/2000;
return true;
//log("");
}
@@ -229,7 +232,7 @@ public class GregtechMetaTileEntity_LargeRocketEngine extends GregtechMeta_Multi
} else
{
- this.mEfficiencyIncrease = euProduction/4000;
+ this.mEfficiencyIncrease = euProduction/2000;
freeFuelTicks--;
this.mEUt = (int) ((this.mEfficiency < 1000) ? 0 : GT_Values.V[5]<<1);
this.mProgresstime = 1;
@@ -259,17 +262,9 @@ public class GregtechMetaTileEntity_LargeRocketEngine extends GregtechMeta_Multi
log("amount: "+amount);
log("Value: "+value);
int energy = value * amount;
- //engine needs at leas 2A EV of fuel to waork
- if (energy < 40000){
- log("not enough fuel to work");
- return false;
- }
- //limits engine to LuV fuel consumption
- if (energy > 427500){
- amount = (int) ((double) 427500/value);
- energy = 427500;
- }
log("amount2: "+amount);
+ if (amount < 5)
+ return false;
FluidStack tLiquid = FluidUtils.getFluidStack(aFuel.mFluidInputs[0], (this.boostEu ? amount * 3 : amount));
if (!this.depleteInput(tLiquid)) {
log("could not deplete fluid");
@@ -286,8 +281,16 @@ public class GregtechMetaTileEntity_LargeRocketEngine extends GregtechMeta_Multi
public void setEUProduction(int energy){
energy /= 20;
- // 3x eff unles it gose above 16K eu/t
- double energyEfficiency = energy > 5500 ? ((double) Math.sqrt(5500)/Math.sqrt(energy) * energy) : energy;
+ double energyEfficiency;
+ if (energy > 10000) {
+ energyEfficiency = ((double) Math.cbrt(10000)/Math.cbrt(energy));
+ if (energy >= 40000)
+ energyEfficiency *= ((double) Math.cbrt(40000)/Math.cbrt(energy));
+ energyEfficiency *= energy;
+ }
+ else {
+ energyEfficiency = energy;
+ }
euProduction = (int) ((double) energyEfficiency * 1.84);
if (this.boostEu)
euProduction *= 3;
@@ -313,6 +316,10 @@ public class GregtechMetaTileEntity_LargeRocketEngine extends GregtechMeta_Multi
int tX = getBaseMetaTileEntity().getXCoord();
int tY = getBaseMetaTileEntity().getYCoord();
int tZ = getBaseMetaTileEntity().getZCoord();
+
+ this.mTecTechDynamoHatches.clear();
+ this.mAllDynamoHatches.clear();
+
final int MAX_LENGTH = 8;
for (int length=0;length<MAX_LENGTH;length++) {
if(getBaseMetaTileEntity().getBlockAtSideAndDistance(tSide, length+1) != getGearboxBlock()) {
@@ -425,8 +432,14 @@ public class GregtechMetaTileEntity_LargeRocketEngine extends GregtechMeta_Multi
this.updateTexture(tTileEntity, getCasingTextureIndex());
}
}
+
+ mAllDynamoHatches.addAll(this.mDynamoHatches);
+
+ if (LoadedMods.TecTech) {
+ mAllDynamoHatches.addAll(this.mTecTechDynamoHatches);
+ }
- if (this.mDynamoHatches.size() <= 0 || this.mDynamoHatches.isEmpty()) {
+ if (this.mAllDynamoHatches.size() <= 0 || this.mAllDynamoHatches.isEmpty()) {
log("Wrong count for Dynamos");
return false;
}
@@ -446,7 +459,85 @@ public class GregtechMetaTileEntity_LargeRocketEngine extends GregtechMeta_Multi
log("Formed Rocket Engine.");
return true;
- }
+ }
+
+ @Override
+ public boolean addEnergyOutput(long aEU) {
+ if (aEU <= 0) {
+ return true;
+ }
+ if (mAllDynamoHatches.size() > 0) {
+ return addEnergyOutputMultipleDynamos(aEU, true);
+ }
+ return false;
+ }
+
+
+ public boolean addEnergyOutputMultipleDynamos(long aEU, boolean aAllowMixedVoltageDynamos) {
+ int injected = 0;
+ long totalOutput = 0;
+ long aFirstVoltageFound = -1;
+ boolean aFoundMixedDynamos = false;
+ for (GT_MetaTileEntity_Hatch aDynamo : mAllDynamoHatches) {
+ if( aDynamo == null ) {
+ return false;
+ }
+ if (isValidMetaTileEntity(aDynamo)) {
+ long aVoltage = aDynamo.maxEUOutput();
+ long aTotal = aDynamo.maxAmperesOut() * aVoltage;
+ // Check against voltage to check when hatch mixing
+ if (aFirstVoltageFound == -1) {
+ aFirstVoltageFound = aVoltage;
+ }
+ else {
+ /**
+ * Calcualtes overclocked ness using long integers
+ * @param aEUt - recipe EUt
+ * @param aDuration - recipe Duration
+ * @param mAmperage - should be 1 ?
+ */
+ //Long time calculation
+ if (aFirstVoltageFound != aVoltage) {
+ aFoundMixedDynamos = true;
+ }
+ }
+ totalOutput += aTotal;
+ }
+ }
+
+ if (totalOutput < aEU || (aFoundMixedDynamos && !aAllowMixedVoltageDynamos)) {
+ explodeMultiblock();
+ return false;
+ }
+
+ long leftToInject;
+ //Long EUt calculation
+ long aVoltage;
+ //Isnt too low EUt check?
+ int aAmpsToInject;
+ int aRemainder;
+
+ //xEUt *= 4;//this is effect of everclocking
+ for (GT_MetaTileEntity_Hatch aDynamo : mAllDynamoHatches) {
+ if (isValidMetaTileEntity(aDynamo)) {
+ leftToInject = aEU - injected;
+ aVoltage = aDynamo.maxEUOutput();
+ aAmpsToInject = (int) (leftToInject / aVoltage);
+ aRemainder = (int) (leftToInject - (aAmpsToInject * aVoltage));
+ long powerGain;
+ for (int i = 0; i < Math.min(aDynamo.maxAmperesOut(), aAmpsToInject + 1); i++) {
+ if (i == Math.min(aDynamo.maxAmperesOut(), aAmpsToInject)){
+ powerGain = aRemainder;
+ }else{
+ powerGain = aVoltage;
+ }
+ aDynamo.getBaseMetaTileEntity().increaseStoredEnergyUnits(powerGain, false);
+ injected += powerGain;
+ }
+ }
+ }
+ return injected > 0;
+ }
public Block getCasingBlock() {
return ModBlocks.blockCasings4Misc;
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 a05ecca551..a7afaa6b56 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
@@ -232,7 +232,7 @@ public class GregtechMTE_AlgaePondBase extends GregtechMeta_MultiBlockBase {
}
public boolean checkForWater() {
-
+
// Get Facing direction
IGregTechTileEntity aBaseMetaTileEntity = this.getBaseMetaTileEntity();
int mDirectionX = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX;
@@ -340,7 +340,7 @@ public class GregtechMTE_AlgaePondBase extends GregtechMeta_MultiBlockBase {
if (aBaseMetaTileEntity.isClientSide()) {
this.mLevel = getCasingTierOnClientSide();
}
-
+
}
@Override
@@ -379,9 +379,15 @@ public class GregtechMTE_AlgaePondBase extends GregtechMeta_MultiBlockBase {
return false;
}
- if (!this.canBufferOutputs(tRecipe, aMaxParallelRecipes, false)) {
+ aMaxParallelRecipes = this.canBufferOutputs(tRecipe, aMaxParallelRecipes);
+ if (aMaxParallelRecipes == 0) {
return false;
}
+ if (tRecipe.mInputs.length > 0) {
+ for (ItemStack aInputToConsume : tRecipe.mInputs) {
+ this.depleteInput(aInputToConsume);
+ }
+ }
// -- Try not to fail after this point - inputs have already been consumed! --
@@ -475,7 +481,7 @@ public class GregtechMTE_AlgaePondBase extends GregtechMeta_MultiBlockBase {
}
return false;
}
-
+
@SideOnly(Side.CLIENT)
private final int getCasingTierOnClientSide() {
if (this == null || this.getBaseMetaTileEntity().getWorld() == null) {
@@ -497,7 +503,7 @@ public class GregtechMTE_AlgaePondBase extends GregtechMeta_MultiBlockBase {
return 0;
}
}
-
+
}
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 87f8d81bb2..60c0ade62f 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
@@ -37,6 +37,7 @@ import gtPlusPlus.core.item.chemistry.AgriculturalChem;
import gtPlusPlus.core.item.chemistry.GenericChem;
import gtPlusPlus.core.item.chemistry.general.ItemGenericChemBase;
import gtPlusPlus.core.lib.CORE;
+import gtPlusPlus.core.recipe.common.CI;
import gtPlusPlus.core.util.math.MathUtils;
import gtPlusPlus.core.util.minecraft.ItemUtils;
import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase;
@@ -51,33 +52,11 @@ import net.minecraftforge.common.util.ForgeDirection;
import net.minecraftforge.fluids.FluidStack;
public class GregtechMTE_ChemicalPlant extends GregtechMeta_MultiBlockBase {
-
+
private int mSolidCasingTier = 0;
private int mMachineCasingTier = 0;
private int mPipeCasingTier = 0;
- private int mCoilTier = 0;
-
-
- /**
- * Internal Recipe Map which holds the actual recipes, backed by the real map, shown by NEI.
- */
- private static final GT_Recipe_Map mFluidChemicalReactorRecipes = new GT_Recipe_Map(
- new HashSet<GT_Recipe>(100),
- "gt.recipe.fluidchemicaleactor",
- "Chemical Plant",
- null,
- CORE.MODID+":textures/gui/FluidReactor",
- 0,
- 0,
- 0,
- 2,
- 1,
- "Tier: ",
- 1,
- E,
- true,
- false);
-
+ private int mCoilTier = 0;
public GregtechMTE_ChemicalPlant(final int aID, final String aName, final String aNameRegional) {
super(aID, aName, aNameRegional);
@@ -173,15 +152,13 @@ public class GregtechMTE_ChemicalPlant extends GregtechMeta_MultiBlockBase {
@Override
public GT_Recipe.GT_Recipe_Map getRecipeMap() {
- if (mFluidChemicalReactorRecipes.mRecipeList.isEmpty() || mFluidChemicalReactorRecipes.mRecipeList.size() != Recipe_GT.Gregtech_Recipe_Map.sFluidChemicalReactorRecipes.mRecipeList.size()) {
- if (!mFluidChemicalReactorRecipes.mRecipeList.isEmpty()) {
- mFluidChemicalReactorRecipes.mRecipeList.clear();
- }
- for (Recipe_GT i : Recipe_GT.Gregtech_Recipe_Map.sFluidChemicalReactorRecipes.mRecipeList) {
- mFluidChemicalReactorRecipes.add(i);
- }
+ return Recipe_GT.Gregtech_Recipe_Map.sChemicalPlant_GT;
+ }
+
+ public static void generateRecipes() {
+ for (Recipe_GT i : Recipe_GT.Gregtech_Recipe_Map.sChemicalPlantRecipes.mRecipeList) {
+ Recipe_GT.Gregtech_Recipe_Map.sChemicalPlant_GT.add(i);
}
- return mFluidChemicalReactorRecipes;
}
@Override
@@ -761,7 +738,7 @@ public class GregtechMTE_ChemicalPlant extends GregtechMeta_MultiBlockBase {
public String getCustomGUIResourceName() {
return null;
}
-
+
// Same speed bonus as pyro oven
public int getSpeedBonus() {
return 50 * (this.mCoilTier - 2);
@@ -790,14 +767,14 @@ public class GregtechMTE_ChemicalPlant extends GregtechMeta_MultiBlockBase {
public boolean checkRecipe(final ItemStack aStack) {
return checkRecipeGeneric(getMaxParallelRecipes(), getEuDiscountForParallelism(), getSpeedBonus());
}
-
-
+
+
@Override
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
@@ -810,33 +787,34 @@ public class GregtechMTE_ChemicalPlant extends GregtechMeta_MultiBlockBase {
byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage));
long tEnergy = getMaxInputEnergy();
log("Running checkRecipeGeneric(0)");
-
+
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;
}
-
-
- if (!this.canBufferOutputs(tRecipe, aMaxParallelRecipes)) {
+
+
+ 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;
@@ -846,7 +824,7 @@ public class GregtechMTE_ChemicalPlant extends GregtechMeta_MultiBlockBase {
tCatalysts = new ArrayList<ItemStack>();
tMaxParrallelCatalyst = getCatalysts(aItemInputs, tCatalystRecipe, aMaxParallelRecipes,tCatalysts);
}
-
+
if (tMaxParrallelCatalyst == 0) {
log("found not enough catalists catalyst");
return false;
@@ -880,7 +858,7 @@ public class GregtechMTE_ChemicalPlant extends GregtechMeta_MultiBlockBase {
log("BAD RETURN - 3");
return false;
}
-
+
if (tCatalysts != null) {
log("damaging catalyst");
for (int j = 0;j<parallelRecipes;j++) {
@@ -896,7 +874,7 @@ public class GregtechMTE_ChemicalPlant extends GregtechMeta_MultiBlockBase {
}
// -- 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.
@@ -923,7 +901,7 @@ public class GregtechMTE_ChemicalPlant extends GregtechMeta_MultiBlockBase {
if (this.mEUt > 0) {
this.mEUt = (-this.mEUt);
}
-
+
this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime);
@@ -997,19 +975,19 @@ public class GregtechMTE_ChemicalPlant extends GregtechMeta_MultiBlockBase {
int allowedParrallel = 0;
for (final ItemStack aInput : aItemInputs) {
if (aRecipeCatalyst.isItemEqual(aInput)) {
- if (aInput.stackSize == 1) {
- int damage = getDamage(aInput) + aMaxParrallel;
- if (damage > getMaxCatalystDurability() ) {
- aOutPut.add(aInput);
- allowedParrallel += aMaxParrallel + (getMaxCatalystDurability() - damage);
- if (allowedParrallel >aMaxParrallel ) {
- return aMaxParrallel;
- }
- continue;
- }
+ if (aInput.stackSize == 1) {
+ int damage = getDamage(aInput) + aMaxParrallel;
+ if (damage > getMaxCatalystDurability() ) {
+ aOutPut.add(aInput);
+ allowedParrallel += aMaxParrallel + (getMaxCatalystDurability() - damage);
+ if (allowedParrallel >aMaxParrallel ) {
+ return aMaxParrallel;
+ }
+ continue;
}
- aOutPut.add(aInput);
- return aMaxParrallel;
+ }
+ aOutPut.add(aInput);
+ return aMaxParrallel;
}
}
return allowedParrallel;
@@ -1019,34 +997,23 @@ public class GregtechMTE_ChemicalPlant extends GregtechMeta_MultiBlockBase {
if (aItemInputs != null) {
for (final ItemStack aInput : aItemInputs) {
if (aInput != null) {
- if (aInput.isItemEqual(GenericChem.mRedCatalyst))
- return aInput;
- else if (aInput.isItemEqual(GenericChem.mYellowCatalyst))
- return aInput;
- else if (aInput.isItemEqual(GenericChem.mBlueCatalyst))
- return aInput;
- else if (aInput.isItemEqual(GenericChem.mOrangeCatalyst))
- return aInput;
- else if (aInput.isItemEqual(GenericChem.mPurpleCatalyst))
- return aInput;
- else if (aInput.isItemEqual(AgriculturalChem.mGreenCatalyst))
- return aInput;
- else if (aInput.isItemEqual(GenericChem.mBrownCatalyst))
+ if (ItemUtils.isCatalyst(aInput)) {
return aInput;
+ }
}
}
}
return null;
}
-
-
+
+
private void damageCatalyst(ItemStack aStack) {
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");
- ItemStack emptyCatalyst = ItemUtils.getSimpleStack(AgriculturalChem.mCatalystCarrier,1);
+ ItemStack emptyCatalyst = CI.getEmptyCatalyst(1);
addOutput(emptyCatalyst);
setDamage(aStack,0);
aStack.stackSize -= 1;
@@ -1059,7 +1026,7 @@ public class GregtechMTE_ChemicalPlant extends GregtechMeta_MultiBlockBase {
log("not consuming catalyst");
}
}
-
+
private int getDamage(ItemStack aStack) {
if (aStack.getTagCompound() == null || aStack.getTagCompound().hasNoTags()) {
final NBTTagCompound tagMain = new NBTTagCompound();
@@ -1071,13 +1038,13 @@ public class GregtechMTE_ChemicalPlant extends GregtechMeta_MultiBlockBase {
NBTTagCompound aNBT = aStack.getTagCompound();
return aNBT.getCompoundTag("catalyst").getInteger("Damage");
}
-
+
private void setDamage(ItemStack aStack,int aAmount) {
NBTTagCompound aNBT = aStack.getTagCompound();
aNBT = aNBT.getCompoundTag("catalyst");
aNBT.setInteger("Damage", aAmount);
}
-
+
@SideOnly(Side.CLIENT)
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 7300b3507b..9b898e34af 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
@@ -10,7 +10,6 @@ import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.MetaTileEntity;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch;
-import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy;
import gregtech.api.objects.GT_RenderedTexture;
import gregtech.api.util.GT_Utility;
import gtPlusPlus.api.objects.Logger;
@@ -47,6 +46,7 @@ public class GregtechMetaTileEntity_PowerSubStationController extends GregtechMe
private final int ENERGY_TAX = 2;
//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) {
@@ -138,12 +138,26 @@ public class GregtechMetaTileEntity_PowerSubStationController extends GregtechMe
} else if (aBlock == ModBlocks.blockCasings3Misc && aMeta == 7) {
return 8;
} else if (aBlock == ModBlocks.blockCasings3Misc && aMeta == 8) {
- return CORE.GTNH ? GT_Values.V.length : 9;
+ return 9;
} else {
return -1;
}
}
+ public static int getMaxHatchTier(int aCellTier) {
+ switch(aCellTier) {
+ case 9:
+ return CORE.GTNH ? 15 : 9;
+ default:
+ if (aCellTier < 4) {
+ return 0;
+ }
+ else {
+ return aCellTier;
+ }
+ }
+ }
+
public static final int CELL_HEIGHT_MAX = 16;
public static final int CELL_HEIGHT_MIN = 2;
@@ -153,8 +167,11 @@ public class GregtechMetaTileEntity_PowerSubStationController extends GregtechMe
final int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX * 2;
final int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ * 2;
- this.mMultiDynamoHatches.clear();
- this.mAllDynamoHatches.clear();
+ this.mTecTechDynamoHatches.clear();
+ this.mAllDynamoHatches.clear();
+
+ this.mTecTechEnergyHatches.clear();
+ this.mAllEnergyHatches.clear();
boolean tFoundCeiling = false;
int tCasingCount = 0;
@@ -246,10 +263,12 @@ public class GregtechMetaTileEntity_PowerSubStationController extends GregtechMe
/**
* TecTech Support, this allows adding Multi-Amp dynamos.
*/
+ mAllEnergyHatches.addAll(this.mEnergyHatches);
mAllDynamoHatches.addAll(this.mDynamoHatches);
if (LoadedMods.TecTech) {
- mAllDynamoHatches.addAll(this.mMultiDynamoHatches);
+ mAllDynamoHatches.addAll(this.mTecTechEnergyHatches);
+ mAllDynamoHatches.addAll(this.mTecTechDynamoHatches);
}
@@ -257,7 +276,7 @@ public class GregtechMetaTileEntity_PowerSubStationController extends GregtechMe
checkMachineProblem("Needed 1 maintenance hatch, found " + this.mMaintenanceHatches.size());
return false;
}
- if (this.mEnergyHatches.size() < 1) {
+ if (this.mAllEnergyHatches.size() < 1) {
checkMachineProblem("Needed at least 1 energy hatch, found 0");
return false;
}
@@ -269,15 +288,17 @@ public class GregtechMetaTileEntity_PowerSubStationController extends GregtechMe
// Find average EU throughput
int totalEuThroughput = 0;
int hatchCount = 0;
+
+ int aMaxHatchTier = getMaxHatchTier(tOverallCellTier);
- for (GT_MetaTileEntity_Hatch_Energy re : this.mEnergyHatches) {
+ for (GT_MetaTileEntity_Hatch re : this.mAllEnergyHatches) {
long tier = re.getOutputTier();
- if(tier > tOverallCellTier) {
- checkMachineProblem("Energy hatch (tier " + tier + ") is too strong for cells (tier " + tOverallCellTier + ")");
+ if(tier > aMaxHatchTier) {
+ checkMachineProblem("Energy hatch (tier " + tier + ") is too strong for cells (tier " + aMaxHatchTier + ")");
return false;
}
if(tier < 3) {
- checkMachineProblem("Energy hatch (tier " + tier + ") is too weak for cells (tier " + tOverallCellTier + ")");
+ checkMachineProblem("Energy hatch (tier " + tier + ") is too weak for cells (tier " + aMaxHatchTier + ")");
return false;
}
totalEuThroughput += re.maxEUInput();
@@ -286,12 +307,12 @@ public class GregtechMetaTileEntity_PowerSubStationController extends GregtechMe
for (GT_MetaTileEntity_Hatch re : this.mAllDynamoHatches) {
long tier = re.getInputTier();
- if(tier > tOverallCellTier) {
- checkMachineProblem("Dynamo hatch (tier " + tier + ") is too strong for cells (tier " + tOverallCellTier + ")");
+ if(tier > aMaxHatchTier) {
+ checkMachineProblem("Dynamo hatch (tier " + tier + ") is too strong for cells (tier " + aMaxHatchTier + ")");
return false;
}
if(tier < 3) {
- checkMachineProblem("Energy hatch (tier " + tier + ") is too weak for cells (tier " + tOverallCellTier + ")");
+ checkMachineProblem("Energy hatch (tier " + tier + ") is too weak for cells (tier " + aMaxHatchTier + ")");
return false;
}
totalEuThroughput += re.maxEUOutput();
@@ -431,6 +452,12 @@ public class GregtechMetaTileEntity_PowerSubStationController extends GregtechMe
return MathUtils.roundToClosestInt(mTax);
}
+
+ @Override
+ public void onPreTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
+ this.fixAllMaintenanceIssue();
+ }
+
@Override
public boolean onRunningTick(ItemStack aStack) {
// First, decay overcharge (0.1% of stored energy plus 1000 EU per tick)
@@ -448,7 +475,7 @@ public class GregtechMetaTileEntity_PowerSubStationController extends GregtechMe
for (GT_MetaTileEntity_Hatch_OutputBattery tHatch : this.mDischargeHatches) {
drawEnergyFromHatch(tHatch);
}
- for (GT_MetaTileEntity_Hatch_Energy tHatch : this.mEnergyHatches) {
+ for (GT_MetaTileEntity_Hatch tHatch : this.mAllEnergyHatches) {
drawEnergyFromHatch(tHatch);
}
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 86d02eae9a..4f0197c060 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GregtechMetaEnergyBuffer.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GregtechMetaEnergyBuffer.java
@@ -26,7 +26,7 @@ import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock;
public class GregtechMetaEnergyBuffer extends GregtechMetaTileEntity {
- private byte aCurrentOutputAmperage = 4;
+ protected byte aCurrentOutputAmperage = 4;
public GregtechMetaEnergyBuffer(final int aID, final String aName, final String aNameRegional, final int aTier, final String aDescription, final int aSlotCount) {
super(aID, aName, aNameRegional, aTier, aSlotCount, aDescription);
@@ -253,7 +253,7 @@ public class GregtechMetaEnergyBuffer extends GregtechMetaTileEntity {
final double c = ((double) tempStorage / this.maxEUStore()) * 100;
final double roundOff = Math.round(c * 100.00) / 100.00;
PlayerUtils.messagePlayer(playerIn, "Energy: " + GT_Utility.formatNumbers(tempStorage) + " EU at "+V[this.mTier]+"v ("+roundOff+"%)");
- PlayerUtils.messagePlayer(playerIn, "Amperage: " + GT_Utility.formatNumbers(maxAmperesIn())+"A");
+ PlayerUtils.messagePlayer(playerIn, "Amperage: " + GT_Utility.formatNumbers(maxAmperesOut())+"A");
}
//Utils.LOG_WARNING("Begin Show Energy");
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/loaders/Gregtech_Blocks.java b/src/Java/gtPlusPlus/xmod/gregtech/loaders/Gregtech_Blocks.java
index 361fadcb5a..535dfb3faa 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/loaders/Gregtech_Blocks.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/loaders/Gregtech_Blocks.java
@@ -26,7 +26,7 @@ public class Gregtech_Blocks {
ModBlocks.blockCasings3Misc = new GregtechMetaCasingBlocks3();
ModBlocks.blockCasings4Misc = new GregtechMetaCasingBlocks4();
- ModBlocks.BlockTieredCasings1 = new GregtechMetaTieredCasingBlocks1();
+ ModBlocks.blockCasingsTieredGTPP = new GregtechMetaTieredCasingBlocks1();
}
}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_AlloySmelter.java b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_AlloySmelter.java
index e2a30851aa..7754d039cf 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_AlloySmelter.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_AlloySmelter.java
@@ -29,7 +29,7 @@ public class RecipeGen_AlloySmelter extends RecipeGen_Base {
}
private void generateRecipes(final Material material){
- final int tVoltageMultiplier = material.getMeltingPointK() >= 2800 ? 60 : 15;
+ final int tVoltageMultiplier = material.vVoltageMultiplier;
@@ -40,7 +40,7 @@ public class RecipeGen_AlloySmelter extends RecipeGen_Base {
ItemList.Shape_Mold_Nugget.get(0),
material.getNugget(9),
(int) Math.max(material.getMass() * 2L, 1L),
- 2 * tVoltageMultiplier);
+ tVoltageMultiplier);
//Gears
if (ItemUtils.checkForInvalidItems(material.getIngot(1)) && ItemUtils.checkForInvalidItems(material.getGear(1)))
@@ -49,7 +49,7 @@ public class RecipeGen_AlloySmelter extends RecipeGen_Base {
ItemList.Shape_Mold_Gear.get(0),
material.getGear(1),
(int) Math.max(material.getMass() * 2L, 1L),
- 2 * tVoltageMultiplier);
+ tVoltageMultiplier);
//Ingot
if (ItemUtils.checkForInvalidItems(material.getIngot(1)) && ItemUtils.checkForInvalidItems(material.getNugget(1)))
@@ -58,7 +58,7 @@ public class RecipeGen_AlloySmelter extends RecipeGen_Base {
ItemList.Shape_Mold_Ingot.get(0),
material.getIngot(1),
(int) Math.max(material.getMass() * 2L, 1L),
- 2 * tVoltageMultiplier);
+ tVoltageMultiplier);
}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Extruder.java b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Extruder.java
index 56f65670a8..cd43d6201c 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Extruder.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Extruder.java
@@ -34,7 +34,6 @@ public class RecipeGen_Extruder extends RecipeGen_Base {
private void generateRecipes(final Material material){
- final int tVoltageMultiplier = material.getMeltingPointK() >= 2800 ? 60 : 15;
final ItemStack itemIngot = material.getIngot(1);
final ItemStack itemPlate = material.getPlate(1);
final ItemStack itemGear = material.getGear(1);
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/loaders/misc/WoodCentrifuging.java b/src/Java/gtPlusPlus/xmod/gregtech/loaders/misc/WoodCentrifuging.java
new file mode 100644
index 0000000000..2d7cd1b73b
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/loaders/misc/WoodCentrifuging.java
@@ -0,0 +1,85 @@
+package gtPlusPlus.xmod.gregtech.loaders.misc;
+
+import java.util.ArrayList;
+
+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.GT_OreDictUnificator;
+import gregtech.api.util.GT_Recipe;
+import gregtech.api.util.GT_Utility;
+import gtPlusPlus.api.objects.Logger;
+import gtPlusPlus.core.util.minecraft.ItemUtils;
+import net.minecraft.item.ItemStack;
+import net.minecraftforge.oredict.OreDictionary;
+
+public class WoodCentrifuging {
+
+ private static final ArrayList<ItemStack> aLogData;
+ private static final ArrayList<ItemStack> aRubberLogs;
+ private static final ArrayList<ItemStack> aRubberLogs2;
+
+ static {
+ aLogData = OreDictionary.getOres("logWood");
+ aRubberLogs = OreDictionary.getOres("logRubber");
+ aRubberLogs2 = OreDictionary.getOres("woodRubber");
+ }
+
+ private static boolean isNormalLog(ItemStack aStack) {
+ if (aLogData.contains(aStack) & !isRubberLog(aStack)) {
+ return true;
+ }
+ return false;
+ }
+
+ private static boolean isRubberLog(ItemStack aStack) {
+ if (aRubberLogs.contains(aStack)) {
+ return true;
+ }
+ else if (aRubberLogs2.contains(aStack)) {
+ return true;
+ }
+ return false;
+ }
+
+
+ private static boolean addCentrifugeRecipe(ItemStack aStack) {
+ if (isNormalLog(aStack)) {
+ return addNormalLogCentrifugeRecipe(aStack);
+ }
+ else if (isRubberLog(aStack)) {
+ return addRubberLogCentrifugeRecipe(aStack);
+ }
+ return false;
+ }
+
+ private static boolean addNormalLogCentrifugeRecipe(ItemStack aStack) {
+ GT_Recipe aFoundRecipe = GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.findRecipe(null, false, gregtech.api.enums.GT_Values.V[1], null, new ItemStack[]{aStack});
+ if (aFoundRecipe == null && GT_Values.RA.addCentrifugeRecipe(GT_Utility.copyAmount(1L, aStack), null, null, Materials.Methane.getGas(60L), GT_Values.NI, GT_Values.NI, GT_Values.NI, GT_Values.NI, GT_Values.NI, GT_Values.NI, null, 200, 20)) {
+ Logger.INFO("Added methane extraction for "+ItemUtils.getItemName(aStack));
+ return true;
+ }
+ return false;
+ }
+ private static boolean addRubberLogCentrifugeRecipe(ItemStack aStack) {
+ GT_Recipe aFoundRecipe = GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.findRecipe(null, false, gregtech.api.enums.GT_Values.V[1], null, new ItemStack[]{aStack});
+ if (aFoundRecipe == null && GT_Values.RA.addCentrifugeRecipe(GT_Utility.copyAmount(1L, aStack), null, null, Materials.Methane.getGas(60L), ItemList.IC2_Resin.get(1L, new Object[0]), GT_ModHandler.getIC2Item("plantBall", 1L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Carbon, 1L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Wood, 1L), null, null, new int[] { 5000, 3750, 2500, 2500 }, 200, 20)) {
+ Logger.INFO("Added rubber plant based methane extraction for "+ItemUtils.getItemName(aStack));
+ return true;
+ }
+ return false;
+ }
+
+ public static void processLogsForMethane() {
+ //Try use all woods found, fix/add methane extraction.
+ if (!aLogData.isEmpty()) {
+ Logger.INFO("Fixing Methane output of centrifuged logs.");
+ for (ItemStack stack : aLogData) {
+ addCentrifugeRecipe(stack);
+ }
+ }
+ }
+
+}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_AlgaeFarm.java b/src/Java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_AlgaeFarm.java
index 609d4e0649..1091533a52 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_AlgaeFarm.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_AlgaeFarm.java
@@ -125,70 +125,75 @@ public class RecipeLoader_AlgaeFarm {
// Create an Automap to dump contents into
AutoMap<ItemStack> aOutputMap = new AutoMap<ItemStack>();
- // Add loot relevant to tier and also add any from lower tiers.
- if (aTier >= 0) {
- aOutputMap.put(ItemUtils.getSimpleStack(AgriculturalChem.mAlgaeBiosmass, MathUtils.randInt(16, 32)));
- aOutputMap.put(ItemUtils.getSimpleStack(AgriculturalChem.mAlgaeBiosmass, MathUtils.randInt(32, 64)));
- if (MathUtils.randInt(0, 10) > 9) {
- aOutputMap.put(ItemUtils.getSimpleStack(AgriculturalChem.mGreenAlgaeBiosmass, MathUtils.randInt(8, 16)));
+ // Buff output by yielding 6-8 times more.
+ for (int i=0;i<MathUtils.randInt(4, 8);i++) {
+ // Add loot relevant to tier and also add any from lower tiers.
+ if (aTier >= 0) {
+ aOutputMap.put(ItemUtils.getSimpleStack(AgriculturalChem.mAlgaeBiosmass, MathUtils.randInt(16, 32)));
+ aOutputMap.put(ItemUtils.getSimpleStack(AgriculturalChem.mAlgaeBiosmass, MathUtils.randInt(32, 64)));
+ if (MathUtils.randInt(0, 10) > 9) {
+ aOutputMap.put(ItemUtils.getSimpleStack(AgriculturalChem.mGreenAlgaeBiosmass, MathUtils.randInt(8, 16)));
+ }
}
- }
- if (aTier >= 1) {
- aOutputMap.put(ItemUtils.getSimpleStack(AgriculturalChem.mAlgaeBiosmass, MathUtils.randInt(16, 32)));
- aOutputMap.put(ItemUtils.getSimpleStack(AgriculturalChem.mGreenAlgaeBiosmass, MathUtils.randInt(16, 32)));
- if (MathUtils.randInt(0, 10) > 9) {
- aOutputMap.put(ItemUtils.getSimpleStack(AgriculturalChem.mGreenAlgaeBiosmass, MathUtils.randInt(4, 8)));
+ if (aTier >= 1) {
+ aOutputMap.put(ItemUtils.getSimpleStack(AgriculturalChem.mAlgaeBiosmass, MathUtils.randInt(16, 32)));
+ aOutputMap.put(ItemUtils.getSimpleStack(AgriculturalChem.mGreenAlgaeBiosmass, MathUtils.randInt(16, 32)));
+ if (MathUtils.randInt(0, 10) > 9) {
+ aOutputMap.put(ItemUtils.getSimpleStack(AgriculturalChem.mGreenAlgaeBiosmass, MathUtils.randInt(4, 8)));
+ }
}
- }
- if (aTier >= 2) {
- aOutputMap.put(ItemUtils.getSimpleStack(AgriculturalChem.mGreenAlgaeBiosmass, MathUtils.randInt(8, 16)));
- aOutputMap.put(ItemUtils.getSimpleStack(AgriculturalChem.mGreenAlgaeBiosmass, MathUtils.randInt(16, 32)));
- if (MathUtils.randInt(0, 10) > 9) {
- aOutputMap.put(ItemUtils.getSimpleStack(AgriculturalChem.mGreenAlgaeBiosmass, MathUtils.randInt(4, 8)));
+ if (aTier >= 2) {
+ aOutputMap.put(ItemUtils.getSimpleStack(AgriculturalChem.mGreenAlgaeBiosmass, MathUtils.randInt(8, 16)));
+ aOutputMap.put(ItemUtils.getSimpleStack(AgriculturalChem.mGreenAlgaeBiosmass, MathUtils.randInt(16, 32)));
+ if (MathUtils.randInt(0, 10) > 9) {
+ aOutputMap.put(ItemUtils.getSimpleStack(AgriculturalChem.mGreenAlgaeBiosmass, MathUtils.randInt(4, 8)));
+ }
}
- }
- if (aTier >= 3) {
- aOutputMap.put(ItemUtils.getSimpleStack(AgriculturalChem.mGreenAlgaeBiosmass, MathUtils.randInt(16, 32)));
- aOutputMap.put(ItemUtils.getSimpleStack(AgriculturalChem.mBrownAlgaeBiosmass, MathUtils.randInt(2, 8)));
- if (MathUtils.randInt(0, 10) > 9) {
- aOutputMap.put(ItemUtils.getSimpleStack(AgriculturalChem.mBrownAlgaeBiosmass, MathUtils.randInt(8, 16)));
+ if (aTier >= 3) {
+ aOutputMap.put(ItemUtils.getSimpleStack(AgriculturalChem.mGreenAlgaeBiosmass, MathUtils.randInt(16, 32)));
+ aOutputMap.put(ItemUtils.getSimpleStack(AgriculturalChem.mBrownAlgaeBiosmass, MathUtils.randInt(2, 8)));
+ if (MathUtils.randInt(0, 10) > 9) {
+ aOutputMap.put(ItemUtils.getSimpleStack(AgriculturalChem.mBrownAlgaeBiosmass, MathUtils.randInt(8, 16)));
+ }
}
- }
- if (aTier >= 4) {
- aOutputMap.put(ItemUtils.getSimpleStack(AgriculturalChem.mBrownAlgaeBiosmass, MathUtils.randInt(16, 32)));
- aOutputMap.put(ItemUtils.getSimpleStack(AgriculturalChem.mBrownAlgaeBiosmass, MathUtils.randInt(32, 64)));
- if (MathUtils.randInt(0, 10) > 9) {
- aOutputMap.put(ItemUtils.getSimpleStack(AgriculturalChem.mGoldenBrownAlgaeBiosmass, MathUtils.randInt(4, 8)));
+ if (aTier >= 4) {
+ aOutputMap.put(ItemUtils.getSimpleStack(AgriculturalChem.mBrownAlgaeBiosmass, MathUtils.randInt(16, 32)));
+ aOutputMap.put(ItemUtils.getSimpleStack(AgriculturalChem.mBrownAlgaeBiosmass, MathUtils.randInt(32, 64)));
+ if (MathUtils.randInt(0, 10) > 9) {
+ aOutputMap.put(ItemUtils.getSimpleStack(AgriculturalChem.mGoldenBrownAlgaeBiosmass, MathUtils.randInt(4, 8)));
+ }
}
- }
- if (aTier >= 5) {
- aOutputMap.put(ItemUtils.getSimpleStack(AgriculturalChem.mBrownAlgaeBiosmass, MathUtils.randInt(16, 32)));
- aOutputMap.put(ItemUtils.getSimpleStack(AgriculturalChem.mGoldenBrownAlgaeBiosmass, MathUtils.randInt(16, 32)));
- if (MathUtils.randInt(0, 10) > 9) {
- aOutputMap.put(ItemUtils.getSimpleStack(AgriculturalChem.mRedAlgaeBiosmass, MathUtils.randInt(1, 2)));
+ if (aTier >= 5) {
+ aOutputMap.put(ItemUtils.getSimpleStack(AgriculturalChem.mBrownAlgaeBiosmass, MathUtils.randInt(16, 32)));
+ aOutputMap.put(ItemUtils.getSimpleStack(AgriculturalChem.mGoldenBrownAlgaeBiosmass, MathUtils.randInt(16, 32)));
+ if (MathUtils.randInt(0, 10) > 9) {
+ aOutputMap.put(ItemUtils.getSimpleStack(AgriculturalChem.mRedAlgaeBiosmass, MathUtils.randInt(1, 2)));
+ }
}
- }
- // Tier 6 is Highest for outputs
- if (aTier >= 6) {
- aOutputMap.put(ItemUtils.getSimpleStack(AgriculturalChem.mGoldenBrownAlgaeBiosmass, MathUtils.randInt(16, 32)));
- aOutputMap.put(ItemUtils.getSimpleStack(AgriculturalChem.mRedAlgaeBiosmass, MathUtils.randInt(8, 16)));
- if (MathUtils.randInt(0, 10) > 9) {
- aOutputMap.put(ItemUtils.getSimpleStack(AgriculturalChem.mRedAlgaeBiosmass, MathUtils.randInt(8, 16)));
+ // Tier 6 is Highest for outputs
+ if (aTier >= 6) {
+ aOutputMap.put(ItemUtils.getSimpleStack(AgriculturalChem.mGoldenBrownAlgaeBiosmass, MathUtils.randInt(16, 32)));
+ aOutputMap.put(ItemUtils.getSimpleStack(AgriculturalChem.mRedAlgaeBiosmass, MathUtils.randInt(8, 16)));
+ if (MathUtils.randInt(0, 10) > 9) {
+ aOutputMap.put(ItemUtils.getSimpleStack(AgriculturalChem.mRedAlgaeBiosmass, MathUtils.randInt(8, 16)));
+ }
}
- }
-
- // Iterate a special loop at higher tiers to provide more Red/Gold Algae.
- for (int i=0;i<(9-aTier);i++) {
- if (aTier >= (6+i)) {
- int aMulti = i + 1;
- aOutputMap.put(ItemUtils.getSimpleStack(AgriculturalChem.mGoldenBrownAlgaeBiosmass, MathUtils.randInt(4, 8*aMulti)));
- aOutputMap.put(ItemUtils.getSimpleStack(AgriculturalChem.mRedAlgaeBiosmass, MathUtils.randInt(4, 8*aMulti)));
- if (MathUtils.randInt(0, 10) > 8) {
- aOutputMap.put(ItemUtils.getSimpleStack(AgriculturalChem.mRedAlgaeBiosmass, MathUtils.randInt(8, 16*aMulti)));
+
+ // Iterate a special loop at higher tiers to provide more Red/Gold Algae.
+ for (int i2=0;i2<(9-aTier);i2++) {
+ if (aTier >= (6+i2)) {
+ int aMulti = i2 + 1;
+ aOutputMap.put(ItemUtils.getSimpleStack(AgriculturalChem.mGoldenBrownAlgaeBiosmass, MathUtils.randInt(4, 8*aMulti)));
+ aOutputMap.put(ItemUtils.getSimpleStack(AgriculturalChem.mRedAlgaeBiosmass, MathUtils.randInt(4, 8*aMulti)));
+ if (MathUtils.randInt(0, 10) > 8) {
+ aOutputMap.put(ItemUtils.getSimpleStack(AgriculturalChem.mRedAlgaeBiosmass, MathUtils.randInt(8, 16*aMulti)));
+ }
}
}
}
+
+
// Map the AutoMap contents to an Itemstack Array.
ItemStack[] aOutputs = new ItemStack[aOutputMap.size()];
for (int i=0;i<aOutputMap.size();i++) {
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/recipes/GregtechRecipeAdder.java b/src/Java/gtPlusPlus/xmod/gregtech/recipes/GregtechRecipeAdder.java
index efac0222af..bb3d93172c 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/recipes/GregtechRecipeAdder.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/recipes/GregtechRecipeAdder.java
@@ -1182,7 +1182,7 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder {
@Override
- public boolean addFluidReactorRecipe(ItemStack[] aInputs, FluidStack[] aInputFluids, ItemStack[] aOutputs, FluidStack[] aFluidOutputs, int time, long eu, int aTier) {
+ public boolean addChemicalPlantRecipe(ItemStack[] aInputs, FluidStack[] aInputFluids, ItemStack[] aOutputs, FluidStack[] aFluidOutputs, int time, long eu, int aTier) {
if (aInputs.length > 4 || aInputFluids.length > 4 || aOutputs.length > 4 || aFluidOutputs.length > 2) {
Logger.INFO("Inputs: "+ItemUtils.getArrayStackNames(aInputs));
@@ -1205,10 +1205,10 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder {
(int) eu,
aTier);
- int aSize = Recipe_GT.Gregtech_Recipe_Map.sFluidChemicalReactorRecipes.mRecipeList.size();
+ int aSize = Recipe_GT.Gregtech_Recipe_Map.sChemicalPlantRecipes.mRecipeList.size();
int aSize2 = aSize;
- Recipe_GT.Gregtech_Recipe_Map.sFluidChemicalReactorRecipes.add(aSpecialRecipe);
- aSize = Recipe_GT.Gregtech_Recipe_Map.sFluidChemicalReactorRecipes.mRecipeList.size();
+ Recipe_GT.Gregtech_Recipe_Map.sChemicalPlantRecipes.add(aSpecialRecipe);
+ aSize = Recipe_GT.Gregtech_Recipe_Map.sChemicalPlantRecipes.mRecipeList.size();
return aSize > aSize2;
}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechDehydrator.java b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechDehydrator.java
index a3aa7e5e78..eecbde9804 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechDehydrator.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechDehydrator.java
@@ -46,34 +46,34 @@ public class GregtechDehydrator {
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. ",
- Recipe_GT.Gregtech_Recipe_Map.sChemicalDehydratorRecipes, 2, 9, 10000, 2, 5, "Dehydrator.png",
+ Recipe_GT.Gregtech_Recipe_Map.sChemicalDehydratorRecipes, 2, 9, 16000, 2, 5, "Dehydrator.png",
"", false, false, 0, "UNBOXINATOR", null).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. ",
- Recipe_GT.Gregtech_Recipe_Map.sChemicalDehydratorRecipes, 2, 9, 10000, 2, 5, "Dehydrator.png",
+ Recipe_GT.Gregtech_Recipe_Map.sChemicalDehydratorRecipes, 2, 9, 32000, 2, 5, "Dehydrator.png",
"", false, false, 0, "UNBOXINATOR", null).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. ",
- Recipe_GT.Gregtech_Recipe_Map.sChemicalDehydratorRecipes, 2, 9, 10000, 2, 5, "Dehydrator.png",
+ Recipe_GT.Gregtech_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. ",
- Recipe_GT.Gregtech_Recipe_Map.sChemicalDehydratorRecipes, 2, 9, 10000, 2, 5, "Dehydrator.png", "",
+ Recipe_GT.Gregtech_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.. ",
- Recipe_GT.Gregtech_Recipe_Map.sChemicalDehydratorRecipes, 2, 9, 10000, 2, 5, "Dehydrator.png", "",
+ Recipe_GT.Gregtech_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.. ",
- Recipe_GT.Gregtech_Recipe_Map.sChemicalDehydratorRecipes, 2, 9, 10000, 2, 5, "Dehydrator.png", "",
+ Recipe_GT.Gregtech_Recipe_Map.sChemicalDehydratorRecipes, 2, 9, 64000, 2, 5, "Dehydrator.png", "",
false, false, 0, "UNBOXINATOR", null).getStackForm(1L));
//Advanced
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechEnergyBuffer.java b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechEnergyBuffer.java
index e07837c2ba..e82fade029 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechEnergyBuffer.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechEnergyBuffer.java
@@ -7,8 +7,10 @@ import gregtech.api.util.GT_ModHandler;
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.lib.CORE;
+import gtPlusPlus.core.lib.LoadedMods;
import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList;
import gtPlusPlus.xmod.gregtech.api.enums.GregtechOreDictNames;
+import gtPlusPlus.xmod.gregtech.common.tileentities.generators.GT_MetaTileEntity_RfConvertor;
import gtPlusPlus.xmod.gregtech.common.tileentities.generators.creative.GregtechMetaCreativeEnergyBuffer;
import gtPlusPlus.xmod.gregtech.common.tileentities.storage.GregtechMetaEnergyBuffer;
@@ -22,11 +24,8 @@ public class GregtechEnergyBuffer
{
if (gtPlusPlus.core.lib.LoadedMods.Gregtech){
Logger.INFO("Gregtech5u Content | Registering Energy Buffer Blocks.");
- if (CORE.ConfigSwitches.enableMachine_RocketEngines) {
- run1();
- }
+ run1();
}
-
}
private static void run1()
@@ -58,6 +57,15 @@ public class GregtechEnergyBuffer
"512V Creative Energy Buffer", 3, "", 0)
.getStackForm(1L));
+ if (LoadedMods.CoFHCore && CORE.ConfigSwitches.enableMachine_RF_Convetor) {
+ // RF Convertor Buffer Has Special ID
+ GregtechItemList.Energy_Buffer_RF_Convertor
+ .set(new GT_MetaTileEntity_RfConvertor(31022,
+ "energybuffer.rf.tier.01",
+ "RF Energy Convertor", 3, "", 0)
+ .getStackForm(1L));
+ }
+
GT_ModHandler.addCraftingRecipe(GregtechItemList.Energy_Buffer_1by1_ULV.get(1L, new Object[0]), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED, new Object[] { "WTW", "WMW", Character.valueOf('M'), ItemList.Hull_ULV, Character.valueOf('W'), OrePrefixes.wireGt08.get(Materials.Lead), Character.valueOf('T'), GregtechOreDictNames.buffer_core });
GT_ModHandler.addCraftingRecipe(GregtechItemList.Energy_Buffer_1by1_LV.get(1L, new Object[0]), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED, new Object[] { "WTW", "WMW", Character.valueOf('M'), ItemList.Hull_LV, Character.valueOf('W'), OrePrefixes.wireGt08.get(Materials.Tin), Character.valueOf('T'), GregtechOreDictNames.buffer_core });
GT_ModHandler.addCraftingRecipe(GregtechItemList.Energy_Buffer_1by1_MV.get(1L, new Object[0]), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED, new Object[] { "WTW", "WMW", Character.valueOf('M'), ItemList.Hull_MV, Character.valueOf('W'), OrePrefixes.wireGt08.get(Materials.AnyCopper), Character.valueOf('T'), GregtechOreDictNames.buffer_core });
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialAlloySmelter.java b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialAlloySmelter.java
new file mode 100644
index 0000000000..6587e3a253
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialAlloySmelter.java
@@ -0,0 +1,22 @@
+package gtPlusPlus.xmod.gregtech.registration.gregtech;
+
+import gtPlusPlus.api.objects.Logger;
+import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList;
+import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing.GregtechMetaTileEntity_IndustrialAlloySmelter;
+
+public class GregtechIndustrialAlloySmelter {
+
+ public static void run() {
+ if (gtPlusPlus.core.lib.LoadedMods.Gregtech) {
+ Logger.INFO("Gregtech5u Content | Registering Industrial Alloy Smelter Multiblock.");
+ run1();
+ }
+
+ }
+
+ private static void run1() {
+ GregtechItemList.Industrial_AlloySmelter.set(new GregtechMetaTileEntity_IndustrialAlloySmelter(31023,
+ "industrialalloysmelter.controller.tier.single", "Zyngen").getStackForm(1L));
+
+ }
+} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/xmod/ob/GliderHandler.java b/src/Java/gtPlusPlus/xmod/ob/GliderHandler.java
index 7a53572aae..a190511b02 100644
--- a/src/Java/gtPlusPlus/xmod/ob/GliderHandler.java
+++ b/src/Java/gtPlusPlus/xmod/ob/GliderHandler.java
@@ -35,15 +35,7 @@ public class GliderHandler {
return;
}
- ItemStack aItem = event.entityPlayer.getItemInUse();
- if (!ItemUtils.checkForInvalidItems(aItem)) {
- Logger.WARNING("[OpenBlocks] Item in use was invalid, trying currentlyEquipped.");
- aItem = event.entityPlayer.getCurrentEquippedItem();
- }
- if (!ItemUtils.checkForInvalidItems(aItem)) {
- Logger.WARNING("[OpenBlocks] Item in use was invalid, trying heldItem.");
- aItem = event.entityPlayer.getHeldItem();
- }
+ ItemStack aItem = PlayerUtils.getItemStackInPlayersHand(event.entityPlayer);
if (ItemUtils.checkForInvalidItems(aItem)) {
Class aItemGliderClass = ReflectionUtils.getClass("openblocks.common.item.ItemHangGlider");
if (aItemGliderClass.isInstance(aItem.getItem())) {